/* Tokens ------------------------------------------------------------- */
:root {
  --ink: #21261f;
  --ink-soft: #5c6157;
  --paper: #f6f5f1;
  --card: #ffffff;
  --line: #d9d7cd;
  --green: #2f5d44;
  --green-deep: #244835;
  --taken: #b3402e;
  --taken-bg: #f7e6e2;
  --sage: #e9f0e9;
  --error: #a33a2a;
  --radius: 10px;
  font-size: 16px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Instrument Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

/* Booking page -------------------------------------------------------- */
.book {
  max-width: 27rem;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 3rem;
}

.book-head { margin-bottom: 1.75rem; }
.book-head h1 {
  font-size: 1.75rem;
  font-weight: 600;
  letter-spacing: -0.015em;
  margin: 0;
}
.book-sub { margin: 0.2rem 0 0; color: var(--ink-soft); }

.field { margin-bottom: 1.5rem; }
.field-label {
  display: block;
  font-weight: 500;
  margin-bottom: 0.6rem;
}

/* Chips: party sizes and time slots */
.chips { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.chip {
  min-width: 2.9rem;
  min-height: 2.9rem;
  padding: 0 0.7rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  color: var(--ink);
  font: inherit;
  font-weight: 500;
  cursor: pointer;
}
.chip[aria-pressed="true"] {
  background: var(--green);
  border-color: var(--green);
  color: #fff;
}
.chip:disabled {
  color: var(--line);
  background: transparent;
  cursor: not-allowed;
  text-decoration: line-through;
}
/* One hour per row: 10:00-10:45 together, 11:00 starting the next line.
   Rows are left-aligned so a part-hour at the end of service reads as
   deliberate rather than stretched. */
.chips-times { display: block; }
.time-hour {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}
.time-hour:last-child { margin-bottom: 0; }
.time-hour .chip { flex: 0 0 auto; min-width: 4.2rem; }

/* Area tiles: the one loud element on the page */
.areas { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }
.area {
  display: grid;
  justify-items: start;
  gap: 0.35rem;
  padding: 0.9rem 0.9rem 0.8rem;
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  color: var(--ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.area-mark { width: 2rem; height: 2rem; color: var(--green); }
.area-name { font-weight: 600; }
.area-note { font-size: 0.85rem; color: var(--ink-soft); min-height: 1.2em; }
.area[aria-pressed="true"] {
  border-color: var(--green);
  background: var(--sage);
}
.area:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* Inputs */
.input {
  width: 100%;
  min-height: 2.9rem;
  padding: 0.55rem 0.8rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  font: inherit;
  color: var(--ink);
}
.input:focus-visible, .chip:focus-visible, .area:focus-visible,
.confirm:focus-visible, .again:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 2px;
}
.details .input { margin-bottom: 0.6rem; }

.hint { color: var(--ink-soft); margin: 0.6rem 0 0; }
.form-error { color: var(--error); margin: 0 0 1rem; }

.confirm, .again {
  width: 100%;
  min-height: 3.1rem;
  border: 0;
  border-radius: var(--radius);
  background: var(--green);
  color: #fff;
  font: inherit;
  font-weight: 600;
  font-size: 1.05rem;
  cursor: pointer;
}
.confirm:hover, .again:hover { background: var(--green-deep); }
.confirm:disabled { opacity: 0.6; cursor: wait; }

/* Confirmation */
.done h2 { font-size: 1.6rem; margin: 0 0 0.5rem; }
.done-detail { margin: 0 0 0.5rem; font-size: 1.1rem; }
.done-note { color: var(--ink-soft); margin: 0 0 1.5rem; }

@media (prefers-reduced-motion: no-preference) {
  .done:not([hidden]) { animation: rise 0.25s ease-out; }
  @keyframes rise {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: none; }
  }
}

/* Admin ---------------------------------------------------------------- */
.admin { max-width: 46rem; margin: 0 auto; padding: 1.5rem 1.25rem 3rem; }
.admin-top { display: flex; align-items: baseline; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.25rem; }
.admin-top h1 { font-size: 1.4rem; font-weight: 600; margin: 0; }
.admin-top nav { margin-left: auto; display: flex; gap: 0.9rem; }
.admin-top a, .daynav a { color: var(--green); font-weight: 500; text-decoration: none; }
.admin-top a:hover, .daynav a:hover { text-decoration: underline; }

.daynav { display: flex; align-items: center; gap: 0.9rem; margin-bottom: 1rem; }
.daynav h2 { font-size: 1.15rem; font-weight: 600; margin: 0; }

.tallies { display: flex; gap: 1.5rem; color: var(--ink-soft); margin-bottom: 1rem; }
.tallies strong { color: var(--ink); }

table.list { width: 100%; border-collapse: collapse; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.list th, .list td { text-align: left; padding: 0.6rem 0.7rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.list th { font-weight: 600; background: var(--sage); }
.list tr:last-child td { border-bottom: 0; }
.list .cancelled { color: var(--ink-soft); text-decoration: line-through; }
.list form { display: inline; }
.linkbtn { border: 0; background: none; color: var(--error); font: inherit; cursor: pointer; padding: 0; }
.linkbtn:hover { text-decoration: underline; }

.settings label { display: block; font-weight: 500; margin: 1rem 0 0.3rem; }
.settings .pair { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1rem; }
.settings textarea { min-height: 9rem; resize: vertical; }
.settings .save { margin-top: 1.5rem; }
.notice { background: var(--sage); border-radius: var(--radius); padding: 0.6rem 0.9rem; margin-bottom: 1rem; }
.notice.err { background: #f6e4e0; color: var(--error); }

.login { max-width: 20rem; margin: 15vh auto 0; padding: 0 1.25rem; }
.login h1 { font-size: 1.3rem; }
.login .input { margin-bottom: 0.8rem; }

@media (max-width: 40rem) {
  .list .hide-sm { display: none; }
}

/* Forecast note on the Outside tile (v1.1) */
.area-weather {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--green);
}
.area-weather.wet { color: #8a6a1f; }
.credit {
  margin: 2rem 0 0;
  font-size: 0.8rem;
  color: var(--ink-soft);
}
.credit a { color: var(--ink-soft); }

/* Floor plan editor (v1.2) */
.settings textarea.floor {
  min-height: 22rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.8rem;
  line-height: 1.5;
  white-space: pre;
}

/* Floor map (v1.3) */
.floorwrap {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.6rem;
  overflow: hidden;
}
#floorMap { width: 100%; height: auto; display: block; }

.fm-divider {
  stroke: var(--line);
  stroke-width: 3;
  stroke-dasharray: 10 10;
}
.fm-area {
  fill: var(--ink-soft);
  font-family: inherit;
  font-size: 26px;
  text-anchor: middle;
}
.fm-top {
  fill: var(--card);
  stroke: var(--ink-soft);
  stroke-width: 3;
}
.fm-chair {
  fill: var(--card);
  stroke: var(--ink-soft);
  stroke-width: 2.5;
}

/* Taken by someone else. */
.fm-table.is-booked .fm-top {
  fill: var(--taken-bg);
  stroke: var(--taken);
}
.fm-chair.is-booked {
  fill: var(--taken);
  stroke: var(--taken);
}

/* Where this guest's own party would sit. */
.fm-table.is-preview .fm-top {
  fill: var(--sage);
  stroke: var(--green);
  stroke-width: 4;
}
.fm-chair.is-preview {
  fill: var(--green);
  stroke: var(--green);
}

.legend {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0.6rem 0 0;
  font-size: 0.85rem;
  color: var(--ink-soft);
}
.legend .key {
  width: 0.85rem;
  height: 0.85rem;
  border-radius: 3px;
  border: 2px solid var(--ink-soft);
  background: var(--card);
  display: inline-block;
}
.legend .key-booked {
  background: var(--taken-bg);
  border-color: var(--taken);
  margin-left: 0.9rem;
}
.legend .key-preview {
  background: var(--sage);
  border-color: var(--green);
  margin-left: 0.9rem;
}

/* Time stamp drawn in the clear middle of the floor map */
.fm-time {
  fill: var(--ink);
  font-family: inherit;
  font-size: 46px;
  font-weight: 600;
  text-anchor: middle;
}
.fm-day {
  fill: var(--ink-soft);
  font-family: inherit;
  font-size: 24px;
  text-anchor: middle;
}

/* Scheduled-email settings */
.settings-section {
  font-size: 1.05rem;
  font-weight: 600;
  margin: 2rem 0 0.75rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}
.checkbox-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 500;
  margin: 1rem 0 0.3rem;
}
.checkbox-row input { width: 1.1rem; height: 1.1rem; }
.settings textarea.template-editor {
  min-height: 8rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.85rem;
  line-height: 1.5;
}

/* Honeypot: off-screen rather than display:none, since some automated
   submitters skip hidden fields but not positioned ones. */
.hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}
