/* Shared foundation. Layouts live below; management-only patterns live in admin.css. */
:root {
  color-scheme: light;
  --primary: #244d3c;
  --primary-soft: #edf3ef;
  --bg: #fafbf9;
  --surface: #fff;
  --nav: #f6f7f5;
  --text: #222a25;
  --muted: #626e66;
  --quiet: #68736b;
  --line: #e3e8e3;
  --input-line: #a0aca2;
  --danger: #a13932;
  --danger-soft: #fcf0ee;
  --warning: #865327;
  --warning-soft: #fff4e8;
  --radius: 10px;
  --ease: cubic-bezier(.2,.7,.2,1);
  --feedback: 120ms;
  --reveal: 180ms;
  font: 400 16px/1.55 -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  color: var(--text);
  font-synthesis: none;
}
* { box-sizing: border-box; }
html { scroll-padding: 24px 0 180px; }
body { margin: 0; background: var(--bg); }
button, input, select, textarea { font: inherit; }
button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }
button, a { touch-action: manipulation; }
button { cursor: pointer; }
button:disabled { opacity: .5; cursor: not-allowed; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
svg { flex: 0 0 auto; vertical-align: middle; }
h1, h2, h3, p { margin: 0; overflow-wrap: anywhere; }
h1 { font-size: 28px; line-height: 1.3; font-weight: 600; letter-spacing: -.04em; text-wrap: balance; }
h2 { font-size: 20px; line-height: 1.4; font-weight: 600; }
h3 { font-size: 16px; line-height: 1.5; font-weight: 550; }
button, a, input, select, textarea, summary { outline-offset: 4px; }
:focus-visible { outline: 2px solid var(--primary); }
h1:focus, main:focus { outline: none; }
button, a { transition: color var(--feedback), background var(--feedback), border-color var(--feedback), box-shadow var(--feedback); }
button:active:not(:disabled) { transform: translateY(1px); }
[hidden] { display: none !important; }
.muted, .a-muted { color: var(--muted); }
.skip-link { position: fixed; left: 16px; top: -70px; z-index: 1000; padding: 12px 20px; background: var(--text); color: white; border-radius: 8px; }
.skip-link:focus { top: 12px; }

/* Controls are identical in every workspace. */
.btn, .a-btn {
  min-height: 44px;
  padding: 10px 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.35;
  white-space: nowrap;
}
.btn:hover:not(:disabled), .a-btn:hover:not(:disabled) { background: var(--nav); border-color: #c3cec5; }
.btn.primary, .a-btn.primary { background: var(--primary); border-color: var(--primary); color: white; }
.btn.primary:hover:not(:disabled), .a-btn.primary:hover:not(:disabled) { background: #173c2c; border-color: #173c2c; }
.btn.secondary, .a-btn.secondary { background: var(--surface); }
.btn.danger, .a-btn.danger { color: var(--danger); border-color: #e7c8c3; background: var(--danger-soft); }
.btn.text, .a-btn.ghost { background: transparent; border-color: transparent; }
.btn.small { padding: 8px 12px; }
.icon-btn, .a-icon-btn { display: inline-grid; place-items: center; width: 44px; height: 44px; border: 0; border-radius: 7px; background: transparent; color: var(--muted); }
.icon-btn:hover, .a-icon-btn:hover { color: var(--text); background: var(--nav); }
.text-link { padding: 8px; min-height: 44px; border: 0; background: transparent; color: var(--muted); font-size: 14px; }
.text-link:hover { color: var(--primary); }
input, select, textarea { width: 100%; min-width: 0; min-height: 44px; padding: 10px 12px; border: 1px solid var(--input-line); border-radius: 7px; background: var(--surface); color: var(--text); font-size: 16px; line-height: 1.5; }
input::placeholder, textarea::placeholder { color: var(--quiet); }
input:focus, select:focus, textarea:focus { border-color: var(--primary); }
input[readonly] { background: var(--nav); }
input[type=checkbox], input[type=radio] { flex: 0 0 auto; width: 18px; height: 18px; min-height: 0; accent-color: var(--primary); }
select { appearance: none; padding-right: 34px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' width='16' height='16' fill='none' stroke='%23626e66' stroke-width='1.7'%3E%3Cpath d='m7 10 5 5 5-5'/%3E%3C/svg%3E"); background-position: right 10px center; background-repeat: no-repeat; }
textarea { resize: vertical; }
.form-group, .a-field { display: flex; flex-direction: column; gap: 8px; margin-bottom: 20px; font-size: 14px; font-weight: 500; }
.form-error, .a-form-error { color: var(--danger); font-size: 14px; line-height: 1.6; }
.form-error:empty { display: none; }
.form-error:not(:empty) { margin: 12px 0; }
.card, .a-panel { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.badge, .a-badge { display: inline-flex; align-items: center; gap: 4px; border-radius: 5px; padding: 4px 8px; background: var(--primary-soft); color: var(--primary); font-size: 12px; line-height: 1.5; font-weight: 500; white-space: nowrap; }
.badge.warm, .a-badge.orange { background: var(--warning-soft); color: var(--warning); }
.badge.gray, .a-badge.neutral { background: var(--nav); color: var(--muted); }
.badge.danger, .a-badge.danger { background: var(--danger-soft); color: var(--danger); }
.a-badge + .a-badge { margin-left: 5px; }

/* Shell */
.app-shell { min-height: 100dvh; display: flex; }
.sidebar { position: fixed; inset: 0 auto 0 0; z-index: 40; width: 216px; padding: 30px 16px; background: var(--nav); border-right: 1px solid var(--line); }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); }
.brand > span { font-size: 20px; font-weight: 600; letter-spacing: -.025em; }
.sidebar .brand { margin: 0 12px 42px; }
.side-nav { display: flex; flex-direction: column; gap: 5px; }
.nav-link { display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 11px 13px; border-radius: 7px; font-size: 14px; line-height: 1.4; color: var(--muted); white-space: nowrap; }
.nav-link:hover { background: var(--primary-soft); color: var(--text); }
.nav-link.active { color: var(--primary); background: #e8eee7; font-weight: 550; }
.workspace { flex: 1; min-width: 0; margin-left: 216px; }
.topbar { height: 72px; padding: 0 40px; display: flex; align-items: center; justify-content: space-between; gap: 24px; border-bottom: 1px solid var(--line); background: var(--surface); }
.topbar-location, .topbar-right { display: flex; align-items: center; gap: 10px; min-width: 0; }
.topbar-location { font-size: 14px; color: var(--muted); }
.topbar-location > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar-right { flex: 0 0 auto; gap: 20px; }
.test-environment { font-size: 12px; color: var(--muted); white-space: nowrap; }
.user-brief { display: flex; align-items: baseline; gap: 9px; font-size: 12px; color: var(--muted); }
.user-brief strong { font-size: 14px; font-weight: 500; color: var(--text); }
.page-content { width: 100%; max-width: 1440px; padding: 40px 40px 64px; margin: auto; min-width: 0; }
.page-content > :first-child { animation: enter var(--reveal) var(--ease); }
.bottom-nav { display: none; }

/* Login */
.login-layout { display: grid; place-items: center; min-height: 100dvh; padding: 60px 24px; background: var(--surface); }
.login-form-wrap { width: 100%; max-width: 360px; }
.login-form-wrap .brand { margin-bottom: 40px; }
.login-form-wrap h1 { font-size: 28px; margin-bottom: 28px; }
.login-roles { display: grid; grid-template-columns: repeat(4,1fr); padding: 4px; gap: 3px; border-radius: 9px; background: var(--nav); margin-bottom: 28px; }
.role-choice { min-height: 44px; padding: 8px; border: 1px solid transparent; border-radius: 6px; font-size: 14px; color: var(--muted); background: transparent; }
.role-choice.selected { color: var(--text); background: white; border-color: var(--line); }
.role-choice:hover { color: var(--text); }
.login-submit { width: 100%; margin-top: 8px; }
.login-environment { text-align: center; font-size: 12px; color: var(--muted); margin: 20px 0; }
.login-accounts { border-top: 1px solid var(--line); padding-top: 16px; font-size: 13px; color: var(--muted); }
.login-accounts summary { cursor: pointer; min-height: 44px; width: fit-content; margin: auto; }
.login-accounts dl { margin: 12px 0 0; }
.login-accounts dl > div { display: flex; justify-content: space-between; padding: 7px 0; gap: 16px; }
.login-accounts dd { margin: 0; color: var(--text); }

/* Employee menu */
.employee-welcome, .order-page-heading { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-bottom: 32px; }
.menu-hours { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; color: var(--muted); white-space: nowrap; }
.menu-layout { display: grid; grid-template-columns: minmax(0,1fr) 296px; gap: 32px; align-items: start; }
.menu-layout > *, .dish-grid, .dish-card { min-width: 0; }
.menu-toolbar { margin-bottom: 20px; }
.search-box { display: flex; align-items: center; gap: 9px; max-width: 320px; min-height: 44px; border: 1px solid var(--input-line); border-radius: 7px; padding: 0 12px; background: var(--surface); color: var(--muted); }
.search-box:focus-within { outline: 2px solid var(--primary); outline-offset: 3px; }
.search-box input { border: 0; outline: 0; padding: 10px 0; background: transparent; }
.category-tabs, .order-filters { display: flex; gap: 4px; overflow: auto; scrollbar-width: thin; padding: 0 0 16px; margin-bottom: 8px; }
.category-tab { flex: 0 0 auto; min-height: 44px; padding: 10px 14px; border: 0; border-radius: 7px; background: transparent; font-size: 14px; line-height: 1.4; color: var(--muted); white-space: nowrap; }
.category-tab.active { color: var(--primary); background: var(--primary-soft); font-weight: 550; }
.category-tab:hover { background: var(--nav); }
.dish-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 20px; }
.dish-card { border: 1px solid var(--line); border-radius: 10px; background: var(--surface); overflow: hidden; }
.dish-card:hover { border-color: #bdcabc; }
.dish-picture-wrap { position: relative; overflow: hidden; background: var(--nav); }
.dish-picture { width: 100%; height: auto; aspect-ratio: 1.65; object-fit: cover; }
.dish-content { padding: 18px; }
.dish-title { font-size: 16px; font-weight: 550; }
.dish-description { color: var(--muted); font-size: 14px; line-height: 1.65; margin: 7px 0 16px; min-height: 46px; }
.dish-bottom { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.dish-price { font-size: 22px; line-height: 1.25; font-weight: 550; letter-spacing: -.025em; font-variant-numeric: tabular-nums; }
.dish-price > span { font-size: 15px; margin-right: 2px; }
.dish-original { margin-left: 7px; font-size: 12px; color: var(--muted); text-decoration: line-through; }
.add-dish { flex: 0 0 auto; display: inline-grid; place-items: center; width: 44px; height: 44px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--primary); }
.add-dish:hover:not(:disabled) { color: white; background: var(--primary); border-color: var(--primary); }
.sold-overlay { position: absolute; inset: 0; display: grid; place-items: center; background: #ffffffbb; color: var(--muted); font-size: 14px; }
.hours-notice, .frozen-notice, .quote-warning { font-size: 14px; color: var(--warning); background: var(--warning-soft); padding: 12px 16px; border-radius: 7px; margin-bottom: 24px; }

/* Cart */
.cart-panel { position: sticky; top: 24px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); scroll-margin-top: 24px; }
.cart-heading { min-height: 68px; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 20px; border-bottom: 1px solid var(--line); }
.cart-heading h2 { display: flex; align-items: center; gap: 8px; font-size: 16px; }
.cart-body { padding: 0 20px 20px; }
.cart-empty { padding: 52px 8px 36px; text-align: center; color: var(--muted); font-size: 14px; }
.cart-empty > svg { display: block; margin: 0 auto 16px; color: #8a998a; }
.cart-line { border-bottom: 1px solid var(--line); padding: 20px 0; }
.cart-line-main, .cart-line-bottom { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.cart-line-main h3 { font-size: 14px; font-weight: 550; }
.cart-line-main small, .cart-line-bottom small { font-size: 12px; color: var(--muted); }
.cart-line-main small { display: block; margin-top: 5px; }
.cart-line-price { font-size: 14px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.cart-line-bottom { margin-top: 10px; }
.qty-control { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; }
.qty-control button { min-width: 44px; min-height: 44px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 7px; color: var(--primary); background: var(--surface); }
.qty-control button:hover { background: var(--primary-soft); }
.qty-control span { min-width: 20px; text-align: center; font-variant-numeric: tabular-nums; }
.cart-note { margin: 20px 0; }
.cart-note textarea { font-size: 14px; }
.cart-totals { padding-top: 4px; }
.cart-total-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 14px; color: var(--muted); margin: 10px 0; font-variant-numeric: tabular-nums; }
.cart-total-row.subsidy { color: var(--primary); }
.cart-total-row.final { padding-top: 18px; margin-top: 18px; border-top: 1px solid var(--line); color: var(--text); }
.cart-total-row.final strong { font-size: 26px; font-weight: 550; letter-spacing: -.03em; }
.cart-submit { width: 100%; margin-top: 12px; }
.quote-warning { margin: 16px 0 0; padding: 10px 12px; }
.wallet-mini { display: flex; align-items: center; gap: 8px; padding: 18px 6px; color: var(--muted); font-size: 13px; }
.wallet-mini strong { margin-left: auto; font-weight: 500; color: var(--text); font-variant-numeric: tabular-nums; }
.wallet-mini:hover { color: var(--primary); }
.mobile-cart-summary { display: none; }

/* Dialogs share scale, focus behavior and motion. */
.dialog-backdrop, .a-modal-backdrop { position: fixed; inset: 0; z-index: 100; background: #14201955; padding: 28px; display: grid; place-items: center; backdrop-filter: blur(3px); animation: fade var(--feedback) var(--ease); }
.order-dialog, .a-modal { width: 100%; max-width: 480px; max-height: calc(100dvh - 56px); overflow: auto; overscroll-behavior: contain; background: var(--surface); border: 1px solid #ffffff99; border-radius: 14px; box-shadow: 0 18px 64px #14201922; animation: enter var(--reveal) var(--ease); }
.dialog-top, .a-modal-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 18px 24px; border-bottom: 1px solid var(--line); }
.dialog-top h2, .a-modal-heading h2 { font-size: 18px; font-weight: 550; }
.dialog-body, .a-modal-body { padding: 24px; }
.dialog-actions, .a-modal-footer { display: flex; justify-content: flex-end; gap: 12px; padding: 16px 24px; border-top: 1px solid var(--line); }
.spice-dish-preview { display: flex; align-items: center; gap: 20px; margin-bottom: 24px; }
.spice-dish-preview > img { width: 104px; height: 90px; object-fit: cover; border-radius: 8px; background: var(--nav); }
.spice-dish-preview h3 { font-size: 18px; margin-bottom: 8px; }
.spice-dish-preview p { color: var(--muted); font-size: 16px; }
.spice-label { font-size: 14px; font-weight: 500; margin-bottom: 10px; }
.spice-options { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 24px; }
.spice-option { min-height: 44px; padding: 10px 18px; border: 1px solid var(--line); border-radius: 7px; background: white; font-size: 14px; color: var(--muted); }
.spice-option.selected { border-color: var(--primary); color: var(--primary); background: var(--primary-soft); }
.payment-hero { padding: 8px 0 24px; text-align: center; }
.payment-hero > p { font-size: 14px; color: var(--muted); overflow-wrap: anywhere; }
.payment-hero strong { display: block; font-size: 44px; font-weight: 550; letter-spacing: -.05em; margin: 12px 0 20px; font-variant-numeric: tabular-nums; }
.payment-demo { border-radius: 7px; padding: 13px 16px; background: var(--warning-soft); color: var(--warning); font-size: 14px; }

/* Personal orders and account */
.my-order-list { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 20px; }
.my-order-card { min-width: 0; border: 1px solid var(--line); border-radius: 10px; background: white; overflow: hidden; }
.my-order-top { display: flex; align-items: start; justify-content: space-between; gap: 16px; padding: 20px; border-bottom: 1px solid var(--line); }
.my-order-top strong { font-size: 14px; font-weight: 550; }
.my-order-top small { display: block; margin-top: 7px; font-size: 12px; color: var(--muted); overflow-wrap: anywhere; }
.my-order-items { padding: 20px 20px 8px; }
.my-order-item { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.my-order-item > img { width: 56px; height: 52px; object-fit: cover; border-radius: 6px; }
.my-order-item > div { min-width: 0; flex: 1; }
.my-order-item h3 { font-size: 14px; font-weight: 500; }
.my-order-item small { font-size: 12px; color: var(--muted); }
.my-order-item > span { font-size: 14px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.my-order-note { padding: 0 20px 16px; font-size: 14px; color: var(--muted); overflow-wrap: anywhere; }
.my-order-footer { padding: 16px 20px; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 16px; border-top: 1px solid var(--line); }
.my-order-footer small { display: block; font-size: 12px; color: var(--muted); }
.my-order-footer strong { display: block; font-size: 22px; font-weight: 550; margin-top: 4px; }
.my-order-actions { display: flex; gap: 8px; }
.order-progress { display: flex; padding: 0 20px 20px; }
.progress-stop { flex: 1; text-align: center; font-size: 12px; color: var(--muted); padding: 10px 0 0; border-top: 2px solid var(--line); }
.progress-stop.done { border-color: var(--primary); color: var(--primary); }
.refund-note { padding: 14px 20px; font-size: 13px; color: var(--danger); background: var(--danger-soft); overflow-wrap: anywhere; }
.account-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; align-items: start; }
.account-profile { display: flex; align-items: center; gap: 16px; padding: 28px; }
.account-avatar { width: 48px; height: 48px; border-radius: 10px; background: var(--primary-soft); display: grid; place-items: center; font-size: 16px; color: var(--primary); }
.account-profile h2 { font-size: 20px; }
.account-profile p { color: var(--muted); font-size: 14px; margin-top: 5px; }
.account-section { padding: 24px 28px; border-top: 1px solid var(--line); }
.account-section h3, .account-rules h3 { font-size: 16px; margin-bottom: 20px; }
.account-row { display: flex; justify-content: space-between; align-items: baseline; gap: 24px; margin: 16px 0; font-size: 14px; }
.account-row > :first-child { color: var(--muted); flex-shrink: 0; }
.account-row > :last-child { text-align: right; overflow-wrap: anywhere; }
.account-wallet { background: white; border: 1px solid var(--line); border-radius: 10px; padding: 28px; }
.account-wallet h3 { font-size: 14px; font-weight: 400; color: var(--muted); display: flex; align-items: center; gap: 8px; }
.wallet-balance { font-size: 48px; line-height: 1.25; margin: 20px 0 8px; font-weight: 550; letter-spacing: -.05em; font-variant-numeric: tabular-nums; }
.wallet-period { font-size: 13px; color: var(--muted); }
.wallet-details { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-top: 28px; padding-top: 24px; border-top: 1px solid var(--line); }
.wallet-details span { display: block; color: var(--muted); font-size: 13px; }
.wallet-details strong { display: block; margin-top: 7px; font-size: 20px; font-weight: 500; font-variant-numeric: tabular-nums; }
.account-rules { margin-top: 24px; padding: 24px 28px; }
.bind-state { max-width: 480px; margin: 32px auto; padding: 36px; text-align: center; }
.bind-state > svg { color: var(--primary); }
.bind-state h1 { margin: 20px 0 12px; font-size: 24px; }
.bind-state p { font-size: 14px; color: var(--muted); }
.bind-state form { margin-top: 28px; text-align: left; }
.bind-state .btn { width: 100%; margin-top: 12px; }
.bind-candidate { padding: 18px; border: 1px solid var(--line); border-radius: 7px; text-align: left; margin-top: 24px; }
.bind-candidate p { margin-top: 7px; }

/* Feedback */
.toasts { position: fixed; z-index: 200; top: 20px; right: 24px; display: flex; flex-direction: column; gap: 10px; max-width: min(400px,calc(100vw - 32px)); pointer-events: none; }
.toast { padding: 13px 18px; color: var(--text); background: white; border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 5px 20px #14201912; font-size: 14px; animation: enter var(--reveal) var(--ease); }
.toast.is-error { border-color: #d7b0a9; color: var(--danger); }
.page-loading, .a-loading, .boot-screen { display: flex; justify-content: center; align-items: center; gap: 10px; min-height: 40vh; color: var(--muted); font-size: 14px; }
.boot-screen { min-height: 100dvh; flex-direction: column; }
.spinner, .a-spinner { width: 20px; height: 20px; border: 2px solid var(--line); border-top-color: var(--primary); border-radius: 50%; animation: spin 900ms linear infinite; }
.empty-state, .error-state, .a-empty { padding: 56px 24px; text-align: center; color: var(--muted); font-size: 14px; }
.empty-icon { margin: 0 auto 16px; color: var(--muted); }
.empty-state h2, .error-state h2 { font-size: 18px; margin-bottom: 10px; color: var(--text); }
.empty-state .btn, .error-state .btn { margin-top: 20px; }
@keyframes enter { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes spin { to { transform: rotate(360deg); } }

@media (min-width: 1560px) {
  .dish-grid { grid-template-columns: repeat(3,minmax(0,1fr)); }
}
@media (max-width: 1180px) {
  .sidebar { width: 190px; padding-inline: 12px; }
  .workspace { margin-left: 190px; }
  .page-content { padding: 32px; }
  .topbar { padding-inline: 32px; }
  .user-brief > span { display: none; }
  .menu-layout { grid-template-columns: minmax(0,1fr) 280px; gap: 24px; }
  .dish-grid { gap: 16px; }
}
@media (max-width: 1024px) {
  .menu-layout { grid-template-columns: minmax(0,1fr); }
  .cart-panel { position: static; }
  .wallet-mini { max-width: 320px; }
  .my-order-list, .account-grid { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
  .app-shell { display: block; }
  .sidebar { position: sticky; top: 0; width: 100%; padding: 18px 20px 0; border-right: 0; z-index: 40; background: var(--surface); }
  .sidebar .brand { margin: 0 0 14px; }
  .brand > span { font-size: 19px; }
  .side-nav { flex-direction: row; overflow-x: auto; gap: 4px; padding: 0 0 10px; scrollbar-width: thin; }
  .side-nav .nav-link { flex: 0 0 auto; padding: 10px 12px; gap: 7px; }
  .side-nav .nav-link svg { width: 16px; height: 16px; }
  .workspace { margin-left: 0; }
  .topbar { height: 60px; padding: 0 20px; gap: 10px; }
  .topbar-location { font-size: 13px; gap: 7px; }
  .topbar-right { gap: 8px; }
  .user-brief { display: none; }
  .test-environment { font-size: 12px; }
  .logout-button { width: 44px; }
  .page-content { padding: 28px 20px 48px; }
  h1 { font-size: 25px; }
  .employee-shell { padding-bottom: calc(72px + env(safe-area-inset-bottom)); }
  .employee-shell .sidebar { display: none; }
  .employee-shell .page-content { padding-bottom: 136px; }
  .employee-welcome, .order-page-heading { gap: 16px; margin-bottom: 28px; }
  .menu-hours { font-size: 12px; }
  .menu-layout { gap: 28px; }
  .menu-toolbar { margin-bottom: 12px; }
  .search-box { max-width: none; }
  .category-tabs { margin-bottom: 4px; padding-bottom: 12px; gap: 2px; }
  .category-tab { padding-inline: 13px; }
  .dish-grid { grid-template-columns: minmax(0,1fr); gap: 12px; }
  .dish-card { display: grid; grid-template-columns: 104px minmax(0,1fr); gap: 16px; padding: 14px; }
  .dish-picture-wrap { border-radius: 7px; align-self: start; }
  .dish-picture { width: 104px; height: 112px; aspect-ratio: auto; object-fit: cover; }
  .dish-content { padding: 0; display: flex; flex-direction: column; }
  .dish-description { font-size: 14px; line-height: 1.5; margin: 6px 0 8px; min-height: 0; }
  .dish-title { font-size: 16px; }
  .dish-bottom { margin-top: auto; gap: 8px; }
  .dish-price { font-size: 21px; }
  .dish-original { display: none; }
  .add-dish { border-radius: 7px; }
  .sold-overlay { font-size: 13px; }
  .wallet-mini { max-width: none; }
  .bottom-nav { position: fixed; left: 0; right: 0; bottom: 0; display: flex; justify-content: space-around; align-items: center; padding: 6px 12px calc(6px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: var(--surface); z-index: 60; }
  .bottom-nav .nav-link { display: flex; flex-direction: column; gap: 4px; min-width: 86px; min-height: 54px; padding: 6px 12px; font-size: 12px; background: transparent; }
  .bottom-nav .nav-link.active { color: var(--primary); }
  .mobile-cart-summary { position: fixed; left: 16px; right: 16px; bottom: calc(80px + env(safe-area-inset-bottom)); z-index: 65; min-height: 56px; display: flex; align-items: center; justify-content: space-between; gap: 12px; width: calc(100% - 32px); padding: 12px 18px; border: 1px solid var(--primary); border-radius: 10px; color: white; background: var(--primary); box-shadow: 0 4px 16px #1420191f; font-size: 14px; }
  .mobile-cart-summary > span { display: flex; align-items: center; gap: 8px; }
  .mobile-cart-summary > span:last-child { font-size: 12px; }
  .mobile-cart-summary strong { font-weight: 550; font-size: 14px; }
  .my-order-top, .my-order-footer { padding: 18px; }
  .my-order-items { padding: 18px 18px 4px; }
  .my-order-top small { max-width: 250px; }
  .my-order-item > span { font-size: 13px; }
  .account-profile, .account-section, .account-wallet, .account-rules { padding: 24px; }
  .wallet-balance { font-size: 44px; }
  .dialog-backdrop, .a-modal-backdrop { padding: 16px; }
  .order-dialog, .a-modal { max-height: calc(100dvh - 32px); }
  .dialog-top, .a-modal-heading { padding: 14px 20px; }
  .dialog-body, .a-modal-body { padding: 20px; }
  .dialog-actions, .a-modal-footer { padding: 16px 20px; }
  .order-page-heading > .btn { padding: 10px 12px; }
  .toasts { top: 12px; right: 16px; }
  .bind-state { padding: 28px 24px; margin: 12px auto; }
}
@media (max-width: 375px) {
  .page-content { padding-inline: 16px; }
  .dish-card { grid-template-columns: 88px minmax(0,1fr); gap: 12px; padding: 12px; }
  .dish-picture { width: 88px; height: 108px; }
  .menu-hours { gap: 4px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* Long enterprise and person names remain readable at narrow widths. */
.account-profile > div:last-child { min-width: 0; overflow-wrap: anywhere; }
.dialog-top h2, .a-modal-heading h2, .dish-title, .a-dish-info h2 { overflow-wrap: anywhere; }
.employee-welcome h1 { flex-shrink: 0; }
.menu-hours { max-width: 58%; white-space: normal; justify-content: end; text-align: right; }
.form-error:focus, .a-form-error:focus { outline-color: var(--danger); }
@media (min-width: 769px) {
  .sidebar { display: flex; flex-direction: column; }
  .sidebar .brand { flex: 0 0 auto; }
  .side-nav { min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
}
.order-alert-link { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 8px 10px; border-radius: 7px; background: var(--primary-soft); color: var(--primary); font-size: 13px; font-variant-numeric: tabular-nums; white-space: nowrap; }
@media (max-width: 768px) { .order-alert-link .alert-word { display: none; } }
.menu-toolbar { display: flex; align-items: center; gap: 12px; }
.menu-toolbar .search-box { flex: 1; min-width: 0; }
.menu-toolbar .search-box input { width: 100%; min-width: 0; }
.menu-toolbar > .icon-btn { flex: 0 0 auto; }
