/* ============================================================
   Site-wide design system — shared by the Campaign Workspace and
   the Instagram Dashboard. One token set, one component library
   (prefixed `ws-` for historical reasons; kept as-is to avoid
   churn across templates/JS).
   ============================================================ */

:root {
  /* color — Meta-inspired neutrals + a confident blue accent */
  --ws-bg: #F0F2F5;
  --ws-surface: #FFFFFF;
  --ws-surface-alt: #F7F8FA;
  --ws-border: #E4E6EB;
  --ws-border-strong: #D8DADF;
  --ws-text: #1C1E21;
  --ws-text-secondary: #65676B;
  --ws-text-tertiary: #6E7276; /* darkened from #8A8D91 for WCAG AA: 4.85:1 on white (was 3.33:1, failing) — Legal Hardening v2 accessibility fix */
  --ws-accent: #1B74E4;
  --ws-accent-hover: #145DBF;
  --ws-accent-soft: #EAF2FE;
  --ws-accent-rgb: 27,116,228;
  --ws-success: #31A24C;
  --ws-success-soft: #E9F6EC;
  --ws-warning: #C77700;
  --ws-warning-soft: #FEF3E2;
  --ws-danger: #E4123F;
  --ws-danger-soft: #FDECEF;
  --ws-info: #0E7C86;
  --ws-info-soft: #E6F6F7;
  --ws-sidebar-bg: #18191A;
  --ws-sidebar-text: #B0B3B8;
  --ws-sidebar-text-active: #FFFFFF;
  --ws-sidebar-active-bg: rgba(255,255,255,.08);

  /* type */
  --ws-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  --ws-text-xs: 12px;
  --ws-text-sm: 13px;
  --ws-text-base: 14px;
  --ws-text-md: 15px;
  --ws-text-lg: 18px;
  --ws-text-xl: 22px;
  --ws-text-2xl: 32px;
  --ws-text-3xl: 38px;

  /* spacing */
  --ws-space-1: 4px;
  --ws-space-2: 8px;
  --ws-space-3: 12px;
  --ws-space-4: 16px;
  --ws-space-5: 20px;
  --ws-space-6: 24px;
  --ws-space-8: 32px;
  --ws-space-10: 40px;
  --ws-space-12: 48px;
  --ws-space-16: 64px;

  /* radius + shadow — softer, more ambient (reads more "expensive") */
  --ws-radius-sm: 8px;
  --ws-radius-md: 12px;
  --ws-radius-lg: 16px;
  --ws-radius-full: 999px;
  --ws-shadow-sm: 0 1px 2px rgba(28,30,33,.04);
  --ws-shadow-md: 0 1px 3px rgba(28,30,33,.04), 0 8px 24px rgba(28,30,33,.06);
  --ws-shadow-lg: 0 4px 12px rgba(28,30,33,.08), 0 20px 48px rgba(28,30,33,.14);

  --ws-sidebar-width: 240px;
  --ws-sidebar-collapsed-width: 72px;
  --ws-ease-spring: cubic-bezier(.34,1.56,.64,1);
}

/* ── reset / base ────────────────────────────────────────── */
.ws * { box-sizing: border-box; }
.ws a:focus-visible, .ws button:focus-visible, .ws input:focus-visible,
.ws select:focus-visible, .ws textarea:focus-visible, .ws summary:focus-visible,
.ws [tabindex]:focus-visible {
  outline: 2px solid var(--ws-accent); outline-offset: 2px; border-radius: var(--ws-radius-sm);
}
.ws .ws-input:focus-visible, .ws .ws-select:focus-visible, .ws .ws-textarea:focus-visible { outline-offset: 0; }
.ws {
  font-family: var(--ws-font);
  color: var(--ws-text);
  background: var(--ws-bg);
  font-size: var(--ws-text-base);
  line-height: 1.5;
  min-height: 100vh;
}
.ws h1, .ws h2, .ws h3, .ws h4 { margin: 0; font-weight: 600; line-height: 1.3; letter-spacing: -.01em; }
.ws h1 { font-size: var(--ws-text-2xl); letter-spacing: -.02em; }
.ws h2 { font-size: var(--ws-text-lg); }
.ws h3 { font-size: var(--ws-text-base); font-weight: 600; color: var(--ws-text); }
.ws p { margin: 0; }
.ws a { color: inherit; transition: color .12s ease; }
.ws .muted { color: var(--ws-text-secondary); font-size: var(--ws-text-sm); }
.ws .tertiary { color: var(--ws-text-tertiary); }

/* ── app shell: sidebar + main ──────────────────────────────────────────
   The sidebar is always position:fixed at the inline-start edge (the right
   in this app's dir="rtl") and never a flex item — .ws-main reserves space
   for it with a fixed margin equal to the *collapsed* width. That margin
   never changes, so expanding the sidebar on hover (Part 2) only grows its
   own box past that reserved edge as a floating overlay with a shadow; it
   never triggers layout/reflow of the content next to it ("must not
   jump"). Mobile (<900px) opts out of all of this — see the media query
   at the bottom, which is the one place sidebar behavior stays a classic
   full-width slide-in drawer instead of a collapsed icon rail. */
.ws-shell { min-height: 100vh; }

.ws-sidebar {
  width: var(--ws-sidebar-collapsed-width);
  position: fixed;
  inset-inline-start: 0;
  top: 0;
  height: 100vh;
  background: var(--ws-sidebar-bg);
  color: var(--ws-sidebar-text);
  display: flex;
  flex-direction: column;
  z-index: 40;
  transition: width .16s ease, box-shadow .16s ease;
}
.ws-sidebar:hover,
.ws-sidebar:focus-within {
  width: var(--ws-sidebar-width);
  box-shadow: var(--ws-shadow-lg);
}
.ws-sidebar-logo {
  padding: var(--ws-space-6) var(--ws-space-5);
  font-weight: 700;
  font-size: var(--ws-text-lg);
  color: var(--ws-sidebar-text-active);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: var(--ws-space-2);
  white-space: nowrap;
}
.ws-sidebar-logo .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ws-accent); display: inline-block; flex-shrink: 0; }
.ws-sidebar-nav { flex: 1; padding: var(--ws-space-2) var(--ws-space-3); display: flex; flex-direction: column; gap: 2px; }
.ws-sidebar-link {
  position: relative;
  display: flex; align-items: center; justify-content: center; gap: var(--ws-space-3);
  padding: var(--ws-space-3);
  border-radius: var(--ws-radius-md);
  color: var(--ws-sidebar-text);
  text-decoration: none;
  font-size: var(--ws-text-sm);
  font-weight: 500;
  white-space: nowrap;
  transition: background .15s ease, color .15s ease, justify-content .16s ease;
}
.ws-sidebar:hover .ws-sidebar-link,
.ws-sidebar:focus-within .ws-sidebar-link { justify-content: flex-start; }
.ws-sidebar-link::before {
  content: ''; position: absolute; inset-inline-start: -12px; top: 50%;
  width: 3px; height: 0; border-radius: var(--ws-radius-full); background: var(--ws-accent);
  transform: translateY(-50%); transition: height .15s ease;
}
.ws-sidebar-link:hover { background: var(--ws-sidebar-active-bg); color: var(--ws-sidebar-text-active); }
.ws-sidebar-link.active { background: var(--ws-sidebar-active-bg); color: var(--ws-sidebar-text-active); }
.ws-sidebar-link.active::before { height: 60%; }
.ws-sidebar-link svg { width: 18px; height: 18px; flex-shrink: 0; }

