:root {
  --bg: #0c0b09;
  --bg-2: #16140f;
  --bg-3: #221f18;
  --line: rgba(212, 179, 106, 0.28);
  --gold: #d4b36a;
  --gold-2: #f3e6c4;
  --ink: #f6f1e7;
  --muted: #b7ab96;
  --dim: #8a7f6e;
  --copper: #d4846a;
  --ok: #9dcaa8;
  --serif: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --sans: "Jost", "Avenir Next", "Segoe UI", sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(900px 420px at 0% -10%, rgba(212, 179, 106, 0.16), transparent 55%),
    var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.45;
}
button, input, select, textarea { font: inherit; color: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
h1, h2, h3 { font-family: var(--serif); font-weight: 560; letter-spacing: 0; margin: 0; }
p { margin: 0; }
a { color: var(--gold-2); }

.top {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: flex-end;
  max-width: 1180px;
  margin: 0 auto;
  padding: 28px 28px 8px;
}
.brand { display: flex; gap: 14px; align-items: center; }
.mark {
  width: 42px; height: 42px;
  border: 1px solid var(--gold);
  display: grid; place-items: center;
  font-family: var(--serif);
  color: var(--gold-2);
  font-size: 22px;
}
.eyebrow {
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 2px;
}
.top h1 { font-size: 40px; line-height: 0.9; }
.top-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.who { color: var(--dim); font-size: 13px; }

.local-banner, .note, .callout {
  max-width: 1180px;
  margin: 8px auto 0;
  padding: 0 28px;
  color: var(--muted);
  font-size: 14px;
}
.callout {
  margin-top: 18px;
  padding: 12px 14px;
  border-left: 2px solid var(--copper);
  background: rgba(212, 132, 106, 0.08);
  color: var(--gold-2);
}

.wrap { max-width: 1180px; margin: 0 auto; padding: 18px 28px 72px; }
.counts { display: flex; flex-wrap: wrap; gap: 8px; }
.count {
  appearance: none;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  padding: 8px 12px;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  gap: 8px;
  align-items: baseline;
}
.count strong { color: var(--ink); font-weight: 560; font-family: var(--serif); font-size: 22px; }
.count.is-on, .count:hover { border-color: var(--gold); color: var(--gold-2); }
.count small { color: var(--dim); font-size: 11px; letter-spacing: 0.04em; }

.split { display: grid; grid-template-columns: 1.2fr 0.8fr; gap: 18px; margin-top: 18px; }
.panel {
  background: rgba(22, 20, 15, 0.88);
  border: 1px solid var(--line);
  padding: 16px 16px 12px;
  min-width: 0;
}
.panel header, .section-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
  margin-bottom: 10px;
}
.panel h2, .section-head h2 { font-size: 28px; }
.quiet { color: var(--dim); font-size: 13px; }
.today-list { max-height: 250px; overflow: auto; display: grid; gap: 6px; }
.task {
  display: grid;
  grid-template-columns: 18px 1fr;
  gap: 8px;
  align-items: start;
  padding: 6px 0;
  border-bottom: 1px solid rgba(212, 179, 106, 0.12);
}
.task a { text-decoration: none; }
.task small { display: block; color: var(--dim); }

.review-row { padding: 8px 0; border-top: 1px solid rgba(212, 179, 106, 0.16); }
.review-row strong { font-family: var(--serif); font-size: 22px; font-weight: 560; }
.review-row strong a { color: var(--ink); text-decoration: none; }
.review-row p { margin: 0; color: var(--muted); font-size: 13px; }
.tag { color: var(--muted); }
.tag.due { color: var(--copper); }
.tag.done { color: var(--ok); }

.section-head { margin: 26px 0 12px; }
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.card {
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(34, 31, 24, 0.55), rgba(12, 11, 9, 0.2));
  padding: 16px 16px 14px;
  min-height: 180px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.card:hover { border-color: var(--gold); }
.kicker { color: var(--gold); font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase; }
.card h2 { font-size: 30px; line-height: 0.95; }
.card h2 a { color: var(--ink); text-decoration: none; }
.card h2 a:hover { color: var(--gold-2); }
.sub { color: var(--muted); }
.meter { height: 2px; background: rgba(212, 179, 106, 0.15); margin-top: 8px; }
.meter span { display: block; height: 100%; background: var(--gold); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; padding-top: 10px; }
.chip {
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  padding: 2px 7px;
}
.chip.hot { border-color: var(--copper); color: var(--copper); }
.links { display: flex; gap: 12px; flex-wrap: wrap; font-size: 14px; }

