:root {
    --bg: #f8f5ef;
    --surface: #ffffff;
    --surface-soft: #fff7ed;
    --surface-green: #eef8f1;
    --text: #1f2933;
    --muted: #667085;
    --border: #e4ded4;
    --primary: #b33a2f;
    --primary-dark: #8d2f28;
    --accent: #22785a;
    --warning: #a86419;
    --danger: #b42318;
    --shadow: 0 10px 28px rgba(31, 41, 51, 0.08);
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    background: var(--bg);
    touch-action: manipulation;
}

body {
    min-height: 100%;
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 16px;
    line-height: 1.45;
    touch-action: manipulation;
    -webkit-text-size-adjust: 100%;
    overscroll-behavior: none;
}

button,
input,
select,
textarea {
    font: inherit;
}

button {
    cursor: pointer;
}

button:disabled,
input:disabled,
textarea:disabled,
select:disabled {
    cursor: not-allowed;
    opacity: 0.55;
}

h1,
h2,
h3,
h4,
p {
    margin: 0;
}

.boot-screen {
    min-height: 100vh;
    display: grid;
    place-items: center;
    gap: 8px;
    color: var(--primary);
}

#blazor-error-ui {
    display: none;
    position: fixed;
    right: 16px;
    bottom: 16px;
    left: 16px;
    z-index: 1000;
    padding: 14px 16px;
    border: 1px solid #fecaca;
    border-radius: 8px;
    background: #fff1f2;
    color: var(--danger);
}

.app-shell {
    min-height: 100vh;
}

.top-bar {
    position: sticky;
    top: 0;
    z-index: 20;
    padding: calc(12px + env(safe-area-inset-top)) 18px 12px;
    border-bottom: 1px solid var(--border);
    background: rgba(248, 245, 239, 0.94);
    backdrop-filter: blur(10px);
}

.top-bar h1 {
    font-size: 24px;
    font-weight: 900;
    line-height: 1.18;
}

