/* =====================================================================
   Almost Normal workspace
   Dark by default, light on request. Every colour is a token below.
   ===================================================================== */

:root {
  --serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --sans: Archivo, "Helvetica Neue", Arial, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --ease: cubic-bezier(0.22, 0.7, 0.3, 1);
  --spring: cubic-bezier(0.2, 0.9, 0.25, 1.05);
  --r-sm: 10px; --r-md: 14px; --r-lg: 18px; --r-xl: 22px;
  --side-w: 236px;
}
[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0A121C;
  --bg-2: #0C1622;
  --surface: #0F1A28;
  --surface-2: #142233;
  --surface-3: #1A2B40;
  --line: rgba(232, 226, 214, 0.075);
  --line-2: rgba(232, 226, 214, 0.13);
  --text: #EDEAE3;
  --text-2: #B9C0C9;
  --text-3: #7D8997;
  --accent: #CDAA6E;
  --accent-2: #E0CDA6;
  --accent-ink: #0C1724;
  --accent-soft: rgba(205, 170, 110, 0.12);
  --ok: #7FC29B;  --ok-soft: rgba(127, 194, 155, 0.12);
  --warn: #E3AA5B; --warn-soft: rgba(227, 170, 91, 0.13);
  --bad: #EA8A70; --bad-soft: rgba(234, 138, 112, 0.13);
  --info: #8EAEDD; --info-soft: rgba(142, 174, 221, 0.13);
  --violet: #B3A4E6; --violet-soft: rgba(179, 164, 230, 0.13);
  --shadow: 0 1px 0 rgba(255,255,255,0.025) inset, 0 18px 40px rgba(0,0,0,0.28);
  --shadow-pop: 0 24px 70px rgba(0,0,0,0.55), 0 0 0 1px rgba(232,226,214,0.08);
  --glass: rgba(12, 22, 34, 0.72);
  --scrim: rgba(3, 8, 14, 0.58);
  --spark-fill: rgba(205, 170, 110, 0.14);
}
[data-theme="light"] {
  color-scheme: light;
  --bg: #F3F1EC;
  --bg-2: #EDEAE3;
  --surface: #FCFCFA;
  --surface-2: #F5F3EE;
  --surface-3: #ECE8E0;
  --line: rgba(12, 23, 36, 0.085);
  --line-2: rgba(12, 23, 36, 0.15);
  --text: #0C1724;
  --text-2: #3A4552;
  --text-3: #6B7683;
  --accent: #8A6A38;
  --accent-2: #BC9960;
  --accent-ink: #FCFCFA;
  --accent-soft: rgba(138, 106, 56, 0.10);
  --ok: #2F7A4E;  --ok-soft: rgba(47, 122, 78, 0.10);
  --warn: #A3650F; --warn-soft: rgba(163, 101, 15, 0.10);
  --bad: #B4452D; --bad-soft: rgba(180, 69, 45, 0.09);
  --info: #2F5F9E; --info-soft: rgba(47, 95, 158, 0.09);
  --violet: #5B4BA8; --violet-soft: rgba(91, 75, 168, 0.09);
  --shadow: 0 1px 2px rgba(12,23,36,0.04), 0 10px 30px rgba(12,23,36,0.06);
  --shadow-pop: 0 24px 70px rgba(12,23,36,0.20), 0 0 0 1px rgba(12,23,36,0.06);
  --glass: rgba(250, 249, 246, 0.78);
  --scrim: rgba(12, 23, 36, 0.32);
  --spark-fill: rgba(138, 106, 56, 0.10);
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body.ws {
  background: var(--bg); color: var(--text);
  font-family: var(--sans); font-size: 14px; line-height: 1.5;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  overflow: hidden;
}
:where(.ws) button { font: inherit; color: inherit; }
:where(.ws) a { color: inherit; }
:where(.ws) :is(h1, h2, h3, h4, p) { margin: 0; }
.ws :focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.ws svg { flex: none; }
::selection { background: var(--accent-soft); }

/* quiet scrollbars */
.ws * { scrollbar-width: thin; scrollbar-color: var(--line-2) transparent; }
.ws *::-webkit-scrollbar { width: 10px; height: 10px; }
.ws *::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 10px; border: 3px solid transparent; background-clip: content-box; }

/* ---------------------------------------------------------------- demo strip */
.ws-demo {
  height: 38px; display: flex; align-items: center; gap: 10px; padding: 0 16px;
  background: var(--bg-2); border-bottom: 1px solid var(--line); font-size: 12.5px; color: var(--text-3);
  position: relative; z-index: 5;
}
.ws-demo__mark { color: var(--accent); display: inline-flex; }
.ws-demo__name { color: var(--text); font-weight: 500; }
.ws-demo__pill { font-family: var(--mono); font-size: 9.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--accent); border: 1px solid color-mix(in srgb, var(--accent) 45%, transparent); border-radius: 99px; padding: 1px 8px; }
.ws-demo__note { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.ws-demo__end { margin-left: auto; display: flex; gap: 16px; flex: none; }
.ws-demo__link { text-decoration: none; color: var(--text-2); display: inline-flex; align-items: center; gap: 5px; transition: color .2s var(--ease); }
.ws-demo__link:hover { color: var(--text); }
.only-embed { display: none !important; }
.is-embed .only-embed { display: inline-flex !important; }
.is-embed .no-embed { display: none !important; }
@media (max-width: 700px) { .ws-demo__note { display: none; } }

/* ---------------------------------------------------------------- app frame */
.ws-app { display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); height: calc(100vh - 38px); height: calc(100dvh - 38px); transition: grid-template-columns .35s var(--ease); }
.ws-app.is-collapsed { grid-template-columns: 72px minmax(0, 1fr); }

