:root {
    --bg: #fffaf3;
    --card: #ffffff;
    --ink: #241f1a;
    --muted: #766d64;
    --line: #e8ded2;
    --accent: #c85b21;
    --accent-dark: #a94615;
    --ok: #116b3a;
    --warn: #8a5a00;
    --bad: #9e1c1c;
}
* { box-sizing: border-box; }
body {
    margin: 0;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: var(--bg);
    color: var(--ink);
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
.topbar {
    position: sticky;
    top: 0;
    z-index: 10;
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: center;
    padding: .9rem 1rem;
    background: #2a1810;
    color: white;
    box-shadow: 0 2px 10px rgba(0,0,0,.12);
}
.brand { color: white; font-weight: 800; font-size: 1.15rem; }
.topbar nav { display: flex; flex-wrap: wrap; gap: .75rem; justify-content: flex-end; }
.topbar nav a { color: white; }
.topbar nav .topbar-nav-button {
    appearance: none;
    background: transparent;
    border: 0;
    border-radius: 0;
    color: white;
    font-weight: inherit;
    padding: 0;
    width: auto;
}
.topbar nav .topbar-nav-button:hover { background: transparent; text-decoration: underline; }
.topbar nav .topbar-nav-button:disabled { opacity: .55; }
.container { width: min(1100px, calc(100% - 2rem)); margin: 1.25rem auto 3rem; }
h1 { margin: .5rem 0 1rem; line-height: 1.15; }
.card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 1rem;
    box-shadow: 0 8px 24px rgba(66,40,15,.06);
    margin-bottom: 1rem;
}
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1rem; }
.menu-card { display: flex; flex-direction: column; overflow: hidden; padding: 0; }
.menu-card img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; background: #eee; }
.menu-card .body { padding: .9rem; display: flex; flex-direction: column; gap: .5rem; flex: 1; }
.price { font-weight: 800; font-size: 1.1rem; }
.muted { color: var(--muted); }
.row { display: flex; gap: .75rem; align-items: center; flex-wrap: wrap; }
.space-between { display: flex; justify-content: space-between; gap: 1rem; align-items: center; }
label { display: block; font-weight: 650; margin: .5rem 0 .25rem; }
input, select, textarea, button {
    font: inherit;
    border-radius: 10px;
}
input, select, textarea {
    width: 100%;
    padding: .75rem;
    border: 1px solid var(--line);
    background: white;
}
input[type="checkbox"] { width: auto; }
input[type="radio"] { width: auto; }
input[type="number"] { max-width: 110px; }
textarea { min-height: 90px; }