/* text labels — visible only once the rail is expanded (hover/focus) or
   on mobile (reset in the media query below), so the collapsed rail shows
   icons only without wrapping/overflowing text. */
.ws-sidebar-logo-text,
.ws-sidebar-link span,
.ws-app-switch a span {
  display: inline-block; max-width: 0; opacity: 0; overflow: hidden;
  transition: max-width .16s ease, opacity .1s ease;
}
.ws-sidebar:hover .ws-sidebar-logo-text,
.ws-sidebar:focus-within .ws-sidebar-logo-text,
.ws-sidebar:hover .ws-sidebar-link span,
.ws-sidebar:focus-within .ws-sidebar-link span,
.ws-sidebar:hover .ws-app-switch a span,
.ws-sidebar:focus-within .ws-app-switch a span {
  max-width: 200px; opacity: 1;
}

.ws-sidebar-avatar {
  width: 32px; height: 32px; border-radius: 50%; background: var(--ws-accent);
  color: white; display: flex; align-items: center; justify-content: center;
  font-size: var(--ws-text-sm); font-weight: 600; flex-shrink: 0;
}
.ws-sidebar-avatar.lg { width: 40px; height: 40px; font-size: var(--ws-text-base); }

.ws-mobile-toggle {
  display: none;
  position: fixed; top: var(--ws-space-4); inset-inline-start: var(--ws-space-4); z-index: 40;
  background: var(--ws-sidebar-bg); color: white; border: none; border-radius: var(--ws-radius-md);
  width: 40px; height: 40px; align-items: center; justify-content: center; cursor: pointer;
  box-shadow: var(--ws-shadow-md);
}
.ws-mobile-toggle svg { width: 20px; height: 20px; }
.ws-sidebar-overlay { display: none; }

.ws-main { margin-inline-start: var(--ws-sidebar-collapsed-width); min-width: 0; }
.ws-content { max-width: 1200px; margin: 0 auto; padding: var(--ws-space-8) var(--ws-space-8) var(--ws-space-16); }

