:root { --blue: #1a73e8; --bg: #f4f6f8; --card: #fff; --text: #1f2933; --muted: #6b7280; --line: #e5e7eb; --red: #dc2626; --green: #15803d; --input-bg: #fff; --th-bg: #f9fafb; --alt-btn: #f3f4f6; --active-bg: #eef2ff; --danger-line: #f3c2c2; --badge-bg: #eef2ff; --badge-fg: #3730a3; --badge-on-bg: #dcfce7; --badge-on-fg: #166534; --badge-off-bg: #fee2e2; --badge-off-fg: #991b1b; }
:root[data-theme="dark"] { --blue: #5b9bf8; --bg: #111318; --card: #1c2027; --text: #e8eaed; --muted: #9aa0a6; --line: #33373f; --red: #f87171; --green: #4ade80; --input-bg: #242a33; --th-bg: #242a33; --alt-btn: #2a2f38; --active-bg: #2a3444; --danger-line: #7f1d1d; --badge-bg: #2b3350; --badge-fg: #c7d2fe; --badge-on-bg: #14532d; --badge-on-fg: #bbf7d0; --badge-off-bg: #7f1d1d; --badge-off-fg: #fecaca; }
* { box-sizing: border-box; color-scheme: light; }
:root[data-theme="dark"] * { color-scheme: dark; }
body { margin: 0; font-family: -apple-system, "Segoe UI", Roboto, sans-serif; background: var(--bg); color: var(--text); }
#app { max-width: 640px; margin: 0 auto; padding: 12px 12px 76px; }
.view.hidden, .hidden { display: none !important; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 16px; margin: 12px 0; box-shadow: 0 1px 2px rgba(0,0,0,.04); }
h1 { font-size: 1.35rem; margin: 0 0 4px; }
h2 { font-size: 1.05rem; margin: 0 0 10px; }
.muted { color: var(--muted); font-size: .9rem; }
label { display: block; font-size: .85rem; font-weight: 600; margin: 10px 0 2px; }
input { width: 100%; padding: 11px 12px; font-size: 1rem; border: 1px solid var(--line); border-radius: 8px; margin-top: 4px; background: var(--input-bg); color: var(--text); }
input:focus { outline: 2px solid var(--blue); border-color: var(--blue); }
button { font-size: 1rem; border-radius: 8px; padding: 11px 14px; border: 1px solid var(--line); background: var(--card); color: var(--text); cursor: pointer; }
button.primary { background: var(--blue); color: #fff; border-color: var(--blue); width: 100%; margin-top: 12px; font-weight: 600; }
button.secondary { background: var(--card); margin-top: 8px; }
button.small { padding: 8px 10px; font-size: .9rem; }
button.link { border: none; background: none; color: var(--blue); padding: 4px; }
button.danger { color: var(--red); border-color: var(--danger-line); }
button:disabled { opacity: .55; }
.row { display: flex; gap: 10px; align-items: flex-end; }
.row.between { justify-content: space-between; align-items: center; }
.grow { flex: 1; }
.error { color: var(--red); font-size: .9rem; margin-top: 8px; min-height: 1.1em; }
.ok { color: var(--green); font-size: .9rem; margin-top: 8px; }
.topbar { display: flex; justify-content: space-between; align-items: center; padding: 6px 2px; }
.total { font-size: 1.05rem; margin: 4px 0 8px; }
ul.entries, ul.users { list-style: none; padding: 0; margin: 0; }
ul.entries li, ul.users li { border-top: 1px solid var(--line); padding: 10px 2px; }
.entry-head { display: flex; justify-content: space-between; font-weight: 600; }
.entry-route { color: var(--muted); font-size: .9rem; margin: 2px 0; }
.entry-actions button { font-size: .85rem; padding: 6px 9px; margin-right: 6px; }
.badge { display: inline-block; font-size: .72rem; padding: 2px 8px; border-radius: 20px; background: var(--badge-bg); color: var(--badge-fg); margin-left: 6px; }
.badge.off { background: var(--badge-off-bg); color: var(--badge-off-fg); }
.badge.on { background: var(--badge-on-bg); color: var(--badge-on-fg); }
.user-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.exp-editor { display: flex; gap: 6px; margin-top: 8px; align-items: center; flex-wrap: wrap; }
.exp-editor input { margin-top: 0; width: auto; flex: 1; min-width: 140px; }
footer { text-align: center; color: var(--muted); font-size: .8rem; padding: 18px 0 4px; }
#bottomnav { position: fixed; bottom: 0; left: 0; right: 0; display: flex; background: var(--card); border-top: 1px solid var(--line); z-index: 10; }
#bottomnav button { flex: 1; border: none; border-radius: 0; padding: 13px 0 calc(13px + env(safe-area-inset-bottom)); font-weight: 600; color: var(--muted); }
#bottomnav button.active { color: var(--blue); }
.login-card { margin-top: 15vh; }
table.report { width: 100%; border-collapse: collapse; font-size: .88rem; }
table.report th, table.report td { border: 1px solid var(--line); padding: 7px 8px; text-align: left; }
table.report th { background: var(--th-bg); }
@media print {
  #bottomnav, .topbar button, #btn-print, #btn-report, footer { display: none !important; }
  #app { padding: 0; max-width: none; }
  .view.hidden { display: none !important; }
}
.stop-wrap { position: relative; }
.stop-row { display: flex; gap: 6px; align-items: stretch; }
.stop-row input.stop { flex: 1; min-width: 0; margin-top: 4px; }
.addr-dropbtn { flex: 0 0 auto; padding: 0 13px; margin-top: 4px; font-size: 1rem; background: var(--alt-btn); }
.addr-dropdown { position: absolute; top: calc(100% + 4px); left: 0; right: 0; background: var(--card); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 8px 24px rgba(0,0,0,.12); max-height: 230px; overflow-y: auto; z-index: 20; padding: 4px; }
.addr-option { display: block; width: 100%; text-align: left; border: none; background: none; padding: 10px 12px; font-size: .9rem; border-radius: 8px; font-weight: 400; }
.addr-option:active { background: var(--active-bg); }
.addr-option-row { display: flex; align-items: center; gap: 2px; }
.addr-option-row .addr-option { flex: 1; min-width: 0; }
.addr-del { flex: 0 0 auto; border: none; background: none; color: var(--muted); font-size: 1.15rem; padding: 8px 12px; cursor: pointer; }
.addr-del:active { color: var(--red); }
.stop-del { flex: 0 0 auto; padding: 0 10px; margin-top: 4px; font-size: 1.15rem; color: var(--muted); background: var(--card); }
.stop-del:active { color: var(--red); }
.muted.small { font-size: .82rem; }

.seg { display: flex; gap: 0; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; margin-top: 6px; }
.seg button { flex: 1; border: none; border-radius: 0; padding: 10px 4px; font-size: .9rem; font-weight: 600; color: var(--muted); background: var(--card); margin: 0; }
.seg button + button { border-left: 1px solid var(--line); }
.seg button.active { background: var(--blue); color: #fff; }
