/* Shared look for the three BWSSB x VTS interfaces. */
:root {
  --bg: #f4f6f8;
  --surface: #ffffff;
  --surface-2: #eef2f5;
  --ink: #14212b;
  --ink-2: #4a5a66;
  --ink-3: #6f7f8a;
  --line: #d9e0e6;
  --accent: #0b6e8a;
  --accent-ink: #ffffff;
  --accent-soft: #e2f1f5;
  --good: #1d7a46;
  --good-soft: #e3f3e9;
  --warn: #9a6200;
  --warn-soft: #fbf0d9;
  --bad: #b3261e;
  --bad-soft: #fbe5e3;
  --high: #b3261e;
  --medium: #9a6200;
  --low: #4a5a66;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(20, 33, 43, .06), 0 2px 8px rgba(20, 33, 43, .06);
  --font: "Noto Sans", "Noto Sans Kannada", system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f171d; --surface: #172229; --surface-2: #1e2b33; --ink: #e6edf2; --ink-2: #b2c0ca; --ink-3: #8798a3;
    --line: #2b3a44; --accent: #4fb3cf; --accent-ink: #062530; --accent-soft: #163844;
    --good: #5cc98a; --good-soft: #15342a; --warn: #e3b25a; --warn-soft: #3a2f17; --bad: #f08a80; --bad-soft: #3d1f1d;
    --high: #f08a80; --medium: #e3b25a; --low: #b2c0ca; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0f171d; --surface: #172229; --surface-2: #1e2b33; --ink: #e6edf2; --ink-2: #b2c0ca; --ink-3: #8798a3;
  --line: #2b3a44; --accent: #4fb3cf; --accent-ink: #062530; --accent-soft: #163844;
  --good: #5cc98a; --good-soft: #15342a; --warn: #e3b25a; --warn-soft: #3a2f17; --bad: #f08a80; --bad-soft: #3d1f1d;
  --high: #f08a80; --medium: #e3b25a; --low: #b2c0ca; color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font: 15px/1.5 var(--font); -webkit-text-size-adjust: 100%; }
h1, h2, h3 { line-height: 1.25; margin: 0 0 .5em; }
h1 { font-size: 1.35rem; } h2 { font-size: 1.1rem; } h3 { font-size: 1rem; }
p { margin: 0 0 .75em; }
a { color: var(--accent); }
img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
.muted { color: var(--ink-3); }
.small { font-size: .85rem; }
.hidden { display: none !important; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.grow { flex: 1; }
.stack > * + * { margin-top: 12px; }

.topbar { background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.switcher { display: flex; align-items: stretch; background: var(--ink); color: var(--bg); font-size: .82rem; }
.switcher a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 5px 4px; color: inherit;
  text-decoration: none; opacity: .75; border-bottom: 3px solid transparent; line-height: 1.15; min-height: 40px; }
.switcher a small { font-size: .68rem; opacity: .85; }
.switcher a.home { flex: 0 0 44px; font-size: 1.15rem; }
.switcher a:hover { opacity: 1; }
.switcher a[aria-current=page] { opacity: 1; font-weight: 700; border-bottom-color: var(--accent); background: rgba(255,255,255,.08); }
.topbar .inner { display: flex; align-items: center; gap: 12px; padding: 10px 16px; max-width: 1280px; margin: 0 auto; }
@media (max-width: 599px) { .topbar { position: static; } }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; }
.brand .mark { width: 30px; height: 30px; border-radius: 8px; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; font-size: .8rem; }
.brand small { display: block; font-weight: 500; color: var(--ink-3); font-size: .75rem; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid var(--line); background: var(--surface);
  border-radius: 8px; padding: 9px 14px; cursor: pointer; font-weight: 600; text-decoration: none; color: var(--ink); min-height: 40px; }
.btn:hover { background: var(--surface-2); }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn.primary:hover { filter: brightness(1.07); }
.btn.good { background: var(--good); color: #fff; border-color: var(--good); }
.btn.bad { color: var(--bad); border-color: var(--bad); background: transparent; }
.btn.big { width: 100%; min-height: 52px; font-size: 1.05rem; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.small { min-height: 32px; padding: 4px 10px; font-size: .85rem; }

label.field { display: block; font-weight: 600; margin-bottom: 4px; }
input[type=text], input[type=tel], input[type=password], input[type=number], select, textarea {
  width: 100%; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); padding: 10px 12px; min-height: 44px; }
textarea { min-height: 80px; resize: vertical; }
select { text-overflow: ellipsis; }
input:focus, select:focus, textarea:focus, .btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

.chip { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 999px; font-size: .78rem; font-weight: 600;
  background: var(--surface-2); color: var(--ink-2); white-space: nowrap; }
.chip.High { background: var(--bad-soft); color: var(--high); }
.chip.Medium { background: var(--warn-soft); color: var(--medium); }
.chip.Low { background: var(--surface-2); color: var(--low); }
.chip.good { background: var(--good-soft); color: var(--good); }
.chip.warn { background: var(--warn-soft); color: var(--warn); }
.chip.bad { background: var(--bad-soft); color: var(--bad); }
.chip.accent { background: var(--accent-soft); color: var(--accent); }

.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.seg button { border: 0; background: transparent; padding: 6px 12px; cursor: pointer; min-height: 36px; }
.seg button[aria-pressed=true] { background: var(--accent); color: var(--accent-ink); font-weight: 600; }

.notice { border-radius: 8px; padding: 10px 12px; background: var(--accent-soft); color: var(--ink); font-size: .9rem; }
.notice.warn { background: var(--warn-soft); }
.notice.bad { background: var(--bad-soft); }
.notice.good { background: var(--good-soft); }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: 10px 16px;
  border-radius: 8px; z-index: 100; max-width: calc(100% - 32px); box-shadow: var(--shadow); }

.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { position: relative; padding: 0 0 14px 22px; }
.timeline li::before { content: ""; position: absolute; left: 5px; top: 7px; width: 9px; height: 9px; border-radius: 50%; background: var(--accent); }
.timeline li::after { content: ""; position: absolute; left: 9px; top: 18px; bottom: 0; width: 1px; background: var(--line); }
.timeline li:last-child::after { display: none; }
.timeline .when { font-size: .8rem; color: var(--ink-3); }

/* Live camera */
.cam { position: fixed; inset: 0; background: #000; z-index: 200; display: flex; flex-direction: column; }
.cam video { flex: 1; width: 100%; object-fit: cover; min-height: 0; }
.cam .bar { display: flex; justify-content: space-between; align-items: center; padding: 16px; gap: 12px; background: #000; color: #fff; }
.cam .shutter { width: 72px; height: 72px; border-radius: 50%; border: 5px solid #fff; background: #fff3; cursor: pointer; }
.cam .shutter:active { background: #fff8; }
.cam .btn { background: transparent; color: #fff; border-color: #fff6; }

.feedback-btn { position: fixed; right: 12px; bottom: 12px; z-index: 30; font-size: .8rem; min-height: 34px; padding: 4px 12px; box-shadow: var(--shadow); }
dialog { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--ink); max-width: min(520px, calc(100% - 32px)); padding: 20px; }
dialog::backdrop { background: rgba(0, 0, 0, .4); }

.pick-login { max-width: 560px; margin: 16px auto 0; }
.pick-login input[type=search] { width: 100%; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); padding: 10px 12px; min-height: 44px; }
.pick-list { display: grid; gap: 6px; max-height: 60vh; overflow-y: auto; padding-right: 2px; }
.pick-group { font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-3); margin: 10px 2px 2px; }
.pick { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; text-align: left; width: 100%; border: 1px solid var(--line);
  background: var(--surface); border-radius: 8px; padding: 10px 12px; cursor: pointer; min-height: 52px; }
.pick:hover, .pick:focus-visible { border-color: var(--accent); background: var(--accent-soft); }
.pick span { font-size: .85rem; color: var(--ink-2); }
.test-banner { background: var(--warn-soft); color: var(--ink); font-size: .82rem; padding: 6px 16px; text-align: center; }
