
:root {
  color-scheme: light;

  /* === Brand colors (canonical from design-system.md §2) === */
  --color-navy-deep: #071421;
  --color-blue: #0b4e8f;
  --color-blue-mid: #134e91;
  --color-blue-light: #2d6eb7;
  --color-teal: #20c6ad;
  --color-teal-deep: #0b8f87;
  --color-teal-dark: #097379;
  --color-teal-pale: #e6fbf8;
  --color-teal-glow: rgba(32, 198, 173, 0.18);

  --color-surface: #fbfdff;
  --color-surface-mist: #f0f5f8;
  --color-surface-tint: #f7fbfd;

  --color-text-strong: #081b2f;
  --color-text-body: #475569;
  --color-text-muted: #64748b;
  --color-text-on-dark: #f8fbff;
  --color-text-on-dark-soft: rgba(255, 255, 255, 0.78);
  --text-on-dark: var(--color-text-on-dark);
  --text-on-dark-soft: var(--color-text-on-dark-soft);

  --color-border-subtle: #e2e8f0;
  --color-border-strong: #c8d4e0;
  --color-border-on-dark: rgba(201, 216, 230, 0.16);

  --color-success: #16a34a;
  --color-success-soft: #e8f7f0;
  --color-warning: #d9822b;
  --color-warning-soft: #fff3e8;
  --color-danger: #d64545;
  --color-danger-soft: #fdecec;
  --color-info: #2563eb;
  --color-info-soft: #e8f1fd;

  --brand-gradient: linear-gradient(130deg, #071421, #0b4e8f 58%, #0b8f87);
  --brand-gradient-soft:
    radial-gradient(circle at 88% 12%, rgba(32, 198, 173, 0.22), transparent 30%),
    var(--brand-gradient);

  --font-display: "Montserrat", "Inter", ui-sans-serif, system-ui, -apple-system,
    BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-sans: "Inter", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", "SFMono-Regular", Consolas, "Liberation Mono", Menlo,
    monospace;

  --type-display: 3.5rem;
  --type-h1: 2.25rem;
  --type-h2: 1.75rem;
  --type-h3: 1.375rem;
  --type-h4: 1.125rem;
  --type-body: 1rem;
  --type-sm: 0.875rem;
  --type-xs: 0.75rem;

  --leading-display: 1.08;
  --leading-h: 1.2;
  --leading-body: 1.55;
  --leading-tight: 1.35;

  --weight-bold: 700;
  --weight-semibold: 600;
  --weight-medium: 500;
  --weight-regular: 400;

  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;

  --sidebar-width: 236px;
  --sidebar-width-collapsed: 64px;
  --topbar-height: 56px;
  --content-max: 1200px;

  --radius-xs: 4px;
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 10px;
  --radius-xl: 12px;
  --radius-pill: 9999px;

  --shadow-sm: 0 1px 2px rgba(8, 27, 47, 0.06);
  --shadow-card: 0 1px 2px rgba(8, 27, 47, 0.05), 0 8px 18px rgba(11, 78, 143, 0.045);
  --shadow-card-hover: 0 12px 28px rgba(11, 78, 143, 0.10);
  --shadow-popover: 0 16px 48px rgba(8, 27, 47, 0.18);
  --shadow-modal: 0 30px 90px rgba(8, 27, 47, 0.28);
  --shadow-inset-line: inset 0 -1px 0 var(--color-border-subtle);

  --motion-fast: 120ms cubic-bezier(0.2, 0.8, 0.4, 1);
  --motion-base: 200ms cubic-bezier(0.2, 0.8, 0.4, 1);
  --motion-slow: 320ms cubic-bezier(0.2, 0.8, 0.4, 1);

  --focus-ring: 0 0 0 3px rgba(32, 198, 173, 0.32);

  --bg-app: var(--color-surface-mist);
  --bg-panel: var(--color-surface);
  --bg-panel-mist: var(--color-surface-tint);
  --bg-shell: var(--color-navy-deep);
  --bg-shell-soft: var(--brand-gradient);

  --text-primary: var(--color-text-strong);
  --text-secondary: var(--color-text-body);
  --text-muted: var(--color-text-muted);
  --text-link: var(--color-teal-dark);

  --border-default: var(--color-border-subtle);
  --border-strong: var(--color-border-strong);

  --accent-primary: var(--color-blue);
  --accent-secondary: var(--color-teal);
  --accent-pale: var(--color-teal-pale);
}

:root[data-theme="dark"] {
  color-scheme: dark;

  --bg-app: #050b14;
  --bg-panel: #0b1828;
  --bg-panel-mist: #0f2034;
  --bg-shell: #050b14;

  --text-primary: #e8eef6;
  --text-secondary: #b6c2d2;
  --text-muted: #7c8a9c;
  --text-link: var(--color-teal);

  --border-default: rgba(201, 216, 230, 0.12);
  --border-strong: rgba(201, 216, 230, 0.22);

  --color-surface: #0b1828;
  --color-surface-mist: #050b14;
  --color-surface-tint: #0f2034;
  --color-text-strong: #e8eef6;
  --color-text-body: #b6c2d2;
  --color-text-muted: #7c8a9c;

  --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.4), 0 12px 32px rgba(0, 0, 0, 0.36);
  --shadow-card-hover: 0 18px 44px rgba(0, 0, 0, 0.46);
}

*, *::before, *::after { box-sizing: border-box; }
html, body {
  margin: 0;
  padding: 0;
  background: var(--bg-app);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: var(--type-body);
  line-height: var(--leading-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
body { min-height: 100vh; }

a { color: var(--text-link); text-decoration: none; border-radius: var(--radius-xs); }
a:hover { text-decoration: underline; }
a:focus-visible { outline: none; box-shadow: var(--focus-ring); }

button { font-family: inherit; font-size: inherit; color: inherit; background: none; border: 0; cursor: pointer; padding: 0; }
button:focus-visible { outline: none; box-shadow: var(--focus-ring); }
button:disabled { cursor: not-allowed; opacity: 0.55; }
input, textarea, select { font-family: inherit; font-size: inherit; }

h1, h2, h3, h4, h5 { margin: 0; font-family: var(--font-display); color: var(--text-primary); }
h1 { font-size: var(--type-h1); font-weight: var(--weight-bold); line-height: var(--leading-h); letter-spacing: -0.01em; }
h2 { font-size: var(--type-h2); font-weight: var(--weight-bold); line-height: var(--leading-h); letter-spacing: -0.005em; }
h3 { font-size: var(--type-h3); font-weight: var(--weight-semibold); line-height: var(--leading-tight); }
h4 { font-size: var(--type-h4); font-weight: var(--weight-semibold); line-height: var(--leading-tight); }
p  { margin: 0 0 var(--space-3) 0; }

.eyebrow { font-family: var(--font-display); font-size: var(--type-xs); font-weight: var(--weight-bold); letter-spacing: 0.16em; text-transform: uppercase; color: var(--accent-primary); }

.app {
  display: grid;
  /* minmax(0, 1fr) prevents the right column from blowing past the viewport
     when a child has wide content (CSS Grid's auto-minimum behaviour). */
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  grid-template-rows: var(--topbar-height) 1fr;
  grid-template-areas: "sidebar topbar" "sidebar main";
  min-height: 100vh;
}
.app > .topbar { grid-area: topbar; min-width: 0; }
.app > .sidebar { grid-area: sidebar; }
.app__main { grid-area: main; padding: var(--space-8); max-width: var(--content-max); margin: 0 auto; width: 100%; min-width: 0; box-sizing: border-box; }
@media (max-width: 960px) {
  .app { grid-template-columns: 1fr; grid-template-areas: "topbar" "main" "sidebar"; grid-template-rows: var(--topbar-height) 1fr auto; }
  .app__main { padding: var(--space-5); }
}

.topbar { height: var(--topbar-height); background: var(--bg-panel); border-bottom: 1px solid var(--border-default); display: flex; align-items: center; gap: var(--space-4); padding: 0 var(--space-6); position: sticky; top: 0; z-index: 30; }
.topbar__brand { display: flex; align-items: baseline; gap: var(--space-2); font-family: var(--font-display); font-weight: var(--weight-bold); color: var(--text-primary); letter-spacing: -0.01em; text-decoration: none; }
.topbar__brand .x { color: var(--accent-secondary); }
.topbar__brand .lockup-eyebrow { font-size: var(--type-xs); font-weight: var(--weight-bold); letter-spacing: 0.16em; color: var(--accent-primary); text-transform: uppercase; margin-right: var(--space-2); }
.topbar__brand .lockup-title { font-size: var(--type-body); font-weight: var(--weight-bold); color: var(--text-primary); }
.topbar__search { flex: 1; max-width: 480px; display: flex; align-items: center; gap: var(--space-2); padding: var(--space-2) var(--space-3); border: 1px solid var(--border-default); border-radius: var(--radius-md); background: var(--bg-panel-mist); color: var(--text-muted); cursor: pointer; transition: border-color var(--motion-fast), background var(--motion-fast); }
.topbar__search:hover { border-color: var(--border-strong); background: var(--bg-panel); }
.topbar__search kbd { font-family: var(--font-sans); font-size: var(--type-xs); font-weight: var(--weight-semibold); background: var(--bg-panel); border: 1px solid var(--border-default); border-radius: var(--radius-xs); padding: 1px 6px; color: var(--text-secondary); margin-left: auto; }
.topbar__right { display: flex; align-items: center; gap: var(--space-3); margin-left: auto; }
.topbar__sync { display: inline-flex; align-items: center; gap: var(--space-2); font-size: var(--type-sm); color: var(--text-muted); padding: var(--space-1) var(--space-3); border: 1px solid var(--border-default); border-radius: var(--radius-pill); background: var(--bg-panel-mist); }
.topbar__sync .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--color-success); box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.18); }
.topbar__sync.is-syncing .dot { background: var(--color-warning); box-shadow: 0 0 0 3px rgba(217, 130, 43, 0.18); }
.topbar__user { display: inline-flex; align-items: center; gap: var(--space-2); font-size: var(--type-sm); font-weight: var(--weight-semibold); color: var(--text-secondary); padding: var(--space-2) var(--space-3); border: 1px solid var(--border-default); border-radius: var(--radius-md); background: var(--bg-panel); }
.topbar__user .avatar { width: 24px; height: 24px; border-radius: 50%; background: var(--brand-gradient); color: var(--text-on-dark); font-size: var(--type-xs); font-weight: var(--weight-bold); display: inline-flex; align-items: center; justify-content: center; }
.topbar__user .role { font-size: var(--type-xs); font-weight: var(--weight-medium); color: var(--text-muted); }

