/* Shared visual system from the original prototype */
:root {
  --bg: #F5F0E6;
  --card: #FBF8F1;
  --border: #E3DAC8;
  --text: #2F2B26;
  --muted: #6E675C;
  --primary: #4F6F52;
  --primary-dark: #436046;
  --primary-tint: #E7ECE4;
  --accent: #B5694A;
  --accent-dark: #9E583D;
  --tint: #EAE3D2;
  --ochre: #C9A45C;
  --r: 12px;
  --rs: 10px;
  --on-accent: #FBF8F1;
  --tint-danger: #F4E3DB;
  --border-danger: #E4C4B4;
  --body-text: #4A443B;
  --shadow-pop: rgba(79,111,82,.10);
  color-scheme: light;
}
/* Dark palette: same hues, lifted for contrast on dark surfaces. */
:root[data-theme="dark"] {
  --bg: #1A1915;
  --card: #24221D;
  --border: #3A362D;
  --text: #EDE8DC;
  --muted: #A59E8F;
  --primary: #8DB08F;
  --primary-dark: #A9C7AB;
  --primary-tint: #26322A;
  --accent: #D8906F;
  --accent-dark: #E8A588;
  --tint: #2F2B24;
  --ochre: #D9B56E;
  --on-accent: #1A1915;
  --tint-danger: #3A2820;
  --border-danger: #5A3D30;
  --body-text: #CFC8B8;
  --shadow-pop: rgba(0,0,0,.35);
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #1A1915;
    --card: #24221D;
    --border: #3A362D;
    --text: #EDE8DC;
    --muted: #A59E8F;
    --primary: #8DB08F;
    --primary-dark: #A9C7AB;
    --primary-tint: #26322A;
    --accent: #D8906F;
    --accent-dark: #E8A588;
    --tint: #2F2B24;
    --ochre: #D9B56E;
    --on-accent: #1A1915;
    --tint-danger: #3A2820;
    --border-danger: #5A3D30;
    --body-text: #CFC8B8;
    --shadow-pop: rgba(0,0,0,.35);
    color-scheme: dark;
  }
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body { font-family: 'DM Sans', sans-serif; font-size: 16px; line-height: 1.6; color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4 { font-family: 'Fraunces', serif; font-weight: 600; line-height: 1.25; letter-spacing: -0.01em; }
h1 { font-size: 34px; }
h2 { font-size: 26px; }
h3 { font-size: 19px; }
h4 { font-size: 17px; }
a { color: var(--primary); text-decoration: none; }
main p a, main li a, main dd a { text-decoration: underline; text-underline-offset: 2px; }
button, input, select, textarea { font: inherit; }
button, select { cursor: pointer; }
[hidden] { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 13.5px; }
.container { max-width: 1060px; margin: 0 auto; padding: 0 20px; }
.ic { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.ic-lg { width: 26px; height: 26px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; font-family: 'DM Sans', sans-serif; font-size: 15px; font-weight: 500; padding: 11px 20px; border-radius: var(--rs); border: 1px solid transparent; cursor: pointer; transition: background .18s ease, border-color .18s ease, color .18s ease, transform .15s ease; line-height: 1.3; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--primary); color: var(--on-accent); border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-dark); }
.btn-accent { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.btn-accent:hover { background: var(--accent-dark); }
.btn-outline { background: transparent; color: var(--text); border-color: var(--border); }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }
.btn-danger { background: transparent; color: var(--accent-dark); border-color: var(--accent); }
.btn-danger:hover { background: var(--tint-danger); }
.btn-sm { padding: 7px 14px; font-size: 13.5px; }
.btn-lg { padding: 13px 26px; font-size: 16px; }
.btn-block { width: 100%; }
.badge { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; font-weight: 500; padding: 3px 10px; border-radius: 99px; border: 1px solid transparent; }
.badge-accent { background: var(--accent); color: var(--on-accent); }
.badge-green { background: var(--primary-tint); color: var(--primary); border-color: #D4DED0; }
.badge-sand { background: var(--tint); color: var(--muted); border-color: var(--border); }
.chip { display: inline-flex; align-items: center; gap: 6px; font-size: 13.5px; color: var(--muted); border: 1px solid var(--border); background: var(--card); border-radius: 99px; padding: 5px 12px; }
.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--r); padding: 22px; }
.nav { border-bottom: 1px solid var(--border); background: var(--bg); position: sticky; top: 0; z-index: 50; }
.nav-in { max-width: 1060px; margin: 0 auto; padding: 14px 20px; display: flex; align-items: center; gap: 26px; }
.logo { font-family: 'Fraunces', serif; font-size: 21px; font-weight: 700; color: var(--text); display: flex; align-items: center; gap: 9px; }
.logo-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--accent); flex: none; }
.nav-links { display: flex; gap: 22px; margin-left: 6px; }
.nav-link { font-size: 14.5px; color: var(--muted); padding: 4px 2px; transition: color .15s ease; }
.nav-link:hover, .nav-link.on { color: var(--text); }
.nav-right { margin-left: auto; display: flex; gap: 10px; align-items: center; }
.page-head { padding: 52px 0 8px; }
.page-head h1 { font-size: 33px; margin-bottom: 8px; }
.page-head p { color: var(--muted); max-width: 58ch; font-size: 16.5px; }
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 13.5px; font-weight: 500; margin-bottom: 6px; color: var(--text); }
.field input, .field select, .field textarea { width: 100%; font-family: 'DM Sans', sans-serif; font-size: 15px; color: var(--text); background: var(--bg); border: 1px solid var(--border); border-radius: var(--rs); padding: 11px 13px; outline: none; transition: border-color .18s ease; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--primary); }
.form-note { font-size: 13px; color: var(--muted); margin-top: 14px; }
.form-err { font-size: 13.5px; color: var(--accent-dark); background: var(--tint-danger); border: 1px solid var(--border-danger); border-radius: var(--rs); padding: 9px 12px; margin: 10px 0 0; }
.empty { border: 1px dashed var(--border); border-radius: var(--rs); padding: 24px; color: var(--muted); background: var(--card); }
.auth-wrap { min-height: calc(100vh - 130px); display: flex; align-items: center; justify-content: center; padding: 48px 20px; }
.auth-card { width: 100%; max-width: 420px; background: var(--card); border: 1px solid var(--border); border-radius: var(--r); padding: 34px 30px; }
.auth-card h1 { font-size: 27px; margin-bottom: 6px; }
.auth-card > p { color: var(--muted); font-size: 15px; margin-bottom: 24px; }
.tabs { display: flex; border: 1px solid var(--border); border-radius: var(--rs); padding: 4px; background: var(--tint); margin-bottom: 22px; }
.tab { flex: 1; padding: 8px; border: none; background: none; border-radius: 8px; font-family: 'DM Sans', sans-serif; font-size: 14px; color: var(--muted); cursor: pointer; transition: background .18s ease, color .18s ease; }
.tab.on { background: var(--card); color: var(--text); font-weight: 500; }
.empty b { display: block; color: var(--text); margin-bottom: 4px; }
.inline-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.notice { background: var(--primary-tint); border: 1px solid #D4DED0; border-radius: var(--rs); padding: 12px 15px; color: var(--primary-dark); font-size: 14.5px; }
.toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); background: var(--text); color: var(--bg); font-size: 14px; padding: 11px 20px; border-radius: 99px; z-index: 120; opacity: 0; pointer-events: none; transition: opacity .2s ease; max-width: 88vw; text-align: center; }
.toast.show { opacity: 1; }
.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; }
:focus-visible { outline: 3px solid rgba(79, 111, 82, .3); outline-offset: 3px; }
.fade-in { animation: fadeIn .18s ease; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
/* App pages stay hidden until auth.js confirms a signed-in session (fails closed). */
html:not([data-gate="open"]) body > .shell { display: none; }
.gate-msg { display: none; max-width: 520px; margin: 90px auto; padding: 0 20px; text-align: center; }
html[data-gate="blocked"] .gate-msg { display: block; }
.theme-toggle { width: 36px; padding: 0; justify-content: center; font-size: 16px; line-height: 1; }
/* Fluid type: scales with the viewport between 320px and 1200px, so any width works. */
html { font-size: 100%; }
h1 { font-size: clamp(1.75rem, 1.2rem + 2.4vw, 2.125rem); }
h2 { font-size: clamp(1.4rem, 1.1rem + 1.2vw, 1.625rem); }
h3 { font-size: clamp(1.125rem, 1rem + .5vw, 1.1875rem); }
img, svg, video { max-width: 100%; height: auto; }
@media (max-width: 920px) {
  .nav-in { flex-wrap: wrap; row-gap: 10px; }
  .nav-links { order: 3; width: 100%; margin-left: 0; gap: 18px; overflow-x: auto; }
  .nav-right { margin-left: auto; }
}
@media (max-width: 560px) {
  .nav-in { padding: 12px 16px; gap: 12px; }
  .container { padding: 0 16px; }
  .btn { white-space: normal; }
  .btn-lg { padding: 12px 20px; }
}
