/* ==========================================================================
   AyeTech widgets: interactive pieces in the proof-card language.
   Loaded only by the pages that use them (managed IT, servers, backup).

   - Radio-driven widgets (.seg, .planx, .pick) are pure CSS via :has().
   - The day clock (.daywatch) and the restore test (.runner) are enhanced by
     /widgets.js. Pages that use them add class "js" to <html> in the head.
   - Nothing here moves on its own until a person has touched the page, so
     lab audits always see a still, fully visible page.
   - Without :has() or without JS every widget reads as plain content.
   ========================================================================== */

/* ---------- Icons: <svg class="i"><use href="#i-name"/></svg> ---------- */
.i {
  width: 18px; height: 18px; flex-shrink: 0; fill: none; stroke: currentColor;
  stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
}
.i-sm { width: 14px; height: 14px; stroke-width: 2.4; }

/* Duotone icons: <svg class="i i-duo"><use href="#d-name"/></svg>.
   Each d- symbol has a soft fill drawn in currentColor behind the outline,
   so every tint sets color to match the stroke it already sets. */
.i-duo { width: 24px; height: 24px; stroke-width: 1.75; }
.ico-green .i-duo { color: var(--green); }
.ico-coral .i-duo { color: var(--coral-deep); }
.ico-coral-dark .i-duo { color: var(--coral); }
.ico-violet .i-duo { color: #4A3FA3; }

/* ---------- Pills ---------- */
.pill {
  display: inline-flex; align-items: center; gap: 6px; border-radius: 999px;
  padding: 3px 10px; font-size: 0.75rem; font-weight: 600; line-height: 1.5; white-space: nowrap;
}
.pill-on { background: #E3F0E6; color: #17603C; }
.pill-off { background: var(--paper-2); color: var(--ink-2); }
.pill-warn { background: #FDEBE6; color: #A33318; }

/* Inverse (ink) proof card, same surface as .pc-2 without its tilt */
.proof-card.inv {
  background: var(--ink); border-color: transparent; color: var(--dark-text);
  box-shadow: 0 16px 36px rgba(23, 19, 14, 0.18);
}
.proof-card.inv span { color: var(--dark-muted); }

.w-note { font-size: 0.8125rem; color: var(--ink-2); margin-top: 16px; text-wrap: pretty; }
/* Links that sit inside a line of text need more than colour to stand out */
.check-list a, .w-note a, .tile p a, .keep a {
  font-weight: 600; text-decoration: underline;
  text-decoration-color: rgba(200, 67, 43, 0.35); text-underline-offset: 3px;
}
.check-list a:hover, .w-note a:hover, .tile p a:hover, .keep a:hover { text-decoration-color: currentColor; }
.w-title {
  font-family: var(--font-display); font-weight: 800; font-size: clamp(1.5rem, 1.3rem + 0.9vw, 2rem);
  letter-spacing: -0.02em; line-height: 1.15; margin-top: 72px; text-wrap: balance;
}
.w-sub { font-size: 1.0625rem; line-height: 1.65; color: var(--ink-2); max-width: 40em; margin-top: 12px; text-wrap: pretty; }

/* ---------- Segmented control (radio group) ---------- */
.seg {
  display: inline-flex; max-width: 100%; gap: 2px; padding: 4px; border-radius: 999px;
  background: var(--card); border: 1px solid var(--line);
}
.seg label { position: relative; cursor: pointer; }
.seg input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.seg span {
  display: block; padding: 10px 20px; border-radius: 999px; font-size: 0.9375rem; font-weight: 600;
  color: var(--ink-2); transition: background-color 0.2s ease, color 0.2s ease;
}
.seg label:hover span { color: var(--ink); }
.seg input:checked + span { background: var(--ink); color: var(--paper); }
.seg input:focus-visible + span { outline: 2px solid var(--coral-deep); outline-offset: 2px; }

/* ---------- Tiles ---------- */
.tile {
  display: flex; gap: 14px; align-items: flex-start; padding: 16px 18px;
  border-radius: var(--radius); background: var(--card); border: 1px solid var(--line-soft);
  box-shadow: 0 8px 24px rgba(23, 19, 14, 0.06);
  transition: background-color 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}
.tile .ico {
  width: 36px; height: 36px; border-radius: 10px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; transition: background-color 0.25s ease;
}
.tile > div { min-width: 0; }
.tile strong { display: block; font-size: 0.9375rem; font-weight: 600; line-height: 1.3; }
.tile p { font-size: 0.8125rem; line-height: 1.5; color: var(--ink-2); margin-top: 3px; text-wrap: pretty; }
.tile .pill { margin-top: 8px; }
.tile a { font-weight: 600; }
.tile-off { background: transparent; border-style: dashed; border-color: var(--line); box-shadow: none; }
.tile-off .ico { background: var(--paper-2); }
.tile-off .ico svg { stroke: var(--ink-2); color: var(--ink-2); }
.tile-grid { list-style: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }

/* ---------- Plan explorer ---------- */
.planx { margin-top: 40px; background: var(--paper-2); border-radius: 28px; padding: 32px; }
.planx .tile .ico { width: 44px; height: 44px; border-radius: 12px; }
.planx-head {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 18px 32px; margin-bottom: 26px;
}
.planx-title {
  font-family: var(--font-display); font-weight: 700; font-size: 1.375rem;
  letter-spacing: -0.015em; line-height: 1.25; margin-bottom: 10px;
}
.planx-sum { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 18px; }
.planx-count { font-size: 0.9375rem; color: var(--ink-2); font-weight: 500; }
.planx-count b { color: var(--ink); font-weight: 700; }
.planx .v:not(.on-p) { display: none; }
.planx .pill-off { display: none; }
.planx-static { font-size: 0.9375rem; font-weight: 600; }

@supports selector(:has(*)) {
  .planx-static { display: none; }
  .planx:has([value="essential"]:checked) .v.on-e,
  .planx:has([value="enterprise"]:checked) .v.on-x { display: revert; }
  .planx:has([value="essential"]:checked) .v:not(.on-e),
  .planx:has([value="enterprise"]:checked) .v:not(.on-x) { display: none; }

  /* A tile that the chosen plan does not include */
  .planx:has([value="essential"]:checked) .tile[data-from="professional"],
  .planx:has([value="essential"]:checked) .tile[data-from="enterprise"],
  .planx:has([value="professional"]:checked) .tile[data-from="enterprise"] {
    background: transparent; border-style: dashed; border-color: var(--line); box-shadow: none;
  }
  .planx:has([value="essential"]:checked) .tile[data-from="professional"] .ico,
  .planx:has([value="essential"]:checked) .tile[data-from="enterprise"] .ico,
  .planx:has([value="professional"]:checked) .tile[data-from="enterprise"] .ico { background: var(--card); }
  .planx:has([value="essential"]:checked) .tile[data-from="professional"] .ico svg,
  .planx:has([value="essential"]:checked) .tile[data-from="enterprise"] .ico svg,
  .planx:has([value="professional"]:checked) .tile[data-from="enterprise"] .ico svg { stroke: var(--ink-2); color: var(--ink-2); }
  .planx:has([value="essential"]:checked) .tile[data-from="professional"] .pill-on,
  .planx:has([value="essential"]:checked) .tile[data-from="enterprise"] .pill-on,
  .planx:has([value="professional"]:checked) .tile[data-from="enterprise"] .pill-on { display: none; }
  .planx:has([value="essential"]:checked) .tile[data-from="professional"] .pill-off,
  .planx:has([value="essential"]:checked) .tile[data-from="enterprise"] .pill-off,
  .planx:has([value="professional"]:checked) .tile[data-from="enterprise"] .pill-off { display: inline-flex; }
}
@supports not selector(:has(*)) {
  .planx .seg { display: none; }
  .planx .tile[data-from="enterprise"] { background: transparent; border-style: dashed; box-shadow: none; }
  .planx .tile[data-from="enterprise"] .pill-on { display: none; }
  .planx .tile[data-from="enterprise"] .pill-off { display: inline-flex; }
}

/* ---------- Pick: radio options that switch a stage ---------- */
.pick { margin-top: 40px; }
.pick-opts { list-style: none; display: flex; flex-direction: column; gap: 10px; }
.pick-opt { position: relative; display: block; cursor: pointer; }
.pick-opt input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.pick-opt .opt {
  display: flex; gap: 14px; align-items: center; padding: 14px 18px;
  border-radius: var(--radius); background: var(--card); border: 1px solid var(--line-soft);
  transition: background-color 0.2s ease, color 0.2s ease, translate 0.2s ease, box-shadow 0.2s ease;
}
.pick-opt:hover .opt { border-color: var(--line); }
.pick-opt .num {
  width: 34px; height: 34px; border-radius: 10px; flex-shrink: 0; display: grid; place-items: center;
  background: var(--paper-2); font-family: var(--font-display); font-weight: 800; font-size: 1.0625rem;
  transition: background-color 0.2s ease, color 0.2s ease;
}
.pick-opt strong { display: block; font-size: 0.9375rem; font-weight: 600; line-height: 1.3; }
.pick-opt small { display: block; font-size: 0.8125rem; color: var(--ink-2); margin-top: 1px; }
.pick-opt input:checked + .opt {
  background: var(--ink); color: var(--paper); border-color: transparent;
  box-shadow: 0 16px 36px rgba(23, 19, 14, 0.18); translate: 6px 0;
}
.pick-opt input:checked + .opt small { color: var(--dark-muted); }
.pick-opt input:checked + .opt .num { background: var(--coral); color: var(--on-coral); }
.pick-opt input:focus-visible + .opt { outline: 2px solid var(--coral-deep); outline-offset: 3px; }
.pick-panel { min-width: 0; }
.pick-panel + .pick-panel { margin-top: 24px; }

/* Options as a row of chips above the stage */
.pick--top .pick-opts { flex-direction: row; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }
.pick--top .pick-opt .opt { padding: 9px 16px; border-radius: 999px; gap: 8px; font-size: 0.875rem; font-weight: 600; }
.pick--top .pick-opt input:checked + .opt { translate: 0 0; box-shadow: none; }

@supports selector(:has(*)) {
  .pick:not(.pick--top) {
    display: grid; grid-template-columns: minmax(240px, 330px) minmax(0, 1fr);
    gap: 28px 44px; align-items: start;
  }
  .pick-stage { display: grid; }
  .pick-panel {
    grid-area: 1 / 1; visibility: hidden; opacity: 0; translate: 0 10px;
    transition: opacity 0.3s ease, translate 0.3s ease, visibility 0s linear 0.3s;
  }
  .pick-panel + .pick-panel { margin-top: 0; }
  .pick:has(.pick-opts > :nth-child(1) input:checked) .pick-panel:nth-child(1),
  .pick:has(.pick-opts > :nth-child(2) input:checked) .pick-panel:nth-child(2),
  .pick:has(.pick-opts > :nth-child(3) input:checked) .pick-panel:nth-child(3),
  .pick:has(.pick-opts > :nth-child(4) input:checked) .pick-panel:nth-child(4),
  .pick:has(.pick-opts > :nth-child(5) input:checked) .pick-panel:nth-child(5),
  .pick:has(.pick-opts > :nth-child(6) input:checked) .pick-panel:nth-child(6),
  .pick:has(.pick-opts > :nth-child(7) input:checked) .pick-panel:nth-child(7),
  .pick:has(.pick-opts > :nth-child(8) input:checked) .pick-panel:nth-child(8) {
    visibility: visible; opacity: 1; translate: 0 0; transition-delay: 0s;
  }
}
@supports not selector(:has(*)) {
  .pick-opts { display: none; }
}

/* A scene: the card a pick shows */
.scene {
  background: var(--card); border: 1px solid var(--line-soft); border-radius: 24px; padding: 32px;
  box-shadow: 0 24px 60px rgba(23, 19, 14, 0.07);
}
.scene-tag {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 14px;
  font-size: 0.75rem; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--coral-deep);
}
.scene-tag .pill { letter-spacing: 0; text-transform: none; }
.scene h3, .scene h4, .scene-h {
  font-family: var(--font-display); font-weight: 700; font-size: 1.375rem;
  letter-spacing: -0.015em; line-height: 1.25; margin-bottom: 10px; text-wrap: balance;
}
.scene p { font-size: 0.9375rem; line-height: 1.65; color: var(--ink-2); text-wrap: pretty; }
.scene p.scene-h { font-size: 1.375rem; line-height: 1.25; color: var(--ink); }
.scene p.scene-tag { font-size: 0.75rem; line-height: 1.5; color: var(--coral-deep); }
.scene p.w-note { font-size: 0.8125rem; }
.scene-flow { display: flex; flex-direction: column; gap: 12px; margin: 22px 0 4px; }
.scene-flow .proof-card:nth-child(odd) { rotate: -0.6deg; margin-right: 28px; }
.scene-flow .proof-card:nth-child(even) { rotate: 0.7deg; margin-left: 28px; }
.scene-foot {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 12px 20px; margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line-soft);
  font-size: 0.9375rem;
}
.scene-next {
  display: inline-flex; align-items: center; gap: 8px; cursor: pointer; border-radius: 999px;
  padding: 9px 18px; border: 1.5px solid var(--line); font-weight: 600; font-size: 0.875rem;
  transition: border-color 0.2s ease, background-color 0.2s ease;
}
.scene-next:hover { border-color: var(--ink); }

/* Kept / lost comparison rows inside a scene */
.keep { list-style: none; display: grid; gap: 10px; margin-top: 20px; }
.keep li {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 4px 14px; align-items: center;
  padding: 14px 16px; border-radius: 14px; background: var(--paper); border: 1px solid var(--line-soft);
}
.keep .ico { width: 34px; height: 34px; border-radius: 10px; display: flex; align-items: center; justify-content: center; }
.keep strong { display: block; font-size: 0.9375rem; font-weight: 600; line-height: 1.3; }
.keep small { display: block; font-size: 0.8125rem; color: var(--ink-2); line-height: 1.45; }
.keep b {
  font-family: var(--font-display); font-weight: 800; font-size: 1.25rem; letter-spacing: -0.02em;
  white-space: nowrap; text-align: right;
}
.keep .lost b { color: var(--coral-deep); }
.keep .kept b { color: var(--green); }

/* ---------- Day clock ---------- */
.daywatch { --dw-h: 74px; --dw-gap: 14px; --dw-step: calc(var(--dw-h) + var(--dw-gap)); }
.daywatch .proof-label { display: flex; align-items: center; justify-content: center; gap: 10px; }
.dw-live { position: relative; width: 8px; height: 8px; border-radius: 50%; background: var(--green); flex-shrink: 0; }
.dw-live::after { content: ''; position: absolute; inset: 0; border-radius: 50%; background: inherit; }
.is-playing .dw-live::after, .is-running .dw-live::after { animation: dw-ping 1.8s cubic-bezier(0, 0, 0.2, 1) infinite; }
@keyframes dw-ping { to { transform: scale(3); opacity: 0; } }

.dw-stage { list-style: none; display: flex; flex-direction: column; gap: var(--dw-gap); }
.dw-ev { align-items: center; }
.dw-ev > span:last-of-type { flex: 1; min-width: 0; }
.dw-ev strong, .dw-ev > span:last-of-type > span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dw-who {
  align-self: flex-start; flex-shrink: 0; font-size: 0.625rem; font-weight: 700; font-style: normal;
  letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-2); padding-top: 3px;
}
.proof-card.inv .dw-who { color: var(--dark-muted); }
.dw-controls { display: none; }
/* Before /widgets.js runs (or with no JS) only the opening four events show */
html:not(.js) .dw-ev:not(.s0):not(.s1):not(.s2):not(.s3) { display: none; }

