/* Theme (2026-10-30): light sand surfaces, dark green accents. --lake is the accent color
   (name kept from the blue theme); --water is the blue used for water in the logo. */
:root {
  --paper: #F6F1E7; --cream: #EEE7D8; --card: #FFFDF8; --ink: #1F2A23; --muted: #67665A;
  --line: #E4DBCA; --line-strong: #D2C6B0;
  --lake: #2D5A40; --lake-deep: #1E4230; --lake-soft: #E2EBDD; --lake-ink: #1A3826;
  --water: #2F6F8F;
  --reed: #6B7F3A; --reed-soft: #ECEFD9; --sun: #B86B2A; --sun-soft: #F7E7D2;
  --alert: #B5433A; --alert-soft: #F8E3E0; --ok: #3C7D5A;
  --serif: "Source Serif 4", Charter, Georgia, serif;
  --sans: Inter, system-ui, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Consolas, monospace;
  --shadow: 0 1px 2px rgba(60, 45, 20, .06), 0 8px 24px -12px rgba(60, 45, 20, .2);
  --r: 12px;
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --paper: #141A16; --cream: #1A211C; --card: #1F2822; --ink: #ECE8DD; --muted: #A6A596;
  --line: #2D362F; --line-strong: #3C473F;
  --lake: #8CC5A0; --lake-deep: #B5DCC2; --lake-soft: #1E3227; --lake-ink: #CDE8D6;
  --water: #6FB1D1;
  --reed: #A9BF6E; --reed-soft: #283019; --sun: #E8964F; --sun-soft: #3A2A1A;
  --alert: #E07A70; --alert-soft: #3C2321; --ok: #7CC49A;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px -12px rgba(0, 0, 0, .6);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --paper: #141A16; --cream: #1A211C; --card: #1F2822; --ink: #ECE8DD; --muted: #A6A596;
    --line: #2D362F; --line-strong: #3C473F;
    --lake: #8CC5A0; --lake-deep: #B5DCC2; --lake-soft: #1E3227; --lake-ink: #CDE8D6;
    --water: #6FB1D1;
    --reed: #A9BF6E; --reed-soft: #283019; --sun: #E8964F; --sun-soft: #3A2A1A;
    --alert: #E07A70; --alert-soft: #3C2321; --ok: #7CC49A;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px -12px rgba(0, 0, 0, .6);
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; margin: 0; }
body { background: var(--paper); color: var(--ink); font: 14px/1.5 var(--sans); display: flex; flex-direction: column; overflow: hidden; }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; margin: 0; letter-spacing: -.01em; }
h2 { font-size: 22px; line-height: 1.2; }
h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-family: var(--sans); font-weight: 600; margin-bottom: 8px; }
a { color: var(--lake); }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
:focus-visible { outline: 2px solid var(--lake); outline-offset: 2px; }
.num, .mono, code { font-family: var(--mono); font-size: .92em; }

/* top bar */
.top { display: grid; grid-template-columns: 1fr minmax(260px, 520px) 1fr; align-items: center; gap: 16px; padding: 10px 18px; border-bottom: 1px solid var(--line); background: var(--card); z-index: 5; }
.brand { display: flex; align-items: baseline; gap: 10px; }
.brand-mark { width: 14px; height: 14px; border-radius: 50% 50% 50% 0; background: linear-gradient(135deg, var(--lake), var(--lake-deep)); transform: rotate(-45deg); align-self: center; }
.brand-name { font-family: var(--serif); font-size: 20px; font-weight: 600; }
.brand-sub { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .1em; }
.search { position: relative; }
.search input { width: 100%; padding: 9px 14px; border: 1px solid var(--line-strong); border-radius: 999px; background: var(--paper); color: var(--ink); font: inherit; outline: none; }
.search input:focus { border-color: var(--lake); box-shadow: 0 0 0 3px var(--lake-soft); }
.search-results { position: absolute; top: 42px; left: 0; right: 0; list-style: none; margin: 0; padding: 6px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); z-index: 20; }
.search-results li { padding: 8px 10px; border-radius: 8px; cursor: pointer; display: flex; justify-content: space-between; gap: 8px; }
.search-results li:hover { background: var(--lake-soft); }
.search-results small { color: var(--muted); }
.top-right { display: flex; justify-content: flex-end; align-items: center; gap: 12px; }
.status { color: var(--muted); font-size: 12px; }
.icon-btn { width: 32px; height: 32px; border-radius: 50%; border: 1px solid var(--line); font-size: 16px; }
.icon-btn:hover { background: var(--cream); }

