/* ONLINECLOCK.NET — colour layer.
   Loaded after site.css. Keeps the Station structure (hairlines, tabular
   numerals, the red seconds paddle) and adds a full colour system on top,
   so nothing in the markup has to change. */

/* OC Segment — the seven-segment LED face for the clock, drawn for this
   site, with chamfered outer corners and slightly rounded segment ends. Under a kilobyte, so it is inlined and the digits never flash in a
   fallback face; the .woff beside it covers browsers without woff2. */
@font-face{
  font-family:"OC Segment";
  src:url(data:font/woff2;base64,d09GMgABAAAAAAR4AAoAAAAAF2gAAAQtAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAABmAAgT4KpDyZVgE2AiQDVAsuAAQgBYQNB04bHBEgngXu3gknYPg0rT0RQ78tTO/n3dL3sbsPxICT+I+5wEUcqZvN7dqM1dFsWMThedr5foUJdBF03W2GE5jrbIITW8sSI1vrf4BwgX+t/eoeJqHrdghNPNHqme4d5vnmN9T2ZNibh1kidLJmtRAyJfxIJMRIZBlOG2ZGF+KUbDc5O6BLItoLrFqyFoBWXOlNHUdrCwCQKdHELgT0gEl2KfVST0Bu25QNBbHQ7vvGuA4AsQgGg0hXpFiVNp3GGaaaZa5lzhIHUaIl2w4QqTIFM+QZHvuZ7x4Y4ZorrrrokPE3v3k1lQZAdH3AEgsnGUEgEyw3wqW+QQPsB7gTAAAAGF2czaGxWAwITc6RiUoZFIS4FK6LUm2NAAmJtUp3BAjbEbtO8NsBzM1Px68St6PR7e7kwx7PEWIll+uQkniQn4rcmSkoCSm8iiAjNPsA1oKw8pBORCnVXZljOUnIXV23FLHJM7a7qw8Lgi+2y04OOBQoEdYzBSUSS0wjQgcL3Xj15EZQ2NBT9qAi2+qaO4UYqvvEU6IIkm2NF3sckABzm6JA2FF2RyHiWw1PaIg9M+kBgA13obpGTwaoAMxBCN8RqJAe4VMx+pSGgvEqvu0IrROEHZv5gWZ1odN3eP+HUCoP8vx2T8wR9wBBx4JMR3d04z9hImxnZOkplLGzMH6E8X7EG9i8QZJVDlfDgz1YtTXVUnE+RiZptorD9jQIw26feXTDmf4nrOao8z6sf4QM0/1PJSY4n9Z8yflH/htZDAf24Pp5Gp7riG3bItaaUPgwHN5TEopDJVFsL6YBJseYZoyKeXyvYgHQXbiESqIWBTyyJFjdTriru73W29HtdURlW+vlo0aKL/CyaHfQOgcywTyxT2QAPLIDQOtIXdbhb6FyNVzH409feiDrzXml95OaKZGMSDUxyk4BjiRP6HSNN/XBloNJsPzBOH++OY9qt4Cm/qrl3fxTanEDqscC9t50OmHl0O1ZNyNOZ690F7+kx9mFRfeaME7H+CLJgmqjw7vuPPzJaEDpN2elvwKAL7GeRFNp/70535AbplGK8ht7HnUJ5Ek7BpBqKEzDKDagRaivGGYnGaQ1W9mzkgrzTcK+a89/R4XSyt1Wc+xAqSP+boeDIpUmRniRmOKQhGkumZghqcMsP77bOUEMNNQwAJRbNGFE8QBT/D3GtGQvMSOWjVkhiUlxolP26QeD1pz5X94v/eAGHm1fmPo5q10dNf/dAOV7CPM0Ze2kwYm0rPRMQYdslI8qCHy+rq72KKg137glZiMsc8xHkNLZZprmm3QzSeW6GdJnLpSKyJZ59vN1qDlf18M0xSym2RbqnkYvMtO4+UKrbVlpcPo0WdJlmmORXZ/GRAYWmBamQ5SFWVhXe6DUq9wAaDKFq/lVD69gIUKFCdRgSItwQQLEypEJAA==) format("woff2"),
      url(/assets/fonts/oc-segment.woff) format("woff");
  font-weight:400; font-style:normal; font-display:block;
}

:root{
  /* Brand spectrum */
  --c-indigo:   #4f46e5;
  --c-violet:   #7c3aed;
  --c-fuchsia:  #c026d3;
  --c-pink:     #ec4899;
  --c-rose:     #f43f5e;
  --c-orange:   #f97316;
  --c-amber:    #f59e0b;
  --c-lime:     #84cc16;
  --c-emerald:  #10b981;
  --c-teal:     #14b8a6;
  --c-cyan:     #06b6d4;
  --c-sky:      #0ea5e9;
  --c-blue:     #3b82f6;

  /* Re-pointed core tokens */
  --brand:      var(--c-indigo);
  --brand-2:    var(--c-violet);
  --signal:     #e11d48;
  --go:         #059669;
  --amber:      #b45309;
  --link:       #4338ca;

  --dial:       #f4f5fa;
  --dial-2:     #eaecf4;
  --panel:      #ffffff;
  --panel-2:    #f7f8fc;
  --panel-3:    #eef0f8;
  --line:       #e0e3ee;
  --line-2:     #c6cbdd;

  --grad-brand:  linear-gradient(135deg, var(--c-indigo), var(--c-violet) 55%, var(--c-fuchsia));
  --grad-warm:   linear-gradient(135deg, var(--c-amber), var(--c-orange) 55%, var(--c-rose));
  --grad-cool:   linear-gradient(135deg, var(--c-cyan), var(--c-sky) 55%, var(--c-indigo));
  --grad-go:     linear-gradient(135deg, var(--c-emerald), var(--c-teal));
  --grad-stop:   linear-gradient(135deg, var(--c-rose), var(--c-orange));
  --grad-rail:   linear-gradient(90deg, var(--c-indigo), var(--c-violet) 18%, var(--c-fuchsia) 34%,
                                        var(--c-rose) 50%, var(--c-orange) 66%, var(--c-amber) 80%, var(--c-teal));

  --glow-brand: 0 10px 30px -10px rgba(79,70,229,.45);
  --glow-warm:  0 10px 30px -10px rgba(249,115,22,.45);
  --glow-soft:  0 1px 2px rgba(17,21,27,.04), 0 8px 24px -12px rgba(50,50,93,.18);
  --glow-lift:  0 2px 4px rgba(17,21,27,.04), 0 18px 44px -18px rgba(50,50,93,.34);
}

[data-theme="dark"]{
  /* Near-black, barely tinted: the page recedes and the clock carries the
     light. Kept in step with the dark tokens in site.css. */
  --dial:       #050608;
  --dial-2:     #08090b;
  --panel:      #0c0e11;
  --panel-2:    #111317;
  --panel-3:    #171a1f;
  --ink:        #e4e7eb;
  --ink-2:      #a9b0ba;
  --rail:       #7b848f;
  --line:       #1b1f25;
  --line-2:     #292e36;

  --brand:      #818cf8;
  --brand-2:    #a78bfa;
  --signal:     #fb7185;
  --go:         #34d399;
  --link:       #a5b4fc;

  --glow-soft:  0 1px 2px rgba(0,0,0,.4), 0 8px 24px -12px rgba(0,0,0,.6);
  --glow-lift:  0 2px 4px rgba(0,0,0,.4), 0 18px 44px -18px rgba(0,0,0,.8);
}

/* ------------------------------------------------------------------
   Page canvas — a soft colour wash instead of flat grey
   ------------------------------------------------------------------ */
body{
  background:
    radial-gradient(60rem 34rem at 12% -6%,  rgba(79,70,229,.11), transparent 62%),
    radial-gradient(52rem 30rem at 92% 2%,   rgba(236,72,153,.09), transparent 62%),
    radial-gradient(46rem 28rem at 68% 42%,  rgba(20,184,166,.07), transparent 64%),
    var(--dial);
  background-attachment: fixed;
}
[data-theme="dark"] body{
  /* Only a trace of the colour wash survives in the dark: bright glows on a
     black page are what make it tiring to look at. */
  background:
    radial-gradient(60rem 34rem at 12% -6%, rgba(99,102,241,.06), transparent 62%),
    radial-gradient(52rem 30rem at 92% 2%,  rgba(192,38,211,.04), transparent 62%),
    var(--dial);
}

/* ------------------------------------------------------------------
   Masthead
   ------------------------------------------------------------------ */
