/* ============================================================
   Меню · dense working tool
   IBM Plex Sans / Mono, cool neutrals, teal accent.
   Rows over cards, tabular numerals, tight 8px rhythm.
   ============================================================ */

:root {
  --bg: #f6f8f9;
  --surface: #ffffff;
  --surface-2: #fbfcfd;
  --head: #e8edf0;
  --sunken: #eef2f4;

  --line: #dde3e7;
  --line-soft: #eaeff2;

  --ink: #0f1519;
  --ink-2: #3b474e;
  --muted: #55636b;
  --faint: #7b878e;

  --accent: #0e7490;
  --accent-ink: #ffffff;
  --accent-soft: #e4f1f5;
  --accent-line: #b8dbe4;

  --gold: #a1701a;
  --gold-soft: #fbf3e2;

  --danger: #b42318;
  --danger-soft: #fdf1f0;

  --r: 5px;
  --r-lg: 8px;

  --sans: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --shadow-sm: 0 1px 2px rgba(15, 21, 25, 0.06);
  --shadow: 0 1px 3px rgba(15, 21, 25, 0.08), 0 8px 24px -12px rgba(15, 21, 25, 0.2);
  --shadow-lg: 0 2px 6px rgba(15, 21, 25, 0.1), 0 24px 50px -18px rgba(15, 21, 25, 0.35);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d1114;
    --surface: #141a1e;
    --surface-2: #11171a;
    --head: #1a2227;
    --sunken: #10161a;

    --line: #242d33;
    --line-soft: #1b2328;

    --ink: #e8eef1;
    --ink-2: #b6c2c8;
    --muted: #8b989f;
    --faint: #6b787f;

    --accent: #38b0c6;
    --accent-ink: #04191e;
    --accent-soft: #0f272d;
    --accent-line: #1d4750;

    --gold: #d6a94a;
    --gold-soft: #241d0f;

    --danger: #f08a78;
    --danger-soft: #2b1512;

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.4), 0 8px 24px -12px rgba(0, 0, 0, 0.7);
    --shadow-lg: 0 2px 6px rgba(0, 0, 0, 0.45), 0 24px 50px -18px rgba(0, 0, 0, 0.8);
  }
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; min-height: 100%; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 13px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

button, input { font: inherit; color: inherit; }
button { cursor: pointer; border: none; background: none; padding: 0; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
::selection { background: var(--accent-soft); color: var(--accent); }

/* ---------------- shell ---------------- */

.shell { min-height: 100vh; display: flex; flex-direction: column; }

/* ---------------- top bar ---------------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

.topbar-inner {
  max-width: 1440px;
  margin: 0 auto;
  padding: 8px 12px 9px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toprow { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.wordmark {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.015em;
  margin-right: 2px;
}

.chip {
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 500;
  color: var(--muted);
  background: var(--sunken);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 2px 7px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.toprow-spacer { margin-left: auto; }

/* segmented control */

.segs {
  display: flex;
  border: 1px solid var(--line);
  border-radius: var(--r);
  overflow: hidden;
  background: var(--surface);
}

.seg {
  flex: 1;
  text-align: center;
  padding: 8px 6px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--muted);
  border-right: 1px solid var(--line);
  transition: background 0.12s, color 0.12s;
  white-space: nowrap;
  min-width: 0;
}
.seg:last-child { border-right: 0; }
.seg:hover:not([aria-pressed="true"]) { background: var(--sunken); color: var(--ink-2); }
.seg[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); }

/* buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 7px 11px;
  border-radius: var(--r);
  font-size: 12px;
  font-weight: 600;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-2);
  transition: background 0.12s, border-color 0.12s, color 0.12s;
  white-space: nowrap;
  min-height: 34px;
}
.btn svg { width: 15px; height: 15px; flex: none; }
.btn:hover:not(:disabled) { background: var(--sunken); border-color: var(--muted); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }

.btn-primary {
  background: var(--ink);
  color: var(--bg);
  border-color: var(--ink);
}
.btn-primary:hover:not(:disabled) { background: #000; border-color: #000; }
@media (prefers-color-scheme: dark) {
  .btn-primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
  .btn-primary:hover:not(:disabled) { background: #4cc3d8; border-color: #4cc3d8; }
}

.btn-accent { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn-accent:hover:not(:disabled) { background: var(--accent); filter: brightness(1.08); }

/* split button: action + model caret */

