/* Cluck editor: plain and roomy, big tap targets, the site's yellow and black. White cards on a black page, like the site. */
:root {
  --yellow: #ffe11a; --ink: #111; --paper: #fff; --ground: #000; --ground-text: #c9c5b8; --line: #d9d5c7; --soft: #5f5b50;
  --red: #b3261e; --red-bg: #fde8e6; --amber-bg: #fff4c2; --green: #1d6b3a;
  --font: 'Archivo', system-ui, sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--ground); color: var(--ink); font: 400 16px/1.5 var(--font); }
[hidden] { display: none !important; }
h1, h2, h3, p { margin: 0; }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; box-shadow: 0 0 0 7px var(--yellow); } /* the yellow ring shows on the black page too */

.wordmark { font-weight: 900; font-variation-settings: 'wdth' 68; text-transform: uppercase; font-size: 32px; line-height: 1; }
.wordmark span { font-weight: 600; font-variation-settings: 'wdth' 90; text-transform: none; font-size: 18px; margin-left: 6px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 44px; padding: 0 18px; border: 2px solid var(--ink); background: none; color: var(--ink);
  font: 700 15px/1 var(--font); text-decoration: none; cursor: pointer; white-space: nowrap;
}
.btn:disabled { opacity: .4; cursor: default; }
.btn-solid { background: var(--yellow); }
.btn-ink { background: var(--ink); color: var(--yellow); }
.btn-ghost { background: var(--paper); }
.btn-small { min-height: 36px; padding: 0 12px; font-size: 14px; }
.btn-danger { color: var(--red); border-color: var(--red); background: var(--paper); }
.btn:not(:disabled):hover { filter: brightness(.94); }

/* Sign in */
.login { min-height: 100svh; display: grid; place-items: center; padding: 24px; }
.login-card { width: min(100%, 420px); background: var(--paper); padding: 32px; display: grid; gap: 18px; border: 2px solid var(--ink); }
.login-lede { color: var(--soft); }
.login-error { color: var(--red); font-weight: 700; }

/* Fields */
.field { display: grid; gap: 6px; }
.field-label { font-weight: 700; font-size: 15px; }
.field-hint { color: var(--soft); font-size: 14px; }
input[type='text'], input[type='password'], input[type='time'], textarea, select {
  width: 100%; min-height: 44px; padding: 10px 12px; border: 2px solid var(--line); background: var(--paper);
  font: 400 16px/1.4 var(--font); color: var(--ink); border-radius: 0;
}
textarea { resize: vertical; min-height: 64px; }
input:focus, textarea:focus, select:focus { border-color: var(--ink); outline: none; }
.price { position: relative; }
.price::before { content: '€'; position: absolute; left: 12px; top: 50%; transform: translateY(-50%); font-weight: 700; }
.price input { padding-left: 28px; font-weight: 700; font-variant-numeric: tabular-nums; }
.is-invalid { border-color: var(--red) !important; background: var(--red-bg) !important; }

/* Layout */
.top { position: sticky; top: 0; z-index: 5; display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 20px; background: var(--yellow); border-bottom: 2px solid var(--ink); }
.top-actions { display: flex; gap: 8px; }
.tabs { display: flex; gap: 4px; padding: 16px 20px 0; overflow-x: auto; max-width: 980px; margin: 0 auto; }
.tabs button { flex: none; min-height: 44px; padding: 0 16px; border: 2px solid var(--ink); border-bottom: 0; background: var(--paper); font: 700 15px var(--font); cursor: pointer; }
.tabs button[aria-selected='true'] { background: var(--yellow); color: var(--ink); }
.panels { max-width: 980px; margin: 0 auto; padding: 0 20px 140px; }
.panel { border-top: 2px solid var(--yellow); padding-top: 24px; display: grid; gap: 20px; }
.panel-intro, .versions > p { color: var(--ground-text); max-width: 70ch; }

