/* PC Command Center. Visual language of succession.media, same as the AI Answer Lab:
   Sora display, Inter body, ink #0B1220, brand #2F6BFF, mist #F5F7FB, pill controls,
   soft card shadows. White theme only. */

@font-face { font-family: "Sora"; src: url("sora.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Inter"; src: url("inter.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }

:root {
  color-scheme: light;
  --bg: #FFFFFF;
  --surface: #FFFFFF;
  --surface-2: #F5F7FB;
  --ink: #0B1220;
  --soft: #1B2436;
  --muted: #5B6678;
  --line: #E6EAF1;
  --line-strong: #D5DCE7;
  --blue: #2F6BFF;
  --blue-ink: #1E4FD1;
  --tint: #EAF0FF;
  --tint-2: #C9D8FF;
  --gold: #FFB400;
  --bar: #A9AFBB;
  --good: #16A34A;
  --good-ink: #15803D;
  --good-tint: #F0FDF4;
  --crit: #D03B3B;
  --crit-ink: #B42323;
  --crit-tint: #FEF2F2;
  --warn: #FFF4D6;
  --warn-ink: #6B4A00;
  --band: #EEF1F6;
  --shadow: 0 1px 2px rgba(11, 18, 32, .04), 0 12px 32px -12px rgba(11, 18, 32, .12);
  --shadow-lg: 0 2px 4px rgba(11, 18, 32, .05), 0 28px 60px -20px rgba(11, 18, 32, .18);
  --shadow-cta: 0 10px 24px -6px rgba(47, 107, 255, .5);
  --radius: 24px;
  --radius-sm: 16px;
  --sans: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
  --display: "Sora", "Inter", ui-sans-serif, system-ui, sans-serif;
}

/* White theme only, whatever the viewer's OS setting. */
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: var(--sans); font-size: 15px; line-height: 1.55; color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; min-height: 100vh; display: flex; flex-direction: column; }
[hidden] { display: none !important; }
h1, h2, h3 { font-family: var(--display); margin: 0; color: var(--ink); letter-spacing: -0.02em; line-height: 1.15; }
a { color: var(--blue); text-decoration: none; }
a:hover { color: var(--blue-ink); text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.num, td.n, th.n { font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.field-label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .14em; color: var(--muted); }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .18em; color: var(--blue); margin-bottom: 12px; }

/* Wordmark: Sora 800 caps with the brand-blue underline */
.wordmark { position: relative; display: inline-block; font-family: var(--display); font-weight: 800; text-transform: uppercase; letter-spacing: -0.01em; line-height: 1; font-size: 19px; color: var(--ink); white-space: nowrap; user-select: none; }
.wordmark svg { position: absolute; left: 1.5%; bottom: -0.22em; width: 97%; height: 0.16em; pointer-events: none; }
.wordmark path { stroke: var(--blue); }
.wordmark.small { font-size: 15px; }

/* Buttons */
.btn { position: relative; overflow: hidden; display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 20px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); font-size: 14px; font-weight: 600; cursor: pointer; color: var(--ink); white-space: nowrap; transition: border-color .2s, color .2s, background-color .2s, transform .2s, box-shadow .2s; }
.btn:hover { border-color: var(--blue); color: var(--blue); }
.btn.primary { background: var(--blue); border-color: var(--blue); color: #fff; box-shadow: var(--shadow-cta); }
.btn.primary:hover { background: var(--blue-ink); border-color: var(--blue-ink); color: #fff; transform: translateY(-2px); }
.btn.primary:active { transform: translateY(0); }
.btn.primary::after { content: ""; position: absolute; top: 0; bottom: 0; left: 0; width: 33%; background: rgba(255, 255, 255, .25); transform: translateX(-180%) skewX(-20deg); pointer-events: none; }
.btn.primary:hover::after { animation: btn-shine 1.1s ease; }
@keyframes btn-shine { 0% { transform: translateX(-180%) skewX(-20deg); } 60%, 100% { transform: translateX(320%) skewX(-20deg); } }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }

/* Header */
.top { position: sticky; top: 0; z-index: 20; background: rgba(255, 255, 255, .85); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.top-inner { max-width: 1360px; margin: 0 auto; padding: 0 32px; min-height: 72px; display: flex; align-items: center; gap: 28px; flex-wrap: wrap; }
.brand { display: flex; align-items: baseline; gap: 14px; min-width: 0; }
.brand .product { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .16em; color: var(--muted); white-space: nowrap; }
.nav { display: flex; gap: 28px; margin-left: 12px; min-width: 0; overflow-x: auto; scrollbar-width: none; padding: 4px 0; }
.nav::-webkit-scrollbar { display: none; }
.nav a { position: relative; flex: none; white-space: nowrap; padding: 8px 0; font-family: var(--display); font-weight: 600; font-size: 12.5px; text-transform: uppercase; letter-spacing: .14em; color: var(--soft); text-decoration: none; }
.nav a::after { content: ""; position: absolute; left: 0; right: 0; bottom: -2px; height: 2px; border-radius: 999px; background: var(--blue); transform: scaleX(0); transform-origin: left; transition: transform .3s ease-out; }
.nav a:hover { color: var(--ink); text-decoration: none; }
.nav a:hover::after, .nav a.on::after { transform: scaleX(1); }
.nav a.on { color: var(--blue); }
.who { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.pill { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 14px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); font-size: 12.5px; font-weight: 500; color: var(--muted); white-space: nowrap; }
.pill:empty { display: none; }
.linkbtn { border: 1px solid var(--line); border-radius: 999px; height: 32px; padding: 0 14px; background: var(--surface); color: var(--muted); cursor: pointer; font-size: 13px; font-weight: 500; white-space: nowrap; }
.linkbtn:hover { border-color: var(--blue); color: var(--blue); }

main { flex: 1; width: 100%; max-width: 1360px; margin: 0 auto; padding: 40px 32px 56px; }
#main > h1 { font-size: 36px; font-weight: 700; margin-bottom: 10px; overflow-wrap: anywhere; }
#main > h1::before { content: "Physician's Choice"; display: block; font-family: var(--sans); font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .18em; color: var(--blue); margin-bottom: 12px; }
h2 { font-size: 20px; font-weight: 700; letter-spacing: -0.01em; line-height: 1.25; margin: 36px 0 12px; }
.card h2 { margin-top: 0; }
.sub { color: var(--muted); font-size: 14.5px; line-height: 1.6; margin: 0 0 20px; max-width: 900px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 28px; margin-bottom: 20px; }
.card .sub { margin-bottom: 0; margin-top: 14px; }

/* Alerts */
.banner { border-radius: var(--radius-sm); padding: 16px 20px; margin-bottom: 24px; background: var(--crit-tint); color: var(--crit-ink); font-size: 14px; }
.banner strong { display: block; font-family: var(--display); font-weight: 700; margin-bottom: 4px; }
.banner ul { margin: 4px 0 0; padding-left: 18px; }
.note-strip { border-radius: var(--radius-sm); padding: 14px 18px; margin-bottom: 20px; background: var(--warn); color: var(--warn-ink); font-size: 14px; line-height: 1.55; }

/* Filters: one row above the content they scope */
.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 28px; }
.seg { display: inline-flex; flex-wrap: wrap; gap: 8px; }
.seg button { height: 36px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); font-size: 13.5px; font-weight: 600; color: var(--soft); cursor: pointer; white-space: nowrap; transition: border-color .2s, color .2s, background-color .2s; }
.seg button:hover { border-color: var(--blue); color: var(--blue); }
.seg button.on { color: var(--blue-ink); border-color: var(--blue); background: var(--tint); }
select, input[type="text"], input[type="search"], input[type="date"], input[type="password"] {
  height: 36px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface-2); padding: 0 16px; font-size: 13.5px; font-weight: 500; color: var(--soft); max-width: 100%;
}
select { background: var(--surface); padding-right: 12px; }
input[type="search"] { min-width: 200px; }
select:focus, input:focus, textarea:focus { border-color: var(--blue); outline: none; box-shadow: 0 0 0 4px var(--tint); }
textarea { border-radius: var(--radius-sm); border: 1px solid var(--line); background: var(--surface-2); padding: 10px 16px; font-size: 14px; line-height: 1.5; resize: vertical; }
.asof { margin-left: auto; display: inline-flex; align-items: center; height: 32px; padding: 0 14px; border-radius: 999px; background: var(--surface-2); color: var(--muted); font-size: 12.5px; font-weight: 500; white-space: nowrap; }

