/* Shared styles for every layout: colours, fonts, page frame, tab bar, cards, buttons and form fields. */
:root {
  --bg: #F7F2E7; --surface: #FFFDF8; --raised: #EFE0BB; --ink: #1A202C; --muted: #5A6170;
  --line: #E2D6BC; --brand: #7B5330; --brand-ink: #FFFFFF; --tan: #976A3E;
  --g1: #1D6FB8; --g2: #D4570F; --g3: #2E8B57; --g4: #8E44AD; --g5: #B8860B; --g6: #C2185B;
  --new: #9A6400; --new-bg: #FBEBC8; --good: #1F7A4D; --good-bg: #DDF1E5; --stop: #A23B2A; --stop-bg: #F8E0DB;
  --display: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --body: Jost, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --gutter-l: max(16px, env(safe-area-inset-left, 0px));
  --gutter-r: max(16px, env(safe-area-inset-right, 0px));
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #1B1712; --surface: #26201A; --raised: #3A2F23; --ink: #F5EEDF; --muted: #B9AF9E;
    --line: #41362A; --brand: #DEB97E; --brand-ink: #24190E; --tan: #DEB97E;
    --g1: #6DB3F2; --g2: #FF9A5C; --g3: #6FD19B; --g4: #C79BE8; --g5: #E8C15A; --g6: #F48FB1;
    --new: #F2C568; --new-bg: #40321A; --good: #7FD6A5; --good-bg: #1E3A2B; --stop: #F0A295; --stop-bg: #472620;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #1B1712; --surface: #26201A; --raised: #3A2F23; --ink: #F5EEDF; --muted: #B9AF9E;
  --line: #41362A; --brand: #DEB97E; --brand-ink: #24190E; --tan: #DEB97E;
  --g1: #6DB3F2; --g2: #FF9A5C; --g3: #6FD19B; --g4: #C79BE8; --g5: #E8C15A; --g6: #F48FB1;
  --new: #F2C568; --new-bg: #40321A; --good: #7FD6A5; --good-bg: #1E3A2B; --stop: #F0A295; --stop-bg: #472620;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 16px/1.45 var(--body); -webkit-text-size-adjust: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--tan); }
h1, h2 { font-family: var(--display); font-weight: 600; line-height: 1.1; margin: 0; text-wrap: balance; }
h1 { font-size: 2rem; }
h2 { font-size: 1.4rem; }
:focus-visible { outline: 2px solid var(--tan); outline-offset: 2px; }

#app { max-width: 560px; margin: 0 auto; min-height: 100%; padding-bottom: calc(76px + env(safe-area-inset-bottom, 0px)); }
.demo-note { background: var(--raised); font-size: .85rem; padding-block: 6px; padding-left: var(--gutter-l); padding-right: var(--gutter-r); }
.view { display: grid; gap: 16px; padding-block: 18px 24px; padding-left: var(--gutter-l); padding-right: var(--gutter-r); }
.view > * { min-width: 0; }
.view-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.count { color: var(--muted); }
.stack { display: grid; gap: 10px; }
.section-label { font-size: .78rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 500; }

.tabs { position: fixed; inset: auto 0 0 0; z-index: 5; background: var(--surface); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom, 0px); padding-left: env(safe-area-inset-left, 0px); padding-right: env(safe-area-inset-right, 0px); }
.tabs-inner { display: grid; grid-template-columns: repeat(4, 1fr); max-width: 560px; margin: 0 auto; }
.tab { border: 0; background: none; padding: 14px 4px; font-size: .9rem; color: var(--muted); position: relative; min-height: 52px; cursor: pointer; }
.tab[aria-current="page"] { color: var(--brand); font-weight: 600; box-shadow: inset 0 3px 0 var(--brand); }
.badge { display: inline-block; min-width: 20px; padding: 0 6px; border-radius: 10px; background: var(--brand); color: var(--brand-ink); font-size: .75rem; font-weight: 600; margin-left: 4px; }

.tab { display: flex; align-items: center; justify-content: center; text-decoration: none; }
.tab-label { display: inline; }

.card { display: grid; gap: 4px; width: 100%; text-align: left; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; cursor: pointer; }
.card.tentative { border-style: dashed; }
.card-top { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }
.card-title { font-weight: 600; min-width: 0; }
.card-meta { color: var(--muted); font-size: .92rem; }
.pill { display: inline-block; font-size: .78rem; font-weight: 500; padding: 1px 8px; border-radius: 10px; white-space: nowrap; background: var(--raised); }
.pill.new { color: var(--new); background: var(--new-bg); }
.pill.confirmed { color: var(--good); background: var(--good-bg); }
.pill.declined, .pill.cancelled { color: var(--stop); background: var(--stop-bg); }
.empty { color: var(--muted); padding: 22px 0; text-align: center; }
a.card { color: inherit; text-decoration: none; }

.two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.agenda-time { font-variant-numeric: tabular-nums; font-weight: 600; }
.contact { display: flex; gap: 8px; flex-wrap: wrap; }
.btn { border: 1px solid var(--brand); background: var(--brand); color: var(--brand-ink); padding: 11px 14px; border-radius: 6px; font-weight: 500; min-height: 46px; cursor: pointer; text-align: center; text-decoration: none; }
.btn.plain { background: none; color: var(--brand); }
.btn.quiet { background: none; color: var(--stop); border-color: var(--line); }
.btn.small { min-height: 38px; padding: 6px 12px; font-size: .92rem; }
a.btn { display: inline-flex; align-items: center; justify-content: center; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

form.fields { display: grid; gap: 14px; }
.field { display: grid; gap: 4px; min-width: 0; }
.field > label, .field > .label { font-weight: 500; font-size: .95rem; }
input, select, textarea { width: 100%; min-height: 46px; padding: 9px 11px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); }
textarea { min-height: 80px; resize: vertical; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { border: 1px solid var(--line); background: var(--surface); border-radius: 6px; padding: 9px 14px; min-height: 44px; cursor: pointer; font-variant-numeric: tabular-nums; }
.chip[aria-pressed="true"] { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.trail-choice { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; text-align: left; width: 100%; }
.trail-choice small { grid-column: 1 / -1; opacity: .8; }
.error { color: var(--stop); font-size: .9rem; }
.hint { color: var(--muted); font-size: .9rem; }
.toast { position: fixed; z-index: 10; left: 50%; transform: translateX(-50%); bottom: calc(84px + env(safe-area-inset-bottom, 0px)); width: min(92%, 500px); background: var(--ink); color: var(--bg); border-radius: 6px; padding: 10px 14px; font-size: .95rem; }