.card { background: var(--paper); border: 2px solid var(--ink); padding: 20px; display: grid; gap: 16px; }
.card-head { display: flex; flex-wrap: wrap; gap: 12px; align-items: end; }
.card-head .field { flex: 1 1 260px; }
.card-title { font-weight: 900; font-variation-settings: 'wdth' 75; text-transform: uppercase; font-size: 24px; line-height: 1.1; }
.row-actions { display: flex; flex-wrap: wrap; gap: 8px; }

/* Dishes */
.dishes { display: grid; gap: 12px; }
.dish { border: 2px solid var(--line); padding: 14px; display: grid; gap: 12px; background: #fcfbf7; }
.dish.is-hidden { opacity: .6; background: #ece8dc; }
.dish-hidden-label { font-weight: 700; color: var(--soft); }
.dish-main { display: grid; grid-template-columns: 1fr 140px; gap: 12px; }
.ticks { border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.ticks legend { font-weight: 700; font-size: 15px; margin-bottom: 6px; padding: 0; }
.tick { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 10px; border: 2px solid var(--line); background: var(--paper); font-size: 14px; cursor: pointer; user-select: none; }
.tick input { width: 18px; height: 18px; margin: 0; accent-color: var(--ink); }
.tick:has(input:checked) { border-color: var(--ink); background: var(--yellow); font-weight: 700; }

/* Hours */
.hours { width: auto; border-collapse: collapse; }
.hours th, .hours td { padding: 6px 8px 6px 0; text-align: left; vertical-align: middle; }
.hours th { font-weight: 700; width: 110px; }
.hours td.closed { width: 110px; }
.hours input[type='time'] { max-width: 150px; }
.check { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; cursor: pointer; font-weight: 600; }
.check input { width: 20px; height: 20px; accent-color: var(--ink); }
.callout { padding: 12px 14px; background: var(--amber-bg); border-left: 4px solid var(--ink); }

/* History */
.versions { display: grid; gap: 8px; }
.version { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 14px; background: var(--paper); border: 2px solid var(--line); }

/* Save bar */
.savebar { position: fixed; inset: auto 0 0; z-index: 6; display: flex; align-items: center; gap: 10px; padding: 12px 20px; background: var(--paper); border-top: 2px solid var(--ink); }
.save-status { flex: 1; font-weight: 600; }
.save-status.is-dirty { color: var(--ink); }
.save-status.is-ok { color: var(--green); }
.save-status.is-error { color: var(--red); }

/* Confirm dialog */
.dialog { width: min(640px, calc(100% - 24px)); max-height: calc(100svh - 48px); border: 2px solid var(--ink); padding: 24px; }
.dialog::backdrop { background: rgb(0 0 0 / .5); }
.dialog h2 { font-size: 22px; margin-bottom: 12px; }
.dialog h3 { font-size: 16px; margin: 16px 0 6px; }
.dialog ul { margin: 0; padding-left: 20px; }
.dialog li { margin: 4px 0; }
.dialog .warn { margin-top: 16px; padding: 12px 14px; background: var(--amber-bg); border-left: 4px solid var(--ink); }
.dialog .errors { padding: 12px 14px; background: var(--red-bg); border-left: 4px solid var(--red); }
.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }

@media (max-width: 640px) {
  .top { padding: 10px 14px; }
  .top-actions .btn { min-height: 40px; padding: 0 10px; font-size: 13px; }
  .tabs { padding: 12px 14px 0; }
  .panels { padding: 0 14px 160px; }
  .card { padding: 14px; }
  .dish-main { grid-template-columns: 1fr 110px; }
  .savebar { flex-wrap: wrap; padding: 10px 14px; }
  .save-status { flex-basis: 100%; font-size: 14px; }
  .savebar .btn { flex: 1; }
  /* Each day becomes two lines: the day and "Closed", then its two times side by side. */
  .hours, .hours tbody { display: block; }
  .hours tr { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 8px; padding: 10px 0; border-top: 2px solid var(--line); }
  .hours th, .hours td { padding: 0; width: auto; }
  .hours td.closed { justify-self: end; }
  .hours input[type='time'] { max-width: none; }
}
