/* ============================================================
   Dorothy's — Menu layout & print styles
   ============================================================ */

:root {
  --ink: #2d1725;          /* brand deep aubergine */
  --paper: #ffffff;
  --page-w: 210mm;         /* A4 */
  --page-h: 297mm;
  --page-pad-x: 26mm;
  --page-pad-top: 24mm;
  --page-pad-bottom: 18mm;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: #e9e7e5;     /* desk colour around the page (screen only) */
  color: var(--ink);
  font-family: "Libre Caslon Text", Georgia, "Times New Roman", serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* ---------- The printable page ---------- */
.page {
  position: relative;
  width: var(--page-w);
  height: var(--page-h);           /* exact size so pagination is predictable */
  margin: 24px auto;
  padding: var(--page-pad-top) var(--page-pad-x) var(--page-pad-bottom);
  background: var(--paper);
  box-shadow: 0 6px 30px rgba(0, 0, 0, 0.12);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.page-content {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

/* ---------- Logo ---------- */
.menu-logo {
  text-align: center;
  margin: 6mm 0 22mm;
}
.menu-logo img {
  width: 64mm;
  height: auto;
}

/* ---------- Section ---------- */
.section { position: relative; margin-bottom: 16mm; }
.section:last-child { margin-bottom: 0; }

/* A section title repeated at the top of a continued page */
.section-title.continued { /* same styling as a normal title */ }

.section-title {
  font-family: "Sackers Gothic", "Libre Caslon Text", serif;
  font-weight: 500;
  font-size: 21pt;
  letter-spacing: 0.42em;
  text-transform: uppercase;
  margin: 0 0 9mm 1px;
}

/* ---------- Menu rows ---------- */
.item {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0 6mm;                    /* column gap only — desc wraps tight below */
  margin-bottom: 4.6mm;          /* spacing between menu rows */
  font-style: italic;
  font-size: 10pt;
  line-height: 1.3;
}
.section .item:last-of-type { margin-bottom: 0; }
.item-name {
  flex: 1 1 auto;
  /* Long item names wrap within their column instead of pushing the price */
  white-space: normal;
  overflow-wrap: break-word;
}
.item-name .sep {              /* the thin pipe between variants */
  font-style: normal;
  padding: 0 0.25em;
  opacity: 0.85;
}
.item-price {
  flex: 0 0 auto;
  min-width: 12mm;               /* keeps empty price boxes clickable & aligned */
  text-align: right;
  white-space: nowrap;
}

/* Name column: wraps the item name + description so the desc sits
   directly below the name at the same width, price stays to the right. */
.item-name-col {
  flex: 1 1 auto;
  min-width: 0;
}

/* Description line: natural block inside the name column */
.item-desc {
  display: block;
  margin-top: 1.2mm;
  font-style: italic;
  opacity: 0.62;
  line-height: 1.35;
}

/* ---------- Footer ---------- */
.menu-footer {
  flex: 0 0 auto;
  padding-top: 10mm;
  text-align: center;
  font-style: italic;
  font-size: 9pt;
}

/* ============================================================
   Coffee, Tea & Juice overrides
   ============================================================ */

/* Reference design uses ~52mm side margins — much wider than A4 default.
   Top/bottom match Day Food & Cocktail A4 (logo & address placement). */
.page.menu-coffee-tea-juice {
  padding: 14mm 52mm 14mm;
}

.menu-coffee-tea-juice .menu-logo { margin: 0; }
.menu-coffee-tea-juice .menu-logo img { width: 60.8mm; }

.menu-coffee-tea-juice .section-title {
  font-weight: 300;
  font-size: 15.5pt;
  letter-spacing: 0.28em;
  white-space: nowrap;
  margin: 0 0 6mm 1px;
}
.menu-coffee-tea-juice .section:last-child { margin-bottom: 0; }

.menu-coffee-tea-juice .section { margin-bottom: 24.5mm; }

.menu-coffee-tea-juice .item {
  font-size: 11.5pt;
  margin-bottom: 5mm;
}

/* Vertical centring spacers: equal free space above and below */
.menu-coffee-tea-juice .cb-spacer-top,
.menu-coffee-tea-juice .cb-spacer-bottom { flex: 1 0 0; min-height: 0; }

.menu-coffee-tea-juice .menu-footer { font-size: 9.3pt; padding-top: 0; }

/* ============================================================
   A5 — Day Food & Cocktail overrides
   ============================================================ */
.page.a5 {
  width: 148mm;
  height: 210mm;
  padding: 12mm 25mm 13mm;
}

.page.a5 .menu-logo { margin: 0 0 13mm; }
.page.a5.continuation { padding-top: 15mm; }
.page.a5 .menu-logo img { width: 40mm; }

.page.a5 .section { margin-bottom: 3mm; }
.page.a5 .section:last-child { margin-bottom: 0; }
/* A level-1 heading with no items of its own (e.g. BREAKFAST) sits
   directly above its first sub-section */
.page.a5 .section.header-only { margin-bottom: 0; }

/* Level-1 title: BREAKFAST, LUNCH, HOUSE COCKTAILS … */
.page.a5 .section-title {
  font-weight: 500;
  font-size: 10pt;
  letter-spacing: 0.38em;
  margin: 4mm 0 2.5mm 1px;
}
.page.a5 .page-content > .section:first-child .section-title { margin-top: 0; }

/* Level-2 sub-title: COUNTER, FROM THE KITCHEN … */
.page.a5 .section-title.level-2 {
  font-weight: 300;
  font-size: 7.5pt;
  letter-spacing: 0.3em;
  margin: 1mm 0 2mm 1px;
}

.page.a5 .item {
  font-size: 6.96pt;
  line-height: 1.25;
  gap: 0 5mm;
  margin-bottom: 0.9mm;
}
.page.a5 .item-desc {
  margin-top: 0.2mm;
  font-size: 6.75pt;
}

.page.a5 .menu-footer {
  padding-top: 4mm;
  font-size: 8pt;
}

/* ============================================================
   Day Food & Cocktail — A5
   All rules scoped to .menu-day-food-cocktail so nothing leaks.
   Content is vertically centred between logo and footer on every page.
   ============================================================ */

/* Remove logo bottom margin — flex gap handles spacing */
.page.a5.menu-day-food-cocktail .menu-logo { margin: 0; }

/* page-content expands to fill all space between logo and footer,
   then centres sections within that space */
.page.a5.menu-day-food-cocktail .page-content {
  flex: 1 1 auto;
  justify-content: center;
}

/* Remove footer top padding so top/bottom gaps are equal */
.page.a5.menu-day-food-cocktail .menu-footer { padding-top: 0; font-size: 7.5pt; }

/* Font sizes (scoped so Aperitivo A5 keeps the shared .page.a5 sizes) */
.page.a5.menu-day-food-cocktail .section-title { font-size: 10.5pt; font-weight: 300; }
.page.a5.menu-day-food-cocktail .section-title.level-2 { font-size: 9pt; font-weight: 300; }
.page.a5.menu-day-food-cocktail .item { font-size: 8.5pt; margin-bottom: 1.1mm; flex-wrap: nowrap; }
.page.a5.menu-day-food-cocktail .item-desc { font-size: 8pt; }
/* Long names wrap to a new line within their column; price stays right */
.page.a5.menu-day-food-cocktail .item-name { min-width: 0; }

/* More gap between items, less gap before each head.
   margin-top = gap from last item to next head; margin-bottom = head to item. */
.page.a5.menu-day-food-cocktail .section-title { margin-top: 1.8mm; margin-bottom: 2.25mm; }
.page.a5.menu-day-food-cocktail .section-title.level-2 { margin-top: 0.9mm; margin-bottom: 1.8mm; }

/* ============================================================
   Wine List — folded A4 leaflet
   ------------------------------------------------------------
   One A4 portrait sheet = two tall panels side by side, folded
   down the middle. Muted taupe palette, two measure columns.
   All rules scoped to .menu-wine-list-a4 so nothing leaks to
   other templates.
   ============================================================ */
.menu-wine-list-a4 {
  --wine-ink: var(--ink);
  --wine-soft: var(--ink);
}

.paper.menu-wine-list-a4 {
  position: relative;
  width: 210mm;
  height: 297mm;
  margin: 24px auto;
  background: var(--paper);
  box-shadow: 0 6px 30px rgba(0, 0, 0, 0.12);
  display: flex;
  overflow: hidden;
  color: var(--wine-ink);
}

/* The vertical fold guide (screen only) */
.paper.menu-wine-list-a4::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  border-left: 1px dashed rgba(128, 124, 112, 0.3);
  pointer-events: none;
}

.menu-wine-list-a4 .panel {
  width: 105mm;
  height: 297mm;
  display: flex;
  flex-direction: column;
  position: relative;
  /* default: outer side 11mm, fold side 13mm — overridden per side below */
  padding: 15mm 11mm 13mm;
}
.menu-wine-list-a4 .panel:first-child  { padding-right: 13mm; } /* left page: fold on right */
.menu-wine-list-a4 .panel:last-child   { padding-left: 13mm; }  /* right page: fold on left */

.menu-wine-list-a4 .panel-content {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

/* Master title (cover only) */
.menu-wine-list-a4 .wine-master-title {
  font-family: "Sackers Gothic", "Libre Caslon Text", serif;
  font-weight: 300;
  font-size: 10.5pt;
  letter-spacing: 0.42em;
  text-transform: uppercase;
  text-align: center;
  color: var(--wine-ink);
  margin: 0 0 13mm;          /* 1.5cm above (panel padding-top) · 1.3cm below to first section */
}

/* Page number (·2· ·3· ·4·) */
.menu-wine-list-a4 .wine-page-num {
  text-align: center;
  font-style: italic;
  font-size: 8.7pt;
  color: var(--wine-ink);
  margin: 0 0 9mm;
}

/* Section */
.menu-wine-list-a4 .wine-section { margin-bottom: 7mm; }
.menu-wine-list-a4 .wine-section:last-child { margin-bottom: 0; }

.menu-wine-list-a4 .wine-head {
  position: relative;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 3mm;
}
.menu-wine-list-a4 .section-title.wine-title {
  font-family: "Sackers Gothic", "Libre Caslon Text", serif;
  font-weight: 300;
  font-size: 10.5pt;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--wine-ink);
  margin: 0;
}

/* Measure labels, right-aligned over the price columns */
.menu-wine-list-a4 .wine-columns {
  flex: 0 0 auto;
  display: flex;
  gap: 0 2.5mm;
}
.menu-wine-list-a4 .wine-col-label {
  width: 12mm;
  text-align: right;
  font-style: italic;
  font-size: 6.44pt;         /* 74% of 8.7pt — matches the price columns it heads */
  color: var(--wine-soft);
}

/* Wine row: name (+grape) on the left, prices right-aligned */
.menu-wine-list-a4 .wine-item {
  display: flex;
  flex-wrap: nowrap;          /* prices stay on the name's first line */
  align-items: flex-start;
  gap: 0 5mm;
  margin-bottom: 2.38mm;
  font-style: normal;
  font-size: 8.5pt;          /* name, grape & price all inherit */
  line-height: 1.3;
}
.menu-wine-list-a4 .wine-section .wine-item:last-of-type { margin-bottom: 0; }

.menu-wine-list-a4 .wine-name-col { flex: 1 1 auto; min-width: 0; }
.menu-wine-list-a4 .wine-name {
  font-style: italic;
  color: var(--wine-ink);
}
.menu-wine-list-a4 .wine-grape {
  font-style: italic;
  color: var(--wine-soft);
  opacity: 0.62;            /* match Aperitivo description lightness */
  margin-top: 0.6mm;
}

.menu-wine-list-a4 .wine-prices {
  flex: 0 0 auto;
  display: flex;
  gap: 0 2.5mm;
}
.menu-wine-list-a4 .wine-price {
  width: 12mm;
  text-align: right;
  font-style: italic;
  color: var(--wine-ink);
  white-space: nowrap;
}

/* Cover panel: reduced bottom padding so logo sits 13mm from page bottom */
.menu-wine-list-a4 .panel.wine-cover { padding-bottom: 13mm; }

/* Cover panel furniture */
.menu-wine-list-a4 .wine-back-logo {
  margin: auto 0 0;         /* margin-top auto pins logo to bottom of cover */
  text-align: center;
}
.menu-wine-list-a4 .wine-back-logo img { width: 30mm; height: auto; }

/* Back panel furniture */
.menu-wine-list-a4 .wine-footer {
  flex: 0 0 auto;
  margin-top: auto;         /* pins footer to bottom of back panel */
  text-align: center;
  font-style: italic;
  font-size: 7.5pt;
  color: var(--wine-ink);
}

/* While editing, let the line tools poke out without clipping */
body.editing .paper.menu-wine-list-a4 { overflow: visible; }
body.editing .menu-wine-list-a4 .panel { overflow: visible; }

/* ============================================================
   Private Event — A5 (single page, vertically centred content)
   All rules scoped to .menu-private-event-a5 so nothing leaks.
   ============================================================ */

.menu-private-event-a5 .menu-logo { margin-bottom: 0; }

/* Body: fills space between logo and footer; content sits at a
   45/55 vertical split (smaller gap on top, larger below) */
.menu-private-event-a5 .pe-body {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 0;
}
.menu-private-event-a5 .pe-body::before { content: ""; flex: 45 0 0; }
.menu-private-event-a5 .pe-body::after  { content: ""; flex: 55 0 0; }

.menu-private-event-a5 .pe-content {
  width: 100%;
  text-align: center;
}

/* Date — rules auto-size to match date text width via max-content */
.menu-private-event-a5 .pe-date-wrap {
  display: flex;
  justify-content: center;
  margin: 0;
}
.menu-private-event-a5 .pe-date-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: max-content;
}
.menu-private-event-a5 .pe-rule {
  height: 0;
  width: 200%; /* always twice the date text length, centred over it */
  border-top: 0.25pt solid rgba(0, 0, 0, 0.07);
}
.menu-private-event-a5 .pe-date {
  font-family: "Sackers Gothic", "Libre Caslon Text", serif;
  font-weight: 300;
  font-size: 10pt;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  padding: 2.5mm 0;
  white-space: nowrap;
  min-width: 1em;
}

/* Sections */
.menu-private-event-a5 .section { margin-bottom: 5mm; }
.menu-private-event-a5 .section:last-child { margin-bottom: 0; }

/* Head: 72% of A5 base (10pt → 7.2pt), +7% bottom gap.
   Selector carries .page.a5 too, to outrank .page.a5 .section-title */
.page.a5.menu-private-event-a5 .section-title {
  font-size: 10pt;
  font-weight: 300;
  text-align: center;
  letter-spacing: 0.38em;
  margin: 0.9cm 0 3.3mm 0;
}
/* First Head (SNACKS) keeps the same 0.9cm top margin as the rest;
   date-wrap has no bottom margin so the gap is exactly 0.9cm */

/* Items: centred, no price; wider item-to-item gap; desc stays tight.
   .page.a5 prefix needed to outrank .page.a5 .item (margin-bottom 0.9mm) */
.page.a5.menu-private-event-a5 .pe-item {
  justify-content: center;
  margin-bottom: 1.6mm;
  font-size: 8.5pt;
}
.menu-private-event-a5 .pe-item .item-name-col { flex: 0 1 auto; }
.menu-private-event-a5 .pe-item .item-name,
.menu-private-event-a5 .pe-item .item-desc { text-align: center; }
.page.a5.menu-private-event-a5 .pe-item .item-desc { margin-top: 0.15mm; font-size: 8pt; }
/* Empty (just-added) fields have no content, so centred they collapse to
   zero width and can't be clicked into — give them a clickable min-width */
.menu-private-event-a5 .pe-item .item-name:empty,
.menu-private-event-a5 .pe-item .item-desc:empty { min-width: 8em; }

/* ============================================================
   Editing affordances (screen only — never printed)
   ============================================================ */
[contenteditable="true"] {
  outline: none;
  border-radius: 3px;
}
/* In edit mode every field shows a light grey input box. We use only a
   background + inset outline (box-shadow) — no border or padding — so the
   text never moves and the edit/preview layouts are pixel-identical. */
body.editing [contenteditable="true"] {
  background: #f3f2f0;
  box-shadow: inset 0 0 0 1px #d8d4d1;
}
body.editing [contenteditable="true"]:hover { background: #ece9e6; }
body.editing [contenteditable="true"]:focus {
  background: #fff;
  box-shadow: inset 0 0 0 1.5px var(--ink);
}

/* Delete controls (item / section / page) — parked in the left margin so
   they never shift the printed content. */
.del-btn {
  border: none;
  background: none;
  color: #c8c0c6;
  width: 14px;
  height: 22px;
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.del-btn:hover { color: var(--ink); }

.section .item { position: relative; }
.section-head { position: relative; }

/* While editing, let the margin controls poke out past the page edge
   instead of being clipped (overflow doesn't affect layout). Print and
   preview keep the page sealed. */
body.editing .page { overflow: visible; }

/* [−][+] pair in the left margin of every line. Horizontal, so it never
   grows taller than the line and rows' controls can't pile up. */
.line-tools {
  position: absolute;
  right: 100%;
  margin-right: 8px;
  top: 50%;
  transform: translateY(-50%);
  display: none;
  flex-direction: row;
  align-items: center;
  gap: 1px;
  white-space: nowrap;
}
.page-del {
  position: absolute;
  left: 12mm;
  top: 12mm;
  display: none;
}
body.editing .line-tools { display: flex; }
/* The transform above traps child z-index in this line's stacking context,
   so lift the whole tools container while its menu is open */
.line-tools.menu-open { z-index: 60; }
body.editing .page-del { display: inline-flex; }

/* + opens the insert menu */
.add-btn {
  border: none;
  background: none;
  color: #c8c0c6;
  width: 14px;
  height: 22px;
  font-size: 13px;
  line-height: 1;
  padding: 0;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.add-btn:hover { color: var(--ink); }

/* Compact margin controls on the smaller A5 page — must stay shorter
   than the ~16px row pitch so neighbouring rows' buttons never touch */
.page.a5 .del-btn,
.page.a5 .add-btn { width: 11px; height: 15px; font-size: 10px; }
.page.a5 .page-del { left: 6mm; top: 5mm; }

/* Drag grip handle — sits after + in .line-tools, only visible while editing */
.drag-btn {
  background: none;
  border: none;
  color: #c8c0c6;
  width: 16px;
  height: 22px;
  font-size: 13px;
  line-height: 1;
  padding: 0;
  cursor: grab;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  user-select: none;
}
.drag-btn:hover { color: #888; }
.drag-btn:active { cursor: grabbing; }
.page.a5 .drag-btn { width: 12px; height: 15px; font-size: 10px; }

/* Wine list has tight 11mm outer margins, so the default-size margin controls
   spill off the paper edge. Shrink the [−][+] and drag grip, drop the
   inter-icon gap, and pull the group closer to the text so the whole cluster
   stays on the sheet where the user can reach it. */
.menu-wine-list-a4 .line-tools { margin-right: 3px; gap: 0; }
.menu-wine-list-a4 .del-btn,
.menu-wine-list-a4 .add-btn { width: 11px; height: 15px; font-size: 10px; }
.menu-wine-list-a4 .drag-btn { width: 12px; height: 15px; font-size: 10px; }

/* Spacer item — blank vertical gap */
.item-spacer { height: 6mm; }
body.editing .item-spacer {
  background: repeating-linear-gradient(
    -45deg,
    transparent,
    transparent 5px,
    rgba(210, 80, 70, 0.12) 5px,
    rgba(210, 80, 70, 0.12) 6px
  );
}

/* Drag-and-drop visual states */
.dragging { opacity: 0; }
.drag-over-top    { box-shadow: 0 -3px 0 #5286f5; }
.drag-over-bottom { box-shadow: 0  3px 0 #5286f5; }

/* The popover listing what + can insert: Title / Sub / Item / Desc */
.add-menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  min-width: 110px;
  padding: 4px;
  background: #fff;
  border: 1px solid #d8d4d1;
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(45, 23, 37, 0.18);
}
.add-menu button {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 12px;
  text-align: left;
  color: var(--ink);
  background: none;
  border: none;
  border-radius: 5px;
  padding: 7px 12px;
  cursor: pointer;
}
.add-menu button:hover { background: rgba(45, 23, 37, 0.07); }

.page-tools button {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 11px;
  letter-spacing: 0.02em;
  color: var(--ink);
  background: none;
  border: 1px dashed rgba(45, 23, 37, 0.4);
  border-radius: 4px;
  padding: 5px 12px;
  cursor: pointer;
}
.page-tools button:hover { background: rgba(45, 23, 37, 0.06); }

/* Add-page control under the whole document (screen only) */
.page-tools {
  display: none;
  justify-content: center;
  margin: 0 auto 36px;
}
body.editing .page-tools { display: flex; }

/* ============================================================
   Toolbar (top of screen)
   ============================================================ */
#browser-notice {
  display: none;
  background: #dc2626;
  color: #fff;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 12px;
  font-weight: 500;
  text-align: center;
  padding: 5px 16px;
  letter-spacing: 0.01em;
}
#browser-notice.visible {
  display: block;
}

.toolbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 16px;
  height: 50px;
  background: #f7f7f7;
  border-bottom: 1px solid #e2e2e2;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 13px;
}
.toolbar .spacer { flex: 1 1 auto; }

/* Menu picker dropdown */
.menu-picker-wrap {
  position: relative;
  flex-shrink: 0;
}
.menu-picker-trigger {
  display: flex;
  align-items: center;
  gap: 7px;
  font: 13px/1 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  padding: 7px 11px 7px 14px;
  border: 1px solid #d5d5d5;
  border-radius: 10px;
  background: #fff;
  color: #1a1a1a;
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  white-space: nowrap;
}
.menu-picker-trigger:hover { border-color: #aaa; box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12); }
.menu-picker-chevron { font-size: 10px; color: #888; margin-top: 1px; }
.menu-picker-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 100%;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.16);
  padding: 5px;
  z-index: 100;
}
.menu-picker-dropdown .menu-picker-item {
  display: block;
  width: 100%;
  text-align: left;
  font: 13px/1.4 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  padding: 8px 14px 8px 30px;
  border: none;
  border-radius: 8px;
  background: none;
  color: #333;
  cursor: pointer;
  white-space: nowrap;
  position: relative;
}
.menu-picker-dropdown .menu-picker-item:hover { background: #f0f0f0; color: #111; }
.menu-picker-dropdown .menu-picker-item.active {
  background: #5286f5;
  color: #fff;
  font-weight: 500;
}
.menu-picker-dropdown .menu-picker-item.active::before {
  content: "✓";
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 12px;
}

/* Vertical divider */
.toolbar-sep {
  width: 1px;
  height: 22px;
  background: #d8d8d8;
  flex-shrink: 0;
  margin: 0 4px;
}

/* All toolbar buttons share base style */
.toolbar button {
  font: 13px/1 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  padding: 6px 13px;
  border: 1px solid #d2d2d2;
  border-radius: 10px;
  background: #fff;
  color: #444;
  cursor: pointer;
  white-space: nowrap;
}
.toolbar button:hover { border-color: #aaa; color: #111; }

/* Preview toggle */
#btn-preview {
  color: #555;
}
#btn-preview:hover { border-color: #999; color: #111; }

/* Edge toggle: subtly thicker/darker border when the cut guide is on.
   Inset shadow fakes the extra thickness so the button doesn't shift. */
body.show-edge #btn-edge {
  border-color: #9a9a9a;
  box-shadow: inset 0 0 0 1px #9a9a9a;
}

/* Reset — subtle danger hint on hover */
#btn-reset { color: #888; }
#btn-reset:hover { border-color: #c00; color: #c00; }

/* Print primary */
.toolbar button.primary {
  background: #1c1c1c;
  border-color: #1c1c1c;
  color: #fff;
  font-weight: 500;
}
.toolbar button.primary:hover { background: #383838; border-color: #383838; }

.toolbar .status { color: #aaa; font-size: 11px; min-width: 70px; }

/* Toolbar secondary-actions group */
.toolbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

/* Overflow ··· button (hidden at wide widths) */
.toolbar-more-wrap {
  display: none;
  position: relative;
  flex-shrink: 0;
}
.toolbar-more-trigger {
  font: 16px/1 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  padding: 4px 10px 6px;
  border: 1px solid #d2d2d2;
  border-radius: 10px;
  background: #fff;
  color: #555;
  cursor: pointer;
  letter-spacing: 2px;
}
.toolbar-more-trigger:hover { border-color: #aaa; color: #111; }
.toolbar-more-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.16);
  padding: 5px;
  z-index: 100;
  white-space: nowrap;
}
.toolbar-more-dropdown .more-item {
  display: block;
  width: 100%;
  text-align: left;
  font: 13px/1.4 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  padding: 8px 16px;
  border: none;
  border-radius: 8px;
  background: none;
  color: #333;
  cursor: pointer;
}
.toolbar-more-dropdown .more-item:hover { background: #f0f0f0; color: #111; }
.toolbar-more-dropdown .more-item.danger { color: #888; }
.toolbar-more-dropdown .more-item.danger:hover { background: #fff0f0; color: #c00; }

/* Print button responsive label */
#btn-print .label-short { display: none; }

/* ── Responsive breakpoints ───────────────────────────────── */

/* ≤ 800px: collapse secondary actions into ··· */
@media (max-width: 800px) {
  .toolbar-actions { display: none; }
  .toolbar-more-wrap { display: block; }
}

/* ≤ 580px: hide status, shorten Print button */
@media (max-width: 580px) {
  .toolbar .status { display: none; }
  #btn-print .label-full { display: none; }
  #btn-print .label-short { display: inline; }
}

/* ≤ 440px: truncate menu picker label */
@media (max-width: 440px) {
  .menu-picker-label {
    max-width: 90px;
    overflow: hidden;
    text-overflow: ellipsis;
  }
}

/* ============================================================
   Day Menu — A4 (two-column)
   All rules scoped to .menu-day-menu-a4 so nothing leaks.
   ============================================================ */

.page.menu-day-menu-a4 {
  padding: 14mm 22mm 14mm;
}

.menu-day-menu-a4 .menu-logo { margin: 0; }
.menu-day-menu-a4 .menu-logo img { width: 60.8mm; }

/* Centre the two-column block vertically between logo and footer */
.menu-day-menu-a4 .dm-columns {
  flex: 0 0 auto;
  margin-top: auto;
  margin-bottom: auto;
  display: flex;
  gap: 0 14mm;
  min-height: 0;
}

.menu-day-menu-a4 .dm-col {
  flex: 1 1 0;
  min-width: 0;
}

.menu-day-menu-a4 .section { margin-bottom: 5mm; }
.menu-day-menu-a4 .section:last-child { margin-bottom: 0; }
.menu-day-menu-a4 .section.header-only { margin-bottom: 0; }

.menu-day-menu-a4 .section-title.level-1 {
  font-size: 15.5pt;
  font-weight: 300;
  letter-spacing: 0.42em;
  line-height: 1.15;
  margin: 10mm 0 3.64mm 1px;
}
.menu-day-menu-a4 .dm-col > .section:first-child .section-title.level-1 { margin-top: 0; }

.menu-day-menu-a4 .section-title.level-2 {
  font-size: 11.4pt;
  font-weight: 300;
  letter-spacing: 0.3em;
  margin: 1.6mm 0 2.8mm 1px;
}

.menu-day-menu-a4 .item {
  font-size: 9.3pt;
  margin-bottom: 1.62mm;
  flex-wrap: nowrap;
  align-items: flex-start;
}
.menu-day-menu-a4 .section .item:last-of-type { margin-bottom: 0; }

.menu-day-menu-a4 .item-desc {
  font-size: 8.5pt;
  margin-top: 0.4mm;
}

.menu-day-menu-a4 .menu-footer { font-size: 9.3pt; padding-top: 0; }

.menu-day-menu-a4 .line-tools { margin-right: 3px; gap: 0; }
.menu-day-menu-a4 .del-btn,
.menu-day-menu-a4 .add-btn { width: 11px; height: 15px; font-size: 10px; }
.menu-day-menu-a4 .drag-btn { width: 12px; height: 15px; font-size: 10px; }

/* ============================================================
   Aperitivo — A4 (two-column)
   All rules scoped to .menu-aperitivo-a4 so nothing leaks.
   ============================================================ */

.page.menu-aperitivo-a4 {
  padding: 14mm 22mm 14mm;
}

.menu-aperitivo-a4 .menu-logo { margin: 0; }
.menu-aperitivo-a4 .menu-logo img { width: 60.8mm; }

/* Centre the two-column block vertically between logo and footer */
.menu-aperitivo-a4 .dm-columns {
  flex: 0 0 auto;
  margin-top: auto;
  margin-bottom: auto;
  display: flex;
  gap: 0 14mm;
  min-height: 0;
}

.menu-aperitivo-a4 .dm-col {
  flex: 1 1 0;
  min-width: 0;
}

.menu-aperitivo-a4 .section { margin-bottom: 5mm; }
.menu-aperitivo-a4 .section:last-child { margin-bottom: 0; }
.menu-aperitivo-a4 .section.header-only { margin-bottom: 0; }

.menu-aperitivo-a4 .section-title.level-1 {
  font-size: 15.5pt;
  font-weight: 300;
  letter-spacing: 0.42em;
  line-height: 1.15;
  margin: 5mm 0 3.64mm 1px;
}
.menu-aperitivo-a4 .dm-col > .section:first-child .section-title.level-1 { margin-top: 0; }

.menu-aperitivo-a4 .section-title.level-2 {
  font-size: 11.4pt;
  font-weight: 300;
  letter-spacing: 0.3em;
  margin: 0 0 2.8mm 1px;
}

.menu-aperitivo-a4 .item {
  font-size: 9.3pt;
  margin-bottom: 2.8mm;
  flex-wrap: nowrap;
  align-items: flex-start;
}
.menu-aperitivo-a4 .section .item:last-of-type { margin-bottom: 0; }

.menu-aperitivo-a4 .item-desc {
  font-size: 8.5pt;
  margin-top: 0.4mm;
}

.menu-aperitivo-a4 .menu-footer { font-size: 9.3pt; padding-top: 0; }

.menu-aperitivo-a4 .line-tools { margin-right: 3px; gap: 0; }
.menu-aperitivo-a4 .del-btn,
.menu-aperitivo-a4 .add-btn { width: 11px; height: 15px; font-size: 10px; }
.menu-aperitivo-a4 .drag-btn { width: 12px; height: 15px; font-size: 10px; }

/* ============================================================
   Aperitivo — A5
   All rules scoped to .menu-aperitivo-a5 so nothing leaks.
   Page 1 has a large logo margin to push APERITIVO content
   to the lower portion of the page; continuation pages are normal.
   ============================================================ */

/* Remove logo margin — flex gap centres content between logo and footer */
.page.a5.menu-aperitivo-a5 .menu-logo { margin: 0; }

.page.a5.menu-aperitivo-a5 .section { margin-bottom: 4mm; }
.page.a5.menu-aperitivo-a5 .section:last-child { margin-bottom: 0; }
.page.a5.menu-aperitivo-a5 .section.header-only { margin-bottom: 0; }

.page.a5.menu-aperitivo-a5 .section-title {
  font-size: 10.5pt;
  font-weight: 300;
  letter-spacing: 0.42em;
  margin: 4mm 0 2.5mm 1px;
}
.page.a5.menu-aperitivo-a5 .page-content > .section:first-child .section-title { margin-top: 0; }

.page.a5.menu-aperitivo-a5 .section-title.level-2 {
  font-size: 9pt;
  font-weight: 300;
  letter-spacing: 0.3em;
  margin: 2mm 0 2mm 1px;
}

.page.a5.menu-aperitivo-a5 .item {
  font-size: 8.5pt;
  margin-bottom: 2mm;
  flex-wrap: nowrap;
  align-items: flex-start;
}
.page.a5.menu-aperitivo-a5 .section .item:last-of-type { margin-bottom: 0; }

.page.a5.menu-aperitivo-a5 .item-desc {
  font-size: 8pt;
  margin-top: 0.5mm;
}

.page.a5.menu-aperitivo-a5 .page-content {
  flex: 1 1 auto;
  justify-content: center;
}

.page.a5.menu-aperitivo-a5 .menu-footer { font-size: 7.5pt; padding-top: 0; }

/* ============================================================
   Coffee Bar — 180mm × 240mm
   All rules scoped to .menu-coffee-bar so nothing leaks.
   ============================================================ */

.page.menu-coffee-bar {
  width: 180mm;
  height: 240mm;
  padding: 17mm 52mm 15mm;
  /* Thin cut guide for printing on A4 then trimming to 180×240mm.
     Border is always present (transparent) so toggling it via the Edge
     button never shifts layout; box-sizing: border-box keeps it inside
     the 180×240 edge. */
  border: 0.3pt solid transparent;
}
body.show-edge .page.menu-coffee-bar { border-color: #cfcfcf; }

.menu-coffee-bar .menu-logo { margin: 0; }
.menu-coffee-bar .menu-logo img { width: 50.5mm; }

.menu-coffee-bar .section-title {
  font-weight: 300;
  font-size: 15.51pt;
  letter-spacing: 0.28em;
  white-space: nowrap;
  margin: 0 0 7mm 1px;
}

/* Vertical centring spacers: 47% of free space above, 53% below */
.menu-coffee-bar .cb-spacer-top    { flex: 47 0 0; min-height: 0; }
.menu-coffee-bar .cb-spacer-bottom { flex: 53 0 0; min-height: 0; }

.menu-coffee-bar .section { margin-bottom: 14mm; }
.menu-coffee-bar .section:last-child { margin-bottom: 0; }

.menu-coffee-bar .item {
  font-size: 10pt;
  margin-bottom: 4mm;
}

.menu-coffee-bar .item-price { min-width: 10mm; font-size: 10pt; }

.menu-coffee-bar .menu-footer { font-size: 10pt; padding-top: 0; }

/* ============================================================
   Print / PDF  (@page size is set dynamically by JS)
   ============================================================ */
@media print {
  body { background: #fff; }
  .toolbar { display: none !important; }
  #browser-notice { display: none !important; }
  body.editing [contenteditable]:hover,
  body.editing [contenteditable]:focus { background: none; box-shadow: none; }
  .line-tools, .add-menu, .page-del, .page-tools { display: none !important; }
  .page {
    margin: 0;
    box-shadow: none;
    overflow: hidden;
    break-after: page;
  }
  .page:last-of-type { break-after: auto; }

  /* Wine List: each folded sheet prints as one A4 page; hide the fold guide.
     These reset rules must match the two-class specificity of the base
     .paper.menu-wine-list-a4 selector — a bare `.paper` reset loses the
     cascade, leaving the 24px screen margin in place. That margin pushes
     each 297mm sheet 24px past the A4 page box, spilling a sliver onto an
     extra page (the broken 4-page PDF). */
  .paper.menu-wine-list-a4 {
    margin: 0;
    box-shadow: none;
    break-after: page;
  }
  .paper.menu-wine-list-a4:last-of-type { break-after: auto; }
  .paper.menu-wine-list-a4::after { display: none; }

  /* Private Event date rules: PDF renders border-top at full resolution,
     making 0.25pt look much thicker than Chrome's sub-pixel rendering.
     Drop to 0.1pt in print so both look like a hairline. */
  .menu-private-event-a5 .pe-rule {
    border-top-width: 0.1pt;
  }
}
