:root {
  --ink: #13302f;
  --ink-2: #3c5553;
  --muted: #6b7f7d;
  --line: #dde4e2;
  --bg: #f4f6f5;
  --card: #ffffff;
  --accent: #0f7a6c;
  --accent-ink: #ffffff;
  --new: #f2a93b;
  --new-bg: #fff6e6;
  --danger: #c2412d;
  --danger-bg: #fdecea;
  --ok: #24804a;
  --ok-bg: #e8f5ec;
  --info-bg: #e9f2f8;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(19, 48, 47, .06), 0 4px 16px rgba(19, 48, 47, .06);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --ink: #e7efed; --ink-2: #b8c9c6; --muted: #8aa09d; --line: #2a3b3a; --bg: #0f1918; --card: #162423;
    --accent: #2bb39f; --accent-ink: #062320; --new-bg: #3a2c12; --danger-bg: #3b1712; --ok-bg: #12301f; --info-bg: #13283a;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.45 var(--font); -webkit-text-size-adjust: 100%; }
body { padding-bottom: env(safe-area-inset-bottom); }
a { color: var(--accent); }
button, input, select, textarea { font: inherit; color: inherit; }
.topbar {
  position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 12px; justify-content: space-between;
  padding: calc(10px + env(safe-area-inset-top)) 16px 10px; background: #13302f; color: #fff;
}
.brand { color: #fff; text-decoration: none; font-weight: 800; letter-spacing: .14em; font-size: 15px; display: flex; align-items: center; gap: 8px; }
.mark { width: 18px; height: 18px; border-radius: 5px; background: linear-gradient(135deg, #2bb39f 0 50%, #f2a93b 50% 100%); }
.nav { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; }
.nav a { color: #cfe3df; text-decoration: none; padding: 6px 10px; border-radius: 8px; font-size: 14px; white-space: nowrap; }
.nav a.active, .nav a:hover { background: rgba(255,255,255,.12); color: #fff; }
.badge-dot { display: inline-block; min-width: 18px; padding: 0 5px; border-radius: 9px; background: var(--new); color: #13302f; font-size: 12px; font-weight: 700; text-align: center; margin-left: 4px; }
.app { max-width: 920px; margin: 0 auto; padding: 16px; }
.pad { padding: 16px; }
h1 { font-size: 22px; margin: 4px 0 14px; }
h2 { font-size: 15px; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-2); margin: 26px 0 10px; display: flex; align-items: center; gap: 8px; }
h2 .count { font-size: 12px; background: var(--line); color: var(--ink-2); border-radius: 9px; padding: 1px 8px; letter-spacing: 0; }
h3 { font-size: 16px; margin: 0 0 8px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px 16px; margin-bottom: 10px; }
.list { display: grid; gap: 10px; }
.ticket { display: block; text-decoration: none; color: inherit; background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px 16px; border-left: 4px solid transparent; }
.ticket.is-new { border-left-color: var(--new); background: linear-gradient(90deg, var(--new-bg), var(--card) 60%); }
.ticket.is-overdue { border-left-color: var(--danger); }
.ticket .title { font-weight: 650; }
.ticket .meta { display: flex; flex-wrap: wrap; gap: 6px 10px; margin-top: 6px; font-size: 13px; color: var(--muted); align-items: center; }
.chip { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: var(--line); color: var(--ink-2); }
.chip.new { background: var(--new); color: #13302f; }
.chip.critical, .chip.danger { background: var(--danger-bg); color: var(--danger); }
.chip.high { background: var(--new-bg); color: #8a5a10; }
.chip.ok { background: var(--ok-bg); color: var(--ok); }
.chip.info { background: var(--info-bg); color: #1d5f8a; }
.empty { color: var(--muted); font-size: 14px; padding: 6px 2px; }
.btn { appearance: none; border: 0; border-radius: 12px; padding: 12px 16px; font-weight: 650; cursor: pointer; background: var(--line); color: var(--ink); min-height: 46px; touch-action: manipulation; }
.btn.primary { background: var(--accent); color: var(--accent-ink); }
.btn.warn { background: var(--new); color: #13302f; }
.btn.ghost { background: transparent; border: 1px solid var(--line); }
.btn.small { min-height: 34px; padding: 6px 12px; font-size: 14px; border-radius: 9px; }
.btn.block { width: 100%; }
.btn[disabled] { opacity: .55; cursor: default; }
.actions { display: grid; gap: 8px; margin: 14px 0; }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.grow { flex: 1; }
label { display: block; font-size: 14px; font-weight: 600; margin: 12px 0 4px; color: var(--ink-2); }
input[type=text], input[type=email], input[type=number], input[type=date], input[type=datetime-local], select, textarea {
  width: 100%; border: 1px solid var(--line); border-radius: 10px; padding: 11px 12px; background: var(--card); min-height: 46px;
}
textarea { min-height: 90px; resize: vertical; }
.check { display: flex; align-items: center; gap: 10px; font-weight: 500; margin: 8px 0; }
.check input { width: 20px; height: 20px; }
.kv { display: grid; grid-template-columns: 130px 1fr; gap: 6px 12px; font-size: 14px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }
.timeline { list-style: none; margin: 0; padding: 0; font-size: 14px; }
.timeline li { padding: 8px 0 8px 18px; border-left: 2px solid var(--line); position: relative; }
.timeline li::before { content: ""; position: absolute; left: -6px; top: 13px; width: 10px; height: 10px; border-radius: 50%; background: var(--accent); }
.timeline time { color: var(--muted); font-size: 12px; display: block; }
.steps { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; margin: 10px 0; }
.steps span { text-align: center; font-size: 11px; padding: 6px 2px; border-radius: 8px; background: var(--line); color: var(--muted); }
.steps span.done { background: var(--ok-bg); color: var(--ok); font-weight: 700; }
.banner { border-radius: var(--radius); padding: 12px 14px; margin-bottom: 12px; font-size: 14px; }
.banner.warn { background: var(--new-bg); }
.banner.info { background: var(--info-bg); }
.banner.ok { background: var(--ok-bg); }
.banner.danger { background: var(--danger-bg); }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th, .table td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table th { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.scroll-x { overflow-x: auto; }
.photo-thumb { width: 84px; height: 84px; object-fit: cover; border-radius: 10px; background: var(--line); }
.toast { position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom)); transform: translateX(-50%); background: #13302f; color: #fff; padding: 10px 16px; border-radius: 12px; box-shadow: var(--shadow); max-width: 90vw; z-index: 50; }
.rule { border-left: 4px solid var(--line); }
.rule.on { border-left-color: var(--accent); }
.rule code, .mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; }
.switch { position: relative; width: 48px; height: 28px; flex: none; }
.switch input { opacity: 0; width: 100%; height: 100%; margin: 0; position: absolute; cursor: pointer; z-index: 1; }
.switch span { position: absolute; inset: 0; background: var(--line); border-radius: 14px; transition: .15s; }
.switch span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; transition: .15s; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.switch input:checked + span { background: var(--accent); }
.switch input:checked + span::after { transform: translateX(20px); }
.ok-text { color: var(--ok); } .bad-text { color: var(--danger); }
.grid-2 { display: grid; grid-template-columns: 1fr; gap: 10px; }
@media (min-width: 720px) { .grid-2 { grid-template-columns: 1fr 1fr; } .actions.inline { grid-auto-flow: column; justify-content: start; } }
pre.trace { white-space: pre-wrap; font-size: 12.5px; background: var(--bg); padding: 10px; border-radius: 10px; margin: 6px 0 0; }
