/* Region calendar and room booking pages. Loaded only on those pages, after site.css.
   Same look as the approved prototype: site colors and fonts, square buttons, week bands. */
:root {
  --surface: #fffdf8; --sunk: var(--sand); --soft: #8a8175; --field: #fff;
  --accent: var(--gold); --accent-text: #8a6417; --accent-soft: #f4efe4;
  --east: #2f5d6a; --east-soft: #e3ebea; --west: #a1502c; --west-soft: #f5e5db; --both: #5d6b2c; --both-soft: #eaecd8;
  --warn: #8a5a0b; --warn-soft: #f6ebcf; --bad: #a3321f; --bad-soft: #f5e0d9; --ok: #3f6b35; --ok-soft: #e4eddb;
}

.app-head { padding-bottom: clamp(24px, 3.5vw, 44px); border-bottom: 0; }
.app-head h1 { font-size: clamp(36px, 4.6vw, 56px); margin-bottom: 0; }
.app-head .lead { font-size: 18px; max-width: 62ch; margin-top: 1rem; }
.subnav { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--paper); }
.subnav-in { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 24px; }
.tabs { display: flex; gap: 24px; overflow-x: auto; scrollbar-width: thin; min-width: 0; }
.tab { padding: 15px 0 14px; color: var(--muted); font-size: 14.5px; font-weight: 500; white-space: nowrap; text-decoration: none; }
.tab[aria-current="page"] { color: var(--ink); box-shadow: inset 0 -2px 0 var(--accent); }
.tab:hover { color: var(--accent-text); }
.who { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; font-size: .88rem; padding: 8px 0; }