.ws-side { background: var(--bg-2); border-right: 1px solid var(--line); display: flex; flex-direction: column; padding: 18px 12px 14px; min-width: 0; overflow: hidden; }
.ws-brand { display: flex; align-items: center; gap: 10px; padding: 4px 10px 18px; text-decoration: none; white-space: nowrap; }
.ws-brand__mark { color: var(--accent); display: inline-flex; transition: transform .6s var(--spring); }
.ws-brand:hover .ws-brand__mark { transform: translateY(-2px) scaleY(1.08); }
.ws-brand__name { font-family: var(--serif); font-size: 19px; letter-spacing: -0.015em; color: var(--text); transition: opacity .2s var(--ease); }
.ws-nav { display: flex; flex-direction: column; gap: 2px; }
.ws-nav__sep { height: 1px; background: var(--line); margin: 10px 10px; }
.ws-nav__a {
  position: relative; display: flex; align-items: center; gap: 12px; padding: 9px 11px; border-radius: 10px;
  color: var(--text-2); text-decoration: none; white-space: nowrap; font-size: 13.5px;
  transition: background .18s var(--ease), color .18s var(--ease);
}
.ws-nav__a svg { width: 18px; height: 18px; color: var(--text-3); transition: color .18s var(--ease); }
.ws-nav__a:hover { background: var(--surface-2); color: var(--text); }
.ws-nav__a[aria-current="page"] { background: var(--surface-2); color: var(--text); }
.ws-nav__a[aria-current="page"] svg { color: var(--accent); }
.ws-nav__a[aria-current="page"]::before { content: ""; position: absolute; left: -12px; top: 9px; bottom: 9px; width: 3px; border-radius: 0 3px 3px 0; background: var(--accent); }
.ws-nav__badge { margin-left: auto; font-family: var(--mono); font-size: 10.5px; color: var(--text-3); background: var(--surface-3); border-radius: 99px; padding: 1px 7px; }
.ws-nav__badge.is-hot { color: var(--bad); background: var(--bad-soft); }
.ws-side__foot { margin-top: auto; padding: 10px 6px 0; }
.ws-clock { border: 1px solid var(--line); border-radius: 12px; padding: 11px 12px; display: grid; gap: 7px; font-size: 12px; color: var(--text-3); }
.ws-clock div { display: flex; justify-content: space-between; gap: 8px; white-space: nowrap; }
.ws-clock b { font-family: var(--mono); font-weight: 500; color: var(--text); font-size: 12px; }
.ws-clock i { font-style: normal; display: inline-flex; align-items: center; gap: 6px; }
.ws-clock i::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 3px var(--ok-soft); }
.ws-clock i.is-closed::before { background: var(--text-3); box-shadow: none; }
.is-collapsed .ws-brand__name, .is-collapsed .ws-nav__a span, .is-collapsed .ws-nav__badge, .is-collapsed .ws-clock { display: none; }
.is-collapsed .ws-nav__a { justify-content: center; padding: 10px; }
.is-collapsed .ws-brand { justify-content: center; padding-inline: 0; }

.ws-main { min-width: 0; display: flex; flex-direction: column; overflow: hidden; position: relative; }
.ws-top { height: 60px; flex: none; display: flex; align-items: center; gap: 12px; padding: 0 22px 0 14px; border-bottom: 1px solid var(--line); background: var(--glass); backdrop-filter: saturate(160%) blur(14px); -webkit-backdrop-filter: saturate(160%) blur(14px); position: relative; z-index: 4; }
.ws-crumbs { display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--text-3); min-width: 0; white-space: nowrap; overflow: hidden; }
.ws-crumbs a { text-decoration: none; transition: color .15s; }
.ws-crumbs a:hover { color: var(--text); }
.ws-crumbs b { font-weight: 500; color: var(--text); overflow: hidden; text-overflow: ellipsis; }
.ws-crumbs svg { width: 12px; height: 12px; opacity: .6; }
.ws-top__end { margin-left: auto; display: flex; align-items: center; gap: 8px; flex: none; }
.ws-ibtn { appearance: none; width: 36px; height: 36px; border-radius: 10px; border: 1px solid transparent; background: none; display: inline-grid; place-items: center; cursor: pointer; color: var(--text-2); position: relative; transition: background .18s var(--ease), color .18s var(--ease), border-color .18s; }
.ws-ibtn:hover { background: var(--surface-2); color: var(--text); }
.ws-ibtn svg { width: 18px; height: 18px; }
.ws-ibtn .dot { position: absolute; top: 7px; right: 8px; width: 7px; height: 7px; border-radius: 50%; background: var(--bad); box-shadow: 0 0 0 2px var(--bg); }
.ws-search { appearance: none; display: inline-flex; align-items: center; gap: 9px; height: 36px; padding: 0 8px 0 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--text-3); cursor: pointer; min-width: 210px; transition: border-color .18s var(--ease), color .18s; }
.ws-search:hover { border-color: var(--line-2); color: var(--text-2); }
.ws-search__ico svg { width: 15px; height: 15px; display: block; }
.ws-search__txt { font-size: 13px; }
.ws-search kbd { margin-left: auto; font-family: var(--mono); font-size: 10.5px; border: 1px solid var(--line-2); border-radius: 6px; padding: 1px 6px; color: var(--text-3); }
.ws-org { appearance: none; display: inline-flex; align-items: center; gap: 9px; height: 36px; padding: 0 10px 0 6px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; transition: border-color .18s; max-width: 220px; }
.ws-org:hover { border-color: var(--line-2); }
.ws-org__av { width: 24px; height: 24px; border-radius: 7px; display: grid; place-items: center; font-family: var(--serif); font-size: 13px; color: var(--accent-ink); background: var(--accent); flex: none; }
.ws-org__name { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ws-org svg { width: 12px; height: 12px; color: var(--text-3); }
@media (max-width: 980px) { .ws-search { min-width: 0; } .ws-search__txt, .ws-search kbd { display: none; } }
@media (max-width: 760px) {
  .ws-app, .ws-app.is-collapsed { grid-template-columns: minmax(0, 1fr); }
  .ws-side { position: fixed; z-index: 40; top: 0; bottom: 0; left: 0; width: 270px; transform: translateX(-102%); transition: transform .35s var(--ease); box-shadow: var(--shadow-pop); }
  .ws-app.is-open .ws-side { transform: none; }
  .is-collapsed .ws-brand__name, .is-collapsed .ws-nav__a span, .is-collapsed .ws-nav__badge, .is-collapsed .ws-clock { display: revert; }
  .is-collapsed .ws-nav__a { justify-content: flex-start; padding: 9px 11px; }
  .ws-org__name { display: none; }
  .ws-top { padding: 0 12px 0 8px; gap: 6px; }
}
.ws-scrim { position: fixed; inset: 0; background: var(--scrim); z-index: 35; animation: fade .25s var(--ease); }

/* ---------------------------------------------------------------- views */
.ws-view { flex: 1; overflow-y: auto; overflow-x: hidden; padding: 30px clamp(16px, 3vw, 40px) 120px; outline: none; scroll-behavior: smooth; }
.v { max-width: 1320px; margin: 0 auto; display: flex; flex-direction: column; gap: 18px; }
.v-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px 24px; flex-wrap: wrap; margin-bottom: 4px; }
.v-eyebrow { font-family: var(--mono); font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--text-3); margin-bottom: 10px; display: flex; align-items: center; gap: 8px; }
.v-eyebrow svg { width: 14px; height: 14px; color: var(--accent); }
.v-title { font-family: var(--serif); font-weight: 300; font-size: clamp(30px, 3.4vw, 42px); letter-spacing: -0.025em; line-height: 1.08; }
.v-sub { color: var(--text-2); margin-top: 8px; font-size: 14.5px; max-width: 64ch; }
.v-sub a, .v-sub button.lnk { color: var(--bad); }
.v-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.back { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; color: var(--text-3); text-decoration: none; margin-bottom: 14px; transition: color .15s, gap .2s var(--ease); }
.back:hover { color: var(--text); gap: 10px; }
.back svg { width: 14px; height: 14px; }

/* entrance */
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.anim { animation: rise .55s var(--ease) backwards; animation-delay: calc(var(--i, 0) * 45ms); }