.brand-switcher { display: inline-flex; align-items: center; gap: var(--space-2); padding: var(--space-2) var(--space-3); border: 1px solid var(--border-default); border-radius: var(--radius-md); background: var(--bg-panel); font-weight: var(--weight-semibold); color: var(--text-primary); cursor: pointer; }
.brand-switcher .swatch { width: 12px; height: 12px; border-radius: 4px; background: var(--brand-gradient); }
.brand-switcher__menu { position: absolute; margin-top: var(--space-2); background: var(--bg-panel); border: 1px solid var(--border-default); border-radius: var(--radius-md); box-shadow: var(--shadow-popover); min-width: 200px; padding: var(--space-2); z-index: 40; }
.brand-switcher__item { display: flex; align-items: center; gap: var(--space-2); padding: var(--space-2) var(--space-3); border-radius: var(--radius-sm); color: var(--text-primary); cursor: pointer; font-size: var(--type-sm); }
.brand-switcher__item:hover { background: var(--bg-panel-mist); }
.brand-switcher__item.is-active { background: var(--accent-pale); color: var(--accent-primary); font-weight: var(--weight-semibold); }

.sidebar { background: color-mix(in srgb, var(--bg-panel) 88%, var(--bg-panel-mist)); border-right: 1px solid var(--border-default); padding: var(--space-4) var(--space-3); overflow-y: auto; display: flex; flex-direction: column; gap: 2px; position: sticky; top: 0; align-self: start; height: 100vh; }
.sidebar__group { margin-top: var(--space-5); }
.sidebar__group:first-child { margin-top: 0; }
.sidebar__group-label { font-size: 0.66rem; line-height: 1.2; font-weight: var(--weight-bold); letter-spacing: 0.11em; text-transform: uppercase; color: var(--text-muted); padding: 0 var(--space-2); margin-bottom: var(--space-1); }
.sidebar__group-label.is-marketing { color: var(--accent-primary); }
.sidebar__group-label.is-hermes { color: var(--text-muted); }
.sidebar__link { display: flex; align-items: center; gap: var(--space-2); padding: 7px 10px; border: 1px solid transparent; border-radius: var(--radius-md); font-size: 0.84rem; line-height: 1.2; font-weight: var(--weight-medium); color: var(--text-secondary); text-decoration: none; transition: background var(--motion-fast), border-color var(--motion-fast), color var(--motion-fast); min-height: 34px; }
.sidebar__link:hover { background: var(--bg-panel); border-color: var(--border-default); color: var(--text-primary); text-decoration: none; }
.sidebar__link.is-active { background: color-mix(in srgb, var(--accent-pale) 78%, var(--bg-panel)); border-color: color-mix(in srgb, var(--accent-secondary) 34%, var(--border-default)); color: var(--accent-primary); font-weight: var(--weight-semibold); box-shadow: none; }
.sidebar__link .icon { width: 15px; height: 15px; flex-shrink: 0; color: currentColor; }
.sidebar__link .badge { margin-left: auto; background: var(--color-danger-soft); color: var(--color-danger); font-size: var(--type-xs); font-weight: var(--weight-bold); border-radius: var(--radius-pill); padding: 1px 8px; min-width: 22px; text-align: center; }
.sidebar__link .badge.is-info { background: var(--color-info-soft); color: var(--color-info); }
.sidebar__link .badge.is-success { background: var(--color-success-soft); color: var(--color-success); }
.sidebar__more { margin-top: var(--space-5); padding-top: var(--space-3); border-top: 1px solid var(--border-default); }
.sidebar__more-summary { display: flex; align-items: center; gap: var(--space-2); min-height: 34px; padding: 7px 10px; border: 1px solid transparent; border-radius: var(--radius-md); color: var(--text-muted); cursor: pointer; font-size: 0.84rem; font-weight: var(--weight-semibold); list-style: none; }
.sidebar__more-summary::-webkit-details-marker { display: none; }
.sidebar__more-summary:hover, .sidebar__more-summary.is-active { background: var(--bg-panel); border-color: var(--border-default); color: var(--text-primary); }
.sidebar__more-summary .icon:last-child { margin-left: auto; transition: transform var(--motion-fast); }
.sidebar__more[open] .sidebar__more-summary .icon:last-child { transform: rotate(180deg); }
.sidebar__more-menu { display: flex; flex-direction: column; gap: 1px; padding-top: var(--space-2); }
.sidebar__link--compact { min-height: 30px; padding: 6px 10px; font-size: 0.78rem; }
@media (max-width: 960px) {
  .sidebar { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); overflow-x: hidden; border-top: 1px solid var(--border-default); border-right: 0; padding: 6px 8px; gap: 4px; position: sticky; top: auto; bottom: 0; align-self: auto; height: auto; background: var(--bg-panel); z-index: 25; }
  .sidebar__group { margin: 0; display: contents; }
  .sidebar__group-label { display: none; }
  .sidebar__more, .sidebar__link[data-mobile-primary="false"] { display: none; }
  .sidebar__link { flex-direction: column; justify-content: center; gap: 2px; width: 100%; min-width: 0; min-height: 48px; padding: 4px 1px; font-size: 0.625rem; line-height: 1.05; text-align: center; white-space: nowrap; }
  .sidebar__link span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
  .sidebar__link .icon { width: 16px; height: 16px; }
}

/* Tighter mobile rules: hide topbar bling under 720px, single-column grids under 600px. */
@media (max-width: 720px) {
  .topbar { padding: 0 var(--space-3); gap: var(--space-2); }
  .topbar__search { display: none; }
  .topbar__sync { display: none; }
  .brand-switcher-details { display: none; }
  .topbar__brand .lockup-eyebrow { display: none; }
  .topbar__user .role { display: none; }
  .topbar__user .stack > span:first-child { font-size: var(--type-xs); max-width: 80px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .page-header h1 { font-size: var(--type-h2); }
  .page-header__actions { width: 100%; }
}

@media (max-width: 600px) {
  .card-grid { grid-template-columns: 1fr !important; }
  .section-row { grid-template-columns: 1fr; }
  .digest__grid { grid-template-columns: 1fr 1fr; }
  .app__main { padding: var(--space-4); }
  .topbar__user .stack > span { display: none; }
  .topbar__user .avatar { margin: 0; }
  .topbar__user { padding: var(--space-1); }
  .table th, .table td { padding: var(--space-2) var(--space-3); }
}

.page { display: flex; flex-direction: column; gap: var(--space-6); }
.page-header { display: flex; flex-direction: column; gap: var(--space-1); padding-bottom: var(--space-4); border-bottom: 1px solid var(--border-default); }
.page-header__top { display: flex; align-items: center; justify-content: space-between; gap: var(--space-4); flex-wrap: wrap; }
.page-header h1 { font-size: var(--type-h1); }
.page-header .description { color: var(--text-muted); font-size: var(--type-body); margin: 0; }
.page-header__actions { display: flex; gap: var(--space-2); flex-wrap: wrap; }

.card { background: var(--bg-panel); border: 1px solid var(--border-default); border-radius: var(--radius-md); box-shadow: var(--shadow-card); padding: var(--space-6); }
.card--mist { background: var(--bg-panel-mist); }
.card--accent { border-color: color-mix(in srgb, var(--accent-secondary) 40%, transparent); }
.card__header { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--space-3); margin-bottom: var(--space-4); }
.card__title { font-size: var(--type-h4); font-weight: var(--weight-semibold); margin: 0; }
.card__description { color: var(--text-muted); font-size: var(--type-sm); margin: var(--space-1) 0 0; }
.card__footer { margin-top: var(--space-4); padding-top: var(--space-4); border-top: 1px solid var(--border-default); }
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: var(--space-4); }

