body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    padding: 2rem 1.5rem 3rem;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
  }

.logo {
    font-size: 1.75rem; font-weight: 700;
    letter-spacing: -0.03em; color: var(--text);
  }

.mode-toggle {
    display: flex; background: var(--accent-soft);
    border-radius: 8px; padding: 3px;
  }

.mode-toggle button {
    background: transparent; border: none;
    padding: 0.5rem 1rem;
    font-family: inherit; font-size: 0.85rem; font-weight: 500;
    cursor: pointer; color: var(--text-muted);
    border-radius: 6px; transition: all 0.15s;
  }

.mode-toggle button.active {
    background: var(--bg); color: var(--text);
    box-shadow: 0 1px 2px rgba(0,0,0,0.06);
  }

.mode-toggle button:not(.active):hover { color: var(--text); }

.stats-link {
    display: inline-flex; align-items: center; gap: 0.4rem;
    padding: 0.5rem 0.9rem;
    background: var(--accent-soft);
    color: var(--text);
    font-size: 0.85rem; font-weight: 500;
    border-radius: 8px;
    text-decoration: none;
    transition: all 0.15s;
  }

/* Nav collapses into a single dropdown button (the six admin pages are all
   occasional owner tools, not live-service buttons — so they live behind one
   "Menu" button instead of cluttering the bar). */
.nav-toggle {
    display: inline-flex;
    background: var(--accent-soft); border: none;
    color: var(--text); cursor: pointer;
    padding: 0.5rem 0.7rem; border-radius: 8px;
    align-items: center; gap: 0.5rem; justify-content: center;
    font-family: inherit; font-size: 0.85rem; font-weight: 500;
  }
.nav-toggle:hover { background: var(--bg); box-shadow: 0 0 0 1px var(--border-strong); }

.header-nav {
    display: none;
    position: absolute; top: calc(100% + 0.5rem); left: 0;
    flex-direction: column; align-items: stretch; gap: 0.25rem;
    background: var(--bg); border: 1px solid var(--border);
    border-radius: 12px; padding: 0.4rem;
    box-shadow: 0 12px 30px rgba(0,0,0,0.12);
    z-index: 90; min-width: 190px;
  }
.header-nav.open { display: flex; }
.header-left { position: relative; }
.header-nav .stats-link {
    padding: 0.7rem 0.85rem; font-size: 0.9rem;
    background: transparent; border-radius: 8px;
    justify-content: flex-start; gap: 0.7rem;
    display: flex; align-items: center;
  }
.header-nav .stats-link:hover { background: var(--accent-soft); box-shadow: none; }
.header-nav .stats-link span { display: inline; }

.stats-link:hover { background: var(--bg); box-shadow: 0 0 0 1px var(--border-strong); }

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

.cart-btn {
    position: relative; display: flex; align-items: center; gap: 0.6rem;
    background: var(--text); color: var(--bg);
    border: 1px solid var(--text);
    padding: 0.55rem 0.9rem 0.55rem 0.75rem;
    border-radius: 8px; cursor: pointer;
    font-family: inherit; font-size: 0.85rem; font-weight: 500;
    transition: all 0.15s;
  }