/* ── account profile area (Part 3 — permanent, at the sidebar bottom) ── */
.ws-account-area { position: relative; margin: var(--ws-space-3); flex-shrink: 0; }
.ws-account-trigger {
  width: 100%; display: flex; align-items: center; justify-content: center; gap: var(--ws-space-3);
  padding: var(--ws-space-2); border-radius: var(--ws-radius-md); border: none; cursor: pointer;
  background: rgba(255,255,255,.04); color: var(--ws-sidebar-text-active); font-family: inherit;
  transition: background .12s ease, justify-content .16s ease;
}
.ws-account-trigger:hover, .ws-account-trigger[aria-expanded="true"] { background: var(--ws-sidebar-active-bg); }
.ws-sidebar:hover .ws-account-trigger,
.ws-sidebar:focus-within .ws-account-trigger { justify-content: flex-start; }
.ws-account-trigger-text {
  flex: 1; min-width: 0; text-align: start; max-width: 0; opacity: 0; overflow: hidden;
  transition: max-width .16s ease, opacity .1s ease;
}
.ws-sidebar:hover .ws-account-trigger-text,
.ws-sidebar:focus-within .ws-account-trigger-text { max-width: 160px; opacity: 1; }
.ws-account-trigger-name {
  font-size: var(--ws-text-sm); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ws-account-trigger-org {
  display: flex; align-items: center; gap: 4px; font-size: var(--ws-text-xs); color: var(--ws-sidebar-text);
  white-space: nowrap; overflow: hidden;
}
.ws-account-trigger-org-name { overflow: hidden; text-overflow: ellipsis; }
.ws-account-trigger-chevron { flex-shrink: 0; opacity: .7; max-width: 0; overflow: hidden; transition: max-width .16s ease; }
.ws-sidebar:hover .ws-account-trigger-chevron,
.ws-sidebar:focus-within .ws-account-trigger-chevron { max-width: 20px; }

.ws-account-badge {
  display: inline-block; padding: 1px 7px; border-radius: var(--ws-radius-full);
  background: rgba(27,116,228,.18); color: #8fbcf5; font-size: 10px; font-weight: 700;
}
.ws-account-badge.sm { font-size: 9px; padding: 1px 6px; }

.ws-account-drawer {
  display: none; position: absolute; bottom: calc(100% + 6px); inset-inline-start: 0;
  width: 240px; background: var(--ws-surface); color: var(--ws-text);
  border: 1px solid var(--ws-border); border-radius: var(--ws-radius-lg); box-shadow: var(--ws-shadow-lg);
  padding: var(--ws-space-3); z-index: 60;
}
.ws-account-drawer.open { display: block; }
.ws-account-drawer-header { display: flex; align-items: center; gap: var(--ws-space-3); padding-bottom: var(--ws-space-3); }
.ws-account-drawer-header-text { min-width: 0; }
.ws-account-drawer-name { font-size: var(--ws-text-sm); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ws-account-drawer-email { font-size: var(--ws-text-xs); color: var(--ws-text-secondary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ws-account-drawer-current {
  display: flex; align-items: center; gap: var(--ws-space-2); padding: var(--ws-space-2);
  border-radius: var(--ws-radius-md); background: var(--ws-surface-alt); font-size: var(--ws-text-sm);
  margin-bottom: var(--ws-space-2);
}
.ws-account-drawer-current .ws-account-badge { background: rgba(27,116,228,.12); color: var(--ws-accent); }
.ws-account-drawer-section-title {
  font-size: var(--ws-text-xs); color: var(--ws-text-tertiary); font-weight: 600;
  padding: var(--ws-space-2) var(--ws-space-1) 4px;
}
.ws-account-switch-option {
  width: 100%; display: flex; align-items: center; gap: var(--ws-space-2); text-align: start;
  padding: var(--ws-space-2); border-radius: var(--ws-radius-md); border: none; background: none;
  cursor: pointer; font-family: inherit; font-size: var(--ws-text-sm); color: var(--ws-text);
}
.ws-account-switch-option:hover { background: var(--ws-surface-alt); }
.ws-account-switch-option.active { background: rgba(27,116,228,.08); font-weight: 600; }
.ws-account-drawer-actions {
  border-top: 1px solid var(--ws-border); margin-top: var(--ws-space-2); padding-top: var(--ws-space-2);
  display: flex; flex-direction: column; gap: 2px;
}
.ws-account-drawer-actions a, .ws-account-logout {
  display: flex; align-items: center; gap: var(--ws-space-2); padding: var(--ws-space-2);
  border-radius: var(--ws-radius-md); text-decoration: none; color: var(--ws-text); font-size: var(--ws-text-sm);
  border: none; background: none; cursor: pointer; font-family: inherit; width: 100%; text-align: start;
}
.ws-account-drawer-actions a:hover, .ws-account-logout:hover { background: var(--ws-surface-alt); }
.ws-account-logout { color: var(--ws-danger); }

/* page header */
.ws-page-header {
  display: flex; align-items: flex-start; justify-content: space-between; flex-wrap: wrap;
  gap: var(--ws-space-4); margin-bottom: var(--ws-space-6);
}
.ws-breadcrumb { font-size: var(--ws-text-sm); color: var(--ws-text-secondary); margin-bottom: var(--ws-space-2); }
.ws-breadcrumb a { color: var(--ws-text-secondary); text-decoration: none; }
.ws-breadcrumb a:hover { color: var(--ws-accent); }
.ws-page-title { font-size: var(--ws-text-2xl); font-weight: 700; letter-spacing: -.02em; display: flex; align-items: center; gap: var(--ws-space-3); }
.ws-page-actions { display: flex; gap: var(--ws-space-2); flex-wrap: wrap; }

/* section anchor nav — sticky tab-look bar with scroll-spy active state */
.ws-section-nav {
  display: flex; gap: 2px; flex-wrap: nowrap; overflow-x: auto; background: var(--ws-surface);
  border: 1px solid var(--ws-border); border-radius: var(--ws-radius-md);
  padding: var(--ws-space-1); margin-bottom: var(--ws-space-6);
  position: sticky; top: var(--ws-space-4); z-index: 5; box-shadow: var(--ws-shadow-sm);
  backdrop-filter: saturate(1.4) blur(8px);
}
.ws-section-nav a {
  color: var(--ws-text-secondary); text-decoration: none; font-size: var(--ws-text-sm); font-weight: 600;
  padding: var(--ws-space-2) var(--ws-space-3); border-radius: var(--ws-radius-sm); white-space: nowrap;
  transition: background .15s ease, color .15s ease;
}
.ws-section-nav a:hover { background: var(--ws-surface-alt); color: var(--ws-text); }
.ws-section-nav a.active { background: var(--ws-accent-soft); color: var(--ws-accent); }

/* ── card ────────────────────────────────────────────────── */
.ws-card {
  background: var(--ws-surface); border: 1px solid var(--ws-border); border-radius: var(--ws-radius-lg);
  box-shadow: var(--ws-shadow-sm); padding: var(--ws-space-6); margin-bottom: var(--ws-space-6);
  scroll-margin-top: var(--ws-space-16); transition: box-shadow .18s ease;
}
.ws-card-header {
  display: flex; align-items: center; justify-content: space-between; gap: var(--ws-space-3);
  margin-bottom: var(--ws-space-5);
}
.ws-card-header h2 { display: flex; align-items: center; gap: var(--ws-space-2); }
.ws-card h3 { margin: var(--ws-space-5) 0 var(--ws-space-3); }

/* ── grid / stats ────────────────────────────────────────── */
.ws-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: var(--ws-space-4); }
.ws-stat {
  background: var(--ws-surface-alt); border: 1px solid var(--ws-border);
  border-radius: var(--ws-radius-md); padding: var(--ws-space-5); position: relative;
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.ws-stat:hover { transform: translateY(-2px); box-shadow: var(--ws-shadow-sm); border-color: var(--ws-border-strong); }
.ws-stat .n { font-size: var(--ws-text-2xl); font-weight: 700; line-height: 1.2; letter-spacing: -.02em; }
.ws-stat .l { font-size: var(--ws-text-xs); color: var(--ws-text-secondary); margin-top: var(--ws-space-1); font-weight: 500; }

/* ── badges ──────────────────────────────────────────────── */
.ws-badge {
  display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: var(--ws-radius-full);
  font-size: var(--ws-text-xs); font-weight: 600; white-space: nowrap; background: var(--ws-surface-alt); color: var(--ws-text-secondary);
}
.ws-badge.success { background: var(--ws-success-soft); color: var(--ws-success); }
.ws-badge.warning { background: var(--ws-warning-soft); color: var(--ws-warning); }
.ws-badge.danger  { background: var(--ws-danger-soft);  color: var(--ws-danger); }
.ws-badge.info    { background: var(--ws-info-soft);    color: var(--ws-info); }
.ws-badge.neutral { background: var(--ws-surface-alt);  color: var(--ws-text-secondary); border: 1px solid var(--ws-border); }
.ws-badge.sm { padding: 1px 7px; font-size: 10px; }

/* ── buttons ─────────────────────────────────────────────── */
.ws-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 38px; padding: 0 var(--ws-space-4); border-radius: var(--ws-radius-sm);
  font-family: inherit; font-size: var(--ws-text-sm); font-weight: 600; cursor: pointer;
  border: 1px solid transparent; text-decoration: none; white-space: nowrap;
  transition: background .12s ease, border-color .12s ease, opacity .12s ease,
              box-shadow .15s ease, transform .08s ease;
}
.ws-btn svg { width: 16px; height: 16px; }
.ws-btn:active:not(:disabled) { transform: scale(.97); }
.ws-btn-primary { background: var(--ws-accent); color: white; }
.ws-btn-primary:hover { background: var(--ws-accent-hover); box-shadow: 0 4px 14px rgba(var(--ws-accent-rgb),.28); }
.ws-btn-secondary { background: var(--ws-surface); color: var(--ws-text); border-color: var(--ws-border-strong); }
.ws-btn-secondary:hover { background: var(--ws-surface-alt); border-color: var(--ws-text-tertiary); }
.ws-btn-ghost { background: transparent; color: var(--ws-text-secondary); }
.ws-btn-ghost:hover { background: var(--ws-surface-alt); color: var(--ws-text); }
.ws-btn-danger { background: var(--ws-danger); color: white; }
.ws-btn-danger:hover { background: #B80E33; box-shadow: 0 4px 14px rgba(228,18,63,.25); }
.ws-btn-sm { height: 30px; padding: 0 var(--ws-space-3); font-size: var(--ws-text-xs); }
.ws-btn:disabled { opacity: .6; cursor: default; pointer-events: none; }
.ws-btn .ws-spinner { display: none; }
.ws-btn.is-loading .ws-spinner { display: inline-block; }
.ws-btn.is-loading .ws-btn-label { opacity: .7; }

.ws-spinner {
  width: 14px; height: 14px; border-radius: 50%;
  border: 2px solid rgba(255,255,255,.4); border-top-color: white;
  animation: ws-spin .6s linear infinite;
}
.ws-btn-secondary .ws-spinner, .ws-btn-ghost .ws-spinner {
  border-color: rgba(28,30,33,.2); border-top-color: var(--ws-text);
}
@keyframes ws-spin { to { transform: rotate(360deg); } }

/* ── forms ───────────────────────────────────────────────── */
.ws-field { display: flex; flex-direction: column; gap: 6px; }
.ws-field label { font-size: var(--ws-text-xs); font-weight: 600; color: var(--ws-text-secondary); }
.ws-field .req { color: var(--ws-danger); }
.ws-field .help { font-size: var(--ws-text-xs); color: var(--ws-text-tertiary); }
.ws-field .field-error { font-size: var(--ws-text-xs); color: var(--ws-danger); }

.ws-input, .ws-select, .ws-textarea {
  font-family: inherit; font-size: var(--ws-text-base); color: var(--ws-text);
  background: var(--ws-surface); border: 1px solid var(--ws-border-strong);
  border-radius: var(--ws-radius-sm); padding: 0 var(--ws-space-3); height: 40px;
  transition: border-color .12s, box-shadow .12s; width: 100%;
}
.ws-textarea { height: auto; padding: var(--ws-space-3); resize: vertical; min-height: 72px; }
.ws-input:focus, .ws-select:focus, .ws-textarea:focus {
  outline: none; border-color: var(--ws-accent); box-shadow: 0 0 0 3px var(--ws-accent-soft);
}
.ws-input.error, .ws-select.error, .ws-textarea.error { border-color: var(--ws-danger); }

.ws-form-row { display: flex; gap: var(--ws-space-4); flex-wrap: wrap; align-items: flex-end; }
.ws-form-row .ws-field { flex: 1; min-width: 160px; }
.ws-form-stack { display: flex; flex-direction: column; gap: var(--ws-space-4); }
.ws-form-stack .ws-field { width: 100%; }

/* ── tables ──────────────────────────────────────────────── */
.ws-table-wrap { overflow-x: auto; }
.ws-table { width: 100%; border-collapse: collapse; font-size: var(--ws-text-sm); }
.ws-table th {
  text-align: start; padding: var(--ws-space-3); color: var(--ws-text-secondary);
  font-weight: 600; font-size: var(--ws-text-xs); text-transform: uppercase; letter-spacing: .02em;
  border-bottom: 1px solid var(--ws-border); position: sticky; top: 0; background: var(--ws-surface);
}
.ws-table td { text-align: start; padding: var(--ws-space-3); border-bottom: 1px solid var(--ws-border); vertical-align: middle; }
.ws-table tbody tr { transition: background .15s ease; }
.ws-table tbody tr:hover { background: var(--ws-surface-alt); }
.ws-table tbody tr:last-child td { border-bottom: none; }
.ws-table-filter { margin-bottom: var(--ws-space-3); position: relative; max-width: 320px; }
.ws-table-filter svg {
  position: absolute; inset-inline-start: var(--ws-space-3); top: 50%; transform: translateY(-50%);
  width: 16px; height: 16px; color: var(--ws-text-tertiary); pointer-events: none;
}
.ws-table-filter input { padding-inline-start: var(--ws-space-8); }
.ws-table-empty-row td { text-align: center; padding: var(--ws-space-8); color: var(--ws-text-tertiary); }

/* ── empty state ─────────────────────────────────────────── */
.ws-empty { text-align: center; padding: var(--ws-space-10) var(--ws-space-4); color: var(--ws-text-tertiary); }
.ws-empty svg {
  width: 40px; height: 40px; margin-bottom: var(--ws-space-4); color: var(--ws-accent);
  padding: 14px; box-sizing: content-box; border-radius: 50%; background: var(--ws-accent-soft);
}
.ws-empty p { font-size: var(--ws-text-sm); margin-bottom: var(--ws-space-4); }
.ws-empty-inline { color: var(--ws-text-tertiary); font-size: var(--ws-text-sm); padding: var(--ws-space-3) 0; }

/* ── disclosure (details/summary) ───────────────────────── */
.ws-disclosure {
  border: 1px solid var(--ws-border); border-radius: var(--ws-radius-md);
  padding: var(--ws-space-3) var(--ws-space-4); margin-bottom: var(--ws-space-3); background: var(--ws-surface-alt);
}
.ws-disclosure summary {
  cursor: pointer; font-weight: 600; font-size: var(--ws-text-sm); list-style: none; display: flex; align-items: center; gap: 6px;
  border-radius: var(--ws-radius-sm); margin: calc(var(--ws-space-3) * -1) calc(var(--ws-space-4) * -1);
  padding: var(--ws-space-3) var(--ws-space-4); transition: background .12s;
}
.ws-disclosure summary:hover { background: rgba(28,30,33,.03); }
.ws-disclosure summary::-webkit-details-marker { display: none; }
.ws-disclosure summary::after {
  content: ''; margin-inline-start: auto; width: 8px; height: 8px; flex-shrink: 0;
  border-inline-end: 1.8px solid var(--ws-text-tertiary); border-bottom: 1.8px solid var(--ws-text-tertiary);
  transform: rotate(-45deg); transition: transform .15s; margin-inline-end: 2px;
}
[dir="rtl"] .ws-disclosure summary::after { transform: rotate(135deg); }
.ws-disclosure[open] summary::after { transform: rotate(45deg); }
[dir="rtl"] .ws-disclosure[open] summary::after { transform: rotate(225deg); }
.ws-disclosure summary .chev { width: 14px; height: 14px; transition: transform .15s; color: var(--ws-text-tertiary); }
.ws-disclosure[open] summary .chev { transform: rotate(90deg); }
.ws-disclosure[open] summary { margin-bottom: var(--ws-space-3); }

/* ── media grid (reels/stories) ─────────────────────────── */
.ws-media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: var(--ws-space-4); }
.ws-media-card {
  border: 1px solid var(--ws-border); border-radius: var(--ws-radius-md); overflow: hidden; background: var(--ws-surface);
  transition: transform .18s ease, box-shadow .18s ease;
}
.ws-media-card:hover { transform: translateY(-3px); box-shadow: var(--ws-shadow-md); }
.ws-media-card img { width: 100%; aspect-ratio: 4/5; object-fit: cover; display: block; background: var(--ws-surface-alt); }
.ws-media-card-body { padding: var(--ws-space-3); }
.ws-media-card-stats { font-size: var(--ws-text-xs); color: var(--ws-text-secondary); margin: var(--ws-space-1) 0 var(--ws-space-2); }

/* ── lists (notes / activity / comments) ────────────────── */
.ws-list { list-style: none; margin: 0; padding: 0; }
.ws-list li { padding: var(--ws-space-3) 0; border-bottom: 1px solid var(--ws-border); font-size: var(--ws-text-sm); }
.ws-list li:last-child { border-bottom: none; }
.ws-list .when { color: var(--ws-text-tertiary); font-size: var(--ws-text-xs); }
.ws-list-flush .when { float: inline-end; }
.ws-note {
  padding: var(--ws-space-3) var(--ws-space-4); background: var(--ws-surface-alt); border-radius: var(--ws-radius-md);
  margin-bottom: var(--ws-space-2); font-size: var(--ws-text-sm); border: 1px solid var(--ws-border);
}

/* ── row actions ─────────────────────────────────────────── */
.ws-row-actions { display: flex; gap: var(--ws-space-2); align-items: center; flex-wrap: wrap; }
.ws-row-actions form { display: flex; gap: 6px; align-items: center; margin: 0; }

/* ── toasts ──────────────────────────────────────────────── */
.ws-toast-stack {
  position: fixed; top: var(--ws-space-5); inset-inline-end: var(--ws-space-5); z-index: 100;
  display: flex; flex-direction: column; gap: var(--ws-space-2); width: 320px; max-width: calc(100vw - 40px);
}
.ws-toast {
  background: var(--ws-surface); border: 1px solid var(--ws-border); border-radius: var(--ws-radius-md);
  box-shadow: var(--ws-shadow-lg); padding: var(--ws-space-3) var(--ws-space-4);
  display: flex; align-items: flex-start; gap: var(--ws-space-2); font-size: var(--ws-text-sm);
  border-inline-start: 3px solid var(--ws-text-tertiary);
  animation: ws-toast-in .4s var(--ws-ease-spring);
}
.ws-toast.success { border-inline-start-color: var(--ws-success); }
.ws-toast.error { border-inline-start-color: var(--ws-danger); }
.ws-toast svg { width: 18px; height: 18px; flex-shrink: 0; margin-top: 1px; }
.ws-toast.success svg { color: var(--ws-success); }
.ws-toast.error svg { color: var(--ws-danger); }
.ws-toast-close { margin-inline-start: auto; background: none; border: none; cursor: pointer; color: var(--ws-text-tertiary); padding: 0; transition: color .12s ease; }
.ws-toast-close:hover { color: var(--ws-text); }
@keyframes ws-toast-in { from { opacity: 0; transform: translateY(-10px) scale(.96); } to { opacity: 1; transform: translateY(0) scale(1); } }
.ws-toast.is-leaving { animation: ws-toast-out .15s ease-in forwards; }
@keyframes ws-toast-out { to { opacity: 0; transform: translateX(8px); } }

/* ── nav progress bar ────────────────────────────────────── */
.ws-nav-progress {
  position: fixed; top: 0; inset-inline-start: 0; height: 3px; width: 0%;
  background: var(--ws-accent); z-index: 200; transition: width .3s ease-out, opacity .2s;
}

/* ── modal (native <dialog>) ─────────────────────────────── */
.ws-modal { border: none; border-radius: var(--ws-radius-lg); padding: 0; box-shadow: var(--ws-shadow-lg); width: 380px; max-width: 90vw; }
.ws-modal::backdrop { background: rgba(28,30,33,.5); }
.ws-modal-body { padding: var(--ws-space-6); }
.ws-modal-body h3 { margin-bottom: var(--ws-space-2); font-size: var(--ws-text-lg); }
.ws-modal-body p { color: var(--ws-text-secondary); font-size: var(--ws-text-sm); margin-bottom: var(--ws-space-5); }
.ws-modal-actions { display: flex; gap: var(--ws-space-2); justify-content: flex-end; }

/* ── login (no sidebar) ─────────────────────────────────── */
.ws-auth-screen {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(160deg, var(--ws-sidebar-bg) 0%, #2A2C2F 100%);
}
.ws-auth-card {
  background: var(--ws-surface); border-radius: var(--ws-radius-lg); box-shadow: var(--ws-shadow-lg);
  padding: var(--ws-space-8); width: 360px; max-width: 90vw;
}
.ws-auth-logo { display: flex; align-items: center; gap: var(--ws-space-2); margin-bottom: var(--ws-space-6); font-weight: 700; font-size: var(--ws-text-lg); }
.ws-auth-logo .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ws-accent); display: inline-block; }

/* ── split-screen login (branding panel + form panel) ────── */
.ws-split-screen { min-height: 100vh; display: flex; }
.ws-split-brand {
  flex: 1 1 46%; position: relative; overflow: hidden;
  background: linear-gradient(160deg, var(--ws-sidebar-bg) 0%, #2A2C2F 100%);
  color: white; display: flex; flex-direction: column; justify-content: space-between;
  padding: var(--ws-space-10);
}
.ws-split-brand::before {
  content: ''; position: absolute; width: 460px; height: 460px; border-radius: 50%;
  background: radial-gradient(circle, rgba(27,116,228,.35), transparent 70%);
  top: -140px; inset-inline-end: -140px; pointer-events: none;
}
.ws-split-brand-logo {
  position: relative; display: flex; align-items: center; gap: var(--ws-space-2);
  font-weight: 700; font-size: var(--ws-text-lg);
}
.ws-split-brand-logo .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ws-accent); display: inline-block; }
.ws-split-brand-content { position: relative; }
.ws-split-brand-content h1 {
  font-size: 34px; line-height: 1.25; font-weight: 700; letter-spacing: -.02em; max-width: 420px;
}
.ws-split-brand-content p { color: rgba(255,255,255,.65); font-size: var(--ws-text-md); margin-top: var(--ws-space-4); max-width: 400px; line-height: 1.6; }
.ws-split-brand-features { display: flex; flex-direction: column; gap: var(--ws-space-3); margin-top: var(--ws-space-8); }
.ws-split-brand-feature { display: flex; align-items: center; gap: var(--ws-space-3); color: rgba(255,255,255,.85); font-size: var(--ws-text-sm); }
.ws-split-brand-feature .ico {
  width: 30px; height: 30px; border-radius: var(--ws-radius-sm); background: rgba(255,255,255,.08);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0; color: #8FC2FF;
}
.ws-split-brand-foot { position: relative; color: rgba(255,255,255,.4); font-size: var(--ws-text-xs); }
.ws-split-form-panel {
  flex: 1 1 54%; display: flex; align-items: center; justify-content: center;
  background: var(--ws-surface); padding: var(--ws-space-6);
}
.ws-split-form-card { width: 380px; max-width: 100%; }
.ws-split-form-card h1 { font-size: var(--ws-text-xl); margin-bottom: var(--ws-space-2); }
@media (max-width: 860px) {
  .ws-split-brand { display: none; }
  .ws-split-form-panel { flex: 1 1 100%; }
}

/* ── SSO ("Continue with <provider>") buttons ───────────── */
.ws-oauth-buttons { display: flex; flex-direction: column; gap: var(--ws-space-3); }
.ws-oauth-btn {
  display: flex; align-items: center; justify-content: center; gap: var(--ws-space-3);
  height: 46px; width: 100%; border-radius: var(--ws-radius-sm); border: 1px solid var(--ws-border-strong);
  background: var(--ws-surface); color: var(--ws-text); font-family: inherit;
  font-size: var(--ws-text-sm); font-weight: 600; cursor: pointer; text-decoration: none;
  transition: background .12s ease, border-color .12s ease, box-shadow .15s ease, transform .08s ease;
}
.ws-oauth-btn:hover { background: var(--ws-surface-alt); border-color: var(--ws-text-tertiary); box-shadow: var(--ws-shadow-sm); }
.ws-oauth-btn:active { transform: scale(.98); }
.ws-oauth-btn svg { width: 20px; height: 20px; flex-shrink: 0; }
.ws-oauth-btn.meta { background: #0866FF; border-color: #0866FF; color: #fff; }
.ws-oauth-btn.meta:hover { background: #0656D6; border-color: #0656D6; box-shadow: 0 4px 14px rgba(8,102,255,.28); }

/* ── divider with centered label (e.g. "or continue with email") ── */
.ws-divider { display: flex; align-items: center; gap: var(--ws-space-3); margin: var(--ws-space-6) 0; }
.ws-divider::before, .ws-divider::after { content: ''; flex: 1; height: 1px; background: var(--ws-border); }
.ws-divider span { color: var(--ws-text-tertiary); font-size: var(--ws-text-xs); white-space: nowrap; }

/* ── de-emphasized secondary auth section (email/password under SSO) ── */
.ws-auth-secondary-label { font-size: var(--ws-text-xs); color: var(--ws-text-tertiary); font-weight: 600; margin-bottom: var(--ws-space-3); }

/* ── error / access-denied screen ───────────────────────── */
.ws-error-screen { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: var(--ws-space-6); }

/* ── skeleton (loading placeholder) ─────────────────────── */
.ws-skeleton {
  position: relative; overflow: hidden; background: var(--ws-surface-alt);
  border-radius: var(--ws-radius-sm); display: block;
}
.ws-skeleton::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.65), transparent);
  animation: ws-shimmer 1.3s ease-in-out infinite;
}
@media (prefers-reduced-motion: reduce) { .ws-skeleton::after { animation: none; } }
[dir="rtl"] .ws-skeleton::after { animation-direction: reverse; }
@keyframes ws-shimmer { from { transform: translateX(-100%); } to { transform: translateX(100%); } }
.ws-skeleton-text { height: 14px; width: 100%; margin-bottom: var(--ws-space-2); }
.ws-skeleton-text.short { width: 40%; }
.ws-skeleton-avatar { width: 80px; height: 80px; border-radius: 50%; }
.ws-skeleton-block { height: 90px; border-radius: var(--ws-radius-md); }
.ws-skeleton-row { display: flex; align-items: center; gap: var(--ws-space-4); padding: var(--ws-space-3) 0; }

