/* Drook Studio v2. True black, rounded glass, white light as the only accent.
   DESIGN.md is the contract for every token and class in this file. */

@font-face { font-family: 'Satoshi'; src: url('/fonts/satoshi-400.woff2') format('woff2'); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: 'Satoshi'; src: url('/fonts/satoshi-500.woff2') format('woff2'); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: 'Satoshi'; src: url('/fonts/satoshi-700.woff2') format('woff2'); font-weight: 700; font-style: normal; font-display: swap; }

@property --ang { syntax: '<angle>'; inherits: false; initial-value: 0deg; }
@property --ld-r { syntax: '<length>'; inherits: false; initial-value: 0px; }

/* ================================================================ tokens */

:root {
  /* surfaces, darkest to lightest */
  --bg: #000;
  --s0: #050506;
  --s1: #0b0b0c;
  --s2: #131315;
  --s3: #1b1b1e;
  --s4: #242428;
  /* ink */
  --ink: #f5f5f7;
  --ink2: rgba(245, 245, 247, .72);
  --ink3: rgba(245, 245, 247, .66); /* about 7.4:1 on black, 7:1 on s3: readable helper text */
  /* hairlines and light */
  --ring: rgba(255, 255, 255, .10);
  --ring2: rgba(255, 255, 255, .20);
  --ring3: rgba(255, 255, 255, .34);
  --hi: rgba(255, 255, 255, .07);
  --glow: rgba(255, 255, 255, .16);
  --light: #fff;
  --light-a: rgba(255, 255, 255, .55);
  /* the one inverted panel */
  --paper: #f4f4f5;
  --paper-ink: #0b0b0c;
  --paper-ink2: rgba(11, 11, 12, .70);
  --paper-ring: rgba(0, 0, 0, .12);
  /* accent = white light */
  --accent: #fff;
  --accent-ink: #000;
  /* status: words + icons first; the only hue is the online light */
  --online: #4ade80;
  --danger-ink: #ffb4ab;
  --paper-danger: #a3261b;
  /* glass recipe */
  --glass: linear-gradient(180deg, rgba(255,255,255,.055), rgba(255,255,255,.012) 46%, rgba(255,255,255,.008));
  --glass-bg: rgba(11, 11, 12, .72);
  --glass-blur: blur(1.1579rem) saturate(140%);
  --edge: inset 0 0 0 1px var(--ring), inset 0 1px 0 rgba(255,255,255,.07);
  --shadow: 0 1px 0 rgba(255,255,255,.06) inset, 0 1.0526rem 2.6316rem -1.2632rem rgba(0,0,0,.9);
  --e1: 0 1px 0 rgba(255,255,255,.05) inset, 0 0.9474rem 2.1053rem -1.4737rem rgba(0,0,0,.95);
  --e2: 0 1.5789rem 4.2105rem -1.5789rem rgba(0,0,0,.95), 0 0 0 1px rgba(0,0,0,.6);
  --e3: 0 2.6316rem 7.3684rem -1.5789rem #000;
  /* charts */
  --cx-line: #fff;
  --cx-area-a: rgba(255, 255, 255, .26);
  --cx-area-b: rgba(255, 255, 255, 0);
  --cx-prev: rgba(255, 255, 255, .42);
  --cx-grid: rgba(255, 255, 255, .07);
  --cx-bar: rgba(255, 255, 255, .9);

  /* radii */
  --r-xl: 1.6842rem;
  --r-card: 1.4737rem;
  --radius-card: 1.4737rem;
  --radius-panel: 1.6842rem;
  --r-lg: 1.1579rem;
  --r-md: 0.9474rem;
  --r-sm: 0.6316rem;
  --r-pill: 52.5789rem;
  /* spacing (4 point) */
  --sp-1: 0.2105rem; --sp-2: 0.4211rem; --sp-3: 0.6316rem; --sp-4: 0.8421rem; --sp-5: 1.2632rem; --sp-6: 1.6842rem; --sp-7: 2.5263rem; --sp-8: 3.3684rem;
  /* type scale (root 1rem) */
  --fs-display: clamp(2.1rem, 1.4rem + 2.4vw, 3.1rem);
  --fs-1: clamp(1.75rem, 1.3rem + 1.4vw, 2.35rem);
  --fs-2: 1.45rem;
  --fs-3: 1.15rem;
  --fs-body: 1rem;
  --fs-small: .9rem;
  --fs-label: .8rem;
  --fs-num: clamp(2.3rem, 1.8rem + 1.6vw, 3.2rem);
  /* motion */
  --ease: cubic-bezier(.22, 1, .36, 1);
  --ease-io: cubic-bezier(.65, 0, .35, 1);
  --t-fast: 160ms;
  --t: 280ms;
  --t-slow: 600ms;
  --t-enter: 800ms;
  /* layout */
  --gutter: 0.8421rem;
  --rail: 16rem;
  --top: 4rem;
  --tab: 4rem;
  --tap: 2.75rem; /* 44px compact (Apple minimum), about 52px with Bigger text */

  color-scheme: dark;
  /* Compact by default: 1rem follows the browser's text size (16px normally).
     "Bigger text" (html[data-size="large"]) is the original roomy look: 1rem = 19px. */
  font-size: 100%;
}

:root[data-size="large"] { font-size: 118.75%; }

:root[data-theme="light"] {
  --bg: #f4f4f5;
  --s0: #fafafa;
  --s1: #ffffff;
  --s2: #f8f8f9;
  --s3: #ececee;
  --s4: #e2e2e5;
  --ink: #0b0b0c;
  --ink2: rgba(11, 11, 12, .74);
  --ink3: rgba(11, 11, 12, .70); /* about 7:1 on paper */
  --ring: rgba(0, 0, 0, .10);
  --ring2: rgba(0, 0, 0, .22);
  --ring3: rgba(0, 0, 0, .34);
  --hi: rgba(0, 0, 0, .04);
  --glow: rgba(0, 0, 0, .10);
  --light: #0b0b0c;
  --light-a: rgba(0, 0, 0, .5);
  --paper: #0b0b0c;
  --paper-ink: #f5f5f7;
  --paper-ink2: rgba(245, 245, 247, .74);
  --paper-ring: rgba(255, 255, 255, .14);
  --accent: #0b0b0c;
  --accent-ink: #fff;
  --online: #15803d;
  --danger-ink: #a3261b;
  --paper-danger: #ffb4ab;
  --glass: linear-gradient(180deg, #fff, #fbfbfc);
  --glass-bg: rgba(255, 255, 255, .82);
  --edge: inset 0 0 0 1px var(--ring);
  --shadow: 0 1px 0 rgba(255,255,255,1) inset, 0 0.9474rem 2.1053rem -1.3684rem rgba(0,0,0,.28);
  --e1: 0 0.9474rem 2.1053rem -1.4737rem rgba(0,0,0,.3);
  --e2: 0 1.5789rem 3.6842rem -1.5789rem rgba(0,0,0,.4), 0 0 0 1px rgba(0,0,0,.06);
  --e3: 0 2.1053rem 5.2632rem -1.5789rem rgba(0,0,0,.45);
  --cx-line: #0b0b0c;
  --cx-area-a: rgba(0, 0, 0, .14);
  --cx-area-b: rgba(0, 0, 0, 0);
  --cx-prev: rgba(0, 0, 0, .42);
  --cx-grid: rgba(0, 0, 0, .08);
  --cx-bar: rgba(0, 0, 0, .86);
  color-scheme: light;
}
:root[data-theme="light"] .logo { filter: invert(1); }

/* ================================================================ base */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--ink);
  font-family: 'Satoshi', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  font-size: 1rem;
  line-height: 1.55;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  font-feature-settings: 'ss01' on;
}
html.sheet-open body { overflow: hidden; }
img, svg { display: block; max-width: 100%; }
h1, h2, h3, h4 { margin: 0; font-weight: 700; line-height: 1.15; letter-spacing: -0.02em; text-wrap: balance; }
p { margin: 0; text-wrap: pretty; }
a { color: inherit; }
button, input, textarea, select { font: inherit; color: inherit; }
::selection { background: var(--ink); color: var(--bg); }

:focus { outline: none; }
:focus-visible {
  outline: 0.1579rem solid var(--ink);
  outline-offset: 0.1579rem;
  border-radius: 0.5263rem;
}
.paper :focus-visible { outline-color: var(--paper-ink); }

.skip {
  position: absolute; left: 0.6316rem; top: -4.2105rem; z-index: 300;
  background: var(--ink); color: var(--bg); padding: 0.6316rem 1.0526rem; border-radius: var(--r-pill);
  text-decoration: none; font-weight: 700;
}
.skip:focus { top: 0.6316rem; }

