:root {
  --navy: #14364f;
  --navy-2: #1d4a6a;
  --sea: #2c7a74;
  --sea-soft: #e3f0ee;
  --sand: #f7f3ea;
  --sand-2: #efe7d6;
  --dune: #e9d9b6;
  --ink: #1b2730;
  --muted: #5d6b75;
  --line: #ddd5c4;
  --card: #fffdf8;
  --coral: #b5523b;
  --coral-soft: #f8e6e0;
  --amber: #8a6410;
  --amber-soft: #f7edd2;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(20, 54, 79, .06), 0 4px 14px rgba(20, 54, 79, .06);
  --serif: 'Source Serif 4', Georgia, serif;
  --sans: 'Public Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--sand); color: var(--ink);
  font: 16px/1.6 var(--sans); min-height: 100vh; display: flex; flex-direction: column;
}
main { flex: 1; padding-top: 28px; padding-bottom: 56px; outline: none; }
.wrap { width: 100%; max-width: 1040px; margin: 0 auto; padding: 0 20px; }
main.wrap { padding-top: 28px; padding-bottom: 56px; }
@media (max-width: 520px) { .wrap { padding: 0 16px; } main.wrap { padding-top: 20px; } }
a { color: var(--sea); }
a:hover { color: var(--navy); }
h1, h2, h3 { font-family: var(--serif); color: var(--navy); line-height: 1.2; margin: 0 0 .5em; }
h1 { font-size: clamp(1.7rem, 4vw, 2.3rem); font-weight: 700; }
h2 { font-size: 1.4rem; font-weight: 600; }
h3 { font-size: 1.12rem; font-weight: 600; }
p { margin: 0 0 1em; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
code { background: var(--sand-2); padding: 1px 5px; border-radius: 4px; font-size: .9em; }

/* Header */
.site-header { background: var(--navy); color: #fff; position: sticky; top: 0; z-index: 20; }
.header-inner { display: flex; align-items: center; gap: 16px; min-height: 62px; }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; font-family: var(--serif); font-size: 1.25rem; font-weight: 600; }
.brand svg { color: var(--sea); }
.brand em { font-style: normal; color: var(--dune); }
.brand:hover { color: #fff; }
.nav { margin-left: auto; display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.nav a, .nav button { color: #dce6ee; text-decoration: none; padding: 8px 12px; border-radius: 8px; font: 500 .95rem var(--sans); background: none; border: 0; cursor: pointer; }
.nav a:hover, .nav button:hover { background: rgba(255,255,255,.08); color: #fff; }
.nav a.active { background: rgba(255,255,255,.12); color: #fff; }
.nav .badge { background: var(--coral); color: #fff; border-radius: 99px; padding: 0 7px; font-size: .75rem; margin-left: 4px; }
.nav-toggle { display: none; margin-left: auto; background: none; border: 1px solid rgba(255,255,255,.3); color: #fff; font-size: 1.2rem; border-radius: 8px; padding: 4px 10px; cursor: pointer; }
@media (max-width: 760px) {
  .nav-toggle { display: block; }
  .nav { display: none; position: absolute; top: 62px; left: 0; right: 0; background: var(--navy); flex-direction: column; align-items: stretch; padding: 8px 16px 16px; }
  .nav.open { display: flex; }
}

/* Footer */
.site-footer { background: var(--sand-2); border-top: 1px solid var(--line); font-size: .875rem; color: var(--muted); }
.footer-inner { padding-top: 22px; padding-bottom: 22px; display: flex; gap: 24px; justify-content: space-between; flex-wrap: wrap; }
.footer-inner p { margin: 0; max-width: 680px; }

/* Cards & layout */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); margin-bottom: 18px; }
.card.tight { padding: 14px 18px; }
.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.stack > * + * { margin-top: 12px; }
.narrow { max-width: 520px; margin: 0 auto; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.page-head h1 { margin: 0; }
.crumbs { font-size: .9rem; color: var(--muted); margin-bottom: 6px; }
.crumbs a { color: var(--muted); }

/* Hero */
.hero { background: linear-gradient(100deg, rgba(14,36,54,.70) 0%, rgba(14,36,54,.38) 48%, rgba(14,36,54,0) 80%), url('/img/hero-sunset.jpg') center 42% / cover no-repeat, var(--navy); color: #fff; border-radius: 14px; padding: clamp(28px, 6vw, 64px); margin-bottom: 26px; position: relative; overflow: hidden; min-height: 380px; display: flex; flex-direction: column; justify-content: center; }
.hero h1 { color: #fff; font-size: clamp(2rem, 5vw, 2.9rem); max-width: 16ch; }
.hero p { color: #e6eef4; text-shadow: 0 1px 8px rgba(0,0,0,.35); font-size: 1.1rem; max-width: 56ch; }
.feature h3 { margin-bottom: .3em; }
.feature p { margin: 0; color: var(--muted); }
.feature .ico { width: 38px; height: 38px; border-radius: 9px; background: var(--sea-soft); color: var(--sea); display: grid; place-items: center; margin-bottom: 10px; font-size: 1.15rem; }

/* Forms */
label { display: block; font-weight: 600; font-size: .92rem; margin-bottom: 4px; color: var(--navy); }
.hint { font-weight: 400; color: var(--muted); font-size: .85rem; }
input:not([type]), input[type=text], input[type=email], input[type=password], input[type=tel], input[type=search], input[type=datetime-local], select, textarea {
  width: 100%; padding: 10px 12px; border: 1px solid #cfc6b3; border-radius: 8px; background: #fff; font: inherit; color: var(--ink);
}
textarea { min-height: 160px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--sea); outline-offset: 1px; border-color: var(--sea); }
.field { margin-bottom: 14px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 520px) { .field-row { grid-template-columns: 1fr; } }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; color: var(--ink); }
.check input { margin-top: 5px; }
fieldset { border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; margin: 0 0 14px; }
legend { font-weight: 600; color: var(--navy); padding: 0 6px; font-size: .92rem; }
.radio { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; color: var(--ink); padding: 6px 0; }
.radio input { margin-top: 5px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 10px 18px; border-radius: 8px; border: 1px solid transparent; font: 600 .95rem var(--sans); cursor: pointer; text-decoration: none; background: var(--navy); color: #fff; }
.btn:hover { background: var(--navy-2); color: #fff; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn.sea { background: var(--sea); }
.btn.sea:hover { background: #246660; }
.btn.light { background: #fff; color: var(--navy); border-color: var(--line); }
.btn.light:hover { background: var(--sand-2); color: var(--navy); }
.btn.ghost { background: transparent; color: var(--navy); border-color: var(--line); }
.btn.danger { background: var(--coral); }
.btn.danger:hover { background: #9a4330; }
.btn.small { padding: 6px 12px; font-size: .85rem; }
.btn.link { background: none; border: 0; color: var(--sea); padding: 0; font-weight: 500; text-decoration: underline; }
.hero .btn.light { border-color: transparent; }

.alert { padding: 12px 14px; border-radius: 8px; margin-bottom: 14px; border: 1px solid; font-size: .95rem; }
.alert.info { background: var(--sea-soft); border-color: #bcdcd7; color: #1d4f4b; }
.alert.warn { background: var(--amber-soft); border-color: #e8d49e; color: #5f450b; }
.alert.error { background: var(--coral-soft); border-color: #eac0b4; color: #7d3423; }
.alert.success { background: #e6f2e6; border-color: #bfdcbf; color: #285828; }

/* Pills */
.pill { display: inline-block; font-size: .75rem; font-weight: 600; padding: 2px 9px; border-radius: 99px; background: var(--sand-2); color: var(--muted); white-space: nowrap; }
.pill.verified { background: #e2f0e2; color: #2c6a2c; }
.pill.pending_review, .pill.pending { background: var(--amber-soft); color: var(--amber); }
.pill.rejected, .pill.flagged_for_review, .pill.hold { background: var(--coral-soft); color: var(--coral); }
.pill.sea { background: var(--sea-soft); color: var(--sea); }
.pill.admin { background: var(--navy); color: #fff; }

/* Lists */
.list { list-style: none; margin: 0; padding: 0; }
.list > li { padding: 14px 0; border-top: 1px solid var(--line); }
.list > li:first-child { border-top: 0; }
.cat-link { display: flex; justify-content: space-between; gap: 16px; text-decoration: none; color: inherit; align-items: center; }
.cat-link:hover h3 { color: var(--sea); }
.cat-link h3 { margin: 0 0 2px; }
.cat-link p { margin: 0; color: var(--muted); font-size: .92rem; }
.cat-meta { text-align: right; font-size: .85rem; color: var(--muted); white-space: nowrap; }

/* Posts */
.post { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; margin-bottom: 12px; }
.post.op { border-left: 4px solid var(--sea); }
.post.held { border-style: dashed; background: #fffaf2; }
.post-head { display: flex; justify-content: space-between; gap: 10px; font-size: .88rem; color: var(--muted); margin-bottom: 8px; flex-wrap: wrap; }
.post-head strong { color: var(--navy); }
.post-body { overflow-wrap: anywhere; }
.post-body p:last-child { margin-bottom: 0; }
.post-actions { margin-top: 10px; display: flex; gap: 14px; font-size: .85rem; }
.post-actions button { background: none; border: 0; padding: 0; color: var(--muted); cursor: pointer; font: inherit; text-decoration: underline; }
.post-actions button:hover { color: var(--coral); }

/* Polls */
.option { display: flex; gap: 10px; align-items: center; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; margin-bottom: 8px; background: #fff; cursor: pointer; font-weight: 500; color: var(--ink); }
.option:has(input:checked) { border-color: var(--sea); background: var(--sea-soft); }
.bar { position: relative; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; margin-bottom: 8px; background: #fff; overflow: hidden; }
.bar .fill { position: absolute; inset: 0 auto 0 0; background: var(--sea-soft); }
.bar .lbl { position: relative; display: flex; justify-content: space-between; gap: 10px; font-weight: 500; }
.bar.mine { border-color: var(--sea); }

/* Tables */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th, td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; background: var(--sand-2); }

/* Tabs */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 20px; overflow-x: auto; }
.tabs a { padding: 10px 14px; text-decoration: none; color: var(--muted); font-weight: 600; font-size: .92rem; border-bottom: 3px solid transparent; white-space: nowrap; }
.tabs a.active { color: var(--navy); border-bottom-color: var(--sea); }
.tabs .badge { background: var(--coral); color: #fff; border-radius: 99px; padding: 0 7px; font-size: .72rem; margin-left: 4px; }

.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.stat .n { font-family: var(--serif); font-size: 2rem; font-weight: 700; color: var(--navy); line-height: 1.1; }
.stat .l { color: var(--muted); font-size: .85rem; }
.stat.attn .n { color: var(--coral); }

/* Modal */
.modal-back { position: fixed; inset: 0; background: rgba(20, 30, 40, .55); display: grid; place-items: center; padding: 16px; z-index: 50; }
.modal { background: var(--card); border-radius: 12px; max-width: 720px; width: 100%; max-height: 90vh; display: flex; flex-direction: column; box-shadow: 0 20px 60px rgba(0,0,0,.25); }
.modal-body { overflow-y: auto; padding: 24px; }
.modal-foot { padding: 16px 24px; border-top: 1px solid var(--line); display: flex; gap: 12px; justify-content: flex-end; align-items: center; flex-wrap: wrap; }

.guidelines h1 { font-size: 1.6rem; }
.guidelines h3 { margin-top: 1.3em; }
.guidelines ul { padding-left: 1.2em; }
.guidelines li { margin-bottom: .4em; }

/* Typeahead */
.typeahead { position: relative; }
.ta-list { position: absolute; left: 0; right: 0; top: 100%; background: #fff; border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow); z-index: 10; max-height: 260px; overflow-y: auto; margin-top: 4px; }
.ta-list button { display: block; width: 100%; text-align: left; padding: 9px 12px; border: 0; background: none; font: inherit; cursor: pointer; }
.ta-list button:hover { background: var(--sea-soft); }

/* Toast */
.toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%) translateY(20px); background: var(--navy); color: #fff; padding: 12px 18px; border-radius: 10px; opacity: 0; pointer-events: none; transition: .25s; max-width: min(90vw, 520px); z-index: 60; box-shadow: 0 8px 30px rgba(0,0,0,.2); }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.error { background: var(--coral); }

.empty { text-align: center; padding: 30px 10px; color: var(--muted); }
details summary { cursor: pointer; font-weight: 600; color: var(--navy); }
pre.raw { white-space: pre-wrap; background: var(--sand); border: 1px solid var(--line); padding: 10px; border-radius: 8px; font: .88rem/1.5 var(--sans); margin: 8px 0; max-height: 240px; overflow: auto; }

/* ---- Photos ---- */
.hero h1 { text-shadow: 0 2px 14px rgba(0,0,0,.35); }
@media (max-width: 640px) { .hero { background: linear-gradient(180deg, rgba(14,36,54,.25), rgba(14,36,54,.70)), url('/img/hero-sunset.jpg') 48% 40% / cover no-repeat, var(--navy); min-height: 0; } }

.feature-photo { width: calc(100% + 44px); margin: -22px -22px 14px; height: 150px; object-fit: cover; object-position: center 12%; border-radius: var(--radius) var(--radius) 0 0; display: block; }

.auth-layout { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1fr); max-width: 900px; margin: 0 auto; background: var(--card); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); overflow: hidden; }
.auth-photo { margin: 0; min-height: 100%; }
.auth-photo img { width: 100%; height: 100%; object-fit: cover; object-position: center 45%; display: block; }
.auth-card { border: 0; box-shadow: none; margin: 0; border-radius: 0; padding: clamp(22px, 4vw, 36px); }
@media (max-width: 760px) {
  .auth-layout { grid-template-columns: 1fr; max-width: 520px; }
  .auth-photo img { height: 150px; object-position: center 48%; }
}

.photo-strip { height: clamp(90px, 16vw, 150px); border-radius: 12px; background-size: cover; background-position: center; margin-bottom: 22px; box-shadow: inset 0 0 0 1px rgba(0,0,0,.06); }

.site-footer { background: linear-gradient(rgba(10,20,32,.55), rgba(10,20,32,.80)), url('/img/footer-twilight.jpg') center 40% / cover no-repeat, #0d1b28; color: #c9d5df; border-top: 0; }
.site-footer strong { color: #fff; }
.site-footer a { color: var(--dune); }
.footer-inner { padding-top: 48px; padding-bottom: 30px; }