/* ── tabs ────────────────────────────────────────────────── */
.ws-tabs {
  display: flex; gap: var(--ws-space-2); border-bottom: 1px solid var(--ws-border);
  margin-bottom: var(--ws-space-6); overflow-x: auto;
}
.ws-tab-btn {
  font-family: inherit; background: none; border: none; cursor: pointer;
  padding: var(--ws-space-3) var(--ws-space-2); margin-bottom: -1px;
  font-size: var(--ws-text-sm); font-weight: 600; color: var(--ws-text-secondary);
  border-bottom: 2px solid transparent; white-space: nowrap; transition: color .12s, border-color .12s;
}
.ws-tab-btn:hover { color: var(--ws-text); }
.ws-tab-btn.active { color: var(--ws-accent); border-bottom-color: var(--ws-accent); }
.ws-tab-panel { display: none; }
.ws-tab-panel.active { display: block; animation: ws-fade-in .15s ease-out; }
@keyframes ws-fade-in { from { opacity: 0; } to { opacity: 1; } }

/* ── segmented control ──────────────────────────────────── */
.ws-segmented {
  display: inline-flex; gap: 2px; background: var(--ws-surface-alt); border: 1px solid var(--ws-border);
  border-radius: var(--ws-radius-md); padding: 2px;
}
.ws-segmented-btn {
  font-family: inherit; background: none; border: none; cursor: pointer;
  padding: var(--ws-space-2) var(--ws-space-4); border-radius: var(--ws-radius-sm);
  font-size: var(--ws-text-xs); font-weight: 600; color: var(--ws-text-secondary);
  transition: background .12s, color .12s, box-shadow .12s;
}
.ws-segmented-btn:hover { color: var(--ws-text); }
.ws-segmented-btn.active { background: var(--ws-surface); color: var(--ws-text); box-shadow: var(--ws-shadow-sm); }

