/* ============================================================
   Content OS — design tokens
   Palette + type pulled straight from wepeka.com (warm near-black,
   amber accent, Grift Black display / JUST Sans body)
   ============================================================ */
@font-face{ font-family:"Grift Black"; src:url("../fonts/grift-black.ttf") format("truetype"); font-weight:900; font-style:normal; font-display:swap; }
@font-face{ font-family:"JUST Sans"; src:url("../fonts/JUST Sans Regular.otf") format("opentype"); font-weight:400; font-style:normal; font-display:swap; }
@font-face{ font-family:"JUST Sans"; src:url("../fonts/JUST Sans SemiBold.woff2") format("woff2"); font-weight:600; font-style:normal; font-display:swap; }
@font-face{ font-family:"JUST Sans"; src:url("../fonts/JUST Sans Bold.woff2") format("woff2"); font-weight:700; font-style:normal; font-display:swap; }
@font-face{ font-family:"JUST Sans"; src:url("../fonts/JUST Sans ExBold.woff2") format("woff2"); font-weight:800; font-style:normal; font-display:swap; }

:root{
  color-scheme: dark;
  --bg: #0c0b0a;
  --bg-raised: #131211;
  --surface: #17161400 ;
  --surface: #171614;
  --surface-2: #1d1b18;
  --surface-hover: #211f1b;
  --border: #2c2925;
  --border-soft: #221f1c;
  --text: #f6f4f1;
  --text-muted: #a19b92;
  --text-faint: #6f6a62;
  --accent: #ffa52b;
  --accent-text: #1c1610;
  --accent-soft: rgba(255,165,43,.12);
  --health-good: #3ddc84;
  --health-good-soft: rgba(61,220,132,.14);
  --health-average: #ffc94a;
  --health-average-soft: rgba(255,201,74,.14);
  --health-poor: #ff6a5c;
  --health-poor-soft: rgba(255,106,92,.14);
  --info: #7ab8ff;

  --tofu: #7ab8ff;
  --mofu: #ffc94a;
  --bofu: #ff8a5c;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-pill: 999px;

  --font-display: "Grift Black", "Times New Roman", serif;
  --font-body: "JUST Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --brand-tint: var(--accent);
  --brand-tint-text: var(--accent-text);
  --brand-tint-fg: var(--accent);

  --shadow-lg: 0 24px 60px -20px rgba(0,0,0,.6);
  --shadow-sm: 0 2px 10px rgba(0,0,0,.25);

  --header-h: 64px;
}

*,*::before,*::after{ box-sizing: border-box; }
html,body{ height: 100%; }
body{
  margin: 0;
  overflow-x: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  transition: background .5s ease;
}
/* Subtle wash sampled from the current brand's own logo/avatar — set via
   --brand-tint in JS. Kept faint on purpose: a hint of brand identity, not
   a competing background. */
body.has-brand-tint{
  background:
    radial-gradient(1100px 550px at 12% -8%, color-mix(in srgb, var(--brand-tint) 16%, transparent), transparent 60%),
    var(--bg);
}
img{ max-width: 100%; display:block; }
a{ color: inherit; text-decoration: none; }
button{ font-family: inherit; }
input,select,textarea{ font-family: inherit; font-size: inherit; color: inherit; }
h1,h2,h3,h4{ font-family: var(--font-display); font-weight: 900; margin: 0; letter-spacing: -0.01em; }
::selection{ background: var(--accent); color: var(--accent-text); }

:focus-visible{ outline: 2px solid var(--brand-tint); outline-offset: 2px; border-radius: 4px; box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand-tint) 25%, transparent); }

/* ============================================================
   Glow scrollbar + reusable glow animation
   ============================================================ */
html{ scrollbar-width: thin; scrollbar-color: var(--brand-tint) var(--bg-raised); }
::-webkit-scrollbar{ width:10px; height:10px; }
::-webkit-scrollbar-track{ background: var(--bg-raised); }
::-webkit-scrollbar-thumb{ background: var(--brand-tint); border-radius:999px; border:2px solid var(--bg-raised); box-shadow: 0 0 6px color-mix(in srgb, var(--brand-tint) 55%, transparent); }
::-webkit-scrollbar-thumb:hover{ box-shadow: 0 0 10px color-mix(in srgb, var(--brand-tint) 80%, transparent); }
.creator-sidebar-list::-webkit-scrollbar,
.table-scroll::-webkit-scrollbar,
.ig-picker-grid::-webkit-scrollbar,
.modal-body::-webkit-scrollbar,
.drawer-body::-webkit-scrollbar{ width:6px; height:6px; }

/* Parameterized via --glow-color so any element can opt in with its own
   tint (brand color, or the health-poor red for "needs attention") instead
   of duplicating this keyframe per color, following the same pattern the
   existing .status-pill status-glow animation already established. */
@keyframes glow-pulse{
  0%,100%{ box-shadow: 0 0 8px var(--glow-color, rgba(255,165,43,.35)); }
  50%{ box-shadow: 0 0 20px var(--glow-color, rgba(255,165,43,.6)); }
}
.glow{ animation: glow-pulse 2.4s ease-in-out infinite; }

.icon-btn.has-overdue{ --glow-color: color-mix(in srgb, var(--health-poor) 55%, transparent); animation: glow-pulse 2.4s ease-in-out infinite; }