.kpi { background: var(--bg-panel); border: 1px solid var(--border-default); border-radius: var(--radius-md); padding: var(--space-5); display: flex; flex-direction: column; gap: var(--space-2); box-shadow: var(--shadow-sm); position: relative; overflow: hidden; }
.kpi::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 3px; background: linear-gradient(90deg, var(--color-teal), var(--color-blue) 60%, var(--color-teal-deep)); opacity: 0; transition: opacity var(--motion-base); }
.kpi:hover::before { opacity: 1; }
.kpi__label { font-size: var(--type-xs); font-weight: var(--weight-bold); letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-muted); }
.kpi__value { font-family: var(--font-display); font-size: var(--type-h1); font-weight: var(--weight-bold); letter-spacing: -0.01em; color: var(--text-primary); line-height: 1; }
.kpi__delta { font-size: var(--type-sm); font-weight: var(--weight-medium); color: var(--text-muted); }
.kpi__delta.is-positive { color: var(--color-success); }
.kpi__delta.is-negative { color: var(--color-danger); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2); padding: var(--space-2) var(--space-4); border: 1px solid transparent; border-radius: var(--radius-md); font-size: var(--type-sm); font-weight: var(--weight-semibold); line-height: 1.2; cursor: pointer; transition: background var(--motion-fast), border-color var(--motion-fast), transform var(--motion-fast); min-height: 36px; text-decoration: none; }
.btn:hover { transform: translateY(-1px); text-decoration: none; }
.btn:active { transform: translateY(0); }
.btn--primary { background: var(--brand-gradient); color: var(--text-on-dark); box-shadow: 0 8px 22px var(--color-teal-glow); }
.btn--primary:hover { filter: saturate(1.08); }
.btn--teal { background: var(--color-teal); color: #003e3a; }
.btn--teal:hover { background: var(--color-teal-deep); color: var(--text-on-dark); }
.btn--secondary { background: var(--bg-panel); color: var(--text-primary); border-color: var(--border-strong); }
.btn--secondary:hover { border-color: var(--accent-secondary); background: var(--accent-pale); }
.btn--ghost { background: transparent; color: var(--text-secondary); }
.btn--ghost:hover { background: var(--bg-panel-mist); color: var(--text-primary); }
.btn--danger { background: var(--color-danger-soft); color: var(--color-danger); border-color: color-mix(in srgb, var(--color-danger) 30%, transparent); }
.btn--danger:hover { background: var(--color-danger); color: var(--text-on-dark); }
.btn--sm { min-height: 28px; padding: var(--space-1) var(--space-3); font-size: var(--type-xs); }
.btn--lg { min-height: 44px; padding: var(--space-3) var(--space-5); }
.btn .icon { width: 16px; height: 16px; }

.pill { display: inline-flex; align-items: center; gap: var(--space-1); padding: 2px 10px; border-radius: var(--radius-pill); border: 1px solid var(--border-default); background: var(--bg-panel-mist); font-size: var(--type-xs); font-weight: var(--weight-semibold); color: var(--text-secondary); letter-spacing: 0.02em; }
.pill--success { background: var(--color-success-soft); color: var(--color-success); border-color: color-mix(in srgb, var(--color-success) 30%, transparent); }
.pill--warning { background: var(--color-warning-soft); color: var(--color-warning); border-color: color-mix(in srgb, var(--color-warning) 30%, transparent); }
.pill--danger  { background: var(--color-danger-soft);  color: var(--color-danger);  border-color: color-mix(in srgb, var(--color-danger) 30%, transparent); }
.pill--info    { background: var(--color-info-soft);    color: var(--color-info);    border-color: color-mix(in srgb, var(--color-info) 30%, transparent); }
.pill--accent  { background: var(--accent-pale); color: var(--color-teal-dark); border-color: color-mix(in srgb, var(--color-teal) 30%, transparent); }
.pill--neutral { background: var(--bg-panel-mist); }

.platform-badge { display: inline-flex; align-items: center; gap: var(--space-1); padding: 2px 8px; border-radius: var(--radius-sm); font-size: var(--type-xs); font-weight: var(--weight-semibold); letter-spacing: 0.02em; background: var(--bg-panel-mist); color: var(--text-primary); border: 1px solid var(--border-default); }
.platform-badge[data-platform="blog"] { color: var(--color-blue); }
.platform-badge[data-platform="email"] { color: var(--color-teal-dark); }
.platform-badge[data-platform="twitter"] { color: #0f1419; }
.platform-badge[data-platform="x"] { color: #0f1419; }
.platform-badge[data-platform="instagram"] { color: #c2185b; }
.platform-badge[data-platform="linkedin"] { color: #0a66c2; }
.platform-badge[data-platform="facebook"] { color: #1877f2; }
.platform-badge[data-platform="bluesky"] { color: #0085ff; }
.platform-badge[data-platform="threads"] { color: #1c1c1c; }
.platform-badge[data-platform="tiktok"] { color: #010101; }
.platform-badge[data-platform="youtube"] { color: #ff0000; }
.platform-badge[data-platform="youtube_short"] { color: #ff0000; }
.platform-badge[data-platform="pinterest"] { color: #bd081c; }
.platform-badge[data-platform="tool"] { color: var(--color-teal-deep); }
.platform-badge .icon { width: 12px; height: 12px; }

.table-wrap { background: var(--bg-panel); border: 1px solid var(--border-default); border-radius: var(--radius-md); overflow: hidden; box-shadow: var(--shadow-card); }
.table { width: 100%; border-collapse: collapse; font-size: var(--type-sm); }
.table th, .table td { padding: var(--space-3) var(--space-4); text-align: left; vertical-align: middle; }
.table th { background: var(--bg-panel-mist); font-weight: var(--weight-semibold); font-size: var(--type-xs); text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); border-bottom: 1px solid var(--border-default); }
.table tbody tr { border-top: 1px solid var(--border-default); transition: background var(--motion-fast); }
.table tbody tr:first-child { border-top: 0; }
.table tbody tr:hover { background: var(--bg-panel-mist); }
.table td.numeric { font-variant-numeric: tabular-nums; text-align: right; }

.empty { text-align: center; padding: var(--space-12) var(--space-6); color: var(--text-muted); background: var(--bg-panel); border: 1px dashed var(--border-strong); border-radius: var(--radius-md); }
.empty__icon { width: 48px; height: 48px; margin: 0 auto var(--space-4); border-radius: 50%; background: var(--accent-pale); color: var(--color-teal-dark); display: inline-flex; align-items: center; justify-content: center; }
.empty__title { font-size: var(--type-h4); font-weight: var(--weight-semibold); color: var(--text-primary); margin: 0 0 var(--space-1); }
.empty__hint { font-size: var(--type-sm); color: var(--text-muted); margin: 0 0 var(--space-4); }

.hermes-row { display: grid; grid-template-columns: 32px 1fr auto; align-items: flex-start; gap: var(--space-3); padding: var(--space-3) var(--space-4); border-radius: var(--radius-sm); background: var(--bg-panel); border: 1px solid var(--border-default); }
.hermes-row__avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--brand-gradient); color: var(--text-on-dark); display: inline-flex; align-items: center; justify-content: center; }
.hermes-row__body { display: flex; flex-direction: column; gap: 2px; }
.hermes-row__title { font-weight: var(--weight-semibold); color: var(--text-primary); font-size: var(--type-sm); }
.hermes-row__meta  { font-size: var(--type-xs); color: var(--text-muted); }
.hermes-row__time  { font-size: var(--type-xs); color: var(--text-muted); white-space: nowrap; }

.section-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(360px, 1fr)); gap: var(--space-4); }

.row { display: flex; align-items: center; gap: var(--space-3); min-width: 0; }
.row--between { justify-content: space-between; flex-wrap: wrap; }
.row--wrap { flex-wrap: wrap; }
.stack { display: flex; flex-direction: column; gap: var(--space-3); }
.stack--md { gap: var(--space-4); }
.stack--lg { gap: var(--space-6); }
.text-muted { color: var(--text-muted); }
.text-strong { color: var(--text-primary); font-weight: var(--weight-semibold); }
.text-sm { font-size: var(--type-sm); }
.text-xs { font-size: var(--type-xs); }
.mono { font-family: var(--font-mono); }
.hidden { display: none !important; }
.spacer { flex: 1; }

/* === Triage console (formerly Next Best Action) === */
.triage { padding: var(--space-5) var(--space-6); border-radius: var(--radius-lg); border: 1px solid color-mix(in srgb, var(--color-blue) 30%, transparent); background: linear-gradient(120deg, rgba(11, 78, 143, 0.08), rgba(32, 198, 173, 0.10)); position: relative; overflow: hidden; min-width: 0; display: flex; flex-direction: column; gap: var(--space-3); }
.triage::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 4px; background: var(--brand-gradient); }
.triage__eyebrow { display: inline-flex; align-items: center; gap: 6px; font-family: var(--font-display); font-size: var(--type-xs); font-weight: var(--weight-bold); letter-spacing: 0.16em; text-transform: uppercase; color: var(--accent-primary); }
.triage__eyebrow .icon { color: var(--accent-secondary); }
.triage__title { font-family: var(--font-display); font-size: var(--type-h2); font-weight: var(--weight-bold); color: var(--text-primary); margin: 0; line-height: 1.2; }
.triage__why { color: var(--text-muted); font-size: var(--type-sm); margin: 0; }
.triage__why strong { color: var(--text-primary); font-weight: var(--weight-semibold); }
.triage__actions { display: flex; gap: var(--space-2); flex-wrap: wrap; margin-top: var(--space-2); }
.triage--quiet { background: color-mix(in srgb, var(--color-success) 8%, transparent); border-color: color-mix(in srgb, var(--color-success) 22%, transparent); color: var(--color-success); }
.triage--quiet::before { background: var(--color-success); }
.triage--quiet .icon, .triage--quiet .triage__title { color: var(--color-success); }
.triage--quiet .triage__title { font-size: var(--type-h4); font-weight: var(--weight-semibold); }
.triage--reply::before { background: linear-gradient(180deg, var(--color-info), var(--color-blue)); }
.triage--attention::before { background: linear-gradient(180deg, var(--color-warning), var(--color-danger)); }

/* === Followup counts — plain-English sentence === */
.fcounts { display: flex; align-items: center; justify-content: space-between; gap: var(--space-4); flex-wrap: wrap; padding: var(--space-3) var(--space-4); border: 1px solid var(--border-default); border-radius: var(--radius-md); background: var(--bg-panel); }
.fcounts__sentence { font-size: var(--type-body); color: var(--text-primary); }
.fcounts__sentence strong { font-family: var(--font-display); font-weight: var(--weight-bold); }
.fcounts__urgent { color: var(--color-danger); }
.fcounts__upcoming { color: var(--color-info); }
.fcounts__link { font-weight: var(--weight-semibold); font-size: var(--type-sm); white-space: nowrap; }

/* === KPI compact row + More metrics collapse === */
.kpi-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: var(--space-3); }
.kpi-row .kpi { padding: var(--space-4); }
.kpi-row .kpi__value { font-size: var(--type-h2); }
.more-metrics { background: var(--bg-panel); border: 1px solid var(--border-default); border-radius: var(--radius-md); padding: 0; }
.more-metrics > summary { padding: var(--space-3) var(--space-5); cursor: pointer; font-weight: var(--weight-semibold); font-size: var(--type-sm); color: var(--text-secondary); display: flex; align-items: center; gap: var(--space-2); list-style: none; }
.more-metrics > summary::-webkit-details-marker { display: none; }
.more-metrics > summary::before { content: "▸"; font-size: 10px; transition: transform var(--motion-fast); color: var(--text-muted); }
.more-metrics[open] > summary::before { transform: rotate(90deg); }
.more-metrics > summary:hover { color: var(--text-primary); }
.more-metrics__chips { display: flex; flex-wrap: wrap; gap: var(--space-2); padding: 0 var(--space-5) var(--space-4); }
.metric-chip { display: inline-flex; align-items: baseline; gap: var(--space-2); padding: var(--space-1) var(--space-3); border-radius: var(--radius-pill); background: var(--bg-panel-mist); border: 1px solid var(--border-default); font-size: var(--type-sm); }
.metric-chip__value { font-family: var(--font-display); font-weight: var(--weight-bold); color: var(--text-primary); }
.metric-chip__label { color: var(--text-muted); font-size: var(--type-xs); }

/* === Inline lead-card actions === */
.lead-actions { display: flex; gap: var(--space-2); margin-top: var(--space-3); flex-wrap: wrap; }
.lead-actions form { display: contents; }

/* === Compact lead row (Today urgent queue — 5+ above the fold) === */
.lead-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--space-3); align-items: center; padding: var(--space-3) var(--space-4); border-bottom: 1px solid var(--border-default); }
.lead-row:last-child { border-bottom: 0; }
.lead-row[data-skipped="1"] { display: none; }
.lead-row__body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.lead-row__line1 { display: flex; align-items: center; gap: var(--space-2); flex-wrap: wrap; }
.lead-row__title { font-size: var(--type-body); font-weight: var(--weight-semibold); color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 60ch; }
.lead-row__title a { color: inherit; }
.lead-row__line2, .lead-row__line3 { font-size: var(--type-xs); color: var(--text-muted); display: flex; align-items: center; gap: var(--space-2); flex-wrap: wrap; }
.lead-row__line2 .platform-badge { transform: scale(0.95); }
.lead-row__actions { display: flex; align-items: center; gap: var(--space-2); flex-wrap: wrap; justify-content: flex-end; }
.lead-row__actions .btn--sm { min-height: 28px; padding: var(--space-1) var(--space-3); font-size: var(--type-xs); }
.lead-row-list { background: var(--bg-panel); border: 1px solid var(--border-default); border-radius: var(--radius-md); box-shadow: var(--shadow-card); overflow: hidden; }

/* === Approvals === */
.approval-split { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: var(--space-4); align-items: start; }
.approval-panel { background: var(--bg-panel); border: 1px solid var(--border-default); border-radius: var(--radius-md); box-shadow: var(--shadow-card); overflow: hidden; }
.approval-panel__header { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--space-3); padding: var(--space-4) var(--space-5); border-bottom: 1px solid var(--border-default); background: var(--bg-panel-mist); }
.approval-panel__title { font-size: var(--type-h4); font-weight: var(--weight-semibold); margin: 0; }
.approval-panel__description { color: var(--text-muted); font-size: var(--type-sm); margin: var(--space-1) 0 0; }
.approval-post { padding: var(--space-4) var(--space-5); border-bottom: 1px solid var(--border-default); display: flex; flex-direction: column; gap: var(--space-3); }
.approval-post:last-child { border-bottom: 0; }
.approval-post__meta { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); flex-wrap: wrap; }
.approval-post__body { white-space: pre-wrap; color: var(--text-primary); font-size: var(--type-sm); margin: 0; }
.approval-post__visual { display: grid; gap: var(--space-2); padding: var(--space-3); border: 1px solid var(--border-default); border-radius: var(--radius-sm); background: var(--bg-panel-mist); }
.approval-post__visual-header { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); flex-wrap: wrap; }
.approval-post__visual-image { display: block; width: min(100%, 420px); max-height: 300px; object-fit: contain; border-radius: var(--radius-sm); border: 1px solid var(--border-default); background: var(--bg-panel); }
.approval-post__visual-spec { color: var(--text-secondary); font-size: var(--type-xs); }
.approval-post__visual-spec summary { cursor: pointer; color: var(--text-primary); font-weight: var(--weight-semibold); }
.approval-post__visual-spec pre { white-space: pre-wrap; overflow-wrap: anywhere; margin: var(--space-2) 0 0; max-height: 180px; overflow: auto; font-family: var(--font-mono); font-size: var(--type-xs); line-height: 1.5; }
.approval-post__actions { display: flex; gap: var(--space-2); flex-wrap: wrap; }
.approval-warnings { display: flex; flex-direction: column; gap: var(--space-1); }
.approval-empty { padding: var(--space-6); color: var(--text-muted); font-size: var(--type-sm); }
.approval-request__heading { display: flex; flex-direction: column; gap: 2px; }
.approval-request__heading h3 { font-size: var(--type-body); line-height: var(--leading-tight); }
.approval-note { border: 1px solid var(--border-default); background: var(--bg-panel-mist); border-radius: var(--radius-sm); padding: var(--space-3); color: var(--text-secondary); font-size: var(--type-sm); }
.approval-note--warning { border-color: color-mix(in srgb, var(--color-warning) 34%, transparent); background: var(--color-warning-soft); color: color-mix(in srgb, var(--color-warning) 74%, var(--text-primary)); }
.approval-request__status { border-top: 1px solid var(--border-default); padding-top: var(--space-2); }
@media (max-width: 1100px) {
  .approval-split { grid-template-columns: 1fr; }
}

