/* ==========================================================================
   Stafford Audio PWA — app stylesheet (mockup)
   Builds on brand.css tokens. Three tiers: phone (<640), tablet (640–1023), desktop (1024+).
   The store lives in daylight (cream); the player is the listening room (navy).
   ========================================================================== */
:root {
  --sb-w: 244px;            /* sidebar, desktop */
  --rail-w: 88px;           /* sidebar rail, tablet */
  --mini-h: 76px;           /* docked mini player */
  --tab-h: 64px;            /* phone tab bar */
  --gutter: 40px;
  --shelf-gap: 22px;
  --card-w: 172px;
  --cover-r: 10px;
  --cover-shadow: 0 10px 28px -10px rgba(27, 53, 96, .45), 0 2px 6px rgba(27, 53, 96, .12);
  --sheet-r: 22px;
  --safe-b: env(safe-area-inset-bottom, 0px);
}
@media (max-width: 1023px) { :root { --gutter: 28px; --card-w: 156px; } }
@media (max-width: 639px)  { :root { --gutter: 20px; --card-w: 42vw; --mini-h: 64px; --shelf-gap: 14px; } }

html { height: 100%; }
body.app { margin: 0; min-height: 100dvh; background: var(--sa-cream); color: var(--sa-navy); font-family: var(--sa-font-sans); font-size: 15px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
* { box-sizing: border-box; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
a { color: inherit; text-decoration: none; }
img, svg { display: block; }
.ic { width: 24px; height: 24px; fill: none; }
.ic use { color: inherit; }
:focus-visible { outline: 2px solid var(--sa-ocean); outline-offset: 3px; border-radius: 4px; }
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* Shell ---------------------------------------------------------------- */
.shell { display: grid; grid-template-columns: var(--sb-w) 1fr; min-height: 100dvh; }
.sidebar { position: sticky; top: 0; height: 100dvh; padding: 28px 20px 0; background: var(--sa-white); border-right: 1px solid var(--sa-line); display: flex; flex-direction: column; }
.sidebar .brand { padding: 4px 6px 28px; }
.sidebar .brand img { height: 44px; width: auto; }
.sidebar .brand .mk { display: none; }
.nav a { display: flex; align-items: center; gap: 14px; padding: 11px 12px; border-radius: 10px; font-weight: 500; color: var(--sa-slate); margin-bottom: 2px; }
.nav a .ic { width: 22px; height: 22px; }
.nav a:hover { background: var(--sa-sand); color: var(--sa-navy); }
.nav a.on { background: var(--sa-cream); color: var(--sa-navy); }
.nav .sep { height: 1px; background: var(--sa-line); margin: 14px 12px; }
.sidebar .foot { margin-top: auto; padding: 16px 12px 22px; font-size: 12.5px; color: var(--sa-slate); }
.main { min-width: 0; padding-bottom: calc(var(--mini-h) + 32px); }
.topbar { display: flex; align-items: center; justify-content: space-between; padding: 30px var(--gutter) 8px; }
.topbar h1 { font-family: var(--sa-font-serif); font-weight: 400; font-size: 30px; margin: 0; line-height: 1.15; }
.topbar .sub { color: var(--sa-slate); font-size: 14px; margin-top: 2px; }
.avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--sa-navy); color: var(--sa-cream); display: grid; place-items: center; font-family: var(--sa-font-serif); font-size: 17px; }
.content { padding: 8px var(--gutter) 0; max-width: 1240px; }
.back { display: inline-flex; align-items: center; gap: 4px; color: var(--sa-slate); font-weight: 500; font-size: 14px; margin: 24px 0 8px; }
.back .ic { width: 20px; height: 20px; }