.sr-only {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.icon { width: 1.25em; height: 1.25em; flex: none; }
.num, .tnum { font-variant-numeric: tabular-nums; }

/* ================================================================ backdrop light */

.backdrop { position: fixed; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; }
.backdrop::before {
  /* a slow pool of light up and to the right, like a lamp over the desk */
  content: ''; position: absolute; width: 90vmax; height: 90vmax; border-radius: 50%;
  top: -58vmax; right: -30vmax;
  background: radial-gradient(circle, rgba(255,255,255,.075), rgba(255,255,255,.02) 38%, transparent 62%);
  animation: drift-a 40s ease-in-out infinite alternate;
}
.backdrop::after {
  content: ''; position: absolute; width: 70vmax; height: 70vmax; border-radius: 50%;
  bottom: -52vmax; left: -24vmax;
  background: radial-gradient(circle, rgba(255,255,255,.04), transparent 60%);
  animation: drift-b 52s ease-in-out infinite alternate;
}
.backdrop i {
  /* fine dot grid that fades out toward the bottom */
  position: absolute; inset: 0;
  background: radial-gradient(rgba(255,255,255,.07) 1px, transparent 1.2px) 0 0 / 1.3684rem 1.3684rem;
  -webkit-mask-image: radial-gradient(120% 70% at 60% 0%, #000 0%, transparent 62%);
  mask-image: radial-gradient(120% 70% at 60% 0%, #000 0%, transparent 62%);
  opacity: .55;
}
.backdrop b {
  position: absolute; left: 0; top: 0; width: 52vmax; height: 52vmax; border-radius: 50%;
  background: radial-gradient(circle, rgba(255,255,255,.06), transparent 60%);
  transform: translate3d(var(--cx, 60vw), var(--cy, 18vh), 0) translate(-50%, -50%);
  opacity: 0; transition: opacity 1.4s ease;
}
.backdrop.live b { opacity: 1; }
@keyframes drift-a { to { transform: translate(-8vmax, 6vmax) scale(1.06); } }
@keyframes drift-b { to { transform: translate(6vmax, -4vmax) scale(.96); } }
:root[data-theme="light"] .backdrop { display: none; }

/* ================================================================ loading screen */

.loader {
  position: fixed; inset: 0; z-index: 400; display: grid; place-items: center; background: #000;
  transition: opacity .7s var(--ease), visibility 0s linear .7s;
  /* failsafe: never block the page, even if no script ever runs */
  animation: ld-failsafe .01s linear 6s forwards;
}
html:not(.ld-on) .loader, html.still .loader { display: none; }
.loader.out { opacity: 0; visibility: hidden; pointer-events: none; }
@keyframes ld-failsafe { to { opacity: 0; visibility: hidden; pointer-events: none; } }
.ld-glow {
  position: absolute; width: 64vmax; height: 64vmax; border-radius: 50%;
  background: radial-gradient(circle, rgba(255,255,255,.12), rgba(255,255,255,.03) 40%, transparent 64%);
  filter: blur(1.2632rem); animation: ld-breathe 3.2s ease-in-out infinite alternate;
}
@keyframes ld-breathe { from { transform: scale(.86); opacity: .5; } to { transform: scale(1.06); opacity: 1; } }
.ld-grid {
  position: absolute; inset: 0;
  background: radial-gradient(rgba(255,255,255,.1) 1px, transparent 1.2px) 0 0 / 1.2632rem 1.2632rem;
  -webkit-mask-image: radial-gradient(circle at 50% 50%, transparent calc(var(--ld-r) - 8.4211rem), #000 calc(var(--ld-r) - 3.6842rem), transparent var(--ld-r));
  mask-image: radial-gradient(circle at 50% 50%, transparent calc(var(--ld-r) - 8.4211rem), #000 calc(var(--ld-r) - 3.6842rem), transparent var(--ld-r));
  animation: ld-wave 2.6s cubic-bezier(.3, .1, .2, 1) .15s infinite;
}
@keyframes ld-wave { from { --ld-r: 0px; } to { --ld-r: 120vmax; } }
.ld-center { position: relative; display: grid; justify-items: center; transition: opacity .35s ease, transform .5s var(--ease), filter .5s ease; }
.loader.out .ld-center { opacity: 0; transform: scale(.96); filter: blur(0.3158rem); }
.ld-logo { display: flex; align-items: center; gap: 0.9474rem; }
.ld-mark { width: 2.9474rem; height: 2.9474rem; animation: ld-mark 1s var(--ease) both; }
@keyframes ld-mark { from { opacity: 0; filter: blur(0.5263rem); transform: scale(.9); } }
.ld-word { position: relative; display: block; width: 10rem; }
.ld-word img { width: 100%; height: auto; animation: ld-wipe 1s var(--ease-io) .18s both; }
@keyframes ld-wipe { from { clip-path: inset(0 100% 0 0); filter: blur(0.4211rem); opacity: .4; } to { clip-path: inset(0 0 0 0); filter: blur(0); opacity: 1; } }
.ld-shine {
  position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(105deg, transparent 36%, rgba(255,255,255,.98) 50%, transparent 64%) 160% 0 / 260% 100% no-repeat;
  -webkit-mask: url('/img/drook-wordmark-mono.webp?v=da37158523') center / contain no-repeat;
  mask: url('/img/drook-wordmark-mono.webp?v=da37158523') center / contain no-repeat;
  animation: ld-shine 1.7s ease-in-out .9s infinite;
  filter: drop-shadow(0 0 0.3158rem rgba(255,255,255,.8));
}
@keyframes ld-shine { from { background-position: 160% 0; } to { background-position: -60% 0; } }
.ld-bar { width: 13.8947rem; height: 0.1053rem; margin-top: 1.7895rem; border-radius: 0.1053rem; background: rgba(255,255,255,.09); overflow: hidden; }
.ld-bar i { display: block; height: 100%; width: var(--p, 0%); border-radius: 0.1053rem; background: linear-gradient(90deg, rgba(255,255,255,.35), #fff); box-shadow: 0 0 0.7368rem #fff; transition: width .45s var(--ease); }
.ld-text { margin-top: 0.8421rem; font-size: var(--fs-small); color: rgba(245,245,247,.72); min-height: 1.6em; transition: opacity .25s; letter-spacing: .01em; }
.ld-text.swap { opacity: 0; }
.ld-quick .ld-word img { animation-duration: .35s; animation-delay: 0s; }
.ld-quick .ld-mark { animation-duration: .3s; }
.ld-quick .ld-grid { animation-duration: 1.2s; animation-delay: 0s; }
html.ld-on body { overflow: hidden; }
html.ld-on.ld-done body { overflow: auto; }
html.ld-on.ld-done.sheet-open body { overflow: hidden; }

/* boot fallback (before the shell paints) */
.boot { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; }
.boot-mark { width: 2.9474rem; height: 2.9474rem; opacity: .85; animation: breathe 2.4s var(--ease) infinite; }
@keyframes breathe { 50% { opacity: .35; } }
.noscript { max-width: 29.4737rem; margin: 15vh auto; padding: 1.6842rem var(--gutter); }
.noscript p + p { margin-top: 0.6316rem; color: var(--ink2); }

/* ================================================================ screen changes */

.rail { view-transition-name: rail; }
.topbar { view-transition-name: topbar; }
.tabbar { view-transition-name: tabbar; }
.backdrop { view-transition-name: backdrop; }
::view-transition-old(root) { animation: vt-out .2s ease both; }
::view-transition-new(root) { animation: vt-in .46s var(--ease) both; }
@keyframes vt-out { to { opacity: 0; filter: blur(0.3158rem); } }
@keyframes vt-in { from { opacity: 0; filter: blur(0.4211rem); } }

/* ================================================================ shell */

.app {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  grid-template-columns: var(--rail) minmax(0, 1fr);
  grid-template-rows: var(--top) auto 1fr;
  grid-template-areas: "rail top" "rail banners" "rail main";
}
.app.is-booting, .app.is-bare { display: block; }

/* ---------- rail */
.rail {
  grid-area: rail;
  position: sticky; top: 0;
  height: 100vh; height: 100dvh;
  padding: 0.7368rem 0 0.7368rem 0.7368rem;
  z-index: 35;
}
.rail-panel {
  height: 100%;
  display: flex; flex-direction: column; gap: 0.3158rem;
  padding: 0.9474rem 0.6316rem 0.8421rem;
  border-radius: var(--r-card);
  background: var(--glass), var(--glass-bg);
  -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur);
  box-shadow: var(--edge), var(--e1);
  overflow-y: auto; overscroll-behavior: contain;
  scrollbar-width: thin; scrollbar-color: var(--ring2) transparent;
}
.brand { display: flex; align-items: center; gap: 0.5263rem; text-decoration: none; min-height: var(--tap); flex: none; padding: 0 0.4211rem; border-radius: var(--r-md); }
.brand-mark { width: 1.6842rem; height: 1.6842rem; object-fit: contain; }
.brand-word { height: 0.6842rem; width: auto; object-fit: contain; }
.brand-studio { font-weight: 500; color: var(--ink3); font-size: .84rem; letter-spacing: .02em; padding-left: 0.5263rem; border-left: 1px solid var(--ring2); }

/* live site card at the top of the rail */
.site-card {
  position: relative; margin: 0.5263rem 0 0.4211rem;
  border-radius: var(--r-lg);
  background: var(--s1);
  box-shadow: inset 0 0 0 1px var(--ring), inset 0 1px 0 var(--hi);
  overflow: hidden;
  text-decoration: none; color: inherit; display: block;
  transition: box-shadow var(--t) var(--ease);
}
a.site-card:hover { box-shadow: inset 0 0 0 1px var(--ring2), 0 0 0 0.2632rem var(--hi), 0 0 1.8947rem -0.4211rem var(--glow); }
.site-thumb {
  position: relative; height: 6.7368rem; overflow: hidden;
  background: linear-gradient(180deg, var(--s3), var(--s2));
  border-bottom: 1px solid var(--ring);
}
.site-thumb iframe {
  position: absolute; top: 0; left: 0; border: 0; pointer-events: none;
  width: 67.3684rem; height: 42.1053rem; transform-origin: 0 0; background: #fff;
  opacity: 0; transition: opacity .8s var(--ease);
}
.site-thumb.ready iframe { opacity: 1; }
.site-thumb::after {
  /* glass sheen + fade into the card */
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(180deg, rgba(255,255,255,.08), transparent 30%, transparent 62%, rgba(11,11,12,.75));
}
.site-thumb-empty { position: absolute; inset: 0; display: grid; place-items: center; color: var(--ink3); }
.site-thumb-empty .icon { width: 1.5789rem; height: 1.5789rem; }
.site-meta { padding: 0.6316rem 0.7368rem 0.7368rem; display: grid; gap: 0.1579rem; }
.site-meta-name { font-weight: 700; line-height: 1.25; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.site-meta-state { display: flex; align-items: center; gap: 0.4737rem; color: var(--ink2); font-size: var(--fs-small); }
.site-meta-open { margin-left: auto; display: inline-flex; color: var(--ink3); }
.site-meta-host { color: var(--ink3); font-size: var(--fs-small); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.site-meta-open .icon { width: 0.9474rem; height: 0.9474rem; }

.status { display: inline-flex; align-items: center; gap: 0.5263rem; font-weight: 500; }
.status-light { width: 0.5263rem; height: 0.5263rem; border-radius: 50%; flex: none; background: var(--ink3); box-shadow: 0 0 0 0.2105rem var(--hi); }
.status-light.is-online { background: var(--online); box-shadow: 0 0 0 0.2105rem color-mix(in srgb, var(--online) 18%, transparent), 0 0 0.7368rem color-mix(in srgb, var(--online) 60%, transparent); animation: online 3.6s ease-in-out infinite; }
.status-light.is-warn { background: var(--ink); box-shadow: 0 0 0 0.2105rem var(--hi), 0 0 0.6316rem var(--glow); }
@keyframes online { 50% { box-shadow: 0 0 0 0.3158rem color-mix(in srgb, var(--online) 8%, transparent), 0 0 1.0526rem color-mix(in srgb, var(--online) 40%, transparent); } }

.nav-group { margin-top: 0.6316rem; display: flex; flex-direction: column; gap: 0.1053rem; }
.nav-group-label {
  padding: 0 0.7368rem 0.3158rem; font-size: var(--fs-label); font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--ink3);
}
.nav-item {
  display: flex; align-items: center; gap: 0.7368rem;
  min-height: var(--tap); padding: 0 0.7368rem;
  border-radius: var(--r-md);
  text-decoration: none; color: var(--ink2); font-weight: 500;
  transition: background var(--t) var(--ease), color var(--t) var(--ease), box-shadow var(--t) var(--ease);
  position: relative;
  border: 0; background: transparent; width: 100%; text-align: left; cursor: pointer;
}
.nav-item .icon { opacity: .85; }
.nav-item:hover { color: var(--ink); background: var(--hi); box-shadow: 0 0 1.3684rem -0.3158rem var(--glow); }
.nav-item[aria-current="page"] {
  color: var(--ink); background: linear-gradient(90deg, rgba(255,255,255,.09), rgba(255,255,255,.03));
  box-shadow: inset 0 0 0 1px var(--ring2), inset 0 1px 0 var(--hi), 0 0 1.5789rem -0.5263rem var(--glow);
}
.nav-item[aria-current="page"]::before {
  /* a filament of light at the left edge of the current place */
  content: ''; position: absolute; left: -0.6316rem; top: 0.7368rem; bottom: 0.7368rem; width: 0.1579rem; border-radius: 0 0.1579rem 0.1579rem 0;
  background: var(--light); box-shadow: 0 0 0.6316rem var(--light), 0 0 0.1053rem var(--light);
}
.nav-item[aria-current="page"] .icon { opacity: 1; }
.nav-item.is-quiet { color: var(--ink3); }
.nav-sep { height: 1px; background: var(--ring); margin: 0.5263rem 0.4211rem; }
.nav-badge {
  margin-left: auto; min-width: 1.4737rem; height: 1.4737rem; padding: 0 0.4211rem;
  display: inline-grid; place-items: center;
  border-radius: var(--r-pill); background: var(--accent); color: var(--accent-ink);
  font-size: .84rem; font-weight: 700; font-variant-numeric: tabular-nums;
  box-shadow: 0 0 0.8421rem -0.1053rem var(--glow);
}
.nav-new { margin-left: auto; font-size: .76rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ink3); border: 1px solid var(--ring2); border-radius: var(--r-pill); padding: 0.1053rem 0.4737rem; }
.rail-foot { margin-top: auto; padding: 0.8421rem 0.4211rem 0; display: grid; gap: 0.2105rem; }
.rail-call { display: flex; align-items: center; gap: 0.6316rem; min-height: var(--tap); padding: 0 0.6316rem; border-radius: var(--r-md); text-decoration: none; color: var(--ink2); transition: background var(--t) var(--ease), color var(--t) var(--ease); }
.rail-call:hover { background: var(--hi); color: var(--ink); }
.rail-call small { display: block; color: var(--ink3); font-size: var(--fs-label); letter-spacing: .02em; }
.rail-call strong { display: block; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }

/* ---------- top bar (page header) */
.topbar {
  grid-area: top;
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 0.8421rem;
  padding: 0 2.1053rem;
  height: var(--top);
  background: linear-gradient(180deg, color-mix(in srgb, var(--bg) 86%, transparent), color-mix(in srgb, var(--bg) 55%, transparent));
  -webkit-backdrop-filter: blur(0.8421rem) saturate(130%); backdrop-filter: blur(0.8421rem) saturate(130%);
}
.topbar::after { content: ''; position: absolute; left: 2.1053rem; right: 2.1053rem; bottom: 0; height: 1px; background: linear-gradient(90deg, var(--ring), transparent 80%); }
.topbar .brand { display: none; }
.crumb { flex: 1; min-width: 0; display: flex; align-items: center; gap: 0.5263rem; color: var(--ink3); font-weight: 500; white-space: nowrap; overflow: hidden; }
.crumb-group { font-size: var(--fs-small); }
.crumb-sep { width: 0.2632rem; height: 0.2632rem; border-radius: 50%; background: var(--ring3); flex: none; }
.crumb-here { color: var(--ink); font-weight: 700; overflow: hidden; text-overflow: ellipsis; }
.crumb-short { display: none; }
.topbar-mid { display: flex; align-items: center; min-width: 0; }
.topbar-end { display: flex; align-items: center; gap: 0.5263rem; flex: none; }
.site-name { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.switcher { display: flex; align-items: center; gap: 0.5263rem; min-width: 0; max-width: 20rem; }
.switcher-label { color: var(--ink3); font-size: .84rem; white-space: nowrap; }
.switcher select, .select {
  appearance: none; -webkit-appearance: none;
  min-height: var(--tap); min-width: 0; width: 100%;
  padding: 0 2.4211rem 0 1.0526rem;
  background: var(--s2) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23aaa' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 0.8421rem center / 0.9474rem;
  border: 1px solid var(--ring2);
  border-radius: var(--r-pill);
  font-weight: 500;
  text-overflow: ellipsis;
  cursor: pointer;
  transition: box-shadow var(--t) var(--ease), border-color var(--t) var(--ease);
}
.switcher select:hover, .select:hover { box-shadow: 0 0 0 0.2632rem var(--hi), 0 0 1.4737rem var(--glow); }

.help-pill { white-space: nowrap; }
.help-pill .icon { opacity: .9; }

/* ---------- banners + main */
.banners { grid-area: banners; display: flex; flex-direction: column; gap: 0.5263rem; padding: 0 2.1053rem; }
.banners:empty { display: none; }
.main {
  grid-area: main;
  min-width: 0;
  padding: 1.4737rem 2.1053rem 9.4737rem;
}
.main:focus { outline: none; }
.view { max-width: 1120px; /* fixed: compact text uses the extra room instead of shrinking the page */ margin: 0 auto; }
.view-narrow { max-width: 40rem; margin: 0 auto; }
.view-wide { max-width: 1320px; margin: 0 auto; }

.viewbar {
  display: flex; align-items: center; gap: 0.7368rem; flex-wrap: wrap;
  margin-top: 0.6316rem; padding: 0.5263rem 0.5263rem 0.5263rem 1.1579rem;
  border-radius: var(--r-lg);
  background: var(--s3); box-shadow: inset 0 0 0 1px var(--ring2);
}
.viewbar p { flex: 1 1 14.7368rem; font-weight: 500; }

/* ---------- the "not published yet" dock */
.dock {
  position: fixed; z-index: 45;
  left: calc(var(--rail) + (100vw - var(--rail)) / 2);
  bottom: 1.1579rem;
  width: min(35.7895rem, calc(100vw - var(--rail) - 3.3684rem));
  transform: translateX(-50%);
  display: flex; align-items: center; gap: 0.8421rem;
  padding: 0.5263rem 0.5263rem 0.5263rem 0.6316rem;
  border-radius: var(--r-pill);
  background: var(--glass), rgba(16, 16, 18, .78);
  -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur);
  box-shadow: var(--edge), var(--e2), 0 0 3.1579rem -0.9474rem var(--glow);
  animation: dock-in .7s var(--ease) both;
}
@keyframes dock-in { from { opacity: 0; transform: translate(-50%, 1.2632rem); filter: blur(0.3158rem); } }
.dock-count {
  flex: none; width: 2.7368rem; height: 2.7368rem; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--accent); color: var(--accent-ink);
  font-size: 1.15rem; font-weight: 700; font-variant-numeric: tabular-nums;
  box-shadow: 0 0 0 0.3158rem var(--hi), 0 0 1.3684rem -0.1053rem var(--glow);
}
.dock-text { flex: 1; min-width: 0; line-height: 1.3; }
.dock-text strong { display: block; font-weight: 700; }
.dock-text span { display: block; color: var(--ink3); font-size: var(--fs-small); }
.dock .btn { flex: none; }
:root[data-theme="light"] .dock { background: rgba(255,255,255,.9); }

/* ---------- phone tab bar */
.tabbar { display: none; }

/* ================================================================ light ring (one primary element per screen) */

/* :where() so a fixed or absolute element (the dock) keeps its own position */
:where(.lightring) { position: relative; }
.lightring { isolation: isolate; }
.lightring::before, .card.lightring::before {
  content: ''; position: absolute; inset: -1px; border-radius: inherit; padding: 1.5px; pointer-events: none; z-index: 2;
  height: auto; background: conic-gradient(from var(--ang), rgba(255,255,255,.08) 0deg, rgba(255,255,255,.08) 120deg, rgba(255,255,255,.95) 180deg, rgba(255,255,255,.08) 240deg, rgba(255,255,255,.08) 360deg);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
  animation: ang 7s linear infinite;
}
.paper.lightring::before { background: conic-gradient(from var(--ang), rgba(255,255,255,0) 0deg, rgba(255,255,255,0) 110deg, rgba(255,255,255,.95) 180deg, rgba(255,255,255,0) 250deg); inset: -0.1053rem; padding: 0.1053rem; filter: drop-shadow(0 0 0.4211rem rgba(255,255,255,.7)); }
@keyframes ang { to { --ang: 360deg; } }
:root[data-theme="light"] .lightring::before { background: conic-gradient(from var(--ang), rgba(0,0,0,.06) 0deg, rgba(0,0,0,.06) 120deg, rgba(0,0,0,.7) 180deg, rgba(0,0,0,.06) 240deg); }

/* ================================================================ buttons */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5263rem;
  min-height: var(--tap);
  padding: 0 1.2632rem;
  border-radius: var(--r-pill);
  border: 1px solid var(--ring2);
  background: linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.015)), var(--s2);
  color: var(--ink);
  font-weight: 700; font-size: 1rem; line-height: 1.2; letter-spacing: -0.005em;
  text-decoration: none; text-align: center;
  cursor: pointer;
  transition: box-shadow var(--t) var(--ease), background var(--t) var(--ease), border-color var(--t) var(--ease), opacity var(--t) var(--ease), color var(--t) var(--ease);
  -webkit-tap-highlight-color: transparent;
  position: relative;
}
.btn:hover { box-shadow: 0 0 0 0.2632rem var(--hi), 0 0 1.6842rem var(--glow); border-color: var(--ring3); }
.btn:active { background: var(--s3); }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .45; cursor: not-allowed; box-shadow: none; }
.btn-primary { background: var(--accent); color: var(--accent-ink); border-color: transparent; box-shadow: 0 0 0 0 transparent, 0 0.5263rem 1.5789rem -0.6316rem rgba(255,255,255,.35); }
.btn-primary:hover { box-shadow: 0 0 0 0.3158rem var(--glow), 0 0 2.3158rem var(--glow); border-color: transparent; }
.btn-primary:active { background: #e8e8ea; }
:root[data-theme="light"] .btn-primary:active { background: #222; }
.btn-ghost { background: transparent; }
.btn-quiet { background: transparent; border-color: transparent; padding: 0 0.8421rem; color: var(--ink2); }
.btn-quiet:hover { color: var(--ink); background: var(--hi); box-shadow: none; border-color: transparent; }
.btn-danger { background: transparent; color: var(--danger-ink); border-color: color-mix(in srgb, var(--danger-ink) 45%, transparent); }
.btn-danger:hover { box-shadow: 0 0 0 0.2632rem color-mix(in srgb, var(--danger-ink) 10%, transparent), 0 0 1.5789rem color-mix(in srgb, var(--danger-ink) 18%, transparent); border-color: var(--danger-ink); }
.btn-small { min-height: var(--tap); padding: 0 0.9474rem; font-size: .9rem; } /* smaller words, same 2.7368rem tap target */
.btn-big { min-height: 3.3684rem; padding: 0 1.7895rem; font-size: 1.08rem; }
.btn-block { width: 100%; }
.btn-row { display: flex; flex-wrap: wrap; gap: 0.6316rem; align-items: center; margin-top: 1.2632rem; }
.btn.is-busy { pointer-events: none; }
.btn.is-busy::after { content: ''; width: 0.8421rem; height: 0.8421rem; border-radius: 50%; border: 0.1053rem solid currentColor; border-right-color: transparent; animation: spin .8s linear infinite; }

.paper .btn { background: transparent; color: var(--paper-ink); border-color: var(--paper-ring); }
.paper .btn:hover { box-shadow: 0 0 0 0.3158rem color-mix(in srgb, var(--paper-ink) 7%, transparent); }
.paper .btn-primary { background: var(--paper-ink); color: var(--paper); border-color: transparent; }
.paper .btn-primary:hover { box-shadow: 0 0 0 0.3158rem color-mix(in srgb, var(--paper-ink) 12%, transparent), 0 0.5263rem 1.5789rem -0.5263rem color-mix(in srgb, var(--paper-ink) 45%, transparent); }

.link { color: var(--ink); text-decoration: underline; text-underline-offset: 0.2105rem; text-decoration-color: var(--ring3); transition: text-decoration-color var(--t) var(--ease); }
.link:hover { text-decoration-color: currentColor; }

/* ================================================================ surfaces + type */

.card, .glass {
  position: relative;
  background: var(--glass), var(--s1);
  border-radius: var(--r-card);
  box-shadow: var(--edge), var(--e1);
  padding: 1.4737rem;
  transition: box-shadow var(--t) var(--ease);
}
.card::before, .glass::before {
  content: ''; position: absolute; inset: 0 1.4737rem auto; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.22), transparent);
  pointer-events: none;
}
:root[data-theme="light"] .card::before, :root[data-theme="light"] .glass::before { display: none; }
a.card, button.card { text-decoration: none; color: inherit; display: block; text-align: left; width: 100%; border: 0; cursor: pointer; }
a.card:hover, button.card:hover, .card.is-link:hover { box-shadow: inset 0 0 0 1px var(--ring2), var(--e1), 0 0 2.3158rem -0.5263rem var(--glow); }
.glass-hero { border-radius: var(--r-xl); padding: 1.8947rem; background: radial-gradient(120% 90% at 85% -10%, rgba(255,255,255,.09), transparent 55%), var(--glass), var(--s1); }
.flat { background: transparent; box-shadow: inset 0 0 0 1px var(--ring); border-radius: var(--r-lg); padding: 1.1579rem 1.2632rem; }

/* light that follows the pointer over cards (glow only, nothing moves) */
@media (hover: hover) and (pointer: fine) {
  .card::after, .glass::after {
    content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
    background: radial-gradient(22.1053rem circle at var(--mx, 50%) var(--my, 0%), rgba(255,255,255,.06), transparent 46%);
    opacity: 0; transition: opacity .6s ease;
  }
  .card:hover::after, .glass:hover::after { opacity: 1; }
  :root[data-theme="light"] .card::after { background: radial-gradient(22.1053rem circle at var(--mx, 50%) var(--my, 0%), rgba(0,0,0,.035), transparent 46%); }
}

.paper {
  position: relative;
  background: var(--paper);
  color: var(--paper-ink);
  border-radius: var(--r-xl);
  padding: 1.8947rem;
  box-shadow: 0 2.1053rem 5.2632rem -2.1053rem rgba(255,255,255,.28), 0 0 0 1px rgba(255,255,255,.6) inset;
}
:root[data-theme="light"] .paper { box-shadow: 0 1.5789rem 3.6842rem -1.8947rem rgba(0,0,0,.5); }

.eyebrow { font-size: var(--fs-label); font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--ink3); }
.paper .eyebrow { color: var(--paper-ink2); }
.display { font-size: var(--fs-display); letter-spacing: -0.035em; line-height: 1.05; }
.page-title { font-size: var(--fs-1); letter-spacing: -0.03em; line-height: 1.1; }
.page-sub, .lede { color: var(--ink2); font-size: 1.08rem; margin-top: 0.5263rem; max-width: 52ch; }
.section-title { font-size: 1.25rem; margin-bottom: 0.8421rem; letter-spacing: -0.015em; }
.muted { color: var(--ink2); }
.faint { color: var(--ink3); }
.stack > * + * { margin-top: 0.8421rem; }
.stack-lg > * + * { margin-top: 2.1053rem; }
.grid { display: grid; gap: 0.8421rem; }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cols-7-5 { display: grid; gap: 1.0526rem; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); align-items: start; }
.cols-5-7 { display: grid; gap: 1.0526rem; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); align-items: start; }
.head { margin-bottom: 1.6842rem; }

