/* YPR Marketing: follows the YPR design concept (Apple-style tokens, Space Grotesk + Inter, CSS-only motion). */
@font-face { font-family: "Inter"; src: url(/fonts/inter.woff2) format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Space Grotesk"; src: url(/fonts/space-grotesk.woff2) format("woff2"); font-weight: 300 700; font-display: swap; }

:root {
  --bg: #f5f5f7; --surface: #ffffff; --surface-2: #f2f2f7; --border: #e5e5ea; --text: #1d1d1f; --text-2: #6e6e73;
  --accent: #0066cc; --accent-strong: #0066cc; --grad: linear-gradient(180deg, #0071e3, #0066cc);
  --ok: #1a6e2e; --warn: #9a4400; --bad: #b8000f;
  --ok-bg: color-mix(in srgb, var(--ok) 10%, var(--surface)); --warn-bg: color-mix(in srgb, var(--warn) 10%, var(--surface)); --bad-bg: color-mix(in srgb, var(--bad) 9%, var(--surface));
  --shadow: 0 1px 2px rgba(0,0,0,.04), 0 1px 1px rgba(0,0,0,.02); --shadow-deep: 0 8px 24px rgba(0,0,0,.08), 0 2px 6px rgba(0,0,0,.04);
  --dur: 200ms; --ease: cubic-bezier(0.25, 0.1, 0.25, 1); --radius: 12px;
  /* Older names used across the pages */
  --muted: var(--text-2); --line: var(--border); --brand: var(--accent); --brand-ink: #fff;
  color-scheme: light; font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; color: var(--text); background: var(--bg);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #000000; --surface: #1c1c1e; --surface-2: #2c2c2e; --border: #38383a; --text: #f5f5f7; --text-2: #98989d;
    --accent: #409cff; --accent-strong: #0071e3; --ok: #30d158; --warn: #ff9f0a; --bad: #ff6961;
    --ok-bg: color-mix(in srgb, var(--ok) 14%, var(--surface)); --warn-bg: color-mix(in srgb, var(--warn) 14%, var(--surface)); --bad-bg: color-mix(in srgb, var(--bad) 14%, var(--surface));
    --shadow: 0 1px 2px rgba(0,0,0,.4); --shadow-deep: 0 10px 30px rgba(0,0,0,.55); color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #000000; --surface: #1c1c1e; --surface-2: #2c2c2e; --border: #38383a; --text: #f5f5f7; --text-2: #98989d;
  --accent: #409cff; --accent-strong: #0071e3; --ok: #30d158; --warn: #ff9f0a; --bad: #ff6961;
  --ok-bg: color-mix(in srgb, var(--ok) 14%, var(--surface)); --warn-bg: color-mix(in srgb, var(--warn) 14%, var(--surface)); --bad-bg: color-mix(in srgb, var(--bad) 14%, var(--surface));
  --shadow: 0 1px 2px rgba(0,0,0,.4); --shadow-deep: 0 10px 30px rgba(0,0,0,.55); color-scheme: dark;
}
@media (prefers-reduced-motion: reduce) {
  :root { --dur: 0ms; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

* { box-sizing: border-box; }
body { margin: 0; line-height: 1.45; font-size: 15px; background: var(--bg); color: var(--text); }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, .font-display, .kpi-value, .verdict-title, .card-title { font-family: "Space Grotesk", "Inter", system-ui, sans-serif; letter-spacing: -0.02em; }
h1 { font-size: 1.5rem; font-weight: 700; margin: .2rem 0 .6rem; }
h2 { font-size: 1.05rem; font-weight: 600; margin: 0 0 .75rem; }
h3 { font-weight: 600; }
small, .muted { color: var(--text-2); }
button, summary, label[for], .btn, select { cursor: pointer; }

/* ---------- Shell: floating sidebar + top bar ---------- */
.with-nav { display: grid; grid-template-columns: 248px minmax(0, 1fr); grid-template-rows: auto 1fr; min-height: 100vh; }
.sidebar { grid-column: 1; grid-row: 1 / span 2; position: sticky; top: 12px; align-self: start; margin: 12px 0 12px 12px; height: calc(100vh - 24px); overflow-y: auto;
  background: var(--surface); border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow); padding: 14px 10px; }
.brand { display: flex; flex-direction: column; gap: 6px; padding: 4px 8px 14px; margin-bottom: 6px; border-bottom: 1px solid var(--border); color: var(--text-2); font-size: .75rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; }
.brand:hover { text-decoration: none; }
.sidebar nav details { margin: 8px 0; }
.sidebar nav summary { list-style: none; display: flex; align-items: center; justify-content: space-between; padding: 6px 10px; font-size: .72rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--text-2); border-radius: 8px; }
.sidebar nav summary::-webkit-details-marker { display: none; }
.sidebar nav summary:hover { background: color-mix(in srgb, var(--text) 5%, transparent); }
.count { display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 18px; padding: 0 6px; border-radius: 999px; background: var(--surface-2); font-size: .7rem; line-height: 1; letter-spacing: 0; }
.sidebar nav a { display: flex; align-items: center; padding: 7px 10px; margin: 1px 0; border-radius: 8px; color: var(--text); font-size: .92rem; font-weight: 500;
  transition: background-color var(--dur) var(--ease), color var(--dur) var(--ease); }
.sidebar nav a:hover { background: color-mix(in srgb, var(--text) 5%, transparent); text-decoration: none; }
.sidebar nav a.on { background: color-mix(in srgb, var(--accent) 10%, transparent); color: var(--accent); font-weight: 600; }
.sidebar nav details[open] > a { animation: open-in 180ms var(--ease) backwards; }

.topbar { grid-column: 2; display: flex; align-items: center; gap: 1rem; margin: 12px 12px 0; padding: 8px 14px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow); position: sticky; top: 12px; z-index: 5; }
.topbar-title { flex: 1; font-family: "Space Grotesk", "Inter", sans-serif; font-weight: 600; letter-spacing: -0.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar .brand-sm, .topbar .nav-open, .side-theme { display: none; }
.theme { display: inline-flex; padding: 2px; background: var(--surface-2); border-radius: 9px; }
.theme button { font: inherit; font-size: .78rem; font-weight: 500; border: 0; background: transparent; color: var(--text-2); padding: 4px 10px; border-radius: 7px; transition: background-color var(--dur) var(--ease), color var(--dur) var(--ease); }
.theme button[aria-pressed="true"] { background: var(--surface); color: var(--text); box-shadow: var(--shadow); animation: tab-on 220ms var(--ease); }
.me { display: flex; align-items: center; gap: .6rem; font-size: .88rem; white-space: nowrap; }
.me form { margin: 0; display: flex; }
.me-name small { display: block; font-size: .72rem; }
.avatar { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 999px; background: color-mix(in srgb, var(--accent) 12%, var(--surface)); color: var(--accent); font-weight: 700; line-height: 1; }
.icon-btn { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 8px; color: var(--text); transition: background-color var(--dur) var(--ease), color var(--dur) var(--ease); }
.icon-btn:hover { background: color-mix(in srgb, var(--accent) 10%, transparent); color: var(--accent); }
.nav-scrim { display: none; }

.page { grid-column: 2; width: 100%; max-width: 1200px; margin: 0 auto; padding: 1.25rem 1.25rem 3rem; animation: page-in 260ms var(--ease) backwards; min-width: 0; }
.page.narrow { max-width: 420px; padding-top: 10vh; }
.auth-logo { display: flex; justify-content: center; margin-bottom: 1.25rem; }
.auth { border-radius: 16px; box-shadow: var(--shadow-deep); padding: 1.5rem; }

@media (max-width: 960px) {
  .with-nav { display: block; }
  .topbar { margin: 8px 8px 0; top: 8px; gap: .6rem; }
  .topbar .nav-open, .topbar .brand-sm { display: inline-grid; }
  .topbar .theme { display: none; }
  .side-theme { display: block; padding: 12px 8px 4px; border-top: 1px solid var(--border); margin-top: 8px; }
  .topbar .me { margin-left: auto; }
  .topbar-title, .me-name { display: none; }
  .sidebar { position: fixed; z-index: 20; inset: 8px auto 8px 8px; margin: 0; width: min(280px, 85vw); height: auto; align-self: stretch; max-height: calc(100dvh - 16px); overscroll-behavior: contain; -webkit-overflow-scrolling: touch; transform: translateX(calc(-100% - 16px)); opacity: 0;
    box-shadow: var(--shadow-deep); }
  .nav-toggle:checked ~ .sidebar { transform: none; opacity: 1; transition: transform var(--dur) var(--ease), opacity var(--dur) var(--ease); }
  .nav-toggle:checked ~ .nav-scrim { display: block; position: fixed; inset: 0; z-index: 15; background: rgba(0,0,0,.3); animation: fade-in 120ms var(--ease); }
  .page { padding: 1rem .75rem 2.5rem; }
}
@media (max-width: 520px) { .theme button { padding: 4px 7px; } }

.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; margin-bottom: 1rem; }
.cards { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); }
.card, .panel, .auth { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.1rem; }
.panel { margin-bottom: 1rem; }
.card-head { display: flex; flex-direction: column; gap: .4rem; align-items: flex-start; }
.card-title { font-weight: 650; font-size: 1.05rem; color: var(--text); }
.card-foot { margin-top: .75rem; padding-top: .6rem; border-top: 1px solid var(--line); font-size: .9rem; }
.kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: .75rem; margin-top: .9rem; }
.kpi-label { font-size: .75rem; color: var(--muted); }
.kpi-value { font-weight: 650; font-variant-numeric: tabular-nums; }
.kpi.bad .kpi-value, .bad { color: var(--bad); }
.kpi.warn .kpi-value, .warn { color: var(--warn); }
.kpi.ok .kpi-value, .ok { color: var(--ok); }
.table tr.bad td { color: var(--bad); }
.table tr.warn td { color: var(--warn); }
.table tr.ok td:nth-child(2) { color: var(--ok); }
.small-note { font-size: .85rem; margin: .6rem 0 0; }
.card-note { margin-top: .6rem; font-size: .85rem; }
.badge { display: inline-block; font-size: .78rem; padding: .2rem .55rem; border-radius: 999px; background: var(--bg); white-space: nowrap; font-weight: 600; }
.badge small { font-weight: 400; }
.badge.campaign { background: var(--ok-bg); color: var(--ok); }
.badge.closing { background: var(--warn-bg); color: var(--warn); }
.badge.waiting { background: var(--warn-bg); color: var(--warn); }
.table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.table th, .table td { text-align: left; padding: .5rem .6rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table th { font-size: .78rem; color: var(--muted); font-weight: 600; }
.table .r { text-align: right; font-variant-numeric: tabular-nums; }
.table tr.hl td { background: var(--warn-bg); }
.table tr.dim td { opacity: .55; }
.timeline { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: .5rem; }
.timeline li { border-top: 3px solid var(--line); padding-top: .5rem; }
.timeline li.past { border-color: var(--muted); }
.timeline li.now { border-color: var(--brand); }
.tl-date { font-weight: 650; }
.tl-label { font-size: .85rem; color: var(--muted); }
.form label { display: flex; flex-direction: column; gap: .3rem; font-size: .85rem; font-weight: 550; margin-bottom: .75rem; }
.form fieldset { border: 1px solid var(--line); border-radius: var(--radius); padding: .8rem 1rem .2rem; margin: 0 0 1rem; background: var(--surface); }
.form legend { font-weight: 650; padding: 0 .35rem; }
input, select, textarea { font: inherit; padding: .5rem .6rem; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); color: var(--text); width: 100%; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--brand); outline-offset: -1px; }
input.small { width: 10rem; padding: .3rem .45rem; font-size: .85rem; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 1rem; }
.grid4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0 1rem; }
.btn { display: inline-block; font: inherit; font-weight: 600; padding: .5rem .9rem; border-radius: 7px; border: 1px solid var(--line); background: var(--surface); color: var(--text); cursor: pointer; }
.btn:hover { text-decoration: none; filter: brightness(.97); }
.btn.primary { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }
.btn.danger { color: var(--bad); border-color: var(--bad); }
.btn.wide { width: 100%; }
button.link { background: none; border: 0; color: var(--brand); cursor: pointer; font: inherit; padding: 0; }
form.inline { display: inline-flex; gap: .4rem; align-items: center; margin-left: .5rem; }
form.inline select { width: auto; padding: .25rem .4rem; }
.actions { display: flex; gap: .5rem; margin: .5rem 0 1rem; }
.danger-zone { border-top: 1px solid var(--line); padding-top: 1rem; }
.alert { padding: .65rem .85rem; border-radius: 8px; background: var(--bad-bg); color: var(--bad); margin: .5rem 0 1rem; font-size: .9rem; }
.alert.ok { background: var(--ok-bg); color: var(--ok); }
.alert.warn { background: var(--warn-bg); color: var(--warn); }
.preview { display: grid; grid-template-columns: repeat(4, 1fr); gap: .5rem; padding: .6rem 0 .9rem; font-size: .85rem; }
.preview div b { display: block; font-size: 1rem; font-variant-numeric: tabular-nums; }
.empty { padding: 2.5rem; text-align: center; background: var(--surface); border: 1px dashed var(--line); border-radius: var(--radius); color: var(--muted); }
.pre { white-space: pre-wrap; margin: 0; }
@media (max-width: 720px) {
  .table.targets th:nth-child(4), .table.targets td:nth-child(4) { display: none; }
  .page { padding: 1rem; }
  .cards { grid-template-columns: 1fr; }
  .grid3, .grid4, .timeline, .preview { grid-template-columns: 1fr 1fr; }
  .kpis { grid-template-columns: 1fr 1fr; }

  .badge { white-space: normal; }
  .table { font-size: .85rem; }
}
.kpis-6 { grid-template-columns: repeat(6, 1fr); margin-top: 0; }
.small-note { font-size: .85rem; margin: .6rem 0 0; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-bottom: 1rem; }
.two-col .panel { margin-bottom: 0; }
.mt { margin-top: 1.2rem; }
.picker select { width: auto; min-width: 14rem; }
.filters { display: flex; justify-content: space-between; gap: 1rem; align-items: center; margin-bottom: .75rem; flex-wrap: wrap; }
.tabs { display: flex; gap: .25rem; flex-wrap: wrap; }
.tabs a { padding: .3rem .7rem; border-radius: 6px; color: var(--muted); font-size: .9rem; }
.tabs a.on, .tabs a:hover { background: var(--bg); color: var(--text); text-decoration: none; }
.search input { width: 16rem; }
.scroll { overflow-x: auto; }
.nowrap { white-space: nowrap; }
.badge.st-layak { background: var(--ok-bg); color: var(--ok); }
.badge.st-tidak_layak { background: var(--bad-bg); color: var(--bad); }
.badge.st-semak { background: var(--warn-bg); color: var(--warn); }
@media (max-width: 720px) {
  .kpis-6 { grid-template-columns: 1fr 1fr 1fr; }
  .two-col { grid-template-columns: 1fr; }
  .search, .search input { width: 100%; }
}
.section-title { display: flex; justify-content: space-between; align-items: baseline; margin-top: .5rem; }
.small-link { font-size: .85rem; font-weight: 500; }
.table td.bad { color: var(--bad); }
.table td.warn { color: var(--warn); }
.table td.ok { color: var(--ok); }
.verdict { border-left: 4px solid var(--line); }
.verdict.ok { border-left-color: var(--ok); background: var(--ok-bg); }
.verdict.warn { border-left-color: var(--warn); background: var(--warn-bg); }
.verdict.bad { border-left-color: var(--bad); background: var(--bad-bg); }
.verdict-title { font-weight: 700; font-size: 1.1rem; margin: .15rem 0; }
.verdict.ok .verdict-title { color: var(--ok); }
.verdict.warn .verdict-title { color: var(--warn); }
.verdict.bad .verdict-title { color: var(--bad); }
.badge.closed { background: var(--brand); color: var(--brand-ink); margin-left: .3rem; }
.badge.lv-ok { background: var(--ok-bg); color: var(--ok); }
.badge.lv-warn { background: var(--warn-bg); color: var(--warn); }
.badge.lv-bad { background: var(--bad-bg); color: var(--bad); }
.table.report td, .table.report th { white-space: nowrap; }
.table tfoot th { color: var(--text); font-size: .9rem; border-top: 2px solid var(--line); }
.table.report .badge { white-space: nowrap; }
.table.report td:first-child { position: sticky; left: 0; background: var(--surface); }
.cards.creatives { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.card.creative { padding: 0; overflow: hidden; display: flex; flex-direction: column; }
.creative-body { padding: .8rem 1rem 1rem; display: flex; flex-direction: column; gap: .35rem; }
.thumb { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; display: block; background: var(--bg); }
.thumb.big { aspect-ratio: auto; max-height: 360px; object-fit: contain; border-radius: 8px; margin-bottom: .75rem; }
.empty-thumb { display: flex; align-items: center; justify-content: center; color: var(--muted); font-weight: 600; aspect-ratio: 16 / 9; }
.mini { display: grid; grid-template-columns: repeat(3, 1fr); gap: .3rem .6rem; font-size: .8rem; color: var(--muted); margin-top: .25rem; }
.mini b { display: block; color: var(--text); font-size: .92rem; font-variant-numeric: tabular-nums; }
.mini b.ok { color: var(--ok); } .mini b.warn { color: var(--warn); } .mini b.bad { color: var(--bad); }
code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .85em; background: var(--bg); padding: .05rem .3rem; border-radius: 4px; }
.dl { display: grid; grid-template-columns: max-content 1fr; gap: .4rem 1rem; margin: 0; font-size: .92rem; }
.dl dt { color: var(--muted); }
.dl dd { margin: 0; }
.copy-row { display: flex; gap: .5rem; margin-top: .35rem; }
.copy-row input { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .85rem; }
.url-cell input { font-size: .8rem; min-width: 22rem; }
.funnel { display: grid; grid-template-columns: repeat(5, 1fr); gap: .5rem; }
.funnel .step { padding: .5rem .7rem; background: var(--bg); border-radius: 8px; }
.funnel .kpi-value { font-size: 1.3rem; }
.checks { display: flex; flex-wrap: wrap; gap: .5rem 1rem; margin-bottom: .75rem; }
.form label.check { flex-direction: row; align-items: center; gap: .4rem; font-weight: 500; margin: 0; }
.check input { width: auto; }
.table.pipe select, .table.pipe input[type=date] { padding: .3rem .4rem; font-size: .85rem; min-width: 8rem; }
.btn.small { padding: .3rem .55rem; font-size: .82rem; }
.row-actions { display: flex; gap: .3rem; margin: 0; }
.small { font-size: .8rem; }
tr.closed-row td { background: var(--ok-bg); }
@media (max-width: 720px) { .funnel { grid-template-columns: repeat(3, 1fr); } }
.issue-head { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.issue-head h2 { margin: 0; }
.panel.issue.no-action { border-color: var(--bad); }
.suggest { margin: .3rem 0 .6rem; padding-left: 1.2rem; font-size: .92rem; }
.actions-list { list-style: none; padding: 0; margin: .5rem 0; display: flex; flex-direction: column; gap: .4rem; }
.actions-list li { padding: .45rem .6rem; background: var(--bg); border-radius: 8px; font-size: .92rem; }
.actions-list li.selesai span:nth-child(2) { text-decoration: line-through; color: var(--muted); }
.add-action { display: flex; gap: .4rem; flex-wrap: wrap; align-items: center; margin-top: .5rem; }
.add-action input[name=title] { flex: 1; min-width: 14rem; }
.add-action input[type=date] { width: auto; }
.reason-group { margin-top: 1rem; }
.reason-group h3 { font-size: .98rem; margin: 0 0 .2rem; }
.alert.banner { display: block; font-weight: 600; text-decoration: none; }
textarea#daily-text { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .85rem; }

/* Function 11: AI Creative Engine */
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
ul.plain { list-style: none; padding: 0; margin: 0; }
ul.plain li { padding: .45rem 0; border-bottom: 1px solid var(--line, #e5e7eb); }
ul.plain li:last-child { border-bottom: 0; }
.variants .card h3 { margin: .25rem 0 .5rem; }
.variants .copy { white-space: pre-wrap; line-height: 1.5; }
@media (max-width: 720px) { .grid2 { grid-template-columns: 1fr; } }

/* Function 12: Integrasi */
ol.steps { margin: .25rem 0 .75rem; padding-left: 1.25rem; line-height: 1.6; }
ol.steps code, .panel p code { font-size: .85em; background: var(--bg); padding: .05rem .3rem; border-radius: 4px; word-break: break-all; }
.panel h3 { margin: 1.1rem 0 .25rem; font-size: 1rem; }
.panel details summary { cursor: pointer; margin: .5rem 0; }
p.bad { color: var(--bad, #b42318); }
.panel { min-width: 0; }

/* ---------- Design layer: components ---------- */
.card, .panel, .auth, .form fieldset, .empty { border-radius: var(--radius); border: 1px solid var(--border); box-shadow: var(--shadow); }
.card, .panel { padding: 1rem 1.15rem; }
.card { transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease); }
a.card:hover, .card:hover { transform: translateY(-2px); box-shadow: var(--shadow-deep); text-decoration: none; }
.cards, .two-col, .grid2 { gap: 1rem; }
.kpi-value { font-size: 1.35rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.kpi-label { font-size: .75rem; color: var(--text-2); }
.funnel .step, .actions-list li { background: var(--surface-2); border-radius: 10px; }

/* Buttons: primary solid blue, secondary white, ghost text */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .35rem; font: inherit; font-weight: 600; font-size: .9rem; padding: .5rem .95rem; border-radius: 8px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text); line-height: 1.2;
  transition: background-color var(--dur) var(--ease), border-color var(--dur) var(--ease), color var(--dur) var(--ease), box-shadow var(--dur) var(--ease), transform 120ms var(--ease); }
.btn:hover { text-decoration: none; filter: none; border-color: var(--accent); color: var(--accent); }
.btn:active { transform: scale(.97); }
.btn.primary { background: var(--accent-strong); border-color: var(--accent-strong); color: #fff; }
.btn.primary:hover { background: var(--grad); color: #fff; box-shadow: 0 4px 14px color-mix(in srgb, var(--accent-strong) 35%, transparent); }
.btn.ghost { border-color: transparent; background: transparent; color: var(--accent); }
.btn.ghost:hover { background: color-mix(in srgb, var(--accent) 8%, transparent); }
.btn.danger { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 40%, var(--border)); }
.btn.danger:hover { background: var(--bad-bg); color: var(--bad); border-color: var(--bad); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .4; cursor: not-allowed; }
.btn.small { padding: .3rem .6rem; font-size: .8rem; border-radius: 7px; }
button.link { color: var(--accent); }

/* Inputs */
input, select, textarea { border: 0; box-shadow: inset 0 0 0 1px var(--border); border-radius: 12px; padding: .55rem .7rem; background: var(--surface); color: var(--text);
  transition: box-shadow var(--dur) var(--ease); }
input:hover, select:hover, textarea:hover { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 45%, var(--border)); }
input:focus, select:focus, textarea:focus { outline: none; box-shadow: inset 0 0 0 2px var(--accent), 0 0 0 4px color-mix(in srgb, var(--accent) 15%, transparent); }
input:disabled, select:disabled, textarea:disabled { background: var(--surface-2); }
input[type=checkbox], input[type=radio] { box-shadow: none; accent-color: var(--accent); width: auto; }
input.small, .table.pipe select, .table.pipe input[type=date], form.inline select { border-radius: 8px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: none; }

/* Tables: scroll inside their card, soft hover tint */
.table th { font-size: .74rem; font-weight: 600; color: var(--text-2); text-transform: none; }
.table th, .table td { border-bottom: 1px solid var(--border); }
.table tbody tr { transition: background-color var(--dur) var(--ease); }
.table tbody tr:hover td { background: color-mix(in srgb, var(--accent) 4%, transparent); }
.table.report td:first-child { background: var(--surface); }
.scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* Badges and pills */
.badge { display: inline-flex; align-items: center; justify-content: center; gap: .25rem; line-height: 1; border-radius: 999px; padding: .28rem .6rem; font-size: .75rem; font-weight: 600;
  background: var(--surface); box-shadow: inset 0 0 0 1px var(--border); color: var(--text-2); }
.badge.campaign, .badge.st-layak, .badge.lv-ok { background: var(--ok-bg); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ok) 30%, transparent); color: var(--ok); }
.badge.closing, .badge.waiting, .badge.st-semak, .badge.lv-warn { background: var(--warn-bg); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--warn) 30%, transparent); color: var(--warn); }
.badge.st-tidak_layak, .badge.lv-bad { background: var(--bad-bg); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--bad) 30%, transparent); color: var(--bad); }
.badge.closed { background: var(--accent-strong); color: #fff; box-shadow: none; }
code { background: var(--surface-2); border-radius: 6px; }

/* Tabs as a segmented control */
.tabs { display: inline-flex; flex-wrap: wrap; gap: 2px; padding: 3px; background: var(--surface-2); border-radius: 10px; }
.tabs a { padding: .3rem .75rem; border-radius: 8px; color: var(--text-2); font-weight: 500; transition: background-color var(--dur) var(--ease), color var(--dur) var(--ease); }
.tabs a:hover { background: transparent; color: var(--text); text-decoration: none; }
.tabs a.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow); animation: tab-on 220ms var(--ease); }