/* === Urgency badges === */
.urgency { display: inline-flex; align-items: center; padding: 2px 10px; border-radius: var(--radius-pill); font-size: var(--type-xs); font-weight: var(--weight-bold); letter-spacing: 0.04em; text-transform: uppercase; border: 1px solid transparent; }
.urgency--overdue { background: var(--color-danger); color: #fff; box-shadow: 0 0 0 3px rgba(214, 69, 69, 0.18); }
.urgency--today   { background: var(--color-warning); color: #fff; }
.urgency--soon    { background: var(--color-warning-soft); color: var(--color-warning); border-color: color-mix(in srgb, var(--color-warning) 30%, transparent); }
.urgency--later   { background: var(--bg-panel-mist); color: var(--text-muted); }
.urgency--fit     { background: var(--accent-pale); color: var(--color-teal-dark); border-color: color-mix(in srgb, var(--color-teal) 30%, transparent); }
.urgency--stale   { background: var(--color-info-soft); color: var(--color-info); }

/* === Compact empty (one-line "All clear" pill) === */
.compact-empty { display: inline-flex; align-items: center; gap: var(--space-2); padding: var(--space-2) var(--space-3); border-radius: var(--radius-md); background: color-mix(in srgb, var(--color-success) 8%, transparent); color: var(--color-success); font-size: var(--type-sm); font-weight: var(--weight-medium); border: 1px solid color-mix(in srgb, var(--color-success) 22%, transparent); }
.compact-empty .icon { color: var(--color-success); }

/* === Quiet bar (full-width single-line "all clear / healthy" row) === */
.quiet-bar { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-2) var(--space-4); border-radius: var(--radius-md); border: 1px solid var(--border-default); background: var(--bg-panel-mist); font-size: var(--type-sm); flex-wrap: wrap; }
.quiet-bar__label { font-weight: var(--weight-semibold); color: var(--text-primary); }
.quiet-bar__hint { color: var(--text-muted); font-size: var(--type-xs); }
.quiet-bar__link { margin-left: auto; font-weight: var(--weight-semibold); }
.quiet-bar--success { background: color-mix(in srgb, var(--color-success) 7%, transparent); border-color: color-mix(in srgb, var(--color-success) 24%, transparent); color: var(--color-success); }
.quiet-bar--success .icon, .quiet-bar--success .quiet-bar__label { color: var(--color-success); }
.quiet-bar--info { background: color-mix(in srgb, var(--color-info) 7%, transparent); border-color: color-mix(in srgb, var(--color-info) 22%, transparent); color: var(--color-info); }
.quiet-bar--info .icon, .quiet-bar--info .quiet-bar__label { color: var(--color-info); }
.quiet-bar--neutral { color: var(--text-secondary); }
.quiet-bar--neutral .icon { color: var(--text-muted); }

/* === Hermes health strip === */
.hermes-strip { background: var(--bg-panel); border: 1px solid var(--border-default); border-radius: var(--radius-md); box-shadow: var(--shadow-card); padding: var(--space-4) var(--space-5); display: flex; flex-direction: column; gap: var(--space-3); position: relative; overflow: hidden; }
.hermes-strip::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 3px; }
.hermes-strip.is-ok::before { background: var(--color-success); }
.hermes-strip.is-warn::before { background: var(--color-warning); }
.hermes-strip.is-stale::before { background: var(--color-info); }
.hermes-strip.is-down::before { background: var(--color-danger); }
.hermes-strip__head { display: flex; align-items: center; gap: var(--space-3); flex-wrap: wrap; }
.hermes-strip__pulse { display: inline-flex; align-items: center; gap: var(--space-2); }
.hermes-strip__pulse .icon { color: var(--color-teal-deep); }
.hermes-strip__status { font-family: var(--font-display); font-weight: var(--weight-bold); font-size: var(--type-sm); letter-spacing: 0.04em; text-transform: uppercase; color: var(--text-primary); }
.hermes-strip.is-warn .hermes-strip__status { color: var(--color-warning); }
.hermes-strip.is-down .hermes-strip__status { color: var(--color-danger); }
.hermes-strip.is-stale .hermes-strip__status { color: var(--color-info); }
.hermes-strip__reason { font-size: var(--type-sm); color: var(--text-muted); }
.hermes-strip__link { margin-left: auto; font-size: var(--type-sm); font-weight: var(--weight-semibold); color: var(--text-link); }
.hermes-strip__row { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: var(--space-2); }
.hermes-strip__stat { display: grid; grid-template-columns: 18px auto 1fr; align-items: center; gap: var(--space-2); padding: var(--space-2) var(--space-3); border: 1px solid var(--border-default); border-radius: var(--radius-sm); background: var(--bg-panel-mist); color: var(--text-primary); text-decoration: none; }
.hermes-strip__stat:hover { background: var(--bg-panel); border-color: var(--border-strong); text-decoration: none; }
.hermes-strip__icon { color: var(--text-muted); display: inline-flex; align-items: center; justify-content: center; }
.hermes-strip__value { font-family: var(--font-display); font-size: var(--type-h4); font-weight: var(--weight-bold); color: var(--text-primary); line-height: 1; }
.hermes-strip__label { font-size: var(--type-xs); color: var(--text-muted); }
.hermes-strip__stat--info .hermes-strip__icon, .hermes-strip__stat--info .hermes-strip__value { color: var(--color-info); }
.hermes-strip__stat--warning .hermes-strip__icon, .hermes-strip__stat--warning .hermes-strip__value { color: var(--color-warning); }
.hermes-strip__stat--danger .hermes-strip__icon, .hermes-strip__stat--danger .hermes-strip__value { color: var(--color-danger); }
.hermes-strip__stat--success .hermes-strip__icon, .hermes-strip__stat--success .hermes-strip__value { color: var(--color-success); }

