/* Shared look for every Bottle Drive page. Light by default, dark when the phone is in dark mode. */
:root {
  --bg: #f4f7f6; --card: #ffffff; --ink: #10201c; --muted: #5b6b67; --line: #dbe4e1;
  --brand: #0f766e; --brand-ink: #ffffff; --brand-soft: #ccfbf1; --accent: #f59e0b;
  --ok: #15803d; --ok-soft: #dcfce7; --warn: #b45309; --warn-soft: #fef3c7; --bad: #b91c1c; --bad-soft: #fee2e2;
  --radius: 14px; --shadow: 0 1px 2px rgba(0,0,0,.06), 0 6px 20px rgba(0,0,0,.06);
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0c1513; --card: #15211e; --ink: #e8f2ef; --muted: #9db0ab; --line: #2a3a36;
    --brand: #2dd4bf; --brand-ink: #04211d; --brand-soft: #123d37; --accent: #fbbf24;
    --ok: #4ade80; --ok-soft: #14321f; --warn: #fbbf24; --warn-soft: #3a2c0c; --bad: #f87171; --bad-soft: #3b1414;
    --shadow: none;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
body.center { min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; }
h1 { font-size: 1.75rem; } h2 { font-size: 1.3rem; } h3 { font-size: 1.05rem; }
p { margin: 0 0 1em; }
a { color: var(--brand); }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.login { width: min(420px, 100%); display: flex; flex-direction: column; gap: 14px; text-align: center; }
.login img { margin: 0 auto; }
.err { color: var(--bad); font-weight: 600; min-height: 1.2em; }
.stack > * + * { margin-top: 14px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.nowrap { flex-wrap: nowrap; }
.grow { flex: 1 1 auto; min-width: 0; }
.right { margin-left: auto; }
.hidden { display: none !important; }

label { display: block; font-weight: 600; margin-bottom: 6px; }
label .muted { font-weight: 400; }
input, select, textarea {
  width: 100%; font: inherit; color: var(--ink); background: var(--card);
  border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; min-height: 48px;
}
textarea { min-height: 90px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 3px solid color-mix(in srgb, var(--brand) 35%, transparent); border-color: var(--brand); }
input[type="checkbox"], input[type="radio"] { width: 22px; height: 22px; min-height: 0; accent-color: var(--brand); flex: none; margin: 0; }
.check { display: flex; gap: 12px; align-items: flex-start; font-weight: 400; cursor: pointer; }
.check input { margin-top: 2px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 10px 16px;
  font: 600 1rem/1.2 inherit; font-family: inherit; color: var(--ink); background: var(--card); border: 1px solid var(--line);
  border-radius: 10px; cursor: pointer; text-decoration: none; white-space: nowrap;
}
.btn:hover { border-color: var(--brand); }
.btn.primary { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }
.btn.danger { color: var(--bad); }
.btn.big { min-height: 56px; font-size: 1.15rem; padding: 14px 20px; width: 100%; white-space: normal; text-align: center; }
.btn.small { min-height: 34px; padding: 6px 10px; font-size: .875rem; }
.btn:disabled { opacity: .5; cursor: default; }

.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 6px; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg label { margin: 0; text-align: center; padding: 12px 6px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; font-weight: 600; background: var(--card); }
.seg input:checked + label { background: var(--brand-soft); border-color: var(--brand); color: var(--ink); outline: 2px solid var(--brand); }
.seg input:focus-visible + label { outline: 3px solid var(--brand); }

.pill { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: .8rem; font-weight: 600; background: var(--line); color: var(--ink); white-space: nowrap; }
.pill.ok { background: var(--ok-soft); color: var(--ok); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.bad { background: var(--bad-soft); color: var(--bad); }
.pill.brand { background: var(--brand-soft); color: var(--brand); }

.notice { padding: 12px 14px; border-radius: 10px; background: var(--warn-soft); color: var(--ink); border: 1px solid color-mix(in srgb, var(--warn) 40%, transparent); }
.notice.ok { background: var(--ok-soft); border-color: color-mix(in srgb, var(--ok) 40%, transparent); }
.notice.bad { background: var(--bad-soft); border-color: color-mix(in srgb, var(--bad) 40%, transparent); }

table { width: 100%; border-collapse: collapse; font-size: .92rem; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-weight: 600; color: var(--muted); font-size: .8rem; text-transform: uppercase; letter-spacing: .03em; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }

.suggest { position: relative; }
.suggest ul { position: absolute; z-index: 20; left: 0; right: 0; top: calc(100% + 4px); margin: 0; padding: 4px; list-style: none;
  background: var(--card); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); max-height: 300px; overflow: auto; }
.suggest li { padding: 10px 12px; border-radius: 8px; cursor: pointer; }
.suggest li[aria-selected="true"], .suggest li:hover { background: var(--brand-soft); }
.suggest li small { display: block; color: var(--muted); }

.map { height: 360px; border-radius: var(--radius); border: 1px solid var(--line); z-index: 0; }
.leaflet-container { font: inherit; }

.toast { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: 12px 18px;
  border-radius: 12px; z-index: 1000; max-width: calc(100% - 32px); box-shadow: var(--shadow); }