.actions { display: flex; gap: 6px; flex: none; }

/* Below this the wordmark + both split buttons stop fitting on one line,
   so the pair drops to its own full-width row instead of overflowing. */
@media (max-width: 780px) {
  .actions { width: 100%; }
  .actions .split { flex: 1; min-width: 0; }
  .split-main { justify-content: flex-start; }
}

.split { display: flex; min-width: 0; }

.split .btn { border-radius: 0; }
.split-main {
  border-radius: var(--r) 0 0 var(--r);
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}
.split-caret {
  border-radius: 0 var(--r) var(--r) 0;
  border-left: 0;
  padding: 7px 8px;
  gap: 4px;
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 500;
  color: var(--muted);
  flex: none;
}
.split-caret:hover:not(:disabled) { color: var(--ink); }

.caret-mark {
  width: 0; height: 0;
  border-left: 3.5px solid transparent;
  border-right: 3.5px solid transparent;
  border-top: 4px solid currentColor;
  display: block;
  opacity: 0.7;
}

/* Pro selected — flagged so an expensive model is never silently active. */
.split-caret.is-warn {
  color: var(--gold);
  background: var(--gold-soft);
  border-color: color-mix(in srgb, var(--gold) 40%, var(--line));
  font-weight: 600;
}

/* model chooser */

.modal-sm { max-width: 420px; }

.model-opt {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  width: 100%;
  text-align: left;
  padding: 11px 12px;
  border-bottom: 1px solid var(--line-soft);
  transition: background 0.12s;
}
.model-opt:hover { background: var(--sunken); }
.model-opt.is-on { background: var(--accent-soft); }

.model-tick {
  width: 16px; height: 16px;
  flex: none;
  margin-top: 2px;
  color: var(--accent);
}
.model-tick svg { width: 16px; height: 16px; }

.model-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }

.model-name {
  font-size: 13.5px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.model-flag {
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--gold);
  background: var(--gold-soft);
  border: 1px solid color-mix(in srgb, var(--gold) 35%, transparent);
  border-radius: 3px;
  padding: 1px 5px;
}
.model-def {
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--faint);
}

.model-desc { font-size: 11.5px; color: var(--muted); line-height: 1.4; }
.model-id {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--faint);
  word-break: break-all;
}

/* Pro warning */

.warn { padding: 14px 14px 4px; }
.warn-head {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  font-weight: 700;
  color: var(--gold);
  margin-bottom: 8px;
}
.warn-head svg { width: 16px; height: 16px; flex: none; }
.warn p { margin: 0 0 9px; font-size: 12.5px; line-height: 1.5; color: var(--ink-2); }

.warn-actions {
  display: flex;
  gap: 8px;
  padding: 10px 14px 14px;
}
.warn-actions .btn { flex: 1; min-height: 38px; }

.btn-warn {
  background: var(--gold);
  border-color: var(--gold);
  color: #fff;
}
.btn-warn:hover:not(:disabled) { filter: brightness(1.06); background: var(--gold); border-color: var(--gold); }
@media (prefers-color-scheme: dark) { .btn-warn { color: #1c1508; } }

/* ---------------- layout ---------------- */

.main {
  flex: 1;
  width: 100%;
  max-width: 1440px;
  margin: 0 auto;
  padding: 12px 12px 96px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(340px, 0.72fr);
  gap: 16px;
  align-items: start;
}

@media (max-width: 1024px) {
  .main { grid-template-columns: minmax(0, 1fr); }
  .preview-col { display: none; }
}

.editor-col { min-width: 0; display: flex; flex-direction: column; gap: 12px; }

/* ---------------- category ---------------- */

.cat {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  overflow: hidden;
}

.cat-head {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--head);
  border-bottom: 1px solid var(--line);
  padding: 7px 10px;
}

.cat-title {
  margin: 0;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--ink-2);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cat-n {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 500;
  color: var(--faint);
  font-variant-numeric: tabular-nums;
  flex: none;
}

.btn-fav {
  margin-left: auto;
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 600;
  color: var(--gold);
  padding: 4px 8px;
  border-radius: 4px;
  border: 1px solid transparent;
  transition: background 0.12s, border-color 0.12s;
  min-height: 28px;
}
.btn-fav svg { width: 13px; height: 13px; }
.btn-fav:hover { background: var(--gold-soft); border-color: color-mix(in srgb, var(--gold) 30%, transparent); }

/* ---------------- dish row ---------------- */

.rows { display: flex; flex-direction: column; }

.dish {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr) 78px 32px;
  gap: 6px;
  align-items: start;
  padding: 6px 8px;
  border-bottom: 1px solid var(--line-soft);
  transition: background 0.12s;
}
.dish:nth-of-type(even) { background: var(--surface-2); }
.dish:focus-within { background: var(--accent-soft); }

