/* ASIO CARE — built on the ASIO Design System tokens (blue #12457e, green #96c12b, Hanken Grotesk). Light only. */
@font-face { font-family: 'Hanken Grotesk'; font-style: normal; font-display: swap; font-weight: 100 900;
  src: url(vendor/hanken-grotesk-latin-ext-wght-normal.woff2) format('woff2');
  unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: 'Hanken Grotesk'; font-style: normal; font-display: swap; font-weight: 100 900;
  src: url(vendor/hanken-grotesk-latin-wght-normal.woff2) format('woff2');
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }

:root {
  --blue-900:#0a2a4f; --blue-800:#0d3460; --blue-700:#12457e; --blue-600:#1d568f; --blue-500:#2d6aa6;
  --blue-400:#4f86bc; --blue-300:#84acd3; --blue-200:#b8d0e6; --blue-100:#e1ebf4; --blue-50:#f1f6fb;
  --green-900:#5a7818; --green-800:#6b8d1d; --green-700:#7ba220; --green-600:#88b226; --green-500:#96c12b;
  --green-400:#aacf4f; --green-200:#dcebb3; --green-100:#eef6da; --green-50:#f6faec;
  --neutral-0:#fff; --neutral-25:#fafbfc; --neutral-50:#f4f7f9; --neutral-100:#eaeef2; --neutral-200:#dbe1e7;
  --neutral-300:#c2cbd3; --neutral-400:#97a3ae; --neutral-500:#6c7884; --neutral-600:#4d5862; --neutral-700:#353e46;
  --neutral-800:#232a31; --neutral-900:#141a1f;
  --warning:#e3a017; --warning-soft:#fdf3dc; --danger:#cf3b3b; --danger-soft:#fbeaea;
  --text-strong:var(--neutral-900); --text-body:var(--neutral-800); --text-muted:var(--neutral-500); --text-subtle:var(--neutral-400);
  --surface-page:var(--neutral-25); --surface-card:#fff; --surface-sunken:var(--neutral-50);
  --border-subtle:var(--neutral-200); --border-default:var(--neutral-300);
  --radius-sm:5px; --radius-md:8px; --radius-lg:12px; --radius-pill:999px;
  --shadow-xs:0 1px 2px rgba(20,40,70,.06);
  --shadow-sm:0 1px 3px rgba(20,40,70,.08),0 1px 2px rgba(20,40,70,.04);
  --shadow-md:0 4px 14px rgba(18,69,126,.08),0 2px 4px rgba(20,40,70,.05);
  --shadow-lg:0 12px 32px rgba(18,69,126,.12),0 4px 10px rgba(20,40,70,.06);
  --shadow-focus:0 0 0 3px rgba(79,134,188,.35);
  --ease:cubic-bezier(.4,0,.2,1); --ease-out:cubic-bezier(.16,1,.3,1);
  --font:'Hanken Grotesk',system-ui,-apple-system,'Segoe UI',Roboto,Arial,sans-serif;
  --c1:#12457e; --c2:#7ba220; --c3:#e3a017;
  --side-w:356px; --top-h:60px;
  color-scheme: light;
}
*,*::before,*::after { box-sizing:border-box; }
html,body { height:100%; margin:0; }
body { font-family:var(--font); font-size:16px; line-height:1.55; color:var(--text-body); background:var(--surface-page);
  -webkit-font-smoothing:antialiased; text-rendering:optimizeLegibility; }
button,input { font:inherit; color:inherit; }
button { cursor:pointer; }
[hidden] { display:none !important; }
.num { font-variant-numeric:tabular-nums; }
.eyebrow { font-size:12px; font-weight:700; letter-spacing:.12em; text-transform:uppercase; color:var(--green-700); }
svg.i { width:18px; height:18px; stroke:currentColor; fill:none; stroke-width:2; stroke-linecap:round; stroke-linejoin:round; flex:none; }

/* ------------------------------------------------------------ login */
.login { min-height:100%; display:grid; grid-template-columns:1.1fr .9fr; }
.login-hero { position:relative; overflow:hidden; color:#fff; padding:56px 64px; display:flex; flex-direction:column;
  background:linear-gradient(165deg,var(--blue-800) 0%,var(--blue-700) 50%,var(--blue-600) 100%); }
.login-hero::after { content:''; position:absolute; inset:0; pointer-events:none;
  background:radial-gradient(900px 520px at 90% -10%,rgba(150,193,43,.24),transparent 60%); }