/* ── chart card ──────────────────────────────────────────── */
.ws-chart-card { margin-bottom: 0; }
.ws-chart-title { font-size: var(--ws-text-md); font-weight: 600; margin-bottom: var(--ws-space-5); }
.ws-chart-wrap { position: relative; height: 240px; }
.ws-chart-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--ws-space-5); }
@media (max-width: 700px) { .ws-chart-grid { grid-template-columns: 1fr; } }

/* ── watch bar (progress) ───────────────────────────────── */
.ws-watch-bar-wrap { display: flex; align-items: center; gap: var(--ws-space-3); font-size: var(--ws-text-xs); color: var(--ws-text-secondary); margin-bottom: var(--ws-space-1); }
.ws-watch-bar { flex: 1; height: 6px; background: var(--ws-border); border-radius: var(--ws-radius-full); overflow: hidden; }
.ws-watch-bar-fill { height: 100%; background: var(--ws-accent); border-radius: var(--ws-radius-full); }

/* ── media row (horizontal media item) ──────────────────── */
.ws-media-row-list { display: flex; flex-direction: column; gap: var(--ws-space-4); }
.ws-media-row {
  background: var(--ws-surface); border: 1px solid var(--ws-border); border-radius: var(--ws-radius-lg);
  padding: var(--ws-space-4); display: flex; gap: var(--ws-space-4); align-items: flex-start;
}
.ws-media-row-thumb {
  width: 84px; height: 84px; border-radius: var(--ws-radius-md); object-fit: cover;
  background: var(--ws-surface-alt); flex-shrink: 0;
}
.ws-media-row-body { flex: 1; min-width: 0; }
.ws-media-row-date { font-size: var(--ws-text-xs); color: var(--ws-text-tertiary); margin-bottom: var(--ws-space-2); display: flex; align-items: center; gap: 6px; }
.ws-media-row-stats { display: flex; flex-wrap: wrap; gap: var(--ws-space-2); }
.ws-media-row-stat {
  display: inline-flex; align-items: center; gap: 4px; background: var(--ws-surface-alt);
  border-radius: var(--ws-radius-sm); padding: 3px 8px; font-size: var(--ws-text-xs); color: var(--ws-text);
  font-weight: 600;
}
.ws-media-row-stat svg { width: 13px; height: 13px; color: var(--ws-text-tertiary); }
.ws-media-row-caption {
  font-size: var(--ws-text-sm); color: var(--ws-text-secondary); margin-top: var(--ws-space-2);
  overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
.ws-media-row-actions { margin-top: var(--ws-space-3); display: flex; gap: var(--ws-space-2); flex-wrap: wrap; }

/* ── post grid (square thumbnails w/ hover overlay) ─────── */
.ws-post-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--ws-space-3); }
@media (max-width: 560px) { .ws-post-grid { grid-template-columns: repeat(2, 1fr); } }
.ws-post-item {
  position: relative; border-radius: var(--ws-radius-md); overflow: hidden; background: var(--ws-surface-alt);
  aspect-ratio: 1; cursor: pointer;
}
.ws-post-item img, .ws-post-item video { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .3s ease; }
.ws-post-item:hover img, .ws-post-item:hover video { transform: scale(1.05); }
.ws-post-overlay {
  position: absolute; inset: 0; background: rgba(28,30,33,.55); display: flex; align-items: center;
  justify-content: center; gap: var(--ws-space-4); opacity: 0; transition: opacity .2s ease; color: white;
  font-size: var(--ws-text-sm); font-weight: 600;
}
.ws-post-item:hover .ws-post-overlay { opacity: 1; }
.ws-post-overlay span { display: flex; align-items: center; gap: 5px; }
.ws-post-overlay svg { width: 16px; height: 16px; }

