[hidden] { display: none !important; }

@font-face {
  font-family: "Geist";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("fonts/geist-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: "Geist";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("fonts/geist-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Bricolage Grotesque";
  font-style: normal;
  font-weight: 600 800;
  font-display: swap;
  src: url("fonts/bricolage-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: "Bricolage Grotesque";
  font-style: normal;
  font-weight: 600 800;
  font-display: swap;
  src: url("fonts/bricolage-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --bg: #120F0A;
  --bar: #15120D;
  --card: #1B1711;
  --card-2: #221E16;
  --field: #120F0A;
  --line: #2F281E;
  --line-2: #3D3427;
  --text: #F5EFE3;
  --text-2: #DCD3C2;
  --muted: #B1A690;
  --dim: #948A74;
  --accent: #F5A524;
  --accent-ink: #1C1203;
  --accent-soft: #2A2010;
  --accent-line: #4A3A1C;
  --accent-text: #F5B54A;
  --ok: #8FCB6B;
  --ok-text: #B8E39B;
  --ok-soft: #1C2614;
  --bad: #EF7B6B;
  --bad-text: #F2A397;
  --bad-soft: #2B1612;
  --warn: #FBBF24;
  --warn-text: #FCD34D;
  --warn-soft: #2A2110;
  --radius: 22px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --font: "Geist", "Segoe UI", system-ui, -apple-system, sans-serif;
  --display: "Bricolage Grotesque", "Geist", "Segoe UI", system-ui, sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent-text); text-decoration: none; }
a:hover { color: #FFD08A; }
h1, h2, h3 { margin: 0; line-height: 1.15; letter-spacing: -0.015em; font-family: var(--display); }
h1 { font-size: 44px; font-weight: 800; letter-spacing: -0.035em; line-height: 1.02; }
h2 { font-size: 22px; font-weight: 700; }
h3 { font-size: 17px; font-weight: 700; }
code { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 13px; background: var(--card-2); padding: 2px 7px; border-radius: 6px; }

.num, .value, .big, .kpi-value { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.dim { color: var(--dim); }
.small-text { font-size: 13px; }
.empty { color: var(--muted); padding: 28px; text-align: center; }

.container { max-width: 1360px; margin: 0 auto; padding: 28px 32px 64px; display: flex; flex-direction: column; gap: 28px; }

button, .button {
  font: inherit;
  font-weight: 700;
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: var(--accent);
  color: var(--accent-ink);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  white-space: nowrap;
}
button:hover, .button:hover { filter: brightness(1.06); color: var(--accent-ink); }
button:disabled { opacity: .6; cursor: default; }
button svg, .button svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
button.ghost { background: transparent; color: var(--text); border-color: var(--line-2); font-weight: 500; }
button.ghost:hover { background: var(--card-2); filter: none; }
button.soft { background: var(--accent-soft); color: var(--accent); border-color: var(--accent-line); font-weight: 600; }
button.danger { background: transparent; color: var(--bad-text); border-color: var(--line-2); font-weight: 500; }
button.danger:hover { background: var(--bad-soft); filter: none; }
button.small { min-height: 34px; padding: 0 12px; font-size: 13px; border-radius: 10px; }
.icon-btn { min-height: 36px; width: 36px; padding: 0; background: transparent; border: 1px solid transparent; color: var(--muted); font-size: 22px; font-weight: 400; }
.icon-btn:hover { background: var(--card-2); color: var(--text); filter: none; }
.icon-btn svg { width: 17px; height: 17px; stroke-width: 1.8; }

.topbar { position: sticky; top: 0; z-index: 20; background: rgba(21, 18, 13, 0.92); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); padding-top: env(safe-area-inset-top, 0px); }
.topbar-inner { max-width: 1360px; margin: 0 auto; padding: 12px 32px; display: flex; align-items: center; gap: 28px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); font-family: var(--display); font-weight: 800; font-size: 21px; letter-spacing: -0.02em; }
.brand:hover { color: var(--text); }
.brand svg { width: 30px; height: 30px; }
.brand .hex { fill: var(--accent); }
.brand .bee-ink, .login-art .bee-ink { fill: none; stroke: var(--accent-ink); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.main-nav { display: flex; gap: 4px; }
.main-nav a { padding: 8px 14px; border-radius: 10px; color: var(--muted); font-weight: 500; }
.main-nav a:hover { background: var(--card-2); color: var(--text); }
.main-nav a.active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 14px; }
.live { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 999px; background: var(--ok-soft); color: var(--ok-text); font-size: 13px; font-weight: 500; white-space: nowrap; }
.live .pulse { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 4px rgba(52, 211, 153, 0.18); }
.live.stale { background: var(--bad-soft); color: var(--bad-text); }
.live.stale .pulse { background: var(--bad); box-shadow: 0 0 0 4px rgba(248, 113, 113, 0.18); }
.user { display: flex; align-items: center; gap: 10px; }
.avatar { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); font-weight: 700; font-size: 14px; }
.user-name { color: var(--text-2); font-weight: 500; }

.bottom-nav { display: none; }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.eyebrow { color: var(--dim); font-size: 13px; font-weight: 600; letter-spacing: 0.09em; text-transform: uppercase; margin-bottom: 8px; }
.page-head p { margin: 6px 0 0; color: var(--muted); }
.actions-row { display: flex; gap: 10px; flex-wrap: wrap; }
.section { display: flex; flex-direction: column; gap: 14px; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.section-head .hint { color: var(--dim); font-size: 13px; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.card-title { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.card-title .hint { color: var(--muted); font-size: 13px; }

.chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--card-2); color: var(--muted); white-space: nowrap; }
.chip .dot-s { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.chip.ok { background: var(--ok-soft); color: var(--ok-text); }
.chip.bad { background: var(--bad-soft); color: var(--bad-text); }
.chip.warn { background: var(--warn-soft); color: var(--warn-text); }
.chip.accent { background: var(--accent-soft); color: var(--accent); }
.tag { padding: 4px 10px; border-radius: 8px; background: var(--card-2); color: var(--text-2); font-size: 13px; }

.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 1000px) { .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.kpi { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 18px 20px; display: flex; flex-direction: column; gap: 6px; min-height: 116px; }
.kpi-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.kpi-label { color: var(--dim); font-size: 13px; font-weight: 500; }
.kpi-value { font-family: var(--display); font-size: 36px; font-weight: 700; letter-spacing: -0.03em; line-height: 1.05; }
.kpi-value small, .big small, .value small { font-size: 15px; font-weight: 500; color: var(--muted); margin-left: 4px; letter-spacing: 0; }
.kpi-note { color: var(--muted); font-size: 13px; }
.kpi-note.ok { color: var(--ok-text); font-weight: 600; }
.kpi-note.bad { color: var(--bad-text); font-weight: 600; }

.tile { position: relative; overflow: hidden; background: var(--card-2); border-radius: var(--radius-md); padding: 14px 16px; min-height: 96px; }
.tile > :not(.spark) { position: relative; }
.tile .label { color: var(--dim); font-size: 13px; font-weight: 500; }
.tile .value { font-family: var(--display); font-size: 28px; font-weight: 700; letter-spacing: -0.02em; margin-top: 2px; line-height: 1.15; }
.tile .value small { font-size: 14px; margin-left: 3px; }
.tile .sub { color: var(--muted); font-size: 12px; }
.tile.compact { padding: 10px 12px; min-height: 0; border-radius: 12px; }
.tile.compact .label { font-size: 12px; }
.tile.compact .value { font-size: 20px; margin-top: 0; }
.tile.compact .value small { font-size: 12px; margin-left: 2px; }
.spark { position: absolute; left: 0; right: 0; bottom: 0; width: 100%; height: 56%; pointer-events: none; }
.tile.compact .spark { height: 42%; opacity: .85; }

.apiary-block { display: flex; flex-direction: column; gap: 18px; padding: 22px; border-radius: 30px; background: #17140F; border: 1px solid var(--line); }
.apiary-head { display: flex; align-items: center; gap: 14px; }
.apiary-icon { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); flex: none; }
.apiary-title { min-width: 0; }
.apiary-title h2 .place { color: var(--muted); font-weight: 500; font-size: .8em; letter-spacing: 0; }
.apiary-title h2 .place::before { content: "·"; margin: 0 10px; color: var(--dim); }
.apiary-title .apiary-meta { margin-top: 2px; }
.apiary-block .section-head { margin-top: 4px; }
.apiary-block .section-head h3 { font-size: 16px; }
.apiary-meta { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 14px; }
.apiary-meta svg { width: 16px; height: 16px; }
.apiary { display: flex; flex-wrap: wrap; gap: 16px; padding: 18px; }
.apiary-info { flex: 999 1 560px; min-width: 0; display: flex; flex-direction: column; gap: 14px; }
.weather { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.weather-source { margin-top: -6px; font-size: 12px; color: var(--dim); }
.weather-source.warn { color: var(--warn-text); }
.device-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 12px 14px; border-radius: var(--radius-md); background: var(--card-2); font-size: 13px; color: var(--muted); }
.device-row strong { display: inline-flex; align-items: center; gap: 8px; color: var(--text); font-size: 15px; }
.device-row strong svg { width: 18px; height: 18px; }
.device-row .fw { margin-left: auto; font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 12px; color: var(--dim); }
.apiary-map { flex: 1 1 320px; position: relative; min-height: 220px; border-radius: var(--radius-md); overflow: hidden; border: 1px solid var(--line); background: #1E1A13; }
.apiary-map iframe, .map-preview iframe { position: absolute; inset: 0 0 auto 0; width: 100%; height: calc(100% + 48px); border: 0; filter: saturate(0.85); }
.map-label { position: absolute; left: 12px; top: 12px; padding: 6px 10px; border-radius: 10px; background: rgba(18, 15, 10, 0.86); color: var(--text); font-size: 13px; font-weight: 600; }
.open-map { position: absolute; right: 12px; bottom: 12px; padding: 7px 12px; border-radius: 10px; background: rgba(18, 15, 10, 0.88); color: var(--text); font-size: 13px; font-weight: 500; }
.open-map:hover { color: var(--accent); }
.map-attrib { position: absolute; left: 12px; bottom: 12px; padding: 2px 8px; border-radius: 6px; background: rgba(18, 15, 10, 0.8); color: var(--muted); font-size: 11px; }
.map-attrib:hover { color: var(--text); }
.empty-map { display: grid; place-items: center; text-align: center; padding: 16px; }
.empty-map p { margin: 0 0 10px; }

.hive-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 16px; }
.hive-card { display: flex; flex-direction: column; gap: 14px; padding: 18px; color: var(--text); transition: border-color .15s ease, transform .15s ease; }
.hive-card:hover { color: var(--text); border-color: var(--accent-line); transform: translateY(-2px); }
.hive-head { display: flex; align-items: center; gap: 10px; }
.hive-head .title { min-width: 0; }
.hive-head .name { font-family: var(--display); font-size: 20px; font-weight: 700; letter-spacing: -0.015em; }
.hive-head .meta { color: var(--dim); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hive-head .badges { margin-left: auto; display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.weight-row { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.big { font-family: var(--display); font-size: 40px; font-weight: 800; letter-spacing: -0.035em; line-height: 1; }
.big small { font-size: 16px; }
.delta { font-size: 13px; font-weight: 600; color: var(--muted); font-variant-numeric: tabular-nums; }
.delta.up { color: var(--ok-text); }
.delta.down { color: var(--bad-text); }
.area-chart { display: block; width: 100%; height: 64px; margin-top: 8px; }
.mini { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.hive-foot { display: flex; justify-content: space-between; gap: 8px; color: var(--dim); font-size: 12px; border-top: 1px solid var(--line); padding-top: 12px; }

.split { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-start; }
.split > .main { flex: 999 1 560px; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.split > .side { flex: 1 1 320px; min-width: 0; display: flex; flex-direction: column; gap: 16px; }

.record { display: flex; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.record:first-child { border-top: 0; padding-top: 2px; }
.badge-type { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; flex: none; font-size: 12px; font-weight: 700; }
.t-inspections { background: #10263A; color: #7DD3FC; }
.t-varroa-checks { background: #3A1515; color: #FCA5A5; }
.t-treatments { background: #251B3D; color: #C4B5FD; }
.t-feedings { background: #10291D; color: #86EFAC; }
.t-harvests { background: #2E230D; color: #FCD34D; }
.t-queens { background: #3A1430; color: #F9A8D4; }
.record-body { min-width: 0; flex: 1; }
.record-top { display: flex; justify-content: space-between; gap: 8px; }
.record-top strong { font-size: 14px; }
.record-date { color: var(--dim); font-size: 13px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.record-summary { color: var(--text-2); font-size: 13px; }
.record-detail { color: var(--muted); font-size: 13px; white-space: pre-line; }
.record-actions { display: flex; gap: 2px; margin-top: 4px; }
.empty-state { display: flex; align-items: center; gap: 16px; padding: 18px; border: 1px dashed var(--line-2); border-radius: var(--radius-md); flex-wrap: wrap; }
.empty-state .ico { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); flex: none; }
.empty-state .ico svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.empty-state .txt { flex: 1 1 220px; }
.empty-state .txt div:first-child { font-weight: 600; }
.empty-state .txt div:last-child { color: var(--muted); font-size: 14px; }
.status-list { display: flex; flex-direction: column; gap: 12px; }
.status-item { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.status-item .dot-s { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); flex: none; }
.status-item .dot-s.bad { background: var(--bad); }
.status-item .dot-s.idle { background: var(--line-2); }
.status-item .note { margin-left: auto; color: var(--dim); font-size: 13px; text-align: right; }

.breadcrumb { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--dim); flex-wrap: wrap; }
.breadcrumb a { color: var(--muted); }
.breadcrumb a:hover { color: var(--text); }
.breadcrumb .current { color: var(--text); }
.title-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.tags { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.seg { display: inline-flex; padding: 4px; gap: 4px; border-radius: 14px; background: var(--card); border: 1px solid var(--line); }
.seg button { min-height: 40px; padding: 0 16px; border-radius: 10px; border: 0; background: transparent; color: var(--muted); font-weight: 600; }
.seg button:hover { color: var(--text); filter: none; }
.seg button[aria-pressed="true"] { background: var(--accent-soft); color: var(--accent); }
.chart-box { position: relative; height: 240px; }
.chart-box.tall { height: 280px; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 13px; color: var(--text-2); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 14px; height: 3px; border-radius: 2px; display: inline-block; }
.legend i.dashed { background: repeating-linear-gradient(90deg, currentColor 0 5px, transparent 5px 8px) !important; }
.charts-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; }
.season { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.queen-card { display: flex; align-items: center; gap: 14px; }
.filters { display: flex; flex-wrap: wrap; gap: 6px; }
.filters .f { min-height: 32px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line-2); background: transparent; color: var(--muted); font-size: 13px; font-weight: 500; }
.filters .f:hover { color: var(--text); filter: none; }
.filters .f[aria-pressed="true"] { background: var(--accent-soft); border-color: var(--accent-line); color: var(--accent); }
.type-picker { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.type-picker button { justify-content: flex-start; background: var(--card-2); color: var(--text); border-color: var(--line); font-weight: 600; min-height: 52px; }
.type-picker button:hover { border-color: var(--accent-line); filter: none; }
.type-picker .badge-type { width: 30px; height: 30px; font-size: 11px; }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 12px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
th { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--dim); font-weight: 600; }
td.actions { text-align: right; white-space: nowrap; }
td.actions button { margin-left: 6px; }
td a strong { color: var(--text); }
td a:hover strong { color: var(--accent); }

form .fields { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
form .field { display: flex; flex-direction: column; gap: 6px; }
form .field.wide { grid-column: 1 / -1; }
form .field.check { flex-direction: row; align-items: center; gap: 10px; padding-top: 24px; }
form label { font-size: 13px; font-weight: 600; color: var(--muted); }
input, select, textarea {
  font: inherit;
  color: var(--text);
  background: var(--field);
  border: 1px solid var(--line-2);
  border-radius: 10px;
  padding: 10px 12px;
  width: 100%;
  min-height: 44px;
}
input[type="checkbox"] { width: 20px; height: 20px; min-height: 0; accent-color: var(--accent); }
textarea { min-height: 88px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: transparent; }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; flex-wrap: wrap; }
.errors { background: var(--bad-soft); color: var(--bad-text); border: 1px solid #4A1D1D; border-radius: 10px; padding: 10px 14px; margin-bottom: 14px; font-size: 14px; }
.errors ul { margin: 4px 0 0; padding-left: 18px; }

.login { width: min(420px, 100%); margin: 8vh auto 32px; display: flex; flex-direction: column; gap: 16px; padding: 28px; }
.login .brand { justify-content: center; font-size: 24px; }
.login .brand svg { width: 38px; height: 38px; }
.login form { display: grid; gap: 14px; }
.login .field { display: flex; flex-direction: column; gap: 6px; }

.modal { position: fixed; inset: 0; background: rgba(8, 6, 3, 0.72); backdrop-filter: blur(4px); display: grid; place-items: center; padding: 16px; z-index: 50; }
.modal-card { background: var(--card); border: 1px solid var(--line-2); border-radius: var(--radius); width: min(780px, 100%); max-height: 92vh; overflow: auto; padding: 22px; box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5); }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.modal-head h2 { font-size: 20px; }
.token-box { display: flex; gap: 8px; align-items: center; margin: 14px 0; }
.token-box code { flex: 1; padding: 12px; word-break: break-all; font-size: 14px; }
.geo { margin-top: 16px; display: grid; gap: 10px; }
.geo-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.map-preview { position: relative; height: 220px; overflow: hidden; border: 1px solid var(--line-2); border-radius: 12px; }
.map-preview:empty { display: none; }

.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: var(--text); color: var(--bg); padding: 11px 18px; border-radius: 12px; z-index: 60; font-weight: 600; box-shadow: 0 12px 30px rgba(0, 0, 0, 0.4); }
.toast.error { background: var(--bad); color: #fff; }

@media (max-width: 760px) {
  .container { padding: 18px 16px calc(96px + env(safe-area-inset-bottom, 0px)); gap: 20px; }
  .topbar-inner { padding: 10px 16px; gap: 12px; }
  .main-nav, .user-name, #logoutBtn { display: none; }
  .avatar { width: 32px; height: 32px; font-size: 13px; }
  h1 { font-size: 32px; }
  h2 { font-size: 19px; }
  .hide-mobile { display: none !important; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .kpi { padding: 14px; min-height: 0; border-radius: 16px; }
  .kpi-value { font-size: 24px; }
  .kpi-note { font-size: 12px; }
  .weather { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .weather .tile { padding: 10px 12px; min-height: 0; }
  .weather .tile .value { font-size: 18px; white-space: nowrap; }
  .weather .tile .value small { font-size: 11px; margin-left: 2px; }
  .weather .tile .label { font-size: 12px; line-height: 1.25; }
  .weather .tile .sub { display: none; }
  .apiary { padding: 12px; }
  .apiary-block { padding: 12px; border-radius: 20px; gap: 12px; }
  .apiary-icon { width: 38px; height: 38px; border-radius: 12px; }
  .apiary-map { min-height: 180px; }
  .device-row .fw { margin-left: 0; }
  .hive-grid { grid-template-columns: 1fr; gap: 12px; }
  .hive-card { padding: 14px; gap: 10px; }
  .big { font-size: 30px; }
  .area-chart { height: 44px; }
  .chart-box, .chart-box.tall { height: 210px; }
  .card { padding: 16px; }
  .modal { place-items: end center; padding: 0; }
  .modal-card { border-radius: 20px 20px 0 0; max-height: 90vh; padding: 18px 16px calc(18px + env(safe-area-inset-bottom, 0px)); }
  .bottom-nav {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: center;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 30;
    padding: 6px 12px calc(8px + env(safe-area-inset-bottom, 0px));
    background: rgba(21, 18, 13, 0.97);
    backdrop-filter: blur(10px);
    border-top: 1px solid var(--line);
  }
  .bottom-nav a { display: flex; flex-direction: column; align-items: center; gap: 3px; min-height: 52px; justify-content: center; color: var(--muted); font-size: 11px; font-weight: 500; }
  .bottom-nav a.active { color: var(--accent); font-weight: 600; }
  .bottom-nav svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
  .bottom-nav .fab { justify-self: center; width: 56px; height: 56px; min-height: 56px; padding: 0; border-radius: 18px; }
  .bottom-nav .fab svg { width: 26px; height: 26px; stroke-width: 2.4; }
  .toast { bottom: calc(96px + env(safe-area-inset-bottom, 0px)); }
}

.map-picker { position: relative; height: 320px; border-radius: 12px; overflow: hidden; border: 1px solid var(--line-2); background: #1E1A13; z-index: 0; }
.map-picker.leaflet-container { font: inherit; background: #1E1A13; }
.map-picker.leaflet-grab { cursor: crosshair; }
.map-picker.leaflet-dragging .leaflet-grab { cursor: grabbing; }
.map-picker .leaflet-tile-pane { filter: saturate(0.85); }
.map-picker.leaflet-container .leaflet-bar { border: 1px solid var(--line-2); border-radius: 10px; overflow: hidden; box-shadow: none; }
.map-picker.leaflet-container .leaflet-bar a { background: var(--card); color: var(--text); border-bottom-color: var(--line-2); width: 34px; height: 34px; line-height: 34px; }
.map-picker.leaflet-container .leaflet-bar a:hover { background: var(--card-2); color: var(--accent); }
.map-picker.leaflet-container .leaflet-control-attribution { background: rgba(18, 15, 10, 0.82); color: var(--muted); font-size: 11px; border-radius: 6px 0 0 0; }
.map-picker.leaflet-container .leaflet-control-attribution a { color: var(--text-2); }
.leaflet-marker-icon.map-pin { background: none; border: 0; }
.leaflet-marker-icon.map-pin svg { width: 34px; height: 42px; display: block; filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.5)); }
.empty-map > div { display: flex; flex-direction: column; align-items: center; }
@media (max-width: 760px) {
  .map-picker { height: 260px; }
}
.login-sub { margin: -8px 0 0; text-align: center; }
.login-tabs { width: 100%; }
.login-tabs button { flex: 1; }
.login .field .hint { color: var(--dim); font-size: 12px; }
.login .field .hint:empty { display: none; }
.login .field .hint.ok { color: var(--ok-text); }
.login .field .hint.bad { color: var(--bad); }
.login .field-pair { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
.login textarea { min-height: 64px; }
.login .form-note { margin: 0; }
.turnstile:empty { display: none; }
.login-alt { display: flex; flex-direction: column; align-items: stretch; gap: 10px; }
.login-alt > span { display: flex; align-items: center; gap: 12px; color: var(--dim); font-size: 12px; text-transform: uppercase; letter-spacing: 0.08em; }
.login-alt > span::before, .login-alt > span::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.demo-btn { justify-content: center; gap: 8px; }
.login-privacy { align-self: center; color: var(--dim); }
.login-done { display: flex; flex-direction: column; align-items: center; gap: 14px; text-align: center; padding: 8px 0; }
.login-done p { margin: 0; }
.login-done .ico { width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.notice { background: var(--ok-soft); color: var(--ok-text); border-radius: 10px; padding: 10px 14px; font-size: 14px; }
.demo-bar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; justify-content: center; gap: 14px; flex-wrap: wrap; padding: 8px 16px; background: var(--accent-soft); border-bottom: 1px solid var(--accent-line); color: var(--accent-text); font-size: 14px; }
.nav-badge { display: inline-grid; place-items: center; min-width: 20px; height: 20px; margin-left: 6px; padding: 0 6px; border-radius: 999px; background: var(--accent); color: var(--accent-ink); font-size: 12px; font-weight: 700; vertical-align: middle; }
.bottom-nav a { position: relative; }
.bottom-nav .nav-badge { position: absolute; top: 2px; right: calc(50% - 22px); margin: 0; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.row-pending td { background: var(--warn-soft); }
.note-cell { max-width: 280px; color: var(--text-2); font-size: 14px; white-space: normal; }
.danger-zone { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--line); }
.danger-zone p { margin: 4px 0 0; }
.privacy { max-width: 760px; margin: 24px auto; display: flex; flex-direction: column; gap: 6px; line-height: 1.6; }
.privacy h1 { margin: 0 0 4px; }
.privacy h2 { margin: 18px 0 6px; font-size: 18px; }
.privacy p, .privacy ul { margin: 0; }
.privacy ul { padding-left: 20px; display: grid; gap: 6px; }

.hex, .apiary-icon.hex { border-radius: 0; clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%); }
.apiary-icon.hex { width: 40px; height: 46px; }
.apiary-title h2 { font-size: 26px; }
.page-head h1 { margin-bottom: 4px; }
.page-head p { font-size: 16px; }

.badge-type { width: 34px; height: 39px; border-radius: 0; clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%); font-size: 11px; }
.type-picker .badge-type { width: 28px; height: 32px; font-size: 10px; }
.t-inspections { background: #2A2010; color: #F5B54A; }
.t-varroa-checks { background: #2B1612; color: #F2A397; }
.t-treatments { background: #1A2230; color: #9CC3EC; }
.t-feedings { background: #1C2614; color: #B8E39B; }
.t-harvests { background: #2E2410; color: #F5C46B; }
.t-queens { background: #261B2E; color: #D8B9F0; }

.queen-mark { display: inline-flex; align-items: center; gap: 4px; flex: none; color: var(--text-2); }
.queen-mark .bee { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.queen-mark.none { color: var(--dim); opacity: 0.6; }
.queen-year { font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: 0.02em; }
.queen-mark.big .bee { width: 34px; height: 34px; stroke-width: 1.6; }
.queen-mark.big .queen-year { font-size: 15px; }
.hive-head .queen-mark { margin-left: auto; }

.plast-wrap { display: inline-flex; flex: none; }
.plast { width: 34px; height: 39px; display: block; }
.plast-bg { fill: var(--bg); }
.plast-fill { fill: var(--accent); }
.plast-edge { fill: none; stroke: #5A4A30; stroke-width: 1.5; }
.hive-card > .badges { display: flex; gap: 6px; flex-wrap: wrap; margin-top: -4px; }

.bento { display: flex; gap: 16px; flex-wrap: wrap; }
.bento-main { flex: 2 1 480px; min-width: 0; position: relative; overflow: hidden; display: flex; flex-direction: column; gap: 10px; padding: 24px; border-radius: 26px; background: var(--card); border: 1px solid var(--line); }
.bento-main::after { content: ""; position: absolute; right: -40px; top: -30px; width: 300px; height: 300px; pointer-events: none; opacity: 0.6; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='31.18' height='54'%3E%3Cpath d='M15.59 0L31.18 9L31.18 27L15.59 36L0 27L0 9Z M0 27L15.59 36L15.59 54L0 63L-15.59 54L-15.59 36Z M31.18 27L46.77 36L46.77 54L31.18 63L15.59 54L15.59 36Z' fill='none' stroke='%23F5A524' stroke-opacity='0.12'/%3E%3C/svg%3E"); -webkit-mask-image: radial-gradient(circle at 70% 30%, #000 30%, transparent 70%); mask-image: radial-gradient(circle at 70% 30%, #000 30%, transparent 70%); }
.bento-main > * { position: relative; z-index: 1; }
.bento-value { font-family: var(--display); font-size: 72px; font-weight: 800; line-height: 1; letter-spacing: -0.04em; font-variant-numeric: tabular-nums; }
.bento-value small { font-size: 26px; font-weight: 600; color: var(--muted); margin-left: 8px; letter-spacing: 0; }
.bento-chart { display: block; width: 100%; height: 130px; }
.bento-axis { display: flex; justify-content: space-between; color: var(--dim); font-size: 12px; }
.bento-side { flex: 1 1 480px; min-width: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.bento-side .kpi { border-radius: 22px; padding: 20px; }

.spot { position: relative; isolation: isolate; }
.spot::before { content: ""; position: absolute; inset: 0; z-index: -1; border-radius: inherit; pointer-events: none; opacity: 0; transition: opacity 0.3s ease; background: radial-gradient(380px circle at var(--mx, 50%) var(--my, 50%), rgba(245, 165, 36, 0.1), transparent 45%); }
.spot:hover::before { opacity: 1; }

body.is-login .container { max-width: none; padding: 0; gap: 0; }
.login-wrap { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.12fr) minmax(0, 1fr); }
.login-visual { position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: space-between; gap: 32px; padding: 52px 64px; border-right: 1px solid var(--line); }
.login-visual > :not(canvas) { position: relative; }
.honeycomb { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.login-visual .brand { font-size: 26px; }
.login-visual .brand svg { width: 44px; height: 44px; }
.login-copy { display: flex; flex-direction: column; gap: 24px; }
.login-copy h1 { font-size: 54px; max-width: 560px; }
.login-copy p { margin: 0; max-width: 470px; font-size: 18px; line-height: 1.55; color: var(--muted); }
.login-art { display: block; width: min(460px, 100%); height: auto; margin-left: -24px; overflow: visible; }
.login-art .faint, .login-art .empty { fill: none; stroke: var(--line-2); stroke-width: 2; }
.login-art .faint { opacity: 0.5; }
.login-art .honey { fill: var(--accent); }
.login-art .edge { fill: none; stroke: #5A4A30; stroke-width: 2; }
.login-art .bee-ink { stroke-width: 1.7; }
.flight-path { fill: none; stroke: var(--muted); stroke-width: 1.5; stroke-dasharray: 3 7; stroke-linecap: round; opacity: 0.7; }
.flying-bee { fill: none; stroke: var(--accent); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.login-chips { display: flex; gap: 10px; flex-wrap: wrap; }
.login-chips span { padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); font-size: 13px; color: var(--text-2); }
.login-side { display: grid; place-items: center; padding: 48px 24px; background: var(--bar); }
.login-side .login { width: min(400px, 100%); margin: 0; padding: 0; background: none; border: 0; gap: 18px; }
.login-brand { display: none; }
.login-head h2 { font-size: 32px; }
.login-head p { margin: 6px 0 0; }

@media (max-width: 900px) {
  .login-wrap { grid-template-columns: 1fr; }
  .login-visual { display: none; }
  .login-side { min-height: 100vh; align-items: start; padding: 32px 16px 48px; background: var(--bg); }
  .login-brand { display: flex; justify-content: center; font-size: 24px; }
  .login-brand svg { width: 40px; height: 40px; }
  .login-head { text-align: center; }
}

@media (max-width: 760px) {
  .bento-value { font-size: 52px; }
  .bento-value small { font-size: 20px; }
  .bento-main { padding: 18px; border-radius: 22px; }
  .bento-side { gap: 10px; }
  .bento-side .kpi { padding: 14px; border-radius: 18px; }
  .bento-chart { height: 96px; }
  .bottom-nav .fab { width: 60px; height: 66px; min-height: 66px; margin-top: -26px; border-radius: 0; clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%); }
}

@media (prefers-reduced-motion: reduce) {
  .spot::before { display: none; }
  .hive-card { transition: none; }
}

.account-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.temp-password { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 6px 0 4px; }
.temp-password code { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 22px; font-weight: 600; letter-spacing: 0.06em; padding: 10px 16px; border-radius: 12px; background: var(--card-2); border: 1px solid var(--line-2); color: var(--text); user-select: all; }
.login .link-button { align-self: center; background: none; border: 0; padding: 4px 8px; min-height: 0; color: var(--muted); font-size: 13px; font-weight: 500; cursor: pointer; border-radius: 8px; }
.login .link-button:hover { color: var(--text); text-decoration: underline; }
.account-subtitle { margin: 22px 0 6px; font-size: 16px; }

.login .step-label { margin: 0; color: var(--accent); font-size: 12px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; }
.verified-email { display: flex; align-items: center; gap: 10px; padding: 10px 6px 10px 12px; border-radius: 12px; background: var(--ok-soft); color: var(--ok-text); font-size: 14px; }
.verified-email svg { flex: none; }
.verified-email span { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.verified-email strong { font-weight: 600; }
.login .verified-email .link-button { color: var(--ok-text); }
.login .code-input { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 24px; font-weight: 600; letter-spacing: 0.4em; text-indent: 0.4em; text-align: center; }
.login .field.check { padding-top: 0; align-items: flex-start; gap: 10px; }
.login .field.check input { flex: none; margin: 1px 0 0; }
.login .field.check label { display: flex; flex-direction: column; gap: 3px; cursor: pointer; }