.dish-n {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--faint);
  text-align: right;
  padding-top: 11px;
  font-variant-numeric: tabular-nums;
  user-select: none;
}

.dish-main { display: flex; flex-direction: column; gap: 5px; min-width: 0; }

.dish-langs { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; }
@media (max-width: 420px) {
  .dish-langs { grid-template-columns: 1fr; }
  .dish { grid-template-columns: minmax(0, 1fr) 72px 32px; }
  .dish-n { display: none; }
}

.input {
  width: 100%;
  min-width: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 7px 8px;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink);
  outline: none;
  min-height: 34px;
  transition: border-color 0.12s, box-shadow 0.12s;
}
.input::placeholder { color: var(--faint); font-weight: 400; }
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }

.input-name { font-weight: 600; }
.input-alt {
  font-size: 11.5px;
  font-weight: 400;
  color: var(--ink-2);
  padding: 6px 8px;
  min-height: 30px;
  background: var(--surface-2);
}
.input-alt:focus { background: var(--surface); }

.input-price {
  font-family: var(--mono);
  font-size: 12.5px;
  font-weight: 600;
  text-align: right;
  font-variant-numeric: tabular-nums;
  padding: 7px 6px;
  -moz-appearance: textfield;
}
.input-price::-webkit-outer-spin-button,
.input-price::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

.dish-del {
  width: 32px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 4px;
  color: var(--faint);
  transition: color 0.12s, background 0.12s;
}
.dish-del svg { width: 15px; height: 15px; }
.dish-del:hover { color: var(--danger); background: var(--danger-soft); }

.add-row {
  display: flex;
  align-items: center;
  gap: 7px;
  width: 100%;
  padding: 9px 10px;
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  background: var(--surface);
  transition: background 0.12s;
  min-height: 38px;
}
.add-row svg { width: 14px; height: 14px; }
.add-row:hover { background: var(--accent-soft); }

.cat-empty {
  padding: 14px 10px;
  font-size: 11.5px;
  color: var(--faint);
  border-bottom: 1px solid var(--line-soft);
}

/* ---------------- preview column ---------------- */

.preview-col { position: sticky; top: 92px; }

.preview-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 2px 8px;
}
.preview-label {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--faint);
  margin-right: auto;
}
.preview-badge {
  font-size: 10.5px;
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid var(--accent-line);
  padding: 2px 8px;
  border-radius: 4px;
}

.paper-scroll {
  max-height: calc(100vh - 170px);
  overflow-y: auto;
  overflow-x: hidden;
  background: var(--sunken);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 14px;
}

/* ---- the printed sheet — unchanged from the working version ---- */

.paper {
  background: #ffffff;
  color: #000000;
  box-shadow: 0 1px 2px rgba(0,0,0,0.1), 0 12px 32px -10px rgba(0,0,0,0.28);
  padding: 10px;
  display: flex;
  gap: 8px;
  align-items: flex-start;
  /* Same stack the original resolved to via Tailwind's font-serif. */
  font-family: ui-serif, Georgia, Cambria, "Times New Roman", Times, serif;
}
.paper.is-single { display: block; }

