/* The sleep panel (views/sleep-panel.js, views/night-strip.js): the night strip leads, the chips under it are the
   quieter, precise way. Time runs left to right in both languages (dir=ltr on the band, the ghosts and the axis). */
.slp{display:flex;flex-direction:column;gap:10px}
/* The hero already says the length; the live line under the panel stays for an activity only. */
.spn:has(.slp)>.sp-live{display:none}

/* ---- the strip */
.ns{display:flex;flex-direction:column;gap:6px}
.ns-hero{display:flex;align-items:center;gap:10px;min-height:46px}
.ns-dur{font:600 2.45rem/1 var(--serif);letter-spacing:-.015em;color:var(--ink);font-variant-numeric:tabular-nums;white-space:nowrap}
.ns-dur[data-goal=good]{background:linear-gradient(100deg,var(--c),var(--a));-webkit-background-clip:text;background-clip:text;color:transparent}
.ns-dur[data-goal=short]{color:var(--d)}
.ns-dur[data-goal=long]{color:var(--b)}
.ns-word{padding:5px 10px;border-radius:var(--pill);font:800 .74rem/1 var(--sans);letter-spacing:.06em;text-transform:uppercase;background:var(--c-soft);color:var(--c)}
.ns-word[data-goal=short]{background:var(--d-soft);color:var(--d)}
.ns-word[data-goal=long]{background:var(--b-soft);color:var(--b)}
.ns-word:empty{display:none}
.ns-times{margin-inline-start:auto;font:700 .9rem/1 var(--sans);color:var(--mut);font-variant-numeric:tabular-nums}

/* The band: night sky to dawn, a sun-glow at the wake end; outside the night it is washed out, so the night is lit. */
.ns-band{position:relative;height:62px;margin-inline:8px;touch-action:none;user-select:none;-webkit-user-select:none;cursor:pointer}
.ns-sky{position:absolute;inset:0;border-radius:20px;overflow:hidden;
background:var(--ns-dawn),var(--ns-sky);box-shadow:var(--ns-sky-shadow)}
.ns-sky::before,.ns-sky::after{content:'';position:absolute;top:0;bottom:0;z-index:1;background:color-mix(in srgb,var(--surface) 55%,transparent);transition:inset .12s}
.ns-sky::before{inset-inline-start:0;inset-inline-end:calc(100% - var(--ns-x0))}
.ns-sky::after{inset-inline-start:var(--ns-x1);inset-inline-end:0}
.ns-stars{position:absolute;inset:0;animation:ns-drift 38s ease-in-out infinite alternate}
.ns-stars i{position:absolute;inset-inline-start:var(--ns-sx);top:var(--ns-sy);width:3px;height:3px;border-radius:50%;background:var(--ns-star);box-shadow:var(--ns-star-glow);animation:ns-twinkle 3.4s ease-in-out var(--ns-sd) infinite}
.ns-stars i:nth-child(3n){width:2px;height:2px}
.ns-night{position:absolute;top:0;bottom:0;inset-inline-start:var(--ns-x0);inset-inline-end:calc(100% - var(--ns-x1));border-radius:20px;pointer-events:none;box-shadow:var(--ns-night-edge);transition:inset .12s}
.ns-handle{position:absolute;top:50%;z-index:2;display:grid;place-items:center;width:48px;height:48px;margin-block-start:-24px;margin-inline-start:-24px;padding:0;border:0;border-radius:50%;cursor:grab;touch-action:none;transition:inset-inline-start .12s,transform .2s cubic-bezier(.2,.8,.2,1)}
.ns-handle svg{width:24px;height:24px}
.ns-moon{inset-inline-start:var(--ns-x0);background:var(--ns-moon);color:var(--ns-moon-ink);box-shadow:var(--ns-moon-glow)}
.ns-sun{inset-inline-start:var(--ns-x1);background:var(--ns-sun);color:var(--ns-sun-ink);box-shadow:var(--ns-sun-glow)}
.ns-handle.drag{transform:translateY(-6px) scale(1.08);cursor:grabbing}
.ns-handle:focus-visible{outline:3px solid var(--focus);outline-offset:3px}
/* while dragging, a handle follows the finger at once; only its rise is eased */
.ns-band.dragging .ns-handle{transition:transform .2s cubic-bezier(.2,.8,.2,1)}
.ns-band.dragging .ns-night,.ns-band.dragging .ns-sky::before,.ns-band.dragging .ns-sky::after{transition:none}