.cart-btn:hover { background: #262626; border-color: #262626; }

.cart-btn .bars { display: flex; flex-direction: column; gap: 3px; }

.cart-btn .bars span {
    display: block; width: 16px; height: 2px;
    background: var(--bg); border-radius: 2px;
  }

.cart-count {
    background: var(--bg); color: var(--text);
    font-size: 0.72rem; font-weight: 600;
    padding: 0.1rem 0.45rem; border-radius: 999px;
    min-width: 20px; text-align: center;
  }

.cart-count.zero { opacity: 0.4; }

@media (max-width: 640px) {
    body { padding: 1rem 0.85rem 2rem; }
    header {
      padding-bottom: 1rem; margin-bottom: 1.25rem;
      gap: 0.6rem;
    }
    .header-left { gap: 0.5rem; flex: 1; min-width: 0; position: relative; }
    .logo { font-size: 1.4rem; }
    .mode-toggle { padding: 2px; }
    .mode-toggle button {
      padding: 0.45rem 0.7rem; font-size: 0.8rem;
    }
    /* Nav dropdown is default at all widths now (see .header-nav above) */
    .cart-btn {
      padding: 0.5rem 0.7rem;
      font-size: 0.8rem;
    }
    .cart-btn .label { display: none; }
    .menu-panel { padding: 1.1rem; }
    .menu-grid {
      grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
      gap: 0.55rem;
    }
    .menu-tile { padding: 0.85rem; min-height: 85px; }
    .menu-tile-name { font-size: 0.95rem; }
    h2 { font-size: 1.25rem; }
    .drawer { width: 100vw; }
    .drawer-head { padding: 1.1rem 1.1rem 0.85rem; }
    .drawer-body { padding: 0.85rem 1.1rem; }
    .drawer-foot { padding: 1rem 1.1rem; }
    .modal { padding: 1.25rem; border-radius: 12px; }
    .pay-amount-value { font-size: 2rem; }
    .keypad { gap: 0.4rem; }
    .key { padding: 0.95rem 0.4rem; font-size: 1.35rem; }
    .pay-method-btn { padding: 1.1rem 0.75rem; }
    .footer-note { margin-top: 1.5rem; }
  }

@media (max-width: 380px) {
    .logo { font-size: 1.2rem; }
    .mode-toggle button { padding: 0.4rem 0.55rem; font-size: 0.75rem; }
    .stats-link { padding: 0.4rem 0.5rem; }
    .cart-btn { padding: 0.45rem 0.6rem; }
    .cart-btn .bars { display: none; }
  }

.menu-panel {
    background: var(--bg); border: 1px solid var(--border);
    padding: 1.75rem; border-radius: 12px;
  }

.status-banner button {
    background: transparent; border: 1px solid currentColor;
    padding: 0.25rem 0.6rem; border-radius: 4px;
    font-family: inherit; font-size: 0.78rem;
    color: inherit; cursor: pointer; margin-left: auto;
  }

.search-wrap { position: relative; margin-bottom: 1.25rem; }

.search-input {
    width: 100%;
    padding: 0.7rem 2.5rem 0.7rem 0.95rem;
    border: 1px solid var(--border);
    background: var(--bg);
    font-family: inherit; font-size: 0.95rem;
    color: var(--text); border-radius: 8px;
    transition: all 0.15s;
  }

.search-input::placeholder { color: var(--text-faint); }

.search-input:focus {
    outline: none; border-color: var(--text);
    box-shadow: 0 0 0 3px rgba(0,0,0,0.05);
  }

.search-clear {
    position: absolute; right: 0.5rem; top: 50%;
    transform: translateY(-50%);
    background: transparent; border: none; cursor: pointer;
    font-size: 1.2rem; color: var(--text-muted);
    opacity: 0; padding: 0.2rem 0.5rem;
    transition: opacity 0.15s; line-height: 1;
  }

.search-wrap.has-value .search-clear { opacity: 1; }

.search-clear:hover { color: var(--text); }

.search-count {
    font-size: 0.78rem; color: var(--text-faint);
    margin-top: -0.5rem; margin-bottom: 1rem; min-height: 1em;
  }

mark.search-hit {
    background: #fef3c7; color: var(--text);
    padding: 0 0.1em; border-radius: 2px;
  }

.menu-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 0.75rem;
  }

.menu-tile {
    background: var(--bg); border: 1px solid var(--border);
    padding: 1rem; cursor: pointer; border-radius: 10px;
    transition: all 0.15s; position: relative;
    text-align: left; min-height: 100px;
    display: flex; flex-direction: column;
    justify-content: space-between;
    font-family: inherit; color: inherit;
  }

.menu-tile:hover {
    border-color: var(--text);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.04);
  }

.menu-tile:active { transform: translateY(0); background: var(--accent-soft); }

.menu-tile-name {
    font-size: 1rem; font-weight: 600;
    line-height: 1.3; padding-right: 0.5rem;
  }

.menu-tile-price {
    font-size: 0.85rem; font-weight: 500;
    color: var(--text-muted); margin-top: 0.5rem;
  }

.menu-tile-delete {
    position: absolute; bottom: 0.4rem; right: 0.5rem;
    background: transparent; border: none;
    font-family: inherit; font-size: 0.7rem; font-weight: 500;
    color: var(--text-muted);
    opacity: 0; cursor: pointer;
    padding: 0.2rem 0.4rem; transition: opacity 0.15s;
    border-radius: 4px;
  }

.menu-tile:hover .menu-tile-delete { opacity: 1; }

.menu-tile-delete:hover { background: var(--accent-soft); color: var(--text); }

.empty-menu {
    grid-column: 1 / -1; text-align: center; padding: 2.5rem 1rem;
    color: var(--text-muted); font-size: 0.9rem;
    border: 1px dashed var(--border-strong); border-radius: 10px;
  }

.manage-form {
    background: var(--surface); border: 1px solid var(--border);
    padding: 1.25rem; border-radius: 10px; margin-bottom: 1.25rem;
  }

.manage-form h3 {
    font-size: 1rem; font-weight: 600;
    margin-bottom: 0.9rem; letter-spacing: -0.01em;
  }

.form-row { display: grid; grid-template-columns: 2fr 1fr auto; gap: 0.6rem; align-items: end; }

@media (max-width: 600px) { .form-row { grid-template-columns: 1fr; } }

label {
    display: block; font-size: 0.75rem; font-weight: 500;
    color: var(--text-muted); margin-bottom: 0.35rem;
  }

.btn:disabled { opacity: 0.4; cursor: not-allowed; }

.lib-row {
    display: grid;
    grid-template-columns: 1.4fr 110px 100px 100px auto;
    gap: 0.4rem;
    margin-bottom: 0.45rem;
    align-items: center;
  }

.lib-row .size-price-cell input { padding-left: 1.55rem; font-size: 0.88rem; padding: 0.5rem 0.7rem 0.5rem 1.55rem; }

@media (max-width: 720px) {
    .lib-row {
      grid-template-columns: 1fr 1fr auto;
      grid-template-areas:
        "name name remove"
        "cat  cat  cat"
        "pyg  usd  usd";
      gap: 0.35rem;
    }
    .lib-row > .lib-name { grid-area: name; }
    .lib-row > .lib-cat { grid-area: cat; }
    .lib-row > .size-price-cell:nth-of-type(1) { grid-area: pyg; }
    .lib-row > .size-price-cell:nth-of-type(2) { grid-area: usd; }
    .lib-row > .side-remove { grid-area: remove; }
  }