/* Tablet: rail */
@media (max-width: 1023px) {
  .shell { grid-template-columns: var(--rail-w) 1fr; }
  .sidebar { padding: 22px 12px 0; align-items: center; }
  .sidebar .brand .full { display: none; }
  .sidebar .brand .mk { display: block; height: 40px; }
  .sidebar .brand { padding-bottom: 22px; }
  .nav a { flex-direction: column; gap: 5px; padding: 10px 6px; font-size: 11.5px; width: 64px; text-align: center; }
  .sidebar .foot { display: none; }
}
/* Phone: no sidebar, tab bar */
@media (max-width: 639px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .main { padding-bottom: calc(var(--mini-h) + var(--tab-h) + var(--safe-b) + 16px); }
  .topbar { padding: 22px var(--gutter) 6px; }
  .topbar h1 { font-size: 26px; }
}
.tabbar { display: none; }
@media (max-width: 639px) {
  .tabbar { display: flex; position: fixed; left: 0; right: 0; bottom: 0; height: calc(var(--tab-h) + var(--safe-b)); padding-bottom: var(--safe-b); background: rgba(255,255,255,.92); backdrop-filter: blur(16px); border-top: 1px solid var(--sa-line); z-index: 30; }
  .tabbar a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 11px; font-weight: 500; color: var(--sa-slate); }
  .tabbar a.on { color: var(--sa-navy); }
  .tabbar .ic { width: 24px; height: 24px; }
}

/* Continue-listening hero ---------------------------------------------- */
.hero { display: grid; grid-template-columns: 168px 1fr auto; gap: 28px; align-items: center; background: var(--sa-navy); color: var(--sa-cream); border-radius: 18px; padding: 24px 28px 24px 24px; margin: 18px 0 8px; }
.hero .cover { width: 168px; border-radius: var(--cover-r); box-shadow: 0 12px 30px -12px rgba(0,0,0,.6); }
.hero .kicker { font-size: 13px; color: var(--sa-mist); margin-bottom: 8px; }
.hero h2 { font-family: var(--sa-font-serif); font-weight: 400; font-size: 28px; margin: 0 0 4px; line-height: 1.15; }
.hero .chap { color: var(--sa-mist); font-size: 15px; }
.hero .prog { margin-top: 18px; display: flex; align-items: center; gap: 12px; font-size: 12.5px; color: var(--sa-mist); }
.hero .bar { flex: 1; height: 4px; border-radius: 2px; background: rgba(244,236,225,.18); overflow: hidden; }
.hero .bar i { display: block; height: 100%; width: 58%; background: var(--sa-brass); border-radius: 2px; }
.playbig { width: 76px; height: 76px; border-radius: 50%; background: var(--sa-brass); color: var(--sa-navy); display: grid; place-items: center; box-shadow: inset 0 0 0 2px rgba(107,74,36,.55); transition: transform .2s var(--sa-ease); }
.playbig .ic { width: 34px; height: 34px; margin-left: 4px; }
.playbig:hover { transform: scale(1.04); }
@media (max-width: 1023px) { .hero { grid-template-columns: 132px 1fr auto; gap: 20px; padding: 20px; } .hero .cover { width: 132px; } .hero h2 { font-size: 24px; } }
@media (max-width: 639px) {
  .hero { grid-template-columns: 92px 1fr 48px; gap: 14px; padding: 14px; border-radius: 16px; margin: 14px 0 4px; }
  .hero .cover { width: 92px; }
  .hero h2 { font-size: 19px; }
  .hero .chap { font-size: 13.5px; }
  .hero .prog { margin-top: 10px; }
  .hero .playbig { width: 48px; height: 48px; }
  .hero .playbig .ic { width: 22px; height: 22px; margin-left: 3px; }
}

/* Shelves ---------------------------------------------------------------- */
.shelf { margin: 30px 0 0; }
.shelf-h { display: flex; align-items: baseline; justify-content: space-between; margin: 0 0 14px; }
.shelf-h h2 { font-family: var(--sa-font-serif); font-weight: 400; font-size: 22px; margin: 0; }
.shelf-h a { font-size: 14px; font-weight: 500; color: var(--sa-bronze); }
.row { display: flex; gap: var(--shelf-gap); overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding-inline: var(--gutter); padding: 6px var(--gutter) 18px; margin: 0 calc(-1 * var(--gutter)); scrollbar-width: none; }
.row::-webkit-scrollbar { display: none; }
.card { flex: 0 0 var(--card-w); scroll-snap-align: start; }
.card .cov { position: relative; border-radius: var(--cover-r); overflow: hidden; box-shadow: var(--cover-shadow); aspect-ratio: 1; }
.card .cov img { width: 100%; height: 100%; }
.pill { position: absolute; left: 10px; top: 10px; font-size: 11.5px; font-weight: 500; padding: 4px 9px; border-radius: 999px; background: rgba(244,236,225,.94); color: var(--sa-navy); }
.pill.price { background: rgba(27,53,96,.92); color: var(--sa-cream); }
.pill.owned { background: rgba(201,162,75,.95); color: var(--sa-navy); display: inline-flex; align-items: center; gap: 4px; }
.pill .ic { width: 13px; height: 13px; }
.card h3 { font-family: var(--sa-font-serif); font-weight: 400; font-size: 15px; line-height: 1.3; margin: 12px 0 5px; }
.tag { display: inline-block; font-size: 11px; font-weight: 500; line-height: 18px; padding: 0 8px; border-radius: 999px; background: var(--sa-white); color: var(--sa-navy); box-shadow: inset 0 0 0 1px var(--sa-line); margin-right: 7px; vertical-align: 1px; }
.tag.price { background: var(--sa-navy); color: var(--sa-cream); box-shadow: none; }
.tag.owned { background: var(--sa-brass); color: var(--sa-navy); box-shadow: none; }
.card .meta { font-size: 12.5px; color: var(--sa-slate); }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(var(--card-w), 1fr)); gap: 26px var(--shelf-gap); padding: 6px 0 18px; }
.grid .card { flex: none; }

