:root {
  color-scheme: light dark;
  --bg: #eef2f6; --card: #ffffff; --ink: #0f1a24; --muted: #5a6875; --line: #d9e1e8; --soft: #f5f8fb;
  --brand: #123a5c; --brand-ink: #ffffff;
  --primary: #1d6fb8; --ok: #15803d; --warn: #b45309; --warn-bg: #fff6e6; --bad: #b91c1c; --bad-bg: #fdecec; --btn-ink: #ffffff;
  --radius: 16px; --shadow: 0 1px 2px rgba(15, 26, 36, .06), 0 6px 18px rgba(15, 26, 36, .06);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b1218; --card: #131c24; --ink: #e8eef3; --muted: #97a6b3; --line: #24313c; --soft: #18232d;
    --brand: #0e2c45; --primary: #4a9be0; --ok: #22c55e; --warn: #fbbf24; --warn-bg: #2a2110; --bad: #f87171; --bad-bg: #2b1414;
    --btn-ink: #06121c; --shadow: none;
  }
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--ink); }
body { min-height: 100dvh; padding-bottom: calc(88px + env(safe-area-inset-bottom)); font-size: 17px; line-height: 1.35; }
button { font: inherit; cursor: pointer; color: inherit; }
a { color: inherit; }
[hidden] { display: none !important; }

.top { position: sticky; top: 0; z-index: 5; display: flex; justify-content: space-between; align-items: center;
  padding: calc(10px + env(safe-area-inset-top)) 16px 10px; background: var(--brand); color: var(--brand-ink); }
.brand { display: flex; align-items: center; gap: 10px; }
.brand strong { display: block; font-size: 1.05rem; }
.brand small { display: block; font-size: .7rem; letter-spacing: .12em; opacity: .75; }
.mark { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: #e6f1fb; font-size: 1.1rem; }
.mark.big { width: 56px; height: 56px; border-radius: 16px; font-size: 1.6rem; margin: 0 auto 8px; }
.who { display: flex; align-items: center; gap: 8px; }
.icon { width: 40px; height: 40px; border: 0; border-radius: 12px; background: rgba(255, 255, 255, .14); color: var(--brand-ink); font-size: 1.2rem; }
.icon.text { width: auto; padding: 0 12px; font-size: .85rem; font-weight: 600; }
.badge { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: #e6f1fb; color: var(--brand); font-weight: 700; font-size: .9rem; }

main { max-width: 36rem; margin: 0 auto; padding: 14px 14px 0; }

.login { min-height: 70dvh; display: grid; place-items: center; }
.login-card { width: 100%; background: var(--card); border-radius: 24px; padding: 28px 20px; box-shadow: var(--shadow); text-align: center; }
.login-card h1 { margin: 6px 0 4px; font-size: 1.5rem; }
.login-card form { text-align: left; margin-top: 18px; }

label { display: block; margin: 12px 0 6px; color: var(--muted); font-size: .9rem; }
input, select, textarea { width: 100%; font: inherit; padding: 12px; border: 2px solid var(--line); border-radius: 12px;
  background: var(--soft); color: var(--ink); outline: none; }
textarea { min-height: 84px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--primary); }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.row2 label { margin-top: 12px; }
.link { display: block; margin: 12px auto 0; background: none; border: 0; color: var(--muted); text-decoration: underline; }
.muted { color: var(--muted); font-size: .92rem; }

.btn { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: 54px; margin-top: 14px; border: 0;
  border-radius: 14px; color: var(--btn-ink); font-weight: 700; font-size: 1.05rem; background: var(--primary); text-decoration: none; }
.btn.ok { background: var(--ok); } .btn.bad { background: var(--bad); } .btn.ghost { background: var(--soft); color: var(--ink); border: 2px solid var(--line); }
.btn:disabled { background: var(--line); color: var(--muted); }
.btns { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.btns .btn { margin-top: 10px; min-height: 48px; font-size: .95rem; }

.head { margin-bottom: 12px; }
.head h2 { margin: 2px 0 6px; font-size: 1.25rem; }
.search { margin-bottom: 4px; }

.list { display: grid; gap: 10px; }
.card { background: var(--card); border-radius: var(--radius); padding: 14px; box-shadow: var(--shadow); border-left: 5px solid var(--line); }
.card.tap { cursor: pointer; }
.card.urgent { border-left-color: var(--bad); }
.card.warn { border-left-color: var(--warn); }
.card.okc { border-left-color: var(--ok); }
.card h3 { margin: 0 0 4px; font-size: 1.05rem; }
.card p { margin: 4px 0 0; }
.meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.chip { display: inline-block; padding: 3px 9px; border-radius: 999px; background: var(--soft); border: 1px solid var(--line); font-size: .8rem; }
.chip.bad { background: var(--bad-bg); color: var(--bad); border-color: transparent; font-weight: 600; }
.chip.warn { background: var(--warn-bg); color: var(--warn); border-color: transparent; font-weight: 600; }
.chip.ok { color: var(--ok); }
.empty { text-align: center; padding: 34px 10px; color: var(--muted); }

.section-title { margin: 18px 0 8px; font-size: .85rem; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; font-size: .95rem; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }

.checks { display: grid; gap: 6px; margin-top: 8px; }
.check { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; background: var(--soft); border: 1px solid var(--line); }
.check input { width: 22px; height: 22px; flex: none; }

.fab { position: fixed; right: 18px; bottom: calc(92px + env(safe-area-inset-bottom)); z-index: 6; width: 58px; height: 58px; border: 0;
  border-radius: 50%; background: var(--primary); color: var(--btn-ink); font-size: 1.8rem; box-shadow: 0 6px 18px rgba(0, 0, 0, .25); }

.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 5; display: grid; grid-template-columns: repeat(5, 1fr);
  background: var(--card); border-top: 1px solid var(--line); padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); }
.tabbar button { border: 0; background: none; padding: 6px 0; display: grid; justify-items: center; gap: 2px; color: var(--muted); font-size: .72rem; }
.tabbar b { font-size: 1.05rem; color: var(--ink); }
.tabbar button[aria-selected=true] { color: var(--primary); }
.tabbar button[aria-selected=true] b { color: var(--primary); }

.sheet { position: fixed; inset: 0; z-index: 10; background: rgba(0, 0, 0, .45); display: flex; align-items: flex-end; justify-content: center; }
.sheet .panel { width: 100%; max-width: 36rem; max-height: 92dvh; overflow: auto; background: var(--card); border-radius: 22px 22px 0 0;
  padding: 18px 16px calc(18px + env(safe-area-inset-bottom)); }
.sheet .panel h2 { margin: 0 0 4px; font-size: 1.2rem; }
.sheet .close { float: right; border: 0; background: var(--soft); border-radius: 10px; width: 36px; height: 36px; font-size: 1.1rem; }

.toast { position: fixed; left: 50%; bottom: calc(96px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 20;
  background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 12px; font-size: .95rem; max-width: 90vw; text-align: center; }
