@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,500;0,600;0,700;1,500;1,600&family=Jost:wght@300;400;500&display=swap');

/* "Alta cocina discreta": the menu of a starred dining room, set for home cooking. Near-black
   paper, ivory type, and a fine champagne gold kept for hairlines, prices and whatever is
   switched on. A high-contrast serif carries the names; a light sans carries the small print;
   labels are letter-spaced small caps. No cards, no shadows on the carta — air and hairlines. */
:root {
  color-scheme: dark;

  --bg: #0d0d0d;
  --surface: #131312;
  --surface-raised: #1a1917;
  --card-bg: #131312;
  --field-bg: #1b1a18;

  --text: #f2ecdf;
  --text-soft: #d9d1c2;
  --text-muted: #aaa293;

  --gold: #c8a96a;
  --gold-bright: #dcc28c;
  --gold-deep: #a88a4f;
  --gold-tint: rgba(200, 169, 106, 0.09);
  --gold-tint-strong: rgba(200, 169, 106, 0.16);
  --hairline: rgba(200, 169, 106, 0.32);
  --hairline-soft: rgba(200, 169, 106, 0.18);
  --border: #3a362f;

  --accent: var(--gold);
  --accent-hover: var(--gold-bright);
  --danger: #e59a88;
  --danger-line: rgba(229, 154, 136, 0.55);

  --serif: 'Cormorant Garamond', 'Cormorant', 'Bodoni Moda', 'Didot', 'Bodoni 72', Garamond,
    'Times New Roman', Georgia, serif;
  --sans: 'Jost', 'Futura', 'Avenir Next', 'Segoe UI', -apple-system, BlinkMacSystemFont, Roboto,
    'Helvetica Neue', Arial, sans-serif;

  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --tap: 44px;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--bg);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--sans);
  font-weight: 400;
  font-size: 1rem;
  line-height: 1.5;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  /* Cormorant's old-style figures make a 1 read as an I in "1 x Flan"; lining everywhere. */
  font-variant-numeric: lining-nums;
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
}

::selection {
  background: var(--gold);
  color: #0d0d0d;
}

a {
  color: var(--gold);
}

/* One focus ring everywhere, thin and gold, offset so it never sits on the text. */
:focus-visible {
  outline: 1px solid var(--gold-bright);
  outline-offset: 3px;
}

button {
  -webkit-tap-highlight-color: transparent;
}

/* ---------- Header ---------- */

header {
  padding: calc(2.75rem + env(safe-area-inset-top)) 1rem 1.75rem;
  text-align: center;
}

header h1 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 500;
  font-size: 2.75rem;
  line-height: 1.05;
  letter-spacing: 0.04em;
  color: var(--text);
}

/* A short gold rule under the name, the way a printed menu marks its masthead. */
header h1::after {
  content: '';
  display: block;
  width: 2.75rem;
  height: 1px;
  margin: 1.1rem auto 0;
  background: var(--gold);
}