.login-hero > * { position:relative; z-index:1; }
.login-hero .logo-chip { background:#fff; border-radius:var(--radius-md); padding:8px 12px; display:inline-flex; align-self:flex-start; }
.login-hero .logo-chip img { height:34px; display:block; }
.login-hero .eyebrow { color:var(--green-400); margin-top:auto; }
.login-hero h1 { font-size:46px; line-height:1.06; letter-spacing:-.02em; font-weight:800; margin:14px 0 40px; max-width:15ch; }
.login-hero h1 span { color:var(--green-400); }
.login-hero .tagline { font-size:13px; color:rgba(255,255,255,.6); }
.login-pane { display:flex; align-items:center; justify-content:center; padding:40px 24px; background:var(--surface-page); }
.card { background:var(--surface-card); border:1px solid var(--border-subtle); border-radius:var(--radius-lg); box-shadow:var(--shadow-sm); }
.login-card { width:100%; max-width:400px; padding:36px 32px; box-shadow:var(--shadow-lg); }
.login-card h2 { font-size:28px; line-height:1.15; letter-spacing:-.02em; color:var(--text-strong); margin:6px 0 6px; font-weight:800; }
.login-card .lead { color:var(--text-muted); font-size:15px; margin:0 0 24px; }
.field { display:flex; flex-direction:column; gap:6px; margin-bottom:16px; }
.field label { font-size:14px; font-weight:600; color:var(--text-strong); }
.input { height:46px; width:100%; padding:0 14px; border:1px solid var(--border-default); border-radius:var(--radius-md);
  background:#fff; outline:none; transition:border-color .2s var(--ease),box-shadow .2s var(--ease); }
.input:focus { border-color:var(--blue-400); box-shadow:var(--shadow-focus); }
.input.code { font-size:26px; letter-spacing:.4em; text-align:center; font-weight:700; height:58px; font-variant-numeric:tabular-nums; }
.btn { display:inline-flex; align-items:center; justify-content:center; gap:8px; height:44px; padding:0 20px; font-weight:700;
  font-size:15px; letter-spacing:.01em; border-radius:var(--radius-md); border:1px solid transparent;
  transition:background .2s var(--ease),border-color .2s var(--ease),color .2s var(--ease),transform .12s var(--ease); }
.btn:active { transform:translateY(1px); }
.btn:focus-visible { outline:none; box-shadow:var(--shadow-focus); }
.btn-primary { background:var(--green-500); border-color:var(--green-500); color:var(--neutral-900); width:100%; height:48px; }
.btn-primary:hover { background:var(--green-700); border-color:var(--green-700); }
.btn-primary:disabled { opacity:.6; cursor:wait; }
.btn-ghost { background:transparent; color:var(--blue-700); height:36px; padding:0 12px; }
.btn-ghost:hover { background:var(--blue-50); }
.btn-outline { background:#fff; color:var(--blue-700); border-color:var(--border-default); height:36px; padding:0 14px; font-size:14px; }
.btn-outline:hover { border-color:var(--blue-700); }
.link-btn { background:none; border:0; padding:0; color:var(--blue-700); font-weight:600; font-size:14px; margin-top:16px; }
.link-btn:hover { color:var(--blue-800); text-decoration:underline; }
.msg { border-radius:var(--radius-md); padding:10px 14px; font-size:14px; margin-bottom:16px; }
.msg.err { background:var(--danger-soft); color:#8f2222; }
.qr { display:flex; justify-content:center; padding:12px; border:1px solid var(--border-subtle); border-radius:var(--radius-md); margin-bottom:12px; background:#fff; }
.qr svg { width:200px; height:200px; }
.secret { font-family:ui-monospace,Menlo,Consolas,monospace; font-size:13px; background:var(--surface-sunken); border-radius:var(--radius-sm);
  padding:8px 10px; word-break:break-all; color:var(--text-body); margin-bottom:16px; text-align:center; }
.steps { padding-left:20px; margin:0 0 18px; color:var(--text-body); font-size:14px; }
.steps li { margin-bottom:4px; }
.legal { font-size:12px; color:var(--text-subtle); margin-top:28px; text-align:center; }

/* ------------------------------------------------------------ app chrome */
.app { height:100%; display:grid; grid-template-rows:var(--top-h) 1fr; }
.top { display:flex; align-items:center; gap:16px; padding:0 20px; background:#fff; border-bottom:1px solid var(--border-subtle); z-index:20; }
.top .brand { display:flex; align-items:center; gap:12px; }
.top .brand img { height:30px; display:block; }
.top .brand .sep { width:1px; height:28px; background:var(--border-subtle); }
.top .product { font-weight:800; color:var(--blue-700); letter-spacing:-.01em; font-size:17px; }
.top .product small { display:block; font-size:11px; font-weight:700; letter-spacing:.12em; color:var(--green-700); text-transform:uppercase; line-height:1; }
.top .site { font-weight:600; color:var(--text-strong); font-size:15px; padding-left:16px; border-left:1px solid var(--border-subtle); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.top .site { min-width:0; flex:0 1 auto; }
.top .spacer { flex:1; }
.live { display:inline-flex; align-items:center; gap:8px; font-size:13px; font-weight:600; color:var(--green-900);
  background:var(--green-50); border:1px solid var(--green-200); padding:4px 10px; border-radius:var(--radius-pill); white-space:nowrap; }
.live i { width:8px; height:8px; border-radius:50%; background:var(--green-500); box-shadow:0 0 0 0 rgba(150,193,43,.6); animation:pulse 2s infinite; }
.live.stale { color:#8a5d00; background:var(--warning-soft); border-color:#f3d792; }
.live.stale i { background:var(--warning); animation:none; }
@keyframes pulse { 0% { box-shadow:0 0 0 0 rgba(150,193,43,.55); } 70% { box-shadow:0 0 0 7px rgba(150,193,43,0); } 100% { box-shadow:0 0 0 0 rgba(150,193,43,0); } }
.user { display:flex; align-items:center; gap:10px; font-size:14px; color:var(--text-muted); }
.avatar { width:32px; height:32px; border-radius:50%; background:var(--blue-100); color:var(--blue-700); display:grid; place-items:center; font-weight:800; font-size:13px; }
.menu-btn { display:none; }

.body { display:grid; grid-template-columns:var(--side-w) minmax(0,1fr); min-height:0; min-width:0; }

/* ------------------------------------------------------------ sensor list */
.side { background:#fff; border-right:1px solid var(--border-subtle); display:flex; flex-direction:column; min-height:0; }
.side-head { padding:16px 16px 10px; }
.gmode { display:flex; width:100%; margin-bottom:10px; }
.gmode[hidden] { display:none; }
.gmode button { flex:1; }
.search { position:relative; }
.search svg { position:absolute; left:12px; top:50%; transform:translateY(-50%); color:var(--text-subtle); width:17px; height:17px; }
.search .input { height:40px; padding-left:38px; font-size:14px; background:var(--surface-sunken); border-color:transparent; }
.search .input:focus { background:#fff; }
.search kbd { position:absolute; right:10px; top:50%; transform:translateY(-50%); font:600 11px var(--font); color:var(--text-subtle);
  border:1px solid var(--border-subtle); border-radius:4px; padding:1px 6px; background:#fff; }
.chips { display:flex; flex-wrap:wrap; gap:6px; padding:10px 16px 8px; }   /* wraps: every group visible, no hidden scroll */
.chip { flex:none; height:28px; padding:0 11px; border-radius:var(--radius-pill); border:1px solid var(--border-subtle); background:#fff;
  font-size:13px; font-weight:600; color:var(--text-muted); transition:all .15s var(--ease); }
.chip:hover { border-color:var(--blue-300); color:var(--blue-700); }
.chip.on { background:var(--blue-700); border-color:var(--blue-700); color:#fff; }
.list { overflow-y:auto; flex:1; padding:0 8px 16px; }
.grp { font-size:11px; font-weight:700; letter-spacing:.12em; text-transform:uppercase; color:var(--text-subtle);
  padding:14px 10px 6px; position:sticky; top:0; background:#fff; z-index:1; display:flex; justify-content:space-between; }
.row { display:grid; grid-template-columns:1fr auto; grid-template-rows:auto auto; column-gap:10px; align-items:center; width:100%; text-align:left;
  border:0; background:transparent; border-radius:var(--radius-md); padding:9px 10px; transition:background .12s var(--ease); }
.row:hover { background:var(--surface-sunken); }
.row.sel { background:var(--blue-50); }
.row.sel .r-name { color:var(--blue-700); }
.row.cmp { background:var(--neutral-50); }
.row:focus-visible { outline:none; box-shadow:inset var(--shadow-focus); }
.r-name { font-weight:600; font-size:14px; color:var(--text-strong); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.r-meta { font-size:12px; color:var(--text-muted); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; grid-column:1; }
.r-val { font-weight:700; font-size:15px; color:var(--text-strong); text-align:right; white-space:nowrap; font-variant-numeric:tabular-nums; }
.r-val small { font-weight:500; font-size:12px; color:var(--text-muted); margin-left:3px; }
.r-spark { grid-column:2; grid-row:2; justify-self:end; width:72px; height:20px; }
.r-spark path { fill:none; stroke:var(--blue-400); stroke-width:1.5; stroke-linejoin:round; stroke-linecap:round; }
.row.sel .r-spark path { stroke:var(--blue-700); }
.dot { display:inline-block; width:8px; height:8px; border-radius:50%; margin-right:6px; vertical-align:1px; }
.row.off .r-name { color:var(--text-muted); font-weight:500; }
.row.off .r-val { color:var(--text-subtle); font-weight:500; }
.badge-off { font-size:11px; font-weight:600; color:var(--text-muted); background:var(--neutral-100); border-radius:var(--radius-pill); padding:1px 8px; grid-column:2; grid-row:2; justify-self:end; }
.empty { padding:24px 12px; color:var(--text-muted); font-size:14px; text-align:center; }

/* ------------------------------------------------------------ main */
.main { min-width:0; min-height:0; overflow-y:auto; padding:24px 28px 32px; display:flex; flex-direction:column; gap:18px; }
.head { display:flex; gap:24px; align-items:flex-end; flex-wrap:wrap; }
.head-l { min-width:0; flex:1 1 360px; }
.head-r { min-width:0; }
.head h1 { font-size:30px; line-height:1.12; letter-spacing:-.02em; font-weight:800; color:var(--text-strong); margin:4px 0 2px;
  display:flex; align-items:center; gap:12px; flex-wrap:wrap; }
.code-tag { font-size:13px; font-weight:700; color:var(--blue-700); background:var(--blue-50); border:1px solid var(--blue-100);
  border-radius:var(--radius-sm); padding:2px 8px; letter-spacing:.02em; }
.price { display:flex; align-items:baseline; gap:14px; margin-top:10px; flex-wrap:wrap; }
.price .big { font-size:46px; line-height:1; font-weight:800; letter-spacing:-.03em; color:var(--text-strong); font-variant-numeric:tabular-nums; }
.price .big small { font-size:20px; font-weight:600; color:var(--text-muted); letter-spacing:0; margin-left:6px; }
.chg { font-size:15px; font-weight:700; border-radius:var(--radius-pill); padding:3px 10px; font-variant-numeric:tabular-nums; }
.chg.up { color:var(--green-900); background:var(--green-100); }
.chg.down { color:#9a2a2a; background:var(--danger-soft); }
.chg.flat { color:var(--text-muted); background:var(--neutral-100); }
.chg-label { font-size:14px; color:var(--text-muted); }
.asof { font-size:13px; color:var(--text-muted); }
.head-r { display:flex; flex-direction:column; align-items:flex-end; gap:10px; }
.seg { display:inline-flex; background:var(--neutral-100); border-radius:var(--radius-md); padding:3px; gap:2px; }
.seg button { border:0; background:transparent; height:32px; min-width:44px; padding:0 10px; border-radius:6px; font-weight:700; font-size:13px;
  color:var(--text-muted); transition:all .15s var(--ease); }
.seg button:hover { color:var(--text-strong); }
.seg button.on { background:#fff; color:var(--blue-700); box-shadow:var(--shadow-xs); }
.cmp-bar { display:flex; gap:8px; flex-wrap:wrap; justify-content:flex-end; align-items:center; }
.cmp-chip { display:inline-flex; align-items:center; gap:6px; height:30px; padding:0 6px 0 10px; border:1px solid var(--border-subtle);
  border-radius:var(--radius-pill); background:#fff; font-size:13px; font-weight:600; }
.cmp-chip button { border:0; background:transparent; width:22px; height:22px; border-radius:50%; display:grid; place-items:center; color:var(--text-muted); }
.cmp-chip button:hover { background:var(--neutral-100); color:var(--text-strong); }
.cmp-chip svg { width:14px; height:14px; }

.chart-card { position:relative; flex:1 1 auto; min-height:380px; padding:8px 8px 4px; display:flex; flex-direction:column; }
.chart { position:relative; flex:1; min-height:340px; }
.chart-foot { display:flex; justify-content:space-between; gap:12px; flex-wrap:wrap; font-size:12px; color:var(--text-subtle); padding:4px 10px 4px; }
.chart-foot a { color:inherit; text-decoration:none; }
.chart-foot a:hover { color:var(--blue-700); text-decoration:underline; }
.head h1 .loc { font-weight:600; color:var(--text-muted); font-size:.62em; letter-spacing:0; margin-left:2px; }
.tip { position:absolute; z-index:5; pointer-events:none; background:#fff; border:1px solid var(--border-subtle); border-radius:var(--radius-md);
  box-shadow:var(--shadow-md); padding:8px 12px; font-size:13px; min-width:150px; }
.tip .t { color:var(--text-muted); font-size:12px; margin-bottom:4px; font-variant-numeric:tabular-nums; }
.tip .v { display:flex; justify-content:space-between; gap:14px; font-weight:700; color:var(--text-strong); font-variant-numeric:tabular-nums; }
.tip .v span:first-child { font-weight:500; color:var(--text-body); }
.tip .mm { color:var(--text-muted); font-size:12px; font-variant-numeric:tabular-nums; }
.loading { position:absolute; top:14px; left:50%; transform:translateX(-50%); font-size:12px; font-weight:600; color:var(--blue-700);
  background:var(--blue-50); border-radius:var(--radius-pill); padding:3px 12px; z-index:4; }
.nodata { position:absolute; inset:0; display:grid; place-items:center; color:var(--text-muted); font-size:15px; z-index:3; pointer-events:none; }

.stats { display:grid; grid-template-columns:repeat(4,1fr); gap:14px; }
.stat { padding:14px 16px; }
.stat .k { font-size:12px; font-weight:700; letter-spacing:.08em; text-transform:uppercase; color:var(--text-subtle); }
.stat .v { font-size:22px; font-weight:800; color:var(--text-strong); letter-spacing:-.01em; font-variant-numeric:tabular-nums; margin-top:2px; }
.stat .v small { font-size:13px; font-weight:600; color:var(--text-muted); margin-left:4px; }
.stat .s { font-size:12px; color:var(--text-muted); font-variant-numeric:tabular-nums; }
.hint { font-size:12px; color:var(--text-subtle); text-align:center; }
.hint kbd { font:600 11px var(--font); border:1px solid var(--border-subtle); border-radius:4px; padding:0 5px; background:#fff; color:var(--text-muted); }

.picker { position:absolute; right:0; top:calc(100% + 6px); width:340px; max-height:420px; overflow-y:auto; z-index:30; padding:8px; box-shadow:var(--shadow-lg); }
.picker .input { height:38px; font-size:14px; margin-bottom:6px; }
.rel { position:relative; }
.scrim { display:none; }

/* ------------------------------------------------------------ messages, rules */
.msg.ok { background:var(--green-50); color:var(--green-900); border:1px solid var(--green-200); }
.msg.warn { background:var(--warning-soft); color:#7a5200; border:1px solid #f3d792; }
.rules { list-style:none; padding:0; margin:-4px 0 18px; font-size:13px; color:var(--text-muted); }
.rules li { display:flex; align-items:center; gap:8px; margin-bottom:3px; }
.rules li::before { content:''; width:14px; height:14px; border-radius:50%; border:1.5px solid var(--border-default); flex:none; }
.rules li.ok { color:var(--green-900); }
.rules li.ok::before { background:var(--green-500); border-color:var(--green-500);
  box-shadow:inset 0 0 0 3px #fff; }
.field label .opt { font-weight:500; color:var(--text-muted); }
.help { font-size:12px; color:var(--text-muted); }
.btn-auto { width:auto; }
select.input { appearance:none; padding-right:36px; cursor:pointer;
  background:#fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%236c7884' stroke-width='2'/%3E%3C/svg%3E") no-repeat right 14px center; }

/* ------------------------------------------------------------ header: views, back, gear */
.app:not([data-view="site"]):not([data-view="schema"]) .site-only { display:none !important; }
.app[data-view="schema"] .menu-btn { display:none !important; }
.app[data-view="overview"] .not-overview { display:none !important; }
.top a.brand { text-decoration:none; color:inherit; border-radius:var(--radius-md); }
.top a.brand:focus-visible { outline:none; box-shadow:var(--shadow-focus); }
.back { display:inline-flex; align-items:center; gap:4px; height:34px; padding:0 12px 0 8px; border-radius:var(--radius-pill);
  font-size:14px; font-weight:700; color:var(--blue-700); text-decoration:none; background:var(--blue-50); white-space:nowrap; }
.back:hover { background:var(--blue-100); }
.back svg { width:16px; height:16px; }
.gear { width:38px; height:38px; border-radius:50%; border:1px solid var(--border-subtle); background:#fff; color:var(--blue-700);
  display:grid; place-items:center; transition:all .15s var(--ease); }
.gear:hover, .gear[aria-expanded="true"] { background:var(--blue-50); border-color:var(--blue-200); }
.gear:focus-visible { outline:none; box-shadow:var(--shadow-focus); }
.gear svg { transition:transform .3s var(--ease-out); }
.gear[aria-expanded="true"] svg { transform:rotate(45deg); }
.pop { position:absolute; z-index:50; padding:6px; box-shadow:var(--shadow-lg); min-width:230px; }
.gear-menu { right:0; top:calc(100% + 8px); }
.pop-head { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:8px 10px 10px; margin-bottom:4px;
  border-bottom:1px solid var(--border-subtle); font-size:14px; color:var(--text-strong); }
.pop-item { display:flex; align-items:center; gap:10px; width:100%; padding:9px 10px; border:0; background:transparent; border-radius:var(--radius-sm);
  font-size:14px; font-weight:600; color:var(--text-body); text-decoration:none; text-align:left; white-space:nowrap; }
.pop-item:hover, .pop-item:focus-visible { background:var(--surface-sunken); color:var(--blue-700); outline:none; }
.pop-item svg { width:16px; height:16px; color:var(--text-muted); }
.pop-foot { margin-top:4px; padding:8px 10px 4px; border-top:1px solid var(--border-subtle); font-size:11px; color:var(--text-subtle); }
.pop-foot a { color:inherit; }
.pop-foot a:hover { color:var(--blue-700); }
.pop-item.danger { color:#9a2a2a; }
.pop-item.danger:hover { background:var(--danger-soft); color:#8f2222; }
.role-badge { font-size:11px; font-weight:700; letter-spacing:.06em; text-transform:uppercase; padding:2px 8px; border-radius:var(--radius-pill);
  background:var(--neutral-100); color:var(--text-muted); white-space:nowrap; }
.role-badge.admin, .pop-head .role-badge { background:var(--blue-50); color:var(--blue-700); }

/* ------------------------------------------------------------ pages (overview, users) */
.page { min-height:0; overflow-y:auto; padding:32px 32px 48px; }
.page > * { max-width:1240px; margin-left:auto; margin-right:auto; }
.page-head { display:flex; align-items:flex-end; justify-content:space-between; gap:20px; flex-wrap:wrap; margin-bottom:24px; }
.page-head h1 { font-size:32px; line-height:1.1; letter-spacing:-.02em; font-weight:800; color:var(--text-strong); margin:4px 0 6px; }
.page-head .lead { margin:0; color:var(--text-muted); font-size:15px; max-width:70ch; }
.ov-group { font-size:12px; font-weight:700; letter-spacing:.12em; text-transform:uppercase; color:var(--text-subtle); margin:28px auto 10px; }
.ov-group:first-child { margin-top:0; }
.ov-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(min(100%,400px),1fr)); gap:18px; }
.site-card { display:flex; flex-direction:column; gap:18px; padding:22px 22px 16px; text-decoration:none; color:inherit;
  transition:box-shadow .2s var(--ease),transform .2s var(--ease),border-color .2s var(--ease); }
.site-card:hover { box-shadow:var(--shadow-lg); transform:translateY(-2px); border-color:var(--blue-200); }
.site-card:focus-visible { outline:none; box-shadow:var(--shadow-focus),var(--shadow-md); }
.sc-head { display:flex; justify-content:space-between; align-items:flex-start; gap:12px; }
.sc-title { min-width:0; }
.sc-title h2 { font-size:21px; line-height:1.2; letter-spacing:-.01em; font-weight:800; color:var(--text-strong); margin:2px 0 0; }
.sc-head .live { flex:none; }
.sc-tiles { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; }
.tile { background:var(--surface-sunken); border-radius:var(--radius-md); padding:12px 14px 8px; min-width:0; }
.t-name { font-size:13px; font-weight:700; color:var(--text-strong); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.t-loc { font-size:12px; color:var(--text-muted); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.t-val { font-size:26px; font-weight:800; letter-spacing:-.02em; color:var(--text-strong); margin-top:4px; line-height:1.15; white-space:nowrap; }
.t-val small { font-size:13px; font-weight:600; color:var(--text-muted); margin-left:4px; letter-spacing:0; }
.t-spark { display:block; width:100%; height:28px; margin-top:4px; }
.t-spark path { fill:none; stroke:var(--blue-400); stroke-width:1.6; stroke-linejoin:round; stroke-linecap:round; vector-effect:non-scaling-stroke; }
.sc-tiles .empty { grid-column:1 / -1; }
.sc-foot { display:flex; justify-content:space-between; align-items:center; gap:12px; font-size:13px; color:var(--text-muted);
  border-top:1px solid var(--border-subtle); padding-top:12px; }
.sc-off { color:#8a5d00; font-weight:600; }
.sc-open { display:inline-flex; align-items:center; gap:2px; font-weight:700; color:var(--blue-700); }
.sc-open svg { width:16px; height:16px; transition:transform .2s var(--ease); }
.site-card:hover .sc-open svg { transform:translateX(3px); }

.table-card { overflow-x:auto; }
.utable { width:100%; border-collapse:collapse; font-size:14px; }
.utable th { text-align:left; font-size:11px; font-weight:700; letter-spacing:.1em; text-transform:uppercase; color:var(--text-subtle);
  padding:14px 16px 10px; border-bottom:1px solid var(--border-subtle); white-space:nowrap; }
.utable td { padding:12px 16px; border-bottom:1px solid var(--border-subtle); vertical-align:middle; color:var(--text-body); }
.utable tr:last-child td { border-bottom:0; }
.utable tbody tr:hover { background:var(--neutral-25); }
.u-who b { display:block; color:var(--text-strong); }
.u-who small, .u-sub { display:block; font-size:12px; color:var(--text-muted); }
.u-mail { word-break:break-all; }
.u-act { text-align:right; width:52px; }
.dots { width:36px; padding:0; }
.state { display:inline-block; font-size:12px; font-weight:700; padding:2px 10px; border-radius:var(--radius-pill); white-space:nowrap; }
.state.green { background:var(--green-100); color:var(--green-900); }
.state.blue { background:var(--blue-50); color:var(--blue-700); }
.state.warn { background:var(--warning-soft); color:#7a5200; }
.state.grey { background:var(--neutral-100); color:var(--text-muted); }
.row-menu { position:fixed; }

.dlg { width:min(480px, calc(100vw - 32px)); max-height:calc(100vh - 32px); overflow-y:auto; padding:28px; border:0; box-shadow:var(--shadow-lg); color:var(--text-body); }
.dlg::backdrop { background:rgba(10,42,79,.35); }
.dlg h2 { font-size:24px; letter-spacing:-.02em; font-weight:800; color:var(--text-strong); margin:4px 0 18px; }
.dlg .lead { color:var(--text-muted); font-size:15px; margin:-8px 0 18px; }
.dlg-actions { display:flex; justify-content:flex-end; gap:10px; margin-top:8px; }
.dlg-actions .btn { height:44px; }
.copy-row { display:flex; gap:8px; }
.copy-row .input { font-size:13px; font-family:ui-monospace,Menlo,Consolas,monospace; }
.copy-row .btn { height:46px; flex:none; }

/* ------------------------------------------------------------ responsive */
@media (max-width: 1100px) { .stats { grid-template-columns:repeat(2,1fr); } }
@media (max-width: 900px) {
  :root { --top-h:56px; }
  .login { grid-template-columns:1fr; }
  .login-hero { padding:32px 24px 36px; }
  .login-hero h1 { font-size:32px; margin-top:28px; margin-bottom:0; }
  .login-hero .tagline { display:none; }
  .body { grid-template-columns:minmax(0,1fr); }
  .app { width:100vw; overflow-x:hidden; }
  .head-l { flex-basis:100%; }
  .top .brand img { height:24px; }
  .avatar { display:none; }
  .foot-help { display:none; }
  .price { gap:8px 10px; }
  .price .big small { font-size:16px; }
  .chg { font-size:13px; }
  .side { position:fixed; top:var(--top-h); bottom:0; left:0; width:min(92vw,380px); z-index:40; transform:translateX(-100%);
    transition:transform .25s var(--ease-out); box-shadow:var(--shadow-lg); }
  .side.open { transform:none; }
  .scrim { display:block; position:fixed; inset:var(--top-h) 0 0 0; background:rgba(10,42,79,.25); z-index:35; opacity:0; pointer-events:none; transition:opacity .2s; }
  .scrim.open { opacity:1; pointer-events:auto; }
  .menu-btn { display:inline-flex; }
  .top { padding:0 12px; gap:10px; }
  .top .brand .sep, .top .product, .user .name { display:none; }
  .top .site { border-left:0; padding-left:0; font-size:14px; }
  .main { padding:16px 14px 24px; }
  .head h1 { font-size:24px; }
  .price .big { font-size:38px; }
  .head-r { align-items:stretch; width:100%; }
  .seg { width:100%; overflow-x:auto; }
  .seg button { flex:1; min-width:0; padding:0 2px; }
  .cmp-bar { justify-content:flex-start; }
  .picker { left:0; right:auto; width:min(340px, calc(100vw - 28px)); }
  .chart-card { min-height:0; flex:none; }
  .chart { min-height:0; height:330px; flex:none; }
  .hint { display:none; }
}
@media (max-width: 900px) {
  .page { padding:20px 16px 32px; }
  .page-head h1 { font-size:26px; }
  .back span { display:none; }
  .back { padding:0 8px; }
  .utable thead { display:none; }
  .utable, .utable tbody, .utable tr, .utable td { display:block; width:auto; }
  .utable tr { position:relative; padding:12px 16px; border-bottom:1px solid var(--border-subtle); }
  .utable td { border:0; padding:3px 0; }
  .utable td[data-k]::before { content:attr(data-k) ": "; font-size:12px; color:var(--text-subtle); }
  .u-act { position:absolute; top:10px; right:10px; width:auto; }
}
@media (max-width: 520px) {
  .live span { display:none; } .live { padding:6px; }
  .sc-head .live span { display:inline; }
  .sc-head { flex-direction:column; }
  .t-val { font-size:22px; }
  .tile { padding:10px 12px 6px; }
}

/* A bit tag in a bad state (pump failure, alarm, power loss): colour only on deviation. */
.row.bad .r-val, .row.bad .val { color:var(--danger); font-weight:600; }
.row.bad { box-shadow:inset 3px 0 0 var(--danger); }
.sc-bad { color:var(--danger); font-weight:600; }

/* ------------------------------------------------------------ view tabs (Grafy | Schéma) */
.vtabs { display:inline-flex; background:var(--neutral-100); border-radius:var(--radius-md); padding:3px; gap:2px; flex:none; }
.vtabs[hidden] { display:none !important; }
.vtabs a { display:inline-flex; align-items:center; height:30px; padding:0 14px; border-radius:6px; font-weight:700; font-size:14px;
  color:var(--text-muted); text-decoration:none; }
.vtabs a:hover { color:var(--text-strong); }
.vtabs a.on { background:#fff; color:var(--blue-700); box-shadow:var(--shadow-xs); }
.vtabs a:focus-visible { outline:none; box-shadow:var(--shadow-focus); }

/* ------------------------------------------------------------ plant scheme */
.sch-stage { position:absolute; left:0; top:0; transform-origin:0 0; }
.sch-pic, .sch-pic svg, .sch-lines { position:absolute; left:0; top:0; display:block; }
.sch-lines { pointer-events:none; }
/* weather layer over the picture, under lines and labels */
#sch-stage { --fx-w:1200px; --fx-tint:#fff; --fx-tint-op:0; --fx-dark:0; --fx-sun:0; --fx-c1:#fff; --fx-c2:#fff; }   /* set by renderFx */
.sch-fx { position:absolute; left:0; top:0; pointer-events:none; overflow:hidden; }
.sch-fx > * { position:absolute; inset:0; width:100%; height:100%; }
.fx-sky { background:var(--fx-tint); mix-blend-mode:multiply; opacity:var(--fx-tint-op); transition:opacity 2s, background-color 2s; }
.fx-night { background:#1a2a55; mix-blend-mode:multiply; opacity:calc(var(--fx-dark) * .6); transition:opacity 2s; }
.fx-veil { background:#fff; opacity:0; transition:opacity 2s; }
.sch-fx[data-kind="snow"] .fx-veil { opacity:calc(.22 * (1 - var(--fx-dark))); }
.fx-sun { background:radial-gradient(circle at 94% -4%, rgba(255,214,120,.55), rgba(255,214,120,0) 42%); opacity:var(--fx-sun); transition:opacity 2s; }
.sch-fx > .fx-lamps { inset:auto; mix-blend-mode:screen; opacity:var(--fx-dark); transition:opacity 2s; }
/* flat illustrated clouds (same style as the drawing): lighter on top, shaded underneath */
/* behind the drawing (the picture is transparent around the plant): clouds pass behind it, in the sky */
.fx-clouds { position:absolute; left:0; top:0; pointer-events:none; opacity:calc(.96 - var(--fx-dark) * .5); transition:opacity 2s; }
.fx-clouds .c1 { stop-color:var(--fx-c1); } .fx-clouds .c2 { stop-color:var(--fx-c2); }
.fx-clouds .cl { animation:fx-cloud linear infinite; }
@keyframes fx-cloud { from { transform:translateX(-300px); } to { transform:translateX(var(--fx-w)); } }
.fx-fog { opacity:0; transition:opacity 2s; }
.sch-fx[data-kind="fog"] .fx-fog { opacity:calc(1 - var(--fx-dark) * .4); }
.fx-fog i { position:absolute; left:-25%; width:150%; height:24%; border-radius:50%;
  background:radial-gradient(closest-side, rgba(238,241,244,.95), rgba(238,241,244,0)); animation:fx-fog 30s ease-in-out infinite alternate; }
.fx-fog i:nth-child(1) { top:22%; } .fx-fog i:nth-child(2) { top:46%; animation-duration:38s; animation-direction:alternate-reverse; }
.fx-fog i:nth-child(3) { top:68%; animation-duration:24s; }
@keyframes fx-fog { from { transform:translateX(-6%); } to { transform:translateX(6%); } }
.fx-flash { background:#eef3ff; opacity:0; }
@media (prefers-reduced-motion: reduce) { .fx-clouds .cl, .fx-fog i { animation:none; } }
.sch-lines path { stroke:var(--neutral-400); stroke-width:1.5; fill:none; }
.sch-lines circle { fill:var(--blue-700); stroke:#fff; stroke-width:2; }
.sch-lines circle.bad { fill:var(--danger); }
.sch-chip { position:absolute; min-width:150px; text-align:left; background:#fff; border:1px solid var(--border-subtle); border-radius:10px;
  box-shadow:0 6px 18px rgba(18,69,126,.12),0 1px 3px rgba(20,40,70,.06); padding:8px 12px; white-space:nowrap; cursor:pointer;
  transition:border-color .15s var(--ease),box-shadow .15s var(--ease); color:var(--text-body); }
.sch-chip:hover { border-color:var(--neutral-400); }
.sch-chip:focus-visible { outline:3px solid rgba(79,134,188,.55); outline-offset:2px; }
.sch-chip.sel { border-color:var(--blue-700); box-shadow:0 0 0 3px rgba(18,69,126,.16),0 6px 18px rgba(18,69,126,.12); }
.sch-chip.bad { border-color:var(--danger); }
.sch-chip .ck { display:block; font-size:12px; font-weight:700; letter-spacing:.06em; text-transform:uppercase; color:var(--text-muted); margin-bottom:2px; }
.sch-chip .cr { display:flex; justify-content:space-between; align-items:baseline; gap:14px; font-size:13px; line-height:1.5; }
.sch-chip .cv { font-weight:800; color:var(--text-strong); font-size:15px; font-variant-numeric:tabular-nums; }
.sch-chip .cv small { font-size:11px; font-weight:600; color:var(--text-muted); margin-left:3px; }
.sch-chip .cv.off { color:var(--text-subtle); font-weight:600; font-size:13px; }
.sch-chip .cv.bad { color:var(--danger); }
.sch-big.bad { color:var(--danger); }
.sch-pills button { height:30px; padding:0 11px; border-radius:var(--radius-pill); border:1px solid var(--border-subtle); background:#fff;
  font-size:13px; font-weight:600; color:var(--text-muted); }
.sch-pills button.on { background:var(--blue-700); border-color:var(--blue-700); color:#fff; }
.sch-pills button.bad:not(.on) { border-color:var(--danger); color:var(--danger); }
.sch-wrap.compact .sch-pills { display:flex; }
.sch-wrap.compact .sch-chip { display:none; }
@media (max-width: 1100px) {
}
@media (max-width: 900px) {
  .vtabs a { padding:0 10px; font-size:13px; }
  .sch-card { padding:8px; }
}
@media (max-width: 520px) { .top:has(.vtabs:not([hidden])) .site { display:none; } }

/* Moving parts of the scheme: only while the PLC says they run (class "on" set from live values). */
.sch-pic .flow { stroke-dasharray:5 11; }
.sch-pic .flow-slow { stroke-dasharray:4 12; }
.sch-pic .bub { opacity:0; transform-box:fill-box; }
.sch-pic .on .flow { animation:sch-flow 1.4s linear infinite; }
.sch-pic .on .flow-slow { animation:sch-flow 2.6s linear infinite; }
.sch-pic .on .swirl { animation:sch-swirl 3s linear infinite; }
.sch-pic .on .bub { animation:sch-rise 2.2s ease-in infinite; }
.sch-pic .on .d1 { animation-delay:.3s; } .sch-pic .on .d2 { animation-delay:.7s; } .sch-pic .on .d3 { animation-delay:1.1s; }
.sch-pic .on .d4 { animation-delay:1.5s; } .sch-pic .on .d5 { animation-delay:1.9s; }
@keyframes sch-flow { to { stroke-dashoffset:-32; } }
@keyframes sch-swirl { to { stroke-dashoffset:-48; } }
@keyframes sch-rise { 0% { transform:translateY(0); opacity:0; } 25% { opacity:.95; } 100% { transform:translateY(-12px); opacity:0; } }
@media (prefers-reduced-motion: reduce) {
  .sch-pic .on .flow, .sch-pic .on .flow-slow, .sch-pic .on .swirl { animation:none; }
  .sch-pic .on .bub { animation:none; opacity:.8; }
}

/* Overview card: the plant model instead of value tiles */
.sc-model { display:block; width:100%; aspect-ratio:16/9; object-fit:cover; object-position:50% 55%; border-radius:var(--radius-md);
  background:var(--neutral-25); border:1px solid var(--neutral-100); }

/* a value that just changed */
.sch-chip .cv.tick, .sch-big.tick { animation:sch-tick 1.2s var(--ease-out); }
@keyframes sch-tick { 0% { background:var(--green-100); box-shadow:0 0 0 3px var(--green-100); } 100% { background:transparent; box-shadow:0 0 0 3px transparent; } }
.sch-chip .cv, .sch-big { border-radius:4px; }
@media (prefers-reduced-motion: reduce) { .sch-chip .cv.tick, .sch-big.tick { animation:none; } }

/* Inflow vs outflow against the permit: outflow green (24 h average ≤ p) or red (> p); grey = not enough data */

/* ------------------------------------------------------------ scheme page layout: one screen on desktop */
.schema-page { padding:20px 24px; }
.schema-page > * { max-width:none; }
.sch-wrap { display:grid; grid-template-columns:minmax(0,1fr) 380px; gap:20px; height:max(600px,100%); }
/* the card clips everything inside it (the picture, its labels and the weather layer, which spans the whole card) */
.sch-card { position:relative; overflow:hidden; min-width:0; min-height:0; padding:14px 14px 10px; background:var(--neutral-25); display:flex; flex-direction:column; align-items:center; }
.sch-fit { position:relative; flex:none; margin:auto 0; }
.sch-note { position:relative; z-index:1; flex:none; margin:8px 0 0; font-size:12px; color:var(--text-subtle); text-align:center; transition:color 2s; }
.sch-card.night .sch-note { color:#c9d3de; }
.sch-side { display:flex; flex-direction:column; gap:16px; min-width:0; min-height:0; }
.sp-head { display:flex; align-items:center; justify-content:space-between; gap:12px; }
.sp-link { display:inline-flex; align-items:center; gap:2px; font-size:13px; font-weight:700; color:var(--blue-700); text-decoration:none;
  padding:4px 6px 4px 10px; border-radius:var(--radius-pill); background:var(--blue-50); }
.sp-link:hover { background:var(--blue-100); }
.sp-link svg { width:14px; height:14px; }

/* selected object: compact, its list scrolls inside */
.sch-panel { padding:16px 18px; flex:1 1 auto; min-height:0; display:flex; flex-direction:column; overflow:hidden; }
.sch-panel h2 { margin:2px 0 0; font-size:19px; line-height:1.25; letter-spacing:-.01em; font-weight:800; color:var(--text-strong); }
.sch-sub { font-size:12.5px; color:var(--text-muted); line-height:1.4; }
.sp-hero { margin:10px 0 6px; padding:8px 14px; border-radius:var(--radius-md); background:var(--blue-50); flex:none; }
.sch-big { font-size:28px; line-height:1.1; font-weight:800; letter-spacing:-.02em; color:var(--text-strong); font-variant-numeric:tabular-nums; }
.sch-big small { font-size:15px; font-weight:600; color:var(--text-muted); margin-left:5px; letter-spacing:0; }
.sch-big.off { font-size:20px; color:var(--text-subtle); }
.sch-big.bad { color:var(--danger); }
.sch-big-l { font-size:12px; color:var(--text-muted); margin-top:2px; }
.sch-rows { flex:1 1 auto; min-height:60px; overflow-y:auto; display:flex; flex-direction:column; gap:1px; margin:0 -6px; padding:0 2px 10px;
  -webkit-mask-image:linear-gradient(#000 calc(100% - 24px), transparent); mask-image:linear-gradient(#000 calc(100% - 24px), transparent); }
.sch-row { display:flex; justify-content:space-between; align-items:baseline; gap:12px; padding:5px 6px; border-radius:6px;
  font-size:13.5px; color:var(--text-body); text-decoration:none; }
.sch-row:hover { background:var(--surface-sunken); color:var(--blue-700); }
.sch-row .code { font-size:10.5px; font-weight:700; color:var(--text-subtle); margin-left:6px; letter-spacing:.02em; }
.sch-row b { font-variant-numeric:tabular-nums; white-space:nowrap; color:var(--text-strong); }
.sch-row b small { font-weight:600; color:var(--text-muted); margin-left:3px; }
.sch-row.off b { color:var(--text-subtle); font-weight:600; }
.sch-row.bad { background:var(--danger-soft); }
.sch-row.bad b { color:var(--danger); }
.sch-pills { display:none; flex-wrap:wrap; gap:6px; margin-bottom:12px; }

/* water quality: always in view, no ruled lines */
.sch-q { padding:16px 18px 14px; flex:none; }
.sch-wx { padding:12px 18px 12px; flex:none; }
.wx-main { display:flex; align-items:center; gap:12px; margin:4px 0 8px; }
.wx-ico { width:40px; height:40px; flex:none; fill:none; stroke:var(--blue-700); stroke-width:1.6; stroke-linecap:round; stroke-linejoin:round; }
.wx-ico.off { stroke:var(--neutral-300); }
.wx-temp { font-size:30px; font-weight:800; line-height:1; letter-spacing:-.01em; color:var(--text-strong); font-variant-numeric:tabular-nums; white-space:nowrap; }
.wx-desc { display:flex; flex-direction:column; min-width:0; line-height:1.25; }
.wx-desc b { font-size:15px; color:var(--text-strong); }
.wx-desc small { font-size:12px; color:var(--text-muted); font-variant-numeric:tabular-nums; }
.wx-grid { display:grid; grid-template-columns:repeat(3, minmax(0,1fr)); gap:8px; margin:0; }
.wx-grid div { background:var(--surface-sunken); border-radius:8px; padding:4px 10px; min-width:0; }
.wx-grid dt { font-size:10px; font-weight:700; letter-spacing:.05em; text-transform:uppercase; color:var(--text-subtle); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.wx-grid dd { margin:0; overflow:hidden; text-overflow:ellipsis; font-size:14px; line-height:1.3; font-weight:700; color:var(--text-strong); font-variant-numeric:tabular-nums; white-space:nowrap; }
.wx-src { font-size:11.5px; color:var(--text-muted); white-space:nowrap; font-variant-numeric:tabular-nums; }
.wx-src.old { color:#7a5200; font-weight:700; }
.wx-src.old::before { content:'starší data · '; }
.sch-q h2 { margin:2px 0 10px; font-size:19px; letter-spacing:-.01em; font-weight:800; color:var(--text-strong); }
.q-legend { display:inline-flex; align-items:center; gap:5px; font-size:11.5px; font-weight:600; color:var(--text-muted); }
.q-legend i { width:9px; height:9px; border-radius:3px; margin-left:6px; }
.q-legend i.ok { background:var(--green-500); }
.q-legend i.over { background:var(--danger); }
.qtable { width:100%; border-collapse:separate; border-spacing:0 4px; margin:-4px 0; font-size:13px; font-variant-numeric:tabular-nums; }
.qtable th { text-align:right; font-size:10.5px; font-weight:700; letter-spacing:.06em; text-transform:uppercase; color:var(--text-subtle);
  padding:0 8px 2px; vertical-align:bottom; line-height:1.2; white-space:nowrap; }
.qtable th:first-child, .qtable td:first-child { text-align:left; padding-left:0; }
.qtable th:last-child, .qtable td:last-child { padding-right:0; }
.qtable th small { display:block; font-size:10px; letter-spacing:0; text-transform:none; font-weight:600; }
.qtable td { text-align:right; padding:3px 8px; vertical-align:middle; line-height:1.2; color:var(--text-body); }
.qtable td a { color:var(--text-strong); font-weight:700; text-decoration:none; }
.qtable td a:hover { color:var(--blue-700); }
.qtable td small { display:block; font-size:10.5px; color:var(--text-muted); font-weight:500; line-height:1.2; }
.qtable td:nth-child(4) { color:var(--text-muted); white-space:nowrap; }
.qtable .q-out { border-radius:8px; font-weight:800; font-size:15px; color:var(--text-strong); padding:3px 10px; line-height:1.15; }
.qtable .q-out.ok { background:var(--green-50); color:var(--green-900); box-shadow:inset 0 0 0 1px var(--green-200); }
.qtable .q-out.over { background:var(--danger-soft); color:#8f2222; box-shadow:inset 0 0 0 1px #f0c4c4; }
.qtable .q-out.off { background:var(--neutral-50); color:var(--text-subtle); font-weight:600; font-size:13px; }
.qtable .q-out small { font-weight:500; }
.qtable .q-none { color:var(--text-subtle); }
.q-foot { margin:10px 0 0; font-size:11.5px; color:var(--text-subtle); line-height:1.45; }

@media (max-width: 1100px) {
  .sch-wrap { grid-template-columns:minmax(0,1fr); height:auto; }
  .sch-panel { flex:none; }
  .sch-rows { flex:none; max-height:none; overflow:visible; -webkit-mask-image:none; mask-image:none; }
}
@media (max-width: 900px) { .schema-page { padding:12px; } .sch-card { padding:8px; } }
.sch-wrap.compact .sch-lines path { display:none; }

/* licence page (third-party notices) */
body.licence { overflow:auto; }
body.licence .page { max-width:760px; margin:0 auto; }
.lic { padding:18px 22px; margin-bottom:14px; }
.lic h2 { margin:0 0 6px; font-size:17px; font-weight:800; color:var(--text-strong); }
.lic p { margin:0; font-size:14px; color:var(--text-body); }
.lic a { color:var(--blue-700); }

/* API keys (user management) */
.sub-head { margin-top:40px; }
.sub-head h2 { font-size:22px; line-height:1.2; letter-spacing:-.01em; font-weight:800; color:var(--text-strong); margin:0 0 6px; }
.sub-head .lead a { color:var(--blue-700); font-weight:600; }
.share-form { display:flex; gap:12px; align-items:flex-end; flex-wrap:wrap; margin-bottom:16px; }
.share-form .field { margin:0; flex:0 1 320px; min-width:220px; }
.share-form .btn { height:46px; padding:0 20px; font-size:15px; }
.k-prefix { font-family:ui-monospace,Menlo,Consolas,monospace; font-size:13px; color:var(--text-muted); }
.flabel { font-size:14px; font-weight:600; color:var(--text-strong); }
.k-sites { display:flex; flex-direction:column; gap:6px; max-height:220px; overflow-y:auto; padding:10px 12px;
  border:1px solid var(--border-default); border-radius:var(--radius-md); }
.k-sites label { display:flex; align-items:center; gap:8px; font-size:14px; font-weight:500; color:var(--text-body); cursor:pointer; }
.k-sites input { width:16px; height:16px; accent-color:var(--blue-700); }
/* API docs page */
.docs code { font-family:ui-monospace,Menlo,Consolas,monospace; font-size:.88em; background:var(--neutral-50); padding:1px 5px; border-radius:4px; }
.docs pre { background:var(--neutral-900); color:#e8eef4; border-radius:var(--radius-md); padding:14px 16px; overflow-x:auto; font-size:12.5px; line-height:1.5; margin:10px 0; }
.docs pre code { background:none; padding:0; color:inherit; font-size:inherit; }
.docs .lic ul { margin:0; padding-left:20px; font-size:14px; } .docs .lic li { margin:4px 0; }
.dtable { width:100%; border-collapse:collapse; font-size:14px; }
.dtable td { padding:7px 8px 7px 0; vertical-align:top; } .dtable td:first-child { white-space:nowrap; padding-right:14px; }
@media (max-width: 700px) { .dtable td:first-child { white-space:normal; } }