/* List rows (library, continue listening on wide screens) ---------------- */
.rows { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 22px; }
@media (max-width: 1023px) { .rows { grid-template-columns: 1fr; } }
.lrow { display: grid; grid-template-columns: 72px 1fr auto; gap: 16px; align-items: center; background: var(--sa-white); border-radius: 14px; padding: 12px; }
.lrow img { width: 72px; border-radius: 8px; }
.lrow h3 { font-family: var(--sa-font-serif); font-weight: 400; font-size: 16px; margin: 0 0 2px; }
.lrow .meta { font-size: 13px; color: var(--sa-slate); }
.lrow .bar { height: 3px; border-radius: 2px; background: var(--sa-line); margin-top: 10px; overflow: hidden; }
.lrow .bar i { display: block; height: 100%; background: var(--sa-brass); }
.lrow .go { width: 44px; height: 44px; border-radius: 50%; background: var(--sa-cream); display: grid; place-items: center; color: var(--sa-navy); }
.lrow .go .ic { width: 22px; height: 22px; margin-left: 2px; }
.seg { display: inline-flex; background: var(--sa-white); border-radius: 999px; padding: 4px; margin: 12px 0 20px; }
.seg button { padding: 8px 18px; border-radius: 999px; font-weight: 500; font-size: 14px; color: var(--sa-slate); }
.seg button.on { background: var(--sa-navy); color: var(--sa-cream); }
.empty { text-align: center; padding: 56px 20px; color: var(--sa-slate); max-width: 420px; margin: 0 auto; }
.empty img { width: 64px; margin: 0 auto 16px; opacity: .9; }
.empty h3 { font-family: var(--sa-font-serif); font-weight: 400; color: var(--sa-navy); font-size: 20px; margin: 0 0 6px; }