.eyebrow {
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

.main-content {
    padding: 18px 14px calc(96px + env(safe-area-inset-bottom));
}

.page-stack {
    width: min(100%, 1120px);
    margin: 0 auto;
    display: grid;
    gap: 14px;
}

.page-title-row,
.section-title-row,
.button-row,
.inline-meta,
.total-line {
    display: flex;
    align-items: center;
}

.page-title-row,
.section-title-row {
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}

.page-title-row h2 {
    font-size: 24px;
    line-height: 1.2;
}

.inline-meta {
    flex-wrap: wrap;
    gap: 8px;
    color: var(--muted);
    font-size: 14px;
}

.table-label-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.panel,
.empty-state,
.order-top-panel {
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
    box-shadow: var(--shadow);
}

.panel {
    padding: 16px;
    display: grid;
    gap: 14px;
}

.empty-state {
    padding: 28px 18px;
    text-align: center;
    color: var(--muted);
}

.empty-state h2,
.empty-state h3,
.panel h3,
.item-section h4 {
    color: var(--text);
}

.primary-action,
.secondary-action,
.danger-action,
.ghost-action,
.serve-action {
    min-height: 44px;
    border: 0;
    border-radius: 8px;
    padding: 0 16px;
    font-weight: 800;
}

.primary-action {
    background: var(--primary);
    color: #fff;
}

.primary-action:hover {
    background: var(--primary-dark);
}

.secondary-action {
    border: 1px solid var(--border);
    background: #fff;
    color: var(--text);
}

.danger-action {
    background: #fff1f0;
    color: var(--danger);
}

.serve-action {
    border: 1px solid #bfe4cb;
    background: #eef8f1;
    color: var(--accent);
}

.serve-action.active {
    background: var(--accent);
    color: #fff;
}

.ghost-action {
    background: transparent;
    color: var(--muted);
}

.full {
    width: 100%;
}

.button-row {
    justify-content: flex-end;
    gap: 10px;
}

.action-cluster {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end;
}

.stacked-actions {
    display: grid;
    gap: 10px;
}

.text-input,
.mini-input {
    width: 100%;
    min-height: 44px;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px 12px;
    background: #fff;
    color: var(--text);
    font-size: 16px;
}

.mini-input {
    min-width: 88px;
    text-align: center;
}

textarea.text-input {
    min-height: 92px;
    resize: vertical;
}

label {
    display: grid;
    gap: 6px;
    color: var(--muted);
    font-size: 14px;
    font-weight: 700;
}

.check-line {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 44px;
}

.check-line input {
    width: 20px;
    height: 20px;
}

.form-grid {
    display: grid;
    gap: 12px;
}

.compact-list,
.dish-list,
.history-list,
.ranking-list {
    display: grid;
    gap: 10px;
}

.compact-row {
    display: grid;
    grid-template-columns: 1fr 84px auto;
    gap: 8px;
    align-items: center;
}

.settings-grid {
    display: grid;
    gap: 14px;
}

.settings-page .panel {
    align-content: start;
}

.file-upload {
    gap: 10px;
}

.file-input {
    width: 100%;
    min-height: 48px;
    border: 1px dashed var(--border);
    border-radius: 8px;
    padding: 12px;
    background: #fff;
    color: var(--text);
    font-size: 16px;
}

.danger-panel {
    border-color: #fecaca;
    background: #fffafa;
}

.sort-input {
    text-align: center;
}

.form-error,
.toast-line {
    border-radius: 8px;
    padding: 10px 12px;
    font-weight: 700;
}

.form-error {
    background: #fff1f0;
    color: var(--danger);
}

.delete-confirm-panel {
    border: 1px solid #fecaca;
    border-radius: 8px;
    padding: 12px;
    display: grid;
    gap: 12px;
    background: #fff1f2;
}

.delete-confirm-panel div:first-child {
    display: grid;
    gap: 4px;
}

.delete-confirm-panel strong {
    color: var(--danger);
}

.delete-confirm-panel span {
    color: var(--muted);
    font-size: 14px;
    font-weight: 700;
}

.toast-line {
    border: 1px solid #f6d7a7;
    background: #fff8e8;
    color: var(--warning);
}

.modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 80;
    padding: 16px;
    display: grid;
    place-items: end center;
    background: rgba(31, 41, 51, 0.42);
}

.modal-sheet {
    width: min(100%, 560px);
    max-height: min(86vh, 720px);
    overflow-y: auto;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 16px;
    display: grid;
    gap: 14px;
    background: var(--surface);
    box-shadow: 0 24px 80px rgba(31, 41, 51, 0.22);
}

.modal-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.modal-title-row h3 {
    color: var(--text);
    font-size: 22px;
}

.modal-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.tag {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    min-height: 26px;
    border-radius: 999px;
    padding: 3px 9px;
    background: #fff0de;
    color: var(--warning);
    font-size: 13px;
    font-weight: 800;
}

.tag-accent {
    background: #e9f7ef;
    color: var(--accent);
}

.tag-danger {
    background: #fee2e2;
    color: var(--danger);
}

.tag-muted {
    background: #eef0f2;
    color: var(--muted);
}

.muted-text {
    color: var(--muted);
}

.bottom-nav {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 30;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 2px;
    padding: 8px 8px calc(8px + env(safe-area-inset-bottom));
    border-top: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(12px);
}

.bottom-nav a {
    min-height: 54px;
    display: grid;
    place-items: center;
    gap: 2px;
    border-radius: 8px;
    color: var(--muted);
    text-decoration: none;
    font-size: 13px;
    font-weight: 800;
}

.bottom-nav a.active {
    background: #fff1e8;
    color: var(--primary);
}

.nav-icon {
    font-size: 18px;
    line-height: 1;
}

.order-card-grid {
    display: grid;
    gap: 12px;
}

.order-card,
.history-card,
.dish-admin-card {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
    box-shadow: var(--shadow);
}