.subtitle {
  margin: 0.9rem 0 0;
  color: var(--text-muted);
  font-size: 0.875rem;
  font-weight: 400;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.main-nav {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0 1.5rem;
  margin-top: 1.1rem;
  font-size: 0.875rem;
}

.main-nav a {
  display: inline-flex;
  align-items: center;
  min-height: var(--tap);
  color: var(--text-muted);
  text-decoration: none;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  border-bottom: 1px solid transparent;
  transition: color 0.2s var(--ease), border-color 0.2s var(--ease);
}

.main-nav a:hover {
  color: var(--text);
}

.main-nav a.current {
  color: var(--gold);
  border-bottom-color: var(--gold);
}

/* ---------- Layout ---------- */

main {
  max-width: 640px;
  margin: 0 auto;
  padding: 0 1rem calc(3.5rem + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.card {
  background: var(--surface);
  border: 1px solid var(--hairline-soft);
  border-radius: 2px;
  padding: 1.5rem 1.25rem;
}

.card h2 {
  margin-top: 0;
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.6rem;
  letter-spacing: 0.02em;
  line-height: 1.2;
}

/* The carta itself is not a card: the dishes sit straight on the black page. */
.card:has(> #carta-lines) {
  background: none;
  border: none;
  padding: 0;
}

/* ---------- Forms (staff screens) ---------- */

.field-row {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

label {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  font-size: 0.875rem;
  color: var(--text-muted);
  letter-spacing: 0.06em;
  flex: 2;
}

.field-small {
  flex: 1;
  min-width: 90px;
}

input,
textarea {
  min-height: var(--tap);
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 2px;
  background: var(--field-bg);
  font-size: 1rem;
  font-family: var(--sans);
  letter-spacing: normal;
  color: var(--text);
  transition: border-color 0.2s var(--ease);
}

input::placeholder,
textarea::placeholder {
  color: #7f786c;
}

input:hover,
textarea:hover {
  border-color: #575046;
}

input:focus,
textarea:focus {
  outline: 1px solid var(--gold);
  outline-offset: 0;
  border-color: var(--gold);
}

input[type='date']::-webkit-calendar-picker-indicator {
  filter: invert(0.8) sepia(0.4);
  cursor: pointer;
}

textarea {
  resize: vertical;
}

.closed-message-field {
  margin-top: 1rem;
}

.field-help {
  margin: 0.4rem 0 0;
  font-size: 0.875rem;
  line-height: 1.45;
  color: var(--text-muted);
}

/* A day with no service reads as such from across the room. */
.day-closed {
  border-color: var(--danger-line);
}

.day-closed textarea {
  border-color: var(--danger-line);
}

.notice {
  margin: 0;
  padding: 1.5rem 1.25rem;
  border-top: 1px solid var(--hairline);
  border-bottom: 1px solid var(--hairline);
  color: var(--text);
  font-family: var(--serif);
  font-size: 1.35rem;
  font-style: italic;
  line-height: 1.45;
  text-align: center;
  white-space: pre-wrap;
}

.sides-section {
  margin-top: 1.25rem;
  border-top: 1px solid var(--hairline-soft);
  padding-top: 0.9rem;
}

.sides-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
}

.sides-header h3 {
  margin: 0;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

#add-side,
#add-time {
  min-height: var(--tap);
  background: none;
  border: 1px solid var(--gold);
  color: var(--gold);
  border-radius: 2px;
  padding: 0.4rem 0.9rem;
  cursor: pointer;
  font-family: var(--sans);
  font-size: 0.875rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  transition: background 0.2s var(--ease);
}

#add-side:hover,
#add-time:hover {
  background: var(--gold-tint);
}

.side-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--hairline-soft);
  align-items: center;
}

/* A flex item will not shrink below the width its content wants unless it is told to,
   which is what pushed this row — and the card around it — off the side of a phone. */
.side-row input {
  flex: 2;
  min-width: 0;
}

.side-row .field-small {
  flex: 1;
  min-width: 0;
}

/* On a phone the description takes the whole width and the unit, the price and the
   remove button share the line below it. */
@media (max-width: 719px) {
  .side-row .side-description {
    flex: 1 1 100%;
  }
}

.remove-side {
  min-width: var(--tap);
  min-height: var(--tap);
  background: none;
  border: 1px solid transparent;
  border-radius: 2px;
  color: var(--danger);
  font-size: 1rem;
  cursor: pointer;
  padding: 0.3rem;
}

.remove-side:hover {
  border-color: var(--danger-line);
}

.form-actions {
  margin-top: 1.25rem;
  display: flex;
  gap: 0.5rem;
}

/* Primary: the one gold-filled control on a screen. */
button.primary {
  flex: 1;
  min-height: 48px;
  padding: 0.75rem 1rem;
  background: var(--gold);
  color: #0d0d0d;
  border: 1px solid var(--gold);
  border-radius: 2px;
  font-family: var(--sans);
  font-size: 0.9375rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.2s var(--ease), border-color 0.2s var(--ease);
}

button.primary:hover {
  background: var(--gold-bright);
  border-color: var(--gold-bright);
}

button.secondary {
  min-height: 48px;
  padding: 0.75rem 1.1rem;
  background: none;
  color: var(--text-soft);
  border: 1px solid var(--border);
  border-radius: 2px;
  font-family: var(--sans);
  font-size: 0.9375rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
}

button.secondary:hover {
  border-color: var(--gold);
  color: var(--gold);
}

/* Toggled by the scripts; it has to beat every display rule below, the chip bar's flex
   included. */
.hidden {
  display: none !important;
}

.edit-item {
  min-height: var(--tap);
  padding: 0 0.5rem;
  background: none;
  border: none;
  color: var(--gold);
  cursor: pointer;
  font-family: var(--sans);
  font-size: 0.875rem;
  letter-spacing: 0.08em;
}

