:root {
  color-scheme: light;
  --bg: #f6f7f5; --panel: #fff; --side: #eef2ec; --line: #e2e6e1; --ink: #1f2a24; --ink-2: #4c5a52; --ink-3: #7a877f;
  --brand: #2f6b4f; --brand-2: #dcefe3; --code: #f0f2ef; --err-bg: #fff3f0; --err-line: #f0c9c0; --err: #8a2f1f;
  --chip: #fff; --chip-line: #cfd6cf; --warn: #8a5a10; --warn-bg: #fdf3e0;
  --t-page: 24px; --t-block: 17px; --t-item: 15px; --t-body: 14px; --t-meta: 13px; --t-cap: 12px;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--ink); font-size: var(--t-body); line-height: 1.45;
  font-family: -apple-system, BlinkMacSystemFont, system-ui, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3, p { margin: 0; }
[hidden] { display: none !important; }
svg.ic { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

.app { display: flex; height: 100vh; height: 100dvh; }
.side { width: 260px; flex: 0 0 260px; background: var(--side); border-right: 1px solid var(--line); display: flex; flex-direction: column; padding: 12px 8px; overflow-y: auto; }
.brand { display: flex; align-items: center; padding: 2px 6px 12px; }
.brand img { width: 200px; max-width: 100%; height: auto; }
.side-mode { display: flex; align-items: center; gap: 8px; margin: 0 0 6px; padding: 7px 10px; border-radius: 8px; background: var(--brand-2); color: var(--brand); font-size: var(--t-meta); font-weight: 600; }
.side-region { display: flex; align-items: center; gap: 8px; padding: 4px 10px 10px; color: var(--ink-2); font-size: var(--t-meta); }
.side-cap { padding: 10px 10px 4px; font-size: var(--t-cap); color: var(--ink-3); border-top: 1px solid var(--line); }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a { display: flex; align-items: center; gap: 8px; padding: 7px 10px; border-radius: 8px; color: var(--ink); text-decoration: none; font-size: var(--t-body); }
.nav a:hover { background: var(--panel); }
.nav a.on { background: var(--panel); color: var(--brand); font-weight: 600; box-shadow: inset 0 0 0 1px var(--chip-line); }
.nav a.nav-new { position: relative; margin-top: 13px; }
.nav a.nav-new::before { content: ""; position: absolute; left: 10px; right: 10px; top: -7px; border-top: 1px solid var(--line); }
.side-new { display: flex; align-items: center; gap: 8px; width: 100%; margin-top: 2px; padding: 7px 10px; border: 0; border-radius: 8px; background: none; color: var(--ink); font: inherit; font-size: var(--t-body); text-align: left; cursor: pointer; }
.side-new:hover { background: var(--panel); }
.side-new svg.ic { color: var(--brand); }
.side-recent { margin: 0 0 8px; }
.side-recent > summary { display: flex; align-items: center; gap: 6px; padding: 8px 10px 4px; list-style: none; cursor: pointer; font-size: var(--t-cap); color: var(--ink-3); text-transform: uppercase; letter-spacing: .04em; }
.side-recent > summary::-webkit-details-marker { display: none; }
.side-recent > summary::after { content: "▸"; } .side-recent[open] > summary::after { content: "▾"; }
.side-dialogs { display: flex; flex-direction: column; gap: 1px; max-height: 260px; overflow-y: auto; }
.side-dialogs a { display: block; padding: 6px 10px; border-radius: 8px; color: var(--ink); text-decoration: none; font-size: var(--t-meta); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-dialogs a:hover { background: var(--panel); } .side-dialogs a.on { background: var(--brand-2); color: var(--brand); }
.side-dialogs .muted { padding: 4px 10px; font-size: var(--t-meta); }
.side-foot { margin-top: auto; border-top: 1px solid var(--line); padding-top: 8px; }
.who { display: flex; align-items: center; gap: 8px; width: 100%; padding: 6px 8px; border: 0; border-radius: 8px; background: none; text-align: left; color: var(--ink-2); }
.who:hover { background: var(--panel); }
.who .ava { width: 32px; height: 32px; border-radius: 50%; background: var(--brand-2); color: var(--brand); display: grid; place-items: center; font-size: var(--t-meta); font-weight: 700; flex: none; }
.who .g { flex: 1; min-width: 0; }
.who .n { color: var(--ink); font-size: var(--t-meta); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.who .r { font-size: var(--t-cap); color: var(--ink-3); }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; overflow: hidden; }
.top { display: flex; align-items: center; gap: 6px; padding: 10px 16px; border-bottom: 1px solid var(--line); background: var(--panel); color: var(--ink-2); font-size: var(--t-meta); }
.top a { color: inherit; text-decoration: none; display: inline-flex; }
.top a:hover { color: var(--brand); }
.top .cur { color: var(--ink); font-weight: 600; }
.top .sep { color: var(--ink-3); }
.top-farm { margin-left: auto; display: flex; align-items: center; gap: 8px; color: var(--ink-3); }
.top-farm select { width: auto; max-width: 240px; padding: 4px 8px; font-size: var(--t-meta); }
.page { flex: 1; overflow-y: auto; padding: 16px 20px 24px; }
.page.fill { display: flex; flex-direction: column; overflow: hidden; }
.head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.head .grow { flex: 1; min-width: 0; }
.head h1 { font-size: var(--t-page); font-weight: 700; line-height: 1.25; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.head .sub { margin-top: 4px; color: var(--ink-2); font-size: var(--t-body); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 5px 10px; border-radius: 8px; border: 1px solid var(--brand); background: var(--panel); color: var(--brand); font-size: var(--t-meta); white-space: nowrap; }
.btn.solid { border: 1px solid var(--brand); background: var(--brand); color: #fff; border-radius: 10px; padding: 8px 14px; font-weight: 600; }
.btn.plain { border-color: var(--chip-line); color: var(--ink-2); }
.btn.on { background: var(--brand); color: #fff; }
.btn:disabled { opacity: .6; cursor: default; }
.link { border: 0; background: none; padding: 0; color: var(--brand); font-size: var(--t-meta); display: inline-flex; align-items: center; gap: 6px; }
.link:hover { text-decoration: underline; }

.card { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; }
.card h2 { font-size: var(--t-block); font-weight: 700; margin-bottom: 10px; }
.card h2 small { font-weight: 400; color: var(--ink-3); font-size: var(--t-meta); }
.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: var(--t-cap); font-weight: 400; background: var(--chip); border: 1px solid var(--chip-line); color: var(--ink-2); white-space: nowrap; }
.badge.temp { background: var(--warn-bg); border-color: #f0dcb4; color: var(--warn); }
.badge.permanent, .badge.spec { background: var(--brand-2); border-color: var(--brand-2); color: var(--brand); }
.badge.archived { background: var(--code); border-color: var(--line); }
.muted { color: var(--ink-3); font-size: var(--t-meta); }
.note-line { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 10px; background: var(--code); color: var(--ink-2); font-size: var(--t-meta); }

.stats { display: grid; grid-template-columns: repeat(3, 1fr); margin-bottom: 12px; padding: 0; }
.stats .s { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-right: 1px solid var(--line); }
.stats .s:last-child { border-right: 0; }
.stats .s svg.ic { width: 24px; height: 24px; color: var(--brand); }
.stats .v { font-size: var(--t-block); font-weight: 700; line-height: 1.25; }
.stats .l { color: var(--ink-3); font-size: var(--t-meta); }
.filters { display: flex; gap: 6px; margin-bottom: 10px; flex-wrap: wrap; }
.chip { border: 1px solid var(--chip-line); background: var(--chip); color: var(--ink-2); border-radius: 999px; padding: 4px 12px; font-size: var(--t-meta); }
.chip.on { background: var(--brand-2); border-color: var(--brand); color: var(--brand); font-weight: 600; }
.tbl { width: 100%; border-collapse: collapse; }
.tbl th { text-align: left; background: var(--code); color: var(--ink-3); font-weight: 500; font-size: var(--t-cap); padding: 7px 8px; border-bottom: 1px solid var(--line); }
.tbl td { padding: 8px; border-bottom: 1px solid var(--line); font-size: var(--t-meta); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl .nm { font-size: var(--t-item); font-weight: 600; }
.tbl .mt { margin-top: 4px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; color: var(--ink-3); font-size: var(--t-meta); }
.tbl td.r { text-align: right; white-space: nowrap; }
.empty { padding: 24px 16px; text-align: center; color: var(--ink-3); font-size: var(--t-meta); }
.empty .btn { margin-top: 12px; }

.steps { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.steps .st { display: flex; align-items: center; gap: 8px; color: var(--ink-3); font-size: var(--t-body); }
.steps .st b { width: 26px; height: 26px; border-radius: 50%; border: 1px solid var(--chip-line); background: var(--panel); display: grid; place-items: center; font-size: var(--t-meta); font-weight: 600; }
.steps .st.on { color: var(--ink); font-weight: 600; }
.steps .st.on b { background: var(--brand); border-color: var(--brand); color: #fff; }
.steps .ln { flex: 1; height: 1px; background: var(--line); max-width: 160px; }
.cols { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(260px, 1fr); gap: 12px; align-items: start; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.form .row { display: grid; grid-template-columns: 170px minmax(0, 1fr); align-items: center; gap: 6px 12px; margin-bottom: 10px; }
.form .row:last-child { margin-bottom: 0; }
.form .row.up { align-items: start; }
.form .row.up > label { padding-top: 6px; }
.form label { color: var(--ink-2); font-size: var(--t-meta); }
.form label i { color: var(--err); font-style: normal; }
.inp { width: 100%; padding: 5px 8px; border: 1px solid var(--chip-line); border-radius: 8px; background: var(--panel); font-size: var(--t-meta); min-width: 0; }
.inp:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 2px var(--brand-2); }
.inp[readonly] { background: var(--code); color: var(--ink-2); }
.inp.bad { border-color: var(--err); }
textarea.inp { min-height: 84px; resize: vertical; line-height: 1.45; }
.hint { margin-top: 6px; font-size: var(--t-cap); line-height: 1.45; color: var(--ink-3); }
.hint.ok { color: var(--brand); } .hint.warn { color: var(--err); }
.kind { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 10px; background: var(--warn-bg); color: var(--warn); font-size: var(--t-item); font-weight: 600; }
.todo { list-style: none; margin: 10px 0; padding: 0 0 10px; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 8px; }
.todo li { display: flex; align-items: center; gap: 8px; font-size: var(--t-meta); }
.todo svg.ic { color: var(--brand); }
.flow { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }
.flow span { padding: 3px 10px; border-radius: 999px; background: var(--code); color: var(--ink-2); font-size: var(--t-cap); }
.flow span.a { background: var(--warn-bg); color: var(--warn); } .flow span.z { background: var(--brand-2); color: var(--brand); }
.flow svg.ic { width: 14px; height: 14px; color: var(--ink-3); }
.bar { display: flex; align-items: center; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.bar .grow { flex: 1 1 200px; min-width: 0; color: var(--ink-3); font-size: var(--t-meta); }
.bar .btn, .mapfoot .btn, .maptools .btn { padding: 6px 12px; border-radius: 8px; }
.maptools .inp { padding: 6px 8px; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin: 0 0 12px; flex-wrap: wrap; }
.tabs button { border: 0; border-bottom: 2px solid transparent; background: none; color: var(--ink-3); font-size: var(--t-item); font-weight: 500; padding: 8px 12px; margin-bottom: -1px; white-space: nowrap; }
.tabs button.on { color: var(--ink); border-bottom-color: var(--brand); font-weight: 600; }
.head-acts { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.menu { position: relative; }
.menu-list { position: absolute; right: 0; top: calc(100% + 6px); z-index: 20; min-width: 290px; padding: 6px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 10px 30px rgba(0,0,0,.14); }
.menu-list button { display: block; width: 100%; padding: 8px 10px; border: 0; border-radius: 8px; background: none; text-align: left; }
.menu-list button:hover { background: var(--code); }
.menu-list b { display: block; font-size: var(--t-body); font-weight: 600; }
.menu-list span { display: block; margin-top: 2px; font-size: var(--t-cap); color: var(--ink-3); }
.pane-search { padding: 0 14px 8px; }
.fsel { position: relative; min-width: 0; }
.fsel-btn { display: flex; align-items: center; gap: 6px; text-align: left; cursor: pointer; }
.fsel-btn .fsel-t { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fsel-btn svg.ic { flex: none; width: 14px; height: 14px; color: var(--ink-3); }
.fsel-pop { position: fixed; z-index: 70; display: flex; flex-direction: column; min-width: 260px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 10px 30px rgba(0,0,0,.14); overflow: hidden; }
.fsel-pop[hidden], .fsel-item[hidden], .fsel-none[hidden] { display: none; }
.fsel-find { padding: 6px 6px 4px; }
.fsel-none { padding: 8px 12px; color: var(--ink-3); font-size: var(--t-meta); }
.fsel-list { flex: 1; min-height: 0; overflow-y: auto; padding: 0 6px 6px; position: relative; }
.fsel-item { display: block; width: 100%; padding: 7px 10px; border: 0; border-radius: 8px; background: none; text-align: left; }
.fsel-item:hover { background: var(--code); }
.fsel-item.on { background: var(--brand-2); }
.fsel-item b { display: block; font-size: var(--t-body); font-weight: 600; overflow-wrap: anywhere; }
.fsel-item span { display: block; margin-top: 1px; font-size: var(--t-cap); color: var(--ink-3); }
.foot-note { display: flex; align-items: center; gap: 8px; margin-top: 8px; color: var(--ink-3); font-size: var(--t-meta); }
.work { flex: 1; min-height: 0; display: grid; grid-template-columns: 250px minmax(0, 1fr) 260px; gap: 12px; }
.work.noside { grid-template-columns: 250px minmax(0, 1fr); }
.pane { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
.pane h2 { font-size: var(--t-block); font-weight: 700; padding: 12px 14px 8px; }
.flist { flex: 1; overflow-y: auto; }
.fitem { display: flex; align-items: center; gap: 8px; width: 100%; padding: 8px 14px; border: 0; border-top: 1px solid var(--line); background: none; text-align: left; }
.fitem:hover { background: var(--code); }
.fitem.on { background: var(--brand-2); }
.fitem svg.ic { color: var(--brand); }
.fitem .g { flex: 1; min-width: 0; }
.fitem .nm { font-size: var(--t-body); font-weight: 600; } .fitem .cr { font-size: var(--t-meta); color: var(--ink-3); }
.fitem .badge { margin-top: 4px; }
.fitem .ha { font-size: var(--t-meta); white-space: nowrap; }
.ftotal { display: flex; justify-content: space-between; align-items: baseline; padding: 10px 14px; border-top: 1px solid var(--line); font-size: var(--t-meta); color: var(--ink-2); }
.ftotal b { font-size: var(--t-item); color: var(--ink); }
.mapbox { position: relative; display: flex; flex-direction: column; }
.maptools { display: flex; align-items: center; gap: 8px; padding: 8px; flex-wrap: wrap; }
.maptools .grow { flex: 1; }
.maptools .inp { width: 240px; }
.map { flex: 1; min-height: 260px; margin: 0 8px 8px; border-radius: 10px; overflow: hidden; background: var(--code); }
.mapfoot { position: absolute; left: 18px; right: 18px; bottom: 18px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 8px 12px; border-radius: 10px; background: rgba(255,255,255,.96); box-shadow: 0 2px 10px rgba(0,0,0,.12); }
.mapfoot .grow { flex: 1 1 120px; min-width: 0; font-size: var(--t-meta); }
.mapfoot .base { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border: 1px solid var(--chip-line); border-radius: 8px; font-size: var(--t-meta); color: var(--ink-2); }
.foot-acts { display: flex; align-items: center; gap: 8px; }
.fpanel > .badge { margin-top: 2px; align-self: flex-start; }
.fpanel { padding: 12px 14px; overflow-y: auto; }
.fpanel h2 { padding: 0 0 4px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.fpanel .fl { display: block; margin: 10px 0 4px; color: var(--ink-2); font-size: var(--t-meta); }
.fpanel .note-line { margin-top: 8px; }
.fpanel .btn { display: flex; width: 100%; margin-top: 10px; padding: 8px 12px; }
.fpanel .btn.del { border-color: var(--chip-line); color: var(--err); }
.x { border: 0; background: none; padding: 4px; color: var(--ink-3); display: inline-flex; border-radius: 6px; }
.x:hover { background: var(--code); color: var(--ink); }
.diary { display: flex; flex-direction: column; gap: 8px; }
.entry { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.entry .m { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 4px; color: var(--ink-3); font-size: var(--t-meta); }
.entry .m b { color: var(--ink); font-size: var(--t-item); font-weight: 600; }
.entry p { white-space: pre-wrap; }

.modal { position: fixed; inset: 0; z-index: 50; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(31,42,36,.38); }
.modal .box { width: min(480px, 100%); max-height: calc(100dvh - 32px); overflow-y: auto; background: var(--panel); border-radius: 18px; padding: 20px 24px 18px; box-shadow: 0 20px 60px rgba(0,0,0,.18); }
.modal h2 { font-size: var(--t-block); font-weight: 700; margin-bottom: 10px; }
.modal.ask { z-index: 60; }
.modal .ask-text { font-size: var(--t-item); line-height: 1.45; margin-bottom: 16px; }
.modal .fl { display: block; margin: 10px 0 4px; color: var(--ink-2); font-size: var(--t-meta); }
.modal .two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.modal .two .inp { height: 31px; }
.modal .bar { justify-content: flex-end; flex-wrap: nowrap; }
.modal .bar .grow { display: none; }
.modal .box.wide { width: min(980px, 100%); }
.mode-sw { display: inline-flex; gap: 2px; padding: 2px; margin: 0 0 8px; border: 1px solid var(--chip-line); border-radius: 10px; background: var(--chip); }
.mode-sw button { display: inline-flex; align-items: center; gap: 6px; padding: 5px 14px; border: 0; border-radius: 8px; background: none; color: var(--ink-2); font: inherit; font-size: var(--t-meta); cursor: pointer; }
.mode-sw button.on { background: var(--panel); color: var(--brand); font-weight: 600; box-shadow: 0 0 0 1px var(--chip-line); }
.ai-obs { margin: 0 0 12px; padding: 10px 12px; border: 1px solid var(--chip-line); border-radius: 12px; background: var(--brand-2); }
.ai-obs textarea.inp { background: var(--panel); }
.ai-obs-bar { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.ai-obs-out { margin-top: 6px; } .ai-obs-out:empty { display: none; }
.ai-obs-d { margin: 6px 0; line-height: 1.4; }
.ai-obs-vars { display: flex; flex-wrap: wrap; gap: 6px; }
.ai-obs .note-line { margin-top: 8px; background: var(--panel); }
.rec { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); }
.rec .check { display: flex; align-items: center; gap: 8px; font-weight: 600; cursor: pointer; }
.rec-body { margin-top: 4px; }
.rec-rate { display: flex; align-items: center; gap: 8px; } .rec-rate .inp { min-width: 0; } .rec-unit { flex: none; color: var(--ink-2); font-size: var(--t-meta); white-space: nowrap; }
.rec-total { margin-top: 6px; font-weight: 600; font-size: var(--t-meta); }
.modal h3 { font-size: var(--t-item); font-weight: 600; margin: 14px 0 8px; }
.obs { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 20px; }
.obs-col { min-width: 0; }
.obs-line { display: flex; align-items: center; gap: 12px; margin-top: 6px; }
.kinds { display: flex; flex-wrap: wrap; gap: 6px; }
.kinds .chip { padding: 6px 12px; }
.photos { display: flex; flex-wrap: wrap; gap: 8px; }
.photos:not(:empty) { margin-bottom: 8px; }
.photos .ph { position: relative; width: 84px; height: 84px; border-radius: 10px; overflow: hidden; border: 1px solid var(--line); }
.photos img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photos .x { position: absolute; top: 2px; right: 2px; background: rgba(255,255,255,.9); }
.btn.wide { display: flex; width: 100%; padding: 8px 12px; }
.obs-map { height: 210px; border-radius: 10px; overflow: hidden; border: 1px dashed var(--chip-line); background: var(--code); }
.obs .note-line { margin-top: 12px; }

.mon { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 12px; margin: 10px 0 12px; align-items: start; }
.mon-map { position: relative; }
.mon-map .map { height: 440px; flex: none; }
.mon-map .maptools .inp { width: 160px; }
.mon-mean { position: absolute; left: 18px; bottom: 18px; padding: 6px 12px; border-radius: 10px; background: rgba(255,255,255,.96); font-size: var(--t-meta); box-shadow: 0 2px 10px rgba(0,0,0,.12); }
.mon-mean b { font-size: var(--t-item); }
.mon-legend { position: absolute; right: 18px; bottom: 18px; width: 200px; padding: 8px 12px; border-radius: 10px; background: rgba(255,255,255,.96); font-size: var(--t-cap); box-shadow: 0 2px 10px rgba(0,0,0,.12); }
.mon-legend .t { margin-bottom: 6px; color: var(--ink); }
.mon-legend .bar5 { display: flex; height: 8px; border-radius: 4px; overflow: hidden; }
.mon-legend .bar5 i { flex: 1; }
.mon-legend .ends { display: flex; justify-content: space-between; margin-top: 4px; color: var(--ink-3); }
.mon-legend .zone-key { display: flex; align-items: flex-start; gap: 7px; margin-top: 7px; padding-top: 7px; border-top: 1px solid var(--line); color: var(--ink-2); line-height: 1.3; }
.mon-legend .zone-key i { flex: none; width: 9px; height: 9px; margin-top: 2px; border-radius: 50%; background: #f5a623; border: 2px solid #fff; box-shadow: 0 0 0 1px rgba(0,0,0,.3); }
.mon-total { margin: -4px 0 8px; font-size: var(--t-body); color: var(--ink-2); }
.zone { display: flex; align-items: baseline; gap: 8px; width: 100%; margin-bottom: 6px; padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); text-align: left; font-size: var(--t-meta); }
.zone:hover { border-color: var(--chip-line); }
.zone.on { background: var(--warn-bg); border-color: #f0dcb4; }
.zone .muted { margin-left: auto; }
.zone-sel { display: flex; align-items: center; gap: 8px; margin: 8px 0; padding: 8px 10px; border-radius: 8px; background: var(--warn-bg); color: var(--warn); font-size: var(--t-meta); }
.mon-note { margin-top: 8px; color: var(--ink-2); font-size: var(--t-meta); }
.mon-acts { display: flex; flex-direction: column; gap: 8px; }
.mon-acts .btn { display: flex; width: 100%; padding: 8px 12px; }
.m { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; color: var(--ink-3); font-size: var(--t-meta); }
.mon-text { margin-bottom: 8px; font-size: var(--t-meta); white-space: pre-wrap; }
.chart { display: block; width: 100%; height: auto; max-height: 240px; }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .axis { fill: var(--ink-3); font-size: 12px; }
.chart .val { fill: var(--ink); font-size: 12px; font-weight: 600; }
.chart .line { fill: none; stroke: var(--brand); stroke-width: 2; }
.chart .area { fill: var(--brand-2); opacity: .6; }
.chart .dot { fill: var(--panel); stroke: var(--brand); stroke-width: 2; }
.ov { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 12px; margin-bottom: 12px; align-items: start; }
.ov .card { margin: 0; }
.ov-zones { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 12px; }
.ov-map { height: 230px; border-radius: 10px; overflow: hidden; background: var(--code); }
.ov-side { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.ov-alert { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 10px; background: var(--warn-bg); color: var(--warn); font-size: var(--t-meta); font-weight: 600; }
.ov-line { display: flex; flex-direction: column; gap: 1px; align-items: flex-start; font-size: var(--t-meta); }
.ov-fact { margin-bottom: 6px; font-size: var(--t-block); }
.ov-fact .muted, .ov-fact.muted { font-size: var(--t-meta); }
.ov-links { display: flex; gap: 18px; flex-wrap: wrap; margin-top: 10px; }
.ov .card > .link { margin-top: 10px; }
.seg2 { display: inline-flex; margin: 0 0 8px; border: 1px solid var(--chip-line); border-radius: 8px; overflow: hidden; }
.seg2 button { border: 0; background: var(--panel); padding: 4px 14px; font-size: var(--t-meta); color: var(--ink-2); cursor: pointer; }
.seg2 button.on { background: var(--brand); color: #fff; font-weight: 600; }
.ev { display: flex; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); font-size: var(--t-meta); }
.ev svg.ic { flex: none; color: var(--brand); margin-top: 2px; }
.ev b { font-weight: 600; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.card-head h2 { margin: 0; }
.tbl-wrap { overflow-x: auto; }
.tbl .inp { min-width: 90px; max-width: 220px; }
.cols2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; align-items: start; }
.cols2 .card { margin: 0; }
.badge.warn { background: var(--warn-bg); color: var(--warn); }
.ai-page .head { margin-bottom: 8px; }
.ai-farm { display: flex; align-items: center; gap: 8px; color: var(--ink-3); font-size: var(--t-meta); }
.ai-farm select { width: auto; max-width: 260px; }
.ai-field[hidden] { display: none; }
.ai-wait { display: flex; align-items: center; gap: 8px; animation: ai-wait-deep 1.4s ease-in-out infinite; }
.ai-wait-logo { width: 22px; height: 22px; border-radius: 6px; flex: none; }
@keyframes ai-wait-deep { 0%, 100% { opacity: 1; } 50% { opacity: .08; } }
@keyframes ai-wait-soft { 0%, 100% { opacity: 1; } 50% { opacity: .45; } }
@media (prefers-reduced-motion: reduce) { .ai-wait { animation: ai-wait-soft 2s ease-in-out infinite; } }
.ai-field .fsel, .ai-field select { width: auto; max-width: min(260px, 60vw); }
.ai-field .fsel-btn, .ai-field select { height: 32px; border-radius: 10px; }

.ai-box { display: flex; flex-direction: column; gap: 6px; padding: 8px 10px; border: 1px solid var(--chip-line); border-radius: 14px; background: var(--panel); }
.ai-box:focus-within { border-color: var(--brand); }
.ai-box textarea.inp { border: 0; box-shadow: none; background: none; resize: none; min-height: 44px; max-height: 160px; padding: 4px 2px; font-size: var(--t-body); font-family: inherit; }
.ai-tools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ai-tools .grow { flex: 1; }
.ai-tool { height: 32px; }
.ai-tool.on { border-color: var(--brand); color: var(--brand); }
.ai-send { flex: none; width: 36px; height: 36px; padding: 0; border: 0; border-radius: 10px; background: var(--brand); color: #fff; display: inline-flex; align-items: center; justify-content: center; }
.ai-send:disabled { opacity: .5; }
.ai-send svg.ic { width: 18px; height: 18px; stroke-width: 2; }
.ai-attach, .ai-reply { display: flex; align-items: center; gap: 8px; font-size: var(--t-meta); color: var(--ink-2); }
.ai-attach[hidden], .ai-reply[hidden] { display: none; }
.ai-attach img { width: 44px; height: 44px; object-fit: cover; border-radius: 8px; }
.ai-attach .grow, .ai-reply .grow { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ai-reply { padding: 4px 4px 4px 8px; border-left: 3px solid var(--brand); border-radius: 6px; background: var(--code); }

.ai-acts { display: flex; align-items: center; gap: 2px; align-self: flex-start; margin: -6px 0 0 4px; color: var(--ink-3); }
.ai-acts.user { align-self: flex-end; margin: -6px 4px 0 0; }
.ai-act { display: inline-flex; padding: 4px 5px; border: 0; border-radius: 6px; background: none; color: var(--ink-3); }
.ai-act:hover { color: var(--brand); background: var(--code); }
.ai-act svg.ic { width: 15px; height: 15px; }
.ai-took { margin-left: 6px; font-size: var(--t-cap); }
.ai-sec { font-variant-numeric: tabular-nums; }
.ai-quote { margin-bottom: 4px; padding-left: 6px; border-left: 2px solid var(--chip-line); font-size: var(--t-cap); color: var(--ink-3); white-space: normal; }
.ai-photo { display: block; max-width: 180px; max-height: 180px; margin-bottom: 6px; border-radius: 8px; }
.ai-page .head .grow { min-width: min(300px, 100%); }
.ai-log { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; padding: 4px 2px 12px; }
.msg { max-width: min(760px, 92%); padding: 10px 14px; border-radius: 12px; font-size: var(--t-body); line-height: 1.5; overflow-wrap: anywhere; }
.msg.user { align-self: flex-end; background: var(--brand-2); color: var(--ink); white-space: pre-wrap; }
.msg.bot { align-self: flex-start; background: var(--panel); border: 1px solid var(--line); }
.msg.err { border-color: var(--err-line); background: var(--err-bg); color: var(--err); }
.msg p { margin: 0; }
.md > * + * { margin-top: 8px; }
.md h4 { font-size: var(--t-item); font-weight: 700; margin-bottom: 0; }
.md ul, .md ol { margin: 0; padding-left: 20px; }
.md li + li { margin-top: 3px; }
.md th { white-space: nowrap; }
.md code { background: var(--code); border-radius: 4px; padding: 1px 4px; font-size: var(--t-meta); }
.ai-seen { margin-top: 8px; padding-top: 6px; border-top: 1px solid var(--line); font-size: var(--t-cap); }
.ai-empty { margin: auto; display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; padding: 20px; }
.ai-empty svg.ic { width: 28px; height: 28px; color: var(--brand); }
.ai-empty .t { font-size: var(--t-block); font-weight: 700; }
.ai-empty .filters { justify-content: center; margin: 10px 0 0; }
.ai-empty .chip { cursor: pointer; }
.ai-in { display: flex; gap: 8px; align-items: flex-end; }
.ai-in textarea { flex: 1; resize: none; min-height: 44px; max-height: 160px; padding: 10px 12px; border-radius: 12px; font-size: var(--t-body); font-family: inherit; }
.ai-note { text-align: center; margin-top: 6px; }
.stats .s.warn svg.ic { color: var(--warn); }
.fmeta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 3px; }
.fmeta span { white-space: nowrap; }
.h-ic { display: flex; align-items: center; gap: 8px; }
.h-ic.warn svg.ic { color: var(--warn); }
.cols + .cols2, .stats + .cols { margin-top: 0; }
.cols { margin-bottom: 12px; }

.reg-row { grid-template-columns: calc(66.667% - 6px) minmax(0, 1fr); align-items: stretch; }
.reg-row + .reg-row { margin-top: 0; }
.cols .card { margin: 0; }
.act { display: flex; align-items: center; gap: 12px; width: 100%; padding: 8px 0; border: 0; border-top: 1px solid var(--line); background: none; text-align: left; cursor: pointer; color: inherit; font: inherit; }
.act .grow { flex: 1; min-width: 0; }
.act svg.ic { color: var(--brand); flex: none; }
.when { flex: none; width: 64px; padding: 5px 4px; border-radius: 8px; background: var(--brand-2); color: var(--brand); text-align: center; font-size: var(--t-cap); line-height: 1.2; }
.when b { display: block; font-size: var(--t-item); font-weight: 700; }
.when.now { font-weight: 600; padding: 9px 4px; }
.when.late { background: var(--warn-bg); color: var(--warn); }
.crop-row { display: grid; grid-template-columns: minmax(90px, 160px) minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 6px 0; font-size: var(--t-meta); }
.crop-row .n { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.crop-row .line { height: 8px; border-radius: 999px; background: var(--code); overflow: hidden; }
.crop-row .line i { display: block; height: 100%; border-radius: 999px; background: var(--brand); }
.crop-row b { font-weight: 600; white-space: nowrap; }
.sel-sm select { width: auto; max-width: 220px; }
.fact { padding: 10px 14px; margin-bottom: 8px; border: 1px solid var(--line); border-radius: 10px; }
.fact .big { font-size: var(--t-page); font-weight: 700; line-height: 1.25; }
.note-line .grow { flex: 1; }
.rep-edit { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 12px; align-items: start; }
.rep-side .check { display: flex; align-items: center; gap: 10px; padding: 6px 0; font-size: var(--t-body); cursor: pointer; }
.rep-side .check input { width: 16px; height: 16px; accent-color: var(--brand); }
.rep-side .fl { display: block; margin: 12px 0 4px; color: var(--ink-2); font-size: var(--t-meta); }
.rep-side .two { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.rep-side textarea { resize: vertical; font-family: inherit; }
.rep-side .note-line { margin-top: 12px; }
.rep-wrap { padding: 16px; border-radius: 12px; background: var(--code); }
.rep-under { margin-top: 12px; background: none; padding-left: 0; }
.share { display: flex; align-items: flex-end; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.share .grow { flex: 1 1 320px; min-width: 0; }
.share .inp { margin-top: 4px; }
.steps { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.steps > svg.ic { color: var(--ink-3); }
.step { display: inline-flex; align-items: center; gap: 8px; padding: 7px 14px; border-radius: 10px; font-size: var(--t-item); font-weight: 600; }
.step.temp { background: var(--warn-bg); color: var(--warn); }
.step.permanent { background: var(--brand-2); color: var(--brand); }
.step.off { background: var(--code); color: var(--ink-3); font-weight: 400; }
.acc { display: flex; align-items: flex-start; gap: 10px; padding: 9px 12px; margin-top: 8px; border-radius: 10px; background: var(--code); font-size: var(--t-meta); }
.acc svg.ic { color: var(--brand); flex: none; margin-top: 1px; }
.acc b { font-weight: 600; }
.frow { display: flex; flex-wrap: wrap; gap: 10px 12px; margin-bottom: 10px; }
.fcell { flex: 1 1 150px; min-width: 0; }
.fcell.end { flex: 0 0 auto; align-self: flex-end; }
.fcell .fl { display: block; margin: 0 0 4px; color: var(--ink-2); font-size: var(--t-meta); }
.row-acts { display: inline-flex; align-items: center; gap: 10px; }
.nm2 { font-weight: 600; }
.card > .tbl { margin-top: 2px; }
.card > p.muted { margin: -4px 0 10px; }
.kv { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-bottom: 1px solid var(--line); font-size: var(--t-meta); }
.kv:last-child { border-bottom: 0; }
.kv span { color: var(--ink-3); } .kv b { font-weight: 600; text-align: right; }
.health { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.health .score { font-size: var(--t-page); font-weight: 700; line-height: 1; }
.reason { padding: 6px 0; border-top: 1px solid var(--line); font-size: var(--t-meta); color: var(--ink-2); }
.link.open-mon { margin-top: 12px; }
.entry-line { margin-bottom: 4px; font-size: var(--t-meta); color: var(--ink-2); }
#toasts { position: fixed; left: 50%; bottom: 32px; transform: translateX(-50%); z-index: 60; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.toast { padding: 10px 14px; border-radius: 10px; background: var(--ink); color: #fff; font-size: var(--t-meta); max-width: min(420px, 90vw); opacity: .95; }
.toast.bad { background: var(--err); }

.login { min-height: 100vh; min-height: 100dvh; display: flex; align-items: center; justify-content: center; padding: 16px; }
.login .box { width: min(480px, 100%); background: var(--panel); border-radius: 18px; padding: 28px 32px 18px; box-shadow: 0 20px 60px rgba(0,0,0,.18); }
.login .logo { display: block; width: auto; height: 72px; margin: 0 auto 12px; }
.login h1 { text-align: center; font-size: var(--t-page); font-weight: 700; line-height: 1.25; }
.login .sub { margin: 6px 0 18px; text-align: center; font-size: var(--t-item); color: var(--ink-2); }
.login .seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; margin-bottom: 16px; border: 1px solid var(--chip-line); border-radius: 10px; }
.login .seg button { height: 44px; padding: 0; border: 0; border-radius: 9px; background: none; color: var(--ink); font-size: var(--t-item); }
.login .seg button.on { background: var(--brand-2); color: var(--brand); font-weight: 600; box-shadow: inset 0 0 0 1px var(--brand); }
.login .fl { display: block; margin: 0 0 6px; font-size: var(--t-meta); color: var(--ink); }
.login .inp { height: 48px; padding: 0 14px; font-size: var(--t-item); border-radius: 10px; }
.login .code { margin-top: 12px; }
.login .code .inp { text-align: center; font-size: var(--t-block); letter-spacing: .4em; font-variant-numeric: tabular-nums; }
.login .hint { margin: 6px 0 0; font-size: var(--t-meta); text-align: center; }
.login .hint:empty { display: none; }
.login .btn.go { display: flex; width: 100%; height: 48px; margin-top: 12px; padding: 0 16px; font-size: var(--t-item); border-radius: 10px; }
.login .foot { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); text-align: center; color: var(--ink-3); font-size: var(--t-meta); }
.login .foot a { display: inline-block; margin-top: 6px; color: var(--brand); font-weight: 600; text-decoration: none; }
.login .foot a:hover { text-decoration: underline; }

.burger { display: none; border: 0; background: none; padding: 2px; color: var(--ink-2); }
@media (max-width: 1100px) {
  .page.fill { overflow-y: auto; display: block; }
  .work, .work.noside { display: flex; flex-direction: column; }
  .work .mapbox { min-height: 440px; order: -1; }
  .cols, .reg-row { grid-template-columns: minmax(0, 1fr); }
  .mon { grid-template-columns: minmax(0, 1fr); }
  .rep-edit { grid-template-columns: minmax(0, 1fr); }
  .rep-wrap { padding: 8px; }
  .ov, .ov-zones, .cols2 { grid-template-columns: minmax(0, 1fr); }
  .obs { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 860px) {
  .side { position: fixed; z-index: 40; top: 0; bottom: 0; left: 0; transform: translateX(-100%); transition: transform .18s; box-shadow: 0 0 30px rgba(0,0,0,.2); }
  .side.open { transform: none; }
  .burger { display: inline-flex; }
  .page { padding: 12px 12px 20px; } .top { padding: 8px 12px; }
  .stats { grid-template-columns: 1fr; } .stats .s { border-right: 0; border-bottom: 1px solid var(--line); } .stats .s:last-child { border-bottom: 0; }
  .form .row { grid-template-columns: 1fr; gap: 4px; }
  .tbl thead { display: none; } .tbl td { display: block; padding: 3px 8px; border: 0; } .tbl tr { display: block; padding: 8px 0; border-bottom: 1px solid var(--line); } .tbl tr:last-child { border-bottom: 0; } .tbl td.r { text-align: left; }
  .login .box { padding: 24px 20px 16px; }
  .steps .ln { max-width: 32px; } .steps .st span { display: none; } .steps .st.on span { display: inline; }
  .maptools .inp { width: 100%; } .maptools .grow { display: none; }
}