.order-card {
    min-height: 112px;
    padding: 16px;
    display: grid;
    justify-items: start;
    gap: 6px;
    text-align: left;
}

.order-card-with-service {
    position: relative;
    padding: 0;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
    gap: 0;
    overflow: visible;
}

.order-card-main {
    width: 100%;
    min-height: 112px;
    border: 0;
    border-radius: 8px;
    padding: 16px;
    display: grid;
    justify-items: start;
    gap: 6px;
    background: transparent;
    color: var(--text);
    text-align: left;
}

.order-card-actions {
    margin: 16px;
    display: grid;
    gap: 8px;
    justify-items: stretch;
}

.served-progress-button {
    min-width: 92px;
    border: 1px solid #bfe4cb;
    border-radius: 8px;
    padding: 9px 10px;
    display: grid;
    justify-items: center;
    gap: 2px;
    background: #eef8f1;
    color: var(--accent);
    font-weight: 900;
}

.served-progress-button span {
    font-size: 12px;
}

.served-progress-button strong {
    color: var(--accent);
    font-size: 22px;
    line-height: 1;
}

.card-checkout-button {
    min-height: 42px;
    border: 0;
    border-radius: 8px;
    padding: 9px 12px;
    background: var(--danger);
    color: #fff;
    font-size: 16px;
    font-weight: 900;
}

.serve-dropdown {
    grid-column: 1 / -1;
    border-top: 1px solid var(--border);
    padding: 12px;
    display: grid;
    gap: 8px;
    background: #fff;
}

.serve-dropdown-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.serve-dropdown-title span {
    color: var(--muted);
    font-size: 13px;
    font-weight: 800;
}

.serve-toggle-row {
    min-height: 54px;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 8px;
    display: grid;
    grid-template-columns: 30px minmax(0, 1fr) auto;
    gap: 8px;
    align-items: center;
    background: #fff;
    color: var(--text);
    text-align: left;
}

.serve-toggle-row.active {
    border-color: #bfe4cb;
    background: #eef8f1;
}

.serve-check {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: #fff1f0;
    color: var(--danger);
    font-weight: 900;
}

.serve-toggle-row.active .serve-check {
    background: #d8f3df;
    color: var(--accent);
}

.serve-toggle-row span:nth-child(2) {
    display: grid;
    gap: 2px;
}

.serve-toggle-row small {
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

.serve-toggle-row em {
    color: var(--muted);
    font-size: 12px;
    font-style: normal;
    font-weight: 900;
}

.order-card-table {
    font-size: 24px;
    font-weight: 900;
}

.order-card-total {
    color: var(--primary);
    font-size: 26px;
    font-weight: 900;
}

.dish-admin-card {
    padding: 14px;
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}

.dish-admin-card p {
    margin-top: 4px;
    color: var(--muted);
}

.muted-card {
    background: #f5f6f7;
}

.card-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.order-top-panel {
    position: relative;
    padding: 16px;
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
}

.order-top-panel > div:first-of-type {
    padding-right: 108px;
}

.order-panel-delete {
    position: absolute;
    top: 12px;
    right: 12px;
    min-height: 40px;
    padding: 0 14px;
}

.order-top-panel h2 {
    font-size: 30px;
    line-height: 1.05;
}

.order-page {
    padding-bottom: 88px;
}

.top-total {
    display: grid;
    gap: 8px;
}

.top-total span {
    color: var(--muted);
    font-weight: 700;
}

.top-total strong {
    color: var(--primary);
    font-size: 30px;
}

.ordering-layout {
    display: grid;
    gap: 14px;
}

.menu-panel,
.order-items-panel {
    display: grid;
    gap: 12px;
}

.category-strip {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 2px;
}

.chip {
    min-height: 42px;
    flex: 0 0 auto;
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 0 14px;
    background: #fff;
    color: var(--text);
    font-weight: 800;
}

.chip.active {
    border-color: var(--primary);
    background: var(--primary);
    color: #fff;
}

.dish-pick-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.dish-pick-card {
    position: relative;
    min-height: 92px;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 12px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 72px;
    gap: 10px;
    align-items: stretch;
    background: #fff;
    text-align: left;
    font-weight: 800;
}

.dish-pick-card.has-quantity {
    border-color: #bfe4cb;
    background: #fbfffc;
}

.dish-card-info {
    min-width: 0;
    display: grid;
    align-content: space-between;
    gap: 8px;
}

.dish-card-info span {
    overflow-wrap: anywhere;
}

.dish-card-info strong {
    color: var(--primary);
}

.dish-card-stepper {
    display: grid;
    grid-template-rows: 32px 1fr;
    gap: 6px;
    align-self: stretch;
}

.dish-quantity-input {
    width: 100%;
    min-width: 0;
    min-height: 32px;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 2px 4px;
    background: #fff;
    color: var(--text);
    text-align: center;
    font-size: 16px;
    font-weight: 900;
}

.dish-stepper-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
}