/* The last nights, faint at their real times; the newest on top and a little stronger. A tap copies one. */
.ns-ghosts{display:flex;flex-direction:column;gap:1px;margin-inline:8px}
.ns-ghost{position:relative;display:block;width:100%;height:9px;padding:0;border:0;background:none;cursor:pointer}
.ns-ghost i{position:absolute;top:2px;bottom:2px;inset-inline-start:var(--ns-g0);inset-inline-end:calc(100% - var(--ns-g1));border-radius:4px;background:linear-gradient(90deg,var(--a),var(--b));opacity:.2;transition:opacity .15s}
.ns-ghost:first-child i{opacity:.34}
.ns-ghost:hover i,.ns-ghost:focus-visible i{opacity:.6}
.ns-ghost:focus-visible{outline:2px solid var(--focus);outline-offset:1px;border-radius:4px}
.ns-ghost.copied i{animation:ns-copied .7s ease-out}
.ns-axis{position:relative;height:13px;margin-inline:8px;font:700 .68rem/1 var(--sans);color:var(--mut);font-variant-numeric:tabular-nums}
.ns-axis span{position:absolute;inset-inline-start:var(--ns-x);transform:translateX(-50%)}
@keyframes ns-twinkle{0%,100%{opacity:.3;transform:scale(.7)}50%{opacity:1;transform:scale(1.15)}}
@keyframes ns-drift{to{transform:translateX(-16px)}}
@keyframes ns-copied{0%{opacity:1}100%{opacity:.2}}

/* ---- the chips, the precise way: quieter than the strip, every chip 48 px to the finger (LLD 7.2): under the label
   the usual hours (seven and Other) in a grid of four columns, the other hours six to a row, then the minutes in a
   row of four, so a time is set hour first */
.slp-precise{display:flex;flex-direction:column;gap:6px}
.slp-blk{display:flex;flex-direction:column;gap:5px;padding:7px 8px 8px;border:1px solid var(--line);border-radius:var(--rm);background:var(--surface2)}
.slp-head{display:flex;flex-wrap:wrap;align-items:center;gap:6px 8px}
.slp-lbl{font:700 .84rem/1.1 var(--sans);color:var(--ink2);white-space:nowrap}
.slp-big{font:600 1.12rem/1 var(--serif);color:var(--ink);font-variant-numeric:tabular-nums}
.slp-mins{display:grid;grid-template-columns:repeat(4,minmax(48px,1fr));gap:4px}
.slp-hours{display:grid;grid-template-columns:repeat(4,minmax(48px,1fr));gap:4px}
.slp-rest{display:grid;grid-template-columns:repeat(auto-fill,minmax(48px,1fr));gap:4px}
.slp-rest[hidden]{display:none}
.slp-chip{display:flex;align-items:center;justify-content:center;min-height:48px;min-width:48px;padding:0;border:1px solid var(--line);border-radius:12px;background:var(--surface);color:var(--ink2);font:600 .9rem/1 var(--serif);font-variant-numeric:tabular-nums;cursor:pointer;transition:transform .12s,background-color .12s}
.slp-rest .slp-chip{background:transparent;color:var(--mut);font:600 .84rem/1 var(--sans)}
.slp-other{font:700 .8rem/1 var(--sans);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;padding-inline:2px}
.slp-other[aria-expanded=true]{border-color:var(--a);color:var(--a)}
.slp-chip i{font-style:normal;opacity:.45;margin-inline-end:1px}
.slp-chip:active{transform:scale(.95)}
.slp-chip:focus-visible{outline:2px solid var(--focus);outline-offset:2px}
.slp-chip[aria-pressed=true]{border-color:var(--a);background:var(--a-soft);color:var(--a)}
/* the question before a second night over a saved one (views/sleep-save.js): the sentence, then its two answers */
.sp-over{flex-wrap:wrap}.sp-over[hidden]{display:none}
.sp-over-q{flex:1 1 0;min-width:0}.sp-over-q .nowrap{white-space:nowrap}
.sp-over-acts{display:flex;flex-wrap:wrap;gap:8px;flex-basis:100%;justify-content:flex-end}