/* === Critical KPI variant (border accent + tone) === */
.kpi--alert { border-color: color-mix(in srgb, var(--color-danger) 35%, transparent); box-shadow: 0 0 0 1px color-mix(in srgb, var(--color-danger) 10%, transparent), 0 12px 32px rgba(214, 69, 69, 0.10); }
.kpi--alert::before { background: linear-gradient(90deg, var(--color-danger), var(--color-warning)) !important; opacity: 1 !important; }
.kpi--alert .kpi__value { color: var(--color-danger); }

/* === Work queue (full-width section above KPIs) === */
.work-queue { display: flex; flex-direction: column; gap: var(--space-4); }
.work-queue__title { display: inline-flex; align-items: center; gap: var(--space-2); font-family: var(--font-display); font-size: var(--type-xs); font-weight: var(--weight-bold); letter-spacing: 0.16em; text-transform: uppercase; color: var(--accent-primary); }
.work-queue__group { background: var(--bg-panel); border: 1px solid var(--border-default); border-radius: var(--radius-md); box-shadow: var(--shadow-card); padding: var(--space-5); display: flex; flex-direction: column; gap: var(--space-3); }
.work-queue__group--alert { border-color: color-mix(in srgb, var(--color-danger) 30%, transparent); }
.work-queue__group--warn { border-color: color-mix(in srgb, var(--color-warning) 30%, transparent); }
.work-queue__head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); flex-wrap: wrap; }
.work-queue__head > .stack { min-width: 0; flex: 1 1 auto; }
.work-queue__heading { font-size: var(--type-h4); font-weight: var(--weight-semibold); margin: 0; min-width: 0; overflow-wrap: anywhere; }
.work-queue__count { font-family: var(--font-display); font-size: var(--type-h2); font-weight: var(--weight-bold); line-height: 1; color: var(--text-primary); }
.work-queue__count--danger { color: var(--color-danger); }
.work-queue__count--warning { color: var(--color-warning); }
.work-queue__hint { color: var(--text-muted); font-size: var(--type-sm); }