/* Buttons ---------------------------------------------------------------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 48px; padding: 0 22px; border-radius: 999px; font-weight: 500; font-size: 15px; white-space: nowrap; }
.btn .ic { width: 20px; height: 20px; }
.btn-primary { background: var(--sa-navy); color: var(--sa-cream); }
.btn-primary:hover { background: var(--sa-deep); }
.btn-gold { background: var(--sa-brass); color: var(--sa-navy); box-shadow: inset 0 0 0 1.5px rgba(107,74,36,.45); }
.btn-ghost { box-shadow: inset 0 0 0 1.5px var(--sa-line); color: var(--sa-navy); background: var(--sa-white); }
.btn-sm { height: 38px; padding: 0 16px; font-size: 14px; }
.btn-lg { height: 54px; padding: 0 28px; font-size: 16px; }

/* Title detail ------------------------------------------------------------ */
.detail-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 12px 0 4px; }
.detail-bar .back { margin-top: 0; margin-bottom: 0; }
.detail-bar .share-btn { flex: none; }
.detail { display: grid; grid-template-columns: 300px 1fr; gap: 40px; margin-top: 8px; }
.detail .cover { width: 300px; border-radius: 14px; box-shadow: var(--cover-shadow); }
.detail .type { font-size: 13.5px; color: var(--sa-bronze); font-weight: 500; }
.detail h1 { font-family: var(--sa-font-serif); font-weight: 400; font-size: 38px; margin: 6px 0 6px; line-height: 1.1; }
.detail .by { color: var(--sa-slate); font-size: 15px; }
.detail .facts { display: flex; flex-wrap: wrap; gap: 8px 22px; margin: 16px 0 18px; font-size: 14px; color: var(--sa-slate); }
.detail .facts b { color: var(--sa-navy); font-weight: 500; }
.detail p.desc { font-size: 16px; line-height: 1.65; max-width: 620px; }
.detail .cta { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin: 22px 0 6px; }
.detail .cta .note { width: 100%; font-size: 13px; color: var(--sa-slate); }
.chapters { margin-top: 40px; max-width: 760px; }
.chapters h2 { font-family: var(--sa-font-serif); font-weight: 400; font-size: 22px; margin: 0 0 8px; }
.chapters ol { list-style: none; margin: 0; padding: 0; }
.chapters li { display: grid; grid-template-columns: 32px 1fr auto auto; align-items: center; gap: 14px; padding: 13px 4px; border-top: 1px solid var(--sa-line); }
.chapters li:last-child { border-bottom: 1px solid var(--sa-line); }
.chapters .n { color: var(--sa-slate); font-size: 14px; }
.chapters .name { font-size: 15.5px; }
.chapters .dur { color: var(--sa-slate); font-size: 13.5px; }
.chapters .ic { width: 22px; height: 22px; color: var(--sa-slate); }
.chapters li.on .name { font-weight: 500; }
.chapters li.on .ic { color: var(--sa-navy); }
@media (max-width: 1023px) { .detail { grid-template-columns: 240px 1fr; gap: 28px; } .detail .cover { width: 240px; } .detail h1 { font-size: 32px; } }
@media (max-width: 639px) {
  .detail { grid-template-columns: 1fr; gap: 18px; }
  .detail .cover { width: 70%; max-width: 280px; margin: 0 auto; }
  .detail .head { text-align: center; }
  .detail .facts { justify-content: center; gap: 6px 16px; }
  .detail h1 { font-size: 30px; }
  .detail .cta { justify-content: center; }
  .detail .cta .btn { width: 100%; }
  .detail .cta .btn-ghost { width: auto; }
  .detail .cta .note { text-align: center; }
  .detail p.desc { font-size: 15.5px; }
}

