:root {
  /* Brand: black + ResQPrep green (#39B54A). "blue" vars kept as names to avoid churn — they are the charcoal/black scale. */
  --blue: #1c1c1c;
  --blue-dark: #000000;
  --blue-light: #eef1ee;
  --brand-green: #39B54A;
  --green: #2a8a38;
  --green-dark: #1f6e2b;
  --green-light: #e7f6e9;
  --amber: #d97706;
  --amber-light: #fdf3e3;
  --red: #c0392b;
  --red-light: #fbe9e7;
  --ink: #1b2430;
  --muted: #5b6878;
  --line: #dbe2ea;
  --bg: #f6f8fb;
  --card: #ffffff;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 4px 16px rgba(16, 24, 40, .06);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Inter, Helvetica, Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body { font-family: var(--font); color: var(--ink); background: var(--bg); line-height: 1.5; font-size: 16px; }
a { color: var(--blue); }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5rem; }
h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); }
h2 { font-size: 1.4rem; }
h3 { font-size: 1.1rem; }
p { margin: 0 0 1rem; }
.muted { color: var(--muted); }
.small { font-size: .9rem; }
.wrap { max-width: 1040px; margin: 0 auto; padding: 0 1.25rem; }
.narrow { max-width: 760px; }

/* header */
.site-header { background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; height: 64px; gap: 1rem; }
.brand { display: flex; align-items: center; gap: .6rem; text-decoration: none; color: var(--ink); font-weight: 700; font-size: 1.15rem; }
.brand .mark { height: 40px; width: auto; }
.brand .tag { font-weight: 400; color: var(--muted); font-size: .85rem; margin-left: .35rem; display: none; }
@media (min-width: 640px) { .brand .tag { display: inline; } }
nav a { margin-left: 1rem; text-decoration: none; color: var(--ink); font-weight: 500; }
nav a.btn { margin-left: 1rem; }