.menu-instance { flex: 1; min-width: 0; border: 2px solid #000; }
.paper.is-single .menu-instance { width: 100%; }

.menu-table { width: 100%; border-collapse: collapse; table-layout: fixed; }

/* Row metrics mirror the original build: cells were Tailwind text-lg / text-2xl,
   whose line-height (1.75rem / 2rem) survived the print font-size override and
   gave the sheet its open, airy rows. Reproduced here as ratios on screen and
   as the same absolute values in print. */
.menu-table th {
  background: #e5e7eb;
  border: 1px solid #000;
  text-align: center;
  font-weight: 700;
  padding: 4px 3px;
  font-size: 10px;
  line-height: 1.556;
}
.menu-table td {
  border: 1px solid #000;
  text-align: center;
  font-weight: 700;
  text-transform: uppercase;
  padding: 3px;
  font-size: 9px;
  line-height: 1.556;
  word-break: break-word;
}
.menu-table td.price-cell { white-space: nowrap; width: 35%; font-variant-numeric: tabular-nums; }
.menu-table td.name-cell { width: 65%; }

.paper.is-single .menu-table th { font-size: 13px; padding: 6px 4px; line-height: 1.333; }
.paper.is-single .menu-table td { font-size: 12px; padding: 5px; line-height: 1.333; }

.paper-empty {
  text-align: center;
  padding: 50px 20px;
  color: #9ca3af;
  font-family: var(--sans);
  font-size: 12px;
}

/* ---------------- action bar ---------------- */

.actionbar {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 35;
  background: var(--surface);
  border-top: 1px solid var(--line);
  padding: 8px 12px;
  padding-bottom: max(8px, env(safe-area-inset-bottom));
}

.actionbar-inner {
  max-width: 1440px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 8px;
}

.check {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--ink-2);
  cursor: pointer;
  user-select: none;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  min-height: 34px;
  white-space: nowrap;
}
.check:hover { background: var(--sunken); }
.check input { width: 14px; height: 14px; accent-color: var(--accent); margin: 0; cursor: pointer; }
.check .short { display: none; }

.stat {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.stat b { color: var(--ink); font-weight: 600; }

.actionbar-spacer { margin-left: auto; }

.btn-print { padding: 8px 16px; min-height: 36px; font-size: 12.5px; }

@media (max-width: 560px) {
  .check .long { display: none; }
  .check .short { display: inline; }
  .stat { display: none; }
}

/* ---------------- modal ---------------- */

.overlay {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(15, 21, 25, 0.55);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0;
}
@media (min-width: 640px) { .overlay { align-items: center; padding: 20px; } }

.modal {
  width: 100%;
  max-width: 560px;
  max-height: 85vh;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg) var(--r-lg) 0 0;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: sheet 0.18s cubic-bezier(0.2, 0.9, 0.3, 1);
}
@media (min-width: 640px) { .modal { border-radius: var(--r-lg); } }
@keyframes sheet { from { transform: translateY(14px); opacity: 0; } }

.modal-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 10px;
  background: var(--head);
  border-bottom: 1px solid var(--line);
}
.modal-title {
  margin: 0;
  margin-right: auto;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--ink-2);
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}
.modal-title svg { width: 14px; height: 14px; color: var(--gold); flex: none; }

.icon-btn {
  width: 30px; height: 30px;
  display: grid; place-items: center;
  border-radius: 4px;
  color: var(--muted);
  flex: none;
}
.icon-btn svg { width: 15px; height: 15px; }
.icon-btn:hover { background: var(--sunken); color: var(--ink); }

.btn-clear {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 600;
  color: var(--danger);
  padding: 5px 9px;
  border-radius: 4px;
  flex: none;
}
.btn-clear svg { width: 12px; height: 12px; }
.btn-clear:hover { background: var(--danger-soft); }

.modal-body { overflow-y: auto; }

