:root {
    color-scheme: light;
    --ink: #11212b;
    --muted: #62727c;
    --paper: #f7fafb;
    --card: #ffffff;
    --line: #dce5ea;
    --accent: #176b87;
    --accent-dark: #0d4e65;
    --danger: #9e2f2f;
    --warning: #825d12;
    --shadow: 0 16px 45px rgba(24, 54, 70, .10);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html { background: var(--paper); color: var(--ink); }
body { margin: 0; min-height: 100vh; background: linear-gradient(180deg, #edf6f8 0, var(--paper) 30rem); }
a { color: var(--accent-dark); }
button, input, select { font: inherit; }
.site-header { min-height: 68px; display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .8rem clamp(1rem, 4vw, 3.5rem); border-bottom: 1px solid rgba(17,33,43,.08); background: rgba(255,255,255,.88); backdrop-filter: blur(14px); position: sticky; top: 0; z-index: 20; }
.brand { color: var(--ink); text-decoration: none; font-weight: 800; letter-spacing: -.025em; font-size: 1.15rem; }
.nav { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: .8rem 1rem; }
.nav a, .link-button { text-decoration: none; font-weight: 650; }
.nav-user { color: var(--muted); font-size: .92rem; }
.inline-form { display: inline; margin: 0; }
.link-button { appearance: none; border: 0; background: none; color: var(--accent-dark); cursor: pointer; padding: 0; }
.page-shell { width: min(1440px, calc(100% - 2rem)); margin: 0 auto; padding: clamp(1.2rem, 3vw, 2.5rem) 0 4rem; }
.hero, .state-hero, .upload-heading { display: flex; justify-content: space-between; align-items: end; gap: 2rem; margin: 1rem 0 2rem; }
.hero h1, .state-hero h1, .upload-heading h1 { font-size: clamp(2.2rem, 5vw, 5rem); max-width: 14ch; line-height: .98; letter-spacing: -.055em; margin: .2rem 0 .8rem; }
.hero-copy { max-width: 68ch; color: var(--muted); font-size: 1.08rem; line-height: 1.7; }
.eyebrow { text-transform: uppercase; letter-spacing: .13em; font-size: .76rem; font-weight: 850; color: var(--accent); margin: 0 0 .7rem; }
.button { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: .75rem 1.05rem; border: 0; border-radius: 999px; background: var(--accent-dark); color: white; text-decoration: none; font-weight: 800; cursor: pointer; white-space: nowrap; }
.button:hover { background: #073b4d; }
.button:disabled { opacity: .55; cursor: wait; }
.button-small { min-height: 36px; padding: .5rem .8rem; }
.card { background: rgba(255,255,255,.92); border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow); padding: clamp(1rem, 2vw, 1.6rem); }
.map-layout { display: grid; grid-template-columns: minmax(0, 1fr) 230px; gap: 1rem; align-items: stretch; }
.map-shell { min-width: 0; min-height: 610px; position: relative; background: radial-gradient(circle at 45% 40%, #ffffff 0, #eaf3f6 72%); border: 1px solid var(--line); border-radius: 24px; overflow: visible; box-shadow: var(--shadow); }
.us-map { width: 100%; height: 610px; }
.state-anchors { position: absolute; inset: 0; pointer-events: none; z-index: 8; overflow: visible; }
.state-dom-anchor { position: absolute; pointer-events: none; overflow: visible; }
.state-hover-card { position: absolute; left: 50%; bottom: calc(100% + 10px); transform: translateX(-50%); display: grid; gap: .35rem; width: min(320px, 72vw); background: rgba(12, 31, 41, .96); color: white; padding: .85rem 1rem; border-radius: 14px; box-shadow: 0 18px 45px rgba(0,0,0,.28); z-index: 30; pointer-events: none; font-size: .86rem; line-height: 1.35; }
.state-hover-card::after { content: ""; position: absolute; left: 50%; top: 100%; transform: translateX(-50%); border: 7px solid transparent; border-top-color: rgba(12,31,41,.96); }
.hover-eyebrow { color: #a8dbea; font-weight: 800; font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; }
.hover-title { font-size: 1.05rem; }
.hover-photo-meta { color: #c7e9f1; border-top: 1px solid rgba(255,255,255,.13); padding-top: .4rem; }
.map-loading { position: absolute; inset: auto 1rem 1rem; text-align: center; color: var(--muted); pointer-events: none; }
.map-loading.is-hidden { display: none; }
.small-states { display: grid; grid-template-columns: 1fr; align-content: start; gap: .55rem; }
.small-state-heading { display: grid; gap: .1rem; padding: .45rem .2rem .6rem; }
.small-state-heading span { color: var(--muted); font-size: .78rem; }
.small-state-card { min-height: 92px; position: relative; display: grid; grid-template-columns: 94px 1fr; align-items: center; gap: .7rem; background: white; border: 1px solid var(--line); border-radius: 15px; padding: .45rem .65rem; color: var(--ink); text-decoration: none; box-shadow: 0 6px 20px rgba(24,54,70,.06); }
.small-state-card:hover { border-color: #9ac6d5; transform: translateY(-1px); }
.small-state-card svg { width: 92px; height: 72px; overflow: visible; }
.small-state-label { display: grid; gap: .15rem; min-width: 0; }
.small-state-label strong { font-size: .91rem; }
.small-state-label span { color: var(--muted); font-size: .75rem; }
.small-state-hover { left: auto; right: calc(100% + 10px); bottom: 50%; transform: translateY(50%); }
.small-state-hover::after { left: 100%; top: 50%; transform: translateY(-50%); border-top-color: transparent; border-left-color: rgba(12,31,41,.96); }
.map-help { margin-top: 1rem; }
.map-help h2, .card h2 { margin-top: 0; }
.state-grid { display: grid; grid-template-columns: minmax(0, .9fr) minmax(300px, 1.1fr); gap: 1rem; margin-bottom: 1rem; }
.facts-list { display: grid; gap: .35rem; margin: 0 0 1.4rem; }
.facts-list div { display: grid; grid-template-columns: 120px 1fr; gap: 1rem; padding: .55rem 0; border-bottom: 1px solid var(--line); }
.facts-list dt { color: var(--muted); }
.facts-list dd { margin: 0; font-weight: 700; }
.state-photo { display: block; width: 100%; max-height: 520px; object-fit: cover; border-radius: 14px; border: 1px solid var(--line); }
.empty-photo { min-height: 300px; display: grid; place-items: center; text-align: center; color: var(--muted); border: 1px dashed #b8c9d2; border-radius: 14px; padding: 2rem; background: #f6fafb; }
.recent-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .8rem; }
.recent-photo { display: grid; gap: .35rem; text-decoration: none; color: var(--ink); }
.recent-photo img { width: 100%; aspect-ratio: 4/3; object-fit: cover; border-radius: 12px; }
.recent-photo span { font-size: .82rem; color: var(--muted); }
.auth-card { width: min(620px, 100%); margin: 2rem auto; }
.stack-form { display: grid; gap: 1rem; }
.stack-form label, .upload-controls label { display: grid; gap: .4rem; font-weight: 750; }
input, select { width: 100%; min-height: 46px; padding: .65rem .75rem; border: 1px solid #bccbd3; border-radius: 10px; background: white; color: var(--ink); }
input:focus, select:focus { outline: 3px solid rgba(23,107,135,.16); border-color: var(--accent); }
.notice { border-radius: 12px; padding: .8rem 1rem; margin: .8rem 0; background: #edf5f7; }
.notice ul { margin: 0; padding-left: 1.2rem; }
.notice-error { background: #faeeee; color: var(--danger); border: 1px solid #e9c3c3; }
.notice-warning { background: #fff8e7; color: var(--warning); border: 1px solid #ead8a7; }
.upload-grid { display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: 1rem; align-items: start; }
.upload-controls { display: grid; gap: 1rem; }
.crop-card { min-height: 620px; display: grid; place-items: center; overflow: hidden; background: radial-gradient(circle, #eaf5f7 0, #dce9ee 100%); }
.crop-source { position: fixed; left: -10000px; top: -10000px; width: 600px; height: 500px; pointer-events: none; visibility: hidden; }
.crop-stage { width: 100%; height: min(68vh, 620px); touch-action: none; cursor: grab; user-select: none; }
.crop-stage.is-dragging { cursor: grabbing; }
.crop-placeholder { fill: #c9dbe3; }
.crop-outline { fill: rgba(255,255,255,.035); stroke: #ffffff; stroke-width: 1.8; vector-effect: non-scaling-stroke; }
.muted, .fine-print { color: var(--muted); }
.fine-print { font-size: .82rem; line-height: 1.55; }
.site-footer { display: flex; justify-content: space-between; gap: 1rem; width: min(1440px, calc(100% - 2rem)); margin: 0 auto; padding: 1.5rem 0 2.5rem; color: var(--muted); border-top: 1px solid var(--line); font-size: .85rem; }
@media (max-width: 980px) {
    .map-layout { grid-template-columns: 1fr; }
    .small-states { grid-template-columns: repeat(3, minmax(0,1fr)); }
    .small-state-heading { grid-column: 1 / -1; }
    .small-state-card { grid-template-columns: 72px 1fr; }
    .small-state-card svg { width: 70px; height: 58px; }
    .small-state-hover { display: none; }
    .upload-grid { grid-template-columns: 1fr; }
    .upload-controls { order: 2; }
    .state-grid { grid-template-columns: 1fr; }
}
@media (max-width: 680px) {
    .site-header { align-items: flex-start; }
    .nav { font-size: .88rem; gap: .5rem .7rem; }
    .nav-user { display: none; }
    .hero, .state-hero, .upload-heading { align-items: flex-start; flex-direction: column; }
    .hero h1, .state-hero h1, .upload-heading h1 { font-size: clamp(2.4rem, 14vw, 4rem); }
    .map-shell, .us-map { min-height: 450px; height: 450px; }
    .small-states { grid-template-columns: repeat(2, minmax(0,1fr)); }
    .small-state-card { grid-template-columns: 1fr; text-align: center; }
    .small-state-card svg { margin: auto; }
    .facts-list div { grid-template-columns: 1fr; gap: .1rem; }
    .crop-card { min-height: 440px; }
    .crop-stage { height: 420px; }
}
