/* Cylinder Storage Planner — page styles on top of the Moduflex house style
   (moduflex.css). Tokens come from there; nothing here redefines the brand. */

[hidden] { display: none !important; }

/* Progress steps */
.steps { display: flex; gap: 18px; list-style: none; margin: 0 0 20px; padding: 0; font-size: 0.9rem; color: var(--brand-grey); flex-wrap: wrap; }
.steps li { display: flex; align-items: center; gap: 8px; }
.steps a { color: inherit; text-decoration: none; display: flex; align-items: center; gap: 8px; }
.steps a:hover { color: var(--brand-blue-deep); }
.step-num { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; border: 1px solid var(--line); font-size: 0.8rem; }
.steps .is-current { color: var(--ink); font-weight: 600; }
.steps .is-current .step-num { background: var(--brand-blue-deep); border-color: var(--brand-blue-deep); color: #fff; }
.steps .is-done .step-num { border-color: var(--brand-blue); color: var(--brand-blue-deep); }

/* Intro and "open a saved plan" */
.intro { display: flex; justify-content: space-between; align-items: flex-end; gap: 22px; flex-wrap: wrap; margin-bottom: 18px; }
.intro > div { flex: 1 1 380px; }
.intro p { margin: 0; }
.open-plan { flex: 0 1 260px; }
.small-label { display: block; font-size: 0.82rem; color: var(--brand-grey); margin-bottom: 4px; }
.inline-form { display: flex; gap: 8px; flex-wrap: wrap; }
.inline-form .field { flex: 1 1 160px; min-width: 0; }
.open-plan .field { padding: 7px 10px; font-size: 0.95rem; text-transform: uppercase; }
.open-plan .field::placeholder { text-transform: none; }

/* Gas filter chips */
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0 14px; }
.chip {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 7px 14px; font: inherit; font-size: 0.9rem;
    background: #fff; color: var(--ink); border: 1px solid var(--line); border-radius: 999px; cursor: pointer;
}
.chip:hover { border-color: var(--brand-blue); color: var(--brand-blue-deep); }
.chip[aria-pressed="true"] { background: var(--brand-blue-deep); border-color: var(--brand-blue-deep); color: #fff; }
.chip-count {
    min-width: 20px; padding: 0 6px; border-radius: 999px; font-size: 0.75rem; line-height: 20px; text-align: center;
    background: var(--tint); color: var(--brand-blue-deep);
}
.chip[aria-pressed="true"] .chip-count { background: #fff; }

.toolbar { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; margin-bottom: 8px; }
.toolbar .search { flex: 1 1 260px; }
.toggle { display: inline-flex; align-items: center; gap: 8px; color: var(--brand-grey); font-size: 0.92rem; cursor: pointer; user-select: none; }
.toggle input { width: 18px; height: 18px; accent-color: var(--brand-blue-deep); }

/* Gas sections and cylinder rows */
.gas h2 { margin-top: 26px; }
.gas-detail { color: var(--brand-grey); font-weight: 400; font-size: 0.88rem; margin-left: 4px; }

.cyl {
    display: grid;
    grid-template-columns: 52px minmax(0, 1fr) auto auto;
    grid-template-areas: "size info tag stepper";
    align-items: center; gap: 14px;
    padding: 10px 14px; cursor: pointer;
}
.cyl.is-selected { border-color: var(--brand-blue); background: #f7fbfd; box-shadow: inset 3px 0 0 var(--brand-blue-deep); }
.cyl-size {
    grid-area: size; width: 52px; height: 52px; border-radius: 8px;
    display: grid; place-items: center;
    background: var(--tint); color: var(--brand-blue-deep); font-weight: 600; font-size: 1.05rem;
}
.cyl.is-selected .cyl-size { background: var(--brand-blue-deep); color: #fff; }
.cyl-info { grid-area: info; min-width: 0; }
.cyl-title { font-weight: 600; }
.cyl-meta { color: var(--brand-grey); font-size: 0.88rem; }

.tag { grid-area: tag; display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 0.78rem; white-space: nowrap; }
.tag-shelf { background: var(--tint); color: var(--brand-blue-deep); }
.tag-pen { background: #f1f2f3; color: #5f6369; }

.stepper { grid-area: stepper; display: flex; align-items: stretch; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: #fff; cursor: default; }
.step-btn {
    width: 40px; min-height: 40px; border: 0; background: #fff; cursor: pointer;
    color: var(--brand-blue-deep); font: inherit; font-size: 1.25rem; line-height: 1;
}
.step-btn:hover { background: var(--tint); }
.qty {
    width: 56px; border: 0; border-left: 1px solid var(--line); border-right: 1px solid var(--line);
    text-align: center; font: inherit; font-size: 1rem; color: var(--ink); background: #fff;
    -moz-appearance: textfield; appearance: textfield;
}
.qty::-webkit-outer-spin-button, .qty::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.qty:focus { outline: none; box-shadow: inset 0 0 0 2px rgba(111, 170, 196, 0.6); }
.step-btn:focus-visible, .chip:focus-visible, .btn:focus-visible, .btn-sm:focus-visible {
    outline: 3px solid rgba(111, 170, 196, 0.5); outline-offset: 2px;
}

.no-match { text-align: center; padding: 28px 0; color: var(--brand-grey); }

/* Sticky selection tray */
.tray {
    position: sticky; bottom: 0; z-index: 5;
    display: flex; justify-content: space-between; align-items: center; gap: 14px; flex-wrap: wrap;
    margin: 22px -22px 0; padding: 14px 22px;
    background: rgba(255, 255, 255, 0.97); border-top: 1px solid var(--line);
    box-shadow: 0 -6px 16px rgba(51, 56, 60, 0.06);
}
.tray-text { display: flex; flex-direction: column; }
.tray-text .muted { font-size: 0.88rem; }
.tray-actions { display: flex; gap: 8px; align-items: center; }
.btn[disabled] { background: #b8c3c8; cursor: not-allowed; }

/* Plan page */
.plan-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.plan-head p { margin: 0; }
.plan-actions { display: flex; gap: 8px; }
.plan-actions a.btn-sm { text-decoration: none; display: inline-block; }
.ref { color: var(--ink); letter-spacing: 0.04em; }

.plan-section { margin-top: 28px; }
.plan-section h2 { margin-top: 0; }
.rule { margin: -2px 0 12px; color: var(--brand-grey); font-size: 0.92rem; }

/* The total and the way to order */
.summary {
    display: flex; justify-content: space-between; align-items: center; gap: 14px 24px; flex-wrap: wrap;
    margin: 20px 0 0; padding: 18px 22px; border: 1px solid var(--line); border-radius: 8px; background: var(--tint);
}
.summary-quote { border-color: var(--brand-blue); }
.summary-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.summary-label { font-weight: 600; color: var(--ink); }
.summary-num { font-size: 2rem; font-weight: 600; line-height: 1.15; color: var(--brand-blue-deep); }
.summary-text .muted { font-size: 0.88rem; }
.summary-action { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.summary-action .btn { text-decoration: none; }

/* The cylinders chosen */
.picked { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.picked li { display: flex; align-items: baseline; gap: 10px; padding: 8px 14px; border: 1px solid var(--line); border-radius: 8px; }
.picked-qty { font-weight: 600; color: var(--brand-blue-deep); }
.picked-note { margin: 10px 0 0; color: var(--brand-grey); font-size: 0.88rem; }

.table-wrap { overflow-x: auto; }
.code { white-space: nowrap; }
th.num, td.num { text-align: right; white-space: nowrap; }

/* What the customer gets: the 3D view, then a line for each kind of unit */
.viewer { border: 1px solid var(--line); border-radius: 8px; overflow: hidden; margin-bottom: 14px; }
.viewer-canvas { position: relative; height: 440px; background: #fff; touch-action: none; }
.viewer-canvas canvas { display: block; width: 100%; height: 100%; }
/* Dimensions, drawn over the 3D view by viewer.js; the view takes the pointer through them. */
.viewer-dims { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.dim-line { fill: none; stroke: var(--brand-blue-deep); stroke-width: 1; }
.dim-arrows { fill: var(--brand-blue-deep); }
.dim-labels text {
    font-size: 12px; font-weight: 600; fill: var(--ink); text-anchor: middle;
    stroke: #fff; stroke-width: 4px; stroke-linejoin: round; paint-order: stroke;
}
.viewer-toggles { display: flex; gap: 6px 16px; flex-wrap: wrap; }
.viewer-status { margin: 0; padding: 8px 14px; font-size: 0.88rem; color: var(--brand-grey); border-top: 1px solid var(--line); }
.viewer-bar { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 14px; border-top: 1px solid var(--line); background: #fbfdfe; }
.viewer-focus { display: flex; gap: 6px; flex-wrap: wrap; }
.viewer-focus .btn-sm.is-active { color: #fff; background: var(--brand-blue-deep); border-color: var(--brand-blue-deep); }
.viewer-help { margin: 0; padding: 0 14px 10px; font-size: 0.8rem; background: #fbfdfe; }
.tag-new { background: #fff4e5; color: #8a5300; border: 1px solid #f0c27a; padding: 1px 8px; margin-left: 6px; font-weight: 400; }

.unit-list { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: 8px; }
.unit-row { display: grid; grid-template-columns: 52px minmax(0, 1fr) auto; align-items: center; gap: 4px 14px; padding: 12px 16px; break-inside: avoid; }
.unit-row + .unit-row { border-top: 1px solid var(--line); }
.unit-nums {
    justify-self: center; display: inline-grid; place-items: center; min-width: 28px; height: 28px; padding: 0 9px;
    border-radius: 14px; background: var(--brand-blue-deep); color: #fff; font-size: 0.8rem; font-weight: 600; white-space: nowrap;
}
.unit-title { display: block; font-weight: 600; color: var(--ink); }
.unit-detail { display: block; color: var(--brand-grey); font-size: 0.88rem; }
.unit-links { font-size: 0.88rem; white-space: nowrap; }
.notice { margin-top: 24px; }

.save-panel { margin-top: 30px; padding: 18px; border: 1px solid var(--line); border-radius: 8px; background: #fbfdfe; }
.save-panel h2 { margin-top: 0; }
.save-panel p { margin: 0 0 12px; }

.error-page { padding: 30px 0; }
.error-page .btn { text-decoration: none; }

/* Signing in, the account and orders */
.nav-form { display: inline; margin: 0; }
.nav-button { padding: 0; border: 0; background: none; font: inherit; font-size: 0.95rem; color: var(--brand-grey); cursor: pointer; }
.nav-button:hover { color: var(--brand-blue-deep); }
.nav-button:focus-visible { outline: 3px solid rgba(111, 170, 196, 0.5); outline-offset: 2px; }

.auth { max-width: 420px; margin: 16px auto 0; padding: 24px; border: 1px solid var(--line); border-radius: 8px; }
.auth h1 { margin-bottom: 4px; }
.auth > p { margin: 0 0 14px; }
.stack { display: flex; flex-direction: column; gap: 6px; }
.stack .btn { align-self: flex-start; margin-top: 12px; }
.narrow { max-width: 380px; }
.label { margin-top: 6px; font-size: 0.9rem; }
.small { font-size: 0.85rem; }
.auth .small { margin: 18px 0 0; }

.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 18px; }
.form-item { display: flex; flex-direction: column; gap: 4px; }
.form-item.wide { grid-column: 1 / -1; }
textarea.field { width: 100%; resize: vertical; line-height: 1.4; }
.field[aria-invalid="true"] { border-color: #b23b2e; }
.field-error { color: #b23b2e; font-size: 0.85rem; }
.form-actions { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-top: 18px; }

/* Layout and delivery: a choice of rack layout for each group of cylinders */
.layout-group { border: 1px solid var(--line); border-radius: 8px; padding: 12px 16px 16px; margin: 0 0 16px; min-width: 0; }
.layout-group legend { padding: 0 6px; margin-left: -6px; font-weight: 600; color: var(--brand-blue); }
.layout-who { margin: 0 0 12px; font-size: 0.9rem; }
.layout-options { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.layout-option { position: relative; display: block; cursor: pointer; }
.layout-option input { position: absolute; top: 12px; left: 12px; width: 1px; height: 1px; opacity: 0; }
.layout-body { display: flex; flex-direction: column; gap: 3px; height: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.layout-option:hover .layout-body { border-color: var(--brand-blue); }
.layout-option input:checked + .layout-body { border-color: var(--brand-blue-deep); background: #f7fbfd; box-shadow: inset 0 0 0 1px var(--brand-blue-deep); }
.layout-option input:focus-visible + .layout-body { outline: 3px solid rgba(111, 170, 196, 0.5); outline-offset: 2px; }
.layout-name { font-weight: 600; }
.layout-detail { font-size: 0.85rem; color: var(--brand-grey); }
.layout-body .tag { align-self: flex-start; margin: 4px 0 0; }
.layout-sketch { display: block; width: 100%; height: 64px; margin: 6px 0; }
.sketch-frame { fill: var(--tint); stroke: var(--line); stroke-width: 1; }
.sketch-big-frame { fill: #5f6369; }
.sketch-full { fill: var(--brand-blue-deep); }
.sketch-spare { fill: #fff; stroke: var(--brand-grey); stroke-width: 1; }
.field.postcode { max-width: 220px; text-transform: uppercase; }
.field.postcode::placeholder { text-transform: none; }

.table-wrap + .rule { margin-top: 8px; }
.order-lines .tag-new { margin-left: 6px; }
.line-detail { display: block; color: var(--brand-grey); font-size: 0.85rem; }
.order-lines tfoot td { background: var(--tint); font-size: 0.9rem; }
.order-total-row { display: flex; justify-content: space-between; align-items: baseline; gap: 6px 16px; flex-wrap: wrap; }
.order-total-row strong { font-size: 1.15rem; color: var(--brand-blue-deep); white-space: nowrap; }
.order-next { margin: 16px 0 0; }
table.details th { width: 32%; font-size: 0.9rem; border-top: 1px solid var(--line); }
.tag-sent { background: #e9f4ee; color: #237a4b; }
.tag-waiting { background: #fff4e5; color: #8a5300; }
.order-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 12px 16px; }
.order-row .order-meta { flex: 1 1 220px; font-size: 0.9rem; }
.order-total { font-weight: 600; white-space: nowrap; }

/* Admin */
.tabs { display: flex; gap: 6px; margin: 4px 0 18px; border-bottom: 1px solid var(--line); }
.tabs a { padding: 8px 14px; color: var(--brand-grey); text-decoration: none; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs a:hover { color: var(--brand-blue-deep); }
.tabs a[aria-current="page"] { color: var(--ink); font-weight: 600; border-bottom-color: var(--brand-blue-deep); }
.notice-box { margin: 0 0 16px; padding: 10px 14px; border: 1px solid #f0c27a; border-radius: 8px; background: #fff4e5; color: #8a5300; font-size: 0.92rem; }
.notice-box code { background: #fff; }
table.accounts td { font-size: 0.92rem; vertical-align: top; }
td.actions { white-space: nowrap; text-align: right; }
td.actions form { display: inline; margin: 0; }
.link-panel { margin: 0 0 18px; border-color: var(--brand-blue); }
select.field { padding: 10px 12px; }

/* Footer */
.foot { max-width: 860px; margin: 30px auto 0; padding: 16px 22px 34px; border-top: 1px solid var(--line); color: var(--brand-grey); font-size: 0.82rem; }
.foot p { margin: 0; }

/* Intro video on the first page of a visit. The background is the video's own,
   so a portrait video on a wide screen has no visible edges. Without the script
   the timer fades it out just after the video (7.8 s) ends. */
.splash {
    position: fixed; inset: 0; z-index: 100;
    background: #fafafa; cursor: pointer;
    transition: opacity 0.4s ease, visibility 0.4s;
    animation: splash-out 0.4s ease 9s forwards;
}
.splash.is-closing { opacity: 0; visibility: hidden; }
@keyframes splash-out { to { opacity: 0; visibility: hidden; } }
.splash-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.splash-skip { position: absolute; right: 22px; bottom: 22px; }
@media (prefers-reduced-motion: reduce) { .splash { display: none; } }

/* Narrow screens: tablet and phone */
@media (max-width: 640px) {
    main { padding: 18px 16px; }
    .topbar { padding: 10px 16px; }
    .logo { height: 34px; }
    .brand-sub { font-size: 0.85rem; }
    .nav { gap: 12px; font-size: 0.9rem; }
    .cyl {
        grid-template-columns: 46px minmax(0, 1fr) auto;
        grid-template-areas: "size info info" "size tag stepper";
        row-gap: 8px; column-gap: 12px;
    }
    .cyl-size { width: 46px; height: 46px; }
    .tag { justify-self: start; }
    .summary { padding: 16px; }
    .summary-action { align-items: stretch; width: 100%; }
    .summary-action .btn { text-align: center; }
    .unit-row { grid-template-columns: 52px minmax(0, 1fr); }
    .unit-links { grid-column: 2; }
    .form-grid { grid-template-columns: minmax(0, 1fr); }
    .auth { padding: 18px 16px; }
    .viewer-canvas { height: 340px; }
    .tray { margin: 18px -16px 0; padding: 12px 16px; }
    .tray-actions { width: 100%; }
    .tray-actions .btn { flex: 1; text-align: center; }
}

/* Print: the plan on paper, without the controls */
@media print {
    .nav, .no-print, .tray, .splash { display: none !important; }
    .foot { max-width: none; padding: 12px 0 0; }
    main { max-width: none; padding: 0; }
    .topbar { padding: 0 0 10px; }
    .summary, .picked li, .unit-list { border-color: #c9d3d8; }
    a { color: inherit; text-decoration: none; }
}