.btn, button.btn {
  appearance: none;
  border: 1px solid var(--gold);
  background: var(--gold);
  color: #1a1408;
  padding: 8px 12px;
  cursor: pointer;
  text-decoration: none;
  font-weight: 560;
}
.btn.ghost { background: transparent; color: var(--gold-2); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }

.back { color: var(--muted); text-decoration: none; font-size: 14px; }
.addr { font-size: 58px; line-height: 0.9; margin: 8px 0 4px; }
.rail { display: flex; gap: 6px; flex-wrap: wrap; margin: 16px 0; }
.rail a, .rail span {
  border: 1px solid var(--line);
  padding: 6px 8px;
  color: var(--dim);
  text-decoration: none;
  font-size: 13px;
}
.rail .is-current { border-color: var(--gold); color: var(--gold-2); }

.actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin: 8px 0 16px; }
.move { display: flex; gap: 8px; align-items: center; }
select, input[type="text"], input[type="number"], input[type="date"], input[type="url"], textarea {
  background: var(--bg);
  border: 1px solid var(--line);
  padding: 8px 10px;
  border-radius: 0;
}
textarea { width: 100%; min-height: 88px; }

.stack-panels { display: grid; gap: 14px; margin-top: 16px; }
.gifts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.gift { border: 1px solid var(--line); padding: 10px; }
.gift strong { font-family: var(--serif); font-size: 22px; font-weight: 560; }
.gift em { font-style: normal; color: var(--gold); float: right; }
.gift p { color: var(--muted); font-size: 13px; min-height: 54px; margin: 6px 0; }
.gift select, .showings input { width: 100%; }

.group { border-top: 1px solid var(--line); padding-top: 8px; margin-top: 8px; }
.group summary { cursor: pointer; display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; }
.group summary h3 { font-size: 26px; }
.item {
  display: grid;
  grid-template-columns: 22px 1fr;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(212, 179, 106, 0.1);
}
.item.is-done .title { color: var(--dim); text-decoration: line-through; }
.item.is-locked { opacity: 0.62; }
.item.is-skipped { opacity: 0.45; }
.title { display: block; }
.meta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; color: var(--dim); font-size: 13px; }
.mode { border: 1px solid var(--line); padding: 0 6px; color: var(--gold); }
.mode.manual { color: var(--ink); }
.desc { color: var(--muted); font-size: 14px; margin-top: 3px; }
.lock { color: var(--copper); }

.file { margin-top: 18px; }
.file summary { cursor: pointer; font-family: var(--serif); font-size: 28px; }
.fields { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 14px; margin-top: 12px; }
.fields label, .stack label { display: grid; gap: 4px; color: var(--muted); font-size: 13px; }
.fields .wide { grid-column: 1 / -1; }
.modules { display: flex; flex-wrap: wrap; gap: 10px 16px; margin: 8px 0 12px; }
.modules label { display: flex; gap: 6px; align-items: center; color: var(--ink); }

.gate {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}
.gate article { max-width: 440px; border: 1px solid var(--line); padding: 28px; background: var(--bg-2); }
.gate h1 { font-size: 48px; line-height: 0.9; margin: 8px 0 12px; }
dialog { border: 1px solid var(--line); background: var(--bg-2); color: var(--ink); padding: 20px; max-width: 460px; }
dialog::backdrop { background: rgba(0, 0, 0, 0.62); }
dialog h3 { font-size: 32px; margin-bottom: 8px; }
.form { display: grid; gap: 10px; }
.error { color: var(--copper); min-height: 1.2em; }

#toast {
  position: fixed;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%) translateY(20px);
  background: var(--gold-2);
  color: #1a1408;
  padding: 10px 14px;
  max-width: min(560px, calc(100% - 24px));
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

@media (max-width: 980px) {
  .split, .grid, .facts, .gifts, .fields { grid-template-columns: 1fr 1fr; }
  .grid { grid-template-columns: 1fr 1fr; }
  .addr { font-size: 42px; }
}
@media (max-width: 700px) {
  .top, .wrap, .local-banner { padding-left: 16px; padding-right: 16px; }
  .top { flex-direction: column; align-items: flex-start; }
  .split, .grid, .facts, .gifts, .fields { grid-template-columns: 1fr; }
  .addr { font-size: 36px; }
  .top h1 { font-size: 34px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  #toast { transition: none; }
}