.admin-colour-control {
    display: flex;
    align-items: center;
    gap: .65rem;
}
.admin-colour-input {
    width: 84px;
    min-width: 84px;
    height: 48px;
    padding: 4px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #fff;
    cursor: pointer;
}
.admin-colour-input::-webkit-color-swatch-wrapper { padding: 0; }
.admin-colour-input::-webkit-color-swatch {
    border: 0;
    border-radius: 6px;
}
.admin-colour-input::-moz-color-swatch {
    border: 0;
    border-radius: 6px;
}
.admin-colour-control output {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: .9rem;
    font-weight: 700;
}
button, .button {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    gap: .35rem;
    padding: .72rem 1rem;
    border: 0;
    background: var(--accent);
    color: white;
    font-weight: 750;
    cursor: pointer;
    border-radius: 999px;
    text-decoration: none;
}
button:hover, .button:hover { background: var(--accent-dark); text-decoration: none; }
button.secondary, .button.secondary { background: #61574e; }
button.danger, .button.danger { background: var(--bad); }
button.ok, .button.ok { background: var(--ok); }
button:disabled { opacity: .55; cursor: not-allowed; }
.form-card { max-width: 560px; }
.alert { padding: .8rem 1rem; border-radius: 12px; margin: .8rem 0; border: 1px solid var(--line); background: white; }
.alert-success { border-color: #b8e2c7; color: var(--ok); }
.alert-error { border-color: #f0b6b6; color: var(--bad); }
.alert-info { border-color: #bdd7ff; color: #1f4d8a; }
.alert-warning { border-color: #f1d392; color: var(--warn); }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; background: white; border-radius: 14px; overflow: hidden; }
th, td { padding: .75rem; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { background: #fff1e6; }
.badge { display: inline-block; padding: .25rem .55rem; border-radius: 999px; font-size: .8rem; font-weight: 800; background: #eee; }
.badge.NEW { background: #e8f1ff; color: #245294; }
.badge.ACCEPTED { background: #fff3cd; color: #785500; }
.badge.PREPARING { background: #ffe0c2; color: #924500; }
.badge.READY, .badge.PACKING { background: #d9f7e8; color: #096338; }
.badge.COMPLETED { background: #e7e7e7; color: #444; }
.badge.CANCELLED { background: #ffe1e1; color: #8e1a1a; }
.tabs { display: flex; gap: .5rem; flex-wrap: wrap; margin-bottom: 1rem; }
.tab { border-radius: 999px; padding: .7rem 1rem; background: white; border: 1px solid var(--line); color: var(--ink); cursor: pointer; }
.tab.active { background: var(--accent); color: white; border-color: var(--accent); }
.order-section { margin: 1.25rem 0; }
.order-section h2 { margin: 0 0 .75rem; }
.order-card { border-left: 6px solid var(--accent); }
.order-card.pack-now { border-left-color: var(--bad); }
.order-card.prep-soon { border-left-color: var(--warn); }
.order-items { margin: .5rem 0; padding-left: 1.1rem; }
.kpi { display: inline-flex; flex-direction: column; gap: .1rem; padding: .7rem .9rem; border-radius: 14px; border: 1px solid var(--line); background: white; }
.kpi strong { font-size: 1.25rem; }
.small { font-size: .9rem; }
.actions { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: .75rem; }
@media (max-width: 640px) {
    .topbar { align-items: flex-start; flex-direction: column; }
    .container { width: min(100% - 1rem, 1100px); margin-top: .75rem; }
    .grid { grid-template-columns: 1fr; }
    .space-between { align-items: flex-start; flex-direction: column; }
    button, .button { width: 100%; }
    .actions button, .actions .button { width: auto; flex: 1; }
}
.checkbox-row { display: flex; gap: .5rem; align-items: center; font-weight: 650; margin: .75rem 0; }
.checkbox-row input { width: auto; }
.approval-code strong { letter-spacing: .12em; font-size: 1.6rem; }
.approval-input { max-width: 160px; }
.table-actions { display: flex; flex-wrap: wrap; gap: .35rem; align-items: center; }
.table-actions form { margin: 0; }
.small-button { padding: .45rem .7rem; font-size: .85rem; }
.form-actions-end { align-self: end; }
@media (max-width: 640px) {
    .table-actions { min-width: 180px; }
    .small-button { width: auto; }
    .form-actions-end { width: 100%; }
}
.topbar-brand-title { display: flex; align-items: baseline; gap: .75rem; flex-wrap: wrap; min-width: 0; }
.topbar-title { color: #fff1e6; font-weight: 750; font-size: 1rem; white-space: nowrap; }
.service-tabs { margin-top: 0; margin-bottom: .55rem; }
.service-tabs .tab { padding: .55rem .85rem; }
.service-orders-card { padding: .65rem; }
.compact-section { margin: .6rem 0 .85rem; }
.compact-section h2 { margin: .15rem 0 .45rem; font-size: 1.05rem; }
.compact-empty { margin: .25rem 0 .55rem; }
.order-row {
    background: var(--card);
    border: 1px solid var(--line);
    border-left: 5px solid var(--accent);
    border-radius: 12px;
    padding: .45rem .55rem;
    margin-bottom: .45rem;
    box-shadow: 0 4px 12px rgba(66,40,15,.04);
}
.order-row.pack-now { border-left-color: var(--bad); }
.order-row.prep-soon { border-left-color: var(--warn); }
.order-row-main {
    display: grid;
    grid-template-columns: minmax(92px, auto) minmax(140px, 1fr) minmax(180px, auto) minmax(220px, 2fr) minmax(70px, auto) minmax(180px, auto);
    gap: .4rem .65rem;
    align-items: center;
}
.order-no { white-space: nowrap; }
.order-customer,
.order-collection {
    display: flex;
    flex-direction: column;
    gap: .05rem;
    min-width: 0;
}
.order-customer span,
.order-collection span { color: var(--muted); font-size: .82rem; }
.order-collection strong { white-space: nowrap; }
.order-items-line {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
    font-weight: 650;
}
.order-total { white-space: nowrap; text-align: right; }
.compact-actions {
    margin-top: 0;
    gap: .3rem;
    justify-content: flex-end;
    flex-wrap: nowrap;
}
.compact-actions button { padding: .42rem .58rem; font-size: .82rem; }
.order-remarks {
    margin-top: .35rem;
    padding: .35rem .45rem;
    border-radius: 8px;
    background: #fff7ef;
    color: var(--warn);
    font-size: .9rem;
}
@media (max-width: 980px) {
    .order-row-main { grid-template-columns: minmax(86px, auto) 1fr minmax(160px, auto); }
    .order-items-line { grid-column: 1 / -1; }
    .order-total { text-align: left; }
    .compact-actions { justify-content: flex-start; }
}
@media (max-width: 640px) {
    .topbar-brand-title { width: 100%; justify-content: space-between; }
    .topbar-title { font-size: .95rem; }
    .service-orders-card { padding: .5rem; }
    .order-row-main { grid-template-columns: 1fr; }
    .order-customer,
    .order-collection { flex-direction: row; justify-content: space-between; gap: .4rem; }
    .order-items-line { white-space: normal; }
    .compact-actions { flex-wrap: wrap; }
    .compact-actions button { width: auto; flex: 1; }
}

.section-box {
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: .55rem;
    margin-bottom: .65rem;
    background: var(--card);
}
.section-urgent { border-color: #e8a0a0; background: #fffafa; }
.section-prep { border-color: #acd8bf; background: #fbfffc; }
.section-pending { border-color: #e1d9d0; background: #f7f2eb; }
.section-neutral { border-color: var(--line); background: var(--card); }
.section-bracket { font-weight: 900; font-size: 1.18em; }
.bracket-red { color: var(--bad); }
.bracket-green { color: var(--ok); }
.order-row.pending { border-left-color: #b8aca1; background: #fffdf9; }
.order-type {
    display: flex;
    flex-direction: column;
    gap: .05rem;
    min-width: 0;
}
.order-type span { color: var(--muted); font-size: .82rem; }
.order-type strong { white-space: nowrap; }
.order-row-main {
    grid-template-columns: minmax(92px, auto) minmax(130px, 1fr) minmax(90px, auto) minmax(170px, auto) minmax(220px, 2fr) minmax(70px, auto) minmax(150px, auto);
}
@media (max-width: 1100px) {
    .order-row-main { grid-template-columns: minmax(86px, auto) 1fr minmax(90px, auto) minmax(150px, auto); }
    .order-items-line { grid-column: 1 / -1; }
    .order-total { text-align: left; }
    .compact-actions { justify-content: flex-start; }
}
@media (max-width: 640px) {
    .order-type { flex-direction: row; justify-content: space-between; gap: .4rem; }
}

/* Service dashboard priority sections */
.service-section {
    border: 2px solid var(--line);
    border-radius: 14px;
    padding: .55rem;
    margin: .65rem 0 .9rem;
    background: var(--card);
}
.service-section h2 {
    display: flex;
    align-items: baseline;
    gap: .18rem;
    flex-wrap: wrap;
}
.service-section .section-bracket {
    font-weight: 900;
    font-size: 1.25em;
    line-height: .8;
}
.top-section { border-color: #d88b8b; background: #fffafa; }
.top-section .section-bracket { color: var(--bad); }
.mid-section { border-color: #9bd3b4; background: #fbfffc; }
.mid-section .section-bracket { color: var(--ok); }
.bottom-section { border-color: #d6d0c8; background: #f8f6f2; }
.bottom-section .section-bracket { color: #9a9188; }
.neutral-section { border-color: var(--line); background: var(--card); }
.order-row.pending-order { border-left-color: #aaa198; background: #fffdfa; }

/* v5 layout refinements */
.phone-field {
    display: flex;
    align-items: stretch;
    width: 100%;
}
.phone-field span {
    display: inline-flex;
    align-items: center;
    padding: 0 .8rem;
    border: 1px solid var(--line);
    border-right: 0;
    border-radius: 10px 0 0 10px;
    background: #fff7ef;
    font-weight: 800;
}
.phone-field input {
    border-radius: 0 10px 10px 0;
    min-width: 0;
}
.order-form-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr);
    gap: .75rem;
    align-items: end;
}
.order-form input[type="datetime-local"] {
    min-width: 0;
    width: 100%;
}
.qty-control {
    display: grid;
    grid-template-columns: 44px minmax(64px, 1fr) 44px;
    gap: .35rem;
    align-items: center;
    max-width: 180px;
}
.qty-control input[type="number"] {
    max-width: none;
    text-align: center;
    font-weight: 800;
    padding-left: .35rem;
    padding-right: .35rem;
}
.qty-btn {
    width: 44px;
    height: 44px;
    padding: 0;
    border-radius: 12px;
    font-size: 1.25rem;
    line-height: 1;
}
.order-row-main {
    grid-template-columns: minmax(64px, auto) minmax(120px, 1fr) minmax(84px, auto) minmax(86px, auto) minmax(180px, 2fr) minmax(70px, auto) minmax(126px, auto);
}
.order-collection em {
    color: var(--muted);
    font-size: .78rem;
    font-style: normal;
    white-space: nowrap;
}
.order-type strong,
.order-collection strong {
    font-size: .95rem;
}
.order-row {
    cursor: pointer;
}
.order-row:focus {
    outline: 3px solid #f2c4a5;
    outline-offset: 2px;
}
.order-detail-panel {
    display: none;
}
.detail-mode .service-section > h2,
.detail-mode .compact-empty,
.detail-mode .order-row:not(.detail-open) {
    display: none;
}
.detail-mode .service-section {
    border-color: transparent;
    background: transparent;
    padding: 0;
}
.order-row.detail-open {
    cursor: default;
    padding: 1rem;
    border-left-width: 8px;
}
.order-row.detail-open .order-row-main {
    display: none;
}
.order-row.detail-open .order-detail-panel {
    display: block;
}
.detail-header {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    margin-bottom: 1rem;
}
.detail-header h2 {
    margin: 0 0 .25rem;
    font-size: clamp(1.7rem, 4vw, 2.4rem);
}
.detail-meta-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: .75rem;
    margin-bottom: 1rem;
}
.detail-meta-grid div {
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: .8rem;
    background: #fffdf9;
}
.detail-meta-grid span {
    display: block;
    color: var(--muted);
    font-size: .9rem;
}
.detail-meta-grid strong {
    display: block;
    font-size: 1.35rem;
    margin-top: .15rem;
}
.order-detail-items {
    display: flex;
    flex-direction: column;
    gap: .55rem;
    margin: 1rem 0;
}
.detail-item-row {
    display: grid;
    grid-template-columns: 70px minmax(0, 1fr) auto;
    gap: .75rem;
    align-items: center;
    padding: .85rem;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: white;
    font-size: clamp(1.2rem, 3vw, 1.65rem);
}
.detail-item-row em {
    font-style: normal;
    color: var(--muted);
    font-size: .9rem;
}
.detail-remarks {
    font-size: 1.15rem;
    padding: .85rem;
}
.detail-actions button {
    font-size: 1.05rem;
    padding: .85rem 1.2rem;
}
@media (max-width: 1100px) {
    .order-row-main {
        grid-template-columns: minmax(60px, auto) minmax(120px, 1fr) minmax(84px, auto) minmax(86px, auto);
    }
    .order-items-line,
    .order-total,
    .compact-actions {
        grid-column: 1 / -1;
    }
    .order-total { text-align: left; }
    .compact-actions { justify-content: flex-start; }
}
@media (max-width: 640px) {
    .order-form-grid { grid-template-columns: 1fr; }
    .order-form input[type="datetime-local"] { font-size: .95rem; padding-left: .55rem; padding-right: .55rem; }
    .qty-control { max-width: none; grid-template-columns: 48px minmax(70px, 1fr) 48px; }
    .qty-btn { width: 48px; height: 48px; }
    .order-row-main { grid-template-columns: 1fr; }
    .order-customer,
    .order-collection,
    .order-type { flex-direction: row; justify-content: space-between; gap: .4rem; }
    .order-collection { align-items: center; }
    .order-collection em { margin-left: .35rem; }
    .detail-header { flex-direction: column; }
    .detail-header .button { width: auto; }
    .detail-item-row { grid-template-columns: 54px minmax(0, 1fr); }
    .detail-item-row em { grid-column: 2; }
}

/* v5 final overrides */
.phone-input-row {
    display: flex;
    align-items: stretch;
    width: 100%;
}
.phone-prefix {
    display: inline-flex;
    align-items: center;
    padding: 0 .85rem;
    border: 1px solid var(--line);
    border-right: 0;
    border-radius: 10px 0 0 10px;
    background: #fff7ef;
    font-weight: 800;
    white-space: nowrap;
}
.phone-input-row input {
    border-radius: 0 10px 10px 0;
    min-width: 0;
}
.order-collection strong {
    display: flex;
    flex-direction: column;
    line-height: 1.1;
    white-space: nowrap;
}
.order-type strong { white-space: nowrap; }
.order-row-main {
    grid-template-columns: minmax(58px, auto) minmax(112px, 1fr) minmax(72px, auto) minmax(74px, auto) minmax(160px, 2fr) minmax(64px, auto) minmax(118px, auto);
}
.order-row:hover { border-color: #d8c6b7; }
.service-order-detail h2 { font-size: clamp(1.8rem, 5vw, 2.6rem); margin: 0 0 .25rem; }
.service-detail-header { align-items: flex-start; }
.service-detail-header .service-back-btn { width: auto; }
.service-detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(155px, 1fr));
    gap: .75rem;
    margin: 1rem 0;
}
.service-detail-grid div {
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: .85rem;
    background: #fffdf9;
}
.service-detail-grid span {
    display: block;
    color: var(--muted);
    font-size: .9rem;
}
.service-detail-grid strong {
    display: block;
    font-size: clamp(1.15rem, 3vw, 1.55rem);
    margin-top: .15rem;
}
.service-detail-items h3 { font-size: 1.25rem; margin-bottom: .5rem; }
.service-detail-item-row,
.service-detail-total {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: .75rem;
    align-items: center;
    padding: .85rem 1rem;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: white;
    margin-bottom: .5rem;
    font-size: clamp(1.2rem, 3.5vw, 1.7rem);
}
.service-detail-total {
    background: #fff7ef;
    font-size: clamp(1.25rem, 3.5vw, 1.75rem);
}
.service-detail-remarks {
    padding: 1rem;
    border-radius: 12px;
    background: #fff7ef;
    margin: 1rem 0;
    font-size: 1.2rem;
}
.service-detail-actions button { font-size: 1.05rem; padding: .85rem 1.2rem; }
@media (max-width: 1100px) {
    .order-row-main { grid-template-columns: minmax(58px, auto) minmax(112px, 1fr) minmax(72px, auto) minmax(74px, auto); }
    .order-items-line,
    .order-total,
    .compact-actions { grid-column: 1 / -1; }
}
@media (max-width: 640px) {
    .phone-prefix { padding: 0 .7rem; }
    .service-detail-header .service-back-btn { width: 100%; }
    .order-collection strong { align-items: flex-end; }
}
.phone-input {
    display: flex;
    align-items: stretch;
    width: 100%;
}
.phone-input span {
    display: inline-flex;
    align-items: center;
    padding: 0 .85rem;
    border: 1px solid var(--line);
    border-right: 0;
    border-radius: 10px 0 0 10px;
    background: #fff7ef;
    font-weight: 800;
    white-space: nowrap;
}
.phone-input input {
    border-radius: 0 10px 10px 0;
    min-width: 0;
}

/* v5.1 final layout fixes */
.order-options {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 220px);
    gap: .75rem;
    align-items: end;
    margin-bottom: .75rem;
}
.form-field { min-width: 0; }
.collection-field input[type="datetime-local"] {
    width: 100%;
    min-width: 0;
    max-width: 100%;
}
.dining-field select { width: 100%; }
.qty-control {
    width: 100%;
    max-width: 210px;
    grid-template-columns: 48px minmax(68px, 1fr) 48px;
}
.qty-btn {
    min-width: 48px;
    min-height: 48px;
    font-size: 1.35rem;
}
.qty-control input[type="number"] {
    min-height: 48px;
    font-size: 1.1rem;
}
.service-orders-card { padding: .25rem 0; }
.service-section { overflow: hidden; }
.order-row-main {
    grid-template-columns: minmax(54px, auto) minmax(120px, 1fr) minmax(82px, auto) minmax(92px, auto) minmax(140px, 2fr) minmax(64px, auto) minmax(116px, auto);
    column-gap: .55rem;
}
.order-collection { min-width: 82px; }
.order-type { min-width: 92px; }
.order-collection strong {
    display: flex;
    flex-direction: column;
    gap: .05rem;
    white-space: nowrap;
    line-height: 1.08;
}
.order-type strong { white-space: nowrap; }
.order-items-line { min-width: 0; }
.order-row-main .badge { display: none; }
.service-order-detail {
    font-size: 1.08rem;
}
.service-detail-item-row strong { line-height: 1.25; }
@media (max-width: 1100px) {
    .order-row-main {
        grid-template-columns: minmax(54px, auto) minmax(120px, 1fr) minmax(82px, auto) minmax(92px, auto);
    }
    .order-items-line,
    .order-total,
    .compact-actions { grid-column: 1 / -1; }
}
@media (max-width: 640px) {
    .order-options { grid-template-columns: 1fr; }
    .collection-field input[type="datetime-local"] {
        font-size: .95rem;
        padding-left: .55rem;
        padding-right: .55rem;
    }
    .qty-control {
        max-width: none;
        grid-template-columns: 56px minmax(72px, 1fr) 56px;
    }
    .qty-btn {
        min-width: 56px;
        min-height: 52px;
    }
    .qty-control input[type="number"] {
        min-height: 52px;
        font-size: 1.2rem;
    }
    .order-row-main { grid-template-columns: 1fr; }
    .order-customer,
    .order-collection,
    .order-type {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        min-width: 0;
        gap: .5rem;
    }
    .order-collection strong { align-items: flex-end; }
}

/* v6 refinements */
.menu-description {
    margin: -.15rem 0 .15rem;
    color: var(--muted);
    font-size: .95rem;
    line-height: 1.35;
}
button.ready,
.button.ready {
    background: #1f5fae;
}
button.ready:hover,
.button.ready:hover {
    background: #184982;
}
.compact-actions:empty {
    display: none;
}
.service-detail-actions .ready {
    min-width: 120px;
}
.badge.READY {
    background: #dbeafe;
    color: #1f5fae;
}
.slot-adjust-message {
    margin: .35rem 0 0;
    padding: .45rem .6rem;
    border-radius: 10px;
    border: 1px solid #bdd7ff;
    background: #f5f9ff;
    color: #1f4d8a;
}
.service-detail-item-row > div {
    min-width: 0;
}
.service-detail-item-description {
    margin: .25rem 0 0;
    color: var(--muted);
    font-size: clamp(.95rem, 2.5vw, 1.15rem);
    line-height: 1.35;
}
.compact-actions .undo {
    min-width: 78px;
}

/* v9 refinements */
.topbar-clock {
    color: #fff7ef;
    font-weight: 900;
    white-space: nowrap;
}
.settings-checkbox-row {
    display: flex;
    align-items: center;
    gap: .75rem;
    flex-wrap: wrap;
}
.settings-checkbox-row .settings-checkbox {
    margin-bottom: .35rem;
}
.test-sound-btn {
    margin-bottom: .35rem;
}
.order-countdown {
    display: flex;
    flex-direction: column;
    gap: .05rem;
    min-width: 0;
}
.order-countdown span {
    color: var(--muted);
    font-size: .82rem;
}
.order-countdown strong {
    white-space: nowrap;
    font-size: .95rem;
}
.order-countdown strong.due-now {
    color: var(--warn);
}
.order-countdown strong.overdue {
    color: var(--bad);
}
.order-row-main {
    grid-template-columns: minmax(64px, auto) minmax(116px, 1fr) minmax(84px, auto) minmax(56px, auto) minmax(86px, auto) minmax(170px, 2fr) minmax(70px, auto) minmax(126px, auto);
}
@media (max-width: 1180px) {
    .order-row-main { grid-template-columns: minmax(64px, auto) minmax(116px, 1fr) minmax(84px, auto) minmax(56px, auto); }
    .order-type, .order-items-line, .order-total, .compact-actions { grid-column: auto; }
    .order-items-line { grid-column: 1 / -1; }
}
@media (max-width: 640px) {
    .topbar-clock { font-size: .95rem; }
    .settings-checkbox-row { align-items: flex-start; flex-direction: column; gap: .25rem; }
    .test-sound-btn { width: auto; }
    .order-row-main { grid-template-columns: 1fr; }
    .order-countdown { flex-direction: row; justify-content: space-between; gap: .4rem; }
}


/* v10 service workflow refinements */
.ready-section { border-color: #8ad0a7; background: #f5fff8; }
.ready-section .section-bracket { color: var(--ok); }
.pack-section,
.top-section { border-color: #e08b8b; background: #fff7f7; }
.pack-section .section-bracket,
.top-section .section-bracket { color: var(--bad); }
.prep-section,
.mid-section { border-color: #8ab6e8; background: #f5faff; }
.prep-section .section-bracket,
.mid-section .section-bracket { color: #1f5fae; }
.pending-section,
.bottom-section { border-color: #d6d0c8; background: #f8f6f2; }
.pending-section .section-bracket,
.bottom-section .section-bracket { color: #9a9188; }
.order-row.ready-order { border-left-color: var(--ok); background: #fbfffc; }
.order-row.pack-now { border-left-color: var(--bad); }
.order-row.prep-soon { border-left-color: #1f5fae; }
.special-section { border-color: #e3bd55; background: #fffaf0; }
.special-section .section-bracket { color: #c98300; }
.order-row.special-order { border-left-color: #d69b00; background: #fffdf7; }
.my-order-delivered-time { margin-top: -.35rem; }
.order-item-delivered-time {
    display: block;
    margin-top: .12rem;
}
.order-items .item-meta {
    display: block;
    color: var(--muted);
    font-size: .88rem;
    margin-top: .12rem;
}

/* Customer menu category navigation */
.category-nav {
    display: flex;
    gap: .5rem;
    overflow-x: auto;
    padding: .35rem 0 .75rem;
    margin-bottom: .5rem;
    position: sticky;
    top: 4.2rem;
    z-index: 5;
    background: var(--bg);
}
.category-nav a {
    flex: 0 0 auto;
    padding: .55rem .8rem;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: white;
    color: var(--ink);
    font-weight: 750;
}
.menu-category-section {
    scroll-margin-top: 8rem;
    margin: 1rem 0 1.4rem;
}
.category-heading {
    margin: .35rem 0 .75rem;
}
.category-heading h2 {
    margin-bottom: .15rem;
}
.menu-card-warning {
    outline: 3px solid #f1d392;
    outline-offset: 2px;
}
.subtle-card {
    background: #fffdf9;
    box-shadow: none;
}
.menu-admin-form {
    max-width: 980px;
}
.admin-menu-actions {
    justify-content: flex-start;
}
.compact-input {
    max-width: 110px;
    padding: .45rem .55rem;
}
.inline {
    display: inline-flex;
    margin: 0;
}
.service-detail-choice {
    margin: .28rem 0 0 1rem;
    color: var(--ink);
    font-size: clamp(1rem, 2.7vw, 1.25rem);
    line-height: 1.3;
}
.service-detail-choice span {
    color: var(--accent-dark);
    font-weight: 800;
}
.service-detail-choice small {
    display: block;
    color: var(--muted);
    font-size: .88em;
    margin-left: 1.1rem;
}
@media (max-width: 640px) {
    .category-nav {
        top: 6.5rem;
    }
    .inline button {
        width: auto;
    }
}


.menu-title {
    margin-bottom: .4rem;
}
.category-tabs-wrap {
    display: flex;
    align-items: center;
    gap: .55rem;
    overflow: hidden;
    padding: .35rem 0 .75rem;
    margin-bottom: .5rem;
    position: sticky;
    top: 4.2rem;
    z-index: 6;
    background: var(--bg);
}
.category-tabs-wrap .category-tabs {
    flex: 1 1 auto;
    min-width: 0;
    margin: 0;
    padding: 0;
    position: static;
    background: transparent;
}
.category-tabs-action {
    flex: 0 0 auto;
}
.menu-tab-submit {
    width: auto;
    white-space: nowrap;
    padding: .55rem .8rem;
}

/* v12 customer menu, preview, and admin refinements */
.order-options {
    align-items: start;
}
.category-tabs {
    display: flex;
    gap: .5rem;
    overflow-x: auto;
    padding: .35rem 0 .75rem;
    margin-bottom: .5rem;
    background: var(--bg);
}
.category-tab {
    flex: 0 0 auto;
    padding: .55rem .8rem;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: white;
    color: var(--ink);
    font-weight: 750;
    width: auto;
}
.category-tab.active {
    background: var(--accent);
    border-color: var(--accent);
    color: white;
}
.category-tab:hover {
    background: var(--accent-dark);
    border-color: var(--accent-dark);
    color: white;
}
.order-preview-overlay {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: rgba(20, 12, 6, .55);
}
.order-preview-overlay[hidden] {
    display: none;
}
.order-preview-modal {
    width: min(680px, 100%);
    max-height: min(86vh, 820px);
    overflow: auto;
    background: var(--card);
    border-radius: 18px;
    padding: 1rem;
    border: 1px solid var(--line);
    box-shadow: 0 22px 60px rgba(0, 0, 0, .28);
}
.order-preview-modal h2 {
    margin-top: 0;
}
.preview-summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: .65rem;
    margin: .75rem 0;
}
.preview-summary-grid div {
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: .75rem;
    background: #fffdf9;
}
.preview-summary-grid span,
.preview-total span {
    display: block;
    color: var(--muted);
    font-size: .86rem;
}
.preview-summary-grid strong {
    display: block;
    margin-top: .15rem;
}
.preview-items {
    display: grid;
    gap: .5rem;
    margin: .75rem 0;
}
.preview-item-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: .75rem;
    align-items: start;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: .75rem;
    background: white;
}
.preview-item-row span {
    display: block;
    color: var(--muted);
    font-size: .92rem;
    margin-top: .18rem;
}
.preview-item-row em {
    font-style: normal;
    font-weight: 800;
    white-space: nowrap;
}
.preview-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    border-top: 1px solid var(--line);
    padding-top: .75rem;
    margin-top: .75rem;
}
.preview-total strong {
    font-size: 1.45rem;
}
.preview-remarks {
    background: #fff7ef;
    padding: .65rem .75rem;
    border-radius: 12px;
}
.slot-suggestions {
    margin-top: .75rem;
    padding: .75rem;
    border: 1px solid #bdd7ff;
    border-radius: 12px;
    background: #f5f9ff;
}
.password-input {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: stretch;
}
.password-input input {
    border-radius: 10px 0 0 10px;
}
.password-eye {
    border-radius: 0 10px 10px 0;
    padding: 0 .85rem;
    min-width: 58px;
}
.admin-menu-tabs {
    margin-bottom: 0;
}
.admin-menu-tabs .tab span {
    opacity: .8;
    font-size: .86em;
}
@media (max-width: 640px) {
    .category-tabs-wrap {
        top: 6.5rem;
    }
    .category-tabs {
        top: auto;
    }
    .category-tab {
        width: auto;
    }
    .menu-tab-submit {
        width: auto;
        padding-left: .7rem;
        padding-right: .7rem;
    }
    .order-preview-actions button,
    .slot-suggestions button {
        width: 100%;
    }
    .preview-item-row {
        grid-template-columns: 1fr;
    }
    .password-eye {
        width: auto;
    }
}


/* v14 customer submit placement: keep category tabs full width */
.customer-submit-bar {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    margin: .25rem 0 .55rem;
}
.customer-submit-bar .menu-submit-button {
    width: auto;
    white-space: nowrap;
    padding-left: 1.05rem;
    padding-right: 1.05rem;
}
.category-tabs-wrap .category-tabs {
    width: 100%;
}
@media (max-width: 640px) {
    .order-form {
        padding-bottom: 5.75rem;
    }
    .customer-submit-bar {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 80;
        display: block;
        margin: 0;
        padding: .7rem 1rem calc(.7rem + env(safe-area-inset-bottom));
        background: rgba(255, 252, 247, .98);
        border-top: 1px solid var(--line);
        box-shadow: 0 -10px 28px rgba(25, 15, 5, .14);
    }
    .customer-submit-bar .menu-submit-button {
        display: block;
        width: min(100%, 640px);
        min-width: 0;
        min-height: 48px;
        margin: 0 auto;
        font-size: 1rem;
    }
}

/* v15 modify-order action placement */
.customer-edit-submit-bar {
    gap: .5rem;
    flex-wrap: wrap;
}
.customer-edit-submit-bar .menu-submit-button,
.customer-edit-submit-bar .menu-cancel-button {
    width: auto;
    white-space: nowrap;
    padding-left: 1.05rem;
    padding-right: 1.05rem;
}
@media (max-width: 640px) {
    .customer-edit-submit-bar {
        display: flex;
        justify-content: center;
        gap: .55rem;
    }
    .customer-edit-submit-bar .menu-submit-button,
    .customer-edit-submit-bar .menu-cancel-button {
        display: inline-flex;
        flex: 1 1 0;
        width: auto;
        max-width: 310px;
        min-width: 0;
        min-height: 48px;
        margin: 0;
        padding-left: .7rem;
        padding-right: .7rem;
        font-size: .95rem;
    }
}

/* v16 pre-order requirement controls */
.preorder-label,
.sub-preorder-label,
.preview-preorder {
    color: #8a4b08;
    font-weight: 750;
}
.preorder-label {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    margin: -.15rem 0 .1rem;
    padding: .28rem .5rem;
    border-radius: 999px;
    background: #fff2d8;
    border: 1px solid #f1cf91;
    font-size: .88rem;
    line-height: 1.25;
}
.sub-preorder-label {
    background: #fff7e8;
    border-radius: 8px;
    padding: .18rem .35rem;
}
.preorder-admin-section {
    margin: .85rem 0;
}
.preorder-admin-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: .75rem;
    align-items: start;
}
.preview-preorder {
    background: #fff7e8;
    border-radius: 8px;
    padding: .16rem .35rem;
    width: fit-content;
}

/* v18 finite collection slots and reliable hidden pre-order notices */
[hidden] {
    display: none !important;
}
.collection-slot-select {
    width: 100%;
    max-width: 100%;
}

/* v19 admin/service session usability and customer collection picker restore */
.collection-datetime-input {
    width: 100%;
    max-width: 100%;
}
.admin-menu-list-card {
    width: min(1500px, calc(100vw - 2rem));
    margin-left: 50%;
    transform: translateX(-50%);
    padding: .75rem;
}
.admin-menu-list-card table {
    font-size: .9rem;
}
.admin-menu-list-card th,
.admin-menu-list-card td {
    padding: .5rem .55rem;
}
.admin-menu-list-card td:nth-child(2),
.admin-menu-list-card td:nth-child(3),
.admin-menu-list-card td:nth-child(5),
.admin-menu-list-card td:nth-child(7),
.admin-menu-list-card td:nth-child(8),
.admin-menu-list-card td:nth-child(10),
.admin-menu-list-card td:nth-child(11),
.admin-menu-list-card td:nth-child(12),
.admin-menu-list-card td:nth-child(13) {
    white-space: nowrap;
}
.admin-menu-list-card td:nth-child(4) {
    min-width: 220px;
    max-width: 320px;
}
.admin-menu-list-card td:nth-child(6) {
    min-width: 56px;
}
@media (max-width: 900px) {
    .admin-menu-list-card {
        width: calc(100vw - .75rem);
    }
}

/* v19: wider admin menu list and restored calendar-style collection picker */
.container.container-wide {
    width: min(1500px, calc(100% - 1rem));
}
.menu-admin-container .form-card {
    max-width: 1000px;
}
.menu-items-list-wide table {
    font-size: .9rem;
}
.menu-items-list-wide th,
.menu-items-list-wide td {
    padding: .55rem .5rem;
    vertical-align: top;
}
.menu-items-list-wide td:nth-child(4) {
    max-width: 260px;
}
.collection-field input[type="datetime-local"] {
    width: 100%;
    box-sizing: border-box;
}
/* v19 menu-items table wide viewport fallback */
.admin-menu-list-card {
    width: min(1500px, calc(100vw - 2rem));
    margin-left: 50%;
    transform: translateX(-50%);
}
.admin-menu-list-card td:nth-child(2),
.admin-menu-list-card td:nth-child(3),
.admin-menu-list-card td:nth-child(5),
.admin-menu-list-card td:nth-child(7),
.admin-menu-list-card td:nth-child(8),
.admin-menu-list-card td:nth-child(10),
.admin-menu-list-card td:nth-child(11),
.admin-menu-list-card td:nth-child(12),
.admin-menu-list-card td:nth-child(13) {
    white-space: nowrap;
}
@media (max-width: 900px) {
    .admin-menu-list-card {
        width: calc(100vw - .75rem);
    }
}



/* v20 admin menu split/list refinements */
.admin-menu-list-toolbar {
    align-items: center;
    gap: 1rem;
    margin-bottom: .55rem;
}
.admin-menu-list-toolbar h2 { margin-bottom: .15rem; }
.admin-menu-form-header { align-items: center; margin-bottom: .75rem; }
.category-manage-row {
    display: flex;
    gap: .6rem;
    align-items: stretch;
}
.category-manage-row select { flex: 1 1 auto; min-width: 0; }
.category-manage-row .button {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    margin-top: 0;
}
.admin-menu-list-card table { min-width: 1320px; }
.admin-menu-list-card th.preorder-col,
.admin-menu-list-card td.preorder-col {
    width: 166px;
    min-width: 166px !important;
    max-width: 166px;
    white-space: normal;
    overflow-wrap: anywhere;
    font-size: .8rem;
    line-height: 1.18;
}
.admin-menu-list-card th.on-menu-col,
.admin-menu-list-card td.on-menu-col {
    width: 78px;
    min-width: 78px !important;
    max-width: 78px;
    text-align: center;
    white-space: nowrap;
    padding-left: .35rem;
    padding-right: .35rem;
}
.admin-menu-list-card th.sub-col,
.admin-menu-list-card td.sub-col {
    width: 60px;
    min-width: 60px !important;
    max-width: 60px;
    text-align: center;
    white-space: nowrap;
    padding-left: .35rem;
    padding-right: .35rem;
}
.admin-menu-list-card th.on-menu-col,
.admin-menu-list-card th.sub-col {
    font-size: .78rem;
    line-height: 1.05;
}
@media (max-width: 720px) {
    .category-manage-row { flex-direction: column; }
    .category-manage-row .button { width: 100%; }
}

/* v20 service pre-order indicators */
.order-items-line {
    display: flex;
    align-items: center;
    gap: .35rem;
}
.order-items-text {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}
.preorder-star {
    color: #f5b400;
    font-size: 1.18rem;
    line-height: 1;
    text-shadow: 0 1px 0 rgba(70, 47, 0, .18);
    flex: 0 0 auto;
}
.order-items-line .preorder-star { margin-left: auto; }
.detail-star { margin-left: .22rem; vertical-align: -1px; }
.order-row.preorder-service-order .order-countdown strong {
    color: var(--bad);
    font-weight: 850;
}



/* v22 final admin menu column spacing */
.admin-menu-list-card table { min-width: 1320px; }
.admin-menu-list-card th.preorder-col,
.admin-menu-list-card td.preorder-col {
    width: 166px;
    min-width: 166px !important;
    max-width: 166px;
}
.admin-menu-list-card th.on-menu-col,
.admin-menu-list-card td.on-menu-col {
    width: 78px;
    min-width: 78px !important;
    max-width: 78px;
    text-align: center;
}
.admin-menu-list-card th.sub-col,
.admin-menu-list-card td.sub-col {
    width: 60px;
    min-width: 60px !important;
    max-width: 60px;
    text-align: center;
}
.admin-menu-list-card th.on-menu-col,
.admin-menu-list-card th.sub-col {
    font-size: .76rem;
    line-height: 1.08;
    white-space: nowrap;
}

/* Compact menu administration table */
.admin-menu-list-card table {
    width: 100%;
    min-width: 1180px;
    table-layout: fixed;
}
.admin-menu-list-card th,
.admin-menu-list-card td {
    overflow-wrap: anywhere;
    vertical-align: top;
}
.admin-menu-list-card .image-col { width: 64px; }
.admin-menu-list-card .image-col img {
    width: 52px;
    height: 40px;
    object-fit: cover;
    border-radius: 8px;
}
.admin-menu-list-card .name-col { width: 112px; }
.admin-menu-list-card .category-col { width: 88px; }
.admin-menu-list-card .description-col {
    width: 145px;
    min-width: 0 !important;
    max-width: 145px !important;
    white-space: normal !important;
    line-height: 1.25;
}
.admin-menu-list-card td.description-col .description-text {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    overflow: hidden;
}
.admin-menu-list-card .price-col {
    width: 86px;
    white-space: nowrap !important;
}
.admin-menu-list-card .stock-initial-col { width: 66px; }
.admin-menu-list-card .preorder-col {
    width: 126px;
    min-width: 0 !important;
    max-width: 126px;
}
.admin-menu-list-card .available-col { width: 66px; text-align: center; }
.admin-menu-list-card .customer-menu-col { width: 72px; text-align: center; }
.admin-menu-list-card .counter-terminal-col { width: 82px; text-align: center; }
.admin-menu-list-card .required-col { width: 82px; text-align: center; }
.admin-menu-list-card .status-col { width: 64px; }
.admin-menu-list-card .order-col { width: 48px; text-align: center; }
.admin-menu-list-card .action-col {
    width: 66px;
    position: sticky;
    right: 0;
    z-index: 1;
    background: #fff;
    box-shadow: -5px 0 8px rgba(44, 31, 20, .05);
}
.admin-menu-list-card th.action-col {
    z-index: 2;
    background: #fff7ef;
}
.service-audio-control:not([hidden]) {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
}
.service-audio-control button { flex: 0 0 auto; }
@media (max-width: 520px) {
    .service-audio-control:not([hidden]) { align-items: stretch; flex-direction: column; }
    .service-audio-control button { width: 100%; }
}

/* Stage 2 grouped menu administration */
.admin-toolbar-actions {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    align-items: center;
}
.admin-current-menu-image {
    display: block;
    width: min(220px, 100%);
    max-height: 170px;
    object-fit: cover;
    border-radius: 12px;
    border: 1px solid var(--line);
}
.admin-item-config-summary { margin-top: 1rem; }
.admin-choice-groups-card,
.admin-choice-group-form,
.admin-menu-configuration-form {
    width: min(1320px, 100%);
    margin-left: auto;
    margin-right: auto;
}
.admin-choice-group-form { padding: 1.1rem; }
.admin-config-basic-grid,
.admin-config-section-grid,
.admin-config-group-grid {
    display: grid;
    gap: .75rem;
    align-items: end;
}
.admin-config-basic-grid { grid-template-columns: minmax(240px, 1fr) 150px; }
.admin-config-section-grid { grid-template-columns: minmax(230px, 2fr) minmax(190px, 1fr) 130px 130px 130px; }
.admin-config-group-grid { grid-template-columns: minmax(220px, 2fr) 130px 130px minmax(210px, 1.4fr) minmax(175px, 1fr) 120px; }
.admin-config-section-name,
.admin-config-group-picker { min-width: 0; }
.admin-config-section-grid input,
.admin-config-section-grid select,
.admin-config-group-grid input,
.admin-config-group-grid select { max-width: 100%; }
.admin-group-members { margin-top: 1rem; }
.admin-group-members table { min-width: 850px; }
.admin-disabled-choice-row { background: #f5f2ee; opacity: .7; }
.admin-config-intro { margin-bottom: 1rem; }
.admin-config-intro h2,
.admin-config-block-header h3,
.admin-config-block-header h4 { margin: 0; }
.admin-config-section {
    border: 2px solid #dfcdbd;
    box-shadow: 0 10px 28px rgba(66,40,15,.08);
}
.admin-config-group {
    margin: .8rem 0;
    border-radius: 12px;
    box-shadow: none;
}
.admin-config-block-header { align-items: center; margin-bottom: .55rem; }
.admin-config-choice-list { margin-top: .65rem; }
.admin-config-choice-list table { min-width: 730px; font-size: .9rem; }
.admin-config-choice-list th,
.admin-config-choice-list td { padding: .5rem; }
.admin-config-choice-list th:first-child,
.admin-config-choice-list td:first-child { width: 75px; text-align: center; }
.admin-config-choice-list th:nth-child(3),
.admin-config-choice-list td:nth-child(3) { width: 165px; }
.admin-config-choice-list th:nth-child(4),
.admin-config-choice-list td:nth-child(4) { width: 105px; text-align: center; }
.admin-config-choice-list th:nth-child(5),
.admin-config-choice-list td:nth-child(5) { width: 90px; }
.compact-price-input { width: 145px; max-width: 145px; }
.admin-config-section.is-extras-section .selection-only { display: none; }
.admin-filter-help { margin: .35rem 0; }
.admin-config-footer {
    position: sticky;
    bottom: 0;
    z-index: 5;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-top: 1rem;
    padding: .75rem;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: rgba(255, 250, 243, .97);
    box-shadow: 0 -8px 24px rgba(66,40,15,.1);
}
.stage2-admin-menu-list table { min-width: 1390px; }
.stage2-admin-menu-list .groups-col { width: 130px; white-space: normal !important; }
.stage2-admin-menu-list .configuration-col { width: 105px; white-space: normal !important; }

@media (max-width: 1050px) {
    .admin-config-section-grid { grid-template-columns: repeat(2, minmax(180px, 1fr)); }
    .admin-config-group-grid { grid-template-columns: repeat(2, minmax(180px, 1fr)); }
}
@media (max-width: 700px) {
    .admin-toolbar-actions,
    .admin-config-footer { align-items: stretch; flex-direction: column; width: 100%; }
    .admin-toolbar-actions .button,
    .admin-toolbar-actions button,
    .admin-config-footer > .button { width: 100%; }
    .admin-config-basic-grid,
    .admin-config-section-grid,
    .admin-config-group-grid { grid-template-columns: 1fr; }
    .admin-config-block-header { align-items: stretch; }
    .admin-config-block-header .button { width: 100%; }
}

/* Stage 2 customer item configurator */
.configuration-requirements {
    display: flex;
    flex-wrap: wrap;
    gap: .35rem;
    margin: .15rem 0 .25rem;
}
.configuration-progress {
    display: flex;
    justify-content: space-between;
    gap: .55rem;
    margin: 0;
    padding: .28rem .48rem;
    border-radius: 999px;
    background: #f1f5f9;
    color: #475569;
    font-size: .76rem;
    line-height: 1.2;
}
.configuration-progress > span:last-child {
    color: var(--accent-dark);
    font-weight: 800;
}
.configuration-group {
    display: grid;
    gap: .4rem;
    min-width: 0;
    margin: .2rem 0;
    padding: 0;
    border: 0;
}
.configuration-group + .configuration-group {
    margin-top: .3rem;
}
.configuration-group-heading {
    width: 100%;
    margin: 0 0 .05rem;
    padding: 0;
    color: var(--ink);
    font-size: .84rem;
    font-weight: 800;
}
.configuration-group-heading small {
    margin-left: .4rem;
    color: var(--muted);
    font-size: .72rem;
    font-weight: 600;
}
.configuration-choice {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: .65rem;
    align-items: center;
    padding: .48rem .55rem;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fff;
}
.configuration-choice-copy {
    display: flex;
    flex-direction: column;
    gap: .12rem;
    min-width: 0;
    margin: 0;
    font-weight: inherit;
}
.configuration-toggle-choice .configuration-choice-copy { cursor: pointer; }
.configuration-choice-copy small { color: var(--muted); line-height: 1.25; }
.configuration-choice-copy em {
    color: var(--accent-dark);
    font-size: .82rem;
    font-style: normal;
    font-weight: 800;
}
input.configuration-checkbox {
    width: 27px;
    height: 27px;
    margin: 0 .2rem 0 0;
    padding: 0;
    accent-color: var(--accent);
    cursor: pointer;
}
input.configuration-checkbox:disabled { cursor: not-allowed; }
.configuration-quantity {
    display: grid;
    grid-template-columns: 34px 42px 34px;
    gap: .25rem;
    align-items: center;
}
.configuration-quantity button {
    width: 34px;
    min-height: 34px;
    padding: 0;
}
.configuration-quantity input {
    width: 42px;
    min-width: 0;
    height: 34px;
    margin: 0;
    padding: .25rem;
    text-align: center;
    -moz-appearance: textfield;
}
.configuration-quantity input::-webkit-outer-spin-button,
.configuration-quantity input::-webkit-inner-spin-button { margin: 0; -webkit-appearance: none; }
.configuration-error {
    min-height: 1.2em;
    margin: 0;
    color: #b42318;
    font-weight: 750;
}
.configured-line-total { margin: -.15rem 0 .1rem; text-align: right; }

@media (max-width: 480px) {
    .configuration-choice { align-items: start; }
    input.configuration-checkbox { margin-top: .2rem; }
    .configuration-quantity { grid-template-columns: 32px 38px 32px; }
    .configuration-quantity button { width: 32px; }
    .configuration-quantity input { width: 38px; }
}
