[hidden] { display: none !important; }
:root {
  --bg: #f6f5f2; --surface: #ffffff; --surface-2: #efeee9; --text: #1d2120; --muted: #6b716f;
  --line: #e1dfd8; --accent: #1f4e46; --accent-2: #2f7a6c; --accent-soft: #dcebe7;
  --red: #b3261e; --red-soft: #fbe3e1; --amber: #8a5a00; --amber-soft: #fff1d6; --green: #2e7d32; --green-soft: #e3f3e4;
  --blue: #1f5fa8; --blue-soft: #e2edf9; --radius: 14px; --shadow: 0 1px 2px rgba(0,0,0,.06), 0 2px 8px rgba(0,0,0,.04);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121514; --surface: #1b1f1e; --surface-2: #232827; --text: #e9ecea; --muted: #9aa3a0; --line: #2d3331;
    --accent: #7cc4b3; --accent-2: #9bd6c8; --accent-soft: #1f3833; --red: #ff8a80; --red-soft: #3a1f1d;
    --amber: #ffcc66; --amber-soft: #3a2f17; --green: #8fd694; --green-soft: #1d3320; --blue: #8ab8f0; --blue-soft: #1a2a3d;
    --shadow: none; color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
a { color: var(--accent-2); text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
h1 { font-size: 1.35rem; margin: 0 0 12px; }
h2 { font-size: 1.05rem; margin: 0 0 10px; display: flex; align-items: center; gap: 8px; }
h3 { font-size: .95rem; margin: 14px 0 6px; color: var(--muted); font-weight: 600; }
.muted { color: var(--muted); } .small { font-size: .85rem; } .pad { padding: 16px; }
.top { position: sticky; top: 0; z-index: 20; display: flex; gap: 10px; align-items: center; padding: 10px 16px;
  background: var(--accent); color: #fff; padding-top: max(10px, env(safe-area-inset-top)); }
@media (prefers-color-scheme: dark) { .top { background: #16302b; } }
.brand { color: #fff; font-weight: 700; letter-spacing: .02em; }
.search { flex: 1; min-width: 0; }
.search input { width: 100%; border: 0; border-radius: 10px; padding: 8px 12px; background: rgba(255,255,255,.16); color: #fff; }
.search input::placeholder { color: rgba(255,255,255,.75); }
.net, .outbox { font-size: .75rem; background: var(--amber); color: #000; padding: 2px 8px; border-radius: 99px; white-space: nowrap; }
main { padding: 16px; padding-bottom: 96px; max-width: 1200px; margin: 0 auto; }
.bottom { position: fixed; bottom: 0; left: 0; right: 0; z-index: 20; display: flex; justify-content: space-around;
  background: var(--surface); border-top: 1px solid var(--line); padding: 6px 4px max(6px, env(safe-area-inset-bottom)); }
.bottom a { display: flex; flex-direction: column; align-items: center; font-size: .72rem; color: var(--muted); padding: 4px 8px; min-width: 56px; }
.bottom a .i { font-size: 1.3rem; line-height: 1.2; }
.bottom a.on { color: var(--accent-2); font-weight: 600; }
.bottom a.plus .i { background: var(--accent); color: #fff; width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; margin-top: -18px; box-shadow: var(--shadow); }
.side { display: none; }
@media (min-width: 900px) {
  body { display: grid; grid-template-columns: 220px 1fr; grid-template-rows: auto 1fr; }
  .top { grid-column: 1 / -1; }
  .side { display: block; padding: 16px 8px; border-right: 1px solid var(--line); min-height: calc(100vh - 56px); }
  .side a { display: block; padding: 8px 12px; border-radius: 10px; color: var(--text); }
  .side a.on { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
  .side .sep { height: 1px; background: var(--line); margin: 8px 12px; }
  .bottom { display: none; }
  main { padding: 24px; padding-bottom: 40px; width: 100%; }
  .cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
  .cols > .card { margin: 0; }
}
@media (min-width: 1300px) { .cols { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; margin-bottom: 14px; box-shadow: var(--shadow); }
.card.urgent { border-color: var(--red); }
.card.warn { border-color: var(--amber); }
.count { background: var(--surface-2); color: var(--muted); border-radius: 99px; padding: 0 8px; font-size: .8rem; font-weight: 600; }
.count.hot { background: var(--red); color: #fff; }
.item { padding: 10px 0; border-top: 1px solid var(--line); }
.item:first-of-type { border-top: 0; padding-top: 2px; }
.item .t { font-weight: 600; word-break: break-word; }
.item .m { color: var(--muted); font-size: .85rem; margin-top: 2px; }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 8px; }
.btn { border: 1px solid var(--line); background: var(--surface-2); border-radius: 10px; padding: 8px 14px; cursor: pointer; min-height: 40px; }
.btn.primary { background: var(--accent); color: #fff; border-color: var(--accent); }
@media (prefers-color-scheme: dark) { .btn.primary { color: #0f1a18; } }
.btn.danger { color: var(--red); border-color: var(--red); background: transparent; }
.btn.small { padding: 4px 10px; min-height: 32px; font-size: .85rem; }
.btn:disabled { opacity: .5; }
.badge { display: inline-block; border-radius: 99px; padding: 1px 9px; font-size: .75rem; font-weight: 600; background: var(--surface-2); color: var(--muted); white-space: nowrap; }
.b-new { background: var(--blue-soft); color: var(--blue); }
.b-run { background: var(--amber-soft); color: var(--amber); }
.b-ok { background: var(--green-soft); color: var(--green); }
.b-err { background: var(--red-soft); color: var(--red); }
.b-you { background: var(--red); color: #fff; }
.b-miss { background: var(--amber-soft); color: var(--amber); }
.late { color: var(--red); font-weight: 600; }
.chips { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 6px; margin-bottom: 8px; scrollbar-width: none; }
.chip { border: 1px solid var(--line); background: var(--surface); border-radius: 99px; padding: 5px 12px; white-space: nowrap; cursor: pointer; font-size: .88rem; }
.chip.on { background: var(--accent); color: #fff; border-color: var(--accent); }
@media (prefers-color-scheme: dark) { .chip.on { color: #0f1a18; } }
label.f { display: block; margin: 10px 0; }
label.f > span { display: block; font-size: .85rem; color: var(--muted); margin-bottom: 4px; }
input.in, select.in, textarea.in { width: 100%; border: 1px solid var(--line); background: var(--surface); border-radius: 10px; padding: 9px 11px; }
textarea.in { min-height: 90px; resize: vertical; }
.kv { display: grid; grid-template-columns: minmax(110px, 34%) 1fr; gap: 6px 12px; }
.kv dt { color: var(--muted); font-size: .88rem; } .kv dd { margin: 0; word-break: break-word; white-space: pre-wrap; }
.two { display: grid; gap: 14px; }
@media (min-width: 700px) { .two { grid-template-columns: 1fr 1fr; } }
.sheet { position: fixed; inset: 0; z-index: 50; background: rgba(0,0,0,.4); display: flex; align-items: flex-end; justify-content: center; }
.sheet > .panel { background: var(--surface); width: 100%; max-width: 640px; max-height: 92vh; overflow: auto; border-radius: 18px 18px 0 0; padding: 18px 16px max(18px, env(safe-area-inset-bottom)); }
@media (min-width: 700px) { .sheet { align-items: center; } .sheet > .panel { border-radius: 18px; } }
.grid-actions { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin: 12px 0; }
.grid-actions .btn { min-height: 64px; font-size: 1rem; }
.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: 90px; background: #222; color: #fff; padding: 10px 16px; border-radius: 10px; z-index: 60; max-width: 90vw; }
.toast.err { background: var(--red); }
.rec { display: inline-flex; align-items: center; gap: 8px; }
.dot { width: 12px; height: 12px; border-radius: 50%; background: var(--red); animation: pulse 1s infinite; }
@keyframes pulse { 50% { opacity: .3; } }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 14px; overflow-x: auto; }
.tabs a { padding: 8px 12px; color: var(--muted); border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs a.on { color: var(--accent-2); border-color: var(--accent-2); font-weight: 600; }
.pre { white-space: pre-wrap; background: var(--surface-2); border-radius: 10px; padding: 10px; font-size: .9rem; max-height: 340px; overflow: auto; }
.list-link { display: block; color: inherit; }
.empty { color: var(--muted); font-size: .9rem; padding: 4px 0; }
table.t { width: 100%; border-collapse: collapse; font-size: .9rem; }
table.t td, table.t th { text-align: left; padding: 6px 4px; border-top: 1px solid var(--line); vertical-align: top; }
.consent { max-width: 520px; margin: 40px auto; padding: 16px; }
.consent .opt { display: block; border: 1px solid var(--line); border-radius: 10px; padding: 10px; margin: 8px 0; background: var(--surface); }
body.plain { display: block; }
.bar { height: 6px; border-radius: 3px; background: var(--surface-2); overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--accent-2); }