/* shell */
.shell { flex: 1; display: grid; grid-template-columns: 250px 1fr 500px; min-height: 0; }
.left, .right { overflow-y: auto; padding: 14px; background: var(--paper); }
.left { border-right: 1px solid var(--line); display: flex; flex-direction: column; gap: 12px; }
.right { border-left: 1px solid var(--line); background: var(--cream); }
.center { position: relative; min-width: 0; }
.map { position: absolute; inset: 0; background: #DCE6EC; }
.ol-layer.blend-multiply { mix-blend-mode: multiply; }
.ol-layer.tone-sand { filter: url(#sand-sea); } /* filter lives in index.html */
.map-tools { position: absolute; top: 12px; right: 12px; z-index: 5; display: flex; gap: 8px; align-items: flex-start; }
.map-btn { display: block; background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 6px 12px; font-weight: 600; box-shadow: var(--shadow); cursor: pointer; list-style: none; transition: border-color .15s, color .15s; }
.map-btn::-webkit-details-marker { display: none; }
.map-btn:hover, .map-pop[open] > .map-btn { border-color: var(--lake); color: var(--lake); }
.map-pop { position: relative; }
.map-pop-body { position: absolute; right: 0; top: 42px; width: 280px; max-height: 70vh; overflow-y: auto; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); padding: 12px 14px; }
.map-pop-body h3 { margin: 14px 0 6px; }
.map-pop-body h3:first-child { margin-top: 0; }
/* OpenLayers controls in the app's look */
.map .ol-zoom { top: 12px; left: 12px; padding: 0; background: none; border-radius: 8px; box-shadow: var(--shadow); }
.map .ol-zoom button { width: 34px; height: 34px; margin: 0; font-size: 18px; font-weight: 500; line-height: 1; color: var(--ink); background: var(--card); border: 1px solid var(--line); }
.map .ol-zoom button:hover, .map .ol-zoom button:focus { background: var(--lake-soft); outline: none; }
.map .ol-zoom .ol-zoom-in { border-radius: 8px 8px 0 0; }
.map .ol-zoom .ol-zoom-out { border-radius: 0 0 8px 8px; border-top: 0; }
.map .ol-attribution { bottom: 6px; right: 6px; max-width: 70%; border-radius: 6px; }
.map .ol-attribution:not(.ol-collapsed) { background: color-mix(in srgb, var(--card) 80%, transparent); }
.map .ol-attribution ul { font-size: 10.5px; color: var(--muted); text-shadow: none; }
.map3d { position: absolute; inset: 0; z-index: 6; background: #DCE6EC; }
.map3d .gl { position: absolute; inset: 0; }
.map3d-bar { position: absolute; top: 12px; left: 12px; display: flex; gap: 12px; align-items: center; background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 5px 6px 5px 12px; font-size: 12px; color: var(--muted); box-shadow: var(--shadow); }
.map3d-bar button { background: var(--lake); color: var(--card); border-radius: 6px; padding: 4px 10px; font-weight: 600; }
.base-select { width: 100%; font: inherit; color: var(--ink); background: var(--paper); border: 1px solid var(--line-strong); border-radius: 8px; padding: 7px 10px; }
.hint { position: absolute; left: 50%; top: 12px; transform: translateX(-50%); white-space: nowrap; background: var(--card); border: 1px solid var(--line); padding: 7px 14px; border-radius: 999px; font-size: 12px; color: var(--muted); box-shadow: var(--shadow); pointer-events: none; }
.tooltip { position: absolute; pointer-events: none; background: var(--ink); color: var(--paper); padding: 4px 9px; border-radius: 6px; font-size: 12px; transform: translate(12px, -28px); white-space: nowrap; z-index: 3; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px; box-shadow: 0 1px 2px rgba(20, 30, 25, .04); }
/* left panel sections fold open and shut */
.fold > summary { list-style: none; cursor: pointer; display: flex; justify-content: space-between; align-items: center; }
.fold > summary::-webkit-details-marker { display: none; }
.fold > summary::after { content: ""; width: 7px; height: 7px; margin: -6px 4px 0 0; border-right: 1.5px solid var(--muted); border-bottom: 1.5px solid var(--muted); transform: rotate(45deg); transition: transform .15s; }
.fold:not([open]) > summary::after { transform: rotate(-45deg); margin-top: 0; }
.fold:not([open]) > summary h3 { margin-bottom: 0; }
.pond-list { list-style: none; margin: 0; padding: 0; }
.pond-list li { padding: 8px 10px; border-radius: 8px; cursor: pointer; display: flex; flex-direction: column; transition: background .15s; }
.pond-list li:hover, .pond-list li.on { background: var(--lake-soft); }
.pond-list small { color: var(--muted); }
.layer-list label { display: flex; align-items: center; gap: 8px; padding: 4px 0; cursor: pointer; }
.layer-list input { accent-color: var(--lake); }
.swatch { width: 14px; height: 14px; border-radius: 3px; border: 1px solid rgba(0,0,0,.15); flex: none; }
.seg { display: flex; gap: 4px; background: var(--cream); padding: 3px; border-radius: 8px; }
.seg button { flex: 1; padding: 5px 6px; border-radius: 6px; font-size: 12px; color: var(--muted); }
.seg button.on { background: var(--card); color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.legend { font-size: 12px; color: var(--muted); }
.legend div { display: flex; align-items: center; gap: 8px; padding: 2px 0; }

/* right panel */
.right-empty { padding: 36px 16px; color: var(--muted); }
.right-empty h2 { color: var(--ink); margin-bottom: 8px; }
.right-empty h3 { margin: 24px 0 8px; }
.try { display: flex; flex-direction: column; gap: 8px; }
.try button { display: flex; flex-direction: column; text-align: left; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 10px 14px; transition: border-color .15s, box-shadow .15s; }
.try button:hover { border-color: var(--lake); box-shadow: var(--shadow); }
.try b { color: var(--ink); font-weight: 600; }
.try small { color: var(--muted); }
.pond-head { display: flex; flex-direction: column; gap: 10px; margin: 4px 0 12px; }
.pond-sub { color: var(--muted); font-size: 13px; }
.back { display: block; font-size: 12px; margin-bottom: 4px; text-decoration: none; }
.grp-row { cursor: pointer; }
.grp-row:hover td { background: var(--lake-soft); }
.badges { display: flex; flex-wrap: wrap; gap: 6px; }
.badge { font-size: 12px; font-weight: 500; padding: 2px 9px; border-radius: 999px; background: var(--cream); color: var(--muted); border: 1px solid var(--line); white-space: nowrap; }
.badge.lake { background: var(--lake-soft); color: var(--lake-ink); border-color: transparent; }
.badge.reed { background: var(--reed-soft); color: var(--reed); border-color: transparent; }
.badge.sun { background: var(--sun-soft); color: var(--sun); border-color: transparent; }
.badge.alert { background: var(--alert-soft); color: var(--alert); border-color: transparent; }
.badge.ok { background: var(--reed-soft); color: var(--ok); border-color: transparent; }
/* every tab visible (wraps to two rows), and the bar stays pinned while the panel scrolls */
.tabs { position: sticky; top: -14px; z-index: 4; display: flex; flex-wrap: wrap; gap: 4px; margin: 0 -14px; padding: 8px 14px 10px; background: var(--cream); border-bottom: 1px solid var(--line); }
.tabs button { padding: 5px 12px; font-size: 13px; color: var(--muted); border-radius: 999px; white-space: nowrap; transition: background .15s, color .15s; }
.tabs button:hover { background: var(--card); color: var(--ink); }
.tabs button.on { background: var(--lake-soft); color: var(--lake-ink); box-shadow: inset 0 0 0 1px var(--lake); font-weight: 600; }
.tab-body { padding-top: 14px; display: flex; flex-direction: column; gap: 12px; }

.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.stat b { display: block; font-family: var(--serif); font-size: 22px; font-weight: 600; line-height: 1.1; }
.stat span { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .06em; }
.stat small { color: var(--muted); font-size: 11px; display: block; }
.kv { display: grid; grid-template-columns: 130px 1fr; gap: 4px 12px; font-size: 13px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }
.card p { margin: 6px 0; }
.lead { font-size: 13px; color: var(--muted); }
.card h4 { margin: 0 0 6px; font-family: var(--serif); font-size: 16px; font-weight: 600; display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.card h4 small { font-family: var(--sans); font-weight: 400; color: var(--muted); font-size: 12px; }
table.t { width: 100%; border-collapse: collapse; font-size: 12.5px; }
table.t th { text-align: left; color: var(--muted); font-weight: 500; padding: 4px 6px; border-bottom: 1px solid var(--line); font-size: 11px; text-transform: uppercase; letter-spacing: .05em; }
table.t td { padding: 5px 6px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.t tr:last-child td { border-bottom: 0; }
table.t td.num { text-align: right; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { font-size: 12px; padding: 3px 9px; border-radius: 999px; background: var(--cream); border: 1px solid var(--line); cursor: pointer; }
.chip.on { background: var(--lake); color: var(--card); border-color: var(--lake); }
.chip.static { cursor: default; }
.pill { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; vertical-align: middle; }
.toggle { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); cursor: pointer; }
.toggle input { accent-color: var(--lake); }
.muted { color: var(--muted); }
.warn { background: var(--sun-soft); border-color: transparent; }
.cta { background: var(--lake); color: var(--card); padding: 8px 14px; border-radius: 8px; font-weight: 500; }
.cta:hover { background: var(--lake-deep); }
.ws-form { display: flex; flex-direction: column; gap: 8px; }
.ws-form label { display: flex; flex-direction: column; gap: 3px; font-size: 12px; color: var(--muted); }
.ws-form input, .ws-form select { font: inherit; color: var(--ink); background: var(--paper); border: 1px solid var(--line-strong); border-radius: 8px; padding: 7px 10px; }
.ws-form input:focus, .ws-form select:focus { outline: none; border-color: var(--lake); box-shadow: 0 0 0 3px var(--lake-soft); }
.ws-form .row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.ws-form .cta { align-self: flex-start; }
details.add-org summary { cursor: pointer; font-size: 12px; color: var(--lake); margin-top: 6px; }
.empty { text-align: center; padding: 28px 14px; color: var(--muted); }
.empty h4 { justify-content: center; }
.skeleton { height: 12px; border-radius: 6px; background: linear-gradient(90deg, var(--cream), var(--line), var(--cream)); background-size: 200% 100%; animation: sh 1.2s infinite; margin: 6px 0; }
@keyframes sh { from { background-position: 200% 0 } to { background-position: -200% 0 } }
.steps { font-size: 12px; color: var(--muted); display: flex; flex-direction: column; gap: 3px; }
.steps .done { color: var(--ok); }

canvas.chart { width: 100% !important; height: 190px !important; }
.chart-wrap { position: relative; height: 190px; }

/* gantt */
.gantt { display: grid; grid-template-columns: 150px 1fr; font-size: 12px; row-gap: 4px; align-items: center; }
.gantt .yrs { display: grid; grid-template-columns: repeat(var(--n), 1fr); color: var(--muted); border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.gantt .yrs span { padding: 2px 4px; border-left: 1px solid var(--line); }
.gantt .lbl { padding-right: 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gantt .lbl.proj { font-weight: 600; margin-top: 6px; }
.gantt .row { position: relative; height: 18px; background: repeating-linear-gradient(90deg, var(--line) 0 1px, transparent 1px calc(100% / var(--n))); }
.gantt .bar { position: absolute; top: 2px; height: 14px; border-radius: 4px; background: var(--lake); opacity: .9; }
.gantt .bar.done { background: var(--reed); }
.gantt .bar.planned { background: transparent; border: 1.5px dashed var(--lake); }
.gantt .bar.phase { background: var(--lake-soft); border: 1px solid var(--lake); height: 12px; top: 3px; }
.gantt .today { position: absolute; top: -2px; bottom: -2px; width: 1px; background: var(--alert); }
.tasks li { display: flex; gap: 8px; align-items: center; padding: 3px 0; font-size: 13px; }
.tasks li.done { color: var(--muted); text-decoration: line-through; }
.tasks input { accent-color: var(--ok); }

/* timeline footer */
.timeline { height: 104px; border-top: 1px solid var(--line); background: var(--card); padding: 8px 40px 6px 90px; position: relative; }
.tl-axis { position: relative; height: 40px; margin-top: 40px; border-top: 1px solid var(--line-strong); }
.tl-year { position: absolute; top: -20px; font-size: 11px; color: var(--muted); transform: translateX(-50%); }
.tl-tick { position: absolute; top: 0; width: 1px; height: 6px; background: var(--line-strong); }
.tl-dot { position: absolute; top: 12px; width: 10px; height: 10px; border-radius: 50%; transform: translateX(-50%); cursor: pointer; border: 2px solid var(--card); box-shadow: 0 0 0 1px var(--line); }
.tl-dot:hover { transform: translateX(-50%) scale(1.5); z-index: 2; }
.tl-legend { position: absolute; right: 40px; top: 4px; display: flex; gap: 10px; font-size: 11px; color: var(--muted); }
.tl-title { position: absolute; left: 18px; top: 44px; font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }

/* calendar */
.cal-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.cal-title { flex: 1; margin: 0; }
.cal-nav { display: flex; gap: 2px; }
.cal-nav button { border: 1px solid var(--line); border-radius: 6px; padding: 3px 8px; font-size: 12px; }
.cal-nav button:hover { background: var(--cream); }
.cal-views { flex: none; }
.cal-plus { width: 28px; height: 28px; border-radius: 50%; background: var(--lake); color: var(--card); font-size: 18px; line-height: 1; flex: none; }
.cal-plus:hover { background: var(--lake-deep); }
.cal-add { background: var(--paper); border: 1px solid var(--line); border-radius: 8px; padding: 10px; margin-bottom: 10px; }
.cal-filter { margin-bottom: 10px; }
.cal-filter .chip.on { color: #fff; }
.cal-n { opacity: .7; font-size: 10px; }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 2px; }
.cal-dow { font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; text-align: center; padding: 2px 0; }
.cal-day { min-height: 68px; border: 1px solid var(--line); border-radius: 6px; padding: 3px; font-size: 11px; background: var(--card); display: flex; flex-direction: column; gap: 2px; overflow: hidden; }
.cal-day.out { opacity: .45; }
.cal-day.today { border-color: var(--lake); box-shadow: inset 0 0 0 1px var(--lake); }
.cal-num { font-family: var(--mono); color: var(--muted); font-size: 10px; cursor: pointer; }
.cal-day.today .cal-num { color: var(--lake); font-weight: 600; }
.cal-pill { display: block; color: #fff; border-radius: 4px; padding: 1px 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; font-size: 10.5px; line-height: 1.4; }
.cal-more { color: var(--lake); cursor: pointer; font-size: 10px; }
.cal-grid.mini { gap: 1px; }
.cal-grid.mini .cal-day { min-height: 18px; padding: 1px 2px; border: 0; background: transparent; flex-direction: row; align-items: center; justify-content: space-between; }
.cal-grid.mini .cal-day.today { box-shadow: none; background: var(--lake-soft); border-radius: 3px; }
.cal-dots { display: flex; gap: 1px; }
.cal-dots i { width: 5px; height: 5px; border-radius: 50%; display: block; }
.cal-year { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.cal-mini { border: 1px solid var(--line); border-radius: 8px; padding: 6px; cursor: pointer; background: var(--card); }
.cal-mini:hover { border-color: var(--lake); }
.cal-mini h5 { margin: 0 0 4px; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.cal-week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.cal-wday { border: 1px solid var(--line); border-radius: 6px; padding: 4px; min-height: 120px; background: var(--card); min-width: 0; }
.cal-card { overflow-wrap: break-word; }
.cal-card b { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.cal-card .muted { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: 10px; }
.cal-wday.today { border-color: var(--lake); }
.cal-wh { font-size: 11px; color: var(--muted); margin-bottom: 4px; }
.cal-card { border-left: 3px solid; padding: 3px 5px; margin: 3px 0; font-size: 11px; background: var(--paper); border-radius: 0 4px 4px 0; cursor: pointer; }
.cal-none { display: block; text-align: center; }
.cal-detail { border-left: 3px solid; padding: 6px 10px; margin-top: 10px; background: var(--paper); border-radius: 0 6px 6px 0; font-size: 13px; }

/* photos */
.grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.ph { position: relative; border-radius: 10px; overflow: hidden; aspect-ratio: 4/3; cursor: pointer; background: var(--cream); }
.ph img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .3s; }
.ph:hover img { transform: scale(1.04); }
.ph .cap { position: absolute; inset: auto 0 0 0; padding: 18px 10px 8px; background: linear-gradient(transparent, rgba(0,0,0,.65)); color: #fff; font-size: 12px; }
.lightbox { position: fixed; inset: 0; background: rgba(10, 14, 12, .88); display: flex; flex-direction: column; align-items: center; justify-content: center; z-index: 50; cursor: zoom-out; }
.lightbox img { max-width: 90vw; max-height: 80vh; border-radius: 8px; }
.lightbox-cap { color: #ddd; margin-top: 10px; font-size: 13px; max-width: 80vw; text-align: center; }

/* forum */
.thread { cursor: pointer; }
.thread .meta { font-size: 12px; color: var(--muted); }
.post { border-left: 2px solid var(--line); padding: 4px 10px; margin: 8px 0; font-size: 13px; }
.post .who { font-weight: 600; }
.post .org { color: var(--muted); font-size: 12px; }
.ann { border-left: 3px solid var(--sun); }

.doc-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.doc-card { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; cursor: pointer; background: var(--card); display: flex; flex-direction: column; }
.doc-card:hover { border-color: var(--lake); }
.doc-card.on { border-color: var(--lake); box-shadow: 0 0 0 2px var(--lake-soft); }
.doc-thumb { aspect-ratio: 4/3; background: var(--cream); display: flex; align-items: center; justify-content: center; overflow: hidden; }
.doc-thumb img { width: 100%; height: 100%; object-fit: cover; object-position: top; display: block; }
.doc-ph { font-family: var(--serif); font-size: 15px; color: var(--muted); padding: 10px; text-align: center; }
.doc-meta { padding: 8px 10px; display: flex; flex-direction: column; gap: 2px; font-size: 12.5px; }
.doc-meta b { line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.doc-big { width: 100%; border-radius: 8px; border: 1px solid var(--line); margin: 6px 0; display: block; }
.doc { display: grid; grid-template-columns: 1fr auto; gap: 2px 8px; padding: 7px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.doc:last-child { border-bottom: 0; }
.doc .cls { color: var(--muted); font-size: 12px; }
.doc .badge, .doc summary > span:last-child { align-self: start; text-align: right; }
.rep-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 12px; }
.rep-grid label { display: flex; flex-direction: column; gap: 2px; font-size: 11px; color: var(--muted); }
.rep-grid span { color: var(--ink); font-size: 13px; overflow-wrap: anywhere; }
.rep input, .rep select, .rep textarea { font: inherit; width: 100%; box-sizing: border-box; color: var(--ink); background: var(--paper); border: 1px solid var(--line-strong); border-radius: 6px; padding: 4px 6px; }
.rep input[type=checkbox] { width: auto; }
.rep textarea { resize: vertical; }

/* field observations: map pins, callout cards, entry form */
.obs-pin { position: relative; width: 28px; height: 28px; padding: 0; border-radius: 50%; background: var(--c); border: 2px solid #fff; box-shadow: 0 2px 6px rgba(30, 25, 15, .35); display: grid; place-items: center; cursor: pointer; transition: transform .15s; }
.obs-pin:hover, .obs-pin.on { transform: scale(1.15); }
.obs-pin svg { width: 14px; height: 14px; fill: none; stroke: #fff; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.obs-pin.draft { --c: var(--ink); animation: pin-pulse 1.4s infinite; }
@keyframes pin-pulse { 50% { box-shadow: 0 0 0 9px rgba(30, 40, 35, .15); } }
.obs-tag { display: none; position: absolute; left: 31px; top: 50%; transform: translateY(-50%); white-space: nowrap; pointer-events: none; background: var(--card); color: var(--ink); font-size: 11.5px; font-weight: 600; padding: 2px 9px; border-radius: 999px; box-shadow: 0 1px 4px rgba(30, 25, 15, .25); }
.obs-tag b { color: var(--c); margin-left: 6px; }
.obs-pin:hover .obs-tag, .obs-pin.on .obs-tag, .k-sample .obs-tag { display: block; }
.ol-overlay-container:has(.obs-pin:hover, .obs-pin.on) { z-index: 2; }
.map:has(.ol-overlay-container:hover) ~ .tooltip { display: none; }
.placing, .placing canvas { cursor: crosshair !important; }
.obs-far .obs-pin:not(.draft) { display: none; }
#btn-obs { background: var(--lake); color: var(--card); border-color: var(--lake); }
#btn-obs.on { background: var(--card); color: var(--lake); }
.callout { position: relative; width: 300px; background: var(--card); border-radius: 14px; font-size: 13px; box-shadow: 0 14px 34px -10px rgba(30, 25, 15, .4), 0 2px 6px rgba(30, 25, 15, .12); }
.callout::after { content: ""; position: absolute; left: 50%; bottom: -6px; width: 13px; height: 13px; background: var(--card); transform: translateX(-50%) rotate(45deg); border-radius: 0 0 3px 0; }
.co-x { position: absolute; top: 8px; right: 8px; z-index: 1; width: 26px; height: 26px; border-radius: 50%; background: rgba(20, 25, 20, .55); color: #fff; font-size: 16px; line-height: 1; }
.co-photo { position: relative; margin: 0; height: 168px; overflow: hidden; border-radius: 14px 14px 0 0; cursor: zoom-in; background: var(--cream); }
.co-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.co-photo figcaption { position: absolute; inset: auto 0 0 0; padding: 18px 12px 6px; font-size: 10.5px; color: #fff; background: linear-gradient(transparent, rgba(0, 0, 0, .62)); }
.co-body { display: flex; flex-direction: column; gap: 7px; padding: 12px 14px; }
.co-kind { display: flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--c, var(--muted)); }
.co-kind svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linejoin: round; }
.co-kind span { margin-left: auto; padding-right: 26px; color: var(--muted); font-weight: 500; letter-spacing: 0; text-transform: none; }
.callout h4 { margin: 0; font-family: var(--serif); font-size: 18px; font-weight: 600; line-height: 1.2; }
.co-sp { color: var(--muted); margin-top: -4px; }
.co-read { display: grid; grid-template-columns: repeat(auto-fit, minmax(62px, 1fr)); gap: 6px; }
.co-read div { background: var(--paper); border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; }
.co-read b { display: block; font-family: var(--serif); font-size: 16px; font-weight: 600; line-height: 1.2; }
.co-read small { margin-left: 3px; font: 500 10.5px var(--sans); color: var(--muted); }
.co-read span { font-size: 10px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.callout p { margin: 0; line-height: 1.45; }
.callout .kv { grid-template-columns: 92px 1fr; gap: 3px 10px; font-size: 12px; }
.co-read.words { grid-template-columns: 1fr 1fr auto; }
.co-read.words b { font-size: 13.5px; }
.co-foot a { color: var(--lake); font-weight: 600; white-space: nowrap; }
.lnk { color: var(--lake); font-weight: 600; text-decoration: underline dotted; text-underline-offset: 3px; }
.lnk:hover { text-decoration-style: solid; }
.co-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding-top: 8px; border-top: 1px solid var(--line); font-size: 11px; color: var(--muted); }
.co-del { flex: none; color: var(--alert); font-size: 11px; font-weight: 600; }
.co-form input, .co-form textarea { width: 100%; min-width: 0; font: inherit; color: var(--ink); background: var(--paper); border: 1px solid var(--line-strong); border-radius: 8px; padding: 6px 9px; }
.co-form input:focus, .co-form textarea:focus { outline: none; border-color: var(--lake); box-shadow: 0 0 0 3px var(--lake-soft); }
.co-form .row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.co-form .row3 { display: grid; grid-template-columns: 1.3fr 1fr .8fr; gap: 6px; }
.co-kinds { display: flex; flex-wrap: wrap; gap: 4px; }
.co-kinds label { display: flex; align-items: center; gap: 4px; padding: 3px 9px; border: 1px solid var(--line); border-radius: 999px; font-size: 11.5px; cursor: pointer; }
.co-kinds input { position: absolute; opacity: 0; pointer-events: none; }
.co-kinds svg { width: 12px; height: 12px; fill: none; stroke: var(--c); stroke-width: 1.8; }
.co-kinds label:has(input:checked) { background: var(--c); border-color: var(--c); color: #fff; }
.co-kinds label:has(input:checked) svg { stroke: #fff; }
.co-kinds label:has(input:focus-visible) { outline: 2px solid var(--lake); outline-offset: 1px; }
.co-file { display: flex; align-items: center; justify-content: center; gap: 6px; overflow: hidden; white-space: nowrap; border: 1px dashed var(--line-strong); border-radius: 8px; color: var(--muted); font-size: 12px; cursor: pointer; }
.co-file svg { width: 14px; height: 14px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.6; }
.co-actions { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 12px; }

/* vegetation: plant photos and the management plan */
.veg-photos { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.veg-ph { position: relative; aspect-ratio: 1; padding: 0; overflow: hidden; border-radius: 10px; background: var(--cream); text-align: left; }
.veg-ph img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .3s; }
.veg-ph:hover img { transform: scale(1.05); }
.veg-ph span { position: absolute; inset: auto 0 0 0; padding: 18px 8px 6px; color: #fff; font-size: 11.5px; font-weight: 600; line-height: 1.25; background: linear-gradient(transparent, rgba(0, 0, 0, .66)); }
.veg-ph small { display: block; font-weight: 400; opacity: .85; }
h5.sub { margin: 12px 0 4px; font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.act { display: grid; grid-template-columns: 86px 1fr auto; gap: 10px; padding: 9px 0 9px 10px; border-left: 3px solid var(--c); border-bottom: 1px solid var(--line); }
.act-when { font-size: 12px; font-weight: 600; }
.act-when small { display: block; font-weight: 400; color: var(--muted); }
.act-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; font-size: 13px; }
.act-kind { color: var(--c); font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; }
.act-cost { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; font-family: var(--serif); font-weight: 600; white-space: nowrap; }
.act-cost small { font: 400 10.5px var(--sans); color: var(--muted); margin-top: -4px; }
/* budget */
.stats.four { grid-template-columns: repeat(4, 1fr); }
.stat.over b, td.neg { color: var(--alert); }
.chips.fy { margin-bottom: 8px; }
.bar-track { display: flex; height: 5px; margin-top: 5px; overflow: hidden; border-radius: 3px; background: var(--line); }
.bar-track i { display: block; height: 100%; }
.bar-track .spent { background: var(--lake); }
.bar-track .plan { background: var(--sun); opacity: .75; }
.link { margin-left: 8px; color: var(--lake); font: 600 12px var(--sans); }
.ledger td small { display: block; font-size: 11.5px; }
.ledger td:first-child { white-space: nowrap; }
.ledger select { font: inherit; font-size: 12px; color: var(--ink); background: var(--paper); border: 1px solid var(--line-strong); border-radius: 6px; padding: 2px 4px; }
.ledger .co-del { display: block; margin: 2px 0 0 auto; }

/* town plan: action status and swimming advisory pickers */
select.plan-st, select.adv { font: inherit; font-size: 12px; color: var(--ink); background: var(--paper); border: 1px solid var(--line-strong); border-radius: 999px; padding: 2px 6px; }
select.plan-st.underway { background: var(--lake-soft); color: var(--lake-ink); border-color: transparent; }
select.plan-st.done, select.adv.ok { background: var(--reed-soft); color: var(--ok); border-color: transparent; }
select.adv.sun { background: var(--sun-soft); color: var(--sun); border-color: transparent; }
select.adv.alert { background: var(--alert-soft); color: var(--alert); border-color: transparent; }
table.plan-acts td:last-child { width: 1%; white-space: nowrap; }

@media (max-width: 1100px) { .shell { grid-template-columns: 220px 1fr 420px; } }
@media (max-width: 820px) { .shell { grid-template-columns: 1fr; grid-template-rows: 45vh 1fr; /* the left list is hidden, so: map, then the panel */ } .left { display: none; } .timeline { display: none; } .map .ol-attribution ul { font-size: 8.5px; } .map .ol-attribution { max-width: 55%; } }

/* pond conditions on the town group page: one small chart per pond */
.cond-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 8px 18px; margin-top: 8px; }
.cond-grid svg { display: block; width: 100%; height: auto; margin-top: 2px; }
.cond-grid line { stroke: var(--line); }
.cond-grid text { fill: var(--muted); font: 10px var(--sans); }
.cond-grid .hit { fill: transparent; }
.cond-grid .bar { fill: var(--water); }
.cond-grid g:hover .bar { fill: var(--ink); }
button.cond-pond { background: none; border: 0; padding: 0; font: 600 13px var(--sans); color: var(--lake); cursor: pointer; }
button.cond-pond:hover { text-decoration: underline; }
.cond-more summary { cursor: pointer; font-size: 12px; color: var(--lake); margin-top: 8px; }
.cond-more ul { margin: 6px 0 0 18px; font-size: 12px; color: var(--muted); }

/* portfolio: an org with several ponds takes the page; the map is a tile at the top right (about 1/8 of the screen) */
.shell.portfolio { grid-template-columns: 250px 1fr 30%; grid-template-rows: 45% 1fr; }
.shell.portfolio .left { grid-row: 1 / 3; }
.shell.portfolio .right { grid-column: 2; grid-row: 1 / 3; }
.shell.portfolio .center { grid-column: 3; grid-row: 1; border-left: 1px solid var(--line); }
.dash-side { grid-column: 3; grid-row: 2; overflow-y: auto; padding: 14px; background: var(--cream); border-left: 1px solid var(--line); border-top: 1px solid var(--line); }
.stats.wide { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
table.pf td { vertical-align: middle; }
.unit, .stat .unit { text-transform: none; } /* uppercase turns µg into MG: wrap any unit in a label styled uppercase */
.spark { display: block; width: 140px; height: 28px; }
.spark line { stroke: var(--line); }
.spark .hit { fill: transparent; }
.spark .bar { fill: var(--water); }
.spark g:hover .bar { fill: var(--ink); }
.pf-item { padding: 6px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.pf-item:last-child { border-bottom: 0; }
.pf-item.grp-row:hover { background: var(--lake-soft); }
@media (max-width: 820px) {
  .shell.portfolio { grid-template-columns: 1fr; grid-template-rows: 28vh 1fr 20vh; }
  .shell.portfolio .center, .shell.portfolio .right, .shell.portfolio .dash-side { grid-column: auto; grid-row: auto; } /* must outrank the desktop placement */
}
.pf-legend { margin-top: 8px; }
.pf-key { display: flex; align-items: center; gap: 8px; font-size: 13px; padding: 2px 0; }
.pf-key small { margin-left: auto; }
.pf-note { font-size: 12px; margin-top: 6px; }
.pf-use { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 13px; margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--line); }
.pf-use label { display: inline-flex; align-items: center; gap: 5px; cursor: pointer; }

/* the dashboard toggle sits in the drawer's upper right corner */
#org .pond-head, #group .pond-head, #pond .pond-head { position: relative; padding-right: 44px; }
.dash-btn, .pdf-btn { position: absolute; top: 0; right: 0; }
.pf-tools { display: flex; justify-content: flex-end; }
.pf-print { background: var(--lake); color: var(--card); border-radius: 8px; padding: 6px 14px; font-weight: 600; font-size: 13px; }
.pf-print:disabled { opacity: .6; cursor: wait; }
.chart-wrap.short, canvas.chart.short { height: 150px !important; }
.left, .right, .dash-side { scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }

/* line icons (icons.js): inline, in the text color, one size */
.ic { width: 15px; height: 15px; flex: none; vertical-align: -3px; }
[data-icon] > .ic, .pf-print .ic, #btn-obs .ic { margin-right: 6px; }
.icon-btn > .ic { margin: 0; }
h3 > .ic { width: 14px; height: 14px; vertical-align: -2px; }
.badge > .ic { width: 13px; height: 13px; margin-right: 4px; vertical-align: -2px; }
.tabs button > .ic { width: 14px; height: 14px; margin-right: 5px; opacity: .8; }
.tabs button.on > .ic { opacity: 1; }
/* organizations list: one line per name (full name on hover), so Managed ponds shows without scrolling */
#orgs li { padding: 6px 10px; }
#orgs li b { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* the hosted one-pond site (Site.cs): no left lists, no search, no workspace forms */
body.site .left, body.site .right-empty, body.site .add-org:has(#ws-form), body.site #back-group { display: none; }
body.site .search { visibility: hidden; }
body.site .shell { grid-template-columns: 1fr minmax(380px, 500px); }
@media (max-width: 820px) { body.site .shell { grid-template-columns: 1fr; } }
.who { display: flex; align-items: center; gap: 4px; margin: 0; font-size: 12.5px; color: var(--muted); }
.who button { padding: 0; border: 0; background: none; font: inherit; cursor: pointer; }
.cache-note { margin: 10px 2px 0; font-size: 12px; }
.cache-note .lnk { padding: 0; border: 0; background: none; font: inherit; cursor: pointer; }
.ref { padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.ref:last-child { border-bottom: 0; }
.ref a { color: var(--lake); font-weight: 600; }
.ref small { display: block; }
.ref p { margin: 3px 0 0; }
/* Why does this matter? (js/explain.js) */
.why { display: inline-flex; align-items: center; justify-content: center; width: 15px; height: 15px; margin-left: 4px; padding: 0; border: 1px solid currentColor; border-radius: 50%; background: none; color: inherit; font: italic 600 10px/1 var(--serif); text-transform: none; letter-spacing: 0; cursor: pointer; opacity: .65; vertical-align: 1px; }
.why:hover { opacity: 1; }
.why-pop { position: fixed; z-index: 1000; max-width: 340px; padding: 12px 14px; background: var(--card); color: var(--ink); border: 1px solid var(--line-strong); border-radius: 10px; box-shadow: var(--shadow); font-size: 13px; }
.why-pop h4 { margin: 0 0 6px; font: 600 15px var(--serif); }
.why-pop p { margin: 5px 0; }
.why-pop a { color: var(--lake); }
@media print { .why, .why-pop { display: none !important; } }