/* view header: eyebrow, big headline, one line under it, optional actions on the right */
.view-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1.0526rem; flex-wrap: wrap; margin: 0.2105rem 0 1.6842rem; }
.view-head h1 { font-size: var(--fs-1); letter-spacing: -0.03em; line-height: 1.08; margin: 0.3158rem 0 0; }
.view-head .lede { margin-top: 0.5263rem; }
.view-head-actions { display: flex; gap: 0.5263rem; flex-wrap: wrap; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 0.8421rem; margin: 2.1053rem 0 0.8421rem; flex-wrap: wrap; }
.section-head h2 { font-size: var(--fs-2); letter-spacing: -0.02em; }
.section-head .muted { font-size: var(--fs-small); }
.divider { height: 1px; background: linear-gradient(90deg, var(--ring2), transparent); margin: 1.4737rem 0; border: 0; }

/* big numbers */
.kpi { display: grid; gap: 0.3158rem; align-content: start; }
.kpi-num { font-size: var(--fs-num); font-weight: 700; letter-spacing: -0.04em; line-height: 1; font-variant-numeric: tabular-nums; }
.kpi-label { font-weight: 500; color: var(--ink); }
.delta { display: inline-flex; align-items: flex-start; gap: 0.3158rem; color: var(--ink2); font-size: var(--fs-small); font-weight: 500; }
/* the arrow stays on the first line when the words wrap */
.delta .icon { width: 1em; height: 1em; flex: none; margin-top: calc((1lh - 1em) / 2); }
.delta[data-dir="up"] { color: var(--ink); }
.badge { display: inline-flex; align-items: center; gap: 0.3158rem; min-height: 1.5789rem; padding: 0 0.6316rem; border-radius: var(--r-pill); font-size: .84rem; font-weight: 700; letter-spacing: .01em; background: var(--s3); box-shadow: inset 0 0 0 1px var(--ring2); color: var(--ink); white-space: nowrap; }
.badge-solid { background: var(--accent); color: var(--accent-ink); box-shadow: 0 0 0.9474rem -0.2105rem var(--glow); }
.badge .icon { width: 1em; height: 1em; }