.menu-tile-sizes {
    font-size: 0.7rem; font-weight: 500;
    color: var(--text-muted);
    margin-top: 0.25rem;
    display: flex; flex-wrap: wrap; gap: 0.2rem;
  }

.menu-tile-sizes span {
    display: inline-block;
    background: var(--accent-soft);
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
  }

/* Collapsed count for items with many variants (e.g. teas) — reads as a single
   neat pill instead of a stack of chips. */
.menu-tile-sizes .size-count {
    background: var(--text);
    color: var(--bg);
    font-weight: 600;
  }

.menu-tile.has-sizes::after {
    content: '';
    position: absolute;
    top: 0.5rem; right: 0.5rem;
    width: 6px; height: 6px;
    background: var(--text);
    border-radius: 50%;
  }

.size-chip-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 0.5rem;
    margin-bottom: 0.5rem;
  }

.size-chip {
    background: var(--bg);
    border: 1px solid var(--border-strong);
    border-radius: 10px;
    padding: 1rem 0.85rem;
    font-family: inherit;
    cursor: pointer;
    text-align: left;
    transition: all 0.15s;
    color: var(--text);
  }

.size-chip:hover { border-color: var(--text); transform: translateY(-1px); }

.size-chip-name {
    font-size: 1rem; font-weight: 600;
    margin-bottom: 0.3rem;
  }

.size-chip-price {
    font-size: 0.85rem; color: var(--text-muted); font-weight: 500;
  }

.edit-row { margin-bottom: 1rem; }

.edit-row label {
    display: block;
    font-size: 0.78rem; font-weight: 500;
    color: var(--text); margin-bottom: 0.4rem;
  }

.edit-hint {
    font-size: 0.72rem; color: var(--text-muted);
    margin-top: 0.35rem;
  }

.dual-price {
    display: grid; grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
  }

.dual-price-cell { position: relative; }

.dual-price-cell input {
    width: 100%;
    padding: 0.6rem 0.75rem 0.6rem 1.85rem;
    border: 1px solid var(--border);
    background: var(--bg);
    font-family: inherit; font-size: 0.95rem;
    color: var(--text);
    border-radius: 6px;
    transition: all 0.15s;
  }

.dual-price-cell input:focus {
    outline: none; border-color: var(--text);
    box-shadow: 0 0 0 3px rgba(0,0,0,0.05);
  }

.dual-price-symbol {
    position: absolute;
    left: 0.7rem; top: 50%;
    transform: translateY(-50%);
    font-size: 0.95rem;
    color: var(--text-muted);
    pointer-events: none;
    font-weight: 500;
  }

.size-preset-row {
    display: flex; gap: 0.4rem; margin-bottom: 0.6rem;
    flex-wrap: wrap;
  }

.size-preset {
    background: var(--accent-soft);
    border: 1px solid transparent;
    padding: 0.4rem 0.85rem;
    border-radius: 6px;
    font-family: inherit; font-size: 0.8rem; font-weight: 500;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.15s;
  }

.size-preset:hover { color: var(--text); }

.size-preset.active {
    background: var(--text); color: var(--bg);
  }

.edit-size-row {
    display: grid;
    grid-template-columns: 1fr 105px 95px auto;
    gap: 0.4rem;
    margin-bottom: 0.35rem;
    align-items: center;
  }

.edit-size-row input {
    padding: 0.5rem 0.7rem;
    font-size: 0.88rem;
  }

.edit-size-row .size-price-cell { position: relative; }

.edit-size-row .size-price-cell input { padding-left: 1.55rem; }

.edit-size-row .size-price-cell .dual-price-symbol {
    font-size: 0.85rem;
  }

@media (max-width: 520px) {
    .edit-size-row {
      grid-template-columns: 1fr auto;
      grid-template-areas:
        "name remove"
        "pyg  pyg"
        "usd  usd";
      gap: 0.35rem;
    }
    .edit-size-row > input.size-name { grid-area: name; }
    .edit-size-row .size-price-cell:nth-of-type(1) { grid-area: pyg; }
    .edit-size-row .size-price-cell:nth-of-type(2) { grid-area: usd; }
    .edit-size-row > .size-remove { grid-area: remove; }
  }

.edit-size-remove {
    background: transparent;
    border: 1px solid var(--border-strong);
    padding: 0 0.7rem;
    cursor: pointer;
    color: var(--text-muted);
    border-radius: 6px;
  }

.edit-size-remove:hover { background: var(--text); color: var(--bg); border-color: var(--text); }

.side-remove {
    background: transparent; border: 1px solid var(--border-strong);
    padding: 0 0.7rem; cursor: pointer;
    font-family: inherit; font-size: 0.95rem; color: var(--text-muted);
    border-radius: 6px;
  }

.side-remove:hover { background: var(--text); color: var(--bg); border-color: var(--text); }

.modal-backdrop {
    position: fixed; inset: 0;
    background: rgba(10, 10, 10, 0.5);
    display: none; align-items: center; justify-content: center;
    z-index: 100; padding: 1rem;
    animation: backdropIn 0.15s ease-out;
    backdrop-filter: blur(2px);
  }

