/* Kerb back office. Colours and sizes live in the variables below; change them here to re-brand a venue. */
:root {
    --brand: #e6c082;
    --brand-strong: #c99a4b;
    --page: #f4f1ec;
    --surface: #ffffff;
    --ink: #2b2925;
    --muted: #6f695e; /* 4.8:1 on the page colour, 5.4:1 on white (WCAG AA for small text) */
    --line: #e2ddd3;
    --topbar: #1f1d1a;
    --topbar-ink: #f4f1ec;
    --good: #2f6b3a;
    --bad: #a3322b;
    --warn: #8a5a00;
    --radius: 8px;
    --gap: 16px;
    --font: "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
    --mono: Consolas, "Cascadia Mono", Menlo, monospace;
    --topbar-h: 56px;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    background: var(--page);
    color: var(--ink);
    font: 15px/1.45 var(--font);
}

a { color: var(--ink); text-decoration-color: var(--brand-strong); }

h1 { font-size: 1.5rem; margin: 0 0 var(--gap); }
/* The router moves focus to the heading after each page change so a screen reader announces it; it is not a stop for Tab. */
h1:focus { outline: none; }
h2 { font-size: 1.1rem; margin: 0 0 8px; }
h3 { font-size: 1rem; margin: 0 0 6px; }

