/* THE DOOR: the facts page (/start), and later the hour and settle pages.
   Linked from start.html only, through base.html's head_extra block.

   OWN NAMES ONLY (ruling P2). Every class this sheet styles carries the
   dr- prefix, so none can collide with components.css, app.css or
   landing.css; test_landing.py and test_door.py hold it. No gold: the
   ring's lit beads are ink, its track the line colour (spec 8.5; the
   door pages use the live light tokens, R4). No rule is reached by a
   style= attribute (CSP), and every duration is a --dur-* token.

   ── THE RING AS PROGRESS, WITHOUT SCRIPT (ruling D2) ─────────────────
   The ring sits inside form.dr-door, after the three fields, and lights a
   third of its 27 beads per fact through :has():
     place  #place:valid (required, so valid only once something is typed)
     date   #date:valid  (required, so valid only once a full date is set)
     time   NOT #time:valid. The time is optional, and an EMPTY optional
            input matches :valid, so `:has(#time:valid)` would be true from
            the first paint. :placeholder-shown cannot rescue it either: a
            type=time input takes no placeholder, so it never matches and
            `:not(:placeholder-shown)` is always true. CSS has no way to
            see whether an optional time input holds a value.
            The third step therefore keys on the certainty chips:
            `:has(input[name=certainty]:checked)`. Because "exactly" is
            checked by default (ruling D3), that is ALWAYS true, so in
            practice the ring goes 0 -> 9 -> 27: the 18-bead rule is
            written and is the cascade's middle step, but the 27 rule
            overrides it the moment place and date are both valid. The
            third third reads "the time question is answered", which the
            default answers. Browsers without :has() show the ring unlit. */

/* ── the page ─────────────────────────────────────────────────────── */
form.dr-door{max-width:34rem}
form.dr-door + form.dr-door{margin-top:1.75rem}

/* ── the certainty chips: three radios styled as pills ────────────── */
.dr-chips{border:0;margin:0;padding:0;display:flex;flex-wrap:wrap;gap:.5rem}
.dr-chips legend{font-family:var(--sans);font-size:.85rem;color:var(--muted);
  padding:0;margin-bottom:.4rem;width:100%}
.dr-chips input{position:absolute;opacity:0;width:1px;height:1px;margin:0}
.dr-chips label{display:inline-flex;align-items:center;min-height:44px;margin:0;
  padding:0 1rem;border:1px solid var(--line);border-radius:999px;
  background:var(--card);color:var(--soft);font-size:.9rem;cursor:pointer;
  transition:background var(--dur-1) var(--ease),color var(--dur-1) var(--ease),border-color var(--dur-1) var(--ease)}
.dr-chips label:hover{border-color:var(--ink)}
.dr-chips input:checked + label{background:var(--ink);border-color:var(--ink);color:var(--paper)}
.dr-chips input:focus-visible + label{outline:2px solid var(--ink);outline-offset:2px}