.fav {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 2px 10px;
  width: 100%;
  text-align: left;
  padding: 9px 12px;
  border-bottom: 1px solid var(--line-soft);
  transition: background 0.12s;
}
.fav:hover { background: var(--accent-soft); }
.fav-name { font-size: 13px; font-weight: 600; }
.fav-alt { font-size: 11px; color: var(--faint); grid-column: 1; }
.fav-price {
  font-family: var(--mono);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.fav-count {
  grid-column: 2;
  justify-self: end;
  font-family: var(--mono);
  font-size: 10px;
  color: var(--faint);
  font-variant-numeric: tabular-nums;
}

.modal-empty { padding: 40px 20px; text-align: center; color: var(--faint); }
.modal-empty strong { display: block; font-size: 13px; color: var(--muted); margin-bottom: 4px; }
.modal-empty span { font-size: 11.5px; }

/* ---------------- toasts ---------------- */

.toasts {
  position: fixed;
  bottom: 62px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 80;
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: center;
  pointer-events: none;
  width: min(420px, calc(100vw - 24px));
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  width: 100%;
  background: var(--ink);
  color: var(--bg);
  padding: 10px 12px;
  border-radius: var(--r);
  box-shadow: var(--shadow-lg);
  font-size: 12.5px;
  font-weight: 500;
  line-height: 1.4;
  animation: toast-in 0.18s ease-out;
}
.toast svg { width: 15px; height: 15px; flex: none; margin-top: 1px; }
.toast.is-ok svg { color: #6ee7b7; }
.toast.is-err svg { color: #fca5a5; }
.toast.is-out { animation: toast-out 0.18s ease-in forwards; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }
@keyframes toast-out { to { opacity: 0; transform: translateY(5px); } }

@media (prefers-color-scheme: dark) {
  .toast { background: var(--head); color: var(--ink); border: 1px solid var(--line); }
}

.spin { animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------------- mobile preview ---------------- */

.mobile-preview {
  position: fixed;
  inset: 0;
  z-index: 55;
  background: var(--sunken);
  overflow-y: auto;
  padding: 12px;
  padding-bottom: 80px;
}
.mobile-preview-bar {
  position: sticky;
  top: -12px;
  margin: -12px -12px 12px;
  padding: 8px 12px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 8px;
  z-index: 2;
}
.mobile-preview-mode {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--muted);
  margin-left: auto;
  text-align: right;
}

.only-narrow { display: none; }
@media (max-width: 1024px) { .only-narrow { display: inline-flex; } }

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* ============================================================
   PRINT — unchanged. A4, two-up or full page, compact option.
   ============================================================ */

@media print {
  @page { size: A4 portrait; margin: 0.05in; }

  html, body {
    background: #fff !important;
    margin: 0 !important;
    padding: 0 !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .topbar,
  .actionbar,
  .editor-col,
  .preview-head,
  .toasts,
  .overlay,
  .mobile-preview-bar,
  .no-print { display: none !important; }

  .main {
    display: block !important;
    max-width: none !important;
    padding: 0 !important;
    margin: 0 !important;
  }

  /* Only one sheet prints — see has-overlay-preview in the renderer. */
  .has-overlay-preview .preview-col { display: none !important; }

  .preview-col,
  .mobile-preview {
    display: block !important;
    position: static !important;
    inset: auto !important;
    top: auto !important;
    padding: 0 !important;
    margin: 0 !important;
    overflow: visible !important;
    background: #fff !important;
  }

  .paper-scroll {
    max-height: none !important;
    overflow: visible !important;
    padding: 0 !important;
    margin: 0 !important;
    border: none !important;
    border-radius: 0 !important;
    background: #fff !important;
  }

  .paper {
    box-shadow: none !important;
    padding: 0 !important;
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    display: flex !important;
    align-items: flex-start !important;
    gap: 0.2cm !important;
    background: #fff !important;
  }

  .paper.is-single { display: block !important; gap: 0 !important; }
  .paper.is-single .menu-instance { width: 100% !important; }

  .menu-instance { border: 2px solid #000 !important; }
  .menu-table th { background-color: #e5e7eb !important; }

  .menu-table tr { break-inside: avoid; page-break-inside: avoid; }

  /* Absolute line-heights, exactly as the original printed: 1.75rem for the
     two-up sheets, 2rem for the full-page one. They do not scale with the
     font-size overrides below — that is what keeps the rows open. */
  .menu-table th,
  .menu-table td { line-height: 1.75rem !important; }
  .paper.is-single .menu-table th,
  .paper.is-single .menu-table td { line-height: 2rem !important; }

  .menu-table th { font-size: 12pt !important; padding: 2px !important; }
  .menu-table td { font-size: 11pt !important; padding: 2px !important; }
  .paper.is-single .menu-table th { font-size: 16pt !important; padding: 6px !important; }
  .paper.is-single .menu-table td { font-size: 16pt !important; padding: 6px !important; }

  .paper.is-compact .menu-table th { font-size: 10pt !important; padding: 1px !important; }
  .paper.is-compact .menu-table td { font-size: 8pt !important; padding: 1px !important; }
  .paper.is-compact.is-single .menu-table th { font-size: 14pt !important; padding: 4px !important; }
  .paper.is-compact.is-single .menu-table td { font-size: 11pt !important; padding: 3px !important; }
}