/* buttons */
.btn { display: inline-flex; align-items: center; gap: .5rem; padding: .7rem 1.15rem; border-radius: 10px; border: 1px solid transparent; font-weight: 600; cursor: pointer; text-decoration: none; font-size: 1rem; line-height: 1; transition: background .15s, transform .05s; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--green); color: #fff; }
.btn-primary:hover { background: var(--green-dark); }
.btn-blue { background: var(--blue); color: #fff; }
.btn-blue:hover { background: var(--blue-dark); }
.btn-outline { background: #fff; color: var(--blue); border-color: var(--blue); }
.btn-outline:hover { background: var(--blue-light); }
.btn-ghost { background: transparent; color: var(--muted); }
.btn-sm { padding: .45rem .8rem; font-size: .9rem; }
.btn-danger { background: #fff; color: var(--red); border-color: var(--red); }
.btn[disabled] { opacity: .55; cursor: not-allowed; }

/* banner */
.event-banner { background: var(--amber-light); border-bottom: 1px solid #f3dfbd; }
.event-banner .wrap { display: flex; gap: 1rem; align-items: center; padding: .75rem 1.25rem; flex-wrap: wrap; }
.event-banner strong { color: #92400e; }
.event-banner a { font-weight: 600; }

/* hero */
.hero { background: linear-gradient(160deg, #000 0%, #1c1c1c 70%); border-bottom: 4px solid var(--brand-green); color: #fff; padding: 3.5rem 0; }
.hero h1 { color: #fff; }
.hero p { color: #d8e3f3; font-size: 1.15rem; max-width: 640px; }
.hero .actions { display: flex; gap: .75rem; flex-wrap: wrap; margin-top: 1.5rem; }
.hero .btn-outline { background: transparent; color: #fff; border-color: rgba(255,255,255,.6); }
.hero .btn-outline:hover { background: rgba(255,255,255,.12); }

/* layout */
section { padding: 2.5rem 0; }
.grid { display: grid; gap: 1rem; }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.25rem; box-shadow: var(--shadow); }
.card h3 { margin-bottom: .35rem; }
.card.link { text-decoration: none; color: inherit; display: block; transition: border-color .15s; }
.card.link:hover { border-color: var(--blue); }
.step { display: flex; gap: 1rem; align-items: flex-start; }
.step .num { flex: 0 0 36px; height: 36px; border-radius: 50%; background: var(--green-light); color: var(--green-dark); font-weight: 700; display: grid; place-items: center; }

/* resources */
.res-group { margin-bottom: 1.75rem; }
.res-group h2 { display: flex; align-items: center; gap: .5rem; font-size: 1.15rem; color: var(--blue-dark); border-bottom: 2px solid var(--blue-light); padding-bottom: .4rem; margin-bottom: .75rem; }
.res { padding: .9rem 0; border-bottom: 1px solid var(--line); display: grid; grid-template-columns: 1fr auto; gap: .5rem 1rem; }
.res:last-child { border-bottom: 0; }
.res .name { font-weight: 600; }
.res .org { color: var(--muted); font-size: .9rem; }
.res .meta { font-size: .95rem; margin-top: .25rem; }
.res .meta span { display: inline-block; margin-right: 1rem; }
.res .notes { font-size: .9rem; color: var(--muted); margin-top: .3rem; }
.res .area-tag { font-size: .75rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; white-space: nowrap; }
.pill { display: inline-block; font-size: .72rem; font-weight: 600; padding: .15rem .5rem; border-radius: 999px; text-transform: uppercase; letter-spacing: .04em; }
.pill-verified { background: var(--green-light); color: var(--green-dark); }
.pill-ai_drafted { background: var(--amber-light); color: #92400e; }
.pill-needs_recheck { background: var(--red-light); color: var(--red); }
.pill-event { background: var(--blue-light); color: var(--blue-dark); }

/* forms */
form { margin: 0; }
label { display: block; font-weight: 600; font-size: .9rem; margin: .75rem 0 .25rem; }
input, select, textarea { width: 100%; padding: .65rem .75rem; border: 1px solid var(--line); border-radius: 8px; font: inherit; background: #fff; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--blue-light); border-color: var(--blue); }
textarea { min-height: 80px; resize: vertical; }
.row { display: grid; gap: .75rem; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.form-actions { margin-top: 1rem; display: flex; gap: .5rem; flex-wrap: wrap; }
fieldset { border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.25rem; margin: 1.25rem 0; }
legend { font-weight: 700; padding: 0 .4rem; color: var(--blue-dark); }
.check { display: flex; gap: .5rem; align-items: center; font-weight: 500; }
.check input { width: auto; }

/* portal */
.portal { display: grid; grid-template-columns: 240px 1fr; gap: 1.5rem; padding: 1.5rem 0; }
@media (max-width: 800px) { .portal { grid-template-columns: 1fr; } }
.sidebar .card { padding: .75rem; }
.sidebar a { display: block; padding: .55rem .75rem; border-radius: 8px; text-decoration: none; color: var(--ink); }
.sidebar a.active, .sidebar a:hover { background: var(--blue-light); color: var(--blue-dark); font-weight: 600; }
.sidebar .prop { font-size: .85rem; color: var(--muted); padding: .4rem .75rem; }
.list-item { display: flex; justify-content: space-between; gap: 1rem; padding: .75rem 0; border-bottom: 1px solid var(--line); }
.list-item:last-child { border-bottom: 0; }
.list-item .actions { display: flex; gap: .4rem; align-items: flex-start; }
.empty { color: var(--muted); padding: 1rem; text-align: center; border: 1px dashed var(--line); border-radius: var(--radius); }
.progress { height: 8px; background: var(--line); border-radius: 999px; overflow: hidden; }
.progress > div { height: 100%; background: var(--green); }

/* misc */
.toast { position: fixed; bottom: 1.25rem; left: 50%; transform: translate(-50%, 20px); background: var(--ink); color: #fff; padding: .7rem 1.1rem; border-radius: 10px; opacity: 0; transition: all .25s; z-index: 50; font-size: .95rem; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast-err { background: var(--red); }
footer { padding: 2.5rem 0; color: var(--muted); font-size: .9rem; border-top: 1px solid var(--line); margin-top: 2rem; }
footer a { color: var(--muted); }
.hidden { display: none !important; }
.callout { background: var(--blue-light); border-left: 4px solid var(--blue); padding: .9rem 1rem; border-radius: 8px; }
.callout-green { background: var(--green-light); border-left-color: var(--green); }

/* ---------- Sign-in screen ---------- */
.login-shell { display: grid; grid-template-columns: 1fr; min-height: calc(100vh - 65px); }
@media (min-width: 900px) { .login-shell { grid-template-columns: 1.1fr 1fr; } }
.login-brand { background: radial-gradient(120% 90% at 0% 0%, #1f2a1f 0%, #0b0b0b 55%, #000 100%); color: #fff; border-bottom: 4px solid var(--brand-green); padding: 2.5rem 1.5rem; display: flex; align-items: center; position: relative; overflow: hidden; }
@media (min-width: 900px) { .login-brand { border-bottom: 0; border-right: 4px solid var(--brand-green); padding: 3rem; } }
.login-brand::after { content: ""; position: absolute; right: -120px; bottom: -120px; width: 380px; height: 380px; border-radius: 50%; background: radial-gradient(circle, rgba(57,181,74,.22), rgba(57,181,74,0) 70%); pointer-events: none; }
.login-brand-inner { max-width: 520px; margin: 0 auto; position: relative; z-index: 1; }
.login-mark { width: 84px; height: 84px; background: #fff; border-radius: 22px; display: grid; place-items: center; box-shadow: 0 10px 30px rgba(0,0,0,.35); margin-bottom: 1.5rem; }
.login-mark img { height: 64px; width: auto; }
.login-brand h1 { font-size: clamp(1.6rem, 3.2vw, 2.3rem); line-height: 1.15; margin-bottom: 1.5rem; letter-spacing: -.01em; }
.login-points { list-style: none; padding: 0; margin: 0 0 1.5rem; display: grid; gap: 1rem; }
.login-points li { display: flex; gap: .85rem; align-items: flex-start; }
.login-points li > span { flex: 0 0 28px; height: 28px; border-radius: 50%; background: var(--brand-green); color: #000; font-weight: 800; display: grid; place-items: center; font-size: .9rem; }
.login-points strong { display: block; font-size: 1.02rem; }
.login-points div { color: rgba(255,255,255,.78); font-size: .95rem; }
.login-points strong { color: #fff; }
.login-trust { color: rgba(255,255,255,.7); font-size: .9rem; border-top: 1px solid rgba(255,255,255,.12); padding-top: 1rem; margin: 0; }
.login-form-side { display: flex; flex-direction: column; justify-content: center; align-items: center; padding: 2rem 1.25rem; background: var(--bg); }
.login-card { width: 100%; max-width: 420px; background: #fff; border-radius: 16px; box-shadow: 0 1px 2px rgba(16,24,40,.06), 0 12px 40px rgba(16,24,40,.10); padding: 2rem; border-top: 4px solid var(--brand-green); }
.login-card h2 { font-size: 1.45rem; }
.login-card input { font-size: 1.05rem; padding: .8rem .9rem; }
.btn-block { width: 100%; justify-content: center; margin-top: 1.25rem; padding: .9rem 1rem; font-size: 1.05rem; }
.login-sent { text-align: center; padding: .5rem 0; }
.login-sent-icon { width: 64px; height: 64px; border-radius: 50%; background: var(--green-light); color: var(--green-dark); display: grid; place-items: center; font-size: 1.8rem; margin: 0 auto 1rem; }
.login-legal { margin: 1.25rem 0 0; text-align: center; }
.login-911 { margin-top: 1rem; }
body.is-login > footer { display: none; }

#view-login { padding: 0; }
@media (max-width: 899px) {
  .login-form-side { order: -1; padding-top: 1.25rem; }
  .login-brand { padding: 2rem 1.5rem; }
  .login-mark { display: none; }
  .login-brand h1 { font-size: 1.35rem; }
}

/* ---------- thumbnails, inventory ---------- */
.thumb { width: 64px; height: 64px; border-radius: 10px; object-fit: cover; border: 1px solid var(--line); background: #f2f4f2; display: block; }
.thumb-add { display: grid; place-items: center; align-content: center; cursor: pointer; color: var(--green); font-size: 1.3rem; line-height: 1; border-style: dashed; }
.thumb-add span { font-size: .7rem; color: var(--muted); }
.thumb-empty { display: grid; place-items: center; font-size: .7rem; color: var(--muted); text-align: center; }
.inv-item { display: grid; grid-template-columns: auto 1fr auto; gap: .9rem; align-items: start; padding: .9rem 0; border-top: 1px solid var(--line); }
.inv-item:first-of-type { border-top: 0; }
.inv-photos { display: flex; gap: .35rem; flex-wrap: wrap; max-width: 140px; }
.inv-body .pill { margin-left: .35rem; background: #eef1ee; color: #3b4652; }
@media (max-width: 640px) { .inv-item { grid-template-columns: 1fr; } .inv-photos { max-width: none; } }
.stat-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: .75rem; margin-top: 1rem; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: .9rem 1rem; border-top: 3px solid var(--brand-green); }
.stat-num { font-size: 1.4rem; font-weight: 800; }
.stat-label { color: var(--muted); font-size: .85rem; }

/* ---------- sharing ---------- */
.chip { display: inline-block; background: #eef1ee; color: #3b4652; border-radius: 999px; padding: .1rem .55rem; font-size: .78rem; margin: .15rem .15rem 0 0; }
.scope-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: .5rem; margin: .5rem 0 1rem; }
.scope { display: flex; gap: .6rem; align-items: flex-start; border: 1px solid var(--line); border-radius: 10px; padding: .65rem .75rem; cursor: pointer; font-weight: 400; background: #fff; }
.scope input { width: auto; margin-top: .2rem; }
.scope small { display: block; color: var(--muted); font-size: .8rem; }
.scope:has(input:checked) { border-color: var(--green); background: var(--green-light); }
.scope-sensitive strong::after { content: " 🔒"; font-size: .8em; }
.share-link { display: flex; gap: .5rem; }
.share-link input { flex: 1; font-family: ui-monospace, Menlo, monospace; font-size: .85rem; }

/* ===== Mission section (homepage) ===== */
.mission { background: #fff; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 3.5rem 0; }
.mission .eyebrow { display: inline-block; font-size: .8rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--green-dark); background: var(--green-light); padding: .25rem .65rem; border-radius: 999px; margin-bottom: .9rem; }
.mission-head { max-width: 780px; }
.mission-head h2 { font-size: clamp(1.45rem, 3vw, 2rem); }
.mission-head p { font-size: 1.08rem; color: var(--muted); }
.mission-why { margin-top: 2rem; gap: 2rem; }
.mission-why p { color: var(--muted); }
.mission-list { list-style: none; padding: 0; margin: 0; display: grid; gap: .75rem; }
.mission-list li { padding-left: 1.6rem; position: relative; color: var(--muted); }
.mission-list li::before { content: ""; position: absolute; left: 0; top: .4rem; width: .8rem; height: .8rem; border-radius: 50%; background: var(--brand-green); }
.mission-list strong { color: var(--ink); }
.mission-sub { margin-top: 2.5rem; }
.stages { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .75rem; margin-top: .75rem; }
.stage { background: linear-gradient(160deg, #000 0%, #1c1c1c 80%); color: #fff; border-radius: var(--radius); padding: 1rem; border-bottom: 3px solid var(--brand-green); display: flex; flex-direction: column; gap: .2rem; }
.stage span { width: 26px; height: 26px; border-radius: 50%; background: var(--brand-green); color: #000; font-weight: 800; font-size: .85rem; display: grid; place-items: center; margin-bottom: .35rem; }
.stage small { color: #c9d2cc; line-height: 1.35; }
.mission-note { margin-top: 1rem; color: var(--muted); font-size: .95rem; }
.site-header nav a { white-space: nowrap; }
@media (max-width: 560px) { .site-header .nav-mission { display: none; } }
.site-header nav { display: flex; align-items: center; gap: 1rem; flex-wrap: nowrap; }
@media (max-width: 560px) { .site-header .brand .tag { display: none; } }
.site-header nav a, .site-header nav a.btn { margin-left: 0; }
@media (max-width: 400px) { .site-header nav { gap: .75rem; } }
