:root {
  --ink: #18261e;
  --forest: #233d2d;
  --forest-deep: #11271b;
  --brass: #987436;
  --paper: #f1eadb;
  --paper-light: #fbf7ed;
  --muted: #6e6759;
  --line: #b9aa8b;
  --red: #8b352e;
  --green: #386348;
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--forest-deep); }
body {
  margin: 0;
  color: var(--ink);
  font-family: Georgia, "Times New Roman", serif;
  background:
    radial-gradient(circle at 16% 8%, rgba(255,255,255,.78), transparent 24rem),
    repeating-linear-gradient(0deg, rgba(85,62,30,.022) 0, rgba(85,62,30,.022) 1px, transparent 1px, transparent 4px),
    var(--paper);
}
a { color: inherit; text-underline-offset: 4px; }
button, input, textarea, select { font: inherit; }

.masthead {
  min-height: 112px;
  padding: 20px clamp(22px, 5vw, 76px);
  color: #f5eedf;
  background: linear-gradient(90deg, rgba(255,255,255,.025) 1px, transparent 1px) 0 0 / 30px 30px, var(--forest-deep);
  border-bottom: 4px double var(--brass);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
}
.brand { display: flex; align-items: center; gap: 15px; text-decoration: none; }
.brand-mark { width: 72px; height: 72px; display: grid; place-items: center; border: 1px solid rgba(184,148,79,.62); border-radius: 50%; }
.brand-mark img { width: 61px; height: 61px; object-fit: contain; }
.brand-name { display: block; text-transform: uppercase; letter-spacing: .16em; font-size: clamp(1.1rem, 2vw, 1.5rem); }
.brand-subtitle { display: block; color: #c8b68f; font: 600 .67rem/1.4 Arial, sans-serif; letter-spacing: .18em; text-transform: uppercase; margin-top: 5px; }
.masthead-right { display: flex; align-items: center; gap: 28px; }
.member-identity { color: #c8b68f; font: .73rem/1.4 Arial, sans-serif; margin: 0; }
.member-identity strong { color: #f5eedf; }
.member-nav { display: flex; align-items: center; flex-wrap: wrap; gap: 18px; font: 700 .67rem/1 Arial, sans-serif; text-transform: uppercase; letter-spacing: .1em; }
.nav-link { color: #d8c8a6; text-decoration: none; padding: 10px 0; border-bottom: 1px solid transparent; }
.nav-link:hover, .nav-link.active { color: white; border-color: var(--brass); }
.inline-form { margin: 0; }
.nav-button { border: 1px solid rgba(200,182,143,.5); background: transparent; color: #d8c8a6; padding: 10px 12px; cursor: pointer; text-transform: inherit; letter-spacing: inherit; font: inherit; }

.login-shell, .workspace-shell, .narrow-shell, .legal-shell { width: min(1240px, calc(100% - 48px)); margin: 0 auto; }
.login-shell { min-height: calc(100vh - 182px); padding: clamp(58px, 8vw, 98px) 0; display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(330px, .72fr); gap: clamp(60px, 9vw, 125px); align-items: center; }
.eyebrow, .folio { margin: 0 0 14px; color: var(--brass); font: 700 .69rem/1.4 Arial, sans-serif; text-transform: uppercase; letter-spacing: .2em; }
h1 { margin: 0; color: var(--forest-deep); font-size: clamp(3rem, 6vw, 6rem); line-height: .96; letter-spacing: -.04em; font-weight: 400; }
h2, h3 { color: var(--forest-deep); font-weight: 400; }
.lede { max-width: 670px; margin: 28px 0 0; color: #4c4a40; font-size: clamp(1.03rem, 1.45vw, 1.2rem); line-height: 1.67; }
.principle-grid { margin-top: 34px; padding-top: 27px; border-top: 1px solid var(--line); display: grid; gap: 14px; }
.principle-grid article { display: grid; grid-template-columns: 135px 1fr; gap: 18px; }
.principle-grid h2 { margin: 0; font-size: .93rem; font-weight: 700; }
.principle-grid p { margin: 0; color: var(--muted); font: .82rem/1.55 Arial, sans-serif; }

.panel { position: relative; background: rgba(251,247,237,.88); border: 1px solid #947c4d; box-shadow: 0 19px 48px rgba(28,37,29,.13), inset 0 0 0 7px rgba(154,118,55,.055); padding: clamp(28px, 4vw, 48px); }
.panel::before { content: ""; position: absolute; inset: 11px; border: 1px solid rgba(154,118,55,.25); pointer-events: none; }
.panel > * { position: relative; }
.login-panel h2 { margin: 0; font-size: clamp(1.8rem, 3vw, 2.45rem); line-height: 1.08; }
.panel-intro { color: var(--muted); font: .9rem/1.55 Arial, sans-serif; margin: 13px 0 25px; }
.stacked-form { display: grid; gap: 10px; }
.stacked-form label, .grid-form label, .ask-form label, .inline-settings label, .review-form label { color: var(--forest); font: 700 .68rem/1.4 Arial, sans-serif; letter-spacing: .1em; text-transform: uppercase; }
input, textarea, select { width: 100%; border: 1px solid #aa9b7c; border-radius: 0; background: rgba(255,255,255,.56); color: var(--ink); padding: 11px 12px; outline: none; }
input, select { min-height: 45px; }
textarea { resize: vertical; line-height: 1.55; }
input:focus, textarea:focus, select:focus { border-color: var(--forest); box-shadow: 0 0 0 2px rgba(35,61,45,.12); }
.primary-button { border: 1px solid #102219; background: var(--forest); color: #fff8e9; min-height: 47px; padding: 12px 19px; font: 700 .72rem/1 Arial, sans-serif; text-transform: uppercase; letter-spacing: .12em; cursor: pointer; }
.primary-button:hover { background: #172d20; }
.stacked-form .primary-button { margin-top: 10px; }
.security-note, .field-help, .form-actions p, .source-note { color: #777062; font: .72rem/1.5 Arial, sans-serif; }
.security-note { padding-top: 17px; border-top: 1px solid var(--line); margin: 20px 0 0; }
.field-help { margin: -3px 0 3px; }
.notice { margin: 15px 0 20px; border-left: 4px solid var(--brass); padding: 12px 14px; font: .82rem/1.5 Arial, sans-serif; background: rgba(152,116,54,.08); }
.notice-error { border-color: var(--red); background: rgba(139,53,46,.08); }
.notice-success { border-color: var(--green); background: rgba(56,99,72,.08); }

.narrow-shell { max-width: 720px; min-height: calc(100vh - 182px); padding: 70px 0 90px; }
.document-panel h1 { font-size: clamp(2.3rem, 5vw, 4.1rem); margin-bottom: 20px; }
.summary-box { border: 1px solid var(--line); padding: 17px 20px; margin: 22px 0; background: rgba(240,231,212,.55); }
.summary-box p { font: .85rem/1.58 Arial, sans-serif; margin: 0 0 10px; }
.summary-box p:last-child { margin-bottom: 0; }
.check-row { display: grid !important; grid-template-columns: 20px 1fr; align-items: start; gap: 10px; text-transform: none !important; letter-spacing: 0 !important; font-weight: 400 !important; line-height: 1.5 !important; }
.check-row input { width: 17px; min-height: 17px; margin-top: 2px; }

.workspace-shell { min-height: calc(100vh - 182px); padding: 60px 0 90px; }
.workspace-heading { display: flex; justify-content: space-between; align-items: end; gap: 45px; margin-bottom: 34px; }
.workspace-heading h1 { font-size: clamp(2.8rem, 5vw, 5.1rem); }
.workspace-heading > div > p:last-child { max-width: 730px; color: var(--muted); font: .91rem/1.6 Arial, sans-serif; }
.quota-card, .health-card { min-width: 285px; border-top: 3px double var(--brass); border-bottom: 1px solid var(--line); padding: 17px 0; }
.quota-card > span, .health-card span { display: block; color: var(--brass); font: 700 .64rem/1.4 Arial, sans-serif; text-transform: uppercase; letter-spacing: .13em; }
.quota-card strong, .health-card strong { display: block; margin: 7px 0; font-size: 1.25rem; font-weight: 400; }
.quota-card small { color: var(--muted); font: .67rem/1.4 Arial, sans-serif; }
.meter { width: 100%; height: 8px; border: 1px solid #9c8e72; border-radius: 0; background: #e8dfcd; margin: 10px 0 8px; appearance: none; }
.meter::-webkit-progress-bar { background: #e8dfcd; }
.meter::-webkit-progress-value { background: var(--forest); }
.meter::-moz-progress-bar { background: var(--forest); }
.ask-panel { padding: 34px 38px; }
.ask-form { display: grid; gap: 12px; }
.ask-form > label { font-family: Georgia, serif; font-size: 1.18rem; font-weight: 400; text-transform: none; letter-spacing: 0; }
.ask-form textarea { background: rgba(255,255,255,.42); font-size: 1.03rem; }
.form-actions { display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.form-actions p { margin: 0; }
.form-actions .primary-button { min-width: 165px; }
.answer-card { margin-top: 28px; padding: clamp(30px, 5vw, 54px); background: var(--forest-deep); color: #f4eddc; border: 1px solid var(--brass); box-shadow: 0 18px 40px rgba(17,39,27,.2); }
.answer-card .folio { color: #c3a96f; }
.answer-card h2 { color: white; font-size: clamp(1.4rem, 2.5vw, 2.15rem); margin: 0 0 25px; }
.answer-text { white-space: pre-wrap; font: .96rem/1.72 Georgia, serif; }
.answer-card details { margin-top: 28px; padding-top: 17px; border-top: 1px solid rgba(195,169,111,.35); color: #d8c9aa; font: .72rem/1.55 Arial, sans-serif; }
.answer-card summary { cursor: pointer; text-transform: uppercase; letter-spacing: .09em; }
.answer-card li { margin-top: 7px; }
.answer-card .source-note { color: #c9ba9a; margin-top: 24px; }
.ledger-list, .table-section, .review-section { margin-top: 45px; }
.section-heading { display: flex; justify-content: space-between; align-items: end; padding-bottom: 15px; border-bottom: 3px double var(--line); }
.section-heading h2 { margin: 0; font-size: 1.9rem; }
.ledger-list ol { list-style: none; margin: 0; padding: 0; }
.ledger-list li { display: grid; grid-template-columns: 1fr auto; gap: 25px; padding: 18px 3px; border-bottom: 1px solid var(--line); }
.ledger-list li > span { color: var(--brass); font: 700 .62rem/1.4 Arial, sans-serif; text-transform: uppercase; letter-spacing: .1em; }
.ledger-list li > strong { font-size: .97rem; }
.ledger-list time { color: var(--muted); font: .7rem/1.4 Arial, sans-serif; }
.empty-row { color: var(--muted); font-style: italic; }

.grid-form { display: grid; grid-template-columns: 1fr 1fr; gap: 19px 22px; }
.grid-form label { display: grid; gap: 7px; }
.full-row { grid-column: 1 / -1; }
.ledger-list li > div { display: grid; grid-template-columns: auto 1fr; gap: 8px 13px; align-items: center; }
.ledger-list li > div p { grid-column: 1 / -1; margin: 0; color: var(--muted); font: .82rem/1.55 Arial, sans-serif; white-space: pre-wrap; }
.status { display: inline-block; width: fit-content; border: 1px solid currentColor; padding: 3px 7px; font: 700 .57rem/1 Arial, sans-serif; text-transform: uppercase; letter-spacing: .1em; }
.status-pending { color: #7c631f; }
.status-approved { color: var(--green); }
.status-rejected, .status-superseded { color: var(--red); }

.record-type-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 0 0 25px; }
.record-type-card { min-height: 126px; padding: 19px 20px; border: 1px solid var(--line); background: rgba(251,247,237,.48); text-decoration: none; display: flex; flex-direction: column; gap: 9px; }
.record-type-card strong { color: var(--forest-deep); font-size: 1.03rem; font-weight: 400; }
.record-type-card span { color: var(--muted); font: .73rem/1.48 Arial, sans-serif; }
.record-type-card:hover, .record-type-card.selected { border-color: var(--brass); background: rgba(251,247,237,.9); box-shadow: inset 0 -3px 0 rgba(152,116,54,.5); }
.record-form-panel { padding: clamp(28px, 4vw, 44px); }
.compact-heading { align-items: start; margin-bottom: 25px; }
.compact-heading h2 { max-width: 800px; font-size: 1.35rem; line-height: 1.4; }
.record-form > label { align-content: start; }
.field-help-after { display: block; margin: 5px 0 0; text-transform: none; letter-spacing: 0; font-weight: 400; }
.record-check { align-self: end; min-height: 45px; border-bottom: 1px solid rgba(185,170,139,.65); padding-bottom: 9px; }
.upload-field { border: 1px dashed var(--line); padding: 18px; background: rgba(240,231,212,.35); }
.upload-field input { border: 0; background: transparent; padding-left: 0; }
.record-row > span { display: grid; justify-items: end; gap: 5px; }
.record-row small { color: var(--muted); font: .67rem/1.4 Arial, sans-serif; }
.record-detail-shell { max-width: 980px; }
.record-details { display: grid; grid-template-columns: minmax(180px, .42fr) 1fr; border-top: 3px double var(--line); margin: 30px 0 0; }
.record-details dt, .record-details dd { margin: 0; padding: 13px 10px; border-bottom: 1px solid var(--line); }
.record-details dt { color: var(--brass); font: 700 .63rem/1.45 Arial, sans-serif; text-transform: uppercase; letter-spacing: .08em; }
.record-details dd { white-space: pre-wrap; font-size: .9rem; line-height: 1.55; }
.record-files { margin-top: 38px; }
.record-files > p { color: var(--muted); font: .77rem/1.55 Arial, sans-serif; }
.record-files ul { list-style: none; padding: 0; margin: 15px 0 0; }
.record-files li { display: flex; align-items: center; justify-content: space-between; gap: 22px; padding: 14px 4px; border-bottom: 1px solid var(--line); }
.record-files li p { margin: 4px 0 0; color: var(--muted); font: .68rem/1.45 Arial, sans-serif; }

.admin-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 26px; }
.admin-grid .panel { padding: 32px; }
.admin-grid h2 { margin: 0; font-size: 1.7rem; }
.admin-grid p, .check-list { color: var(--muted); font: .8rem/1.55 Arial, sans-serif; }
.inline-settings { display: grid; grid-template-columns: 1fr auto; gap: 9px; align-items: end; margin-top: 18px; }
.inline-settings label { grid-column: 1 / -1; }
.check-list { padding-left: 18px; }
.check-list li { margin: 7px 0; }
.health-card.ok { border-top-color: var(--green); }
.health-card.warn { border-top-color: var(--red); }
.table-wrap { overflow-x: auto; border-bottom: 1px solid var(--line); }
table { width: 100%; border-collapse: collapse; font: .75rem/1.45 Arial, sans-serif; }
th { text-align: left; color: var(--brass); font-size: .61rem; text-transform: uppercase; letter-spacing: .1em; }
th, td { padding: 14px 11px; border-bottom: 1px solid var(--line); }
td strong, td small { display: block; }
td small { color: var(--muted); margin-top: 3px; }
.table-button { margin-top: 7px; border: 1px solid var(--forest); color: var(--forest); background: transparent; padding: 5px 7px; font: 700 .58rem/1 Arial, sans-serif; text-transform: uppercase; letter-spacing: .06em; cursor: pointer; }
.review-card { display: grid; grid-template-columns: 1fr minmax(280px, .55fr); gap: 35px; padding: 25px 2px; border-bottom: 1px solid var(--line); }
.review-card h3 { margin: 4px 0 10px; font-size: 1.35rem; }
.contribution-content { white-space: pre-wrap; line-height: 1.6; }
.review-card small { color: var(--muted); font: .7rem/1.4 Arial, sans-serif; }
.review-form { display: grid; gap: 11px; align-content: center; }
.review-form label { display: grid; gap: 6px; }
.review-form > div { display: flex; gap: 8px; flex-wrap: wrap; }
.small-button { border: 1px solid currentColor; background: transparent; padding: 9px 11px; font: 700 .63rem/1 Arial, sans-serif; text-transform: uppercase; letter-spacing: .08em; cursor: pointer; }
.small-button.approve { color: var(--green); }
.small-button.reject { color: var(--red); }
.empty-card { padding: 26px 0; color: var(--muted); font-style: italic; }

.legal-shell { max-width: 880px; min-height: calc(100vh - 182px); padding: 65px 0 95px; }
.legal-document { background: rgba(251,247,237,.86); border: 1px solid var(--line); padding: clamp(30px, 7vw, 74px); box-shadow: 0 16px 42px rgba(28,37,29,.09); }
.legal-document h1 { font-size: clamp(2.4rem, 5vw, 4.7rem); margin-bottom: 8px; }
.legal-date { color: var(--muted); font: .69rem/1.4 Arial, sans-serif; text-transform: uppercase; letter-spacing: .08em; padding-bottom: 23px; border-bottom: 3px double var(--line); }
.legal-document h2 { margin-top: 30px; font-size: 1.45rem; }
.legal-document p { font-size: .94rem; line-height: 1.72; }
.draft-banner { border: 1px solid var(--red); color: var(--red); padding: 10px 12px; font: 700 .65rem/1.45 Arial, sans-serif !important; letter-spacing: .08em; text-transform: uppercase; }
.text-link { display: inline-block; margin-top: 18px; color: var(--forest); font-weight: 700; }

footer { min-height: 70px; padding: 21px clamp(22px, 5vw, 76px); background: rgba(32,54,40,.055); border-top: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; gap: 24px; color: #6e6758; font: .64rem/1.4 Arial, sans-serif; letter-spacing: .06em; text-transform: uppercase; }
footer p { margin: 0; }
footer nav { display: flex; flex-wrap: wrap; gap: 20px; }

.map-launch-panel { display: flex; align-items: center; justify-content: space-between; gap: 28px; margin-bottom: 24px; padding: 24px 28px; border-left: 5px solid var(--brass); }
.map-launch-panel h2 { margin: 2px 0 7px; font-size: 1.55rem; }
.map-launch-panel p:last-child { margin: 0; max-width: 760px; color: var(--muted); font: .8rem/1.55 Arial, sans-serif; }
.map-launch-panel .primary-button { flex: 0 0 auto; text-decoration: none; }
.map-record-shortcut { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 16px 18px; border: 1px solid var(--brass); background: rgba(152,116,54,.08); }
.map-record-shortcut strong { color: var(--forest-deep); font: 700 .82rem/1.4 Arial, sans-serif; }
.map-record-shortcut p { margin: 4px 0 0; color: var(--muted); font: .74rem/1.45 Arial, sans-serif; }
.map-record-shortcut .small-button { flex: 0 0 auto; color: var(--forest); text-decoration: none; }
.optional-coordinates { border: 1px solid var(--line); padding: 13px 16px; background: rgba(240,231,212,.28); }
.optional-coordinates summary { cursor: pointer; color: var(--muted); font: 700 .65rem/1.4 Arial, sans-serif; text-transform: uppercase; letter-spacing: .08em; }
.coordinate-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 14px; }
.coordinate-fields label { color: var(--forest); font: 700 .65rem/1.4 Arial, sans-serif; text-transform: uppercase; letter-spacing: .1em; }
.coordinate-fields input { margin-top: 6px; }

.map-workspace { max-width: 1920px; width: calc(100% - 40px); }
.map-heading { margin-bottom: 24px; }
.map-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px; align-items: start; }
.map-main { padding: 24px; }
.map-toolbar { display: flex; align-items: end; justify-content: space-between; gap: 18px; margin-bottom: 13px; }
.map-toolbar label { min-width: 220px; color: var(--forest); font: 700 .65rem/1.4 Arial, sans-serif; text-transform: uppercase; letter-spacing: .1em; }
.map-toolbar select { margin-top: 6px; }
.map-tools { display: flex; flex-wrap: wrap; gap: 7px; justify-content: flex-end; }
.map-tool.active { color: #fff8e9; background: var(--forest); border-color: var(--forest); }
.map-note { margin: 0 0 13px; color: var(--muted); font: .72rem/1.5 Arial, sans-serif; }
.map-section-nav { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; margin: 0 0 12px; }
.map-section-nav > span { margin-right: 3px; color: var(--muted); font: 700 .61rem/1.4 Arial, sans-serif; text-transform: uppercase; letter-spacing: .09em; }
.map-section-button { min-height: 32px; border: 1px solid rgba(128,109,71,.55); padding: 7px 10px; color: var(--forest); background: rgba(251,247,237,.72); font: 700 .62rem/1 Arial, sans-serif; cursor: pointer; }
.map-section-button:hover, .map-section-button.active { color: #fff8e9; background: var(--forest); border-color: var(--forest); }
.map-layer-switch { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; margin: 0 0 9px; }
.map-layer-switch > span { margin-right: 3px; color: var(--muted); font: 700 .61rem/1.4 Arial, sans-serif; text-transform: uppercase; letter-spacing: .09em; }
.map-layer-button { min-height: 31px; border: 1px solid rgba(128,109,71,.45); padding: 7px 11px; color: var(--forest); background: transparent; font: 700 .61rem/1 Arial, sans-serif; cursor: pointer; }
.map-layer-button:hover, .map-layer-button.active { border-color: var(--brass); color: var(--forest-deep); background: rgba(194,159,80,.18); box-shadow: inset 0 -2px 0 var(--brass); }
.farm-map { --map-zoom: 1; position: relative; aspect-ratio: 1000 / 680; overflow: hidden; border: 1px solid #806d47; background: linear-gradient(135deg, #eee5d1, #d8c9a9); box-shadow: inset 0 0 0 5px rgba(255,255,255,.22); touch-action: none; cursor: grab; }
.farm-map.is-panning { cursor: grabbing; }
.farm-map[data-tool="hunting_pin"], .farm-map[data-tool="farming_zone"] { cursor: crosshair; }
.map-pan-layer { position: absolute; inset: 0; transform: translate(0, 0) scale(1); transform-origin: 0 0; will-change: transform; }
.map-loading { position: absolute; inset: 0; display: grid; place-items: center; z-index: 5; color: var(--forest); background: rgba(239,231,213,.92); font: italic 1rem/1.5 Georgia, serif; }
.map-base { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center center; filter: saturate(.86) contrast(.94); user-select: none; }
.map-base[data-map-layer="lidar"] { filter: contrast(1.02) brightness(1.02); }
.map-base[data-map-layer="topo"] { filter: saturate(.72) contrast(.96) brightness(1.02); }
.map-base[data-map-layer="annotations"] { object-fit: fill; filter: saturate(.82) contrast(.91); }
#map-svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.map-grid-line { stroke: rgba(255,248,232,.28); stroke-width: .75; vector-effect: non-scaling-stroke; }
.map-grid-minor, .map-grid-label { display: none; }
.map-grid-major { opacity: .25; }
.map-grid-detail-visible .map-grid-minor, .map-grid-detail-visible .map-grid-label { display: block; }
.map-grid-detail-visible .map-grid-major { opacity: .55; }
.map-grid-label { fill: rgba(23,43,31,.68); font: 700 calc(11px / var(--map-zoom)) Arial, sans-serif; paint-order: stroke; stroke: rgba(247,240,222,.86); stroke-width: calc(3px / var(--map-zoom)); }
.map-region { fill: rgba(194,159,80,.04); stroke: rgba(255,245,216,.62); stroke-width: 1.25; stroke-dasharray: 7 5; vector-effect: non-scaling-stroke; }
.map-region-food_plot, .map-region-field, .map-region-garden { fill: rgba(205,170,76,.07); }
.map-region-water { fill: rgba(54,118,139,.10); }
.map-region-woods, .map-region-ridge, .map-region-travel_corridor { fill: rgba(34,85,54,.07); }
.map-region-label, .map-feature-label { display: none; fill: white; font: 700 calc(13px / var(--map-zoom)) Arial, sans-serif; text-anchor: middle; paint-order: stroke; stroke: rgba(15,35,23,.88); stroke-width: calc(4px / var(--map-zoom)); stroke-linejoin: round; pointer-events: none; }
.map-labels-visible .map-region-label, .map-feature-labels-visible .map-feature-label { display: block; }
.saved-hunting-pin, .draft-hunting-pin { fill: #a54331; stroke: #fff8e9; stroke-width: 4; vector-effect: non-scaling-stroke; }
.saved-hunting-pin { r: calc(10px / var(--map-zoom)); }
.saved-farming-zone, .draft-farming-zone { fill: rgba(204,160,47,.28); stroke: #f8e6ae; stroke-width: 4; vector-effect: non-scaling-stroke; }
.draft-hunting-pin, .draft-farming-zone { stroke-dasharray: 6 4; }
.map-error { fill: #7e2f29; font: 700 18px Arial, sans-serif; text-anchor: middle; }
.map-zoom-controls { position: absolute; z-index: 6; top: 12px; right: 12px; display: grid; overflow: hidden; border: 1px solid rgba(38,55,41,.48); border-radius: 3px; box-shadow: 0 3px 12px rgba(20,34,24,.2); }
.map-zoom-controls button { width: 40px; height: 39px; border: 0; border-bottom: 1px solid rgba(38,55,41,.2); color: var(--forest-deep); background: rgba(251,247,237,.94); font: 700 1.25rem/1 Arial, sans-serif; cursor: pointer; }
.map-zoom-controls button:last-child { border-bottom: 0; font-size: 1rem; }
.map-zoom-controls button:hover { color: #fff8e9; background: var(--forest); }
.map-view-status { position: absolute; z-index: 6; left: 12px; bottom: 12px; max-width: calc(100% - 80px); padding: 7px 10px; color: #fff8e9; background: rgba(18,41,28,.82); font: 700 .61rem/1.2 Arial, sans-serif; letter-spacing: .06em; text-transform: uppercase; pointer-events: none; }
.map-help-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 22px; margin-top: 12px; }
.map-help-row > p { max-width: 620px; margin: 0; color: var(--muted); font: .7rem/1.5 Arial, sans-serif; }
.map-legend { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 12px; margin: 0; color: var(--muted); font: .63rem/1.4 Arial, sans-serif; }
.map-legend span { display: inline-flex; align-items: center; gap: 6px; }
.map-legend i { width: 16px; height: 12px; display: inline-block; border: 2px dashed #fff; background: #af9259; }
.map-legend .legend-grid { border-color: #b9a676; background: transparent; }
.map-legend .legend-pin { width: 12px; height: 12px; border-radius: 50%; border-style: solid; background: #a54331; }
.map-legend .legend-zone { border-style: solid; background: rgba(204,160,47,.45); }
.map-side { display: grid; gap: 18px; }
.map-side .panel { padding: 28px; }
.map-side h2 { margin: 3px 0 11px; font-size: 1.45rem; }
.map-side p { color: var(--muted); font: .78rem/1.55 Arial, sans-serif; }
.map-selection-panel { border-color: rgba(138, 100, 47, .45); }
.map-selection-actions { display: grid; gap: 12px; margin-top: 14px; }
.map-selection-form { border-top: 1px solid rgba(138, 100, 47, .2); padding-top: 12px; }
.danger-button { color: #8d2f26; border-color: rgba(141, 47, 38, .45); }
.map-region-result { padding: 10px 12px; border-left: 3px solid var(--brass); background: rgba(152,116,54,.08); color: var(--forest) !important; }
.sharing-fieldset { display: grid; gap: 9px; margin: 4px 0 8px; padding: 15px; border: 1px solid var(--line); }
.sharing-fieldset legend { padding: 0 7px; color: var(--forest); font: 700 .67rem/1.4 Arial, sans-serif; text-transform: uppercase; letter-spacing: .08em; }
.sharing-fieldset > label, .share-person { display: grid !important; grid-template-columns: 18px 1fr; gap: 8px; align-items: start; color: var(--ink) !important; font: .77rem/1.45 Arial, sans-serif !important; text-transform: none !important; letter-spacing: 0 !important; }
.sharing-fieldset input, .share-person input { width: 16px; min-height: 16px; margin: 1px 0 0; }
.share-people { display: grid; gap: 7px; margin: 3px 0 0 25px; padding: 10px 12px; background: rgba(240,231,212,.5); }
.share-person { grid-template-columns: 18px 1fr; }
.share-person small { color: var(--muted); }
.share-editor { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(190px, 1fr) minmax(190px, 1.3fr) auto; gap: 8px 12px; align-items: end; margin-top: 11px; padding: 12px; border: 1px solid var(--line); background: rgba(240,231,212,.35); }
.share-editor > label { color: var(--forest); font: 700 .61rem/1.35 Arial, sans-serif; text-transform: uppercase; letter-spacing: .08em; }
.share-editor select { margin-top: 5px; }
.compact-share-people { display: flex; flex-wrap: wrap; gap: 7px 12px; margin: 0; padding: 8px 10px; }
.shared-entry-note { grid-column: 1 / -1; color: var(--muted); font: .68rem/1.45 Arial, sans-serif; }
.map-alias-panel { margin-top: 0; }
.map-ledger { margin-top: 42px; }
.map-ledger li > div { grid-template-columns: auto 1fr; }

@media (max-width: 1080px) {
  .map-layout { grid-template-columns: minmax(0, 1fr); }
  .map-side { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .map-side .map-entry-panel { grid-column: 1 / -1; }
}

@media (max-width: 880px) {
  .masthead { align-items: flex-start; }
  .masthead-right { align-items: flex-end; flex-direction: column; gap: 8px; }
  .member-identity { display: none; }
  .login-shell { grid-template-columns: 1fr; width: min(650px, calc(100% - 36px)); gap: 52px; }
  .workspace-heading { align-items: flex-start; flex-direction: column; }
  .quota-card, .health-card { width: 100%; }
  .admin-grid { grid-template-columns: 1fr; }
  .review-card { grid-template-columns: 1fr; }
  .record-type-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 590px) {
  .masthead { padding: 16px; flex-direction: column; }
  .masthead-right, .member-nav { width: 100%; }
  .member-nav { justify-content: flex-start; gap: 8px 14px; }
  .brand-mark { width: 60px; height: 60px; }
  .brand-mark img { width: 51px; height: 51px; }
  .login-shell, .workspace-shell, .narrow-shell, .legal-shell { width: min(100% - 28px, 1240px); }
  h1 { font-size: 3rem; }
  .principle-grid article, .grid-form { grid-template-columns: 1fr; }
  .full-row { grid-column: auto; }
  .form-actions { align-items: stretch; flex-direction: column; }
  .form-actions .primary-button { width: 100%; }
  .ask-panel { padding: 27px 24px; }
  .inline-settings { grid-template-columns: 1fr; }
  .inline-settings label { grid-column: auto; }
  .record-type-grid { grid-template-columns: 1fr; }
  .record-type-card { min-height: auto; }
  .record-details { grid-template-columns: 1fr; }
  .record-details dt { border-bottom: 0; padding-bottom: 2px; }
  .record-details dd { padding-top: 3px; }
  .record-files li { align-items: flex-start; flex-direction: column; }
  .map-launch-panel, .map-record-shortcut { align-items: stretch; flex-direction: column; }
  .map-launch-panel .primary-button, .map-record-shortcut .small-button { width: 100%; text-align: center; }
  .coordinate-fields { grid-template-columns: 1fr; }
  .map-main { padding: 14px; }
  .map-layout, .map-main, .map-side, .map-side .panel, .map-toolbar, .map-toolbar label, .map-tools, .map-note, .farm-map, .map-help-row { min-width: 0; max-width: 100%; }
  .map-main, .map-side { width: 100%; }
  .map-toolbar select { min-width: 0; max-width: 100%; }
  .map-toolbar { align-items: stretch; flex-direction: column; }
  .map-tools { justify-content: stretch; }
  .map-tools button { flex: 1 1 45%; min-height: 42px; }
  .map-section-nav, .map-layer-switch { flex-wrap: nowrap; margin-right: -14px; padding-right: 14px; overflow-x: auto; scrollbar-width: thin; }
  .map-section-nav > span, .map-section-button, .map-layer-switch > span, .map-layer-button { flex: 0 0 auto; }
  .map-section-button { min-height: 38px; }
  .map-help-row { flex-direction: column; }
  .map-legend { justify-content: flex-start; }
  .map-zoom-controls button { width: 44px; height: 43px; }
  .map-side { grid-template-columns: minmax(0, 1fr); }
  .map-side .map-entry-panel { grid-column: auto; }
  .map-region-label { font-size: 10px; }
  .map-feature-label { font-size: 11px; }
  .share-editor { grid-template-columns: 1fr; }
  .farm-map { min-height: 390px; aspect-ratio: auto; }
  footer { align-items: flex-start; flex-direction: column; }
}

/* Terrain upgrade: map first, field notes underneath, shared classical palette. */
.map-view-toolbar { display: flex; flex-wrap: wrap; gap: 12px; align-items: end; margin: 12px 0; }
.map-view-toolbar [data-map-mode].active { background: var(--forest); color: #fff8e9; }
.map-find-label { flex: 1; min-width: 200px; max-width: 440px; font: 700 .7rem/1.5 Arial, sans-serif; }
.map-find-label select { width: 100%; margin-top: 4px; }
.map-stage { position: relative; height: max(540px, 72vh); overflow: hidden; border: 1px solid #806d47; }
.map-stage .farm-map, .map-stage .farm-map.leaflet-container, .farm-map-terrain { width: 100%; height: 100%; min-height: 0; max-height: none; aspect-ratio: auto; }
.map-stage [hidden], .map-terrain-controls[hidden] { display: none !important; }
.map-terrain-controls { position: absolute; z-index: 3; bottom: 32px; left: 12px; right: 12px; display: flex; flex-wrap: wrap; gap: 12px; align-items: center; width: fit-content; padding: 10px 14px; background: rgba(251,247,237,.95); border: 1px solid #a08d64; }
.map-terrain-controls label { display: flex; align-items: center; gap: 7px; font: 700 .72rem Arial, sans-serif; }
.map-terrain-controls input { width: 125px; }
.map-terrain-controls select { padding: 6px; width: auto; }
.terrain-waypoint { width: 17px; height: 17px; border: 2px solid #fff5d8; border-radius: 50%; background: #7e3528; cursor: pointer; box-shadow: 0 1px 5px #0008; padding: 0; }
.terrain-waypoint:focus-visible, .terrain-waypoint:hover { outline: 3px solid #f2c95e; }
.map-status { margin: 9px 0; font: 700 .76rem/1.5 Arial, sans-serif; color: var(--forest); min-height: 1.5em; }
.map-source-note { margin: 5px 0; color: var(--muted); font: .68rem/1.5 Arial, sans-serif; }
.map-layout .map-side { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px,1fr)); align-items: start; gap: 20px; }
.map-layout .map-side > [hidden] { display: none; }
.map-main.map-expanded { position: fixed; inset: 0; z-index: 2000; overflow: auto; padding: 12px; display: flex; flex-direction: column; background: #f8f4e8; }
.map-expanded > :not(.map-stage) { flex-shrink: 0; }
.map-expanded .map-stage { flex: 1 0 55vh; }
.map-expanded .map-note, .map-expanded .map-section-nav, .map-expanded .map-help-row, .map-expanded .map-source-note { display: none; }
body.map-is-expanded { overflow: hidden; }
@media (max-width: 700px) {
  .map-workspace { width: calc(100% - 16px); }
  .map-layout .map-main { padding: 10px; }
  .map-stage { height: 72svh; min-height: 460px; }
  .map-heading h1 { font-size: 1.9rem; }
  .map-view-toolbar { gap: 8px; }
  .map-view-toolbar .small-button { min-height: 42px; }
  .map-find-label { min-width: 180px; }
  .map-layout .map-side { grid-template-columns: minmax(0,1fr); }
  .map-terrain-controls { bottom: 32px; padding: 8px; gap: 8px; }
  .map-terrain-controls input { width: 88px; }
  .map-expanded .map-toolbar { display: none; }
  .map-expanded .map-layer-switch, .map-expanded .map-overlay-switch { margin-right: 0; width: 100%; }
}

/* Geographic farm map — Leaflet owns panning, fractional zoom, and touch gestures. */
.map-overlay-switch { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; margin: 0 0 12px; }
.map-overlay-switch > span { margin-right: 3px; color: var(--muted); font: 700 .61rem/1.4 Arial, sans-serif; text-transform: uppercase; letter-spacing: .09em; }
.map-overlay-button { min-height: 31px; border: 1px solid rgba(128,109,71,.45); padding: 7px 11px; color: var(--forest); background: transparent; font: 700 .61rem/1 Arial, sans-serif; cursor: pointer; }
.map-overlay-button:hover, .map-overlay-button.active { border-color: var(--brass); color: var(--forest-deep); background: rgba(194,159,80,.18); box-shadow: inset 0 -2px 0 var(--brass); }
.farm-map.leaflet-container { width: 100%; height: clamp(560px, 67vh, 760px); min-height: 560px; aspect-ratio: auto; overflow: hidden; touch-action: pan-x pan-y; cursor: grab; background: #d8c9a9; font-family: Arial, sans-serif; }
.farm-map.leaflet-drag-target, .farm-map.leaflet-grab { cursor: grab; }
.farm-map[data-tool="hunting_pin"], .farm-map[data-tool="farming_zone"] { cursor: crosshair; }
.farm-map .leaflet-control-zoom a { color: var(--forest-deep); background: rgba(251,247,237,.96); }
.farm-map .leaflet-control-attribution { max-width: 72%; color: #3c463d; background: rgba(251,247,237,.82); font-size: 10px; }
.farm-map .leaflet-control-attribution a { color: #234d35; }
.farm-map .leaflet-tooltip { white-space: nowrap; pointer-events: none; }
.farm-map .reference-label, .farm-map .grid-label, .farm-map .saved-feature-label { display: none; border: 0; border-radius: 2px; padding: 3px 6px; color: #fff9e9; background: rgba(16,42,28,.84); box-shadow: 0 1px 5px rgba(0,0,0,.26); font: 700 10px/1.2 Arial, sans-serif; text-shadow: 0 1px 1px rgba(0,0,0,.35); }
.farm-map .reference-label::before, .farm-map .grid-label::before, .farm-map .saved-feature-label::before { display: none; }
.farm-map:not(.show-waypoint-symbols) .huntwise-waypoint { display: none; }
.farm-map.show-area-labels .area-label, .farm-map.show-waypoint-labels .waypoint-label, .farm-map.show-grid-labels .grid-label, .farm-map.show-saved-labels .saved-feature-label { display: block; }
.farm-map .grid-label { color: rgba(20,48,32,.82); background: rgba(255,249,230,.68); box-shadow: none; font-size: 9px; }
.map-loading, .map-error-message { position: absolute; z-index: 1000; inset: 45% auto auto 50%; transform: translate(-50%,-50%); padding: 10px 14px; color: var(--forest-deep); background: rgba(251,247,237,.93); box-shadow: 0 3px 16px rgba(28,42,31,.18); font: 700 .72rem/1.4 Arial, sans-serif; }

@media (max-width: 590px) {
  .map-overlay-switch { flex-wrap: nowrap; margin-right: -14px; padding-right: 14px; overflow-x: auto; scrollbar-width: thin; }
  .map-overlay-switch > span, .map-overlay-button { flex: 0 0 auto; }
  .map-overlay-button { min-height: 38px; }
  .farm-map.leaflet-container { height: 62vh; min-height: 430px; max-height: 650px; }
  .farm-map .leaflet-control-attribution { max-width: 86%; font-size: 8px; }
}