.js .dw-stage { display: block; position: relative; height: calc(4 * var(--dw-h) + 3 * var(--dw-gap)); }
.js .dw-ev {
  position: absolute; top: 0; left: 0; right: 44px; height: var(--dw-h);
  opacity: 0; visibility: hidden; transform: translate(14px, calc(-0.7 * var(--dw-step))) rotate(-2deg);
  transition: transform 0.55s cubic-bezier(0.2, 0.75, 0.2, 1), opacity 0.3s ease, visibility 0s linear 0.55s;
}
.js .dw-ev.past { transform: translate(26px, calc(3.7 * var(--dw-step))) rotate(2.5deg); }
.js .dw-ev.s0, .js .dw-ev.s1, .js .dw-ev.s2, .js .dw-ev.s3 { opacity: 1; visibility: visible; transition-delay: 0s; }
.js .dw-ev.s0 { transform: translate(0, 0) rotate(-1.5deg); }
.js .dw-ev.s1 { transform: translate(40px, var(--dw-step)) rotate(1.25deg); }
.js .dw-ev.s2 { transform: translate(10px, calc(2 * var(--dw-step))) rotate(-0.75deg); }
.js .dw-ev.s3 { transform: translate(44px, calc(3 * var(--dw-step))) rotate(1.5deg); }