.masthead{
  background:var(--panel);
  background: color-mix(in srgb, var(--panel) 78%, transparent);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid transparent;
  border-image: var(--grad-rail) 1;
  box-shadow: 0 1px 24px -14px rgba(50,50,93,.5);
}
.brand-mark{
  background: var(--grad-brand);
  border-color: transparent;
  box-shadow: var(--glow-brand);
}
.brand-mark::before,
.brand-mark::after{ background:#fff; }
.brand-mark::after{ background: #fde047; }
.brand-name{ letter-spacing:-.02em; }
.brand-name .b-net{
  background: var(--grad-warm);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}
.mainnav a{ border-radius: 999px; transition: color .16s ease, background .16s ease; }
.mainnav a:hover{
  color: var(--brand);
  background:var(--brand);
  background: color-mix(in srgb, var(--brand) 10%, transparent);
}
.mainnav a[aria-current="page"]{
  color:#fff;
  background: var(--grad-brand);
  border-bottom-color: transparent;
  box-shadow: var(--glow-brand);
}
.mast-tools .btn-icon:hover{ border-color: var(--brand); color: var(--brand); }

/* ------------------------------------------------------------------
   Eyebrows — rotate hue by position so sections read as distinct
   ------------------------------------------------------------------ */
.eyebrow{
  background: var(--grad-brand);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}
.eyebrow::after{ background: linear-gradient(90deg, var(--brand), transparent); }
.section:nth-of-type(3n+2) .eyebrow{ background: var(--grad-warm);
  -webkit-background-clip:text; background-clip:text; -webkit-text-fill-color:transparent; }
.section:nth-of-type(3n+2) .eyebrow::after{ background: linear-gradient(90deg, var(--c-orange), transparent); }
.section:nth-of-type(3n+3) .eyebrow{ background: var(--grad-cool);
  -webkit-background-clip:text; background-clip:text; -webkit-text-fill-color:transparent; }
.section:nth-of-type(3n+3) .eyebrow::after{ background: linear-gradient(90deg, var(--c-cyan), transparent); }
.eyebrow-plain{
  background:none; -webkit-text-fill-color: var(--rail); color: var(--rail);
}

/* ------------------------------------------------------------------
   Hero
   ------------------------------------------------------------------ */
.hero h1{
  background: linear-gradient(135deg, var(--ink) 22%, var(--c-indigo) 62%, var(--c-fuchsia));
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}
[data-theme="dark"] .hero h1{
  background: linear-gradient(135deg, #fff 20%, #a5b4fc 58%, #f0abfc);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}

/* ------------------------------------------------------------------
   Chips — pastel rotation
   ------------------------------------------------------------------ */
.chip{
  border-color: transparent;
  background:var(--panel);
  background: color-mix(in srgb, var(--c-indigo) 12%, var(--panel));
  color:var(--ink);
  color: color-mix(in srgb, var(--c-indigo) 78%, var(--ink));
  font-weight: 600;
}
.chip:nth-child(2){ background:var(--panel); background:color-mix(in srgb, var(--c-orange) 14%, var(--panel));
                    color:var(--ink); color:color-mix(in srgb, var(--c-orange) 72%, var(--ink)); }
.chip:nth-child(3){ background:var(--panel); background:color-mix(in srgb, var(--c-teal) 14%, var(--panel));
                    color:var(--ink); color:color-mix(in srgb, var(--c-teal) 72%, var(--ink)); }
.chip:nth-child(4){ background:var(--panel); background:color-mix(in srgb, var(--c-pink) 13%, var(--panel));
                    color:var(--ink); color:color-mix(in srgb, var(--c-pink) 74%, var(--ink)); }
.chip:nth-child(5){ background:var(--panel); background:color-mix(in srgb, var(--c-emerald) 14%, var(--panel));
                    color:var(--ink); color:color-mix(in srgb, var(--c-emerald) 72%, var(--ink)); }
.chip-live{ background:var(--panel); background:color-mix(in srgb, var(--c-emerald) 15%, var(--panel));
            color:var(--ink); color:color-mix(in srgb, var(--c-emerald) 76%, var(--ink)); }
.chip-live::before{ background: var(--c-emerald); box-shadow:0 0 0 3px var(--c-emerald); box-shadow:0 0 0 3px color-mix(in srgb, var(--c-emerald) 25%, transparent); }

/* ------------------------------------------------------------------
   Instrument — rainbow rail and a coloured glow
   ------------------------------------------------------------------ */
.instrument{
  background:linear-gradient(180deg, var(--panel), var(--panel));
  background: linear-gradient(180deg, var(--panel), color-mix(in srgb, var(--brand) 4%, var(--panel)));
  border-color: var(--line);
  box-shadow: var(--glow-lift);
  position: relative; overflow: hidden;
}
.instrument::before{
  background: var(--grad-rail);
  height: 4px; left: 0; right: 0; width: auto;
  opacity: 1;
}
.instrument::after{
  content:""; position:absolute; inset:auto -20% -60% -20%; height:150px;
  background:radial-gradient(60% 100% at 50% 0%, var(--brand), transparent 70%);
  background: radial-gradient(60% 100% at 50% 0%, color-mix(in srgb, var(--brand) 14%, transparent), transparent 70%);
  pointer-events:none;
}
.readout{
  background:linear-gradient(160deg, var(--ink) 30%, var(--c-indigo));
  background: linear-gradient(160deg, var(--ink) 30%, color-mix(in srgb, var(--ink) 62%, var(--c-indigo)));
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}
[data-theme="dark"] .readout{
  background: linear-gradient(160deg, #eceef2 28%, #b7c0dc);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.readout .sep{ -webkit-text-fill-color: var(--c-rose); color: var(--c-rose); opacity:.85; }
.readout .ampm{ -webkit-text-fill-color: var(--rail); color: var(--rail); }
.secrail-paddle::after{ background: var(--c-rose); box-shadow:0 0 12px var(--c-rose); box-shadow:0 0 12px color-mix(in srgb, var(--c-rose) 60%, transparent); }
.secrail-paddle::before{ background: var(--c-rose); }
.secrail-ticks i:nth-child(5n+1){ background:var(--rail); background:color-mix(in srgb, var(--brand) 55%, var(--rail)); }

/* ------------------------------------------------------------------
   Buttons
   ------------------------------------------------------------------ */
.btn, button.btn{ transition: transform .14s ease, box-shadow .18s ease, background .18s ease, color .18s ease, border-color .18s ease; }
.btn:hover, button.btn:hover{ transform: translateY(-1px); border-color: var(--brand); color: var(--brand); box-shadow: var(--glow-soft); }
.btn:active, button.btn:active{ transform: translateY(0); }
.btn.btn-solid{
  background: var(--grad-brand); border-color: transparent; color:#fff;
  box-shadow: var(--glow-brand);
}
.btn.btn-solid:hover{ color:#fff; border-color: transparent; filter: brightness(1.07); box-shadow: 0 14px 34px -12px rgba(79,70,229,.6); }
.btn.btn-go{
  background: var(--grad-go); border-color: transparent; color:#fff;
  box-shadow: 0 10px 26px -12px rgba(16,185,129,.55);
}
.btn.btn-go:hover{ color:#fff; border-color:transparent; filter: brightness(1.07); }
.btn.btn-stop{
  background: var(--grad-stop); border-color: transparent; color:#fff;
  box-shadow: 0 10px 26px -12px rgba(244,63,94,.55);
}
.btn.btn-stop:hover{ color:#fff; border-color:transparent; filter: brightness(1.07); }
.btn.btn-ghost:hover{ background:var(--brand); background:color-mix(in srgb, var(--brand) 9%, transparent); color: var(--brand); }

.preset{ transition: all .15s ease; }
.preset:hover{ border-color: var(--brand); color: var(--brand); background:var(--brand); background:color-mix(in srgb, var(--brand) 8%, transparent); }
.preset[aria-pressed="true"]{
  background: var(--grad-brand); border-color: transparent; color:#fff;
  box-shadow: var(--glow-brand);
}

/* ------------------------------------------------------------------
   Panels and cards
   ------------------------------------------------------------------ */
.panel{
  background:linear-gradient(180deg, var(--panel), var(--panel));
  background: linear-gradient(180deg, var(--panel), color-mix(in srgb, var(--brand) 3%, var(--panel)));
  box-shadow: var(--glow-soft);
  transition: box-shadow .2s ease, transform .2s ease, border-color .2s ease;
}
.panel:hover{ box-shadow: var(--glow-lift); }
.panel-2{ background:linear-gradient(180deg, var(--panel-2), var(--panel-2)); background:linear-gradient(180deg, var(--panel-2), color-mix(in srgb, var(--brand) 5%, var(--panel-2))); }

.card{
  position: relative; overflow: hidden;
  background:linear-gradient(180deg, var(--panel), var(--panel));
  background: linear-gradient(180deg, var(--panel), color-mix(in srgb, var(--brand) 4%, var(--panel)));
  box-shadow: var(--glow-soft);
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.card::before{
  content:""; position:absolute; top:0; left:0; right:0; height:3px;
  background: var(--grad-brand); opacity:.9;
  transform: scaleX(0); transform-origin: left; transition: transform .28s ease;
}
.card:hover::before{ transform: scaleX(1); }
.card:hover{ transform: translateY(-3px); border-color:var(--line); border-color:color-mix(in srgb, var(--brand) 35%, var(--line)); box-shadow: var(--glow-lift); }
.grid > .card:nth-child(3n+2)::before{ background: var(--grad-warm); }
.grid > .card:nth-child(3n+3)::before{ background: var(--grad-cool); }
.card-kicker{ color: var(--brand); font-weight:700; }
.grid > .card:nth-child(3n+2) .card-kicker{ color: var(--c-orange); }
.grid > .card:nth-child(3n+3) .card-kicker{ color: var(--c-cyan); }
.card-go{ color: var(--brand); font-weight:600; }
.card:hover .card-go{ transform: translateX(2px); }

/* ------------------------------------------------------------------
   Fields, status, progress
   ------------------------------------------------------------------ */
.field:focus{
  border-color: var(--brand);
  box-shadow:0 0 0 4px var(--brand);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 16%, transparent);
  outline: none;
}
.status{ border-left: 3px solid var(--line-2); border-radius: var(--radius); }
.status-go{
  background:var(--panel);
  background: color-mix(in srgb, var(--c-emerald) 10%, var(--panel));
  border-left-color: var(--c-emerald);
  color:var(--ink);
  color: color-mix(in srgb, var(--c-emerald) 70%, var(--ink));
}
.status-stop{
  background:var(--panel);
  background: color-mix(in srgb, var(--c-rose) 10%, var(--panel));
  border-left-color: var(--c-rose);
  color:var(--ink);
  color: color-mix(in srgb, var(--c-rose) 72%, var(--ink));
}
.status-idle{
  background:var(--panel);
  background: color-mix(in srgb, var(--brand) 7%, var(--panel));
  border-left-color:var(--line-2);
  border-left-color: color-mix(in srgb, var(--brand) 50%, var(--line-2));
}
.progress{ background:var(--panel-3); background:color-mix(in srgb, var(--brand) 12%, var(--panel-3)); overflow:hidden; }
.progress > i{ background: var(--grad-brand); }
.progress-stop > i{ background: var(--grad-stop); }

/* ------------------------------------------------------------------
   Tables
   ------------------------------------------------------------------ */
.dtable thead th{
  background:linear-gradient(180deg, var(--panel-2), var(--panel-2));
  background: linear-gradient(180deg, color-mix(in srgb, var(--brand) 10%, var(--panel-2)), var(--panel-2));
  color:var(--ink);
  color: color-mix(in srgb, var(--brand) 62%, var(--ink));
  border-bottom:2px solid var(--line);
  border-bottom: 2px solid color-mix(in srgb, var(--brand) 35%, var(--line));
}
.dtable tbody tr:hover{ background:var(--brand); background:color-mix(in srgb, var(--brand) 6%, transparent); }
.dtable tbody tr:nth-child(even){ background:var(--brand); background:color-mix(in srgb, var(--brand) 2.5%, transparent); }
.table-wrap{ border-radius: var(--radius-lg); overflow:hidden; box-shadow: var(--glow-soft); }

/* ------------------------------------------------------------------
   FAQ and notes
   ------------------------------------------------------------------ */
.faq details{
  border-radius: var(--radius); margin-bottom:.5rem;
  border:1px solid var(--line);
  background: var(--panel);
  transition: border-color .18s ease, box-shadow .18s ease;
}
.faq details[open]{ border-color:var(--line); border-color:color-mix(in srgb, var(--brand) 34%, var(--line)); box-shadow: var(--glow-soft); }
.faq summary{ padding:.95rem 1.1rem; border-radius: var(--radius); }
.faq summary::before{ color: var(--brand); font-weight:800; }
.faq summary:hover{ color: var(--brand); background:var(--brand); background:color-mix(in srgb, var(--brand) 5%, transparent); }
.faq-a{ padding:0 1.1rem 1rem; }
.faq-a a{ color: var(--link); }

.note{ border-radius: var(--radius); border-left-width:4px; }
.note-signal{
  background:var(--panel);
  background: color-mix(in srgb, var(--c-amber) 11%, var(--panel));
  border-left-color: var(--c-amber);
}
.note-go{
  background:var(--panel);
  background: color-mix(in srgb, var(--c-emerald) 10%, var(--panel));
  border-left-color: var(--c-emerald);
}

/* ------------------------------------------------------------------
   Footer
   ------------------------------------------------------------------ */
.siteftr{
  background: linear-gradient(180deg, #12172a, #0a0d18);
  border-top: 3px solid transparent;
  border-image: var(--grad-rail) 1;
  color:#c7cede;
}
.siteftr h5, .siteftr h4{ color:#fff; }
.siteftr a{ color:#aeb8cd; }
.siteftr a:hover{ color:#fff; }
.ftr-base{ border-top-color: rgba(255,255,255,.09); color:#8892a8; }

/* ------------------------------------------------------------------
   Crumbs, jump links, laps
   ------------------------------------------------------------------ */
.crumbs a{ color: var(--brand); }
.jump a:hover{ border-color: var(--brand); color: var(--brand); background:var(--brand); background:color-mix(in srgb, var(--brand) 8%, transparent); }
.laps li:nth-child(odd){ background:var(--brand); background:color-mix(in srgb, var(--brand) 4%, transparent); }
.laps li span:nth-child(2){ color: var(--brand); font-weight:700; }
.kbd{ background:var(--panel); background:color-mix(in srgb, var(--brand) 10%, var(--panel)); border-color:var(--line); border-color:color-mix(in srgb, var(--brand) 26%, var(--line)); color: var(--ink); }

a{ color: var(--link); }

/* ------------------------------------------------------------------
   Reveal on scroll (driven by fx.js)
   ------------------------------------------------------------------ */
.reveal{ opacity:0; transform: translateY(14px); }
.reveal.is-in{ opacity:1; transform:none; transition: opacity .5s ease, transform .5s cubic-bezier(.2,.7,.3,1); }
@media (prefers-reduced-motion: reduce){
  .reveal, .reveal.is-in{ opacity:1; transform:none; transition:none; }
  .card, .btn, .panel{ transition:none; }
}

/* ------------------------------------------------------------------
   World clock reference faces
   ------------------------------------------------------------------ */
.faces{ display:grid; grid-template-columns:repeat(3,1fr); gap:14px; }
@media (max-width:900px){ .faces{ grid-template-columns:repeat(2,1fr); } }
@media (max-width:520px){ .faces{ grid-template-columns:repeat(2,1fr); gap:10px; } }
.face-card{
  text-align:center; padding:1.1rem .8rem 1rem;
  border:1px solid var(--line); border-radius: var(--radius-lg);
  background:linear-gradient(180deg, var(--panel), var(--panel));
  background: linear-gradient(180deg, var(--panel), color-mix(in srgb, var(--brand) 5%, var(--panel)));
  box-shadow: var(--glow-soft);
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.face-card:hover{ transform: translateY(-3px); box-shadow: var(--glow-lift);
                  border-color:var(--line); border-color:color-mix(in srgb, var(--brand) 34%, var(--line)); }
.face-card .dialwrap{ max-width:150px; margin:0 auto; color: var(--ink); }
.face-card h3{ font-size:var(--step-0); font-weight:700; margin:.75rem 0 .15rem; }
.face-card .t{ font-family:var(--f-mono); font-size:.82rem; color:var(--brand); font-weight:600; margin:0; }
.face-card .z{ font-family:var(--f-mono); font-size:.7rem; color:var(--rail); margin:.15rem 0 0; }

/* ------------------------------------------------------------------
   Ad slots blend in rather than sitting in a grey box
   ------------------------------------------------------------------ */
.adslot{ background:var(--brand); background:color-mix(in srgb, var(--brand) 3%, transparent); border-radius: var(--radius); }

/* ------------------------------------------------------------------
   Clock over an animated scene — the scene stage is always dark, so the
   readout needs a light gradient regardless of the page theme.
   ------------------------------------------------------------------ */
.stage-clock .readout,
.stage .readout{
  background: linear-gradient(160deg, #ffffff 26%, #dbe4ff);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
  text-shadow: none;
}
.stage-clock .readout .sep,
.stage .readout .sep{ -webkit-text-fill-color:#ff6b81; color:#ff6b81; }
.stage-clock .readout .ampm,
.stage .readout .ampm{ -webkit-text-fill-color: rgba(255,255,255,.6); color: rgba(255,255,255,.6); }
.stage-clock .stage-date{ color: rgba(255,255,255,.82); }
.stage-clock .label{ color: rgba(255,255,255,.7) !important; }

/* ------------------------------------------------------------------
   Round pips (Pomodoro) and round chips (interval trainer)
   ------------------------------------------------------------------ */
.pips{ display:flex; gap:8px; justify-content:center; }
.pip{
  width:11px; height:11px; border-radius:50%;
  background:var(--panel-3);
  background: color-mix(in srgb, var(--brand) 18%, var(--panel-3));
  border:1px solid var(--line-2);
}
.pip.is-done{ background: var(--grad-brand); border-color:transparent; }
.pip.is-now{
  background: var(--grad-go); border-color:transparent;
  box-shadow:0 0 0 4px var(--c-emerald);
  box-shadow:0 0 0 4px color-mix(in srgb, var(--c-emerald) 22%, transparent);
}

/* ------------------------------------------------------------------
   Alarm list rows
   ------------------------------------------------------------------ */
.alarm-row{
  display:flex; align-items:center; justify-content:space-between; gap:1rem;
  padding:.85rem 1rem; margin-bottom:.55rem;
  border:1px solid var(--line); border-radius: var(--radius);
  background:linear-gradient(180deg, var(--panel), var(--panel));
  background: linear-gradient(180deg, var(--panel), color-mix(in srgb, var(--brand) 5%, var(--panel)));
  transition: border-color .18s ease, box-shadow .18s ease, opacity .18s ease;
}
.alarm-row:hover{ border-color:var(--line); border-color:color-mix(in srgb, var(--brand) 34%, var(--line)); box-shadow: var(--glow-soft); }
.alarm-row.is-off{ opacity:.55; }
.alarm-main{ min-width:0; }
.alarm-time{
  margin:0; font-family:var(--f-mono); font-weight:600;
  font-size:var(--step-2); font-variant-numeric:tabular-nums;
  background: var(--grad-brand); -webkit-background-clip:text; background-clip:text;
  -webkit-text-fill-color:transparent; color:transparent;
}
.alarm-row.is-off .alarm-time{ background:none; -webkit-text-fill-color:var(--rail); color:var(--rail); }
.alarm-meta{ margin:.15rem 0 0; font-size:.84rem; color:var(--ink-2); }
.alarm-acts{ display:flex; gap:6px; flex-shrink:0; }
.ringbar{
  display:flex; align-items:center; justify-content:space-between; gap:1rem; flex-wrap:wrap;
  padding:.85rem 1rem; margin-bottom:.8rem; border-radius:var(--radius);
  background: var(--grad-stop); color:#fff;
  box-shadow:0 10px 26px -12px rgba(244,63,94,.6);
}
.ringbar .btn{ background:rgba(255,255,255,.16); border-color:rgba(255,255,255,.4); color:#fff; }
.ringbar .btn:hover{ background:rgba(255,255,255,.28); color:#fff; border-color:#fff; }
@media (max-width:520px){
  .alarm-row{ flex-direction:column; align-items:flex-start; }
}

/* ------------------------------------------------------------------
   Meeting planner grid
   ------------------------------------------------------------------ */
.planner-wrap{ overflow-x:auto; }
.planner{ min-width:900px; }
.planner th, .planner td{ padding:.35rem .2rem; text-align:center; font-size:.76rem; }
.planner th:first-child, .planner td:first-child{
  text-align:left; padding-left:.9rem; padding-right:.9rem;
  white-space:nowrap; position:sticky; left:0; z-index:2;
  background: var(--panel);
}
.planner thead th:first-child{ background: var(--panel-2); }
.planner td.h{ font-family:var(--f-mono); font-variant-numeric:tabular-nums; color:#0b1220; }
.planner td.good{ background:var(--c-emerald); background:color-mix(in srgb, var(--c-emerald) 46%, transparent); font-weight:700; }
.planner td.ok{   background:var(--c-amber); background:color-mix(in srgb, var(--c-amber) 42%, transparent); }
.planner td.bad{  background:var(--c-rose); background:color-mix(in srgb, var(--c-rose) 34%, transparent); color:#fff; }
.planner td.off{  background:var(--rail); background:color-mix(in srgb, var(--rail) 22%, transparent); color:var(--rail); }
.planner th.best{ background: var(--grad-go); color:#fff; border-radius:6px 6px 0 0; }
[data-theme="dark"] .planner td.h{ color:#e9edf7; }
.legend{ display:flex; flex-wrap:wrap; gap:1.1rem; font-size:.84rem; color:var(--ink-2); }
.legend .sw{ display:inline-block; width:14px; height:14px; border-radius:4px; margin-right:.35rem; vertical-align:-2px; }
.sw-good{ background:var(--c-emerald); background:color-mix(in srgb, var(--c-emerald) 46%, transparent); }
.sw-ok{   background:var(--c-amber); background:color-mix(in srgb, var(--c-amber) 42%, transparent); }
.sw-bad{  background:var(--c-rose); background:color-mix(in srgb, var(--c-rose) 34%, transparent); }
.sw-off{  background:var(--rail); background:color-mix(in srgb, var(--rail) 22%, transparent); }

/* ------------------------------------------------------------------
   Mobile navigation drawer
   ------------------------------------------------------------------ */
.navtoggle{ display:none; }
.burger{ display:block; width:18px; }
.burger i{
  display:block; height:2px; border-radius:2px; background:currentColor;
  margin:3px 0; transition:transform .22s ease, opacity .18s ease;
}
.navtoggle[aria-expanded="true"] .burger i:nth-child(1){ transform:translateY(5px) rotate(45deg); }
.navtoggle[aria-expanded="true"] .burger i:nth-child(2){ opacity:0; }
.navtoggle[aria-expanded="true"] .burger i:nth-child(3){ transform:translateY(-5px) rotate(-45deg); }

.navdrawer{
  border-top:1px solid var(--line);
  background:var(--panel);
  background: color-mix(in srgb, var(--panel) 96%, transparent);
  -webkit-backdrop-filter: saturate(180%) blur(14px);   /* Safari needs the prefix */
  backdrop-filter: saturate(180%) blur(14px);
  padding:1rem 0 1.2rem;
  max-height:min(70vh, 560px); overflow-y:auto;
  animation: navIn .18s ease;
}
@keyframes navIn{ from{ opacity:0; transform:translateY(-6px) } to{ opacity:1; transform:none } }
.navdrawer ul{ list-style:none; margin:0; padding:0; display:grid; grid-template-columns:1fr 1fr; gap:6px; }
.navdrawer-more{ grid-template-columns:1fr 1fr; }
.navdrawer a{
  display:block; padding:.7rem .85rem; border-radius:var(--radius-sm);
  font-weight:600; font-size:.94rem; text-decoration:none;
  color:var(--ink); background:var(--panel-2); border:1px solid var(--line);
}
.navdrawer a:hover{ border-color:var(--brand); color:var(--brand); }
.navdrawer a[aria-current="page"]{ background:var(--grad-brand); color:#fff; border-color:transparent; }
.navdrawer-more a{ background:transparent; font-weight:500; font-size:.9rem; }

@media (max-width: 1100px){
  .masthead-in{ gap:.5rem; }
}
@media (max-width: 900px){
  .brand-name{ font-size:.95rem; }
}
@media (max-width: 420px){
  .mast-tools [data-miniclock]{ display:none; }
}

/* ------------------------------------------------------------------
   Collapsible intro blocks — compact on phones, full on desktop.
   All the text stays in the DOM, so nothing is lost to search engines
   or screen readers; only the visual height is reduced.
   ------------------------------------------------------------------ */

@media (max-width: 760px){
  .collapse-toggle::after{ content:"▾"; font-size:.8em; transition:transform .2s ease; }
  .collapse-toggle[aria-expanded="true"]::after{ transform:rotate(180deg); }

  /* Tighter hero rhythm on small screens */
  .hero h1, .section-tight h1{ font-size:clamp(1.65rem,7.4vw,2.3rem); line-height:1.12; }
  .hero .lede, .section-tight .lede{ font-size:1rem; line-height:1.55; }
  .hero-meta{ gap:6px; }
  .hero-meta .chip{ font-size:.72rem; padding:.28rem .55rem; }
  .section{ padding:2.2rem 0; }
  .section-tight{ padding:1.4rem 0; }
}

/* ------------------------------------------------------------------
   Location search
   ------------------------------------------------------------------ */
.locsearch{ position:relative; }
.locsearch-row{ display:flex; gap:8px; }
.locsearch-row .field{ flex:1; min-width:0; }
.locsuggest{
  position:absolute; z-index:40; left:0; right:0; top:100%;
  margin:.35rem 0 0; padding:.3rem; list-style:none;
  background:var(--panel); border:1px solid var(--line-2);
  border-radius:var(--radius); box-shadow:var(--glow-lift);
  max-height:320px; overflow-y:auto;
}
.locsuggest li{
  display:grid; grid-template-columns:1fr auto; gap:.1rem .8rem;
  padding:.55rem .7rem; border-radius:var(--radius-sm); cursor:pointer;
}
.locsuggest li:hover, .locsuggest li.is-active{ background:var(--brand); background:color-mix(in srgb, var(--brand) 12%, transparent); }
.ls-name{ font-weight:600; font-size:.95rem; }
.ls-sub{ grid-column:1; font-size:.78rem; color:var(--rail); }
.ls-time{ grid-row:1 / span 2; align-self:center; font-size:.9rem; color:var(--brand); font-weight:600; }

.loccards{ display:grid; grid-template-columns:repeat(auto-fill,minmax(260px,1fr)); gap:14px; margin-top:1.3rem; }
.loccard{
  border:1px solid var(--line); border-radius:var(--radius-lg); padding:1.1rem 1.2rem;
  background:linear-gradient(180deg,var(--panel),var(--panel));
  background:linear-gradient(180deg,var(--panel),color-mix(in srgb,var(--brand) 5%,var(--panel)));
  box-shadow:var(--glow-soft);
}
.loccard-h{ display:flex; justify-content:space-between; align-items:flex-start; gap:.6rem; }
.loccard h3{ margin:0; font-size:var(--step-1); }
.loccard-sub{ margin:.1rem 0 0; font-size:.8rem; color:var(--rail); }
.loccard-x{ padding:.15rem .45rem; min-height:0; line-height:1; }
.loccard-time{
  margin:.7rem 0 .1rem; font-size:2rem; font-weight:600; font-variant-numeric:tabular-nums;
  background:var(--grad-brand); -webkit-background-clip:text; background-clip:text;
  -webkit-text-fill-color:transparent; color:transparent;
}
.loccard-meta{ margin:0; font-size:.8rem; color:var(--ink-2); }
.loccard-wx{ margin-top:.8rem; padding-top:.8rem; border-top:1px solid var(--line); }
.wx-now{ display:flex; align-items:center; gap:.55rem; }
.wx-ico{ font-size:1.5rem; line-height:1; }
.wx-t{ font-size:1.35rem; font-weight:700; }
.wx-d{ font-size:.85rem; color:var(--ink-2); }
.wx-more{ margin:.45rem 0 0; font-size:.78rem; color:var(--rail); line-height:1.5; }
.wx-load{ font-size:.82rem; color:var(--rail); }

/* ------------------------------------------------------------------
   World map
   ------------------------------------------------------------------ */
.wmap{
  width:100%; border-radius:var(--radius-lg); overflow:hidden;
  border:1px solid var(--line-2); background:#0a1020;
  box-shadow:var(--glow-lift);
}
.wmap-svg{ display:block; width:100%; height:auto; }
.band-a{ fill:#101a33; }
.band-b{ fill:#0d1628; }
.wmap-land polygon{ fill:#27407a; stroke:#3d5da8; stroke-width:1.5; opacity:.95; }
.wmap-grid line{ stroke:rgba(255,255,255,.14); stroke-width:1.5; }
.wmap-grid .g-eq{ stroke:rgba(255,255,255,.3); stroke-dasharray:10 8; }
.wmap-grid .g-pm{ stroke:rgba(255,215,120,.45); stroke-dasharray:10 8; }
.wmap-night rect{ fill:rgba(0,0,0,.42); pointer-events:none; }
.wmap-noon{ stroke:#ffd166; stroke-width:3; opacity:.75; }
.wmap-pin{ cursor:pointer; }
.pin-halo{ fill:rgba(255,90,120,.22); }
.pin-dot{ fill:#ff5a78; stroke:#fff; stroke-width:2.5; }
.wmap-pin.is-night .pin-dot{ fill:#8b9bff; }
.wmap-pin.is-night .pin-halo{ fill:rgba(139,155,255,.22); }
.wmap-pin:hover .pin-halo, .wmap-pin:focus .pin-halo{ fill:rgba(255,255,255,.3); }
.pin-city{ fill:#fff; font-family:var(--f-display); font-weight:700; font-size:26px; }
.pin-time{ fill:#c9d4ff; font-family:var(--f-mono); font-size:24px; }
.wmap-legend{
  display:flex; flex-wrap:wrap; gap:1.1rem; align-items:center;
  margin-top:.8rem; font-size:.82rem; color:var(--ink-2);
}
.wmap-legend .sw{ display:inline-block; width:14px; height:14px; border-radius:4px; margin-right:.35rem; vertical-align:-2px; }
.sw-night{ background:rgba(10,16,32,.85); border:1px solid var(--line-2); }
.sw-band{ background:linear-gradient(90deg,#101a33 50%,#0d1628 50%); }
.sw-noon{ background:#ffd166; }
.wmap-hint{ margin-left:auto; color:var(--rail); }
.wmap-read{
  margin:.7rem 0 0; min-height:1.4em; font-size:.9rem; color:var(--ink-2);
  padding:.6rem .9rem; border-radius:var(--radius);
  background:var(--brand);
  background:color-mix(in srgb,var(--brand) 7%,transparent);
}
@media (max-width:760px){
  .pin-city{ font-size:34px; }
  .pin-time{ font-size:32px; }
  .pin-dot{ r:9; }
  .wmap-hint{ margin-left:0; width:100%; }
}

/* ------------------------------------------------------------------
   Country page weather panels
   ------------------------------------------------------------------ */
.wx-hero{ display:flex; align-items:center; gap:1rem; }
.wx-ico-lg{ font-size:3.2rem; line-height:1; }
.wx-big{
  margin:0; font-size:2.6rem; font-weight:700; line-height:1;
  font-variant-numeric:tabular-nums;
  background:var(--grad-warm); -webkit-background-clip:text; background-clip:text;
  -webkit-text-fill-color:transparent; color:transparent;
}
.wx-desc{ margin:.25rem 0 0; font-size:.92rem; color:var(--ink-2); }
.wx-grid{
  display:grid; grid-template-columns:repeat(auto-fit,minmax(110px,1fr));
  gap:.8rem; margin-top:1.1rem; padding-top:1rem; border-top:1px solid var(--line);
}
.wx-grid > div{ display:flex; flex-direction:column; gap:.15rem; }
.wx-grid b{ font-size:1.05rem; font-variant-numeric:tabular-nums; }

/* ------------------------------------------------------------------
   Country index
   ------------------------------------------------------------------ */
.ctry-grid{ display:grid; grid-template-columns:repeat(auto-fill,minmax(220px,1fr)); gap:10px; margin-top:.8rem; }
.ctry{
  display:grid; grid-template-columns:1fr auto; gap:.05rem .7rem;
  padding:.75rem .9rem; border:1px solid var(--line); border-radius:var(--radius);
  background:var(--panel); text-decoration:none;
  transition:border-color .16s ease, transform .16s ease, box-shadow .16s ease;
}
.ctry:hover{ border-color:var(--brand); transform:translateY(-2px); box-shadow:var(--glow-soft); }
.ctry-name{ font-weight:700; font-size:.95rem; color:var(--ink); }
.ctry-cap{ grid-column:1; font-size:.76rem; color:var(--rail); }
.ctry-time{ grid-row:1 / span 2; align-self:center; font-size:.95rem; font-weight:600; color:var(--brand); }
/* Halo behind map labels so they stay legible over land and sea alike. */
.pin-city, .pin-time{ paint-order:stroke fill; stroke:rgba(6,10,22,.85); stroke-width:6px; stroke-linejoin:round; }
.wmap-hours text{ fill:rgba(255,255,255,.5); font-family:var(--f-mono); font-size:20px; }
/* Wide container for the dedicated map page */
.shell-wide{ width:100%; max-width:1600px; margin:0 auto; padding:0 clamp(1rem,3vw,2rem); }

/* ------------------------------------------------------------------
   Masthead search
   ------------------------------------------------------------------ */
.navsearch{ position:relative; }
.navsearch-in{
  width:clamp(150px,17vw,230px); padding:.42rem .7rem; min-height:36px;
  font-family:var(--f-body); font-size:.85rem;
  border:1px solid var(--line-2); border-radius:999px;
  background:var(--panel-2); color:var(--ink);
}
.navsearch-in::placeholder{ color:var(--rail); }
.navsearch-in:focus{
  outline:none; border-color:var(--brand); background:var(--panel);
  box-shadow:0 0 0 4px var(--brand);
  box-shadow:0 0 0 4px color-mix(in srgb, var(--brand) 16%, transparent);
}
.navsearch-list{
  position:absolute; right:0; top:calc(100% + .4rem); z-index:60;
  width:min(340px,84vw); margin:0; padding:.3rem; list-style:none;
  background:var(--panel); border:1px solid var(--line-2);
  border-radius:var(--radius); box-shadow:var(--glow-lift);
  max-height:60vh; overflow-y:auto;
}
@media (max-width:1150px){ .navsearch-in{ width:150px; } }
@media (max-width:900px){
  .navsearch{ order:3; flex-basis:100%; margin-top:.5rem; }
  .navsearch-in{ width:100%; }
  .navsearch-list{ left:0; right:0; width:auto; }
  .masthead-in{ flex-wrap:wrap; }
}

/* ------------------------------------------------------------------
   Nav dropdowns
   ------------------------------------------------------------------ */
.mainnav li.hasmenu{ position:relative; }
.navtrigger{
  display:inline-flex; align-items:center; gap:.3rem;
  font-family:var(--f-body); font-size:.86rem; font-weight:600;
  padding:.45rem .7rem; border:0; border-radius:999px;
  background:transparent; color:var(--rail); cursor:pointer;
  white-space:nowrap; transition:color .16s ease, background .16s ease;
}
.navtrigger:hover{ color:var(--brand); background:var(--brand); background:color-mix(in srgb,var(--brand) 10%,transparent); }
.navtrigger.is-current{ color:#fff; background:var(--grad-brand); box-shadow:var(--glow-brand); }
.caret{
  width:0; height:0; border-left:4px solid transparent; border-right:4px solid transparent;
  border-top:5px solid currentColor; transition:transform .18s ease;
}
.navtrigger[aria-expanded="true"] .caret{ transform:rotate(180deg); }

.navmenu{
  position:absolute; z-index:70; top:calc(100% + .5rem); left:0;
  min-width:270px; padding:.35rem;
  background:var(--panel); border:1px solid var(--line-2);
  border-radius:var(--radius); box-shadow:var(--glow-lift);
  animation:navMenuIn .16s ease;
}
@keyframes navMenuIn{ from{ opacity:0; transform:translateY(-5px) } to{ opacity:1; transform:none } }
.navmenu ul{ display:block; list-style:none; margin:0; padding:0; }
.navmenu a{
  display:block; padding:.55rem .7rem; border-radius:var(--radius-sm);
  text-decoration:none; border:0;
}
.navmenu a:hover{ background:var(--brand); background:color-mix(in srgb,var(--brand) 11%,transparent); }
.navmenu a[aria-current="page"]{ background:var(--grad-brand); }
.navmenu a[aria-current="page"] .nm-t,
.navmenu a[aria-current="page"] .nm-n{ color:#fff; }
.nm-t{ display:block; font-weight:600; font-size:.9rem; color:var(--ink); }
.nm-n{ display:block; font-size:.76rem; color:var(--rail); margin-top:.1rem; }

/* The burger belongs to phones and tablets only. The extra class beats
   `button.btn` from the base sheet, which would otherwise force it visible. */
.btn.navtoggle, button.navtoggle{ display:none; }
@media (max-width: 1100px){
  .btn.navtoggle, button.navtoggle{ display:inline-flex; }
  .mainnav{ display:none; }
}

/* ------------------------------------------------------------------
   Collapsible intros now work at every width
   ------------------------------------------------------------------ */
.btn.collapse-toggle, button.collapse-toggle{
  display:inline-flex; margin-top:.7rem; gap:.35rem; align-items:center;
}
.collapsible.is-collapsed{
  position:relative; overflow:hidden;
  max-height:6.4em;
  -webkit-mask-image:linear-gradient(180deg,#000 60%,transparent 100%);
          mask-image:linear-gradient(180deg,#000 60%,transparent 100%);
}
.collapsible.is-collapsed > *:not(:first-child){ margin-top:.4rem; }
@media (max-width: 760px){
  .collapsible.is-collapsed{ max-height:8.6em; }
}

/* The base sheet gives .mainnav overflow-x:auto for the old scrolling nav.
   That creates a clipping context, which would cut off the dropdown panels,
   and it also let items scroll out of sight. With seven grouped items there
   is room to lay them out normally. */
.mainnav{ overflow:visible; flex:0 1 auto; }
.mainnav > ul{ flex-wrap:nowrap; }
.mainnav a, .navtrigger{ padding-inline:.6rem; }
.masthead-in{ gap:.4rem; }
.mast-tools{ margin-left:auto; }
@media (max-width:1360px){
  .navsearch-in{ width:170px; }
  .mainnav a, .navtrigger{ padding-inline:.5rem; font-size:.83rem; }
}
@media (max-width:1200px){
  .navsearch-in{ width:140px; }
  .mast-tools [data-miniclock]{ display:none; }
}

/* ------------------------------------------------------------------
   Masthead spans the full viewport rather than the article column, so the
   brand sits hard left and the search and controls hard right. The page
   content keeps its narrower measure for readability.
   ------------------------------------------------------------------ */
.masthead .masthead-in{
  max-width:none;
  padding-inline:clamp(1rem, 2.2vw, 2.4rem);
  gap:clamp(.5rem, 1.4vw, 1.4rem);
}
.masthead .brand{ margin-right:clamp(.4rem, 1.6vw, 1.6rem); flex-shrink:0; }
.masthead .mainnav{ margin-inline:auto 0; }
.masthead .mast-tools{ margin-left:auto; flex-shrink:0; gap:8px; }
@media (min-width:1500px){
  .navsearch-in{ width:260px; }
}

/* ------------------------------------------------------------------
   Charts
   ------------------------------------------------------------------ */
.chartwrap + .chartwrap{ margin-top:1.4rem; }
.ocv{
  margin:0; padding:1.1rem 1.2rem 1rem;
  border:1px solid var(--line); border-radius:var(--radius-lg);
  background:linear-gradient(180deg,var(--panel),var(--panel));
  background:linear-gradient(180deg,var(--panel),color-mix(in srgb,var(--brand) 4%,var(--panel)));
  box-shadow:var(--glow-soft);
}
.ocv-title{ font-family:var(--f-display); font-weight:700; font-size:var(--step-1); margin-bottom:.7rem; }
.ocv-svg{ display:block; width:100%; height:auto; overflow:visible; }
.ocv-grid{ stroke:var(--line); stroke-width:1.4; stroke-dasharray:5 6; }
.ocv-ylab, .ocv-xlab{ fill:var(--rail); font-family:var(--f-mono); font-size:20px; }
.ocv-bar{ transition:opacity .15s ease; }
.ocv-bar:hover{ opacity:.78; }
.ocv-c1{ fill:var(--c-orange); }
.ocv-c2{ fill:var(--c-cyan); }
.ocv-c3{ fill:var(--c-violet); }
.ocv-line{ fill:none; stroke:var(--brand); stroke-width:4; stroke-linejoin:round; stroke-linecap:round; }
.ocv-fill{ fill:var(--brand); fill:color-mix(in srgb, var(--brand) 18%, transparent); stroke:none; }
.ocv-mark circle{ stroke:var(--panel); stroke-width:3; }
.ocv-mark text{ font-family:var(--f-mono); font-size:21px; font-weight:600; }
.ocv-hi circle{ fill:var(--c-rose); } .ocv-hi text{ fill:var(--c-rose); }
.ocv-lo circle{ fill:var(--c-cyan); } .ocv-lo text{ fill:var(--c-cyan); }
.ocv-legend{ display:flex; gap:1.1rem; flex-wrap:wrap; margin-top:.7rem; font-size:.82rem; color:var(--ink-2); }
.ocv-key{ display:inline-block; width:13px; height:13px; border-radius:3px; margin-right:.35rem; vertical-align:-2px; }
.ocv-key.ocv-c1{ background:var(--c-orange); }
.ocv-key.ocv-c2{ background:var(--c-cyan); }
.ocv-note{ margin:.7rem 0 0; font-size:.79rem; color:var(--rail); line-height:1.5; }

/* Moon and air quality */
.moonface{ font-size:4.6rem; line-height:1; }
.moon-ill{ margin:.1rem 0 0; font-family:var(--f-mono); font-size:1.05rem; color:var(--brand); font-weight:600; }
.aqi-badge{
  display:inline-grid; place-items:center; width:76px; height:76px; border-radius:50%;
  font-family:var(--f-mono); font-size:1.7rem; font-weight:700; color:#fff;
}
.aqi-go{ background:var(--grad-go); }
.aqi-idle{ background:var(--grad-warm); }
.aqi-stop{ background:var(--grad-stop); }
@media (max-width:760px){
  .ocv-ylab, .ocv-xlab{ font-size:28px; }
  .ocv-mark text{ font-size:28px; }
}

/* ------------------------------------------------------------------
   Dual clock, day timeline, device comparison, map
   ------------------------------------------------------------------ */
.dualtime{
  margin:.5rem 0 0; text-align:center;
  font-size:.95rem; color:var(--ink-2); font-variant-numeric:tabular-nums;
}
.dualtime .dual-sep{ color:var(--line-2); margin:0 .5rem; }
.u-alt{ font-weight:500; opacity:.72; }

.dayline{ margin:1.6rem auto 0; max-width:760px; padding:2.6rem 0 2.2rem; }
.dl-track{
  position:relative; height:10px; border-radius:999px;
  background:linear-gradient(90deg,
    #1e2749 0%, #2c3a6b 12%, #d98b4a 24%, #ffd88a 33%,
    #8fd0ff 50%, #ffd88a 67%, #d98b4a 76%, #2c3a6b 88%, #1e2749 100%);
  box-shadow:inset 0 0 0 1px rgba(0,0,0,.12);
}
.dl-fill{
  position:absolute; inset:0 auto 0 0; border-radius:999px;
  background:rgba(255,255,255,.55); mix-blend-mode:overlay;
}
[data-theme="dark"] .dl-fill{ background:rgba(0,0,0,.35); mix-blend-mode:normal; }
.dl-tick{ position:absolute; top:100%; transform:translateX(-50%); text-align:center; }
.dl-tick i{ display:block; width:1px; height:7px; margin:0 auto; background:var(--line-2); }
.dl-tick b{
  display:block; margin-top:.3rem; font-family:var(--f-mono);
  font-size:.68rem; font-weight:500; color:var(--rail); white-space:nowrap;
}
.dl-pin{ position:absolute; top:50%; width:0; height:0; }
.dl-pin::before{
  content:""; position:absolute; left:-7px; top:-7px;
  width:14px; height:14px; border-radius:50%;
  border:3px solid var(--panel); box-shadow:0 1px 5px rgba(0,0,0,.3);
}
.dl-there::before{ background:var(--c-rose); }
.dl-here::before{ background:var(--c-indigo); }
.dl-lab{
  position:absolute; left:0; bottom:16px; transform:translateX(-50%);
  white-space:nowrap; text-align:center;
}
.dl-pin.flip .dl-lab{ bottom:auto; top:16px; }
.dl-lab b{
  display:block; font-family:var(--f-mono); font-size:.86rem; font-weight:700; color:var(--ink);
}
.dl-lab i{ display:block; font-style:normal; font-size:.7rem; color:var(--rail); }
.dl-there .dl-lab b{ color:var(--c-rose); }
.dl-here .dl-lab b{ color:var(--c-indigo); }

.devcompare{
  display:grid; grid-template-columns:1fr auto 1fr; gap:1rem; align-items:center;
  max-width:640px; margin:1.4rem auto 0; padding:1rem 1.2rem;
  border:1px solid var(--line); border-radius:var(--radius-lg);
  background:var(--panel);
  background:color-mix(in srgb, var(--brand) 5%, var(--panel));
}
.dc-cell{ text-align:center; min-width:0; }
.dc-time{ margin:.2rem 0 0; font-size:1.45rem; font-weight:700; font-variant-numeric:tabular-nums; }
.dc-sub{ margin:.15rem 0 0; font-size:.7rem; color:var(--rail); word-break:break-word; }
.dc-gap{ text-align:center; font-size:.78rem; color:var(--ink-2); }
.dc-gap b{ display:block; font-family:var(--f-mono); font-size:1.05rem; color:var(--brand); }
.dc-gap i{ display:block; font-style:normal; font-size:.68rem; color:var(--rail); margin-top:.1rem; }
.dc-arrow{ display:block; font-size:1.2rem; color:var(--brand); line-height:1; }
.dc-same{ font-weight:600; color:var(--go); }
@media (max-width:560px){
  .devcompare{ grid-template-columns:1fr; gap:.7rem; }
  .dl-tick b{ font-size:.6rem; }
}

.mapbox{
  height:clamp(340px, 46vh, 520px); border-radius:var(--radius-lg);
  border:1px solid var(--line-2); overflow:hidden; box-shadow:var(--glow-lift);
  background:var(--panel-3);
}
.mapbox .leaflet-control-layers, .mapbox .leaflet-bar{ border-radius:8px; }
.mapfallback{ display:grid; place-items:center; height:100%; text-align:center; gap:.4rem; }
/* The big weather figure uses gradient text; the secondary unit needs its
   own solid colour or it disappears into the clipped background. */
.wx-big .u-alt{
  -webkit-text-fill-color: var(--ink-2); color: var(--ink-2);
  background: none; font-size:.55em; font-weight:600; margin-left:.15em;
}

/* ------------------------------------------------------------------
   Nav items as buttons
   ------------------------------------------------------------------ */
.mainnav > ul{ gap:6px; }
.mainnav > ul > li > a,
.mainnav .navtrigger{
  border:1px solid var(--line-2);
  border-radius:999px;
  background:var(--panel-2);
  padding:.44rem .8rem;
  font-weight:600; font-size:.85rem;
  color:var(--ink-2);
  transition:border-color .16s ease, color .16s ease, background .16s ease, transform .12s ease;
}
.mainnav > ul > li > a:hover,
.mainnav .navtrigger:hover{
  border-color:var(--brand); color:var(--brand);
  background:var(--panel);
  background:color-mix(in srgb, var(--brand) 9%, var(--panel));
  transform:translateY(-1px);
}
.mainnav > ul > li > a[aria-current="page"],
.mainnav .navtrigger.is-current{
  background:var(--grad-brand); border-color:transparent; color:#fff;
  box-shadow:var(--glow-brand);
}
.mainnav .navtrigger[aria-expanded="true"]{
  border-color:var(--brand); color:var(--brand);
  background:var(--panel);
  background:color-mix(in srgb, var(--brand) 9%, var(--panel));
}
.mainnav .navtrigger.is-current[aria-expanded="true"]{ color:#fff; background:var(--grad-brand); }

/* ------------------------------------------------------------------
   Country page dashboard grid.
   Two columns from 900px and three from 1400px, so a wide screen shows
   most of the data without scrolling instead of one tall column.
   ------------------------------------------------------------------ */
.dash{ display:grid; grid-template-columns:1fr; gap:16px; margin-top:1.4rem; align-items:stretch; }
@media (min-width:900px){ .dash{ grid-template-columns:repeat(2,1fr); } }
@media (min-width:1400px){
  .dash{ grid-template-columns:repeat(3,1fr); }
  .dash-2{ grid-template-columns:repeat(2,1fr); }
  .dash-span2{ grid-column:span 2; }
}
.dash-card{
  border:1px solid var(--line); border-radius:var(--radius-lg);
  padding:1.15rem 1.25rem 1.2rem;
  background:linear-gradient(180deg,var(--panel),var(--panel));
  background:linear-gradient(180deg,var(--panel),color-mix(in srgb,var(--brand) 4%,var(--panel)));
  box-shadow:var(--glow-soft);
  min-width:0;
}
.dash-card > h3, .dash-card > .dash-h{
  margin:0 0 .2rem; font-size:var(--step-1); font-family:var(--f-display); font-weight:700;
}
.dash-card .dash-sub{ margin:0 0 .9rem; font-size:.85rem; color:var(--ink-2); }
.dash-card .dash-h{ margin-top:.2rem; }
.dash-card .table-wrap{ box-shadow:none; }
/* Charts sit flush inside their card rather than nesting two boxes. */
.dash-card .ocv{ border:0; background:none; box-shadow:none; padding:0; }
.dash-card .mapbox{ height:clamp(300px,34vh,420px); }
.dash-card .wx-hero{ gap:.8rem; }
.dash-card .wx-ico-lg{ font-size:2.6rem; }
.dash-card .wx-big{ font-size:2rem; }
.moonrow{ display:grid; grid-template-columns:1fr; gap:.9rem; align-items:center; }
@media (min-width:520px){ .moonrow{ grid-template-columns:auto 1fr; } }
.moonrow-a{ text-align:center; }
.moonrow-a .moonface{ font-size:3.2rem; }
.moonrow-a h3{ font-size:.98rem; margin:.3rem 0 .1rem; }
.moonrow-a .moon-ill{ font-size:.85rem; }
.moonrow-a .hint{ font-size:.72rem; }
/* The map is the tallest card, so it also spans two rows and the weather
   and sun cards stack beside it instead of leaving a hole in the grid. */
@media (min-width:1400px){
  .dash-span2#map{ grid-column:span 2; grid-row:span 2; }
}
@media (min-width:900px) and (max-width:1399px){
  .dash-span2{ grid-column:span 2; }
}
.dash-card#weather, .dash-card#sun{ align-self:stretch; }
.moonrow-a{ display:flex; flex-direction:column; align-items:center; justify-content:center; }
.moonrow-a .moonface{ font-size:2.8rem; }

/* ------------------------------------------------------------------
   Desktop: nav sits next to the search rather than floating mid-header
   ------------------------------------------------------------------ */
.masthead .mainnav{ margin-left:auto; margin-right:0; }
.masthead .mast-tools{ margin-left:.6rem; }
.btn.searchtoggle, button.searchtoggle{ display:none; }

/* ------------------------------------------------------------------
   Phones and tablets: brand left, controls right, search behind an icon
   ------------------------------------------------------------------ */
@media (max-width:1100px){
  .masthead-in{ flex-wrap:nowrap; }
  .masthead .brand{ margin-right:0; }
  .masthead .mast-tools{ margin-left:auto; gap:6px; }

  .btn.searchtoggle, button.searchtoggle{ display:inline-flex; order:1; }
  .mast-tools [data-theme-toggle]{ order:2; }
  .mast-tools .navtoggle{ order:3; }
  .mast-tools [data-miniclock]{ display:none; }

  /* The field drops below the bar and only when asked for. */
  .navsearch{
    order:4; position:absolute; left:0; right:0; top:100%;
    margin:0; padding:.7rem clamp(1rem,4vw,1.4rem);
    background:var(--panel);
    border-bottom:1px solid var(--line);
    box-shadow:var(--glow-soft);
    display:none; z-index:65;
  }
  .navsearch.is-open{ display:block; }
  .navsearch-in{ width:100%; }
  .navsearch-list{ left:clamp(1rem,4vw,1.4rem); right:clamp(1rem,4vw,1.4rem); width:auto; }
  .searchtoggle[aria-expanded="true"]{
    border-color:var(--brand); color:var(--brand);
    background:var(--brand);
    background:color-mix(in srgb, var(--brand) 10%, transparent);
  }
  .masthead{ position:relative; }
}

/* Cards in the same row match height, and their content sits top-aligned
   so a short card does not float its text into the middle. */
.dash-card{ display:flex; flex-direction:column; }
.dash-card > :last-child{ margin-bottom:0; }
.dash-card .table-wrap{ overflow-x:auto; }

/* ------------------------------------------------------------------
   On-page notices, used instead of window.alert() for timers and alarms
   ------------------------------------------------------------------ */
.octoasts{
  position:fixed; z-index:200; right:clamp(.7rem,2vw,1.4rem); bottom:clamp(.7rem,2vw,1.4rem);
  display:flex; flex-direction:column; gap:.6rem; width:min(360px, calc(100vw - 1.6rem));
  pointer-events:none;
}
.octoast{
  pointer-events:auto;
  display:flex; align-items:flex-start; gap:.8rem;
  padding:.9rem 1rem; border-radius:var(--radius);
  background:var(--grad-brand); color:#fff;
  box-shadow:0 14px 40px -14px rgba(0,0,0,.55);
  animation:toastIn .22s cubic-bezier(.2,.8,.3,1);
}
@keyframes toastIn{ from{ opacity:0; transform:translateY(12px) } to{ opacity:1; transform:none } }
.octoast.is-out{ opacity:0; transform:translateY(8px); transition:opacity .22s ease, transform .22s ease; }
.octoast strong{ display:block; font-size:.95rem; }
.octoast p{ margin:.2rem 0 0; font-size:.84rem; opacity:.9; line-height:1.45; }
.octoast-x{
  margin-left:auto; background:transparent; border:0; color:#fff;
  font-size:1.3rem; line-height:1; cursor:pointer; opacity:.75; padding:0 .1rem;
}
.octoast-x:hover{ opacity:1; }

/* ==================================================================
   Homepage clock studio
   ================================================================== */
.studio{
  --studio-accent: var(--c-rose);
  border:1px solid var(--line-2); border-radius:var(--radius-lg);
  background:var(--panel); box-shadow:var(--glow-lift);
  overflow:hidden; margin-top:1.4rem;
}
.studio-bar{
  display:flex; align-items:center; justify-content:space-between; gap:1rem;
  padding:.7rem .9rem; border-bottom:1px solid var(--line);
  background:linear-gradient(180deg, var(--panel), var(--panel));
  background:linear-gradient(180deg, color-mix(in srgb,var(--brand) 7%,var(--panel)), var(--panel));
  flex-wrap:wrap;
}
.studio-mode{ display:flex; gap:4px; }
.sbtn{
  font-family:var(--f-body); font-size:.82rem; font-weight:600;
  padding:.4rem .8rem; border:1px solid var(--line-2); border-radius:999px;
  background:var(--panel); color:var(--ink-2); cursor:pointer;
  transition:all .15s ease;
}
.sbtn:hover{ border-color:var(--brand); color:var(--brand); }
.sbtn[aria-pressed="true"]{ background:var(--grad-brand); border-color:transparent; color:#fff; }
.studio-tools{ display:flex; align-items:center; gap:5px; }
.sicon{
  display:inline-grid; place-items:center; width:34px; height:34px;
  border:1px solid var(--line-2); border-radius:9px;
  background:var(--panel); color:var(--ink-2); cursor:pointer;
  transition:all .15s ease;
}
.sicon:hover{ border-color:var(--brand); color:var(--brand); background:var(--brand); background:color-mix(in srgb,var(--brand) 8%,transparent); }
.sicon[aria-expanded="true"]{ border-color:var(--brand); color:var(--brand); background:var(--brand); background:color-mix(in srgb,var(--brand) 12%,transparent); }
.ssize{ min-width:44px; text-align:center; font-size:.76rem; color:var(--rail); }
.studio-div{ width:1px; height:22px; background:var(--line-2); margin:0 .3rem; }

.studio-panel{
  padding:1rem 1.1rem; border-bottom:1px solid var(--line);
  background:var(--panel-2);
  animation:navMenuIn .16s ease;
}
.setgrid{ display:grid; grid-template-columns:repeat(auto-fit,minmax(210px,1fr)); gap:1.1rem; }

.bgpick{ display:grid; grid-template-columns:repeat(auto-fill,minmax(118px,1fr)); gap:8px; }
.bgchip{
  position:relative; height:74px; border-radius:10px; overflow:hidden;
  border:2px solid var(--line-2); cursor:pointer; padding:0;
  display:grid; place-items:end center;
}
/* the live preview sits behind the label */
.bgchip .stage-layer{ position:absolute; inset:0; z-index:1; pointer-events:none; }
.bgchip .stage-layer > *{ pointer-events:none; }
.bgchip-label{
  position:relative; z-index:2; width:100%; padding:.22rem .3rem;
  font-size:.68rem; font-weight:700; color:#fff;
  background:linear-gradient(180deg, transparent, rgba(0,0,0,.8));
  text-shadow:0 1px 3px rgba(0,0,0,.6);
}
.bgchip-none{ background:var(--panel-3); }
.bgchip-none .bgchip-label{ color:var(--ink-2); background:none; text-shadow:none; }
.bgchip:hover{ border-color:var(--brand); }
.bgchip[aria-pressed="true"]{ border-color:var(--brand); box-shadow:0 0 0 3px var(--brand); box-shadow:0 0 0 3px color-mix(in srgb,var(--brand) 25%,transparent); }

.studio-stage{
  position:relative; overflow:hidden;
  min-height:clamp(320px, 46vh, 520px);
  display:grid; place-items:center;
  background:var(--dial-2);
  padding:1.8rem 1rem;
}
.studio-stage[data-bg="none"]{ background:linear-gradient(160deg,var(--panel),var(--dial-2)); }
.studio-stage:not([data-bg="none"]) .studio-clock{ color:#fff; }
.studio-stage:fullscreen{ min-height:100vh; border-radius:0; }

.studio-clock{
  --scale:1;
  position:relative; z-index:3;
  display:flex; align-items:center; justify-content:center;
  gap:clamp(1.2rem, 4vw, 3.4rem);
  transform:scale(var(--scale)); transform-origin:center;
  transition:transform .18s ease;
  flex-wrap:wrap;
}
.studio[data-view="analog"] .sc-digital{ display:none; }
.studio[data-view="digital"] .sc-analog{ display:none; }

.sc-analog{ width:clamp(180px, 26vw, 300px); flex-shrink:0; }
.sc-analog svg{ display:block; width:100%; height:auto; }
.f-dial{ fill:var(--panel); stroke:currentColor; stroke-width:5; }
.studio-stage:not([data-bg="none"]) .f-dial{ fill:rgba(12,16,28,.55); stroke:#fff; }
.f-tick{ stroke:currentColor; opacity:.55; }
.f-tick-h{ opacity:1; }
.f-num{ fill:currentColor; font-family:var(--f-display); font-weight:700; font-size:30px; }
.f-hand{ stroke:currentColor; stroke-linecap:round; }
.f-hour{ stroke-width:16; }
.f-min{ stroke-width:10; }
.f-sec line{ stroke:var(--studio-accent); stroke-width:3.5; stroke-linecap:round; }
.f-sec circle{ fill:var(--studio-accent); }
.f-cap{ fill:currentColor; }

.sc-digital{ text-align:center; min-width:0; }
.sc-digital .readout{ font-size:clamp(2.6rem, 9vw, 6rem); }
/* The digits are painted by a clipped gradient rather than by `color`, so a
   dark backdrop has to restate that here — setting the clock's colour alone
   leaves them dark and unreadable. */
.studio-stage:not([data-bg="none"]) .sc-digital .readout,
.studio-stage.on-dark .sc-digital .readout{
  background:linear-gradient(160deg,#fff 26%,#dbe4ff);
  -webkit-background-clip:text; background-clip:text; -webkit-text-fill-color:transparent;
}
.studio-stage.on-dark .sc-meta,
.studio-stage.on-dark .sc-digital .ms{ color:rgba(255,255,255,.72); }
.studio-stage.on-dark .studio-clock .rail-tick{ background:rgba(255,255,255,.5); }
.sc-digital .ms{ font-size:.34em; color:var(--rail); margin-left:.12em; font-variant-numeric:tabular-nums; }
.sc-meta{
  margin:.6rem 0 0; font-size:.86rem; color:var(--ink-2);
  display:flex; gap:.6rem; justify-content:center; flex-wrap:wrap;
}
.studio-stage:not([data-bg="none"]) .sc-meta{ color:rgba(255,255,255,.82); }
.sexit{ position:absolute; top:14px; right:14px; z-index:5; }

.studio-foot{
  display:flex; align-items:center; justify-content:space-between; gap:1rem;
  padding:.9rem 1rem; border-top:1px solid var(--line); flex-wrap:wrap;
  background:var(--panel);
}
@media (max-width:760px){
  .studio-bar{ justify-content:center; }
  .studio-clock{ flex-direction:column; gap:1.2rem; }
  .sc-analog{ width:min(58vw,230px); }
  .studio-foot{ justify-content:center; }
}
/* [hidden] loses to .sicon's display rule, so restore it explicitly. */
.sicon[hidden], .sbtn[hidden]{ display:none !important; }

/* Colour swatches were only styled inside the night-light page; the studio
   needs them too, so the rules live here now. */
.swatches{ display:flex; flex-wrap:wrap; gap:8px; }
.swatch{
  width:34px; height:34px; border-radius:50%; border:2px solid var(--line-2);
  cursor:pointer; padding:0; transition:transform .12s ease, border-color .12s ease;
}
.swatch:hover{ transform:scale(1.08); }
.swatch[aria-pressed="true"]{ border-color:var(--ink); transform:scale(1.1); }

/* ---- clock studio: layout tweaks and the font picker ---- */
.studio-head{ max-width:760px; margin-inline:auto; }
.studio-head h1{ margin-bottom:.35rem; }
.studio-head .lede{ margin-inline:auto; }

.studio-left{ display:flex; align-items:center; gap:.5rem; flex-wrap:wrap; }
.studio-mode{ display:flex; gap:4px; }

.sc-cta{ margin-top:1.1rem; display:flex; justify-content:center; }
.sc-cta .btn{ box-shadow:0 10px 30px -12px rgba(244,63,94,.65); }

.studio-foot{ align-items:center; }
.studio-links{ gap:6px; }
.studio-links .btn{ white-space:nowrap; }

/* the chosen face drives both the digital readout and the analog numerals —
   on the clock and on the timer, stopwatch and countdown stages alike */
.sc-digital .readout,
.studio .studio-clock .readout{
  font-family:var(--clock-font, var(--f-mono));
  font-weight:var(--clock-weight, 600);
  letter-spacing:var(--clock-ls, -.02em);
}
.f-num{ font-family:var(--dial-font, var(--clock-font, var(--f-display))); }

.setgrid-wide{ grid-column:1 / -1; }

.fontchip{
  display:grid; gap:.15rem; padding:.55rem .5rem;
  border:1px solid var(--line-2); border-radius:10px;
  background:var(--panel); cursor:pointer; text-align:center;
  transition:border-color .15s ease, background .15s ease, transform .12s ease;
}
.fontchip:hover{ border-color:var(--brand); transform:translateY(-1px); }
.fontchip[aria-pressed="true"]{
  border-color:var(--brand); background:var(--panel);
  border-color:var(--brand); background:var(--panel); background:color-mix(in srgb,var(--brand) 10%,var(--panel));
  box-shadow:0 0 0 3px var(--brand);
  box-shadow:0 0 0 3px color-mix(in srgb,var(--brand) 18%,transparent);
}
.fc-demo{ font-size:1.35rem; line-height:1.1; color:var(--ink); font-variant-numeric:tabular-nums; }
.fc-name{ font-size:.68rem; color:var(--rail); }
@media (max-width:760px){
  .studio-left{ justify-content:center; width:100%; }
  .studio-links{ justify-content:center; }
}

/* ---- settings panel, reorganised into labelled blocks ---- */
.setwrap{ display:grid; gap:1.1rem; }
.setblock{
  padding:.9rem 1rem 1rem; border:1px solid var(--line); border-radius:var(--radius);
  background:var(--panel);
}
.setblock-t{
  margin:0 0 .7rem; font-size:.72rem; font-weight:700; letter-spacing:.14em;
  text-transform:uppercase; color:var(--brand); font-family:var(--f-mono);
}
.setrows{ display:grid; gap:.7rem; }
.setrow{ display:grid; grid-template-columns:112px 1fr; gap:.8rem; align-items:center; }
.setrow-l{ font-size:.82rem; color:var(--rail); font-weight:600; }
@media (max-width:640px){
  .setrow{ grid-template-columns:1fr; gap:.35rem; }
}

.fontpick{ display:grid; grid-template-columns:1fr; gap:1rem; }
.fontgroup-t{
  margin:0 0 .4rem; font-size:.7rem; letter-spacing:.12em; text-transform:uppercase;
  color:var(--rail); font-family:var(--f-mono);
}
.fontrow{ display:grid; grid-template-columns:repeat(auto-fill,minmax(112px,1fr)); gap:8px; }

/* ---- alarm dialog ---- */
.alarmdlg{
  border:0; padding:0; max-width:min(560px, calc(100vw - 2rem)); width:100%;
  border-radius:var(--radius-lg); background:var(--panel); color:var(--ink);
  box-shadow:0 30px 80px -20px rgba(0,0,0,.55);
}
.alarmdlg::backdrop{ background:rgba(8,12,24,.6); -webkit-backdrop-filter:blur(3px); backdrop-filter:blur(3px); }
.alarmdlg-in{ display:flex; flex-direction:column; max-height:min(88vh, 780px); }
.alarmdlg-h{
  display:flex; align-items:flex-start; justify-content:space-between; gap:1rem;
  padding:1.1rem 1.3rem .8rem; border-bottom:1px solid var(--line);
}
.alarmdlg-h h2{ margin:.1rem 0 0; font-size:var(--step-2); }
.alarmdlg-b{ padding:1.1rem 1.3rem; overflow-y:auto; }
/* Cancel on the left, Set Alarm on the right, with the alarm count between. */
.alarmdlg-f{
  display:flex; align-items:center; gap:8px;
  padding:.9rem 1.3rem 1.1rem; border-top:1px solid var(--line);
  background:var(--panel-2);
  border-radius:0 0 var(--radius-lg) var(--radius-lg);
}
/* the count takes the space between, pushing the two buttons apart */
.alarmdlg-f .dlgcount{ flex:1 1 auto; text-align:center; }
.alarmdlg-f #dlgSave{ flex:0 0 auto; min-width:132px; justify-content:center; }
.alarmdlg-f #dlgCancel{ flex:0 0 auto; }
@media (max-width:520px){
  .alarmdlg-f .dlgcount{ display:none; }
  .alarmdlg-f{ justify-content:space-between; }
  .alarmdlg-f #dlgSave{ min-width:0; flex:1 1 auto; margin-left:8px; }
}

/* ---- alarm dialog sits near the top, not centred in the viewport ---- */
.alarmdlg{
  margin-top:clamp(1.2rem, 6vh, 5rem);
  margin-bottom:auto;
  margin-inline:auto;
}
.alarmdlg-in{ max-height:min(84vh, 760px); }

/* the clock faces are alarm triggers too */
.is-clickable{ cursor:pointer; }
.sc-analog.is-clickable svg{ transition:transform .18s ease, filter .18s ease; }
.sc-analog.is-clickable:hover svg{ transform:scale(1.02); }
.sc-digital .readout.is-clickable{
  transition:transform .18s ease, opacity .18s ease;
  transform-origin:center;
  border-radius:12px;
  /* The digits are gradient-clipped text, so scale the element itself
     rather than the font size — that keeps the gradient stable. */
  will-change:transform;
}
.sc-digital .readout.is-clickable:hover{ transform:scale(1.02); opacity:.92; }
.is-clickable:focus-visible{ outline:3px solid var(--brand); outline-offset:6px; border-radius:12px; }

/* ---- hero intro: quieter and smaller than a standard lede ---- */
.hero-intro{
  margin:.55rem auto 0;
  max-width:56ch;
  font-size:clamp(.92rem, 1.05vw, 1rem);
  line-height:1.6;
  color:var(--rail);
  font-weight:400;
}

/* ==================================================================
   Alarm dialog, list and ringing overlay
   ================================================================== */
.presets-tight{ gap:6px; }
.preset-xs{ font-size:.74rem; padding:.28rem .6rem; }

/* big time picker */
.tpick{
  display:flex; align-items:center; justify-content:center; gap:.4rem;
  padding:.9rem 0 .2rem;
}
.tpick-col{ display:flex; flex-direction:column; align-items:center; gap:.2rem; }
.tpick-step{
  border:0; background:transparent; color:var(--rail); cursor:pointer;
  font-size:.7rem; line-height:1; padding:.25rem .5rem; border-radius:6px;
}
.tpick-step:hover{ color:var(--brand); background:var(--brand); background:color-mix(in srgb,var(--brand) 10%,transparent); }
.tpick-in{
  width:2.4em; padding:.1rem .1rem; text-align:center;
  font-family:var(--f-mono); font-size:clamp(2.4rem,9vw,3.4rem); font-weight:700;
  font-variant-numeric:tabular-nums; line-height:1;
  border:0; border-bottom:2px solid transparent; background:transparent; color:var(--ink);
}
.tpick-in:focus{ outline:none; border-bottom-color:var(--brand); }
.tpick-sep{ font-family:var(--f-mono); font-size:clamp(2rem,7vw,2.8rem); color:var(--rail); padding-bottom:.15em; }
.tpick-mer{ display:flex; flex-direction:column; gap:4px; margin-left:.5rem; }
.tpick-am{
  border:1px solid var(--line-2); background:var(--panel); color:var(--ink-2);
  font-size:.74rem; font-weight:700; padding:.25rem .55rem; border-radius:7px; cursor:pointer;
}
.tpick-am[aria-pressed="true"]{ background:var(--grad-brand); border-color:transparent; color:#fff; }
.tpick-when{
  margin:.1rem 0 1rem; text-align:center; font-size:.85rem; color:var(--brand); font-weight:600;
  min-height:1.2em;
}

.daypick{ display:flex; gap:6px; margin-top:.6rem; flex-wrap:wrap; }
.daybtn{
  width:38px; height:38px; border-radius:50%; cursor:pointer;
  border:1px solid var(--line-2); background:var(--panel);
  font-weight:700; font-size:.82rem; color:var(--ink-2);
}
.daybtn[aria-pressed="true"]{ background:var(--grad-brand); border-color:transparent; color:#fff; }

.dlgmore{ margin-top:1rem; border:1px solid var(--line); border-radius:var(--radius); }
.dlgmore summary{
  cursor:pointer; padding:.65rem .85rem; font-weight:600; font-size:.9rem;
  list-style:none; color:var(--ink-2);
}
.dlgmore summary::-webkit-details-marker{ display:none; }
.dlgmore summary::after{ content:"\25BE"; float:right; transition:transform .2s ease; }
.dlgmore[open] summary::after{ transform:rotate(180deg); }
.dlgmore-in{ padding:0 .85rem .95rem; }
.tune-row{ display:flex; gap:6px; }
.tune-row .field{ flex:1; min-width:0; }
.range{ width:100%; accent-color:var(--brand); }
.dlgcount{ margin-right:auto; font-size:.8rem; color:var(--rail); }

/* alarm list */
.alarmlist-wrap{ margin-top:1.6rem; }
.alarmlist-bar{
  display:flex; align-items:center; justify-content:space-between; gap:1rem;
  flex-wrap:wrap; margin-bottom:1rem;
}
.alarmlist-next{ margin:.15rem 0 0; font-size:1rem; color:var(--ink); font-weight:600; }
.alarmlist{ display:grid; gap:10px; }
.alarmcard{
  display:flex; align-items:center; gap:1rem;
  padding:.9rem 1rem; border:1px solid var(--line); border-radius:var(--radius-lg);
  background:var(--panel); box-shadow:var(--glow-soft);
  transition:opacity .18s ease, border-color .18s ease;
}
.alarmcard.is-off{ opacity:.55; }
.alarmcard.is-snoozed{ border-color:var(--c-amber); }
.al-toggle{
  flex-shrink:0; width:50px; height:29px; border-radius:999px; cursor:pointer;
  border:0; background:var(--line-2); position:relative; transition:background .18s ease;
}
.al-toggle[aria-checked="true"]{ background:var(--grad-go); }
.al-toggle span{
  position:absolute; top:3px; left:3px; width:23px; height:23px; border-radius:50%;
  background:#fff; box-shadow:0 1px 4px rgba(0,0,0,.3); transition:transform .18s ease;
}
.al-toggle[aria-checked="true"] span{ transform:translateX(21px); }
.al-main{ flex:1; min-width:0; }
.al-time{ margin:0; font-size:1.6rem; font-weight:700; font-variant-numeric:tabular-nums; line-height:1.1; }
.al-meta{ margin:.15rem 0 0; font-size:.82rem; color:var(--ink-2); display:flex; gap:.5rem; flex-wrap:wrap; align-items:center; }
.al-days{ display:inline-flex; gap:3px; }
.al-days i{
  font-style:normal; width:17px; height:17px; border-radius:50%;
  display:grid; place-items:center; font-size:.6rem; font-weight:700;
  background:var(--panel-3); color:var(--rail);
}
.al-days i.on{ background:var(--brand); color:#fff; }
.al-next{ margin:.2rem 0 0; font-size:.78rem; color:var(--rail); }
.al-acts{ display:flex; gap:5px; flex-shrink:0; }
.alarmempty{
  padding:2rem 1rem; text-align:center; border:1px dashed var(--line-2);
  border-radius:var(--radius-lg); color:var(--ink-2);
}
.alarmempty p{ margin:0 0 .4rem; }
.alarmempty .btn{ margin-top:.8rem; }
@media (max-width:560px){
  .alarmcard{ gap:.7rem; padding:.8rem; }
  .al-time{ font-size:1.35rem; }
}

/* ringing overlay */
.ocring{
  position:fixed; inset:0; z-index:300; display:grid; place-items:center;
  background:rgba(8,12,24,.82); -webkit-backdrop-filter:blur(6px); backdrop-filter:blur(6px);
  animation:toastIn .2s ease;
}
.ocring[hidden]{ display:none !important; }
.ocring-box{
  text-align:center; padding:2.2rem 2rem; border-radius:var(--radius-lg);
  background:var(--panel); box-shadow:0 30px 90px -20px rgba(0,0,0,.7);
  width:min(440px, calc(100vw - 2rem));
  /* Pulse the glow rather than the box. Scaling the whole panel makes the
     Stop and Snooze buttons drift under the cursor, which is exactly the
     wrong thing to do to someone half awake reaching for them. */
  animation:ringGlow 1.8s ease-in-out infinite;
}
@keyframes ringGlow{
  0%,100%{ box-shadow:0 30px 90px -20px rgba(0,0,0,.7), 0 0 0 0 rgba(244,63,94,.45); }
  50%    { box-shadow:0 30px 90px -20px rgba(0,0,0,.7), 0 0 0 16px rgba(244,63,94,0); }
}
@media (prefers-reduced-motion: reduce){ .ocring-box{ animation:none; } }
.ocring-eyebrow{
  margin:0; font-family:var(--f-mono); font-size:.72rem; letter-spacing:.18em;
  text-transform:uppercase; color:var(--c-rose);
}
.ocring-time{ margin:.4rem 0 .2rem; font-size:clamp(2.6rem,11vw,4rem); font-weight:700; }
.ocring-label{ margin:0 0 1.4rem; font-size:1rem; color:var(--ink-2); }
.ocring-acts{ display:flex; gap:10px; justify-content:center; }
.ocring-hint{ margin:1rem 0 0; font-size:.76rem; color:var(--rail); }
body.is-ringing{ overflow:hidden; }

/* ---- scroll-wheel time picker ---- */
.wheel{
  --wheel-item:46px;
  position:relative;
  display:flex; align-items:center; justify-content:center; gap:.35rem;
  padding:.6rem 0 .3rem;
  user-select:none;
}
.wheel-band{
  position:absolute; left:50%; top:50%; transform:translate(-50%,-50%);
  width:min(300px, 92%); height:var(--wheel-item);
  border-radius:12px;
  background:var(--brand);
  background:color-mix(in srgb, var(--brand) 12%, transparent);
  border-top:1px solid var(--line-2); border-bottom:1px solid var(--line-2);
  pointer-events:none; z-index:0;
}
.wheel-col{
  position:relative; z-index:1;
  height:calc(var(--wheel-item) * 5);
  overflow-y:auto; overflow-x:hidden;
  scroll-snap-type:y mandatory;
  scrollbar-width:none; -ms-overflow-style:none;
  -webkit-mask-image:linear-gradient(180deg,transparent,#000 26%,#000 74%,transparent);
          mask-image:linear-gradient(180deg,transparent,#000 26%,#000 74%,transparent);
  text-align:center; outline:none;
  scroll-behavior:auto;
}
.wheel-col::-webkit-scrollbar{ display:none; }
.wheel-col:focus-visible{ box-shadow:0 0 0 3px var(--brand); box-shadow:0 0 0 3px color-mix(in srgb,var(--brand) 30%,transparent); border-radius:10px; }
.wheel-pad{ height:calc(var(--wheel-item) * 2); }
.wheel-item{
  height:var(--wheel-item); line-height:var(--wheel-item);
  scroll-snap-align:center; scroll-snap-stop:always;
  font-family:var(--f-mono); font-size:2rem; font-weight:700;
  font-variant-numeric:tabular-nums; color:var(--ink);
  transition:opacity .12s linear, transform .12s linear, color .12s linear;
  cursor:grab;
}
.wheel-item.is-sel{ color:var(--brand); }
.wheel-col{ width:3.1em; }
.wheel-col-mer{ width:3.4em; }
.wheel-col-mer .wheel-item{ font-size:1.15rem; letter-spacing:.06em; }
.wheel-sep{
  z-index:1; font-family:var(--f-mono); font-size:1.9rem; font-weight:700;
  color:var(--rail); padding-bottom:.1em;
}
@media (max-width:480px){
  .wheel{ --wheel-item:42px; }
  .wheel-item{ font-size:1.7rem; }
}

/* ---- wheel affordances ---- */
.wheel-unit{ display:flex; flex-direction:column; align-items:center; gap:2px; }
.wheel-nudge{
  border:1px solid var(--line-2); background:var(--panel); color:var(--rail);
  width:38px; height:22px; border-radius:7px; cursor:pointer; line-height:1;
  font-size:.7rem; display:grid; place-items:center; z-index:2;
  transition:all .14s ease;
}
.wheel-nudge:hover{ border-color:var(--brand); color:var(--brand); background:var(--brand); background:color-mix(in srgb,var(--brand) 10%,transparent); }
.wheel-nudge:active{ transform:scale(.94); }
.wheel-cap{
  font-family:var(--f-mono); font-size:.62rem; letter-spacing:.1em;
  text-transform:uppercase; color:var(--rail); margin-top:.2rem;
}
.wheel-hint{
  margin:.1rem 0 .2rem; text-align:center; font-size:.76rem; color:var(--rail);
}
.wheel-band{ top:calc(50% - .6rem); }

/* one-time nudge so the column visibly moves on a first visit */
.wheel-col.is-hinting{ animation:wheelHint 1.4s ease-in-out; }
@keyframes wheelHint{
  0%,100%{ transform:translateY(0) }
  25%    { transform:translateY(-9px) }
  60%    { transform:translateY(6px) }
}
@media (prefers-reduced-motion: reduce){ .wheel-col.is-hinting{ animation:none } }

#dlgPresets .preset{ font-size:.78rem; }
#dlgTest{ position:relative; }

/* Keep the dialog compact enough that the presets and wheel are both
   visible without scrolling on a laptop screen. */
.alarmdlg-b{ scroll-behavior:auto; }
.alarmdlg .wheel{ --wheel-item:42px; padding:.35rem 0 .1rem; }
.alarmdlg .wheel-item{ font-size:1.75rem; }
.alarmdlg .wheel-col-mer .wheel-item{ font-size:1rem; }
.alarmdlg .field-group{ margin-top:.8rem; }
.alarmdlg .label{ margin-bottom:.3rem; }

/* The base sheet sets svg{display:block}, which beats the [hidden]
   attribute, so both preview icons were showing at once. */
/* The base sheet sets svg{display:block}, which beats the [hidden] attribute.
   Scoped to any icon button, not just the dialog's, so a second preview
   control cannot show both icons at once. */
.sicon svg[hidden], button svg[hidden]{ display:none !important; }

/* ==================================================================
   Time dial with an editable centre row.
   Five rows are visible so the column obviously continues past the
   selection, and the middle one is a text input, so the same control
   can be scrolled, nudged or typed into.
   ================================================================== */
.alarmdlg .wheel{ --wheel-item:44px; padding:.5rem 0 .2rem; }
.alarmdlg .wheel-item{ font-size:1.6rem; }

.wheel-frame{ position:relative; }
.wheel-edit{
  position:absolute; left:0; right:0;
  top:calc(var(--wheel-item) * 2);
  height:var(--wheel-item);
  width:100%; padding:0; margin:0;
  border:0; background:transparent; text-align:center;
  font-family:var(--f-mono); font-size:1.6rem; font-weight:700;
  font-variant-numeric:tabular-nums; line-height:var(--wheel-item);
  color:var(--brand); cursor:text; z-index:3;
  border-radius:10px;
}
.wheel-edit:focus{
  outline:none;
  background:var(--panel);
  box-shadow:0 0 0 2px var(--brand);
}
/* The input is the visible centre value, so the item beneath it is hidden
   rather than showing the same number twice, slightly offset. */
/* Only columns with a typing overlay hide their selected row — the input
   is the visible value there. Plain wheels must still show theirs. */
.wheel-frame.has-edit .wheel-item.is-sel{ visibility:hidden; }
.wheel-frame.is-editing ~ .wheel-nudge{ border-color:var(--brand); color:var(--brand); }

.wheel-unit-mer{ touch-action:none;  justify-content:center; gap:6px; }
.wheel-unit-mer .wheel-nudge{
  width:46px; height:32px; font-size:.78rem; font-weight:700;
  font-family:var(--f-mono);
}
.wheel-unit-mer .wheel-nudge[aria-pressed="true"]{
  background:var(--grad-brand); border-color:transparent; color:#fff;
}
.wheel-mer-gap{ height:4px; }

.alarmdlg .wheel-band{
  top:calc(50% - .6rem);
  height:var(--wheel-item);
}
/* Line the AM/PM pair up with the selection band, and sit every caption on
   the same baseline as HOUR and MINUTE. */
.alarmdlg .wheel{ align-items:stretch; }
.wheel-unit{ justify-content:flex-start; }
/* Centre the pair on the selection band: two rows of nudge height sit
   above the band, so push the buttons down by that much. */
.wheel-unit-mer{ touch-action:none; 
  justify-content:flex-start;
  padding-top:calc(var(--wheel-item) * 2 + 22px - 17px);
}
.wheel-unit-mer .wheel-cap{ margin-top:auto; }
.wheel-cap{ margin-top:.25rem; }
.alarmdlg .wheel-sep{ align-self:center; margin-bottom:1.6rem; }

/* The selection band should sit behind the hour and minute columns only —
   it was running underneath the AM/PM buttons and tinting them. */
.alarmdlg .wheel-band{
  left:auto; right:auto; transform:none;
  width:auto; inset-inline:0;
}
.alarmdlg .wheel{ position:relative; }
.alarmdlg .wheel-band{
  position:absolute;
  top:calc(50% - .6rem); transform:translateY(-50%);
  left:0; width:var(--band-w, 100%);
}

/* Scrolling the dial must not chain into the dialog body, and scrolling the
   dialog must not drag the dial. Each keeps its own gesture. */
.wheel-col{ overscroll-behavior:contain; touch-action:pan-y; }
.wheel-edit{ overscroll-behavior:contain; touch-action:pan-y; }
.alarmdlg-b{ overscroll-behavior:contain; }
/* Give the band room to wrap the minute column before the AM/PM buttons. */
.wheel-unit-mer{ touch-action:none;  margin-left:1.1rem; }

/* ==================================================================
   Compact alarm dialog
   ================================================================== */
.alarmdlg{ max-width:min(400px, calc(100vw - 2rem)); }
.alarmdlg-h{ padding:.9rem 1.1rem .7rem; align-items:center; }
.alarmdlg-h h2{ margin:0; font-size:1.15rem; }
.alarmdlg-b{ padding:.9rem 1.1rem 1rem; }
/* Cancel on the left, Set Alarm on the right, with the alarm count between. */
.alarmdlg-f{ padding:.75rem 1.1rem .9rem; }

.fmtrow{ display:flex; justify-content:flex-end; }
.fmtswap{ display:flex; gap:3px; }
.fmtbtn{
  border:1px solid var(--line-2); background:var(--panel); color:var(--rail);
  font-family:var(--f-mono); font-size:.68rem; font-weight:700;
  padding:.2rem .5rem; border-radius:999px; cursor:pointer;
}
.fmtbtn[aria-pressed="true"]{ background:var(--grad-brand); border-color:transparent; color:#fff; }

/* three rows, not five */
.alarmdlg .wheel{ --wheel-item:40px; padding:.3rem 0 .1rem; gap:.3rem; }
.alarmdlg .wheel-item{ font-size:1.5rem; }
.alarmdlg .wheel-edit{ font-size:1.5rem; }
.alarmdlg .wheel-band{ top:50%; }
.alarmdlg .wheel-sep{ font-size:1.4rem; margin-bottom:0; align-self:center; }

.wheel-unit-mer{ touch-action:none;  flex-direction:column; gap:4px; margin-left:.8rem; justify-content:center; padding-top:0; }
.merbtn{
  border:1px solid var(--line-2); background:var(--panel); color:var(--ink-2);
  font-family:var(--f-mono); font-size:.7rem; font-weight:700;
  width:42px; padding:.22rem 0; border-radius:7px; cursor:pointer;
}
.merbtn[aria-pressed="true"]{ background:var(--grad-brand); border-color:transparent; color:#fff; }

.alarmdlg .tpick-when{ margin:.35rem 0 .8rem; font-size:.8rem; }

.drow{ margin-bottom:.75rem; }
.drow .label{ margin-bottom:.25rem; }
.drow-switch{ display:flex; align-items:center; justify-content:space-between; }
.drow-switch .label{ margin:0; }

.clearfield{ position:relative; }
.clearfield .field{ padding-right:2.1rem; }
.clearbtn{
  position:absolute; right:.45rem; top:50%; transform:translateY(-50%);
  width:22px; height:22px; border-radius:50%; cursor:pointer;
  border:0; background:var(--panel-3); color:var(--rail);
  display:grid; place-items:center;
}
.clearbtn:hover{ background:var(--c-rose); color:#fff; }

.snoozewrap{ margin:-.2rem 0 .8rem; }
.wheel-mini{ --wheel-item:34px; padding:0; }
.wheel-mini .wheel-col{ height:calc(var(--wheel-item) * 3); width:auto; }
.wheel-mini .wheel-pad{ height:var(--wheel-item); }
.wheel-mini .wheel-item{
  font-family:var(--f-body); font-size:.92rem; font-weight:600;
  line-height:var(--wheel-item); height:var(--wheel-item);
}
.wheel-mini .wheel-band{ left:0 !important; width:100% !important; height:var(--wheel-item); }
.wheel-mini .wheel-unit{ width:100%; }
.wheel-mini .wheel-frame{ width:100%; }

.alarmdlg .status{ margin-top:.2rem; font-size:.8rem; }
.alarmdlg .status[hidden]{ display:none !important; }

/* ---- compact dialog: centred title, 5-row dial, boxed snooze, confirmation ---- */
.alarmdlg-h{ position:relative; justify-content:center; text-align:center; }
.alarmdlg-h h2{ margin:0; }
.dlg-x{ position:absolute; right:1.1rem; top:50%; transform:translateY(-50%); }

/* Five rows: the extra pair top and bottom fills the space and makes the
   column read as something that continues past the selection. */

.snoozebox{
  border:1px solid var(--line-2); border-radius:var(--radius-sm);
  background:var(--panel-2); overflow:hidden;
}
.snoozebox .wheel-mini{ --wheel-item:32px; }
.snoozebox .wheel-mini .wheel-col{ height:calc(var(--wheel-item) * 3); }
.snoozebox .wheel-mini .wheel-band{
  background:var(--brand);
  background:color-mix(in srgb, var(--brand) 14%, transparent);
  border-radius:0;
}

.savedbox{
  margin-top:.9rem; padding:.8rem .9rem;
  border:1px solid var(--line-2); border-radius:var(--radius);
  background:var(--panel-2);
}
.savedbox-perm{ margin:0 0 .5rem; font-size:.8rem; line-height:1.45; }
.savedbox-perm.is-ok{ color:var(--go); }
.savedbox-perm.is-warn{ color:var(--c-amber); }
.savedbox-perm.is-stop{ color:var(--c-rose); font-weight:600; }
.savedbox-alarm{
  margin:0; padding-top:.5rem; border-top:1px solid var(--line);
  font-size:.9rem; color:var(--ink);
}
.savedbox-in{ font-size:.78rem; color:var(--rail); }
.alarmdlg .status[hidden], .savedbox[hidden]{ display:none !important; }
.alarmdlg-f .btn[hidden]{ display:none !important; }
.ocring-acts .btn[hidden]{ display:none !important; }

/* ---- dialog: header controls, two columns on desktop ---- */
.alarmdlg-h{
  display:grid; grid-template-columns:34px 1fr 34px; align-items:center; gap:.6rem;
}
.alarmdlg-h h2{ text-align:center; }
.dlg-x, .dlg-ok{ position:static; transform:none; }
.dlg-ok{ border-color:var(--go); color:var(--go); }
.dlg-ok:hover{ background:var(--go); background:color-mix(in srgb, var(--go) 14%, transparent); border-color:var(--go); color:var(--go); }
.dlg-ok.is-done{ background:var(--grad-go); border-color:transparent; color:#fff; }

.fmtrow{ justify-content:flex-start; }

.btn-block{ width:100%; justify-content:center; }
.dlg-fasthint{ text-align:center; margin:.45rem 0 0; font-size:.72rem; }

.snoozeopts{ display:flex; flex-wrap:wrap; gap:5px; }
.snoozeopts .preset{ font-size:.75rem; padding:.28rem .55rem; }

.dlgcols{ display:grid; grid-template-columns:1fr; gap:1rem; }
@media (min-width:680px){
  .alarmdlg{ max-width:min(720px, calc(100vw - 2rem)); }
  .dlgcols{ grid-template-columns:1fr 1fr; gap:1.6rem; align-items:start; }
  .dlgcol-time{
    padding-right:1.4rem; border-right:1px solid var(--line);
    display:flex; flex-direction:column; justify-content:center;
  }
  .alarmdlg .wheel{ --wheel-item:46px; }
  .alarmdlg .wheel-item{ font-size:1.7rem; }
  .alarmdlg .wheel-edit{ font-size:1.7rem; }
  .dlgcol-opts .drow:first-child{ margin-top:0; }
}

/* ---- notification recovery instructions ---- */
.permfix{
  margin:.7rem 0; padding:.7rem .8rem;
  border:1px solid var(--line-2);
  border:1px solid color-mix(in srgb, var(--c-rose) 45%, var(--line-2));
  border-radius:var(--radius-sm);
  background:var(--c-rose);
  background:color-mix(in srgb, var(--c-rose) 8%, transparent);
}
.permfix[hidden]{ display:none !important; }
.permfix-t{ margin:0 0 .4rem; font-size:.78rem; font-weight:700; color:var(--ink); }
.permfix-steps{ margin:0 0 .6rem; padding-left:1.1rem; font-size:.78rem; line-height:1.6; color:var(--ink-2); }
.permfix-steps li{ margin:0; }
.savedbox-tip{ margin:.5rem 0 0; font-size:.76rem; color:var(--rail); line-height:1.5; }
.savedbox-tip[hidden]{ display:none !important; }

/* ---- alarms under the clock ---- */
.studio-alarms{
  margin-top:1rem; padding:1rem 1.1rem 1.1rem;
  border:1px solid var(--line); border-radius:var(--radius-lg);
  background:var(--panel);
}
.studio-alarms[hidden]{ display:none !important; }
.studio-alarms-h{ margin-bottom:.8rem; }
.studio-alarms-next{ margin:.15rem 0 0; font-size:.95rem; font-weight:600; color:var(--ink); }

/* ---- inline alarm form ---- */
.alarmform{
  margin-top:1.4rem; padding:1.1rem 1.2rem 1.2rem;
  border:1px solid var(--line-2); border-radius:var(--radius-lg);
  background:linear-gradient(180deg,var(--panel),var(--panel));
  background:linear-gradient(180deg,var(--panel),color-mix(in srgb,var(--brand) 4%,var(--panel)));
  box-shadow:var(--glow-soft);
}
.alarmform-grid{
  display:grid; grid-template-columns:1fr; gap:.9rem;
}
@media (min-width:620px){
  .alarmform-grid{ grid-template-columns:repeat(3,1fr); }
}
@media (min-width:980px){
  .alarmform-grid{ grid-template-columns:repeat(6,1fr); align-items:end; }
}
.alarmform .field-group{ margin:0; }
.alarmform-go .btn{ width:100%; }
.alarmform .hint{ margin:.7rem 0 0; }
.alarmform .status[hidden]{ display:none !important; }
.alarmform .status{ margin-top:.7rem; }

/* ---- site-wide search dropdown ----
   Names only, laid out in columns, so the panel stays short enough to read
   at a glance instead of scrolling as one long list. */
.navsearch-list{
  width:min(640px, 94vw); padding:.6rem;
  max-height:min(66vh, 460px);
}
.ns-grid{
  display:grid; grid-template-columns:repeat(2, minmax(0,1fr)); gap:.4rem 1rem;
  align-items:start;
}
@media (min-width:1280px){
  .navsearch-list{ width:min(760px, 94vw); }
  .ns-grid{ grid-template-columns:repeat(3, minmax(0,1fr)); }
}
@media (max-width:640px){
  .navsearch-list{ width:auto; }
  .ns-grid{ grid-template-columns:1fr; }
}
.ns-group{ min-width:0; margin-bottom:.5rem; }
.ns-head{
  display:flex; align-items:center; gap:.35rem;
  margin:0 0 .2rem; padding:.25rem .5rem;
  font-family:var(--f-mono); font-size:.62rem; letter-spacing:.13em;
  text-transform:uppercase; color:var(--rail);
  border-bottom:1px solid var(--line);
}
.ns-head span{ font-size:.85rem; }
.ns-item{
  display:flex; align-items:center; justify-content:space-between; gap:.6rem;
  padding:.32rem .5rem; border-radius:var(--radius-sm);
  text-decoration:none; min-width:0;
}
.ns-item.is-active, .ns-item:hover{ background:var(--brand); background:color-mix(in srgb,var(--brand) 13%,transparent); }
.ns-name{
  font-weight:600; font-size:.84rem; color:var(--ink);
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis; min-width:0;
}
.ns-time{ font-size:.74rem; font-weight:600; color:var(--brand); flex-shrink:0; }
.ns-empty, .ns-tip{ margin:0; padding:.5rem .6rem; font-size:.74rem; color:var(--rail); }
.ns-tip{ border-top:1px solid var(--line); margin-top:.35rem; }
/* skipped alarms read differently from off ones */
.alarmcard.is-skipped{ border-color:var(--c-cyan); }
.alarmcard.is-skipped .al-next{ color:var(--c-cyan); }
/* Five actions need room; below 560px they wrap into a compact block. */
.al-acts{ flex-wrap:wrap; justify-content:flex-end; max-width:none; gap:4px; }
.al-acts .sicon{ width:30px; height:30px; }
@media (max-width:560px){
  .al-acts{ max-width:100px; }
  .al-acts .sicon{ width:28px; height:28px; }
}
#alBulkStatus[hidden]{ display:none !important; }
.panel-link{ text-decoration:none; display:block; transition:border-color .16s ease, transform .16s ease; }
.panel-link:hover{ border-color:var(--brand); transform:translateY(-2px); }

/* ---- place search: suggestions as cards, results fully clickable ---- */
.locsuggest{
  display:grid; grid-template-columns:repeat(auto-fill,minmax(210px,1fr));
  gap:8px; padding:.55rem;
}
.locsuggest li.lsug{
  display:grid; grid-template-columns:1fr auto; gap:.1rem .6rem;
  padding:.6rem .7rem; border:1px solid var(--line);
  border-radius:var(--radius); background:var(--panel); cursor:pointer;
  transition:border-color .15s ease, transform .12s ease, box-shadow .15s ease;
}
.locsuggest li.lsug:hover, .locsuggest li.lsug.is-active{
  border-color:var(--brand); transform:translateY(-1px); box-shadow:var(--glow-soft);
  background:var(--panel);
}
.lsug-name{ font-weight:700; font-size:.92rem; color:var(--ink); }
.lsug-sub{ grid-column:1; font-size:.74rem; color:var(--rail); }
.lsug-time{
  grid-row:1 / span 2; align-self:center;
  font-size:.86rem; font-weight:600; color:var(--brand);
}
@media (max-width:520px){
  .locsuggest{ grid-template-columns:1fr; }
}

/* the whole result card is the link */
.loccard.is-linked{ cursor:pointer; }
.loccard.is-linked:hover{
  border-color:var(--brand); transform:translateY(-3px);
  box-shadow:var(--glow-lift);
}
.loccard.is-linked:focus-visible{ outline:3px solid var(--brand); outline-offset:3px; }
.loccard{ transition:border-color .18s ease, transform .18s ease, box-shadow .18s ease; }
.loccard .card-go{
  display:inline-block; margin-top:.8rem; font-size:.82rem;
  font-weight:600; color:var(--brand);
}
.loccard.is-linked:hover .card-go{ text-decoration:underline; }
/* small add-to-compare control on a suggestion row */
.lsug{ position:relative; }
.lsug-add{
  position:absolute; right:6px; bottom:6px;
  width:22px; height:22px; border-radius:50%; cursor:pointer;
  border:1px solid var(--line-2); background:var(--panel-2); color:var(--rail);
  font-size:.9rem; line-height:1; display:grid; place-items:center; padding:0;
  opacity:0; transition:opacity .14s ease, background .14s ease, color .14s ease;
}
.lsug:hover .lsug-add, .lsug.is-active .lsug-add, .lsug-add:focus-visible{ opacity:1; }
.lsug-add:hover{ background:var(--brand); border-color:transparent; color:#fff; }
/* Full screen is for reading the clock across a room, so the controls that
   belong to the page go away — the Set Alarm button included. */
.studio.is-fs .sc-cta{ display:none; }

/* ---- mobile: one column, with Set Alarm sitting between Repeat and Ringtone.
   Flattening the two columns with display:contents lets every field become a
   direct child of the dialog body, so the order can be set field by field
   rather than being fixed by which column the markup put it in. ---- */
@media (max-width:679px){
  .alarmdlg-b{ display:flex; flex-direction:column; }
  .dlgcols, .dlgcol{ display:contents; }

  .fmtrow{ order:1; }
  #dlgWheel{ order:2; }
  .dialwrap{ order:2; }
  #dlgWhen{ order:3; }
  .drow[data-row="label"]{ order:4; }
  .dlg-more{ order:5; }
  .drow[data-row="repeat"]{ order:6; }
  .drow[data-row="tune"]{ order:7; }
  .drow[data-row="vol"]{ order:8; }
  .drow[data-row="snooze"]{ order:9; }
  .snoozewrap{ order:10; }
  #dlgStatus{ order:11; }
  #dlgSaved{ order:12; }
}

/* ---- search: horizontal quick-access strip ---- */
.ns-quick{
  display:flex; gap:6px; overflow-x:auto; overflow-y:hidden;
  padding:.15rem .1rem .6rem; margin-bottom:.5rem;
  border-bottom:1px solid var(--line);
  scrollbar-width:none; -ms-overflow-style:none;
  overscroll-behavior-x:contain;
  -webkit-overflow-scrolling:touch;
}
.ns-quick::-webkit-scrollbar{ display:none; }
.ns-qchip{
  flex:0 0 auto; display:inline-flex; align-items:center; gap:.35rem;
  padding:.4rem .7rem; border-radius:999px; white-space:nowrap;
  border:1px solid var(--line-2); background:var(--panel-2);
  font-size:.8rem; font-weight:600; color:var(--ink); text-decoration:none;
  transition:border-color .14s ease, background .14s ease, transform .12s ease;
}
.ns-qchip span{ font-size:.9rem; line-height:1; }
.ns-qchip:hover, .ns-qchip:focus-visible{
  border-color:var(--brand); background:var(--brand);
  border-color:var(--brand); background:var(--brand); background:color-mix(in srgb,var(--brand) 12%,transparent);
  transform:translateY(-1px);
}

/* "add another alarm" under the list */
.addmore{
  display:flex; align-items:center; justify-content:center;
  width:100%; margin-top:10px; padding:.55rem 1rem;
  border:1px dashed var(--line-2); border-radius:var(--radius-lg);
  background:transparent; color:var(--ink-2); cursor:pointer;
  transition:border-color .16s ease, color .16s ease, background .16s ease;
}
/* The plus alone carries the meaning here; the accessible name is on the
   button, so screen readers still get the full description. */
.addmore span{ font-size:1.5rem; line-height:1; font-weight:800; }
.addmore:hover{
  border-color:var(--brand); color:var(--brand);
  background:var(--brand);
  background:color-mix(in srgb,var(--brand) 7%,transparent);
}

/* ================= clock-face time picker ================= */
.fmtrow{ display:flex; align-items:center; justify-content:space-between; gap:.5rem; }
.dialbtn{
  display:grid; place-items:center; width:30px; height:26px;
  border:1px solid var(--line-2); border-radius:8px;
  background:var(--panel); color:var(--rail); cursor:pointer;
  transition:all .14s ease;
}
.dialbtn:hover{ border-color:var(--brand); color:var(--brand); }
.dialbtn[aria-pressed="true"]{ background:var(--grad-brand); border-color:transparent; color:#fff; }

.dialwrap[hidden]{ display:none !important; }
/* .wheel is display:flex, which beats the hidden attribute on its own. */
#dlgWheel[hidden]{ display:none !important; }
.dialwrap{ display:flex; flex-direction:column; align-items:center; padding-top:.4rem; }

.dial-readout{ display:flex; align-items:center; gap:.3rem; margin-bottom:.6rem; }
.dial-seg{
  font-family:var(--f-mono); font-size:1.7rem; font-weight:700;
  padding:.1rem .45rem; border-radius:8px; cursor:pointer;
  border:1px solid transparent; background:transparent; color:var(--ink-2);
}
.dial-seg[aria-pressed="true"]{
  background:var(--brand);
  background:color-mix(in srgb,var(--brand) 14%,transparent);
  border-color:var(--brand); color:var(--brand);
  border-color:var(--brand); border-color:color-mix(in srgb,var(--brand) 40%,transparent); color:var(--brand);
}
.dial-colon{ font-family:var(--f-mono); font-size:1.5rem; color:var(--rail); }
.dial-mer{ display:flex; flex-direction:column; gap:3px; margin-left:.4rem; }

.dial{
  position:relative; width:min(260px, 78vw); aspect-ratio:1;
  touch-action:none; cursor:pointer; user-select:none;
  color:var(--ink);                 /* the face borrows currentColor, as the studio clock does */
}
.dial.is-dragging{ cursor:grabbing; }
.dial-svg{ display:block; width:100%; height:auto; overflow:visible; }

/* .f-dial, .f-tick, .f-num, .f-cap and .f-hand come from the studio clock,
   so the two faces stay identical without a second set of rules. */
.dial .f-num{
  font-size:30px; pointer-events:none;
  /* Falls back to the display face on pages with no clock studio. */
  font-family:var(--dial-font, var(--clock-font, var(--f-display)));
}
.dial .f-num.is-inner{ font-size:23px; opacity:.6; }
.dial .f-num.is-on{ fill:#fff; }
.dial .f-min{ stroke:var(--brand); stroke-width:9; }
.dial .f-cap{ fill:var(--brand); }
.dial-knob{
  fill:var(--brand);
  fill:color-mix(in srgb,var(--brand) 26%,transparent);
  stroke:var(--brand); stroke-width:3;
}
.dial-hint{ margin:.6rem 0 0; font-size:.76rem; color:var(--rail); text-align:center; }

/* ---- "where to click" illustrations in the notification panel ---- */
.permshots{ display:grid; gap:.7rem; margin:.2rem 0 .8rem; }
.permshots figure{ margin:0; }
.permshots img{
  display:block; width:100%; height:auto;
  border:1px solid var(--line-2); border-radius:8px; background:#f1f3f4;
}
.permshots figcaption{
  margin-top:.28rem; font-size:.72rem; color:var(--rail); line-height:1.4;
}
@media (min-width:680px){
  .permshots{ grid-template-columns:1fr 1fr; gap:.8rem; }
}

/* ================= settings: a row, then one line of choices ================= */
.setpanel{ padding:.7rem .9rem .8rem; }

.setbar{ display:flex; gap:8px; flex-wrap:wrap; }
.setchip{
  display:grid; grid-template-columns:auto 1fr; align-items:center;
  gap:.05rem .5rem; text-align:left;
  padding:.45rem .7rem; border:1px solid var(--line-2); border-radius:var(--radius);
  background:var(--panel); cursor:pointer; min-width:126px;
  transition:border-color .15s ease, background .15s ease, transform .12s ease;
}
.setchip:hover{ border-color:var(--brand); transform:translateY(-1px); }
.setchip[aria-selected="true"]{
  border-color:var(--brand);
  background:var(--panel);
  background:color-mix(in srgb,var(--brand) 10%,var(--panel));
}
.setchip-i{
  grid-row:1 / span 2; color:var(--brand); line-height:0;
  display:grid; place-items:center;
}
.setchip-i svg{ display:block; }
.setchip-dot{
  width:15px; height:15px; border-radius:50%; background:var(--brand);
  box-shadow:0 0 0 1px var(--line-2);
}
.setchip-t{ font-size:.8rem; font-weight:700; color:var(--ink); }
.setchip-v{
  grid-column:2; font-size:.68rem; color:var(--rail);
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis; max-width:170px;
}

/* the single line of choices */
.setline{
  display:flex; align-items:flex-start; gap:.6rem;
  margin-top:.7rem; padding-top:.7rem; border-top:1px solid var(--line);
}
.setline[hidden]{ display:none !important; }
.setline-track{
  flex:1; min-width:0;
  overflow-x:auto; overflow-y:hidden;
  scroll-behavior:smooth;
  overscroll-behavior-x:contain;   /* a swipe here must not scroll the page */
  -webkit-overflow-scrolling:touch;
  scrollbar-width:none; -ms-overflow-style:none;
  padding-bottom:2px;
}
.setline-track::-webkit-scrollbar{ display:none; }
.setgroup{ display:flex; align-items:center; gap:6px; flex-wrap:nowrap; }
.setgroup[hidden]{ display:none !important; }
.setgroup .fontpick,
.setgroup .swatches{
  display:flex; gap:6px; flex-wrap:nowrap; align-items:center;
  grid-template-columns:none;
}
.setgroup .fontgroup-t{
  flex:0 0 auto; margin:0 .15rem 0 .35rem;
  font-family:var(--f-mono); font-size:.6rem; letter-spacing:.12em;
  text-transform:uppercase; color:var(--rail);
}
.setgroup .fontchip{ flex:0 0 auto; min-width:96px; }

.setmore{
  flex:0 0 auto; align-self:center;
  display:grid; place-items:center; width:32px; height:32px; padding:0;
  border:1px solid var(--line-2); background:var(--panel);
  color:var(--brand); border-radius:50%; cursor:pointer;
  transition:border-color .15s ease, background .15s ease;
}
/* A plain arrow character rather than a drawn icon, so it reads as
   "there is more this way" at any size. */
.setmore span{
  font-size:1.15rem; line-height:1; font-weight:700;
  display:block; transition:transform .18s ease;
}
.setmore.is-back span{ transform:rotate(180deg); }
.setmore:hover{ border-color:var(--brand); background:var(--brand); background:color-mix(in srgb,var(--brand) 10%,transparent); }
.setmore[hidden]{ display:none !important; }

@media (max-width:560px){
  .setchip{ flex:1 1 46%; min-width:0; }
  .setchip-v{ max-width:120px; }
}
/* backgrounds inside the settings line: chips in a row, not a grid */
.setgroup-bg .bgpick{
  display:flex; gap:6px; flex-wrap:nowrap; grid-template-columns:none;
}
.setgroup-bg .bgchip{ flex:0 0 auto; width:104px; height:62px; }
/* extra analog dial features */
.f-num-24{ font-size:22px; opacity:.85; }
.f-datebox{ fill:var(--panel-2); stroke:var(--line-2); stroke-width:2; }
.f-date{
  fill:var(--ink); font-family:var(--dial-font, var(--clock-font, var(--f-display)));
  font-weight:700; font-size:24px;
}

/* ================= clock face designs ================= */
.facepick{ display:flex; gap:8px; flex-wrap:nowrap; align-items:center; }
.facechip{
  flex:0 0 auto; display:grid; gap:.2rem; justify-items:center;
  width:92px; padding:.4rem .3rem .45rem;
  border:1px solid var(--line-2); border-radius:10px;
  background:var(--panel); cursor:pointer;
  transition:border-color .15s ease, transform .12s ease;
}
.facechip:hover{ border-color:var(--brand); transform:translateY(-1px); }
.facechip[aria-pressed="true"]{
  border-color:var(--brand);
  box-shadow:0 0 0 3px var(--brand);
  box-shadow:0 0 0 3px color-mix(in srgb,var(--brand) 18%,transparent);
}
.fc-face{ display:block; width:58px; height:58px; }
.fc-face svg{ width:100%; height:100%; display:block; }
.facechip .fc-name{ font-size:.66rem; color:var(--rail); }

/* ---- the designs themselves. Each styles the shared face classes, so the
        preview chip and the full clock cannot look different. ---- */
.face-classic  .f-dial{ fill:var(--panel); stroke:var(--ink); stroke-width:5; }

.face-minimal  .f-dial{ fill:var(--panel); stroke:var(--line-2); stroke-width:2; }
.face-minimal  .f-hand{ stroke-width:5; stroke-linecap:round; }
.face-minimal  .f-cap{ fill:var(--ink); }

.face-railway  .f-dial{ fill:#fff; stroke:#111; stroke-width:5; }
.face-railway  .f-tick, .face-railway .f-tick-h{ stroke:#111; opacity:1; }
.face-railway  .f-hand{ stroke:#111; }
.face-railway  .f-sec line{ stroke:#e2231a; stroke-width:7; }
.face-railway  .f-sec circle{ fill:#e2231a; }
.face-railway  .f-cap{ fill:#111; }

.face-roman    .f-dial{ fill:#fdfcf7; stroke:#2b2b2b; stroke-width:5; }
.face-roman    .f-num{ fill:#2b2b2b; font-family:Georgia,"Times New Roman",serif; }
.face-roman    .f-hand{ stroke:#2b2b2b; }
.face-roman    .f-cap{ fill:#2b2b2b; }

.face-bauhaus  .f-dial{ fill:var(--panel); stroke:none; }
.face-bauhaus  .f-num{ fill:var(--ink); font-weight:800; }
.face-bauhaus  .f-hour{ stroke:#e5322d; stroke-width:14; stroke-linecap:butt; }
.face-bauhaus  .f-min{ stroke:var(--ink); stroke-width:9; stroke-linecap:butt; }
.face-bauhaus  .f-sec line{ stroke:#f5a524; }
.face-bauhaus  .f-sec circle{ fill:#f5a524; }
.face-bauhaus  .f-cap{ fill:var(--ink); }

.face-midnight .f-dial{ fill:#11131c; stroke:#2b3040; stroke-width:5; }
.face-midnight .f-tick{ stroke:#8b93a7; }
.face-midnight .f-tick-h{ stroke:#e8ecf5; }
.face-midnight .f-num{ fill:#e8ecf5; }
.face-midnight .f-hand{ stroke:#e8ecf5; }
.face-midnight .f-sec line, .face-midnight .f-sec circle{ stroke:#5eead4; fill:#5eead4; }
.face-midnight .f-cap{ fill:#5eead4; }
.face-midnight .f-datebox{ fill:#1a1e2b; stroke:#2b3040; }
.face-midnight .f-date{ fill:#e8ecf5; }

.face-neon     .f-dial{ fill:#08070f; stroke:#2a1a4a; stroke-width:5; }
.face-neon     .f-tick{ stroke:#7c3aed; opacity:.7; }
.face-neon     .f-tick-h{ stroke:#c084fc; opacity:1; }
.face-neon     .f-num{ fill:#e9d5ff; }
.face-neon     .f-hand{ stroke:#c084fc; filter:drop-shadow(0 0 4px #a855f7); }
.face-neon     .f-sec line, .face-neon .f-sec circle{ stroke:#22d3ee; fill:#22d3ee;
  filter:drop-shadow(0 0 4px #22d3ee); }
.face-neon     .f-cap{ fill:#22d3ee; }

.face-vintage  .f-dial{ fill:#f4e6c8; stroke:#6b4a2b; stroke-width:5; }
.face-vintage  .f-tick{ stroke:#6b4a2b; opacity:.5; }
.face-vintage  .f-tick-h{ stroke:#6b4a2b; opacity:1; }
.face-vintage  .f-num{ fill:#5a3d22; font-family:Georgia,"Times New Roman",serif; }
.face-vintage  .f-hand{ stroke:#5a3d22; }
.face-vintage  .f-sec line, .face-vintage .f-sec circle{ stroke:#a8442a; fill:#a8442a; }
.face-vintage  .f-cap{ fill:#5a3d22; }

.face-pilot    .f-dial{ fill:#14161d; stroke:#333a49; stroke-width:5; }
.face-pilot    .f-tick{ stroke:#9aa3b5; }
.face-pilot    .f-tick-h{ stroke:#fff; }
.face-pilot    .f-num{ fill:#fff; }
.face-pilot    .f-hand{ stroke:#fff; }
.face-pilot    .f-sec line, .face-pilot .f-sec circle{ stroke:#f5a524; fill:#f5a524; }
.face-pilot    .f-cap{ fill:#f5a524; }
/* the Restore defaults action in the settings row */
.setchip-action{ margin-left:auto; }
.setchip-action .setchip-i{ font-size:1.05rem; }
.setchip-action.is-armed{
  border-color:var(--c-rose);
  background:var(--panel);
  background:color-mix(in srgb,var(--c-rose) 12%,var(--panel));
}
.setchip-action.is-armed .setchip-i,
.setchip-action.is-armed .setchip-v{ color:var(--c-rose); }
@media (max-width:560px){ .setchip-action{ margin-left:0; } }

/* ---- the ten added faces. The dial gradient comes from the SVG; these
        style the hands, markers and numerals that sit on top. ---- */
.face-azure    .f-dial{ stroke:#4a8fd0; stroke-width:5; }
.face-azure    .f-tick{ stroke:#2c5f8f; opacity:.5; }
.face-azure    .f-tick-h{ stroke:#123f68; opacity:1; }
.face-azure    .f-num{ fill:#123f68; }
.face-azure    .f-hand{ stroke:#123f68; }
.face-azure    .f-sec line, .face-azure .f-sec circle{ stroke:#e5322d; fill:#e5322d; }
.face-azure    .f-cap{ fill:#123f68; }

.face-ocean    .f-dial{ stroke:#0b3d5c; stroke-width:5; }
.face-ocean    .f-tick{ stroke:#bfe6f5; opacity:.45; }
.face-ocean    .f-tick-h{ stroke:#eafaff; opacity:1; }
.face-ocean    .f-hand{ stroke:#eafaff; }
.face-ocean    .f-sec line, .face-ocean .f-sec circle{ stroke:#ffd166; fill:#ffd166; }
.face-ocean    .f-cap{ fill:#ffd166; }

.face-sports   .f-dial{ stroke:#e5322d; stroke-width:7; }
.face-sports   .f-tick{ stroke:#8b929c; }
.face-sports   .f-tick-h{ stroke:#fff; }
.face-sports   .f-num{ fill:#fff; font-weight:800; }
.face-sports   .f-hand{ stroke:#fff; stroke-linecap:butt; }
.face-sports   .f-min{ stroke-width:10; }
.face-sports   .f-sec line, .face-sports .f-sec circle{ stroke:#e5322d; fill:#e5322d; }
.face-sports   .f-cap{ fill:#e5322d; }

.face-diver    .f-dial{ stroke:#0a241d; stroke-width:9; }
.face-diver    .f-tick{ stroke:#5d8f7e; opacity:.55; }
.face-diver    .f-tick-h{ stroke:#c9f7cf; opacity:1; stroke-linecap:round; }
.face-diver    .f-hand{ stroke:#c9f7cf; stroke-linecap:round; }
.face-diver    .f-sec line, .face-diver .f-sec circle{ stroke:#ffb703; fill:#ffb703; }
.face-diver    .f-cap{ fill:#c9f7cf; }

.face-antique  .f-dial{ stroke:#8a6a3a; stroke-width:6; }
.face-antique  .f-tick{ stroke:#8a6a3a; opacity:.45; }
.face-antique  .f-tick-h{ stroke:#5b421f; opacity:1; }
.face-antique  .f-num{ fill:#5b421f; font-family:Georgia,"Times New Roman",serif; }
.face-antique  .f-hand{ stroke:#4a3418; }
.face-antique  .f-sec line, .face-antique .f-sec circle{ stroke:#8a3324; fill:#8a3324; }
.face-antique  .f-cap{ fill:#4a3418; }

.face-geometric .f-dial{ stroke:#7c3aed; stroke-width:4; }
.face-geometric .f-tick{ stroke:#7c3aed; opacity:.3; }
.face-geometric .f-tick-h{ stroke:#4c1d95; opacity:1; stroke-width:12 !important; stroke-linecap:butt; }
.face-geometric .f-hand{ stroke:#4c1d95; stroke-linecap:butt; }
.face-geometric .f-sec line, .face-geometric .f-sec circle{ stroke:#f59e0b; fill:#f59e0b; }
.face-geometric .f-cap{ fill:#4c1d95; }

.face-mono     .f-dial{ stroke:#111; stroke-width:4; }
.face-mono     .f-tick{ stroke:#9a9a9a; }
.face-mono     .f-tick-h{ stroke:#111; }
.face-mono     .f-num{ fill:#111; }
.face-mono     .f-hand{ stroke:#111; }
.face-mono     .f-sec line, .face-mono .f-sec circle{ stroke:#666; fill:#666; }
.face-mono     .f-cap{ fill:#111; }

.face-onyx     .f-dial{ stroke:#3a3a3d; stroke-width:5; }
.face-onyx     .f-tick{ stroke:#6b6b70; }
.face-onyx     .f-tick-h{ stroke:#f2f2f5; }
.face-onyx     .f-num{ fill:#f2f2f5; }
.face-onyx     .f-hand{ stroke:#f2f2f5; }
.face-onyx     .f-sec line, .face-onyx .f-sec circle{ stroke:#ff453a; fill:#ff453a; }
.face-onyx     .f-cap{ fill:#ff453a; }
.face-onyx     .f-datebox{ fill:#000; stroke:#3a3a3d; }
.face-onyx     .f-date{ fill:#f2f2f5; }

.face-timber   .f-dial{ stroke:#5e3c1c; stroke-width:7; }
.face-timber   .f-tick{ stroke:#f0ddc2; opacity:.4; }
.face-timber   .f-tick-h{ stroke:#fdf3e3; opacity:1; }
.face-timber   .f-num{ fill:#fdf3e3; }
.face-timber   .f-hand{ stroke:#fdf3e3; }
.face-timber   .f-sec line, .face-timber .f-sec circle{ stroke:#2f5d50; fill:#2f5d50; }
.face-timber   .f-cap{ fill:#fdf3e3; }

.face-steel    .f-dial{ stroke:#6b7682; stroke-width:6; }
.face-steel    .f-tick{ stroke:#7b8794; opacity:.6; }
.face-steel    .f-tick-h{ stroke:#2c3540; opacity:1; }
.face-steel    .f-num{ fill:#2c3540; }
.face-steel    .f-hand{ stroke:#2c3540; }
.face-steel    .f-sec line, .face-steel .f-sec circle{ stroke:#0ea5e9; fill:#0ea5e9; }
.face-steel    .f-cap{ fill:#2c3540; }

/* ---- dial furniture ---- */
.f-sub{ fill:none; stroke:currentColor; stroke-width:2.5; opacity:.35; }
.f-redline{ stroke:#e5322d; stroke-width:10; stroke-linecap:round; opacity:.9; }
.f-inner{ fill:currentColor; opacity:.55; font-family:var(--f-mono); }
.f-moonbox{ fill:#0a0d20; stroke:currentColor; stroke-width:2; opacity:.9; }
.f-moon{ fill:#ffe9a8; }
.f-skel{ fill:none; stroke:currentColor; stroke-width:2; opacity:.28; }

/* ---- the five convention-based faces ---- */
.face-chrono    .f-dial{ stroke:#8e99a4; stroke-width:6; }
.face-chrono    .f-tick{ stroke:#98a2ad; }
.face-chrono    .f-tick-h{ stroke:#1f2933; }
.face-chrono    .f-num{ fill:#1f2933; }
.face-chrono    .f-hand{ stroke:#1f2933; }
.face-chrono    .f-sub{ stroke:#7b8794; opacity:.55; }
.face-chrono    .f-sec line, .face-chrono .f-sec circle{ stroke:#0ea5e9; fill:#0ea5e9; }
.face-chrono    .f-cap{ fill:#1f2933; }

.face-dashboard .f-dial{ stroke:#3a3d45; stroke-width:7; }
.face-dashboard .f-tick{ stroke:#7a808c; }
.face-dashboard .f-tick-h{ stroke:#fff; }
.face-dashboard .f-num{ fill:#fff; font-weight:800; }
.face-dashboard .f-hand{ stroke:#e6e8ec; stroke-linecap:butt; }
.face-dashboard .f-sec line, .face-dashboard .f-sec circle{ stroke:#e5322d; fill:#e5322d; }
.face-dashboard .f-cap{ fill:#e5322d; }

.face-field     .f-dial{ stroke:#4c5346; stroke-width:6; color:#d7dcd2; }
.face-field     .f-tick{ stroke:#9aa392; }
.face-field     .f-tick-h{ stroke:#eef2e9; }
.face-field     .f-num{ fill:#eef2e9; }
.face-field     .f-inner{ fill:#e2b64b; opacity:.85; }
.face-field     .f-hand{ stroke:#eef2e9; }
.face-field     .f-sec line, .face-field .f-sec circle{ stroke:#e2b64b; fill:#e2b64b; }
.face-field     .f-cap{ fill:#eef2e9; }

.face-moonphase .f-dial{ stroke:#2b3560; stroke-width:6; color:#c9d2ff; }
.face-moonphase .f-tick{ stroke:#6b78ad; }
.face-moonphase .f-tick-h{ stroke:#e8ecff; }
.face-moonphase .f-num{ fill:#e8ecff; font-family:Georgia,"Times New Roman",serif; }
.face-moonphase .f-hand{ stroke:#e8ecff; }
.face-moonphase .f-sec line, .face-moonphase .f-sec circle{ stroke:#ffd166; fill:#ffd166; }
.face-moonphase .f-cap{ fill:#ffd166; }

.face-skeleton  .f-dial{ stroke:#8a7f68; stroke-width:5; color:#6b6353; }
.face-skeleton  .f-tick{ stroke:#8a7f68; opacity:.5; }
.face-skeleton  .f-tick-h{ stroke:#4a4335; opacity:1; }
.face-skeleton  .f-hand{ stroke:#4a4335; }
.face-skeleton  .f-sec line, .face-skeleton .f-sec circle{ stroke:#b8863b; fill:#b8863b; }
.face-skeleton  .f-cap{ fill:#4a4335; }

/* On a phone, opening a setting hides the other items so the choices and the
   clock both fit. The gear and full screen stay in the bar above. */

/* ---- mechanical movement ---- */
.mv-plate{ fill:#1b150f; stroke:#4a3c2a; stroke-width:2; opacity:.75; }
.mv-teeth{ fill:#c9a24a; stroke:#6d5322; stroke-width:1.2; }
.mv-rim{ fill:#2a2118; stroke:#8a6d33; stroke-width:1.6; }
.mv-spoke{ stroke:#8a6d33; stroke-width:3; stroke-linecap:round; }
.mv-hub{ fill:#e0c069; stroke:#6d5322; stroke-width:1.2; }
.mv-balrim{ fill:none; stroke:#d8b45c; stroke-width:5; }
.mv-balarm{ stroke:#d8b45c; stroke-width:3; stroke-linecap:round; }
.mv-jewel{ fill:#e0245e; stroke:#7a1030; stroke-width:1; }

.face-mechanical .f-dial{ stroke:#6d5322; stroke-width:7; }
.face-mechanical .f-tick{ stroke:#c9a24a; opacity:.45; }
.face-mechanical .f-tick-h{ stroke:#f0dca8; opacity:1; }
.face-mechanical .f-num{ fill:#f0dca8; }
.face-mechanical .f-hand{ stroke:#f6ead0; }
.face-mechanical .f-sec line, .face-mechanical .f-sec circle{ stroke:#e0245e; fill:#e0245e; }
.face-mechanical .f-cap{ fill:#e0c069; }



/* ---- settings row: the gear leads, items are icons, the open one names itself ---- */
.setbar{
  display:flex; align-items:center; gap:6px; flex-wrap:nowrap;
  overflow-x:auto; overscroll-behavior-x:contain;
  scrollbar-width:none; -ms-overflow-style:none; padding-bottom:2px;
}
.setbar::-webkit-scrollbar{ display:none; }

.sicon.is-leading{
  /* Sized to the items it now sits with, not to the tool bar it came from. */
  flex:0 0 auto; width:44px; height:42px; margin-right:.35rem;
  border-color:var(--brand);
  background:var(--panel);
  background:color-mix(in srgb,var(--brand) 12%,var(--panel));
  color:var(--brand);
}

/* every item is an icon until it is the one open */
.setbar .setchip{
  flex:0 0 auto; min-width:0; width:44px; height:42px;
  display:grid; place-items:center; padding:0; margin:0;
  grid-template-columns:none;
}
.setbar .setchip .setchip-t,
.setbar .setchip .setchip-v{ display:none; }
.setbar .setchip .setchip-i{ grid-row:auto; }
.setbar .setchip-dot{ width:18px; height:18px; }

/* the open item widens and names itself, the rest stay beside it */
.setbar .setchip[aria-selected="true"],
.setbar .setchip.is-armed{
  width:auto; height:42px; padding:.3rem .7rem;
  display:grid; grid-template-columns:auto 1fr; gap:.05rem .45rem;
  text-align:left; place-items:center start;
}
.setbar .setchip[aria-selected="true"] .setchip-i,
.setbar .setchip.is-armed .setchip-i{ grid-row:1 / span 2; }
.setbar .setchip[aria-selected="true"] .setchip-t,
.setbar .setchip.is-armed .setchip-t{ display:block; font-size:.8rem; white-space:nowrap; }
.setbar .setchip[aria-selected="true"] .setchip-v,
.setbar .setchip.is-armed .setchip-v{
  display:block; grid-column:2; font-size:.66rem;
  white-space:nowrap; max-width:150px; overflow:hidden; text-overflow:ellipsis;
}

/* With the settings open the gear leads its own row below. The size controls
   and full screen stay where they are, dimmed rather than removed, so the row
   being worked on reads as the front one — and they are still there to use. */
.studio-tools .sicon,
.studio-tools .ssize,
.studio-tools .studio-div{ transition:opacity .2s ease; }
.studio.has-open-setting .studio-tools .sicon,
.studio.has-open-setting .studio-tools .ssize,
.studio.has-open-setting .studio-tools .studio-div{ opacity:.34; }
.studio.has-open-setting .studio-tools .sicon:hover,
.studio.has-open-setting .studio-tools .sicon:focus-visible{ opacity:1; }

/* Names are shown once there is room for all eight without the row having to
   scroll — measured at about 1280px. Below that the row is icons, with only
   the open item naming itself, so nothing is hidden off the edge. */
@media (min-width:1280px){
  .setbar .setchip{
    width:auto; height:42px; padding:.3rem .7rem;
    display:grid; grid-template-columns:auto 1fr; gap:.05rem .45rem;
    text-align:left; place-items:center start;
  }
  .setbar .setchip .setchip-i{ grid-row:1 / span 2; }
  .setbar .setchip .setchip-t{ display:block; font-size:.8rem; white-space:nowrap; }
  .setbar .setchip .setchip-v{
    display:block; grid-column:2; font-size:.66rem;
    white-space:nowrap; max-width:150px; overflow:hidden; text-overflow:ellipsis;
  }
}

/* ---- background colour palette ---- */
.colorpick{ display:flex; gap:7px; flex-wrap:nowrap; align-items:center; }
.swatch2{
  flex:0 0 auto; width:38px; height:38px; padding:0; cursor:pointer;
  border:2px solid var(--line-2); border-radius:10px;
  transition:transform .12s ease, border-color .15s ease, box-shadow .15s ease;
}
.swatch2:hover{ transform:translateY(-2px); border-color:var(--brand); }
.swatch2[aria-pressed="true"]{
  border-color:var(--brand);
  box-shadow:0 0 0 3px var(--brand);
  box-shadow:0 0 0 3px color-mix(in srgb,var(--brand) 24%,transparent);
}
/* the "no colour" swatch reads as a cleared field */
.swatch2-none{
  background:
    linear-gradient(45deg, transparent 44%, var(--c-rose) 44%, var(--c-rose) 56%, transparent 56%),
    var(--panel-2);
}
.colorcustom{
  flex:0 0 auto; display:inline-flex; align-items:center; gap:.4rem;
  padding:.3rem .6rem .3rem .35rem; margin-left:.2rem;
  border:1px solid var(--line-2); border-radius:999px;
  font-size:.74rem; font-weight:600; color:var(--ink-2); cursor:pointer;
  white-space:nowrap;
}
.colorcustom:hover{ border-color:var(--brand); color:var(--brand); }
.colorcustom input[type="color"]{
  width:28px; height:28px; padding:0; cursor:pointer;
  border:1px solid var(--line-2); border-radius:50%; background:none;
}
.colorcustom input[type="color"]::-webkit-color-swatch-wrapper{ padding:2px; }
.colorcustom input[type="color"]::-webkit-color-swatch{ border:0; border-radius:50%; }
/* The clock has to stay readable on a chosen colour, the same way it does on
   a scene. Light colours keep the dark type. */
.studio-stage.on-dark .studio-clock{ color:#fff; }
.studio-stage.on-dark .studio-clock .f-dial{ fill:rgba(255,255,255,.06); }
.studio-stage.on-light .studio-clock{ color:var(--ink); }

/* A colour chosen while a scene is running recolours the scene rather than
   replacing it. `mix-blend-mode:color` takes the hue and saturation from the
   overlay and keeps the scene's own light and shade, so rain still looks like
   rain — just a different colour. One rule covers all thirty scenes. */
.studio-stage.is-tinted::after{
  content:""; position:absolute; inset:0; pointer-events:none; z-index:2;
  background:var(--scene-tint, transparent);
  /* `hue` shifts only the colour, keeping the scene's own brightness and
     contrast — `color` also replaced the saturation and flattened it. */
  mix-blend-mode:hue;
}
/* The clock sits above the tint, so it keeps its own colours. */
.studio-stage.is-tinted .studio-clock{ z-index:3; }

/* the settings row, with a close control kept out of the scrolling part */
.setbar-row{ display:flex; align-items:center; gap:8px; }
.setbar-row .setbar{ flex:1 1 auto; min-width:0; }
.setclose{
  flex:0 0 auto; display:grid; place-items:center; width:34px; height:34px; padding:0;
  border:1px solid var(--line-2); border-radius:50%;
  background:var(--panel); color:var(--rail); cursor:pointer;
  transition:border-color .15s ease, color .15s ease, background .15s ease;
}
.setclose:hover{
  border-color:var(--c-rose); color:var(--c-rose);
  background:var(--c-rose);
  background:color-mix(in srgb,var(--c-rose) 10%,transparent);
}

/* The readout paints its text with a clipped gradient, which a child element
   cannot inherit — it would render transparent. The same explicit fill the
   separator and AM/PM already use applies here. */
.sc-digital .secs{ -webkit-text-fill-color:var(--ink); color:var(--ink); }
[data-theme="dark"] .sc-digital .secs{ -webkit-text-fill-color:#fff; color:#fff; }
.studio-stage:not([data-bg="none"]) .sc-digital .secs,
.studio-stage.on-dark .sc-digital .secs{ -webkit-text-fill-color:#fff; color:#fff; }
/* the ticking sound choices, inline in the Screen row */
.ticksound{ display:inline-flex; gap:6px; align-items:center; }
.setlabel{
  flex:0 0 auto; margin:0 .1rem 0 .5rem;
  font-family:var(--f-mono); font-size:.62rem; letter-spacing:.12em;
  text-transform:uppercase; color:var(--rail);
}

/* ---- tool stages: the readout has to lift off a scene the same way the
        clock's does. The existing rules were scoped to the clock's own
        markup, so a stopwatch or timer sitting on a scene stayed dark. ---- */
.studio-stage:not([data-bg="none"]) .studio-clock .readout,
.studio-stage.on-dark .studio-clock .readout{
  background:linear-gradient(160deg,#fff 26%,#dbe4ff);
  -webkit-background-clip:text; background-clip:text; -webkit-text-fill-color:transparent;
}
.studio-stage:not([data-bg="none"]) .studio-clock .hint,
.studio-stage:not([data-bg="none"]) .studio-clock .readout-meta,
.studio-stage.on-dark .studio-clock .hint,
.studio-stage.on-dark .studio-clock .readout-meta{ color:rgba(255,255,255,.78); }
.studio-stage:not([data-bg="none"]) .studio-clock .kbd,
.studio-stage.on-dark .studio-clock .kbd{
  background:rgba(255,255,255,.16); border-color:rgba(255,255,255,.28); color:#fff;
}
.studio-stage:not([data-bg="none"]) .studio-clock .eyebrow,
.studio-stage.on-dark .studio-clock .eyebrow{ color:rgba(255,255,255,.72); }

/* A stage whose content is a single column rather than the clock's two
   side-by-side faces. Without this the readout, the bar and the buttons all
   sit on one line. */
.studio-clock-stack{
  flex-direction:column; align-items:center; justify-content:center;
  gap:0; width:100%;
}
.studio-clock-stack > *{ max-width:100%; }

/* Panels inside a stage have to work on a scene as well as on the plain
   background, so they lift rather than staying light-on-light. */
.studio-stage:not([data-bg="none"]) .studio-clock .panel,
.studio-stage.on-dark .studio-clock .panel{
  background:rgba(10,14,22,.42);
  border-color:rgba(255,255,255,.18);
  -webkit-backdrop-filter:blur(3px);   /* Safari needs the prefix */
  backdrop-filter:blur(3px);
}
.studio-stage:not([data-bg="none"]) .studio-clock .panel .label,
.studio-stage.on-dark .studio-clock .panel .label{ color:rgba(255,255,255,.72); }
.studio-stage:not([data-bg="none"]) .studio-clock .progress,
.studio-stage.on-dark .studio-clock .progress{ background:rgba(255,255,255,.18); }

/* A stage card without the settings machinery, for the tool sections further
   down the home page. Shorter than a full page stage, since it is one of
   several sections rather than the main event. */
.studio-plain .studio-stage-sm{ min-height:clamp(240px, 30vh, 340px); }
.studio-plain .studio-bar{ min-height:46px; }
.studio-plain .studio-left .eyebrow{ margin:0; }
/* While the alarm dialog is open the page is held still; the scrollbar is
   kept so the layout does not shift sideways as it locks. */
body.is-locked{ overflow-y:scroll; }

/* ==================================================================
   Alarm dialog wheel size — one place, not four.

   Four rules had accumulated for this selector over time, each added
   later and quietly overriding the one before, so the phone was getting
   whichever happened to come last rather than the one meant for it.
   ================================================================== */
#dlgWheel .wheel-col{ height:calc(var(--wheel-item) * 5); }
#dlgWheel .wheel-pad{ height:calc(var(--wheel-item) * 2); }

/* On a phone three rows is enough to show the column continues, and it
   takes about 90px less height — which is the difference between
   reaching for the wheel and not. */
@media (max-width:679px){
  .alarmdlg .wheel{ --wheel-item:38px; padding:.2rem 0 0; gap:.25rem; }
  #dlgWheel .wheel-col{ height:calc(var(--wheel-item) * 3); }
  #dlgWheel .wheel-pad{ height:var(--wheel-item); }
  .alarmdlg .wheel-item{ font-size:1.4rem; }
  .alarmdlg .wheel-edit{ font-size:1.4rem; }
  .alarmdlg .wheel-band{ height:var(--wheel-item); }

  /* and the rest of the dialog tightens to match */
  .alarmdlg-h{ padding:.5rem .9rem .45rem; }
  .alarmdlg-h h2{ font-size:1rem; }
  .alarmdlg-h .sicon{ width:32px; height:32px; }
  .alarmdlg-b{ padding:.7rem .9rem .8rem; }
  .alarmdlg-f{ padding:.6rem .9rem .7rem; }
  .alarmdlg .drow{ margin-top:.4rem; }
  .alarmdlg .label{ margin-bottom:.15rem; font-size:.62rem; }
  .alarmdlg .tpick-when{ margin:.3rem 0 0; font-size:.84rem; }
  .alarmdlg .drow-switch{ padding:.25rem 0; }
  /* the clock-face picker, now at the foot of the column, has less room */
  .dial{ width:min(190px, 52vw); }
  .dial-readout{ margin-bottom:.35rem; }
  .dial-seg{ font-size:1.35rem; }
  .dial-hint{ margin-top:.35rem; font-size:.7rem; }
  .dialwrap{ padding-top:.15rem; }
  .alarmdlg .field, .alarmdlg select.field, .alarmdlg input.field{ min-height:42px; padding-top:.45rem; padding-bottom:.45rem; }
  .alarmdlg-b{ padding-top:.55rem; padding-bottom:.55rem; }
  .alarmdlg .saverow{ margin:.3rem 0 .5rem; }

  /* Sit against the bottom of the screen rather than the top. The wheel then
     falls where the thumb already is, which was the actual complaint — the
     dialog was reachable, just not comfortably. */
  .alarmdlg{
    top:auto; bottom:0; margin-bottom:0;
    max-width:100%; width:100%;
    border-radius:var(--radius-lg) var(--radius-lg) 0 0;
  }
  .alarmdlg-f{ border-radius:0; }
}

/* ================= alarm dialog: five ways to set the time =================
   The strip under the header picks one; each is a different input for the
   same value. Shown on phones; desktop keeps the wheel and its dial toggle. */
.dlg-layouts{ display:none; }

@media (max-width:679px){
  .dlg-layouts{ display:flex; gap:6px; justify-content:center; padding:.35rem .9rem .1rem; }
  .dlg-layouts button{
    width:36px; height:30px; display:grid; place-items:center; padding:0;
    border:1px solid var(--line-2); border-radius:8px;
    background:var(--panel); color:var(--rail); cursor:pointer;
  }
  .dlg-layouts button[aria-pressed="true"]{ background:var(--grad-brand); border-color:transparent; color:#fff; }
}
.tp-alt[hidden]{ display:none !important; }
.tp-alt{ padding:.3rem 0 .2rem; }

/* big readouts shared by the keypad and slider */
.tp-readout{
  text-align:center; font-size:2.2rem; font-weight:700; letter-spacing:.04em;
  color:var(--brand); padding:.25rem 0 .5rem;
}

/* 2: the phone's own picker, made big enough to tap */
.tp-native{ width:100%; font-size:1.5rem; text-align:center; min-height:52px; font-family:var(--f-mono); }

/* 4: keypad */
.tp-keys{ display:grid; grid-template-columns:repeat(3,1fr); gap:6px; }
.tp-keys button{
  min-height:44px; font-size:1.2rem; font-weight:700; cursor:pointer;
  border:1px solid var(--line-2); border-radius:10px; background:var(--panel); color:var(--ink);
  font-family:var(--f-mono);
}
.tp-keys button:active{ background:var(--panel); background:color-mix(in srgb,var(--brand) 14%,var(--panel)); }
.tp-keys [data-key="mer"]{ font-size:.9rem; color:var(--brand); }
.tp-keys [data-key="del"]{ font-size:1.1rem; color:var(--rail); }

/* 5: slider */
#tpSlideIn{ width:100%; margin-top:.2rem; }
.tp-slidemarks{ display:flex; justify-content:space-between; font-size:.62rem; color:var(--rail); margin-top:.15rem; }

/* the mobile column order accepts the alternatives where the wheel goes */
@media (max-width:679px){
  .tp-alt{ order:2; }
}

/* ================= the wheel as a slide-up sheet on phones =================
   Mirrors the phone's own picker: the form shows the time as a button, and
   the wheel rises from the bottom edge over it when tapped. */
.wheel-sheetbar{ display:none; }
.tp-timebtn[hidden]{ display:none !important; }

@media (max-width:679px){
  .tp-timebtn{
    display:flex; flex-direction:column; align-items:center; gap:.1rem;
    width:100%; padding:.8rem 1rem .7rem; margin:.2rem 0 .1rem;
    border:1px solid var(--line-2); border-radius:var(--radius);
    background:var(--panel-2); cursor:pointer; color:var(--ink);
    order:2;
  }
  .tp-timebtn:active{ background:var(--panel-2); background:color-mix(in srgb,var(--brand) 12%,var(--panel-2)); }
  .tp-timebtn-v{ font-size:2.4rem; font-weight:700; letter-spacing:.04em; color:var(--brand); line-height:1.1; }
  .tp-timebtn-h{ font-size:.7rem; letter-spacing:.1em; text-transform:uppercase; color:var(--rail); }

  /* the sheet itself */
  .alarmdlg #dlgWheel{
    position:fixed; left:0; right:0; bottom:0; z-index:5;
    margin:0; padding:0 1rem calc(1rem + env(safe-area-inset-bottom));
    background:var(--panel); border-top:1px solid var(--line);
    border-radius:var(--radius-lg) var(--radius-lg) 0 0;
    box-shadow:0 -18px 40px -20px rgba(0,0,0,.5);
    transform:translateY(105%); transition:transform .24s cubic-bezier(.2,.8,.25,1);
    --wheel-item:46px;
    display:flex; flex-wrap:wrap; justify-content:center; align-items:center; gap:.4rem;
  }
  .alarmdlg.is-sheet-open #dlgWheel{ transform:none; }
  .alarmdlg #dlgWheel[hidden]{ display:flex !important; transform:translateY(105%); visibility:hidden; }
  .alarmdlg.is-sheet-open #dlgWheel[hidden]{ visibility:visible; }
  .alarmdlg #dlgWheel .wheel-col{ height:calc(var(--wheel-item) * 5); }
  .alarmdlg #dlgWheel .wheel-pad{ height:calc(var(--wheel-item) * 2); }
  .alarmdlg #dlgWheel .wheel-item,
  .alarmdlg #dlgWheel .wheel-edit{ font-size:1.7rem; }

  .wheel-sheetbar{
    display:flex; align-items:center; justify-content:space-between;
    flex:1 1 100%; padding:.75rem 0 .35rem;
  }
  .wheel-sheetbar-t{
    font-family:var(--f-mono); font-size:.66rem; letter-spacing:.13em;
    text-transform:uppercase; color:var(--rail);
  }

  /* dim the form behind the sheet */
  .alarmdlg::after{
    content:""; position:fixed; inset:0; z-index:4; pointer-events:none;
    background:rgba(8,10,16,.42); opacity:0; transition:opacity .2s ease;
  }
  .alarmdlg.is-sheet-open::after{ opacity:1; pointer-events:auto; }
}

/* ================= alarm dialog: fields as an icon row on phones =================
   The row sits under the time; one field opens at a time beneath it. */
.fieldbar{ display:none; }
.fieldbar[hidden]{ display:none !important; }

@media (max-width:679px){
  .fieldbar{
    display:flex; gap:6px; align-items:center; order:3;
    margin-top:.55rem; padding-top:.55rem; border-top:1px solid var(--line);
    overflow-x:auto; scrollbar-width:none; -ms-overflow-style:none; overscroll-behavior-x:contain;
  }
  .fieldbar::-webkit-scrollbar{ display:none; }
  .fchip{
    flex:0 0 auto; width:44px; height:42px; padding:0;
    display:grid; place-items:center;
    border:1px solid var(--line-2); border-radius:var(--radius);
    background:var(--panel); color:var(--brand); cursor:pointer;
    transition:border-color .15s ease, background .15s ease;
  }
  .fchip .fchip-i{ line-height:0; }
  .fchip .fchip-t, .fchip .fchip-v{ display:none; }
  .fchip[aria-selected="true"]{
    width:auto; padding:.3rem .7rem;
    grid-template-columns:auto 1fr; gap:.05rem .45rem; text-align:left; place-items:center start;
    border-color:var(--brand); background:var(--panel);
    border-color:var(--brand); background:var(--panel); background:color-mix(in srgb,var(--brand) 10%,var(--panel));
  }
  .fchip[aria-selected="true"] .fchip-i{ grid-row:1 / span 2; }
  .fchip[aria-selected="true"] .fchip-t{ display:block; font-size:.8rem; font-weight:700; color:var(--ink); white-space:nowrap; }
  .fchip[aria-selected="true"] .fchip-v{
    display:block; grid-column:2; font-size:.66rem; color:var(--rail);
    white-space:nowrap; max-width:140px; overflow:hidden; text-overflow:ellipsis;
  }

  /* the fields themselves stay hidden until their icon is tapped */
  .alarmdlg .drow[data-row]{ display:none; }
  .alarmdlg .drow[data-row].is-field-open{ display:block; order:4; margin-top:.6rem; }
  .alarmdlg .drow[data-row="snooze"].is-field-open{ display:flex; }
  .alarmdlg .snoozewrap{ display:none; }
  .alarmdlg .snoozewrap.is-field-open:not([hidden]){ display:block; order:5; }
  /* the open field's own label is redundant beside the named chip */
  .alarmdlg .drow.is-field-open > .label{ display:none; }
  .alarmdlg .drow[data-row="vol"].is-field-open > .label{ display:block; }
  #dlgStatus{ order:6; } #dlgSaved{ order:7; }
}

/* On a touch screen the typed-entry input over the wheel's band must not
   catch the finger, or the drag has no momentum. Taps reach it through the
   column's own tap handling instead. Mouse and keyboard are unaffected. */
@media (pointer:coarse){
  .wheel-edit{ pointer-events:none; }
  .wheel-edit:focus{ pointer-events:auto; }   /* once open for typing, it can be tapped again */
}

/* ==================================================================
   Cylinder wheel picker (#wpPicker)
   Three drums sharing one vanishing point. The band is a fixed element
   the numbers turn behind; the drums themselves are 3D-transformed items.
   ================================================================== */
.wp{
  --wp-item:44px;
  --wp-rows:5;
  position:relative; display:flex; justify-content:center; align-items:stretch; gap:.35rem;
  height:calc(var(--wp-item) * var(--wp-rows));
  /* The curve comes from perspective. A shorter distance bends the drum
     more, which matters at small row heights: with the default the rows are
     so close that the cylinder reads as a flat list. */
  perspective:var(--wp-persp, 820px); perspective-origin:50% 50%;
  padding:0 .35rem;
}
.wp-band{
  position:absolute; left:.35rem; right:.35rem; top:50%; z-index:0;
  height:var(--wp-item); margin-top:calc(var(--wp-item) / -2);
  border-radius:12px;
  background:var(--panel-2);
  background:color-mix(in srgb, var(--brand) 11%, var(--panel-2));
  pointer-events:none;
}
.wp-mount{ position:relative; z-index:1; flex:0 0 auto; width:3.3em; }
.wp-mer{ width:3.6em; }
.wp-col{
  position:relative; height:100%; outline:none;
  touch-action:none;                 /* the column is the gesture surface */
  user-select:none; -webkit-user-select:none;
  cursor:grab;
  border-radius:12px;
  /* fade the top and bottom of the drum into the panel */
  -webkit-mask-image:linear-gradient(180deg, transparent 0, #000 22%, #000 78%, transparent 100%);
          mask-image:linear-gradient(180deg, transparent 0, #000 22%, #000 78%, transparent 100%);
}
.wp-col.is-dragging{ cursor:grabbing; }
.wp-col:focus-visible{ box-shadow:inset 0 0 0 2px var(--brand); }
.wp-drum{ position:absolute; inset:0; transform-style:preserve-3d; }
.wp-item{
  position:absolute; left:0; right:0; top:50%;
  height:var(--wp-item); margin-top:calc(var(--wp-item) / -2);
  display:flex; align-items:center; justify-content:center;
  font-family:var(--f-mono); font-size:1.55rem; font-weight:600;
  letter-spacing:.02em; color:var(--ink-2);
  backface-visibility:hidden; will-change:transform, opacity;
  pointer-events:none;
}
.wp-item.is-on{ color:var(--ink); font-weight:700; }
.wp-mer .wp-item{ font-size:1.1rem; letter-spacing:.08em; }
.wp-hidden{ display:none !important; }

/* larger and taller on a desktop, where there is room */
@media (min-width:680px){
  .wp{ --wp-item:46px; --wp-rows:7; }
  .wp-item{ font-size:1.7rem; }
}
/* the sheet on a phone: the drum fills the width and gets a big thumb target */
@media (max-width:679px){
  .alarmdlg #dlgWheel .wp{ --wp-item:46px; --wp-rows:5; width:100%; padding:0; }
  .alarmdlg #dlgWheel .wp-mount{ flex:1 1 0; width:auto; max-width:120px; }
  .alarmdlg #dlgWheel .wp-item{ font-size:1.75rem; }
}
@media (prefers-reduced-motion: reduce){
  .wp-item{ will-change:auto; }
}

/* the dialog header doubles as a drag handle on larger screens */
@media (min-width:680px){
  .alarmdlg-h{ cursor:grab; user-select:none; -webkit-user-select:none; touch-action:none; }
  .alarmdlg-h.is-dragging{ cursor:grabbing; }
  .alarmdlg-h button{ cursor:pointer; }
  .alarmdlg.is-moved{ transition:none; }
  /* a faint grip in the title, so the handle is discoverable */
  .alarmdlg-h h2::before{
    content:""; display:inline-block; width:22px; height:4px; margin:0 .6rem 4px 0;
    border-radius:2px; vertical-align:middle;
    background:repeating-linear-gradient(90deg, var(--line-2) 0 3px, transparent 3px 6px);
  }
}

/* typing into a drum: the input sits exactly on the band row */
.wp-edit{
  position:absolute; left:0; right:0; top:50%; z-index:3;
  height:var(--wp-item); margin-top:calc(var(--wp-item) / -2);
  width:100%; padding:0; border:0; outline:none; background:transparent;
  text-align:center; font:inherit;
  font-family:var(--f-mono); font-size:1.55rem; font-weight:700; letter-spacing:.02em;
  display:none; pointer-events:auto;
}
.wp-edit::placeholder{ color:var(--brand); color:color-mix(in srgb, var(--brand) 55%, transparent); }
.wp.is-typing .wp-edit{ display:block; }
.wp-col.is-editing .wp-item.is-on{ visibility:hidden; }
/* Typing marks the row, not the column: a full outline drew a tall bar down
   each side of the drum. A hairline under the digit is enough, and the digit
   itself turns to show it is being typed rather than turned. */
.wp-col.is-editing{ box-shadow:none; }
.wp.is-typing .wp-edit{
  color:#ff8a3d; caret-color:#ff8a3d;
  box-shadow:0 1px 0 #ff8a3d;                /* a 1px rule under the digit */
}
.wp.is-typing .wp-edit::placeholder{
  color:#ff8a3d;
  color:color-mix(in srgb, #ff8a3d 45%, transparent);
}
/* Sweet orange: a touch warmer and softer than the flat brand orange, so a
   typed time reads as marked rather than as a warning. */
.wp{ --wp-typed:#ff8a3d; }
/* the digit being typed, and every selected digit once any of them has been */
.wp-item.is-typed,
.wp.is-typed-time .wp-item.is-on{ color:var(--wp-typed); }
.wp.is-typed-time .wp-mer .wp-item.is-on{ color:var(--wp-typed); }
@media (min-width:680px){ .wp-edit{ font-size:1.7rem; } }
@media (max-width:679px){ .alarmdlg #dlgWheel .wp-edit{ font-size:1.75rem; } }
/* the off-screen switch that gives iOS its detent tap; it must not be
   display:none, or Safari will not fire the haptic */
.wp-haptic{
  position:fixed; left:-100px; top:0; width:1px; height:1px;
  overflow:hidden; opacity:0; pointer-events:none;
}

/* ================= /test/: alarm options on the stage ================= */
.tp-inline{
  flex:1 1 100%; width:100%; max-width:820px; margin:1.2rem auto 0;
  display:grid; gap:.9rem; justify-items:center;
}
.tp-inline-time{
  display:flex; flex-direction:column; align-items:center; gap:.1rem;
  padding:.7rem 1.6rem .6rem; border:1px solid var(--line-2); border-radius:var(--radius);
  background:var(--panel); color:var(--ink); cursor:pointer;
  transition:border-color .15s ease, transform .12s ease;
}
.tp-inline-time:hover{ border-color:var(--brand); transform:translateY(-1px); }
.tp-inline-time-v{ font-size:2.2rem; font-weight:700; letter-spacing:.04em; color:var(--brand); line-height:1.1; }
.tp-inline-time-h{ font-size:.66rem; letter-spacing:.12em; text-transform:uppercase; color:var(--rail); }
.tp-inline-fields{
  display:grid; grid-template-columns:repeat(auto-fit, minmax(150px, 1fr)); gap:.6rem .8rem;
  width:100%; padding:.9rem 1rem; border-radius:var(--radius-lg);
  background:var(--panel); border:1px solid var(--line);
  background:var(--panel); background:color-mix(in srgb, var(--panel) 82%, transparent); border:1px solid var(--line);
  -webkit-backdrop-filter:blur(4px);   /* Safari needs the prefix */
  backdrop-filter:blur(4px);
}
.tp-f{ display:grid; gap:.25rem; min-width:0; }
.tp-f .field{ width:100%; min-height:40px; }
.tp-f-switch{ align-content:center; justify-items:start; }
.tp-inline-actions{ display:flex; align-items:center; gap:1.2rem; flex-wrap:wrap; justify-content:center; }
.tp-inline-actions .tpick-when{ margin:0; }
/* keep it readable on a scene */
.studio-stage:not([data-bg="none"]) .tp-inline-fields,
.studio-stage.on-dark .tp-inline-fields{ background:rgba(10,14,22,.55); border-color:rgba(255,255,255,.18); }
.studio-stage:not([data-bg="none"]) .tp-inline-fields .label,
.studio-stage.on-dark .tp-inline-fields .label{ color:rgba(255,255,255,.75); }
.studio-stage:not([data-bg="none"]) .tp-inline-time,
.studio-stage.on-dark .tp-inline-time{ background:rgba(10,14,22,.55); border-color:rgba(255,255,255,.22); }
.studio-stage:not([data-bg="none"]) .tp-inline-actions .tpick-when,
.studio-stage.on-dark .tp-inline-actions .tpick-when{ color:#fff; }

/* the wheel-only popup */
.wheeldlg{
  border:0; padding:0; width:min(420px, calc(100vw - 2rem));
  border-radius:var(--radius-lg); background:var(--panel); color:var(--ink);
  box-shadow:0 30px 80px -20px rgba(0,0,0,.55);
}
.wheeldlg::backdrop{ background:rgba(8,12,24,.55); -webkit-backdrop-filter:blur(3px); backdrop-filter:blur(3px); }
.wheeldlg-in{ display:flex; flex-direction:column; }
.wheeldlg-h{
  display:flex; align-items:center; justify-content:space-between; gap:1rem;
  padding:.7rem .9rem .5rem; border-bottom:1px solid var(--line);
}
.wheeldlg-h h2{ margin:0; font-size:1rem; }
.wheeldlg-h .is-go{ color:var(--c-green); border-color:var(--c-green); }
.wheeldlg .wp{ margin:.6rem 0 .2rem; }
.wheeldlg .tpick-when{ margin:0 0 .9rem; }
@media (max-width:679px){
  .wheeldlg{ top:auto; bottom:0; margin-bottom:0; width:100%; max-width:100%;
             border-radius:var(--radius-lg) var(--radius-lg) 0 0; }
  .wheeldlg .wp{ --wp-item:46px; --wp-rows:5; }
  .wheeldlg .wp-mount{ flex:1 1 0; width:auto; max-width:120px; }
  .wheeldlg .wp-item, .wheeldlg .wp-edit{ font-size:1.75rem; }
  .tp-inline-time-v{ font-size:1.9rem; }
}
/* /test/: the alarm list lives on the stage too */
.tp-inline-list{
  width:100%; padding:.8rem 1rem .9rem; border-radius:var(--radius-lg);
  background:var(--panel); border:1px solid var(--line);
  background:var(--panel); background:color-mix(in srgb, var(--panel) 82%, transparent); border:1px solid var(--line);
  -webkit-backdrop-filter:blur(4px);   /* Safari needs the prefix */
  backdrop-filter:blur(4px); text-align:left;
}
.tp-inline-list-h{ display:flex; align-items:center; justify-content:space-between; gap:1rem; margin-bottom:.4rem; }
.tp-inline-list [data-alarmlist]:empty::before{
  content:"No alarms yet. Tap the clock to choose a time."; display:block;
  font-size:.86rem; color:var(--rail); padding:.3rem 0 .1rem;
}
.tp-inline-actions #tiSave .mono{ margin-left:.5rem; opacity:.85; font-weight:600; }
.studio-stage:not([data-bg="none"]) .tp-inline-list,
.studio-stage.on-dark .tp-inline-list{ background:rgba(10,14,22,.55); border-color:rgba(255,255,255,.18); }
.studio-stage:not([data-bg="none"]) .tp-inline-list .label,
.studio-stage.on-dark .tp-inline-list .label{ color:rgba(255,255,255,.75); }
/* /test/: the native time input is never shown; it only supplies the picker.
   It must stay in the layout (not display:none) or showPicker() is refused. */
.tp-native-hidden{
  position:absolute; width:1px; height:1px; opacity:0; pointer-events:none;
  left:50%; top:50%; margin:0; padding:0; border:0;
}
.tp-inline-fields .tp-inline-actions{ grid-column:1 / -1; padding-top:.3rem; border-top:1px solid var(--line); margin-top:.2rem; }
.tp-inline-fields .tp-inline-list{ grid-column:1 / -1; padding:0; border:0; background:transparent; -webkit-backdrop-filter:none; backdrop-filter:none; }
/* /test/: on a desktop the native time input is a real field, so the
   browser's own picker can be seen and judged. Phones hide it and open the
   picker from the clock. */
.tp-f-time .tp-native{ font-family:var(--f-mono); font-size:1.25rem; font-weight:700; min-height:44px; }
@media (max-width:679px){
  .tp-f-time{ position:absolute; width:1px; height:1px; overflow:hidden; opacity:0; pointer-events:none; }
}
/* /test/: the popup that holds the device's time picker */
.timedlg{
  border:0; padding:0; width:min(400px, calc(100vw - 2rem));
  border-radius:var(--radius-lg); background:var(--panel); color:var(--ink);
  box-shadow:0 30px 80px -20px rgba(0,0,0,.55);
}
.timedlg::backdrop{ background:rgba(8,12,24,.55); -webkit-backdrop-filter:blur(3px); backdrop-filter:blur(3px); }
.timedlg-in{ display:flex; flex-direction:column; }
.timedlg-h{ display:flex; align-items:center; justify-content:space-between; gap:1rem; padding:.7rem .9rem .5rem; border-bottom:1px solid var(--line); }
.timedlg-h h2{ margin:0; font-size:1rem; }
.timedlg-b{ padding:.9rem 1rem .6rem; }
.timedlg-b .tp-native{ width:100%; font-family:var(--f-mono); font-size:1.5rem; font-weight:700; text-align:center; min-height:52px; margin-top:.3rem; }
.timedlg-b .hint{ margin:.5rem 0 0; }
.timedlg-b .tpick-when{ margin:.6rem 0 0; }
.timedlg-f{ display:flex; justify-content:space-between; gap:8px; padding:.7rem 1rem .9rem; border-top:1px solid var(--line); background:var(--panel-2); border-radius:0 0 var(--radius-lg) var(--radius-lg); }
.timedlg-f #tiSave{ min-width:132px; }
@media (max-width:679px){
  .timedlg{ top:auto; bottom:0; margin-bottom:0; width:100%; max-width:100%; border-radius:var(--radius-lg) var(--radius-lg) 0 0; }
  .timedlg-f{ border-radius:0; }
}
/* /test/: the native time input sits invisibly over the Set Alarm button so
   the phone's picker opens from a genuine tap, anchored to the button */
.tp-cta{ position:relative; display:inline-block; }
.tp-native-over{
  position:absolute; inset:0; width:100%; height:100%; margin:0; padding:0;
  opacity:0; border:0; background:transparent; z-index:2; cursor:pointer;
  -webkit-appearance:none; appearance:none; font-size:16px;  /* 16px: no iOS zoom on focus */
}
.tp-native-over::-webkit-calendar-picker-indicator{ position:absolute; inset:0; width:100%; height:100%; opacity:0; cursor:pointer; }
.tp-native-over::-webkit-date-and-time-value{ width:100%; height:100%; }

.tp-timebox-in{
  flex:0 0 auto; width:8.2em; min-height:48px; margin:0; padding:.2rem .5rem;
  border:0; border-radius:10px; background:var(--panel-2); color:var(--brand);
  font-family:var(--f-mono); font-size:1.5rem; font-weight:700; letter-spacing:.02em; text-align:center;
  -webkit-appearance:none; appearance:none;
}
.tp-timebox-in::-webkit-calendar-picker-indicator{ opacity:.55; margin-left:.1rem; }
.tp-timebox-in:focus{ outline:2px solid var(--brand); outline-offset:1px; }
.tp-timebox-sep{ width:1px; align-self:stretch; background:var(--line); }
.tp-timebox-when{ flex:1 1 auto; min-width:0; font-size:.86rem; font-weight:600; color:var(--brand); line-height:1.25; }
.studio-stage:not([data-bg="none"]) .tp-timebox,
.studio-stage.on-dark .tp-timebox{ background:rgba(10,14,22,.62); border-color:rgba(255,255,255,.2); }
.studio-stage:not([data-bg="none"]) .tp-timebox-in,
.studio-stage.on-dark .tp-timebox-in{ background:rgba(255,255,255,.1); color:#fff; }
.studio-stage:not([data-bg="none"]) .tp-timebox-when,
.studio-stage.on-dark .tp-timebox-when{ color:#fff; }
@media (max-width:420px){
  .tp-timebox-in{ width:7.2em; font-size:1.3rem; }
  .tp-timebox-when{ font-size:.78rem; }
}
/* /test1/: the readout in the box is text, not a field */
.tp-timebox-in{ display:inline-flex; align-items:center; justify-content:center; }
.tp-native-over{ cursor:pointer; }

/* the second input, over the clock face and digits */
.tp-native-face{ cursor:pointer; }

/* the readout keeps its own stacking so the input over it stays clickable */
#sTime.tp-cta{ position:relative; display:inline-block; }

/* /test1/: the time and its status, floating just above Set Alarm while the
   picker is open. Positioned absolutely from the button's wrapper, so
   showing it moves nothing — the tap that opened the picker lands where it
   was aimed. Hidden until then; the attribute must beat the display rule. */
.tp-timebox{
  /* A bar pinned to the bottom of the screen for as long as the picker is
     open: the time on the left, when it will ring on the right. The picker
     opens above the tap, so the bar is never under it. */
  position:fixed; left:0; right:0; bottom:0; z-index:80;
  display:grid; gap:.6rem;
  padding:.7rem 1rem calc(.75rem + env(safe-area-inset-bottom));
  border-top:1px solid var(--line-2);
  background:var(--panel);
  background:color-mix(in srgb, var(--panel) 94%, transparent);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter:blur(10px); -webkit-backdrop-filter:blur(10px);
  box-shadow:0 -14px 36px -20px rgba(0,0,0,.45);
  animation:tp-rise .22s cubic-bezier(.2,.8,.25,1);
}
.tp-timebox-in{ background:transparent; color:var(--brand); padding:0; min-height:0; width:auto; font-size:1.45rem; }
.tp-timebox-sep{ display:none; }
.tp-timebox-when{ flex:0 1 auto; text-align:right; color:var(--ink); font-weight:600; font-size:.88rem; }
.tp-timebox-row{ display:flex; align-items:center; justify-content:space-between; gap:1rem; }
.tp-timebox-acts{ display:flex; gap:8px; }
.tp-timebox-acts #tiCancel{ flex:0 0 auto; }
.tp-timebox-acts #tiSave{ flex:1 1 auto; justify-content:center; }
@media (min-width:680px){
  .tp-timebox{ grid-template-columns:1fr auto; align-items:center; }
  .tp-timebox-acts #tiSave{ flex:0 0 auto; min-width:130px; }
}
@keyframes tp-rise{ from{ transform:translateY(100%); } to{ transform:none; } }
@media (min-width:680px){
  .tp-timebox{ left:50%; right:auto; transform:translateX(-50%); width:min(560px, 92vw);
               border:1px solid var(--line-2); border-bottom:0; border-radius:var(--radius-lg) var(--radius-lg) 0 0; }
  @keyframes tp-rise{ from{ transform:translate(-50%, 100%); } to{ transform:translate(-50%, 0); } }
}
.tp-timebox[hidden]{ display:none !important; }
@keyframes tp-pop{ from{ opacity:0; } to{ opacity:1; } }

/* ================= /test2/: our own picker sheet =================
   Ours, so it can be styled, moved and given its own buttons. */
.wsheet[hidden]{ display:none !important; }
.wsheet{ position:fixed; inset:0; z-index:90; }
.wsheet-scrim{
  position:absolute; inset:0; background:rgba(8,12,24,.45);
  opacity:0; transition:opacity .2s ease;
}
.wsheet.is-open .wsheet-scrim{ opacity:1; }
.wsheet-card{
  /* On a phone the card runs the full width so the options bar and the
     status row have room; the drum inside stays centred on its own. */
  --wsheet-dy:0px;
  position:absolute; left:50%; bottom:0;
  width:100%;
  background:var(--panel); color:var(--ink);
  border:1px solid var(--line-2); border-bottom:0;
  border-radius:var(--radius-lg) var(--radius-lg) 0 0;
  box-shadow:0 -18px 50px -20px rgba(0,0,0,.5);
  padding:.35rem 1rem calc(.9rem + env(safe-area-inset-bottom));
  transform:translate(-50%, calc(var(--wsheet-dy) + 14px)); opacity:0;
  transition:transform .22s cubic-bezier(.2,.8,.25,1), opacity .18s ease;
}
.wsheet.is-open .wsheet-card{ transform:translate(-50%, var(--wsheet-dy)); opacity:1; }
.wsheet-card.is-moving{ transition:opacity .18s ease; }
.wsheet-h{
  display:flex; align-items:baseline; justify-content:space-between; gap:1rem;
  position:relative; padding:.75rem .1rem .35rem;
}
/* only the tap-anchored page keeps a draggable header */
.wsheet.t3 .wsheet-h{ cursor:grab; touch-action:none; user-select:none; -webkit-user-select:none; }
.wsheet.t3 .wsheet-card.is-moving .wsheet-h{ cursor:grabbing; }
.wsheet-grip{
  position:absolute; top:.3rem; left:50%; transform:translateX(-50%);
  width:34px; height:4px; border-radius:2px; background:var(--line-2);
}
.wsheet-t{
  font-family:var(--f-mono); font-size:.66rem; letter-spacing:.13em;
  text-transform:uppercase; color:var(--rail);
}
.wsheet-when{ font-size:.84rem; font-weight:600; color:var(--brand); }
.wsheet-f{ display:flex; gap:10px; margin-top:.8rem; }
.wsheet-f #tiCancel{ flex:0 0 auto; min-width:96px; }
.wsheet-f #tiSave{ flex:1 1 auto; justify-content:center; }

/* smaller digits than the alarm dialog's wheel */
.wp-sm{
  --wp-item:38px; --wp-rows:7; --wp-persp:340px;
  margin:.4rem 0 .2rem;
}
.wp-sm .wp-item{ font-size:1.15rem; font-weight:600; }
.wp-sm .wp-item.is-on{ font-weight:700; }
.wp-sm .wp-mer .wp-item{ font-size:.86rem; letter-spacing:.08em; }

.wp-sm .wp-edit{ font-size:1.15rem; }
/* The rows are absolutely positioned, so a column has no width of its own —
   it has to be given one by the flex line. Sizing it to content collapses the
   whole drum to nothing. */
.wp-sm .wp-mount{ flex:1 1 0; width:auto; max-width:110px; }
/* the picker itself is not stretched by a wider card: it keeps its size and
   sits in the middle */
.wsheet.t2 .wp{ width:min(320px, 100%); margin-left:auto; margin-right:auto; }
/* a deeper fade at the ends, so the rows disappear round the drum */
.wp-sm .wp-col{
  -webkit-mask-image:linear-gradient(180deg, transparent 0, #000 30%, #000 70%, transparent 100%);
          mask-image:linear-gradient(180deg, transparent 0, #000 30%, #000 70%, transparent 100%);
}

/* on a desktop it is a centred card, not a sheet */
@media (min-width:680px){
  .wsheet-card{
    bottom:auto; top:50%; margin-top:-160px;
    width:min(380px, 92vw);
    border:1px solid var(--line-2); border-radius:var(--radius-lg);
    box-shadow:0 26px 60px -20px rgba(0,0,0,.5);
    padding:.35rem .9rem .9rem;
  }
  .wp-sm{ --wp-item:40px; --wp-persp:380px; }
}

/* /test3/: the card is placed at the touch, so it is positioned from the
   top-left rather than being centred on an edge */
.wsheet.t3 .wsheet-card{
  left:0; top:0; bottom:auto; margin-top:0;
  transform:translateY(10px); opacity:0;
}
.wsheet.t3.is-open .wsheet-card{ transform:none; opacity:1; }

/* ---- /test2/: a card with some depth, and a smaller commit button ---- */
.wsheet.t2 .wsheet-card{
  padding:.2rem .85rem .8rem;
  border:1px solid rgba(255,255,255,.55);
  background:linear-gradient(180deg, #fff 0%,
                            var(--dial-2) 100%); background:linear-gradient(180deg, color-mix(in srgb, var(--panel) 100%, #fff 0%) 0%,
                            color-mix(in srgb, var(--panel) 92%, var(--dial-2)) 100%);
  box-shadow:
    0 1px 0 rgba(255,255,255,.9) inset,          /* top highlight */
    0 -1px 0 rgba(0,0,0,.05) inset,              /* bottom shade */
    0 2px 4px rgba(0,0,0,.06),
    0 12px 20px -8px rgba(0,0,0,.18),
    0 34px 60px -22px rgba(0,0,0,.5);            /* the card lifting off */
}
/* the drum sunk into the card, with the band raised out of it */
.wsheet.t2 .wp{
  border-radius:14px;
  background:linear-gradient(180deg, rgba(0,0,0,.05), rgba(0,0,0,.015) 26%, rgba(0,0,0,.015) 74%, rgba(0,0,0,.05));
  box-shadow:
    0 1px 2px rgba(0,0,0,.09) inset,
    0 -1px 0 rgba(255,255,255,.8) inset;
}
.wsheet.t2 .wp-band{
  background:linear-gradient(180deg, #fff, var(--panel));
  background:linear-gradient(180deg, color-mix(in srgb, var(--brand) 16%, #fff), color-mix(in srgb, var(--brand) 9%, var(--panel)));
  box-shadow:0 1px 0 rgba(255,255,255,.95) inset,
    0 1px 3px rgba(0,0,0,.12),
    0 4px 10px -4px var(--brand); box-shadow:0 1px 0 rgba(255,255,255,.95) inset,
    0 1px 3px rgba(0,0,0,.12),
    0 4px 10px -4px color-mix(in srgb, var(--brand) 45%, transparent);
}
.wsheet.t2 .wp-item{ text-shadow:0 1px 0 rgba(255,255,255,.7); }
.wsheet.t2 .wp-item.is-on{ text-shadow:0 1px 0 rgba(255,255,255,.9); }

/* the time in the top-left corner, its status on the right */
/* One row, one type size, one line height — the time, the word, the
   dropdown and the countdown all match. */
.wsheet.t2 .wsheet-h{
  align-items:center; justify-content:space-between; gap:1.1rem;
  padding:.7rem .15rem .25rem;
  font-size:.9rem; line-height:1.5;
}
.wsheet-time{
  flex:0 0 auto; white-space:nowrap;
  font-size:inherit; line-height:inherit; font-weight:700; letter-spacing:.02em;
  color:var(--brand); text-shadow:0 1px 0 rgba(255,255,255,.9);
}
/* the status shares the line: it shrinks rather than wrapping the time */
.wsheet.t2 .wsheet-when{
  flex:0 1 auto; min-width:0; text-align:right;
  overflow:hidden; text-overflow:ellipsis;
}
@media (max-width:359px){
  .wsheet.t2 .wsheet-h{ font-size:.82rem; }
}

/* a modest commit button, not a full-width slab */
/* Cancel sits bottom-left, Set Alarm bottom-right */
.wsheet.t2 .wsheet-f{ justify-content:space-between; gap:8px; margin-top:.7rem; }
/* the sheet's own buttons stay modest; the page's Set Alarm is the big one */
.wsheet.t2 .wsheet-f #tiCancel,
.wsheet.t2 .wsheet-f #tiSave{
  flex:0 0 auto; min-width:0; padding:.44rem .95rem; font-size:.86rem; border-radius:10px;
}
.wsheet.t2 .wsheet-f #tiSave{ box-shadow:0 1px 0 rgba(255,255,255,.4) inset, 0 4px 12px -4px rgba(0,0,0,.35); }

[data-theme="dark"] .wsheet.t2 .wsheet-card{
  border-color:rgba(255,255,255,.1);
  box-shadow:0 1px 0 rgba(255,255,255,.08) inset, 0 34px 60px -22px rgba(0,0,0,.75);
}
[data-theme="dark"] .wsheet.t2 .wp-item,
[data-theme="dark"] .wsheet.t2 .wp-item.is-on,
[data-theme="dark"] .wsheet.t2 .wsheet-time{ text-shadow:none; }

/* The Set Alarm button on the page itself — the way in to the picker — is
   the primary action on the clock, so it is sized to be obvious. */
/* only on the test beds, which carry #tpInline — the live pages keep the
   button they already had */
.studio.has-inline #clockSetAlarm,
.studio:has(#tpInline) #clockSetAlarm{
  padding:.85rem 2.2rem; font-size:1.05rem; font-weight:700;
  border-radius:14px; letter-spacing:.01em;
  box-shadow:0 1px 0 rgba(255,255,255,.35) inset, 0 10px 24px -10px rgba(0,0,0,.45);
}
@media (max-width:679px){
  .studio.has-inline #clockSetAlarm,
.studio:has(#tpInline) #clockSetAlarm{ padding:.9rem 2rem; font-size:1.08rem; }
}
/* /test4/: the barrel reads better with a little more room either side and a
   soft inner shading, so the column looks round rather than flat */
.wsheet.t4 .wp{
  background:
    radial-gradient(120% 100% at 50% 50%, rgba(255,255,255,.55), transparent 62%),
    linear-gradient(90deg, rgba(0,0,0,.055), transparent 16%, transparent 84%, rgba(0,0,0,.055)),
    linear-gradient(180deg, rgba(0,0,0,.05), rgba(0,0,0,.015) 26%, rgba(0,0,0,.015) 74%, rgba(0,0,0,.05));
}
.wsheet.t4 .wp-mount{ max-width:120px; }
/* a shorter perspective and more rows deepen the barrel further */
.wsheet.t4 .wp{ --wp-persp:260px; --wp-rows:9; }

/* ---- the day dropdown in the sheet's status line ---- */
/* the whole status row on one line, one size, with air before it */
.wsheet-when{
  display:inline-flex; align-items:center; gap:.3rem;
  white-space:nowrap; font-size:inherit; line-height:inherit; font-weight:600;
  height:1.5em;                       /* the row's own height, not the tallest child */
}
/* every part of the row centres on the same line, whatever its box */
.wsheet-when > *{ align-self:center; }
.wsheet-when-t, .wsheet-when-in{ font-size:inherit; font-weight:inherit; line-height:inherit; }
.wsheet-when-in{ margin-left:-.3rem; }
.wsheet-when-t{ color:inherit; }
/* The wrapper is taken out of the layout entirely — the menu it used to
   anchor now lives on the body, so it has no job left. With display:contents
   the button becomes a direct child of the status row and centres with the
   text instead of sitting inside a box of its own. */
.daypick{ display:contents; }
.daypick-btn{
  /* The outline is a shadow, not a border: a border adds two pixels of height
     that the plain text beside it does not have, which left the box sitting
     lower than the rest of the row. */
  display:inline-flex; align-items:center; justify-content:center; gap:.3rem;
  height:1.5em; padding:0 .4rem; margin:0; cursor:pointer;
  border:0; border-radius:4px;
  box-shadow:inset 0 0 0 1px var(--line-2);
  background:var(--panel-2); color:inherit;
  font-size:inherit; font-family:inherit; font-weight:700; line-height:1;
  vertical-align:middle;
}
.daypick-btn svg{ display:block; }
.daypick-btn svg{ opacity:.65; }
.daypick-btn[aria-expanded="true"]{ box-shadow:inset 0 0 0 1px var(--brand); }
/* The drum below sits in its own 3D context, which paints above anything
   the header puts there unless the header is given a stacking context of its
   own — the menu was opening behind the wheel. */
.wsheet-h{ position:relative; z-index:30; }
.daypick-menu{
  position:fixed; z-index:120;
  min-width:160px; padding:0;
  border:1px solid var(--line-2); border-radius:4px;   /* square corners */
  background:var(--panel); box-shadow:0 16px 34px -14px rgba(0,0,0,.5);
  overflow:hidden;
}
.daypick-menu[hidden]{ display:none !important; }
.daypick-opt{
  display:block; width:100%; text-align:left; cursor:pointer;
  padding:.5rem .7rem; margin:0; border:0; border-radius:0;
  border-bottom:1px solid var(--line);
  background:transparent; color:var(--ink);
  font-family:inherit; font-size:.86rem; font-weight:600; line-height:1.4;
}
.daypick-opt:last-of-type{ border-bottom:0; }
.daypick-opt:hover, .daypick-opt:focus-visible{ background:var(--brand); background:color-mix(in srgb, var(--brand) 12%, transparent); }

/* the "Pick a date" row is the date field itself, invisible on top of it */
.daypick-dateopt{ position:relative; display:block; }
.daypick-dateopt .daypick-date{
  position:absolute; inset:0; width:100%; height:100%;
  opacity:0; margin:0; padding:0; border:0; cursor:pointer;
  pointer-events:auto; z-index:2;
  font-size:16px;                       /* 16px keeps iOS from zooming */
}
.daypick-dateopt .daypick-date::-webkit-calendar-picker-indicator{
  position:absolute; inset:0; width:100%; height:100%; opacity:0; cursor:pointer;
}


/* the schedule button that replaced the "rings in…" line */
.daypick-icon{
  position:relative; width:1.9em; height:1.9em; padding:0;
  color:var(--brand);
}
.daypick-icon svg{ display:block; }
.daypick-mark{
  position:absolute; top:-2px; right:-2px; width:7px; height:7px;
  border-radius:50%; background:var(--c-orange);
  box-shadow:0 0 0 2px var(--panel);
}
.daypick-mark[hidden]{ display:none !important; }
.wsheet.t2 .wsheet-h{ justify-content:space-between; }

/* ---- /test2/: the alarm's options, inside the popup under the wheel ---- */
.wsheet-opts{
  display:grid; grid-template-columns:1fr 1fr; gap:.55rem .7rem;
  margin:.7rem 0 .2rem;
}
.wsheet-opts .tp-f{ display:grid; gap:.2rem; min-width:0; }
.wsheet-opts .tp-f .label{ font-size:.62rem; }
.wsheet-opts .field{ width:100%; min-height:38px; font-size:.9rem; }
.wsheet-opts .tp-f-vol{ grid-column:1 / -1; }
.wsheet-opts .tp-f-vol .range{ width:100%; }
.wsheet-opts .tp-f-switch{
  grid-column:1 / -1; display:flex; align-items:center; justify-content:space-between; gap:1rem;
}
/* a taller, wider card now that it carries the whole form */
.wsheet.t2 .wsheet-card{ padding:.35rem 1rem calc(1rem + env(safe-area-inset-bottom)); }
@media (min-width:680px){
  .wsheet.t2 .wsheet-card{ width:min(460px, 94vw); margin-top:-230px; }
}
@media (min-width:940px){
  .wsheet.t2 .wsheet-card{ width:min(520px, 94vw); }
}
/* the page box is now just the alarm list */
.tp-inline-fields:empty{ display:none; }
/* the shared typing field sits over whichever column owns it */
.wp .wp-edit{ transform:translateY(-50%); margin-top:0; z-index:4; }
/* how long snooze lasts — only while snooze is on */
.tp-f-snoozemins[hidden]{ display:none !important; }
.wsheet-opts .tp-f-snoozemins{ grid-column:1 / -1; }
.snoozemins{ display:flex; gap:6px; }
.snoozemins{ flex-wrap:wrap; }
.snoozemin{
  /* "5 min" through "30 min" all spelled out, so they need a little more
     room each and are allowed to wrap onto a second line on a narrow phone
     rather than being squeezed unreadably thin */
  flex:1 1 auto; min-width:0; padding:.34rem .45rem; cursor:pointer;
  border:1px solid var(--line-2); border-radius:8px;
  background:var(--panel); color:var(--ink-2);
  font-family:var(--f-mono); font-size:.74rem; font-weight:700; white-space:nowrap;
}
.snoozemin[aria-checked="true"]{
  border-color:var(--brand); color:var(--brand);
  background:var(--panel);
  background:color-mix(in srgb, var(--brand) 12%, var(--panel));
}
/* the single typing field: invisible, over the band, never moved */
.wp-type{
  position:absolute; left:0; top:50%; z-index:6;
  height:var(--wp-item); margin-top:calc(var(--wp-item) / -2);
  width:100%; padding:0; border:0; outline:none; background:transparent;
  color:transparent; caret-color:transparent; font-size:16px;   /* 16px: no iOS zoom */
  opacity:0; pointer-events:none;
}
.wp.is-typing .wp-type{
  opacity:1;
  /* it has to take the taps: if they fall through to the drum, the column
     takes focus and the field loses it, which closes a phone's keypad */
  pointer-events:auto;
  background:transparent; border:0;
  color:transparent; caret-color:transparent;
}
/* the box that marks the column being typed into */
.wp-typebox{
  position:absolute; left:0; top:50%; z-index:5;
  height:var(--wp-item); margin-top:calc(var(--wp-item) / -2);
  display:none; pointer-events:none;
  border:2px solid #ff8a3d; border-radius:8px;
  background:#ff8a3d;
  background:color-mix(in srgb, #ff8a3d 7%, transparent);
}
.wp.is-typing .wp-typebox{ display:block; }


/* ---- /test2/: play and volume on the ringtone row ---- */
.wsheet-opts .tp-f-tune{ grid-column:1 / -1; }
.wsheet-opts .tp-f-tune .tunerow{ display:flex; gap:8px; align-items:center; }
.wsheet-opts .tp-f-tune .field{ flex:1 1 auto; min-width:0; }
.tuneplay{ flex:0 0 auto; width:38px; height:38px; color:var(--brand); }
.tuneplay.is-playing{ color:#fff; border-color:transparent; background:var(--grad-brand); }
.tuneplay svg[hidden]{ display:none !important; }

/* the volume icon sits beside play; its slider springs out as a tall
   vertical bar so the tune can be heard while it is being set */
.volcell{ position:relative; flex:0 0 auto; }
.volbtn{ width:38px; height:38px; color:var(--brand); display:grid; place-items:center; }
.volbtn[aria-expanded="true"]{
  border-color:var(--brand); background:var(--panel);
  border-color:var(--brand); background:var(--panel); background:color-mix(in srgb, var(--brand) 12%, var(--panel));
}
.volwrap{
  /* Anchored to the button's right edge rather than centred on it, so it
     cannot hang off the side of the card. */
  position:absolute; right:0; bottom:calc(100% + 8px); z-index:40;
  width:58px; height:236px; padding:.8rem 0 .6rem;
  display:none;
  border:1px solid var(--line-2); border-radius:14px;
  background:var(--panel); box-shadow:0 18px 40px -16px rgba(0,0,0,.5);
}
.volwrap.is-open{ display:block; }
/* The slider is rotated, so its layout box stays 180px wide and would
   overflow a 58px panel. It is taken out of the flow and centred by hand
   instead, which is what makes it appear at all. */
.volwrap .range{
  position:absolute; left:50%; top:calc(50% - 10px);
  width:180px; margin:0;
  transform:translate(-50%, -50%) rotate(-90deg);
  transform-origin:center;
}
.volwrap-v{
  position:absolute; left:0; right:0; bottom:.5rem; text-align:center;
  font-size:.72rem; font-weight:700; color:var(--brand);
}
@media (min-width:680px){
  .volwrap{ height:256px; }
  .volwrap .range{ width:200px; }
}

/* ================= /test2/: the options, rearranged ================= */
.wsheet-opts{ grid-template-columns:1fr; gap:.7rem; }

/* Label: the word, then the field, on one row */
.tp-f-label{
  grid-column:1 / -1;
  display:flex !important; align-items:center; gap:.7rem;
}
.tp-f-label .label{ flex:0 0 auto; }
.tp-f-label .field{ flex:1 1 auto; min-width:0; }

/* Ringtone: the box says "Ringtone: <name>", then play, then volume */
.tp-f-tune{ grid-column:1 / -1; }
.selbox{
  flex:1 1 auto; min-width:0; display:flex; align-items:center; gap:.35rem;
  padding:0 .2rem 0 .7rem; min-height:38px;
  border:1px solid var(--line-2); border-radius:10px; background:var(--panel);
}
.selbox-t{ flex:0 0 auto; font-size:.68rem; font-weight:700; letter-spacing:.1em; text-transform:uppercase; color:var(--rail); }
.selbox-s{
  flex:1 1 auto; min-width:0; border:0; background:transparent; color:var(--ink);
  font-family:inherit; font-size:.9rem; font-weight:600; padding:.3rem .2rem;
  -webkit-appearance:none; appearance:none;
}
.selbox-s:focus{ outline:none; }
.selbox:focus-within{ border-color:var(--brand); }

/* Repeat and Snooze share a row */
.tp-f-pair{
  grid-column:1 / -1; display:flex !important; gap:.8rem; align-items:center;
}
.pairbox{ flex:1 1 0; min-width:0; display:flex; align-items:center; justify-content:space-between; gap:.5rem; }
.snoozecell{ display:flex; align-items:center; gap:.4rem; }
.menucell{ position:relative; }
.menucell[hidden]{ display:none !important; }

.chipbtn{
  display:inline-flex; align-items:center; gap:.3rem; cursor:pointer;
  padding:.3rem .5rem; min-height:32px;
  border:1px solid var(--line-2); border-radius:8px;
  background:var(--panel); color:var(--ink);
  font-family:inherit; font-size:.8rem; font-weight:700; white-space:nowrap;
}
.chipbtn[aria-expanded="true"]{ border-color:var(--brand); color:var(--brand); }
.chipbtn svg{ opacity:.6; }
.chipmenu{
  position:fixed; z-index:130; min-width:140px; padding:0;
  border:1px solid var(--line-2); border-radius:6px; overflow:hidden;
  background:var(--panel); box-shadow:0 16px 34px -14px rgba(0,0,0,.5);
}
.chipmenu[hidden]{ display:none !important; }
.chipopt{
  display:block; width:100%; text-align:left; cursor:pointer;
  padding:.5rem .7rem; border:0; border-bottom:1px solid var(--line); border-radius:0;
  background:transparent; color:var(--ink);
  font-family:inherit; font-size:.85rem; font-weight:600;
}
.chipopt:last-child{ border-bottom:0; }
.chipopt:hover, .chipopt:focus-visible{ background:var(--brand); background:color-mix(in srgb, var(--brand) 12%, transparent); }


/* ---- /test2/: the schedule button and its calendar ---- */
.schedbtn{
  display:inline-flex; align-items:center; gap:.4rem; cursor:pointer;
  padding:.28rem .5rem; min-height:32px;
  border:1.5px solid var(--brand); border-radius:9px;
  background:var(--panel);
  background:color-mix(in srgb, var(--brand) 10%, var(--panel));
  color:var(--brand); font-family:inherit; font-size:.78rem; font-weight:700;
  position:relative; white-space:nowrap;
}
.schedbtn:hover{ background:var(--panel); background:color-mix(in srgb, var(--brand) 18%, var(--panel)); }
.schedbtn[aria-expanded="true"]{ background:var(--brand); color:#fff; }
.schedbtn[aria-expanded="true"] .schedic circle[fill]{ fill:var(--brand); }
.schedbtn-t{ display:none; }                 /* phone: the icon alone */
@media (min-width:680px){ .schedbtn-t{ display:inline; } }
.daypick-mark{
  position:absolute; top:-3px; right:-3px; width:8px; height:8px;
  border-radius:50%; background:var(--c-orange); box-shadow:0 0 0 2px var(--panel);
}
.daypick-mark[hidden]{ display:none !important; }

.calpop{
  position:fixed; z-index:130; width:268px; padding:.7rem;
  border:1px solid var(--line-2); border-radius:12px;
  background:var(--panel); box-shadow:0 20px 44px -16px rgba(0,0,0,.55);
}
.calpop[hidden]{ display:none !important; }
.calpop-quick{ display:flex; gap:6px; margin-bottom:.5rem; }
.calpop-quick .chipopt{
  flex:1 1 0; text-align:center; border:1px solid var(--line-2); border-radius:7px;
  padding:.4rem .3rem; font-size:.78rem;
}
.calpop-head{ display:flex; align-items:center; justify-content:space-between; gap:.4rem; margin-bottom:.35rem; }
.calpop-title{ font-size:.84rem; font-weight:700; }
.calnav{ width:28px; height:28px; }
.calpop-dows{ display:grid; grid-template-columns:repeat(7,1fr); gap:2px; margin-bottom:2px; }
.calpop-dows span{ text-align:center; font-size:.62rem; font-weight:700; color:var(--rail); }
.calpop-grid{ display:grid; grid-template-columns:repeat(7,1fr); gap:2px; }
.calday{
  aspect-ratio:1; display:grid; place-items:center; cursor:pointer;
  border:0; border-radius:7px; background:transparent; color:var(--ink);
  font-family:var(--f-mono); font-size:.78rem; font-weight:600;
}
.calday.is-blank{ pointer-events:none; }
.calday.is-past{ color:var(--rail); opacity:.45; cursor:default; }
.calday.is-today{ box-shadow:inset 0 0 0 1.5px var(--line-2); }
.calday:not(.is-past):not(.is-blank):hover{ background:var(--brand); background:color-mix(in srgb, var(--brand) 14%, transparent); }
.calday.is-picked{ background:var(--brand); color:#fff; }

/* ---- the option rows under the switches ---- */
.tp-f-row{ grid-column:1 / -1; display:flex !important; align-items:center; justify-content:space-between; gap:1rem; }
.optrow{ grid-column:1 / -1; display:grid !important; gap:.35rem; }
.optrow[hidden]{ display:none !important; }
.optchips{ display:flex; flex-wrap:wrap; gap:6px; }
.optchip{
  flex:1 1 auto; padding:.34rem .5rem; cursor:pointer;
  border:1px solid var(--line-2); border-radius:8px;
  background:var(--panel); color:var(--ink-2);
  font-family:inherit; font-size:.76rem; font-weight:700; white-space:nowrap;
}
.optchip[aria-checked="true"]{
  border-color:var(--brand); color:var(--brand);
  background:var(--panel);
  background:color-mix(in srgb, var(--brand) 12%, var(--panel));
}
.dowrow{ display:flex; gap:5px; margin-top:.15rem; }
.dowrow[hidden]{ display:none !important; }
.dow{
  flex:1 1 0; aspect-ratio:1; max-width:40px; cursor:pointer;
  border:1px solid var(--line-2); border-radius:50%;
  background:var(--panel); color:var(--ink-2);
  font-family:inherit; font-size:.76rem; font-weight:700;
}
.dow[aria-pressed="true"]{ border-color:transparent; background:var(--grad-brand); color:#fff; }
/* the ringtone box shows its chevron at the end */
.selbox-drop{ padding-right:.6rem; }
.selbox-c{ flex:0 0 auto; opacity:.55; }

/* ---- /test2/: label and ringtone as soft outlined fields ---- */
.selbox{
  display:flex; align-items:center; gap:0; overflow:hidden;
  padding:0; min-height:42px;
  border:1px solid var(--line-2); border-radius:12px;
  background:var(--panel);
}
.selbox-t{
  flex:0 0 auto; align-self:stretch; display:flex; align-items:center;
  padding:0 .8rem; margin:0;
  border-right:1px solid var(--line);
  background:var(--panel-2); color:var(--rail);
  font-size:.66rem; font-weight:800;
  letter-spacing:.11em; text-transform:uppercase; white-space:nowrap;
}
.selbox-s{
  flex:1 1 auto; min-width:0; align-self:stretch;
  margin:0; padding:0 .9rem;
  border:0; border-radius:0;
  background:transparent; color:var(--ink);
  font-family:inherit; font-size:.92rem; font-weight:600;
  -webkit-appearance:none; appearance:none;
}
.selbox-s::placeholder{ color:var(--rail); font-weight:500; }
.selbox-s:focus{ outline:none; }
.selbox:focus-within{ border-color:var(--brand); }
.selbox-drop{ position:relative; }
.selbox-c{ position:absolute; right:.9rem; opacity:.5; pointer-events:none; }
.selbox-drop .selbox-s{ padding-right:2rem; }

/* the current answer, shown once the list folds away */
.valchip{
  margin-left:auto; margin-right:.5rem; cursor:pointer;
  padding:.16rem .5rem; border:1px solid var(--line-2); border-radius:7px;
  background:var(--panel); color:var(--brand);
  font-family:inherit; font-size:.74rem; font-weight:700; white-space:nowrap;
}
.valchip[hidden]{ display:none !important; }
.valchip:hover{ border-color:var(--brand); }

/* the close button that ends day-picking */
.dowdone{
  order:9; margin-left:.35rem; cursor:pointer;
  width:26px; height:26px; display:grid; place-items:center;
  border:1px solid var(--line-2); border-radius:50%;
  background:var(--panel); color:var(--ink-2);
}
.dowdone:hover{ border-color:var(--brand); color:var(--brand); }

/* Repeat and Snooze need air between them, and a rule to show they are two
   separate settings rather than one run-on row. */
.tp-f-pair{ gap:0 !important; }
.tp-f-pair .pairbox{ padding:0 .9rem; }
.tp-f-pair .pairbox:first-child{ padding-left:0; border-right:1px solid var(--line); }
.tp-f-pair .pairbox:last-child{ padding-right:0; }

/* the close button for custom days sits at the far right of the row */
.dowrow{ display:flex; align-items:center; gap:6px; }
.dowdone{ order:99; margin-left:auto; }

/* the chosen date, shown beside the time once the calendar is used */
.wsheet-date{
  margin-left:.5rem; padding:.1rem .45rem;
  border:1px solid var(--line-2); border-radius:6px;
  background:var(--panel-2); color:var(--brand);
  font-size:.68rem; font-weight:700; white-space:nowrap;
}
.wsheet-date[hidden]{ display:none !important; }
/* 12 / 24 hour, in the popup's header */
.fmtpick{
  display:inline-flex; margin-left:.6rem; overflow:hidden;
  border:1px solid var(--line-2); border-radius:8px;
}
.fmtbtn{
  padding:.1rem .45rem; cursor:pointer; border:0; border-radius:0;
  background:var(--panel); color:var(--ink-2);
  font-family:var(--f-mono); font-size:.68rem; font-weight:700; line-height:1.5;
}
.fmtbtn + .fmtbtn{ border-left:1px solid var(--line-2); }
.fmtbtn[aria-checked="true"]{ background:var(--brand); color:#fff; }

/* /test2/: the hour format and the clock face sit on their own row, below
   the top bar and divided from it by a hairline */
.wsheet.t2 .wsheet-h{ padding-bottom:.55rem; border-bottom:1px solid var(--line); }
.pickbar{
  display:flex; align-items:center; justify-content:space-between;
  padding:.55rem .15rem .1rem;
}
.pickbar .fmtpick{ margin-left:0; }
.pickbar .dialbtn{
  display:grid; place-items:center; width:30px; height:26px; cursor:pointer;
  border:1px solid var(--line-2); border-radius:8px;
  background:var(--panel); color:var(--ink-2);
}
.pickbar .dialbtn[aria-pressed="true"]{ border-color:var(--brand); color:var(--brand);
  background:var(--panel); background:color-mix(in srgb, var(--brand) 12%, var(--panel)); }
.wsheet .dialwrap{ display:grid; justify-items:center; gap:.4rem; }
.wsheet .dialwrap[hidden]{ display:none !important; }
.wsheet .dial{ width:min(300px, 78vw); }
.wsheet .dial-readout{ display:flex; align-items:center; gap:.3rem; }
/* `hidden` has to beat the picker's own display rule, or switching to the
   clock face leaves the drums on screen underneath it */
.wp[hidden]{ display:none !important; }

/* with the face showing, the card can outgrow the screen: let it scroll
   rather than run off the bottom */
/* 100vh on a phone is the window, which does not shrink when the keyboard
   appears; dvh is the part actually visible. The vh line stays first as the
   fallback for anything that does not know dvh. */
.wsheet.t2 .wsheet-card{ max-height:calc(100vh - 24px); overflow-y:auto; overscroll-behavior:contain; }
.wsheet.t2 .wsheet-card{ max-height:calc(100dvh - 24px); }
@media (max-width:679px){
  .wsheet.t2 .wsheet-card{ max-height:calc(100vh - 12px); }
  .wsheet.t2 .wsheet-card{ max-height:calc(100dvh - 12px); }
  .wsheet .dial{ width:min(260px, 70vw); }
}

/* ---- /test2/: the card on a desktop ----
   Centred by layout rather than by a transform. A fixed offset cannot know
   how tall the card is, so once the clock face made it taller the card ran
   off the top and bottom. Flex centring with padding keeps it on screen at
   any height, and the extra bottom padding lifts it slightly above centre. */
@media (min-width:680px){
  .wsheet{ display:flex; align-items:center; justify-content:center; padding:16px 16px 7vh; }
  .wsheet.t2 .wsheet-card{
    position:relative; left:auto; right:auto; top:auto; bottom:auto; margin:0;
    width:min(600px, 94vw);
    max-height:calc(100vh - 32px - 7vh);
    max-height:calc(100dvh - 32px - 7dvh);
    overflow-y:auto; overscroll-behavior:contain;
    transform:translateY(12px); opacity:0;
  }
  .wsheet.t2.is-open .wsheet-card{ transform:none; opacity:1; }
  .wsheet .dial{ width:min(300px, 46vh); }
}
/* the preview button while it is playing */
.al-test.is-playing{ color:#fff; border-color:transparent; background:var(--grad-brand); }
.al-test svg[hidden]{ display:none !important; }
/* the typing box shows the digits entered so far, unpadded */
.wp-typebox{
  display:none; place-items:center;
  font-family:var(--f-mono); font-size:1.15rem; font-weight:700;
  color:#ff8a3d; line-height:1;
}
.wp.is-typing .wp-typebox{ display:grid; }
.wp-typebox.has-text{ background:var(--panel); }

/* ---- the calendar's month and year drums ---- */
.calpop-title{
  display:inline-flex; align-items:center; gap:.3rem; cursor:pointer;
  padding:.15rem .45rem; border:1px solid transparent; border-radius:7px;
  background:transparent; color:inherit; font:inherit; font-weight:700;
}
.calpop-title:hover{ border-color:var(--line-2); }
.calpop-title[aria-expanded="true"]{ border-color:var(--brand); color:var(--brand); }
.calpop-title svg{ opacity:.6; }
.calpop-my[hidden]{ display:none !important; }
.calpop-my{ padding-top:.2rem; }
.wp-my{ --wp-item:34px; --wp-rows:5; --wp-persp:300px; }
.wp-my .wp-item{ font-size:1rem; }
.wp-my .wp-mount{ flex:1 1 0; max-width:120px; }
.calpop-myf{ display:flex; justify-content:space-between; gap:8px; margin-top:.5rem; }
.calpop-myf .btn{ flex:1 1 0; justify-content:center; }
/* `hidden` must beat these elements' own display rules, or the day grid stays
   on screen underneath the month and year drums */
.calpop-grid[hidden], .calpop-dows[hidden], .calnav[hidden]{ display:none !important; }
/* the calendar's month-and-year actions, as icons */
.calpop-myf{ display:flex; justify-content:space-between; gap:10px; margin-top:.5rem; }
.myicon{ width:40px; height:34px; display:grid; place-items:center; }
.myicon.is-go{ color:#fff; border-color:transparent; background:var(--grad-go, var(--grad-brand)); }

/* ---- the clock is clickable: it lifts a little under the pointer ---- */
#sAnalog, #sTime{
  cursor:pointer;
  transition:transform .18s cubic-bezier(.2,.8,.25,1), filter .18s ease;
  transform-origin:center;
}
#sAnalog:hover, #sTime:hover{ transform:scale(1.035); }
#sAnalog:active, #sTime:active{ transform:scale(.995); }
/* a keyboard user gets the same affordance */
#sAnalog:focus-visible, #sTime:focus-visible{
  outline:2px solid var(--brand); outline-offset:6px; border-radius:12px;
}
@media (hover:none){
  /* nothing to hover on a touch screen; the tap still works */
  #sAnalog:hover, #sTime:hover{ transform:none; }
}
@media (prefers-reduced-motion: reduce){
  #sAnalog, #sTime{ transition:none; }
  #sAnalog:hover, #sTime:hover{ transform:none; }
}

/* ================= the Set Countdown panel ================= */
.cdsheet .wsheet-card{ width:min(560px, 94vw); }
.cdmodes{ gap:8px; }
.cdmodes .fmtbtn{ flex:1 1 0; padding:.4rem .6rem; font-size:.8rem; border-radius:8px; }
.cdmodes{ display:flex; }
.cdmodes .cdmode{ border:1px solid var(--line-2); }
.cdmodes .cdmode[aria-checked="true"]{ background:var(--brand); color:#fff; border-color:var(--brand); }
.cdpane[hidden]{ display:none !important; }
.cdcal{ padding:.2rem 0 .4rem; }
.cdsub{ text-align:center; margin:.6rem 0 .2rem; }
.cddur .wp-mount{ flex:1 1 0; max-width:none; }
.cddur-labels{
  /* the same width as the drums above them, or the four names spread across
     the whole card and stop lining up with their columns */
  display:flex; margin:.2rem auto 0;
  width:min(320px, 100%); padding:0 .35rem;
  font-size:.62rem; font-weight:700; letter-spacing:.1em;
  text-transform:uppercase; color:var(--rail);
}
.cddur-labels span{ flex:1 1 0; text-align:center; }
.cdsheet .wsheet-time{ font-size:1rem; }
#cdSheetGo[disabled]{ opacity:.45; cursor:not-allowed; }
/* the countdown's calendar is in a much wider card than the alarm's popup,
   so its cells would stretch into big squares without a size of their own */
.cdcal .calpop-grid, .cdcal .calpop-dows{
  max-width:340px; margin-inline:auto;
}
.cdcal .calpop-grid{ gap:2px; }
.cdcal .calday{ height:34px; min-width:0; font-size:.85rem; }
.cdcal .calpop-head{ max-width:340px; margin-inline:auto; }
.cdsheet .wp-sm{ --wp-item:34px; --wp-rows:5; }
.cdsheet #cdTimePicker{ width:min(300px,100%); margin-inline:auto; }

/* ---- the countdown's title and its lines ---- */
.cd-title{
  font-size:var(--step-1); font-weight:800; letter-spacing:-.01em;
  margin:0 0 .2rem; text-align:center;
}
.cd-lines{ display:grid; gap:.15rem; margin:0 0 .3rem; text-align:center; }
.cd-lines[hidden]{ display:none !important; }
.cd-lines span{ font-size:.92rem; color:var(--ink-2); }

/* in the panel: the title reads larger than the notes below it */
.cd-titlein{ font-size:1.05rem !important; font-weight:700 !important; }
.cd-lines-edit{ display:grid; gap:.45rem; }
.cd-linerow{ position:relative; }
.cd-linerow .selbox-s{ padding-right:2.2rem; }
.cd-delline{
  position:absolute; right:.45rem; top:50%; transform:translateY(-50%);
  width:24px; height:24px; display:grid; place-items:center; cursor:pointer;
  border:0; border-radius:50%; background:transparent; color:var(--rail);
}
.cd-delline:hover{ color:var(--c-red, #e5484d); background:var(--panel-2); }
.cd-delline[hidden]{ display:none !important; }
.cd-addrow{ display:flex; }
.cd-addline{ display:inline-flex; align-items:center; gap:.35rem; }
.cd-addline[hidden]{ display:none !important; }
/* "At what time", with the hour format beside it */
.cdtimebar{
  display:flex; align-items:center; justify-content:center; gap:.7rem;
  margin:.7rem 0 .2rem;
}
.cdtimebar .cdsub{ margin:0; }
.cdtimebar .fmtpick{ margin-left:0; }

/* ---- the countdown's four figures ----
   They stay side by side at every width. The shared .g-4 grid stacked them
   into a column on a phone, which is not what a countdown should look like:
   days, hours, minutes and seconds belong on one line. */
.cd-figures{
  display:grid; grid-template-columns:repeat(4, minmax(0, 1fr));
  gap:10px; max-width:780px; margin:0 auto;
}
/* only the figures themselves are clickable — not the gaps between them, and
   not the rest of the stage */
.cd-figures .panel{
  padding:1rem .5rem; cursor:pointer;
  transition:transform .18s cubic-bezier(.2,.8,.25,1);
}
.cd-figures .panel:hover{ transform:translateY(-2px); }
@media (hover:none){ .cd-figures .panel:hover{ transform:none; } }
@media (prefers-reduced-motion: reduce){
  .cd-figures .panel{ transition:none; }
  .cd-figures .panel:hover{ transform:none; }
}
@media (max-width:620px){
  .cd-figures{ gap:6px; }
  .cd-figures .panel{ padding:.7rem .25rem; }
  .cd-figures .readout-md{ font-size:clamp(1.5rem, 9vw, 2.4rem); }
  .cd-figures .label{ font-size:.58rem; letter-spacing:.06em; }
}
@media (max-width:380px){
  .cd-figures{ gap:4px; }
  .cd-figures .panel{ padding:.6rem .15rem; }
}

/* ---- full screen: the clock and nothing else ----
   Every control is hidden once the stage fills the screen, so what is left is
   only the thing being shown. Escape leaves full screen, as it always does. */
.studio-stage:fullscreen .studio-tools,
.studio-stage:fullscreen .studio-panel,
.studio-stage:fullscreen .setpanel,
.studio-stage:fullscreen .studio-foot,
.studio-stage:fullscreen .btn-row,
.studio-stage:fullscreen .viewrow,
.studio-stage:fullscreen .fmtrow,

.studio-stage:fullscreen .studio-settings,
.studio-stage:fullscreen .cd-figures + *,
.studio-stage:fullscreen button,
.studio-stage:fullscreen .btn{
  display:none !important;
}
/* except the few that belong there */
.studio-stage:fullscreen .fsbar{ display:flex !important; }
.studio-stage:fullscreen .fsbar button{ display:grid !important; }
/* the figures themselves are not buttons, and the countdown needs them */
.studio-stage:fullscreen .cd-figures,
.studio-stage:fullscreen .cd-figures .panel{ display:grid !important; }
.studio-stage:fullscreen .cd-figures .panel{ cursor:default; }
.studio-stage:fullscreen .cd-figures .panel:hover{ transform:none; }

/* the full-screen control bar: only there in full screen, and out of the way */
.fsbar{
  display:none; align-items:center; gap:6px;
  position:absolute; top:16px; right:16px; z-index:20;
  padding:6px; border-radius:12px;
  background:var(--panel);
  background:color-mix(in srgb, var(--panel) 80%, transparent);
  border:1px solid var(--line-2);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter:blur(8px); -webkit-backdrop-filter:blur(8px);
  opacity:.35; transition:opacity .2s ease;
}
.fsbar:hover, .fsbar:focus-within{ opacity:1; }
.studio-stage:not([data-bg="none"]) .fsbar{
  background:rgba(10,14,22,.5); border-color:rgba(255,255,255,.2); color:#fff;
}
@media (hover:none){ .fsbar{ opacity:.8; } }
/* the homepage timer's readout opens the panel, like the countdown figures */
#tDisplay{ cursor:pointer; }
/* the homepage timer's presets, centred with its buttons */
.presets-center{ justify-content:center; }

/* ================= older Safari =================
   color-mix() needs Safari 16.2 (December 2022). Below that every value using
   it is invalid, so the property falls back to whatever came before — which
   for text means inheriting, and for backgrounds means transparent. The
   eleven text colours are the ones that would actually break something, so
   they get a plain colour underneath. */
@supports not (color: color-mix(in srgb, red 50%, blue)){
  .fbar-chip, .valchip, .chipbtn[aria-expanded="true"],
  .optchip[aria-pressed="true"], .dow[aria-pressed="true"],
  .snoozemin[aria-checked="true"], .daypick-btn[aria-expanded="true"],
  .calpop-title[aria-expanded="true"], .fmtbtn[aria-checked="true"],
  .dialbtn[aria-pressed="true"], .volbtn[aria-expanded="true"]{
    color:var(--brand);
    background:var(--panel-2);
    border-color:var(--brand);
  }
  .fmtbtn[aria-checked="true"], .cdmode[aria-checked="true"],
  .dow[aria-pressed="true"]{ color:#fff; background:var(--brand); }
  .chipopt:hover, .daypick-opt:hover, .calday:hover{ background:var(--panel-2); }
  .wp-typebox{ background:var(--panel); }
  .fsbar{ background:var(--panel); }
}

/* ---- /timer/: the stage runs the full width, settings beneath it ---- */
.timer-wrap{ display:grid; gap:1rem; }
.timer-stage{ width:100%; }
.timer-wrap > .panel{ max-width:none; }
#tDisplay{ cursor:pointer; }
/* the Set Timer panel's three drums */
.cddur-3{ width:min(300px, 100%); }
#tmDurPicker{ width:min(300px, 100%); margin-inline:auto; }
#tmQuick{ margin-top:.3rem; }
#tmGo[disabled]{ opacity:.45; cursor:not-allowed; }

/* the timer's note, a size down from its title */
#tmNotes{ font-size:.95rem; color:var(--ink-2); }
/* ---- the time box on iOS ----
   A plain box you type two digits into. It sits over the column being set,
   outside the picker's 3D context, and it moves across when the other column
   is tapped rather than jumping there by itself. The field underneath is a
   real input at full opacity — Safari will not raise a keypad for one it
   treats as hidden — while the digits are drawn over it so the rule standing
   in for the missing digit can be shown: 1_ */
.oc-type{ position:fixed; z-index:120; }
.oc-type[hidden]{ display:none; }
.oc-type input{
  position:absolute; inset:0; width:100%; height:100%;
  margin:0; padding:0;
  -webkit-appearance:none; appearance:none;
  border:2px solid var(--wp-typed, #ff8a3d); border-radius:12px;
  background:var(--panel);
  font-size:16px;                    /* 16px or more, or Safari zooms the page */
  color:transparent; caret-color:transparent;
  text-align:center;
}
.oc-type input:focus{ outline:none; box-shadow:0 0 0 3px rgba(249,115,22,.22); }
.oc-type-txt{
  position:absolute; inset:0; display:flex; align-items:center; justify-content:center;
  font-family:var(--f-mono); font-weight:700; font-size:1.35rem; letter-spacing:.02em;
  color:var(--wp-typed, #ff8a3d);
  pointer-events:none;
}
.oc-type-txt.is-hint{ color:var(--ink-2); opacity:.5; }

/* the picker's own field and box stand down where the one above is in use */
.wp.is-ios .wp-type,
.wp.is-ios .wp-typebox{ display:none !important; }

/* ------------------------------------------------------------------
   Masthead on a narrow phone
   The tools row would not give way below about 360px, so the header ran
   past the right edge and the menu button sat off screen entirely —
   unreachable without scrolling the page sideways.
   ------------------------------------------------------------------ */
@media (max-width:420px){
  .masthead-in{ padding-inline:.65rem; gap:.4rem; }
  .brand{ min-width:0; flex:0 1 auto; overflow:hidden; }
  .brand-name{ font-size:.9rem; letter-spacing:-.2px; white-space:nowrap; }
  .mast-tools{ gap:.28rem; min-width:0; flex:0 0 auto; }
  .mast-tools .btn-icon{ flex:0 0 auto; }
  .mast-tools .chip{ display:none; }          /* the mini clock, already hidden lower down */
}
@media (max-width:360px){

  .mast-tools .searchtoggle{ display:none; }  /* search lives in the drawer too */
}

/* ==================================================================
   LED readout — the "LED" clock font (OC Segment)
   Flat LED red on the dial instead of the clipped gradient the other faces
   use, with the colon, seconds and AM/PM in the same ink, and AM/PM sitting
   on the baseline the way a bedside clock prints it. The accent swatches set
   --seg-ink, so the LEDs can be recoloured.
   ================================================================== */
.studio{ --seg-ink:#e3002b; }
.studio[data-font="seg"] .studio-stage .studio-clock .readout{
  font-family:"OC Segment","IBM Plex Mono",ui-monospace,monospace;
  background:none;
  -webkit-text-fill-color:var(--seg-ink); color:var(--seg-ink);
  font-weight:400; letter-spacing:0; line-height:1;
  font-variant-numeric:normal; font-feature-settings:normal;
}
.studio[data-font="seg"] .studio-stage .studio-clock .readout .sep,
.studio[data-font="seg"] .studio-stage .studio-clock .readout .secs,
.studio[data-font="seg"] .studio-stage .studio-clock .readout .ampm,
.studio[data-font="seg"] .studio-stage .studio-clock .readout .ms{
  -webkit-text-fill-color:var(--seg-ink); color:var(--seg-ink);
  opacity:1; font-weight:400; letter-spacing:0;
}
.studio[data-font="seg"] .studio-stage .studio-clock .readout .ampm{
  font-size:.41em; vertical-align:baseline; margin-left:.1em;
}
.studio[data-font="seg"] .studio-stage .studio-clock .readout .ms{ font-size:.41em; margin-left:.04em; }
.fontchip[data-font="seg"] .fc-demo{ color:#e3002b; font-weight:400; }
/* Seven segments are narrower than a mono face, so the LED readout runs a
   size larger to keep the same presence on the dial. */
.studio[data-font="seg"] .sc-digital .readout{ font-size:clamp(2.9rem, 10.5vw, 6.9rem); }
/* In the dark theme the empty stage goes nearly black, like the face of an
   LED clock, so the digits are the only light in it. */
[data-theme="dark"] .studio-stage[data-bg="none"]{ background:linear-gradient(160deg,#08090b,#020203); }
@media (max-width:760px){
  .studio[data-font="seg"] .sc-digital .readout{ font-size:min(14vw, 4.4rem); }
}
/* Homepage: the heading block now follows the clock rather than leading it. */
.studio-head-after{ margin-top:clamp(1.8rem, 4vw, 2.8rem); }
#clock > .shell-wide > .studio{ margin-top:.4rem; }

/* ==================================================================
   LED analog face — with the LED font, the classic dial is drawn in the
   same red as the digits: ring, ticks, numerals, hands and seconds.
   ================================================================== */
.studio[data-font="seg"] .studio-stage .sc-analog.face-classic{ color:var(--seg-ink); }
.studio[data-font="seg"] .studio-stage .sc-analog.face-classic .f-dial{ stroke:var(--seg-ink); }
.studio[data-font="seg"] .studio-stage .sc-analog.face-classic .f-sec line{ stroke:var(--seg-ink); }
.studio[data-font="seg"] .studio-stage .sc-analog.face-classic .f-sec circle,
.studio[data-font="seg"] .studio-stage .sc-analog.face-classic .f-cap{ fill:var(--seg-ink); }

/* ==================================================================
   Homepage hero clock — the clock is the page. No card: no frame, no
   rounded corners, no shadow, no gutters. The toolbar sits directly
   under the navigation rule and the stage fills the first screen.
   ================================================================== */
.clock-hero{ padding-top:0; border-top:0; }
.clock-hero > .shell-wide{ max-width:none; padding:0; }
.clock-hero .studio{
  border:0; border-radius:0; box-shadow:none; background:transparent;
  margin-top:0; overflow:visible;
}
.clock-hero #studio{ margin-top:0; }
.clock-hero .studio-bar{
  border-bottom:0; background:transparent;
  padding:.55rem clamp(.75rem, 2vw, 1.25rem);
}
.clock-hero .setline{ border-radius:0; }
.clock-hero .studio-stage{ border-radius:0; }
/* "Your alarms" keeps a gutter, so its frame does not sit on the screen edge */
.clock-hero .studio-alarms{ margin:0 auto; width:calc(100% - 2 * clamp(1rem,3vw,2rem)); max-width:1180px; }
.clock-hero .studio-head .studio-links{ margin-top:1.1rem; }

/* Digital on its own: as large as the screen allows. */
/* Sized so that 100% on the size control is what 60% used to be. */
.clock-hero .studio[data-view="digital"] .sc-digital .readout{ font-size:min(9vw, 18vh, 12rem); }
.clock-hero .studio[data-font="seg"][data-view="digital"] .sc-digital .readout{
  font-size:min(10.2vw, 18vh, 13.2rem);
  font-size:min(10.2vw, 18svh, 13.2rem);
}
.clock-hero .studio[data-view="digital"] .sc-meta{ font-size:clamp(.86rem, 1.3vw, 1.05rem); }
.clock-hero .studio[data-view="digital"] .secrail{ max-width:min(92vw, 1100px); margin-inline:auto; }
/* Analog on its own: a big dial. */
.clock-hero .studio[data-view="analog"] .sc-analog{ width:min(47vw, 37vh, 360px); }
@media (max-width:760px){
  .clock-hero .studio[data-font="seg"][data-view="digital"] .sc-digital .readout{ font-size:min(14vw, 18svh); }
}
/* The date line is a <p>, so it picked up the 74ch paragraph cap and sat
   left of centre once the clock grew wider than that. */
.sc-meta{ max-width:none; margin-inline:auto; }
/* With no backdrop chosen, the hero stage is the page itself — no panel
   edge where the stage ends. */
.clock-hero .studio-stage[data-bg="none"]{ background:transparent; }
/* "Copy time" is a <button> among links and was rendering a size larger. */
.studio-head .studio-links .btn{ font-size:.82rem; }

/* Native dropdown lists. A select with a transparent background hands the
   popup no background of its own, so Windows drew it white while the text
   kept the pale dark-theme ink — the ringtone list was unreadable. The
   options now carry both colours explicitly. */
select option, select optgroup{ background-color:var(--panel); color:var(--ink); }
select option:checked{ background-color:var(--panel-3); color:var(--ink); }
select option:disabled{ color:var(--rail); }

/* ==================================================================
   Set Alarm under the clock — calm, not a beacon. The bright
   rose-to-orange gradient and its glow were the most intense thing on a
   black page; it is now a dark red tint with a thin red outline and soft
   red text, in the clock's own red (it follows the accent like the LEDs).
   ================================================================== */
.studio .sc-cta .btn.btn-stop{
  background:rgba(227,0,43,.12);
  background:color-mix(in srgb, var(--seg-ink, #e3002b) 12%, transparent);
  border:1px solid rgba(227,0,43,.42);
  border-color:color-mix(in srgb, var(--seg-ink, #e3002b) 42%, transparent);
  color:#e8606e;
  color:color-mix(in srgb, var(--seg-ink, #e3002b) 72%, #ffffff);
  box-shadow:none; filter:none;
  font-weight:600; letter-spacing:.01em;
  transition:background-color .15s ease, border-color .15s ease, color .15s ease;
}
.studio .sc-cta .btn.btn-stop:hover,
.studio .sc-cta .btn.btn-stop:focus-visible{
  background:rgba(227,0,43,.2);
  background:color-mix(in srgb, var(--seg-ink, #e3002b) 20%, transparent);
  border-color:rgba(227,0,43,.65);
  border-color:color-mix(in srgb, var(--seg-ink, #e3002b) 65%, transparent);
  color:#f07c88;
  color:color-mix(in srgb, var(--seg-ink, #e3002b) 62%, #ffffff);
  filter:none;
}
[data-theme="light"] .studio .sc-cta .btn.btn-stop{
  background:rgba(227,0,43,.07);
  background:color-mix(in srgb, var(--seg-ink, #e3002b) 7%, transparent);
  color:#b0001f;
  color:color-mix(in srgb, var(--seg-ink, #e3002b) 80%, #000000);
}
[data-theme="light"] .studio .sc-cta .btn.btn-stop:hover{
  background:color-mix(in srgb, var(--seg-ink, #e3002b) 12%, transparent);
  color:color-mix(in srgb, var(--seg-ink, #e3002b) 85%, #000000);
}
/* on a moving backdrop the tint alone would vanish, so it gets a dark glass */
.studio-stage:not([data-bg="none"]) .sc-cta .btn.btn-stop{
  background:rgba(10,4,6,.55); -webkit-backdrop-filter:blur(6px); backdrop-filter:blur(6px);
  color:#f2a0a9;
}

/* ==================================================================
   LED everywhere — every clock, timer and counter readout on the site
   uses the red seven-segment face, and every analog dial is drawn in the
   same red, matching the homepage clock. The clock studios (home, alarm,
   timer, stopwatch, countdown) keep following their own font picker, so
   these rules leave readouts inside .studio alone.
   ================================================================== */
:root{ --led-ink:#e3002b; }

[data-theme] .readout:not(.studio .readout):not(.readout-words){
  font-family:"OC Segment","IBM Plex Mono",ui-monospace,monospace;
  font-weight:400; letter-spacing:0; line-height:1;
  font-variant-numeric:normal; font-feature-settings:normal;
  background:none;
  -webkit-text-fill-color:var(--led-ink); color:var(--led-ink);
}
[data-theme] .readout:not(.studio .readout):not(.readout-words) *{
  -webkit-text-fill-color:var(--led-ink); color:var(--led-ink);
  font-weight:400; letter-spacing:0; opacity:1;
}
[data-theme] .readout:not(.studio .readout):not(.readout-words) .ampm{
  font-size:.41em; vertical-align:baseline; margin-left:.1em;
}

/* analog dials outside the studio: the shared face (world clock cards,
   homepage city cards) and the big dial on /analog-clock/ */
svg.analog{ color:var(--led-ink); --signal:var(--led-ink); }
.face-card .dialwrap{ color:var(--led-ink); }
#dialBox{ color:var(--led-ink); --signal:var(--led-ink); }
/* the time under each city dial (world clock sets its colour inline) */
[data-face-time]{ color:var(--led-ink) !important; }

/* the little clock in the header, on every page */
[data-miniclock]{
  font-family:"OC Segment","IBM Plex Mono",ui-monospace,monospace;
  font-size:1rem; font-weight:400; letter-spacing:.02em;
  color:var(--led-ink); -webkit-text-fill-color:var(--led-ink);
  background:rgba(227,0,43,.1); background:color-mix(in srgb, var(--led-ink) 10%, transparent);
  border-color:rgba(227,0,43,.3); border-color:color-mix(in srgb, var(--led-ink) 30%, transparent);
}
[data-theme="light"] [data-miniclock]{ color:#c4001f; -webkit-text-fill-color:#c4001f; }

/* Red action buttons everywhere get the same calm treatment as Set Alarm
   under the clock: a dark red tint, thin outline, soft red text, no glow. */
[data-theme] .btn.btn-stop{
  background:rgba(227,0,43,.12);
  background:color-mix(in srgb, var(--led-ink) 12%, transparent);
  border:1px solid rgba(227,0,43,.42);
  border-color:color-mix(in srgb, var(--led-ink) 42%, transparent);
  color:#e8606e; color:color-mix(in srgb, var(--led-ink) 72%, #ffffff);
  box-shadow:none; filter:none;
}
[data-theme] .btn.btn-stop:hover,
[data-theme] .btn.btn-stop:focus-visible{
  background:rgba(227,0,43,.2);
  background:color-mix(in srgb, var(--led-ink) 20%, transparent);
  border-color:color-mix(in srgb, var(--led-ink) 65%, transparent);
  color:#f07c88; color:color-mix(in srgb, var(--led-ink) 62%, #ffffff);
  filter:none;
}
[data-theme="light"] .btn.btn-stop{
  background:color-mix(in srgb, var(--led-ink) 7%, transparent);
  color:#b0001f; color:color-mix(in srgb, var(--led-ink) 80%, #000000);
}
[data-theme="light"] .btn.btn-stop:hover{
  background:color-mix(in srgb, var(--led-ink) 12%, transparent);
  color:color-mix(in srgb, var(--led-ink) 85%, #000000);
}

/* ==================================================================
   Quick alarm under the clock: hour : minute, then Set Alarm. No panel.
   ================================================================== */
.sc-cta{ flex-direction:column; align-items:center; }
.quickalarm{
  display:flex; align-items:center; justify-content:center;
  gap:.45rem; flex-wrap:wrap; margin:0;
}
.qa-select{
  -webkit-appearance:none; appearance:none;
  font-family:var(--f-mono); font-size:1rem; font-weight:600; line-height:1.2;
  color:var(--ink); background-color:var(--panel-2);
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%237b848f' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat:no-repeat; background-position:right .75rem center; background-size:10px 6px;
  border:1px solid var(--line-2); border-radius:10px;
  min-height:48px; padding:.55rem 2.1rem .55rem .9rem;
  cursor:pointer; transition:border-color .15s ease, background-color .15s ease;
}
.qa-hour{ min-width:7.4rem; }
.qa-min{ min-width:5.2rem; }
.qa-select:hover{ border-color:color-mix(in srgb, var(--led-ink) 45%, var(--line-2)); }
.qa-select:focus-visible{ outline:none; border-color:color-mix(in srgb, var(--led-ink) 65%, transparent); }
.qa-colon{
  font-family:"OC Segment","IBM Plex Mono",monospace; font-size:1.5rem; line-height:1;
  color:var(--led-ink);
}
.quickalarm .qa-set{ margin-left:.35rem; min-height:48px; }
.qa-status{
  margin:.75rem 0 0; max-width:none; font-size:.88rem; color:var(--ink-2);
}
.qa-status[hidden]{ display:none; }
.studio-stage:not([data-bg="none"]) .qa-status{ color:rgba(255,255,255,.82); }
@media (max-width:420px){
  .qa-hour{ min-width:6.6rem; } .qa-min{ min-width:4.6rem; }
  .quickalarm .qa-set{ margin-left:0; }
}

/* ==================================================================
   Logo — a small live analog clock. A dark face inside a slowly turning
   colour ring; the hands show the visitor's real time and the red second
   hand ticks with a little spring. The wordmark reads ONLINE CLOCK.
   ================================================================== */
.brand-mark.is-live{
  border:0; background:none; box-shadow:0 6px 18px -8px rgba(168,85,247,.65);
  position:relative; display:grid; place-items:center; overflow:hidden;
}
.brand-mark.is-live::after{ display:none; }
.brand-mark.is-live::before{
  content:""; position:absolute; inset:0; left:0; top:0; width:100%; height:100%;
  margin:0; border-radius:50%; transform-origin:50% 50%; transform:none;
  background:conic-gradient(from 0deg, #6366f1, #a855f7, #ec4899, #f97316, #f59e0b, #6366f1);
  animation:lc-ring 12s linear infinite;
}
@keyframes lc-ring{ to{ transform:rotate(360deg); } }
.brand-mark.is-live .lc{ position:relative; z-index:1; width:100%; height:100%; display:block; }
/* The face is the opposite of the page so the dial always stands out:
   a white face with dark hands on the dark theme, a dark face with white
   hands on the light theme. The second hand stays red on both. */
.brand-mark.is-live{ --lc-face:#f7f8fb; --lc-ink:#10131a; --lc-sec:#e3002b; }
[data-theme="light"] .brand-mark.is-live{ --lc-face:#10131a; --lc-ink:#f4f5f8; --lc-sec:#ff2d4b; }
.lc-face{ fill:var(--lc-face); }
.lc-tick{ fill:var(--lc-ink); opacity:.6; }
.lc-h, .lc-m, .lc-s{ stroke-linecap:round; transform-origin:16px 16px; }
.lc-h{ stroke:var(--lc-ink); stroke-width:2.5; }
.lc-m{ stroke:var(--lc-ink); stroke-width:1.8; }
.lc-s{ stroke:var(--lc-sec); stroke-width:1.1; }
.lc-hub{ fill:var(--lc-sec); stroke:var(--lc-ink); stroke-width:.9; }
.lc.is-running .lc-s{ transition:transform .34s cubic-bezier(.34,1.56,.64,1); }
.lc.is-running .lc-m, .lc.is-running .lc-h{ transition:transform .6s ease; }
.brand:hover .brand-mark.is-live::before{ animation-duration:3s; }

.brand-name .b-word{
  background:var(--grad-warm);
  -webkit-background-clip:text; background-clip:text;
  -webkit-text-fill-color:transparent; color:transparent;
}

/* ==================================================================
   Your alarms, under the hero clock: close to the clock, and foldable.
   Once there are alarms the stage stops filling the screen, so the list
   sits just below the Set Alarm row instead of a screen further down.
   ================================================================== */
/* The hero is exactly one screen. Toolbar, clock and — once there are
   alarms — the alarm box together fill the window under the header, so the
   heading and everything after it start below the fold, alarms or not.
   --mast-h is the header's height, measured by site.js. */
.clock-hero > .shell-wide{
  display:flex; flex-direction:column;
  min-height:calc(100vh - var(--mast-h, 63px));
  min-height:calc(100svh - var(--mast-h, 63px));
}
.clock-hero .studio{ flex:1 0 auto; display:flex; flex-direction:column; }
.clock-hero .studio-stage{ flex:1 0 auto; min-height:300px; }
.clock-hero .studio-alarms{ flex:0 0 auto; margin-top:.4rem; margin-bottom:clamp(.75rem, 2vh, 1.25rem); }
.studio-alarms-h{ position:relative; padding-right:2.8rem; }
.sa-min{
  position:absolute; top:-.2rem; right:-.2rem;
  display:inline-grid; place-items:center; width:32px; height:32px;
  border:1px solid var(--line-2); border-radius:9px;
  background:var(--panel-2); color:var(--ink-2); cursor:pointer;
  transition:border-color .15s ease, color .15s ease;
}
.sa-min:hover, .sa-min:focus-visible{ border-color:var(--brand); color:var(--ink); outline:none; }
.sa-min .ic-max{ display:none; }
.studio-alarms.is-min .sa-min .ic-min{ display:none; }
.studio-alarms.is-min .sa-min .ic-max{ display:block; }
.studio-alarms.is-min .alarmlist,
.studio-alarms.is-min .addmore{ display:none; }
.studio-alarms.is-min .studio-alarms-h{ margin-bottom:0; }
.studio-alarms.is-min{ padding-bottom:1rem; }
/* with the alarm box in the same screen, the stage gives up some padding so
   both fit on a laptop-height window */
.clock-hero:has(#studioAlarms:not([hidden])) .studio-stage{ padding-block:1rem .5rem; }
/* dark theme: a thin white outline round the logo clock, so its edge reads
   crisply against the black header */
[data-theme="dark"] .brand-mark.is-live{
  box-shadow:0 0 0 1.5px #ffffff, 0 6px 18px -8px rgba(168,85,247,.65);
}

/* "Keep this site open" note in the alarm lists, with the calendar export */
.alarm-keepnote{
  margin:.35rem 0 0; max-width:none; font-size:.82rem; line-height:1.45; color:var(--ink-2);
}
.linkbtn{
  appearance:none; background:none; border:0; padding:0; font:inherit; cursor:pointer;
  color:var(--led-ink); color:color-mix(in srgb, var(--led-ink) 72%, var(--ink));
  text-decoration:underline; text-underline-offset:2px;
}
.linkbtn:hover, .linkbtn:focus-visible{ color:var(--ink); outline:none; }
.studio-alarms.is-min .alarm-keepnote{ display:none; }

/* ==================================================================
   Minute timers (/timer/1-minutes/ … /timer/59-minutes/): the "every
   length" grid and the list of uses.
   ================================================================== */
.mt-grid{
  display:grid; gap:.45rem;
  grid-template-columns:repeat(auto-fill, minmax(3.4rem, 1fr));
}
.mt-link{
  display:grid; place-items:center; min-height:2.6rem;
  border:1px solid var(--line-2); border-radius:10px; background:var(--panel-2);
  color:var(--ink); font-family:var(--f-mono); font-weight:600; font-size:.95rem;
  text-decoration:none; transition:border-color .15s ease, color .15s ease;
}
.mt-link:hover, .mt-link:focus-visible{
  border-color:color-mix(in srgb, var(--led-ink) 55%, var(--line-2)); color:var(--led-ink); outline:none;
}
.mt-link.is-here{
  border-color:color-mix(in srgb, var(--led-ink) 60%, transparent);
  background:color-mix(in srgb, var(--led-ink) 12%, transparent);
  color:var(--led-ink);
}
.mt-uses{ margin:0; padding-left:1.15rem; display:grid; gap:.45rem; color:var(--ink-2); }
.mt-uses li::marker{ color:var(--led-ink); }
