:root {
  --bg: #f4f6f8; --card: #fff; --text: #17202a; --muted: #5d6b78; --line: #dde3e8;
  --brand: #0f5c8c; --brand-2: #e8f1f8;
  --new: #c2410c; --new-bg: #fff1e8; --prog: #1d4ed8; --prog-bg: #e8efff; --done: #15803d; --done-bg: #e7f6ec;
  --danger: #b91c1c; --radius: 12px;
  --safe-b: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; -webkit-text-size-adjust: 100%; }
main { max-width: 720px; margin: 0 auto; padding: 0 12px calc(150px + var(--safe-b)); }
h1 { font-size: 20px; margin: 0; } h2 { font-size: 17px; margin: 18px 0 8px; } h3 { font-size: 15px; margin: 12px 0 6px; }
a { color: var(--brand); }
.hidden { display: none !important; }
.loading { padding: 40px; text-align: center; color: var(--muted); }
.muted { color: var(--muted); } .small { font-size: 13px; } .right { text-align: right; } .nowrap { white-space: nowrap; }
.row { display: flex; gap: 8px; align-items: center; } .row > .grow { flex: 1; } .wrap { flex-wrap: wrap; }
.top { position: sticky; top: 0; z-index: 5; background: var(--bg); padding: calc(10px + env(safe-area-inset-top, 0px)) 0 8px; display: flex; align-items: center; gap: 8px; }
.top .back { font-size: 22px; text-decoration: none; padding: 4px 10px 4px 0; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; margin: 8px 0; }
.chips { display: flex; gap: 6px; overflow-x: auto; padding: 2px 0 6px; -webkit-overflow-scrolling: touch; }
.chip { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 7px 14px; font-size: 14px; white-space: nowrap; cursor: pointer; color: var(--text); }
.chip.on { background: var(--brand); color: #fff; border-color: var(--brand); }
.tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; background: #e6eaee; border-radius: 10px; padding: 4px; margin: 6px 0; }
.tabs button { border: 0; background: transparent; padding: 9px 4px; border-radius: 8px; font-size: 14px; font-weight: 600; color: var(--muted); }
.tabs button.on { background: #fff; color: var(--text); box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.tabs .n { display: inline-block; min-width: 20px; padding: 0 6px; border-radius: 10px; background: var(--line); font-size: 12px; margin-left: 2px; }
.tabs button.on .n { background: var(--brand); color: #fff; }
.mine { display: flex; justify-content: space-between; align-items: center; background: var(--prog-bg); color: var(--prog); border: 1px solid #c9d8ff; border-radius: var(--radius); padding: 10px 12px; text-decoration: none; font-weight: 600; margin: 6px 0; }
.mine.on { background: var(--prog); color: #fff; }
.ticket { display: block; text-decoration: none; color: inherit; }
.ticket .desc { font-weight: 600; font-size: 16px; }
.ticket .meta { color: var(--muted); font-size: 14px; margin-top: 2px; }
.ticket .foot { display: flex; justify-content: space-between; gap: 8px; margin-top: 6px; font-size: 13px; color: var(--muted); align-items: center; }
.badge { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.badge.new { background: var(--new-bg); color: var(--new); } .badge.in_progress { background: var(--prog-bg); color: var(--prog); } .badge.done { background: var(--done-bg); color: var(--done); }
.unassigned { color: var(--new); font-weight: 600; }
.fab { position: fixed; right: 16px; bottom: calc(72px + var(--safe-b)); z-index: 10; background: var(--new); color: #fff; border: 0; border-radius: 999px; padding: 15px 22px; font-size: 18px; font-weight: 700; box-shadow: 0 6px 18px rgba(194,65,12,.4); text-decoration: none; }
.nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 9; background: #fff; border-top: 1px solid var(--line); display: flex; padding-bottom: var(--safe-b); }
.nav a { flex: 1; text-align: center; padding: 9px 2px 10px; font-size: 12px; color: var(--muted); text-decoration: none; }
.nav a .i { display: block; font-size: 20px; line-height: 1.1; }
.nav a.on { color: var(--brand); font-weight: 700; }
label { display: block; font-size: 14px; font-weight: 600; margin: 12px 0 4px; }
label .req { color: var(--danger); }
input, select, textarea { width: 100%; font: inherit; font-size: 16px; padding: 10px 12px; border: 1px solid #c5cdd5; border-radius: 10px; background: #fff; color: var(--text); }
textarea { min-height: 70px; resize: vertical; }
input[type=checkbox] { width: 20px; height: 20px; vertical-align: middle; margin: 0 6px 0 0; }
.check { display: flex; align-items: center; font-weight: 500; margin: 8px 0; }
.btn { display: inline-block; border: 1px solid var(--brand); background: var(--brand); color: #fff; font: inherit; font-weight: 700; padding: 12px 16px; border-radius: 10px; cursor: pointer; text-align: center; text-decoration: none; }
.btn.block { display: block; width: 100%; margin: 8px 0; }
.btn.big { font-size: 18px; padding: 15px; }
.btn.ghost { background: #fff; color: var(--brand); }
.btn.warn { background: #fff; color: var(--danger); border-color: #f1b8b8; }
.btn.green { background: var(--done); border-color: var(--done); }
.btn.orange { background: var(--new); border-color: var(--new); }
.btn.sm { padding: 7px 12px; font-size: 14px; }
.btn:disabled { opacity: .55; }
.status { margin: 8px 0; padding: 10px 12px; border-radius: 10px; font-weight: 600; }
.status.sending { background: #fff8db; color: #7a5b00; }
.status.ok { background: var(--done-bg); color: var(--done); }
.status.err { background: #fde8e8; color: var(--danger); }
.kv { display: grid; grid-template-columns: 110px 1fr; gap: 4px 10px; font-size: 15px; }
.kv .k { color: var(--muted); }
.photos { display: flex; gap: 6px; flex-wrap: wrap; margin: 8px 0; }
.photos img, .thumb { width: 84px; height: 84px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); background: #eee; }
.thumbs { position: relative; display: inline-block; }
.thumbs button { position: absolute; top: -6px; right: -6px; border: 0; background: #333; color: #fff; border-radius: 50%; width: 22px; height: 22px; font-size: 13px; }
.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li { border-left: 3px solid var(--line); padding: 2px 0 10px 12px; position: relative; }
.timeline li::before { content: ''; position: absolute; left: -7px; top: 6px; width: 11px; height: 11px; border-radius: 50%; background: var(--line); }
.timeline li.created::before { background: var(--new); } .timeline li.claimed::before { background: var(--prog); } .timeline li.done::before { background: var(--done); }
.timeline li.reopened::before, .timeline li.released::before, .timeline li.reset::before { background: #a16207; }
.timeline .t { font-size: 13px; color: var(--muted); }
.money { font-variant-numeric: tabular-nums; white-space: nowrap; }
table.costs { width: 100%; border-collapse: collapse; font-size: 14px; }
table.costs td, table.costs th { padding: 6px 4px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
table.costs .money { text-align: right; }
.item-row { display: grid; grid-template-columns: 1fr 130px 36px; gap: 6px; margin-bottom: 6px; }
.item-row button { border: 0; background: #eee; border-radius: 8px; font-size: 18px; }
details summary { cursor: pointer; font-weight: 600; color: var(--brand); padding: 8px 0; }
.toast { position: fixed; left: 12px; right: 12px; bottom: calc(80px + var(--safe-b)); z-index: 20; max-width: 520px; margin: 0 auto; background: #17202a; color: #fff; padding: 12px 14px; border-radius: 10px; font-weight: 600; box-shadow: 0 4px 16px rgba(0,0,0,.3); }
.toast.err { background: var(--danger); }
.net { position: sticky; top: 0; z-index: 30; background: var(--danger); color: #fff; text-align: center; font-size: 14px; padding: 6px; font-weight: 600; }
.banner { background: #fff8db; border: 1px solid #f0dc8c; color: #5c4400; border-radius: var(--radius); padding: 10px 12px; margin: 6px 0; font-size: 14px; }
.banner a { font-weight: 700; }
.summary { background: var(--brand-2); border: 1px solid #c8dcec; border-radius: var(--radius); padding: 12px; margin: 10px 0; }
.summary .big { font-size: 22px; font-weight: 800; color: var(--brand); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.quick { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.quick .chip { font-size: 13px; padding: 6px 10px; }
.empty { text-align: center; color: var(--muted); padding: 30px 10px; }
.lightbox { position: fixed; inset: 0; z-index: 50; background: rgba(0,0,0,.9); display: flex; align-items: center; justify-content: center; }
.lightbox img { max-width: 100%; max-height: 100%; }
.login { max-width: 380px; margin: 12vh auto 0; }
.login .logo { text-align: center; margin-bottom: 14px; } .login .logo img { width: 72px; height: 72px; border-radius: 16px; }
ol.steps { padding-left: 20px; margin: 6px 0; } ol.steps li { margin: 4px 0; }
.pill-ok { color: var(--done); font-weight: 700; } .pill-bad { color: var(--danger); font-weight: 700; }