/* === Daily digest hero === */
.digest {
  background: linear-gradient(135deg, rgba(11, 78, 143, 0.04), rgba(32, 198, 173, 0.06));
  border: 1px solid color-mix(in srgb, var(--accent-secondary) 25%, transparent);
  border-radius: var(--radius-md);
  padding: var(--space-4) var(--space-5);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}
.digest__title { display: inline-flex; align-items: center; gap: var(--space-2); font-size: var(--type-sm); font-weight: var(--weight-semibold); color: var(--text-primary); flex-wrap: wrap; }
.digest__title .icon { color: var(--accent-secondary); }
.digest__quiet { font-weight: var(--weight-regular); color: var(--text-muted); }
.digest__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: var(--space-3); }
.digest__item { display: grid; grid-template-columns: 18px auto 1fr; align-items: center; gap: var(--space-2); padding: var(--space-2) var(--space-3); border: 1px solid var(--border-default); border-radius: var(--radius-sm); background: var(--bg-panel); }
.digest__icon { color: var(--text-muted); display: inline-flex; align-items: center; justify-content: center; }
.digest__value { font-family: var(--font-display); font-size: var(--type-h3); font-weight: var(--weight-bold); color: var(--text-primary); line-height: 1; }
.digest__label { font-size: var(--type-xs); color: var(--text-muted); }
.digest__item--info .digest__icon, .digest__item--info .digest__value { color: var(--color-info); }
.digest__item--success .digest__icon, .digest__item--success .digest__value { color: var(--color-success); }
.digest__item--warning .digest__icon, .digest__item--warning .digest__value { color: var(--color-warning); }

/* === Command palette === */
.cmdk { position: fixed; inset: 0; z-index: 100; display: flex; align-items: flex-start; justify-content: center; padding-top: 12vh; }
.cmdk[hidden] { display: none; }
.cmdk__backdrop { position: absolute; inset: 0; background: rgba(7, 20, 33, 0.45); backdrop-filter: blur(4px); }
.cmdk__panel { position: relative; width: min(640px, 92vw); background: var(--bg-panel); border: 1px solid var(--border-default); border-radius: var(--radius-lg); box-shadow: var(--shadow-modal); overflow: hidden; display: flex; flex-direction: column; max-height: 70vh; }
.cmdk__input-row { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-4) var(--space-5); border-bottom: 1px solid var(--border-default); color: var(--text-muted); }
.cmdk__input { flex: 1; border: 0; outline: 0; background: transparent; font-size: var(--type-h4); color: var(--text-primary); padding: 0; }
.cmdk__input::placeholder { color: var(--text-muted); }
.cmdk__kbd, .cmdk__footer kbd { display: inline-flex; align-items: center; padding: 1px 6px; font-size: var(--type-xs); font-weight: var(--weight-semibold); background: var(--bg-panel-mist); border: 1px solid var(--border-default); border-radius: var(--radius-xs); color: var(--text-secondary); }
.cmdk__results { overflow-y: auto; padding: var(--space-2); flex: 1; }
.cmdk__hint { padding: var(--space-6) var(--space-3); color: var(--text-muted); font-size: var(--type-sm); text-align: center; }
.cmdk__group { padding: var(--space-2) 0; }
.cmdk__group-label { font-size: var(--type-xs); font-weight: var(--weight-bold); letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-muted); padding: var(--space-1) var(--space-3); }
.cmdk__item { display: grid; grid-template-columns: 18px 1fr auto; gap: var(--space-3); align-items: center; padding: var(--space-3); border-radius: var(--radius-sm); cursor: pointer; color: var(--text-primary); font-size: var(--type-sm); border: 0; background: transparent; width: 100%; text-align: left; text-decoration: none; }
.cmdk__item:hover, .cmdk__item.is-active { background: var(--accent-pale); color: var(--accent-primary); }
.cmdk__item-label { font-weight: var(--weight-semibold); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cmdk__item-hint { font-size: var(--type-xs); color: var(--text-muted); white-space: nowrap; }
.cmdk__item-icon { color: var(--text-muted); display: inline-flex; align-items: center; justify-content: center; }
.cmdk__item.is-active .cmdk__item-icon, .cmdk__item.is-active .cmdk__item-hint { color: var(--accent-primary); }
.cmdk__footer { display: flex; align-items: center; gap: var(--space-4); padding: var(--space-2) var(--space-5); border-top: 1px solid var(--border-default); font-size: var(--type-xs); color: var(--text-muted); }
.cmdk__footer span { display: inline-flex; align-items: center; gap: 4px; }

/* === Focus mode (Triage) — hides sidebar, lets main fill width === */
.app--focus { grid-template-columns: minmax(0, 1fr); grid-template-areas: "topbar" "main"; }
[data-focus-mode="1"] .app__main { padding: var(--space-6) var(--space-8); max-width: 1100px; }

/* === Triage workstation === */
.triage-shell { display: flex; flex-direction: column; gap: var(--space-5); min-width: 0; }
.triage-mode { display: flex; align-items: stretch; justify-content: space-between; gap: var(--space-4); padding: var(--space-4) var(--space-5); border-radius: var(--radius-lg); border: 1px solid color-mix(in srgb, var(--color-blue) 24%, transparent); background: linear-gradient(120deg, rgba(11, 78, 143, 0.10), rgba(32, 198, 173, 0.08)); position: relative; overflow: hidden; flex-wrap: wrap; }
.triage-mode__main { flex: 1; min-width: 280px; display: flex; flex-direction: column; gap: var(--space-2); }
.triage-mode__title { display: inline-flex; align-items: center; gap: var(--space-2); }
.triage-mode__pulse { width: 10px; height: 10px; border-radius: 50%; background: var(--color-success); box-shadow: 0 0 0 4px color-mix(in srgb, var(--color-success) 25%, transparent); animation: triage-pulse 1.6s ease-in-out infinite; }
@keyframes triage-pulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: 0.55; transform: scale(0.92); } }
.triage-mode__label { font-family: var(--font-display); font-weight: var(--weight-bold); font-size: var(--type-xs); letter-spacing: 0.18em; text-transform: uppercase; color: var(--accent-primary); }
.triage-mode__stats { display: flex; align-items: baseline; gap: var(--space-2); flex-wrap: wrap; color: var(--text-primary); }
.triage-mode__stat { display: inline-flex; align-items: baseline; gap: var(--space-1); }
.triage-mode__stat strong { font-family: var(--font-display); font-weight: var(--weight-bold); font-size: var(--type-h3); line-height: 1; color: var(--text-primary); }
.triage-mode__stat--cleared strong { color: var(--color-success); }
.triage-mode__stat--remaining strong { color: var(--color-danger); }
.triage-mode__statlabel { font-size: var(--type-xs); color: var(--text-muted); letter-spacing: 0.04em; }
.triage-mode__sep { color: var(--text-muted); }
.triage-mode__bar { height: 6px; background: var(--bg-panel-mist); border-radius: 999px; overflow: hidden; margin-top: var(--space-1); }
.triage-mode__bar-fill { height: 100%; background: var(--brand-gradient); transition: width var(--motion-base); width: 0%; }
.triage-mode__exit { display: flex; align-items: center; }
.triage-shell__shortcuts { display: flex; align-items: center; gap: var(--space-3); flex-wrap: wrap; padding: var(--space-2) var(--space-4); background: var(--bg-panel); border: 1px solid var(--border-default); border-radius: var(--radius-md); }
.triage-shell__shortcuts-label { font-size: var(--type-xs); font-weight: var(--weight-bold); letter-spacing: 0.14em; text-transform: uppercase; color: var(--text-muted); margin-right: var(--space-1); }
.kchip { display: inline-flex; align-items: center; gap: 4px; font-size: var(--type-xs); color: var(--text-muted); }
.kchip kbd { font-family: var(--font-sans); font-weight: var(--weight-semibold); background: var(--bg-panel-mist); border: 1px solid var(--border-default); border-radius: var(--radius-xs); padding: 1px 6px; min-width: 18px; text-align: center; color: var(--text-primary); }

