:root {
  --bg: #141414; --card: #1f1f1f; --card2: #2a2a2a; --line: #333; --txt: #f3f3f3; --muted: #9a9a9a;
  --accent: #FF8A00; --accent2: #FFC21A; --danger: #e5484d; --ok: #30a46c;
  --r: 14px; --safe-b: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--txt); font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
body { min-height: 100vh; padding-bottom: calc(16px + var(--safe-b)); }
button, input, select, textarea { font: inherit; color: inherit; }
.hidden { display: none !important; }
.center { text-align: center; } .muted { color: var(--muted); } .small { font-size: 12.5px; }

.top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 8px; padding: 10px 14px; padding-top: max(10px, env(safe-area-inset-top)); background: rgba(20,20,20,.94); backdrop-filter: blur(8px); border-bottom: 1px solid #222; }
.logo { font-weight: 900; font-size: 21px; letter-spacing: -.3px; flex: 1; }
.logo .o { color: var(--accent); }
.back, .icon-btn { background: none; border: 0; font-size: 26px; line-height: 1; padding: 2px 8px; cursor: pointer; color: var(--txt); }
.icon-btn { font-size: 20px; color: var(--muted); }

main { max-width: 720px; margin: 0 auto; padding: 14px; }
h2 { font-size: 19px; margin: 18px 0 10px; } h3 { font-size: 16px; margin: 16px 0 8px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: 12px; padding: 13px 16px; font-weight: 700; cursor: pointer; background: var(--card2); color: var(--txt); text-decoration: none; }
.btn:active { transform: scale(.98); }
.btn.primary { background: var(--accent); color: #111; }
.btn.yellow { background: var(--accent2); color: #111; }
.btn.danger { background: transparent; color: var(--danger); border: 1px solid #4a2526; }
.btn.ghost { background: transparent; border: 1px solid var(--line); }
.btn.block { width: 100%; }
.btn.big { padding: 18px; font-size: 17px; }
.btn[disabled] { opacity: .5; pointer-events: none; }
.row { display: flex; gap: 10px; } .row > * { flex: 1; }
.stack > * + * { margin-top: 10px; }

.card { background: var(--card); border-radius: var(--r); padding: 14px; }
.trip { display: flex; gap: 12px; align-items: center; cursor: pointer; }
.trip + .trip { margin-top: 10px; }
.trip .emo { font-size: 28px; width: 48px; height: 48px; display: grid; place-items: center; background: var(--card2); border-radius: 12px; flex: none; }
.trip .t { font-weight: 700; } .trip .s { color: var(--muted); font-size: 13px; }
.trip .chev { color: var(--muted); font-size: 22px; margin-left: auto; }
.empty { text-align: center; padding: 30px 10px; color: var(--muted); }
.empty .big { font-size: 46px; }

label.f { display: block; font-size: 13px; color: var(--muted); margin: 12px 0 5px; }
input[type=text], select, textarea { width: 100%; background: var(--card2); border: 1px solid var(--line); border-radius: 10px; padding: 11px 12px; outline: none; }
input[type=text]:focus, select:focus, textarea:focus { border-color: var(--accent); }
input[type=range] { width: 100%; accent-color: var(--accent); }

.map { width: 100%; height: 300px; border-radius: var(--r); display: block; background: #2b2f24; }
.map.tall { height: 46vh; }

.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 12px 0; }
.stat { background: var(--card); border-radius: 12px; padding: 10px; text-align: center; }
.stat .v { font-size: 20px; font-weight: 800; } .stat .l { font-size: 11.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .4px; }
.rec .stat .v { font-size: 22px; }
.stat .v { white-space: nowrap; }

.gps { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.dot { width: 10px; height: 10px; border-radius: 50%; background: #666; }
.dot.ok { background: var(--ok); box-shadow: 0 0 0 4px rgba(48,164,108,.25); } .dot.warn { background: #e2a336; } .dot.bad { background: var(--danger); }
.recbadge { display: inline-flex; align-items: center; gap: 6px; color: var(--danger); font-weight: 800; }
.recbadge::before { content: ''; width: 10px; height: 10px; border-radius: 50%; background: var(--danger); animation: blink 1s infinite; }
@keyframes blink { 50% { opacity: .2; } }

.notice { background: #2d2412; border: 1px solid #5a4314; color: #f3d9a4; border-radius: 12px; padding: 10px 12px; font-size: 13.5px; }
.notice.info { background: #13222d; border-color: #1f3d52; color: #b9dcf3; }

.media { display: flex; gap: 10px; align-items: flex-start; padding: 10px; background: var(--card); border-radius: 12px; }
.media + .media { margin-top: 8px; }
.media.sel { outline: 2px solid var(--accent); }
.media .th { width: 72px; height: 72px; border-radius: 10px; object-fit: cover; background: #000; flex: none; }
.media .body { flex: 1; min-width: 0; }
.media .meta { font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.media .warn { color: #e2a336; }
.media .acts { display: flex; gap: 6px; margin-top: 6px; }
.media .acts button { padding: 6px 10px; font-size: 12.5px; border-radius: 8px; }

.seg { display: flex; background: var(--card2); border-radius: 10px; padding: 3px; gap: 3px; }
.seg button { flex: 1; background: none; border: 0; padding: 9px 4px; border-radius: 8px; font-weight: 600; font-size: 13px; cursor: pointer; color: var(--muted); }
.seg button.on { background: var(--accent); color: #111; }

.player { width: 100%; max-height: 62vh; background: #000; border-radius: var(--r); display: block; object-fit: contain; }
.progress { height: 10px; background: var(--card2); border-radius: 6px; overflow: hidden; }
.progress > i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--accent), var(--accent2)); transition: width .2s; }

#toast { position: fixed; left: 50%; bottom: calc(24px + var(--safe-b)); transform: translateX(-50%) translateY(30px); opacity: 0; background: #fff; color: #111; padding: 10px 16px; border-radius: 24px; font-weight: 600; font-size: 14px; transition: .25s; z-index: 99; max-width: 90vw; text-align: center; pointer-events: none; }
#toast.on { opacity: 1; transform: translateX(-50%) translateY(0); }

dialog { background: var(--card); color: var(--txt); border: 0; border-radius: 18px; padding: 18px; width: min(92vw, 440px); }
dialog::backdrop { background: rgba(0,0,0,.6); }
dialog h3 { margin-top: 0; }
.list-plain { padding-left: 18px; } .list-plain li { margin: 6px 0; }
.foot { text-align: center; color: var(--muted); font-size: 12px; margin-top: 26px; }
a { color: var(--accent2); }
.mt { margin-top: 12px; }