/* grids */
.g { display: grid; gap: 16px; }
.g-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g-21 { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); }
.g-12 { grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr); }
@media (max-width: 1180px) { .g-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g-21, .g-12 { grid-template-columns: 1fr; } }
@media (max-width: 860px) { .g-3, .g-2 { grid-template-columns: 1fr; } }
@media (max-width: 520px) { .g-4 { grid-template-columns: 1fr 1fr; gap: 10px; } }

/* ---------------------------------------------------------------- cards */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 20px 22px; min-width: 0; box-shadow: var(--shadow); position: relative; }
.card--flush { padding: 0; overflow: hidden; }
.card--dark { background: #0B1520; border-color: rgba(232,226,214,.08); color: #EDEAE3; }
.card__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.card__title { display: flex; align-items: center; gap: 9px; font-size: 14px; font-weight: 500; }
.card__title svg { width: 16px; height: 16px; color: var(--text-3); }
.card--dark .card__title svg { color: #7D8997; }
.card__meta { font-size: 12.5px; color: var(--text-3); display: flex; align-items: center; gap: 14px; }
.lnk { appearance: none; background: none; border: 0; padding: 0; cursor: pointer; color: var(--accent); text-decoration: none; font-size: 13px; display: inline-flex; align-items: center; gap: 5px; transition: gap .2s var(--ease), color .15s; }
.lnk:hover { gap: 8px; }
.lnk svg { width: 12px; height: 12px; }
.card--click { cursor: pointer; transition: transform .35s var(--ease), border-color .2s, box-shadow .35s var(--ease); }
.card--click:hover { transform: translateY(-2px); border-color: var(--line-2); }

/* KPI */
.kpi__k { font-family: var(--mono); font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--text-3); display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.kpi__k svg { width: 15px; height: 15px; opacity: .8; }
.kpi__row { display: flex; align-items: baseline; gap: 10px; margin-top: 14px; flex-wrap: wrap; }
.kpi__v { font-family: var(--serif); font-weight: 300; font-size: clamp(34px, 3.2vw, 44px); letter-spacing: -0.03em; line-height: 1; font-variant-numeric: tabular-nums; }
.kpi__v small { font-size: .5em; letter-spacing: 0; margin-left: 3px; color: var(--text-2); }
.kpi__n { font-size: 12.5px; color: var(--text-3); margin-top: 10px; }
.delta { font-family: var(--mono); font-size: 11.5px; display: inline-flex; align-items: center; gap: 3px; }
.delta svg { width: 11px; height: 11px; }
.delta.up { color: var(--ok); } .delta.down { color: var(--bad); } .delta.flat { color: var(--text-3); }
.spark { display: block; width: 100%; height: 54px; margin-top: 14px; overflow: visible; }
.spark path.l { fill: none; stroke: var(--accent); stroke-width: 1.6; stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; stroke-dasharray: 1; stroke-dashoffset: 1; animation: draw 1.2s var(--ease) .15s forwards; }
.spark path.a { fill: var(--spark-fill); opacity: 0; animation: fade .8s var(--ease) .6s forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.meter { height: 6px; border-radius: 6px; background: var(--surface-3); overflow: hidden; margin-top: 18px; position: relative; }
.meter > span { display: block; height: 100%; border-radius: 6px; background: var(--accent); transform-origin: left; animation: grow 1s var(--ease) .2s both; }
.meter > i { position: absolute; top: -3px; bottom: -3px; width: 2px; background: var(--text-2); border-radius: 2px; }
@keyframes grow { from { transform: scaleX(0); } to { transform: none; } }
.meter-legend { display: flex; justify-content: space-between; gap: 8px; margin-top: 9px; font-size: 12px; color: var(--text-3); }

/* compare bars (days to customer) */
.cmp { display: grid; gap: 10px; margin-top: 16px; }
.cmp__r { display: grid; grid-template-columns: 74px 1fr 52px; gap: 10px; align-items: center; font-size: 12px; color: var(--text-3); }
.cmp__t { height: 8px; border-radius: 8px; background: var(--surface-3); overflow: hidden; }
.cmp__t span { display: block; height: 100%; border-radius: 8px; transform-origin: left; animation: grow 1.1s var(--ease) .25s both; }
.cmp__r b { font-family: var(--mono); font-weight: 500; color: var(--text); text-align: right; }

/* ---------------------------------------------------------------- buttons, inputs */
.btn { appearance: none; display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 38px; padding: 0 16px; border-radius: 11px; border: 1px solid var(--line-2); background: var(--surface); color: var(--text); font-size: 13.5px; font-weight: 500; cursor: pointer; text-decoration: none; white-space: nowrap; transition: background .18s var(--ease), border-color .18s, transform .15s var(--ease), box-shadow .2s; }
.btn:hover { border-color: var(--text-3); }
.btn:active { transform: scale(.98); }
.btn svg { width: 15px; height: 15px; }
.btn--primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn--primary:hover { background: var(--accent-2); border-color: var(--accent-2); }
.btn--ghost { background: none; border-color: transparent; color: var(--text-2); }
.btn--ghost:hover { background: var(--surface-2); border-color: transparent; color: var(--text); }
.btn--sm { height: 30px; padding: 0 11px; font-size: 12.5px; border-radius: 9px; }
.btn--icon { width: 32px; padding: 0; height: 32px; border-radius: 9px; }
.btn[disabled] { opacity: .45; pointer-events: none; }

.seg { display: inline-flex; padding: 3px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); position: relative; }
.seg button { appearance: none; border: 0; background: none; height: 30px; padding: 0 13px; border-radius: 9px; font-size: 12.5px; color: var(--text-3); cursor: pointer; position: relative; z-index: 1; display: inline-flex; align-items: center; gap: 7px; transition: color .2s var(--ease); }
.seg button:hover { color: var(--text); }
.seg button[aria-pressed="true"] { color: var(--text); }
.seg__thumb { position: absolute; top: 3px; bottom: 3px; border-radius: 9px; background: var(--surface-3); box-shadow: 0 1px 2px rgba(0,0,0,.15); transition: left .35s var(--spring), width .35s var(--spring); z-index: 0; }
.seg .live { width: 6px; height: 6px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 3px var(--ok-soft); animation: pulse 2.2s ease-in-out infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 5px transparent; } }

.input { width: 100%; height: 38px; border-radius: 11px; border: 1px solid var(--line-2); background: var(--surface); color: var(--text); padding: 0 12px; font: inherit; font-size: 13.5px; transition: border-color .18s, box-shadow .18s; }
.input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
textarea.input { height: auto; min-height: 96px; padding: 10px 12px; resize: vertical; line-height: 1.5; }
select.input { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M3 4.5l3 3 3-3' fill='none' stroke='%237D8997' stroke-width='1.4'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; background-size: 12px; padding-right: 30px; }
.searchbox { position: relative; min-width: 240px; flex: 0 1 300px; }
.searchbox svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 15px; height: 15px; color: var(--text-3); pointer-events: none; }
.searchbox .input { padding-left: 36px; }
.field { display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; color: var(--text-2); }
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.toolbar__l, .toolbar__r { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

.tabs { display: inline-flex; gap: 2px; padding: 3px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); flex-wrap: wrap; }
.tabs button { appearance: none; border: 0; background: none; height: 30px; padding: 0 12px; border-radius: 9px; font-size: 12.5px; color: var(--text-3); cursor: pointer; display: inline-flex; align-items: center; gap: 7px; transition: background .2s var(--ease), color .2s; }
.tabs button:hover { color: var(--text); }
.tabs button[aria-pressed="true"] { background: var(--surface); color: var(--text); box-shadow: 0 1px 2px rgba(0,0,0,.12); }
.tabs .n { font-family: var(--mono); font-size: 10.5px; padding: 0 6px; border-radius: 99px; background: var(--surface-3); color: var(--text-3); }
.tabs .n.hot { background: var(--bad-soft); color: var(--bad); }

.switch { appearance: none; width: 38px; height: 22px; border-radius: 22px; background: var(--surface-3); border: 1px solid var(--line-2); position: relative; cursor: pointer; transition: background .25s var(--ease); flex: none; }
.switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: var(--text-2); transition: transform .3s var(--spring), background .25s; }
.switch[aria-checked="true"] { background: var(--accent); border-color: var(--accent); }
.switch[aria-checked="true"]::after { transform: translateX(16px); background: var(--accent-ink); }