.js .dw-controls {
  display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 4px 14px;
  margin-top: 24px; padding: 14px 18px 12px; border-radius: 18px;
  background: var(--card); border: 1px solid var(--line-soft); box-shadow: 0 12px 32px rgba(23, 19, 14, 0.08);
}
.dw-play {
  width: 40px; height: 40px; border-radius: 50%; border: none; cursor: pointer;
  display: grid; place-items: center; background: var(--ink); color: var(--paper);
  transition: background-color 0.2s ease;
}
.dw-play:hover { background: var(--coral-deep); }
.dw-play .i { width: 16px; height: 16px; stroke-width: 2.2; }
.dw-play .i-play { fill: currentColor; translate: 1px 0; }
.dw-play .i-pause, .is-playing .dw-play .i-play { display: none; }
.is-playing .dw-play .i-pause { display: block; }
.dw-now { display: flex; align-items: baseline; gap: 10px; min-width: 0; }
.dw-clock {
  font-family: var(--font-display); font-weight: 800; font-size: 1.5rem; letter-spacing: -0.02em;
  line-height: 1; font-variant-numeric: tabular-nums; white-space: nowrap;
}
.dw-hint { font-size: 0.8125rem; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dw-track { position: relative; grid-column: 1 / -1; margin-top: 6px; }
.dw-range {
  -webkit-appearance: none; appearance: none; display: block; width: 100%; height: 28px;
  margin: 0; background: transparent; cursor: grab; touch-action: pan-y;
}
.dw-range:active { cursor: grabbing; }
.dw-range::-webkit-slider-runnable-track {
  height: 6px; border-radius: 999px;
  background: linear-gradient(to right, var(--ink) var(--dw-p, 0%), var(--line) var(--dw-p, 0%));
}
.dw-range::-moz-range-track { height: 6px; border-radius: 999px; background: var(--line); }
.dw-range::-moz-range-progress { height: 6px; border-radius: 999px; background: var(--ink); }
.dw-range::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none; width: 24px; height: 24px; margin-top: -9px; border-radius: 50%;
  background: var(--coral); border: 3px solid var(--ink); box-shadow: 0 4px 12px rgba(23, 19, 14, 0.25);
}
.dw-range::-moz-range-thumb {
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--coral); border: 3px solid var(--ink); box-shadow: 0 4px 12px rgba(23, 19, 14, 0.25);
}
.dw-range:focus-visible { outline: 2px solid var(--coral-deep); outline-offset: 4px; border-radius: 999px; }
.dw-marks { position: absolute; left: 12px; right: 12px; top: 14px; height: 0; pointer-events: none; }
.dw-marks i {
  position: absolute; top: -13px; width: 6px; height: 6px; margin-left: -3px; border-radius: 50%;
  background: var(--ink-2);
}
.dw-marks .k-sophos { background: var(--coral-deep); }
.dw-marks .k-backup { background: var(--green); }
.dw-ticks {
  display: flex; justify-content: space-between; margin-top: 2px;
  font-size: 0.6875rem; font-weight: 500; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-2);
}
.dw-key { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 16px; margin-top: 14px; font-size: 0.75rem; color: var(--ink-2); }
.dw-key span { display: inline-flex; align-items: center; gap: 6px; }
.dw-key i { width: 7px; height: 7px; border-radius: 50%; background: var(--ink-2); }
.dw-key .k-sophos { background: var(--coral-deep); }
.dw-key .k-backup { background: var(--green); }