/* Mini player ------------------------------------------------------------- */
.mini { position: fixed; left: var(--sb-w); right: 0; bottom: 0; height: var(--mini-h); background: var(--sa-navy); color: var(--sa-cream); display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 18px; padding: 0 24px 0 16px; z-index: 20; }
.mini::before { content: ""; position: absolute; left: 0; top: 0; height: 2px; width: 58%; background: var(--sa-brass); }
.mini .who { display: flex; align-items: center; gap: 14px; min-width: 0; }
.mini .who img { width: 52px; height: 52px; border-radius: 6px; }
.mini, .mini:hover { color: var(--sa-cream); }
.mini .t { color: var(--sa-cream); font-family: var(--sa-font-serif); font-size: 15.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini .c { font-size: 12.5px; color: var(--sa-mist); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini .tp { display: flex; align-items: center; justify-content: center; gap: 22px; }
.mini .tp button { color: var(--sa-cream); width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; }
.mini .tp .ic { width: 26px; height: 26px; }
.mini .tp .pp { width: 46px; height: 46px; background: var(--sa-brass); color: var(--sa-navy); box-shadow: inset 0 0 0 1.5px rgba(107,74,36,.55); }
.mini .tp .pp .ic { width: 24px; height: 24px; }
.mini .aux { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--sa-mist); }
.mini .aux .spd { padding: 5px 10px; border-radius: 999px; border: 1px solid rgba(244,236,225,.25); color: var(--sa-cream); font-weight: 500; font-size: 12.5px; }
.mini .aux .ic { width: 20px; height: 20px; }
@media (max-width: 1023px) { .mini { left: var(--rail-w); } .mini .aux .time { display: none; } }
@media (max-width: 639px) {
  .mini { left: 10px; right: 10px; bottom: calc(var(--tab-h) + var(--safe-b) + 8px); border-radius: 14px; height: var(--mini-h); padding: 0 10px 0 8px; gap: 10px; box-shadow: 0 12px 30px -10px rgba(27,53,96,.55); overflow: hidden; }
  .mini::before { left: 0; }
  .mini .who img { width: 46px; height: 46px; }
  .mini .tp { gap: 4px; }
  .mini .tp .skb, .mini .tp .skf { display: none; }
  .mini .tp .pp { width: 42px; height: 42px; }
  .mini .aux { display: none; }
}

/* The listening room (full player) --------------------------------------- */
body.room { background: var(--sa-navy); color: var(--sa-cream); }
body.room h1, body.room h2, body.room h3 { color: var(--sa-cream); }
body.room .sheet h1, body.room .sheet h2 { color: var(--sa-navy); }
.hero h2 { color: var(--sa-cream); }
.room-top { display: flex; align-items: center; justify-content: space-between; padding: 22px 28px 0; }
.room-top .lab { font-size: 13px; color: var(--sa-mist); }
.room-top button { color: var(--sa-cream); width: 44px; height: 44px; display: grid; place-items: center; border-radius: 50%; }
.stage { display: grid; grid-template-columns: minmax(0, 640px) 340px; gap: 56px; justify-content: center; padding: 24px 40px 40px; min-height: calc(100dvh - 70px); align-items: center; }
.np { display: flex; flex-direction: column; align-items: center; text-align: center; }
.np .cover { width: min(360px, 100%); border-radius: 14px; box-shadow: 0 24px 60px -20px rgba(0,0,0,.7); margin: 8px 0 30px; }
.np .cnum { font-size: 13px; color: var(--sa-mist); }
.np h1 { font-family: var(--sa-font-serif); font-weight: 400; font-size: 30px; margin: 6px 0 4px; line-height: 1.15; }
.np .cname { font-size: 16px; color: var(--sa-mist); }
.scrub { width: 100%; max-width: 560px; margin: 34px 0 6px; }
.scrub .track { position: relative; height: 4px; border-radius: 2px; background: rgba(244,236,225,.18); }
.scrub .track .fill { position: absolute; left: 0; top: 0; height: 100%; width: 32%; border-radius: 2px; background: var(--sa-brass); }
.scrub .track .tick { position: absolute; top: -3px; width: 1.5px; height: 10px; background: rgba(244,236,225,.45); }
.scrub .track .knob { position: absolute; top: 50%; left: 32%; width: 16px; height: 16px; border-radius: 50%; background: var(--sa-cream); transform: translate(-50%, -50%); box-shadow: 0 2px 6px rgba(0,0,0,.4); }
.scrub .times { display: flex; justify-content: space-between; font-size: 12.5px; color: var(--sa-mist); margin-top: 10px; font-variant-numeric: tabular-nums; }
.transport { display: flex; align-items: center; justify-content: center; gap: 26px; margin: 24px 0 26px; }
.transport button { color: var(--sa-cream); width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; }
.transport button:hover { background: rgba(244,236,225,.08); }
.transport .ic { width: 30px; height: 30px; }
.transport .sk .ic { width: 26px; height: 26px; }
.transport .pp { width: 88px; height: 88px; background: var(--sa-brass); color: var(--sa-navy); box-shadow: inset 0 0 0 2px rgba(107,74,36,.6), 0 12px 30px -10px rgba(201,162,75,.6); }
.transport .pp .ic { width: 40px; height: 40px; }
.transport .pp.playing .ic { margin-left: 0; }
.transport .pp .ic.play { margin-left: 5px; }
.aux { display: flex; justify-content: center; gap: 12px; flex-wrap: wrap; }
.aux button { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 16px; border-radius: 999px; border: 1px solid rgba(244,236,225,.22); color: var(--sa-cream); font-size: 14px; font-weight: 500; }
.aux button.on { background: rgba(201,162,75,.16); border-color: rgba(201,162,75,.6); color: var(--sa-straw); }
.aux .ic { width: 20px; height: 20px; }
.chlist { background: rgba(244,236,225,.06); border: 1px solid rgba(244,236,225,.12); border-radius: 18px; padding: 8px 6px; align-self: center; max-height: 72vh; overflow: auto; margin-top: 8px; width: 100%; }
.chlist h2 { font-family: var(--sa-font-serif); font-weight: 400; font-size: 18px; margin: 12px 14px 8px; }
.chlist ol { list-style: none; padding: 0; margin: 0; }
.chlist li { display: grid; grid-template-columns: 26px 1fr auto; gap: 12px; align-items: center; padding: 11px 14px; border-radius: 10px; font-size: 14.5px; color: var(--sa-mist); }
.chlist li.on { background: rgba(201,162,75,.14); color: var(--sa-cream); }
.chlist li.on .n { color: var(--sa-brass); }
.chlist li.done { color: rgba(169,196,232,.55); }
.chlist .n { font-size: 13px; }
.chlist .d { font-size: 12.5px; font-variant-numeric: tabular-nums; }
@media (max-width: 1023px) {
  .stage { grid-template-columns: minmax(0, 620px); gap: 28px; padding: 16px 32px 48px; }
  .chlist { margin-top: 12px; }
}
@media (max-width: 639px) {
  .room-top { padding: 14px 12px 0; }
  .stage { padding: 6px 22px 40px; gap: 18px; min-height: calc(100dvh - 60px); }
  .np .cover { width: min(78vw, 340px); margin: 6px 0 22px; }
  .np h1 { font-size: 25px; }
  .np .cname { font-size: 15px; }
  .scrub { margin-top: 26px; }
  .transport { gap: 14px; margin: 18px 0 22px; }
  .transport .pp { width: 80px; height: 80px; }
  .transport button { width: 48px; height: 48px; }
  .aux { gap: 8px; }
  .aux button { padding: 0 12px; height: 38px; font-size: 13px; gap: 6px; }
  .chlist { display: none; }
}

/* Sheets (phone) / dialogs (tablet, desktop) ------------------------------- */
.scrim { position: fixed; inset: 0; background: rgba(9,20,40,.55); z-index: 40; }
.sheet { position: fixed; left: 0; right: 0; bottom: 0; background: var(--sa-white); color: var(--sa-navy); border-radius: var(--sheet-r) var(--sheet-r) 0 0; padding: 10px 20px calc(24px + var(--safe-b)); z-index: 50; max-height: 84dvh; overflow: auto; }
.sheet .handle { width: 40px; height: 4px; border-radius: 2px; background: var(--sa-line); margin: 0 auto 16px; }
.sheet h2 { font-family: var(--sa-font-serif); font-weight: 400; font-size: 21px; margin: 0 0 4px; }
.sheet .sub { color: var(--sa-slate); font-size: 13.5px; margin-bottom: 14px; }
@media (min-width: 640px) {
  .sheet { left: 50%; right: auto; bottom: auto; top: 50%; transform: translate(-50%, -50%); width: 440px; border-radius: 22px; padding: 22px 24px 24px; max-height: 80dvh; }
  .sheet .handle { display: none; }
}
.opt { display: flex; align-items: center; justify-content: space-between; padding: 14px 4px; border-top: 1px solid var(--sa-line); font-size: 15.5px; }
.opt:first-of-type { border-top: 0; }
.opt .r { width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid var(--sa-line); }
.opt.on .r { border: 7px solid var(--sa-navy); }
.opt .s { color: var(--sa-slate); font-size: 13.5px; }
.chsheet li { display: grid; grid-template-columns: 26px 1fr auto; gap: 12px; align-items: center; padding: 13px 6px; border-top: 1px solid var(--sa-line); font-size: 15px; }
.chsheet li:first-child { border-top: 0; }
.chsheet li.on { color: var(--sa-navy); font-weight: 500; }
.chsheet li.on .n { color: var(--sa-bronze); }
.chsheet li.done { color: var(--sa-slate); }
.chsheet .n, .chsheet .d { font-size: 13px; color: var(--sa-slate); font-variant-numeric: tabular-nums; }
.speed .big { font-family: var(--sa-font-serif); font-size: 44px; text-align: center; margin: 6px 0 14px; }
.speed .slider { position: relative; height: 4px; background: var(--sa-line); border-radius: 2px; margin: 18px 10px 10px; }
.speed .slider .fill { position: absolute; left: 0; top: 0; height: 100%; width: 33%; background: var(--sa-brass); border-radius: 2px; }
.speed .slider .knob { position: absolute; left: 33%; top: 50%; width: 26px; height: 26px; border-radius: 50%; background: var(--sa-white); transform: translate(-50%, -50%); box-shadow: 0 2px 8px rgba(27,53,96,.35), inset 0 0 0 1.5px var(--sa-line); }
.speed .ends { display: flex; justify-content: space-between; font-size: 12.5px; color: var(--sa-slate); margin: 0 10px 18px; }
.speed .presets { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; }
.speed .presets button { height: 40px; border-radius: 10px; background: var(--sa-cream); font-weight: 500; font-size: 14px; }
.speed .presets button.on { background: var(--sa-navy); color: var(--sa-cream); }

/* Sign in ------------------------------------------------------------------- */
body.auth { background: var(--sa-cream); }
.auth-wrap { display: grid; grid-template-columns: 1fr 1fr; min-height: 100dvh; }
.auth-side { background: var(--sa-navy); color: var(--sa-cream); display: flex; flex-direction: column; justify-content: space-between; padding: 44px 48px; }
.auth-side .lockup { width: 300px; }
.auth-side .tagline { font-family: var(--sa-font-serif); font-size: 34px; line-height: 1.2; max-width: 420px; }
.auth-side .tagline small { display: block; font-family: var(--sa-font-sans); font-size: 15px; color: var(--sa-mist); margin-top: 14px; line-height: 1.55; }
.auth-form { display: flex; align-items: center; justify-content: center; padding: 40px 32px; }
.auth-card { width: 100%; max-width: 400px; }
.auth-card h1 { font-family: var(--sa-font-serif); font-weight: 400; font-size: 30px; margin: 0 0 6px; }
.auth-card .lead { color: var(--sa-slate); margin: 0 0 26px; font-size: 15px; }
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 13.5px; font-weight: 500; margin-bottom: 6px; }
.field input, .field textarea, .field select { width: 100%; height: 50px; border-radius: 12px; border: 1.5px solid var(--sa-line); background: var(--sa-white); padding: 0 16px; font: inherit; font-size: 15.5px; color: var(--sa-navy); }
.field textarea { height: auto; padding: 12px 16px; min-height: 120px; resize: vertical; line-height: 1.5; }
.field input:focus { border-color: var(--sa-ocean); outline: none; box-shadow: 0 0 0 3px rgba(74,116,184,.18); }
.field .hint { font-size: 12.5px; color: var(--sa-slate); margin-top: 6px; }
.codes { display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; margin: 18px 0 20px; }
.codes div { height: 58px; border-radius: 12px; border: 1.5px solid var(--sa-line); background: var(--sa-white); display: grid; place-items: center; font-family: var(--sa-font-serif); font-size: 26px; }
.codes div.on { border-color: var(--sa-ocean); box-shadow: 0 0 0 3px rgba(74,116,184,.18); }
.auth-card .btn { width: 100%; }
.or { display: flex; align-items: center; gap: 12px; color: var(--sa-slate); font-size: 13px; margin: 18px 0; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--sa-line); }
.auth-card .fine { font-size: 12.5px; color: var(--sa-slate); margin-top: 18px; line-height: 1.5; }
.auth-card .fine a { color: var(--sa-deep); text-decoration: underline; }
@media (max-width: 1023px) { .auth-wrap { grid-template-columns: 1fr 1.2fr; } .auth-side { padding: 36px; } .auth-side .tagline { font-size: 28px; } .auth-side .lockup { width: 240px; } }
@media (max-width: 639px) {
  .auth-wrap { grid-template-columns: 1fr; }
  .auth-side { padding: 28px 24px 30px; gap: 18px; }
  .auth-side .lockup { width: 190px; }
  .auth-side .tagline { font-size: 22px; } .auth-side .tagline small { font-size: 14px; margin-top: 8px; }
  .auth-side .foot { display: none; }
  .auth-form { padding: 28px 22px 40px; align-items: flex-start; }
}

