/* ==========================================================================
   DesignTrack — interface
   Nation Studio look (13 Nov 2026), shared with the poster generator: navy
   rail, white cards on hairlines, Inter, one confident blue. The skin layer
   at the end of this file restyles the shell on top of these tokens.
   ========================================================================== */

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("../fonts/inter-var-latin.woff2") format("woff2");
}

:root {
  /* Nation Studio (13 Nov 2026): the poster generator's palette — a navy rail,
     quiet white surfaces with hairlines, and one confident blue. */
  /* surfaces */
  --bg: #F6F7F9;             /* app canvas */
  --card: #FFFFFF;           /* cards */
  --card-2: #F7F8FB;         /* hover row / inset */
  --card-3: #EFF1F6;         /* stronger inset */
  --field: #FFFFFF;
  --bar: #E6E9EF;            /* inactive bars & tracks */

  /* hairlines */
  --line: #EEF0F4;
  --line-2: #E5E8ED;
  --line-3: #D3D9E2;

  /* text */
  --text: #172338;
  --text-2: #49556A;
  --text-3: #7B8391;

  /* brand / interaction */
  --primary: #3156DB;        /* NMG interface blue */
  --primary-hover: #2547C2;
  --primary-press: #1F3BA8;
  --primary-soft: #EEF2FD;
  --deep: #142034;           /* navy: the rail and dark feature surfaces */
  --navy-900: #1D2C43;
  --navy-800: #2A3B56;
  --navy-700: #344052;
  --sky-ink: #B2C4FF;
  --tooltip: #142034;
  --focus: #3156DB;

  /* status chips */
  --good: #2F7A55;
  --good-bg: #E9F3EC;
  --bad: #C0392B;
  --bad-bg: #FBEDEB;
  --warn: #8A6A1F;
  --warn-bg: #F7F0DF;

  /* icon accents (channel colours from the generator) */
  --orange: #EC6631;
  --green: #4F8A63;
  --sky: #267DCC;
  --rose: #DF6197;
  --gold: #F7A427;

  --shadow: 0 1px 2px rgba(20, 32, 52, .04), 0 0 0 1px rgba(20, 32, 52, .045);
  --shadow-hover: 0 8px 24px rgba(21, 41, 85, .08), 0 0 0 1px rgba(20, 32, 52, .06);
  --shadow-lg: 0 24px 60px rgba(16, 27, 59, .18), 0 2px 6px rgba(16, 27, 59, .06);

  --r-sm: 6px;
  --r: 8px;
  --r-lg: 12px;
  --ease: cubic-bezier(.2, .7, .2, 1);
  --t: 150ms;
  --sidebar-w: 248px;
  --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font: 400 14px/1.55 var(--font);
  font-feature-settings: "cv05", "cv08", "ss03";
  letter-spacing: -.003em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}