/* ── avatar (table rows, small contexts) ────────────────── */
.ws-avatar {
  width: 40px; height: 40px; border-radius: 50%; object-fit: cover;
  background: var(--ws-surface-alt); border: 1px solid var(--ws-border); display: block;
}

/* ── hero card (profile banner + overlapping avatar) ────── */
.ws-hero-card {
  position: relative; overflow: hidden; border-radius: var(--ws-radius-lg);
  background: var(--ws-surface); border: 1px solid var(--ws-border); box-shadow: var(--ws-shadow-sm);
  margin-bottom: var(--ws-space-6);
}
.ws-hero-banner { height: 92px; background: linear-gradient(135deg, var(--ws-accent-soft) 0%, var(--ws-surface-alt) 100%); }
.ws-hero-body {
  padding: 0 var(--ws-space-6) var(--ws-space-6); margin-top: -46px;
  display: flex; gap: var(--ws-space-5); align-items: flex-end; flex-wrap: wrap;
}

/* ── profile header (avatar + name + bio) ───────────────── */
.ws-profile-header { display: flex; gap: var(--ws-space-5); align-items: flex-end; flex-wrap: wrap; flex: 1; min-width: 0; }
.ws-profile-avatar {
  width: 92px; height: 92px; border-radius: 50%; object-fit: cover; background: var(--ws-surface-alt);
  border: 4px solid var(--ws-surface); box-shadow: var(--ws-shadow-sm); flex-shrink: 0;
}
.ws-profile-info { flex: 1; min-width: 200px; padding-bottom: 2px; }
.ws-profile-info h2 { font-size: var(--ws-text-xl); margin-bottom: var(--ws-space-1); letter-spacing: -.01em; }
.ws-profile-info p { color: var(--ws-text-secondary); font-size: var(--ws-text-sm); line-height: 1.5; max-width: 520px; }

