/* AgriHub design system. Self-hosted font, no inline styles (the CSP forbids them). */
@font-face {
  font-family: "Inter"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url("../fonts/inter-latin-ext-wght-normal.woff2") format("woff2-variations");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Inter"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url("../fonts/inter-latin-wght-normal.woff2") format("woff2-variations");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --blue: #1f4e9e; --blue-deep: #143a78; --blue-soft: #e9f0fb;
  --green: #0b7a35; --green-deep: #075a28; --green-soft: #e6f4ea;
  --gold: #f2b705; --amber-soft: #fff6dc; --amber: #8a6200;
  --ink: #0f1f38; --text: #26364f; --muted: #5b6b82; --faint: #8a97aa;
  --bg: #f4f7f5; --surface: #ffffff; --line: #e1e8e3; --line-strong: #cdd7d0;
  --danger: #b3261e; --danger-soft: #fdecea;
  --radius-sm: 8px; --radius: 12px; --radius-lg: 18px;
  --shadow-sm: 0 1px 2px rgba(15, 31, 56, .06);
  --shadow: 0 1px 2px rgba(15, 31, 56, .05), 0 8px 24px rgba(15, 31, 56, .07);
  --shadow-lg: 0 24px 60px rgba(15, 31, 56, .22);
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; font-family: var(--font); font-size: 15px; line-height: 1.6; color: var(--text);
  background: var(--bg); -webkit-font-smoothing: antialiased; min-height: 100vh;
  display: flex; flex-direction: column;
}
h1, h2, h3, h4 { color: var(--ink); line-height: 1.25; margin: 0 0 .5rem; letter-spacing: -.015em; }
h1 { font-size: clamp(1.6rem, 2.4vw, 2rem); font-weight: 750; }
h2 { font-size: 1.25rem; font-weight: 700; }
h3 { font-size: 1.05rem; font-weight: 650; }
h4 { font-size: .95rem; font-weight: 650; margin-top: 1.25rem; }
p { margin: 0 0 .75rem; }
a { color: var(--blue); text-underline-offset: 3px; }
a:hover { color: var(--blue-deep); }
code { font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; font-size: .86em; background: #eef3ef; padding: .1em .4em; border-radius: 6px; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid rgba(31, 78, 158, .45); outline-offset: 2px; border-radius: 6px; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.container { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 1.25rem; }
.container-narrow { max-width: 780px; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem; width: 100%;
  min-height: 44px; padding: .6rem 1.15rem; border: 1px solid transparent; border-radius: var(--radius);
  background: var(--blue); color: #fff; font: inherit; font-weight: 600; text-decoration: none; cursor: pointer;
  transition: background .15s, box-shadow .15s, transform .05s, border-color .15s; box-shadow: var(--shadow-sm);
}
.btn:hover { background: var(--blue-deep); color: #fff; }
.btn:active { transform: translateY(1px); }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .55; cursor: not-allowed; box-shadow: none; }
.btn-auto { width: auto; }
.btn-green { background: var(--green); } .btn-green:hover { background: var(--green-deep); }
.btn-quiet { background: var(--surface); color: var(--blue); border-color: var(--line-strong); box-shadow: none; }
.btn-quiet:hover { background: var(--blue-soft); color: var(--blue-deep); border-color: #b7c9e8; }
.btn-danger { background: var(--danger); } .btn-danger:hover { background: #8f1d17; }
.btn-sm { min-height: 36px; padding: .35rem .8rem; font-size: .88rem; border-radius: 10px; }
.btn svg { width: 1.1em; height: 1.1em; flex: none; }
.link-button { background: none; border: 0; padding: 0; font: inherit; color: var(--blue); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.link-button[disabled] { color: var(--faint); cursor: default; text-decoration: none; }
.link-button.danger { color: var(--danger); }
.button-row { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem; margin-top: 1rem; }

/* ---------- forms ---------- */
.field { margin-bottom: 1.1rem; }
label, .label { display: block; font-weight: 600; font-size: .9rem; color: var(--ink); margin-bottom: .35rem; }
input[type="text"], input[type="email"], input[type="password"], input[type="tel"], input[type="number"],
input[type="datetime-local"], input[type="search"], select, textarea {
  width: 100%; min-height: 46px; padding: .6rem .85rem; font: inherit; color: var(--ink);
  background: #fff; border: 1px solid var(--line-strong); border-radius: var(--radius);
  transition: border-color .15s, box-shadow .15s;
}
input::placeholder { color: var(--faint); }
input:hover, select:hover { border-color: #aebdb3; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 4px rgba(31, 78, 158, .14); }
input[readonly] { background: #f4f7f5; color: var(--muted); }
input[aria-invalid="true"] { border-color: var(--danger); box-shadow: 0 0 0 4px rgba(179, 38, 30, .1); }
input[type="file"] { font: inherit; font-size: .9rem; max-width: 100%; }
input[type="file"]::file-selector-button { font: inherit; font-weight: 600; margin-right: .75rem; padding: .45rem .9rem; border: 1px solid var(--line-strong); border-radius: 10px; background: #fff; color: var(--blue); cursor: pointer; }
.hint { font-size: .83rem; color: var(--muted); margin: .35rem 0 0; }
.field-error { font-size: .83rem; color: var(--danger); margin: .35rem 0 0; font-weight: 500; }
.password-wrap { position: relative; }
.password-wrap input { padding-right: 4.5rem; }
.toggle-password { position: absolute; right: .5rem; top: 50%; transform: translateY(-50%); background: none; border: 0; padding: .4rem .55rem; font: inherit; font-size: .85rem; font-weight: 600; color: var(--blue); cursor: pointer; border-radius: 8px; }
.toggle-password:hover { background: var(--blue-soft); }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 1.25rem; }
.inline-form { display: flex; gap: .75rem; align-items: flex-start; }
.inline-form .field { flex: 1; margin-bottom: 0; }
.otp-input { font-size: 1.7rem !important; letter-spacing: .5rem; text-align: center; font-variant-numeric: tabular-nums; font-weight: 650; }
.segmented { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; margin: 0 0 1.4rem; border: 1px solid var(--line-strong); border-radius: var(--radius); background: #eef3ef; }
.segmented legend { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.segmented label { margin: 0; cursor: pointer; }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented span { display: block; text-align: center; padding: .6rem; border-radius: 9px; font-weight: 600; color: var(--muted); transition: background .15s, color .15s, box-shadow .15s; }
.segmented input:checked + span { background: #fff; color: var(--blue); box-shadow: var(--shadow-sm); }
.segmented input:focus-visible + span { outline: 3px solid rgba(31, 78, 158, .45); }
.consent { display: flex; gap: .7rem; align-items: flex-start; padding: .9rem 1rem; border: 1px solid var(--line-strong); border-radius: var(--radius); background: #fafcfa; margin-bottom: 1.1rem; }
.consent input { width: 20px; height: 20px; margin: .15rem 0 0; flex: none; accent-color: var(--blue); }
.consent label { font-weight: 450; font-size: .88rem; color: var(--text); margin: 0; line-height: 1.55; }

/* ---------- auth pages ---------- */
.auth { flex: 1; display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); min-height: 100vh; }
.auth-brand {
  position: relative; overflow: hidden; color: #fff; padding: clamp(2rem, 5vw, 4.5rem);
  display: flex; flex-direction: column; justify-content: space-between; gap: 2rem;
  background: radial-gradient(1200px 600px at -10% -10%, #2a6bc9 0%, transparent 60%),
              radial-gradient(900px 500px at 110% 110%, #0f9a47 0%, transparent 55%), linear-gradient(160deg, #143a78, #0b5a3a);
}
.auth-brand::after { content: ""; position: absolute; inset: 0; background-image: radial-gradient(rgba(255,255,255,.09) 1px, transparent 1px); background-size: 22px 22px; mask-image: linear-gradient(180deg, transparent, #000 40%, transparent); pointer-events: none; }
.auth-brand > * { position: relative; z-index: 1; }
.auth-logo-wrap { display: inline-flex; align-items: center; gap: .85rem; }
.auth-logo { width: 84px; height: 84px; object-fit: contain; background: #fff; border-radius: 50%; padding: 7px; box-shadow: 0 8px 24px rgba(0,0,0,.2); }
.auth-logo-name { font-size: 1.5rem; font-weight: 750; letter-spacing: -.02em; }
.auth-title { color: #fff; font-size: clamp(2rem, 3.4vw, 3rem); font-weight: 780; max-width: 15ch; letter-spacing: -.025em; margin-bottom: .75rem; }
.auth-byline { display: inline-block; font-weight: 600; font-size: .85rem; letter-spacing: .04em; text-transform: uppercase; color: #bfe8cc; margin-bottom: 1rem; }
.auth-lede { max-width: 44ch; color: rgba(255,255,255,.86); font-size: 1.05rem; margin: 0 0 1.75rem; }
.auth-points { list-style: none; margin: 0; padding: 0; display: grid; gap: .8rem; }
.auth-points li { display: flex; gap: .75rem; align-items: flex-start; color: rgba(255,255,255,.92); font-size: .95rem; }
.auth-points svg { width: 22px; height: 22px; flex: none; color: #8de0ae; margin-top: 1px; }
.auth-brand-foot { font-size: .8rem; color: rgba(255,255,255,.65); }
.auth-brand-foot a { color: rgba(255,255,255,.85); }
.auth-form-panel { display: flex; flex-direction: column; justify-content: center; align-items: center; padding: 2rem 1.25rem; background: var(--bg); }
.auth-card { width: 100%; max-width: 460px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow); padding: clamp(1.5rem, 4vw, 2.25rem); }
.auth-card h2 { font-size: 1.6rem; font-weight: 750; }
.auth-card .muted { margin-bottom: 1.4rem; }
.switch { text-align: center; margin: 1.25rem 0 0; color: var(--muted); }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin: -.4rem 0 1.1rem; font-size: .88rem; }
.auth-legal { max-width: 460px; width: 100%; text-align: center; font-size: .8rem; color: var(--faint); margin-top: 1.25rem; }
.auth-legal a { color: var(--muted); }
.success-mark { width: 64px; height: 64px; border-radius: 50%; background: var(--green-soft); color: var(--green); display: grid; place-items: center; margin: 0 auto 1rem; }
.success-mark svg { width: 32px; height: 32px; }
.center { text-align: center; }

/* ---------- app shell ---------- */
.site-header { position: sticky; top: 0; z-index: 40; background: rgba(255,255,255,.92); backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--line); }
.site-header .container { display: flex; align-items: center; justify-content: space-between; min-height: 66px; gap: 1rem; }
.brand { display: inline-flex; align-items: center; gap: .65rem; text-decoration: none; color: var(--ink); font-weight: 750; font-size: 1.15rem; letter-spacing: -.02em; }
.brand img { width: 38px; height: auto; }
.brand:hover { color: var(--ink); }
.main-nav { display: flex; gap: .25rem; margin-right: auto; margin-left: 1.5rem; }
.main-nav a { padding: .45rem .85rem; border-radius: 10px; text-decoration: none; color: var(--muted); font-weight: 550; }
.main-nav a:hover { background: #eef3ef; color: var(--ink); }
.main-nav a[aria-current="page"] { background: var(--blue-soft); color: var(--blue); }
.user-menu { position: relative; }
.user-button { display: inline-flex; align-items: center; gap: .6rem; padding: .3rem .55rem .3rem .3rem; border: 1px solid var(--line-strong); border-radius: 999px; background: #fff; cursor: pointer; font: inherit; color: var(--ink); }
.user-button:hover { background: #f4f7f5; }
.user-name { font-weight: 600; font-size: .9rem; max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-button svg { width: 16px; height: 16px; color: var(--muted); }
.avatar { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; background: linear-gradient(135deg, var(--blue), var(--green)); color: #fff; display: inline-grid; place-items: center; font-weight: 700; font-size: .85rem; flex: none; overflow: hidden; }
.avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.avatar-lg { width: 96px; height: 96px; font-size: 2rem; }
.menu { position: absolute; right: 0; top: calc(100% + 8px); min-width: 250px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-lg); padding: .4rem; z-index: 50; }
.menu-head { padding: .7rem .8rem .75rem; border-bottom: 1px solid var(--line); margin-bottom: .35rem; }
.menu-head strong { display: block; color: var(--ink); overflow: hidden; text-overflow: ellipsis; }
.menu-head span { font-size: .82rem; color: var(--muted); overflow-wrap: anywhere; }
.menu a, .menu button { display: flex; align-items: center; gap: .65rem; width: 100%; padding: .6rem .8rem; border: 0; border-radius: 9px; background: none; font: inherit; color: var(--text); text-align: left; text-decoration: none; cursor: pointer; }
.menu a:hover, .menu button:hover { background: #f1f5f2; color: var(--ink); }
.menu svg { width: 18px; height: 18px; color: var(--muted); flex: none; }
.menu .menu-danger { color: var(--danger); } .menu .menu-danger svg { color: var(--danger); }
.shell-main { flex: 1; width: 100%; max-width: 1120px; margin: 0 auto; padding: 2rem 1.25rem 3rem; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 1.5rem; flex-wrap: wrap; margin-bottom: 1.5rem; }
.page-head p { margin: 0; }
.breadcrumb { margin: 0 0 .75rem; font-size: .9rem; }
.breadcrumb a { text-decoration: none; font-weight: 550; }
.lede { max-width: 62ch; margin-bottom: 1.5rem; }
.site-footer { border-top: 1px solid var(--line); background: #fff; padding: 1.25rem 0; font-size: .85rem; color: var(--muted); }
.site-footer .container { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .75rem 1.5rem; }
.site-footer nav { display: flex; gap: 1.25rem; flex-wrap: wrap; }
.site-footer a { color: var(--muted); text-decoration: none; } .site-footer a:hover { color: var(--blue); text-decoration: underline; }

/* ---------- cards, panels, chips ---------- */
.panel, .card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); padding: clamp(1.1rem, 2.5vw, 1.75rem); margin-bottom: 1.25rem; }
.panel > h2 { display: flex; align-items: center; gap: .75rem; margin-bottom: .35rem; }
.step-badge { width: 28px; height: 28px; border-radius: 50%; background: var(--blue); color: #fff; display: inline-grid; place-items: center; font-size: .85rem; font-weight: 700; flex: none; }
.chip { display: inline-flex; align-items: center; gap: .35rem; padding: .18rem .65rem; border-radius: 999px; font-size: .78rem; font-weight: 650; white-space: nowrap; }
.chip::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.chip-ok { background: var(--green-soft); color: var(--green-deep); }
.chip-todo { background: var(--amber-soft); color: var(--amber); }
.chip-info { background: var(--blue-soft); color: var(--blue); }
.note { display: flex; gap: .75rem; padding: .9rem 1rem; border-radius: var(--radius); background: var(--blue-soft); color: #1d3f78; font-size: .9rem; margin: 1rem 0; }
.note svg { width: 20px; height: 20px; flex: none; margin-top: 1px; }
.note-warn { background: var(--amber-soft); color: #6b4c00; }
.cta-card { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; background: linear-gradient(120deg, var(--blue-soft), var(--green-soft)); border: 1px solid #cfe0d6; border-radius: var(--radius-lg); padding: 1.1rem 1.4rem; margin-bottom: 1.5rem; }
.cta-card strong { color: var(--ink); display: block; }
.stat-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; margin-bottom: 1.75rem; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 1.1rem 1.25rem; box-shadow: var(--shadow-sm); display: flex; gap: .9rem; align-items: center; }
.stat-icon { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--blue-soft); color: var(--blue); flex: none; }
.stat-icon svg { width: 22px; height: 22px; }
.stat-icon.green { background: var(--green-soft); color: var(--green); }
.stat-icon.gold { background: var(--amber-soft); color: var(--amber); }
.stat b { display: block; font-size: 1.6rem; line-height: 1.1; color: var(--ink); font-weight: 750; }
.stat span { font-size: .85rem; color: var(--muted); }

/* farm cards */
.farm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 1.1rem; }
.farm-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 1.25rem; box-shadow: var(--shadow-sm); display: flex; flex-direction: column; gap: .9rem; transition: box-shadow .2s, transform .2s, border-color .2s; }
.farm-card:hover { box-shadow: var(--shadow); border-color: var(--line-strong); transform: translateY(-1px); }
.farm-card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: .75rem; }
.farm-card h3 { margin: 0; font-size: 1.1rem; }
.farm-meta { display: grid; gap: .55rem; margin: 0; }
.farm-meta div { display: flex; gap: .6rem; align-items: flex-start; font-size: .9rem; }
.farm-meta dt { color: var(--muted); min-width: 92px; }
.farm-meta dd { margin: 0; color: var(--ink); font-weight: 500; overflow-wrap: anywhere; }
.farm-actions { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: auto; }
.shell-main > p.small { margin-top: 1.5rem; }
.empty { text-align: center; padding: 3rem 1.5rem; background: #fff; border: 1px dashed var(--line-strong); border-radius: var(--radius-lg); }
.empty svg { width: 44px; height: 44px; color: var(--green); margin-bottom: .75rem; }
.farm-list { list-style: none; margin: 0 0 1.25rem; padding: 0; display: grid; gap: .75rem; }
.farm-row { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: .9rem 1.1rem; }
.farm-row strong { margin-right: .75rem; }
.farm-row-actions { display: flex; gap: .75rem; align-items: center; }
.progress-line { font-weight: 650; color: var(--blue); margin-bottom: .9rem; }
.actions { margin-top: 1.5rem; }
.add-farm .btn { min-height: 46px; }

/* tables */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); }
.table { width: 100%; border-collapse: collapse; font-size: .9rem; background: #fff; }
.table th, .table td { text-align: left; padding: .7rem .95rem; border-bottom: 1px solid var(--line); }
.table thead th { background: #f4f7f5; font-size: .76rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 650; }
.table tbody tr:last-child th, .table tbody tr:last-child td { border-bottom: 0; }
.table tbody th { font-weight: 600; color: var(--ink); }
.table-compact th, .table-compact td { padding: .5rem .8rem; }

/* data source picker */
.source-options { border: 0; padding: 0; margin: 1rem 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .9rem; }
.source-option { position: relative; display: block; margin: 0; cursor: pointer; font-weight: 400; }
.source-option input { position: absolute; opacity: 0; pointer-events: none; }
.source-card { display: flex; flex-direction: column; gap: .35rem; height: 100%; padding: 1rem 1.1rem; border: 1.5px solid var(--line-strong); border-radius: var(--radius); background: #fff; transition: border-color .15s, background .15s, box-shadow .15s; }
.source-card strong { color: var(--ink); } .source-card span { font-size: .86rem; color: var(--muted); }
.source-option:hover .source-card { border-color: #9db4dc; }
.source-option input:checked + .source-card { border-color: var(--blue); background: var(--blue-soft); box-shadow: 0 0 0 3px rgba(31, 78, 158, .12); }
.source-option input:focus-visible + .source-card { outline: 3px solid rgba(31, 78, 158, .45); outline-offset: 2px; }
.source-panel { margin-top: 1.5rem; padding-top: 1.25rem; border-top: 1px solid var(--line); }
.copy-row { display: flex; gap: .6rem; margin-bottom: 1rem; }
.copy-row input { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .85rem; }
.copy-row .btn { width: auto; }
pre.code { background: #0f1f38; color: #e6eefc; padding: 1rem 1.1rem; border-radius: var(--radius); overflow-x: auto; font-size: .82rem; line-height: 1.6; }
.plain-list { margin: .25rem 0 1rem; padding-left: 1.2rem; } .plain-list li { margin: .25rem 0; }
.kv { display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; margin: 0 0 1rem; color: var(--muted); font-size: .9rem; }
.kv b { color: var(--ink); font-weight: 600; }
.progress { display: flex; gap: 6px; margin: .5rem 0 .25rem; }
.progress i { flex: 1; height: 8px; border-radius: 99px; background: #e4ebe6; max-width: 56px; }
.progress i.on { background: var(--green); }

/* map picker */
.map-wrap { margin: .5rem 0 1.25rem; }
.map-search { position: relative; margin-bottom: .75rem; }
.map-search input { padding-left: 2.6rem; }
.map-search > svg { position: absolute; left: .85rem; top: 13px; width: 20px; height: 20px; color: var(--faint); pointer-events: none; }
.map-results { position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 1100; list-style: none; margin: 0; padding: .35rem; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-lg); max-height: 280px; overflow-y: auto; }
.map-results button { display: block; width: 100%; text-align: left; border: 0; background: none; padding: .55rem .7rem; border-radius: 8px; font: inherit; cursor: pointer; color: var(--text); }
.map-results button:hover, .map-results button:focus { background: var(--blue-soft); outline: none; }
.map-results small { display: block; color: var(--muted); }
.map-box { height: 380px; border-radius: var(--radius); border: 1px solid var(--line-strong); overflow: hidden; background: #e8eee9; z-index: 0; }
.map-help { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; align-items: center; margin-top: .6rem; }
.leaflet-container { font-family: var(--font); }

/* profile */
.profile-head { display: flex; align-items: center; gap: 1.5rem; flex-wrap: wrap; }
.profile-head .avatar-lg { box-shadow: 0 0 0 4px #fff, 0 0 0 5px var(--line-strong); }
.profile-head h2 { margin: 0; }
.account-card { display: grid; gap: .6rem; margin: 0; }
.account-card div { display: flex; gap: 1rem; } .account-card dt { min-width: 120px; color: var(--muted); } .account-card dd { margin: 0; color: var(--ink); font-weight: 500; }
.consent-row { display: flex; flex-wrap: wrap; gap: .5rem 1.25rem; font-size: .9rem; }

/* legal pages */
.legal-header { background: #fff; border-bottom: 1px solid var(--line); }
.legal-header .container { display: flex; justify-content: space-between; align-items: center; min-height: 66px; }
.legal-main { flex: 1; width: 100%; max-width: 820px; margin: 0 auto; padding: 2.5rem 1.25rem 4rem; }
.legal-main h1 { font-size: 2.1rem; }
.legal-meta { color: var(--muted); font-size: .9rem; margin-bottom: 1.75rem; }
.legal-main h2 { margin-top: 2rem; font-size: 1.2rem; padding-top: 1.25rem; border-top: 1px solid var(--line); }
.legal-main li { margin: .35rem 0; }
.legal-toc { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.25rem; margin-bottom: 1rem; columns: 2; font-size: .9rem; }
.legal-toc a { display: block; padding: .15rem 0; text-decoration: none; }
.share-grid { display: grid; gap: 1rem; margin: 1.25rem 0; }
.share-card { display: grid; grid-template-columns: 44px 1fr; gap: 1rem; background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 1.1rem 1.25rem; }
.share-card .stat-icon { align-self: start; }
.share-card h3 { margin-bottom: .25rem; }
.share-card ul { margin: .4rem 0 0; padding-left: 1.1rem; }
.share-tag { display: inline-block; font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; padding: .12rem .5rem; border-radius: 6px; margin-left: .5rem; vertical-align: middle; }
.tag-no { background: var(--green-soft); color: var(--green-deep); } .tag-yes { background: var(--blue-soft); color: var(--blue); } .tag-req { background: var(--amber-soft); color: var(--amber); }

/* ---------- popups (all messages) ---------- */
dialog.popup { border: 0; padding: 0; background: transparent; max-width: 440px; width: calc(100% - 2rem); color: var(--text); overflow: visible; }
dialog.popup::backdrop { background: rgba(15, 31, 56, .5); backdrop-filter: blur(3px); animation: fade .18s ease; }
.popup-card { background: #fff; border-radius: 20px; padding: 1.75rem 1.6rem 1.4rem; box-shadow: var(--shadow-lg); text-align: center; animation: pop .2s cubic-bezier(.2, .9, .3, 1.2); }
.popup-icon { width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; margin: 0 auto 1rem; }
.popup-icon svg { width: 28px; height: 28px; }
.popup-success .popup-icon { background: var(--green-soft); color: var(--green); }
.popup-error .popup-icon, .popup-danger .popup-icon { background: var(--danger-soft); color: var(--danger); }
.popup-info .popup-icon { background: var(--blue-soft); color: var(--blue); }
.popup-warning .popup-icon { background: var(--amber-soft); color: var(--amber); }
.popup-card h2 { font-size: 1.2rem; margin-bottom: .4rem; }
.popup-message { margin: 0 0 1.35rem; color: var(--muted); overflow-wrap: anywhere; white-space: pre-line; }
.popup-actions { display: flex; gap: .7rem; justify-content: center; }
.popup-actions .btn { width: auto; min-width: 110px; flex: 1; max-width: 190px; }
.popup-bar { height: 3px; border-radius: 3px; background: var(--green); margin-top: 1.1rem; transform-origin: left; animation: shrink linear forwards; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(10px) scale(.96); } }
@keyframes shrink { to { transform: scaleX(0); } }
@media (prefers-reduced-motion: reduce) { * { animation-duration: .01ms !important; scroll-behavior: auto !important; } }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .auth { grid-template-columns: 1fr; min-height: 0; }
  .auth-brand { padding: 1.75rem 1.5rem 2rem; gap: 1.25rem; }
  .auth-points, .auth-brand-foot { display: none; }
  .auth-title { font-size: 1.9rem; max-width: none; } .auth-lede { margin-bottom: 0; }
  .auth-logo { width: 64px; height: 64px; }
  .source-options { grid-template-columns: 1fr; }
  .stat-grid { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .grid-2 { grid-template-columns: 1fr; }
  .main-nav { display: none; }
  .user-name { display: none; }
  .farm-grid { grid-template-columns: 1fr; }
  .inline-form { flex-direction: column; } .inline-form .btn { width: 100%; }
  .page-head { align-items: flex-start; }
  .legal-toc { columns: 1; }
  .map-box { height: 320px; }
  .popup-actions { flex-direction: column-reverse; } .popup-actions .btn { max-width: none; }
}
