/* DreamTalk: a night app, so the interface is dark by design. */
:root {
  --bg: #06070d;
  --bg-2: #0b0d1a;
  --ink: #ece8f4;
  --muted: #9a96b2;
  --faint: #5f5c78;
  --line: rgba(255, 255, 255, .08);
  --line-2: rgba(255, 255, 255, .14);
  --glass: rgba(255, 255, 255, .035);
  --gold: #e8cf9f;
  --gold-2: #c8a66b;
  --gold-soft: rgba(232, 207, 159, .14);
  --lav: #aa9dff;
  --rec: #ff5d73;
  --ok: #7fd1a8;
  --r: 24px;
  --serif: 'Cormorant Garamond', 'Cormorant', Georgia, 'Times New Roman', serif;
  --sans: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --safe-b: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; color: var(--ink); font: 15px/1.5 var(--sans);
  background:
    radial-gradient(1200px 600px at 50% -200px, rgba(120, 100, 255, .16), transparent 70%),
    radial-gradient(900px 500px at 110% 110%, rgba(232, 207, 159, .07), transparent 70%),
    linear-gradient(180deg, var(--bg-2), var(--bg) 60%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
.sky { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 0; opacity: .9; }
a { color: inherit; }
button { font: inherit; color: inherit; }
.i { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }

/* Cormorant uses old-style figures by default; clocks and stats need lining ones */
.display, .n-clock, .n-date, .big-num, .stat b, .slider output, .nc-title, .moon-label, h2, .clip-text, .nc-note, textarea.note { font-variant-numeric: lining-nums; }

/* ---------- layout ---------- */
.top {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between;
  padding: 12px max(16px, calc((100% - 728px) / 2));
  background: rgba(8, 9, 18, .72); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(255, 255, 255, .04);
}
.brand img { border-radius: 8px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font: 500 22px/1 var(--serif); letter-spacing: .02em; }
.view { position: relative; z-index: 1; max-width: 760px; margin: 0 auto; padding: 8px 16px calc(120px + var(--safe-b)); animation: fade .35s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.tabs {
  position: fixed; z-index: 30; left: 50%; bottom: calc(14px + var(--safe-b)); transform: translateX(-50%);
  display: flex; gap: 4px; padding: 6px; border-radius: 999px;
  background: rgba(16, 18, 32, .72); border: 1px solid var(--line); backdrop-filter: blur(18px) saturate(1.3); -webkit-backdrop-filter: blur(18px) saturate(1.3);
  box-shadow: 0 20px 50px rgba(0, 0, 0, .45);
}
.tabs a { display: flex; align-items: center; gap: 8px; padding: 10px 18px; border-radius: 999px; text-decoration: none; color: var(--muted); font-weight: 500; font-size: 14px; transition: color .2s, background .2s; }
.tabs a.on { color: var(--ink); background: rgba(255, 255, 255, .08); }
.tabs a.on .i { color: var(--gold); }
@media (max-width: 420px) { .tabs a { padding: 10px 14px; } .tabs a span { font-size: 13px; } }

/* ---------- type ---------- */
.eyebrow { margin: 0 0 10px; font-size: 11.5px; font-weight: 600; letter-spacing: .2em; text-transform: uppercase; color: var(--gold); }
.display { margin: 0; font: 400 clamp(42px, 10vw, 64px)/1 var(--serif); letter-spacing: -.01em; }
.display em { font-style: italic; color: var(--gold); }
.lede { margin: 14px 0 0; color: var(--muted); font-size: 16px; max-width: 34ch; }
h2 { margin: 0; font: 500 26px/1.15 var(--serif); }
.section-title { margin: 34px 4px 14px; font: 500 26px/1 var(--serif); }
.page-head { margin: 18px 0 24px; }

/* ---------- surfaces ---------- */
.card {
  position: relative; margin-top: 16px; padding: 20px; border-radius: var(--r);
  background: linear-gradient(180deg, rgba(255, 255, 255, .05), rgba(255, 255, 255, .018));
  border: 1px solid var(--line); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.card-head p { margin: 6px 0 0; font-size: 14px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 44px; padding: 0 18px;
  border-radius: 999px; border: 1px solid var(--line-2); background: rgba(255, 255, 255, .04);
  color: var(--ink); font-weight: 500; font-size: 14px; cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: background .2s, border-color .2s, transform .1s;
}
.btn:hover { background: rgba(255, 255, 255, .08); }
.btn:active { transform: scale(.98); }
.btn.gold { border: 0; color: #1d160a; background: linear-gradient(180deg, #f3dfb8, #d3b17a); box-shadow: 0 8px 26px rgba(232, 207, 159, .22); }
.btn.gold:hover { filter: brightness(1.05); }
.btn.danger { color: #ff96a5; border-color: rgba(255, 93, 115, .3); }
.btn.sm { height: 36px; padding: 0 14px; font-size: 13px; }
.btn[disabled] { opacity: .45; pointer-events: none; }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; }
.icon-btn { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; border: 1px solid transparent; background: none; color: var(--muted); cursor: pointer; transition: color .2s, background .2s; }
.icon-btn:hover { color: var(--ink); background: rgba(255, 255, 255, .06); }
.icon-btn.on { color: var(--gold); }
.icon-btn.on .i { fill: currentColor; }

/* ---------- home ---------- */
.hero { text-align: center; padding: 26px 0 6px; }
.hero .lede { margin-left: auto; margin-right: auto; }
.moon-btn { display: flex; flex-direction: column; align-items: center; gap: 26px; margin: 46px auto 8px; padding: 0; background: none; border: 0; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.moon-wrap { position: relative; width: 196px; height: 196px; }
.moon-wrap::before, .moon-wrap::after { content: ""; position: absolute; border-radius: 50%; border: 1px solid rgba(232, 207, 159, .16); inset: -22px; animation: halo 7s ease-in-out infinite; }
.moon-wrap::after { inset: -48px; border-color: rgba(170, 157, 255, .1); animation-delay: -3.5s; }
.moon {
  position: absolute; inset: 0; border-radius: 50%;
  background:
    radial-gradient(circle at 64% 62%, rgba(120, 96, 60, .35) 0 9%, transparent 10%),
    radial-gradient(circle at 38% 70%, rgba(120, 96, 60, .25) 0 6%, transparent 7%),
    radial-gradient(circle at 56% 34%, rgba(120, 96, 60, .22) 0 5%, transparent 6%),
    radial-gradient(circle at 34% 30%, #fff8e8 0%, #f0d9ab 30%, #c7a671 64%, #6d5a40 100%);
  box-shadow: 0 0 90px rgba(232, 207, 159, .32), 0 0 200px rgba(170, 157, 255, .12), inset -26px -20px 54px rgba(18, 14, 40, .6);
  transition: box-shadow .4s, transform .4s;
}
.moon-btn:hover .moon { box-shadow: 0 0 120px rgba(232, 207, 159, .45), 0 0 240px rgba(170, 157, 255, .18), inset -26px -20px 54px rgba(18, 14, 40, .6); transform: scale(1.02); }
.moon-btn:active .moon { transform: scale(.98); }
.moon-label { font: 500 30px/1 var(--serif); letter-spacing: .01em; }
.moon-sub { margin-top: 12px; color: var(--muted); font-size: 13px; }
@keyframes halo { 0%, 100% { transform: scale(1); opacity: .9; } 50% { transform: scale(1.06); opacity: .35; } }

.chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 26px; }
.chip { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; padding: 7px 13px; border-radius: 999px; border: 1px solid var(--line); background: var(--glass); color: var(--muted); font-size: 13px; text-decoration: none; }
.chip b { color: var(--ink); font-weight: 500; }

.meter { position: relative; height: 8px; margin: 20px 0 10px; border-radius: 99px; background: rgba(255, 255, 255, .06); overflow: hidden; }
.meter .lvl { position: absolute; inset: 0 auto 0 0; width: 0; border-radius: 99px; background: linear-gradient(90deg, #6e64c9, var(--lav)); transition: width .08s linear; }
.meter.hot .lvl { background: linear-gradient(90deg, #c9536a, var(--rec)); }
.meter .thr { position: absolute; top: -3px; bottom: -3px; width: 2px; left: 50%; background: var(--gold); border-radius: 2px; opacity: 0; transition: left .3s; }
.meter .thr.on { opacity: 1; }
.test-state { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--muted); min-height: 22px; }
.test-state i { width: 8px; height: 8px; border-radius: 50%; background: var(--faint); }
.test-state.rec i { background: var(--rec); box-shadow: 0 0 10px var(--rec); }
.test-state.rec { color: var(--ink); }

.slider { display: grid; grid-template-columns: 1fr auto; gap: 10px 14px; align-items: center; margin-top: 18px; font-size: 14px; }
.slider output { font: 500 22px/1 var(--serif); color: var(--gold); min-width: 2ch; text-align: right; }
.slider input { grid-column: 1 / -1; }
input[type=range] { -webkit-appearance: none; appearance: none; width: 100%; height: 28px; background: none; cursor: pointer; }
input[type=range]::-webkit-slider-runnable-track { height: 4px; border-radius: 4px; background: linear-gradient(90deg, var(--gold) var(--p, 50%), rgba(255, 255, 255, .1) var(--p, 50%)); }
input[type=range]::-moz-range-track { height: 4px; border-radius: 4px; background: rgba(255, 255, 255, .1); }
input[type=range]::-moz-range-progress { height: 4px; border-radius: 4px; background: var(--gold); }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 22px; height: 22px; margin-top: -9px; border-radius: 50%; background: #fff4dc; border: 0; box-shadow: 0 0 0 5px rgba(232, 207, 159, .16), 0 4px 14px rgba(0, 0, 0, .4); }
input[type=range]::-moz-range-thumb { width: 22px; height: 22px; border-radius: 50%; background: #fff4dc; border: 0; box-shadow: 0 0 0 5px rgba(232, 207, 159, .16); }
.scale { display: flex; justify-content: space-between; grid-column: 1 / -1; margin-top: -6px; font-size: 12px; color: var(--faint); }

.last { display: flex; align-items: center; justify-content: space-between; gap: 14px; text-decoration: none; }
.last .chev { color: var(--faint); }

/* ---------- archive ---------- */
.search { display: flex; align-items: center; gap: 10px; height: 50px; padding: 0 18px; border-radius: 999px; border: 1px solid var(--line); background: var(--glass); color: var(--muted); }
.search input { flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; background: none; color: var(--ink); font: inherit; font-size: 15px; }
.search:focus-within { border-color: var(--line-2); }
.filters { display: flex; gap: 8px; margin: 14px 0 6px; }
.filters .chip { cursor: pointer; }
.filters .chip.on { color: var(--gold); border-color: rgba(232, 207, 159, .35); background: var(--gold-soft); }

.night-card { display: block; text-decoration: none; transition: border-color .2s, transform .2s; }
.night-card:hover { border-color: var(--line-2); transform: translateY(-1px); }
.nc-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.nc-title { font: 500 25px/1.1 var(--serif); }
.nc-sub { margin-top: 4px; font-size: 13px; color: var(--muted); }
.nc-mood { font-size: 22px; line-height: 1; }
.nc-stats { display: flex; gap: 18px; margin-top: 14px; font-size: 13px; color: var(--muted); }
.nc-stats b { color: var(--ink); font-weight: 500; }
.nc-note { margin: 12px 0 0; color: var(--muted); font: italic 400 17px/1.35 var(--serif); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

.timeline { position: relative; height: 26px; margin-top: 16px; border-radius: 8px; background: repeating-linear-gradient(90deg, rgba(255, 255, 255, .05) 0 1px, transparent 1px calc(100% / 8)), rgba(255, 255, 255, .025); }
.timeline i { position: absolute; top: 4px; bottom: 4px; min-width: 3px; border-radius: 3px; background: linear-gradient(180deg, var(--gold), var(--gold-2)); box-shadow: 0 0 10px rgba(232, 207, 159, .4); }
.timeline.big { height: 46px; }
.timeline.big i { top: 8px; bottom: 8px; cursor: pointer; }
.tl-labels { display: flex; justify-content: space-between; margin-top: 8px; font-size: 12px; color: var(--faint); font-variant-numeric: tabular-nums; }

.empty { text-align: center; padding: 50px 20px; }
.empty .display { font-size: 34px; }
.empty p { color: var(--muted); max-width: 34ch; margin: 10px auto 0; }

.hit { display: block; text-decoration: none; }
.hit .t { font-size: 12.5px; color: var(--muted); }
.hit q { display: block; margin-top: 6px; font: italic 400 19px/1.35 var(--serif); quotes: "«" "»"; }
mark { background: var(--gold-soft); color: var(--gold); border-radius: 4px; padding: 0 2px; }

/* ---------- night page ---------- */
.back { display: inline-flex; align-items: center; gap: 6px; margin-top: 6px; color: var(--muted); text-decoration: none; font-size: 14px; }
.back:hover { color: var(--ink); }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 18px; }
.stat b { display: block; font: 500 26px/1.1 var(--serif); }
.stat span { font-size: 12.5px; color: var(--muted); }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }

.moods { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.mood { display: inline-flex; align-items: center; gap: 6px; padding: 8px 13px; border-radius: 999px; border: 1px solid var(--line); background: var(--glass); cursor: pointer; font-size: 13.5px; color: var(--muted); }
.mood.on { color: var(--ink); border-color: rgba(232, 207, 159, .4); background: var(--gold-soft); }
textarea.note { display: block; width: 100%; min-height: 110px; margin-top: 14px; padding: 14px 16px; resize: vertical; border-radius: 16px; border: 1px solid var(--line); background: rgba(0, 0, 0, .2); color: var(--ink); font: italic 400 19px/1.4 var(--serif); outline: 0; }
textarea.note:focus { border-color: var(--line-2); }
textarea.note::placeholder { color: var(--faint); }
.saved { min-height: 18px; margin: 8px 2px 0; font-size: 12px; }

.clip { display: grid; grid-template-columns: auto 1fr; gap: 14px; align-items: start; padding: 16px; margin-top: 10px; scroll-margin-top: 90px; }
.clip.flash { animation: flash 1.6s ease; }
@keyframes flash { 0%, 40% { border-color: rgba(232, 207, 159, .6); } 100% { border-color: var(--line); } }
.play { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 50%; border: 0; cursor: pointer; color: #1d160a; background: linear-gradient(180deg, #f3dfb8, #d3b17a); box-shadow: 0 6px 20px rgba(232, 207, 159, .2); }
.play .i { width: 18px; height: 18px; }
.clip-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; min-height: 22px; }
.clip-meta .time { font-weight: 600; font-variant-numeric: tabular-nums; }
.clip-meta .dur { color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 99px; font-size: 11.5px; color: var(--lav); background: rgba(170, 157, 255, .1); border: 1px solid rgba(170, 157, 255, .2); cursor: pointer; }
.badge.raw { color: var(--muted); background: rgba(255, 255, 255, .04); border-color: var(--line); }
.clip-foot { display: flex; align-items: flex-start; gap: 8px; }
.clip-foot .tx { flex: 1; min-width: 0; }
.clip-tools { display: flex; gap: 0; margin: 4px -8px 0 auto; }
.wave { display: block; width: 100%; height: 44px; margin-top: 10px; cursor: pointer; }
.clip-text { margin: 10px 0 0; font: italic 400 19px/1.4 var(--serif); }
.clip-text.none { font: 13.5px var(--sans); color: var(--faint); }
.link { padding: 0; margin-top: 10px; border: 0; background: none; color: var(--gold); font-size: 13.5px; font-weight: 500; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.link[disabled] { color: var(--muted); cursor: default; }
.spin { width: 14px; height: 14px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .15); border-top-color: var(--gold); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- settings ---------- */
.group { margin-top: 28px; }
.group > h3 { margin: 0 4px 10px; font-size: 11.5px; font-weight: 600; letter-spacing: .2em; text-transform: uppercase; color: var(--gold); }
.group .card { margin-top: 0; padding: 4px 20px; }
.row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 0; border-top: 1px solid var(--line); }
.row:first-child { border-top: 0; }
.row.col { flex-direction: column; align-items: stretch; }
.row .lbl { font-weight: 500; }
.row .desc { margin-top: 3px; font-size: 13px; color: var(--muted); }
.row .slider { margin-top: 4px; }
.switch { position: relative; flex: none; width: 48px; height: 28px; }
.switch input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; z-index: 1; }
.switch span { position: absolute; inset: 0; border-radius: 99px; background: rgba(255, 255, 255, .12); transition: background .2s; }
.switch span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #d9d5e6; transition: transform .2s, background .2s; box-shadow: 0 2px 6px rgba(0, 0, 0, .35); }
.switch input:checked + span { background: linear-gradient(180deg, #e9cf9c, #c8a66b); }
.switch input:checked + span::after { transform: translateX(20px); background: #fffaf0; }
.switch input:focus-visible + span { outline: 2px solid var(--lav); outline-offset: 2px; }
.seg { display: flex; flex-wrap: nowrap; gap: 4px; padding: 4px; margin-top: 10px; border-radius: 16px; background: rgba(0, 0, 0, .22); border: 1px solid var(--line); }
.seg button { flex: 1 1 0; min-width: 0; padding: 9px 4px; border: 0; border-radius: 12px; background: none; color: var(--muted); font-size: 13.5px; font-weight: 500; cursor: pointer; line-height: 1.2; }
.seg button small { display: block; margin-top: 2px; font-size: 11px; font-weight: 400; color: var(--faint); }
.seg button.on { color: var(--ink); background: rgba(255, 255, 255, .09); box-shadow: inset 0 0 0 1px rgba(232, 207, 159, .3); }
.seg button.on small { color: var(--gold); }
.time-row { display: flex; align-items: center; gap: 10px; }
input[type=time] { height: 40px; padding: 0 12px; border-radius: 12px; border: 1px solid var(--line-2); background: rgba(0, 0, 0, .25); color: var(--ink); font: 500 16px var(--sans); color-scheme: dark; }
.usage { height: 6px; margin: 12px 0 6px; border-radius: 6px; background: rgba(255, 255, 255, .07); overflow: hidden; }
.usage i { display: block; height: 100%; background: linear-gradient(90deg, var(--lav), var(--gold)); border-radius: 6px; }
.note-box { margin: 12px 0 4px; padding: 12px 14px; border-radius: 14px; font-size: 13px; color: var(--muted); background: rgba(170, 157, 255, .06); border: 1px solid rgba(170, 157, 255, .14); }
.diag { margin: 12px 0; padding: 12px; max-height: 320px; overflow: auto; white-space: pre-wrap; word-break: break-word; border-radius: 12px; background: rgba(0,0,0,.3); border: 1px solid var(--line); color: var(--muted); font: 12px/1.5 ui-monospace, Menlo, monospace; }
.foot { margin: 34px 0 0; text-align: center; color: var(--faint); font-size: 12.5px; }
.foot b { font: 500 18px var(--serif); color: var(--muted); }

/* ---------- night overlay ---------- */
.night { position: fixed; inset: 0; z-index: 100; background: #000; color: rgba(236, 232, 244, .3); display: flex; flex-direction: column; align-items: center; justify-content: center; user-select: none; -webkit-user-select: none; cursor: default; }
.night[hidden] { display: none; }
.n-wrap { position: relative; display: flex; flex-direction: column; align-items: center; text-align: center; transition: transform 3s ease; }
.orb { position: absolute; left: 50%; top: 42%; width: 440px; height: 440px; margin: -220px 0 0 -220px; border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle, rgba(170, 157, 255, .1), rgba(170, 157, 255, .03) 40%, transparent 68%);
  transform: scale(calc(.85 + var(--lv, 0) * .5)); transition: transform .25s ease-out, background .6s; }
.night.rec .orb { background: radial-gradient(circle, rgba(255, 93, 115, .14), rgba(255, 93, 115, .04) 40%, transparent 68%); }
.n-clock { position: relative; font: 300 clamp(96px, 28vw, 180px)/1 var(--serif); color: rgba(236, 232, 244, .32); font-variant-numeric: lining-nums tabular-nums; letter-spacing: -.02em; }
.n-date { position: relative; margin-top: 4px; font: italic 400 20px var(--serif); color: rgba(236, 232, 244, .22); }
.n-status { position: relative; display: flex; align-items: center; gap: 10px; margin-top: 40px; font-size: 14px; letter-spacing: .04em; }
.n-status i { width: 8px; height: 8px; border-radius: 50%; background: rgba(170, 157, 255, .4); }
.night.rec .n-status { color: rgba(255, 140, 156, .7); }
.night.rec .n-status i { background: var(--rec); box-shadow: 0 0 14px var(--rec); animation: pulse 1.4s ease-in-out infinite; }
.night.wait .n-status i { background: rgba(232, 207, 159, .35); }
@keyframes pulse { 50% { opacity: .35; } }
.n-meta { position: relative; display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 18px; margin-top: 12px; font-size: 13px; color: rgba(236, 232, 244, .2); }
.n-wake { position: absolute; bottom: calc(36px + var(--safe-b)); display: flex; align-items: center; gap: 12px; padding: 10px 22px 10px 12px; border-radius: 999px; border: 1px solid rgba(255, 255, 255, .06); background: none; color: rgba(236, 232, 244, .28); font-size: 13.5px; cursor: pointer; touch-action: none; }
.n-wake svg { width: 32px; height: 32px; transform: rotate(-90deg); }
.n-wake circle { fill: none; stroke-width: 2; }
.n-wake .track { stroke: rgba(255, 255, 255, .08); }
.n-wake .prog { stroke: var(--gold); stroke-dasharray: 107; stroke-dashoffset: 107; stroke-linecap: round; transition: stroke-dashoffset .25s; }
.n-wake.holding { color: rgba(236, 232, 244, .6); border-color: rgba(232, 207, 159, .2); }
.n-wake.holding .prog { stroke-dashoffset: 0; transition: stroke-dashoffset 1.5s linear; }

/* ---------- modal, toast, pill ---------- */
.modal { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; padding: 16px; background: rgba(3, 4, 10, .66); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); animation: fade .25s ease; }
.modal[hidden] { display: none; }
.sheet { width: min(440px, 100%); padding: 28px 24px 22px; border-radius: 28px; text-align: center; background: linear-gradient(180deg, #161829, #0e101c); border: 1px solid var(--line-2); box-shadow: 0 30px 80px rgba(0, 0, 0, .6); }
.sheet .display { font-size: 40px; }
.sheet p { color: var(--muted); margin: 12px 0 0; }
.sheet .btn-row { justify-content: center; margin-top: 24px; }
.sheet .big-num { font: 300 72px/1 var(--serif); color: var(--gold); margin: 14px 0 0; }
.toast { position: fixed; z-index: 300; left: 50%; bottom: calc(96px + var(--safe-b)); transform: translate(-50%, 20px); max-width: calc(100% - 32px); padding: 12px 18px; border-radius: 16px; background: #1b1d30; border: 1px solid var(--line-2); box-shadow: 0 16px 40px rgba(0, 0, 0, .5); font-size: 14px; opacity: 0; pointer-events: none; transition: opacity .25s, transform .25s; }
.toast.on { opacity: 1; transform: translate(-50%, 0); }
.pill { display: inline-flex; align-items: center; gap: 8px; max-width: 60vw; padding: 7px 14px; border-radius: 999px; font-size: 12.5px; color: var(--ink); background: rgba(170, 157, 255, .12); border: 1px solid rgba(170, 157, 255, .25); }
.pill[hidden] { display: none; }
.pill i { width: 12px; height: 12px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .18); border-top-color: var(--lav); animation: spin .8s linear infinite; flex: none; }
.pill span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

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