/* Tezly owner panel. One world: Tezly's night palette, lime for money and
   selection, amber for "watch", coral for "broken". Onest throughout. */

:root {
  color-scheme: dark;
  --bg: #0a0a09;
  --rail: #0e0e0d;
  --surface: rgba(22, 22, 20, 0.78);
  --surface-solid: #161614;
  --surface-2: #1d1d1a;
  --surface-3: #262622;
  --line: rgba(245, 244, 237, 0.08);
  --line-2: rgba(245, 244, 237, 0.14);
  --ink: #f5f4ed;
  --ink-2: #cfcec4;
  --muted: #9a998e;
  --faint: #6e6d62;
  --lime: #d7ff3d;
  --lime-ink: #0e0f04;
  --lime-soft: rgba(215, 255, 61, 0.11);
  --lime-line: rgba(215, 255, 61, 0.32);
  --amber: #f2c14e;
  --amber-soft: rgba(242, 193, 78, 0.13);
  --coral: #ff6b5b;
  --coral-soft: rgba(255, 107, 91, 0.13);
  --sky: #9cc8ff;
  --radius: 18px;
  --radius-s: 12px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --font: 'Onest', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(1100px 620px at 4% -12%, rgba(150, 185, 20, 0.2), transparent 62%),
    var(--bg);
  background-attachment: fixed;
  color: var(--ink);
  font: 400 14px/1.45 var(--font);
  font-feature-settings: 'tnum' 1, 'cv11' 1;
  -webkit-font-smoothing: antialiased;
}
::selection { background: var(--lime); color: var(--lime-ink); }
:focus-visible { outline: 2px solid var(--lime); outline-offset: 2px; border-radius: 8px; }
a { color: inherit; text-decoration: none; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
input::placeholder { color: var(--muted); }
* { scrollbar-width: thin; scrollbar-color: var(--surface-3) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--surface-3); border-radius: 10px; border: 3px solid var(--bg); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.icon { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.num { font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }

/* ── shell ─────────────────────────────────────────────────────────── */
.shell { display: grid; grid-template-columns: 72px minmax(0, 1fr); min-height: 100vh; }
.rail {
  position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 18px 0;
  background: rgba(14, 14, 13, 0.82);
  border-right: 1px solid var(--line);
  backdrop-filter: blur(18px);
  z-index: 20;
}
.rail-mark { width: 36px; height: 36px; margin-bottom: 18px; display: grid; place-items: center; }
.rail-mark img { width: 30px; height: 30px; }
.rail a, .rail button {
  position: relative;
  width: 44px; height: 44px; border-radius: 13px;
  display: grid; place-items: center;
  color: var(--muted); background: none; border: 0;
  transition: background 180ms var(--ease), color 180ms var(--ease);
}
.rail a:hover, .rail button:hover { color: var(--ink); background: var(--surface-2); }
.rail a[aria-current='page'] { color: var(--lime-ink); background: var(--lime); }
.rail .spacer { flex: 1; }
.rail .lbl { display: none; }
.rail .tip {
  position: absolute; left: 54px; top: 50%; transform: translate(-4px, -50%);
  padding: 6px 10px; border-radius: 9px; white-space: nowrap;
  background: var(--surface-3); color: var(--ink); font-size: 13px; font-weight: 500;
  opacity: 0; pointer-events: none; transition: opacity 150ms, transform 150ms var(--ease);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}
.rail a:hover .tip, .rail a:focus-visible .tip, .rail button:hover .tip { opacity: 1; transform: translate(0, -50%); }
.rail .dot { position: absolute; top: 9px; right: 9px; width: 7px; height: 7px; border-radius: 50%; background: var(--coral); box-shadow: 0 0 0 2px var(--rail); }

.main { min-width: 0; padding: 22px 32px 56px; max-width: 1720px; width: 100%; margin: 0 auto; }

/* ── top bar ───────────────────────────────────────────────────────── */
.top { display: flex; align-items: center; gap: 12px; margin-bottom: 28px; flex-wrap: wrap; }
.crumbs { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--muted); margin-right: auto; min-width: 0; }
.crumbs b { color: var(--ink); font-weight: 600; }
.crumbs .sep { color: var(--faint); }
.demo-tag {
  display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border-radius: 99px;
  background: var(--amber-soft); color: var(--amber); font-size: 12px; font-weight: 600;
}
.search {
  display: flex; align-items: center; gap: 8px; height: 40px; width: min(340px, 100%); padding: 0 12px;
  border-radius: 12px; background: var(--surface); border: 1px solid var(--line); color: var(--muted);
  transition: border-color 160ms;
}
.search:focus-within { border-color: var(--lime-line); color: var(--ink); }
.search input { flex: 1; min-width: 0; background: none; border: 0; outline: 0; font-size: 14px; }
.seg { display: inline-flex; padding: 3px; gap: 2px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); }
.seg button {
  height: 32px; padding: 0 12px; border-radius: 9px; border: 0; background: none;
  color: var(--muted); font-size: 13px; font-weight: 500; white-space: nowrap;
  transition: background 160ms var(--ease), color 160ms;
}
.seg button:hover { color: var(--ink); }
.seg button[aria-pressed='true'] { background: var(--surface-3); color: var(--ink); }
.btn {
  display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 14px; border-radius: 12px;
  background: var(--surface); border: 1px solid var(--line); color: var(--ink-2); font-size: 13px; font-weight: 500; white-space: nowrap;
  transition: border-color 160ms, color 160ms, background 160ms;
}
.btn:hover { border-color: var(--line-2); color: var(--ink); }
.btn:disabled { opacity: 0.5; cursor: default; }
.btn.primary { background: var(--lime); color: var(--lime-ink); border-color: var(--lime); font-weight: 600; }
.btn.primary:hover { background: #e2ff6c; }
.stamp { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); white-space: nowrap; }
.pulse { width: 8px; height: 8px; border-radius: 50%; background: var(--lime); }
.stamp.fresh .pulse { animation: pulse 1.2s 2; }
.stamp.stale .pulse { background: var(--faint); animation: none; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(215, 255, 61, 0.45); } 70% { box-shadow: 0 0 0 8px rgba(215, 255, 61, 0); } 100% { box-shadow: 0 0 0 0 rgba(215, 255, 61, 0); } }
.spin { animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── greeting ──────────────────────────────────────────────────────── */
.hello { display: flex; flex-direction: column; align-items: flex-start; gap: 14px; margin-bottom: 22px; }
.hello h1 { margin: 0 0 6px; font-size: 30px; line-height: 1.15; font-weight: 600; letter-spacing: -0.025em; text-wrap: balance; }
.hello p { margin: 0; color: var(--ink-2); font-size: 15px; max-width: 70ch; }
.hello p strong { color: var(--ink); font-weight: 600; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 8px; min-height: 34px; padding: 6px 12px; border-radius: 11px;
  font-size: 13px; font-weight: 500; line-height: 1.3; border: 1px solid transparent;
}
a.chip { transition: filter 150ms; }
a.chip:hover { filter: brightness(1.18); }
a.chip .icon:last-child { width: 14px; height: 14px; opacity: 0.7; margin-left: -2px; }
.chip.warn { background: var(--amber-soft); color: var(--amber); border-color: rgba(242, 193, 78, 0.22); }
.chip.bad { background: var(--coral-soft); color: #ff8a7d; border-color: rgba(255, 107, 91, 0.25); }
.chip.ok { background: var(--lime-soft); color: var(--lime); border-color: rgba(215, 255, 61, 0.2); }
.chip .icon { width: 16px; height: 16px; }

/* ── grid + cards ──────────────────────────────────────────────────── */
.grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 16px; }
.s3 { grid-column: span 3; } .s4 { grid-column: span 4; } .s5 { grid-column: span 5; } .s6 { grid-column: span 6; }
.s7 { grid-column: span 7; } .s8 { grid-column: span 8; } .s12 { grid-column: span 12; }
.card {
  position: relative; min-width: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px 22px;
  backdrop-filter: blur(16px);
}
.card-h { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.card-h h2 { margin: 0; font-size: 15px; font-weight: 600; letter-spacing: -0.01em; }
.card-h .sub { margin: 3px 0 0; font-size: 13px; color: var(--muted); }
.link { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; color: var(--muted); white-space: nowrap; transition: color 150ms; }
.link:hover { color: var(--lime); }
.link .icon { width: 15px; height: 15px; }
.empty { padding: 18px 0 6px; color: var(--muted); font-size: 13px; max-width: 46ch; }

/* ── revenue chart ─────────────────────────────────────────────────── */
.big { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-top: 4px; }
.big .val { font-size: 40px; font-weight: 600; letter-spacing: -0.03em; line-height: 1.05; }
.big .cur { font-size: 18px; color: var(--muted); font-weight: 500; margin-left: 2px; }
.delta { display: inline-flex; align-items: center; gap: 3px; height: 24px; padding: 0 8px; border-radius: 8px; font-size: 12px; font-weight: 600; }
.delta.up { background: var(--lime-soft); color: var(--lime); }
.delta.down { background: var(--coral-soft); color: #ff8a7d; }
.delta.flat { background: var(--surface-3); color: var(--muted); }
.delta .icon { width: 13px; height: 13px; stroke-width: 2.2; }
.vs { font-size: 13px; color: var(--muted); }
.chart { position: relative; margin-top: 18px; height: 280px; }
.chart svg { display: block; width: 100%; height: 100%; overflow: visible; }
.chart .grid-l { stroke: var(--line); stroke-width: 1; }
.chart .axis { fill: var(--muted); font-size: 11px; }
.chart .band { fill: rgba(215, 255, 61, 0.045); }
.chart .bar-v { fill: rgba(215, 255, 61, 0.26); }
.chart .bar-v.on { fill: var(--lime); }
.chart .bar-g { fill: none; stroke: rgba(245, 244, 237, 0.5); stroke-width: 1; stroke-dasharray: 3 3; }
.chart .bar-g.dark { stroke: rgba(10, 10, 9, 0.75); stroke-dashoffset: 3; }
.chart .err-bar { fill: var(--coral); }
.chart .cursor { fill: rgba(245, 244, 237, 0.06); }
.tooltip {
  position: absolute; top: 0; pointer-events: none; z-index: 5;
  min-width: 150px; padding: 10px 12px; border-radius: 12px;
  background: rgba(38, 38, 34, 0.96); border: 1px solid var(--line-2);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.45);
  font-size: 12px; color: var(--ink-2); opacity: 0; transition: opacity 120ms;
}
.tooltip b { display: block; font-size: 15px; color: var(--ink); font-weight: 600; margin: 2px 0; }
.tooltip.on { opacity: 1; }
.legend { display: flex; gap: 16px; margin-top: 10px; font-size: 12px; color: var(--muted); flex-wrap: wrap; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }

/* ── now ───────────────────────────────────────────────────────────── */
.now-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 18px; }
.mini { padding: 14px; border-radius: var(--radius-s); background: var(--surface-2); }
.mini .v { font-size: 26px; font-weight: 600; letter-spacing: -0.02em; line-height: 1.1; }
.mini .l { font-size: 12px; color: var(--muted); margin-top: 4px; }
.mini.warn .v { color: var(--amber); }
.mini.live .v { color: var(--lime); }
.subhead { font-size: 12px; font-weight: 600; color: var(--muted); margin: 0 0 10px; }
.prov { display: grid; gap: 14px; }
.prov-row { display: grid; gap: 7px; }
.prov-top { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; font-size: 13px; }
.prov-top b { font-weight: 600; }
.prov-top span { color: var(--muted); font-size: 12px; }
.prov-top .amt { color: var(--ink); font-size: 13px; font-weight: 600; }
.bar { height: 8px; border-radius: 8px; background: var(--surface-3); overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: 8px; background: var(--lime); transform-origin: left; animation: grow 700ms var(--ease) both; }
.bar.warn > i { background: var(--amber); }
.bar.bad > i { background: var(--coral); }
@keyframes grow { from { transform: scaleX(0); } }
.prov-meta { font-size: 12px; color: var(--muted); }
.prov-meta .err { color: #ff8a7d; }

/* ── KPI strip ─────────────────────────────────────────────────────── */
.kpi { display: flex; flex-direction: column; gap: 6px; }
.kpi .k { font-size: 13px; color: var(--muted); font-weight: 500; }
.kpi .v { font-size: 30px; font-weight: 600; letter-spacing: -0.025em; line-height: 1.1; }
.kpi .v small { font-size: 15px; color: var(--muted); font-weight: 500; margin-left: 3px; }
.kpi .foot { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); flex-wrap: wrap; }

/* ── funnel (signature) ────────────────────────────────────────────── */
.funnel { position: relative; }
.funnel { height: 124px; }
.funnel svg { display: block; width: 100%; height: 100%; overflow: visible; }
.funnel .river { fill: url(#gRiver); }
.funnel .river-worst { fill: url(#gWorst); }
@media (prefers-reduced-motion: no-preference) {
  .funnel.reveal svg { animation: river 1100ms var(--ease) both; }
  @keyframes river { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }
}
.funnel .tick { stroke: rgba(10, 10, 9, 0.55); stroke-width: 1.5; }
.steps { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; margin-top: 14px; }
.step { text-align: center; }
.step .sv { font-size: 20px; font-weight: 600; letter-spacing: -0.02em; }
.step .sl { font-size: 12px; color: var(--ink-2); margin-top: 2px; line-height: 1.3; }
.step .sp { font-size: 12px; color: var(--muted); margin-top: 6px; }
.step.worst .sp { color: var(--amber); font-weight: 600; }
.verdict {
  display: flex; align-items: flex-start; gap: 10px; margin-top: 18px; padding: 12px 14px; border-radius: var(--radius-s);
  background: var(--amber-soft); color: #f6d488; font-size: 13px;
}
.verdict .icon { color: var(--amber); margin-top: 1px; }

/* ── lists ─────────────────────────────────────────────────────────── */
.rows { display: grid; }
.row { display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.row:first-child { border-top: 0; padding-top: 2px; }
.ava {
  width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center;
  background: var(--surface-3); color: var(--ink-2); font-size: 12px; font-weight: 600; letter-spacing: 0.02em;
}
.ava.paid { background: var(--lime-soft); color: var(--lime); }
.ava.pend { background: var(--amber-soft); color: var(--amber); }
.ava.err { background: var(--coral-soft); color: #ff8a7d; }
.ava .icon { width: 17px; height: 17px; }
.row .t { font-size: 14px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .m { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .r { text-align: right; font-size: 14px; font-weight: 600; white-space: nowrap; }
.row .r small { display: block; font-size: 12px; font-weight: 500; color: var(--muted); }
.pill { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 7px; font-size: 11px; font-weight: 600; white-space: nowrap; }
.pill.paid, .pill.done, .pill.open { background: var(--lime-soft); color: var(--lime); }
.pill.created, .pill.prepared, .pill.processing, .pill.queued, .pill.in_progress { background: var(--amber-soft); color: var(--amber); }
.pill.cancelled, .pill.closed { background: var(--surface-3); color: var(--muted); }
.pill.error { background: var(--coral-soft); color: #ff8a7d; }

/* ── generations strip ─────────────────────────────────────────────── */
.thumbs { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; }
.thumb { position: relative; aspect-ratio: 3 / 4; border-radius: 12px; overflow: hidden; background: var(--surface-2); }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 400ms var(--ease); }
.thumb:hover img { transform: scale(1.04); }
.thumb .ph { position: absolute; inset: 0; display: grid; place-items: center; padding: 10px; text-align: center; font-size: 11px; color: var(--ink-2); }
.thumb .cap {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 22px 8px 7px;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.82));
  font-size: 11px; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.thumb .pill { position: absolute; top: 7px; left: 7px; }
.errs { display: grid; gap: 8px; margin-top: 18px; }
.err-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: center; font-size: 13px; }
.err-row .why { color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.err-row .cnt { color: #ff8a7d; font-weight: 600; white-space: nowrap; }
.err-row .cnt span { color: var(--muted); font-weight: 400; margin-left: 6px; }

/* ── cost ──────────────────────────────────────────────────────────── */
.split { display: flex; height: 12px; border-radius: 12px; overflow: hidden; background: var(--surface-3); margin: 8px 0 16px; }
.split i { display: block; height: 100%; }
.split .s-ai { background: var(--amber); }
.split .s-m { background: var(--lime); }
.cost-rows { display: grid; gap: 10px; }
.cost-row { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; color: var(--ink-2); }
.cost-row b { color: var(--ink); font-weight: 600; }
.cost-row i { display: inline-block; width: 9px; height: 9px; border-radius: 3px; margin-right: 8px; }
.note { font-size: 12px; color: var(--muted); margin-top: 14px; }

/* ── feed ──────────────────────────────────────────────────────────── */
.feed { display: grid; max-height: 560px; overflow: auto; margin: 0 -8px; padding: 0 8px; }
.ev { display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); align-items: start; }
.ev:first-child { border-top: 0; padding-top: 0; }
.ev .ava { width: 30px; height: 30px; border-radius: 10px; }
.ev .ava .icon { width: 15px; height: 15px; }
.ev .t { font-size: 13px; line-height: 1.4; }
.ev .t b { font-weight: 600; }
.ev .m { font-size: 12px; color: var(--muted); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ev .amt { font-size: 13px; font-weight: 600; color: var(--lime); white-space: nowrap; }

/* ── tables (detail views) ─────────────────────────────────────────── */
.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.toolbar .search { width: min(360px, 100%); }
.table-wrap { overflow-x: auto; margin: 0 -22px; padding: 0 22px; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { text-align: left; font-weight: 500; color: var(--muted); font-size: 12px; padding: 0 12px 10px; white-space: nowrap; border-bottom: 1px solid var(--line); }
td { padding: 12px; border-bottom: 1px solid var(--line); white-space: nowrap; vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
tbody tr { transition: background 120ms; }
tbody tr:hover { background: rgba(245, 244, 237, 0.025); }
th:first-child, td:first-child { padding-left: 0; }
th:last-child, td:last-child { padding-right: 0; }
td.right, th.right { text-align: right; }
td .who { display: flex; align-items: center; gap: 10px; }
td .who .ava { width: 30px; height: 30px; border-radius: 9px; font-size: 11px; }
td .who small { display: block; color: var(--muted); font-size: 12px; }
.muted { color: var(--muted); }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
.gallery .thumb { aspect-ratio: 3 / 4; }
.gallery .err-cap { position: absolute; inset: auto 0 0 0; padding: 8px; font-size: 11px; color: #ffb3aa; background: rgba(40, 10, 8, 0.85); white-space: normal; line-height: 1.3; }
.more { display: flex; justify-content: center; margin-top: 18px; }
.tools { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.tool { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 14px; border-radius: var(--radius-s); background: var(--surface-2); font-size: 13px; }

/* ── skeleton + states ─────────────────────────────────────────────── */
.sk { position: relative; overflow: hidden; background: var(--surface-2); border-radius: 10px; }
.sk::after { content: ''; position: absolute; inset: 0; transform: translateX(-100%); background: linear-gradient(90deg, transparent, rgba(245, 244, 237, 0.05), transparent); animation: shimmer 1.4s infinite; }
@keyframes shimmer { to { transform: translateX(100%); } }
.fail { display: grid; place-items: center; gap: 12px; padding: 60px 20px; text-align: center; color: var(--ink-2); }
.fail .icon { width: 28px; height: 28px; color: var(--coral); }

/* ── login ─────────────────────────────────────────────────────────── */
.login { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.login-card { width: min(420px, 100%); padding: 32px 28px; }
.login-card img { width: 44px; height: 44px; margin-bottom: 22px; }
.login-card h1 { margin: 0 0 8px; font-size: 24px; font-weight: 600; letter-spacing: -0.02em; }
.login-card p { margin: 0 0 22px; color: var(--ink-2); font-size: 14px; }
.field { display: grid; gap: 7px; margin-bottom: 14px; font-size: 13px; color: var(--muted); }
.field input {
  height: 46px; padding: 0 14px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line-2); outline: 0; font-size: 15px; color: var(--ink);
  transition: border-color 160ms;
}
.field input:focus { border-color: var(--lime); }
.login-card .btn { width: 100%; justify-content: center; height: 46px; }
.login-card .alt { margin-top: 10px; }
.form-err { color: #ff8a7d; font-size: 13px; margin: -4px 0 14px; }
.login-lang { position: fixed; top: 16px; right: 16px; }

/* ── motion: one moment, the page settling in ──────────────────────── */
@media (prefers-reduced-motion: no-preference) {
  .rise { animation: rise 520ms var(--ease) both; }
  @keyframes rise { from { opacity: 0.001; transform: translateY(8px); } }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; animation-iteration-count: 1 !important; transition-duration: 1ms !important; }
}

/* ── responsive ────────────────────────────────────────────────────── */
@media (max-width: 1360px) {
  .thumbs { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .thumbs .thumb:nth-child(n + 9) { display: none; }
}
@media (max-width: 1200px) {
  .s8, .s7, .s6, .s5, .s4 { grid-column: span 12; }
  .s3 { grid-column: span 6; }
  .now-wrap { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
  .now-stats { margin-bottom: 0; }
}
@media (max-width: 860px) {
  .steps { grid-template-columns: repeat(4, minmax(0, 1fr)); row-gap: 14px; }
}
@media (max-width: 760px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .rail {
    position: fixed; top: auto; bottom: 0; left: 0; right: 0; height: auto;
    flex-direction: row; justify-content: space-around; padding: 8px 8px calc(8px + env(safe-area-inset-bottom));
    border-right: 0; border-top: 1px solid var(--line);
  }
  .rail-mark, .rail .spacer, .rail .r-extra { display: none; }
  .rail a { width: auto; min-width: 58px; height: 50px; padding: 4px 6px 2px; display: flex; flex-direction: column; gap: 3px; align-items: center; justify-content: center; }
  .rail .tip { display: none; }
  .rail .lbl { display: block; font-size: 10px; font-weight: 500; white-space: nowrap; }
  .rail .dot { top: 4px; right: 14px; }
  .main { padding: 16px 16px 96px; }
  .top { gap: 10px; margin-bottom: 20px; }
  .crumbs { flex: 1 1 0; flex-wrap: wrap; row-gap: 6px; order: 0; }
  .top [data-act='refresh'] { order: 1; margin-left: auto; padding: 0 10px; }
  .top .seg { order: 6; }
  .top .search { order: 5; width: 100%; }
  .top .stamp { font-size: 11px; }
  .hello h1 { font-size: 24px; }
  .hello p { font-size: 14px; }
  .grid { gap: 12px; }
  .s3 { grid-column: span 6; }
  .card { padding: 16px; }
  .big .val { font-size: 32px; }
  .chart { height: 220px; }
  .card-h { flex-wrap: wrap; }
  .card-h > .seg { max-width: 100%; overflow-x: auto; }
  .big .vs { width: 100%; }
  .now-wrap { grid-template-columns: 1fr; gap: 18px; }
  .kpi .v { font-size: 24px; }
  .thumbs { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .thumbs .thumb:nth-child(n + 7) { display: none; }
  .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .funnel { height: 96px; }
  .funnel .tick { display: none; }
  .table-wrap { margin: 0 -16px; padding: 0 16px; }
}
@media (max-width: 420px) {
  .s3 { grid-column: span 12; }
  .seg button { padding: 0 9px; }
}