.edit-item:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.empty-state {
  color: var(--text-muted);
  font-family: var(--serif);
  font-size: 1.2rem;
  font-style: italic;
  text-align: center;
}

.menu-hint {
  margin: 1rem 0 0;
  padding: 0.75rem 0.9rem;
  border: 1px solid var(--hairline);
  border-radius: 2px;
  background: var(--gold-tint);
  color: var(--text);
  font-size: 0.875rem;
}

/* ---------- Dish lists ---------- */

.dishes-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.dish-item {
  border: 1px solid var(--border);
  border-radius: 2px;
  padding: 0.85rem 1rem;
  background: var(--surface-raised);
}

.dish-item-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 0.25rem 0.5rem;
}

/* The name keeps a readable width; on a phone the price and actions drop below it. */
.dish-item-header > :first-child {
  flex: 1 1 11rem;
  min-width: 0;
}

.dish-item-header > :last-child {
  flex: none;
  margin-left: auto;
}

.dish-title {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.25rem;
  line-height: 1.25;
  letter-spacing: 0.01em;
  color: var(--text);
}

.dish-extra {
  color: var(--text-muted);
  font-family: var(--serif);
  font-style: italic;
  font-weight: 500;
  font-size: 1.05rem;
}

.dish-price {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.25rem;
  color: var(--gold);
  white-space: nowrap;
  font-variant-numeric: lining-nums tabular-nums;
}

.delete-dish {
  min-height: var(--tap);
  padding: 0 0.5rem;
  background: none;
  border: none;
  color: var(--danger);
  cursor: pointer;
  font-family: var(--sans);
  font-size: 0.875rem;
  letter-spacing: 0.08em;
}

.side-item {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  font-size: 0.9375rem;
  color: var(--text-soft);
  margin-top: 0.35rem;
  padding-left: 0.85rem;
  border-left: 1px solid var(--hairline-soft);
}

.time-row .time-value {
  flex: 1;
}

.daily-dishes {
  margin-top: 1rem;
}

/* The card is the wrapper, not the row: a button cannot hold a number field, so the box
   sits beside the row inside one border and reads as part of the same item. */
.daily-dish-holder {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--surface-raised);
  transition: border-color 0.2s var(--ease), background 0.2s var(--ease);
}

.daily-dish,
.daily-line {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem 0.75rem;
  flex: 1;
  min-width: 0;
  min-height: var(--tap);
  padding: 0;
  border: none;
  background: none;
  cursor: pointer;
  user-select: none;
  color: var(--text);
  font-family: inherit;
  font-size: 0.95rem;
  text-align: left;
}

/* One dish and its combinados, with a handle to drag the whole dish at once. */
.daily-dish-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Lifted out of the flow and following the finger. */
.daily-dish-group.dragging {
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.7);
  outline: 1px solid var(--gold);
  border-radius: 2px;
  background: var(--surface-raised);
}

/* The gap the dragged dish will drop into. */
.daily-drag-placeholder {
  border: 1px dashed var(--gold);
  border-radius: 2px;
  background: var(--gold-tint);
}

.daily-dish-lines {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.daily-group-label {
  margin: 0 0 0.1rem;
  font-size: 0.875rem;
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: 0.16em;
}

/* Combinados collapse under a toggle so a dish is one short, easy-to-drag row. */
.daily-combos-toggle {
  align-self: flex-start;
  min-height: var(--tap);
  background: none;
  border: none;
  padding: 0.15rem 0;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.875rem;
  letter-spacing: 0.04em;
  cursor: pointer;
}

.daily-combos-toggle-active {
  color: var(--gold);
  font-weight: 500;
}

.daily-combos-caret {
  display: inline-block;
  width: 1em;
}

.daily-combos-count {
  color: var(--gold);
  font-weight: 500;
}

.daily-combos {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  padding-left: 0.85rem;
  border-left: 1px solid var(--hairline);
}

.daily-combos.hidden {
  display: none !important;
}

.daily-dish-holder:active {
  background: var(--surface);
}

.daily-dish-holder:has(.daily-dish-chosen) {
  border-color: var(--gold);
  background: var(--gold-tint);
}

.daily-dish-title {
  flex: 1;
}

.daily-dish-mark {
  visibility: hidden;
  color: var(--gold);
  font-weight: 700;
}

.daily-dish-chosen .daily-dish-mark {
  visibility: visible;
}

button.primary:disabled {
  background: var(--border);
  border-color: var(--border);
  color: var(--text-muted);
  cursor: default;
}

.order-line {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
  user-select: none;
}

.order-line-title {
  flex: 1;
  min-width: 0;
}

.carta-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
}