.dish-stepper-button {
    min-width: 0;
    min-height: 34px;
    border: 0;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-size: 20px;
    line-height: 1;
    font-weight: 900;
}

.dish-stepper-button.minus {
    background: #fff1f0;
    color: var(--danger);
}

.dish-stepper-button.plus {
    background: var(--accent);
    color: #fff;
}

.mode-hint {
    min-height: 42px;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 8px 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    background: #fff;
}

.mode-hint span {
    color: var(--muted);
    font-size: 14px;
    font-weight: 800;
}

.mode-hint strong {
    color: var(--primary);
}

.item-section {
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 12px;
    display: grid;
    gap: 10px;
    background: #fff;
}

.add-on-section {
    border-color: #bfe4cb;
    background: var(--surface-green);
}

.order-item-row,
.checkout-row {
    display: grid;
    gap: 10px;
    padding: 10px 0;
    border-top: 1px solid var(--border);
}

.order-item-row:first-of-type,
.checkout-row:first-of-type {
    border-top: 0;
}

.served-item {
    border-color: #bfe4cb;
    border-radius: 8px;
    background: #eef8f1;
}

.item-main {
    display: grid;
    gap: 3px;
}

.item-main span,
.checkout-row span {
    color: var(--muted);
    font-size: 14px;
}

.quantity-tools {
    width: fit-content;
    display: grid;
    grid-template-columns: 44px 42px 44px;
    align-items: center;
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
}

.quantity-tools button {
    height: 44px;
    border: 0;
    background: #fff;
    color: var(--primary);
    font-size: 22px;
    font-weight: 900;
}

.quantity-tools span {
    text-align: center;
    font-weight: 900;
}

.compact-quantity {
    grid-template-columns: 38px 36px 38px;
}

.compact-quantity button {
    height: 38px;
}

.price-tools {
    display: grid;
    grid-template-columns: minmax(96px, 140px);
    gap: 8px;
    align-items: center;
}

.price-tools .mini-input,
.drawer-item-tools .mini-input {
    font-size: 20px;
    font-weight: 900;
    text-align: center;
}

.mini-field {
    gap: 4px;
    font-size: 12px;
}

.served-label {
    width: fit-content;
    border-radius: 999px;
    padding: 2px 8px;
    background: #d8f3df;
    color: var(--accent);
    font-size: 12px;
    font-weight: 900;
}

.fixed-order-bar {
    position: fixed;
    right: 12px;
    bottom: calc(78px + env(safe-area-inset-bottom));
    left: 12px;
    z-index: 25;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.98);
    box-shadow: var(--shadow);
}

.fixed-order-bar.expanded {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: stretch;
}

.fixed-order-summary {
    min-width: 0;
    border: 0;
    border-radius: 8px;
    padding: 0;
    display: grid;
    gap: 2px;
    justify-items: start;
    background: transparent;
    text-align: left;
}

.fixed-order-summary span,
.fixed-order-summary small {
    color: var(--muted);
    font-size: 13px;
    font-weight: 800;
}

.fixed-order-summary strong {
    color: var(--primary);
    font-size: 22px;
}

