/* Shared planner styles for the homepage and every pair page. Pair pages load assets/pair.css after this file.
   Color tokens, the control cursor, the logo swap, and the theme menu live in assets/tokens.css.
   Toast, footer, button, the form reset, and the header live in assets/components.css. */
        * { box-sizing: border-box; margin: 0; padding: 0; }
        body {
            font-family: Outfit, system-ui, sans-serif;
            background: var(--bg);
            color: var(--text);
            min-height: 100vh;
        }
        h1 { font-size: 1.7rem; letter-spacing: 0.06em; font-weight: 800; }
        .dot {
            width: 10px; height: 10px; border-radius: 50%;
            background: var(--green-500); box-shadow: 0 0 8px var(--green-500);
        }
        .badge {
            border: 1px solid color-mix(in srgb, var(--cyan) 45%, transparent);
            color: var(--cyan);
            border-radius: 999px;
            padding: 4px 10px;
            font-size: 0.72rem;
            font-weight: 700;
            letter-spacing: 0.08em;
        }
        .subtitle { color: var(--muted); margin-top: 6px; font-size: 0.92rem; }
        /* The visible page heading keeps the subtitle's size and colour. The keyword sits on its own short line. */
        h1.subtitle { font-weight: 400; letter-spacing: normal; line-height: 1.45; }
        .subtitle-lead { display: block; }
        .subhead { color: var(--muted); margin-top: 4px; font-size: 0.92rem; line-height: 1.45; max-width: 36rem; }
        main { max-width: 1400px; margin: 0 auto; padding: 22px 28px 64px; }
        .hint-row {
            display: flex; justify-content: center; align-items: center; color: var(--muted);
            font-size: 1.05rem; margin-bottom: var(--gap-now-timeline); gap: 12px;
        }
        /* >=601px: pill on the first city card's left edge, hint on the right, as before #166. Phones keep the centred column. */
        @media (min-width: 601px) { .hint-row { justify-content: space-between; } }
        /* One joined control. Stretch both halves to the button's shared
           min-block-size (the 44px target on .btn). A fixed 40px height left
           the field short and let the button stick out below it. */
        .now-seg {
            display: inline-flex; align-items: stretch; flex: none;
        }
        .now-seg-live {
            display: inline-flex; align-items: center; gap: 8px;
            padding: 0 12px; border: 1px solid var(--line);
            border-start-start-radius: 10px; border-end-start-radius: 10px;
            background: var(--slate-800); color: var(--text);
            font-size: 0.95rem; font-weight: 600;
        }
        html.light .now-seg-live { background: var(--white); }
        .now-seg .now-clock { margin-left: 0; font-size: 0.95rem; }
        .now-zone {
            color: var(--text);
            font-weight: 600;
            font-variant-numeric: tabular-nums;
            white-space: nowrap;
        }
        .now-seg .lbl-long { display: inline; }
        .now-seg .lbl-short { display: none; }
        .now-seg .now-seg-snap {
            margin-inline-start: -1px; padding: 0 14px;
            border-radius: 0;             border-start-end-radius: 10px; border-end-end-radius: 10px;
            display: inline-flex; align-items: center; background: var(--slate-800); color: var(--text);
            font-size: var(--btn-size);
        }
        html.light .now-seg .now-seg-snap { background: var(--white); }
        .now-seg .now-seg-snap:focus-visible { outline: 3px solid var(--text); outline-offset: 2px; z-index: 1; }
        .now-seg.is-away .sync-dot {
            background: transparent; box-shadow: none; animation: none;
            border: 2px solid var(--green-500); box-sizing: border-box;
        }
        .now-seg.is-away .now-seg-snap {
            background: var(--hot-fill); border-color: var(--hot-edge); color: var(--slate-900); font-weight: 700;
        }
        html.light .now-seg.is-away .now-seg-snap {
            background: var(--hot-fill); color: var(--slate-900);
        }
        @media (prefers-reduced-motion: reduce) {
            .now-seg .sync-dot { animation: none; }
        }
        .corner { font-size: 1.05rem; }
        .stack { position: relative; display: flex; flex-direction: column; gap: 16px; cursor: grab; user-select: none; touch-action: pan-y; }
        /* Empty until the deferred planner paints the default two cities.
           Those cards measure 220px and 164px. The empty box holds that
           block size so the legend, Add a city, and the banner do not drop
           when the articles arrive. :empty lets go in that same layout, and
           the two-city stack is the same 384px. */
        #cards:empty { min-block-size: 384px; }
        .timeline-live {
            position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden;
            clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
        }
        .stack.dragging { cursor: grabbing; }
        /* Franco's drawings, scaled to 1/10 of the viewBox. The silhouette is
           filled with its line colour, then a 1px opposite outline (stroke 30
           behind the 1px stroke) sits outside it. The open-hand hotspot is
           the index fingertip. The fist hotspot is the top centre. */
        html.dark .stack {
            cursor: url("/assets/cursors/hand-dark.svg?v=36144339188b") 10 3, grab;
        }
        html.dark .stack:active,
        html.dark .stack.dragging {
            cursor: url("/assets/cursors/grabbing-hand-dark.svg?v=9c061ebe8025") 12 2, grabbing;
        }
        html.light .stack {
            cursor: url("/assets/cursors/hand.svg?v=6710152050d7") 10 3, grab;
        }
        html.light .stack:active,
        html.light .stack.dragging {
            cursor: url("/assets/cursors/grabbing-hand.svg?v=25ba11ac17b1") 12 2, grabbing;
        }
        /* The name and the country are text boxes. The empty header beside them stays the hand. */
        .card-head p { cursor: default; }
        /* No z-index and no transform here. Either one would trap the lower
           knob in this box. The violet frame and the overlap times box paint
           over the line, its glow, and that knob. */
        .playhead {
            position: absolute; top: -8px; bottom: -8px; left: calc(50% - 1px); width: 2px;
            pointer-events: none;
        }
        .playhead::before {
            content: "";
            position: absolute;
            inset: 0;
            background: var(--cyan);
            box-shadow: 0 0 10px var(--cyan);
            z-index: 5;
        }
        .playhead i {
            position: absolute; left: 50%; width: 22px; height: 11px;
            border: 2px solid var(--cyan); transform: translateX(-50%);
            background: var(--bg);
        }
        .playhead i.top {
            top: -11px;
            z-index: 5;
            border-bottom: none;
            border-radius: 11px 11px 0 0;
            background: var(--bg);
            border-color: var(--cyan);
            animation: cap-pulse 1.8s ease-in-out infinite;
        }
        .playhead i.top::after {
            content: "";
            position: absolute;
            left: 3px;
            right: 3px;
            top: 3px;
            bottom: 0;
            background: var(--cyan);
            border-radius: 8px 8px 0 0;
            animation: cap-pulse 1.8s ease-in-out infinite;
        }
        @keyframes cap-pulse {
            0%, 100% { box-shadow: 0 0 4px var(--cyan); }
            50% { box-shadow: 0 0 14px var(--cyan), 0 0 22px var(--neon-75); }
        }
        .sync-dot {
            width: 9px;
            height: 9px;
            border-radius: 50%;
            background: var(--green-500);
            box-shadow: 0 0 8px var(--green-500);
            animation: dot-pulse 1.8s ease-in-out infinite;
        }
        @keyframes dot-pulse {
            0%, 100% { transform: scale(1); opacity: 0.75; box-shadow: 0 0 4px var(--green-500); }
            50% { transform: scale(1.25); opacity: 1; box-shadow: 0 0 12px var(--green-500); }
        }
        .sync-label { display: flex; align-items: center; gap: 8px; font-size: 1.12rem; }
        /* Behind the overlap window (z-index 6), so the violet frame and the
           times box cover this knob instead of the knob sitting on them. */
        .playhead i.bot { bottom: -11px; z-index: 3; border-top: none; border-radius: 0 0 11px 11px; }
        .card {
            background: var(--card);
            border: 1px solid var(--line);
            border-radius: 16px;
            padding: 18px 20px 16px;
            position: relative;
        }
        .card-head { position: relative; display: flex; align-items: flex-start; margin-bottom: var(--gap-card-head); }
        .city-line { display: flex; align-items: center; gap: 10px; }
        .card h2 { letter-spacing: 0.04em; font-size: 1.05rem; font-weight: 700; line-height: normal; text-transform: uppercase; cursor: default; }
        .card p { color: var(--muted); font-size: 0.8rem; }
        .remove {
            display: inline-flex; align-items: center; gap: 7px;
            background: var(--slate-800);
            color: var(--text);
            border: 1px solid var(--line);
            border-radius: 12px;
            padding: 8px 14px;
            font-size: 0.85rem;
            font-weight: 600;
            position: relative;
            z-index: 8;
            font-family: inherit;
        }
        .remove svg { width: 18px; height: 18px; flex: none; }
        .remove:focus-visible { outline: 3px solid var(--text); outline-offset: 2px; }
        html.light .remove { background: var(--white); }
        /* First card only: the day/week jumps are their own row, above the city name.
           They still hug the playhead: a 28px gutter is left open for the line (pairs sit 14px either side of centre). */
        .jump-row { display: grid; grid-template-columns: 1fr 28px 1fr; gap: 0; margin: 0 0 12px; }
        /* Each pair is one joined pill: no gap, borders overlap into a single divider, outer corners rounded only. */
        .jump-row > div { display: flex; gap: 0; }
        .jump-row .jump { border-radius: 0; }
        .jump-row .jump + .jump { margin-inline-start: -1px; }
        .jump-row .jump:first-child { border-start-start-radius: 10px; border-end-start-radius: 10px; }
        .jump-row .jump:last-of-type { border-start-end-radius: 10px; border-end-end-radius: 10px; }
        .jump-row > div:first-child { grid-column: 1; justify-self: end; }
        .jump-row > div:last-child { grid-column: 3; justify-self: start; }
        .jump {
            background: var(--slate-800); color: var(--text); border: 1px solid var(--line);
            border-radius: 10px; padding: 6px 12px; font-size: var(--btn-size); font-weight: var(--btn-weight);
            position: relative; z-index: 8; font-family: inherit;
        }
        .jump:hover { border-color: var(--cyan); z-index: 9; }
        .jump:focus-visible { outline: 3px solid var(--text); outline-offset: 2px; z-index: 10; }
        html.light .jump { background: var(--white); }
        .now-clock {
            color: var(--text);
            font-weight: 700;
            margin-left: 4px;
            font-size: 1.2rem;
            font-variant-numeric: tabular-nums;
        }
        .flag {
            /* 6px above the hour bar, with at least that much space under the city name. Block padding is what leaves both gaps inside the existing row. */
            /* Left edge at 50% + 14px, shifted in only when the label would run past 12px into the card's
               right padding (planner.js sets --flag-w to the label width). */
            position: absolute; top: auto; bottom: -8px; left: min(calc(50% + 14px), calc(100% + 12px - var(--flag-w, 0px))); z-index: 6;
            display: flex; gap: 8px; align-items: center;
            background: var(--ink); color: var(--white);
            border: 1px solid color-mix(in srgb, var(--cyan) 45%, transparent);
            border-radius: 10px; padding: 2.25px 10px; pointer-events: none;
        }
        /* .overlap-clip also sits at z-index 6 and comes later, so it painted over the shifted label at 320px. */
        .card-head .flag { z-index: 7; }
        html.light .flag { background: var(--white); color: var(--text); }
        .flag b { font-size: 0.95rem; }
        .flag span { color: var(--cyan); font-size: 0.75rem; font-weight: 700; }
        .flag em { font-style: normal; color: var(--muted); font-size: 0.75rem; background: var(--white-06); padding: 2px 6px; border-radius: 4px; }
        /* Transparent border is always reserved so the pill doesn't change the badge width at midnight. */
        .flag .date { border: 1.5px solid transparent; border-radius: 999px; padding: 0 6px; line-height: 1.35; white-space: nowrap; }
        .flag[data-holiday] { flex-wrap: wrap; max-width: 16rem; }
        .flag .holiday {
            flex-basis: 100%;
            font-size: 0.75rem;
            font-weight: 700;
            line-height: 1.35;
            color: var(--slate-50);
        }
        html.light .flag .holiday { color: var(--slate-900); }
        .flag[data-holiday="partial"] .holiday { color: var(--slate-300); }
        html.light .flag[data-holiday="partial"] .holiday { color: var(--slate-800); }
        /* Bank-only closure (banks closed, not a public holiday). Amber, a colour no
           hour band or badge uses. 13.5:1 on the dark badge, 9.1:1 on the light one.
           --bank lives in tokens.css. */
        .flag[data-bank] { flex-wrap: wrap; max-width: 16rem; }
        .flag .bank {
            flex-basis: 100%;
            display: inline-flex; align-items: center; gap: 4px;
            font-size: 0.75rem; font-weight: 700; line-height: 1.35;
            color: var(--bank);
        }
        .flag .bank[hidden] { display: none; }
        .flag .bank svg { width: 14px; height: 14px; flex: none; }
        .flag[data-weekend] .date { border-color: currentColor; }
        /* Light date text uses --link (9:1 on the white badge). Dark mode keeps --cyan. */
        html.light .flag .date { color: var(--link); }
        @keyframes day-roll {
            0% { box-shadow: 0 0 0 0 transparent; }
            30% { box-shadow: 0 0 0 3px color-mix(in srgb, var(--cyan) 55%, transparent), 6px 0 22px 2px color-mix(in srgb, var(--cyan) 55%, transparent); border-color: var(--cyan); }
            100% { box-shadow: 0 0 0 0 transparent; }
        }
        @keyframes day-roll-text { 30% { text-shadow: 0 0 10px var(--cyan); } }
        @keyframes day-roll-static {
            0%, 99.9% { outline: 2px solid var(--cyan); outline-offset: 2px; }
            100% { outline: none; }
        }
        .flag.rolled { animation: day-roll 900ms ease-out; }
        .flag.rolled .date { animation: day-roll-text 900ms ease-out; }
        @media (prefers-reduced-motion: reduce) {
            .flag.rolled { animation: day-roll-static 1200ms linear; }
            .flag.rolled .date { animation: none; }
        }
        /* Hour cells come from the track width: 10 from 1200px up, 8 at 601–1199px, 5 at ≤600px.
           1200px is a gate width, so the wide count stays here instead of moving to 1400px.
           cqi resolves against the nearest ancestor container, so --hour-w is set on the
           track's children, not on the track itself. Registered as a <length> so
           planner.js reads a px value (getComputedStyle) for drag, wheel and snap maths. */
        @property --hour-w { syntax: "<length>"; inherits: true; initial-value: 100px; }
        .track {
            container-type: inline-size; --hours-visible: 10;
            position: relative; height: 54px; overflow-x: clip; overflow-y: visible; border-radius: 10px;
            background: var(--track); border: 1px solid var(--line); touch-action: pan-y;
        }
        @media (max-width: 1199px) { .track { --hours-visible: 8; } }
        .track > * { --hour-w: calc(100cqi / var(--hours-visible)); }
        /* Room for the clock-change chip, which sits above the hour instead of on the digits. Every card
           reserves it when any card shows one, so the header-to-hours gap is the same in every card. */
        .stack:has(.hour[data-dst]) .track { margin-top: var(--gap-dst-reserve); }
        .strip { position: absolute; top: 0; left: 0; width: calc(96 * var(--hour-w)); height: 100%; display: flex; will-change: transform; }
        .hour {
            height: 100%; flex: 0 0 var(--hour-w);
            display: flex; align-items: center; justify-content: center;
            font-weight: 700; font-size: 0.85rem; color: var(--white);
            border-right: 1px solid var(--hour-edge);
        }
        .hour-num { line-height: 1; }
        .hour.dst-back, .hour.dst-forward {
            position: relative;
            border-inline-start: 2px dashed var(--slate-900);
        }
        html.dark .hour.dst-back, html.dark .hour.dst-forward { border-inline-start-color: var(--slate-50); }
        .dst-chip {
            position: absolute; z-index: 4; left: auto; right: calc(100% + 8px); bottom: calc(100% + 8px);
            display: flex; flex-direction: column; align-items: flex-start; gap: 1px;
            width: max-content; max-width: 16rem;
            padding: 5px 8px; border-radius: 8px; border: 1px solid var(--slate-900);
            background: var(--white); color: var(--slate-900);
            font-size: 0.8125rem; font-weight: 700; line-height: 1.3; text-align: start;
            white-space: nowrap; pointer-events: none;
        }
        html.dark .dst-chip { background: var(--slate-900); color: var(--slate-50); border-color: var(--slate-50); }
        .hour.work { background: var(--work); color: var(--work-ink); }
        .hour.shoulder { background: var(--shoulder); color: var(--shoulder-ink); }
        .hour.night {
            background: var(--night); color: var(--night-ink);
            background-image: repeating-linear-gradient(45deg, var(--night-stripe) 0 10px, transparent 10px 20px);
        }
        /* Weekend hours keep work/early/night colours. One attribute on the strip selects them;
           the cells themselves are not rewritten while the bar moves. Dots and wash are
           background layers, so they rasterize once inside the transformed strip. A dotted
           border plus a 999px inset shadow is a paint record on every hour. Forced colors
           drops background images, so the CanvasText border stays. */
        .hour.is-weekend {
            border-top: 0;
            box-shadow: none;
            background-image:
                radial-gradient(circle, var(--weekend-dot) calc(var(--weekend-mark) / 2), transparent calc(var(--weekend-mark) / 2 + 0.5px)),
                linear-gradient(var(--weekend-wash), var(--weekend-wash));
            background-size: calc(var(--weekend-mark) * 2) var(--weekend-mark), auto;
            background-repeat: repeat-x, no-repeat;
            background-position: left top, 0 0;
        }
        .hour.night.is-weekend {
            background-image:
                radial-gradient(circle, var(--weekend-dot) calc(var(--weekend-mark) / 2), transparent calc(var(--weekend-mark) / 2 + 0.5px)),
                linear-gradient(var(--weekend-wash), var(--weekend-wash)),
                repeating-linear-gradient(45deg, var(--night-stripe) 0 10px, transparent 10px 20px);
            background-size: calc(var(--weekend-mark) * 2) var(--weekend-mark), auto, auto;
            background-repeat: repeat-x, no-repeat, repeat;
            background-position: left top, 0 0, 0 0;
        }
        .sw.work { background: var(--work); }
        .sw.shoulder { background: var(--shoulder); }
        .sw.night { background: var(--night); }
        .sw.bank { background: var(--bank); }
        /* border-style: dotted does not paint on a small swatch. The weekend line sits on any
           hour colour, so the chip is only the dots, with a transparent fill. */
        .sw.weekend {
            width: 28px;
            background-color: transparent;
            background-image: repeating-linear-gradient(to right, var(--weekend-dot) 0 3px, transparent 3px 7px);
            background-size: auto var(--weekend-mark);
            background-repeat: repeat-x;
            background-position: left center;
        }
        @media (forced-colors: active) {
            .hour.is-weekend,
            .hour.night.is-weekend {
                box-shadow: none;
                background-image: none;
                border-top: 3px dotted CanvasText;
            }
            .hour.dst-back, .hour.dst-forward { border-inline-start: 2px dashed CanvasText; }
            .dst-chip { background: Canvas; color: CanvasText; border-color: CanvasText; }
            .flag .bank { color: CanvasText; }
            .sw.bank { background: CanvasText; forced-color-adjust: none; }
            .sw.weekend {
                background: Canvas;
                border: 1px solid CanvasText;
                border-top: 3px dotted CanvasText;
            }
        }
        html.light .sw.night { background-image: repeating-linear-gradient(45deg, var(--night-stripe) 0 3px, transparent 3px 6px); }
        html.light .sw:not(.weekend) { box-shadow: inset 0 0 0 1px var(--slate-900-18); }
        .add-row {
            display: flex; align-items: flex-start; justify-content: flex-start;
            gap: 12px; margin-block-start: calc(var(--gap-timeline-add) + var(--add-drop, 0px)); /* same 14px as the Now row above the timeline */
        }
        .add-row:has(#show-planner) { justify-content: center; }
        .add {
            margin: 0;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 0.5rem;
            background: var(--hot-fill);
            color: var(--hot-ink);
            border: 1px solid var(--hot-edge);
            border-radius: 14px;
            padding: 0 28px;
            min-block-size: 44px;
            font-size: var(--btn-size);
            font-weight: 700;
            font-family: inherit;
        }
        .add:focus-visible { outline: 3px solid var(--text); outline-offset: 2px; }
        .add-row #open-add, .add-row #show-planner { margin: 0; }
        footer {
            display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap;
            margin-top: 28px; padding-top: 18px; border-top: 1px solid var(--line);
            color: var(--muted); font-size: 1.05rem;
        }
        /* Homepage "Popular conversions" lives in the site footer (list filled by scripts/build-pairs.mjs). */
        .popular { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 14px; margin-top: 0; color: var(--muted); font-size: 0.85rem; }
        .popular h2 { font-size: inherit; font-weight: 600; }
        .popular ul { list-style: none; display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 0; padding: 0; }
        .popular a { color: inherit; text-underline-offset: 3px; }
        .popular a:hover { color: var(--text); }
        .popular a:focus-visible { outline: 3px solid var(--text); outline-offset: 2px; border-radius: 3px; }
        /* Homepage "Popular time zone conversions": the same list, on the page width, in body text color. */
        .home-pairs { max-width: 980px; margin: 0 auto; padding: 20px 28px 0; color: var(--text); font-size: 1rem; }
        .home-pairs a:hover { color: var(--text); text-decoration-thickness: 2px; }
        @media (max-width: 640px) { .home-pairs { padding: 16px 16px 0; } }
        .sw { width: 12px; height: 12px; border-radius: 3px; display: inline-block; margin-right: 6px; }
        .legend-gap { margin-left: 14px; }
        .modal {
            position: fixed; inset: 0; width: 100%; height: 100%; max-width: none; max-height: none;
            margin: 0; padding: 0; border: none; background: var(--ink-78); color: inherit; font: inherit;
            display: none; align-items: center; justify-content: center; z-index: 30;
        }
        .modal.open, .modal[open] { display: flex; }
        .modal::backdrop { background: transparent; }
        .sheet label[for="q"] { font-weight: 700; }
        .sheet {
            width: min(460px, calc(100% - 32px));
            background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 22px;
        }
        .sheet input {
            width: 100%; margin-top: 8px; background: var(--bg); color: var(--text);
            border: 1px solid var(--line); border-radius: 10px; padding: 12px;
        }
        .hits { margin-top: 10px; max-height: 220px; overflow: auto; }
        .add-foot { display: flex; justify-content: flex-end; align-items: center; gap: 8px; margin-top: 14px; }
        .add-attrib { margin-right: auto; color: var(--muted); font-size: 0.72rem; }
        .add-attrib a { color: inherit; }
        .hits button {
            width: 100%; text-align: left; background: none; color: var(--text);
            border: none; border-radius: 8px; padding: 8px 10px;
        }
        .hits button:hover, .hits button.selected { background: var(--neon-08); }
        .cdn-note { color: var(--amber-500); font-size: 0.8rem; margin-top: 6px; }
        .lbl-short { display: none; }
        @keyframes hot-pulse {
            0% { box-shadow: 0 0 0 0 var(--neon-70), 0 4px 18px var(--neon-32); }
            70% { box-shadow: 0 0 0 12px var(--neon-0), 0 4px 18px var(--neon-32); }
            100% { box-shadow: 0 0 0 0 var(--neon-0), 0 4px 18px var(--neon-32); }
        }
        .seg--hot.hot-pulse { animation: hot-pulse 1.6s ease-out 0.6s 3; }
        @media (prefers-reduced-motion: reduce) {
            .seg--hot.hot-pulse { animation: none; }
        }
        @media (forced-colors: active) {
            .cal-actions .btn:focus-visible { outline: 3px solid Highlight; outline-offset: 3px; }
            .now-zone { color: CanvasText; }
        }

        /* Add to Calendar dialog */
        .cal-dialog {
            width: min(500px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); margin: auto;
            background: var(--card); color: var(--text); border: 1px solid var(--line);
            border-radius: 18px; padding: 0; overflow: auto;
            box-shadow: 0 24px 60px var(--black-45);
        }
        .cal-dialog::backdrop { background: var(--ink-72); }
        html.light .cal-dialog::backdrop { background: var(--slate-900-45); }
        .cal-form { padding: 20px 22px 22px; display: flex; flex-direction: column; gap: 16px; }
        .cal-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
        .cal-head h2 { font-size: 1.2rem; font-weight: 700; }
        .cal-x {
            background: none; border: 1px solid var(--line); color: var(--muted); border-radius: 10px;
            width: 36px; height: 36px; font-size: 1.3rem; line-height: 1; font-family: inherit;
            display: inline-flex; align-items: center; justify-content: center;
        }
        .cal-x svg { width: 18px; height: 18px; }
        .cal-x:hover { color: var(--text); border-color: var(--cyan); }
        .cal-k { color: var(--muted); font-size: 0.75rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; }
        .cal-k-gap { margin-bottom: 8px; }
        .cal-start { font-size: 1.35rem; font-weight: 700; margin-top: 4px; font-variant-numeric: tabular-nums; }
        .cal-start small { display: block; color: var(--muted); font-size: 0.8rem; font-weight: 500; margin-top: 2px; }
        .cal-dur { border: none; }
        .cal-dur legend { margin-bottom: 8px; }
        /* Duration uses the dialog title's face, weight, and ink. Size stays 0.875rem
           and the uppercase kicker treatment stays. line-height: 1 keeps the line box
           1px shorter than the 15px normal box of the other kickers, and the extra
           0.0625rem of margin holds the buttons in place. */
        .cal-dur > legend.cal-k {
            font-family: Outfit, system-ui, sans-serif;
            font-weight: 700;
            color: var(--text);
            font-size: 0.875rem;
            line-height: 1;
            margin-bottom: 0.5625rem;
        }
        .dur-row { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; }
        .dur-btn {
            background: var(--bg); color: var(--text); border: 1px solid var(--line); border-radius: 10px;
            padding: 9px 4px; font: inherit; font-size: var(--btn-size); font-weight: var(--btn-weight); white-space: nowrap;
        }
        .dur-btn:hover { border-color: var(--cyan); }
        .dur-btn[aria-pressed="true"] { background: var(--btn-primary); border-color: var(--btn-primary); color: var(--white); }
        .dur-custom { display: flex; align-items: center; gap: 8px; margin-top: 10px; color: var(--muted); font-size: 0.85rem; }
        .dur-custom input {
            width: 84px; background: var(--bg); color: var(--text); border: 1px solid var(--line);
            border-radius: 8px; padding: 7px 9px; font: inherit; font-size: 0.9rem;
        }
        .dur-custom input:focus-visible, .dur-btn:focus-visible, .cal-x:focus-visible, .cal-actions .btn:focus-visible {
            outline: 3px solid var(--text); outline-offset: 2px;
        }
        .cal-cities { list-style: none; display: flex; flex-direction: column; gap: 6px; }
        .cal-city {
            display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 4px 12px;
            background: var(--bg); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px;
        }
        .cal-name { display: flex; align-items: center; gap: 8px; min-width: 0; }
        .cal-city b { font-size: 0.95rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
        .wkend-tag {
            flex: none; font-size: 0.72rem; font-weight: 700; line-height: 1.35;
            border: 1.5px solid currentColor; border-radius: 999px; padding: 1px 7px;
        }
        .cal-weekend { margin: 0 0 8px; font-size: 0.85rem; font-weight: 600; }
        .cal-city .span { font-variant-numeric: tabular-nums; font-weight: 700; font-size: 0.95rem; white-space: nowrap; }
        .cal-city .span .end { padding: 1px 6px; border-radius: 6px; }
        .cal-city .note { grid-column: 1 / -1; color: var(--muted); font-size: 0.75rem; }
        .cal-city.shoulder .end { background: var(--shoulder); color: var(--white); }
        .cal-city.night .end { background: var(--night); color: var(--white); }
        .cal-city.shoulder { border-color: color-mix(in srgb, var(--shoulder) 55%, transparent); }
        .cal-city.night { border-color: color-mix(in srgb, var(--night) 65%, transparent); }
        .cal-city.shoulder .note { color: var(--shoulder-text); }
        .cal-city.night .note { color: var(--night-text); }
        html.light .cal-city.shoulder .end { color: var(--shoulder-ink); }
        html.light .cal-city.night .end { color: var(--night-ink); }
        html.light .cal-city.shoulder { border-color: color-mix(in srgb, var(--shoulder-text) 45%, transparent); }
        html.light .cal-city.night { border-color: color-mix(in srgb, var(--night-text) 45%, transparent); }
        .cal-actions { display: flex; flex-direction: column; gap: 10px; }
        .cal-actions .btn, .act-share-actions .btn, .act-scan .btn { text-decoration: none; padding: 12px 14px; }
        .cal-actions .btn {
            width: 100%; min-width: 0; min-height: 44px; white-space: normal; line-height: 1.25; text-align: center;
            flex-direction: column; align-items: stretch; gap: 1px;
        }
        /* Balance the label inside the button. The button itself keeps its full width. */
        .cal-actions .cal-label { display: block; min-width: 0; max-width: 100%; overflow-wrap: break-word; text-wrap: balance; }
        /* Same ink as the button, so the smaller line stays at the 7:1 button contrast. */
        .cal-actions .cal-sub { display: block; min-width: 0; max-width: 100%; font-size: 0.75rem; font-weight: 600; line-height: 1.2; color: inherit; overflow-wrap: break-word; }
        .act-share, .act-scan { display: flex; flex-direction: column; gap: 10px; }
        /* Beats .cal-actions and .act-share { display: flex }. The hidden attribute stays hidden. */
        .cal-form [hidden] { display: none; }
        .act-share-actions { display: flex; flex-wrap: wrap; gap: 10px; }
        .act-share-actions .btn { flex: 1 1 auto; max-width: 100%; min-width: min(100%, max-content); }
        .act-link {
            width: 100%; min-width: 0; background: var(--bg); color: var(--text); border: 1px solid var(--line);
            border-radius: 10px; padding: 11px 12px; font: inherit; font-size: 0.82rem;
        }
        .act-preview {
            background: var(--bg); color: var(--text); border: 1px solid var(--line); border-radius: 10px;
            padding: 10px 12px; max-height: 150px; overflow: auto; white-space: pre;
            font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.74rem; line-height: 1.45;
        }
        .act-status { color: var(--muted); font-size: 0.8rem; margin-top: -6px; }
        .act-status:empty { display: none; }
        .act-link:focus-visible, .act-preview:focus-visible { outline: 3px solid var(--text); outline-offset: 2px; }
        /* City flags. Hidden on phones (under 641px). The day/week controls stay on their
           own row. The flag sits in the name row that is already there. It is taken out of
           flow, so a card with flags is the same height as a card without them. The header
           stays 52px, and the date pill keeps its gap to the city name and the hour bar. */
        .city-flag-anchor, .city-flag-tip { display: none; }
        @media (min-width: 641px) {
            .card {
                --edge-gap: 7px;
                --flag-w: 49.18px;
                --flag-h: calc(var(--flag-w) * 2 / 3);
                --label-room: 18px;
                --flag-inset: calc(var(--edge-gap) - 21px + 0.38 * var(--flag-w));
            }
            .city-line { position: relative; }
            .city-line:has(.city-flag-anchor) {
                padding-inline-start: calc(var(--flag-inset) + var(--flag-w) + 10px);
            }
            .city-flag-anchor {
                display: block;
                position: absolute;
                inset-inline-start: var(--flag-inset);
                inset-block-start: 50%;
                translate: 0 -50%;
                inline-size: var(--flag-w);
                block-size: var(--flag-h);
                z-index: 10;
            }
            .city-flags {
                display: inline-flex;
                align-items: center;
                justify-content: center;
                padding: 0;
                border: 0;
                background: none;
                color: inherit;
                font: inherit;
                line-height: 0;
                cursor: default;
            }
            .city-flags:focus-visible { outline: 3px solid var(--text); outline-offset: 2px; border-radius: 4px; }
            .city-flag-face {
                position: relative;
                width: var(--flag-w);
                height: var(--flag-h);
            }
            .city-flag-badge {
                position: relative;
                display: block;
                width: var(--flag-w);
                height: var(--flag-h);
                border-radius: 4px;
                overflow: hidden;
                border: 1px solid var(--slate-900-55);
                box-shadow:
                    inset 0 1px 0 var(--white-65),
                    0 1px 2px var(--slate-900-35),
                    0 3px 8px var(--slate-900-22);
            }
            .city-flag-img { display: block; width: 100%; height: 100%; object-fit: cover; }
            .city-flag-badge::after {
                content: "";
                position: absolute;
                inset: 0;
                border-radius: inherit;
                background: linear-gradient(180deg, var(--white-50), var(--white-06) 42%, var(--black-20));
                pointer-events: none;
            }
            .city-flags--region .city-flag-badge:not(.city-flag-badge--region) {
                box-shadow:
                    inset 0 1px 0 var(--white-65),
                    0 1px 2px var(--slate-900-28),
                    0 0 0 1px color-mix(in srgb, var(--cyan) 34%, transparent),
                    0 0 7px 1px color-mix(in srgb, var(--cyan) 36%, transparent);
                animation: flag-rest-glow 1.8s ease-in-out infinite;
            }
            @keyframes flag-rest-glow {
                0%, 100% {
                    box-shadow:
                        inset 0 1px 0 var(--white-65),
                        0 1px 2px var(--slate-900-28),
                        0 0 0 1px color-mix(in srgb, var(--cyan) 28%, transparent),
                        0 0 5px 1px color-mix(in srgb, var(--cyan) 28%, transparent);
                }
                50% {
                    box-shadow:
                        inset 0 1px 0 var(--white-65),
                        0 1px 2px var(--slate-900-28),
                        0 0 0 1px color-mix(in srgb, var(--cyan) 48%, transparent),
                        0 0 9px 2px color-mix(in srgb, var(--cyan) 42%, transparent);
                }
            }
            .city-flag-badge--region {
                position: absolute;
                inset-inline-start: 0;
                inset-block-start: 0;
                z-index: 2;
                opacity: 0;
                translate: 0 0;
                pointer-events: none;
                transition: opacity 180ms ease, translate 180ms ease, box-shadow 180ms ease;
            }
            .city-flag-tip {
                display: block;
                position: absolute;
                inset-inline-start: calc(var(--flag-w) + 10px);
                inset-block-start: calc(-0.48 * var(--flag-h) - var(--label-room));
                z-index: 9;
                opacity: 0;
                pointer-events: none;
                transition: opacity 180ms ease;
            }
            .city-flag-tip__text:has(.city-flag-tip__region) {
                display: flex;
                flex-direction: column;
                align-items: center;
            }
            .city-flag-tip__bubble {
                --tip-pad-x: 7px;
                --tip-border: 1px;
                display: flex;
                align-items: center;
                justify-content: center;
                text-align: center;
                margin-inline-start: calc(-1 * (var(--tip-pad-x) + var(--tip-border)));
                padding-block: 8px;
                padding-inline: var(--tip-pad-x);
                border-radius: 8px;
                background: var(--ink);
                color: var(--white);
                border: var(--tip-border) solid color-mix(in srgb, var(--neon) 45%, transparent);
                box-shadow: 0 8px 22px var(--black-35);
                font-family: Outfit, "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic", "Yu Gothic UI", Meiryo, "PingFang SC", "Noto Sans JP", "Noto Sans CJK JP", "Source Han Sans JP", "WenQuanYi Micro Hei", "Droid Sans Fallback", sans-serif;
                font-size: 0.95rem;
                font-weight: 600;
                line-height: 1.4;
                letter-spacing: 0.01em;
                white-space: nowrap;
            }
            html.light .city-flag-tip__bubble {
                background: var(--white);
                color: var(--slate-900);
                border-color: color-mix(in srgb, var(--sky-600) 40%, transparent);
                box-shadow: 0 8px 22px var(--slate-900-16);
            }
            .city-flag-anchor:has(.city-flags.is-open) .city-flag-badge--region {
                opacity: 1;
                translate: -38% -48%;
                box-shadow:
                    inset 0 1px 0 var(--white-65),
                    0 1px 2px var(--slate-900-28),
                    0 0 0 1px color-mix(in srgb, var(--cyan) 40%, transparent),
                    0 0 8px 1px color-mix(in srgb, var(--cyan) 40%, transparent);
            }
            .city-flag-anchor:has(.city-flags.is-open) .city-flag-tip { opacity: 1; }
        }
        @media (min-width: 641px) and (hover: hover) and (pointer: fine) {
            .city-flag-anchor:is(:hover, :focus-within:has(:focus-visible)) .city-flag-badge--region {
                opacity: 1;
                translate: -38% -48%;
                box-shadow:
                    inset 0 1px 0 var(--white-65),
                    0 1px 2px var(--slate-900-28),
                    0 0 0 1px color-mix(in srgb, var(--cyan) 40%, transparent),
                    0 0 8px 1px color-mix(in srgb, var(--cyan) 40%, transparent);
            }
            .city-flag-anchor:is(:hover, :focus-within:has(:focus-visible)) .city-flag-tip { opacity: 1; }
        }
        @media (min-width: 641px) and (prefers-reduced-motion: reduce) {
            .city-flag-badge--region, .city-flag-tip { transition: none; }
            .city-flags--region .city-flag-badge:not(.city-flag-badge--region) { animation: none; }
        }
        @media (min-width: 641px) and (pointer: coarse) {
            .city-flags { min-block-size: 44px; margin-block: -6px; }
        }
        @media (forced-colors: active) {
            .city-flags--region { outline: 2px solid Highlight; outline-offset: 2px; }
            .city-flag-tip__bubble { border-color: CanvasText; }
        }
        @media (max-width: 600px) {
            .track { --hours-visible: 5; }
            .lbl-long { display: none; }
            .lbl-short { display: inline; }
            .dur-row { grid-template-columns: repeat(3, 1fr); }
            .cal-form { padding: 12px 14px 12px; gap: 10px; }
            .cal-actions { gap: 8px; }
            .cal-actions .btn { padding: 8px 12px; }
            main { padding: 16px 12px 48px; }
            .hint-row { flex-direction: column; gap: 4px; font-size: 0.95rem; }
            .sync-label { font-size: 1rem; }
            .corner { font-size: 0.85rem; }
            .card .remove {
                display: inline-flex; align-items: center; justify-content: center;
                width: 44px; height: 44px; padding: 0;
            }
            .remove-lbl { display: none; }
            .card h2 {
                cursor: default; text-decoration: none; overflow-wrap: anywhere; text-underline-offset: 4px;
                min-block-size: 2lh; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden;
            }
            .hour { justify-content: flex-start; padding-inline-start: 8px; }
            .dst-chip-long { display: none; }
            .stack:has(.hour[data-dst]) .track { margin-top: var(--gap-dst-reserve-600); }
            .stack.overlap-above .overlap-label {
                transform: none; border-radius: 10px 10px 0 0;
                white-space: normal; text-align: center;
            }
            .stack.overlap-above .overlap-summary {
                border-top-width: 0; border-radius: 0 0 10px 10px; text-align: center;
            }
            .add-row { justify-content: space-between; }
            /* Name block stays left of the time badge (which starts 14px right of centre); Remove wraps under the name. */
            .card-head > div:not(.flag) { max-width: calc(50% - 6px); }
            .city-line { flex-wrap: wrap; row-gap: 6px; flex-direction: column; align-items: flex-start; }
            /* Same header height on every card: the name always gets two lines of room
               (clamped at two), so does the zone line under it, and Remove always sits on its own row, so the hours row
               starts at the same offset whether the name wraps or not. */
            .card-head p { min-block-size: 2lh; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
            /* Slightly tighter time badge so it fits inside the card at 360px. */
            /* Time badge: time on top, date + offset underneath, so it stays inside the card in 12H at 360px. */
            .flag { display: grid; grid-template-columns: auto auto; gap: 2px 6px; padding: 5px 8px; white-space: nowrap; justify-items: start; top: -2px; bottom: auto; }
            .flag b { grid-column: 1 / -1; grid-row: 1; font-size: 0.95rem; }
            .flag span, .flag em { font-size: 0.7rem; }
            .flag em { padding: 1px 4px; }
            .card-head { margin-bottom: var(--gap-card-head-600); }
            .jump { padding: 5px 8px; white-space: nowrap; }
        }
        /* Touch screens: 44px targets for the day/week jumps (after the phone rules so the padding wins). */
        @media (pointer: coarse) {
            .jump { min-block-size: 44px; min-inline-size: 44px; padding-inline: 12px; }
        }
        @media (pointer: coarse) and (max-width: 380px) {
            .jump { padding-inline: 10px; }
        }
        /* 1rem labels need less side padding below 370px, or +1 Week crosses the card. */
        @media (max-width: 370px) {
            .jump { padding-inline: 3px; }
        }
        /* 44px targets. min-block-size / min-inline-size so the label can grow the control.
           The header segments set their own sizes (see "Header" at the end of this file). */
        .jump,
        .remove {
            min-block-size: 44px;
            min-inline-size: 44px;
        }
        /* Homepage explainer + site footer. The planner fills the first screen (main min-height); this sits below the fold. */
        main { min-height: calc(100svh - var(--hdr, 160px)); }
        .explainer { max-width: 980px; margin: 0 auto; padding: 56px 28px 40px; border-top: 1px solid var(--line); line-height: 1.6; }
        .explainer h2 { font-size: 1.6rem; line-height: 1.25; margin-bottom: 10px; }
        .explainer h3 { font-size: 1.08rem; margin-bottom: 6px; }
        .explainer .lead { color: var(--muted); font-size: 1.1rem; max-width: 720px; }
        html.light .explainer .lead,
        html.light .faq details p { color: var(--slate-700); }
        .explainer a { color: var(--cyan); text-underline-offset: 3px; }
        html.light .explainer a { color: var(--link); }
        .explainer a:focus-visible { outline: 3px solid var(--text); outline-offset: 2px; border-radius: 3px; }
        .steps { list-style: none; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin: 26px 0 40px; counter-reset: step; }
        .steps > li { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 18px 20px; counter-increment: step; }
        .steps h3::before {
            content: counter(step); display: inline-grid; place-items: center; width: 26px; height: 26px; margin-right: 10px;
            border-radius: 50%; background: color-mix(in srgb, var(--cyan) 16%, transparent); color: var(--cyan); font-size: 0.85rem;
        }
        html.light .steps h3::before { color: var(--link); }
        .steps p { color: var(--muted); font-size: 0.98rem; }
        .steps p + p { margin-top: 8px; }
        .steps b { color: var(--text); font-weight: 600; }
        .colour-key { list-style: none; display: grid; gap: 6px; margin-top: 8px; color: var(--muted); font-size: 0.98rem; }
        .colour-key .sw { vertical-align: -1px; }
        .faq { margin-top: 14px; }
        .explainer .demo-link { margin-top: 18px; }
        /* Hover is the popular-link text color. */
        .explainer .demo-link a:hover,
        html.light .explainer .demo-link a:hover { color: var(--text); }
        @media (max-width: 700px) {
            .steps { grid-template-columns: 1fr; }
            .explainer { padding: 40px 16px 32px; }
            .explainer h2 { font-size: 1.35rem; }
        }
        /* About 16px between the planner, the explainer, and the footer.
           The legend rule sets margin-top on every footer; the site footer must not keep it. */
        @media (max-width: 480px) {
            main { padding-bottom: 0; }
            .explainer { padding-top: 16px; padding-bottom: 0; }
        }
        /* Suggested overlap. The frame is a child of .overlap-clip, which is the
           same size as the hour tracks and uses the same overflow: hidden the
           cells use, so a scrolled window is cut at the track edge instead of
           painting in the page margin. Label and summary are absolute siblings
           so they can sit on the lower edge without being clipped and without
           growing the stack (that padding was stretching the playhead and
           pushing Add a city). Hollow 3px frame, 10px like the track. #5B21B6
           stays: on the dark page it is stronger than #4C1D95, and the 1px ring
           separates the stroke from the hour fills. Pointer events stay off so
           dragging and the jump buttons still work. The frame, its label, and
           the times box paint over the centre line, its glow, and the lower
           half-circle wherever they cross. */
        .overlap-clip {
            position: absolute;
            z-index: 6;
            overflow: hidden;
            border-radius: 10px;
            pointer-events: none;
        }
        .overlap-bracket {
            position: absolute;
            box-sizing: border-box;
            border: 3px solid var(--violet);
            border-radius: 10px;
            pointer-events: none;
            /* Identity translate so the intro glide does not create a stacking
               context only after the first animated frame. */
            translate: 0;
        }
        /* The clip is the same height as the tracks and hides overflow, so the
           outer ring is cut off along the top and bottom. In dark theme those
           bands are drawn inside the stroke: 2px white. #ffffff is 5.0:1 on
           the amber hours, 5.5:1 on the green, and 8.3:1 on the red. The 1px
           outer ring stays for the left and right edges, which the clip does
           not cut. Light theme is unchanged. */
        html.dark .overlap-bracket {
            box-shadow:
                0 0 0 1px var(--slate-50),
                inset 0 2px 0 0 var(--white),
                inset 0 -2px 0 0 var(--white);
        }
        html.light .overlap-bracket { box-shadow: 0 0 0 1px var(--slate-900); }
        .overlap-label,
        .overlap-summary {
            position: absolute;
            z-index: 6;
            box-sizing: border-box;
            margin: 0;
            pointer-events: none;
        }
        .overlap-label {
            transform: translate(-50%, -50%);
            padding: 0.2rem 0.75rem;
            border-radius: 999px;
            background: var(--violet);
            color: var(--white);
            font-size: 1rem;
            font-weight: 700;
            line-height: 1.35;
            white-space: nowrap;
            max-inline-size: 100%;
            overflow: hidden;
        }
        .overlap-summary {
            padding: 0.35rem 0.7rem;
            border: 2px solid var(--violet);
            border-radius: 10px;
            background: var(--white);
            color: var(--violet);
            font-size: 1rem;
            font-weight: 700;
            line-height: 1.35;
            overflow-wrap: break-word;
            white-space: normal;
            overflow: hidden;
            /* As tall as the city rows. The script pins the bottom edge to
               Add a city, and moves the top to just below the badge when that
               pin would cover it. Extra rows then hang below the pin, so the
               badge and the rows both stay whole. Following the window sets
               translate with no transition; the left/right switch sets
               translate 0.3s in script, and only then. */
            block-size: auto;
            transition: none;
            /* Identity translate so the window-follow move does not create a
               stacking context only after the first placement. */
            translate: 0;
        }
        .overlap-summary:not([hidden]) {
            display: flex;
            flex-wrap: wrap;
            align-items: flex-end;
            align-content: flex-end;
        }
        .summary-city { white-space: nowrap; }
        /* Leads main (under the pair h1), above the Now row, so the Now row
           keeps home's gap to the timeline. */
        .overlap-none {
            margin-block: 0 12px;
            margin-inline: auto;
            max-inline-size: 40em;
            text-align: center;
            color: var(--text);
            font-size: 1.2rem;
            font-weight: 700;
            line-height: 1.4;
        }
        .overlap-none[hidden] { display: none; }
        /* Phone source order is summary, Add a city, timeline (the no-green line leads main).
           This slot is the summary's border box (1rem type, line-height 1.35,
           0.35rem block padding, 2px border) so the timeline is already in its
           final place when the sentence is shown and this slot is removed.
           Two nowrap city lines share a row only once the content box clears
           about 397px, which is a viewport of about 448px with the phone main
           padding. 375 and 390 stay on two lines. */
        .verdict-reserve { display: none; }
        .card-reserve .jump,
        .card-reserve .remove {
            display: inline-flex;
            align-items: center;
            justify-content: center;
        }
        /* Below 768px the verdict is the first planner block: the summary, the
           no-green sentence when it is open, then Add a city. The box is in
           normal flow above the stack, full width, and as tall as its lines,
           so nothing clips it and the playhead cannot cross it. */
        @media (max-width: 767px) {
            .verdict-reserve {
                display: block;
                box-sizing: border-box;
                font-size: 1rem;
                line-height: 1.35;
                min-block-size: calc(1.35em + 0.7rem + 4px);
                margin: 0;
            }
            main:has(#overlap-summary:not([hidden])) .verdict-reserve,
            .verdict-reserve[hidden] { display: none; }
            main > .overlap-summary {
                position: relative;
                inset: auto;
                z-index: 1;
                inline-size: 100%;
                max-inline-size: 100%;
                margin: 0;
                overflow: visible;
                block-size: auto;
                translate: none;
            }
            main > .overlap-none {
                margin-block: 0 12px;
                max-inline-size: none;
            }
            main > .add-row { margin-block: var(--gap-timeline-add-767-start) var(--gap-timeline-add-767-end); }
        }
        @media (max-width: 447px) {
            .verdict-reserve { min-block-size: calc(2.7em + 0.7rem + 4px); }
        }
        @media (prefers-reduced-motion: reduce) {
            .overlap-summary { transition: none; }
        }
        @media (forced-colors: active) {
            .overlap-bracket,
            html.dark .overlap-bracket,
            html.light .overlap-bracket { border-color: CanvasText; box-shadow: none; }
            .overlap-label, .overlap-summary {
                background: Canvas;
                color: CanvasText;
                border: 2px solid CanvasText;
            }
        }
        .scan-badge {
            position: static;
            margin: 0;
            padding: 0.15rem 0.45rem;
            border-radius: 999px;
            background: var(--slate-900);
            color: var(--slate-50);
            font-size: 0.8rem;
            font-weight: 700;
            line-height: 1.2;
            white-space: nowrap;
            pointer-events: none;
        }
        .scan-badge:empty { display: none; }
        .scan-popup {
            width: min(480px, calc(100vw - 24px));
            max-height: calc(100dvh - 24px);
            margin: auto;
            background: var(--card);
            color: var(--text);
            border: 1px solid var(--line);
            border-radius: 18px;
            padding: 0;
            overflow: auto;
            box-shadow: 0 24px 60px var(--black-45);
        }
        .scan-popup::backdrop { background: var(--ink-72); }
        html.light .scan-popup::backdrop { background: var(--slate-900-45); }
        .scan-popup-form { padding: 20px 22px 22px; display: flex; flex-direction: column; gap: 14px; align-items: center; }
        .scan-popup-form .cal-head { width: 100%; }
        .scan-popup img {
            display: block;
            width: min(420px, 72vw);
            height: auto;
            background: var(--white);
            border-radius: 8px;
            forced-color-adjust: none;
        }
        @media (max-width: 820px) {
            .scan-mobile { display: none; }
        }
        @media (prefers-reduced-motion: reduce) {
            .scan-mobile { animation: none; transition: none; }
        }
        /* The header, logo and Site nav styles are in assets/components.css. */

/* Phones: a long holiday label on a city flag ("Holiday in New York: Election Day") wraps instead of widening the page. */
.flag{min-width:0;max-width:100%}
.flag .holiday{white-space:normal;overflow-wrap:anywhere}
/* Narrow phones: a long city phrase in the overlap sentence ("Central European Time 15:00–17:00 GMT+1") may wrap too. */
@media (max-width:400px){.summary-city{white-space:normal}}