.order-line-chosen {
  border-color: var(--gold);
}

.order-line:active {
  background: var(--surface);
}

.order-line-amount {
  min-width: 1.6rem;
  text-align: right;
  font-weight: 600;
  color: var(--gold);
}

.order-line-remove {
  position: absolute;
  top: -0.55rem;
  right: -0.55rem;
  width: 1.5rem;
  height: 1.5rem;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: var(--danger);
  color: #0d0d0d;
  font-size: 0.8rem;
  line-height: 1;
  cursor: pointer;
}

.order-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem 1.5rem;
  margin-top: 1.25rem;
  border-top: 1px solid var(--hairline-soft);
  padding-top: 0.9rem;
}

.time-options-label {
  margin: 0 0 0.4rem;
  font-size: 0.875rem;
  color: var(--text-muted);
}

.time-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.time-option {
  min-height: var(--tap);
  padding: 0.45rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: 2px;
  background: none;
  color: var(--text);
  font-size: 0.95rem;
  font-family: inherit;
  cursor: pointer;
}

.time-option.selected {
  background: var(--gold);
  border-color: var(--gold);
  color: #0d0d0d;
  font-weight: 500;
}

.time-option.closed {
  color: var(--text-muted);
  background: none;
  text-decoration: line-through;
  cursor: not-allowed;
}

.order-summary .side-item {
  margin-top: 0.5rem;
  font-size: 0.95rem;
  color: var(--text);
  padding-left: 0;
  border-left: none;
}

.order-summary-total {
  display: flex;
  justify-content: space-between;
  margin-top: 0.9rem;
  padding-top: 0.9rem;
  border-top: 1px solid var(--hairline);
  font-size: 1.05rem;
}

.drop-point-slug {
  color: var(--text-muted);
  font-size: 0.875rem;
  text-decoration: none;
}

.drop-point-slug:hover {
  color: var(--gold);
}

/* ---------- Kitchen / counter (kept for completeness) ---------- */

.kitchen-status {
  margin-left: 0.5rem;
  font-size: 0.8rem;
  padding: 0.1rem 0.5rem;
  border-radius: 999px;
  border: 1px solid var(--border);
}

.kitchen-status-live {
  color: var(--gold);
  border-color: var(--gold);
}

.kitchen-status-down {
  color: var(--danger);
  border-color: var(--danger);
}

.kitchen-group-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.kitchen-group-header h2 {
  margin: 0;
  font-size: 1.4rem;
}

.kitchen-group-badges {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.kitchen-chip {
  font-size: 0.8rem;
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.1rem 0.5rem;
}

.kitchen-group-ready {
  border-color: var(--gold);
}

.kitchen-group-ready .kitchen-group-count {
  color: var(--gold);
}

.kitchen-line {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
  user-select: none;
}

.kitchen-line:active {
  background: var(--surface);
}

.kitchen-line-title {
  flex: 1;
}

.kitchen-count {
  font-family: var(--serif);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--gold);
  white-space: nowrap;
}

.kitchen-line-done {
  border-color: var(--gold);
  background: var(--gold-tint);
}

.kitchen-line-done .kitchen-count {
  font-size: 1.65rem;
}

.kitchen-undo {
  position: absolute;
  top: -0.55rem;
  right: -0.55rem;
  width: 1.5rem;
  height: 1.5rem;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: var(--text-muted);
  color: #0d0d0d;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  cursor: pointer;
}

.kitchen-undo.hidden {
  display: none !important;
}

@keyframes kitchen-arrived {
  from {
    background: var(--gold-tint-strong);
    border-color: var(--gold);
  }
  to {
    background: var(--surface-raised);
    border-color: var(--border);
  }
}

.kitchen-line-new {
  animation: kitchen-arrived 2.5s ease-out;
}

/* Desktop only: the phone layout below 720px stays exactly as it is. */
@media (min-width: 720px) {
  main {
    max-width: 1080px;
  }

  .dishes-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    column-gap: 0.75rem;
  }

  #daily-dishes,
  #order-lines,
  .kitchen-group .dishes-list {
    grid-auto-rows: 1fr;
  }

  .kitchen-group .dishes-list {
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  }
}