.triage-deck { display: flex; flex-direction: column; gap: var(--space-4); position: relative; min-height: 360px; }
.triage-card { background: var(--bg-panel); border: 1px solid var(--border-default); border-radius: var(--radius-lg); box-shadow: var(--shadow-card); padding: var(--space-8); display: flex; flex-direction: column; gap: var(--space-4); }
.triage-card[hidden] { display: none; }
.triage-card__top { display: flex; align-items: center; gap: var(--space-2); flex-wrap: wrap; }
.triage-card__title { font-size: var(--type-display); font-weight: var(--weight-bold); margin: 0; line-height: 1.05; letter-spacing: -0.02em; }
.triage-card__meta { display: flex; align-items: center; gap: var(--space-3); flex-wrap: wrap; }
.triage-card__why { color: var(--text-secondary); font-size: var(--type-body); margin: 0; padding: var(--space-3) var(--space-4); background: var(--bg-panel-mist); border-radius: var(--radius-md); border-left: 3px solid var(--accent-secondary); }
.triage-card__why strong { color: var(--text-primary); }
.triage-card__context { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: var(--space-2); }
.triage-card__ctxrow { display: flex; flex-direction: column; gap: 2px; padding: var(--space-2) var(--space-3); border: 1px solid var(--border-default); border-radius: var(--radius-sm); background: var(--bg-panel); }
.triage-card__ctxlabel { font-size: var(--type-xs); color: var(--text-muted); letter-spacing: 0.06em; text-transform: uppercase; }
.triage-card__ctxvalue { font-family: var(--font-display); font-size: var(--type-h4); font-weight: var(--weight-semibold); color: var(--text-primary); }
.triage-card__reply { margin: 0; padding: var(--space-4); background: color-mix(in srgb, var(--color-info) 5%, transparent); border-left: 3px solid var(--color-info); border-radius: var(--radius-sm); }
.triage-card__reply .eyebrow { color: var(--color-info); }
.triage-card__reply p { margin: var(--space-2) 0 0 0; color: var(--text-primary); }
.triage-card__actions { display: flex; gap: var(--space-3); flex-wrap: wrap; padding-top: var(--space-3); border-top: 1px solid var(--border-default); margin-top: var(--space-2); }

/* === Outcome capture (post-DM) === */
.outcome { display: flex; flex-direction: column; gap: var(--space-3); padding: var(--space-4) var(--space-5); border-radius: var(--radius-md); border: 1px solid color-mix(in srgb, var(--accent-secondary) 32%, transparent); background: color-mix(in srgb, var(--color-teal) 6%, transparent); margin-top: var(--space-2); }
.outcome[hidden] { display: none; }
.outcome__head { display: flex; align-items: center; gap: var(--space-2); flex-wrap: wrap; }
.outcome__eyebrow { display: inline-flex; align-items: center; gap: 4px; font-family: var(--font-display); font-size: var(--type-xs); font-weight: var(--weight-bold); letter-spacing: 0.16em; text-transform: uppercase; color: var(--color-teal-deep); }
.outcome__hint { color: var(--text-muted); font-size: var(--type-sm); }
.outcome__buttons { display: flex; gap: var(--space-2); flex-wrap: wrap; }
.btn__kbd { font-family: var(--font-sans); font-weight: var(--weight-semibold); background: rgba(255, 255, 255, 0.18); border: 1px solid rgba(255, 255, 255, 0.28); border-radius: var(--radius-xs); padding: 0 4px; font-size: 10px; margin-left: var(--space-2); }
.btn--secondary .btn__kbd, .btn--ghost .btn__kbd { background: var(--bg-panel-mist); border-color: var(--border-default); color: var(--text-secondary); }

.triage-card--clear { align-items: center; text-align: center; padding: var(--space-12); }
.triage-card--clear h2 { font-size: var(--type-h1); margin: 0; }
.triage-shell--clear { padding: var(--space-12); display: flex; align-items: center; justify-content: center; min-height: 60vh; }
.triage-shell__clear { display: flex; flex-direction: column; align-items: center; gap: var(--space-3); text-align: center; }
.triage-shell__clear-icon { width: 80px; height: 80px; border-radius: 50%; background: color-mix(in srgb, var(--color-success) 12%, transparent); color: var(--color-success); display: inline-flex; align-items: center; justify-content: center; }
.triage-shell__clear h1 { font-family: var(--font-display); font-size: var(--type-h1); margin: 0; }

.triage-shell__upnext { display: flex; align-items: center; gap: var(--space-2); padding: var(--space-3) var(--space-4); border: 1px dashed var(--border-strong); border-radius: var(--radius-md); color: var(--text-secondary); font-size: var(--type-sm); }
.triage-shell__upnext [data-triage-upnext-name] { font-weight: var(--weight-semibold); color: var(--text-primary); }

.triage-shortcuts-overlay { position: fixed; inset: 0; background: rgba(7, 20, 33, 0.6); backdrop-filter: blur(4px); display: flex; align-items: center; justify-content: center; z-index: 200; padding: var(--space-6); }
.triage-shortcuts-overlay[hidden] { display: none; }
.triage-shortcuts-overlay__panel { background: var(--bg-panel); border-radius: var(--radius-lg); box-shadow: var(--shadow-modal); padding: var(--space-6); max-width: 360px; width: 100%; display: flex; flex-direction: column; gap: var(--space-3); }
.triage-shortcuts-overlay__row { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); padding: var(--space-2) 0; border-bottom: 1px solid var(--border-default); }
.triage-shortcuts-overlay__row:last-child { border-bottom: 0; }

/* === ArtBot campaign center === */
.campaign-focus { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(220px, 0.6fr); gap: var(--space-5); align-items: start; }
.work-item { display: flex; gap: var(--space-3); align-items: flex-start; color: var(--text-secondary); }
.work-item__icon { width: 24px; height: 24px; border-radius: var(--radius-pill); background: var(--color-success-soft); color: var(--color-success); display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.media-preview-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: var(--space-3); margin-top: var(--space-5); }
.media-preview-card { border: 1px solid var(--border-default); border-radius: var(--radius-sm); overflow: hidden; background: var(--bg-panel-mist); min-width: 0; }
.media-preview-card img { display: block; width: 100%; aspect-ratio: 1 / 1; object-fit: cover; }
.media-preview-card__video { width: 100%; aspect-ratio: 1 / 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--space-2); color: var(--text-secondary); background: var(--bg-panel); font-size: var(--type-xs); text-align: center; padding: var(--space-3); }
.media-preview-card__label { display: block; padding: var(--space-2); font-family: var(--font-mono); font-size: 0.68rem; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.draft-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: var(--space-4); }
.draft-card { border: 1px solid var(--border-default); border-radius: var(--radius-md); background: var(--bg-panel); padding: var(--space-4); display: flex; flex-direction: column; gap: var(--space-4); min-width: 0; }
.draft-card h3 { font-size: var(--type-h4); }
.performance-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: var(--space-4); }
.performance-card { border: 1px solid var(--border-default); border-radius: var(--radius-md); background: var(--bg-panel); padding: var(--space-4); display: flex; flex-direction: column; gap: var(--space-4); min-width: 0; }
.performance-card h3 { font-size: var(--type-h4); }
.metric-strip { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--space-2); }
.metric-chip { border: 1px solid var(--border-default); border-radius: var(--radius-sm); padding: var(--space-2); background: var(--bg-panel-mist); min-width: 0; }
.metric-chip strong, .metric-chip span { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.metric-chip strong { font-size: var(--type-sm); color: var(--text-primary); }
.metric-chip span { font-size: var(--type-xs); color: var(--text-muted); }
.performance-form { display: flex; flex-direction: column; gap: var(--space-2); }
.performance-form input, .performance-form textarea { width: 100%; border: 1px solid var(--border-default); border-radius: var(--radius-sm); background: var(--bg-panel); color: var(--text-primary); font: inherit; font-size: var(--type-sm); padding: var(--space-2) var(--space-3); }
.performance-form textarea { resize: vertical; }
.performance-form__metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--space-2); }
.performance-form__details { border: 1px solid var(--border-default); border-radius: var(--radius-sm); padding: var(--space-2); }
.performance-form__details summary { cursor: pointer; color: var(--text-secondary); font-size: var(--type-sm); }
.performance-form__details > div, .performance-form__details > textarea { margin-top: var(--space-2); }
.preserve-lines { white-space: pre-line; }
.markdown-pre { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; font-family: var(--font-sans); font-size: var(--type-sm); line-height: var(--leading-body); color: var(--text-secondary); }