/* list rows (messages, orders, products) */
.rows { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.row {
  display: flex; align-items: center; gap: 0.8421rem; min-height: 4rem; padding: 0.7368rem 0.9474rem;
  border-radius: var(--r-lg); text-decoration: none; color: inherit;
  transition: background var(--t) var(--ease), box-shadow var(--t) var(--ease);
}
.row + .row { box-shadow: 0 -1px 0 var(--ring); }
a.row:hover, button.row:hover, .row.is-link:hover { background: var(--hi); box-shadow: inset 0 0 0 1px var(--ring); }
.row-main { flex: 1; min-width: 0; }
.row-title { font-weight: 700; overflow: hidden; text-overflow: ellipsis; }
.row-meta { color: var(--ink3); font-size: var(--fs-small); }
.row-end { flex: none; text-align: right; font-variant-numeric: tabular-nums; }
.round { width: 2.5263rem; height: 2.5263rem; border-radius: 50%; display: grid; place-items: center; background: var(--s3); flex: none; box-shadow: inset 0 0 0 1px var(--ring2); }

/* ================================================================ forms */

.field { display: flex; flex-direction: column; gap: 0.5263rem; }
.label { font-weight: 700; }
.hint { color: var(--ink3); font-size: .9rem; }
.input, .textarea {
  width: 100%;
  min-height: 3.1579rem;
  padding: 0.7368rem 1.0526rem;
  border-radius: var(--r-md);
  background: var(--s2);
  border: 1px solid var(--ring2);
  font-size: 1.05rem;
  transition: border-color var(--t) var(--ease), box-shadow var(--t) var(--ease), background var(--t) var(--ease);
}
.textarea { min-height: 7.8947rem; resize: vertical; line-height: 1.5; }
.input:hover, .textarea:hover { border-color: var(--ring3); }
.input:focus-visible, .textarea:focus-visible { outline: none; border-color: var(--ink); background: var(--s1); box-shadow: 0 0 0 0.2105rem var(--hi), 0 0 1.8947rem -0.2105rem var(--glow); }
.input::placeholder, .textarea::placeholder { color: var(--ink3); }
.form-error { color: var(--danger-ink); font-weight: 500; }

.chips { display: flex; flex-wrap: wrap; gap: 0.5263rem; }
.chip {
  min-height: var(--tap); padding: 0 1.0526rem;
  display: inline-flex; align-items: center; gap: 0.4211rem;
  border-radius: var(--r-pill);
  border: 1px solid var(--ring2);
  background: transparent; cursor: pointer; font-weight: 500;
  transition: box-shadow var(--t) var(--ease), background var(--t) var(--ease), border-color var(--t) var(--ease);
}
.chip:hover { box-shadow: 0 0 0 0.2632rem var(--hi), 0 0 1.2632rem var(--glow); border-color: var(--ring3); }
.chip[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); border-color: transparent; }

.seg { display: inline-flex; padding: 0.2632rem; gap: 0.2105rem; border-radius: var(--r-pill); background: var(--s1); box-shadow: inset 0 0 0 1px var(--ring); }
.seg-btn {
  min-height: var(--tap); padding: 0 0.9474rem; border: 0; border-radius: var(--r-pill);
  background: transparent; color: var(--ink2); font-weight: 500; cursor: pointer;
  display: inline-flex; align-items: center; gap: 0.4211rem;
  transition: background var(--t) var(--ease), color var(--t) var(--ease), box-shadow var(--t) var(--ease);
}
.seg-btn:hover { color: var(--ink); }
.seg-btn[aria-pressed="true"], .seg-btn[aria-selected="true"] { background: var(--s4); color: var(--ink); box-shadow: inset 0 0 0 1px var(--ring2), inset 0 1px 0 var(--hi), 0 0 1.0526rem -0.3158rem var(--glow); }

/* on / off switch: <input type="checkbox" class="switch"> inside a <label> */
.switch {
  appearance: none; -webkit-appearance: none; flex: none;
  width: 3.1579rem; height: 1.7895rem; border-radius: var(--r-pill); margin: 0.4737rem 0;
  background: var(--s3); box-shadow: inset 0 0 0 1px var(--ring2);
  position: relative; cursor: pointer; transition: background var(--t) var(--ease), box-shadow var(--t) var(--ease);
}
.switch::after { content: ''; position: absolute; top: 0.2105rem; left: 0.2105rem; width: 1.3684rem; height: 1.3684rem; border-radius: 50%; background: var(--ink3); transition: left var(--t) var(--ease), background var(--t) var(--ease); }
.switch:checked { background: var(--accent); box-shadow: 0 0 1.1579rem -0.2105rem var(--glow); }
.switch:checked::after { left: 1.5789rem; background: var(--accent-ink); }
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 0.8421rem; min-height: var(--tap); cursor: pointer; }