.day-picker {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.day-picker input {
  flex: 1;
  min-width: 0;
}

.day-picker button {
  min-width: var(--tap);
  min-height: var(--tap);
  padding: 0.5rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: 2px;
  background: none;
  color: var(--text-soft);
  font-family: inherit;
  font-size: 0.875rem;
  letter-spacing: 0.06em;
  cursor: pointer;
}

.day-picker button:hover {
  border-color: var(--gold);
  color: var(--gold);
}

/* ---------- Family headings ---------- */

/* A family's name, centred between two gold hairlines like a course on a printed menu. It
   spans the whole grid so the family below it starts on a fresh row. */
.line-group-heading {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 2.25rem 0 0.5rem;
  font-family: var(--serif);
  font-size: 1.15rem;
  font-weight: 600;
  line-height: 1.2;
  color: var(--gold);
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.24em;
}

.line-group-heading::before,
.line-group-heading::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--hairline);
}

.line-group-heading:first-child {
  margin-top: 0.75rem;
}

@media (min-width: 720px) {
  .line-group-heading {
    grid-column: 1 / -1;
  }
}

/* A dish with no price is a group; the list says so where the price would be. */
.dish-group-tag {
  color: var(--text-muted);
  font-family: var(--sans);
  font-weight: 400;
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

/* ---------- Sticky staff action bars ---------- */

.form-actions,
.sticky-actions {
  position: sticky;
  bottom: 0;
  background: var(--surface);
  padding-bottom: calc(0.5rem + env(safe-area-inset-bottom));
}

.sticky-actions {
  padding-top: 0.1rem;
}

.sticky-actions .form-actions {
  position: static;
  padding-bottom: 0;
}

.form-actions::before,
.sticky-actions::before {
  content: '';
  display: block;
  border-top: 1px solid var(--hairline-soft);
  margin-bottom: 0.75rem;
}

/* A flex row would put the hairline beside the buttons instead of above them. */
.form-actions {
  flex-wrap: wrap;
}

.form-actions::before {
  flex: 1 1 100%;
  margin-bottom: 0.25rem;
}

.sticky-actions .form-actions::before {
  content: none;
}

#summary-card .form-actions {
  position: static;
}

#summary-card .form-actions::before {
  content: none;
}

.daily-dish-stock {
  width: 4.5rem;
  height: var(--tap);
  min-height: 0;
  flex: none;
  padding: 0.25rem 0.5rem;
  font-size: 0.95rem;
  text-align: right;
}