/* ---------- Restore test runner ---------- */
.runner {
  background: var(--dark); color: var(--dark-text); color-scheme: dark;
  border: 1px solid rgba(245, 239, 230, 0.08); border-radius: 24px; padding: 28px;
  box-shadow: 0 24px 60px rgba(23, 19, 14, 0.18);
}
.runner-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 20px; }
.runner-title {
  display: flex; align-items: center; gap: 10px; font-size: 0.75rem; font-weight: 600;
  letter-spacing: 0.12em; text-transform: uppercase; color: var(--dark-muted);
}
.runner-btn {
  display: none; align-items: center; gap: 8px; cursor: pointer; border-radius: 999px; padding: 9px 18px;
  background: var(--coral); color: var(--on-coral); border: none;
  font-family: var(--font-body); font-size: 0.875rem; font-weight: 600; transition: background-color 0.2s ease;
}
.js .runner-btn { display: inline-flex; }
.runner-btn:hover { background: #FF7257; }
.runner-btn:disabled { background: rgba(245, 239, 230, 0.12); color: var(--dark-muted); cursor: default; }
.runner :focus-visible { outline-color: var(--coral); }
.runner-bar { height: 4px; border-radius: 999px; background: rgba(245, 239, 230, 0.12); margin: 20px 0 8px; overflow: hidden; }
.runner-bar i { display: block; height: 100%; background: var(--coral); transform-origin: left center; transition: transform 0.5s ease; }
.runner-steps { list-style: none; }
.runner-steps li {
  display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; gap: 2px 14px; align-items: start;
  padding: 14px 0; border-bottom: 1px solid rgba(245, 239, 230, 0.08);
}
.runner-steps .st {
  width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center;
  background: rgba(76, 175, 125, 0.18); color: #6FCB97;
}
.runner-steps strong { display: block; font-size: 0.9375rem; font-weight: 600; line-height: 1.35; }
.runner-steps p { font-size: 0.8125rem; line-height: 1.5; color: var(--dark-muted); }
.runner-steps time { font-size: 0.75rem; color: var(--dark-muted); font-variant-numeric: tabular-nums; padding-top: 3px; }
.runner-steps .is-wait .st { background: transparent; box-shadow: inset 0 0 0 2px rgba(245, 239, 230, 0.22); }
.runner-steps .is-wait .st svg, .runner-steps .is-run .st svg { visibility: hidden; }
.runner-steps .is-wait strong { color: var(--dark-muted); }
.runner-steps .is-run .st {
  background: transparent; box-shadow: none; border: 2px solid rgba(245, 239, 230, 0.22);
  border-top-color: var(--coral); animation: runner-spin 0.7s linear infinite;
}
@keyframes runner-spin { to { transform: rotate(360deg); } }
.runner-result { display: flex; align-items: center; gap: 10px; margin-top: 18px; font-size: 0.9375rem; font-weight: 600; }
.runner-result .pill { background: rgba(76, 175, 125, 0.18); color: #8FDDB0; }
.is-running .runner-result .pill { background: rgba(245, 239, 230, 0.12); color: var(--dark-muted); }

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .planx { padding: 22px 18px; border-radius: 22px; }
  .planx-head { flex-direction: column; align-items: flex-start; }
  .seg span { padding: 10px 14px; font-size: 0.875rem; }
  .scene { padding: 24px 20px; border-radius: 20px; }
  .runner { padding: 22px 18px; border-radius: 20px; }
  .scene-flow .proof-card:nth-child(odd) { margin-right: 12px; }
  .scene-flow .proof-card:nth-child(even) { margin-left: 12px; }
  .js .dw-ev { right: 28px; }
  .js .dw-ev.s1 { transform: translate(24px, var(--dw-step)) rotate(1.25deg); }
  .js .dw-ev.s3 { transform: translate(28px, calc(3 * var(--dw-step))) rotate(1.5deg); }
  .dw-hint { display: none; }
  .keep li { grid-template-columns: auto minmax(0, 1fr); }
  .keep b { grid-column: 2; text-align: left; font-size: 1.125rem; }
}
@supports selector(:has(*)) {
  @media (max-width: 860px) {
    .pick:not(.pick--top) { grid-template-columns: minmax(0, 1fr); gap: 16px; }
    .pick:not(.pick--top) .pick-opts {
      flex-direction: row; overflow-x: auto; gap: 8px; padding: 4px 2px 10px; margin-inline: -2px;
      scroll-snap-type: x proximity; -webkit-overflow-scrolling: touch; scrollbar-width: none;
    }
    .pick:not(.pick--top) .pick-opts::-webkit-scrollbar { display: none; }
    .pick:not(.pick--top) .pick-opt { flex: 0 0 auto; scroll-snap-align: start; }
    .pick:not(.pick--top) .pick-opt .opt { padding: 10px 14px; gap: 10px; }
    .pick:not(.pick--top) .pick-opt small { display: none; }
    .pick:not(.pick--top) .pick-opt .num { width: 28px; height: 28px; border-radius: 8px; font-size: 0.9375rem; }
    .pick:not(.pick--top) .pick-opt input:checked + .opt { translate: 0 0; box-shadow: none; }
  }
}

@media (max-width: 520px) {
  .daywatch { --dw-h: 68px; --dw-gap: 12px; }
  .dw-who { display: none; }
  .daywatch .dw-ev { padding: 14px 16px; gap: 12px; }
  .dw-ev strong { font-size: 0.875rem; }
  .dw-ev > span:last-of-type > span { font-size: 0.78125rem; }
  .js .dw-ev { right: 22px; }
  .js .dw-ev.s1 { transform: translate(18px, var(--dw-step)) rotate(1.25deg); }
  .js .dw-ev.s2 { transform: translate(6px, calc(2 * var(--dw-step))) rotate(-0.75deg); }
  .js .dw-ev.s3 { transform: translate(22px, calc(3 * var(--dw-step))) rotate(1.5deg); }
  .js .dw-controls { padding: 12px 14px 10px; }
  .seg { display: flex; }
  .seg label { flex: 1; text-align: center; }
  .seg span { padding: 10px 8px; }
}

@media (prefers-reduced-motion: reduce) {
  .tile, .tile .ico, .seg span, .pick-opt .opt, .pick-opt .num, .pick-panel,
  .js .dw-ev, .runner-bar i { transition: none; }
  .dw-live::after, .runner-steps .is-run .st { animation: none; }
  .dw-play { display: none; }
}

/* ---------- Dark mode ---------- */
[data-theme="dark"] .pill-on { background: rgba(76, 175, 125, 0.16); color: #8FDDB0; }
[data-theme="dark"] .pill-warn { background: rgba(240, 100, 73, 0.15); color: #FFA78F; }
[data-theme="dark"] .proof-card.inv { color: #17130E; }
[data-theme="dark"] .proof-card.inv span,
[data-theme="dark"] .proof-card.inv .dw-who { color: #5C544A; }
[data-theme="dark"] .proof-card.inv .ico-coral-dark svg { stroke: #C8432B; }
[data-theme="dark"] .pick-opt input:checked + .opt small { color: #5C544A; }
[data-theme="dark"] .dw-play:hover { background: var(--coral); color: var(--on-coral); }
[data-theme="dark"] .runner { background: var(--dark-2); }
[data-theme="dark"] .check-list a, [data-theme="dark"] .w-note a,
[data-theme="dark"] .tile p a, [data-theme="dark"] .keep a { text-decoration-color: rgba(255, 138, 110, 0.4); }
[data-theme="dark"] .planx .tile { background: var(--dark-2); }
[data-theme="dark"] .planx .tile-off { background: transparent; }
[data-theme="dark"] .ico-green .i-duo { color: #6FCB97; }
[data-theme="dark"] .ico-violet .i-duo { color: #A99BF0; }
[data-theme="dark"] .proof-card.inv .ico-coral-dark .i-duo { color: #C8432B; }