.app { padding-top: var(--sp-40); padding-bottom: var(--sp-60); display: flex; flex-direction: column; gap: 22px; }
.ax { font-size: 16px; }
.who.ax { font-size: .88rem; }
.ax [hidden], .modal[hidden], .toast[hidden], .submenu [hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.ax h4 { font-family: var(--sans); font-size: .82rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--accent-text); margin: 8px 0 0; }
.ax fieldset { border: 0; padding: 0; margin: 0; }
.ax fieldset legend { font-size: 14px; font-weight: 500; margin-bottom: 7px; padding: 0; }
.empty { color: var(--muted); font-style: italic; font-size: .92rem; padding: 6px 0; }
.ax h2 { font-size: clamp(26px, 2.8vw, 34px); margin: 0; }
.ax h3 { font-size: 1.4rem; line-height: 1.25; margin: 0; }
.ax p { margin: 0; }
.ax .small { font-size: .9rem; }
.ax .num { font-variant-numeric: tabular-nums; }
.ax button, .ax input, .ax select, .ax textarea { font: inherit; color: inherit; }
.ax button { cursor: pointer; }
.ax :focus-visible { outline: 2px solid #b88a2e; outline-offset: 3px; }

/* buttons, as on the prototype */
.ax .btn { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--ink); background: transparent; color: var(--ink); border-radius: 2px; padding: 9px 16px; font-size: 14.5px; font-weight: 500; line-height: 1.2; text-decoration: none; }
.ax .btn:hover { border-color: var(--accent); color: var(--accent-text); background: transparent; }
.ax .btn.primary { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.ax .btn.primary:hover { background: var(--accent); border-color: var(--accent); color: #fff; }
.ax .btn.danger { color: var(--bad); border-color: var(--bad); }
.ax .btn.ghost { border-color: transparent; background: none; padding-inline: 6px; }
.ax .btn[disabled] { opacity: .45; cursor: not-allowed; }
.ax .btn.primary[disabled]:hover { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.ax .btn:not(.primary)[disabled]:hover { border-color: var(--ink); color: var(--ink); }
.ax .btn.ghost[disabled]:hover { border-color: transparent; }
.who .btn { padding: 7px 13px; font-size: 13.5px; }
.seg { display: inline-flex; border: 1px solid var(--stone); overflow: hidden; background: var(--surface); }
.seg button { border: 0; background: none; padding: 7px 14px; font-weight: 500; font-size: .92rem; color: var(--muted); }
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.row { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: center; }
.spread { justify-content: space-between; }
.panel { background: var(--sunk); padding: clamp(18px, 2.6vw, 30px); }
.stack { display: flex; flex-direction: column; gap: 12px; }
.a-cols { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 24px 40px; align-items: start; }
@media (max-width: 860px) { .a-cols { grid-template-columns: minmax(0, 1fr); } }

.ax .pill, .who .pill, .tab .pill { display: inline-flex; align-items: center; gap: 4px; border-radius: 999px; padding: 1px 8px; font-size: .74rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; white-space: nowrap; border: 0; cursor: default; }
.ax .pill:hover { background: var(--rs, var(--paper)); }
.r-E { --rc: var(--east); --rs: var(--east-soft); } .r-W { --rc: var(--west); --rs: var(--west-soft); } .r-B { --rc: var(--both); --rs: var(--both-soft); }
.pill.reg { background: var(--rs); color: var(--rc); }
.pill.st-pending { background: var(--warn-soft); color: var(--warn); }
.pill.st-approved { background: var(--ok-soft); color: var(--ok); }
.pill.st-declined, .pill.st-cancelled { background: var(--bad-soft); color: var(--bad); }
.pill.st-changed { background: var(--accent-soft); color: var(--accent-text); }
.pill.plain { background: var(--paper); color: var(--muted); }
.tab .pill { margin-left: 4px; }

/* calendar */
.cal-head { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px 20px; align-items: end; }
.cal-title { font-family: var(--serif); font-weight: 400; font-size: clamp(1.7rem, 3vw, 2.4rem); letter-spacing: -.01em; line-height: 1.1; }
.cal-theme { font-size: 12.5px; text-transform: uppercase; letter-spacing: .14em; color: var(--accent-text); margin-top: 6px; }
.scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.month { min-width: 860px; border: 1px solid var(--line); background: var(--surface); }
.dows, .week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.dows div { font-weight: 600; text-transform: uppercase; letter-spacing: .08em; font-size: .78rem; padding: 7px 8px; background: var(--sunk); color: var(--muted); }
.band { background: var(--ink); color: var(--paper); font-weight: 600; letter-spacing: .08em; text-transform: uppercase; font-size: .78rem; padding: 4px 10px; }
.day { min-height: 112px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 6px 6px 8px; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.day:nth-child(7n) { border-right: 0; }
.day.out { background: var(--paper); }
.day.today { box-shadow: inset 0 0 0 2px var(--accent); }
.dn { font-family: var(--serif); font-size: 1.25rem; line-height: 1; }
.ev { font-size: .8rem; line-height: 1.3; padding: 2px 4px 2px 6px; border-left: 3px solid var(--rc); background: var(--rs); overflow-wrap: anywhere; }
.ev .t { font-weight: 700; font-variant-numeric: tabular-nums; }
.ev .rm { display: inline-block; font-weight: 600; color: var(--rc); }
.ev .host { display: block; color: var(--muted); }
.ev.obs { background: none; border-left-color: var(--line); font-style: italic; color: var(--muted); }
.ev.closed { background: var(--bad-soft); border-left-color: var(--bad); color: var(--bad); font-weight: 700; text-transform: uppercase; letter-spacing: .03em; }
.ev.note { background: none; border-left-color: var(--rc); font-weight: 600; }
.tagb { font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--both); }
.legend { display: flex; flex-wrap: wrap; gap: 8px 16px; font-size: .85rem; color: var(--muted); }
.legend span::before { content: ""; display: inline-block; width: 10px; height: 10px; margin-right: 6px; vertical-align: -1px; background: var(--rc); }
.list { display: flex; flex-direction: column; gap: 2px; }
.lday { display: grid; grid-template-columns: 76px minmax(0, 1fr); gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.lday .d { font-weight: 600; text-transform: uppercase; font-size: .85rem; letter-spacing: .06em; line-height: 1.1; color: var(--muted); }
.lday .d b { display: block; font-family: var(--serif); font-weight: 400; font-size: 1.9rem; letter-spacing: 0; color: var(--ink); }
.lband { margin-top: 12px; }
.lev { display: flex; flex-direction: column; gap: 5px; }
.monthnav { display: flex; align-items: center; gap: 10px; }
.monthnav .mname { font-family: var(--serif); font-weight: 400; font-size: 1.3rem; min-width: 9em; text-align: center; }
.monthnav .btn { white-space: nowrap; }
.notice { background: var(--accent-soft); border-left: 3px solid var(--accent); padding: 11px 15px; font-size: .95rem; }

/* forms */
.form { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px 14px; }
.form .wide { grid-column: span 2; }
.form .full { grid-column: 1 / -1; }
@media (max-width: 700px) { .form { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } .form .wide { grid-column: 1 / -1; } }
label.f { display: flex; flex-direction: column; gap: 7px; font-size: 14px; font-weight: 500; color: var(--ink); min-width: 0; }
label.f input, label.f select, label.f textarea { border: 1px solid var(--stone); background: var(--field); border-radius: 0; padding: 11px 13px; font-weight: 400; color: var(--ink); font-size: 15px; min-width: 0; width: 100%; }
label.f textarea { min-height: 84px; resize: vertical; }
label.f input:focus, label.f select:focus, label.f textarea:focus { border-color: var(--accent); outline: 1px solid var(--accent); }
label.f input[type="date"], label.f input[type="time"] { min-height: 46px; }
label.f .hint { font-size: 12.5px; font-weight: 400; color: var(--muted); }
label.f.inline { flex-direction: row; align-items: center; gap: 8px; white-space: nowrap; }
label.f.inline select { width: auto; padding: 8px 10px; }
label.chk { display: flex; gap: 8px; align-items: center; font-size: 14px; font-weight: 500; }
@media (max-width: 600px) { label.f.inline { width: 100%; } label.f.inline select { flex: 1; } }
.flag { padding: 9px 13px; font-size: .92rem; }
.flag.warn { background: var(--warn-soft); color: var(--warn); }
.flag.ok { background: var(--ok-soft); color: var(--ok); }
.flag.bad { background: var(--bad-soft); color: var(--bad); }
.flag.info { background: var(--accent-soft); color: var(--ink); }
.rooms { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 14px; }
.rcard { border: 1px solid var(--line); background: var(--surface); overflow: hidden; display: flex; flex-direction: column; text-align: left; padding: 0; min-width: 0; }
.rcard[aria-pressed="true"] { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent); }
.rcard.taken { opacity: .55; cursor: not-allowed; }
.photo { aspect-ratio: 16 / 9; width: 100%; max-width: 100%; background: repeating-linear-gradient(135deg, transparent 0 10px, rgba(33, 30, 26, .05) 10px 11px), linear-gradient(160deg, var(--accent-soft), var(--sunk)); display: flex; align-items: center; justify-content: center; flex-direction: column; color: var(--muted); font-size: .72rem; text-transform: uppercase; letter-spacing: .1em; font-weight: 600; }
.photo b { font-family: var(--serif); font-weight: 400; font-size: 2rem; color: var(--accent-text); letter-spacing: 0; }
.photo.has-img { background: var(--sunk); }
.photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.rbody { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 4px; }
.rname { font-family: var(--serif); font-size: 1.2rem; line-height: 1.2; }
.rstat { font-size: .86rem; }
.rstat.ok { color: var(--ok); } .rstat.bad { color: var(--bad); } .rstat.warn { color: var(--warn); }

/* approvals */
.ax .req { border-top: 1px solid var(--ink); padding: 16px 0 4px; display: flex; flex-direction: column; gap: 10px; }
.ax .req h3 { font-size: 1.35rem; }
.kv { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 3px 12px; font-size: .93rem; margin: 0; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; }
.was { text-decoration: line-through; color: var(--soft); }
.hist { border-left: 3px solid var(--accent); background: var(--accent-soft); padding: 8px 12px; font-size: .9rem; display: grid; gap: 2px; }
.sect { margin-top: 12px; }
.mail { border: 1px solid var(--line); background: var(--surface); font-size: .88rem; overflow: hidden; flex: none; }
.mail-h { padding: 9px 12px; background: var(--sunk); display: grid; gap: 1px; }
.mail-h b { font-size: .93rem; }
.mail-b { padding: 10px 12px; display: grid; gap: 6px; }
.outbox { display: flex; flex-direction: column; gap: 10px; max-height: 900px; overflow-y: auto; padding-right: 2px; }

/* room grid */
.grid { border-collapse: separate; border-spacing: 0; min-width: 980px; width: 100%; background: var(--surface); border: 1px solid var(--line); }
.grid th, .grid td { border-bottom: 1px solid var(--line); border-right: 1px solid var(--line); padding: 6px; vertical-align: top; text-align: left; }
.grid thead th { background: var(--sunk); font-weight: 600; letter-spacing: .08em; text-transform: uppercase; font-size: .76rem; }
.grid thead th.today { box-shadow: inset 0 -2px 0 var(--accent); }
.grid tbody th { width: 150px; font-family: var(--serif); font-weight: 400; font-size: 1.05rem; line-height: 1.2; }
.grid tbody th span { display: block; font-family: var(--sans); color: var(--muted); font-size: .78rem; margin-top: 2px; }
.grid td.closed { background: var(--bad-soft); }
.chip { display: block; width: 100%; text-align: left; font-size: .76rem; line-height: 1.3; padding: 3px 5px; margin-bottom: 3px; background: var(--rs); border: 0; border-left: 3px solid var(--rc); color: var(--ink); }
.chip.pend { background: none; border: 1px dashed var(--rc); border-left-width: 3px; }
.chip b { font-variant-numeric: tabular-nums; }
button.chip:hover { box-shadow: inset 0 0 0 1px var(--rc); }
.chip .chg { display: block; font-weight: 600; color: var(--accent-text); font-size: .7rem; text-transform: uppercase; letter-spacing: .04em; }

/* people and editor tables */
.ptable { width: 100%; border-collapse: collapse; font-size: .93rem; }
.ptable th, .ptable td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--stone); vertical-align: top; }
.ptable th { text-transform: uppercase; letter-spacing: .08em; font-size: .76rem; color: var(--muted); font-weight: 600; }
.ptable td.acts { white-space: nowrap; text-align: right; }
.ptable tr.past td { color: var(--soft); }
.addr { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .9rem; background: var(--paper); padding: 4px 8px; user-select: all; overflow-wrap: anywhere; }
.support { border-left: 3px solid var(--accent); }

/* printable sheet */
.sheet-wrap { background: var(--sunk); padding: 16px; }
.sheet { min-width: 960px; min-height: 742px; background: #fff; color: #111; border: 1px solid #c9c9c9; padding: 16px 18px; display: flex; flex-direction: column; gap: 4px; font-family: var(--sans); }
.sh-head { display: grid; grid-template-columns: 150px minmax(0, 1fr) 200px 200px; gap: 10px; align-items: stretch; }
.sh-slog { font-weight: 700; text-transform: uppercase; font-size: .85rem; line-height: 1.15; display: flex; flex-direction: column; justify-content: space-between; gap: 6px; }
.sh-slog .big { font-size: 1rem; color: #8a6417; }
.sh-title { text-align: center; display: flex; flex-direction: column; justify-content: center; }
.sh-title b { font-family: var(--serif); font-weight: 400; font-size: 1.8rem; letter-spacing: .02em; line-height: 1.05; }
.sh-title span { font-size: .95rem; letter-spacing: .14em; text-transform: uppercase; color: #8a6417; font-weight: 600; }
.sh-box { border: 1.5px solid #222; padding: 4px 7px; font-size: .66rem; line-height: 1.35; font-variant-numeric: tabular-nums; }
.sh-box b { display: block; font-size: .72rem; }
.sh-grid { flex: 1 0 auto; display: flex; flex-direction: column; border: 1.5px solid #222; }
.sh-dows, .sh-week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.sh-dows div { background: #211e1a; color: #fff; font-weight: 600; text-align: center; font-size: .8rem; letter-spacing: .08em; padding: 2px 0; }
.sh-band { background: #efe9dd; color: #111; font-weight: 700; font-size: .76rem; letter-spacing: .05em; text-transform: uppercase; padding: 1px 6px; border-top: 1px solid #222; border-bottom: 1px solid #222; }
.sh-week { flex: 1 0 auto; }
.sh-cell { border-right: 1px solid #444; padding: 2px 4px; font-size: .62rem; line-height: 1.25; min-height: 64px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.sh-cell:last-child { border-right: 0; }
.sh-cell .n { font-weight: 700; font-size: .85rem; line-height: 1; }
.sh-cell .o { font-style: italic; color: #444; }
.sh-cell .c { font-weight: 700; color: #a3321f; text-transform: uppercase; }
.sh-cell .rm { font-weight: 700; color: #2f5d6a; }
.sh-foot { text-align: center; font-size: .68rem; font-weight: 600; }
.sheet.measure { padding: 0; border: 0; min-width: 0; min-height: 0; }
@media print {
  @page { size: letter landscape; margin: .3in; }
  body { background: #fff; }
  body > :not(main), main > :not(#view), #view > :not(.sheet-wrap), .skip-link { display: none !important; }
  #view { padding: 0; margin: 0; max-width: none; }
  .sheet-wrap { padding: 0; background: none; overflow: visible; }
  .sheet { border: 0; padding: 0; min-width: 0; width: 100%; }
  .sheet, .sheet * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* room sign page */
.phone { max-width: 440px; width: 100%; margin: 0 auto; border: 1px solid var(--line); background: var(--surface); overflow: hidden; }
.ph-top { padding: 16px 18px 12px; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 2px; }
.ph-top .site { font-size: .72rem; color: var(--accent-text); text-transform: uppercase; letter-spacing: .14em; }
.ph-body { padding: 14px 18px 20px; display: flex; flex-direction: column; gap: 14px; }
.slot { display: grid; grid-template-columns: 86px minmax(0, 1fr); gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: .92rem; }
.slot .tm { font-weight: 700; font-variant-numeric: tabular-nums; }

/* dialog + toast */
.modal { position: fixed; inset: 0; background: rgba(0, 0, 0, .45); display: flex; align-items: center; justify-content: center; padding: 16px; z-index: 50; }
.dialog { background: var(--paper); border-top: 2px solid #b88a2e; max-width: 460px; width: 100%; padding: 24px; display: flex; flex-direction: column; gap: 14px; max-height: 100%; overflow-y: auto; box-shadow: 0 18px 40px -18px rgba(34, 28, 20, .45); }
.dialog.wide { max-width: 640px; }
.dialog .form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.dialog .eyebrow { margin: 0; }
.code { font-family: var(--serif); font-size: 1.8rem; letter-spacing: .3em; text-align: center; }
.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: 18px; background: var(--ink); color: var(--paper); padding: 11px 18px; border-radius: 2px; font-weight: 500; font-size: .92rem; z-index: 60; max-width: calc(100% - 32px); box-shadow: 0 6px 20px rgba(0, 0, 0, .25); }
@media (prefers-reduced-motion: no-preference) { .toast { animation: pop .2s ease-out; } @keyframes pop { from { transform: translate(-50%, 8px); opacity: .4; } } }

@media (max-width: 600px) {
  .cal-head { grid-template-columns: minmax(0, 1fr); }
  .monthnav { width: 100%; justify-content: space-between; }
  .monthnav .mname { min-width: 0; font-size: 1.15rem; }
  .monthnav .btn { padding: 8px 10px; }
  .kv { grid-template-columns: 96px minmax(0, 1fr); }
}

a.rcard { text-decoration: none; color: inherit; }
a.rcard:hover { border-color: var(--accent); color: inherit; }
a.rcard:hover .rname { color: var(--accent-text); }
@media (max-width: 600px) {
  .rooms { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .rbody { padding: 10px; }
  .rname { font-size: 1.05rem; }
  .photo b { font-size: 1.5rem; }
}