.order-line-left {
  position: absolute;
  left: 0.9rem;
  bottom: 0.1rem;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.order-line:has(.order-line-left:not(:empty)) {
  padding-bottom: 1.4rem;
}

.order-line-sold-out {
  background: var(--surface);
  cursor: not-allowed;
}

.order-line-sold-out .dish-title,
.order-line-sold-out .dish-price {
  color: var(--text-muted);
}

.order-line-sold-out .order-line-left {
  color: var(--danger);
}

.counter-line {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
  user-select: none;
  padding-right: 2.6rem;
}

.counter-line:active {
  background: var(--surface);
}

.counter-line-title {
  flex: 1;
  min-width: 0;
}

.counter-breakdown {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.counter-count {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--gold);
  white-space: nowrap;
}

.counter-line-empty {
  background: var(--surface);
}

.counter-line-empty .counter-count {
  color: var(--text-muted);
}

.counter-line-short {
  border-color: var(--danger);
}

.counter-short {
  color: var(--danger);
  font-weight: 600;
}

.counter-add {
  position: absolute;
  bottom: -0.55rem;
  right: -0.55rem;
  width: 1.5rem;
  height: 1.5rem;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: var(--gold);
  color: #0d0d0d;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  cursor: pointer;
}

/* ---------- Allergens and ingredients ---------- */

/* Always visible under the name: nobody with an allergy should have to ask. Set quieter
   than the name and the price, but never below legible size. */
.order-line-details {
  flex: 1 1 100%;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35rem 0.4rem;
  margin-top: 0.1rem;
  min-width: 0;
}

.allergen-tag {
  padding: 0 0.55rem 0.05rem;
  border: 1px solid var(--hairline);
  border-radius: 999px;
  color: var(--text-soft);
  font-family: var(--sans);
  font-size: 0.875rem;
  font-weight: 400;
  line-height: 1.55;
  font-variant-caps: all-small-caps;
  letter-spacing: 0.1em;
  white-space: nowrap;
}

.order-line-ingredients {
  flex: 1 1 100%;
  font-family: var(--sans);
  font-size: 0.875rem;
  font-weight: 300;
  line-height: 1.55;
  color: var(--text-muted);
  overflow-wrap: anywhere;
}

.order-line {
  flex-wrap: wrap;
}

/* The multiselect in Gestión: a chip has the shape of the tag it becomes on the carta. */
.allergen-field {
  margin-top: 1rem;
}

.allergen-label {
  display: block;
  font-size: 0.875rem;
  color: var(--text-muted);
  letter-spacing: 0.06em;
  margin-bottom: 0.4rem;
}

.allergen-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.allergen-chip {
  min-height: 36px;
  padding: 0.25rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: none;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.875rem;
  cursor: pointer;
}

.allergen-chip-on {
  border-color: var(--gold);
  background: var(--gold-tint-strong);
  color: var(--gold-bright);
  font-weight: 500;
}

.details-field {
  margin-top: 0.75rem;
}

.side-row .side-ingredients,
.side-row .allergen-chips {
  flex: 1 1 100%;
  min-width: 0;
}

.chime-button {
  margin-left: 0.4rem;
  padding: 0.1rem 0.5rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: none;
  color: var(--text);
  font-family: inherit;
  font-size: 0.8rem;
  cursor: pointer;
  vertical-align: middle;
}

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

.chime-button-blocked {
  border-color: var(--gold);
  color: var(--gold);
}

/* ---------- Carta: category bar ---------- */

/* Sticks to the top so the families stay reachable while the list scrolls; the chips scroll
   sideways inside it. A gold hairline marks where the fixed part ends. */
.carta-categories {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  gap: 0.25rem;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 0.35rem 0;
  margin: 0 -1rem 0.25rem;
  padding-left: 1rem;
  padding-right: 1rem;
  scroll-padding-inline: 1rem;
  background: var(--bg);
  border-bottom: 1px solid var(--hairline);
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.carta-categories::-webkit-scrollbar {
  display: none;
}

.carta-chip {
  flex: 0 0 auto;
  min-height: var(--tap);
  padding: 0.35rem 0.95rem;
  border: 1px solid transparent;
  border-radius: 999px;
  background: none;
  color: var(--text-muted);
  font-family: var(--sans);
  font-size: 0.875rem;
  font-weight: 400;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.2s var(--ease), border-color 0.2s var(--ease);
}

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

.carta-chip-on {
  border-color: var(--gold);
  color: var(--gold);
  font-weight: 500;
}

/* Gestión: the single free-text category field on the dish form. */
#tag-input {
  width: 100%;
}

/* Menú del día: the per-day ordering list. */
.daily-order {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.daily-order-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.drag-handle {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  min-height: var(--tap);
  cursor: grab;
  touch-action: none;
  color: var(--gold-deep);
  font-size: 1.25rem;
  line-height: 1;
  padding: 0.2rem 0.3rem;
  user-select: none;
}

.daily-order-row.dragging {
  opacity: 0.6;
  border-color: var(--gold);
  cursor: grabbing;
}

/* ---------- Carta: the dish list ---------- */

/* One calm column, even on a wide screen: a menu is read down, not across. */
@media (min-width: 720px) {
  main:has(#carta-lines) {
    max-width: 760px;
  }

  #carta-lines {
    grid-template-columns: minmax(0, 1fr);
  }
}

#carta-lines {
  gap: 0;
}

.dish-item.carta-line {
  gap: 0.35rem 1rem;
  padding: 1.15rem 0 1.2rem;
  border: none;
  border-bottom: 1px solid var(--hairline-soft);
  border-radius: 0;
  background: none;
}

/* The last dish of a family closes on the heading of the next, not on a stray rule. */
.dish-item.carta-line:has(+ .line-group-heading),
.dish-item.carta-line:last-child {
  border-bottom: none;
}

.carta-line .order-line-title {
  flex: 1 1 0;
  min-width: 0;
  font-family: var(--serif);
}

.carta-line .dish-title {
  font-size: 1.375rem;
  line-height: 1.2;
}

.carta-line .dish-price {
  font-size: 1.3rem;
  margin-left: auto;
}

@media (min-width: 720px) {
  .carta-line .dish-title {
    font-size: 1.5rem;
  }

  .carta-line .dish-price {
    font-size: 1.4rem;
  }
}

/* ---------- Ordering: steppers ---------- */