.fixed-order-drawer {
    grid-column: 1 / -1;
    max-height: min(58vh, 430px);
    overflow-y: auto;
    border-bottom: 1px solid var(--border);
    padding-bottom: 10px;
    display: grid;
    gap: 10px;
}

.drawer-title-row,
.drawer-item-row,
.drawer-item-tools {
    display: grid;
    gap: 8px;
}

.drawer-title-row {
    grid-template-columns: 1fr auto;
    align-items: center;
}

.drawer-title-row span {
    color: var(--muted);
    font-size: 13px;
    font-weight: 800;
}

.drawer-item-row {
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px;
    display: grid;
    grid-template-columns: minmax(0, 0.95fr) minmax(190px, 1.05fr);
    gap: 10px;
    background: #fff;
}

.drawer-item-row.served-item {
    border-color: #bfe4cb;
    background: #eef8f1;
}

.drawer-item-name {
    display: grid;
    align-content: space-between;
    gap: 10px;
}

.drawer-item-name strong {
    color: var(--text);
    font-size: 22px;
    font-weight: 950;
    line-height: 1.18;
    overflow-wrap: anywhere;
}

.drawer-item-name span {
    color: var(--muted);
    font-size: 13px;
    font-weight: 800;
}

.drawer-item-tools {
    grid-template-columns: 1fr;
    justify-items: end;
    align-items: end;
}

.drawer-item-tools .quantity-tools {
    width: 100%;
}

.drawer-item-tools .compact-quantity {
    grid-template-columns: 38px 36px 38px;
}

.drawer-edit-row {
    width: 100%;
    display: grid;
    grid-template-columns: minmax(110px, 116px) minmax(96px, 120px);
    gap: 8px;
    justify-content: end;
    align-items: end;
}

.drawer-edit-row .quantity-tools,
.drawer-edit-row .mini-field {
    width: 100%;
    min-width: 0;
}

.drawer-item-tools .danger-action {
    width: min(100%, 244px);
    min-width: 0;
}

.fixed-order-actions {
    display: flex;
    gap: 8px;
    justify-self: end;
    align-self: center;
}

.fixed-order-actions .primary-action,
.fixed-order-actions .secondary-action {
    padding: 0 14px;
}

.segmented-control {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
}

.segmented-control button {
    min-height: 44px;
    border: 0;
    border-left: 1px solid var(--border);
    background: #fff;
    color: var(--muted);
    font-weight: 800;
}

.segmented-control button:first-child {
    border-left: 0;
}

.segmented-control button.active {
    background: var(--primary);
    color: #fff;
}

.history-card {
    min-height: 76px;
    padding: 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    text-align: left;
}

.history-card div {
    display: grid;
    gap: 4px;
}

.history-card span {
    color: var(--muted);
    font-size: 14px;
}

.read-row,
.ranking-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 10px;
    align-items: center;
    padding: 10px 0;
    border-top: 1px solid var(--border);
}

.read-row:first-child,
.ranking-row:first-child {
    border-top: 0;
}

.metric-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.metric-card {
    min-height: 112px;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 14px;
    display: grid;
    align-content: space-between;
    background: var(--surface);
    box-shadow: var(--shadow);
}

.metric-card span {
    color: var(--muted);
    font-size: 14px;
    font-weight: 800;
}

.metric-card strong {
    color: var(--primary);
    font-size: 28px;
    line-height: 1;
}

.ranking-row {
    grid-template-columns: 34px 1fr auto;
}

.rank-no {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: #eef8f1;
    color: var(--accent);
    font-weight: 900;
}

.ranking-row div {
    display: grid;
    gap: 3px;
}

.ranking-row span {
    color: var(--muted);
    font-size: 14px;
}

.total-panel {
    gap: 16px;
}

.total-line {
    justify-content: space-between;
    gap: 12px;
    color: var(--muted);
}

.total-line strong {
    color: var(--text);
}