/* ── the ring ─────────────────────────────────────────────────────── */
.dr-ring{display:block;width:96px;height:96px;margin:.25rem auto}
.dr-track{fill:none;stroke:var(--line);stroke-width:1}
.dr-beads{fill:var(--line)}
.dr-bead{transition:fill var(--dur-3) var(--ease)}
.dr-moon{fill:var(--ink)}
.dr-ring .dr-bead.dr-on{fill:var(--ink)}
form.dr-door:has(#place:valid) .dr-bead:nth-child(-n+9){fill:var(--ink)}
form.dr-door:has(#place:valid):has(#date:valid) .dr-bead:nth-child(-n+18){fill:var(--ink)}
form.dr-door:has(#place:valid):has(#date:valid):has(input[name=certainty]:checked) .dr-bead:nth-child(-n+27){fill:var(--ink)}

@media (prefers-reduced-motion: reduce){
  .dr-chips label,.dr-bead{transition:none}
}

/* ── generated widths and positions (ruling P1; the hour page's band) ─ */
/* Regenerate with:
   python3 -c "print(''.join(f'.dr-w{n}{{flex:{n} 0 0}}' for n in range(1,101))); print(''.join(f'.dr-l{n}{{left:{n}%}}' for n in range(0,101)))"
*/
.dr-w1{flex:1 0 0}.dr-w2{flex:2 0 0}.dr-w3{flex:3 0 0}.dr-w4{flex:4 0 0}.dr-w5{flex:5 0 0}.dr-w6{flex:6 0 0}.dr-w7{flex:7 0 0}.dr-w8{flex:8 0 0}.dr-w9{flex:9 0 0}.dr-w10{flex:10 0 0}.dr-w11{flex:11 0 0}.dr-w12{flex:12 0 0}.dr-w13{flex:13 0 0}.dr-w14{flex:14 0 0}.dr-w15{flex:15 0 0}.dr-w16{flex:16 0 0}.dr-w17{flex:17 0 0}.dr-w18{flex:18 0 0}.dr-w19{flex:19 0 0}.dr-w20{flex:20 0 0}.dr-w21{flex:21 0 0}.dr-w22{flex:22 0 0}.dr-w23{flex:23 0 0}.dr-w24{flex:24 0 0}.dr-w25{flex:25 0 0}.dr-w26{flex:26 0 0}.dr-w27{flex:27 0 0}.dr-w28{flex:28 0 0}.dr-w29{flex:29 0 0}.dr-w30{flex:30 0 0}.dr-w31{flex:31 0 0}.dr-w32{flex:32 0 0}.dr-w33{flex:33 0 0}.dr-w34{flex:34 0 0}.dr-w35{flex:35 0 0}.dr-w36{flex:36 0 0}.dr-w37{flex:37 0 0}.dr-w38{flex:38 0 0}.dr-w39{flex:39 0 0}.dr-w40{flex:40 0 0}.dr-w41{flex:41 0 0}.dr-w42{flex:42 0 0}.dr-w43{flex:43 0 0}.dr-w44{flex:44 0 0}.dr-w45{flex:45 0 0}.dr-w46{flex:46 0 0}.dr-w47{flex:47 0 0}.dr-w48{flex:48 0 0}.dr-w49{flex:49 0 0}.dr-w50{flex:50 0 0}.dr-w51{flex:51 0 0}.dr-w52{flex:52 0 0}.dr-w53{flex:53 0 0}.dr-w54{flex:54 0 0}.dr-w55{flex:55 0 0}.dr-w56{flex:56 0 0}.dr-w57{flex:57 0 0}.dr-w58{flex:58 0 0}.dr-w59{flex:59 0 0}.dr-w60{flex:60 0 0}.dr-w61{flex:61 0 0}.dr-w62{flex:62 0 0}.dr-w63{flex:63 0 0}.dr-w64{flex:64 0 0}.dr-w65{flex:65 0 0}.dr-w66{flex:66 0 0}.dr-w67{flex:67 0 0}.dr-w68{flex:68 0 0}.dr-w69{flex:69 0 0}.dr-w70{flex:70 0 0}.dr-w71{flex:71 0 0}.dr-w72{flex:72 0 0}.dr-w73{flex:73 0 0}.dr-w74{flex:74 0 0}.dr-w75{flex:75 0 0}.dr-w76{flex:76 0 0}.dr-w77{flex:77 0 0}.dr-w78{flex:78 0 0}.dr-w79{flex:79 0 0}.dr-w80{flex:80 0 0}.dr-w81{flex:81 0 0}.dr-w82{flex:82 0 0}.dr-w83{flex:83 0 0}.dr-w84{flex:84 0 0}.dr-w85{flex:85 0 0}.dr-w86{flex:86 0 0}.dr-w87{flex:87 0 0}.dr-w88{flex:88 0 0}.dr-w89{flex:89 0 0}.dr-w90{flex:90 0 0}.dr-w91{flex:91 0 0}.dr-w92{flex:92 0 0}.dr-w93{flex:93 0 0}.dr-w94{flex:94 0 0}.dr-w95{flex:95 0 0}.dr-w96{flex:96 0 0}.dr-w97{flex:97 0 0}.dr-w98{flex:98 0 0}.dr-w99{flex:99 0 0}.dr-w100{flex:100 0 0}
.dr-l0{left:0%}.dr-l1{left:1%}.dr-l2{left:2%}.dr-l3{left:3%}.dr-l4{left:4%}.dr-l5{left:5%}.dr-l6{left:6%}.dr-l7{left:7%}.dr-l8{left:8%}.dr-l9{left:9%}.dr-l10{left:10%}.dr-l11{left:11%}.dr-l12{left:12%}.dr-l13{left:13%}.dr-l14{left:14%}.dr-l15{left:15%}.dr-l16{left:16%}.dr-l17{left:17%}.dr-l18{left:18%}.dr-l19{left:19%}.dr-l20{left:20%}.dr-l21{left:21%}.dr-l22{left:22%}.dr-l23{left:23%}.dr-l24{left:24%}.dr-l25{left:25%}.dr-l26{left:26%}.dr-l27{left:27%}.dr-l28{left:28%}.dr-l29{left:29%}.dr-l30{left:30%}.dr-l31{left:31%}.dr-l32{left:32%}.dr-l33{left:33%}.dr-l34{left:34%}.dr-l35{left:35%}.dr-l36{left:36%}.dr-l37{left:37%}.dr-l38{left:38%}.dr-l39{left:39%}.dr-l40{left:40%}.dr-l41{left:41%}.dr-l42{left:42%}.dr-l43{left:43%}.dr-l44{left:44%}.dr-l45{left:45%}.dr-l46{left:46%}.dr-l47{left:47%}.dr-l48{left:48%}.dr-l49{left:49%}.dr-l50{left:50%}.dr-l51{left:51%}.dr-l52{left:52%}.dr-l53{left:53%}.dr-l54{left:54%}.dr-l55{left:55%}.dr-l56{left:56%}.dr-l57{left:57%}.dr-l58{left:58%}.dr-l59{left:59%}.dr-l60{left:60%}.dr-l61{left:61%}.dr-l62{left:62%}.dr-l63{left:63%}.dr-l64{left:64%}.dr-l65{left:65%}.dr-l66{left:66%}.dr-l67{left:67%}.dr-l68{left:68%}.dr-l69{left:69%}.dr-l70{left:70%}.dr-l71{left:71%}.dr-l72{left:72%}.dr-l73{left:73%}.dr-l74{left:74%}.dr-l75{left:75%}.dr-l76{left:76%}.dr-l77{left:77%}.dr-l78{left:78%}.dr-l79{left:79%}.dr-l80{left:80%}.dr-l81{left:81%}.dr-l82{left:82%}.dr-l83{left:83%}.dr-l84{left:84%}.dr-l85{left:85%}.dr-l86{left:86%}.dr-l87{left:87%}.dr-l88{left:88%}.dr-l89{left:89%}.dr-l90{left:90%}.dr-l91{left:91%}.dr-l92{left:92%}.dr-l93{left:93%}.dr-l94{left:94%}.dr-l95{left:95%}.dr-l96{left:96%}.dr-l97{left:97%}.dr-l98{left:98%}.dr-l99{left:99%}.dr-l100{left:100%}

/* ── the hour page: the lagna band (Task 4) ───────────────────────── */
/* Two neutral tones alternate (--card, --line); no graha colours, no
   gold. The bars carry NO text: names sit in .dr-lagna-names beneath,
   sized by the same dr-w class, and wrap there (Hindi names are long). */
.dr-kicker{font-family:var(--sans);font-size:.72rem;letter-spacing:.12em;
  text-transform:uppercase;color:var(--muted);margin:0 0 .5rem}
.dr-band{position:relative;max-width:34rem;margin:1.5rem 0 1rem;padding-top:1.6rem}
.dr-lagna,.dr-lagna-names{display:flex;list-style:none;margin:0;padding:0}
.dr-lagna{height:2.25rem;border:1px solid var(--line);border-radius:6px;overflow:hidden}
.dr-seg{background:var(--card)}
.dr-seg:nth-child(even){background:var(--line)}
.dr-lagna-names li{min-width:0;padding:.35rem .25rem 0;font-size:.8rem;color:var(--soft);
  overflow-wrap:anywhere;text-align:center}
.dr-pin{position:absolute;top:0;transform:translateX(-50%);font-family:var(--sans);
  font-size:.8rem;color:var(--ink);white-space:nowrap}
.dr-pin::after{content:"";position:absolute;left:50%;top:1.3rem;width:2px;height:2.75rem;
  margin-left:-1px;background:var(--ink)}
.dr-hold{position:relative;height:1.4rem;margin-top:.2rem}
.dr-edge{position:absolute;top:0;font-family:var(--sans);font-size:.75rem;color:var(--soft);
  white-space:nowrap;padding:0 .3rem;border-left:1px solid var(--line)}
.dr-edge-a{transform:translateX(-100%);border-left:0;border-right:1px solid var(--line)}
.dr-hour-forms{display:flex;flex-wrap:wrap;gap:.75rem;margin-top:1.25rem}
.dr-hour-forms form{margin:0}
.dr-quiet{background:transparent;color:var(--ink);border:1px solid var(--line);
  transition:border-color var(--dur-1) var(--ease)}
.dr-quiet:hover{border-color:var(--ink)}
@media (prefers-reduced-motion: reduce){
  .dr-quiet{transition:none}
}

/* ── Settle (Task 5): the hour pinned as one line above the address ── */
.dr-pinned{font-family:var(--sans);font-size:1.05rem;color:var(--ink);
  border-left:2px solid var(--ink);padding:.15rem 0 .15rem .75rem;margin:1rem 0 1.25rem}

/* ── H2: roughly when (the five windows under "Not sure") ──────────── */
/* Shown only while "Not sure" is checked. Without :has() the rule below
   never applies and the group stays visible under the chips, which is
   the fallback the door wants: a window the other chips ignore. */
.dr-when{margin-top:1rem}
@supports selector(:has(*)){
  form.dr-door:not(:has(input[name=certainty][value=unsure]:checked)) .dr-when{display:none}
}

/* ── H2: the candidates page ──────────────────────────────────────── */
/* The band is the hour page's with no pin; the window's two edges sit at
   its ends. One radio per rising sign, a full-width row each. */
.dr-band-window{padding-top:0}
.dr-edge-start{left:0;border-left:0;padding-left:0}
.dr-edge-end{right:0;border-left:0;padding-right:0}
.dr-candidates{border:0;margin:0 0 1rem;padding:0;display:flex;flex-direction:column;gap:.5rem}
.dr-candidates div{display:flex;align-items:center;gap:.6rem;min-height:44px}
.dr-candidates input{width:1.1rem;height:1.1rem;margin:0}
.dr-candidates label{margin:0;font-family:var(--sans);font-size:.95rem;color:var(--ink);cursor:pointer}
