:root { --bg:#0b0f17; --card:#121826; --line:#243047; --text:#e6ebf5; --muted:#8a96ad; --accent:#4f8cff; --up:#2fbf71; --down:#ef5b5b; --warn:#e9a93b; --nav:64px;
  --sat: env(safe-area-inset-top, 0px); --sab: env(safe-area-inset-bottom, 0px); --sal: env(safe-area-inset-left, 0px); --sar: env(safe-area-inset-right, 0px); }
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; -webkit-text-size-adjust: 100%; }
body { min-height: 100dvh; padding: var(--sat) var(--sar) 0 var(--sal); }
h1 { font-size: 18px; margin: 0; } h2 { font-size: 16px; margin: 0 0 8px; } h3 { font-size: 14px; margin: 12px 0 6px; color: var(--muted); font-weight: 600; }
.muted { color: var(--muted); } .small { font-size: 12px; } .center { text-align: center; } .pad { padding: 24px; }
.up { color: var(--up); } .down { color: var(--down); } .warn { color: var(--warn); }
header.top { display: flex; align-items: center; gap: 8px; padding: 10px 14px; position: sticky; top: var(--sat); background: var(--bg); z-index: 5; border-bottom: 1px solid var(--line); }
header.top .sp { flex: 1; }
/* content leaves room for the bottom bar, the phone's gesture/3-button bar (safe area) and, when the keyboard is open, nothing extra: the bar is hidden then */
main { padding: 12px 14px calc(var(--nav) + var(--sab) + 28px); max-width: 980px; margin: 0 auto; }
nav.tabs { position: fixed; left: 0; right: 0; bottom: 0; display: flex; background: #0e1420; border-top: 1px solid var(--line); z-index: 10;
  padding: 0 var(--sar) var(--sab) var(--sal); min-height: calc(var(--nav) + var(--sab)); }
nav.tabs button { flex: 1; min-height: var(--nav); background: none; border: 0; color: var(--muted); font: inherit; font-size: 12px; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 2px; cursor: pointer; }
nav.tabs button .ic { font-size: 20px; line-height: 1; }
nav.tabs button[aria-current="page"] { color: var(--accent); font-weight: 600; }
body.kbd nav.tabs { display: none; } body.kbd main { padding-bottom: 20px; }
@media (min-width: 900px) { nav.tabs { position: sticky; top: 52px; bottom: auto; min-height: 0; border: 0; border-bottom: 1px solid var(--line); justify-content: center; }
  nav.tabs button { flex: 0 0 140px; min-height: 44px; flex-direction: row; justify-content: center; gap: 6px; } main { padding-bottom: 40px; } }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 12px; margin-bottom: 12px; }
