/* ============================================================
   Drowsli — "Quiet Paper & Line" design
   Paper #F7F6F2 · teal accent #3D9B80 · Inter · Lucide icons
   Icons render as CSS masks (background-color: currentColor)
   so they recolor live with state.
   ============================================================ */

:root{
  color-scheme:light;
  --paper:#F7F6F2; --card:#FFFFFF;
  --ink:#22282B; --ink-2:#5E686B; --ink-3:#8D9598;
  --line:#E8E4DC;
  --accent:#3D9B80; --accent-strong:#2C7A63; --accent-soft:#E9F4F0; --accent-line:#BFE0D5;
  --accent-text:#2C7A63; --accent-tint:rgba(44,122,99,.12);
  /* liquid-fill tile (tile-spec §3/§10): --accent-deep is the active-content
     accent, darkened from --accent-text so label/icon hit WCAG AA 4.5:1 on
     both --card (#fff) and --wave-1 fill (#D6E8DE). */
  --wave-1:#D6E8DE; --wave-2:#E8F2EC; --accent-deep:#245F4E;
  --topbar-bg:rgba(247,246,242,.88);
  --danger:#C4674F; --danger-tint:rgba(196,103,79,.14);
  --floating-bg:#22282B; --floating-fg:#FFFFFF;
  --radius:13px; --radius-sm:10px;
  --shadow:0 1px 2px rgba(30,40,38,.05);
  --shadow-hover:0 8px 24px rgba(30,40,38,.09);
  --ease:cubic-bezier(.2,.6,.2,1);
  --pad:clamp(16px,4vw,28px);
  --content:1180px;
}
*{box-sizing:border-box;margin:0}
html{-webkit-text-size-adjust:100%}
body{
  font-family:'Inter',-apple-system,BlinkMacSystemFont,'Segoe UI',system-ui,sans-serif;
  background:var(--paper); color:var(--ink);
  font-size:14px; line-height:1.5;
  -webkit-font-smoothing:antialiased;
}
button{font-family:inherit}

/* viewport-height flex column: .page absorbs the leftover space
   so the intro + footer sit flush at the bottom of the viewport */