.paper .chip { border-color: var(--paper-ring); color: var(--paper-ink); }
.paper .chip:hover { box-shadow: 0 0 0 0.2632rem color-mix(in srgb, var(--paper-ink) 7%, transparent); }
.paper .chip[aria-pressed="true"] { background: var(--paper-ink); color: var(--paper); border-color: transparent; }
.paper .input, .paper .textarea {
  background: color-mix(in srgb, var(--paper-ink) 4%, transparent);
  border: 1.5px solid var(--paper-ring);
  color: var(--paper-ink);
}
.paper .input::placeholder, .paper .textarea::placeholder { color: color-mix(in srgb, var(--paper-ink) 52%, transparent); }
.paper .input:focus-visible, .paper .textarea:focus-visible { border-color: var(--paper-ink); background: transparent; box-shadow: 0 0 0 0.2105rem color-mix(in srgb, var(--paper-ink) 10%, transparent); }
.paper .form-error { color: var(--paper-danger); }
.paper .muted { color: var(--paper-ink2); }

/* ================================================================ sheets */

.sheet {
  border: 0; padding: 0; margin: auto; background: transparent; color: var(--ink);
  max-width: min(31.5789rem, calc(100vw - 1.6842rem)); width: 100%;
  max-height: calc(100dvh - 2.5263rem);
  overflow: visible;
}
.sheet-wide { max-width: min(45.2632rem, calc(100vw - 1.6842rem)); }
.sheet::backdrop { background: rgba(0,0,0,.62); backdrop-filter: blur(0.4211rem) saturate(120%); -webkit-backdrop-filter: blur(0.4211rem) saturate(120%); animation: fade var(--t) var(--ease); }
.sheet-card {
  position: relative;
  background: var(--glass), var(--s1);
  border-radius: var(--r-card);
  box-shadow: inset 0 0 0 1px var(--ring2), inset 0 1px 0 rgba(255,255,255,.08), var(--e3);
  padding: 1.4737rem;
  max-height: calc(100dvh - 2.5263rem);
  overflow-y: auto;
  animation: sheet-in 420ms var(--ease);
}
.sheet.closing .sheet-card { animation: sheet-out 220ms var(--ease) forwards; }
.sheet.closing::backdrop { opacity: 0; transition: opacity 220ms; }
.sheet-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 0.8421rem; margin-bottom: 0.9474rem; }
.sheet-title { font-size: 1.45rem; padding-top: 0.4211rem; letter-spacing: -0.02em; }
.sheet-close { flex: none; }
.confirm-text { color: var(--ink2); font-size: 1.05rem; }
@keyframes sheet-in { from { opacity: 0; transform: translateY(0.8421rem) scale(.98); filter: blur(0.2105rem); } }
@keyframes sheet-out { to { opacity: 0; transform: translateY(0.5263rem); } }
@keyframes fade { from { opacity: 0; } }

/* ================================================================ toasts (top, never over Publish) */

.toasts {
  position: fixed; z-index: 350; left: 50%; top: 0.9474rem; transform: translateX(-50%);
  width: min(29.4737rem, calc(100vw - 1.6842rem));
  display: flex; flex-direction: column; gap: 0.5263rem; pointer-events: none;
}
.toast {
  pointer-events: auto;
  display: flex; align-items: center; gap: 0.7368rem;
  padding: 0.4211rem 0.4211rem 0.4211rem 0.5263rem; min-height: 3.3684rem;
  background: var(--glass), rgba(22, 22, 25, .86);
  -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur);
  color: var(--ink);
  border-radius: 1.2632rem;
  box-shadow: inset 0 0 0 1px var(--ring2), inset 0 1px 0 rgba(255,255,255,.08), 0 1.2632rem 3.1579rem -1.0526rem rgba(0,0,0,.9);
  font-weight: 500;
  opacity: 0; transform: translateY(-0.5263rem); filter: blur(0.2105rem);
  transition: opacity var(--t) var(--ease), transform var(--t) var(--ease), filter var(--t) var(--ease);
}
.toast > .icon { width: 2.3158rem; height: 2.3158rem; padding: 0.5263rem; border-radius: 50%; background: var(--accent); color: var(--accent-ink); flex: none; box-shadow: 0 0 1.0526rem -0.2105rem var(--glow); }
.toast > span { flex: 1; padding: 0.3158rem 0; }
.toast.in { opacity: 1; transform: none; filter: none; }
.toast.out { opacity: 0; transform: translateY(-0.3158rem); }
.toast-error > .icon { background: transparent; color: var(--danger-ink); box-shadow: inset 0 0 0 1.5px var(--danger-ink); }
.toast-error { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--danger-ink) 55%, transparent), 0 1.2632rem 3.1579rem -1.0526rem rgba(0,0,0,.9); }
.toast-warn > .icon { background: var(--s4); color: var(--ink); box-shadow: inset 0 0 0 1px var(--ring2); }
.toast-x { min-width: var(--tap); height: var(--tap); flex: none; display: inline-flex; align-items: center; justify-content: center; gap: 0.3158rem; padding: 0 0.6316rem; border: 0; background: transparent; border-radius: var(--r-pill); cursor: pointer; color: var(--ink2); font: inherit; font-weight: 700; transition: background var(--t) var(--ease), color var(--t) var(--ease); }
.toast-x:hover { background: var(--hi); color: var(--ink); }
.toast-x-word { font-size: .9rem; }
.toast-act { flex: none; }
:root[data-theme="light"] .toast { background: rgba(255,255,255,.94); }

/* ================================================================ loading shapes */

.spinner { display: inline-flex; align-items: center; gap: 0.7368rem; color: var(--ink2); font-weight: 500; }
.spinner-dot {
  width: 1.1579rem; height: 1.1579rem; border-radius: 50%; position: relative;
  background: conic-gradient(from 0deg, transparent 0deg, var(--ink) 300deg, transparent 360deg);
  -webkit-mask: radial-gradient(circle, transparent 0.3947rem, #000 0.4211rem); mask: radial-gradient(circle, transparent 0.3947rem, #000 0.4211rem);
  animation: spin .9s linear infinite;
  filter: drop-shadow(0 0 0.3158rem var(--glow));
}
.paper .spinner { color: var(--paper-ink2); }
.paper .spinner-dot { background: conic-gradient(from 0deg, transparent 0deg, var(--paper-ink) 300deg, transparent 360deg); }
@keyframes spin { to { transform: rotate(360deg); } }
.loading-block { padding: 3.3684rem 0; display: grid; place-items: center; }

.shimmer { position: relative; overflow: hidden; }
.shimmer::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(100deg, transparent 30%, rgba(255,255,255,.07) 50%, transparent 70%) 0 0 / 220% 100% no-repeat;
  animation: shimmer 1.6s ease-in-out infinite;
}
@keyframes shimmer { from { background-position: 160% 0; } to { background-position: -60% 0; } }
.skel { display: grid; gap: 0.6316rem; padding: 0.2105rem 0; }
.skel-line { display: block; height: 0.8421rem; border-radius: 0.4211rem; background: var(--s3); }
.skel-title { height: 1.3684rem; width: 55%; }
.skel-num { height: 2.3158rem; width: 40%; border-radius: 0.6316rem; }
.skel-short { width: 60%; }
.skel-row { display: block; height: 3.3684rem; border-radius: var(--r-lg); background: var(--s2); }
.skel-chart { display: block; height: 12.6316rem; border-radius: var(--r-lg); background: linear-gradient(180deg, var(--s2), transparent); }

/* ================================================================ empty + notice */

.empty { text-align: center; padding: 2.9474rem 1.4737rem; }
.empty-icon {
  width: 3.7895rem; height: 3.7895rem; margin: 0 auto 1.0526rem; border-radius: 50%; display: grid; place-items: center;
  background: radial-gradient(circle at 50% 30%, rgba(255,255,255,.12), transparent 70%), var(--s3);
  box-shadow: inset 0 0 0 1px var(--ring2), 0 0 2.1053rem -0.5263rem var(--glow);
}
.empty-icon .icon { width: 1.5789rem; height: 1.5789rem; }
.empty-title { font-size: var(--fs-2); letter-spacing: -0.02em; }
.empty-body { color: var(--ink2); margin: 0.5263rem auto 0; max-width: 46ch; }
.empty .btn-row { justify-content: center; }

.notice { display: flex; gap: 0.8421rem; align-items: flex-start; padding: 1.1579rem 1.2632rem; border-radius: var(--r-lg); box-shadow: inset 0 0 0 1px var(--ring2); background: var(--s1); }
.notice .icon { margin-top: 0.1579rem; }
.notice-body { flex: 1; }
.notice-body p + p { margin-top: 0.3158rem; }

/* ================================================================ preview frame */