@keyframes backdropIn { from { opacity: 0; } to { opacity: 1; } }

.modal-head {
    display: flex; justify-content: space-between; align-items: baseline;
    margin-bottom: 0.25rem; gap: 1rem;
  }

.modal-base-price { font-size: 0.9rem; color: var(--text-muted); font-weight: 500; }

.addon-section { margin-bottom: 1.25rem; }

.addon-section-label {
    font-size: 0.72rem; font-weight: 600;
    text-transform: uppercase; letter-spacing: 0.05em;
    color: var(--text-muted); margin-bottom: 0.55rem;
  }

.chip-row { display: flex; flex-wrap: wrap; gap: 0.4rem; }

.chip {
    border: 1px solid var(--border-strong); background: var(--bg);
    padding: 0.45rem 0.85rem;
    font-family: inherit; font-size: 0.88rem;
    cursor: pointer; border-radius: 999px;
    transition: all 0.12s; user-select: none;
    display: inline-flex; align-items: center; gap: 0.4rem;
    color: var(--text);
  }

.chip:hover { border-color: var(--text); }

.chip.active { background: var(--text); color: var(--bg); border-color: var(--text); }

.chip .price { font-size: 0.75rem; color: var(--text-muted); font-weight: 500; }

.chip.active .price { color: rgba(255,255,255,0.7); }

.running-total {
    margin-top: 1.25rem; padding-top: 1rem;
    border-top: 1px solid var(--border);
    display: flex; justify-content: space-between; align-items: baseline;
  }

.running-total-label { font-size: 0.85rem; color: var(--text-muted); font-weight: 500; }

.running-total-amount { font-size: 1.5rem; font-weight: 700; color: var(--text); letter-spacing: -0.02em; }

.drawer-backdrop {
    position: fixed; inset: 0;
    background: rgba(10, 10, 10, 0.4);
    opacity: 0; pointer-events: none;
    transition: opacity 0.25s; z-index: 90;
    backdrop-filter: blur(2px);
  }

.drawer-backdrop.open { opacity: 1; pointer-events: auto; }

.drawer {
    position: fixed; top: 0; right: 0; bottom: 0;
    width: 420px; max-width: 100vw;
    background: var(--text); color: var(--bg);
    z-index: 95;
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.32, 0.72, 0, 1);
    display: flex; flex-direction: column;
    box-shadow: -10px 0 40px rgba(0,0,0,0.2);
  }

.drawer.open { transform: translateX(0); }

.drawer-head {
    padding: 1.5rem 1.5rem 1rem;
    display: flex; justify-content: space-between; align-items: center;
    border-bottom: 1px solid rgba(255,255,255,0.1);
  }

.drawer-head h2 { color: var(--bg); margin: 0; }

.drawer-close {
    background: transparent; border: none; color: rgba(255,255,255,0.7);
    font-size: 1.4rem; cursor: pointer; padding: 0.3rem 0.5rem;
    line-height: 1; border-radius: 6px; transition: all 0.15s;
  }

.drawer-close:hover { background: rgba(255,255,255,0.1); color: var(--bg); }

.drawer-body { flex: 1; overflow-y: auto; padding: 1rem 1.5rem; }

.drawer-foot {
    padding: 1.25rem 1.5rem;
    border-top: 1px solid rgba(255,255,255,0.15);
    background: var(--text);
  }

/* Discount control — light-on-dark to match the drawer footer */
.discount-area { margin-bottom: 0.9rem; }

.discount-toggle {
    background: transparent; border: 1px dashed rgba(255,255,255,0.3);
    color: rgba(255,255,255,0.7); font-family: inherit; font-size: 0.8rem;
    padding: 0.4rem 0.7rem; border-radius: 8px; cursor: pointer;
    transition: color 0.15s, border-color 0.15s;
  }

.discount-toggle:hover { color: var(--bg); border-color: rgba(255,255,255,0.5); }

.discount-panel { margin-top: 0.6rem; }

/* %/₲ mode toggle — segmented control on the dark panel. */
.discount-mode {
    display: inline-flex; gap: 2px; margin-bottom: 0.5rem;
    background: rgba(255,255,255,0.08); border-radius: 8px; padding: 2px;
  }
.discount-mode-btn {
    background: none; border: none; color: rgba(255,255,255,0.6);
    font-family: inherit; font-size: 0.9rem; font-weight: 700;
    padding: 0.3rem 0.9rem; border-radius: 6px; cursor: pointer;
    transition: background 0.15s, color 0.15s;
  }
.discount-mode-btn.active { background: var(--bg); color: var(--text); }

.discount-presets { display: flex; gap: 0.4rem; align-items: center; }
.discount-presets + .discount-presets { margin-top: 0; }

.discount-preset {
    background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.2);
    color: var(--bg); font-family: inherit; font-size: 0.85rem; font-weight: 600;
    padding: 0.4rem 0.7rem; border-radius: 8px; cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
  }

.discount-preset:hover { background: rgba(255,255,255,0.16); }

.discount-preset.active {
    background: var(--bg); color: var(--text); border-color: var(--bg);
  }

.discount-custom {
    flex: 1; min-width: 0; background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.2); color: var(--bg);
    font-family: inherit; font-size: 0.85rem; padding: 0.4rem 0.6rem;
    border-radius: 8px; -moz-appearance: textfield; appearance: textfield;
  }

