:root {
  --bg: #f4efe6;
  --ink: #1c1915;
  --muted: #6b6258;
  --paper: #fffaf3;
  --line: #ddd4c6;
  --accent: #2f4a38;
  --accent-2: #8b3a2b;
  --gold: #c4a35a;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  background: var(--bg);
  color: var(--ink);
  min-height: 100vh;
}
.top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 6vw;
  border-bottom: 1px solid var(--line);
  background: var(--paper);
}
.brand { font-weight: 700; letter-spacing: .04em; text-decoration: none; color: var(--ink); }
nav a { margin-left: 1.2rem; color: var(--muted); text-decoration: none; }
nav a:hover { color: var(--ink); }
main { padding: 2rem 6vw 4rem; }
footer { padding: 2rem 6vw; color: var(--muted); font-size: .9rem; }
.hero { max-width: 42rem; margin-bottom: 2.5rem; }
.hero h1 { font-size: clamp(2.2rem, 5vw, 4rem); margin: .2rem 0 1rem; }
.lead { font-size: 1.15rem; color: var(--muted); }
.eyebrow { text-transform: uppercase; letter-spacing: .16em; font-size: .75rem; color: var(--accent); }
.grid.two { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1.25rem; }
.card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 1.4rem 1.5rem;
  box-shadow: 0 8px 30px rgba(40, 30, 10, .04);
}
.card.compact { padding: 1rem 1.1rem; }
.card h2, .card h3 { margin-top: 0; }
.btn {
  display: inline-block;
  border: 1px solid var(--ink);
  background: transparent;
  color: var(--ink);
  padding: .28rem .7rem;
  border-radius: 7px;
  text-decoration: none;
  cursor: pointer;
  font: inherit;
  font-size: .9rem;
  line-height: 1.2;
}
.btn.primary { background: var(--accent); color: #f7f3ea; border-color: var(--accent); }
.btn.danger { background: var(--accent-2); color: white; border-color: var(--accent-2); }
.muted { color: var(--muted); }
.map { margin: 1rem 0; border-radius: 12px; overflow: hidden; border: 1px solid var(--line); }
.map iframe { width: 100%; height: 180px; border: 0; }
.narrow { max-width: 640px; margin: 0 auto; }
.form label { display: block; margin: .7rem 0; font-size: .95rem; }
.form input, .form select, .form textarea {
  width: 100%;
  margin-top: .35rem;
  padding: .65rem .7rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  font: inherit;
  background: #fff;
}
.row { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem; }
.alert { background: #f8e4de; border: 1px solid #e4b3a8; padding: .8rem 1rem; border-radius: 12px; }
.weather {
  background: #eef3ea;
  border: 1px solid #d3dfd0;
  padding: .8rem 1rem;
  border-radius: 12px;
  margin: .6rem 0 1rem;
  color: var(--accent);
}
.facts { display: grid; grid-template-columns: 8rem 1fr; gap: .4rem 1rem; }
.facts dt { color: var(--muted); }
.sheet { width: 100%; border-collapse: collapse; background: var(--paper); margin: 1rem 0 2rem; }
.sheet th, .sheet td { text-align: left; padding: .7rem .6rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.sheet.tight th, .sheet.tight td { padding: .35rem .4rem; }
.pill { display: inline-block; font-size: .75rem; padding: .15rem .5rem; border-radius: 999px; background: #ece4d6; margin: .1rem .15rem .1rem 0; }
.tag-box { border: 1px solid var(--line); border-radius: 12px; padding: .6rem 1rem 1rem; margin: 1rem 0; }
.tag-box legend { padding: 0 .35rem; }
.tag-group h2 { font-size: .95rem; margin: .8rem 0 .35rem; }
.tag-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .15rem .8rem; }
.tag-opt { display: flex; align-items: center; gap: .45rem; margin: .2rem 0; font-size: .92rem; }
.tag-opt input { width: auto; margin: 0; }
.need-box {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: .6rem 1rem .85rem;
  margin: .8rem 0;
}
.need-box legend { padding: 0 .35rem; }
.form .need-box .tag-opt {
  display: flex;
  align-items: center;
  gap: .55rem;
  margin: .4rem 0;
}
.form .need-box .tag-opt input[type="checkbox"] {
  width: 1.2rem;
  height: 1.2rem;
  margin: 0;
  padding: 0;
  flex: 0 0 auto;
  accent-color: var(--accent);
}
.need-line { margin: .35rem 0 0; font-weight: 600; color: var(--accent); }
.hours-row { margin: 0 0 1rem; padding-bottom: .4rem; border-bottom: 1px solid var(--line); }
.hours-row.is-closed .hours-slots { opacity: .45; }
.hours-slot {
  display: grid;
  grid-template-columns: 1fr 1fr 2.2rem;
  gap: .6rem;
  align-items: end;
  margin: .35rem 0;
}
.hours-slot .hours-del {
  width: 2.2rem;
  height: 2.2rem;
  padding: 0;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 8px;
  cursor: pointer;
  font-size: 1.2rem;
  line-height: 1;
  color: var(--muted);
}
.hours-add { margin: .35rem 0 .2rem; }
.st-cancelled { opacity: .5; }
.filter-check { display: inline-flex; align-items: center; gap: .35rem; color: var(--muted); font-size: .92rem; margin-left: .3rem; white-space: nowrap; }
.filter-check input { width: auto; margin: 0; }
main:has(#hide-cancelled:checked) .res-edit.st-cancelled,
main:has(#hide-completed:checked) .res-edit.st-completed { display: none; }
.st-seated td:first-child { box-shadow: inset 4px 0 0 var(--accent); }
.toolbar { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; flex-wrap: wrap; }
.subnav a { margin-right: 1rem; color: var(--muted); }
.filters { display: flex; gap: .5rem; align-items: center; margin: 1rem 0; flex-wrap: wrap; }
.filters input, .filters select { padding: .28rem .55rem; border-radius: 7px; border: 1px solid var(--line); font: inherit; font-size: .9rem; line-height: 1.2; }
.inline select { font: inherit; }
.hours { columns: 2; padding-left: 1.1rem; }
pre { background: #efe8dc; padding: .8rem; overflow: auto; border-radius: 8px; font-size: .85rem; }
.widget-body { background: transparent; padding: .5rem; }
.edit-grid { display: grid; grid-template-columns: 1.2fr 1.4fr auto; gap: .8rem 1.2rem; align-items: start; }
.res-edit { margin-bottom: .8rem; }
.table-picks-head { font-size: .9rem; margin-bottom: .45rem; }
.table-chips { display: flex; flex-wrap: wrap; gap: .4rem; }
.chip {
  display: inline-flex;
  align-items: baseline;
  gap: .45rem;
  margin: 0;
  padding: .45rem .7rem;
  border: 1px dashed var(--line);
  border-radius: 10px;
  background: #fff;
  cursor: pointer;
  user-select: none;
}
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.chip-nr { font-weight: 700; font-variant-numeric: tabular-nums; }
.chip-meta { font-size: .78rem; color: var(--muted); }
.chip:has(input:checked) {
  background: var(--accent);
  border-style: solid;
  border-color: var(--accent);
  color: #f7f3ea;
}
.chip:has(input:checked) .chip-meta { color: #d9e4d6; }
.chip.is-off { opacity: .4; }
.chip[hidden] { display: none !important; }
body.tablet .is-draft .chip.is-busy { display: none !important; }
.room-switch { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .65rem; }
.room-btn {
  font: inherit;
  font-size: .82rem;
  padding: .3rem .7rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  cursor: pointer;
  color: var(--ink);
}
.room-btn.is-on {
  background: var(--ink);
  color: #f7f3ea;
  border-color: var(--ink);
}
.storno-dialog {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.2rem;
  background: rgba(28, 25, 21, .45);
}
.storno-dialog[hidden] { display: none !important; }
.storno-box {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 1.2rem 1.3rem 1.1rem;
  width: min(28rem, 92vw);
  box-shadow: 0 16px 40px rgba(28, 25, 21, .18);
}
.storno-box h2 { margin: 0 0 .4rem; font-size: 1.2rem; }
.storno-actions { display: flex; justify-content: flex-end; gap: .6rem; margin-top: 1rem; }
@media (max-width: 900px) {
  .edit-grid { grid-template-columns: 1fr; }
}
.success h1 { color: var(--accent); }
body.tablet {
  height: 100dvh;
  overflow: hidden;
  font-family: Helvetica, "Helvetica Neue", Arial, sans-serif;
  font-size: 13pt;
  line-height: 1.25;
  color: #2c332c;
  background: #eef3ea;
}
body.tablet .top,
body.tablet footer { display: none; }
body.tablet main {
  padding: .4rem .55rem .35rem;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  gap: .35rem;
  overflow: hidden;
}
body.tablet .btn {
  font-family: inherit;
  font-size: 13pt;
  background: #d7e2d4;
  border-color: #b7c6b3;
  color: #2c332c;
}
body.tablet .btn.primary {
  background: #5d7260;
  border-color: #5d7260;
  color: #f4f7f3;
}
body.tablet .btn.danger {
  background: #a56b62;
  border-color: #a56b62;
  color: #fbf6f5;
}
body.tablet .filters input,
body.tablet .filters select {
  font-family: inherit;
  font-size: 13pt;
  background: #f7faf6;
  border-color: #c5d1c2;
}
.tablet-terminal {
  position: fixed;
  top: .35rem;
  right: .55rem;
  z-index: 6;
  font-size: 13pt;
  color: #5d7260;
  text-decoration: none;
  font-weight: 700;
}
.tablet-filters { padding-right: 6.2rem; margin: 0; flex-shrink: 0; }
.tablet-actions { display: flex; gap: .4rem; flex-shrink: 0; align-items: center; }
.tablet-flash {
  margin: 0;
  padding: .35rem .6rem;
  border-radius: 6px;
  flex-shrink: 0;
}
.tablet-flash.is-error { background: #f8e4de; border: 1px solid #e4b3a8; }
.tablet-flash.is-ok { background: #dce8d8; border: 1px solid #b7c6b3; }
.tablet-list {
  flex: 1;
  overflow: auto;
  border: 1px solid #c5d1c2;
  background: #eef3ea;
  border-radius: 8px;
}
.tablet-head,
.tablet-row {
  display: grid;
  grid-template-columns: 5.2rem minmax(7rem, 11rem) 4.4rem minmax(12.5rem, max-content) 8.2rem minmax(7rem, 1fr) 10.4rem;
  gap: .2rem .4rem;
  align-items: center;
  padding: .22rem .45rem;
  font-size: 13pt;
}
.tablet-head {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #d7e2d4;
  border-bottom: 1px solid #b7c6b3;
  font-weight: 700;
}
.tablet-head button,
.tablet-head span {
  font: inherit;
  font-weight: 700;
  text-align: left;
  background: none;
  border: 0;
  padding: 0;
  color: #2c332c;
}
.tablet-head button { cursor: pointer; }
.tablet-head button.is-on { color: #1d3a24; text-decoration: underline; }
.tablet-head button[data-dir="asc"]::after { content: " ▲"; font-size: .75em; }
.tablet-head button[data-dir="desc"]::after { content: " ▼"; font-size: .75em; }
.tablet-row {
  border-bottom: 1px solid #d3dfd0;
  background: #eef3ea;
}
.tablet-row:nth-child(even) { background: #e4ede1; }
.tablet-row.is-draft {
  background: #f4ecd0;
  padding: 0;
}
.t-time { font-variant-numeric: tabular-nums; font-weight: 700; }
.t-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.t-phone { white-space: nowrap; font-variant-numeric: tabular-nums; }
.t-call { color: inherit; text-decoration: none; }
.t-call:hover, .t-call:active { text-decoration: underline; }
.tablet-head .t-pax-head,
.t-pax { font-variant-numeric: tabular-nums; font-weight: 700; text-align: center; }
.t-status { margin: 0; }
.t-status select {
  font: inherit;
  font-size: 13pt;
  padding: .15rem .25rem;
  max-width: 100%;
  background: #f7faf6;
  border: 1px solid #c5d1c2;
}
.t-edit {
  grid-column: 6 / 8;
  display: grid;
  grid-template-columns: minmax(7rem, 1fr) 10.4rem;
  gap: .2rem .4rem;
  align-items: center;
  min-width: 0;
}
.t-draft {
  display: grid;
  grid-template-columns: 5.2rem minmax(7rem, 11rem) 4.4rem minmax(12.5rem, max-content) 8.2rem minmax(7rem, 1fr) 10.4rem;
  gap: .2rem .4rem;
  align-items: start;
  padding: .35rem .45rem;
}
.t-picks { display: contents; }
.t-picks .table-chips { min-width: 0; }
.t-room { display: flex; align-items: center; gap: .3rem; min-width: 0; }
.t-picks .room-select {
  width: 8.2rem;
  flex: 1 1 8.2rem;
  font: inherit;
  font-size: 13pt;
  padding: .15rem .25rem;
  background: #f7faf6;
  border: 1px solid #c5d1c2;
}
.t-who, .t-contact { display: flex; flex-direction: column; gap: .15rem; min-width: 0; }
.t-who input, .t-contact input, .t-pax input, .t-time-input {
  font: inherit;
  font-size: 12pt;
  padding: .12rem .3rem;
  background: #f7faf6;
  border: 1px solid #c5d1c2;
  width: 100%;
  min-width: 0;
}
.t-pax input[name="party_size"] { width: 3.6rem; text-align: center; }
.t-who { flex-direction: row; align-items: center; }
.t-draft-status { color: #5d7260; font-weight: 700; }
body.tablet .chip {
  background: #f7faf6;
  border: 1px solid #c5d1c2;
  border-style: solid;
  color: #2c332c;
}
body.tablet .chip:has(input:checked) {
  background: #111;
  border-color: #111;
  color: #fff;
}
body.tablet .chip.is-off {
  background: #eef3ea;
  border-color: #d3dfd0;
  color: #8a8a8a;
  opacity: 1;
}
.chip-pos { padding: .18rem .42rem; border-radius: 6px; }
.t-save { flex: 0 0 auto; }
.t-needs, .t-draft-needs {
  grid-column: 1 / -1;
  font-size: 12pt;
  color: #3d4a3e;
  font-weight: 600;
}
.t-draft-needs {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem 1rem;
  padding-top: .15rem;
}
@media (max-width: 700px) {
  .row, .hours { columns: 1; grid-template-columns: 1fr; }
  .sheet { font-size: .85rem; }
  main, .top, footer { padding-left: 1rem; padding-right: 1rem; }
}