/* KPI tiles */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 20px; }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px 22px 20px; min-width: 0; }
.tile .k { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .14em; color: var(--muted); line-height: 1.45; min-height: 32px; }
.tile .v { font-family: var(--display); font-weight: 800; font-size: 36px; line-height: 1; letter-spacing: -0.03em; color: var(--blue); margin: 12px 0 14px; overflow-wrap: anywhere; }
.tile .d { font-size: 13px; color: var(--muted); margin-top: 6px; display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.tile .d > b:not([class]) { color: var(--ink); font-weight: 700; font-variant-numeric: tabular-nums; }
.tile .d b.up-good, .tile .d b.up-bad, .tile .d b.flat, .tile .d span.flat { font-size: 12px; font-weight: 700; display: inline-flex; align-items: center; border-radius: 999px; padding: 3px 10px; font-variant-numeric: tabular-nums; }
.up-good { color: var(--good-ink); background: var(--good-tint); }
.up-bad { color: var(--crit-ink); background: var(--crit-tint); }
.flat { color: var(--muted); background: var(--surface-2); }
.range { position: relative; height: 18px; margin-top: 16px; }
.range .track { position: absolute; left: 0; right: 0; top: 8px; height: 1px; background: var(--line); }
.range .span { position: absolute; top: 7px; height: 3px; background: var(--line-strong); border-radius: 2px; }
.range .avg { position: absolute; top: 3px; width: 2px; height: 12px; margin-left: -1px; background: var(--bar); border-radius: 1px; }
.range .dot { position: absolute; top: 3px; width: 12px; height: 12px; margin-left: -6px; border-radius: 50%; background: var(--blue); box-shadow: 0 0 0 2px var(--surface); }
.range-cap { display: flex; justify-content: space-between; gap: 6px; color: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; margin-top: 2px; }
.tile .foot { color: var(--muted); font-size: 12.5px; line-height: 1.5; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }

/* Charts */
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(380px, 100%), 1fr)); gap: 20px; }
.grid2 > *, .charts > *, .tiles > * { min-width: 0; }
.charts { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr)); gap: 20px; }
.chart-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px 20px 12px; position: relative; min-width: 0; }
.chart-card h3 { font-size: 11px; font-family: var(--sans); font-weight: 600; text-transform: uppercase; letter-spacing: .14em; color: var(--muted); margin-bottom: 10px; }
.chart-card .cap { color: var(--muted); font-size: 12px; margin-bottom: 4px; }
.key { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 13px; color: var(--soft); margin: 0 0 14px; }
.key span { display: inline-flex; align-items: center; }
.key i { display: inline-block; margin-right: 8px; flex: none; }
.key .k-line { width: 18px; height: 3px; border-radius: 2px; background: var(--blue); }
.key .k-avg { width: 18px; height: 0; border-top: 2px dashed var(--bar); }
.key .k-band { width: 14px; height: 10px; background: var(--band); border-radius: 3px; }
.key .k-mark { width: 2px; height: 14px; background: var(--gold); }
svg.chart { display: block; width: 100%; height: auto; overflow: visible; }
svg.chart text { fill: var(--muted); font-size: 10.5px; font-family: var(--sans); font-variant-numeric: tabular-nums; }
svg.chart .gridline { stroke: var(--line); stroke-width: 1; }
svg.chart .baseline { stroke: var(--line-strong); stroke-width: 1; }
svg.chart .band { fill: var(--band); }
svg.chart .avgline { stroke: var(--bar); stroke-width: 1.5; stroke-dasharray: 4 3; fill: none; }
svg.chart .line { stroke: var(--blue); stroke-width: 2; fill: none; stroke-linejoin: round; stroke-linecap: round; }
svg.chart .bar { fill: var(--blue); }
svg.chart .bar.partial { fill: var(--tint-2); }
svg.chart .pt { fill: var(--blue); stroke: var(--surface); stroke-width: 2; }
svg.chart .marker { stroke: var(--gold); stroke-width: 2; }
svg.chart .cross { stroke: var(--muted); stroke-width: 1; }
.tip { position: absolute; pointer-events: none; background: #0B1220; color: #fff; border: 1px solid rgba(255, 255, 255, .1); box-shadow: 0 12px 32px -8px rgba(11, 18, 32, .45); border-radius: 14px; padding: 10px 12px; font-size: 12.5px; line-height: 1.5; z-index: 5; min-width: 170px; max-width: 320px; }
.tip .t { opacity: .7; font-size: 11.5px; margin-bottom: 4px; }
.tip .r { display: flex; gap: 12px; align-items: baseline; justify-content: space-between; }
.tip .r span:first-child { opacity: .8; }
.tip .r b { font-weight: 700; font-variant-numeric: tabular-nums; text-align: right; }

/* Tables */
.tablewrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); box-shadow: var(--shadow); }
table { border-collapse: collapse; width: 100%; font-size: 13.5px; }
th, td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { position: sticky; top: 0; background: var(--surface); font-size: 11px; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); font-weight: 600; white-space: nowrap; cursor: pointer; user-select: none; }
th:hover { color: var(--ink); }
th.nosort { cursor: default; }
th.nosort:hover { color: var(--muted); }
th .arrow { color: var(--blue); }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: var(--surface-2); }
tr.total td { font-weight: 700; background: var(--surface-2); color: var(--ink); }
td.name { min-width: 220px; max-width: 440px; }
td.name.wide { min-width: 320px; }
td.name .p { font-weight: 600; color: var(--ink); word-break: break-all; }
td.name a.p { color: var(--blue); }
td.name .t { color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.badge { display: inline-flex; align-items: center; height: 24px; padding: 0 10px; border-radius: 999px; font-size: 11.5px; font-weight: 600; background: var(--surface-2); border: 1px solid var(--line); color: var(--soft); margin: 6px 6px 0 0; white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis; vertical-align: middle; }
.badge.flag { height: auto; min-height: 24px; padding: 3px 10px; background: var(--warn); border-color: transparent; color: var(--warn-ink); white-space: normal; line-height: 1.4; }
.badge.ok { background: var(--good-tint); border-color: transparent; color: var(--good-ink); margin-top: 0; }
.badge.off { color: var(--muted); margin-top: 0; }
.pin { background: none; border: 0; cursor: pointer; color: var(--line-strong); font-size: 17px; line-height: 1; padding: 0 2px; }
.pin:hover { color: var(--gold); }
.pin.on { color: var(--gold); }
#main > h1 .pin { font-size: 26px; vertical-align: 4px; }
.caret { display: inline-grid; place-items: center; background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px; cursor: pointer; color: var(--blue); width: 24px; height: 24px; padding: 0; margin-right: 8px; font-size: 13px; line-height: 1; vertical-align: -6px; }
.caret:hover { border-color: var(--blue); color: var(--blue); }
tr.l1 td { background: #FAFBFD; }
tr.l1 td.name { padding-left: 34px; }
tr.l2 td { background: #FCFDFE; }
tr.l2 td.name { padding-left: 64px; font-size: 13px; }
tr.l0 td.name .p { font-family: var(--display); font-weight: 700; font-size: 13.5px; }
.na { color: var(--bar); }

/* Changes */
.day { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .14em; color: var(--blue); padding: 18px 20px 6px; }
.ev { display: grid; grid-template-columns: 84px 1fr; gap: 14px; padding: 12px 20px; border-bottom: 1px solid var(--line); }
.ev:last-child { border-bottom: 0; }
.ev .time { color: var(--muted); font-variant-numeric: tabular-nums; font-size: 13px; }
.ev .what { font-size: 14px; color: var(--soft); }
.ev .what b { font-weight: 700; color: var(--ink); }
.ev .detail { color: var(--muted); font-size: 13px; word-break: break-all; margin-top: 2px; }
.noteform { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-start; margin: 14px 0 18px; }
.noteform textarea { flex: 1 1 320px; min-height: 44px; }

/* Health */
.check { display: grid; grid-template-columns: 70px 1fr; gap: 14px; align-items: start; padding: 14px 20px; border-bottom: 1px solid var(--line); }
.check:last-child { border-bottom: 0; }
.check b { font-weight: 600; color: var(--ink); }
.check .detail { color: var(--muted); font-size: 13px; margin-top: 2px; word-break: break-word; }
.st { justify-self: start; font-size: 11px; font-weight: 700; letter-spacing: .08em; border-radius: 999px; padding: 3px 10px; }
.st.OK { color: var(--good-ink); background: var(--good-tint); }
.st.WARN { color: var(--warn-ink); background: var(--warn); }
.st.FAIL { color: var(--crit-ink); background: var(--crit-tint); }
.defs dt { font-family: var(--display); font-weight: 700; font-size: 15px; margin-top: 18px; }
.defs dt:first-child { margin-top: 0; }
.defs dd { margin: 4px 0 0; color: var(--soft); font-size: 14px; line-height: 1.6; }

.loading { opacity: .55; transition: opacity .15s; }
.empty { color: var(--muted); padding: 32px 16px; text-align: center; }
details { margin: 4px 0 16px; }
details summary { cursor: pointer; color: var(--blue); font-weight: 600; font-size: 14px; }
details .sub { margin-top: 8px; }

/* Footer */
.foot { border-top: 1px solid var(--line); background: var(--surface); }
.foot-inner { max-width: 1360px; margin: 0 auto; padding: 24px 32px; display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; font-size: 13px; color: var(--muted); }

/* Login */
.login { min-height: 100vh; width: 100%; display: grid; place-items: center; padding: 16px; background: radial-gradient(900px 520px at 20% 0%, rgba(47, 107, 255, .12), transparent 60%), var(--bg); }
.login-card { width: 100%; max-width: 440px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 40px; box-shadow: var(--shadow-lg); }
.login-card .brandline { margin-bottom: 36px; }
.login-card .wordmark { font-size: 24px; }
.login-card h1 { font-size: 30px; font-weight: 700; margin-bottom: 10px; }
.login-card p { color: var(--muted); margin: 0 0 24px; }
.login-card input { display: block; width: 100%; height: 50px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface-2); padding: 0 20px; margin: 8px 0 14px; font-size: 15px; }
.login-card .btn { width: 100%; height: 50px; font-size: 15px; margin-top: 4px; }
.form-error { color: var(--crit-ink); font-size: 14px; margin: 12px 0 0 !important; min-height: 21px; }

@media (max-width: 760px) {
  .top-inner { padding: 12px 16px; gap: 12px 20px; }
  .nav { order: 3; width: 100%; margin-left: 0; gap: 22px; }
  main { padding: 28px 16px 40px; }
  #main > h1 { font-size: 28px; }
  .tile .v { font-size: 30px; }
  .asof { margin-left: 0; }
  .grid2 { grid-template-columns: minmax(0, 1fr); }
  td.name, td.name.wide { min-width: 180px; }
  .login-card { padding: 28px 22px; }
  .foot-inner { padding: 20px 16px; }
}
.card .tablewrap { box-shadow: none; }
.card h3.minihead { font-size: 11px; font-family: var(--sans); font-weight: 600; text-transform: uppercase; letter-spacing: .14em; color: var(--blue); margin: 28px 0 0; }
svg.chart .rollline { stroke: var(--ink); stroke-width: 1.75; stroke-dasharray: 5 4; fill: none; stroke-linejoin: round; }
.key .k-roll { width: 18px; height: 0; border-top: 2px dashed var(--ink); }

/* ---------- Motion ----------
   Entrances run once when a view opens (#main.anim), then the class is removed so
   sorting, refreshes and hovers never replay them. Reduced-motion users get none. */
:root { --ease-out: cubic-bezier(.16, 1, .3, 1); --ease-io: cubic-bezier(.65, 0, .35, 1); }
@keyframes rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes grow { from { transform: scaleY(0); } to { transform: scaleY(1); } }
@keyframes wipe { from { clip-path: inset(-10% 100% -10% 0); } to { clip-path: inset(-10% -2% -10% 0); } }
@keyframes draw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@keyframes pop { 0% { opacity: 0; transform: scale(.6); } 70% { transform: scale(1.06); } 100% { opacity: 1; transform: scale(1); } }
@keyframes dotIn { from { opacity: 0; transform: scale(0); } to { opacity: 1; transform: scale(1); } }
@keyframes spanIn { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes rowIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes tipIn { from { opacity: 0; transform: translateY(4px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(22, 163, 74, .45); } 70% { box-shadow: 0 0 0 8px rgba(22, 163, 74, 0); } 100% { box-shadow: 0 0 0 0 rgba(22, 163, 74, 0); } }
@keyframes busybar { 0% { transform: translateX(-100%); } 100% { transform: translateX(260%); } }
@keyframes shimmer { to { background-position: -200% 0; } }

/* Wordmark underline draws itself on load, like a pen stroke. */
.wordmark path { stroke-dasharray: 1; animation: draw 1.1s .15s var(--ease-io) both; }

/* Thin load bar under the header while anything is fetching. */
body::after { content: ""; position: fixed; top: 0; left: 0; width: 40%; height: 2px; background: linear-gradient(90deg, transparent, var(--blue), transparent); z-index: 60; opacity: 0; transform: translateX(-100%); pointer-events: none; transition: opacity .3s; }
body.busy::after { opacity: 1; animation: busybar 1.1s var(--ease-io) infinite; }

/* Page entrance: blocks rise in a stagger (--i is set per block). */
.anim > *, .anim .tiles > .tile, .anim .charts > .chart-card, .anim .grid2 > * { animation: rise .7s var(--ease-out) both; animation-delay: calc(var(--i, 0) * 45ms); }
.anim .tiles, .anim .charts, .anim .grid2 { animation: none; }
.anim tbody tr { animation: rowIn .45s var(--ease-out) both; animation-delay: calc(var(--i, 0) * 45ms + 120ms + var(--r, 30) * 18ms); }
.anim .tile .d b, .anim .tile .d span.flat { animation: pop .5s var(--ease-out) both; animation-delay: calc(var(--i, 0) * 45ms + 650ms); }
.anim .range .span { transform-origin: left center; animation: spanIn .8s var(--ease-out) both; animation-delay: calc(var(--i, 0) * 45ms + 350ms); }
.anim .range .dot { animation: dotIn .5s var(--ease-out) both; animation-delay: calc(var(--i, 0) * 45ms + 900ms); }
.anim .range .avg { animation: fade .5s both; animation-delay: calc(var(--i, 0) * 45ms + 600ms); }

/* Charts: bars grow from the baseline in a short wave, lines wipe left to right. */
.anim svg.chart .bars path { transform-box: fill-box; transform-origin: 50% 100%; animation: grow .75s var(--ease-out) both; animation-delay: calc(var(--i, 0) * 45ms + 200ms + var(--b, 0) * 450ms); }
.anim svg.chart .wipe { animation: wipe 1.2s var(--ease-io) both; animation-delay: calc(var(--i, 0) * 45ms + 250ms); }
.anim svg.chart .marker { animation: fade .6s both; animation-delay: calc(var(--i, 0) * 45ms + 1200ms); }

/* Rows that appear when a campaign or ad set is opened. */
tr.appear { animation: rowIn .4s var(--ease-out) both; animation-delay: calc(var(--r, 0) * 22ms); }

/* Live: the as-of pill breathes on today's view. */
.asof.live::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--good); margin-right: 9px; flex: none; animation: pulse 2s ease-out infinite; }

/* Hover depth, same feel as the succession.media cards. */
.tile, .chart-card, .card { transition: transform .35s var(--ease-out), box-shadow .35s var(--ease-out), border-color .35s; }
.tile:hover, .chart-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: var(--line-strong); }
.tile .v { transition: color .3s; }
.tip:not([hidden]) { animation: tipIn .16s var(--ease-out); }
tbody tr td { transition: background-color .2s; }
.seg button, .btn, .linkbtn, select, input { transition: border-color .2s, color .2s, background-color .2s, box-shadow .2s, transform .2s; }
.seg button:active, .btn:active { transform: scale(.97); }
#main { transition: opacity .25s; }
.loading { opacity: .5; }

/* First paint skeleton. */
.skel .sk { border-radius: 999px; background: linear-gradient(90deg, var(--line) 0%, var(--surface-2) 50%, var(--line) 100%); background-size: 200% 100%; animation: shimmer 1.4s infinite; }
.skel .sk-title { width: 260px; height: 34px; margin: 28px 0 14px; border-radius: 12px; }
.skel .sk-line { width: 60%; height: 12px; margin: 10px 0 24px; }
.skel .sk-k { width: 55%; height: 10px; }
.skel .sk-v { width: 70%; height: 30px; margin: 16px 0 6px; border-radius: 10px; }
.skel .tile .sk-line { width: 80%; margin: 14px 0 0; }
.skel .tile:hover { transform: none; box-shadow: var(--shadow); }

/* Login card rises in. */
.login-card { animation: rise .8s var(--ease-out) both; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .wordmark path { stroke-dasharray: none; }
}
.badge.bad { background: var(--crit-tint); border-color: transparent; color: var(--crit-ink); margin-top: 0; }
td .badge { margin-top: 0; }
