/* PhleboHub — phone first. No inline styles (strict CSP). */
:root { --bg: #F7F4FA; --card: #fff; --line: #E4DDEB; --text: #1F1A26; --muted: #6B6475; --ink: #7A2E79; --ink-2: #9B3F9A; --on-ink: #fff; --soft: #F3EAF5;
  --ok: #1F7A47; --ok-bg: #E4F4EA; --warn: #8A5A00; --warn-bg: #FFF1CC; --bad: #A11D1D; --bad-bg: #FDE4E4; --info: #1F4E8A; --info-bg: #E3EEFB; }
@media (prefers-color-scheme: dark) { :root { --bg: #17131C; --card: #221C2A; --line: #3A3144; --text: #EFE9F5; --muted: #A99FB5; --ink: #C77AC4; --ink-2: #D595D2; --on-ink: #1B1622; --soft: #2E2340;
  --ok: #7FD6A2; --ok-bg: #173524; --warn: #F0C766; --warn-bg: #3D3010; --bad: #F29A9A; --bad-bg: #44191B; --info: #9CC3F5; --info-bg: #1B2C44; } }
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, p { margin: 0; }
.boot, .empty { padding: 40px 16px; text-align: center; color: var(--muted); }
.wrap { max-width: 760px; margin: 0 auto; padding: 0 14px 90px; }
.top { position: sticky; top: 0; z-index: 10; background: var(--ink); color: var(--on-ink); padding: 10px 14px; padding-top: calc(10px + env(safe-area-inset-top)); }
.top-in { max-width: 760px; margin: 0 auto; display: flex; align-items: center; gap: 10px; }
.brand { font-weight: 750; font-size: 17px; letter-spacing: -.01em; margin-right: auto; }
.brand small { font-weight: 500; opacity: .8; font-size: 12px; margin-left: 6px; }
.top button { background: rgba(255,255,255,.16); color: inherit; border: 0; border-radius: 999px; padding: 6px 12px; font-size: 13px; cursor: pointer; }
.tabs { display: flex; gap: 6px; overflow-x: auto; padding: 10px 0 2px; }
.tab { flex: none; border: 1px solid var(--line); background: var(--card); border-radius: 999px; padding: 7px 14px; font-size: 13.5px; cursor: pointer; }
.tab.on { background: var(--ink); border-color: var(--ink); color: var(--on-ink); font-weight: 650; }
.bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 12px 0; }
.bar input[type=search], .bar select, .bar input[type=date] { flex: 1 1 140px; min-width: 0; }
input[type=text], input[type=email], input[type=password], input[type=search], input[type=date], input[type=tel], select, textarea {
  width: 100%; padding: 11px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); min-height: 44px; }
input:focus, select:focus, textarea:focus, button:focus-visible { outline: 2px solid var(--ink-2); outline-offset: 1px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 10px 16px; border-radius: 10px; border: 1px solid var(--line); background: var(--card); font-weight: 650; cursor: pointer; }
.btn.ink { background: var(--ink); border-color: var(--ink); color: var(--on-ink); }
.btn.big { width: 100%; min-height: 54px; font-size: 16.5px; }
.btn.danger { color: var(--bad); }
.btn:disabled { opacity: .5; cursor: default; }
.lnk { background: none; border: 0; padding: 0; color: var(--ink); text-decoration: underline; text-underline-offset: 2px; cursor: pointer; font-size: 13px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 14px; margin: 10px 0; }
.card h2 { font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 650; margin-bottom: 10px; }
.bk { display: grid; grid-template-columns: 74px 1fr auto; gap: 10px; align-items: start; width: 100%; text-align: left; cursor: pointer; }
.bk .t { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; font-size: 14px; padding-top: 2px; }
.bk .n { font-weight: 650; font-size: 15.5px; }
.bk .s { display: block; }
.bk .s { color: var(--muted); font-size: 13px; margin-top: 2px; }
.bk.done { opacity: .62; }
.pill { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 700; white-space: nowrap; background: var(--soft); color: var(--ink); }
.pill.ok { background: var(--ok-bg); color: var(--ok); } .pill.warn { background: var(--warn-bg); color: var(--warn); } .pill.bad { background: var(--bad-bg); color: var(--bad); } .pill.info { background: var(--info-bg); color: var(--info); }
.pills { display: flex; gap: 5px; flex-wrap: wrap; justify-content: flex-end; }
.banner { border-radius: 12px; padding: 12px 14px; margin: 10px 0; font-size: 14px; }
.banner.warn { background: var(--warn-bg); color: var(--warn); } .banner.bad { background: var(--bad-bg); color: var(--bad); } .banner.ok { background: var(--ok-bg); color: var(--ok); } .banner.info { background: var(--info-bg); color: var(--info); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.fld { display: grid; gap: 4px; font-size: 12.5px; color: var(--muted); font-weight: 600; margin-bottom: 10px; }
.fld > * { font-weight: 400; color: var(--text); font-size: 15px; }
.seg { display: flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.seg button { flex: 1; min-height: 44px; border: 0; background: var(--card); cursor: pointer; }
.seg button.on { background: var(--ink); color: var(--on-ink); font-weight: 650; }
.line { border-top: 1px solid var(--line); padding: 12px 0; }
.line:first-of-type { border-top: 0; padding-top: 0; }
.line-h { display: flex; gap: 8px; align-items: baseline; justify-content: space-between; }
.line-h b { font-size: 14.5px; }
.line.need > .line-h b::after { content: " · choose"; color: var(--warn); font-weight: 700; }
.opt { display: flex; align-items: center; gap: 10px; padding: 7px 0; cursor: pointer; }
.opt input { width: 22px; height: 22px; flex: none; accent-color: var(--ink); margin: 0; min-height: 0; padding: 0; }
.opt em { font-style: normal; font-size: 11.5px; color: var(--muted); background: var(--soft); padding: 1px 8px; border-radius: 999px; white-space: nowrap; }
.line-a { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 4px; }
.sub { margin: 8px 0 0 10px; padding-left: 10px; border-left: 2px solid var(--line); }
.sub .line { padding: 8px 0; }
.find { position: relative; margin-top: 8px; }
.res { border: 1px solid var(--line); border-radius: 10px; background: var(--card); margin-top: 4px; max-height: 240px; overflow: auto; }
.res button { display: block; width: 100%; text-align: left; border: 0; background: none; padding: 10px 12px; cursor: pointer; border-bottom: 1px solid var(--line); }
.res button:last-child { border-bottom: 0; }
.acc { font: 700 20px/1.2 ui-monospace, Menlo, Consolas, monospace; letter-spacing: .02em; word-break: break-all; }
.barcode { background: #fff; border-radius: 8px; padding: 10px; margin-top: 8px; display: block; width: 100%; max-width: 420px; height: 76px; }
.muted { color: var(--muted); } .small { font-size: 12.5px; }
.sticky { position: fixed; left: 0; right: 0; bottom: 0; background: var(--card); border-top: 1px solid var(--line); padding: 10px 14px calc(10px + env(safe-area-inset-bottom)); z-index: 9; }
.sticky-in { max-width: 760px; margin: 0 auto; }
.login { max-width: 400px; margin: 0 auto; padding: 8vh 18px 40px; }
.login h1 { font-size: 26px; color: var(--ink); letter-spacing: -.02em; margin-bottom: 4px; }
.login .sub1 { color: var(--muted); margin-bottom: 22px; }
.login form { display: grid; gap: 4px; }
.qr { background: #fff; padding: 10px; border-radius: 12px; display: block; margin: 10px auto; width: 200px; height: 200px; image-rendering: pixelated; }
.key { font: 600 15px/1.4 ui-monospace, Menlo, monospace; word-break: break-all; background: var(--soft); padding: 8px 10px; border-radius: 8px; user-select: all; }
.err { color: var(--bad); font-size: 13.5px; min-height: 20px; margin: 4px 0; }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th, td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.scroll { overflow-x: auto; }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.chk { display: inline-flex; gap: 6px; align-items: center; margin: 4px 10px 4px 0; font-size: 14px; }
.chk input { width: 20px; height: 20px; min-height: 0; accent-color: var(--ink); }
#toast { position: fixed; left: 50%; bottom: 96px; transform: translateX(-50%); background: #221A2B; color: #fff; padding: 10px 16px; border-radius: 999px; font-size: 14px; z-index: 50; max-width: 90vw; }
#toast.error { background: var(--bad); color: #fff; }
dialog { border: 0; border-radius: 16px; padding: 18px; max-width: 440px; width: calc(100vw - 32px); background: var(--card); color: var(--text); }
dialog::backdrop { background: rgba(20, 10, 30, .5); }
dialog h3 { font-size: 17px; margin-bottom: 10px; }
.acts { display: flex; gap: 8px; justify-content: flex-end; margin-top: 14px; flex-wrap: wrap; }
@media (max-width: 420px) { .bk { grid-template-columns: 74px 1fr; } .bk .pills { grid-column: 2; justify-content: flex-start; } }
.fld > .lbl { font-weight: 600; color: var(--muted); font-size: 12.5px; }