/* ---------------------------------------------------------------- chips */
.chip { display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 9px; border-radius: 99px; font-size: 11.5px; white-space: nowrap; background: var(--surface-3); color: var(--text-2); }
.chip::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .85; }
.chip--plain::before { display: none; }
.chip.ok { background: var(--ok-soft); color: var(--ok); }
.chip.warn { background: var(--warn-soft); color: var(--warn); }
.chip.bad { background: var(--bad-soft); color: var(--bad); }
.chip.info { background: var(--info-soft); color: var(--info); }
.chip.violet { background: var(--violet-soft); color: var(--violet); }
.chip.accent { background: var(--accent-soft); color: var(--accent); }
.chip.live::before { animation: pulse 2s ease-in-out infinite; box-shadow: 0 0 0 3px transparent; }
.tag { display: inline-flex; align-items: center; height: 20px; padding: 0 7px; border-radius: 6px; font-family: var(--mono); font-size: 10.5px; letter-spacing: .04em; background: var(--surface-3); color: var(--text-2); }
.prio { font-family: var(--mono); font-size: 10.5px; letter-spacing: .06em; text-transform: uppercase; }
.prio.high { color: var(--bad); } .prio.normal { color: var(--text-3); } .prio.low { color: var(--text-3); opacity: .7; }

/* ---------------------------------------------------------------- tables */
.tbl-wrap { overflow-x: auto; }
.tbl { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13.5px; }
.tbl th { position: sticky; top: 0; z-index: 1; background: var(--surface); text-align: left; font-family: var(--mono); font-weight: 400; font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--text-3); padding: 13px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 13px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tbody tr { transition: background .15s var(--ease); }
.tbl tbody tr.row-click { cursor: pointer; }
.tbl tbody tr.row-click:hover td { background: var(--surface-2); }
.tbl .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tbl th.num { text-align: right; }
.tbl .mono { font-family: var(--mono); font-size: 12.5px; }
.tbl .muted { color: var(--text-3); }
.tbl .strong { font-weight: 500; }
.tbl .nowrap { white-space: nowrap; }
.tbl .id { font-family: var(--mono); font-size: 12.5px; color: var(--text); text-decoration: underline; text-decoration-color: var(--line-2); text-underline-offset: 3px; }
.tbl .acts { text-align: right; white-space: nowrap; }
.tbl-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; border-top: 1px solid var(--line); font-size: 12.5px; color: var(--text-3); }
.empty { padding: 48px 20px; text-align: center; color: var(--text-3); }
.empty svg { width: 28px; height: 28px; margin-bottom: 10px; color: var(--text-3); opacity: .7; }
.prod { display: flex; align-items: center; gap: 12px; min-width: 220px; }
.prod__n { font-weight: 500; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 260px; }
.prod__s { font-family: var(--mono); font-size: 11px; color: var(--text-3); }

/* product glyphs */
.gly { width: 38px; height: 38px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--line); display: grid; place-items: center; flex: none; color: var(--text-2); position: relative; overflow: hidden; }
.gly svg { width: 22px; height: 22px; }
.gly--lg { width: 120px; height: 120px; border-radius: 22px; }
.gly--lg svg { width: 64px; height: 64px; }
.gly i { position: absolute; inset: auto 0 0 0; height: 40%; background: linear-gradient(transparent, color-mix(in srgb, var(--accent) 10%, transparent)); }

/* runway bar */
.runway { display: grid; grid-template-columns: 1fr 48px; gap: 10px; align-items: center; min-width: 150px; }
.runway__t { position: relative; height: 6px; border-radius: 6px; background: var(--surface-3); }
.runway__t span { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 6px; background: var(--ok); }
.runway__t span.warn { background: var(--warn); } .runway__t span.bad { background: var(--bad); }
.runway__t i { position: absolute; top: -4px; bottom: -4px; width: 2px; border-radius: 2px; background: var(--text-3); }
.runway b { font-family: var(--mono); font-weight: 500; font-size: 12px; text-align: right; }