/* Admin ----------------------------------------------------------------------- */
.admin .topbar h1 { font-size: 28px; }
.table { width: 100%; border-collapse: collapse; background: var(--sa-white); border-radius: 14px; overflow: hidden; }
.table th { text-align: left; font-size: 12.5px; font-weight: 500; color: var(--sa-slate); padding: 12px 14px; border-bottom: 1px solid var(--sa-line); }
.table td { padding: 12px 14px; border-bottom: 1px solid var(--sa-line); font-size: 14.5px; vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table .tt { display: flex; align-items: center; gap: 12px; }
.table .tt img { width: 44px; height: 44px; border-radius: 6px; }
.table .tt b { font-family: var(--sa-font-serif); font-weight: 400; font-size: 15.5px; display: block; }
.table .tt span { font-size: 12.5px; color: var(--sa-slate); }
.status { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 500; padding: 4px 10px; border-radius: 999px; background: var(--sa-cream); }
.status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--sa-slate); }
.status.live::before { background: #2E8B57; }
.status.draft::before { background: var(--sa-brass); }
.table .act { display: flex; gap: 6px; justify-content: flex-end; }
.table .act button { width: 36px; height: 36px; border-radius: 8px; display: grid; place-items: center; color: var(--sa-slate); }
.table .act button:hover { background: var(--sa-cream); color: var(--sa-navy); }
.form { display: grid; grid-template-columns: 1.15fr .85fr; gap: 28px; align-items: start; margin-top: 10px; }
.panel { background: var(--sa-white); border-radius: 16px; padding: 22px 22px 8px; }
.panel h2 { font-family: var(--sa-font-serif); font-weight: 400; font-size: 19px; margin: 0 0 16px; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.toggle { display: flex; align-items: center; justify-content: space-between; padding: 12px 0; border-top: 1px solid var(--sa-line); font-size: 14.5px; }
.toggle .sw { width: 44px; height: 26px; border-radius: 13px; background: var(--sa-line); position: relative; }
.toggle .sw::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.toggle .sw.on { background: var(--sa-navy); }
.toggle .sw.on::after { left: 21px; }
.drop { border: 1.5px dashed var(--sa-line); border-radius: 12px; padding: 18px; display: flex; align-items: center; gap: 16px; margin-bottom: 16px; }
.drop img { width: 84px; height: 84px; border-radius: 8px; }
.drop .ic { width: 28px; height: 28px; color: var(--sa-slate); }
.drop b { display: block; font-weight: 500; font-size: 14.5px; }
.drop span { font-size: 13px; color: var(--sa-slate); }
.chtable { width: 100%; border-collapse: collapse; margin-bottom: 8px; }
.chtable th { text-align: left; font-size: 12px; color: var(--sa-slate); font-weight: 500; padding: 4px 8px 8px; }
.chtable td { padding: 6px 8px; border-top: 1px solid var(--sa-line); }
.chtable input { height: 40px; border-radius: 8px; border: 1.5px solid var(--sa-line); padding: 0 10px; font: inherit; font-size: 14px; width: 100%; color: var(--sa-navy); }
.chtable .mono { font-variant-numeric: tabular-nums; width: 96px; }
.chtable .ic { width: 20px; height: 20px; color: var(--sa-slate); }
.formbar { position: sticky; bottom: 0; margin: 20px calc(-1 * var(--gutter)) 0; padding: 14px var(--gutter); background: rgba(244,236,225,.94); backdrop-filter: blur(12px); border-top: 1px solid var(--sa-line); display: flex; justify-content: flex-end; gap: 10px; }
.admin .main { padding-bottom: 0; }
@media (max-width: 1023px) { .form { grid-template-columns: 1fr; } }
@media (max-width: 639px) { .table th:nth-child(3), .table td:nth-child(3), .table th:nth-child(5), .table td:nth-child(5) { display: none; } .two { grid-template-columns: 1fr; } .formbar { position: sticky; } }

/* Toasts, install banner, misc --------------------------------------------- */
.toast { position: fixed; left: 50%; bottom: calc(var(--mini-h) + 20px); transform: translateX(-50%); background: var(--sa-navy); color: var(--sa-cream); padding: 12px 18px; border-radius: 999px; font-size: 14px; display: inline-flex; align-items: center; gap: 10px; box-shadow: 0 12px 30px -10px rgba(27,53,96,.6); z-index: 60; }
.toast .ic { width: 18px; height: 18px; color: var(--sa-brass); }
@media (max-width: 639px) { .toast { bottom: calc(var(--mini-h) + var(--tab-h) + var(--safe-b) + 20px); white-space: nowrap; } }
.install { display: flex; align-items: center; gap: 14px; background: var(--sa-white); border-radius: 14px; padding: 12px 14px; margin: 14px 0 2px; }
.install img { width: 40px; height: 40px; border-radius: 9px; }
.install b { display: block; font-size: 14px; font-weight: 500; }
.install span { font-size: 12.5px; color: var(--sa-slate); }
.install .btn { margin-left: auto; }

/* Callout badges (annotation mode only) ------------------------------------- */
.co { position: absolute; width: 24px; height: 24px; border-radius: 50%; background: #C0392B; color: #fff; font: 600 12px/24px Inter, sans-serif; text-align: center; box-shadow: 0 0 0 2.5px #fff, 0 4px 10px rgba(0,0,0,.3); z-index: 999; pointer-events: none; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
