:root {
  color-scheme: light;
  --ink: #21342c;
  --muted: #637169;
  --paper: #fffdf8;
  --sand: #f4eee2;
  --line: #ded5c5;
  --green: #244a3a;
  --green-soft: #dfeae3;
  --gold: #b0782f;
  --error: #9b342e;
  --shadow: 0 18px 45px rgb(38 50 42 / 10%);
}
* { box-sizing: border-box; }
html { background: #ece8df; scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 10% 5%, rgb(255 255 255 / 75%), transparent 34rem),
    linear-gradient(150deg, #f6f2ea, #e5e9e2);
  font: 16px/1.5 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: var(--green); }
.hidden { display: none !important; }
.skip-link { position: fixed; left: 1rem; top: -4rem; z-index: 10; background: #fff; padding: .6rem 1rem; }
.skip-link:focus { top: 1rem; }

.site-header {
  min-height: 78px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: .8rem clamp(1rem, 4vw, 3.5rem);
  background: rgb(255 253 248 / 92%);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 5;
}
.brand { display: flex; gap: .8rem; align-items: center; color: inherit; text-decoration: none; }
.brand-mark { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: var(--green); color: white; font: 700 1.45rem Georgia, serif; }
.brand span:last-child { display: flex; flex-direction: column; }
.brand strong { font-family: Georgia, serif; font-size: 1.05rem; }
.brand small { color: var(--muted); }
.header-actions { display: flex; gap: .5rem; }
.language, .quiet { border: 1px solid var(--line); background: transparent; color: var(--ink); border-radius: 999px; padding: .45rem .8rem; cursor: pointer; }

main { width: min(1120px, calc(100% - 2rem)); margin: 2rem auto 5rem; }
.loading, .empty { padding: 4rem 1rem; text-align: center; color: var(--muted); }
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(250px, .8fr);
  gap: 1.2rem;
  align-items: stretch;
  margin-bottom: 1rem;
}
.hero-main, .hero-side, .panel, .access-card, .quote-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: var(--shadow);
}
.hero-main { padding: clamp(1.4rem, 4vw, 2.6rem); }
.eyebrow { color: var(--gold); text-transform: uppercase; letter-spacing: .13em; font-size: .78rem; font-weight: 750; }
h1, h2, h3 { font-family: Georgia, serif; line-height: 1.16; }
h1 { margin: .35rem 0 .6rem; font-size: clamp(2rem, 5vw, 3.6rem); font-weight: 500; }
.hero-main p { margin: 0; color: var(--muted); font-size: 1.05rem; }
.hero-side { padding: 1.25rem; display: grid; align-content: center; gap: .7rem; background: var(--green); color: white; }
.hero-side strong { font: 500 1.4rem Georgia, serif; }
.hero-side span { color: #dce9e1; }

.tabs { display: flex; gap: .35rem; overflow-x: auto; padding: .45rem; margin: 1rem 0; border-radius: 16px; background: rgb(255 253 248 / 72%); border: 1px solid var(--line); scrollbar-width: thin; }
.tabs button { white-space: nowrap; border: 0; border-radius: 12px; padding: .7rem 1rem; color: var(--muted); background: transparent; cursor: pointer; }
.tabs button[aria-selected="true"] { color: white; background: var(--green); }
.panel { padding: clamp(1rem, 3vw, 1.7rem); min-height: 380px; }
.panel-header { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.panel h2 { margin: 0; font-size: 1.65rem; }
.panel-note { color: var(--muted); font-size: .9rem; }
.unit-grid, .request-grid, .payment-grid { display: grid; gap: .8rem; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.unit, .request, .payment-case, .message { border: 1px solid var(--line); border-radius: 15px; padding: 1rem; background: #fff; }
.unit h3, .request h3 { margin: 0 0 .45rem; font-family: inherit; font-size: 1rem; }
.access-note { margin: .9rem 0 0; color: var(--muted); font-size: .9rem; }
.access-code { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-top: .9rem; padding: .8rem 1rem; border-radius: 12px; background: var(--green-soft); color: var(--green); }
.access-code strong { font: 600 1.35rem ui-monospace, SFMono-Regular, Consolas, monospace; letter-spacing: .08em; }
.offer-units { margin-bottom: 1rem; }
.offer-totals { max-width: 620px; margin-top: 1rem; }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: .35rem .9rem; margin: 0; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; font-weight: 620; }
.badge { display: inline-flex; align-items: center; border-radius: 999px; background: var(--green-soft); color: var(--green); padding: .2rem .55rem; font-size: .8rem; font-weight: 700; }

.form-grid { display: grid; gap: 1rem; grid-template-columns: repeat(2, minmax(0, 1fr)); }
label { display: grid; gap: .35rem; font-weight: 650; }
label.full { grid-column: 1 / -1; }
label span { color: var(--muted); font-weight: 500; font-size: .88rem; }
input, select, textarea { width: 100%; border: 1px solid #c8c1b5; border-radius: 11px; padding: .72rem .8rem; color: var(--ink); background: white; }
input:focus, select:focus, textarea:focus, button:focus-visible, a:focus-visible { outline: 3px solid rgb(176 120 47 / 32%); outline-offset: 2px; }
textarea { min-height: 110px; resize: vertical; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: .7rem; margin-top: 1rem; }
.primary, .secondary, .danger { border-radius: 999px; padding: .72rem 1.1rem; cursor: pointer; font-weight: 700; }
.primary { border: 1px solid var(--green); background: var(--green); color: white; }
.secondary { border: 1px solid var(--green); background: white; color: var(--green); }
.danger { border: 1px solid #d6aca8; background: #fff7f6; color: var(--error); }
button:disabled { opacity: .55; cursor: wait; }
.message { margin-bottom: .7rem; }
.message.outbound { margin-left: clamp(1rem, 8vw, 5rem); background: #f4f8f5; }
.message.inbound { margin-right: clamp(1rem, 8vw, 5rem); }
.message-meta { color: var(--muted); font-size: .82rem; margin-bottom: .35rem; }
.message-body { white-space: pre-wrap; overflow-wrap: anywhere; }
.balance { font: 500 clamp(1.9rem, 5vw, 3rem) Georgia, serif; margin: .4rem 0; }
.payment-link { display: inline-flex; text-decoration: none; }
.request p { margin: .25rem 0; color: var(--muted); }
.status-pending { background: #fff0cf; color: #73501e; }
.status-accepted { background: #dfeee3; color: #235635; }

.access-wrap, .quote-wrap { min-height: 65vh; display: grid; place-items: center; }
.access-card, .quote-card { width: min(640px, 100%); padding: clamp(1.4rem, 5vw, 3rem); }
.access-card h1, .quote-card h1 { font-size: clamp(2rem, 7vw, 3.5rem); }
.access-card p, .quote-card > p { color: var(--muted); }
.error { border-left: 4px solid var(--error); background: #fff4f2; padding: .8rem 1rem; color: #6e2925; }
.toast { position: fixed; left: 50%; bottom: 1rem; transform: translate(-50%, 150%); opacity: 0; background: #17382b; color: white; border-radius: 999px; padding: .7rem 1rem; transition: .22s ease; z-index: 8; }
.toast.visible { transform: translate(-50%, 0); opacity: 1; }

@media (max-width: 720px) {
  .site-header { min-height: 66px; padding: .65rem 1rem; }
  .brand small { display: none; }
  .quiet { font-size: 0; width: 40px; height: 40px; padding: 0; }
  .quiet::after { content: "×"; font-size: 1.5rem; }
  main { width: min(100% - 1rem, 1120px); margin-top: .8rem; }
  .hero { grid-template-columns: 1fr; }
  .hero-side { grid-template-columns: 1fr 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  label.full { grid-column: auto; }
  .panel { border-radius: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
