:root {
  --green: #1f4d2e; --green-dark: #16381f; --green-light: #e4efe6; --accent: #e9b949; --accent-dark: #a67c12;
  --bg: #f4f3ef; --card: #ffffff; --text: #1d261f; --muted: #66706a; --line: #dfe3df;
  --red: #b3261e; --red-light: #fbe9e7; --orange: #a65b00; --orange-light: #fff3e0; --blue: #1a4f8a; --blue-light: #e8f0fa;
  --radius: 14px;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font-family: -apple-system, system-ui, "Segoe UI", Roboto, sans-serif; font-size: 17px; line-height: 1.4; -webkit-tap-highlight-color: transparent; }
#app { max-width: 680px; margin: 0 auto; padding: 16px 16px 110px; }
h1 { font-size: 24px; margin: 8px 0 14px; }
h2 { font-size: 19px; margin: 22px 0 10px; }
h3 { font-size: 17px; margin: 0 0 6px; }
p { margin: 6px 0; }
.muted { color: var(--muted); font-size: 15px; }
.small { font-size: 14px; }
.hidden { display: none !important; }
.card { background: var(--card); border-radius: var(--radius); padding: 16px; margin-bottom: 12px; box-shadow: 0 1px 2px rgba(0,0,0,.06); }
.card.accent { border-left: 5px solid var(--accent); }
.tap { cursor: pointer; }
.tap:active { opacity: .7; }
.row { display: flex; align-items: center; gap: 10px; }
.row.between { justify-content: space-between; }
.row.wrap { flex-wrap: wrap; }
.grow { flex: 1; }
button, .btn { font: inherit; border: 0; border-radius: 12px; padding: 14px 18px; background: var(--green); color: #fff; font-weight: 600; cursor: pointer; width: 100%; font-size: 17px; text-align: center; }
button:active { background: var(--green-dark); }
button.secondary, .btn.secondary { background: var(--green-light); color: var(--green-dark); }
button.gold { background: var(--accent); color: var(--green-dark); }
button.danger { background: var(--red-light); color: var(--red); }
button.small { width: auto; padding: 8px 14px; font-size: 15px; }
button.link { background: none; color: var(--green); padding: 6px 0; width: auto; font-weight: 600; }
button:disabled { opacity: .5; }
input, select, textarea { font: inherit; width: 100%; padding: 13px 14px; border: 1px solid var(--line); border-radius: 12px; background: #fff; font-size: 17px; margin: 4px 0 12px; }
input[type=checkbox] { width: 26px; height: 26px; margin: 0; }
textarea { min-height: 90px; }
label { font-weight: 600; font-size: 15px; display: block; margin-top: 6px; }
.error { background: var(--red-light); color: var(--red); padding: 10px 14px; border-radius: 10px; margin: 8px 0; }
.alert { padding: 12px 14px; border-radius: 12px; margin-bottom: 8px; display: flex; gap: 10px; align-items: flex-start; }
.alert.alert { background: var(--red-light); color: var(--red); }
.alert.warn { background: var(--orange-light); color: var(--orange); }
.alert.info { background: var(--blue-light); color: var(--blue); }
.alert b { font-weight: 700; min-width: 48px; }
.pill { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: 13px; font-weight: 600; background: var(--green-light); color: var(--green-dark); }
.pill.avlsokse { background: #fdf1cf; color: var(--accent-dark); }
.pill.okse { background: var(--blue-light); color: var(--blue); }
.pill.kalv { background: var(--orange-light); color: var(--orange); }
.pill.gray { background: #eee; color: #555; }
.pill.gold { background: #fdf1cf; color: var(--accent-dark); }
.kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 8px; }
.kpis.four { grid-template-columns: repeat(2, 1fr); }
.kpi { background: var(--card); border-radius: var(--radius); padding: 12px 8px; text-align: center; }
.kpi .n { font-size: 26px; font-weight: 700; color: var(--green); }
.kpi .l { font-size: 13px; color: var(--muted); }
.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 6px; margin-bottom: 8px; scrollbar-width: none; }
.chip { white-space: nowrap; padding: 8px 14px; border-radius: 20px; background: #fff; border: 1px solid var(--line); font-weight: 600; font-size: 15px; width: auto; color: var(--text); }
.chip.on { background: var(--green); color: #fff; border-color: var(--green); }
.tabs { position: fixed; bottom: 0; left: 0; right: 0; background: #fff; border-top: 1px solid var(--line); display: flex; justify-content: space-around; padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); z-index: 20; }
.tabs button { background: none; color: var(--muted); display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 12px; padding: 4px; width: auto; flex: 1; font-weight: 600; border-radius: 10px; }
.tabs button span { font-size: 22px; }
.tabs button.on { color: var(--green); }
.tabs button.big span { background: var(--green); color: #fff; border-radius: 50%; width: 54px; height: 54px; display: flex; align-items: center; justify-content: center; margin-top: -24px; box-shadow: 0 3px 8px rgba(0,0,0,.25); border: 3px solid var(--accent); }
.mic { width: 110px; height: 110px; border-radius: 50%; background: var(--green); color: #fff; font-size: 48px; margin: 10px auto; display: flex; align-items: center; justify-content: center; box-shadow: 0 4px 12px rgba(0,0,0,.2); border: 4px solid var(--accent); }
.mic.rec { background: var(--red); animation: pulse 1s infinite; }
@keyframes pulse { 0%{transform:scale(1)} 50%{transform:scale(1.07)} 100%{transform:scale(1)} }
.center { text-align: center; }
.list-item { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.list-item:last-child { border-bottom: 0; }
.tag { font-size: 20px; font-weight: 700; min-width: 64px; }
.toast { position: fixed; top: 14px; left: 50%; transform: translateX(-50%); background: var(--green-dark); color: #fff; padding: 12px 20px; border-radius: 12px; z-index: 50; font-weight: 600; box-shadow: 0 3px 10px rgba(0,0,0,.25); max-width: 90%; }
.toast.err { background: var(--red); }
.offline { position: fixed; top: 0; left: 0; right: 0; background: var(--orange); color: #fff; padding: 8px 14px; font-size: 14px; text-align: center; z-index: 40; }
.timeline .ev { padding: 10px 0; border-bottom: 1px solid var(--line); }
.timeline .ev:last-child { border-bottom: 0; }
.timeline .ev small { color: var(--muted); }
.help { background: var(--green-light); border-radius: 12px; padding: 12px 14px; font-size: 15px; margin-bottom: 12px; }
pre.report { white-space: pre-wrap; font: inherit; margin: 0; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.grid3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
.logo { text-align: center; margin: 24px 0 4px; }
.brand { font-size: 30px; font-weight: 800; color: var(--green); letter-spacing: -.5px; text-align: center; margin: 0; }
.tagline { text-align: center; color: var(--muted); margin: 2px 0 18px; }
table { width: 100%; border-collapse: collapse; font-size: 15px; }
th, td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 600; font-size: 13px; }
td.num, th.num { text-align: right; white-space: nowrap; }
.rank { font-weight: 800; color: var(--green); font-size: 18px; }
.bar { height: 10px; background: var(--green-light); border-radius: 5px; overflow: hidden; }
.bar > div { height: 100%; background: var(--green); }
.weigh-row { display: grid; grid-template-columns: 70px 1fr 110px; gap: 8px; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--line); }
.weigh-row input { margin: 0; padding: 10px; text-align: right; }
.check { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.check:last-child { border-bottom: 0; }
.actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 10px 0; }
.actions button { padding: 14px 10px; font-size: 15px; }
.section-title { display: flex; justify-content: space-between; align-items: baseline; }