img, svg { display: block; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; letter-spacing: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
h1, h2, h3, p { margin: 0; }
[hidden] { display: none !important; }
::selection { background: var(--primary); color: #fff; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--text-2); }
.dim { color: var(--text-3); }
.nowrap { white-space: nowrap; }
.ico { flex: none; }
.skip-link { position: absolute; left: 12px; top: -60px; z-index: 100; background: var(--primary); color: #fff; padding: 8px 14px; border-radius: var(--r); font-weight: 500; }
.skip-link:focus { top: 12px; }

* { scrollbar-width: thin; scrollbar-color: #C9D2DF transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #CDD5E1; border-radius: 10px; border: 3px solid var(--bg); }

/* ------------------------------------------------------------------ Buttons */
.btn {
  --h: 38px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: var(--h); padding: 0 16px; border-radius: var(--r);
  font-weight: 500; font-size: 13.5px; white-space: nowrap;
  border: 1px solid transparent; position: relative;
  transition: background-color var(--t) var(--ease), border-color var(--t) var(--ease), color var(--t) var(--ease);
  user-select: none;
}
.btn-sm { --h: 32px; padding: 0 12px; font-size: 13px; gap: 6px; }
.btn-lg { --h: 44px; font-size: 14px; }
.btn-block { width: 100%; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); }
.btn-primary:active { background: var(--primary-press); }
.btn-ghost { background: var(--card); border-color: var(--line-2); color: var(--text); }
.btn-ghost:hover { background: #FFFFFF; border-color: var(--line-3); }
.btn-outline-accent { background: transparent; border-color: var(--line-3); color: var(--text); }
.btn-outline-accent:hover { background: #FFFFFF; border-color: #C3CCDA; }
.btn-danger { background: var(--bad-bg); color: var(--bad); border-color: transparent; }
.btn-danger:hover { background: #FBD7DD; }
.btn .spinner { display: none; }
.btn.is-loading { pointer-events: none; }
.btn.is-loading .btn-label { opacity: 0; }
.btn.is-loading .spinner { display: block; position: absolute; }
.btn[disabled] { opacity: .5; pointer-events: none; }
.link-accent { color: var(--primary); font-weight: 500; font-size: 13px; }
.link-accent:hover { text-decoration: underline; text-underline-offset: 3px; }

.icon-btn {
  display: inline-grid; place-items: center; width: 36px; height: 36px; flex: none;
  border-radius: var(--r); border: 1px solid var(--line-2); background: var(--card); color: var(--text-2);
  transition: color var(--t) var(--ease), border-color var(--t) var(--ease), background var(--t) var(--ease);
}
.icon-btn:hover { color: var(--text); border-color: var(--line-3); background: #FFFFFF; }
.icon-btn-sm { width: 30px; height: 30px; border-radius: 8px; }
.icon-btn-accent { color: #fff; border-color: var(--primary); background: var(--primary); }
.icon-btn-accent:hover { color: #fff; background: var(--primary-hover); border-color: var(--primary-hover); }
.icon-btn.is-disabled { opacity: .35; pointer-events: none; }

.spinner { width: 15px; height: 15px; border-radius: 50%; border: 1.5px solid currentColor; border-right-color: transparent; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ------------------------------------------------------------------ Forms */
.form { display: grid; gap: 16px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-actions { display: flex; justify-content: flex-end; gap: 8px; }
.field { display: grid; gap: 7px; align-content: start; }
.field-label { font-size: 12.5px; font-weight: 500; color: var(--text-2); }
.field-hint { font-size: 12px; color: var(--text-3); }
.input-wrap { position: relative; display: block; }
.input {
  width: 100%; height: 42px; padding: 0 13px; border-radius: var(--r);
  background: var(--field); border: 1px solid var(--line-2); color: var(--text);
  transition: border-color var(--t) var(--ease), box-shadow var(--t) var(--ease);
  font-size: 14px; outline: none;
}
.input::placeholder { color: var(--text-3); }
.input:hover { border-color: var(--line-3); }
.input:focus { border-color: #6C91FF; box-shadow: 0 0 0 4px rgba(49, 86, 219, .16); }
.input.has-ico { padding-left: 40px; }
.input.has-action { padding-right: 44px; }
.input-sm { height: 34px; font-size: 13px; padding: 0 11px; }
.input-ico { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--text-3); pointer-events: none; }
.input-action { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 30px; height: 30px; display: grid; place-items: center; border-radius: 8px; color: var(--text-3); transition: color var(--t); }
.input-action:hover { color: var(--text); }
select.input {
  appearance: none; -webkit-appearance: none; padding-right: 34px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%2374787B' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m4.5 6.5 3.5 3.5 3.5-3.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center;
}
.input.is-invalid { border-color: var(--bad); }

.check { display: inline-flex; align-items: center; gap: 9px; font-size: 13px; color: var(--text-2); cursor: pointer; user-select: none; }
.check input {
  appearance: none; -webkit-appearance: none; width: 17px; height: 17px; margin: 0; flex: none;
  border-radius: 5px; border: 1px solid var(--line-3); background: #fff; display: grid; place-items: center;
  transition: background var(--t), border-color var(--t); cursor: pointer;
}
.check input::after { content: ""; width: 8px; height: 4.5px; border: 1.7px solid #fff; border-top: 0; border-right: 0; transform: rotate(-45deg) translate(.5px, -1px); opacity: 0; transition: opacity var(--t); }
.check input:checked { background: var(--primary); border-color: var(--primary); }
.check input:checked::after { opacity: 1; }

.strength { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; height: 4px; }
.strength i { border-radius: 2px; background: var(--bar); transition: background var(--t); }
.strength[data-score="1"] i:nth-child(-n+1) { background: var(--bad); }
.strength[data-score="2"] i:nth-child(-n+2) { background: #E89A1C; }
.strength[data-score="3"] i:nth-child(-n+3) { background: var(--primary); }
.strength[data-score="4"] i { background: var(--green); }

.form-error, .notice {
  display: flex; gap: 9px; align-items: flex-start; padding: 10px 12px; border-radius: var(--r);
  background: var(--bad-bg); color: var(--bad); font-size: 13px;
}
.notice { background: var(--primary-soft); color: var(--primary); margin-bottom: 16px; }

/* ------------------------------------------------------------------ Auth */
.auth-body { display: grid; min-height: 100vh; }
.auth-wrap { display: grid; place-items: center; align-content: center; gap: 20px; padding: 48px 16px; min-height: 100vh; }
.auth-card {
  width: 100%; max-width: 390px; padding: 34px 30px 30px; border-radius: 18px;
  background: var(--card); box-shadow: var(--shadow);
  animation: fade .4s var(--ease) both;
}
.auth-logo { display: grid; place-items: center; margin-bottom: 20px; }
.auth-card h1 { text-align: center; font-size: 21px; font-weight: 600; letter-spacing: -.02em; }
.auth-sub { text-align: center; color: var(--text-2); margin: 6px 0 24px; font-size: 13.5px; }
.auth-divider { display: flex; align-items: center; gap: 12px; margin: 16px 0; color: var(--text-3); font-size: 12px; }
.auth-divider::before, .auth-divider::after { content: ""; height: 1px; flex: 1; background: var(--line-2); }
.auth-switch { text-align: center; margin-top: 18px; font-size: 13px; color: var(--text-2); }
.auth-switch a { color: var(--primary); font-weight: 500; }
.auth-switch a:hover { text-decoration: underline; text-underline-offset: 3px; }
.auth-forgot { display: block; width: max-content; margin: -6px 0 14px auto; font-size: 13px; font-weight: 500; color: var(--primary); }
.auth-forgot:hover { text-decoration: underline; text-underline-offset: 3px; }
.auth-foot { display: flex; align-items: center; justify-content: center; gap: 7px; color: var(--text-3); font-size: 12px; text-align: center; max-width: 390px; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } }

/* ------------------------------------------------------------------ App shell */
.app { display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); min-height: 100vh; }

.sidebar {
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column;
  padding: 24px 16px 16px; background: var(--bg); z-index: 40; overflow-y: auto;
}
.sidebar-head { display: flex; align-items: center; justify-content: space-between; padding: 0 6px 30px; }
.brand { display: flex; align-items: center; gap: 11px; }
.brand-text { display: grid; line-height: 1.2; }
.brand-text strong { font-size: 16px; font-weight: 600; letter-spacing: -.02em; color: var(--text); }
.brand-text small { font-size: 11.5px; color: var(--text-3); }
.sidebar-close { display: none; }

.nav { display: grid; gap: 4px; }
.nav-label { font-size: 11px; font-weight: 500; letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); padding: 18px 12px 6px; }
.nav-label:first-child { padding-top: 0; }
.nav-item {
  display: flex; align-items: center; gap: 12px; height: 40px; padding: 0 14px; border-radius: var(--r);
  color: var(--text-2); font-weight: 500; font-size: 13.5px;
  transition: background var(--t) var(--ease), color var(--t) var(--ease);
}
.nav-item:hover { background: #E2E9F5; color: var(--text); }
.nav-item .nav-ico { color: #8A909B; transition: color var(--t); }
.nav-item:hover .nav-ico { color: var(--text-2); }
.nav-item.is-active { background: var(--primary); color: #fff; }
.nav-item.is-active .nav-ico { color: #fff; }
.nav-text { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.sidebar-note { margin-top: auto; display: flex; gap: 9px; padding: 14px 10px; color: var(--text-3); font-size: 12px; line-height: 1.5; }
.sidebar-note .ico { margin-top: 2px; color: var(--text-3); }

.sidebar-user { display: flex; align-items: center; gap: 10px; padding: 12px 10px; border-radius: var(--r-lg); background: var(--card); box-shadow: var(--shadow); }
.avatar {
  width: 34px; height: 34px; flex: none; border-radius: 50%; display: grid; place-items: center;
  background: var(--primary-soft); font-weight: 600; font-size: 12px; color: var(--primary);
}
.avatar-lg { width: 50px; height: 50px; font-size: 18px; }
.sidebar-user-text { display: grid; min-width: 0; flex: 1; line-height: 1.3; }
.sidebar-user-text strong { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user-text small { font-size: 11.5px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.logout-form .icon-btn { width: 30px; height: 30px; border-color: transparent; background: transparent; }
.logout-form .icon-btn:hover { color: var(--bad); background: var(--bad-bg); }

.scrim { display: none; }
.main { min-width: 0; }
.mobile-bar { display: none; }
.page { width: 100%; max-width: 1320px; margin: 0 auto; padding: 32px 40px 64px 16px; animation: fade .3s var(--ease) both; }

/* ------------------------------------------------------------------ Page header */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; flex-wrap: wrap; margin-bottom: 24px; }
.page-title h1, .week-label h1 { font-size: 26px; font-weight: 600; letter-spacing: -.025em; line-height: 1.2; }
.eyebrow { font-size: 12.5px; font-weight: 500; color: var(--text-3); margin-bottom: 6px; }
.sub { color: var(--text-2); margin-top: 6px; font-size: 14px; max-width: 640px; }
.page-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.segmented { display: inline-flex; padding: 4px; gap: 2px; border-radius: var(--r); background: var(--card); box-shadow: var(--shadow); position: relative; }
.segmented button { white-space: nowrap; position: relative; z-index: 1; height: 30px; padding: 0 14px; border-radius: 7px; font-size: 13px; font-weight: 500; color: var(--text-2); transition: color var(--t); }
.segmented button:hover { color: var(--text); }
.segmented button.is-active { color: #fff; }
.segmented .seg-thumb { position: absolute; z-index: 0; top: 4px; bottom: 4px; border-radius: 7px; background: var(--primary); transition: left .22s var(--ease), width .22s var(--ease); }

/* ------------------------------------------------------------------ Cards & KPIs */
.card { position: relative; background: var(--card); border-radius: var(--r-lg); padding: 24px; box-shadow: var(--shadow); }
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.card-head h2 { font-size: 15px; font-weight: 600; letter-spacing: -.01em; }
.card h3 { font-size: 14px; font-weight: 600; margin-bottom: 12px; }
.card-sub { color: var(--text-2); font-size: 12.5px; margin-top: 3px; }

/* KPI row — one card with dividers, like the reference */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; margin-bottom: 16px; background: var(--card); border-radius: var(--r-lg); box-shadow: var(--shadow); padding: 6px 0; }
.kpi { padding: 16px 24px; position: relative; }
.kpi + .kpi::before { content: ""; position: absolute; left: 0; top: 18px; bottom: 18px; width: 1px; background: var(--line-2); }
.kpi-top { display: flex; flex-direction: row-reverse; align-items: center; justify-content: flex-end; gap: 10px; }
.kpi-label { font-size: 13px; font-weight: 500; color: var(--text-2); }
.kpi-ico { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; color: #fff; background: var(--orange); }
.kpi-ico .ico { width: 14px; height: 14px; }
.kpi:nth-child(2) .kpi-ico { background: var(--green); }
.kpi:nth-child(3) .kpi-ico { background: var(--sky); }
.kpi:nth-child(4) .kpi-ico { background: var(--rose); }
.kpi-value { font-size: 30px; font-weight: 600; letter-spacing: -.03em; line-height: 1.15; margin: 12px 0 8px; font-variant-numeric: tabular-nums; min-height: 36px; color: var(--text); }
.kpi-value-text { font-size: 24px; line-height: 36px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi-value small { font-size: 13px; font-weight: 500; color: var(--text-3); letter-spacing: 0; margin-left: 4px; }
.kpi-foot { font-size: 12.5px; color: var(--text-2); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; min-height: 22px; }
.kpi-foot b { color: var(--text); font-weight: 600; }
.delta { display: inline-flex; align-items: center; gap: 2px; height: 20px; padding: 0 7px; border-radius: 6px; font-size: 11.5px; font-weight: 600; font-variant-numeric: tabular-nums; }
.delta.up { color: var(--good); background: var(--good-bg); }
.delta.down { color: var(--bad); background: var(--bad-bg); }
.delta.flat { color: var(--text-2); background: var(--card-3); }
.delta .ico { width: 12px; height: 12px; }

.dash-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 16px; }
.dash-grid > * { min-width: 0; }
.span-4 { grid-column: span 4; }
.span-6 { grid-column: span 6; }
.span-8 { grid-column: span 8; }
.span-12 { grid-column: span 12; }

/* ------------------------------------------------------------------ Charts */
.chart { position: relative; height: 272px; }
.chart > svg { width: 100%; height: 100%; overflow: visible; }
.chart .grid-line { stroke: var(--line); stroke-width: 1; }
.chart .base-line { stroke: var(--line-2); stroke-width: 1; }
.chart .axis-label { fill: var(--text-3); font-size: 11px; font-variant-numeric: tabular-nums; }
.chart .bar { fill: var(--primary); transition: fill var(--t); }
.chart .bar.is-dim { fill: var(--bar); }
.chart .bar-ghost { fill: var(--bar); transition: fill var(--t); }
.chart .bar-grow { transform-box: fill-box; transform-origin: bottom; animation: grow .5s var(--ease) both; }
.chart .hit { fill: transparent; cursor: pointer; }
.chart .col.is-hover .bar { fill: var(--primary-hover); }
.chart .col.is-hover .bar.is-dim { fill: #CFD7E2; }
.chart .col.is-hover .bar-ghost { fill: #D3DAE3; }
.chart .val-label { fill: var(--text); font-size: 11.5px; font-weight: 600; font-variant-numeric: tabular-nums; }
@keyframes grow { from { transform: scaleY(0); } }
.chart-tip {
  position: absolute; z-index: 5; pointer-events: none; min-width: 124px; padding: 9px 12px; border-radius: 8px;
  background: var(--tooltip); color: #fff; box-shadow: var(--shadow-lg);
  font-size: 12.5px; transform: translate(-50%, calc(-100% - 10px)); opacity: 0; transition: opacity var(--t); white-space: nowrap;
}
.chart-tip.is-on { opacity: 1; }
.chart-tip strong { display: block; font-size: 12px; color: #B9BCC4; font-weight: 500; margin-bottom: 5px; }
.chart-tip .tip-row { display: flex; align-items: center; gap: 12px; justify-content: space-between; }
.chart-tip .tip-row span { display: inline-flex; align-items: center; gap: 7px; color: #D6D8DD; }
.chart-tip .tip-row b { font-variant-numeric: tabular-nums; color: #fff; font-weight: 600; }
.chart-tip i, .legend i { width: 8px; height: 8px; border-radius: 2px; display: inline-block; }
.legend { display: flex; gap: 14px; font-size: 12px; color: var(--text-2); flex-wrap: wrap; }
.legend span { display: inline-flex; align-items: center; gap: 7px; }

.donut-wrap { display: grid; grid-template-columns: 1fr; gap: 20px; justify-items: center; }
.donut { position: relative; width: 176px; height: 176px; }
.donut svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.donut circle { fill: none; stroke-width: 16; transition: opacity var(--t); cursor: pointer; }
.donut circle.track { stroke: var(--bar); cursor: default; }
.donut circle.seg { animation: dash .7s var(--ease) both; }
.donut.has-hover circle.seg:not(.is-hover) { opacity: .3; }
@keyframes dash { from { stroke-dasharray: 0 999; } }
.donut-center { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; pointer-events: none; }
.donut-center strong { font-size: 28px; font-weight: 600; letter-spacing: -.03em; line-height: 1; font-variant-numeric: tabular-nums; }
.donut-center span { font-size: 12px; color: var(--text-3); margin-top: 5px; }
.donut-legend { width: 100%; display: grid; gap: 2px; }
.donut-legend li { list-style: none; display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 10px; font-size: 13px; padding: 6px 8px; border-radius: 8px; transition: background var(--t); }
.donut-legend li:hover, .donut-legend li.is-hover { background: var(--card-2); }
.donut-legend li span { display: inline-flex; align-items: center; gap: 9px; color: var(--text-2); }
.donut-legend li b { font-weight: 600; font-variant-numeric: tabular-nums; }
.donut-legend li b small { color: var(--text-3); font-weight: 400; margin-left: 8px; }
.donut-legend i { width: 8px; height: 8px; border-radius: 2px; }
ul.donut-legend { margin: 0; padding: 0; }

.breakdown { display: grid; gap: 2px; }
.bd-row { display: grid; grid-template-columns: minmax(110px, 1.1fr) 2fr auto; align-items: center; gap: 16px; padding: 8px 6px; border-radius: 8px; transition: background var(--t); }
.bd-row:hover { background: var(--card-2); }
.bd-label { display: inline-flex; align-items: center; gap: 9px; font-size: 13px; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bd-label i { width: 8px; height: 8px; border-radius: 2px; flex: none; }
.bd-track { height: 6px; border-radius: 3px; background: var(--bar); overflow: hidden; }
.bd-fill { display: block; height: 100%; width: var(--w, 0%); border-radius: 3px; background: var(--primary); animation: fill .6s var(--ease) both; }
@keyframes fill { from { width: 0; } }
.bd-val { font-size: 12.5px; color: var(--text-3); font-variant-numeric: tabular-nums; white-space: nowrap; min-width: 64px; text-align: right; }
.bd-val strong { color: var(--text); font-weight: 600; }

/* ------------------------------------------------------------------ Lists, chips, badges */
.recent { display: grid; }
.r-item { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; align-items: center; gap: 14px; padding: 12px 8px; border-top: 1px solid var(--line); transition: background var(--t); animation: fade .3s var(--ease) both; }
.r-item:first-child { border-top: 0; }
.r-item:hover { background: var(--card-2); }
.r-main { min-width: 0; display: grid; gap: 2px; }
.r-main strong { font-size: 13.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.r-main span { font-size: 12.5px; color: var(--text-3); }
.r-tags { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.r-item .icon-btn { opacity: .6; border-color: transparent; background: transparent; }
.r-item:hover .icon-btn, .r-item .icon-btn:focus-visible { opacity: 1; border-color: var(--line-2); background: #fff; }

.chip { display: inline-flex; align-items: center; gap: 7px; height: 24px; padding: 0 9px; border-radius: 6px; font-size: 12px; font-weight: 500; background: var(--card-3); color: var(--text); white-space: nowrap; }
.chip i { width: 6px; height: 6px; border-radius: 50%; flex: none; }
.chip-muted { color: var(--text-2); }
.chip-accent { background: var(--primary-soft); color: var(--primary); }
.badge { display: inline-flex; align-items: center; height: 19px; padding: 0 7px; border-radius: 5px; font-size: 10.5px; font-weight: 600; letter-spacing: .03em; vertical-align: middle; margin-left: 6px; }
.badge-accent { background: var(--primary-soft); color: var(--primary); }

.fbadge {
  width: 38px; height: 38px; flex: none; display: grid; place-items: center; border-radius: var(--r);
  font-size: 9.5px; font-weight: 700; letter-spacing: .04em; color: var(--primary);
  background: var(--primary-soft);
}

.conf { display: inline-flex; align-items: center; gap: 8px; font-variant-numeric: tabular-nums; font-size: 12px; color: var(--text-2); }
.conf::before { content: ""; width: 30px; height: 4px; border-radius: 2px; background: var(--bar); box-shadow: inset calc(var(--c) * .3px) 0 0 var(--primary); }

/* ------------------------------------------------------------------ Empty & skeleton */
.empty { display: grid; justify-items: center; text-align: center; gap: 8px; padding: 40px 16px; }
.empty h2, .empty h3 { font-size: 15px; font-weight: 600; }
.empty p { color: var(--text-2); max-width: 360px; font-size: 13px; margin-bottom: 8px; }
.empty-ico { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 50%; background: var(--primary-soft); color: var(--primary); margin-bottom: 6px; }
.empty-card { padding: 12px; }
.empty-inline { padding: 28px 8px; text-align: center; color: var(--text-3); font-size: 13px; display: grid; gap: 10px; justify-items: center; }

.skel { display: block; border-radius: 8px; background: var(--card-3); animation: pulse 1.4s ease-in-out infinite; }
.skel-num { width: 56px; height: 32px; margin-top: 4px; }
.skel-line { width: 65%; height: 11px; }
.skel-row { height: 30px; margin: 6px 0; }
.skel-row.lg { height: 46px; }
.skel-chart { position: absolute; inset: 0; border-radius: var(--r); }
.skel-donut { width: 176px; height: 176px; border-radius: 50%; }
@keyframes pulse { 50% { opacity: .5; } }

/* ------------------------------------------------------------------ Report */
.report-head { align-items: center; }
.week-nav { display: flex; align-items: center; gap: 14px; }
.week-label .eyebrow { margin-bottom: 4px; }
.week-label .sub { margin-top: 4px; }
.table-wrap { position: relative; overflow-x: auto; margin: 0 -24px -24px; }
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th { text-align: left; font-size: 12px; font-weight: 500; color: var(--text-3); padding: 10px 16px; border-bottom: 1px solid var(--line-2); white-space: nowrap; }
.table td { padding: 12px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tbody tr { transition: background var(--t); }
.table tbody tr:hover { background: var(--card-2); }
.table tbody tr:last-child td { border-bottom: 0; }
.table .num { text-align: right; }
.table .actions { width: 52px; text-align: right; }
.file-cell { display: flex; align-items: center; gap: 11px; max-width: 360px; }
.file-cell .fbadge { width: 32px; height: 32px; border-radius: 8px; font-size: 8.5px; }
.fname { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; }
.table tr.is-removing { opacity: 0; transition: opacity .25s; }
.print-foot { display: none; }

/* ------------------------------------------------------------------ Settings */
.settings-layout { display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: 24px; align-items: start; }
.settings-nav { position: sticky; top: 24px; display: grid; gap: 4px; padding: 8px; background: var(--card); border-radius: var(--r-lg); box-shadow: var(--shadow); }
.settings-nav a { display: flex; align-items: center; gap: 10px; height: 38px; padding: 0 12px; border-radius: 8px; color: var(--text-2); font-weight: 500; font-size: 13.5px; transition: background var(--t), color var(--t); }
.settings-nav a .ico { color: var(--text-3); }
.settings-nav a:hover { background: var(--card-2); color: var(--text); }
.settings-nav a.is-active { background: var(--primary-soft); color: var(--primary); }
.settings-nav a.is-active .ico { color: var(--primary); }
.settings-nav .count { margin-left: auto; font-size: 11px; font-weight: 600; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; display: grid; place-items: center; background: var(--primary); color: #fff; }
.settings-main { display: grid; gap: 16px; min-width: 0; }
.settings-card { padding: 24px; scroll-margin-top: 24px; }
.account-row { display: flex; align-items: center; gap: 14px; margin-bottom: 20px; }
.account-row div { display: grid; }
.account-row strong { font-size: 15px; font-weight: 600; }
.account-row .muted { font-size: 13px; }
.facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; margin: 0; background: var(--card-2); border-radius: var(--r); }
.facts div { padding: 14px 16px; border-left: 1px solid var(--line-2); }
.facts div:first-child { border-left: 0; }
.facts dt { font-size: 12px; color: var(--text-3); }
.facts dd { margin: 3px 0 0; font-weight: 600; font-size: 14px; }
.devices { list-style: none; padding: 0; margin: 0; display: grid; }
.device { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 14px; padding: 14px 0; border-top: 1px solid var(--line); transition: opacity .25s; }
.device:first-child { border-top: 0; padding-top: 2px; }
.device.is-removing { opacity: 0; }
.device-ico { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 50%; background: var(--primary-soft); color: var(--primary); }
.device-info { display: grid; gap: 2px; min-width: 0; }
.device-info strong { font-weight: 600; font-size: 13.5px; }
.device-info .muted { font-size: 12.5px; color: var(--text-3); }
.danger-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-top: 18px; padding: 14px 16px; border-radius: var(--r); background: #FFF6F7; }
.danger-row div { display: grid; gap: 2px; }
.danger-row strong { font-weight: 600; font-size: 13.5px; }
.danger-row .muted { font-size: 12.5px; }
.privacy-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.privacy-list li { display: grid; grid-template-columns: auto 1fr; gap: 12px; font-size: 13px; color: var(--text-2); }
.privacy-list .ico { color: var(--green); margin-top: 3px; }
.privacy-list strong { color: var(--text); font-weight: 600; }

/* ------------------------------------------------------------------ Modal */
dialog.modal { padding: 0; border: 0; background: transparent; color: var(--text); max-width: calc(100vw - 32px); width: 460px; overflow: visible; }
dialog.modal::backdrop { background: rgba(21, 30, 50, .35); }
dialog.modal[open] .modal-card { animation: fade .2s var(--ease) both; }
.modal-card { background: var(--card); border-radius: 16px; padding: 24px; box-shadow: var(--shadow-lg); }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.modal-head h2 { font-size: 16px; font-weight: 600; letter-spacing: -.01em; }
.modal-head p { font-size: 12.5px; color: var(--text-3); margin-top: 3px; word-break: break-word; }
.modal-foot { display: flex; align-items: center; gap: 8px; margin-top: 22px; }
.modal-foot .spacer { flex: 1; }
.btn-text-danger { color: var(--bad); font-size: 13px; font-weight: 500; display: inline-flex; align-items: center; gap: 6px; padding: 6px 2px; border-radius: 6px; }
.btn-text-danger:hover { text-decoration: underline; text-underline-offset: 3px; }

/* ------------------------------------------------------------------ Toasts */
.toast-stack { position: fixed; z-index: 100; right: 20px; bottom: 20px; display: grid; gap: 8px; width: min(360px, calc(100vw - 32px)); pointer-events: none; }
.page-dashboard .toast-stack { bottom: auto; top: 20px; }
.toast {
  pointer-events: auto; display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: start; padding: 12px 12px 12px 14px;
  border-radius: 12px; background: var(--tooltip); color: #fff; box-shadow: var(--shadow-lg);
  animation: fade .2s var(--ease) both; font-size: 13px;
}
.toast.is-leaving { animation: fadeOut .2s var(--ease) both; }
.toast-ico { display: grid; place-items: center; padding-top: 1px; }
.toast-success .toast-ico { color: #6BD48E; }
.toast-error .toast-ico { color: #FF8A9B; }
.toast-info .toast-ico { color: #8DB6FF; }
.toast p { color: #fff; }
.toast button { color: #9A9EA8; padding: 2px; border-radius: 4px; }
.toast button:hover { color: #fff; }
@keyframes fadeOut { to { opacity: 0; } }

/* ------------------------------------------------------------------ Live sync */
.live { display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 12px; border-radius: 17px; background: var(--good-bg); color: var(--good); font-size: 12.5px; font-weight: 600; white-space: nowrap; cursor: default; }
.live i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; animation: beat 2s ease-in-out infinite; }
.live.is-off { background: var(--warn-bg); color: var(--warn); }
.live.is-off i { animation: none; }
@keyframes beat { 0%, 100% { opacity: 1; } 50% { opacity: .3; } }

.bmark {
  width: 38px; height: 38px; flex: none; display: grid; place-items: center; border-radius: var(--r);
  font-size: 9.5px; font-weight: 700; letter-spacing: .04em;
  color: var(--bc, var(--primary)); background: color-mix(in srgb, var(--bc, var(--primary)) 12%, #fff);
}
.bmark-sm { width: 30px; height: 30px; border-radius: 8px; font-size: 8.5px; }

.recent { container-type: inline-size; }
.recent .r-item { grid-template-columns: auto minmax(0, 1fr) auto auto auto; }
@container (max-width: 900px) {
  .recent .r-item { grid-template-columns: auto minmax(0, 1fr) auto auto; row-gap: 4px; }
  .recent .r-when { grid-column: 2; grid-row: 2; }
}
@container (max-width: 620px) {
  .recent .r-item { grid-template-columns: auto minmax(0, 1fr) auto; align-items: start; }
  .recent .r-when { grid-column: 2 / -1; grid-row: 2; }
  .recent .r-tags { grid-column: 2 / -1; grid-row: 3; justify-content: flex-start; }
  .recent .r-item .icon-btn { grid-column: 3; grid-row: 1; }
}
.r-when { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--text-2); white-space: nowrap; }
.r-when .ico { color: var(--text-3); }
.src { display: inline-flex; align-items: center; gap: 3px; margin-right: 6px; padding: 0 6px; height: 18px; border-radius: 4px; font-size: 10.5px; font-weight: 600; letter-spacing: .02em; color: var(--primary); background: var(--primary-soft); vertical-align: 1px; }
.src-muted { color: var(--text-2); background: var(--card-3); }
.r-main span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.r-item.is-new { animation: fade .3s var(--ease) both, newrow 2.4s ease-out .3s both; }
@keyframes newrow { from { background: var(--primary-soft); } to { background: transparent; } }

.upcoming { display: grid; }
.up-item { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 12px; align-items: center; padding: 10px 8px; border-top: 1px solid var(--line); text-align: left; border-radius: 0; transition: background var(--t); width: 100%; }
.up-item:first-child { border-top: 0; }
.up-item:hover { background: var(--card-2); }
.up-date { width: 42px; height: 44px; border-radius: var(--r); display: grid; place-content: center; text-align: center; background: var(--card-3); line-height: 1.1; }
.up-date b { font-size: 16px; font-weight: 700; }
.up-date small { font-size: 10.5px; color: var(--text-2); text-transform: uppercase; letter-spacing: .04em; }
.up-date.is-today { background: var(--primary); color: #fff; }
.up-date.is-today small { color: #D6E4FF; }
.up-main { display: grid; gap: 2px; min-width: 0; }
.up-main strong { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.up-main span { font-size: 12px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ------------------------------------------------------------------ Design dialog */
dialog.modal.modal-wide { width: 600px; }
.form-row-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.textarea { height: auto; min-height: 84px; padding: 10px 13px; line-height: 1.5; resize: vertical; font: inherit; }
.field-opt { font-weight: 400; color: var(--text-3); margin-left: 4px; }
.modal-card .form { display: grid; gap: 14px; }

/* ------------------------------------------------------------------ Poster sync page */
.token-form { display: grid; gap: 12px; padding-bottom: 18px; margin-bottom: 6px; border-bottom: 1px solid var(--line); }
.token-form .form-actions { justify-content: flex-start; }
.tokens { list-style: none; padding: 0; margin: 0; display: grid; }
.token { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 14px; padding: 14px 0; border-top: 1px solid var(--line); }
.token:first-child { border-top: 0; }
.tprefix, .kv code, .ref-table code, .endpoint code, .tr-head code, .kv-tight code {
  font: 500 12px/1.4 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; padding: 1px 6px; border-radius: 5px; background: var(--card-3); color: var(--text);
}
.tprefix { margin-left: 6px; color: var(--text-2); }
.endpoint { display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 10px; border-radius: var(--r); background: var(--card-2); border: 1px solid var(--line-2); min-width: 0; }
.endpoint code { flex: 1; min-width: 0; background: none; padding: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.endpoint .icon-btn { flex: none; }
.method { flex: none; font-size: 11px; font-weight: 700; letter-spacing: .04em; color: #fff; background: var(--primary); padding: 3px 7px; border-radius: 5px; }
.token-reveal { margin: 14px 0 4px; }
.token-reveal code { white-space: normal; word-break: break-all; font-size: 13px; }
.notice-warn { background: var(--warn-bg); color: var(--warn); margin-bottom: 0; }
.kv { display: grid; gap: 0; margin: 16px 0; }
.kv > div { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 12px; padding: 9px 0; border-top: 1px solid var(--line); font-size: 13px; }
.kv > div:first-child { border-top: 0; }
.kv dt { color: var(--text-3); }
.kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.kv-tight > div { padding: 7px 0; grid-template-columns: 96px minmax(0, 1fr); }
.code-block { border-radius: var(--r); background: #F4F6FA; border: 1px solid var(--line-2); overflow: hidden; }
.code-head { display: flex; align-items: center; justify-content: space-between; padding: 6px 8px 6px 12px; border-bottom: 1px solid var(--line-2); font-size: 12px; font-weight: 600; color: var(--text-2); }
.code-head span { display: inline-flex; align-items: center; gap: 6px; }
.code-block pre { margin: 0; padding: 12px 14px; overflow-x: auto; font: 12px/1.6 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; color: #2B3240; }
.code-input { font: 12.5px/1.55 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; min-height: 260px; tab-size: 2; white-space: pre; }
.test-actions { justify-content: flex-start; align-items: center; flex-wrap: wrap; }
.small { font-size: 12px; }
.test-result { margin-top: 16px; padding: 14px 16px; border-radius: var(--r); background: var(--card-2); animation: fade .2s var(--ease) both; }
.tr-head { display: flex; align-items: center; gap: 8px; font-size: 13.5px; }
.tr-head strong { font-weight: 600; flex: 1; min-width: 0; }
.tr-head.is-good .ico { color: var(--good); }
.tr-head.is-bad .ico, .tr-head.is-bad strong { color: var(--bad); }
.tr-list { margin: 10px 0 0; padding-left: 20px; font-size: 13px; color: var(--text-2); display: grid; gap: 4px; }
.tr-warn { display: grid; grid-template-columns: auto 1fr; gap: 8px; margin-top: 12px; padding: 10px 12px; border-radius: 8px; background: var(--warn-bg); color: var(--warn); font-size: 12.5px; }
.tr-warn ul { margin: 0; padding-left: 16px; display: grid; gap: 3px; }
.ref-table td { vertical-align: top; }
.ref-table td:first-child { white-space: nowrap; }
.ref-table td:nth-child(2) { color: var(--text-2); white-space: nowrap; }
.ref-table .badge { margin-left: 4px; }
.badge:not(.badge-accent) { background: var(--card-3); color: var(--text-2); }
.design-cell { display: grid; gap: 1px; max-width: 360px; }
/* design log: the program leads (bold), the design follows in regular weight */
.prog-cell strong { font-weight: 700; color: var(--text); }
.design-cell-2nd .fname { font-weight: 400; }
.design-cell .small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ------------------------------------------------------------------ Responsive */
@media (max-width: 1200px) {
  .span-8, .span-4 { grid-column: span 12; }
  .donut-wrap { grid-template-columns: 176px 1fr; align-items: center; justify-items: stretch; gap: 32px; }
  .donut { justify-self: center; }
}
@media (max-width: 1024px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi:nth-child(3)::before { display: none; }
  .kpi:nth-child(n+3) { border-top: 1px solid var(--line-2); }
  .settings-layout { grid-template-columns: 1fr; gap: 16px; }
  .settings-nav { position: static; display: flex; overflow-x: auto; }
  .settings-nav a { white-space: nowrap; }
}
@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: fixed; inset: 0 auto 0 0; width: min(280px, 84vw); transform: translateX(-101%); transition: transform .25s var(--ease); box-shadow: var(--shadow-lg); }
  .sidebar.is-open { transform: none; }
  .sidebar-close { display: inline-grid; }
  .scrim { display: block; position: fixed; inset: 0; z-index: 35; background: rgba(21, 30, 50, .3); opacity: 0; pointer-events: none; transition: opacity .25s; }
  .scrim.is-open { opacity: 1; pointer-events: auto; }
  .mobile-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; position: sticky; top: 0; z-index: 30; padding: 10px 16px; background: var(--bg); border-bottom: 1px solid var(--line-2); }
  .brand-sm { gap: 9px; font-size: 15px; font-weight: 600; letter-spacing: -.02em; }
  .page { padding: 24px 20px 48px; }
  .span-6 { grid-column: span 12; }
}
@media (max-width: 640px) {
  .page { padding: 20px 14px 40px; }
  .page-head { align-items: stretch; margin-bottom: 20px; }
  .page-title h1, .week-label h1 { font-size: 22px; }
  .page-actions { width: 100%; }
  .page-actions .segmented { flex: 1; }
  .page-actions .segmented button { flex: 1; padding: 0 8px; }
  .page-dashboard .page-head .btn-primary { display: none; }
  .kpi { padding: 14px 16px; }
  .kpi-value { font-size: 26px; margin-top: 10px; }
  .kpi-value-text { font-size: 19px; }
  .card { padding: 18px; }
  .table-wrap { margin: 0; }
  .chart { height: 220px; }
  .donut-wrap { grid-template-columns: 1fr; justify-items: center; }
  .bd-row { grid-template-columns: minmax(90px, 1fr) 1.2fr auto; gap: 10px; }
  .r-item { grid-template-columns: auto minmax(0, 1fr) auto; }
  .r-tags { grid-column: 2 / -1; justify-content: flex-start; grid-row: 2; }
  .form-row { grid-template-columns: 1fr; }
  .facts { grid-template-columns: 1fr; }
  .facts div { border-left: 0; border-top: 1px solid var(--line-2); }
  .facts div:first-child { border-top: 0; }
  .report-head .page-actions { justify-content: flex-start; }
  .week-nav { width: 100%; justify-content: space-between; gap: 10px; }
  .week-label { text-align: center; }
  .table-wrap { overflow: visible; }
  .table thead { display: none; }
  .table, .table tbody, .table tr, .table td { display: block; width: 100%; }
  .table tr { position: relative; padding: 12px 2px; border-top: 1px solid var(--line); }
  .table td { border: 0; padding: 3px 44px 3px 0; }
  .table td.num { text-align: left; }
  .table td.actions { position: absolute; top: 12px; right: 0; width: auto; padding: 0; }
  .file-cell { max-width: none; }
  .device { grid-template-columns: auto minmax(0, 1fr); }
  .device form { grid-column: 2; }
  .toast-stack, .page-dashboard .toast-stack { left: 16px; right: 16px; width: auto; top: auto; bottom: 16px; }
  .auth-card { padding: 28px 20px 22px; }
}
@media (max-width: 640px) {
  .form-row-3 { grid-template-columns: 1fr; }
  .page-actions .live { order: -1; }
  .kv > div, .kv-tight > div { grid-template-columns: 1fr; gap: 2px; }
  .token { grid-template-columns: auto minmax(0, 1fr); }
  .token .btn { grid-column: 2; justify-self: start; }
  .ref-table td:first-child, .ref-table td:nth-child(2) { white-space: normal; }
  .design-cell { max-width: none; }
}
@media (max-width: 380px) {
  .kpis { grid-template-columns: 1fr; }
  .kpi + .kpi::before { display: none; }
  .kpi + .kpi { border-top: 1px solid var(--line-2); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}

/* ------------------------------------------------------------------ Print (report) */
@media print {
  @page { margin: 14mm; }
  body { background: #fff !important; font-size: 11px; }
  .sidebar, .mobile-bar, .page-actions, .icon-btn, .toast-stack, .table .actions, .week-nav a, .week-nav span.icon-btn { display: none !important; }
  .app { display: block; }
  .page { padding: 0; max-width: none; animation: none; }
  .card, .kpis { background: #fff !important; border: 1px solid #ddd !important; box-shadow: none !important; break-inside: avoid; }
  .print-foot { display: block; margin-top: 18px; color: #777; font-size: 10px; }
  * { animation: none !important; transition: none !important; }
}

/* ------------------------------------------------------------------ Poster sync: redesign (1 Oct)
   The feed and the connection lead; the endpoint, code, test console and field
   reference live in a side drawer opened from the "For developers" tiles. */
.sync-side { display: grid; gap: 16px; align-content: start; }
.sync-feed .recent { min-height: 240px; }
.disclosure { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 12px; }
.disclosure > summary { list-style: none; display: flex; align-items: center; gap: 8px; cursor: pointer; font-size: 13px; font-weight: 600; color: var(--primary); padding: 4px 0; border-radius: 6px; }
.disclosure > summary::-webkit-details-marker { display: none; }
.disclosure > summary span { flex: 1; }
.disclosure > summary svg:last-child { color: var(--text-3); transition: transform var(--t) var(--ease); }
.disclosure[open] > summary svg:last-child { transform: rotate(90deg); }
.disclosure > summary:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.disclosure .token-form { border-bottom: 0; margin: 12px 0 0; padding-bottom: 0; }
.disclosure .form-row { grid-template-columns: minmax(0, 1fr); }
.dev-tiles { display: grid; gap: 8px; }
.dev-tile { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 12px; width: 100%; text-align: left; padding: 12px; border-radius: var(--r); background: var(--card-2); border: 1px solid var(--line-2); color: var(--text); transition: border-color var(--t), background var(--t), transform var(--t) var(--ease); }
.dev-tile:hover { background: #FFFFFF; border-color: var(--line-3); transform: translateY(-1px); }
.dev-tile:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.dev-tile > svg { color: var(--text-3); }
.dev-ico { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 9px; background: var(--primary-soft); color: var(--primary); }
.dev-txt { display: grid; gap: 2px; min-width: 0; }
.dev-txt strong { font-size: 13.5px; font-weight: 600; }
.dev-txt span { font-size: 12px; color: var(--text-3); }
dialog.modal.drawer { width: min(760px, 100vw); max-width: 100vw; height: 100vh; max-height: 100vh; margin: 0 0 0 auto; }
dialog.modal.drawer .modal-card { height: 100%; overflow-y: auto; border-radius: 16px 0 0 16px; padding: 24px 28px 32px; }
dialog.modal.drawer[open] .modal-card { animation: drawer-in .26s var(--ease) both; }
@keyframes drawer-in { from { transform: translateX(32px); opacity: 0; } to { transform: none; opacity: 1; } }
.dev-tabs { margin-bottom: 18px; max-width: 100%; overflow-x: auto; }
.dev-lead { margin: 0 0 14px; }
.dev-panel .code-block { margin-top: 4px; }
.dev-panel .ref-table td { vertical-align: top; }
@media (max-width: 1100px) {
  .sync-grid .span-8, .sync-grid .span-4 { grid-column: span 12; }
  .sync-side { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  .sync-side { grid-template-columns: minmax(0, 1fr); }
  dialog.modal.drawer .modal-card { border-radius: 0; padding: 20px 16px 28px; }
}
@media (prefers-reduced-motion: reduce) {
  dialog.modal.drawer[open] .modal-card { animation: none; }
  .dev-tile:hover { transform: none; }
}

/* ------------------------------------------------------------------ Reports: weekly / monthly (1 Oct) */
.head-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.report-period { margin-bottom: 18px; }
.report-period a { display: inline-flex; align-items: center; height: 30px; padding: 0 16px; border-radius: 7px; font-size: 13px; font-weight: 500; color: var(--text-2); text-decoration: none; transition: color var(--t), background var(--t); }
.report-period a:hover { color: var(--text); }
.report-period a.is-active { background: var(--primary); color: #fff; }
.report-period a:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
@media print { .report-period { display: none; } }

/* ---------------------------------------------- AI artwork reading (Add design) */
.ai-drop { border: 1.5px dashed var(--line-3); border-radius: 12px; background: var(--card-2); padding: 12px 14px; cursor: pointer; transition: border-color .15s, background .15s; }
.ai-drop:hover, .ai-drop:focus-visible, .ai-drop.is-over { border-color: var(--primary); background: var(--primary-soft); outline: none; }
.ai-drop.is-off { cursor: default; display: flex; gap: 12px; align-items: center; border-style: solid; border-color: var(--line-2); }
.ai-drop.is-off:hover { border-color: var(--line-2); background: var(--card-2); }
.ai-state { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px; }
.ai-state > .btn { flex: none; }
.ai-state[hidden] { display: none; }
.ai-state > div, .ai-drop.is-off > div { display: grid; gap: 2px; min-width: 0; flex: 1 1 170px; }
.ai-drop strong { font-size: 13.5px; font-weight: 600; color: var(--text); }
.ai-drop span:not(.ai-ico):not(.spinner) { font-size: 12.5px; color: var(--text-2); }
.ai-ico { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; background: var(--primary-soft); color: var(--primary); flex: none; }
.ai-thumb { width: 44px; height: 44px; object-fit: cover; border-radius: 8px; background: var(--card-3); flex: none; }
.ai-state .spinner { color: var(--primary); flex: none; }
.ai-filled { animation: ai-flash 1.6s var(--ease) both; }
@keyframes ai-flash { 0% { background: var(--primary-soft); box-shadow: 0 0 0 2px var(--primary); } 100% { background: var(--field); box-shadow: none; } }

/* ---------------------------------------------- report: day by day */
.ds-nav { display: flex; gap: 6px; }
.ds-strip { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; margin-bottom: 18px; }
.ds-day { display: grid; justify-items: center; gap: 6px; padding: 10px 4px 9px; border-radius: 12px; background: var(--card-2); color: var(--text-2); font-size: 12.5px; font-weight: 500; transition: background var(--t) var(--ease), color var(--t) var(--ease), box-shadow var(--t) var(--ease); }
.ds-day:hover { background: var(--card-3); color: var(--text); }
.ds-day:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.ds-day.is-sel { background: var(--primary); color: #fff; box-shadow: var(--shadow); }
.ds-name { white-space: nowrap; }
.ds-bar { display: flex; align-items: flex-end; width: 14px; height: 46px; border-radius: 4px; background: var(--bar); overflow: hidden; }
.ds-bar i { display: block; width: 100%; background: var(--primary); border-radius: 4px; min-height: 0; transition: height .3s var(--ease); }
.ds-day.is-sel .ds-bar { background: rgba(255, 255, 255, .28); }
.ds-day.is-sel .ds-bar i { background: #fff; }
.ds-count { font-size: 15px; font-weight: 600; color: var(--text); font-variant-numeric: tabular-nums; }
.ds-day.is-sel .ds-count { color: #fff; }
.ds-panel { display: grid; grid-template-columns: minmax(0, 300px) minmax(0, 1fr); gap: 24px; align-items: start; }
.ds-sum { display: grid; gap: 8px; }
.ds-big { font-size: 15px; color: var(--text-2); }
.ds-big strong { font-size: 34px; font-weight: 650; color: var(--text); letter-spacing: -.02em; margin-right: 6px; font-variant-numeric: tabular-nums; }
.ds-cmps { display: grid; gap: 6px; margin-top: 2px; }
.ds-cmp { font-size: 12.5px; color: var(--text-2); display: flex; align-items: center; gap: 6px; }
.ds-top { display: grid; gap: 1px; margin-top: 4px; }
.ds-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.ds-list { display: grid; gap: 2px; min-width: 0; }
.ds-row { display: grid; grid-template-columns: 74px minmax(0, 1fr) auto auto; gap: 12px; align-items: center; padding: 8px 10px; border-radius: 10px; }
.ds-row .chip { justify-self: start; }
.ds-row:nth-child(odd) { background: var(--card-2); }
.ds-what { display: grid; min-width: 0; }
.ds-what strong { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ds-what .muted { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 13px; }
.ds-meta { white-space: nowrap; }
.ds-more { justify-self: start; margin-top: 6px; }
@media (max-width: 860px) { .ds-panel { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 560px) {
  .ds-strip { gap: 4px; }
  .ds-day { padding: 8px 2px; font-size: 11px; }
  .ds-row { grid-template-columns: minmax(0, 1fr) auto; }
  .ds-when { grid-column: 1 / -1; }
  .ds-row { gap: 4px 10px; }
}
@media print { .ds-nav { display: none; } }
.ds-more { color: var(--primary); font-size: 13px; font-weight: 500; padding: 6px 2px; border-radius: 6px; }
.ds-more:hover { text-decoration: underline; text-underline-offset: 3px; }

/* ==========================================================================
   Nation Studio skin (13 Nov 2026)
   The poster generator's look, on the whole app: a navy rail with a sky-blue
   marker on the active page, white cards on hairlines that lift on hover,
   tighter type, and the artwork reader's states.
   ========================================================================== */

/* ---- the rail */
.sidebar { background: var(--deep); color: #B6BFCE; padding: 26px 16px 16px; border-right: 1px solid #0E1828; }
.sidebar-head { padding: 0 4px 26px; margin-bottom: 18px; border-bottom: 1px solid var(--navy-700); }
.brand-text strong { color: #fff; font-size: 15.5px; }
.brand-text small { color: #8997AA; font-size: 11px; }
.sidebar .logo-mark { border-radius: 8px; box-shadow: 0 0 0 1px rgba(255, 255, 255, .08); }
.nav { gap: 3px; }
.nav-label { color: #708099; font-size: 10px; font-weight: 650; letter-spacing: .16em; padding: 16px 14px 8px; }
.nav-item { position: relative; height: 43px; padding: 0 14px; border-radius: 7px; color: #AAB6C8; font-size: 13px; }
.nav-item .nav-ico { color: #8293AB; }
.nav-item:hover { background: var(--navy-900); color: #fff; }
.nav-item:hover .nav-ico { color: #D3DDF4; }
.nav-item.is-active { background: var(--navy-800); color: #fff; }
.nav-item.is-active .nav-ico { color: var(--sky-ink); }
.nav-item.is-active::before { content: ""; position: absolute; left: 0; top: 13px; bottom: 13px; width: 3px; border-radius: 2px; background: var(--sky-ink); }
.sidebar-note { color: #7F8DA3; border-top: 1px solid var(--navy-700); margin-top: auto; padding: 16px 8px 14px; }
.sidebar-note .ico { color: #77BC9C; }
.sidebar-user { background: var(--navy-900); box-shadow: none; border: 1px solid var(--navy-700); border-radius: 10px; }
.sidebar-user .avatar { background: #28364D; color: #D3DDF4; }
.sidebar-user-text strong { color: #E8EBF0; }
.sidebar-user-text small { color: #8997AA; }
.logout-form .icon-btn { color: #8997AA; }
.logout-form .icon-btn:hover { color: #fff; background: rgba(192, 57, 43, .35); }
.sidebar ::-webkit-scrollbar-thumb, .sidebar::-webkit-scrollbar-thumb { background: var(--navy-700); border-color: var(--deep); }

/* ---- page */
.page { padding: 34px 44px 72px 40px; }
.page-head { margin-bottom: 26px; }
.page-title h1, .week-label h1 { font-size: 28px; font-weight: 650; letter-spacing: -.028em; }
.eyebrow { font-size: 11px; font-weight: 650; letter-spacing: .12em; text-transform: uppercase; color: var(--primary); margin-bottom: 8px; }
.sub { color: var(--text-2); font-size: 13.5px; }

/* ---- surfaces */
.card, .kpis, .settings-nav, .segmented { box-shadow: var(--shadow); border-radius: var(--r-lg); }
.card { transition: box-shadow .2s var(--ease); }
.card-head h2 { font-size: 14.5px; font-weight: 650; }
.kpis { padding: 4px 0; }
.kpi { padding: 18px 24px; }
.kpi-label { font-size: 12px; font-weight: 600; letter-spacing: .02em; color: var(--text-3); text-transform: uppercase; }
.kpi-ico { border-radius: 8px; width: 28px; height: 28px; background: color-mix(in srgb, var(--orange) 14%, #fff); color: var(--orange); }
.kpi:nth-child(2) .kpi-ico { background: color-mix(in srgb, var(--green) 14%, #fff); color: var(--green); }
.kpi:nth-child(3) .kpi-ico { background: color-mix(in srgb, var(--sky) 14%, #fff); color: var(--sky); }
.kpi:nth-child(4) .kpi-ico { background: color-mix(in srgb, var(--rose) 14%, #fff); color: var(--rose); }
.kpi-value { font-size: 32px; font-weight: 650; letter-spacing: -.035em; }
.segmented .seg-thumb { background: var(--deep); }
.btn { border-radius: 7px; font-weight: 550; }
.btn-primary { box-shadow: 0 1px 2px rgba(20, 32, 52, .12), inset 0 1px 0 rgba(255, 255, 255, .12); }
.btn-ghost { background: #fff; border-color: var(--line-2); box-shadow: 0 1px 2px rgba(20, 32, 52, .04); }
.btn-ghost:hover { border-color: var(--line-3); background: var(--card-2); }
.icon-btn { background: #fff; border-radius: 7px; }
.icon-btn.icon-btn-accent { background: var(--primary); border-color: var(--primary); color: #fff; }
.icon-btn.icon-btn-accent:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
.chip { border-radius: 99px; height: 23px; padding: 0 10px; font-weight: 550; }
.input { border-radius: 7px; border-color: var(--line-2); }
.table th { font-size: 11px; font-weight: 650; letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); }
.r-item { border-radius: 8px; }
.empty-ico { border-radius: 12px; }
.settings-nav a.is-active, .settings-nav a[aria-current] { background: var(--primary-soft); color: var(--primary); }
.toast { border-radius: 10px; }

/* ---- dialogs */
dialog.modal::backdrop { background: rgba(20, 32, 52, .42); backdrop-filter: blur(2px); }
.modal-card { border-radius: 14px; padding: 26px; box-shadow: var(--shadow-lg); }
.modal-head h2 { font-size: 17px; font-weight: 650; letter-spacing: -.015em; }

/* ---- artwork reader (Add design) */
.ai-drop { position: relative; overflow: hidden; border: 1.5px dashed #C9D3E6; border-radius: 12px; background: linear-gradient(180deg, #FAFBFE, #F4F6FB); padding: 14px 16px; }
.ai-drop:hover, .ai-drop:focus-visible, .ai-drop.is-over { border-color: #6C91FF; background: var(--primary-soft); }
.ai-drop.is-over { box-shadow: 0 0 0 4px rgba(49, 86, 219, .12); }
.ai-ico { border-radius: 10px; background: var(--deep); color: var(--sky-ink); }
.ai-thumb { width: 48px; height: 60px; border-radius: 6px; box-shadow: 0 0 0 1px rgba(20, 32, 52, .08), 0 4px 10px rgba(20, 32, 52, .12); }
.ai-busy-text { display: grid; gap: 8px !important; }
.ai-meter { display: block; height: 4px; border-radius: 99px; background: var(--bar); overflow: hidden; max-width: 280px; }
.ai-meter i { display: block; height: 100%; width: 3%; border-radius: inherit; background: linear-gradient(90deg, #6C91FF, var(--primary)); transition: width .25s var(--ease); }
.ai-drop.is-stamp { border-style: solid; border-color: color-mix(in srgb, var(--green) 45%, #fff); background: var(--good-bg); }
.ai-drop.is-stamp strong::before { content: ""; display: inline-block; width: 7px; height: 7px; margin: 0 8px 1px 0; border-radius: 50%; background: var(--green); }
.ai-drop.is-warn { border-style: solid; border-color: color-mix(in srgb, var(--gold) 55%, #fff); background: var(--warn-bg); }
.ai-drop.is-warn strong { color: var(--warn); }
.ai-drop.is-warn strong::before { background: var(--gold); }
.ai-drop.is-ai::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2px;
  background: linear-gradient(90deg, transparent, #6C91FF, transparent); background-size: 40% 100%; background-repeat: no-repeat;
  animation: ai-sweep 1.3s linear infinite; }
@keyframes ai-sweep { from { background-position: -40% 0; } to { background-position: 140% 0; } }

/* ---- Team page */
.team-people { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; margin-bottom: 16px; }
.team-people:empty { display: none; }
.person { display: flex; align-items: center; gap: 12px; padding: 14px 16px; background: var(--card); border-radius: var(--r-lg); box-shadow: var(--shadow); transition: box-shadow .2s var(--ease), transform .2s var(--ease); }
.person:hover { box-shadow: var(--shadow-hover); transform: translateY(-1px); }
.person > div { display: grid; min-width: 0; flex: 1; line-height: 1.35; }
.person strong { font-size: 13.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.person small { font-size: 12px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.person .avatar { background: var(--deep); color: var(--sky-ink); }
.person-count { display: grid; justify-items: end; font-size: 11px; color: var(--text-3); line-height: 1.2; }
.person-count b { font-size: 20px; font-weight: 650; color: var(--text); letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.recent-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 14px; padding: 12px 8px; border-top: 1px solid var(--line); border-radius: 8px; transition: background var(--t); }
.recent-row:first-child { border-top: 0; }
.recent-row:hover { background: var(--card-2); }
.recent-row > .brand-mark { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 8px; font-size: 9.5px; font-weight: 700; letter-spacing: .04em;
  color: var(--c, var(--primary)); background: color-mix(in srgb, var(--c, var(--primary)) 12%, #fff); }
.recent-main { display: grid; gap: 3px; min-width: 0; }
.recent-main strong { font-size: 13.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.recent-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 12px; color: var(--text-3); }
.recent-topic { font-size: 12.5px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pill-made { display: inline-flex; align-items: center; gap: 5px; height: 20px; padding: 0 8px; border-radius: 99px; background: var(--warn-bg); color: var(--warn); font-size: 11.5px; font-weight: 600; }

/* ---- small screens: the rail becomes a drawer, as before */
@media (max-width: 900px) {
  .page { padding: 20px 16px 56px; }
  .mobile-bar { background: var(--deep); color: #fff; }
  .mobile-bar .icon-btn:not(.icon-btn-accent) { background: transparent; border-color: var(--navy-700); color: #D3DDF4; }
}
@media (prefers-reduced-motion: reduce) {
  .ai-drop.is-ai::after { animation: none; }
  .person:hover { transform: none; }
}
@media print {
  .sidebar { display: none !important; }
}
.mobile-bar .brand-sm { color: #fff; }
.sidebar-close { background: transparent; border-color: var(--navy-700); color: #D3DDF4; }
.auth-body { background: radial-gradient(1100px 460px at 50% -8%, #DCE4FB, transparent 70%), var(--bg); }
.auth-card { box-shadow: 0 1px 2px rgba(20, 32, 52, .04), 0 0 0 1px rgba(20, 32, 52, .05), 0 24px 48px -24px rgba(21, 41, 85, .18); border-radius: 16px; }

/* ------------------------------------------------------------------
   Design previews (13 Nov): the artwork itself, whole and uncropped,
   instead of the brand monogram. One 72×90 (4:5) tile for every row;
   square and wide artworks sit centred on a soft rounded tile.
   ------------------------------------------------------------------ */
.r-item > .bmark, .recent-row > .bmark { width: 72px; height: 90px; border-radius: 10px; font-size: 11px; }
.dthumb {
  width: 72px; height: 90px; flex: none; display: grid; place-items: center; overflow: hidden;
  border-radius: 10px; background: color-mix(in srgb, var(--bc, var(--primary)) 9%, #fff);
}
.dthumb img {
  max-width: 100%; max-height: 100%; width: auto; height: auto; display: block; object-fit: contain;
  border-radius: 3px; box-shadow: 0 1px 3px rgba(20, 32, 52, .16);
}
.r-item:hover .dthumb img, .recent-row:hover .dthumb img { box-shadow: 0 3px 10px rgba(20, 32, 52, .22); }
@container (max-width: 620px) {
  .recent .dthumb, .recent .r-item > .bmark, .recent .recent-row > .bmark { width: 56px; height: 70px; }
}

.thumb-slot {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 14px;
  padding: 10px 12px; margin-bottom: 14px; border: 1px dashed var(--line-2); border-radius: var(--r-lg);
  background: var(--card-2); cursor: pointer; transition: border-color var(--t), background var(--t);
}
.thumb-slot:hover, .thumb-slot:focus-visible, .thumb-slot.is-over { border-color: var(--primary); background: var(--primary-soft); outline: none; }
.thumb-slot.is-set { border-style: solid; border-color: color-mix(in srgb, var(--primary) 40%, var(--line-2)); }
.thumb-slot-text strong { display: block; font-size: 13.5px; }
.thumb-slot-text small { display: block; font-size: 12.5px; color: var(--text-2); }
.thumb-slot-img { display: block; line-height: 0; }
@media print { .dthumb { box-shadow: none; } }
.disclosure-danger > summary { color: var(--bad); }

/* Report previews (13 Nov): the design log and the day-by-day list show each poster */
.table th.thumb-col, .table td.thumb-col { width: 58px; padding-right: 0; }
.dthumb-log, .table .bmark.dthumb-log { width: 44px; height: 55px; border-radius: 7px; font-size: 9px; }
.ds-row { grid-template-columns: 36px 74px minmax(0, 1fr) auto auto; }
.ds-row > .dthumb, .ds-row > .bmark { width: 36px; height: 45px; border-radius: 6px; font-size: 8px; }
@media (max-width: 640px) {
  /* stacked cards: the preview sits at the left of each card, the fields beside it */
  .table tr:has(td.thumb-col) { padding-left: 58px; min-height: 79px; }
  .table td.thumb-col { position: absolute; left: 0; top: 12px; width: auto; padding: 0; }
}
@media (max-width: 560px) {
  .ds-row { grid-template-columns: 36px minmax(0, 1fr) auto; }
  .ds-row > .dthumb, .ds-row > .bmark { grid-row: span 2; }
  .ds-when { grid-column: 2 / -1; }
}
@media print { .dthumb img { box-shadow: none; } }