.discount-custom::placeholder { color: rgba(255,255,255,0.4); }
.discount-custom:focus { outline: none; border-color: rgba(255,255,255,0.5); }
.discount-custom::-webkit-outer-spin-button,
.discount-custom::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

/* Subtotal + discount rows above the Total */
.subtotal-line, .discount-line {
    display: flex; justify-content: space-between; align-items: baseline;
    gap: 0.5rem; margin-bottom: 0.4rem; font-size: 0.85rem;
  }

.subtotal-label { color: rgba(255,255,255,0.6); }
.subtotal-amount { color: rgba(255,255,255,0.6); text-decoration: line-through; }

.discount-line-label { color: rgba(255,255,255,0.85); }
.discount-line-amount { color: #6ee7a8; margin-left: auto; }

.discount-clear {
    background: transparent; border: none; color: rgba(255,255,255,0.5);
    font-size: 1.1rem; line-height: 1; cursor: pointer; padding: 0 0.2rem;
    transition: color 0.15s;
  }

.discount-clear:hover { color: #ff6b6b; }

.order-item {
    border-bottom: 1px solid rgba(255,255,255,0.1);
    padding: 0.85rem 0;
    animation: fadeIn 0.2s ease-out;
  }

.order-item:last-of-type { border-bottom: none; }

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: translateY(0); }
  }

.order-item-head { display: flex; justify-content: space-between; align-items: baseline; gap: 0.5rem; }

.order-item-name { font-size: 0.95rem; font-weight: 600; }

.order-item-price { font-size: 0.9rem; color: rgba(255,255,255,0.8); font-weight: 500; }

.order-item-sides {
    font-size: 0.78rem; color: rgba(255,255,255,0.6); line-height: 1.5;
    padding-left: 0.6rem; border-left: 1px solid rgba(255,255,255,0.2);
    margin: 0.4rem 0 0.3rem;
  }

.order-item .remove {
    background: transparent; border: none; color: rgba(255,255,255,0.5);
    font-family: inherit; font-size: 0.75rem;
    cursor: pointer; padding: 0; margin-top: 0.25rem;
    transition: color 0.15s;
  }

.order-item .remove:hover { color: #ff6b6b; }

.empty { text-align: center; padding: 3rem 0; color: rgba(255,255,255,0.5); font-size: 0.9rem; }

.total {
    display: flex; justify-content: space-between; align-items: baseline;
    margin-bottom: 1rem;
  }

.total-label { font-size: 0.85rem; color: rgba(255,255,255,0.7); font-weight: 500; }

.total-amount { font-size: 1.75rem; font-weight: 700; color: var(--bg); letter-spacing: -0.02em; }

.drawer-actions { display: flex; gap: 0.5rem; }

.drawer-actions .btn {
    flex: 1; background: var(--bg); color: var(--text); border-color: var(--bg);
  }

.drawer-actions .btn:hover { background: #f5f5f5; border-color: #f5f5f5; }

.drawer-actions .btn.secondary {
    background: transparent; color: var(--bg); border-color: rgba(255,255,255,0.3);
  }

.drawer-actions .btn.secondary:hover {
    background: rgba(255,255,255,0.1); border-color: rgba(255,255,255,0.5);
  }

.pay-amount-display {
    text-align: center;
    padding: 1.25rem 0 1.5rem;
    border-bottom: 1px solid var(--border);
    margin-bottom: 1.5rem;
  }

.pay-amount-label {
    font-size: 0.75rem; font-weight: 500;
    color: var(--text-muted); text-transform: uppercase;
    letter-spacing: 0.05em; margin-bottom: 0.4rem;
  }

.pay-amount-value { font-size: 2.5rem; font-weight: 700; letter-spacing: -0.03em; }

.pay-method-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }

.pay-method-btn {
    background: var(--bg); border: 1px solid var(--border-strong);
    border-radius: 10px; padding: 1.5rem 1rem;
    cursor: pointer; font-family: inherit;
    transition: all 0.15s;
    display: flex; flex-direction: column;
    align-items: center; gap: 0.6rem;
  }

.pay-method-btn:hover {
    border-color: var(--text); transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.06);
  }

.pay-method-icon { font-size: 1.6rem; }

.pay-method-label { font-size: 0.95rem; font-weight: 600; color: var(--text); }

.pay-method-sub { font-size: 0.75rem; color: var(--text-muted); }

.cash-entry { padding-top: 0.5rem; }

.currency-toggle {
    display: grid; grid-template-columns: 1fr 1fr;
    gap: 0.4rem; margin-bottom: 1rem;
  }

.currency-btn {
    background: var(--bg); border: 1px solid var(--border-strong);
    padding: 0.65rem 0.8rem;
    font-family: inherit; font-size: 0.9rem; font-weight: 500;
    cursor: pointer; color: var(--text-muted);
    border-radius: 8px; transition: all 0.15s;
  }

.currency-btn:hover { color: var(--text); border-color: var(--text); }

.currency-btn.active {
    background: var(--text); color: var(--bg); border-color: var(--text);
  }

.cash-input-row { margin-bottom: 1rem; }

.cash-input-row label {
    font-size: 0.85rem; font-weight: 500;
    color: var(--text); margin-bottom: 0.5rem;
  }