.order-stepper {
  display: inline-flex;
  align-items: center;
  gap: 0.15rem;
  flex: none;
}

.order-stepper button {
  width: var(--tap);
  height: var(--tap);
  padding: 0;
  border: 1px solid var(--hairline);
  border-radius: 50%;
  background: none;
  color: var(--text-soft);
  font-family: var(--sans);
  font-size: 1.25rem;
  font-weight: 300;
  line-height: 1;
  cursor: pointer;
  transition: background 0.2s var(--ease), border-color 0.2s var(--ease), color 0.2s var(--ease);
}

.order-stepper .order-add,
.order-stepper .order-plus {
  border-color: var(--gold);
  color: var(--gold);
}

.order-stepper button:hover {
  background: var(--gold-tint);
  border-color: var(--gold);
  color: var(--gold-bright);
}

.order-stepper button:active {
  background: var(--gold-tint-strong);
}

.order-quantity {
  min-width: 1.6rem;
  text-align: center;
  font-family: var(--serif);
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--text);
  font-variant-numeric: lining-nums tabular-nums;
}

/* ---------- Ordering: bottom bar ---------- */

/* Leave room under the last line so the bar never covers it. */
body:has(.order-bar:not(.hidden)) main {
  padding-bottom: calc(7rem + env(safe-area-inset-bottom));
}

.order-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 20;
  padding: 1.5rem calc(1rem + env(safe-area-inset-right)) calc(1rem + env(safe-area-inset-bottom))
    calc(1rem + env(safe-area-inset-left));
  background: linear-gradient(to bottom, rgba(13, 13, 13, 0) 0, rgba(13, 13, 13, 0.92) 1.4rem, #0d0d0d 100%);
  animation: micaela-rise 0.32s var(--ease) both;
}

.order-bar-button,
.order-send {
  display: block;
  width: 100%;
  max-width: 32rem;
  min-height: 52px;
  margin: 0 auto;
  padding: 0.9rem 1rem;
  border: 1px solid var(--gold);
  border-radius: 2px;
  background: var(--gold);
  color: #0d0d0d;
  font-family: var(--sans);
  font-size: 0.9375rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.2s var(--ease), border-color 0.2s var(--ease);
}

.order-bar-button:hover,
.order-send:hover {
  background: var(--gold-bright);
  border-color: var(--gold-bright);
}

.order-bar-button:focus-visible,
.order-send:focus-visible {
  outline-color: var(--text);
}

/* ---------- Ordering: sheet ---------- */

.order-overlay {
  position: fixed;
  inset: 0;
  z-index: 30;
  background: rgba(0, 0, 0, 0.72);
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
  animation: micaela-fade 0.25s ease-out both;
}

.order-sheet {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 40;
  max-width: 36rem;
  max-height: 88vh;
  max-height: 88dvh;
  margin: 0 auto;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 1.5rem calc(1.25rem + env(safe-area-inset-right)) calc(1.5rem + env(safe-area-inset-bottom))
    calc(1.25rem + env(safe-area-inset-left));
  border-top: 1px solid var(--gold);
  border-radius: 0;
  background: var(--bg);
  animation: micaela-sheet 0.34s var(--ease) both;
}

.order-sheet-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding-bottom: 0.75rem;
  margin-bottom: 0.25rem;
  border-bottom: 1px solid var(--hairline-soft);
}

.order-sheet-head h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: 1.9rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  line-height: 1.1;
}

.order-close {
  flex: none;
  width: var(--tap);
  height: var(--tap);
  margin-right: -0.5rem;
  border: 1px solid transparent;
  border-radius: 50%;
  background: none;
  color: var(--text-soft);
  font-family: var(--sans);
  font-size: 1.75rem;
  font-weight: 300;
  line-height: 1;
  cursor: pointer;
}

.order-close:hover {
  border-color: var(--hairline);
  color: var(--gold);
}

.order-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.8rem 0;
  border-bottom: 1px solid var(--hairline-soft);
}

.order-item-name {
  flex: 1;
  min-width: 0;
  font-family: var(--serif);
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1.2;
}

.order-item-name small {
  display: block;
  margin-top: 0.15rem;
  color: var(--gold);
  font-size: 1.05rem;
  font-weight: 600;
  font-variant-numeric: lining-nums tabular-nums;
}

.order-total {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin: 0;
  padding: 1rem 0 1.25rem;
  font-weight: 400;
}

.order-total span:first-child {
  font-size: 0.875rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-soft);
}