/* ── brand selector (Brand Dashboard — All Brands / one brand) ────── */
.ws-brand-selector {
  display: flex; align-items: center; gap: var(--ws-space-3); margin-bottom: var(--ws-space-5);
}
.ws-brand-selector label { font-size: var(--ws-text-sm); color: var(--ws-text-secondary); }
.ws-brand-selector select {
  font-family: inherit; font-size: var(--ws-text-sm); padding: var(--ws-space-2) var(--ws-space-3);
  border: 1px solid var(--ws-border); border-radius: var(--ws-radius-md); background: var(--ws-surface);
  color: var(--ws-text-primary); min-width: 220px;
}

/* ── KPI tiles (dashboard stat row with icon badges) ─────── */
.ws-kpi-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: var(--ws-space-4); margin-bottom: var(--ws-space-6); }
.ws-kpi-tile {
  background: var(--ws-surface); border: 1px solid var(--ws-border); border-radius: var(--ws-radius-lg);
  padding: var(--ws-space-5); box-shadow: var(--ws-shadow-sm); display: flex; align-items: center; gap: var(--ws-space-4);
  transition: transform .15s ease, box-shadow .15s ease;
}
.ws-kpi-tile:hover { transform: translateY(-3px); box-shadow: var(--ws-shadow-md); }
.ws-kpi-icon {
  width: 44px; height: 44px; border-radius: var(--ws-radius-md); flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: var(--ws-accent-soft); color: var(--ws-accent);
}
.ws-kpi-icon svg { width: 20px; height: 20px; }
.ws-kpi-icon.success { background: var(--ws-success-soft); color: var(--ws-success); }
.ws-kpi-icon.info { background: var(--ws-info-soft); color: var(--ws-info); }
.ws-kpi-icon.warning { background: var(--ws-warning-soft); color: var(--ws-warning); }
.ws-kpi-body { min-width: 0; }
.ws-kpi-body .n { font-size: var(--ws-text-2xl); font-weight: 700; letter-spacing: -.02em; line-height: 1.2; }
.ws-kpi-body .l { font-size: var(--ws-text-xs); color: var(--ws-text-secondary); font-weight: 500; margin-top: 2px; }

/* ── goal-vs-actual progress bars ────────────────────────── */
.ws-goal-row { margin-bottom: var(--ws-space-3); }
.ws-goal-row-head {
  display: flex; justify-content: space-between; align-items: baseline;
  font-size: var(--ws-text-sm); font-weight: 600; margin-bottom: var(--ws-space-1);
}
.ws-progress {
  height: 8px; border-radius: var(--ws-radius-full); background: var(--ws-surface-alt);
  border: 1px solid var(--ws-border); overflow: hidden;
}
.ws-progress-bar { height: 100%; border-radius: var(--ws-radius-full); background: var(--ws-accent); transition: width .3s ease; }
.ws-progress-bar.success { background: var(--ws-success); }

/* ── brand dashboard: brand cards ────────────────────────── */
.ws-brand-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: var(--ws-space-4); }
.ws-brand-card {
  display: block; text-decoration: none; color: inherit;
  background: var(--ws-surface); border: 1px solid var(--ws-border); border-radius: var(--ws-radius-lg);
  padding: var(--ws-space-5); box-shadow: var(--ws-shadow-sm); transition: transform .15s ease, box-shadow .15s ease;
}
.ws-brand-card:hover { transform: translateY(-3px); box-shadow: var(--ws-shadow-md); border-color: var(--ws-border-strong); }
.ws-brand-card-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: var(--ws-space-4); gap: var(--ws-space-2); }
.ws-brand-card-header h3 { font-size: var(--ws-text-md); font-weight: 700; }
.ws-brand-card-stats { display: flex; gap: var(--ws-space-5); }
.ws-brand-card-stats .n { font-size: var(--ws-text-lg); font-weight: 700; line-height: 1.2; }
.ws-brand-card-stats .l { font-size: var(--ws-text-xs); color: var(--ws-text-secondary); margin-top: 2px; }

/* ── alert / approval lists ───────────────────────────────── */
.ws-alert-list, .ws-approval-list { display: flex; flex-direction: column; gap: var(--ws-space-2); }
.ws-alert-item {
  display: flex; align-items: center; justify-content: space-between; gap: var(--ws-space-3);
  padding: var(--ws-space-3) var(--ws-space-4); border-radius: var(--ws-radius-md);
  background: var(--ws-surface-alt); border-inline-start: 3px solid var(--ws-border-strong);
  font-size: var(--ws-text-sm);
}
.ws-alert-item.warning { border-inline-start-color: var(--ws-warning); }
.ws-alert-item.danger { border-inline-start-color: var(--ws-danger); }
.ws-alert-item.info { border-inline-start-color: var(--ws-info); }
.ws-alert-item-label { font-weight: 500; }
.ws-alert-item-campaign { color: var(--ws-text-secondary); font-size: var(--ws-text-xs); }

/* ── chip list (agencies etc.) ───────────────────────────── */
.ws-chip-list { display: flex; flex-wrap: wrap; gap: var(--ws-space-2); }
.ws-chip {
  display: inline-flex; align-items: center; gap: var(--ws-space-1);
  padding: var(--ws-space-1) var(--ws-space-3); border-radius: var(--ws-radius-full);
  background: var(--ws-surface-alt); border: 1px solid var(--ws-border); font-size: var(--ws-text-xs); font-weight: 500;
}

/* ── annual campaign timeline (Part 4.2) — a 12-column CSS grid; each
   campaign is one row with a colored bar spanning start_month..end_month */
.ws-timeline-months {
  display: grid; grid-template-columns: 200px repeat(12, 1fr); gap: 2px;
  font-size: var(--ws-text-xs); color: var(--ws-text-tertiary); padding-bottom: var(--ws-space-2);
  border-bottom: 1px solid var(--ws-border); margin-bottom: var(--ws-space-2);
}
.ws-timeline-months span:first-child { visibility: hidden; }
.ws-timeline-row { display: grid; grid-template-columns: 200px repeat(12, 1fr); gap: 2px; align-items: center; min-height: 34px; }
.ws-timeline-row + .ws-timeline-row { border-top: 1px solid var(--ws-border); }
.ws-timeline-row-label { font-size: var(--ws-text-sm); font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding-inline-end: var(--ws-space-2); }
.ws-timeline-row-label a { text-decoration: none; color: inherit; }
.ws-timeline-row-label a:hover { color: var(--ws-accent); }
.ws-timeline-bar-track { grid-column: span 12; position: relative; height: 22px; }
.ws-timeline-bar {
  position: absolute; top: 0; bottom: 0; border-radius: var(--ws-radius-sm);
  background: var(--ws-accent-soft, rgba(27,116,228,.16)); border: 1px solid var(--ws-accent);
  display: flex; align-items: center; padding: 0 6px; font-size: 10px; color: var(--ws-accent); overflow: hidden; white-space: nowrap;
}
.ws-timeline-bar.at_risk { border-color: var(--ws-warning); background: var(--ws-warning-soft); color: var(--ws-warning); }
.ws-timeline-bar.delayed { border-color: var(--ws-danger); background: var(--ws-danger-soft); color: var(--ws-danger); }

