/* ===================================================================
   Home — Today + Terminal (2026-09-01)

   Paired with js/home-terminal.js. The terminal's own card/lane styles
   (.dt5-*) come from departures-v5.css and are NOT restated here — the
   markup is the same renderer, so it must wear the same clothes.

   This file covers: the tightened home top, the ring as a tap target,
   and the Today strip.
   =================================================================== */

/* ── tightened top ──────────────────────────────────────────────────
   The three-line acronym became one line, and the four quick buttons
   under the ring became a tap ON the ring. Together that is roughly
   110px, which is what puts Today above the fold. */
.dpad-home-header--tight { padding: 8px 20px 0 !important; }
.dpad-home-header--tight .dpad-home-tagline {
    font-size: 13px !important;
    letter-spacing: .14em;
    line-height: 1.2 !important;
    opacity: .5;
}

/* ── the ring as a button ───────────────────────────────────────────
   It was a static SVG; it is now the only way into Activity / Games /
   Steps. Reset the button chrome so it still reads as the ring, and
   keep a visible focus ring for keyboard users. */
.dpad-ring-tap {
    display: block;
    width: 100%;
    background: none;
    border: none;
    padding: 0;
    margin: 0;
    font: inherit;
    color: inherit;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: transform .16s ease;
}
.dpad-ring-tap:active { transform: scale(.985); }
.dpad-ring-tap:focus-visible {
    outline: 2px solid var(--accent-gold, #FFD93D);
    outline-offset: 4px;
    border-radius: 16px;
}
.dpad-ring-hint {
    display: block;
    margin-top: 6px;
    font-family: var(--font-mono, monospace);
    font-size: 8.4px;
    letter-spacing: .16em;
    text-transform: uppercase;
    color: rgba(26, 26, 26, .38);
}

/* ── section headings, matching the terminal's lane headings ── */
/* Flex items, same story as #home-terminal — never let the column squeeze
   them below their content. */
#home-today-wrap,
.dpad-home-content .intel-triple-ring,
.dpad-home-content .dpad-home-header { flex: 0 0 auto; }

.home-sec-hd {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
    /* .tab-panel already pays the 20px side padding — don't pay it twice. */
    padding: 4px 0 8px;
}
.home-sec-hd h2 {
    font-family: var(--font-display, sans-serif);
    font-weight: var(--font-display-weight, 700);
    font-size: 13px;
    letter-spacing: .03em;
    margin: 0;
}
.home-sec-hd span { font-size: 10px; color: rgba(26, 26, 26, .55); }

/* Daily / Weekly / Monthly — replaces the old "Today" heading (2026-09-14). */
.home-sec-hd { align-items: center; }
.home-cad {
    display: flex;
    gap: 3px;
    padding: 3px;
    border-radius: 100px;
    background: rgba(26, 26, 26, .06);
}
.home-cad-tab {
    border: 0;
    background: transparent;
    padding: 6px 12px;
    border-radius: 100px;
    font-family: var(--font-display, sans-serif);
    font-weight: var(--font-display-weight, 700);
    font-size: 11px;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: rgba(26, 26, 26, .5);
    cursor: pointer;
    white-space: nowrap;
    -webkit-tap-highlight-color: transparent;
}
.home-cad-tab.is-on {
    background: var(--ink, #1a1a1a);
    color: var(--paper, #F4F1EA);
    box-shadow: 0 1px 3px rgba(0, 0, 0, .18);
}
.home-sec-hd #home-today-reset { white-space: nowrap; }
.home-tdy-empty {
    flex: 1 0 auto;
    padding: 22px 4px;
    font-family: var(--font-ui, sans-serif);
    font-size: 13px;
    color: rgba(26, 26, 26, .5);
}

/* ── Today ──────────────────────────────────────────────────────────
   Bucket-coloured, same palette as the lane picker and the board, so a
   GO card is the same red everywhere in the app. */
.home-today {
    display: flex;
    gap: 9px;
    overflow-x: auto;
    /* A rail should run off the edge of the screen, not stop 20px short — so
       cancel .tab-panel's padding and re-pay it inside, where it becomes the
       first card's inset instead of a dead margin the scroll can't use. */
    margin: 0 -20px;
    padding: 0 20px 14px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}
.home-today::-webkit-scrollbar { height: 0; }

.home-tdy {
    flex: 0 0 158px;
    text-align: left;
    border-radius: 13px;
    padding: 11px 12px;
    border: 1.5px solid var(--dt-bucket-edge, rgba(26, 26, 26, .14));
    background: var(--dt-bucket-wash, #fff);
    font-family: inherit;
    color: inherit;
    cursor: pointer;
    transition: transform .14s ease;
}
.home-tdy:active { transform: scale(.98); }
.home-tdy.is-done { opacity: .62; }
.home-tdy.is-claimable {
    border-color: var(--accent-gold, #FFD93D);
    box-shadow: 0 0 0 3px rgba(255, 217, 61, .22);
}

.home-tdy-chip {
    display: inline-block;
    font-family: var(--font-mono, monospace);
    font-size: 7.4px;
    letter-spacing: .13em;
    color: #fff;
    background: var(--dt-bucket-ink, #333);
    padding: 2px 6px;
    border-radius: 100px;
    margin-bottom: 6px;
}
.home-tdy-t {
    display: block;
    font-size: 12.5px;
    font-weight: 700;
    line-height: 1.32;
}
.home-tdy-m {
    display: block;
    font-size: 10px;
    color: rgba(26, 26, 26, .6);
    margin-top: 4px;
}
.home-tdy-bar {
    display: block;
    height: 4px;
    border-radius: 100px;
    background: rgba(26, 26, 26, .1);
    margin-top: 8px;
    overflow: hidden;
}
.home-tdy-bar i {
    display: block;
    height: 100%;
    border-radius: 100px;
    background: var(--dt-bucket-hue, #333);
}
.home-tdy-flag {
    display: block;
    margin-top: 7px;
    font-family: var(--font-mono, monospace);
    font-size: 8px;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: #8a6d00;
}
.home-tdy-flag.is-done { color: rgba(26, 26, 26, .4); }

/* ── the terminal on Home ───────────────────────────────────────────
   departures-v5.css scopes its lane styles under body.dep-v5, which is
   set globally, so the .dt5-* rules already apply here. The one thing
   that does NOT carry over is the dark sheet background the terminal
   sat on inside Departures — on Home it sits on paper. */
#home-terminal { padding-top: 2px; }
#home-terminal:empty { display: none; }

@media (prefers-reduced-motion: reduce) {
    .dpad-ring-tap, .home-tdy { transition: none; }
}

/* ===================================================================
   Merged history modal — Activity / Games / Steps (2026-09-01)

   The tab strip that used to be four quick buttons under the ring.
   intel-earnings.css already styles .history-tab, but ONLY scoped under
   #departures-content, so the modal's own strip needs its own rules —
   deliberately the same look, since it is the same control.
   =================================================================== */

#history-modal .history-tabs {
    display: flex;
    border-bottom: 1px solid rgba(0, 0, 0, .08);
    background: rgba(244, 241, 234, .95);
    flex: none;
}
#history-modal .history-tab {
    flex: 1;
    padding: 13px 10px;
    background: none;
    border: none;
    font-family: var(--font-display, 'Archivo Black', sans-serif);
    font-weight: var(--font-display-weight, 700);
    font-size: 11.5px;
    letter-spacing: .08em;
    color: rgba(0, 0, 0, .4);
    cursor: pointer;
    position: relative;
    transition: color .25s;
}
#history-modal .history-tab.active { color: #b38728; }
#history-modal .history-tab.active::after {
    content: '';
    position: absolute;
    bottom: 0; left: 22px; right: 22px;
    height: 2px;
    background: #b38728;
    border-radius: 2px 2px 0 0;
}

/* Panels: only the active one shows. The generic .history-panel rule is
   also scoped to #departures-content upstream, so restate it here. */
#history-modal .history-panel { display: none; }
#history-modal .history-panel.active { display: block; }

@media (prefers-reduced-motion: reduce) {
    #history-modal .history-tab { transition: none; }
}

/* ===================================================================
   The Terminal's surface on Home (2026-09-01)

   THE BUG IT FIXES: departures-v5.css hard-codes the terminal's text to
   #fff (.dt5-lane-hd h2, .dt5-c-t, .dt5-c-f …) scoped under body.dep-v5,
   which is set globally. On Home's paper that was white-on-cream.

   THE SURFACE: #E8E0D0 — the header band behind the profile pic, boost
   button and miles counter (style.css:9, rgba(232,224,208,.82)). Home's
   page is #F4F1EA, so the terminal is a slightly deeper tone of the same
   sand: enough to read as its own zone, not enough to feel bolted on.
   That is the Costa shape — a band of a different tone with a curved top,
   not a hole punched in the page.

   THE COST: a light surface means the terminal's white text has to become
   ink, which is what everything below does. Scoped to #home-terminal so
   departures-v5.css and its legacy in-Departures page are untouched.

   NOT flipped, on purpose:
   - the marquee (.dt5-m-t/.dt5-m-s) keeps white text: those sit on
     artwork behind a scrim, so they were never relying on the page.
   - .dt5-all stays a dark pill: it is a button, and one dark anchor at
     the foot of a light surface is the point of it.
   - .dt5-pass already used ink (#2a2113) on its own cream-and-gold, so it
     needs no recolour — only a defined edge, since "light card on dark
     page" became "light card on light page".
   =================================================================== */

#home-terminal {
    /* .dpad-home-content is `display:flex; flex-direction:column`, so every
       section here is a flex ITEM and inherits flex-shrink:1. That let the
       terminal be squeezed to its min-height while its content carried on
       painting past the background. flex:none sizes it from content. */
    flex: 0 0 auto;
    background: #E8E0D0;
    color: var(--ink, #1a1a1a);
    border-radius: 22px 22px 0 0;
    border-top: 1px solid rgba(26, 26, 26, .07);
    padding: 18px 0 28px;
    /* Cancel .tab-panel's 20px so the surface goes edge to edge, and eat its
       bottom padding too — this is the last thing on Home. The lanes keep
       their own 15px inset from departures-v5.css. */
    margin: 14px -20px -20px;
    min-height: 40vh;
}
#home-terminal:empty { display: none; margin: 0; padding: 0; min-height: 0; }

/* A grab-handle lip so the curved join reads as a surface arriving. */
#home-terminal::before {
    content: '';
    display: block;
    width: 42px;
    height: 4px;
    border-radius: 100px;
    background: rgba(26, 26, 26, .14);
    margin: -4px auto 16px;
}

/* Lane rows scroll inside the surface, not the page. */
#home-terminal .dt5-lane {
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}
#home-terminal .dt5-lane::-webkit-scrollbar { height: 0; }

/* ── white → ink ───────────────────────────────────────────────────── */
#home-terminal .dt5-lane-hd h2 { color: var(--ink, #1a1a1a); }
#home-terminal .dt5-c-t        { color: var(--ink, #1a1a1a); }
#home-terminal .dt5-g          { color: var(--ink, #1a1a1a); }
/* .58 was the obvious mirror of the dark page's rgba(255,255,255,.55), but on
   sand it lands at 3.92:1 — under AA. .68 is the first step that clears it. */
#home-terminal .dt5-c-f        { color: rgba(26, 26, 26, .68); }
#home-terminal .dt5-g span     { color: rgba(26, 26, 26, .68); }

/* The lane "by" chip was gold-on-gold for a dark page — #FFD93D on sand is
   about 1.3:1. Same idea, darkened to the brand's #b38728 family. */
#home-terminal .dt5-lane-by {
    color: #6d4f10;
    background: rgba(179, 135, 40, .14);
    border-color: rgba(179, 135, 40, .34);
}

/* Carousel dots: white-on-dark becomes ink-on-sand. */
#home-terminal .dt5-dots i { background: rgba(26, 26, 26, .18); }
#home-terminal .dt5-dots i.on { background: #b38728; }

/* ── surfaces that were dark card stock ────────────────────────────── */
/* Art placeholder: a warm tint of the surface, not a dark hole.
   background-IMAGE, never the `background` shorthand: the shorthand resets
   background-size/position, and departures-v5.css sets `cover`/`center` as
   separate longhands (css:877-878). Overriding with the shorthand won the
   cascade and silently reset those, so every stamp and sponsor image rendered
   at natural size in the top-left corner — which read as "the images are
   gone". A card WITH art carries its url inline and paints over this. */
#home-terminal .dt5-c-art {
    background-image: linear-gradient(150deg, #DCD2BC 0%, #CFC3A9 100%);
}
#home-terminal .dt5-c-ico { color: rgba(26, 26, 26, .35); opacity: 1; }

/* Browse tiles: a card on the surface needs to be lighter than it, and
   carry its own edge — the opposite of how they worked on the dark page. */
#home-terminal .dt5-g {
    background-image: none;
    background-color: #FAF7F0;
    border-color: rgba(26, 26, 26, .1);
}
#home-terminal .dt5-g.is-pinned {
    background-image: linear-gradient(140deg, #FFF6DA 0%, #F6E9C4 100%);
    border-color: rgba(179, 135, 40, .45);
}

/* The Boarding Pass was the light thing on a dark page; on a light surface
   it needs a drawn edge instead of a tonal one. */
#home-terminal .dt5-pass {
    border: 1px solid rgba(179, 135, 40, .38);
    box-shadow: 0 4px 16px rgba(60, 46, 18, .12);
}

/* The "All series" pill stays dark on purpose — a button, and the one
   anchor at the foot of the surface. */
#home-terminal .dt5-all {
    background-color: #2a2113;
    background-image: none;
    border-color: rgba(26, 26, 26, .12);
    color: #fff;
}

/* ── the series view, opened from the Terminal on Home ──────────────
   It now mounts on document.body (departures-series-view.js), so the rules
   that scoped it to a surface no longer reach it. departures-v5.css hides it
   by default and shows it under body.dep-v5.dt-series-active — dep-v5 is set
   globally so that still applies, but its z:30 used to sit inside
   #departures-content's stacking context. On body it competes with the tab
   bar and header directly, so pin it between them: above the tab bar
   (--z-sticky 200), below the app header (--z-header 1200), which keeps the
   miles counter and boost button visible the way every other overlay does. */
body.dt-series-active .dt-series-view {
    z-index: 300;
    background: var(--paper, #F4F1EA);
}