/* Alerts and verdicts on tinted panels keep status-coloured text */
.alert { border-radius: 10px; box-shadow: inset 0 0 0 1px color-mix(in srgb, currentColor 20%, transparent); }
.verdict { border-left-width: 4px; }
.timeline li.now { border-color: var(--accent); }
.menu-list, details[open] > .menu-list { animation: pop-in 160ms var(--ease) backwards; }

/* ---------- Motion (CSS only, enter animations, no exit) ---------- */
@keyframes page-in { from { opacity: 0; transform: translateY(8px); } }
@keyframes rise-in { from { opacity: 0; transform: translateY(10px) scale(.99); } }
@keyframes line-in { from { opacity: 0; transform: translateY(4px); } }
@keyframes tab-on { 0% { transform: scale(.96); } 60% { transform: scale(1.02); } 100% { transform: scale(1); } }
@keyframes pop-in { from { opacity: 0; transform: translateY(-4px) scale(.98); } }
@keyframes open-in { from { opacity: 0; transform: translateY(-3px); } }
@keyframes fade-in { from { opacity: 0; } }
.cards > *, .panel, .two-col > *, .grid2 > *, .kpis > * { animation: rise-in 320ms var(--ease) backwards; }
.cards > :nth-child(2), .kpis > :nth-child(2) { animation-delay: 40ms; }
.cards > :nth-child(3), .kpis > :nth-child(3) { animation-delay: 80ms; }
.cards > :nth-child(4), .kpis > :nth-child(4) { animation-delay: 120ms; }
.cards > :nth-child(5), .kpis > :nth-child(5) { animation-delay: 160ms; }
.cards > :nth-child(n+6), .kpis > :nth-child(n+6) { animation-delay: 200ms; }
.table tbody tr:nth-child(-n+12) { animation: line-in 280ms var(--ease) backwards; }
.table tbody tr:nth-child(2) { animation-delay: 30ms; } .table tbody tr:nth-child(3) { animation-delay: 60ms; }
.table tbody tr:nth-child(4) { animation-delay: 90ms; } .table tbody tr:nth-child(5) { animation-delay: 120ms; }
.table tbody tr:nth-child(6) { animation-delay: 150ms; } .table tbody tr:nth-child(7) { animation-delay: 180ms; }
.table tbody tr:nth-child(8) { animation-delay: 210ms; } .table tbody tr:nth-child(9) { animation-delay: 240ms; }
.table tbody tr:nth-child(10) { animation-delay: 270ms; } .table tbody tr:nth-child(11) { animation-delay: 300ms; }
.table tbody tr:nth-child(12) { animation-delay: 330ms; }
.panel details[open] > :not(summary) { animation: open-in 180ms var(--ease) backwards; }
.alert { animation: fade-in 120ms var(--ease) backwards; }