/* ── task buckets (My Tasks widget) ──────────────────────── */
.ws-task-bucket-title { font-size: var(--ws-text-xs); font-weight: 600; color: var(--ws-text-tertiary); margin: var(--ws-space-3) 0 var(--ws-space-1); }
.ws-task-bucket-title:first-child { margin-top: 0; }

/* ── cross-app switcher link (sidebar) ──────────────────── */
.ws-app-switch {
  margin: var(--ws-space-3); padding-top: var(--ws-space-3); border-top: 1px solid rgba(255,255,255,.08);
}
.ws-app-switch a {
  display: flex; align-items: center; gap: var(--ws-space-2); color: var(--ws-sidebar-text);
  text-decoration: none; font-size: var(--ws-text-xs); font-weight: 500; padding: var(--ws-space-2) var(--ws-space-3);
  border-radius: var(--ws-radius-md); transition: background .12s, color .12s;
}
.ws-app-switch a:hover { background: var(--ws-sidebar-active-bg); color: var(--ws-sidebar-text-active); }
.ws-app-switch svg { width: 15px; height: 15px; flex-shrink: 0; }

/* ── responsive ──────────────────────────────────────────── */
@media (max-width: 900px) {
  /* Mobile keeps the pre-existing full-width slide-in drawer pattern —
     deliberately NOT the collapsed icon rail from Part 2, which only makes
     sense with a hover affordance mobile doesn't have. Every collapse/
     hover-expand rule above is reset back to "always fully expanded." */
  .ws-sidebar,
  .ws-sidebar:hover,
  .ws-sidebar:focus-within {
    width: var(--ws-sidebar-width);
    position: fixed; inset-inline-start: 0; top: 0; z-index: 50;
    transform: translateX(100%);
    transition: transform .2s ease-out;
  }
  [dir="rtl"] .ws-sidebar { transform: translateX(-100%); }
  .ws-shell.nav-open .ws-sidebar { transform: translateX(0); }
  .ws-shell.nav-open .ws-sidebar-overlay {
    display: block; position: fixed; inset: 0; background: rgba(28,30,33,.4); z-index: 45;
  }
  .ws-mobile-toggle { display: flex; }
  .ws-main { margin-inline-start: 0; }
  .ws-content { padding: var(--ws-space-16) var(--ws-space-4) var(--ws-space-10); }
  .ws-page-header { flex-direction: column; }
  .ws-section-nav { position: static; }

  .ws-sidebar-logo-text,
  .ws-sidebar-link span,
  .ws-app-switch a span,
  .ws-account-trigger-text,
  .ws-account-trigger-chevron {
    max-width: none; opacity: 1;
  }
  .ws-sidebar-link,
  .ws-account-trigger { justify-content: flex-start; }
  .ws-account-drawer { inset-inline-start: 0; inset-inline-end: 0; width: auto; }
}

/* ── skip link (WCAG 2.4.1 Bypass Blocks) ───────────────────────────────
   Visually hidden until focused, then pinned to the top of the viewport —
   the first tab stop on every page so keyboard users can jump straight to
   <main> instead of tabbing through the full sidebar/nav first. */
.ws-skip-link {
  position: absolute; inset-inline-start: -9999px; top: auto;
  background: var(--ws-accent); color: #fff;
  padding: var(--ws-space-3) var(--ws-space-4);
  border-radius: var(--ws-radius-sm);
  z-index: 1000; font-weight: 600; text-decoration: none;
}
.ws-skip-link:focus {
  position: fixed; inset-inline-start: var(--ws-space-4); top: var(--ws-space-4);
}

/* ── legal pages (privacy/terms/accessibility/data-rights/cookies) + footer */
.ws-legal-footer {
  padding: var(--ws-space-6) var(--ws-space-4);
  border-top: 1px solid var(--ws-border);
  text-align: center;
}
.ws-legal-footer nav {
  display: flex; flex-wrap: wrap; justify-content: center; align-items: center;
  gap: var(--ws-space-2); font-size: var(--ws-text-sm); color: var(--ws-text-secondary);
}
.ws-legal-footer a { color: var(--ws-text-secondary); text-decoration: underline; }
.ws-legal-footer a:hover { color: var(--ws-accent); }

.ws-legal-page { max-width: 760px; margin: 0 auto; padding: var(--ws-space-10) var(--ws-space-4); }
.ws-legal-page h1 { font-size: var(--ws-text-2xl); margin-bottom: var(--ws-space-2); }
.ws-legal-page .ws-legal-updated { color: var(--ws-text-tertiary); font-size: var(--ws-text-sm); margin-bottom: var(--ws-space-8); }
.ws-legal-page h2 { font-size: var(--ws-text-lg); margin-top: var(--ws-space-8); margin-bottom: var(--ws-space-3); }
.ws-legal-page p, .ws-legal-page li { line-height: 1.8; color: var(--ws-text); margin-bottom: var(--ws-space-3); }
.ws-legal-page ul, .ws-legal-page ol { padding-inline-start: var(--ws-space-6); margin-bottom: var(--ws-space-4); }
.ws-legal-page table { width: 100%; border-collapse: collapse; margin: var(--ws-space-4) 0; }
.ws-legal-page caption { text-align: start; font-weight: 600; margin-bottom: var(--ws-space-2); }
.ws-legal-page th, .ws-legal-page td { border: 1px solid var(--ws-border); padding: var(--ws-space-2) var(--ws-space-3); text-align: start; font-size: var(--ws-text-sm); }
.ws-legal-page th { background: var(--ws-surface-alt); }
.ws-legal-placeholder { background: var(--ws-warning-soft); color: var(--ws-warning); padding: 1px 6px; border-radius: var(--ws-radius-sm); font-family: monospace; font-size: .9em; }

/* Section 11 notices attached to forms that collect personal information */
.ws-s11-notice {
  background: var(--ws-accent-soft); border: 1px solid var(--ws-border);
  border-radius: var(--ws-radius-md); padding: var(--ws-space-3) var(--ws-space-4);
  margin-bottom: var(--ws-space-4); font-size: var(--ws-text-sm); line-height: 1.7;
}
.ws-s11-notice p { margin-bottom: var(--ws-space-1); }
.ws-s11-notice a { color: var(--ws-accent); text-decoration: underline; }

/* prefers-reduced-motion coverage for the animations design-system.css
   defines elsewhere (spinner, toast in/out, fade-in) — previously only the
   skeleton shimmer respected this (line ~604). */
@media (prefers-reduced-motion: reduce) {
  .ws-spinner,
  .ws-toast,
  .ws-fade-in,
  [class*="ws-fade-in"] {
    animation: none !important;
    transition: none !important;
  }
}