/* order pipeline */
.flow { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); position: relative; padding: 4px 0 2px; }
.flow::before { content: ""; position: absolute; left: 6%; right: 6%; top: 22px; height: 1px; background: var(--line-2); }
.flow__s { appearance: none; border: 0; background: none; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 6px 4px 10px; border-radius: 12px; position: relative; color: var(--text-3); transition: background .2s var(--ease), color .2s; }
.flow__s:hover { background: var(--surface-2); color: var(--text); }
.flow__dot { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--surface); border: 1px solid var(--line-2); position: relative; z-index: 1; transition: border-color .2s, background .2s, transform .3s var(--spring); }
.flow__dot svg { width: 15px; height: 15px; }
.flow__s:hover .flow__dot { transform: scale(1.06); }
.flow__s[aria-pressed="true"] { color: var(--text); }
.flow__s[aria-pressed="true"] .flow__dot { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.flow__n { font-family: var(--serif); font-size: 22px; font-weight: 300; color: var(--text); line-height: 1; font-variant-numeric: tabular-nums; }
.flow__l { font-size: 11.5px; white-space: nowrap; }
@media (max-width: 980px) { .flow { grid-template-columns: repeat(4, minmax(0, 1fr)); row-gap: 8px; } .flow::before { display: none; } }

/* stepper */
.steps { display: flex; align-items: flex-start; gap: 0; position: relative; }
.step { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 9px; position: relative; text-align: center; font-size: 12.5px; color: var(--text-3); }
.step::before { content: ""; position: absolute; top: 13px; left: -50%; right: 50%; height: 2px; background: var(--line-2); }
.step:first-child::before { display: none; }
.step.done::before, .step.now::before { background: var(--accent); }
.step__d { width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--line-2); background: var(--surface); display: grid; place-items: center; position: relative; z-index: 1; transition: all .4s var(--ease); }
.step__d svg { width: 13px; height: 13px; }
.step.done .step__d { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.step.now .step__d { border-color: var(--accent); color: var(--accent); box-shadow: 0 0 0 5px var(--accent-soft); }
.step.done, .step.now { color: var(--text); }
.step small { display: block; font-size: 11.5px; color: var(--text-3); margin-top: 2px; }
@media (max-width: 700px) { .steps { flex-direction: column; gap: 14px; } .step { flex-direction: row; text-align: left; } .step::before { display: none; } }

/* timeline (order drawer) */
.tl { list-style: none; margin: 0; padding: 0; position: relative; }
.tl li { display: grid; grid-template-columns: 22px 1fr; gap: 12px; padding-bottom: 16px; position: relative; }
.tl li::before { content: ""; position: absolute; left: 10px; top: 20px; bottom: 0; width: 1.5px; background: var(--line-2); }
.tl li:last-child::before { display: none; }
.tl li.done::before { background: var(--accent); }
.tl .d { width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid var(--line-2); background: var(--surface); display: grid; place-items: center; }
.tl li.done .d { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.tl li.now .d { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.tl li.now .d::after { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
.tl li.bad .d { border-color: var(--bad); background: var(--bad-soft); color: var(--bad); }
.tl .d svg { width: 11px; height: 11px; }
.tl b { font-weight: 500; display: block; font-size: 13.5px; }
.tl small { color: var(--text-3); font-size: 12px; }
.tl li.todo b { color: var(--text-3); font-weight: 400; }

/* lists */
.list { list-style: none; margin: 0; padding: 0; }
.list > li { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.list > li:first-child { border-top: 0; padding-top: 2px; }
.list .grow { flex: 1; min-width: 0; }
.list .t { font-weight: 500; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list .s { color: var(--text-3); font-size: 12.5px; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list .r { text-align: right; flex: none; }
.list .r b { font-family: var(--serif); font-weight: 400; font-size: 18px; display: block; line-height: 1.1; }
.list .r small { font-size: 11px; color: var(--text-3); }
.list--click > li { cursor: pointer; border-radius: 10px; margin: 0 -10px; padding-left: 10px; padding-right: 10px; transition: background .15s var(--ease); }
.list--click > li:hover { background: var(--surface-2); }
.list--click > li:hover + li, .list--click > li:hover { border-top-color: transparent; }
.rank { width: 20px; height: 20px; border-radius: 6px; display: grid; place-items: center; font-family: var(--mono); font-size: 11px; background: var(--accent-soft); color: var(--accent); flex: none; }
.sev { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.sev.hi { background: var(--bad); box-shadow: 0 0 0 4px var(--bad-soft); }
.sev.mid { background: var(--warn); box-shadow: 0 0 0 4px var(--warn-soft); }
.sev.lo { background: var(--info); box-shadow: 0 0 0 4px var(--info-soft); }

/* best sellers grid */
.best { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 6px 22px; }
.best__i { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; padding: 10px; margin: 0 -10px; border-radius: 12px; cursor: pointer; transition: background .15s var(--ease); position: relative; }
.best__i:hover { background: var(--surface-2); }
.best__i .rank { position: absolute; left: 2px; top: 4px; width: 18px; height: 18px; font-size: 10px; background: var(--accent); color: var(--accent-ink); z-index: 1; }
.best__i b { font-family: var(--serif); font-weight: 400; font-size: 19px; text-align: right; line-height: 1; display: block; }
.best__i small { font-size: 11px; color: var(--text-3); display: block; text-align: right; }

/* issue tiles */
.tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
@media (max-width: 640px) { .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.tile { appearance: none; text-align: left; border: 1px solid var(--line); background: var(--surface-2); border-radius: 14px; padding: 14px; cursor: pointer; display: flex; flex-direction: column; gap: 10px; transition: transform .3s var(--ease), border-color .2s; }
.tile:hover { transform: translateY(-2px); border-color: var(--line-2); }
.tile__top { display: flex; justify-content: space-between; align-items: center; color: var(--text-3); }
.tile__top svg { width: 16px; height: 16px; }
.tile__n { font-family: var(--serif); font-weight: 300; font-size: 30px; line-height: 1; color: var(--text); }
.tile__l { font-size: 12.5px; color: var(--text-2); }
.tile__l small { display: block; color: var(--text-3); font-size: 11.5px; }

/* charts */
.chart { width: 100%; display: block; overflow: visible; }
.chart text { font-family: var(--mono); font-size: 10px; fill: var(--text-3); }
.chart .grid { stroke: var(--line); }
.chart .bar { fill: var(--surface-3); transition: fill .2s; }
.chart .bar.on { fill: var(--accent); }
.chart g.bars rect { transform-origin: bottom; transform-box: fill-box; animation: barup .8s var(--ease) both; }
@keyframes barup { from { transform: scaleY(0); } to { transform: none; } }

.stack { display: flex; height: 8px; border-radius: 8px; overflow: hidden; background: var(--surface-3); min-width: 130px; gap: 2px; }
.stack span { display: block; height: 100%; }
.legend { display: flex; flex-wrap: wrap; gap: 8px 16px; font-size: 12px; color: var(--text-3); }
.legend i { display: inline-block; width: 9px; height: 9px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }

/* key-value */
.kv { display: grid; grid-template-columns: 150px 1fr; gap: 12px 16px; font-size: 13.5px; }
.kv dt { color: var(--text-3); }
.kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.big { font-family: var(--serif); font-weight: 300; font-size: clamp(36px, 4vw, 52px); letter-spacing: -0.03em; line-height: 1; }

/* ---------------------------------------------------------------- home specifics */
.hello { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px 24px; flex-wrap: wrap; }
.hello .v-title { font-size: clamp(34px, 4vw, 50px); }
.globe-card { padding: 0; overflow: hidden; }
.globe-card .card__head { padding: 18px 22px 0; margin-bottom: 0; }
.globe-wrap { position: relative; height: 360px; }
.globe-wrap canvas { position: absolute; inset: 0; width: 100%; height: 100%; cursor: grab; touch-action: none; }
.globe-wrap canvas:active { cursor: grabbing; }
.globe-stats { position: absolute; left: 22px; bottom: 18px; display: grid; gap: 8px; pointer-events: none; }
.globe-stats div { display: flex; align-items: baseline; gap: 10px; font-size: 12px; color: #9AA6B4; }
.globe-stats b { font-family: var(--serif); font-weight: 300; font-size: 28px; color: #EDEAE3; line-height: 1; min-width: 46px; }
.globe-list { position: absolute; right: 18px; top: 58px; display: grid; gap: 6px; font-size: 12px; color: #9AA6B4; pointer-events: none; }
.globe-list span { display: flex; justify-content: space-between; gap: 18px; }
.globe-list b { font-family: var(--mono); font-weight: 500; color: #E0CDA6; }
@media (max-width: 640px) { .globe-list { display: none; } .globe-wrap { height: 300px; } }
.feed { list-style: none; margin: 0; padding: 0; }
.feed li { display: grid; grid-template-columns: 28px 1fr auto; gap: 10px; align-items: start; padding: 9px 0; }
.feed .ic { width: 28px; height: 28px; border-radius: 9px; display: grid; place-items: center; background: var(--surface-2); color: var(--text-3); }
.feed .ic svg { width: 14px; height: 14px; }
.feed b { font-weight: 500; font-size: 13px; }
.feed small { display: block; color: var(--text-3); font-size: 12px; }
.feed time { font-family: var(--mono); font-size: 11px; color: var(--text-3); white-space: nowrap; }
.inb-mini { border: 1px solid var(--line); border-radius: 14px; padding: 14px; background: var(--surface-2); cursor: pointer; transition: border-color .2s, transform .3s var(--ease); }
.inb-mini:hover { border-color: var(--line-2); transform: translateY(-1px); }
.inb-mini + .inb-mini { margin-top: 10px; }
.inb-mini__h { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 12px; }
.inb-mini__h b { font-family: var(--mono); font-weight: 500; font-size: 12.5px; }
.inb-mini__h small { color: var(--text-3); font-size: 12px; }
.mini-steps { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; }
.mini-steps span { height: 4px; border-radius: 4px; background: var(--surface-3); }
.mini-steps span.on { background: var(--accent); }
.mini-steps span.now { background: linear-gradient(90deg, var(--accent) 0 50%, var(--surface-3) 50%); background-size: 200% 100%; animation: shimmer 1.8s linear infinite; }
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: 0 0; } }
.insight { display: flex; gap: 14px; align-items: flex-start; padding: 16px 18px; border-radius: var(--r-lg); border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent); background: linear-gradient(135deg, var(--accent-soft), transparent 70%); }
.insight svg { width: 20px; height: 20px; color: var(--accent); margin-top: 2px; }
.insight b { font-weight: 500; }
.insight p { color: var(--text-2); font-size: 13.5px; margin-top: 3px; }
.insight .btn { margin-left: auto; flex: none; }
@media (max-width: 640px) { .insight { flex-wrap: wrap; } .insight .btn { margin-left: 0; } }

/* ---------------------------------------------------------------- support thread */
.thread { display: flex; flex-direction: column; gap: 14px; }
.msg { max-width: 78%; display: flex; flex-direction: column; gap: 5px; animation: rise .45s var(--ease) both; }
.msg__b { padding: 12px 15px; border-radius: 16px; background: var(--surface-2); border: 1px solid var(--line); font-size: 13.5px; line-height: 1.55; }
.msg__m { font-size: 11.5px; color: var(--text-3); display: flex; gap: 8px; align-items: center; }
.msg__av { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font-size: 10px; font-weight: 600; background: var(--accent); color: var(--accent-ink); }
.msg.me { align-self: flex-end; align-items: flex-end; }
.msg.me .msg__b { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 30%, transparent); }
.composer { display: flex; gap: 10px; align-items: flex-end; border-top: 1px solid var(--line); padding-top: 16px; margin-top: 4px; }
.composer textarea { min-height: 46px; }
.typing { display: inline-flex; gap: 4px; padding: 14px 16px; border-radius: 16px; background: var(--surface-2); border: 1px solid var(--line); align-self: flex-start; }
.typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--text-3); animation: bob 1.2s ease-in-out infinite; }
.typing i:nth-child(2) { animation-delay: .15s; } .typing i:nth-child(3) { animation-delay: .3s; }
@keyframes bob { 0%, 60%, 100% { transform: none; opacity: .5; } 30% { transform: translateY(-4px); opacity: 1; } }

/* services */
.svc { display: flex; flex-direction: column; gap: 12px; }
.svc__ic { width: 44px; height: 44px; border-radius: 13px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.svc__ic svg { width: 22px; height: 22px; }
.svc h3 { font-family: var(--serif); font-weight: 400; font-size: 21px; letter-spacing: -0.01em; }
.svc p { color: var(--text-2); font-size: 13.5px; }
.svc ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 6px; font-size: 13px; color: var(--text-2); }
.svc li { display: flex; gap: 8px; }
.svc li::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: var(--accent); margin-top: 8px; flex: none; }
.svc__f { margin-top: auto; display: flex; justify-content: space-between; align-items: center; gap: 10px; padding-top: 6px; }

/* settings */
.set-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 0; border-top: 1px solid var(--line); }
.set-row:first-of-type { border-top: 0; }
.set-row b { font-weight: 500; display: block; }
.set-row small { color: var(--text-3); font-size: 12.5px; }
.theme-pick { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.theme-pick button { appearance: none; border: 1px solid var(--line-2); background: none; border-radius: 14px; padding: 10px; cursor: pointer; display: flex; flex-direction: column; gap: 10px; text-align: left; font-size: 12.5px; color: var(--text-2); transition: border-color .2s, transform .3s var(--ease); }
.theme-pick button:hover { transform: translateY(-2px); }
.theme-pick button[aria-pressed="true"] { border-color: var(--accent); color: var(--text); box-shadow: 0 0 0 3px var(--accent-soft); }
.theme-pick .sw { height: 70px; border-radius: 9px; overflow: hidden; display: grid; grid-template-columns: 30% 1fr; }
.theme-pick .sw.d { background: #0F1A28; } .theme-pick .sw.d i { background: #0C1622; }
.theme-pick .sw.l { background: #FCFCFA; } .theme-pick .sw.l i { background: #EDEAE3; }
.theme-pick .sw.s { background: linear-gradient(90deg, #0F1A28 50%, #FCFCFA 50%); }
.theme-pick .sw i { display: block; height: 100%; }
.theme-pick .sw span { display: block; margin: 12px; height: 8px; width: 60%; border-radius: 4px; background: #CDAA6E; }
.integ { display: flex; align-items: center; gap: 14px; padding: 12px 0; border-top: 1px solid var(--line); }
.integ:first-child { border-top: 0; }
.integ__l { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--surface-2); border: 1px solid var(--line); font-family: var(--serif); font-size: 15px; color: var(--text-2); flex: none; }
.integ b { font-weight: 500; display: block; }
.integ small { color: var(--text-3); font-size: 12.5px; }
.integ .btn { margin-left: auto; }
.av { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 600; background: var(--surface-3); color: var(--text-2); flex: none; }

/* ---------------------------------------------------------------- overlays */
.drawer-scrim, .modal-scrim, .pal-scrim { position: fixed; inset: 0; background: var(--scrim); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); z-index: 60; animation: fade .25s var(--ease); }
.drawer { position: fixed; top: 10px; right: 10px; bottom: 10px; width: min(520px, calc(100vw - 20px)); background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r-xl); z-index: 61; box-shadow: var(--shadow-pop); display: flex; flex-direction: column; animation: slidein .45s var(--ease) both; }
@keyframes slidein { from { transform: translateX(30px); opacity: 0; } to { transform: none; opacity: 1; } }
.drawer.is-out { animation: slideout .25s var(--ease) both; }
@keyframes slideout { to { transform: translateX(30px); opacity: 0; } }
.drawer__h { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 20px 22px 16px; border-bottom: 1px solid var(--line); }
.drawer__h h2 { font-family: var(--serif); font-weight: 400; font-size: 24px; letter-spacing: -0.015em; }
.drawer__h p { color: var(--text-3); font-size: 12.5px; margin-top: 3px; }
.drawer__b { padding: 20px 22px 26px; overflow-y: auto; display: flex; flex-direction: column; gap: 22px; }
.drawer__f { padding: 14px 22px; border-top: 1px solid var(--line); display: flex; gap: 10px; justify-content: flex-end; }
.sec-t { font-family: var(--mono); font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--text-3); margin-bottom: 12px; }
.modal { position: fixed; left: 50%; top: 9vh; transform: translateX(-50%); width: min(560px, calc(100vw - 24px)); max-height: 82vh; background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r-xl); z-index: 61; box-shadow: var(--shadow-pop); display: flex; flex-direction: column; animation: pop .35s var(--spring) both; }
@keyframes pop { from { opacity: 0; transform: translateX(-50%) translateY(10px) scale(.98); } to { opacity: 1; transform: translateX(-50%); } }
.modal .drawer__b { gap: 14px; }
.x { appearance: none; width: 32px; height: 32px; border-radius: 9px; border: 0; background: none; display: grid; place-items: center; color: var(--text-3); cursor: pointer; flex: none; transition: background .15s, color .15s; }
.x:hover { background: var(--surface-2); color: var(--text); }
.x svg { width: 16px; height: 16px; }

/* popovers */
.pop { position: fixed; z-index: 55; background: var(--surface); border: 1px solid var(--line-2); border-radius: 16px; box-shadow: var(--shadow-pop); animation: popin .25s var(--ease) both; transform-origin: top right; }
@keyframes popin { from { opacity: 0; transform: translateY(-6px) scale(.98); } to { opacity: 1; transform: none; } }
.pop__h { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 14px 16px 10px; }
.pop__h b { font-weight: 500; }
.notes { list-style: none; margin: 0; padding: 4px 8px 8px; max-height: 420px; overflow-y: auto; }
.notes li { display: grid; grid-template-columns: 30px 1fr; gap: 10px; padding: 10px 8px; border-radius: 10px; cursor: pointer; position: relative; transition: background .15s; }
.notes li:hover { background: var(--surface-2); }
.notes li.unread::after { content: ""; position: absolute; right: 10px; top: 16px; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
.notes .ic { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: var(--surface-2); color: var(--text-3); }
.notes .ic svg { width: 15px; height: 15px; }
.notes b { font-weight: 500; font-size: 13px; display: block; padding-right: 16px; }
.notes small { color: var(--text-3); font-size: 12px; }
.orgs { padding: 8px; min-width: 260px; }
.orgs button { appearance: none; width: 100%; border: 0; background: none; display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 10px; cursor: pointer; text-align: left; transition: background .15s; }
.orgs button:hover { background: var(--surface-2); }
.orgs small { display: block; color: var(--text-3); font-size: 11.5px; }
.orgs .chk { margin-left: auto; color: var(--accent); }
.orgs .chk svg { width: 15px; height: 15px; }

/* palette */
.pal { position: fixed; left: 50%; top: 13vh; transform: translateX(-50%); width: min(640px, calc(100vw - 24px)); background: var(--surface); border: 1px solid var(--line-2); border-radius: 20px; box-shadow: var(--shadow-pop); z-index: 61; overflow: hidden; animation: pop .3s var(--spring) both; }
.pal__in { display: flex; align-items: center; gap: 12px; padding: 0 18px; border-bottom: 1px solid var(--line); }
.pal__in svg { width: 18px; height: 18px; color: var(--text-3); }
.pal__in input { flex: 1; height: 58px; border: 0; background: none; color: var(--text); font: inherit; font-size: 16px; outline: none; }
.pal__in kbd { font-family: var(--mono); font-size: 10.5px; border: 1px solid var(--line-2); border-radius: 6px; padding: 2px 6px; color: var(--text-3); }
.pal__r { max-height: 52vh; overflow-y: auto; padding: 8px; }
.pal__g { font-family: var(--mono); font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: var(--text-3); padding: 10px 10px 6px; }
.pal__i { display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: 11px; cursor: pointer; }
.pal__i .ic { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: var(--surface-2); color: var(--text-2); flex: none; }
.pal__i .ic svg { width: 15px; height: 15px; }
.pal__i b { font-weight: 500; font-size: 13.5px; }
.pal__i small { color: var(--text-3); font-size: 12px; margin-left: auto; white-space: nowrap; }
.pal__i.on { background: var(--surface-2); }
.pal__i.on .ic { background: var(--accent); color: var(--accent-ink); }
.pal__foot { display: flex; gap: 16px; padding: 10px 18px; border-top: 1px solid var(--line); font-size: 11.5px; color: var(--text-3); }
.pal__foot kbd { font-family: var(--mono); font-size: 10px; border: 1px solid var(--line-2); border-radius: 5px; padding: 0 5px; margin-right: 4px; }

/* floating pill + chat */
.ws-pill { position: fixed; left: calc(50% + var(--side-w) / 2); bottom: 22px; transform: translateX(-50%); z-index: 30; display: flex; align-items: center; gap: 4px; padding: 5px; border-radius: 99px; background: rgba(10, 18, 28, 0.88); border: 1px solid rgba(232,226,214,.1); box-shadow: 0 16px 40px rgba(0,0,0,.35); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); transition: transform .45s var(--ease), opacity .3s; animation: pillin .6s var(--ease) .6s backwards; }
@keyframes pillin { from { opacity: 0; transform: translate(-50%, 16px); } to { opacity: 1; transform: translate(-50%, 0); } }
.is-collapsed ~ .ws-pill, .ws-app.is-collapsed + .ws-pill { left: calc(50% + 36px); }
.ws-pill.is-hidden { transform: translateX(-50%) translateY(140%); opacity: 0; }
.ws-pill__tour, .ws-pill__talk { appearance: none; border: 0; display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 16px; border-radius: 99px; font-size: 13.5px; font-weight: 500; cursor: pointer; text-decoration: none; transition: background .2s var(--ease); }
.ws-pill__tour { background: none; color: #EDEAE3; }
.ws-pill__tour:hover { background: rgba(255,255,255,.07); }
.ws-pill__talk { background: #E0CDA6; color: #0C1724; }
.ws-pill__talk:hover { background: #F0E3C8; }
@media (max-width: 760px) { .ws-pill { left: 50%; bottom: 14px; } .ws-pill__tour, .ws-pill__talk { height: 34px; padding: 0 13px; font-size: 12.5px; } }

.chat-b { position: fixed; right: 22px; bottom: 22px; width: 50px; height: 50px; border-radius: 50%; border: 0; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; cursor: pointer; z-index: 31; box-shadow: 0 14px 34px rgba(0,0,0,.35); transition: transform .35s var(--spring); animation: rise .6s var(--ease) .8s backwards; }
.chat-b:hover { transform: scale(1.06); }
.chat-b svg { width: 21px; height: 21px; }
.chat { position: fixed; right: 22px; bottom: 84px; width: min(370px, calc(100vw - 28px)); height: min(520px, calc(100vh - 140px)); background: var(--surface); border: 1px solid var(--line-2); border-radius: 22px; z-index: 32; box-shadow: var(--shadow-pop); display: flex; flex-direction: column; overflow: hidden; transform-origin: bottom right; animation: chatin .4s var(--spring) both; }
@keyframes chatin { from { opacity: 0; transform: translateY(12px) scale(.96); } to { opacity: 1; transform: none; } }
.chat__h { padding: 18px 18px 16px; background: #0B1520; color: #EDEAE3; display: flex; gap: 12px; align-items: center; }
.chat__h .av { background: #CDAA6E; color: #0C1724; }
.chat__h b { font-weight: 500; display: block; }
.chat__h small { color: #9AA6B4; font-size: 12px; display: flex; align-items: center; gap: 6px; }
.chat__h small::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: #7FC29B; }
.chat__h .x { margin-left: auto; color: #9AA6B4; }
.chat__h .x:hover { background: rgba(255,255,255,.07); color: #fff; }
.chat__b { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.chat__b .msg { max-width: 88%; }
.chat__q { display: flex; flex-wrap: wrap; gap: 6px; }
.chat__q button { appearance: none; border: 1px solid var(--line-2); background: none; border-radius: 99px; padding: 6px 11px; font-size: 12px; color: var(--text-2); cursor: pointer; transition: border-color .15s, color .15s; }
.chat__q button:hover { border-color: var(--accent); color: var(--text); }
.chat__f { display: flex; gap: 8px; padding: 12px; border-top: 1px solid var(--line); }
.chat__f .btn { width: 38px; padding: 0; }

/* tour */
.tour-spot { position: fixed; z-index: 70; border-radius: 18px; box-shadow: 0 0 0 9999px rgba(3, 8, 14, 0.6), 0 0 0 2px var(--accent); pointer-events: none; transition: all .5s var(--ease); }
[data-theme="light"] .tour-spot { box-shadow: 0 0 0 9999px rgba(12, 23, 36, 0.42), 0 0 0 2px var(--accent); }
.tour-spot::after { content: ""; position: absolute; top: -6px; right: -6px; width: 12px; height: 12px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); animation: pulse 2s ease-in-out infinite; }
.tour-blocker { position: fixed; inset: 0; z-index: 69; }
.tour-pop { position: fixed; z-index: 71; width: min(340px, calc(100vw - 24px)); background: var(--surface); border: 1px solid var(--line-2); border-radius: 18px; box-shadow: var(--shadow-pop); padding: 18px 18px 16px; transition: top .5s var(--ease), left .5s var(--ease); animation: pop2 .35s var(--spring) both; }
@keyframes pop2 { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.tour-pop__n { font-family: var(--mono); font-size: 11px; color: var(--accent); display: flex; justify-content: space-between; align-items: center; }
.tour-dash { display: grid; grid-auto-flow: column; gap: 4px; margin: 10px 0 14px; }
.tour-dash i { height: 3px; border-radius: 3px; background: var(--surface-3); transition: background .3s; }
.tour-dash i.on { background: var(--accent); }
.tour-pop h3 { font-family: var(--serif); font-weight: 400; font-size: 20px; letter-spacing: -0.01em; }
.tour-pop p { color: var(--text-2); font-size: 13.5px; margin-top: 6px; }
.tour-pop__f { display: flex; justify-content: space-between; align-items: center; margin-top: 16px; }

/* toast */
.ws-toast { position: fixed; left: 50%; top: 20px; transform: translate(-50%, -20px); background: var(--text); color: var(--bg); padding: 11px 16px 11px 14px; border-radius: 14px; font-size: 13.5px; box-shadow: var(--shadow-pop); opacity: 0; pointer-events: none; z-index: 90; display: flex; align-items: center; gap: 10px; transition: opacity .25s var(--ease), transform .35s var(--spring); max-width: calc(100vw - 24px); }
.ws-toast.is-on { opacity: 1; transform: translate(-50%, 0); }
.ws-toast svg { width: 16px; height: 16px; color: var(--ok); }
[data-theme="light"] .ws-toast svg { color: #7FC29B; }

/* tooltip */
[data-tip]:hover::after { content: attr(data-tip); position: absolute; top: calc(100% + 8px); left: 50%; transform: translateX(-50%); background: var(--text); color: var(--bg); font-size: 11.5px; padding: 4px 8px; border-radius: 7px; white-space: nowrap; pointer-events: none; animation: fade .2s .4s both; z-index: 5; }

/* theme switch: the new theme opens out of the toggle (View Transitions) */
::view-transition-old(root), ::view-transition-new(root) { animation: none; mix-blend-mode: normal; }
::view-transition-new(root) { animation: reveal .6s var(--ease); }
@keyframes reveal { from { clip-path: circle(0 at var(--vx, 100%) var(--vy, 0)); } to { clip-path: circle(var(--vr, 150vmax) at var(--vx, 100%) var(--vy, 0)); } }
html.theme-fade, html.theme-fade * { transition: background-color .35s var(--ease), border-color .35s var(--ease), color .35s var(--ease) !important; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-delay: 0ms !important; transition-duration: .01ms !important; }
  .spark path.l { stroke-dashoffset: 0; }
}
.list > li > svg.chev { width: 16px; height: 16px; color: var(--text-3); transition: transform .25s var(--ease), color .2s; }
.list--click > li:hover > svg.chev { transform: translateX(3px); color: var(--text); }
.g-3 .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.ws-pill__tour, .ws-pill__talk { white-space: nowrap; }
@media (max-width: 560px) {
  .g-4 { grid-template-columns: 1fr; }
  .kpi .spark { height: 44px; }
  .ws-pill { bottom: 12px; }
  .chat-b { bottom: 12px; right: 14px; width: 46px; height: 46px; }
}

.ws-demo__x { appearance: none; width: 28px; height: 28px; margin-left: 6px; border-radius: 8px; border: 1px solid var(--line); background: transparent; color: var(--text-2); display: grid; place-items: center; cursor: pointer; transition: background .2s, color .2s; }
.ws-demo__x:hover { background: var(--surface-2); color: var(--text); }
.is-embed .ws-demo__x.only-embed { display: grid !important; }
.tbl--landed th { white-space: normal; line-height: 1.35; vertical-align: bottom; }
.tbl--landed td .stack { min-width: 90px; }
.tbl--landed th { white-space: normal; line-height: 1.35; vertical-align: bottom; max-width: 96px; }
.tbl .id { white-space: nowrap; }
@media (max-width: 760px) {
  .drawer__f { flex-wrap: wrap; }
  .drawer__f .btn { flex: 1 1 auto; justify-content: center; }
}