#app{min-height:100vh; display:flex; flex-direction:column}
@supports (min-height:100dvh){#app{min-height:100dvh}}

/* centered content column (max-width --content, side padding --pad) */
.wrap{width:100%; max-width:var(--content); margin:0 auto; padding-inline:var(--pad)}
.page{flex:1 0 auto; display:flex; flex-direction:column}
a{color:var(--accent-text)}

[v-cloak]{display:none!important}
[hidden]{display:none!important}

/* ---------- icons (CSS mask) ---------- */
.ico{
  display:inline-block;
  background-color:currentColor;
  -webkit-mask:var(--i) center/contain no-repeat;
  mask:var(--i) center/contain no-repeat;
}
.ico-bird{--i:url(../images/bird.svg)}
.ico-bubbles{--i:url(../images/bubbles.svg)}
.ico-bug{--i:url(../images/bug.svg)}
.ico-building-2{--i:url(../images/building-2.svg)}
.ico-circle-dashed{--i:url(../images/circle-dashed.svg)}
.ico-circle-dot{--i:url(../images/circle-dot.svg)}
.ico-cloud-drizzle{--i:url(../images/cloud-drizzle.svg)}
.ico-cloud-lightning{--i:url(../images/cloud-lightning.svg)}
.ico-cloud-rain{--i:url(../images/cloud-rain.svg)}
.ico-coffee{--i:url(../images/coffee.svg)}
.ico-droplets{--i:url(../images/droplets.svg)}
.ico-fan{--i:url(../images/fan.svg)}
.ico-fish{--i:url(../images/fish.svg)}
.ico-flame{--i:url(../images/flame.svg)}
.ico-flower-2{--i:url(../images/flower-2.svg)}
.ico-hourglass{--i:url(../images/hourglass.svg)}
.ico-leaf{--i:url(../images/leaf.svg)}
.ico-link-2{--i:url(../images/link-2.svg)}
.ico-moon{--i:url(../images/moon.svg)}
.ico-mountain{--i:url(../images/mountain.svg)}
.ico-plane{--i:url(../images/plane.svg)}
.ico-play{--i:url(../images/play.svg)}
.ico-plus{--i:url(../images/plus.svg)}
.ico-route{--i:url(../images/route.svg)}
.ico-shuffle{--i:url(../images/shuffle.svg)}
.ico-square{--i:url(../images/square.svg)}
.ico-sun{--i:url(../images/sun.svg)}
.ico-tent{--i:url(../images/tent.svg)}
.ico-timer{--i:url(../images/timer.svg)}
.ico-train-front{--i:url(../images/train-front.svg)}
.ico-tree-deciduous{--i:url(../images/tree-deciduous.svg)}
.ico-tree-palm{--i:url(../images/tree-palm.svg)}
.ico-volume-2{--i:url(../images/volume-2.svg)}
.ico-volume-x{--i:url(../images/volume-x.svg)}
.ico-washing-machine{--i:url(../images/washing-machine.svg)}
.ico-waves{--i:url(../images/waves.svg)}
.ico-wind{--i:url(../images/wind.svg)}
.ico-x{--i:url(../images/x.svg)}

/* ---------- header ---------- */
.topbar{
  position:sticky; top:0; z-index:50;
  background:var(--topbar-bg); backdrop-filter:blur(12px); -webkit-backdrop-filter:blur(12px);
  border-bottom:1px solid var(--line);
}
.topbar-inner{height:60px; display:flex; align-items:center; gap:14px}
.brand{display:flex; align-items:center; gap:10px}
.brand-mark{
  position:relative; width:32px; height:32px; padding:0; border:0;
  border-radius:10px; background:var(--accent-soft); color:var(--accent-text);
  display:grid; place-items:center; cursor:pointer;
  transition:background .14s var(--ease);
}
.brand-mark:hover{background:var(--accent-line)}
.brand-mark:active{transform:scale(.95)}
.brand-mark::after{content:''; position:absolute; inset:-6px} /* 44px hit area */
.brand-mark .ico{width:18px; height:18px}
.brand-name{font-size:17px; font-weight:650; letter-spacing:-.01em; line-height:1.5}
.brand-tag{font-size:12px; color:var(--ink-3); font-weight:500; margin-top:1px}
.topbar-actions{margin-left:auto; display:flex; align-items:center; gap:10px}
.master{
  display:flex; align-items:center; gap:8px;
  background:var(--accent-soft); border-radius:999px; padding:3px 14px 3px 3px;
}
.master.muted .master-slider{opacity:.45}
.icon-btn{
  width:32px; height:32px; border-radius:50%; border:none; background:transparent;
  color:var(--ink-2); cursor:pointer; display:grid; place-items:center;
  transition:background .14s var(--ease), color .14s var(--ease);
}
.icon-btn:hover{background:var(--accent-tint); color:var(--accent-text)}
.icon-btn .ico{width:17px; height:17px}
.timer-btn{
  display:inline-flex; align-items:center; gap:7px;
  background:transparent; color:var(--ink-2); border:none;
  border-radius:999px; padding:8px 12px; font-size:13px; font-weight:600; cursor:pointer;
  transition:background .14s var(--ease), color .14s var(--ease);
}
.timer-btn:hover{background:var(--accent-soft); color:var(--accent-text)}
.timer-btn .ico{width:15px; height:15px}
.timer-chip{
  background:var(--accent-soft); color:var(--accent-text);
  border-radius:999px; padding:2px 8px; font-size:11.5px; font-weight:650;
  font-variant-numeric:tabular-nums;
}

/* ---------- sliders ---------- */
input[type=range].slider{
  -webkit-appearance:none; appearance:none;
  height:3px; border-radius:3px; outline:none; cursor:pointer;
  background:var(--line); /* accent fill applied inline via sliderStyle() */
}
input[type=range].slider::-webkit-slider-thumb{
  -webkit-appearance:none; appearance:none;
  width:12px; height:12px; border-radius:50%;
  background:#fff; border:1.5px solid var(--accent);
  box-shadow:0 1px 2px rgba(30,40,38,.18); cursor:pointer;
}
input[type=range].slider::-moz-range-thumb{
  width:12px; height:12px; border-radius:50%;
  background:#fff; border:1.5px solid var(--accent); cursor:pointer;
}
input[type=range].slider::-moz-range-track{height:3px; border-radius:3px; background:transparent}
.master-slider{width:92px}

/* ---------- timer (topbar icon + sheet card; the old sticky panel is gone) ---------- */
.timer-icon{
  display:none; align-items:center; gap:6px; height:32px; padding:0 8px;
  border:none; border-radius:999px; background:transparent; color:var(--ink-2);
  cursor:pointer; transition:background .14s var(--ease), color .14s var(--ease);
}
.timer-icon:hover{background:var(--accent-soft); color:var(--accent-text)}
.timer-icon .ico{width:17px; height:17px}
.micro{
  display:block; font-size:10.5px; font-weight:650; letter-spacing:.08em;
  text-transform:uppercase; color:var(--ink-3); margin-bottom:7px;
}
.seg{display:flex; flex-wrap:wrap; gap:8px}
.chipbtn{
  border:1px solid transparent; background:transparent; color:var(--ink-2);
  border-radius:999px; padding:7px 12px; font-size:12.5px; font-weight:600; cursor:pointer;
  display:inline-flex; align-items:center; gap:6px;
  transition:background .14s var(--ease), color .14s var(--ease), border-color .14s var(--ease);
}
.chipbtn .ico{width:14px; height:14px}
.chipbtn:hover{background:var(--accent-soft); color:var(--accent-text)}
.chipbtn.on{background:var(--accent-strong); border-color:var(--accent-strong); color:#fff}
.phase{font-size:12.5px; font-weight:600; color:var(--ink-2); align-self:center}
.phase strong{color:var(--accent-text); font-weight:650}

/* ---------- buttons ---------- */
.btn-solid{
  background:var(--accent-strong); color:#fff; border:none;
  border-radius:999px; padding:9px 18px; font-size:13px; font-weight:600; cursor:pointer;
  transition:background .14s var(--ease);
}
.btn-solid:hover{background:#245F4E}
.btn-pill{
  background:var(--card); color:var(--ink); border:1px solid var(--line);
  border-radius:999px; padding:9px 18px; font-size:13px; font-weight:600; cursor:pointer;
}
.btn-pill:hover{border-color:var(--accent-line)}
.ghost{
  display:inline-flex; align-items:center; gap:6px;
  background:transparent; border:none; color:var(--ink-2);
  border-radius:999px; padding:8px 11px;
  font-size:12.5px; font-weight:600; cursor:pointer;
  transition:background .14s var(--ease), color .14s var(--ease);
}
.ghost:hover{background:var(--accent-soft); color:var(--accent-text)}
.ghost .ico{width:15px; height:15px}

/* ---------- toolbar ---------- */
.toolbar{
  display:flex; flex-wrap:wrap; align-items:center; gap:10px;
  margin-top: 1rem;
  padding: 4px 0;
  border-radius: var(--radius-sm);
}
.toolbar-label{
  font-size:10.5px; font-weight:650; letter-spacing:.08em; text-transform:uppercase;
  color:var(--ink-2); margin-right:2px;
}
.presets{display:flex; flex-wrap:wrap; align-items:center; gap:4px}
.divider{width:1px; height:20px; background:var(--line); margin:0 6px}
.chip-save{border-style:dashed; border-color:var(--accent-line); color:var(--accent-text); background:transparent}
.chip-save:hover{background:var(--accent-soft)}
.user-chip{padding-right:6px}
.user-chip .chip-label{
  background:none; border:none; padding:0; font:inherit; font-size:12.5px;
  font-weight:600; color:inherit; cursor:pointer; line-height:1.5;
}
.user-chip .x{
  width:18px; height:18px; border:none; border-radius:50%; background:transparent;
  color:var(--ink-3); cursor:pointer; display:grid; place-items:center; margin-left:2px;
}
.user-chip .x:hover{background:var(--danger-tint); color:var(--danger)}
.user-chip .x .ico{width:11px; height:11px}
.toolbar-right{margin-left:auto; display:flex; gap:2px}

/* ---------- save row ---------- */
.save-row{
  display:flex; flex-wrap:wrap; align-items:center; gap:10px;
  margin:12px 0 0; padding:12px 14px;
  background:var(--accent-soft); border-radius:12px;
}
.save-input{
  flex:0 1 230px; padding:9px 12px; font-size:13px; font-family:inherit; color:var(--ink);
  background:var(--card); border:1px solid var(--line); border-radius:var(--radius-sm);
}
.save-input:focus{outline:2px solid var(--accent-line); border-color:var(--accent)}
.save-hint{font-size:12px; color:var(--ink-3)}

/* ---------- the one control sheet (off-canvas) ---------- */
/* scrim sits above the sticky topbar (blocks it) but below toast/resume */
.scrim{
  position:fixed; inset:0; z-index:55;
  background:rgba(24,27,28,.42);
  opacity:0; pointer-events:none;
  transition:opacity .22s var(--ease);
}
.scrim.open{opacity:1; pointer-events:auto}

/* mobile: modal bottom sheet (desktop: right-hand side sheet, below) */
.sheet{
  position:fixed; z-index:80;
  left:0; right:0; bottom:0;
  max-height:min(86dvh,720px);
  display:flex; flex-direction:column;
  background:var(--paper);
  border-top:1px solid var(--line);
  border-radius:18px 18px 0 0;
  box-shadow:0 -12px 44px rgba(20,30,28,.2);
  transform:translateY(103%);
  visibility:hidden;
  transition:transform .26s var(--ease), visibility 0s linear .26s;
}
.sheet.open{transform:none; visibility:visible; transition:transform .26s var(--ease), visibility 0s}
.sheet:focus{outline:none}
.sheet-grip{width:38px; height:4px; border-radius:2px; background:var(--line); margin:8px auto 0; flex:none}
.sheet-head{
  display:flex; align-items:center; gap:12px; justify-content:space-between;
  padding:12px 16px; border-bottom:1px solid var(--line); flex:none;
}
.sheet-body{
  flex:1; overflow-y:auto; overscroll-behavior:contain;
  padding:10px 10px 18px;
  display:flex; flex-direction:column; gap:2px;
}
.sheet-foot{
  flex:none; border-top:1px solid var(--line);
  padding:11px 16px calc(12px + env(safe-area-inset-bottom));
  font-size:11.5px; color:var(--ink-2);
}
.sheet-title{
  display:block; font-size:16px; font-weight:650;
  letter-spacing:-.01em; line-height:1.35;
}
.sheet-sub{display:block; font-size:11.5px; color:var(--ink-2)}
.sheet-sec{
  padding:10px; border-radius:14px;
  display:flex; flex-direction:column; gap:8px;
  transition:background-color .45s var(--ease), box-shadow .45s var(--ease);
}
.sheet-sec .micro{margin-bottom:0}
.sheet-sec.flash{
  background:var(--accent-soft);
  box-shadow:inset 0 0 0 1px var(--accent-line);
}
.master-row{
  display:flex; align-items:center; gap:10px;
  background:var(--card); border:1px solid var(--line); border-radius:12px;
  padding:7px 12px 7px 7px;
}
.master-row .slider{flex:1; min-width:0}
.master-row.muted .slider{opacity:.45}
.master-val{
  font-size:11.5px; font-weight:650; color:var(--ink-2);
  font-variant-numeric:tabular-nums; min-width:34px; text-align:right;
}

/* timer card (inline, compact — replaces the old sticky panel) */
.timer-card{
  background:var(--card); border:1px solid var(--line); border-radius:13px;
  padding:13px; display:flex; flex-direction:column; gap:11px;
}
.timer-head{display:flex; align-items:center; gap:12px}
.cd{flex:1; display:flex; flex-direction:column; gap:1px; min-width:0}
.cd-time{
  font-size:30px; font-weight:650; letter-spacing:-.02em; line-height:1.1;
  font-variant-numeric:tabular-nums;
}
.cd-sub{font-size:11.5px; font-weight:500; color:var(--ink-2)}
.timer-rule{height:1px; background:var(--line)}
.timer-card .chipbtn{padding:7px 11px}
.timer-card .btn-solid{flex:none}

/* actions as full-width rows */
.action-list{border-top:1px solid var(--line); margin-top:2px}
.row-btn{
  display:flex; align-items:center; gap:10px; width:100%;
  background:transparent; border:none; border-radius:0;
  padding:12px 6px; font:inherit; font-size:13px; font-weight:600;
  color:var(--ink); text-align:left; cursor:pointer;
  border-bottom:1px solid var(--line);
  transition:background .14s var(--ease), color .14s var(--ease);
}
.row-btn .ico{width:16px; height:16px; color:var(--ink-2); transition:color .14s var(--ease)}
.row-btn:hover{background:var(--accent-soft); color:var(--accent-text)}
.row-btn:hover .ico{color:var(--accent-text)}
.row-btn:last-child{border-bottom:0}

/* mobile-only quick access in the topbar / library head */
.topbar .top-now{display:none; margin-left:0}
.top-mute{display:none}
.lib-mixes{display:none}

/* ---------- onboarding coach card (F14) ---------- */
.onb-card{
  position:fixed; left:20px; bottom:20px; z-index:58;
  width:min(340px, calc(100vw - 32px));
  background:var(--card); border:1px solid var(--line); border-radius:var(--radius);
  box-shadow:0 12px 40px rgba(20,30,28,.18);
  padding:14px 16px 12px;
  display:flex; flex-direction:column; gap:11px;
  animation:onb-in .3s var(--ease);
}
.onb-head{display:flex; align-items:center; justify-content:space-between; gap:10px}
.onb-eyebrow{
  font-size:10.5px; font-weight:650; letter-spacing:.08em;
  text-transform:uppercase; color:var(--ink-3);
}
.onb-skip{
  background:none; border:none; padding:3px 5px; font:inherit;
  font-size:12px; font-weight:600; color:var(--ink-3); cursor:pointer; border-radius:6px;
  transition:color .14s var(--ease);
}
.onb-skip:hover{color:var(--accent-text)}
.onb-body{display:flex; gap:11px; align-items:flex-start}
.onb-ic{width:20px; height:20px; color:var(--accent-text); margin-top:1px}
.onb-title{margin:0 0 2px; font-size:14px; font-weight:650; letter-spacing:-.01em; color:var(--ink)}
.onb-text{margin:0; font-size:12.5px; line-height:1.55; color:var(--ink-2)}
.onb-foot{display:flex; align-items:center; gap:10px}
.onb-count{
  font-size:11px; font-weight:650; color:var(--ink-3);
  font-variant-numeric:tabular-nums;
}
.onb-dots{display:flex; gap:5px}
.onb-dot{width:6px; height:6px; border-radius:50%; background:var(--line); transition:background .14s var(--ease)}
.onb-dot.on{background:var(--accent)}
.onb-actions{margin-left:auto; display:flex; gap:8px}
.onb-actions .btn-pill, .onb-actions .btn-solid{padding:7px 14px; font-size:12.5px}
/* soft pulsing ring on the control the step refers to */
.onb-ring{outline:2px solid var(--accent); outline-offset:3px; animation:onb-pulse 1.8s ease-in-out infinite}
@keyframes onb-pulse{0%,100%{outline-color:var(--accent)} 50%{outline-color:var(--accent-line)}}
@keyframes onb-in{from{opacity:0; transform:translateY(8px)}to{opacity:1; transform:translateY(0)}}

/* ---------- library ---------- */
.library{flex:1 0 auto; display:flex; flex-direction:column}
.library-head{
  display:flex; align-items:baseline; gap:10px;
  padding:14px 0 4px;
}
.library-title{font-size:15px; font-weight:650; letter-spacing:-.01em}
.lib-count{font-size:12px; font-weight:500; color:var(--ink-2)}
.now-pill{
  margin-left:auto;
  display:inline-flex; align-items:center; gap:6px;
  background:var(--accent-soft); color:var(--accent-text);
  border-radius:999px; padding:4px 11px;
  font-size:11.5px; font-weight:650; font-variant-numeric:tabular-nums;
}
/* "N playing" equalizer bars (the only eq indicator left — tile-spec §13
   removed the per-tile bars; keyframes `eq` kept for these) */
.eq-mini{display:flex; align-items:flex-end; gap:2px; height:8px; flex:0 0 auto}
.eq-mini span{width:2px; border-radius:2px; background:var(--accent); height:3px; animation:eq 1.1s ease-in-out infinite}
.eq-mini span:nth-child(2){animation-delay:.18s}
.eq-mini span:nth-child(3){animation-delay:.36s}
@keyframes eq{0%,100%{height:3px}50%{height:9px}}

/* ---------- grid & tiles ---------- */
.grid{
  display:grid; grid-template-columns:repeat(auto-fill,minmax(112px,1fr));
  gap:10px; margin:0; align-content:start;
  padding:6px 0 44px;
  width:100%; flex:1 0 auto;
}
.group-head{
  grid-column:1 / -1;
  display:flex; align-items:center; gap:12px;
  margin:16px 0 0;
}
.group-head:first-child{margin-top:2px}
.group-name{
  font-size:10.5px; font-weight:650; letter-spacing:.08em; text-transform:uppercase;
  color:var(--ink-2); white-space:nowrap;
}
.group-rule{flex:1; height:1px; background:var(--line)}
.group-count{
  font-size:10.5px; font-weight:650; color:var(--ink-3);
  font-variant-numeric:tabular-nums;
}
/* ---------- liquid-fill tile (soundscape-tile-spec) ----------
   Stacking order bottom→top (§2): surface 0 · fill (.f) 1 · icon+label 2 ·
   speaker (.sp) 3. The tile IS its slider: idle = quiet card with no volume
   UI, playing = liquid level + surface waves + corner speaker glyph. */
.tile{
  position:relative; overflow:hidden;      /* waves clip to the rounded corners */
  height:112px; box-sizing:border-box;
  background:var(--card); border:1px solid var(--line); border-radius:var(--radius);
  padding:18px 6px 0;
  display:flex; flex-direction:column; align-items:center;
  cursor:pointer; user-select:none; -webkit-user-select:none;
  touch-action:pan-y;                      /* §5.1 idle: page still scrolls */
  transition:border-color .25s, box-shadow .14s var(--ease), transform .14s var(--ease);
}
.tile:hover{transform:translateY(-1px); box-shadow:var(--shadow-hover); border-color:var(--accent-line)}
.tile.active{
  border-color:var(--accent-line);         /* §5.2 active border (--abd role) */
  cursor:ns-resize;
  touch-action:none;                       /* §5.2 active: drag sets volume, no scroll */
}
.tile.drag{transition:none}
.tile:focus-visible{outline:none; box-shadow:0 0 0 2px var(--accent-text)}  /* §5.5 */

/* fill body: height = effective volume (§6), eased .3s (§9.4),
   no transition while dragging so it tracks the finger 1:1 (§5.3) */
.f{
  position:absolute; left:0; right:0; bottom:0; z-index:1;
  background:var(--wave-1);
  transition:height .3s ease;
  pointer-events:none;
}
.tile.drag .f{transition:none}

/* wave surface. Horizontal loop lives on the outer .w (animation owns
   `transform` there) and amplitude scaleY on the inner .wv, so the two never
   fight over the same property (split-element fallback, §9.3). */
.w{
  position:absolute; left:0; bottom:100%;
  width:200%; height:14px;
  opacity:0; transition:opacity .3s;
  animation:wave-x var(--spd,9s) linear infinite;
  animation-play-state:paused;              /* §9.5 idle tiles don't animate */
}
.tile.active .w{opacity:1; animation-play-state:running}
.w.b{--spd:9s; animation-direction:reverse} /* back: slower, opposite direction */
.w.a{--spd:5.5s; margin-bottom:-1px}        /* front: 1px overlap avoids a seam */
.w svg{display:block; width:100%; height:100%}
.w.b path{fill:var(--wave-2)}
.w.a path{fill:var(--wave-1)}               /* front merges with the fill body */
.wv{
  width:100%; height:100%;
  transform-origin:50% 100%;
  transform:scaleY(var(--a,.5));            /* --a = 0.2..1.0, set per state (§9.3) */
  transition:transform .3s;
}
@keyframes wave-x{from{transform:translateX(0)} to{transform:translateX(-50%)}}

/* icon + label (z2): top-anchored, so a two-line label never shifts the
   icon (§11) and neither collides with the corner speaker (§4) */
.ic{
  width:36px; height:36px; line-height:1; z-index:2;
  color:var(--ink-2); opacity:.72;
  transition:opacity .25s, color .25s;
}
.tile.active .ic{opacity:1; color:var(--accent-deep)}
.l{
  margin-top:9px; max-width:100%; z-index:2;
  font-size:13px; font-weight:400; line-height:1.25;
  color:var(--ink-2); text-align:center;
  font-variant-numeric:tabular-nums;        /* live % readout stays steady (§7.4) */
  transition:color .25s;
}
.tile.active .l{color:var(--accent-deep)}

/* speaker button (z3): shown on playing tiles, doubles as mute (§7.2) */
.sp{
  position:absolute; top:7px; right:7px; z-index:3;
  width:26px; height:26px; padding:0;
  display:flex; align-items:center; justify-content:center;
  background:transparent; border:none; border-radius:8px;
  color:var(--accent-deep); cursor:pointer;
  opacity:0; pointer-events:none;           /* hidden while idle (§5.1) */
  transition:opacity .25s, background .14s;
}
.tile.active .sp{opacity:1; pointer-events:auto}
.sp:hover{background:rgba(127,127,127,.12)}
.sp:disabled{cursor:default}
.sp svg{
  width:17px; height:17px;
  fill:none; stroke:currentColor; stroke-width:1.8; stroke-linecap:round; stroke-linejoin:round;
}
/* glyph variant by data-lv (§8): 0 = mute cross · 1 = one arc · 2 = two arcs */
.sp .a1,.sp .a2,.sp .x{display:none}
.sp[data-lv="0"] .x{display:block}
.sp[data-lv="1"] .a1{display:block}
.sp[data-lv="2"] .a1,.sp[data-lv="2"] .a2{display:block}

/* the real <input type=range> stays in the DOM to hold the volume value;
   the tile renders it — the input itself never shows (project contract) */
.tile-slider{display:none}

:focus-visible{outline:2px solid var(--accent); outline-offset:2px; border-radius:6px}

/* ---------- floating ---------- */
.resume-pill{
  position:fixed; left:50%; bottom:88px; transform:translateX(-50%); z-index:60;
  display:inline-flex; align-items:center; gap:8px;
  background:var(--floating-bg); color:var(--floating-fg); border:none; border-radius:999px;
  padding:11px 18px; font-size:13px; font-weight:600; cursor:pointer;
  box-shadow:0 10px 30px rgba(20,30,28,.25); animation:rise .3s var(--ease);
}
.resume-pill .ico{width:13px; height:13px}
.toast{
  position:fixed; left:50%; bottom:26px; transform:translateX(-50%); z-index:90;
  background:var(--floating-bg); color:var(--floating-fg); border-radius:12px;
  padding:12px 18px; font-size:13px; font-weight:600; max-width:90vw;
  box-shadow:0 10px 30px rgba(20,30,28,.25); animation:rise .25s var(--ease);
}
@keyframes rise{from{opacity:0; transform:translate(-50%,8px)}to{opacity:1; transform:translate(-50%,0)}}

/* ---------- intro (SEO copy) ---------- */
.intro{
  max-width:760px; width:100%; margin:0 auto;
  padding:30px 0 34px; text-align:center;
  color:var(--ink-2); font-size:13px; line-height:1.7;
}
.intro p{margin:0}

/* ---------- footer ---------- */
.footer{
  border-top:1px solid var(--line);
  padding:26px 0 34px; text-align:center;
  color:var(--ink-3); font-size:12px; line-height:1.9;
}
.footer a{color:var(--accent-text); text-decoration:underline; text-underline-offset:2px}

/* ---------- responsive ---------- */
/* ---------- responsive ---------- */
@media (max-width:720px){
  .topbar-inner{height:56px; gap:8px}
  .topbar-actions{gap:6px}
  /* the desktop cluster lives in the sheet on mobile */
  .topbar-actions .master,
  .theme-btn,
  .timer-btn{display:none}
  .toolbar{display:none}
  .library-head .now-pill{display:none}
  .topbar .top-now{display:inline-flex}
  .top-mute{display:grid}
  .timer-icon{display:inline-flex}
  .lib-mixes{display:inline-flex; margin-left:auto}
  .onb-card{
    left:12px; right:12px; width:auto;
    bottom:calc(12px + env(safe-area-inset-bottom));
  }
}
@media (max-width:560px){
  .brand-tag{display:none}
}
@media (min-width:721px){
  /* desktop: right-hand side sheet */
  .sheet{
    left:auto; right:0; top:0; bottom:0;
    width:min(400px,92vw); max-height:none;
    border-top:0; border-left:1px solid var(--line);
    border-radius:0;
    box-shadow:0 0 48px rgba(20,30,28,.16);
    transform:translateX(103%);
  }
  .sheet-grip{display:none}
  .sheet-head{padding:14px 18px}
  .sheet-body{padding:12px 12px 20px}
  .sheet-foot{padding:12px 18px 16px}
}
@media (min-width:640px){
  .grid{gap:12px}
}
@media (min-width:992px){
  .grid{grid-template-columns:repeat(auto-fill,minmax(118px,1fr)); gap:14px}
}
@media (prefers-reduced-motion:reduce){
  *,*::before,*::after{animation:none!important; transition:opacity .15s ease!important}
  .tile:hover{transform:none}
}

/* ---------- dark theme (html[data-theme="dark"]) ---------- */
html[data-theme="dark"]{
  color-scheme:dark;
  --paper:#181B1C; --card:#212526;
  --ink:#E7E9E8; --ink-2:#A8AFB1; --ink-3:#767E80;
  --line:#2E3335;
  --accent:#4FB394; --accent-soft:#1F2E2A; --accent-line:#33514A;
  --accent-text:#63C4A6; --accent-tint:rgba(79,179,148,.14);
  /* tile-spec §3 dark wave fills + active accent (AA on #2C4639 fill / #212526 card) */
  --wave-1:#2C4639; --wave-2:#3B5D4B; --accent-deep:#63C4A6;
  --topbar-bg:rgba(24,27,28,.88);
  --floating-bg:#2A2F31;
  --shadow:0 1px 2px rgba(0,0,0,.35);
  --shadow-hover:0 8px 24px rgba(0,0,0,.5);
}