.total-line.final {
    padding-top: 12px;
    border-top: 1px solid var(--border);
    color: var(--text);
    font-size: 18px;
    font-weight: 900;
}

.total-line.final strong {
    color: var(--primary);
    font-size: 26px;
}

.note-box {
    border-radius: 8px;
    padding: 12px;
    background: var(--surface-soft);
    color: var(--text);
}

@media (max-width: 679px) {
    .main-content {
        padding: 14px 10px calc(96px + env(safe-area-inset-bottom));
    }

    .panel,
    .order-top-panel {
        padding: 14px;
    }

    .page-title-row h2 {
        font-size: 22px;
    }

    .compact-row {
        grid-template-columns: minmax(0, 1fr) 82px;
    }

    .compact-row .secondary-action {
        grid-column: 1 / -1;
    }

    .category-edit-row {
        align-items: stretch;
    }

    .dish-admin-card {
        gap: 14px;
    }

    .card-actions {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }

    .settings-grid {
        gap: 12px;
    }

    .order-card-with-service {
        grid-template-columns: minmax(0, 1fr) 98px;
    }

    .order-card-actions {
        margin: 14px 12px 14px 0;
        gap: 7px;
    }

    .served-progress-button {
        min-width: 74px;
        margin: 0;
        padding: 8px 6px;
    }

    .served-progress-button strong {
        font-size: 20px;
    }

    .card-checkout-button {
        min-height: 40px;
        padding: 8px 6px;
        font-size: 15px;
    }

    .serve-dropdown {
        padding: 10px;
    }

    .serve-toggle-row {
        grid-template-columns: 28px minmax(0, 1fr) 48px;
    }

    .drawer-item-row {
        grid-template-columns: minmax(0, 1fr) minmax(210px, 0.95fr);
        gap: 8px;
        padding: 8px;
    }

    .drawer-item-name strong {
        font-size: 20px;
    }

    .drawer-edit-row {
        grid-template-columns: 108px 104px;
        gap: 8px;
    }

    .drawer-item-tools .compact-quantity {
        grid-template-columns: 34px 34px 34px;
    }

    .compact-quantity button {
        height: 36px;
    }

    .drawer-item-tools .mini-input {
        min-height: 36px;
        padding: 6px 8px;
        font-size: 18px;
    }

    .modal-backdrop {
        padding: 10px;
        align-items: end;
    }

    .modal-sheet {
        width: 100%;
        max-height: 88vh;
        padding: 14px;
    }

    .modal-actions {
        position: sticky;
        bottom: -14px;
        margin: 0 -14px -14px;
        padding: 12px 14px calc(12px + env(safe-area-inset-bottom));
        border-top: 1px solid var(--border);
        background: rgba(255, 255, 255, 0.98);
    }
}

@media (min-width: 680px) {
    .main-content {
        padding-right: 22px;
        padding-left: 22px;
    }

    .form-grid.two,
    .form-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .order-card-grid,
    .dish-list,
    .history-list,
    .settings-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .dish-admin-card {
        grid-template-columns: 1fr auto;
        align-items: center;
    }

    .order-top-panel {
        grid-template-columns: 1fr auto;
        align-items: center;
    }

    .top-total {
        min-width: 210px;
        justify-items: end;
    }

    .checkout-row,
    .order-item-row {
        grid-template-columns: 1fr auto minmax(188px, 240px) auto auto;
        align-items: center;
    }

    .drawer-item-row {
        grid-template-columns: 1fr minmax(360px, 0.9fr);
        align-items: center;
    }

    .drawer-item-tools {
        grid-template-columns: 1fr;
    }
}

@media (min-width: 900px) {
    .ordering-layout {
        grid-template-columns: minmax(0, 1.1fr) minmax(360px, 0.9fr);
        align-items: start;
    }

    .order-items-panel {
        position: sticky;
        top: 104px;
    }

    .fixed-order-bar {
        right: calc((100vw - min(100vw, 1120px)) / 2 + 18px);
        left: auto;
        width: 420px;
    }
}