@media (prefers-reduced-motion: reduce){
  html{ scroll-behavior: auto; }
  *,*::before,*::after{
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ============================================================
   Layout shell
   ============================================================ */
#app{ min-height: 100vh; display:flex; flex-direction:column; }

.topbar{
  position: sticky; top:0; z-index: 40;
  height: var(--header-h);
  display:flex; align-items:center; gap:20px;
  padding: 0 28px;
  background: rgba(12,11,10,.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-soft);
}
.brand-mark{
  display:flex; align-items:center; gap:10px;
  font-family: var(--font-display); font-weight:900; font-size:18px;
  white-space: nowrap; flex: none;
}
.brand-mark .dot{ width:9px; height:9px; border-radius:50%; background: var(--accent); }
.brand-logo{ height:22px; width:auto; display:block; }
.brand-mark-divider{ width:1px; height:18px; background: var(--border); }
.topbar-sep{ width:1px; align-self:stretch; margin: 14px 0; background: var(--border); }

.back-to-site{
  display:flex; align-items:center; gap:5px;
  padding: 8px 12px; border-radius: var(--radius-pill);
  background: var(--surface); border:1px solid var(--border);
  color: var(--text-muted); font-size:12.5px; font-weight:700;
  white-space:nowrap;
}
.back-to-site:hover{ background: var(--surface-hover); color: var(--text); }
.back-to-site svg{ width:14px; height:14px; }

.brand-switch{
  display:flex; align-items:center; gap:8px;
  padding: 7px 14px 7px 8px;
  border:1px solid var(--border); border-radius: var(--radius-pill);
  background: var(--surface); cursor:pointer;
  font-size: 13px; font-weight:600;
  max-width: 240px; flex: none;
}
.brand-switch .avatar{
  width:22px; height:22px; border-radius:50%; flex:none;
  display:flex; align-items:center; justify-content:center;
  font-size:11px; font-weight:800; font-family: var(--font-display);
  background: var(--brand-tint); color: var(--brand-tint-text);
  object-fit: cover;
}
.brand-switch span{ overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.brand-switch:hover{ background: var(--surface-hover); box-shadow: 0 0 14px color-mix(in srgb, var(--brand-tint) 30%, transparent); }

.tabs{
  display:flex; align-items:center; gap:4px; margin-left: 4px;
  min-width:0; flex-shrink:1; overflow-x:auto; scrollbar-width:none;
}
.tabs::-webkit-scrollbar{ display:none; }
.tab{
  padding: 8px 14px; border-radius: var(--radius-pill);
  font-size: 13.5px; font-weight:600; color: var(--text-muted);
  display:flex; align-items:center; gap:7px; flex: none; white-space:nowrap;
  transition: color .12s, background .12s;
}
.tab:hover{ color: var(--text); background: var(--surface); }
.tab.active{ color: var(--brand-tint-text); background: var(--brand-tint); }
.tab svg{ width:16px; height:16px; }

.topbar-right{ margin-left:auto; display:flex; align-items:center; gap:10px; flex:none; }

.icon-btn{
  position:relative;
  width:38px; height:38px; border-radius: var(--radius-pill);
  display:flex; align-items:center; justify-content:center;
  background: var(--surface); border:1px solid var(--border);
  color: var(--text); cursor:pointer;
}
.icon-btn:hover{ background: var(--surface-hover); }
.icon-btn svg{ width:18px; height:18px; }

main.view{ flex:1; padding: 36px 28px 80px; max-width: 1240px; margin: 0 auto; width:100%; }
main.view.wide{ max-width: 1440px; }

/* ============================================================
   Buttons / form controls
   ============================================================ */
.btn{
  display:inline-flex; align-items:center; justify-content:center; gap:8px;
  padding: 10px 18px; border-radius: var(--radius-md);
  font-size: 13.5px; font-weight:700; cursor:pointer; border:1px solid transparent;
  transition: transform .08s ease, background .12s, border-color .12s;
  white-space: nowrap;
}
.btn:active{ transform: scale(.98); }
.btn svg{ width:16px; height:16px; flex:none; }
.btn-primary{ background: var(--brand-tint); color: var(--brand-tint-text); }
.btn-primary:hover{ filter: brightness(1.06); box-shadow: 0 0 16px color-mix(in srgb, var(--brand-tint) 55%, transparent); }
.btn-secondary{ background: var(--surface); color: var(--text); border-color: var(--border); }
.btn-secondary:hover{ background: var(--surface-hover); }
.btn-ghost{ background: transparent; color: var(--text-muted); }
.btn-ghost:hover{ color: var(--text); background: var(--surface); }
.btn-danger{ background: var(--health-poor-soft); color: var(--health-poor); }
.btn-danger:hover{ filter: brightness(1.1); }
.btn-sm{ padding: 7px 12px; font-size:12.5px; }
.btn-block{ width:100%; }
.stage-big-action{ padding:20px; font-size:16px; gap:10px; }
.stage-script-display{ background: var(--surface-2); border:1px solid var(--border); border-radius: var(--radius-md); padding:20px; font-size:16px; line-height:1.7; margin-bottom:22px; max-height:50vh; overflow-y:auto; white-space:normal; }
.btn[disabled]{ opacity:.45; pointer-events:none; }

.field{ display:flex; flex-direction:column; gap:7px; margin-bottom:16px; }
.field label{ font-size:12.5px; font-weight:700; color: var(--text-muted); text-transform:uppercase; letter-spacing:.04em; }
.field .hint{ font-size:12px; color: var(--text-faint); margin-top:-3px; }
.input,.select,.textarea{
  background: var(--surface); border:1px solid var(--border); color: var(--text);
  border-radius: var(--radius-md); padding: 11px 13px; width:100%;
}
.input:focus,.select:focus,.textarea:focus{ border-color: var(--accent); }
.textarea{ resize: vertical; min-height: 84px; line-height:1.5; }
.select{ appearance:none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23a19b92' stroke-width='2.5'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat:no-repeat; background-position: right 12px center; padding-right:34px; }
.row-2{ display:grid; grid-template-columns:1fr 1fr; gap:14px; }
.row-3{ display:grid; grid-template-columns:1fr 1fr 1fr; gap:14px; }
@media (max-width: 720px){ .row-2,.row-3{ grid-template-columns:1fr; } }

.segmented{ display:flex; flex-wrap:wrap; background: var(--surface); border:1px solid var(--border); border-radius: var(--radius-pill); padding:3px; gap:2px; }
.segmented button{ min-width:0; }
.segmented button{ flex:1; border:0; background:transparent; color: var(--text-muted); padding:8px 12px; border-radius: var(--radius-pill); font-size:12.5px; font-weight:700; cursor:pointer; white-space:nowrap; }
.segmented button.active{ background: var(--text); color: var(--bg); }

.chip-select{ display:flex; flex-wrap:wrap; gap:8px; }
.chip-select button{ border:1px solid var(--border); background: var(--surface); color: var(--text-muted); padding:8px 14px; border-radius: var(--radius-pill); font-size:12.5px; font-weight:700; cursor:pointer; }
.chip-select button.active{ background: var(--text); color: var(--bg); border-color: var(--text); }

.checkbox-chip{ display:inline-flex; align-items:center; gap:7px; border:1px solid var(--border); background: var(--surface); color: var(--text); padding:8px 14px; border-radius: var(--radius-pill); font-size:12.5px; font-weight:700; cursor:pointer; }
.checkbox-chip svg{ width:14px; height:14px; }
.checkbox-chip input[type=checkbox]{ width:14px; height:14px; margin:0; }
.checkbox-chip.disabled{ opacity:.5; cursor:not-allowed; }

/* ============================================================
   Cards / surfaces
   ============================================================ */
.card{ background: var(--surface); border:1px solid var(--border); border-radius: var(--radius-lg); padding:22px; }
.card-tight{ padding:16px 18px; }

.page-head{ display:flex; align-items:flex-end; justify-content:space-between; gap:20px; margin-bottom:28px; flex-wrap:wrap; }
.page-head h1{ font-size: 30px; }
.page-eyebrow{ font-size:12.5px; font-weight:700; letter-spacing:.08em; text-transform:uppercase; color: var(--brand-tint-fg); margin-bottom:8px; }
.page-sub{ color: var(--text-muted); font-size:14px; margin-top:6px; max-width: 60ch; }

.stat-grid{ display:grid; grid-template-columns: repeat(4,1fr); gap:14px; margin-bottom: 28px; }
@media (max-width: 980px){ .stat-grid{ grid-template-columns: repeat(2,1fr); } }
@media (max-width: 560px){ .stat-grid{ grid-template-columns: 1fr; } }
.stat{ background: var(--surface); border:1px solid var(--border); border-radius: var(--radius-lg); padding:18px 20px; }
.stat .label{ font-size:12px; font-weight:700; text-transform:uppercase; letter-spacing:.05em; color: var(--text-muted); }
.stat .value{ font-family: var(--font-display); font-size:30px; font-weight:700; margin-top:8px; }
.stat .value small{ font-size:15px; color: var(--text-muted); font-family: var(--font-body); font-weight:600; }
.stat .sub{ font-size:12px; color: var(--text-faint); margin-top:4px; }

.section-title{ display:flex; align-items:center; justify-content:space-between; margin: 36px 0 14px; }
.section-title h2{ font-size:19px; }
.section-title .link{ font-size:12.5px; font-weight:700; color: var(--accent); }

/* ============================================================
   Badges / tags / health
   ============================================================ */
.tag{ display:inline-flex; align-items:center; gap:6px; padding:5px 11px; border-radius: var(--radius-pill); font-size:11.5px; font-weight:800; letter-spacing:.02em; text-transform:uppercase; }
.tag-tofu{ background: rgba(122,184,255,.14); color: var(--tofu); }
.tag-mofu{ background: rgba(255,201,74,.14); color: var(--mofu); }
.tag-bofu{ background: rgba(255,138,92,.14); color: var(--bofu); }

.status-pill{ display:inline-flex; align-items:center; gap:6px; padding:5px 12px; border-radius: var(--radius-pill); font-size:12px; font-weight:700; background: var(--surface-2); border:1px solid var(--border); color: var(--text-muted); transition: box-shadow .3s, background .3s, border-color .3s; }
.status-dot{ width:7px; height:7px; border-radius:50%; background: currentColor; }
.status-idea{ color:#a19b92; } .status-draft{ color:#7ab8ff; } .status-production{ color:#c792ff; }
.status-editing{ color:#ff9d5c; }
.status-scheduled{ color:#ffc94a; } .status-published{ color:#3ddc84; } .status-archived{ color:#6f6a62; }

/* Each phase gets its own tinted pill, not just a colored dot — the whole
   badge shifts treatment as content moves through Idea → Execution →
   Editing → Ready to Upload, so the stage is readable at a glance. */
.status-pill.status-idea{ background: rgba(161,155,146,.10); border-color: rgba(161,155,146,.28); }
.status-pill.status-draft{ background: rgba(122,184,255,.10); border-color: rgba(122,184,255,.28); }
.status-pill.status-production{ background: rgba(199,146,255,.10); border-color: rgba(199,146,255,.28); }
.status-pill.status-editing{ background: rgba(255,157,92,.10); border-color: rgba(255,157,92,.28); }
.status-pill.status-published{ background: rgba(61,220,132,.10); border-color: rgba(61,220,132,.28); }
/* Ready to Upload glows — the one stage that means "go", worth standing out. */
.status-pill.status-scheduled{
  background: rgba(255,201,74,.16); border-color: rgba(255,201,74,.5);
  box-shadow: 0 0 10px rgba(255,201,74,.3);
  animation: status-glow 2.2s ease-in-out infinite;
}
@keyframes status-glow{
  0%,100%{ box-shadow: 0 0 8px rgba(255,201,74,.22); }
  50%{ box-shadow: 0 0 18px rgba(255,201,74,.5); }
}

.health-badge{ display:inline-flex; align-items:center; gap:7px; padding:6px 13px; border-radius: var(--radius-pill); font-size:12px; font-weight:800; }
.health-good{ background: var(--health-good-soft); color: var(--health-good); }
.health-average{ background: var(--health-average-soft); color: var(--health-average); }
.health-poor{ background: var(--health-poor-soft); color: var(--health-poor); }
.health-none{ background: var(--surface-2); color: var(--text-faint); }
.health-dot{ width:8px; height:8px; border-radius:50%; background: currentColor; flex:none; }

.platform-pill{ display:inline-flex; align-items:center; gap:6px; font-size:12.5px; font-weight:600; color: var(--text-muted); }
.platform-pill svg{ width:15px; height:15px; }

/* ============================================================
   Tables
   ============================================================ */
.table-wrap{ border:1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; background: var(--surface); }
table.data-table{ width:100%; border-collapse:collapse; font-size:13.5px; }
.data-table thead th{ text-align:left; font-size:11px; text-transform:uppercase; letter-spacing:.05em; color: var(--text-faint); font-weight:700; padding:13px 16px; border-bottom:1px solid var(--border); white-space:nowrap; cursor:pointer; user-select:none; }
.data-table thead th:hover{ color: var(--text-muted); }
.data-table tbody td{ padding:13px 16px; border-bottom:1px solid var(--border-soft); vertical-align: middle; }
.data-table tbody tr:last-child td{ border-bottom:none; }
.data-table tbody tr{ cursor:pointer; transition: background .1s; }
.data-table tbody tr:hover{ background: var(--surface-hover); }
.cell-title{ font-weight:700; color: var(--text); max-width: 320px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.cell-muted{ color: var(--text-muted); }
.table-scroll{ overflow-x:auto; }
.table-empty{ padding: 60px 20px; text-align:center; color: var(--text-muted); }

/* ============================================================
   Content view chooser
   ============================================================ */
.content-view-grid{ display:grid; grid-template-columns: repeat(auto-fit, minmax(200px,1fr)); gap:16px; max-width:760px; }
.content-view-card{ background: var(--surface); border:1px solid var(--border); border-radius: var(--radius-lg); padding:26px 22px; text-align:left; cursor:pointer; transition: border-color .15s, transform .1s; }
.content-view-card:hover{ border-color: var(--brand-tint); transform: translateY(-2px); box-shadow: 0 0 20px color-mix(in srgb, var(--brand-tint) 25%, transparent); }
.content-view-card .icon-wrap{ width:44px; height:44px; border-radius: var(--radius-md); background: var(--accent-soft); color: var(--accent); display:flex; align-items:center; justify-content:center; margin-bottom:16px; }
.content-view-card h3{ font-size:16px; margin-bottom:4px; }
.content-view-card p{ font-size:12.5px; color: var(--text-muted); margin:0; }

/* ============================================================
   Toolbars / filters
   ============================================================ */
.toolbar{ display:flex; align-items:center; gap:10px; flex-wrap:wrap; margin-bottom:18px; }
.search-box{ position:relative; flex:1; min-width:200px; max-width:320px; }
.search-box svg{ position:absolute; left:12px; top:50%; transform:translateY(-50%); width:16px; height:16px; color: var(--text-faint); }
.search-box input{ padding-left:36px; }
.filter-pop{ position:relative; }
.filter-btn{ display:flex; align-items:center; gap:7px; }
.filter-count{ background: var(--brand-tint); color: var(--brand-tint-text); border-radius:999px; font-size:10.5px; font-weight:800; min-width:16px; height:16px; display:flex; align-items:center; justify-content:center; padding:0 4px; }

/* ============================================================
   Empty states
   ============================================================ */
.empty-state{ text-align:center; padding: 70px 24px; color: var(--text-muted); }
.empty-state .icon-wrap{ width:56px; height:56px; border-radius:50%; background: var(--surface-2); display:flex; align-items:center; justify-content:center; margin:0 auto 18px; color: var(--text-faint); }
.empty-state .icon-wrap svg{ width:26px; height:26px; }
.empty-state h3{ font-size:18px; color: var(--text); margin-bottom:8px; }
.empty-state p{ max-width: 40ch; margin: 0 auto 18px; font-size:13.5px; }

/* ============================================================
   Brand select screen
   ============================================================ */
.onboarding-card{ position:relative; display:flex; gap:20px; align-items:center; margin-bottom:28px; flex-wrap:wrap; }
.onboarding-video-placeholder{ flex:none; width:180px; height:101px; border-radius: var(--radius-md); background: var(--surface-2); display:flex; flex-direction:column; align-items:center; justify-content:center; gap:8px; color: var(--text-faint); }
.onboarding-video-placeholder span{ font-size:11px; font-weight:600; }
.onboarding-copy{ flex:1; min-width:220px; padding-right:30px; }

.weekly-work-row{ display:flex; align-items:center; gap:12px; padding:11px 4px; border-bottom:1px solid var(--border-soft); cursor:pointer; }
.weekly-work-row:last-child{ border-bottom:none; }
.weekly-work-row:hover{ background: var(--surface-hover); }
.weekly-work-verb{ font-size:10.5px; font-weight:800; text-transform:uppercase; letter-spacing:.04em; color: var(--accent); background: var(--accent-soft); padding:4px 9px; border-radius:999px; flex:none; }
.weekly-work-title{ flex:1; font-weight:600; font-size:13.5px; }
.weekly-work-brand{ font-size:11.5px; color: var(--text-faint); flex:none; }

.overdue-card{ border-color: color-mix(in srgb, var(--health-poor) 35%, var(--border)); }
.overdue-row{ display:flex; align-items:center; gap:14px; padding:11px 4px; border-bottom:1px solid var(--border-soft); }
.overdue-row:last-child{ border-bottom:none; }
.overdue-row .t{ font-weight:700; font-size:13.5px; }
.overdue-row .m{ font-size:12px; color: var(--health-poor); margin-top:2px; }

.routine-task-row{ display:flex; align-items:center; gap:12px; padding:10px 4px; border-bottom:1px solid var(--border-soft); }
.routine-task-row:last-child{ border-bottom:none; }
.routine-task-text{ flex:1; font-weight:600; font-size:13.5px; transition: opacity .3s ease; }
.routine-task-row.done .routine-task-text{ text-decoration: line-through; color: var(--text-faint); opacity:.7; }
.routine-auto-badge{ width:20px; height:20px; border-radius:50%; display:flex; align-items:center; justify-content:center; flex:none; background: var(--surface-2); color: var(--text-faint); }
.routine-auto-badge.done{ background: var(--health-good); color:#fff; }

.hero-strip{ margin-bottom: 40px; }
.hero-strip .kicker{ color: var(--accent); font-weight:700; font-size:12.5px; text-transform:uppercase; letter-spacing:.08em; margin-bottom:10px; }
.hero-strip h1{ font-size: 42px; line-height:1.05; max-width: 16ch; }
.brand-grid{ display:grid; grid-template-columns: repeat(auto-fill,minmax(230px,1fr)); gap:16px; }
.brand-card{ position:relative; background: var(--surface); border:1px solid var(--border); border-radius: var(--radius-lg); padding:22px; cursor:pointer; transition: border-color .15s, transform .1s; }
.brand-card:hover{ border-color: var(--brand-tint); transform: translateY(-2px); box-shadow: 0 0 20px color-mix(in srgb, var(--brand-tint) 25%, transparent); }
.brand-card .avatar{ width:44px; height:44px; border-radius: var(--radius-md); display:flex; align-items:center; justify-content:center; font-family: var(--font-display); font-weight:800; font-size:18px; background: var(--accent); color: var(--accent-text); margin-bottom: 16px; }
.brand-card h3{ font-size:17px; margin-bottom:6px; }
.brand-card .meta{ font-size:12.5px; color: var(--text-muted); }
.brand-card .card-menu{ position:absolute; top:14px; right:14px; }
.brand-card-add{ display:flex; flex-direction:column; align-items:center; justify-content:center; gap:10px; border:1.5px dashed var(--border); background:transparent; color: var(--text-muted); border-radius: var(--radius-lg); min-height: 160px; cursor:pointer; font-weight:700; font-size:13.5px; }
.brand-card-add:hover{ border-color: var(--accent); color: var(--accent); }
.brand-card-add svg{ width:22px; height:22px; }

/* ============================================================
   Auth screen (local access lock)
   ============================================================ */
.auth-shell{ min-height:100vh; display:flex; align-items:center; justify-content:center; padding:24px; }
.auth-card{ position:relative; width:min(400px,100%); background: var(--surface); border:1px solid var(--border); border-radius: var(--radius-lg); padding:36px 32px; box-shadow: var(--shadow-lg); }
.auth-close{ position:absolute; top:14px; right:14px; }
.auth-title{ font-size:24px; text-align:center; }
.auth-card .page-sub{ text-align:center; max-width:none; }
.auth-error{ color: var(--health-poor); font-size:12.5px; font-weight:600; margin:-4px 0 4px; }
.auth-card .hint{ display:flex; align-items:flex-start; gap:6px; color: var(--text-faint); line-height:1.5; }
.auth-card .hint svg{ flex:none; margin-top:2px; }

/* ============================================================
   Menus / dropdowns
   ============================================================ */
.menu{ position:absolute; z-index:60; min-width:170px; background: var(--bg-raised); border:1px solid var(--border); border-radius: var(--radius-md); padding:6px; box-shadow: var(--shadow-lg); }
.menu button{ display:flex; align-items:center; gap:9px; width:100%; text-align:left; padding:9px 10px; border-radius:8px; background:transparent; border:0; color: var(--text); font-size:13px; cursor:pointer; }
.menu button:hover{ background: var(--surface-2); }
.menu button.danger{ color: var(--health-poor); }
.menu button:disabled{ opacity:.45; cursor:not-allowed; }
.menu button svg[viewBox]{ flex:none; }
.menu button svg{ width:15px; height:15px; }
.menu-checkbox-row{ display:flex; align-items:center; gap:9px; width:100%; padding:9px 10px; border-radius:8px; font-size:13px; color: var(--text); cursor:pointer; }
.menu-checkbox-row:hover{ background: var(--surface-2); }
.menu-checkbox-row.disabled{ opacity:.5; cursor:not-allowed; }
.menu-checkbox-row input[type=checkbox]{ width:14px; height:14px; margin:0; }
.menu-divider{ height:1px; background: var(--border); margin:6px 4px; }

/* ============================================================
   Notification bell
   ============================================================ */
.notif-badge{ position:absolute; top:-3px; right:-3px; min-width:16px; height:16px; padding:0 4px; border-radius:999px; background: var(--health-poor); color:#fff; font-size:10px; font-weight:800; display:flex; align-items:center; justify-content:center; border:2px solid var(--bg); }
.notif-panel{ min-width:340px; max-width:380px; max-height:70vh; overflow-y:auto; padding:8px; }
.notif-section-head{ padding:9px 10px 5px; font-size:10.5px; font-weight:800; text-transform:uppercase; letter-spacing:.04em; color: var(--text-faint); }
.notif-row{ display:flex; align-items:center; gap:10px; width:100%; text-align:left; padding:8px 10px; border-radius:8px; background:transparent; border:0; color: var(--text); cursor:pointer; }
.notif-row:hover{ background: var(--surface-2); }
.notif-row .ti{ flex:1; min-width:0; }
.notif-row .t{ font-weight:700; font-size:13px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.notif-row .m{ font-size:11.5px; color: var(--text-faint); margin-top:2px; }
.notif-overdue{ color: var(--health-poor); font-weight:700; }
.notif-today{ color: var(--health-average); font-weight:700; }
.notif-soon{ color: var(--text-faint); }
.notif-empty{ display:flex; align-items:center; gap:8px; padding:20px 14px; color: var(--text-muted); font-size:13px; }
.notif-empty svg{ color: var(--health-good); flex:none; }

/* ============================================================
   Modal / Drawer
   ============================================================ */
.overlay{ position:fixed; inset:0; background: rgba(6,5,4,.6); backdrop-filter: blur(3px); z-index:70; display:flex; justify-content:flex-end; }
.overlay.center{ justify-content:center; align-items:center; }
.drawer{ width: min(620px, 100vw); height:100%; background: var(--bg-raised); border-left:1px solid var(--border); display:flex; flex-direction:column; box-shadow: var(--shadow-lg); animation: slideIn .18s ease-out; }
@keyframes slideIn{ from{ transform: translateX(24px); opacity:0; } to{ transform:none; opacity:1; } }
.modal{ width: min(480px, 92vw); background: var(--bg-raised); border:1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); animation: pop .28s cubic-bezier(0.34,1.56,0.64,1); }
@keyframes pop{ from{ transform: scale(.9); opacity:0; } to{ transform:none; opacity:1; } }
.drawer-head{ display:flex; align-items:center; justify-content:space-between; padding:20px 24px; border-bottom:1px solid var(--border); }
.drawer-head h2{ font-size:19px; }
.drawer-body{ flex:1; overflow-y:auto; padding:24px; }
.drawer-foot{ padding:16px 24px; border-top:1px solid var(--border); display:flex; justify-content:space-between; align-items:center; gap:10px; }
.modal-body{ padding:24px; max-height: calc(100vh - 160px); overflow-y: auto; }
.modal-foot{ padding:16px 24px; border-top:1px solid var(--border); display:flex; justify-content:flex-end; gap:10px; }

.editor-tabs{ display:flex; gap:4px; border-bottom:1px solid var(--border); margin: -24px -24px 24px; padding: 0 24px; }
.editor-tab{ padding: 14px 4px; margin-right:22px; font-size:13.5px; font-weight:700; color: var(--text-muted); border-bottom:2px solid transparent; cursor:pointer; }
.editor-tab.active{ color: var(--text); border-color: var(--accent); }
.editor-pane{ display:none; }
.editor-pane.active{ display:block; }

/* ============================================================
   Brand Assets (logos, Drive, Brandbook — embedded previews)
   ============================================================ */
.logo-gallery{ display:flex; align-items:center; gap:10px; flex-wrap:wrap; }
.logo-thumb{ position:relative; width:52px; height:52px; border-radius:10px; border:1px solid var(--border); background: var(--text); flex:none; }
.logo-thumb img{ width:100%; height:100%; object-fit:contain; padding:7px; cursor:zoom-in; border-radius:10px; }
.logo-remove{ position:absolute; top:-6px; right:-6px; width:18px; height:18px; border-radius:50%; background: var(--bg-raised); border:1px solid var(--border); color: var(--text-muted); display:flex; align-items:center; justify-content:center; cursor:pointer; padding:0; }
.logo-remove:hover{ color: var(--health-poor); }
.logo-download{ position:absolute; bottom:-6px; right:-6px; width:18px; height:18px; border-radius:50%; background: var(--bg-raised); border:1px solid var(--border); color: var(--text-muted); display:flex; align-items:center; justify-content:center; cursor:pointer; text-decoration:none; }
.logo-download:hover{ color: var(--accent); }
.logo-add-tile{ width:52px; height:52px; border-radius:10px; border:1.5px dashed var(--border); background:transparent; color: var(--text-faint); display:flex; align-items:center; justify-content:center; cursor:pointer; flex:none; }
.logo-add-tile:hover{ border-color: var(--accent); color: var(--accent); }

.resource-chip{ display:flex; align-items:center; gap:6px; padding:8px 14px; border-radius: var(--radius-pill); border:1px dashed var(--border); background: var(--surface); font-size:12.5px; font-weight:700; color: var(--text-muted); cursor:pointer; }
.resource-chip.empty:hover{ border-color: var(--accent); color: var(--accent); }
.chip-icon-btn{ width:22px; height:22px; border-radius:50%; display:flex; align-items:center; justify-content:center; background:transparent; border:0; color: var(--text-faint); cursor:pointer; padding:0; flex:none; }
.chip-icon-btn:hover{ color: var(--text); background: var(--surface-2); }
.chip-icon-btn:disabled{ opacity:.4; cursor:not-allowed; }
.chip-icon-btn:disabled:hover{ background:transparent; color: var(--text-faint); }
.chip-icon-btn.mic-active{ color:#fff; background: var(--health-poor); animation: mic-pulse 1.2s ease-in-out infinite; }
.chip-icon-btn.loading{ color: var(--accent); animation: mic-pulse 1s ease-in-out infinite; }
@keyframes mic-pulse{ 0%,100%{ opacity:1; } 50%{ opacity:.55; } }

.asset-panel{ border:1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); padding:16px; }
.asset-panel.empty{ display:flex; flex-direction:column; justify-content:center; }
.asset-panel-head{ display:flex; align-items:center; justify-content:space-between; margin-bottom:12px; }
.asset-embed{ width:100%; height:280px; border:0; border-radius: var(--radius-md); background:#fff; display:block; }
.asset-embed-fallback{ padding:36px 16px; text-align:center; color: var(--text-muted); font-size:13px; background: var(--surface-2); border-radius: var(--radius-md); }

/* ============================================================
   Creator studio
   ============================================================ */
.creator-layout{ display:grid; grid-template-columns: 260px 1fr; gap:20px; align-items:start; }
@media (max-width: 860px){
  .creator-layout{ grid-template-columns:1fr; }
  /* Stacked on mobile — no side-by-side panel to size against, so the
     sidebar just flows with the page instead of scrolling in its own
     capped-height box (100vh miscounts the browser's address bar on
     mobile, cutting the list off with no working scroll). */
  .creator-sidebar-list{ max-height:none; overflow-y:visible; overflow-x:visible; }
}
.creator-sidebar{ overflow:visible; }
.creator-sidebar-list{ max-height: calc(100vh - 230px); overflow-y:auto; overflow-x:hidden; display:flex; flex-direction:column; gap:12px; padding-right:2px; }
.creator-item{ display:flex; align-items:center; gap:10px; padding:12px 14px; cursor:pointer; border-bottom:1px solid var(--border-soft); }
.creator-item:last-child{ border-bottom:none; }
.creator-item:hover{ background: var(--surface-hover); }
.creator-item.active{ background: color-mix(in srgb, var(--brand-tint) 12%, transparent); border-left: 2px solid var(--brand-tint); padding-left:12px; }
.creator-item .ti{ flex:1; min-width:0; }
.creator-item .t{ font-weight:700; font-size:13px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.creator-item .m{ font-size:11.5px; color: var(--text-faint); margin-top:2px; }

/* Each phase is its own separated, collapsible box — not one continuous
   list — using the CSS grid 1fr/0fr trick to animate to/from auto height
   without JS measuring anything. */
.creator-sidebar-group{ border:1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); overflow:hidden; }
.creator-sidebar-group-head{
  width:100%; display:flex; align-items:center; justify-content:space-between; gap:6px;
  padding:12px 14px; font-size:11px; font-weight:800; letter-spacing:.04em; text-transform:uppercase;
  color: var(--text-faint); background: var(--surface-2); border:0; cursor:pointer; text-align:left;
}
.creator-sidebar-group-head:hover{ color: var(--text); }
.creator-sidebar-group-chevron{ transition: transform .25s ease; flex:none; }
.creator-sidebar-group.collapsed .creator-sidebar-group-chevron{ transform: rotate(-90deg); }
.creator-sidebar-group-body{ display:grid; grid-template-rows: 1fr; transition: grid-template-rows .32s ease; }
.creator-sidebar-group.collapsed .creator-sidebar-group-body{ grid-template-rows: 0fr; }
.creator-sidebar-group-body-inner{ overflow:hidden; min-height:0; }
.creator-main{ display:flex; flex-direction:column; gap:16px; }
.creator-field-head{ display:flex; align-items:center; justify-content:space-between; }
.save-indicator{ font-size:11.5px; font-weight:700; color: var(--health-good); opacity:0; transition: opacity .2s; }
.save-indicator.show{ opacity:1; }
.due-badge{ font-size:10px; font-weight:800; text-transform:uppercase; letter-spacing:.03em; padding:3px 8px; border-radius:999px; flex:none; }
.due-overdue{ background: var(--health-poor-soft); color: var(--health-poor); }
.due-today{ background: var(--health-average-soft); color: var(--health-average); }
.due-soon{ background: var(--surface-2); color: var(--text-faint); }

/* ============================================================
   Instagram import picker
   ============================================================ */
.ig-picker-toolbar{ display:flex; align-items:center; gap:10px; margin-bottom:14px; }
.ig-picker-grid{ display:grid; grid-template-columns: repeat(auto-fill, minmax(150px,1fr)); gap:12px; max-height:60vh; overflow-y:auto; padding-right:2px; }
.ig-picker-card{ display:block; cursor:pointer; border:1px solid var(--border); border-radius: var(--radius-md); padding:8px; background: var(--surface); position:relative; transition: border-color .12s; }
.ig-picker-card:hover{ border-color: var(--text-faint); }
.ig-picker-card input[type=checkbox]{ position:absolute; top:14px; left:14px; z-index:2; width:18px; height:18px; accent-color: var(--accent); }
.ig-picker-thumb{ position:relative; width:100%; aspect-ratio:1; border-radius:8px; overflow:hidden; background: var(--surface-2); margin-bottom:8px; }
.ig-picker-thumb img{ width:100%; height:100%; object-fit:cover; }
.ig-picker-noimg{ width:100%; height:100%; display:flex; align-items:center; justify-content:center; color: var(--text-faint); }
.ig-picker-type{ position:absolute; bottom:6px; right:6px; background: rgba(12,11,10,.75); color: var(--text); font-size:10px; font-weight:700; padding:3px 7px; border-radius:999px; text-transform:uppercase; letter-spacing:.03em; }
.ig-picker-check{ display:none; }
.ig-picker-caption{ font-size:11.5px; color: var(--text-muted); line-height:1.4; display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; }
.ig-picker-already{ margin-top:6px; font-size:10.5px; font-weight:700; color: var(--health-good); text-transform:uppercase; letter-spacing:.03em; }
.ig-picker-linked{ margin-top:6px; font-size:10.5px; font-weight:700; color: var(--accent); display:flex; align-items:center; gap:4px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.ig-picker-card:has(input:disabled){ opacity:.55; cursor:default; }
.ig-card-working{ outline:2px solid var(--accent); }
.ig-card-done{ outline:2px solid var(--health-good); }
.ig-card-error{ outline:2px solid var(--health-poor); }

input[type=checkbox]{ accent-color: var(--accent); width:16px; height:16px; cursor:pointer; }

/* ============================================================
   Teleprompter overlay
   ============================================================ */
.tp-overlay{ position:fixed; inset:0; background: rgba(6,5,4,.82); backdrop-filter: blur(4px); z-index:90; display:flex; align-items:center; justify-content:center; padding:24px; }
.tp-panel{ width:min(920px,92vw); height:min(720px,88vh); background: var(--bg-raised); border:1px solid var(--border); border-radius: var(--radius-lg); display:flex; flex-direction:column; box-shadow: var(--shadow-lg); }
.tp-head{ display:flex; align-items:center; justify-content:space-between; padding:16px 22px; border-bottom:1px solid var(--border); flex:none; }
.tp-title{ display:flex; align-items:center; gap:9px; font-family: var(--font-display); font-weight:700; font-size:16px; }
.tp-scroll{ flex:1; overflow-y:auto; padding:56px 64px; }
.tp-text{ font-family: var(--font-display); font-weight:600; line-height:1.65; color: var(--text); white-space:pre-wrap; max-width:720px; margin:0 auto; }
.tp-controls{ display:flex; align-items:center; gap:20px; padding:14px 22px; border-top:1px solid var(--border); flex-wrap:wrap; flex:none; }
.tp-slider{ display:flex; align-items:center; gap:9px; font-size:11.5px; color: var(--text-muted); font-weight:700; text-transform:uppercase; letter-spacing:.04em; }
.tp-slider input[type=range]{ width:100px; accent-color: var(--accent); }

/* ============================================================
   Spotlight tour (onboarding)
   ============================================================ */
.tour-overlay{ position:fixed; inset:0; z-index:95; }
/* Dim-with-a-hole as four plain strips around the target rect, not a
   giant-spread box-shadow — a 9999px box-shadow spread on a fixed element
   is a known trigger for compositing/repaint glitches on scroll in some
   engines, and four positioned divs sidestep that entirely. */
.tour-dim{ position:fixed; background: rgba(6,5,4,.78); pointer-events:none; }
.tour-highlight-ring{
  position:fixed; border-radius: var(--radius-md);
  border: 2px solid var(--brand-tint);
  --glow-color: color-mix(in srgb, var(--brand-tint) 60%, transparent);
  animation: glow-pulse 2s ease-in-out infinite;
  pointer-events:none;
}
.tour-tooltip{
  position:fixed; z-index:96; width:min(320px,90vw);
  background: var(--bg-raised); border:1px solid var(--border); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg); padding:20px;
  animation: pop .28s cubic-bezier(0.34,1.56,0.64,1);
}
.tour-progress{ font-size:11px; font-weight:700; color: var(--text-faint); text-transform:uppercase; letter-spacing:.04em; margin-bottom:8px; }
.tour-tooltip h3{ font-size:16px; margin-bottom:8px; }
.tour-tooltip p{ font-size:13px; color: var(--text-muted); line-height:1.55; margin:0 0 18px; }
.tour-tooltip-actions{ display:flex; align-items:center; justify-content:space-between; gap:10px; }

/* ============================================================
   Dropzone / OCR
   ============================================================ */
.dropzone{ border:1.5px dashed var(--border); border-radius: var(--radius-lg); padding: 30px 20px; text-align:center; cursor:pointer; color: var(--text-muted); transition: border-color .12s, background .12s; }
.dropzone.drag{ border-color: var(--accent); background: var(--accent-soft); color: var(--text); }
.dropzone svg{ width:26px; height:26px; margin: 0 auto 10px; color: var(--text-faint); }
.dropzone strong{ color: var(--text); }
.screenshot-preview{ position:relative; border-radius: var(--radius-md); overflow:hidden; border:1px solid var(--border); }
.screenshot-preview img{ width:100%; max-height: 260px; object-fit:cover; }
.screenshot-preview .remove{ position:absolute; top:8px; right:8px; }
.ocr-status{ display:flex; align-items:center; gap:10px; padding:12px 14px; border-radius: var(--radius-md); background: var(--surface-2); font-size:13px; color: var(--text-muted); margin-top:12px; }
.spinner{ width:16px; height:16px; border-radius:50%; border:2px solid var(--border); border-top-color: var(--accent); animation: spin .7s linear infinite; flex:none; }
@keyframes spin{ to{ transform: rotate(360deg); } }
.metric-grid{ display:grid; grid-template-columns: repeat(2,1fr); gap:12px; margin-top:14px; }
@media (max-width:520px){ .metric-grid{ grid-template-columns:1fr; } }
.metric-field label{ display:flex; align-items:center; gap:6px; }
.metric-field .found{ color: var(--health-good); }

/* ============================================================
   Calendar
   ============================================================ */
.cal-head{ display:flex; align-items:center; justify-content:space-between; margin-bottom:18px; gap:14px; flex-wrap:wrap; }
.cal-nav{ display:flex; align-items:center; gap:8px; }
.cal-month-label{ font-family: var(--font-display); font-size:20px; font-weight:700; min-width:180px; text-align:center; }
.cal-grid{ display:grid; grid-template-columns: repeat(7,1fr); border:1px solid var(--border); border-radius: var(--radius-lg); overflow:hidden; background: var(--border-soft); gap:1px; }
.cal-dow{ background: var(--bg-raised); padding:10px; font-size:11px; text-transform:uppercase; letter-spacing:.05em; color: var(--text-faint); font-weight:700; text-align:center; }
.cal-cell{ background: var(--surface); height: 128px; overflow:hidden; padding:8px; display:flex; flex-direction:column; gap:5px; }
.cal-cell.outside{ background: var(--bg-raised); opacity:.45; }
.cal-cell.today .cal-date{ background: var(--brand-tint); color: var(--brand-tint-text); }
.cal-cell.drag-over{ outline: 2px solid var(--accent); outline-offset:-2px; }
.cal-date{ width:22px; height:22px; border-radius:50%; display:flex; align-items:center; justify-content:center; font-size:11.5px; font-weight:700; color: var(--text-muted); }
/* Tanggal merah — Indonesian national holidays (solid red) vs. cuti
   bersama / joint leave (softer, dashed) get slightly different treatment
   since only one of them is an actual libur nasional. */
.cal-cell.holiday .cal-date{ color: var(--health-poor); font-weight:800; }
.cal-cell.holiday:not(.today){ background: color-mix(in srgb, var(--health-poor) 6%, var(--surface)); }
.cal-cell.cuti .cal-date{ color: var(--health-poor); opacity:.75; }
.cal-cell.cuti:not(.today){ background: color-mix(in srgb, var(--health-poor) 3%, var(--surface)); }
.cal-holiday-label{ font-size:9.5px; font-weight:700; color: var(--health-poor); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; margin-top:-3px; }
.cal-item{ position:relative; font-size:11px; font-weight:700; padding:4px 18px 4px 7px; border-radius:7px; background: var(--surface-2); border:1px solid var(--border); cursor:grab; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; display:flex; align-items:center; gap:5px; }
.cal-item:hover{ border-color: var(--brand-tint); }
.cal-item .swatch{ width:6px; height:6px; border-radius:50%; flex:none; }
.cal-item-remove{ position:absolute; top:50%; right:3px; transform:translateY(-50%); width:14px; height:14px; border-radius:50%; background: var(--bg-raised); border:1px solid var(--border); color: var(--text-muted); display:flex; align-items:center; justify-content:center; padding:0; cursor:pointer; opacity:0; transition: opacity .15s; }
.cal-item:hover .cal-item-remove{ opacity:1; }
.cal-item-remove:hover{ color: var(--health-poor); border-color: var(--health-poor); }
.cal-more{ font-size:10.5px; color: var(--text-faint); padding-left:2px; }

/* Content Bank — a slide-in drag source panel, not a modal, so the
   calendar underneath stays fully interactive for dropping onto. */
.content-bank{ position:fixed; top:0; right:0; bottom:0; width:300px; background: var(--bg-raised); border-left:1px solid var(--border); box-shadow: var(--shadow-lg); z-index:90; display:flex; flex-direction:column; animation: bankIn .2s ease-out; }
@keyframes bankIn{ from{ transform: translateX(100%); } to{ transform: translateX(0); } }
.content-bank-head{ display:flex; align-items:center; justify-content:space-between; padding:16px 14px; font-weight:800; font-size:14px; border-bottom:1px solid var(--border); }
.content-bank-list{ flex:1; overflow-y:auto; padding:0 14px 20px; }
.content-bank-group{ margin-bottom:16px; }
.content-bank-group-head{ font-size:10.5px; font-weight:800; letter-spacing:.04em; text-transform:uppercase; color: var(--text-faint); margin-bottom:8px; }
.content-bank-group .bank-item{ width:100%; margin-bottom:6px; box-sizing:border-box; white-space:normal; }
.auto-schedule-list{ max-height:50vh; overflow-y:auto; display:flex; flex-direction:column; gap:2px; }
.auto-schedule-row{ display:flex; align-items:center; gap:12px; padding:9px 4px; border-bottom:1px solid var(--border-soft); }
.auto-schedule-row:last-child{ border-bottom:none; }
.auto-schedule-title{ flex:1; font-size:13px; font-weight:600; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.agenda-list{ display:flex; flex-direction:column; gap:10px; }
.agenda-row{ display:flex; align-items:center; gap:14px; background: var(--surface); border:1px solid var(--border); border-radius: var(--radius-md); padding:13px 16px; cursor:pointer; }
.agenda-date{ width:52px; text-align:center; flex:none; }
.agenda-date .d{ font-family:var(--font-display); font-size:20px; font-weight:800; }
.agenda-date .m{ font-size:10.5px; text-transform:uppercase; color: var(--text-faint); }

/* ============================================================
   Analytics
   ============================================================ */
.funnel-compare{ display:grid; grid-template-columns: repeat(3,1fr); gap:14px; }
@media (max-width: 820px){ .funnel-compare{ grid-template-columns:1fr; } }
.funnel-card{ border-radius: var(--radius-lg); padding:20px; border:1px solid var(--border); background: var(--surface); }
.funnel-card .fh{ display:flex; align-items:center; gap:8px; margin-bottom:14px; }
.funnel-card .metric-row{ display:flex; justify-content:space-between; align-items:baseline; padding:9px 0; border-top:1px solid var(--border-soft); }
.funnel-card .metric-row:first-of-type{ border-top:none; }
.funnel-card .metric-row .v{ font-family: var(--font-display); font-weight:700; font-size:18px; }
.bar-row{ display:flex; align-items:center; gap:12px; margin-bottom:12px; }
.bar-row .bl{ width: 120px; font-size:12.5px; color: var(--text-muted); flex:none; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.bar-track{ flex:1; height:8px; border-radius:999px; background: var(--surface-2); overflow:hidden; }
.bar-fill{ height:100%; border-radius:999px; background: var(--brand-tint); }
.bar-val{ width:52px; text-align:right; font-size:12.5px; font-weight:700; flex:none; }

/* ============================================================
   Settings
   ============================================================ */
.settings-grid{ display:grid; grid-template-columns: 220px 1fr; gap:32px; align-items:start; }
@media (max-width: 860px){ .settings-grid{ grid-template-columns:1fr; } }
.settings-nav{ display:flex; flex-direction:column; gap:2px; position:sticky; top: calc(var(--header-h) + 24px); }
.settings-nav button{ text-align:left; padding:10px 14px; border-radius: var(--radius-md); background:transparent; border:0; color: var(--text-muted); font-weight:700; font-size:13.5px; cursor:pointer; }
.settings-nav button.active{ background: var(--surface); color: var(--text); }
.settings-panel{ display:none; }
.settings-panel.active{ display:block; }
.threshold-row{ display:grid; grid-template-columns: 90px 1fr 1fr; gap:12px; align-items:center; margin-bottom:10px; }
.threshold-row .tl{ font-size:12.5px; font-weight:700; color: var(--text-muted); }
.list-editor-row{ display:flex; align-items:center; gap:10px; padding:10px 0; border-bottom:1px solid var(--border-soft); }
.list-editor-row:last-child{ border-bottom:none; }
.list-editor-row .row-label{ flex:1; font-weight:600; font-size:13.5px; }
.formula-box{ font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size:13.5px; }
.formula-vars{ display:flex; flex-wrap:wrap; gap:6px; margin-top:10px; }
.var-chip{ font-size:11px; font-weight:700; padding:4px 9px; border-radius:999px; background: var(--surface-2); color: var(--text-muted); cursor:pointer; font-family: ui-monospace, monospace; }
.var-chip:hover{ color: var(--accent); }
.formula-preview{ margin-top:10px; font-size:12.5px; color: var(--text-muted); }

/* ============================================================
   Toast
   ============================================================ */
.toast-root{ position:fixed; bottom:22px; left:50%; transform:translateX(-50%); z-index:100; display:flex; flex-direction:column; gap:8px; align-items:center; }
.toast{ background: var(--bg-raised); border:1px solid var(--border); color: var(--text); padding:12px 18px; border-radius: var(--radius-pill); font-size:13px; font-weight:600; box-shadow: var(--shadow-lg); display:flex; align-items:center; gap:9px; animation: toastIn .16s ease-out; }
@keyframes toastIn{ from{ opacity:0; transform: translateY(6px); } to{ opacity:1; transform:none; } }
.toast.success svg{ color: var(--health-good); }
.toast.error svg{ color: var(--health-poor); }
.toast svg{ width:16px; height:16px; }

/* ============================================================
   Floating progress (minimized long-running work — imports, syncs)
   ============================================================ */
#progress-root{ position:fixed; top:74px; right:20px; z-index:100; display:flex; flex-direction:column; gap:10px; width:260px; }
.floating-progress{ background: var(--bg-raised); border:1px solid var(--border); border-radius: var(--radius-md); padding:12px 14px; box-shadow: var(--shadow-lg); animation: toastIn .16s ease-out; }
.floating-progress-label{ font-size:12.5px; font-weight:700; margin-bottom:8px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.floating-progress-track{ height:5px; border-radius:3px; background: var(--surface-2); overflow:hidden; }
.floating-progress-fill{ height:100%; background: var(--accent); border-radius:3px; transition: width .3s ease; }
.floating-progress.done .floating-progress-fill{ background: var(--health-good); }
.floating-progress-sub{ font-size:11px; color: var(--text-faint); margin-top:6px; }

/* ============================================================
   Misc
   ============================================================ */
.text-muted{ color: var(--text-muted); }
.text-faint{ color: var(--text-faint); }
.mt-0{ margin-top:0; }
.flex{ display:flex; }
.items-center{ align-items:center; }
.gap-8{ gap:8px; }
.gap-10{ gap:10px; }
.justify-between{ justify-content:space-between; }
.w-full{ width:100%; }
.divider{ height:1px; background: var(--border); margin: 20px 0; }
.kv{ display:flex; justify-content:space-between; font-size:13px; padding:9px 0; border-bottom:1px solid var(--border-soft); }
.kv:last-child{ border-bottom:none; }
.kv .k{ color: var(--text-muted); }
.kv .v{ font-weight:700; }
.thumb-preview{ width:100%; aspect-ratio: 16/10; border-radius: var(--radius-md); background: var(--surface-2); border:1px solid var(--border); object-fit:cover; }
.mono{ font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.top-content-row{ display:flex; align-items:center; gap:12px; padding:12px 0; border-bottom:1px solid var(--border-soft); }
.top-content-row:last-child{ border-bottom:none; }
.top-content-row .rank{ font-family: var(--font-display); font-weight:800; font-size:16px; color: var(--text-faint); width:20px; }
.top-content-row .ti{ flex:1; min-width:0; }
.top-content-row .ti .t{ font-weight:700; font-size:13.5px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.top-content-row .ti .m{ font-size:12px; color:var(--text-muted); margin-top:2px; }

/* ============================================================
   Report card (printable)
   ============================================================ */
.report-preview-wrap{ display:flex; justify-content:center; background: var(--surface-2); border-radius: var(--radius-md); padding:24px; }
.report-sheet{
  width:100%; max-width:680px; background:#ffffff; color:#1a1816; border-radius:6px;
  padding:40px; box-shadow: 0 12px 40px rgba(0,0,0,.35);
  font-family: var(--font-body);
}
.report-header{ display:flex; align-items:center; gap:14px; padding-bottom:20px; margin-bottom:24px; border-bottom:2px solid #1a1816; }
.report-header .avatar{ flex:none; }
.report-brand{ font-family: var(--font-display); font-weight:800; font-size:20px; }
.report-title{ font-size:12.5px; color:#6b6560; text-transform:uppercase; letter-spacing:.05em; margin-top:2px; }
.report-range{ margin-left:auto; text-align:right; font-size:12.5px; color:#33302c; }
.report-generated{ color:#8a8580; font-size:11px; margin-top:2px; }
.report-stat-grid{ display:grid; grid-template-columns: repeat(3,1fr); gap:14px; margin-bottom:28px; }
.report-stat{ background:#f6f4f1; border-radius:8px; padding:14px; }
.report-stat-label{ font-size:10.5px; text-transform:uppercase; letter-spacing:.04em; color:#6b6560; font-weight:700; }
.report-stat-value{ font-family: var(--font-display); font-weight:700; font-size:22px; margin-top:4px; color:#1a1816; }
.report-section-title{ font-family: var(--font-display); font-weight:700; font-size:15px; margin:24px 0 10px; color:#1a1816; }
.report-table{ width:100%; border-collapse:collapse; font-size:12.5px; }
.report-table th{ text-align:left; padding:8px 10px; border-bottom:2px solid #1a1816; font-size:10.5px; text-transform:uppercase; letter-spacing:.04em; color:#6b6560; }
.report-table td{ padding:8px 10px; border-bottom:1px solid #e4e0da; color:#33302c; }
.report-empty{ color:#8a8580; font-size:12.5px; }
.report-footer{ margin-top:32px; padding-top:14px; border-top:1px solid #e4e0da; font-size:10.5px; color:#8a8580; text-align:center; }

@media print{
  body *{ visibility:hidden; }
  .report-sheet, .report-sheet *{ visibility:visible; }
  .report-sheet{ position:absolute; inset:0; margin:0; max-width:none; box-shadow:none; border-radius:0; }
}

@media (max-width: 720px){
  .topbar{ flex-wrap: wrap; height:auto; padding: 12px 16px; gap:10px; row-gap:10px; }
  .topbar-sep{ display:none; }
  .brand-switch{ order:1; max-width: 200px; }
  .brand-mark{ order:0; }
  .topbar-right{ order:2; }
  .tabs{ order:3; flex:1 1 100%; width:100%; overflow-x:auto; min-width:0; }
  main.view{ padding: 24px 16px 60px; }
  .hero-strip h1{ font-size:32px; }
  .drawer{ width:100%; }
}