/* Wide tables scroll inside their own card on phones, never the whole page. */
.panel, .card, .form fieldset { overflow-x: auto; }

/* Three-dot menu */
.more { position: relative; display: inline-block; }
.more summary { list-style: none; }
.more summary::-webkit-details-marker { display: none; }
.btn.icon { width: 36px; padding: .5rem 0; font-size: 1.1rem; line-height: 1; }
.more .menu-list { position: absolute; right: 0; top: calc(100% + 6px); left: auto; z-index: 10; min-width: 15rem; display: flex; flex-direction: column; padding: 6px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-deep); }
.more .menu-list a { display: flex; flex-direction: column; gap: 2px; padding: 8px 10px; border-radius: 8px; color: var(--text); font-weight: 500; }
.more .menu-list a:hover { background: color-mix(in srgb, var(--accent) 8%, transparent); text-decoration: none; }
.more .menu-list small { font-weight: 400; font-size: .78rem; }
.page-head .actions { align-items: center; flex-wrap: wrap; justify-content: flex-end; }
@media (max-width: 720px) { .page-head { flex-wrap: wrap; } }

/* =================== Visual layer: stat tiles, charts, rings, hero =================== */
:root { --c1: #007aff; --c2: #34c759; --c3: #ff9500; --c4: #ff2d55; --c5: #5856d6; --c6: #30b0c7; }

/* Smooth page-to-page transitions (cross-document View Transitions); the shell stays put. */
@view-transition { navigation: auto; }
.sidebar { view-transition-name: sidebar; }
.topbar { view-transition-name: topbar; }
::view-transition-old(root) { animation: 160ms var(--ease) both vt-out; }
::view-transition-new(root) { animation: 260ms var(--ease) both vt-in; }
@keyframes vt-out { to { opacity: 0; transform: translateY(-4px); } }
@keyframes vt-in { from { opacity: 0; transform: translateY(8px); } }
@media (prefers-reduced-motion: reduce) { ::view-transition-old(root), ::view-transition-new(root) { animation: none; } }

/* Stat tiles: coloured icon square, small grey label, big Space Grotesk number */
.kpis { gap: .6rem; }
.kpi { position: relative; padding: .7rem .8rem; border-radius: 12px; background: var(--surface-2); transition: transform var(--dur) var(--ease), background-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease); }
.kpi:hover { transform: translateY(-2px); background: var(--surface); box-shadow: var(--shadow-deep); }
.kpi-top { display: flex; align-items: center; gap: .5rem; margin-bottom: .35rem; }
.stat-ic { flex: none; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 8px; color: #fff; background: var(--c1);
  animation: icon-in 420ms var(--ease) 80ms backwards; transition: transform var(--dur) var(--ease); }
.kpis > :nth-child(6n+2) .stat-ic { background: var(--c2); }
.kpis > :nth-child(6n+3) .stat-ic { background: var(--c3); }
.kpis > :nth-child(6n+4) .stat-ic { background: var(--c4); }
.kpis > :nth-child(6n+5) .stat-ic { background: var(--c5); }
.kpis > :nth-child(6n+6) .stat-ic { background: var(--c6); }
.kpi:hover .stat-ic, .card:hover .stat-ic { transform: translateY(-2px) scale(1.08) rotate(-6deg); }
.kpi-label { font-size: .74rem; line-height: 1.2; }
.kpi-value { font-size: 1.45rem; line-height: 1.15; }
.kpi-value small { font-family: "Inter", sans-serif; font-size: .74rem; font-weight: 500; letter-spacing: 0; color: var(--text-2); }
.kpi.bad .kpi-value .num { color: var(--bad); } .kpi.warn .kpi-value .num { color: var(--warn); } .kpi.ok .kpi-value .num { color: var(--ok); }
.kpi.bad::after, .kpi.warn::after, .kpi.ok::after { content: ""; position: absolute; top: .7rem; right: .7rem; width: 8px; height: 8px; border-radius: 999px; background: var(--ok); }
.kpi.bad::after { background: var(--bad); } .kpi.warn::after { background: var(--warn); }
.num { font-variant-numeric: tabular-nums; }
@keyframes icon-in { from { opacity: 0; transform: scale(.6) rotate(-12deg); } }

/* Charts */
.viz { margin: 0; position: relative; }
.viz svg { display: block; width: 100%; height: auto; overflow: visible; }
.viz.bars, .viz.trend .plot { position: relative; padding-bottom: 20px; }
.viz.trend svg, .viz.bars svg { height: var(--h); }
.viz .ticks { position: absolute; left: 0; right: 0; bottom: 0; height: 18px; }
.viz .ticks span { position: absolute; transform: translateX(-50%); font: 500 11px "Inter", sans-serif; color: var(--text-2); white-space: nowrap; }
.viz .ticks span.first { transform: none; } .viz .ticks span.last { transform: translateX(-100%); }
.viz i.dot { position: absolute; width: 10px; height: 10px; margin: -5px 0 0 -5px; border-radius: 50%; background: var(--surface); box-shadow: 0 0 0 2.5px var(--c); pointer-events: none; }
.viz .grid { stroke: var(--border); stroke-dasharray: 3 4; }
.viz .axis { stroke: var(--border); }
.viz .tick { fill: var(--text-2); font: 500 11px "Inter", sans-serif; }
.viz .line { fill: none; stroke: var(--c); stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.viz .area { opacity: 1; }
.viz .dot { fill: var(--surface); stroke: var(--c); stroke-width: 2.5; }
.viz .guide { stroke: var(--text-2); stroke-width: 1; stroke-dasharray: 3 3; opacity: 0; transition: opacity var(--dur) var(--ease); pointer-events: none; }
.viz svg.hovering .guide { opacity: .6; }
.viz .hit { fill: transparent; cursor: crosshair; }
.viz .bar { transform-box: fill-box; transform-origin: 50% 100%; transition: filter var(--dur) var(--ease); }
.viz .bar.lv-ok { fill: var(--ok); } .viz .bar.lv-warn { fill: var(--warn); } .viz .bar.lv-bad { fill: var(--bad); }
.viz .bar-g:has(.hit.hot) .bar { filter: brightness(1.12) saturate(1.1); }
.viz.spark { height: 48px; margin-top: .6rem; }
.viz.spark svg { height: 48px; }
.viz.spark .line { stroke-width: 2; }
.legend { display: flex; flex-wrap: wrap; gap: .4rem 1rem; margin-bottom: .5rem; font-size: .78rem; color: var(--text-2); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: .35rem; vertical-align: -1px; }
.viz-empty { padding: 1.5rem; text-align: center; font-size: .9rem; }
.chart-panel h2 { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; }
.chart-panel h2 small { font-family: "Inter", sans-serif; font-weight: 500; font-size: .78rem; letter-spacing: 0; }
.chart-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 1rem; margin-bottom: 1rem; }
.chart-grid .panel { margin-bottom: 0; }

/* Draw-in animations, started by ui.js when the visual scrolls into view (only with JS). */
html.js .viz:not(.in) .series { clip-path: inset(0 100% 0 0); }
html.js .viz:not(.in) .dot { opacity: 0; }
html.js .viz:not(.in) .bar { transform: scaleY(0); }
.viz.in .series { animation: reveal 900ms var(--ease) calc(var(--k, 0) * 120ms) backwards; }
.viz.in .dot { animation: pop 300ms var(--ease) calc(800ms + var(--k, 0) * 120ms) backwards; }
.viz.in .bar { animation: grow 520ms var(--ease) calc(var(--i, 0) * 28ms) backwards; }
@keyframes reveal { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }
@keyframes grow { from { transform: scaleY(0); } }
@keyframes pop { from { opacity: 0; transform: scale(.4); } }
.viz .dot { transform-box: fill-box; transform-origin: center; }

/* Tooltip */
.tip { position: fixed; left: 0; top: 0; z-index: 50; pointer-events: none; max-width: 240px; padding: .5rem .65rem; border-radius: 10px; font-size: .78rem; line-height: 1.4;
  background: color-mix(in srgb, var(--text) 92%, transparent); color: var(--bg); box-shadow: var(--shadow-deep); opacity: 0; transition: opacity 120ms var(--ease); white-space: pre-line; }
.tip.on { opacity: 1; }
.tip b { display: block; font-weight: 600; margin-bottom: 2px; }

/* Progress rings */
.rings { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .5rem; margin-top: .9rem; }
.ring-box { position: relative; display: flex; flex-direction: column; align-items: center; text-align: center; padding: .55rem .3rem .6rem; border-radius: 12px; cursor: default;
  transition: background-color var(--dur) var(--ease), transform var(--dur) var(--ease); --rc: var(--accent); }
.ring-box:hover { background: var(--surface-2); transform: translateY(-2px); }
.ring-box.ok { --rc: var(--ok); } .ring-box.warn { --rc: var(--warn); } .ring-box.bad { --rc: var(--bad); }
.viz.ring { width: 76px; height: 76px; transform: rotate(-90deg); }
.ring-track { fill: none; stroke: var(--surface-2); stroke-width: 8; }
.ring-box:hover .ring-track { stroke: var(--border); }
.ring-fill { fill: none; stroke: var(--rc); stroke-width: 8; stroke-linecap: round; stroke-dasharray: 100; stroke-dashoffset: var(--off); }
html.js .rings:not(.in) .ring-fill { stroke-dashoffset: 100; }
.rings.in .ring-fill { animation: ring 900ms var(--ease) backwards; }
.rings.in .ring-box:nth-child(2) .ring-fill { animation-delay: 80ms; } .rings.in .ring-box:nth-child(3) .ring-fill { animation-delay: 160ms; } .rings.in .ring-box:nth-child(4) .ring-fill { animation-delay: 240ms; }
@keyframes ring { from { stroke-dashoffset: 100; } }
.ring-center { position: absolute; top: .55rem; width: 76px; height: 76px; display: grid; place-items: center; }
.ring-center b { font: 700 1rem "Space Grotesk", sans-serif; letter-spacing: -0.02em; color: var(--rc); }
.ring-label { margin-top: .35rem; font-size: .72rem; color: var(--text-2); }
.ring-value { font: 600 .92rem "Space Grotesk", sans-serif; letter-spacing: -0.02em; line-height: 1.2; }
.ring-value small { display: block; font: 500 .7rem "Inter", sans-serif; color: var(--text-2); letter-spacing: 0; }