.pf { position: relative; }
.pf-bar {
  display: flex; align-items: center; gap: 0.6316rem; height: 2.3158rem; padding: 0 0.4211rem 0 0.8421rem;
  border-radius: 1.1579rem 1.1579rem 0 0; background: var(--s2); box-shadow: inset 0 0 0 1px var(--ring), inset 0 1px 0 var(--hi);
  color: var(--ink3); font-size: var(--fs-small);
}
.pf-bar-dot { width: 0.4211rem; height: 0.4211rem; border-radius: 50%; background: var(--ink); box-shadow: 0 0 0.5263rem var(--glow); flex: none; }
.pf-bar-addr { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink2); font-weight: 500; }
.pf-bar-tag { flex: none; font-size: var(--fs-label); font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ink3); padding: 0 0.4211rem; }
.pf-stage {
  position: relative; overflow: hidden;
  height: min(72vh, 40rem);
  border-radius: 1.1579rem;
  background: var(--s2);
  box-shadow: inset 0 0 0 1px var(--ring2), var(--e1);
}
.pf-bar + .pf-stage { border-radius: 0 0 1.1579rem 1.1579rem; }
.pf[data-device="phone"] .pf-bar { display: none; }
.pf[data-device="phone"] .pf-stage { background: transparent; box-shadow: none; border-radius: 1.1579rem; }
.pf-iframe {
  position: absolute; top: 0; left: 0; border: 0;
  transform-origin: 0 0;
  background: #fff;
  opacity: 0; transition: opacity 500ms var(--ease);
}
.pf[data-device="phone"] .pf-iframe { border-radius: 1.7895rem; box-shadow: 0 0 0 0.5263rem var(--s3), 0 0 0 0.5789rem var(--ring2), 0 1.5789rem 3.1579rem -1.0526rem #000; }
.pf.pf-ready .pf-iframe { opacity: 1; }
.pf-loading { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; transition: opacity 300ms; }
.pf.pf-ready .pf-loading { opacity: 0; }
.pf[data-device="phone"] .pf-stage { padding: 0.6316rem; }

/* ================================================================ charts (charts.js) */

.cx { position: relative; width: 100%; min-width: 0; }
.cx-svg { display: block; overflow: visible; touch-action: pan-y; }
.cx-svg:focus-visible { outline: 0.1579rem solid var(--ink); outline-offset: 0.3158rem; border-radius: 0.6316rem; }
.cx-pre .cx-svg { opacity: 0; }
.cx-updating .cx-svg, .cx-updating .cx-bars, .cx-updating .cx-funnel-list { opacity: .35; }
.cx-svg, .cx-bars, .cx-funnel-list { transition: opacity .35s var(--ease); }
.cx-grid line { stroke: var(--cx-grid); stroke-width: 1; }
.cx-grid line.cx-base { stroke: var(--ring2); }
.cx-yt, .cx-xt { fill: var(--ink3); font-size: 0.7895rem; font-weight: 500; font-variant-numeric: tabular-nums; }
.cx-axis-t { fill: var(--ink2); font-size: 0.7895rem; font-weight: 700; }
.cx-stop-a { stop-color: var(--cx-area-a); stop-opacity: 1; }
.cx-stop-b { stop-color: var(--cx-area-b); }
.cx-line { fill: none; stroke: var(--cx-line); stroke-width: 2.25; stroke-linecap: round; stroke-linejoin: round; filter: drop-shadow(0 0 0.3158rem rgba(255,255,255,.35)); }
:root[data-theme="light"] .cx-line { filter: none; }
.cx-prev { fill: none; stroke: var(--cx-prev); stroke-width: 1.75; stroke-dasharray: 4 6; stroke-linecap: round; }
.cx-end-dot { fill: var(--cx-line); }
.cx-end-halo { fill: var(--cx-line); opacity: .18; transform-box: fill-box; transform-origin: center; animation: halo 2.8s ease-in-out infinite; }
@keyframes halo { 50% { opacity: .05; transform: scale(1.8); } }
.cx-hover { opacity: 0; transition: opacity .2s ease; pointer-events: none; }
.cx-hover.on { opacity: 1; }
.cx-cross { stroke: var(--ring3); stroke-width: 1; }
.cx-dot { fill: var(--bg); stroke: var(--cx-line); stroke-width: 2.5; }
.cx-prev-dot { fill: var(--bg); stroke: var(--cx-prev); stroke-width: 2; }
.cx-ann-line { stroke: var(--ring3); stroke-dasharray: 2 4; }
.cx-ann-pill { fill: var(--s3); stroke: var(--ring2); }
.cx-ann-t { fill: var(--ink); font-size: 0.7368rem; font-weight: 700; }
.cx-colbar { fill: var(--cx-bar); transition: opacity .25s ease; }
.cx-col.dim .cx-colbar { opacity: .32; }
.cx-val { fill: var(--ink); font-size: 0.7895rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.cx-combo-bar { fill: var(--cx-bar); fill-opacity: .3; transition: fill-opacity .25s ease; }
.cx-combo-bar.dim { fill-opacity: .14; }
.cx-combo-dot { fill: var(--bg); stroke: var(--cx-line); stroke-width: 2; }
.cx-spark-area { fill: var(--cx-area-a); opacity: .5; }
.cx-spark-line { fill: none; stroke: var(--cx-line); stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.cx-spark-base { stroke: var(--ring); stroke-width: 1; }
.cx-spark-peak { fill: var(--cx-line); }
.cx-tip {
  position: absolute; left: 0; top: 0; z-index: 5; pointer-events: none;
  min-width: 10rem; padding: 0.6316rem 0.7368rem; border-radius: 0.8421rem;
  background: var(--glass), rgba(20, 20, 23, .92);
  -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur);
  box-shadow: inset 0 0 0 1px var(--ring2), 0 0.9474rem 2.1053rem -0.8421rem #000;
  font-size: var(--fs-small); line-height: 1.4;
  opacity: 0; transition: opacity .18s ease;
}
:root[data-theme="light"] .cx-tip { background: rgba(255,255,255,.96); box-shadow: inset 0 0 0 1px var(--ring2), 0 0.9474rem 2.1053rem -0.8421rem rgba(0,0,0,.3); }
.cx-tip.on { opacity: 1; }
.cx-tip-row { display: flex; justify-content: space-between; gap: 0.9474rem; }
.cx-tip-row + .cx-tip-row { margin-top: 0.1579rem; }
.cx-tip-row b { font-variant-numeric: tabular-nums; }
.cx-tip-h { font-weight: 700; color: var(--ink); margin-bottom: 0.2105rem; }
.cx-tip-prev { color: var(--ink2); }
.cx-tip-note { color: var(--ink3); margin-top: 0.3158rem !important; }
.cx-tip-total { border-top: 1px solid var(--ring); padding-top: 0.2105rem; margin-top: 0.3158rem !important; font-weight: 700; }
.cx-legend { list-style: none; display: flex; flex-wrap: wrap; gap: 0.4211rem 1.0526rem; margin: 0.7368rem 0 0; padding: 0; color: var(--ink2); font-size: var(--fs-small); }
.cx-legend li { display: inline-flex; align-items: center; gap: 0.4211rem; }
.cx-sw { display: inline-block; flex: none; }
.cx-sw-box { width: 0.7368rem; height: 0.7368rem; border-radius: 0.2105rem; background: var(--cx-bar); }
.cx-sw-line { width: 0.9474rem; height: 0.1579rem; border-radius: 0.1053rem; background: var(--cx-line); box-shadow: 0 0 0.3158rem var(--glow); }
.cx-sw-dash { width: 0.9474rem; height: 0; border-top: 0.1053rem dashed var(--cx-prev); }

.cx-bars { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.8421rem; }
.cx-bar-head { display: flex; justify-content: space-between; align-items: baseline; gap: 0.8421rem; }
.cx-bar-label { font-weight: 500; min-width: 0; overflow-wrap: anywhere; }
.cx-bar-val { font-weight: 700; font-variant-numeric: tabular-nums; flex: none; }
.cx-bar-track { margin-top: 0.4211rem; height: 0.5263rem; border-radius: 0.3158rem; background: var(--s2); box-shadow: inset 0 0 0 1px var(--ring); overflow: hidden; }
.cx-bar-fill { height: 100%; border-radius: 0.3158rem; background: var(--cx-bar); opacity: .5; }
.cx-bar.is-top .cx-bar-fill { opacity: 1; box-shadow: 0 0 0.8421rem -0.1053rem var(--glow); }
.cx-bar-note { display: block; color: var(--ink3); font-size: var(--fs-small); margin-top: 0.2105rem; }

.cx-meter-radial { position: relative; display: grid; justify-items: center; }
.cx-meter-trk { fill: none; stroke: var(--ring); stroke-linecap: round; }
.cx-meter-arc { fill: none; stroke: var(--cx-line); stroke-linecap: round; filter: drop-shadow(0 0 0.4211rem rgba(255,255,255,.45)); }
.cx-meter-center { position: absolute; top: 0; display: grid; place-content: center; text-align: center; }
.cx-meter-num { font-size: 2.2rem; font-weight: 700; letter-spacing: -0.03em; line-height: 1; font-variant-numeric: tabular-nums; }
.cx-meter-of { color: var(--ink3); font-size: var(--fs-small); margin-top: 0.3158rem; }
.cx-meter-cap { margin-top: 0.4211rem; font-weight: 500; text-align: center; }
.cx-meter-head { display: flex; justify-content: space-between; gap: 0.8421rem; font-weight: 500; }
.cx-meter-val { font-variant-numeric: tabular-nums; color: var(--ink2); }
.cx-meter-track { margin-top: 0.5263rem; height: 0.6316rem; border-radius: 0.4211rem; background: var(--s2); box-shadow: inset 0 0 0 1px var(--ring); overflow: hidden; }
.cx-meter-fill { height: 100%; border-radius: 0.4211rem; background: var(--cx-bar); box-shadow: 0 0 0.8421rem -0.1053rem var(--glow); }
.cx-meter-note { color: var(--ink3); font-size: var(--fs-small); margin-top: 0.5263rem; }

.cx-cell { fill: var(--cx-line); transition: stroke .15s ease; }
.cx-cell.l0 { fill: var(--s2); }
.cx-cell.l1 { fill-opacity: .14; }
.cx-cell.l2 { fill-opacity: .32; }
.cx-cell.l3 { fill-opacity: .58; }
.cx-cell.l4 { fill-opacity: .92; }
.cx-cell.is-best { stroke: var(--light); stroke-width: 2; filter: drop-shadow(0 0 0.3158rem rgba(255,255,255,.7)); }
.cx-cell.is-cur { stroke: var(--light); stroke-width: 2; }
.cx-heat-cap { margin-top: 0.7368rem; font-weight: 500; }

.cx-funnel-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; }
.cx-funnel-step { display: grid; gap: 0.5263rem; }
.cx-funnel-text { display: flex; align-items: baseline; gap: 0.6316rem; flex-wrap: wrap; }
.cx-funnel-val { font-size: 1.7rem; font-weight: 700; letter-spacing: -0.03em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.cx-funnel-label { color: var(--ink2); font-weight: 500; }
.cx-funnel-track { height: 0.7368rem; border-radius: 0.4211rem; background: var(--s2); box-shadow: inset 0 0 0 1px var(--ring); overflow: hidden; }
.cx-funnel-bar { height: 100%; border-radius: 0.4211rem; background: var(--cx-bar); opacity: calc(.3 + .7 * var(--shade, 1)); }
.cx-funnel-step:first-child .cx-funnel-bar { box-shadow: 0 0 0.9474rem -0.1053rem var(--glow); }
.cx-funnel-rate { display: flex; align-items: center; gap: 0.5263rem; padding: 0.5263rem 0 0.5263rem 0.5263rem; color: var(--ink3); font-size: var(--fs-small); font-weight: 500; }
.cx-funnel-rate::before { content: ''; width: 1px; height: 1.1579rem; background: linear-gradient(var(--ring3), transparent); }

/* ================================================================ motion classes (motion.js) */

html:not(.still) [data-reveal]:not(.in):not(.in-now) { opacity: 0; transform: translateY(0.7368rem); animation: reveal-failsafe 0s linear 4s forwards; }
[data-reveal].in { opacity: 1; transform: none; transition: opacity var(--t-enter) var(--ease) var(--rd, 0ms), transform var(--t-enter) var(--ease) var(--rd, 0ms); }
[data-reveal].in-now { opacity: 1; transform: none; }
@keyframes reveal-failsafe { to { opacity: 1; transform: none; filter: none; } }
.words .w { display: inline-block; }
.words:not(.words-in):not(.words-now) .w { opacity: 0; filter: blur(0.5263rem); transform: translateY(.2em); animation: reveal-failsafe 0s linear 4s forwards; }
.words.words-in .w { animation: w-in .9s var(--ease) both; animation-delay: calc(60ms + var(--wi) * 50ms); }
@keyframes w-in { from { opacity: 0; filter: blur(0.5263rem); transform: translateY(.2em); } to { opacity: 1; filter: blur(0); transform: none; } }

.check-ring { position: relative; }
.check-ring::after { content: ''; position: absolute; inset: 0; border-radius: 50%; pointer-events: none; box-shadow: 0 0 0 0 rgba(255,255,255,.55); }
.check-ring.pulsed::after { animation: ring-pulse 1.4s ease-out 2; }
@keyframes ring-pulse { to { box-shadow: 0 0 0 1.1579rem rgba(255,255,255,0); } }

/* ================================================================ sign in */

.signin {
  min-height: 100vh; min-height: 100dvh;
  display: grid; place-items: center;
  padding: 2.1053rem var(--gutter);
  position: relative;
}
.signin::before {
  content: ''; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background: radial-gradient(60vmax 40vmax at 50% -6%, rgba(255,255,255,.10), transparent 62%);
}
:root[data-theme="light"] .signin::before { display: none; }
.signin-card { width: 100%; max-width: 28.4211rem; }
.signin-brand { display: flex; flex-direction: column; align-items: center; gap: 1.0526rem; margin-bottom: 1.8947rem; text-align: center; }
.signin-brand .brand-mark { width: 3.5789rem; height: 3.5789rem; filter: drop-shadow(0 0 1.2632rem rgba(255,255,255,.25)); }
.signin-brand .brand-word { height: 1.1579rem; }
.signin h1 { font-size: var(--fs-1); letter-spacing: -0.03em; }
.signin .card { padding: 2.1053rem; border-radius: var(--r-xl); background: var(--glass), var(--glass-bg); -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur); box-shadow: var(--edge), var(--e3), 0 0 4.2105rem -1.5789rem var(--glow); }
.signin-foot { margin-top: 1.4737rem; text-align: center; color: var(--ink2); }
.signin-foot a { font-weight: 700; }

.code-boxes { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 0.5263rem; }
.code-box {
  width: 100%; min-width: 0;
  height: 4rem;
  text-align: center;
  font-size: 2.1rem; font-weight: 700; font-variant-numeric: tabular-nums;
  border-radius: 0.9474rem;
  background: var(--s2);
  border: 1px solid var(--ring2);
  caret-color: var(--ink);
  transition: border-color var(--t) var(--ease), box-shadow var(--t) var(--ease), background var(--t) var(--ease);
}
.code-box:focus-visible { outline: none; border-color: var(--ink); box-shadow: 0 0 0 0.2105rem var(--hi), 0 0 1.5789rem var(--glow); }
.code-box.filled { background: var(--s3); border-color: var(--ring3); }
.dev-note {
  margin-top: 1.0526rem; padding: 0.7368rem 0.9474rem; border-radius: var(--r-md);
  border: 1.5px dashed var(--ring2); color: var(--ink2);
}
.dev-note strong { color: var(--ink); letter-spacing: .12em; font-variant-numeric: tabular-nums; }

/* ================================================================ home (until the home view brings its own) */

.greet { margin-bottom: 1.4737rem; }
.greet h1 { font-size: var(--fs-display); letter-spacing: -0.035em; line-height: 1.05; }
.greet p { color: var(--ink2); margin-top: 0.6316rem; font-size: 1.1rem; }

.ask { padding: 1.8947rem; }
.ask-label { display: block; font-size: 1.6rem; font-weight: 700; letter-spacing: -0.025em; line-height: 1.2; margin-bottom: 0.9474rem; }
.ask textarea {
  width: 100%; min-height: 7.3684rem; resize: vertical;
  padding: 1.0526rem 1.1579rem; border-radius: 1.1579rem;
  background: color-mix(in srgb, var(--paper-ink) 4%, transparent);
  border: 1.5px solid var(--paper-ring);
  color: var(--paper-ink);
  font-size: 1.12rem; line-height: 1.5;
  transition: border-color var(--t) var(--ease), box-shadow var(--t) var(--ease);
}
.ask textarea::placeholder { color: color-mix(in srgb, var(--paper-ink) 52%, transparent); }
.ask textarea:focus-visible { outline: none; border-color: var(--paper-ink); box-shadow: 0 0 0 0.2105rem color-mix(in srgb, var(--paper-ink) 10%, transparent); }
.ask .chips { margin-top: 0.8421rem; }
.ask .chip { border-color: var(--paper-ring); color: var(--paper-ink); }
.ask .chip:hover { box-shadow: 0 0 0 0.2632rem color-mix(in srgb, var(--paper-ink) 7%, transparent); }
.ask-try { color: var(--paper-ink2); font-size: .9rem; font-weight: 500; margin-top: 0.9474rem; }
.ask .btn-row { justify-content: space-between; }
.ask-actions { display: flex; gap: 0.6316rem; flex-wrap: wrap; }
.mic[aria-pressed="true"] { background: var(--paper-ink); color: var(--paper); }
.mic[aria-pressed="true"] .icon { animation: breathe 1.4s var(--ease) infinite; }
.ask-note { margin-top: 0.9474rem; padding: 0.9474rem 1.0526rem; border-radius: 1.0526rem; background: color-mix(in srgb, var(--paper-ink) 5%, transparent); color: var(--paper-ink); }
.ask-note p + p, .ask-note p + .btn-row { margin-top: 0.5263rem; }
.ask-note .btn-row { margin-top: 0.7368rem; }
.ask-wait { margin-top: 0.8421rem; color: var(--paper-ink2); }

.health {
  display: flex; align-items: center; gap: 0.7368rem; flex-wrap: wrap;
  margin-top: 1.4737rem; padding: 0.8421rem 0.8421rem 0.8421rem 1.2632rem;
  border-radius: var(--r-lg); box-shadow: inset 0 0 0 1px var(--ring); background: color-mix(in srgb, var(--s1) 60%, transparent);
}
.health-dot { width: 0.6316rem; height: 0.6316rem; border-radius: 50%; background: var(--online); box-shadow: 0 0 0 0.2632rem color-mix(in srgb, var(--online) 18%, transparent), 0 0 0.9474rem color-mix(in srgb, var(--online) 55%, transparent); flex: none; animation: online 3.6s ease-in-out infinite; }
.health-dot.off { background: var(--ink3); box-shadow: 0 0 0 0.2632rem var(--hi); animation: none; }
.health-text { font-weight: 700; }
.health-sub { color: var(--ink3); font-size: .9rem; }
.health a { margin-left: auto; }

.stat { padding: 1.3684rem 1.4737rem; }
.stat-num { font-size: var(--fs-num); font-weight: 700; letter-spacing: -0.04em; line-height: 1; font-variant-numeric: tabular-nums; }
.stat-label { font-weight: 500; margin-top: 0.5263rem; }
.stat-cmp { color: var(--ink3); font-size: .9rem; margin-top: 0.5263rem; display: flex; align-items: center; gap: 0.3158rem; }
.stat-cmp .icon { width: 1em; height: 1em; }

.card.msg-card { display: flex; align-items: center; gap: 1.0526rem; }
.msg-card .round { width: 3.1579rem; height: 3.1579rem; }
.msg-card .msg-card-text { flex: 1; min-width: 0; }
.msg-card .msg-big { font-size: 1.2rem; font-weight: 700; }
@media (max-width: 560px) { .card.msg-card { flex-wrap: wrap; } .msg-card .msg-card-text { flex-basis: calc(100% - 4.2105rem); } .msg-card .btn-small { margin-left: 4.2105rem; } }

.wd-card { display: flex; flex-direction: column; gap: 0.7368rem; }
.wd-top { display: flex; gap: 0.8421rem; align-items: flex-start; }
.wd-label { color: var(--ink3); font-size: .86rem; font-weight: 700; letter-spacing: .04em; }
.wd-issue { font-weight: 500; font-size: 1.05rem; }
.wd-sugg { padding: 0.7368rem 0.9474rem; border-radius: var(--r-md); background: var(--s2); box-shadow: inset 0 0 0 1px var(--ring); }
.wd-sugg .faint { font-size: .86rem; display: block; margin-bottom: 0.2105rem; }
.wd-card .btn-row { margin-top: 0.2105rem; }

/* ================================================================ change (until the review view brings its own) */

.reply { display: flex; gap: 0.9474rem; align-items: flex-start; }
.reply .round { width: 2.7368rem; height: 2.7368rem; background: var(--accent); color: var(--accent-ink); box-shadow: 0 0 1.2632rem -0.2105rem var(--glow); }
.reply-text { font-size: 1.15rem; line-height: 1.55; padding-top: 0.5263rem; white-space: pre-line; }
.reply-request { color: var(--ink3); font-size: .92rem; margin-bottom: 0.3158rem; }
.question { margin-top: 1.2632rem; }
.question h2 { font-size: 1.35rem; margin-bottom: 0.7368rem; }
.change-layout { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 1.4737rem; align-items: start; margin-top: 1.6842rem; }
.change-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.6316rem; }
.change-item {
  width: 100%; text-align: left; cursor: pointer;
  border: 0; color: inherit;
  padding: 1.0526rem 1.1579rem; border-radius: 1.1579rem;
  background: var(--glass), var(--s1); box-shadow: inset 0 0 0 1px var(--ring);
  transition: box-shadow var(--t) var(--ease);
  display: block;
}
.change-item:hover { box-shadow: inset 0 0 0 1px var(--ring2), 0 0 1.5789rem -0.3158rem var(--glow); }
.change-item[aria-current="true"] { box-shadow: inset 0 0 0 1.5px var(--ink), 0 0 1.5789rem -0.4211rem var(--glow); }
.change-label { font-weight: 700; display: flex; align-items: center; gap: 0.5263rem; }
.change-page { color: var(--ink3); font-weight: 500; font-size: .86rem; }
.change-row { display: block; margin-top: 0.5263rem; }
.change-tag { display: block; font-size: .76rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ink3); margin-bottom: 0.1053rem; }
.change-before, .change-after { display: block; overflow-wrap: anywhere; }
.change-before { color: var(--ink2); text-decoration: line-through; text-decoration-thickness: 1.5px; }
.change-after { color: var(--ink); font-weight: 500; text-decoration: none; }
.change-why { color: var(--ink3); font-size: .9rem; margin-top: 0.5263rem; }
.change-thumb { margin-top: 0.5263rem; width: 6.3158rem; height: 4.2105rem; object-fit: cover; border-radius: 0.6316rem; box-shadow: inset 0 0 0 1px var(--ring); background: var(--s2); }
.rejected { margin-top: 0.9474rem; padding: 0.9474rem 1.0526rem; border-radius: 1.0526rem; box-shadow: inset 0 0 0 1px var(--ring2); }
.rejected ul { margin: 0.4211rem 0 0; padding-left: 1.0526rem; color: var(--ink2); }
.preview-tools { display: flex; align-items: center; justify-content: space-between; gap: 0.6316rem; flex-wrap: wrap; margin-bottom: 0.7368rem; }
.page-chips .chip { min-height: var(--tap); }
.change-actions { position: sticky; bottom: 0; z-index: 5; margin-top: 1.6842rem; padding: 0.9474rem 0; background: linear-gradient(transparent, var(--bg) 30%); }
.change-actions .btn-row { margin: 0; }
.done-panel { text-align: center; }
.done-panel .round { margin: 0 auto 0.9474rem; width: 4rem; height: 4rem; background: var(--paper-ink); color: var(--paper); }
.done-panel .round .icon { width: 1.7895rem; height: 1.7895rem; }
.done-panel h1 { font-size: 2rem; }
.done-panel p { color: var(--paper-ink2); margin-top: 0.5263rem; }
.done-panel .btn-row { justify-content: center; }

