/* ====================================================================
   SCREEN 05 — CHECKOUT, THE DESKTOP LAYER (desktop slice D3, 2026-10-08)

   Frames built: 05-d (delivery, 1280), 05-d-pickup, 05-d-forms (the
   details while she types, the card's states), 05-d-narrow (1000),
   05-d-states. Source: docs/design/pharmacy/screens/05/desktop/
   {README.md,frame.html} and the two Screen 05 records in
   screens/desktop-01-14/records/ (work order + design pass, folded).

   Tiers: >=901 the column, the head, the option cards, the details card,
   the prescription card, D0's fixed foot bar (901-1119); >=1120 the
   sticky 340 card (counter head, the order's lines, What you pay, the
   commit). The phone (<=900) is untouched: every rule below sits inside a
   min-width query, and the desktop frame itself is built by
   js/pharmacy/task-frame.js only from 901.

   Load order: app.css -> desktop/shared.css -> this file. Class prefix
   .vm-ck- (the page's own). D0 classes used as they are: .vm-dt-wrap,
   .vm-dt-cols, .vm-dt-aside, .vm-dt-foot-bar, .vm-dt-side-head (+ cover,
   id, name, sub), .vm-dt-lines / .vm-dt-line*, .vm-dt-dim; and since
   slice D7 the side card's shell, the head's band form, the store tile
   and the failure line (.vm-dt-side-shell, .vm-dt-side-head--band,
   .vm-dt-cover-tile, .vm-dt-card-fail), which checkout.js sets beside
   the page's own classes.

   Sections, the frame's order: 1 page frame + head · 2 main (mode cards,
   details card, note, prescription card) · 3 the 901-1119 tier (band,
   summary, foot bar) · 4 the side card (>=1120) · 5 states.
   ==================================================================== */


/* ====================================================================
   1. PAGE FRAME + HEAD (>=901)
   ==================================================================== */
@media (min-width: 901px) {
    /* The phone's sticky top and its body padding give way to the column. */
    .vm-ck-cols { padding-top: 12px; padding-bottom: 120px; }
    .vm-ck-main { display: flex; flex-direction: column; min-width: 0; }
    .vm-ck-top { position: static; z-index: auto; background: transparent; }
    .vm-ck-head {
        background: transparent;
        border-bottom: 0;
        padding: 0;
        gap: 0;
    }
    .vm-ck-back { font-size: 13.5px; gap: 7px; }
    .vm-ck-back i { font-size: 14px; }
    .vm-ck-title {
        margin-top: 8px;
        font-size: 36px;
        letter-spacing: -1.1px;
        line-height: 1.08;
    }
    /* The phone's counter bar: at 901-1119 the band below carries it, from
       1120 the side card's head. */
    .vm-ck-counter { display: none; }

    #vm-ck .vm-ck-body,
    #vm-ck.has-foot .vm-ck-body {
        flex: none;
        padding: 0;
        margin-top: 18px;
        gap: 16px;
    }
    /* 05-d-states: a line she lost sits on its card above the details. */
    .vm-ck-body > [data-mode-slot] { order: -2; }
    .vm-ck-body > [data-note] { order: -1; }
}

@media (min-width: 1120px) {
    .vm-ck-cols { padding-bottom: 64px; }
    /* The label column: 150 at 901-1119 (05-d-narrow), 180 from here. */
    #vm-ck .vm-ck-cards > .vm-ck-card { grid-template-columns: 180px minmax(0, 1fr) auto; }
    .vm-ck-modeopts { margin-bottom: 4px; }
    .vm-ck-title {
        margin-top: 12px;
        font-size: 40px;
        letter-spacing: -1.2px;
    }
    #vm-ck .vm-ck-body,
    #vm-ck.has-foot .vm-ck-body { margin-top: 24px; }
}


/* ====================================================================
   2. MAIN — the option cards, the details card, the note, the
   prescription card (>=901)
   ==================================================================== */