.cash-display {
    width: 100%;
    padding: 0.85rem 1rem;
    border: 1px solid var(--border-strong);
    border-radius: 8px; background: var(--surface);
    font-family: inherit; font-size: 1.75rem; font-weight: 700;
    color: var(--text); text-align: right;
    letter-spacing: -0.01em; user-select: none;
    min-height: 3.2rem;
    display: flex; align-items: center; justify-content: flex-end;
  }

.cash-display.empty { color: var(--text-faint); }

.quick-amounts { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.6rem; }

.quick-amount {
    background: var(--accent-soft); border: 1px solid transparent;
    padding: 0.45rem 0.85rem; border-radius: 6px;
    font-family: inherit; font-size: 0.9rem; font-weight: 500;
    cursor: pointer; color: var(--text); transition: all 0.15s;
  }

.quick-amount:hover { border-color: var(--text); background: var(--bg); }

.quick-amount:active { transform: scale(0.97); }

.keypad {
    display: grid; grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem; margin-bottom: 1rem;
  }

.key {
    background: var(--bg); border: 1px solid var(--border-strong);
    border-radius: 10px; padding: 1.1rem 0.5rem;
    font-family: inherit; font-size: 1.5rem; font-weight: 600;
    color: var(--text); cursor: pointer; transition: all 0.1s;
    -webkit-tap-highlight-color: transparent;
    display: flex; align-items: center; justify-content: center;
    user-select: none;
  }

.key:hover { border-color: var(--text); background: var(--accent-soft); }

.key:active {
    background: var(--text); color: var(--bg);
    border-color: var(--text); transform: scale(0.97);
  }

.key-secondary { background: var(--surface); color: var(--text-muted); }

.key-secondary:hover { color: var(--text); }

.key-secondary svg { display: block; }

.change-row {
    background: var(--accent-soft);
    padding: 1rem 1.25rem; border-radius: 10px;
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 1rem;
  }