/* ================================================================ help */

.phone-card { display: flex; align-items: center; gap: 0.9474rem; flex-wrap: wrap; }
.phone-card .round { width: 2.9474rem; height: 2.9474rem; }
.phone-big { font-size: 1.5rem; font-weight: 700; text-decoration: none; letter-spacing: -0.01em; font-variant-numeric: tabular-nums; }
.phone-big:hover { text-decoration: underline; text-underline-offset: 0.2632rem; }

/* ================================================================ More sheet (phone) */

.more-list { display: flex; flex-direction: column; gap: 0.3158rem; }
.more-group + .more-group { margin-top: 0.9474rem; }
.more-group-label { padding: 0 0.3158rem 0.4211rem; font-size: var(--fs-label); font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--ink3); }
.more-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.4211rem; }
.more-list .nav-item, .more-grid .nav-item {
  background: var(--s2); box-shadow: inset 0 0 0 1px var(--ring); color: var(--ink);
  min-height: 3.3684rem; border-radius: var(--r-lg); padding: 0 0.8421rem;
}
.more-grid .nav-item { flex-direction: column; align-items: flex-start; justify-content: center; gap: 0.3158rem; min-height: 4.8421rem; padding: 0.7368rem 0.8421rem; line-height: 1.2; }
.more-list .nav-item[aria-current="page"]::before, .more-grid .nav-item[aria-current="page"]::before { display: none; }
.more-call { margin-top: 0.9474rem; }

