/* ── OLIVES — app styles on top of mangonese.css tokens ── */
:root { --olive: #8aa26a; --olive-deep: #2f4a2a; --nav-h: 60px; }
html, body { background: var(--bg-primary); color: var(--text-primary); font-family: var(--font-sans); margin: 0; }
body {
  -webkit-tap-highlight-color: transparent; -webkit-touch-callout: none;
  -webkit-user-select: none; user-select: none; overscroll-behavior-y: contain;
}
input, textarea, [contenteditable="true"] { -webkit-touch-callout: default; -webkit-user-select: text; user-select: text; }
* { box-sizing: border-box; }
.boot { display: flex; justify-content: center; padding: 40vh 0; }

/* shell */
.app { min-height: 100dvh; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 5; background: color-mix(in srgb, var(--bg-primary) 88%, transparent); backdrop-filter: blur(12px);
  padding: calc(env(safe-area-inset-top) + 10px) 16px 10px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--border-subtle); }
.topbar h1 { font-size: 20px; margin: 0; letter-spacing: -0.01em; display: flex; align-items: center; gap: 8px; }
.topbar .sub { font-size: 12px; color: var(--text-muted); }
.view { flex: 1; padding: 14px 16px calc(var(--nav-h) + env(safe-area-inset-bottom) + 24px); max-width: 720px; width: 100%; margin: 0 auto; }
.bottom-nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 6; display: flex; background: var(--bg-surface); border-top: 1px solid var(--border-subtle); padding: 0; }
.nav-item { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: calc(var(--nav-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom); background: none; border: 0; color: var(--text-muted); font: inherit; font-size: 11px; cursor: pointer; }
.nav-item svg { width: 24px; height: 24px; }
.nav-item[aria-current="page"] { color: var(--mango); }

/* verdict cards */
.tree-card { background: var(--bg-surface); border: 1px solid var(--border-subtle); border-radius: var(--radius-lg); padding: 16px; margin-bottom: 14px; }
.tree-card.k-STAY { border-left: 4px solid var(--success); }
.tree-card.k-COVER, .tree-card.k-MOVE_IN_SOON, .tree-card.k-WATER, .tree-card.k-LIGHT, .tree-card.k-UNCOVER, .tree-card.k-TO_OPEN { border-left: 4px solid var(--warning); }
.tree-card.k-MOVE_IN, .tree-card.k-GARAGE_COLD, .tree-card.k-GARAGE_NIGHT, .tree-card.k-KILL_RISK { border-left: 4px solid var(--error); }
.tree-card.k-MOVE_OUT, .tree-card.k-BACK_TO_GARAGE { border-left: 4px solid var(--teal); }
.tree-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.tree-name { font-size: 18px; font-weight: 700; }
.tree-where { font-size: 12px; color: var(--text-muted); }
.verdict { font-size: 17px; font-weight: 600; margin: 10px 0 6px; line-height: 1.3; }
.verdict-detail { font-size: 13px; color: var(--text-secondary); line-height: 1.45; }
.deadline { font-size: 13px; color: var(--warning); margin-top: 6px; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 12px; }
.stat { background: var(--bg-elevated); border-radius: var(--radius-md); padding: 8px 10px; }
.stat .v { font-size: 18px; font-weight: 700; font-variant-numeric: tabular-nums; }
.stat .l { font-size: 11px; color: var(--text-muted); }
.ring-row { display: flex; align-items: center; gap: 12px; margin-top: 12px; }
.ring { width: 64px; height: 64px; flex: 0 0 auto; }
.ring text { fill: var(--text-primary); font-size: 13px; font-weight: 700; }
.ring .track { stroke: var(--bg-elevated); }
.ring .bar { stroke: var(--olive); stroke-linecap: round; transition: stroke-dasharray .4s; }
.ring-text { font-size: 13px; color: var(--text-secondary); line-height: 1.4; }
.actions { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.actions .btn { min-height: 44px; flex: 1; }
.pbar { height: 6px; background: var(--bg-elevated); border-radius: 999px; overflow: hidden; margin-top: 6px; }
.pbar > i { display: block; height: 100%; background: var(--warning); }

/* forecast */
.day-table { width: 100%; border-collapse: collapse; font-size: 13px; font-variant-numeric: tabular-nums; }
.day-table th, .day-table td { padding: 8px 6px; text-align: right; border-bottom: 1px solid var(--border-subtle); white-space: nowrap; }
.day-table th:first-child, .day-table td:first-child { text-align: left; }
.day-table .cold { color: var(--error); font-weight: 700; }
.day-table .cool { color: var(--warning); }
.scroll-x { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.spark { width: 100%; height: 120px; display: block; }
.spark .line { fill: none; stroke: var(--mango); stroke-width: 2; }
.spark .thr { stroke: var(--error); stroke-dasharray: 4 4; }
.spark .axis { fill: var(--text-muted); font-size: 10px; }
.nws-alert { background: color-mix(in srgb, var(--error) 18%, var(--bg-surface)); border-left: 4px solid var(--error); padding: 10px 12px; border-radius: var(--radius-md); margin-bottom: 12px; font-size: 13px; }

/* chill */
.chart { width: 100%; height: 220px; display: block; }
.chart .dma { fill: none; stroke: var(--olive); stroke-width: 2.5; }
.chart .gauss { fill: none; stroke: var(--teal); stroke-width: 1.5; stroke-dasharray: 3 3; }
.chart .target { stroke: var(--mango); stroke-dasharray: 5 4; }
.chart .neg { stroke: var(--error); stroke-width: 2; }
.chart .axis { fill: var(--text-muted); font-size: 10px; }
.legend { display: flex; gap: 14px; font-size: 12px; color: var(--text-secondary); flex-wrap: wrap; margin: 6px 0 10px; }
.legend i { display: inline-block; width: 14px; height: 3px; vertical-align: middle; margin-right: 4px; border-radius: 2px; }

/* log */
.log-item { padding: 10px 0; border-bottom: 1px solid var(--border-subtle); font-size: 13px; }
.log-item .t { color: var(--text-muted); font-size: 11px; }
.log-item .k { font-weight: 600; }
.tabs { display: flex; gap: 6px; margin-bottom: 12px; overflow-x: auto; }
.tabs .chip { cursor: pointer; white-space: nowrap; min-height: 36px; }
.tabs .chip.on { background: var(--mango); color: #1a1205; }

/* settings */
.row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border-subtle); min-height: 52px; }
.row .l { font-size: 14px; } .row .h { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.row input.input { width: 96px; text-align: right; min-height: 40px; }
h2 { font-size: 15px; text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted); margin: 22px 0 6px; }
.status-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; background: var(--text-muted); }
.status-dot.ok { background: var(--success); } .status-dot.bad { background: var(--error); }

/* sheet (drag-to-dismiss) */
.sheet-backdrop { position: fixed; inset: 0; z-index: 20; background: rgba(0,0,0,.5); display: flex; align-items: flex-end; }
.sheet { width: 100%; max-width: 720px; margin: 0 auto; background: var(--bg-surface); border-radius: var(--radius-xl) var(--radius-xl) 0 0; padding: 0 16px calc(16px + env(safe-area-inset-bottom));
  transform: translateY(100%); transition: transform 220ms ease-out; touch-action: pan-y; }
.sheet.open { transform: translateY(0); }
.sheet .handle { width: 48px; height: 6px; border-radius: 3px; background: var(--border-strong); margin: 10px auto 14px; touch-action: none; }
.sheet h3 { margin: 0 0 12px; font-size: 17px; }
.tier-list { display: flex; flex-direction: column; gap: 8px; }
.tier-btn { min-height: 52px; text-align: left; padding: 0 14px; border-radius: var(--radius-md); border: 1px solid var(--border-subtle); background: var(--bg-elevated); color: var(--text-primary); font: inherit; font-size: 15px; display: flex; justify-content: space-between; align-items: center; cursor: pointer; }
.tier-btn.want { border-color: var(--mango); }
.tier-btn .low { font-size: 12px; color: var(--text-muted); }
.check-row { display: flex; gap: 10px; align-items: center; margin: 10px 0 14px; font-size: 14px; }

/* pin */
.pin { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 80dvh; gap: 16px; }
.pin input { font-size: 28px; letter-spacing: .4em; text-align: center; width: 220px; min-height: 56px; }
.toasts { position: fixed; left: 12px; right: 12px; bottom: calc(var(--nav-h) + env(safe-area-inset-bottom) + 12px); z-index: 30; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.toasts .toast { pointer-events: auto; }
.empty { color: var(--text-muted); font-size: 14px; padding: 24px 0; text-align: center; }
.muted { color: var(--text-muted); } .small { font-size: 12px; }
.update-banner { background: var(--bg-elevated); border: 1px solid var(--mango); border-radius: var(--radius-md); padding: 10px 12px; margin-bottom: 12px; display: flex; justify-content: space-between; align-items: center; gap: 10px; font-size: 13px; }