.change-row.negative { background: #fef2f2; color: var(--danger); }

.change-row.positive { background: #f0fdf4; color: var(--success); }

.change-label { font-size: 0.85rem; font-weight: 500; color: inherit; opacity: 0.85; }

.change-amount { font-size: 1.6rem; font-weight: 700; letter-spacing: -0.02em; color: inherit; }

.success-screen { text-align: center; padding: 1rem 0 0.5rem; }

.success-icon {
    width: 64px; height: 64px;
    background: #f0fdf4; color: var(--success);
    border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 2rem; font-weight: 700;
    margin-bottom: 1rem;
    animation: popIn 0.3s ease-out;
  }

@keyframes popIn {
    from { transform: scale(0.5); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
  }

.success-title { font-size: 1.3rem; font-weight: 600; margin-bottom: 0.4rem; }

.success-sub { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 1.5rem; }

.success-details {
    background: var(--accent-soft); border-radius: 10px;
    padding: 1rem 1.25rem; margin-bottom: 1.5rem; text-align: left;
  }

.success-row {
    display: flex; justify-content: space-between;
    padding: 0.3rem 0; font-size: 0.9rem;
  }

.success-row.bold { font-weight: 600; }

.success-row span:first-child { color: var(--text-muted); }

.takings-grid {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 0.75rem; margin-bottom: 1rem;
  }

.takings-tile {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: 10px; padding: 1rem;
  }

.takings-tile-label {
    font-size: 0.75rem; font-weight: 500;
    color: var(--text-muted); margin-bottom: 0.3rem;
    text-transform: uppercase; letter-spacing: 0.04em;
  }

.takings-tile-value {
    font-size: 1.5rem; font-weight: 700; letter-spacing: -0.02em;
  }

.order-log {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: 10px; padding: 1rem 1.25rem;
    max-height: 320px; overflow-y: auto;
  }

.order-log-row {
    display: flex; justify-content: space-between; align-items: center;
    padding: 0.5rem 0; border-bottom: 1px solid var(--border);
    font-size: 0.9rem;
  }

.order-log-row:last-child { border-bottom: none; }

.order-log-meta { color: var(--text-muted); font-size: 0.78rem; }

.order-log-amount { font-weight: 600; }

/* ===== Held orders ===== */
.held-btn { background: var(--surface); border-color: var(--border); color: var(--text); }
.held-btn:hover { background: var(--accent-soft); border-color: var(--border-strong); }
.held-btn .cart-count { background: var(--text); color: var(--bg); }

.held-list {
    display: flex; flex-direction: column; gap: 0.5rem;
    margin: 0.5rem 0 1rem; max-height: 55vh; overflow-y: auto;
  }
.held-list .empty {
    text-align: center; padding: 2rem 0;
    color: var(--text-faint); font-size: 0.9rem;
  }

.held-item { display: flex; align-items: stretch; gap: 0.5rem; }

.held-resume {
    flex: 1; text-align: left; cursor: pointer;
    background: var(--surface); border: 1px solid var(--border);
    border-radius: 10px; padding: 0.7rem 0.85rem;
    font-family: inherit; transition: border-color 0.15s, background 0.15s;
  }
.held-resume:hover { border-color: var(--text); background: var(--accent-soft); }

.held-item-main {
    display: flex; justify-content: space-between; align-items: baseline;
    margin-bottom: 0.2rem;
  }
.held-item-count { font-weight: 600; font-size: 0.9rem; }
.held-item-time  { font-size: 0.75rem; color: var(--text-muted); }
.held-item-names { font-size: 0.8rem; color: var(--text-muted); margin-bottom: 0.3rem; }
.held-item-total { font-size: 0.85rem; font-weight: 500; }

.held-discard {
    flex: 0 0 auto; width: 40px;
    background: transparent; border: 1px solid var(--border);
    border-radius: 10px; color: var(--text-faint);
    font-size: 1.3rem; line-height: 1; cursor: pointer;
    transition: color 0.15s, border-color 0.15s;
  }
.held-discard:hover { color: var(--danger); border-color: var(--danger); }

/* Card confirmation step */
.card-confirm-prompt {
  text-align: center;
  font-size: 0.95rem;
  color: var(--text);
  margin-top: 1.25rem;
}

/* Loading spinner on the confirm button — while a payment is in flight the
   button is locked so repeat taps can't double-record the order. */
.btn .btn-spinner { display: none; }
.btn.loading .btn-label { visibility: hidden; }
.btn.loading { position: relative; pointer-events: none; }
.btn.loading .btn-spinner {
  display: block;
  position: absolute;
  top: 50%; left: 50%;
  width: 16px; height: 16px;
  margin: -8px 0 0 -8px;
  border: 2px solid rgba(255,255,255,0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: btnSpin 0.6s linear infinite;
}
@keyframes btnSpin { to { transform: rotate(360deg); } }
/* Offline queue: pending-sync banner + synced status line */
.offline-banner {
  display: none;
  margin: 0.5rem 0;
  padding: 0.5rem 0.85rem;
  border-radius: 8px;
  background: #fff8e1;
  border: 1px solid #f0d98c;
  color: #8a6d13;
  font-size: 0.85rem;
  font-weight: 500;
}
.offline-banner.show { display: block; }

.status-banner.ok {
  margin: 0.5rem 0;
  padding: 0.5rem 0.85rem;
  border-radius: 8px;
  background: #e8f5e9;
  border: 1px solid #a5d6a7;
  color: #2e7d32;
  font-size: 0.85rem;
  font-weight: 500;
}

/* Per-item note: entry field in the add-on modal + display in the cart */
.note-field { margin: 0.85rem 0 0.25rem; }
.note-label {
  display: block;
  font-size: 0.72rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-bottom: 0.3rem;
}
.note-input {
  width: 100%;
  box-sizing: border-box;
  padding: 0.55rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.9rem;
  background: var(--bg);
  color: var(--text);
  resize: vertical;
}
.note-input:focus { outline: none; border-color: var(--text); }

.order-item-note {
  margin-top: 0.25rem;
  font-size: 0.82rem;
  color: #8a6d13;
  font-style: italic;
}

/* Order name: typed at the top of the checkout panel before adding items */
.customer-name-bar {
  padding: 0.75rem 1.15rem 0.6rem;
  border-bottom: 1px solid var(--border);
}
.customer-name-label {
  display: block;
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.3rem;
}
.customer-name-input {
  width: 100%;
  box-sizing: border-box;
  padding: 0.6rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 500;
  background: var(--bg);
  color: var(--text);
}
.customer-name-input:focus { outline: none; border-color: var(--text); }
.customer-name-input::placeholder { font-weight: 400; color: var(--text-faint); }

/* Custom name autocomplete — positioned directly under the input, unlike the
   native datalist which iPadOS floats arbitrarily. Sits on the dark checkout
   drawer, so light surface with dark text for contrast. */
.name-autocomplete { position: relative; }
.name-suggestions {
  position: absolute;
  top: calc(100% + 4px);
  left: 0; right: 0;
  background: var(--bg);
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.25);
  overflow: hidden;
  z-index: 10;
  max-height: 260px;
  overflow-y: auto;
}
.name-suggestion {
  display: block;
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  border-bottom: 1px solid var(--border);
  padding: 0.65rem 0.8rem;
  font-family: inherit;
  font-size: 0.95rem;
  color: var(--text);
  cursor: pointer;
}
.name-suggestion:last-child { border-bottom: none; }
.name-suggestion:hover, .name-suggestion:active { background: var(--accent-soft); }

.held-item-sub {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.1rem;
}

/* ---- Cash register ---- */
.register-modal { max-width: 460px; }

.reg-summary {
  background: var(--accent-soft);
  border-radius: 10px;
  padding: 0.75rem 0.9rem;
  margin: 0.9rem 0;
}
.reg-row {
  display: flex; justify-content: space-between; align-items: baseline;
  padding: 0.22rem 0;
  font-size: 0.88rem;
}
.reg-row span { color: var(--text-muted); }
.reg-row small { opacity: 0.7; }
.reg-row strong { font-variant-numeric: tabular-nums; }
.reg-total {
  border-top: 1px solid var(--border);
  margin-top: 0.4rem; padding-top: 0.5rem;
  font-size: 1rem;
}
.reg-total span { color: var(--text); font-weight: 500; }

.reg-actions { display: flex; gap: 0.4rem; flex-wrap: wrap; }
.reg-actions .btn { flex: 1; min-width: 120px; font-size: 0.8rem; }

.reg-form {
  margin-top: 0.9rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.8rem;
}
.reg-form.hidden { display: none; }
.reg-form-title { font-size: 0.8rem; color: var(--text-muted); margin-bottom: 0.5rem; }
.reg-form input {
  width: 100%; box-sizing: border-box;
  padding: 0.55rem 0.7rem; margin-bottom: 0.5rem;
  border: 1px solid var(--border); border-radius: 8px;
  font-family: inherit; font-size: 0.95rem;
  background: var(--bg); color: var(--text);
}
.reg-form input:focus { outline: none; border-color: var(--text); }
.reg-form-actions { display: flex; gap: 0.5rem; justify-content: flex-end; }

.reg-movements { margin-top: 0.9rem; }
.reg-mov-title {
  font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.04em;
  color: var(--text-muted); margin-bottom: 0.35rem;
}
.reg-mov {
  display: flex; align-items: center; gap: 0.5rem;
  padding: 0.35rem 0;
  border-top: 1px solid var(--border);
  font-size: 0.85rem;
}
.reg-mov-type {
  display: inline-flex; align-items: center; justify-content: center;
  width: 1.3rem; height: 1.3rem; border-radius: 50%;
  font-weight: 700; font-size: 0.8rem; flex-shrink: 0;
}
.reg-mov-type.in  { background: #e8f5e9; color: #2e7d32; }
.reg-mov-type.out { background: #fdecea; color: #c62828; }
.reg-mov-amt { font-variant-numeric: tabular-nums; font-weight: 500; }
.reg-mov-note { flex: 1; color: var(--text-muted); font-size: 0.8rem; }
.reg-mov-del {
  border: none; background: none; color: var(--text-muted);
  font-size: 1.1rem; cursor: pointer; padding: 0 0.2rem;
}

/* Register sits on its own line beneath the Checkout button, so it reads as a
   separate tool rather than another cart action.

   It is a READOUT you can open, not a primary action — so it takes the page's
   surface language (light, bordered) rather than the solid black of Checkout.
   The expected-cash figure is the point of the strip, so it gets the size. */
.register-strip {
  flex-basis: 100%;
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  margin-top: 0.65rem;
  padding: 0.7rem 0.85rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  /* A café till prints on paper all day; the dashed underline is a quiet nod to
     a receipt's tear-off edge, and separates the strip from the menu below. */
  border-bottom: 1px dashed var(--border-strong);
  font-family: inherit;
  color: var(--text);
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.register-strip:hover { background: var(--surface); border-color: var(--border-strong); }
.register-strip:focus-visible {
  outline: 2px solid var(--text);
  outline-offset: 2px;
}

.reg-icon {
  display: flex; align-items: center; justify-content: center;
  width: 34px; height: 34px;
  border-radius: 8px;
  background: var(--accent-soft);
  color: var(--text-muted);
}
.reg-icon svg { width: 18px; height: 18px; }

.reg-text { display: flex; flex-direction: column; gap: 0.1rem; min-width: 0; }
.reg-label {
  font-size: 0.7rem; font-weight: 600; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--text-faint);
}
.reg-sub {
  font-size: 0.8rem; color: var(--text-muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* The number is the reason the strip exists. Tabular figures so it doesn't
   jitter as cash sales come in through the morning. */
.reg-value {
  font-size: 1.15rem; font-weight: 650;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.reg-chevron { display: flex; color: var(--text-faint); }
.reg-chevron svg { width: 16px; height: 16px; }

/* Empty state: an invitation, not a stray lowercase word at the far margin. */
.register-strip.needs-setup { border-style: dashed; border-color: var(--border-strong); }
.register-strip.needs-setup .reg-value {
  font-size: 0.78rem; font-weight: 600;
  background: var(--text); color: var(--bg);
  padding: 0.35rem 0.7rem; border-radius: 999px;
}

@media (max-width: 640px) {
  .register-strip { gap: 0.6rem; padding: 0.6rem 0.7rem; }
  .reg-value { font-size: 1rem; }
  .reg-icon { width: 30px; height: 30px; }
}
/* ===== Till section grouping ===== */
/* When sections are present, #menuGrid becomes a plain vertical stack of
   [header][inner-grid][header][inner-grid]. The grid layout moves to the inner
   wrappers so tiles still lay out in columns under each header. The .sectioned
   class is toggled from JS (more robust than :has() on older tablet browsers).
   Search results and the no-sections case use a single .menu-grid-inner, which
   also gets the grid. */
.menu-grid.sectioned {
    display: block;
  }
.menu-grid-inner {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 0.75rem;
  }
.till-section-header {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text);
    margin: 1.5rem 0 0.65rem;
  }
.till-section-header:first-child { margin-top: 0.25rem; }
.till-section-header.unorganised { color: var(--text-faint); }

@media (max-width: 640px) {
  .menu-grid-inner {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 0.55rem;
  }
}
/* USD exchange-rate indicator, sits by the Checkout button. USD is reference-
   only info, so it's quiet — not a button, just a labelled figure. */
.rate-indicator {
  display: inline-flex;
  align-items: center;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--accent-soft);
  border-radius: 999px;
  padding: 0.35rem 0.7rem;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
@media (max-width: 640px) {
  .rate-indicator { font-size: 0.72rem; padding: 0.3rem 0.55rem; }
}