/* ================================================================ responsive */

@media (max-width: 1180px) {
  .change-layout { grid-template-columns: minmax(0, 1fr); }
  .change-preview { order: -1; }
  .main { padding: 1.2632rem 1.6842rem 9.4737rem; }
  .topbar { padding: 0 1.6842rem; }
  .banners { padding: 0 1.6842rem; }
  .cols-7-5, .cols-5-7 { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 1000px) and (min-width: 761px) {
  :root { --rail: 13.0526rem; }
  .rail .brand-studio { display: none; }
  .site-thumb { height: 5.4737rem; }
}

@media (max-width: 760px) {
  :root { --top: 3.3684rem; --tab: 3.7895rem; }
  .app {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: var(--top) auto 1fr;
    grid-template-areas: "top" "banners" "main";
  }
  .rail { display: none; }
  .topbar { padding: 0 var(--gutter); gap: 0.5263rem; padding-top: env(safe-area-inset-top); height: calc(var(--top) + env(safe-area-inset-top)); }
  .topbar::after { left: var(--gutter); right: var(--gutter); }
  .topbar .brand { display: flex; padding: 0; gap: 0.5263rem; }
  .topbar .brand-word, .topbar .brand-studio { display: none; }
  .topbar .brand-mark { width: 1.5789rem; height: 1.5789rem; }
  .crumb-group, .crumb-sep { display: none; }
  /* the short screen name, so it is never cut off next to Get help; the full name stays for screen readers */
  .crumb-long { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .crumb-short { display: inline; }
  .switcher-label { display: none; }
  .switcher select { padding-left: 0.8421rem; padding-right: 2.1053rem; background-position: right 0.6316rem center; font-size: .92rem; }
  .help-pill { padding: 0 0.8421rem; }
  .banners { padding: 0 var(--gutter); }
  .main { padding: 1.0526rem var(--gutter) calc(var(--tab) + 7.8947rem + env(safe-area-inset-bottom)); }
  .viewbar { padding: 0.5263rem var(--gutter); }

  .dock {
    left: 0.5263rem; right: 0.5263rem; width: auto; transform: none;
    bottom: calc(var(--tab) + 1.1579rem + env(safe-area-inset-bottom));
    border-radius: 1.3684rem; padding: 0.4211rem 0.4211rem 0.4211rem 0.5263rem; gap: 0.6316rem;
    animation-name: dock-in-phone;
  }
  @keyframes dock-in-phone { from { opacity: 0; transform: translateY(1.2632rem); filter: blur(0.3158rem); } }
  .dock-count { width: 2.3158rem; height: 2.3158rem; font-size: 1rem; box-shadow: 0 0 0 0.2105rem var(--hi); }
  /* on a phone the count and the button say it; the words stay for screen readers */
  .dock-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .dock .btn { flex: 1; padding: 0 0.8421rem; }

  .tabbar {
    display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0.1053rem;
    position: fixed; z-index: 40; left: 0.5263rem; right: 0.5263rem; bottom: calc(0.5263rem + env(safe-area-inset-bottom));
    padding: 0.3158rem;
    border-radius: 1.4737rem;
    background: var(--glass), rgba(14, 14, 16, .82);
    -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur);
    box-shadow: var(--edge), var(--e2);
  }
  :root[data-theme="light"] .tabbar { background: rgba(255,255,255,.92); }
  .tab {
    min-height: 3.1579rem;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.1579rem;
    border: 0; background: transparent; border-radius: 1.1579rem;
    color: var(--ink2); text-decoration: none; font-size: .76rem; font-weight: 700; cursor: pointer;
    position: relative; min-width: 0; padding: 0 0.1053rem;
    transition: background var(--t) var(--ease), color var(--t) var(--ease), box-shadow var(--t) var(--ease);
  }
  .tab > span:not(.nav-badge) { max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; letter-spacing: -.02em; }
  .tab .icon { width: 1.3158rem; height: 1.3158rem; }
  .tab[aria-current="page"] { color: var(--ink); background: rgba(255,255,255,.08); box-shadow: inset 0 0 0 1px var(--ring2), 0 0 1.2632rem -0.4211rem var(--glow); }
  :root[data-theme="light"] .tab[aria-current="page"] { background: var(--s3); }
  .tab .nav-badge { position: absolute; top: 0.1579rem; right: calc(50% - 1.5789rem); min-width: 1.2632rem; height: 1.2632rem; font-size: .8rem; padding: 0 0.3158rem; }
  .toasts { top: calc(0.5263rem + env(safe-area-inset-top)); }

  .page-title, .view-head h1 { font-size: 1.85rem; }
  .greet h1 { font-size: 2rem; }
  .card, .glass { padding: 1.1579rem; border-radius: 1.2632rem; }
  .paper, .ask, .glass-hero { padding: 1.2632rem 1.0526rem; border-radius: 1.3684rem; }
  .ask-label { font-size: 1.3rem; }
  .ask .btn-row { flex-direction: column-reverse; align-items: stretch; }
  .ask-actions { flex-direction: column; }
  .ask-actions .btn, .ask .btn-row > .btn { width: 100%; }
  .grid-3, .grid-2 { grid-template-columns: minmax(0, 1fr); }
  .health a { margin-left: 0; }
  .view-head { margin-bottom: 1.2632rem; }
  .section-head { margin-top: 1.6842rem; }
  /* a quiet link that wraps under its heading lines its words up with the heading, not its padding */
  .section-head > .btn-quiet { margin-left: -0.8421rem; }
  .section-head > .btn-quiet.btn-small { margin-left: -0.9474rem; }

  .sheet { max-width: 100vw; width: 100vw; margin: auto 0 0; max-height: 92dvh; }
  .sheet-card { border-radius: 1.5789rem 1.5789rem 0 0; padding: 1.3684rem var(--gutter) calc(1.1579rem + env(safe-area-inset-bottom)); max-height: 92dvh; animation: sheet-up 420ms var(--ease); }
  .sheet-card::before { content: ''; position: absolute; top: 0.4211rem; left: 50%; width: 2.3158rem; height: 0.2632rem; margin-left: -1.1579rem; border-radius: 0.1579rem; background: var(--ring2); }
  .sheet.closing .sheet-card { animation: sheet-down 220ms var(--ease) forwards; }
  .btn-row > .btn { flex: 1 1 auto; }
  .confirm .btn-row { flex-direction: column; align-items: stretch; }

  .code-boxes { gap: 0.3158rem; }
  .code-box { height: 3.3684rem; font-size: 1.65rem; border-radius: 0.7368rem; }
  .signin .card { padding: 1.3684rem 0.9474rem; border-radius: 1.4737rem; }

  .pf-stage { height: 62vh; }
  .change-actions { position: static; background: none; padding: 0; }
  .change-actions .btn-row { flex-direction: column; align-items: stretch; }
  .reply { flex-direction: column; gap: 0.6316rem; }
  .reply .round { width: 2.3158rem; height: 2.3158rem; }
  .reply-text { padding-top: 0; font-size: 1.05rem; }
  .preview-tools .seg { width: 100%; }
  .preview-tools .seg-btn { flex: 1; justify-content: center; }
  .cx-yt, .cx-xt { font-size: 0.7368rem; }
}
@keyframes sheet-up { from { transform: translateY(100%); } }
@keyframes sheet-down { to { transform: translateY(100%); } }

/* ================================================================ still + reduced motion */

html.still *, html.still *::before, html.still *::after { animation-duration: .001ms !important; animation-delay: 0s !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; transition-delay: 0s !important; }
html.still [data-reveal], html.still .words .w { opacity: 1 !important; transform: none !important; filter: none !important; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
  [data-reveal], .words .w { opacity: 1 !important; transform: none !important; filter: none !important; }
  .backdrop b { display: none; }
  ::view-transition-old(root), ::view-transition-new(root) { animation: none; }
}

@media (forced-colors: active) {
  .btn, .chip, .card, .glass, .input, .textarea, .code-box, .dock, .tabbar { border: 1px solid CanvasText; }
  .lightring::before, .backdrop { display: none; }
}

/* ================================================================ text size switch */
.size-toggle { gap: .5rem; }
.size-glyph { font-weight: 700; letter-spacing: -.02em; font-size: 1.05em; line-height: 1; }
.size-toggle[aria-pressed="true"] { box-shadow: inset 0 0 0 1px var(--ring2), 0 0 1.2rem rgba(255,255,255,.08); }
.signin-size { display: flex; justify-content: center; margin-top: 1rem; }
.acct-size { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-top: 1.25rem; padding-top: 1.25rem; border-top: 1px solid var(--ring); flex-wrap: wrap; }
@media (max-width: 760px) {
  /* phone top bar is tight: keep just the Aa mark, with the words for screen readers */
  .topbar .size-toggle span:not(.size-glyph) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .topbar .size-toggle { min-width: var(--tap); justify-content: center; padding: 0 .75rem; }
}