.topbar {
    position: sticky; top: 0; z-index: 40;
    display: flex; align-items: center; gap: var(--gap);
    min-height: var(--topbar-h); padding: 0 var(--gap);
    background: var(--topbar); color: var(--topbar-ink);
}
.brand { color: var(--brand); font-weight: 700; font-size: 1.2rem; text-decoration: none; }
/* On a laptop the links wrap to a second row, so Hardware, Subscription and Accounts stay in sight. */
.nav { display: flex; flex-wrap: wrap; gap: 4px; flex: 1; white-space: nowrap; padding: 6px 0; }
.nav a { color: var(--topbar-ink); text-decoration: none; padding: 6px 10px; border-radius: var(--radius); }
.nav a.active { background: var(--brand); color: var(--topbar); }
.signout { margin: 0; }
.signout .ghost { color: var(--topbar-ink); border-color: #55504a; }

.page { max-width: 1200px; margin: 0 auto; padding: var(--gap); }
.page.narrow { max-width: 480px; }

.panel {
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
    padding: var(--gap); margin: 0 0 var(--gap);
}
.cards { display: grid; gap: var(--gap); grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.cards > .panel { margin: 0; }
.changes { border-left: 4px solid var(--brand); }
.change-list { margin: 0 0 8px; padding-left: 20px; }

.muted { color: var(--muted); }
#blazor-error-ui {
    display: none; position: fixed; left: 0; right: 0; bottom: 0; z-index: 50; padding: 12px var(--gap);
    background: #fbeeec; color: var(--bad); border-top: 2px solid var(--bad); font-weight: 600;
}
.step-summary { margin-left: 6px; font-weight: 400; font-size: .95rem; }
.error { color: var(--bad); font-weight: 600; }
.notice { color: var(--good); font-weight: 600; }
.warn { color: var(--warn); }
/* The subscription line under the top bar: a full-width band at every stage, never text against the page edge. */
.phase-banner { margin: 0; padding: 8px var(--gap); border-radius: 0; }
.phase-banner.warn { background: #fff7e6; border-bottom: 1px solid var(--brand); }
/* A Kerb support session is running (ADR-033 section 5): a red bar on every page. */
.support-bar { position: sticky; top: var(--topbar-h, 56px); z-index: 30; margin: 0; padding: 8px var(--gap); background: var(--bad); color: #fff; font-weight: 600; }
.problems { background: #fbeeec; border-radius: var(--radius); padding: 8px 12px; margin: 8px 0; color: var(--bad); }
.problems ul { margin: 4px 0 0; padding-left: 20px; }
/* The Menu step's file box: the whole dashed box takes a drop or a press, through the browser's own file input laid over it. */
label.drop, .form label.drop {
    position: relative; display: grid; place-items: center; gap: 4px; min-height: 140px; padding: 24px var(--gap);
    border: 2px dashed var(--line); border-radius: var(--radius); background: var(--surface); text-align: center;
    font-size: 15px; cursor: pointer;
}
label.drop:hover, label.drop:focus-within { border-color: var(--brand-strong); }
label.drop:focus-within { outline: 2px solid var(--brand-strong); outline-offset: 1px; }
label.drop input[type="file"] { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.found { border-top: 1px solid var(--line); padding-top: 8px; margin-top: 8px; }
.found h4 { font-size: .95rem; margin: 12px 0 4px; }
.found ul { margin: 4px 0 8px; padding-left: 20px; }
.found .counts { font-weight: 600; }
/* Chromium keeps laying out what a closed "Worth a look" holds; take it out of the page until it opens. */
#step-menu details:not([open]) > :not(summary) { display: none; }
@media (max-width: 640px) {
    /* "Worth a look" opens under a thumb too. */
    #step-menu summary { padding: 10px 0; }
}
.pill { display: inline-block; background: var(--brand); color: var(--topbar); border-radius: 999px; padding: 0 8px; font-size: 12px; }

.form { display: grid; gap: 10px; }
.form.inline { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; }
.form label, .toolbar label { display: grid; gap: 4px; font-weight: 600; font-size: 13px; }
.form label.check, label.check { display: flex; align-items: center; gap: 6px; font-weight: 400; }
fieldset { border: 1px solid var(--line); border-radius: var(--radius); display: flex; flex-wrap: wrap; gap: 4px 16px; }
legend { font-weight: 600; font-size: 13px; }
.toolbar { display: flex; flex-wrap: wrap; gap: var(--gap); align-items: flex-end; margin: 0 0 var(--gap); }
.actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

input, select, textarea {
    font: inherit; color: inherit; background: var(--surface);
    border: 1px solid var(--line); border-radius: 6px; padding: 7px 9px; min-width: 0;
}
input:focus, select:focus, textarea:focus, button:focus-visible, .help:focus { outline: 2px solid var(--brand-strong); outline-offset: 1px; }
input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--brand-strong); }
input.short { width: 6em; }
input.money { width: 6.5em; text-align: right; }

button, .button {
    font: inherit; font-weight: 600; cursor: pointer; border-radius: 6px; padding: 8px 14px;
    border: 1px solid var(--line); background: var(--surface); color: var(--ink); text-decoration: none; display: inline-block;
}
button.primary, .button.primary { background: var(--brand); border-color: var(--brand-strong); color: var(--topbar); }
button.ghost { background: transparent; }
button.small { padding: 4px 9px; font-size: 13px; }
button.link { border: 0; background: none; padding: 0 4px; text-decoration: underline; font-weight: 400; }
button:disabled { opacity: .5; cursor: default; }

.table-wrap { position: relative; overflow-x: auto; margin: 0 0 var(--gap); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.tbl { width: 100%; border-collapse: collapse; }
.tbl th {
    font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); background: var(--page);
    text-align: left; padding: 8px 10px; white-space: nowrap;
}
.tbl td { padding: 8px 10px; border-top: 1px solid var(--line); vertical-align: middle; }
.tbl th.num, .tbl td.num { text-align: right; }
.tbl th.centre, .tbl td.centre { text-align: center; }
/* ADR-036: a size sits under its item in the "sizes together" report. */
.tbl tr.size-row td:first-child { padding-left: 28px; }
.tbl tr.inactive td { color: var(--muted); }
.tbl tr.subrow td { background: #faf8f4; }
.row-actions { white-space: nowrap; text-align: right; }
button.sort { all: unset; cursor: pointer; }
button.sort:focus-visible { outline: 2px solid var(--brand-strong); }

.face {
    display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%;
    background: var(--brand); color: var(--topbar); font-size: 12px; font-weight: 700; margin-right: 6px; vertical-align: middle;
}

.help {
    position: relative; display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 50%;
    border: 1px solid var(--muted); color: var(--muted); font-size: 11px; font-weight: 700; cursor: help; vertical-align: middle;
    text-transform: none; letter-spacing: 0;
}
.help-link { cursor: pointer; text-decoration: none; margin-left: 4px; }
.help-text {
    display: none; position: absolute; z-index: 30; top: 22px; left: -8px; width: min(300px, 80vw);
    background: var(--topbar); color: var(--topbar-ink); padding: 8px 10px; border-radius: var(--radius);
    font-size: 13px; font-weight: 400; line-height: 1.4; text-align: left; white-space: normal;
}
.help:hover .help-text, .help:focus .help-text, .help:focus-within .help-text { display: block; }
/* A field with a help icon: the icon sits beside the label, outside it, so the field's name stays the label's words. */
.field-help { display: flex; align-items: flex-start; gap: 6px; }
.field-help > label { flex: 1 1 auto; min-width: 0; }
.field-help > .help { flex: none; margin-top: 1px; }
.toolbar .field-help > label { flex: 0 1 auto; }

.paper {
    font: 12px/1.35 var(--mono); background: #fffdf8; border: 1px dashed var(--line); padding: 10px;
    overflow-x: auto; max-width: 100%; white-space: pre; margin: 0 0 8px;
}
.logo-paper {
    background: var(--surface); border: 1px dashed var(--line); padding: 10px; max-width: 576px;
    text-align: center; margin: 0 0 8px;
}
.logo-paper img { image-rendering: pixelated; max-width: 100%; height: auto; }
.qr { display: block; image-rendering: pixelated; border: 8px solid #fff; max-width: 100%; height: auto; }
.key code { font: 1.1rem var(--mono); letter-spacing: .05em; }
.codes { columns: 2; font-family: var(--mono); }
.steps li { margin-bottom: 10px; }
.pager { display: flex; gap: 12px; align-items: center; justify-content: center; }
.plain { list-style: none; padding: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.button.small { padding: 4px 9px; font-size: 13px; }

/* Menu board editor. The preview canvas sizes its zones in container width units (cqw), so a zone keeps its place and
   its type size at any width, as the lane screen scales its design canvas to the panel. */
.mb-layout { display: grid; gap: var(--gap); grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); align-items: start; }
.mb-preview { position: sticky; top: calc(var(--topbar-h) + 8px); z-index: 10; }
.mb-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 10px; }
.mb-list { padding-left: 20px; margin: 4px 0 8px; }
.mb-list li { padding: 3px 0; }
.mb-list li.mb-picked > button.link { font-weight: 700; }
.mb-sub { border-top: 1px solid var(--line); margin-top: 12px; padding-top: 12px; }
.mb-row-edit { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--line); }
.mb-days { display: inline-flex; flex-wrap: wrap; gap: 2px 8px; align-items: center; }
.mb-item { border: 1px solid var(--line); border-radius: var(--radius); padding: 8px 10px; margin: 0 0 8px; }
.mb-item-head { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; margin-bottom: 6px; }
.mb-picker { margin-top: 10px; }
.mb-picker label { display: grid; gap: 4px; font-weight: 600; font-size: 13px; }
.mb-results { max-height: 280px; overflow-y: auto; margin: 6px 0 0; }
.mb-results li { padding: 2px 0; }
.mb-problems { color: var(--bad); font-size: 13px; margin: 4px 0 0; padding-left: 18px; flex-basis: 100%; }
.pill.mb-bad { background: #fbeeec; color: var(--bad); }
.mb-warnings { color: var(--warn); font-size: 13px; padding-left: 18px; }
.mb-thumbs { display: flex; flex-wrap: wrap; gap: 8px; }
.mb-thumb { padding: 2px; line-height: 0; }
.mb-thumb img { width: 84px; height: 56px; object-fit: contain; background: var(--page); }
.mb-thumb.mb-picked { outline: 3px solid var(--brand-strong); }

.mb-canvas {
    position: relative; width: 100%; overflow: hidden; container-type: inline-size; border-radius: 4px;
    font-family: var(--font); line-height: 1.25; margin: 0 0 8px; box-shadow: 0 1px 3px rgba(0, 0, 0, .25);
}
.mb-zone { position: absolute; display: flex; flex-direction: column; cursor: pointer; }
.mb-zone:hover { outline: 1px dashed rgba(127, 127, 127, .8); outline-offset: -1px; }
.mb-zone.mb-selected { outline: 2px dashed #4aa3ff; outline-offset: -2px; }
.mb-inner { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.mb-title { font-weight: 700; }
.mb-items { display: grid; align-content: start; }
.mb-row { display: flex; align-items: flex-start; }
.mb-row.mb-out { opacity: .45; }
.mb-name { flex: 1; min-width: 0; font-weight: 600; overflow-wrap: anywhere; }
.mb-desc { display: block; font-weight: 400; }
.mb-price { font-weight: 700; white-space: nowrap; }
.mb-text .mb-inner { align-items: center; justify-content: center; text-align: center; font-weight: 700; overflow-wrap: anywhere; }
.mb-image .mb-inner { align-items: center; justify-content: center; text-align: center; overflow: hidden; }
.mb-image img { width: 100%; height: 100%; object-fit: contain; }

@media (max-width: 960px) {
    .mb-layout { grid-template-columns: minmax(0, 1fr); }
    .mb-preview { position: static; order: -1; }
}

@media (max-width: 640px) {
    .topbar { flex-wrap: wrap; padding: 8px var(--gap); gap: 8px; }
    .nav { order: 3; flex-basis: 100%; flex-wrap: nowrap; overflow-x: auto; padding: 0; }
    .page { padding: 12px; }
    .form.inline { display: grid; }
    .help-text { left: auto; right: -8px; }

    /* Every control a thumb presses is at least 40 px each way on a phone. */
    input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]), select, textarea { min-height: 44px; }
    button, .button { min-height: 44px; min-width: 44px; }
    button.small, .button.small { min-height: 40px; min-width: 40px; padding: 8px 12px; }
    button.link { min-height: 40px; }
    button.sort { display: inline-flex; align-items: center; min-height: 40px; min-width: 40px; }
    .nav a, .brand, .menu-tabs a { display: inline-flex; align-items: center; min-height: 40px; }
    /* A text link grows its tap area with padding above and below; the lines around it do not move. */
    .page a:not(.button), .phase-banner a { padding: 12px 4px; margin: 0 -4px; }
    .page .menu-tabs a { padding: 8px 12px; margin: 0; }
    .tbl td a, .tbl td button.link { display: inline-flex; align-items: center; min-height: 40px; min-width: 40px; }
    .help { width: 40px; height: 40px; border: 0; }
    .help::before { content: ""; position: absolute; inset: 11px; border: 1px solid var(--muted); border-radius: 50%; }
    .help-text { top: 36px; }
    .page a.help-link { padding: 0; margin: 0 0 0 4px; }

    /* A tick box keeps an 18 px drawn box inside a 40 px target. The pictures carry the --muted and --brand-strong colours. */
    input[type="checkbox"] {
        appearance: none; -webkit-appearance: none; width: 40px; height: 40px; margin: 0; flex: none; border: 0; border-radius: 6px;
        background: transparent url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Crect x='1' y='1' width='18' height='18' rx='3' fill='%23fff' stroke='%236f695e' stroke-width='1.5'/%3E%3C/svg%3E") center / 20px 20px no-repeat;
        cursor: pointer;
    }
    input[type="checkbox"]:checked {
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Crect x='1' y='1' width='18' height='18' rx='3' fill='%23c99a4b' stroke='%23c99a4b' stroke-width='1.5'/%3E%3Cpath d='M5 10.5l3.2 3.2L15 7' fill='none' stroke='%23fff' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    }
    input[type="checkbox"]:disabled { opacity: .5; cursor: default; }
    label.check { min-height: 40px; }
}

/* GST pages */
.gst-suggestion { margin: 0; }
.gst-question { border: 1px solid var(--line); border-radius: var(--radius); padding: 6px 10px; display: flex; flex-wrap: wrap; gap: 4px 14px; align-items: center; }
.gst-question legend { font-weight: 600; font-size: 13px; }
.gst-review { border-top: 1px solid var(--line); padding: 8px 0; }
.gst-review p { margin: 4px 0; }

/* The product editor's tax code suggestion: the link to its questions sits on a line of its own. */
.gst-suggestion .gst-detail { display: block; margin-top: 4px; }

/* The three-way till setting (ADR-047) and Choices on the till: one tap picks, the picked button reads as pressed. */
.ask-picker { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0; }
.ask-picker .ask { background: #fff; min-height: 44px; }
.ask-picker .ask.chosen, .ask-picker .ask[aria-pressed="true"] { background: var(--brand); border-color: var(--brand-strong); color: var(--topbar); font-weight: 700; }
.ask-on { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 8px; }
.menu-notes summary { cursor: pointer; }
.with-unit { display: inline-flex; align-items: center; gap: 6px; }