@media (min-width: 901px) {
    /* -- Delivery | Pickup: two option cards, 72 tall (design pass 1). */
    .vm-ck-modeopts {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
    }
    .vm-ck-modeopts .vm-ck-opt {
        min-height: 72px;
        padding: 14px 18px;
        gap: 14px;
        border: 0;
        border-radius: 16px;
        background: #fff;
        box-shadow: inset 0 0 0 1px #e2e8f0, 0 1px 2px rgba(16, 24, 40, .04);
    }
    .vm-ck-modeopts .vm-ck-opt.is-on {
        background: #e3f4f0;
        box-shadow: inset 0 0 0 1.5px #16a085;
    }
    .vm-ck-modeopts .vm-ck-opt-tile {
        width: 40px;
        height: 40px;
        border-radius: 12px;
        background: #f1f5f9;
        color: #475569;
    }
    .vm-ck-modeopts .vm-ck-opt-tile i { font-size: 15px; }
    .vm-ck-modeopts .vm-ck-opt.is-on .vm-ck-opt-tile { background: #fff; color: #0f6d5c; }
    .vm-ck-modeopts .vm-ck-opt-title,
    .vm-ck-modeopts .vm-ck-opt.is-on .vm-ck-opt-title {
        font-family: 'Space Grotesk', sans-serif;
        font-size: 16px;
        font-weight: 700;
        letter-spacing: -.3px;
        color: #0f172a;
    }
    .vm-ck-modeopts .vm-ck-opt-sub,
    .vm-ck-modeopts .vm-ck-opt.is-on .vm-ck-opt-sub {
        margin-top: 3px;
        font-size: 13px;
        color: #475569;
        font-variant-numeric: tabular-nums;
    }
    .vm-ck-modeopts .vm-ck-opt-check { font-size: 18px; color: #16a085; }

    /* -- The reason line in the switch's place (05-d-states). */
    .vm-ck-modereason {
        align-self: flex-start;
        align-items: center;
        gap: 10px;
        padding: 10px 14px;
        border-radius: 10px;
        background: #fff;
        box-shadow: 0 1px 2px rgba(16, 24, 40, .04);
        font-size: 13px;
        font-weight: 600;
        color: #0f172a;
    }
    .vm-ck-modereason i { margin-top: 0; font-size: 13px; color: #0f6d5c; }

    /* -- The details: the phone's three cards are one card of three
       labelled rows (label column 180; the code's card labels). */
    .vm-ck-cards {
        gap: 0;
        padding: 2px 28px;
        border-radius: 18px;
        background: #fff;
        box-shadow: 0 1px 2px rgba(16, 24, 40, .03), 0 10px 28px rgba(16, 24, 40, .07);
    }
    .vm-ck-cards > .vm-ck-card {
        display: grid;
        grid-template-columns: 150px minmax(0, 1fr) auto;
        column-gap: 24px;
        align-items: start;
        padding: 22px 0;
        border-radius: 0;
        background: transparent;
        box-shadow: none;
    }
    .vm-ck-cards > .vm-ck-card + .vm-ck-card { border-top: 1px solid #eef1f5; }
    .vm-ck-cards > .vm-ck-card > * { grid-column: 2 / -1; min-width: 0; }
    .vm-ck-cards > .vm-ck-card > .vm-ck-label {
        grid-column: 1;
        grid-row: 1 / span 6;
        padding-top: 10px;
        font-family: 'Space Grotesk', sans-serif;
        font-size: 15px;
        font-weight: 700;
        letter-spacing: -.2px;
        text-transform: none;
        line-height: 1.4;
        color: #0f172a;
    }
    /* Row tiles cut: the label column names the row (design pass 2). */
    .vm-ck-card .vm-ck-tile { display: none; }

    .vm-ck-cards .vm-ck-row { margin-top: 0; min-height: 44px; align-items: center; gap: 14px; }
    .vm-ck-cards .vm-ck-rowtitle { font-size: 15px; font-weight: 600; line-height: 1.35; }
    .vm-ck-cards .vm-ck-rowsub,
    .vm-ck-cards .vm-ck-rowphone {
        margin-top: 2px;
        font-size: 13px;
        color: #64748b;
        line-height: 1.4;
        font-variant-numeric: tabular-nums;
    }
    .vm-ck-cards .vm-ck-rowhours { margin-top: 2px; font-size: 13px; color: #475569; font-weight: 400; }

    /* The doors: mint pills (Change address, Edit, Save, Directions...). */
    .vm-ck-cards .vm-ck-pill {
        flex: 0 0 auto;
        height: 44px;
        padding: 0 16px;
        border: 0;
        background: #e3f4f0;
        color: #0f6d5c;
        font-size: 13.5px;
        font-weight: 700;
        white-space: nowrap;
    }
    .vm-ck-cards .vm-ck-acts { margin-top: 14px; gap: 8px; }
    .vm-ck-cards .vm-ck-acts > .vm-ck-pill { min-width: 0; }
    /* Deliver to: Change address stands beside the address. */
    .vm-ck-cards > [data-card="address"] > .vm-ck-row { grid-column: 2; grid-row: 1; }
    .vm-ck-cards > [data-card="address"] > .vm-ck-acts {
        grid-column: 3;
        grid-row: 1;
        align-self: center;
        margin-top: 0;
    }
    .vm-ck-cards .vm-ck-hair {
        margin-top: 14px;
        padding-top: 12px;
        border-top-color: #eef1f5;
    }
    .vm-ck-cards .vm-ck-hair span { font-size: 12.5px; color: #475569; line-height: 1.45; }

    /* The forms: fields side by side, in place (05-d-forms). */
    .vm-ck-cards .vm-ck-form {
        display: grid;
        grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
        column-gap: 12px;
        row-gap: 6px;
        align-items: start;
        margin-top: 0;
    }
    .vm-ck-cards > [data-card="receiver"] .vm-ck-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .vm-ck-cards .vm-ck-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
    .vm-ck-cards .vm-ck-fieldlabel { margin-bottom: 0; font-size: 12.5px; color: #334155; }
    .vm-ck-cards .vm-ck-input {
        height: 48px;
        padding: 0 14px;
        border-color: #cbd5e1;
        font-size: 14.5px;
        font-variant-numeric: tabular-nums;
    }
    .vm-ck-cards .vm-ck-input:focus {
        outline: 0;
        border-color: #16a085;
        box-shadow: 0 0 0 1px #16a085, 0 0 0 4px #e3f4f0;
    }
    .vm-ck-cards .vm-ck-err { grid-column: 2; margin-top: 0; font-size: 12.5px; }
    .vm-ck-cards .vm-ck-formacts { grid-column: 1 / -1; margin-top: 8px; gap: 6px; }

    /* The options side by side: the payment method; When 1.3fr | 1fr. */
    .vm-ck-cards .vm-ck-opts {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
        margin-top: 0;
    }
    .vm-ck-cards > [data-card="when"] .vm-ck-opts { grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); }
    .vm-ck-cards .vm-ck-opt {
        min-height: 60px;
        padding: 10px 16px;
        gap: 12px;
        border: 0;
        background: #fff;
        box-shadow: inset 0 0 0 1px #e2e8f0;
    }
    .vm-ck-cards .vm-ck-opt.is-on { background: #e3f4f0; box-shadow: inset 0 0 0 1.5px #16a085; }
    .vm-ck-cards .vm-ck-opt-tile { width: 32px; height: 32px; border-radius: 9px; background: #f1f5f9; color: #475569; }
    .vm-ck-cards .vm-ck-opt.is-on .vm-ck-opt-tile { background: #fff; color: #0f6d5c; }
    .vm-ck-cards .vm-ck-opt-title,
    .vm-ck-cards .vm-ck-opt.is-on .vm-ck-opt-title { font-size: 14px; font-weight: 700; color: #0f172a; }
    .vm-ck-cards .vm-ck-opt-sub,
    .vm-ck-cards .vm-ck-opt.is-on .vm-ck-opt-sub {
        font-size: 12.5px;
        color: #475569;
        font-variant-numeric: tabular-nums;
    }
    .vm-ck-cards .vm-ck-opt-check { color: #16a085; }
    .vm-ck-cards .vm-ck-slots { grid-column: 1 / -1; margin-top: 2px; }
    .vm-ck-cards .vm-ck-slot {
        min-width: 76px;
        padding: 0 14px;
        background: #fff;
        color: #334155;
        font-size: 14px;
        font-variant-numeric: tabular-nums;
        box-shadow: inset 0 0 0 1px #e2e8f0;
    }
    .vm-ck-cards .vm-ck-slot.is-on { background: #16a085; color: #fff; box-shadow: none; }
    /* 901-1119 only: the payment card keeps its sentence under the
       options (from 1120 it moves to the side card). */
    .vm-ck-cards .vm-ck-card > .vm-ck-cardnote { margin-top: 12px; font-size: 12.5px; color: #475569; }

    /* -- A line she lost: the code's sentence, bordered, the door mint. */
    .vm-ck-note {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        column-gap: 20px;
        row-gap: 6px;
        align-items: center;
        padding: 18px 24px;
        border-color: #e2e8f0;
    }
    .vm-ck-note > .vm-ck-notetext { grid-column: 1; margin-top: 0; font-size: 14px; font-weight: 600; color: #0f172a; text-wrap: pretty; }
    .vm-ck-note > .vm-ck-notelink {
        grid-column: 2;
        grid-row: 1 / span 6;
        padding: 0 16px;
        border-radius: 999px;
        background: #e3f4f0;
        color: #0f6d5c;
        font-size: 13.5px;
        white-space: nowrap;
    }

    /* -- The prescription card: tile 64 | the title | the grey pill with
       blue ink (the image glyph on a laptop); the inset under the title.
       The code's block (.vm-ck-rx) by its parts' own class names: the
       body is the grid, the state line across it, the tile + title row
       dissolved into it, the door at its right, the inset under the
       title. */
    .vm-ck-rxwrap > .vm-ck-rx > .vm-ck-rx-body {
        display: grid;
        grid-template-columns: 64px minmax(0, 1fr) auto;
        column-gap: 20px;
        row-gap: 0;
        align-items: center;
        padding: 18px 28px 22px;
    }
    .vm-ck-rxwrap .vm-ck-rx-body > .vm-ck-rx-state { grid-column: 1 / -1; font-size: 12.5px; }
    .vm-ck-rxwrap .vm-ck-rx-body > .vm-ck-rx-row { display: contents; }
    .vm-ck-rxwrap .vm-ck-rx-row > .vm-ck-rx-tile {
        grid-column: 1;
        grid-row: 2;
        width: 64px;
        height: 64px;
        margin-top: 14px;
        border-radius: 14px;
        background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
        font-size: 22px;
    }
    .vm-ck-rxwrap .vm-ck-rx-row > .vm-ck-rx-title { grid-column: 2; grid-row: 2; margin-top: 14px; line-height: 1.3; }
    .vm-ck-rxwrap .vm-ck-rx-body > .vm-ck-rx-door {
        grid-column: 3;
        grid-row: 2;
        width: auto;
        margin-top: 14px;
        padding: 0 20px;
        gap: 9px;
        white-space: nowrap;
    }
    .vm-ck-rxwrap .vm-ck-rx-body > .vm-ck-rx-inset {
        grid-column: 2 / -1;
        grid-row: 3;
        max-width: 460px;
        margin-top: 12px;
        padding: 10px 14px;
    }
    .vm-ck-rxwrap .vm-ck-rx-inset > .vm-ck-rx-line { gap: 10px; }
    .vm-ck-rxwrap .vm-ck-rx-inset > .vm-ck-rx-line i { font-size: 12px; }
    .vm-ck-rxwrap .vm-ck-rx-inset > .vm-ck-rx-line span { font-size: 13px; line-height: 1.45; }

    @media (hover: hover) {
        .vm-ck-modeopts .vm-ck-opt:not(.is-on):hover,
        .vm-ck-cards .vm-ck-opt:not(.is-on):hover,
        .vm-ck-cards .vm-ck-slot:not(.is-on):hover { box-shadow: inset 0 0 0 1.5px #16a085; }
        .vm-ck-cards .vm-ck-pill:hover,
        .vm-ck-note > .vm-ck-notelink:hover { box-shadow: inset 0 0 0 1.5px #16a085; color: #0f6d5c; }
        .vm-ck-rxwrap .vm-ck-rx-body > .vm-ck-rx-door:hover { box-shadow: inset 0 0 0 1.5px #1b6fa8; }
    }
}


/* ====================================================================
   3. 901-1119 — THE PHONE'S ORDER AT WIDTH (05-d-narrow): the counter
   band under the title, What you pay as the phone's headline block, the
   commit in D0's fixed foot bar (figure + payLabel left, commit 260).
   ==================================================================== */
@media (min-width: 901px) {
    /* The counter band: D0's head in its band form, 18 under the title. */
    .vm-ck-dthead.vm-dt-side-head { margin-top: 18px; }

    /* The summary: the headline block alone, 460 wide (no card round it). */
    #vm-ck [data-summary].vm-ck-card {
        max-width: 460px;
        padding: 0;
        border-radius: 0;
        background: transparent;
        box-shadow: none;
    }
    .vm-ck-total { padding: 16px; gap: 10px; }
    .vm-ck-totalfig { gap: 6px; }
    .vm-ck-totalnum { font-variant-numeric: tabular-nums; }
    .vm-ck-totalcur { font-size: 14px; }
    .vm-ck-sums { padding: 10px 12px; gap: 8px; }
    .vm-ck-sumrow { gap: 10px; font-size: 13px; }
    .vm-ck-sums i { font-size: 12px; }
    .vm-ck-sumfig { font-weight: 700; font-variant-numeric: tabular-nums; }

    /* The foot bar (D0's .vm-dt-foot-bar does the position and column). */
    .vm-ck-foot.vm-dt-foot-bar { gap: 16px; }
    .vm-ck-foot-fig { font-size: 22px; letter-spacing: -.4px; font-variant-numeric: tabular-nums; }
    .vm-ck-foot-cur { font-size: 12px; }
    .vm-ck-foot-total { gap: 5px; }
    .vm-ck-foot-sub { font-size: 12.5px; color: #64748b; }
    .vm-ck-foot .vm-ck-commit {
        width: 260px;
        height: 52px;
        justify-content: center;
        gap: 9px;
        font-size: 15px;
    }
    .vm-ck-commit i { font-size: 12px; }
    /* Inert: the solid at D0's dim, not the phone's tint (05-d-forms).
       The solid is the phone's own AA token (#0f6d5c, white text 6.4:1),
       not the frame's #16a085 (3.3:1 under 15px text). */
    .vm-ck-commit.is-inert.vm-dt-dim {
        background: #0f6d5c;
        color: #fff;
        box-shadow: none;
    }
    @media (hover: hover) {
        .vm-ck-commit:not(.is-inert):hover { background: #0c5b4c; color: #fff; }
    }
}


/* ====================================================================
   4. THE SIDE CARD (>=1120): D0's head without Change, the order's lines
   read-only (cap 4), What you pay (payLabel over the 44 figure, items +
   fee, the sentence on the white row), the missing fact's door, the
   solid commit 52. A failed commit answers here, not in a toast.
   ==================================================================== */
@media (min-width: 1120px) {
    .vm-ck-side { margin-top: 56px; }
    .vm-ck-sidecard .vm-ck-dthead.vm-dt-side-head { margin-top: 0; }
    .vm-ck-sidelines { padding: 4px 18px 0; }
    .vm-ck-sidepay {
        display: flex;
        flex-direction: column;
        gap: 14px;
        padding: 14px 18px 18px;
    }
    #vm-ck .vm-ck-sidepay [data-summary].vm-ck-card { max-width: none; }
    .vm-ck-sidepay .vm-ck-totalnum { font-size: 44px; letter-spacing: -1.4px; }
    .vm-ck-sidepay .vm-ck-sums .vm-ck-cardnote--dt {
        padding-top: 9px;
        border-top: 1px solid #eef1f5;
    }
    .vm-ck-sidepay .vm-ck-sums .vm-ck-cardnote span { font-size: 12.5px; line-height: 1.45; }

    /* The foot, inside the card: no figure (the summary's is over its
       label), the sub only as the missing fact's door, the commit 52. */
    #vm-ck .vm-ck-sidepay .vm-ck-foot {
        position: static;
        left: auto;
        transform: none;
        width: auto;
        max-width: none;
        z-index: auto;
        flex-direction: column;
        align-items: stretch;
        gap: 14px;
        padding: 0;
        border: 0;
        background: transparent;
        box-shadow: none;
    }
    .vm-ck-sidepay .vm-ck-foot-total { display: none; }
    .vm-ck-sidepay .vm-ck-foot-main { flex: none; }
    .vm-ck-sidepay .vm-ck-foot-sub { margin-top: 0; }
    .vm-ck-sidepay .vm-ck-foot .vm-ck-commit { width: 100%; }

    .vm-ck-missing {
        display: flex;
        align-items: center;
        gap: 10px;
        width: 100%;
        min-height: 48px;
        padding: 0 14px;
        border-radius: 12px;
        background: #e3f4f0;
        color: #0f6d5c;
        font-size: 13.5px;
        font-weight: 700;
        line-height: 1.35;
        text-align: left;
    }
    .vm-ck-missing span { flex: 1; min-width: 0; }
    .vm-ck-missing i { font-size: 13px; }
    .vm-ck-missing i:last-child { font-size: 12px; }
    .vm-ck-missing:focus-visible { outline: 2px solid #0f6d5c; outline-offset: 2px; }

    /* Nothing priced: the card holds the note, stacked (05-d-states). */
    .vm-ck-sidepay .vm-ck-note {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
        padding: 14px 16px;
    }
    .vm-ck-sidepay .vm-ck-note > .vm-ck-notelink { grid-row: auto; }

    @media (hover: hover) {
        .vm-ck-missing:hover { box-shadow: inset 0 0 0 1.5px #16a085; }
    }
}


/* ====================================================================
   5. STATES — the loading line in the column.
   ==================================================================== */
@media (min-width: 901px) {
    .vm-ck-body > .vm-loading { padding: 0; font-size: 14px; color: #64748b; }
}