/* === Content operations command center === */
body[data-active-path="/content-ops"] .app__main { max-width: 1380px; padding-top: var(--space-6); }
.content-ops { max-width: 1380px; gap: var(--space-5); }
.ops-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: var(--space-4);
  align-items: center;
  border-bottom: 1px solid var(--border-default);
  padding: var(--space-1) 0 var(--space-5);
}
.ops-hero__copy { display: flex; flex-direction: column; gap: var(--space-1); min-width: 0; }
.ops-hero__title-row { display: flex; align-items: center; gap: var(--space-2); flex-wrap: wrap; }
.ops-hero__copy h1 { font-size: var(--type-h2); letter-spacing: -0.01em; }
.ops-hero__copy p { max-width: 62ch; color: var(--text-secondary); margin: 0; font-size: var(--type-sm); }
.ops-hero__actions { display: flex; gap: var(--space-2); flex-wrap: wrap; justify-content: flex-end; }
.ops-hero__actions .btn { min-height: 34px; }
.ops-hero__meta { grid-column: 1 / -1; display: flex; align-items: center; gap: var(--space-2); flex-wrap: wrap; padding-top: var(--space-2); color: var(--text-muted); font-size: var(--type-sm); }
.ops-hero__meta span { display: inline-flex; align-items: baseline; gap: 4px; padding: 5px 9px; border: 1px solid var(--border-default); border-radius: var(--radius-md); background: var(--bg-panel); }
.ops-hero__meta strong { color: var(--text-primary); }
.ops-hero__timestamp { margin-left: auto; background: transparent !important; border-color: transparent !important; padding-right: 0 !important; }

.ops-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(300px, 352px); gap: var(--space-4); align-items: start; }
.ops-layout__main, .ops-layout__side { min-width: 0; }
.ops-layout__side { position: sticky; top: calc(var(--topbar-height) + var(--space-4)); }
.ops-panel { background: var(--bg-panel); border: 1px solid var(--border-default); border-radius: var(--radius-md); box-shadow: var(--shadow-card); padding: var(--space-4); min-width: 0; }
.ops-panel--side { padding: 0; overflow: hidden; }
.ops-panel__header { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--space-3); margin-bottom: var(--space-4); }
.ops-panel--side .ops-panel__header { margin: 0; padding: var(--space-3) var(--space-4); border-bottom: 1px solid var(--border-default); background: color-mix(in srgb, var(--bg-panel) 70%, var(--bg-panel-mist)); }
.ops-panel__header h2 { font-size: var(--type-h4); }
.ops-panel__header p { margin: 2px 0 0; color: var(--text-muted); font-size: var(--type-sm); max-width: 72ch; }
.ops-panel__body { padding: var(--space-3) var(--space-4) var(--space-4); }
.ops-panel__link { white-space: nowrap; font-size: var(--type-sm); font-weight: var(--weight-semibold); }

.ops-cadence-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-3); }
.ops-cadence-card { display: grid; grid-template-columns: 34px minmax(0, 1fr) 58px; gap: var(--space-3); align-items: center; border: 1px solid var(--border-default); border-radius: var(--radius-md); background: var(--bg-panel-mist); padding: var(--space-3); min-width: 0; }
.ops-cadence-card__icon { width: 34px; height: 34px; border-radius: var(--radius-sm); display: inline-flex; align-items: center; justify-content: center; color: var(--color-blue); background: var(--bg-panel); border: 1px solid var(--border-default); }
.ops-cadence-card__body { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.ops-cadence-card__body strong { font-size: var(--type-sm); color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ops-cadence-card__body span, .ops-cadence-card__body small { color: var(--text-muted); font-size: var(--type-xs); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ops-ring { width: 52px; height: 52px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: conic-gradient(var(--color-teal) 68%, var(--border-default) 0); color: var(--text-primary); font-family: var(--font-display); font-weight: var(--weight-bold); font-size: var(--type-sm); }
.ops-ring[data-health="needs_work"] { background: conic-gradient(var(--color-warning) 36%, var(--border-default) 0); }
.ops-ring span { width: 40px; height: 40px; border-radius: 50%; background: var(--bg-panel); display: inline-flex; align-items: center; justify-content: center; }

.ops-pipeline { display: grid; grid-template-columns: repeat(4, minmax(150px, 1fr)); gap: var(--space-2); }
.ops-stage { display: grid; grid-template-columns: 34px minmax(0, 1fr); align-items: center; gap: var(--space-2); padding: var(--space-2); border: 1px solid var(--border-default); border-radius: var(--radius-md); background: var(--bg-panel-mist); min-width: 0; }
.ops-stage.is-active { border-color: color-mix(in srgb, var(--color-blue) 28%, var(--border-default)); background: color-mix(in srgb, var(--color-info) 6%, var(--bg-panel)); }
.ops-stage__icon { width: 34px; height: 34px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: var(--bg-panel); border: 1px solid var(--border-default); color: var(--color-blue); font-size: 0.68rem; font-weight: var(--weight-bold); }
.ops-stage strong, .ops-stage span { display: block; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ops-stage strong { color: var(--text-primary); font-size: var(--type-xs); }
.ops-stage span { color: var(--text-muted); font-size: var(--type-sm); font-family: var(--font-display); font-weight: var(--weight-bold); }

.ops-queue-item { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); padding: var(--space-3) 0; color: inherit; border-bottom: 1px solid var(--border-default); text-decoration: none; }
.ops-queue-item:last-child { border-bottom: 0; }
.ops-queue-item:hover { text-decoration: none; }
.ops-queue-item > div { min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.ops-queue-item strong { color: var(--text-primary); font-size: var(--type-sm); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ops-queue-item span { color: var(--text-muted); font-size: var(--type-xs); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ops-audit-row { display: flex; flex-direction: column; gap: 1px; padding: var(--space-2) 0; border-bottom: 1px solid var(--border-default); }
.ops-audit-row:last-child { border-bottom: 0; }
.ops-audit-row strong { color: var(--text-primary); font-size: var(--type-sm); }
.ops-audit-row span { color: var(--text-muted); font-size: var(--type-xs); }
.ops-readiness__missing { display: flex; flex-wrap: wrap; gap: var(--space-1); }
.ops-readiness__missing code { display: inline-flex; max-width: 100%; padding: 3px 7px; border-radius: var(--radius-sm); border: 1px solid var(--border-default); background: var(--bg-panel-mist); color: var(--text-secondary); font-size: 0.7rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ops-readiness__missing small { color: var(--text-muted); font-size: var(--type-xs); align-self: center; }

@media (max-width: 1180px) {
  .ops-layout { grid-template-columns: 1fr; }
  .ops-layout__side { position: static; }
  .ops-cadence-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ops-pipeline { grid-template-columns: repeat(3, minmax(150px, 1fr)); }
}

@media (max-width: 720px) {
  body[data-active-path="/content-ops"] .app__main { padding-top: var(--space-4); }
  .ops-hero { grid-template-columns: 1fr; }
  .ops-hero__actions { justify-content: flex-start; }
  .ops-hero__timestamp { margin-left: 0; width: 100%; }
  .ops-cadence-grid, .ops-pipeline { grid-template-columns: 1fr; }
}

/* === Automation proof === */
.proof-grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.8fr); gap: var(--space-4); align-items: start; }
.proof-shot-wrap { display: flex; flex-direction: column; gap: var(--space-3); }
.proof-shot { display: block; border: 1px solid var(--border-default); border-radius: var(--radius-sm); overflow: hidden; background: var(--bg-panel-mist); box-shadow: var(--shadow-sm); }
.proof-shot:hover { border-color: var(--accent-secondary); text-decoration: none; }
.proof-shot--failed { display: none; }
.proof-shot img { display: block; width: 100%; max-height: 720px; object-fit: contain; background: var(--bg-panel); }
.proof-shot-fallback { border: 1px dashed var(--border-strong); border-radius: var(--radius-sm); padding: var(--space-4); background: var(--bg-panel-mist); color: var(--text-secondary); font-size: var(--type-sm); }
.proof-shot-fallback strong, .proof-shot-fallback span { display: block; }
.proof-body { white-space: pre-wrap; color: var(--text-primary); font-size: var(--type-sm); margin: 0; }
.proof-meta-grid { display: grid; grid-template-columns: minmax(88px, max-content) minmax(0, 1fr); gap: var(--space-2) var(--space-3); align-items: start; font-size: var(--type-sm); }
.proof-meta-grid code { overflow-wrap: anywhere; }
.proof-json { max-height: 360px; overflow: auto; padding: var(--space-3); border: 1px solid var(--border-default); border-radius: var(--radius-sm); background: var(--bg-panel-mist); color: var(--text-primary); font-size: var(--type-xs); line-height: 1.5; }

@media (max-width: 720px) {
  .campaign-focus { grid-template-columns: 1fr; }
  .performance-form__metrics, .metric-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 980px) {
  .proof-grid { grid-template-columns: 1fr; }
}

@media print {
  .topbar, .sidebar { display: none !important; }
  .app { grid-template-columns: 1fr; grid-template-areas: "main"; }
  .app__main { padding: 0; max-width: none; }
  body { background: #fff; }
  .cmdk { display: none !important; }
}