/* Horizontal bars (funnel) */
.hbars { display: flex; flex-direction: column; gap: .55rem; }
.hbar { display: grid; grid-template-columns: 8.5rem 1fr 5rem; align-items: center; gap: .75rem; cursor: default; }
.hbar-label { font-size: .85rem; color: var(--text-2); }
.hbar-track { height: 12px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.hbar-fill { height: 100%; width: var(--w); border-radius: 999px; background: var(--grad); transform-origin: left; transition: filter var(--dur) var(--ease); }
.hbar-fill.lv-ok { background: var(--ok); } .hbar-fill.lv-warn { background: var(--warn); } .hbar-fill.lv-bad { background: var(--bad); }
.hbar:hover .hbar-fill { filter: brightness(1.12); }
.hbar-value { text-align: right; font: 600 .95rem "Space Grotesk", sans-serif; }
html.js .hbars:not(.in) .hbar-fill { transform: scaleX(0); }
.hbars.in .hbar-fill { animation: grow-x 700ms var(--ease) calc(var(--i) * 90ms) backwards; }
@keyframes grow-x { from { transform: scaleX(0); } }

/* Home hero banner */
.hero { position: relative; overflow: hidden; border-radius: 24px; padding: 1.5rem 1.6rem 1.2rem; margin-bottom: 1.25rem; color: #fff;
  background: radial-gradient(60% 80% at 85% 10%, rgba(90, 200, 250, .35), transparent 60%), radial-gradient(40% 60% at 10% 100%, rgba(52, 199, 89, .22), transparent 60%), linear-gradient(135deg, #0b1d39, #0a3f86 55%, #0066cc);
  box-shadow: var(--shadow-deep); animation: rise-in 420ms var(--ease) backwards; }
.hero::after { content: ""; position: absolute; width: 260px; height: 260px; right: -60px; bottom: -120px; border-radius: 50%; background: radial-gradient(circle, rgba(64, 156, 255, .55), transparent 70%); pointer-events: none; }
.hero h1 { margin: 0; font-size: 1.7rem; color: #fff; }
.hero p { margin: .25rem 0 0; color: rgba(255, 255, 255, .78); }
.hero-stats { position: relative; z-index: 1; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; margin-top: 1.2rem; }
.hero-stat { padding: .7rem .85rem; border-radius: 14px; background: rgba(255, 255, 255, .1); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .14); transition: background-color var(--dur) var(--ease), transform var(--dur) var(--ease); }
.hero-stat:hover { background: rgba(255, 255, 255, .16); transform: translateY(-2px); }
.hero-stat span { display: block; font-size: .74rem; color: rgba(255, 255, 255, .75); }
.hero-stat b { display: block; font: 700 1.6rem "Space Grotesk", sans-serif; letter-spacing: -0.02em; margin-top: .1rem; }
.hero .hero-stat:nth-child(2) { animation-delay: 60ms; }
.hero .viz { position: relative; z-index: 1; margin-top: 1rem; }
.hero .viz .ticks span, .hero .legend { color: rgba(255, 255, 255, .75); }
.hero .viz .grid, .hero .viz .axis { stroke: rgba(255, 255, 255, .18); }
.hero .viz i.dot { background: #0a3f86; }
.hero-stats > * { animation: rise-in 420ms var(--ease) backwards; }
.hero-stats > :nth-child(2) { animation-delay: 60ms; } .hero-stats > :nth-child(3) { animation-delay: 120ms; } .hero-stats > :nth-child(4) { animation-delay: 180ms; }

.card .card-mini { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .5rem; margin-top: .6rem; }

@media (max-width: 720px) {
  .rings { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero { padding: 1.2rem; border-radius: 20px; }
  .hero h1 { font-size: 1.35rem; }
  .hero-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .6rem; }
  .hero-stat b { font-size: 1.25rem; }
  .hbar { grid-template-columns: 6.5rem 1fr 4rem; gap: .5rem; }
  .chart-grid { grid-template-columns: 1fr; }
}
.spark-head { margin-top: .8rem; font-size: .74rem; }
.score-panel { display: flex; align-items: center; gap: 1.25rem; }
.score-panel .rings { display: block; margin: 0; }
.score-panel .ring-label, .score-panel .ring-value { display: none; }
@media (max-width: 520px) { .viz .ticks span:nth-child(even):not(.last) { display: none; } }

/* ---------- AI Analysis ---------- */
.ai-head h2 { font-size: 1.35rem; line-height: 1.3; margin: .25rem 0 .5rem; }
.ai-actions { margin: 0; padding-left: 1.25rem; display: grid; gap: .9rem; }
.ai-act { margin: .35rem 0 .15rem; font-weight: 600; }
.ai-findings { display: grid; gap: .75rem; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.ai-finding { padding: .9rem 1rem; border-radius: var(--radius); background: var(--bg); border-left: 3px solid var(--warn); }
.ai-finding.good { border-left-color: var(--ok); }
.ai-finding.problem { border-left-color: var(--bad); }
.ai-finding h3 { margin: .45rem 0 .25rem; font-size: 1rem; }
.ai-finding p { margin: 0; }
.ai-snapshot { white-space: pre-wrap; font-size: .8rem; max-height: 28rem; overflow: auto; background: var(--bg); padding: .75rem; border-radius: 8px; }
.ai-history { margin: 0; padding-left: 1rem; }
.ai-history a.on { font-weight: 700; }

/* ---------- Phase list (one row per phase) ---------- */
.phase-group { padding: 0; overflow: hidden; }
.phase-group-head { display: flex; align-items: baseline; justify-content: space-between; gap: .75rem; flex-wrap: wrap; padding: 1rem 1.1rem .5rem; }
.phase-group-head h2 { margin: 0; font-size: 1.05rem; }
.phase-rows { display: grid; }
.phase-row { display: grid; grid-template-columns: minmax(0, 1.2fr) 15.5rem minmax(0, 1.7fr); align-items: center; gap: 1rem; padding: .85rem 1.1rem; border-top: 1px solid var(--line); color: inherit; text-decoration: none; transition: background var(--dur, .2s) var(--ease, ease); }
.phase-row:hover { background: var(--bg); text-decoration: none; }
.pr-stage { justify-self: start; }
.phase-row.st-done { opacity: .6; }
.pr-name { font-weight: 600; }
.pr-dates { font-size: .85rem; margin-top: .1rem; }
.pr-figs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .75rem; align-items: start; }
.pr-fig { display: grid; gap: .1rem; min-width: 0; }
.pr-fig small { color: var(--muted); font-size: .72rem; text-transform: uppercase; letter-spacing: .04em; }
.pr-fig b { font-variant-numeric: tabular-nums; font-size: .95rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pr-fig.ok b { color: var(--ok); } .pr-fig.warn b { color: var(--warn); } .pr-fig.bad b { color: var(--bad); }
.meter { display: block; height: 4px; border-radius: 4px; background: var(--line); overflow: hidden; margin-top: .2rem; }
.meter > span { display: block; height: 100%; border-radius: inherit; background: var(--accent); transition: width .7s var(--ease, ease); }
.meter.lv-ok > span { background: var(--ok); } .meter.lv-warn > span { background: var(--warn); } .meter.lv-bad > span { background: var(--bad); }
@media (max-width: 760px) {
  .phase-row { grid-template-columns: minmax(0, 1fr); gap: .45rem; }
  .pr-figs { gap: .5rem; margin-top: .25rem; }
  .pr-fig b { font-size: .88rem; }
}

/* =================== Apple polish layer: one spacing scale, pill buttons, glass bars, spring motion =================== */
:root {
  --ease: cubic-bezier(0.32, 0.72, 0, 1); --ease-out: cubic-bezier(0.22, 1, 0.36, 1); --dur: 240ms;
  --radius: 18px; --btn-h: 36px; --btn-h-sm: 30px; --ctl-h: 40px; --gap: 10px;
}
body { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; text-rendering: optimizeLegibility; transition: background-color 300ms var(--ease); }
h1 { font-size: 1.85rem; letter-spacing: -0.03em; line-height: 1.15; }
h2 { letter-spacing: -0.02em; }
.page { padding: 1.5rem 1.5rem 3.5rem; animation: page-in 420ms var(--ease-out) backwards; }
.page-head { align-items: center; margin-bottom: 1.25rem; }
.page-head h1 { margin: 0; }
.page-head > div > p, .page-head > div > .muted { margin: .3rem 0 0; }

/* Glass top bar and calmer sidebar */
.topbar { background: color-mix(in srgb, var(--surface) 72%, transparent); -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px);
  border-color: color-mix(in srgb, var(--border) 70%, transparent); border-radius: 16px; padding: 8px 10px 8px 16px; }
.sidebar { border-radius: 20px; border-color: color-mix(in srgb, var(--border) 70%, transparent); padding: 16px 12px; }
.sidebar nav a { padding: 8px 12px; border-radius: 10px; transition: background-color var(--dur) var(--ease), color var(--dur) var(--ease), transform 160ms var(--ease); }
.sidebar nav a:active { transform: scale(.98); }
.sidebar nav a.on { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 14%, transparent); }

/* Surfaces */
.card, .panel, .auth, .form fieldset, .empty { border-radius: var(--radius); border-color: color-mix(in srgb, var(--border) 75%, transparent); }
.card, .panel { padding: 1.25rem 1.35rem; }
.panel { margin-bottom: 1.25rem; transition: box-shadow var(--dur) var(--ease), background-color 300ms var(--ease); }
.panel > h2:first-child, .card > h2:first-child { margin-bottom: .9rem; }
.cards, .two-col, .grid2, .chart-grid { gap: 1.25rem; }
.chart-grid { margin-bottom: 1.25rem; }
.alert { border-radius: 14px; padding: .8rem 1rem; }
.empty { padding: 3rem 1.5rem; }

/* Buttons: one height per size, pill shape, never wrap */
.btn { min-height: var(--btn-h); padding: 0 16px; border-radius: 980px; font-size: 14px; font-weight: 500; letter-spacing: -0.01em; line-height: 1; white-space: nowrap; gap: 6px; vertical-align: middle;
  transition: background-color var(--dur) var(--ease), border-color var(--dur) var(--ease), color var(--dur) var(--ease), box-shadow var(--dur) var(--ease), transform 160ms var(--ease); }
.btn:hover { border-color: color-mix(in srgb, var(--accent) 55%, var(--border)); color: var(--accent); background: color-mix(in srgb, var(--accent) 5%, var(--surface)); }
.btn:active { transform: scale(.96); }
.btn.primary { background: var(--accent-strong); border-color: transparent; color: #fff; }
.btn.primary:hover { background: color-mix(in srgb, var(--accent-strong) 88%, #fff); color: #fff; box-shadow: 0 6px 18px color-mix(in srgb, var(--accent-strong) 30%, transparent); }
.btn.danger:hover { background: var(--bad-bg); }
.btn.small { min-height: var(--btn-h-sm); padding: 0 12px; font-size: 13px; border-radius: 980px; }
.btn.icon { width: var(--btn-h); min-width: var(--btn-h); padding: 0; }
.btn.wide { width: 100%; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .38; transform: none; box-shadow: none; }
button.link { padding: 4px 8px; margin: -4px -8px; border-radius: 8px; font-weight: 500; transition: background-color var(--dur) var(--ease); }
button.link:hover { background: color-mix(in srgb, var(--accent) 8%, transparent); }

/* Button rows: same gap everywhere; wrapper forms never change a button's size */
.actions, .row-actions, .add-action, .copy-row, .filters { gap: var(--gap); align-items: center; }
.actions { flex-wrap: wrap; margin: .9rem 0 1rem; }
.actions:last-child { margin-bottom: 0; }
.actions > form, .row-actions > form, .page-head form, .card-foot form, form[style*="display:inline"] { display: inline-flex !important; align-items: center; gap: var(--gap); margin: 0; }
.page-head .actions { margin: 0; }
.card-foot { display: flex; gap: var(--gap); align-items: center; }

/* Controls: one height so a button beside an input lines up */
input:not([type=checkbox]):not([type=radio]):not([type=file]), select { min-height: var(--ctl-h); border-radius: 10px; padding: 0 .8rem; }
textarea { border-radius: 12px; padding: .65rem .8rem; }
input[type=file] { padding: .55rem .8rem; border-radius: 10px; }
.add-action .btn, .copy-row .btn, .search .btn, .picker .btn { min-height: var(--ctl-h); padding: 0 18px; font-size: 14px; }
.table input:not([type=checkbox]), .table select, input.small, form.inline select, .table.pipe select, .table.pipe input[type=date] { min-height: 32px; padding: 0 .55rem; border-radius: 8px; }
.form label { gap: .4rem; margin-bottom: 1rem; }
.form .actions { margin-top: 1.25rem; }
input[type=checkbox], input[type=radio] { width: 18px; height: 18px; }

/* Tables */
.table th, .table td { padding: .7rem .75rem; }
.table th { letter-spacing: .01em; }
.table tbody tr:last-child td { border-bottom: 0; }

/* Segmented tabs */
.tabs { padding: 3px; border-radius: 12px; margin-bottom: 1.25rem; }
.tabs a { padding: .4rem .9rem; border-radius: 9px; font-size: .9rem; }
.tabs a.on { animation: none; transition: background-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease); }

/* Badges a touch roomier */
.badge { padding: .32rem .65rem; }

/* Bars: values stay on one line */
.hbar { grid-template-columns: 9rem minmax(0, 1fr) auto; }
.hbar-value { white-space: nowrap; font-size: .9rem; }

/* Motion: quick, springy entrances; short stagger */
@keyframes page-in { from { opacity: 0; transform: translateY(10px); } }
@keyframes rise-in { from { opacity: 0; transform: translateY(12px) scale(.985); } }
.cards > *, .panel, .two-col > *, .grid2 > *, .kpis > * { animation: rise-in 520ms var(--ease-out) backwards; }
.page > :nth-child(2) { animation-delay: 30ms; } .page > :nth-child(3) { animation-delay: 60ms; } .page > :nth-child(4) { animation-delay: 90ms; } .page > :nth-child(n+5) { animation-delay: 120ms; }
.table tbody tr:nth-child(-n+12) { animation: line-in 360ms var(--ease-out) backwards; }
.card:hover, a.card:hover { transform: translateY(-3px); }
::view-transition-old(root) { animation: 180ms var(--ease) both vt-out; }
::view-transition-new(root) { animation: 360ms var(--ease-out) both vt-in; }

@media (max-width: 960px) { .page { padding: 1rem .9rem 2.5rem; } h1 { font-size: 1.55rem; } }
@media (max-width: 720px) { .page-head { align-items: flex-start; } .card, .panel { padding: 1rem 1.05rem; } }
/* Fieldset titles sit inside the card, not on its border */
.form fieldset { padding: 1.1rem 1.35rem .35rem; margin-bottom: 1.25rem; }
.form legend { float: left; width: 100%; padding: 0; margin: 0 0 .9rem; font: 600 1rem "Space Grotesk", "Inter", sans-serif; letter-spacing: -0.02em; }
.form legend + * { clear: both; }
@media (max-width: 760px) { .pr-fig b { font-size: .84rem; overflow: visible; text-overflow: clip; } .pr-figs { gap: .4rem; } }

/* ---------- Calm metrics: neutral numbers, colour only where action is needed ---------- */
.stat-ic { display: none; }
.kpi-top { margin-bottom: .25rem; }
.kpi.ok .kpi-value .num, .kpi.warn .kpi-value .num { color: var(--text); }
.kpi.ok::after { display: none; }
.kpi:hover { transform: none; box-shadow: none; background: var(--surface-2); }
i.dot { display: inline-block; width: 7px; height: 7px; border-radius: 999px; background: var(--text-2); flex: none; vertical-align: middle; }
i.dot.bad { background: var(--bad); } i.dot.warn { background: var(--warn); } i.dot.ok { background: var(--ok); }

/* ---------- Daily report ---------- */
.day-card { padding: 22px 24px 18px; }
.day-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.day-title { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.day-title a { font-family: "Space Grotesk", "Inter", sans-serif; font-size: 1.15rem; font-weight: 600; letter-spacing: -.01em; color: var(--text); text-decoration: none; }
.day-title a:hover { color: var(--accent); }
.day-title .muted { font-size: .85rem; }
.day-issues { display: inline-flex; align-items: center; gap: 8px; min-height: 30px; padding: 0 12px; border-radius: 980px; background: var(--surface-2); color: var(--text); font-size: .82rem; font-weight: 500; text-decoration: none; transition: background-color var(--dur) var(--ease); }
.day-issues:hover { background: var(--border); }
.day-issues span { color: var(--text-2); font-size: 1rem; line-height: 1; }
.score { display: grid; grid-template-columns: 5.5rem repeat(7, minmax(0, 1fr)); border-top: 1px solid var(--border); }
.sc-col { display: grid; grid-template-rows: auto; grid-auto-rows: 1fr; min-width: 0; }
.sc-col + .sc-col:not(.sc-when) { border-left: 1px solid var(--border); }
.sc-label { padding: 12px 14px 6px; font-size: .74rem; font-weight: 500; color: var(--text-2); white-space: nowrap; }
.sc-cell { display: flex; flex-direction: column; justify-content: center; gap: 2px; padding: 8px 14px 12px; min-width: 0; }
.sc-col .sc-cell + .sc-cell { border-top: 1px solid var(--border); }
.sc-when .sc-cell { font-size: .8rem; font-weight: 500; color: var(--text-2); padding-left: 0; }
.sc-when .sc-label { padding-left: 0; }
.sc-v { display: inline-flex; align-items: center; gap: 7px; font-family: "Space Grotesk", "Inter", sans-serif; font-size: 1.25rem; font-weight: 600; letter-spacing: -.015em; font-variant-numeric: tabular-nums; white-space: nowrap; color: var(--text); }
.sc-cell small { font-size: .74rem; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.day-verdict { display: flex; align-items: baseline; gap: 8px; margin: 14px 0 0; padding-top: 14px; border-top: 1px solid var(--border); font-size: .86rem; }
.day-verdict i.dot { transform: translateY(-1px); }
.share { padding: 0; }
.share summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 24px; cursor: pointer; list-style: none; font-weight: 600; }
.share summary::-webkit-details-marker { display: none; }
.share summary > span::before { content: "›"; display: inline-block; margin-right: 10px; color: var(--text-2); transition: transform var(--dur) var(--ease); }
.share[open] summary > span::before { transform: rotate(90deg); }
.share textarea { display: block; width: calc(100% - 48px); margin: 0 24px 20px; }
@media (max-width: 900px) {
  .score { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; border-top: 0; }
  .sc-when { display: none; }
  .sc-col, .sc-col + .sc-col:not(.sc-when) { border: 0; border-radius: 12px; background: var(--surface-2); }
  .sc-col .sc-cell + .sc-cell { border-top: 1px solid var(--border); }
  .sc-cell::before { content: attr(data-when); font-size: .68rem; font-weight: 500; color: var(--text-2); text-transform: uppercase; letter-spacing: .04em; }
  .sc-v { font-size: 1.1rem; }
  .day-card { padding: 18px 16px 16px; }
  .share summary { padding: 14px 16px; }
  .share textarea { width: calc(100% - 32px); margin: 0 16px 16px; }
}
@media (max-width: 900px) { .day-verdict { display: block; } .day-verdict i.dot { margin-right: 6px; } }

/* ---------- Calm layer: status shown by a small dot, text stays neutral ---------- */
.kpi.bad .kpi-value .num { color: var(--text); }
.table td.ok, .table td.warn, .table td.bad, .table tr.ok td { color: var(--text); }
.table td.warn::before, .table td.bad::before { content: ""; display: inline-block; width: 6px; height: 6px; margin-right: 7px; border-radius: 999px; vertical-align: .12em; background: var(--warn); }
.table td.bad::before { background: var(--bad); }
.pr-fig.ok b, .pr-fig.warn b, .pr-fig.bad b { color: var(--text); }
.pr-fig.warn b::before, .pr-fig.bad b::before { content: ""; display: inline-block; width: 6px; height: 6px; margin-right: 6px; border-radius: 999px; vertical-align: .15em; background: var(--warn); }
.pr-fig.bad b::before { background: var(--bad); }
/* Status pills: neutral pill, coloured dot */
.badge.lv-ok, .badge.lv-warn, .badge.lv-bad, .badge.st-layak, .badge.st-tidak_layak, .badge.st-semak, .badge.campaign, .badge.closing, .badge.waiting {
  display: inline-flex; align-items: center; gap: 6px; background: var(--surface-2); color: var(--text); box-shadow: none; font-weight: 500; }
.badge.lv-ok::before, .badge.lv-warn::before, .badge.lv-bad::before, .badge.st-layak::before, .badge.st-tidak_layak::before, .badge.st-semak::before, .badge.campaign::before, .badge.closing::before, .badge.waiting::before {
  content: ""; width: 6px; height: 6px; border-radius: 999px; flex: none; background: var(--ok); }
.badge.lv-warn::before, .badge.st-semak::before, .badge.closing::before, .badge.waiting::before { background: var(--warn); }
.badge.lv-bad::before, .badge.st-tidak_layak::before { background: var(--bad); }
/* Verdicts: a quiet card with a dot in front of the title */
.verdict, .verdict.ok, .verdict.warn, .verdict.bad { background: var(--surface); border-left: 0; }
.verdict .verdict-title, .verdict.ok .verdict-title, .verdict.warn .verdict-title, .verdict.bad .verdict-title { display: flex; align-items: center; gap: 9px; color: var(--text); font-size: 1.05rem; }
.verdict .verdict-title::before { content: ""; width: 8px; height: 8px; border-radius: 999px; flex: none; background: var(--text-2); }
.verdict.ok .verdict-title::before { background: var(--ok); } .verdict.warn .verdict-title::before { background: var(--warn); } .verdict.bad .verdict-title::before { background: var(--bad); }
.verdict, .verdict * { color: inherit; }
.verdict { color: var(--text-2); }
.panel.issue.no-action { border-color: var(--border); }
/* Alerts: neutral surface, dot by kind */
.alert, .alert.ok, .alert.warn { background: var(--surface); color: var(--text); box-shadow: inset 0 0 0 1px var(--border); padding-left: 2rem; position: relative; }
.alert::before { content: ""; position: absolute; left: 1rem; top: 1.15rem; width: 7px; height: 7px; border-radius: 999px; background: var(--bad); }
.alert.ok::before { background: var(--ok); } .alert.warn::before { background: var(--warn); }
.alert.banner { color: var(--text); }
.more-row { display: flex; justify-content: center; padding-top: 12px; }
.clip-wrap:not(.all) table.clip > tbody > tr:nth-child(n+26) { display: none; }
.share .details-body { padding: 0 24px 20px; }
@media (max-width: 900px) { .share .details-body { padding: 0 16px 16px; } }
.table.report th, .table.report td { padding-left: 9px; padding-right: 9px; }
.table.report td:first-child { min-width: 13rem; }

/* ---------- Translucent glass ---------- */
/* Soft colour fields behind the page give the frosted panels something to blur. */
:root {
  --glass: rgba(255, 255, 255, .5); --glass-strong: rgba(255, 255, 255, .78); --glass-edge: rgba(255, 255, 255, .7);
  --surface: rgba(255, 255, 255, .62); --surface-2: rgba(120, 120, 128, .09); --border: rgba(60, 60, 67, .13);
  --glass-shadow: 0 1px 0 rgba(255, 255, 255, .6) inset, 0 8px 32px rgba(31, 38, 135, .08), 0 1px 3px rgba(0, 0, 0, .04);
  --bg: #eef1f7;
  --bg-art: radial-gradient(40rem 32rem at 8% 0%, rgba(120, 170, 255, .45), transparent 70%),
            radial-gradient(36rem 30rem at 100% 10%, rgba(196, 160, 255, .38), transparent 70%),
            radial-gradient(44rem 34rem at 70% 100%, rgba(110, 220, 210, .32), transparent 70%),
            radial-gradient(30rem 26rem at 0% 90%, rgba(255, 190, 160, .30), transparent 70%);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --glass: rgba(28, 28, 32, .52); --glass-strong: rgba(28, 28, 32, .78); --glass-edge: rgba(255, 255, 255, .09);
    --surface: rgba(30, 30, 34, .55); --surface-2: rgba(255, 255, 255, .06); --border: rgba(255, 255, 255, .1);
    --glass-shadow: 0 1px 0 rgba(255, 255, 255, .06) inset, 0 10px 36px rgba(0, 0, 0, .45);
    --bg: #07080c;
    --bg-art: radial-gradient(40rem 32rem at 8% 0%, rgba(40, 90, 220, .35), transparent 70%),
              radial-gradient(36rem 30rem at 100% 10%, rgba(130, 70, 220, .28), transparent 70%),
              radial-gradient(44rem 34rem at 70% 100%, rgba(20, 150, 140, .22), transparent 70%),
              radial-gradient(30rem 26rem at 0% 90%, rgba(200, 90, 60, .18), transparent 70%);
  }
}
:root[data-theme="dark"] {
  --glass: rgba(28, 28, 32, .52); --glass-strong: rgba(28, 28, 32, .78); --glass-edge: rgba(255, 255, 255, .09);
  --surface: rgba(30, 30, 34, .55); --surface-2: rgba(255, 255, 255, .06); --border: rgba(255, 255, 255, .1);
  --glass-shadow: 0 1px 0 rgba(255, 255, 255, .06) inset, 0 10px 36px rgba(0, 0, 0, .45);
  --bg: #07080c;
  --bg-art: radial-gradient(40rem 32rem at 8% 0%, rgba(40, 90, 220, .35), transparent 70%),
            radial-gradient(36rem 30rem at 100% 10%, rgba(130, 70, 220, .28), transparent 70%),
            radial-gradient(44rem 34rem at 70% 100%, rgba(20, 150, 140, .22), transparent 70%),
            radial-gradient(30rem 26rem at 0% 90%, rgba(200, 90, 60, .18), transparent 70%);
}
html { background: var(--bg); }
body { background: var(--bg); min-height: 100vh; position: relative; isolation: isolate; }
body::before { content: ""; position: fixed; inset: 0; z-index: -1; background: var(--bg-art); pointer-events: none; }
.card, .panel, .auth, .empty, .sidebar, .topbar, details.panel, .alert, .form fieldset {
  background: var(--glass); border: 1px solid var(--glass-edge); box-shadow: var(--glass-shadow);
  -webkit-backdrop-filter: blur(28px) saturate(170%); backdrop-filter: blur(28px) saturate(170%);
}
.form fieldset { background: transparent; -webkit-backdrop-filter: none; backdrop-filter: none; box-shadow: none; border-color: var(--border); }
.topbar { background: var(--glass-strong); }
.sidebar nav a.on { background: color-mix(in srgb, var(--accent) 14%, transparent); }
/* Tiles inside a glass panel: a faint tint instead of another blur layer */
.kpi, .day-issues, .tabs, .theme { background: var(--surface-2); }
@media (max-width: 900px) { .sc-col, .sc-col + .sc-col:not(.sc-when) { background: var(--surface-2); } }
.kpi:hover { background: color-mix(in srgb, var(--text) 7%, transparent); }
.table tbody tr:hover td { background: color-mix(in srgb, var(--text) 4%, transparent); }
input, select, textarea { background: color-mix(in srgb, var(--glass-strong) 80%, transparent); border-color: var(--border); }
.tabs a.on, .theme button[aria-pressed="true"], .theme .on { background: var(--glass-strong); box-shadow: 0 1px 3px rgba(0, 0, 0, .08); }
.btn:not(.primary) { background: color-mix(in srgb, var(--glass-strong) 85%, transparent); border-color: var(--border); }
/* Text stays crisp on glass */
.muted, .kpi-label, .sc-label, small { color: var(--text-2); }
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .card, .panel, .auth, .empty, .sidebar, .topbar, details.panel, .alert { background: var(--glass-strong); }
}

/* ---------- Sidebar dropdown sections ---------- */
.nav-sec { margin: 6px 0; }
.nav-head { all: unset; box-sizing: border-box; display: flex; width: 100%; align-items: center; justify-content: space-between; min-height: 32px; padding: 6px 10px; border-radius: 8px; cursor: pointer;
  font-size: .72rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--text-2); transition: background-color var(--dur) var(--ease), color var(--dur) var(--ease); }
.nav-head:hover { background: color-mix(in srgb, var(--text) 6%, transparent); color: var(--text); }
.nav-head:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.nav-meta { display: inline-flex; align-items: center; gap: 8px; }
.chev { transition: transform 320ms cubic-bezier(.32, .72, 0, 1); }
.nav-sec.shut .chev { transform: rotate(-90deg); }
.nav-body { display: grid; grid-template-rows: 1fr; }
.nav-sec.ready .nav-body { transition: grid-template-rows 380ms cubic-bezier(.32, .72, 0, 1); }
.nav-sec.shut .nav-body { grid-template-rows: 0fr; }
.nav-inner { min-height: 0; overflow: hidden; padding-top: 2px; }
.nav-inner > a { transition: opacity 260ms ease, transform 320ms cubic-bezier(.32, .72, 0, 1); }
.nav-sec.shut .nav-inner > a { opacity: 0; transform: translateY(-6px); }
.nav-sec:not(.shut) .nav-inner > a:nth-child(2) { transition-delay: 20ms; } .nav-sec:not(.shut) .nav-inner > a:nth-child(3) { transition-delay: 40ms; }
.nav-sec:not(.shut) .nav-inner > a:nth-child(4) { transition-delay: 60ms; } .nav-sec:not(.shut) .nav-inner > a:nth-child(5) { transition-delay: 80ms; }
.nav-sec:not(.shut) .nav-inner > a:nth-child(n+6) { transition-delay: 100ms; }
.sidebar nav .nav-inner a { display: flex; }

/* Top bar: theme and log out as icons */
.theme button { display: inline-grid; place-items: center; width: 30px; height: 26px; padding: 0; }
.theme svg, .logout svg { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.theme svg .fill { fill: currentColor; stroke: none; }
.theme button:hover:not([aria-pressed="true"]) { color: var(--text); }
.me { gap: .5rem; }
.me .logout { width: 30px; height: 30px; color: var(--text-2); border: 0; background: transparent; cursor: pointer; }
.me .logout:hover { color: var(--bad, #d93025); background: color-mix(in srgb, var(--bad, #d93025) 10%, transparent); }
.topbar .theme { margin-right: .25rem; }
@media (max-width: 520px) { .theme button { width: 28px; padding: 0; } }

/* Mobile polish: one consistent gutter, single-column forms, two-up KPIs, scrollable tables */
@media (max-width: 600px) {
  .page { padding: 14px 16px 44px; }
  h1, .page-head h1 { font-size: 1.4rem; line-height: 1.2; }
  .page-head { gap: .6rem; margin-bottom: 1rem; }
  .page-head .actions .btn { white-space: nowrap; }
  .card, .panel { padding: 14px 14px; border-radius: 16px; }
  .cards, .two-col, .grid2, .chart-grid { gap: 12px; }
  .kpis, .kpis-6, .kpis.card-mini { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .kpi { min-width: 0; padding: 10px 11px; }
  .kpi-value, .kpi-value .num { font-size: 1.2rem; overflow-wrap: anywhere; }
  .kpi-label { font-size: .72rem; }
  .form .grid2, .form .grid3, .form .grid4, form .grid3, form .grid4 { grid-template-columns: 1fr; }
  .form fieldset { padding: 14px 14px 4px; }
  .form input, .form select, .form textarea { font-size: 16px; min-height: 44px; }
  .form textarea { min-height: 88px; }
  .form .actions { flex-wrap: wrap; gap: 8px; }
  .btn { min-height: 40px; }
  select.phase-picker, .page-head select { max-width: 100%; }
  .scroll { margin: 0 -14px; padding: 0 14px; }
  .scroll table { min-width: 100%; }
  table.table th, table.table td { padding-left: 8px; padding-right: 8px; }
  .tabs { flex-wrap: wrap; max-width: 100%; }
  .tabs a { white-space: nowrap; }
  .filters { flex-direction: column; align-items: stretch; gap: 8px; }
  .filters .search input { width: 100%; }
}

/* How to (top of every tab) */
.howto { margin: 0 0 12px; border-radius: 14px; background: var(--glass, var(--surface)); border: 1px solid var(--border); backdrop-filter: blur(20px) saturate(160%); -webkit-backdrop-filter: blur(20px) saturate(160%); }
.howto > summary { list-style: none; display: inline-flex; align-items: center; gap: 8px; padding: 9px 14px; cursor: pointer; font-size: .86rem; font-weight: 550; color: var(--accent); }
.howto > summary::-webkit-details-marker { display: none; }
.howto > summary svg { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.howto[open] > summary { border-bottom: 1px solid var(--border); width: 100%; }
.howto-body { padding: 12px 16px 14px; font-size: .9rem; line-height: 1.55; }
.howto-body > p:first-child { margin: 0 0 8px; }
.howto-steps { margin: 0 0 6px; padding-left: 1.2rem; }
.howto-steps li { margin: 4px 0; }
.howto-body .small { margin: 6px 0 0; }

/* System Health */
.health-sum { display: flex; align-items: center; gap: 12px; }
.health-sum .dot { width: 12px; height: 12px; border-radius: 99px; flex: 0 0 auto; background: var(--ok); }
.health-sum .dot.warn { background: var(--warn); }
.health-sum .dot.bad { background: var(--bad); }
.health-sum b { font-size: 1.05rem; }
.health-sum p { margin: 2px 0 0; }
.health-list { list-style: none; margin: 0; padding: 0; }
.health-list li { display: grid; grid-template-columns: 86px 1fr auto; gap: 12px; align-items: start; padding: 12px 0; border-top: 1px solid var(--border); }
.health-list li:first-child { border-top: 0; padding-top: 2px; }
.health-list .badge { justify-self: start; }
.health-title { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.health-body p { margin: 3px 0 0; overflow-wrap: anywhere; }
@media (max-width: 600px) {
  .health-list li { grid-template-columns: 1fr auto; }
  .health-list .badge { grid-column: 1 / -1; }
  .howto-body { padding: 10px 14px 12px; }
}
.score .sc-col b, .score .sc-col .num { overflow-wrap: anywhere; }
@media (min-width: 901px) and (max-width: 1240px) { .score { font-size: .92em; } }
.sc-v { font-size: clamp(.95rem, 1.35vw, 1.2rem); }
.sc-cell { padding-left: 12px; padding-right: 10px; }
@media (max-width: 900px) { .sc-v { font-size: 1.15rem; } }
.score { grid-template-columns: 4.5rem repeat(7, minmax(0, 1fr)); }
.sc-v { gap: 5px; font-size: clamp(.92rem, 1.25vw, 1.2rem); }
@media (max-width: 900px) { .score { grid-template-columns: repeat(2, minmax(0, 1fr)); } .sc-v { font-size: 1.15rem; } }

/* =================== AI Analysis: visual board =================== */
.panel-head { display: flex; align-items: baseline; justify-content: space-between; gap: .5rem 1rem; flex-wrap: wrap; margin-bottom: .75rem; }
.panel-head h2 { margin: 0; }
.ai-hero { --lc: var(--warn); position: relative; padding: 1.25rem 1.4rem 1.1rem; margin-bottom: 1rem; border-radius: var(--radius); border: 1px solid color-mix(in srgb, var(--lc) 30%, var(--border));
  background: linear-gradient(135deg, color-mix(in srgb, var(--lc) 13%, var(--surface)) 0%, var(--surface) 70%); overflow: hidden; }
.ai-hero::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 5px; background: var(--lc); }
.ai-hero.h-ok { --lc: var(--ok); } .ai-hero.h-bad { --lc: var(--bad); }
.ai-hero-top { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.ai-hero h2 { font-size: 1.4rem; line-height: 1.3; margin: .6rem 0 .4rem; }
.ai-summary { margin: 0 0 .9rem; max-width: 70ch; color: var(--text-2, var(--muted)); }
.ai-counts { display: flex; gap: .5rem; flex-wrap: wrap; }
.ai-count { --cc: var(--muted); display: inline-flex; align-items: baseline; gap: .35rem; padding: .4rem .8rem; border-radius: 999px; font: inherit; font-size: .88rem; cursor: pointer;
  border: 1px solid color-mix(in srgb, var(--cc) 35%, var(--border)); background: color-mix(in srgb, var(--cc) 10%, var(--surface)); color: var(--cc); }
.ai-count b { font-size: 1.05rem; }
.ai-count.bad { --cc: var(--bad); } .ai-count.warn { --cc: var(--warn); } .ai-count.ok { --cc: var(--ok); }
.ai-count.calm { cursor: default; }
.ai-count:disabled { opacity: .45; cursor: default; }
.ai-count:not(:disabled):not(.calm):hover { transform: translateY(-1px); }
.ai-legend { display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; margin: .75rem 0 0; }
.ai-legend i.dot { margin-left: .5rem; } .ai-legend i.dot:first-child { margin-left: 0; }
.ai-charts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; margin-bottom: 1rem; }
.ai-charts .panel { margin: 0; }

.ai-actions-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: .75rem; }
.ai-action { --pc: var(--accent); display: flex; flex-direction: column; gap: .35rem; padding: .9rem 1rem 1rem; border-radius: var(--radius); background: var(--surface);
  border: 1px solid var(--border); border-top: 4px solid var(--pc); animation: pop-in 260ms var(--ease) backwards; animation-delay: calc(var(--i) * 50ms); }
.ai-action.p-bad { --pc: var(--bad); } .ai-action.p-warn { --pc: var(--warn); } .ai-action.p-calm { --pc: var(--border); }
.ai-action-top { display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; }
.ai-step { display: inline-grid; place-items: center; width: 1.6rem; height: 1.6rem; border-radius: 999px; background: var(--pc); color: #fff; font-weight: 700; font-size: .85rem; }
.ai-action.p-calm .ai-step { background: var(--surface-2); color: var(--text); }
.ai-action h3 { font-size: 1rem; line-height: 1.4; margin: .2rem 0 0; }
.ai-action p { margin: 0; }
.ai-action-foot, .ai-finding-foot { margin-top: auto; padding-top: .5rem; }
.badge.lv-calm { background: var(--surface-2); color: var(--muted); }
.ai-menu { margin-left: auto; }
.ai-menu summary.btn.icon { width: 32px; padding: .3rem 0; border-color: transparent; background: transparent; }
.ai-menu summary.btn.icon:hover { background: var(--surface-2); }
.more .menu-list form { margin: 0; }
.more .menu-list button { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; width: 100%; padding: 8px 10px; border: 0; border-radius: 8px; background: transparent;
  color: var(--text); font: inherit; font-weight: 500; text-align: left; cursor: pointer; }
.more .menu-list button:hover { background: color-mix(in srgb, var(--accent) 8%, transparent); }
.more .menu-list button small { font-weight: 400; font-size: .78rem; }
.btn.go { display: inline-flex; align-items: center; gap: .35rem; }

.ai-board .seg { display: inline-flex; gap: 2px; padding: 3px; border-radius: 10px; background: var(--surface-2); flex-wrap: wrap; }
.seg button { border: 0; background: transparent; padding: .3rem .75rem; border-radius: 8px; font: inherit; font-size: .85rem; color: var(--muted); cursor: pointer; }
.seg button.on { background: var(--surface); color: var(--text); box-shadow: 0 1px 2px rgb(0 0 0 / .08); }
.ai-board[data-show="problem"] .ai-finding:not(.problem), .ai-board[data-show="watch"] .ai-finding:not(.watch), .ai-board[data-show="good"] .ai-finding:not(.good) { display: none; }
.ai-findings { display: grid; gap: .75rem; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
.ai-finding { --fc: var(--warn); display: flex; flex-direction: column; gap: .3rem; padding: .9rem 1rem 1rem; border-radius: var(--radius); background: var(--surface);
  border: 1px solid var(--border); border-left: 4px solid var(--fc); animation: pop-in 260ms var(--ease) backwards; animation-delay: calc(var(--i) * 40ms); }
.ai-finding.good { --fc: var(--ok); } .ai-finding.problem { --fc: var(--bad); }
.ai-finding-top { display: flex; align-items: center; gap: .45rem; }
.ai-ic { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; color: var(--fc); background: color-mix(in srgb, var(--fc) 12%, var(--surface)); }
.ai-finding h3 { margin: .3rem 0 0; font-size: 1rem; line-height: 1.35; }
.ai-metric { display: flex; flex-direction: column; gap: 1px; padding: .5rem .65rem; border-radius: 10px; background: color-mix(in srgb, var(--fc) 8%, var(--surface)); }
.ai-metric b { font-size: 1.45rem; line-height: 1.15; color: var(--fc); }
.ai-detail summary { cursor: pointer; font-size: .85rem; color: var(--accent); list-style: none; }
.ai-detail summary::-webkit-details-marker { display: none; }
.ai-detail summary::before { content: "▸ "; } .ai-detail[open] summary::before { content: "▾ "; }
.ai-detail p { margin: .35rem 0 0; color: var(--text-2, var(--muted)); }
.ai-watch { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; }
.ai-watch li { display: flex; gap: .5rem; align-items: flex-start; }
.ai-watch svg { flex: none; margin-top: 3px; color: var(--accent); }
@media (max-width: 720px) {
  .ai-charts { grid-template-columns: 1fr; }
  .ai-hero { padding: 1rem 1rem .9rem 1.2rem; }
  .ai-hero h2 { font-size: 1.15rem; }
  .ai-actions-grid, .ai-findings { grid-template-columns: 1fr; }
  .ai-board .seg { width: 100%; }
}
@media print { .ai-menu, .btn.go, .page-head .actions { display: none !important; } }
.more .menu-list { background: color-mix(in srgb, var(--bg) 94%, transparent); -webkit-backdrop-filter: blur(20px) saturate(1.6); backdrop-filter: blur(20px) saturate(1.6); }
.ai-action:has(details[open]), .panel:has(.page-head details[open]) { position: relative; z-index: 30; }
@media (max-width: 720px) {
  .ai-charts .hbar { grid-template-columns: minmax(0, 1fr) auto; row-gap: .3rem; }
  .ai-charts .hbar-track { grid-column: 1 / -1; grid-row: 2; }
}

/* AI Analysis: plain lists instead of cards */
.ai-hero { background: var(--surface); border-color: var(--border); }
.ai-hero::before { width: 3px; }
.ai-count { cursor: pointer; text-decoration: none; }
.ai-count:hover { text-decoration: none; }
.ai-list { list-style: none; margin: 0; padding: 0; }
.ai-list > li { border-top: 1px solid var(--border); }
.ai-list > li:first-child { border-top: 0; }
.ai-row { display: grid; grid-template-columns: 1.6rem minmax(0, 1fr) auto; gap: .75rem; align-items: start; padding: .85rem 0; }
.ai-num { color: var(--muted); font-weight: 600; padding-top: 1px; }
.ai-row-title { font-weight: 600; line-height: 1.4; }
.ai-row-sub { display: flex; flex-wrap: wrap; gap: .25rem .75rem; margin-top: .25rem; font-size: .85rem; color: var(--text-2, var(--muted)); }
.ai-when { font-weight: 600; } .ai-when.bad { color: var(--bad); } .ai-when.warn { color: var(--warn); } .ai-when.calm { color: var(--muted); }
.ai-added { color: var(--ok); }
.ai-row-end { display: flex; align-items: center; gap: .25rem; }
.ai-go { display: inline-flex; align-items: center; gap: .3rem; font-size: .88rem; font-weight: 500; white-space: nowrap; }
.ai-group + .ai-group { margin-top: 1.1rem; }
.ai-group-h { font-size: .78rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin: 0 0 .25rem; }
.ai-group-h .muted { margin-left: .25rem; }
.ai-find summary { display: flex; align-items: center; gap: .7rem; padding: .75rem 0; cursor: pointer; list-style: none; }
.ai-find summary::-webkit-details-marker { display: none; }
.ai-find-title { flex: 1; min-width: 0; }
.ai-find-val { font-weight: 600; white-space: nowrap; }
.ai-find-val.bad { color: var(--bad); } .ai-find-val.warn { color: var(--warn); } .ai-find-val.ok { color: var(--ok); }
.ai-chev { flex: none; color: var(--muted); transition: transform var(--dur) var(--ease); }
.ai-find[open] .ai-chev { transform: rotate(90deg); }
.ai-find summary:hover .ai-find-title { color: var(--accent); }
.ai-find-body { padding: 0 0 .9rem 1.2rem; max-width: 70ch; }
.ai-find-body p { margin: 0 0 .5rem; }
.ai-watch li { display: list-item; }
.ai-watch { list-style: disc; padding-left: 1.2rem; display: block; }
.ai-watch li + li { margin-top: .35rem; }
@media (max-width: 720px) {
  .ai-row { grid-template-columns: 1.3rem minmax(0, 1fr); }
  .ai-row-end { grid-column: 2; justify-content: space-between; }
}
@media (max-width: 720px) { .ai-row { row-gap: .2rem; } .ai-row-end { margin-right: -8px; } }


/* Sales team panel (Masterlist) */
.sales-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .75rem; margin-bottom: 1rem; }
.sales-big { padding: .75rem .9rem; border-radius: 12px; background: var(--surface-2); }
.sales-big b { display: block; font-size: 1.6rem; line-height: 1.2; margin: .15rem 0; }
.sales-big.ok b { color: var(--ok); } .sales-big.warn b { color: var(--warn); } .sales-big.bad b { color: var(--bad); }
.sales-stages > li { display: flex; align-items: center; gap: .65rem; padding: .6rem 0; }
.sales-stage { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.sales-stage small { font-size: .78rem; }
.sales-sub { margin-top: 1.2rem; }
.section-h { margin: 1.5rem 0 .75rem; font-size: 1rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
@media (max-width: 720px) { .sales-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ---------- Audience Insights ---------- */
.chip { display: inline-flex; align-items: center; gap: .25rem; font-size: .74rem; font-weight: 600; line-height: 1.2; padding: .22rem .55rem; border-radius: 999px; background: var(--surface-2); color: var(--text-2); margin: 2px 4px 2px 0; }
.chip.ok { background: var(--ok-bg); color: var(--ok); }
.chip.bad { background: var(--bad-bg); color: var(--bad); }
.chip.warn { background: var(--warn-bg); color: var(--warn); }
.ins-tabs { margin: -.25rem 0 1rem; }
.ins-focus .ai-row { grid-template-columns: .9rem minmax(0, 1fr); }
.ins-focus .dot { margin-top: .35rem; }
.ins-use { color: var(--accent); margin-top: .2rem; }
.ins-legend { display: flex; flex-wrap: wrap; gap: .4rem 1rem; align-items: center; margin: -.4rem 0 .8rem; }
.ins-legend span { display: inline-flex; align-items: center; gap: .35rem; }
.ins-key { display: inline-block; width: 18px; height: 8px; border-radius: 4px; background: color-mix(in srgb, var(--text) 22%, transparent); }
.ins-key.top { background: var(--accent); }
.ins-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; margin-bottom: 1.5rem; }
.ins-grid .panel { margin: 0; }
.ins-head { display: flex; align-items: baseline; justify-content: space-between; gap: .5rem; }
.ins-head h3 { margin: 0; }
.ins-sum { margin: .2rem 0 .7rem; }
.ins-bars { display: grid; gap: .45rem; }
.ins-bar { display: grid; grid-template-columns: minmax(0, 42%) minmax(0, 1fr) auto; gap: .6rem; align-items: center; font-size: .86rem; }
.ins-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ins-label .chip { margin: 0 0 0 .3rem; padding: .1rem .4rem; font-size: .68rem; }
.ins-track { height: 14px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.ins-fill { position: relative; height: 100%; width: var(--w); border-radius: 999px; background: color-mix(in srgb, var(--text) 22%, transparent); transform-origin: left; animation: grow-x 700ms var(--ease) calc(var(--i) * 60ms) backwards; overflow: hidden; }
.ins-bar.top .ins-fill { background: var(--accent); }
.ins-closed { position: absolute; inset: 0 auto 0 0; width: var(--c); min-width: 0; background: var(--ok); border-radius: 999px 0 0 999px; }
.ins-bar.top .ins-label { font-weight: 700; }
.ins-num { display: grid; grid-template-columns: 2.6rem 3.6rem 2.6rem; text-align: right; gap: .3rem; font-size: .8rem; }
.ins-rate { font-weight: 700; }
.ins-rate.ok { color: var(--ok); } .ins-rate.bad { color: var(--bad); }
.ins-why { min-width: 260px; }
.ins-team td { font-weight: 700; border-top: 2px solid var(--border); }
.ins-play { margin-top: 1rem; }
.ins-play ul { margin: .3rem 0 .5rem 1.1rem; padding: 0; }
@media (max-width: 960px) { .ins-grid { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 520px) {
  .ins-bar { grid-template-columns: minmax(0, 1fr) auto; }
  .ins-track { grid-column: 1 / -1; grid-row: 2; }
  .ins-num { grid-template-columns: 2.2rem 3.2rem 2.4rem; }
}

/* ---------- Meta Ads ---------- */
.ma-media { position: relative; }
.ma-media .chip { position: absolute; top: 10px; margin: 0; box-shadow: 0 1px 4px rgba(0,0,0,.18); }
.ma-verdict { left: 10px; background: var(--surface); }
.ma-format { right: 10px; background: var(--surface); }
.ma-verdict.ok { background: var(--ok); color: #fff; } .ma-verdict.warn { background: var(--warn); color: #fff; } .ma-verdict.bad { background: var(--bad); color: #fff; }
.ma-camp { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ma-figs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .5rem .75rem; margin: .5rem 0; padding: .6rem 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.ma-figs div { min-width: 0; }
.ma-figs dt { font-size: .7rem; color: var(--text-2); text-transform: uppercase; letter-spacing: .04em; }
.ma-figs dd { margin: 0; font-weight: 700; font-size: .92rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ma-figs dd.ok { color: var(--ok); } .ma-figs dd.warn { color: var(--warn); } .ma-figs dd.bad { color: var(--bad); }
.ma-why { background: var(--surface-2); border-radius: 10px; padding: .5rem .65rem; margin: 0; }
.ma-copy summary { color: var(--accent); }
.ma-body { white-space: pre-wrap; }
.ma-card.v-winner, .ma-card.v-good { box-shadow: inset 0 3px 0 var(--ok), var(--shadow); }
.ma-card.v-weak, .ma-card.v-loser { box-shadow: inset 0 3px 0 var(--bad), var(--shadow); }
.ma-pat ul { margin: .3rem 0 0 1.1rem; padding: 0; }
.ma-pat li { margin: .25rem 0; }
.ai-group-h.ok { color: var(--ok); } .ai-group-h.bad { color: var(--bad); }
.ma-ideas > li { padding: .7rem 0; }
.ma-ideas dl { display: grid; grid-template-columns: 8rem minmax(0, 1fr); gap: .2rem .75rem; margin: .4rem 0 0; font-size: .88rem; }
.ma-ideas dt { color: var(--text-2); }
.ma-ideas dd { margin: 0; }
@media (max-width: 520px) { .ma-ideas dl { grid-template-columns: minmax(0, 1fr); } .ma-ideas dt { margin-top: .3rem; } }

/* ---------- Sign in with Google ---------- */
.google-btn { gap: 10px; background: var(--glass-strong); color: var(--text); border: 1px solid var(--border); }
.google-btn:hover { color: var(--text); border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); background: var(--glass-strong); }
.google-mark { flex: none; display: block; }
.auth-or { display: flex; align-items: center; gap: 12px; margin: 1rem 0; color: var(--text-2); font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; }
.auth-or::before, .auth-or::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.auth .small-note { font-size: .82rem; margin: 1rem 0 0; text-align: center; }
.access-page h1 { margin-top: 0; }
.access-page p { line-height: 1.55; }
.access-page .access-out { margin-top: .75rem; }
.nav-badge { margin-left: auto; min-width: 20px; height: 18px; padding: 0 6px; border-radius: 999px; display: inline-flex; align-items: center; justify-content: center;
  font-size: .7rem; font-weight: 700; line-height: 1; background: var(--warn-bg); color: var(--warn); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--warn) 30%, transparent); }

/* ---------- Privacy and terms ---------- */
.legal { max-width: 46rem; margin: 0 auto; line-height: 1.6; }
.legal h2 { font-size: 1.05rem; margin-top: 1.4rem; }

/* ---------- YPR logo: mark + name as text ---------- */
.logo { display: inline-flex; align-items: center; gap: .55rem; color: var(--text); text-transform: none; letter-spacing: 0; }
.logo img { display: block; flex: none; }
.logo-word { font-family: "Space Grotesk", "Inter", sans-serif; font-weight: 700; font-size: .78rem; line-height: 1.05; letter-spacing: .02em; text-transform: uppercase; color: var(--text); }
.brand .logo-word { font-size: .9rem; }
.auth-logo .logo-word { font-size: 1.05rem; }
.brand-sm .logo-word { font-size: .66rem; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* ---------- Target, Actual, Balance ---------- */
.table.tab th[scope="row"] { font-weight: 600; text-align: left; white-space: nowrap; }
.table.tab .tab-actual { font-weight: 700; font-size: 1rem; }
.table.tab .tab-actual.ok, .tab-bal.ok { color: var(--ok); }
.table.tab .tab-actual.warn { color: var(--warn); }
.table.tab .tab-actual.bad, .tab-bal.bad { color: var(--bad); }
.tab-bal { white-space: nowrap; font-weight: 600; }
.table.tab-compact td, .table.tab-compact th { padding-top: .35rem; padding-bottom: .35rem; font-size: .86rem; }
.table.tab-compact .tab-actual { font-size: .92rem; }
.table.tab-compact { margin: .25rem 0 .5rem; }
tr.tab-group th { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--text-2); border-bottom: 0; padding-bottom: 0; }
tr.tab-group th.c { text-align: center; border-bottom: 2px solid var(--border); }
.table.tab tbody tr:last-child th { border-bottom: 0; }
.table.tab tbody tr:hover th { background: color-mix(in srgb, var(--text) 4%, transparent); }
.phase-row:has(.pr-tab) { grid-template-columns: minmax(0, 1fr) auto; row-gap: .6rem; }
.phase-row:has(.pr-tab) .pr-stage { justify-self: end; }
.pr-tab { grid-column: 1 / -1; display: grid; grid-template-columns: 4.6rem repeat(4, minmax(0, 1fr)); gap: .15rem .75rem; align-items: baseline; padding: .5rem .7rem; border-radius: 10px; background: color-mix(in srgb, var(--text) 3%, transparent); font-variant-numeric: tabular-nums; }
.pr-tab small { color: var(--muted); font-size: .7rem; text-transform: uppercase; letter-spacing: .05em; font-weight: 600; }
.pr-tab i { font-style: normal; font-size: .7rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.pr-tab span, .pr-tab b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: .84rem; }
.pr-tab .pr-t { color: var(--text-2); }
.pr-tab b { font-size: .95rem; color: var(--text); }
.pr-tab b.ok, .pr-tab .pr-b.ok { color: var(--ok); }
.pr-tab b.warn { color: var(--warn); }
.pr-tab b.bad, .pr-tab .pr-b.bad { color: var(--bad); }
.pr-tab .pr-b { font-weight: 600; }
@media (max-width: 760px) { .pr-tab { grid-template-columns: 3.9rem repeat(4, minmax(0, 1fr)); gap: .15rem .4rem; padding: .45rem .5rem; } .pr-tab span, .pr-tab b { font-size: .74rem; white-space: normal; } .pr-tab small, .pr-tab i { font-size: .6rem; } }
.table.tab .tab-actual { white-space: nowrap; }
.tab-today-m { display: none; }
@media (max-width: 760px) {
  .phase-row:has(.pr-tab) { grid-template-columns: minmax(0, 1fr); }
  .phase-row:has(.pr-tab) .pr-stage { justify-self: start; }
  .pr-tab span, .pr-tab b { overflow: visible; text-overflow: clip; overflow-wrap: anywhere; }
  .table.tab th, .table.tab td { padding-left: 6px; padding-right: 6px; font-size: .8rem; }
  .table.tab th[scope="row"] { white-space: normal; }
  .table.tab .tab-actual { font-size: .9rem; }
  .table.tab .tab-today { display: none; }
  .tab-today-m { display: block; font-weight: 400; font-size: .7rem; }
}
@media (max-width: 760px) {
  .scroll table.table.tab { min-width: 0; width: 100%; }
  .table.tab .tab-bal { white-space: normal; }
  .table.tab th, .table.tab td { padding-left: 4px; padding-right: 4px; }
  .pr-tab { grid-template-columns: 3.3rem repeat(4, minmax(0, 1fr)); gap: .15rem .3rem; }
  .pr-tab span, .pr-tab b { overflow-wrap: normal; font-size: .7rem; }
  .pr-tab b { font-size: .76rem; }
}
@media (max-width: 760px) {
  /* On a phone the phase-row grid turns on its side: one line per figure, columns Target, Actual, Balance. */
  .pr-tab { grid-auto-flow: column; grid-template-rows: repeat(5, auto); grid-template-columns: 3.6rem repeat(3, minmax(0, 1fr)); gap: .2rem .35rem; }
  .pr-tab span, .pr-tab b { font-size: .8rem; white-space: nowrap; }
  .pr-tab b { font-size: .86rem; }
  .pr-tab small, .pr-tab i { font-size: .64rem; }
}
.hero-tab { display: block; margin-top: .2rem; font-size: .72rem; color: rgba(255, 255, 255, .78); line-height: 1.35; }
.hero-tab em { font-style: normal; font-weight: 600; color: #fff; }
.hero-tab em.bad { color: #ffb4b4; } .hero-tab em.ok { color: #b9f6ca; }
.live-tabs { margin: .25rem 0 .5rem; }
.live-edit { margin-top: .75rem; }
.live-edit .form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); gap: .6rem 1rem; margin-top: .6rem; align-items: end; }
.live-edit label { display: grid; gap: .25rem; font-size: .82rem; }

/* Speed: pages appear at once. No fade or rise on every navigation; hover and open/close motion stays, and charts draw quickly. */
@view-transition { navigation: none; }
.page, .hero, .hero-stats > *, .cards > *, .panel, .two-col > *, .grid2 > *, .kpis > *, .table tbody tr, .alert, .ai-action, .ai-finding, .ins-fill { animation: none !important; }
.viz.in .series { animation-duration: 400ms; animation-delay: 0ms; }
.viz.in .dot { animation-delay: 300ms; }
.viz.in .bar { animation-duration: 320ms; animation-delay: calc(var(--i, 0) * 10ms); }
.rings.in .ring-fill { animation-duration: 450ms; }
.hbars.in .hbar-fill { animation-duration: 350ms; animation-delay: calc(var(--i) * 25ms); }
/* Speed: blur only on the bars that sit over moving content. Panels and cards were each blurring the page behind them on every scroll frame;
   over the soft background a slightly more solid fill looks the same. */
.card, .panel, .auth, .empty, details.panel, .alert, .howto { -webkit-backdrop-filter: none; backdrop-filter: none; background: var(--glass-strong); }
.cb-thumb { width: 64px; }
.cb-thumb img { width: 56px; height: 56px; object-fit: cover; border-radius: 8px; display: block; }
.ma-glance .ma-next { margin: .25rem 0 1rem; padding-left: 1.1rem; display: grid; gap: .35rem; }
.ma-trio { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; margin-bottom: 1rem; }
@media (max-width: 860px) { .ma-trio { grid-template-columns: 1fr; } }
.ma-mini { display: flex; gap: .6rem; align-items: center; padding: .4rem; border-radius: 10px; color: inherit; text-decoration: none; }
.ma-mini:hover { background: color-mix(in srgb, var(--text) 5%, transparent); text-decoration: none; }
.ma-mini img, .ma-mini-empty { width: 64px; height: 64px; flex: none; border-radius: 8px; object-fit: cover; background: var(--surface-2); display: grid; place-items: center; font-size: .7rem; color: var(--muted); }
.ma-mini-body { display: grid; gap: .1rem; min-width: 0; }
.ma-mini-body b { font-size: .86rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Insights suite */
.ipage-decide { border-left: 3px solid var(--accent, #2563eb); }
.ipage-decide h2 { margin-bottom: .5rem; }
.strategy-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 1rem; }
.strategy-grid > .panel { margin: 0; min-width: 0; }
.strategy-grid h2 a { color: inherit; text-decoration: none; }
@media (max-width: 640px) { .strategy-grid { grid-template-columns: 1fr; } }

/* Loading bar with a percentage while the next page loads */
.loadbar { position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 1000; pointer-events: none; opacity: 0; transition: opacity 200ms ease; }
.loadbar.on { opacity: 1; }
.loadbar.done { transition-delay: 250ms; opacity: 0; }
.loadbar i { position: absolute; inset: 0; background: var(--accent); transform-origin: 0 50%; transform: scaleX(0); transition: transform 150ms linear; box-shadow: 0 0 8px color-mix(in srgb, var(--accent) 60%, transparent); }
.loadbar b { position: absolute; top: 6px; left: 0; transform: translateX(-100%); transition: left 150ms linear; margin-left: -4px; font: 600 11px/1 system-ui, sans-serif; color: #fff; background: var(--accent); padding: 3px 6px; border-radius: 999px; font-variant-numeric: tabular-nums; }

/* BBA monthly targets */
.bba-split { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .75rem; margin: 1rem 0 .25rem; }
.bba-split > div { display: flex; flex-direction: column; gap: 2px; padding: .6rem .75rem; border: 1px solid var(--line); border-radius: 12px; min-width: 0; }
.bba-split b { font-size: 1.1rem; font-variant-numeric: tabular-nums; }
.bba-split b.bad { color: var(--bad); }
@media (max-width: 720px) { .bba-split { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.phase-budget-hint { margin-top: .35rem; }

/* Tabs inside a side-panel entry: related pages switch along the top instead of filling the side panel */
.hub-tabs { display: flex; gap: 2px; padding: 3px; margin: 0 0 1rem; background: var(--surface-2); border-radius: 12px; overflow-x: auto; scrollbar-width: none; max-width: 100%; width: fit-content; }
.hub-tabs::-webkit-scrollbar { display: none; }
.hub-tabs a { flex: none; padding: .4rem .9rem; border-radius: 9px; color: var(--text-2); font-weight: 500; font-size: .9rem; white-space: nowrap; }
.hub-tabs a:hover { color: var(--text); text-decoration: none; }
.hub-tabs a.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
@media (min-width: 721px) { .hub-tabs { flex-wrap: wrap; overflow: visible; } }

/* One Meta ad: the poster or video at full size beside its results and the AI read. */
.ad-detail { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1rem; align-items: start; }
.ad-media img, .ad-media video { display: block; width: 100%; height: auto; max-height: 80vh; object-fit: contain; border-radius: 10px; background: var(--bg); }
.ad-media .ad-copy { margin-top: .75rem; border-top: 1px solid var(--line); padding-top: .5rem; }
.ad-figs small { display: block; font-size: .75rem; }
.ad-parts { display: grid; gap: .5rem; margin: .75rem 0; }
.ad-parts > div { padding: .5rem .75rem; border-radius: 8px; }
.ad-parts dt { font-weight: 600; }
.ad-parts dd { margin: .15rem 0 0; }
.ma-card .card-title a { color: inherit; text-decoration: none; }
@media (max-width: 860px) { .ad-detail { grid-template-columns: 1fr; } }

/* Insights opens as a sub-menu in the side panel while you are on one of its pages */
.page.with-sub { max-width: 1440px; display: grid; grid-template-columns: 190px minmax(0, 1fr); gap: 1.5rem; align-items: start; }
.sub-main { min-width: 0; }
.sub-nav { position: sticky; top: 84px; display: flex; flex-direction: column; gap: 1px; padding: 10px 8px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow); max-height: calc(100dvh - 100px); overflow-y: auto; }
.sub-nav-title { padding: 4px 10px 8px; font-size: .72rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--text-2); }
.sub-nav a { padding: 6px 10px; border-radius: 8px; color: var(--text-2); font-size: .9rem; }
.sub-nav a:hover { color: var(--text); background: var(--surface-2); text-decoration: none; }
.sub-nav a.on { background: color-mix(in srgb, var(--accent) 12%, var(--surface)); color: var(--accent); font-weight: 600; }
@media (max-width: 960px) {
  .page.with-sub { display: block; }
  .sub-nav { position: static; flex-direction: row; overflow-x: auto; max-height: none; margin-bottom: 1rem; padding: 3px; gap: 2px; scrollbar-width: none; background: var(--surface-2); border: 0; box-shadow: none; border-radius: 12px; }
  .sub-nav::-webkit-scrollbar { display: none; }
  .sub-nav-title { display: none; }
  .sub-nav a { flex: none; white-space: nowrap; }
  .sub-nav a.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
}
.ad-media .ad-frame { display: block; width: 100%; max-width: 420px; height: 720px; max-height: 85vh; margin: 0 auto; border: 0; border-radius: 10px; background: #fff; }

/* Follow-up (consultant work list) */
.work-filter { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; margin: 0; }
.work-filter select, .work-filter input { width: auto; max-width: 100%; }
.work-filter input[name=q] { width: 14rem; }
.work-list { display: grid; gap: .75rem; }
.work-card { display: grid; gap: .6rem; }
.work-top { display: flex; justify-content: space-between; gap: .75rem; align-items: flex-start; }
.work-form { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1.4fr) minmax(0, .8fr) minmax(0, 1.6fr) auto; gap: .5rem; align-items: end; margin: 0; }
.work-form label { margin: 0; }
.work-form select, .work-form input { width: 100%; min-width: 0; }
.work-pages { justify-content: center; align-items: center; margin-top: 1rem; }
@media (max-width: 860px) {
  .work-form { grid-template-columns: 1fr 1fr; }
  .work-form .work-note { grid-column: 1 / -1; }
  .work-form .btn { grid-column: 1 / -1; padding: .55rem; }
  .work-filter input[name=q] { width: 100%; }
}
.mt-xs { margin-top: .3rem; }
.live-form { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .5rem .75rem; align-items: end; }
.live-form label { margin: 0; }
.live-form .live-notes { grid-column: span 3; }
@media (max-width: 760px) { .live-form { grid-template-columns: 1fr 1fr; } .live-form .live-notes, .live-form .btn { grid-column: 1 / -1; } }
.work-pay summary { cursor: pointer; font-weight: 600; font-size: .88rem; color: var(--accent); }
.work-pay-form { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)) auto; gap: .5rem; align-items: end; margin: .5rem 0 0; }
.work-pay-form label { margin: 0; }
@media (max-width: 860px) { .work-pay-form { grid-template-columns: 1fr 1fr; } .work-pay-form .btn { grid-column: 1 / -1; } }

/* Call recording (Follow-up) and Call progress */
.call-bar { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.call-bar label.btn { margin: 0; cursor: pointer; }
.call-bar.recording { padding: .4rem .5rem; border-radius: 10px; background: var(--bad-bg); }
.rec-dot { display: inline-block; width: .6rem; height: .6rem; border-radius: 50%; background: var(--bad); margin-right: .25rem; vertical-align: middle; animation: rec-blink 1s infinite; }
@keyframes rec-blink { 50% { opacity: .25; } }
@media (prefers-reduced-motion: reduce) { .rec-dot { animation: none; } }
.call-hint { margin: 0 0 .75rem; }
.call-audio { width: 100%; }
.call-steps { display: grid; gap: .55rem; padding-left: 1.2rem; margin: 0; }
.call-facts { display: grid; gap: .5rem; padding-left: 1rem; margin: 0; }
.call-transcript { white-space: pre-wrap; font: inherit; font-size: .9rem; line-height: 1.55; margin: .75rem 0 0; max-height: 60vh; overflow: auto; }
.row-new td { font-weight: 600; }
.inline-form { display: inline; margin-left: .5rem; }