.grid { display: grid; gap: 12px; grid-template-columns: 1fr; } @media (min-width: 640px) { .grid.two { grid-template-columns: 1fr 1fr; } .grid.three { grid-template-columns: repeat(3, 1fr); } }
.kv { display: flex; justify-content: space-between; gap: 8px; padding: 3px 0; } .kv b { font-variant-numeric: tabular-nums; text-align: right; }
.big { font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; }
.badge { display: inline-block; font-size: 11px; padding: 1px 7px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); }
.badge.ok { color: var(--up); border-color: var(--up); } .badge.err { color: var(--down); border-color: var(--down); } .badge.old { color: var(--warn); border-color: var(--warn); }
.badge.src { color: var(--accent); border-color: var(--accent); }
.alert { border-radius: 8px; padding: 9px 11px; margin-bottom: 10px; font-size: 13px; border: 1px solid var(--warn); background: rgba(233,169,59,.1); }
.alert.err { border-color: var(--down); background: rgba(239,91,91,.1); } .alert.info { border-color: var(--accent); background: rgba(79,140,255,.1); }
button, .btn { font: inherit; color: var(--text); background: #1a2336; border: 1px solid var(--line); border-radius: 8px; padding: 9px 14px; min-height: 44px; cursor: pointer; }
button.primary { background: rgba(79,140,255,.25); border-color: var(--accent); } button.danger { border-color: var(--down); color: var(--down); background: rgba(239,91,91,.08); }
button:disabled { opacity: .45; cursor: not-allowed; } .row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
label { display: block; font-size: 12px; color: var(--muted); margin: 8px 0 3px; }
input, select, textarea { width: 100%; font: inherit; font-size: 16px; /* 16px stops iOS zoom */ color: var(--text); background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 9px 10px; min-height: 44px; }
input[type=checkbox], input[type=radio] { width: auto; min-height: 0; } input:disabled, select:disabled { opacity: .4; } textarea { min-height: 76px; resize: vertical; }
.check { display: flex; align-items: center; gap: 8px; color: var(--text); font-size: 14px; margin: 6px 0; } .check input { width: 20px; height: 20px; }
.days { display: flex; gap: 6px; flex-wrap: wrap; } .days label { display: flex; align-items: center; gap: 4px; margin: 0; color: var(--text); font-size: 14px; border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; min-height: 40px; }
table { width: 100%; border-collapse: collapse; font-size: 13px; font-variant-numeric: tabular-nums; } th, td { padding: 6px 5px; border-bottom: 1px solid var(--line); text-align: right; } th:first-child, td:first-child { text-align: left; }
th { color: var(--muted); font-weight: 600; } .scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.chart { height: 240px; width: 100%; margin: 6px 0 4px; } .legend { display: flex; gap: 12px; flex-wrap: wrap; font-size: 12px; color: var(--muted); } .legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 4px; }
.jrow { display: block; width: 100%; text-align: left; background: var(--card); margin-bottom: 8px; padding: 10px 12px; } .jrow .t { display: flex; justify-content: space-between; gap: 8px; }
#toast { position: fixed; left: 12px; right: 12px; bottom: calc(var(--nav) + var(--sab) + 12px); z-index: 50; pointer-events: none; display: flex; flex-direction: column; gap: 6px; align-items: center; }
#toast div { background: #1d2740; border: 1px solid var(--line); border-radius: 8px; padding: 9px 14px; max-width: 520px; box-shadow: 0 4px 16px rgba(0,0,0,.5); } #toast .bad { border-color: var(--down); }
#modal { position: fixed; inset: 0; background: rgba(0,0,0,.6); z-index: 40; display: flex; align-items: flex-end; justify-content: center; }
#modal[hidden] { display: none; } #modal .sheet { background: var(--card); border: 1px solid var(--line); border-radius: 14px 14px 0 0; width: 100%; max-width: 640px; max-height: 92dvh; overflow-y: auto;
  padding: 14px 14px calc(18px + var(--sab)); } @media (min-width: 640px) { #modal { align-items: center; } #modal .sheet { border-radius: 14px; } }
.login { max-width: 360px; margin: 14vh auto 0; padding: 0 14px; } .tag { font-size: 11px; color: var(--muted); }
details summary { cursor: pointer; padding: 8px 0; min-height: 40px; }

/* ---- professional mobile polish ---- */
:root { --card2: #172036; --glow: rgba(79,140,255,.18); }
body { background: radial-gradient(900px 420px at 50% -120px, #162240 0%, var(--bg) 60%) no-repeat, var(--bg); }
header.top { backdrop-filter: blur(10px); background: rgba(11,15,23,.82); padding: 8px 14px; min-height: 52px; }
header.top .logo { border-radius: 8px; } header.top h1 { font-size: 16px; letter-spacing: .2px; }
.chip { min-height: 36px; padding: 4px 12px; font-size: 13px; border-radius: 999px; background: rgba(79,140,255,.2); border-color: var(--accent); }
.card { background: linear-gradient(180deg, var(--card2), var(--card)); border-radius: 14px; box-shadow: 0 1px 0 rgba(255,255,255,.03) inset, 0 6px 18px rgba(0,0,0,.25); }
.hero { border-radius: 18px; padding: 16px; margin-bottom: 12px; border: 1px solid #2c3d63; background: linear-gradient(135deg, #1b2c52 0%, #14203a 55%, #101a30 100%); box-shadow: 0 10px 30px var(--glow); }
.hero-n { font-size: 32px; font-weight: 800; letter-spacing: -.5px; margin: 4px 0 6px; font-variant-numeric: tabular-nums; }
.hero-s { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; font-size: 13px; color: var(--muted); } .hero-s b { color: var(--text); margin-left: 4px; }
button { border-radius: 12px; transition: transform .08s, background .15s; } button:active { transform: scale(.97); }
nav.tabs { background: rgba(14,20,32,.94); backdrop-filter: blur(12px); border-top: 1px solid #2a3855; }
nav.tabs button { position: relative; font-size: 11px; font-weight: 500; gap: 3px; border-radius: 0; }
nav.tabs button .ic { display: grid; place-items: center; width: 52px; height: 28px; border-radius: 999px; transition: background .2s; }
nav.tabs button[aria-current="page"] .ic { background: rgba(79,140,255,.22); }
.steps { padding-left: 20px; line-height: 1.7; } .steps li { margin-bottom: 4px; }
.jrow { border-radius: 14px; }
@media (min-width: 900px) { nav.tabs button .ic { width: 28px; } nav.tabs button { font-size: 13px; } }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

.pend { border-color: var(--warn); } .pend-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); flex-wrap: wrap; }
.bar { height: 10px; border-radius: 999px; background: #0d1424; border: 1px solid var(--line); overflow: hidden; margin: 8px 0 4px; } .bar i { display: block; height: 100%; background: linear-gradient(90deg, #2fbf71, #4f8cff); border-radius: 999px; }