.order-total span:last-child {
  font-family: var(--serif);
  font-size: 1.6rem;
  font-weight: 600;
  color: var(--gold);
  font-variant-numeric: lining-nums tabular-nums;
}

.order-field-label {
  display: block;
  margin-bottom: 0.6rem;
  font-size: 0.875rem;
  font-weight: 400;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-soft);
}

.order-times {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.order-time {
  flex: 1 1 0;
  min-width: 4.5rem;
  min-height: 48px;
  padding: 0.6rem;
  border: 1px solid var(--border);
  border-radius: 2px;
  background: none;
  color: var(--text);
  font-family: var(--serif);
  font-size: 1.3rem;
  font-weight: 600;
  font-variant-numeric: lining-nums tabular-nums;
  cursor: pointer;
  transition: border-color 0.2s var(--ease), color 0.2s var(--ease), background 0.2s var(--ease);
}

.order-time:hover {
  border-color: var(--gold);
}

.order-time-on {
  border-color: var(--gold);
  background: var(--gold-tint-strong);
  color: var(--gold-bright);
  box-shadow: inset 0 0 0 1px var(--gold);
}

.order-error {
  margin: 0 0 0.9rem;
  padding: 0.6rem 0.8rem;
  border-left: 1px solid var(--danger);
  color: var(--danger);
  font-size: 0.9375rem;
}

.order-hint {
  margin: 0.9rem auto 0;
  max-width: 26rem;
  color: var(--text-muted);
  font-size: 0.875rem;
  font-weight: 300;
  line-height: 1.5;
  text-align: center;
}

.order-summary-edit,
.order-discard {
  display: block;
  width: 100%;
  min-height: 48px;
  padding: 0.75rem 1rem;
  border: 1px solid var(--gold);
  border-radius: 2px;
  background: none;
  color: var(--gold);
  font-family: var(--sans);
  font-size: 0.9375rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.2s var(--ease);
}

.order-summary-edit:hover,
.order-discard:hover {
  background: var(--gold-tint);
}

.order-discard {
  max-width: 32rem;
  margin: 0.6rem auto 0;
  border-color: var(--border);
  color: var(--text-soft);
  font-weight: 400;
}

.order-discard:hover {
  border-color: var(--text-muted);
  background: none;
}

.order-cancel-note {
  margin: 1rem 0 0.25rem;
  color: var(--danger);
  font-family: var(--serif);
  font-size: 1.2rem;
  font-style: italic;
}

.order-items-cancelled .order-item-name {
  text-decoration: line-through;
  text-decoration-thickness: 1px;
  color: var(--text-muted);
}

.order-items-cancelled .order-item-name small {
  color: var(--text-muted);
}

.order-items-cancelled {
  margin-bottom: 1.25rem;
}

/* ---------- "Tu pedido de hoy" ---------- */

/* Framed in a single gold hairline, like a reservation card left on the table. */
.order-summary {
  margin: 0 0 0.5rem;
  padding: 1.75rem 1.25rem 1.5rem;
  border: 1px solid var(--hairline);
  border-radius: 0;
  background: none;
  text-align: center;
}

.order-summary h2 {
  margin: 0 0 1rem;
  font-family: var(--serif);
  font-size: 1.7rem;
  font-weight: 500;
  font-style: italic;
}

.order-summary-lines {
  text-align: left;
}

.order-summary-line {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.75rem;
  padding: 0.45rem 0;
  font-family: var(--serif);
  font-size: 1.2rem;
  font-weight: 600;
}

.order-summary-line span:last-child {
  color: var(--gold);
  white-space: nowrap;
  font-variant-numeric: lining-nums tabular-nums;
}

.order-summary .order-total {
  margin-top: 0.4rem;
  padding: 0.85rem 0 0.9rem;
  border-top: 1px solid var(--hairline-soft);
  text-align: left;
}

.order-summary-time {
  margin: 0 0 1.25rem;
  font-size: 0.9375rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold);
}

/* ---------- Motion ---------- */

@keyframes micaela-fade {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes micaela-sheet {
  from {
    transform: translateY(2.5rem);
    opacity: 0;
  }
  to {
    transform: none;
    opacity: 1;
  }
}

@keyframes micaela-rise {
  from {
    transform: translateY(1rem);
    opacity: 0;
  }
  to {
    transform: none;
    opacity: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .kitchen-line-new {
    animation: none;
    border-color: var(--gold);
  }
}
