:root {
  --bg: #101216; --surface: #181b21; --surface2: #1f232b; --line: #2a2f39;
  --text: #eef0f4; --muted: #9aa3b2; --accent: #2f7bff; --accent-ink: #fff;
  --ok: #2ecc71; --warn: #f5a623; --bad: #ff5d5d;
  --r: 14px;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
body { min-height: 100vh; padding-bottom: env(safe-area-inset-bottom); }
button, input, select { font: inherit; color: inherit; }
h1, h2, h3 { margin: 0; }
.wrap { max-width: 760px; margin: 0 auto; padding: 16px 16px 96px; }
.top { position: sticky; top: 0; z-index: 5; background: var(--bg); border-bottom: 1px solid var(--line); padding: calc(10px + env(safe-area-inset-top)) 16px 10px; display: flex; align-items: center; gap: 10px; }
.top h1 { font-size: 18px; flex: 1; }
.top .iconbtn { background: none; border: 0; padding: 8px; border-radius: 10px; color: var(--muted); cursor: pointer; font-size: 14px; }
.top .iconbtn:hover { background: var(--surface); color: var(--text); }
.nav { position: fixed; bottom: 0; left: 0; right: 0; z-index: 6; background: var(--surface); border-top: 1px solid var(--line); display: flex; padding-bottom: env(safe-area-inset-bottom); }
.nav button { flex: 1; background: none; border: 0; padding: 12px 4px 10px; color: var(--muted); cursor: pointer; font-size: 12px; display: flex; flex-direction: column; align-items: center; gap: 3px; }
.nav button .ic { font-size: 19px; line-height: 1; }
.nav button.on { color: var(--accent); font-weight: 600; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 14px; margin-bottom: 12px; }
.card h2 { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-bottom: 10px; font-weight: 600; }
.grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 12px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 14px; }
.stat b { display: block; font-size: 24px; margin-top: 4px; }
.stat span { color: var(--muted); font-size: 13px; }
.row { display: flex; align-items: center; gap: 10px; }
.row.sp { justify-content: space-between; }
.grow { flex: 1; min-width: 0; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.trunc { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item { display: flex; align-items: center; gap: 12px; padding: 12px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); margin-bottom: 8px; cursor: pointer; }
.item:active { background: var(--surface2); }
.item.static { cursor: default; }
.avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--surface2); display: grid; place-items: center; font-weight: 700; flex: none; color: var(--accent); }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--muted); flex: none; }
.dot.on { background: var(--ok); }
.badge { display: inline-block; font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 99px; background: var(--surface2); color: var(--muted); margin-right: 4px; }
.badge.ok { background: rgba(46,204,113,.15); color: var(--ok); }
.badge.warn { background: rgba(245,166,35,.15); color: var(--warn); }
.badge.bad { background: rgba(255,93,93,.15); color: var(--bad); }
.badge.acc { background: rgba(47,123,255,.18); color: #7aa8ff; }
.btn { background: var(--surface2); border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; cursor: pointer; font-weight: 600; }
.btn:active { opacity: .8; }
.btn.pri { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.bad { background: transparent; border-color: var(--bad); color: var(--bad); }
.btn.sm { padding: 6px 10px; font-size: 13px; }
.btn[disabled] { opacity: .5; pointer-events: none; }
.btns { display: flex; flex-wrap: wrap; gap: 8px; }
label.f { display: block; margin-bottom: 10px; font-size: 13px; color: var(--muted); }
label.f > span { display: block; margin-bottom: 4px; }
input, select { width: 100%; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 11px 12px; outline: none; }
input:focus, select:focus { border-color: var(--accent); }
input[type=checkbox] { width: auto; }
.check { display: flex; align-items: center; gap: 8px; margin: 6px 0 12px; font-size: 14px; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.chip { background: var(--bg); border: 1px solid var(--line); border-radius: 99px; padding: 7px 14px; cursor: pointer; font-size: 14px; }
.chip.on { background: rgba(47,123,255,.2); border-color: var(--accent); color: #9bbfff; }
.search { margin-bottom: 12px; }
.center { text-align: center; padding: 30px 10px; color: var(--muted); }
.login { max-width: 380px; margin: 0 auto; padding: 14vh 20px 20px; }
.login h1 { font-size: 26px; margin-bottom: 4px; }
.login p { color: var(--muted); margin: 0 0 22px; }
.err { color: var(--bad); font-size: 14px; min-height: 20px; margin: 8px 0; }
.back { background: none; border: 0; color: var(--accent); cursor: pointer; padding: 6px 0 12px; font-size: 15px; }
.hero { display: flex; gap: 14px; align-items: center; margin-bottom: 14px; }
.hero .avatar { width: 56px; height: 56px; font-size: 22px; }
.swatch { width: 14px; height: 14px; border-radius: 50%; flex: none; }
.overlay { position: fixed; inset: 0; background: rgba(0,0,0,.6); z-index: 20; display: flex; align-items: flex-end; justify-content: center; }
.sheet { background: var(--surface); border-radius: 20px 20px 0 0; width: 100%; max-width: 560px; padding: 18px 16px calc(18px + env(safe-area-inset-bottom)); max-height: 90vh; overflow: auto; border: 1px solid var(--line); }
.sheet h3 { margin-bottom: 12px; font-size: 18px; }
.sheet .btns { margin-top: 12px; justify-content: flex-end; }
@media (min-width: 700px) { .overlay { align-items: center; } .sheet { border-radius: 20px; } .grid { grid-template-columns: repeat(4, 1fr); } }
#toasts { position: fixed; left: 0; right: 0; bottom: calc(76px + env(safe-area-inset-bottom)); z-index: 30; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; }
.toast { background: #2b303a; border: 1px solid var(--line); padding: 10px 16px; border-radius: 12px; box-shadow: 0 6px 20px rgba(0,0,0,.4); max-width: 90vw; }
.toast.bad { border-color: var(--bad); }
.toast.ok { border-color: var(--ok); }
