/* Shared building blocks of every layout. Colours: tokens.css. Fonts, radii, density: the layout files (--font-ui, --font-num, --fs,
   --r-lg, --r-md, --r-sm, --pad, --head-h, --gap). */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; }
body { min-height: 100vh; background: var(--glow), var(--bg); background-color: var(--bg); background-repeat: no-repeat; color: var(--text); font: var(--fs)/1.4 var(--font-ui); -webkit-font-smoothing: antialiased; }
a { color: var(--text-2); text-decoration: none; }
a:hover { color: var(--text); }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .5; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.num { font-family: var(--font-num); font-variant-numeric: tabular-nums; }
.up { color: var(--up); } .down { color: var(--down); } .flat, .mute { color: var(--text-3); } .t2 { color: var(--text-2); }
.acc { color: var(--accent-text); } .warn-t { color: var(--warn); } .down-t { color: var(--down-text); }
.b6 { font-weight: 600; } .sm { font-size: 12px; } .r { text-align: right; } .o8 { opacity: .8; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.ico { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.ico-sm { width: 14px; height: 14px; stroke-width: 2; } .ico-xs { width: 11px; height: 11px; stroke-width: 2.4; }
.stack { display: flex; flex-direction: column; gap: 3px; min-width: 0; } .stack.r { align-items: flex-end; }

/* frame pieces (placed by layout-*.css) */
.logo { width: 30px; height: 30px; flex: none; display: flex; align-items: center; justify-content: center; border-radius: 8px; background: var(--accent); color: var(--accent-ink); }
.logo .ico { width: 18px; height: 18px; stroke-width: 2.4; }
.brand-txt { display: flex; flex-direction: column; gap: 1px; white-space: nowrap; }
.brand-txt b { font-size: 14px; font-weight: 600; }
/* the Oriqon logo: the app icon is its own dark square in every theme; the wordmark takes the text colour, its Q segment the brand blue */
.logo:has(.oq-mark) { background: none; }
.oq-mark { width: 100%; height: 100%; display: block; }
.oq-word { display: block; height: 12px; width: auto; color: var(--text); }
.oq-seg { stroke: var(--oq-seg, #6F8DFF); }
[data-theme="arctic"] { --oq-seg: #2F5BFF; }
.brand-txt small { font-size: 11px; color: var(--text-3); }
.nav-list .badge { margin-left: auto; font: 11.5px var(--font-num); color: var(--text-3); }
.nav-list .badge.up { color: var(--up); } .nav-list .badge.down { color: var(--down); }
.sys-h { font-size: 12px; font-weight: 600; color: var(--text-2); }
.sys-r { display: flex; align-items: center; gap: 8px; font-size: 12.5px; }
.sys-r .k { color: var(--text-2); } .sys-r .v { margin-left: auto; font-size: 12px; color: var(--text-2); } .sys-r .v.down-t { color: var(--down-text); }
.upd-card b { display: flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 600; color: var(--accent-text); }
.upd-card > span { font-size: 12px; line-height: 1.4; color: var(--text-2); }
.upd-card .btn { height: 30px; border-color: var(--accent-line); color: var(--accent-text); font-weight: 600; }
.nav-row { height: 44px; display: flex; align-items: center; gap: 10px; padding: 0 22px; border: 0; background: none; color: var(--text-2); font-size: 13.5px; text-align: left; }
.nav-row:hover:not(:disabled) { color: var(--text); }
.hdr-page { display: flex; align-items: center; gap: 10px; } .hdr-page:empty { display: none; }
.hdr-status { display: flex; align-items: center; gap: 10px; }
.chip-mode { display: inline-flex; align-items: center; gap: 8px; height: 32px; padding: 0 12px; border-radius: var(--r-md); background: var(--surface-2); color: var(--text-2); font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.chip-mode.down { background: var(--down-soft); color: var(--down-text); } .chip-mode.down .dot { background: var(--down); }
.chip-mode.warn { background: var(--warn-soft); color: var(--warn); } .chip-mode.warn .dot { background: var(--warn); }
.chip-toggle { display: inline-flex; align-items: center; gap: 10px; height: 32px; padding: 0 6px 0 12px; border: 1px solid var(--line-strong); border-radius: var(--r-md); background: var(--surface); color: var(--text-2); font-size: 12.5px; white-space: nowrap; }
.sel select { height: 32px; max-width: 200px; padding: 0 28px 0 10px; border: 1px solid var(--line-strong); border-radius: var(--r-md); background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238A8F99' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 9px center / 11px; color: var(--text-2); font-size: 12.5px; appearance: none; cursor: pointer; text-overflow: ellipsis; }
.sel select:hover { color: var(--text); }
.sel option { background: var(--surface); color: var(--text); }
.offline { padding: 8px 16px; border-bottom: 1px solid var(--down-line); background: var(--down-soft); color: var(--down-text); font-size: 12.5px; font-weight: 600; }
.offline.warn { border-color: var(--warn-soft); background: var(--warn-soft); color: var(--warn); }
.page { min-height: 100%; }
.ov > .kpis { grid-area: kpis; }
.ov > .pos { grid-area: pos; } .ov > .autop { grid-area: auto; } .ov > .feed { grid-area: feed; } .ov > .top { grid-area: top; }

/* panels */
.panel { min-width: 0; min-height: 0; display: flex; flex-direction: column; overflow: hidden; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); }
.panel-h { flex: none; display: flex; align-items: center; gap: 10px; min-height: var(--head-h); padding: 0 var(--pad); border-bottom: 1px solid var(--line); }
.panel-h h2 { margin: 0; font-size: 14px; font-weight: 600; white-space: nowrap; }
.panel-h .sub { min-width: 0; overflow: hidden; font-size: 12.5px; color: var(--text-3); white-space: nowrap; text-overflow: ellipsis; }
.end { margin-left: auto; }
.panel-b { flex: 1; min-height: 0; overflow: auto; }
.panel-f { flex: none; display: flex; align-items: center; gap: 20px; min-height: 40px; overflow: hidden; padding: 0 var(--pad); border-top: 1px solid var(--line); font-size: 12.5px; color: var(--text-3); white-space: nowrap; }
.link { display: inline-flex; align-items: center; gap: 6px; color: var(--accent-text); font-weight: 500; white-space: nowrap; }
.link:hover { color: var(--accent-text); text-decoration: underline; }
.empty { margin: 14px var(--pad); padding: 20px; border: 1px dashed var(--line-strong); border-radius: var(--r-md); color: var(--text-3); font-size: 13px; line-height: 1.5; text-align: center; }
.empty .btn { margin-top: 10px; }

/* tabs (underline) and segmented controls */
.tabs { display: flex; align-items: stretch; gap: 22px; align-self: stretch; min-width: 0; }
.tab { display: flex; align-items: center; gap: 8px; padding: 0; border: 0; border-bottom: 2px solid transparent; background: none; color: var(--text-3); font-weight: 500; white-space: nowrap; }
.tab:hover { color: var(--text-2); }
.tab[aria-pressed="true"] { border-bottom-color: var(--accent); color: var(--text); font-weight: 600; }
.cnt { padding: 1px 7px; border-radius: 10px; background: var(--surface-2); color: var(--text-3); font: 11.5px var(--font-num); }
.tab[aria-pressed="true"] .cnt { background: var(--surface-3); color: var(--text-2); }
.seg { display: inline-flex; gap: 2px; padding: 3px; border: 1px solid var(--line); border-radius: calc(var(--r-md) + 1px); background: var(--inset); }
.seg button { height: 26px; padding: 0 10px; border: 0; border-radius: var(--r-sm); background: transparent; color: var(--text-3); font-size: 12px; font-weight: 500; white-space: nowrap; }
.seg button:hover { color: var(--text-2); }
.seg button[aria-pressed="true"] { background: var(--surface-3); color: var(--text); font-weight: 600; }

/* buttons */
.btn { height: 32px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: var(--r-md); background: transparent; color: var(--text-btn); font-size: 12.5px; font-weight: 500; white-space: nowrap; }
.btn:hover:not(:disabled) { border-color: var(--text-3); color: var(--text); }
.btn-sm { height: 26px; padding: 0 9px; font-size: 12px; }
.btn-lg { height: 40px; padding: 0 16px; font-size: 13.5px; font-weight: 600; }
.btn-long, .btn-long:hover:not(:disabled) { border-color: var(--up); background: var(--up); color: var(--up-ink); font-weight: 600; }
.btn-short { border-color: var(--down-line); color: var(--down); font-weight: 600; }
.btn-short:hover:not(:disabled) { border-color: var(--down); color: var(--down); }
.btn-short.solid, .btn-short.solid:hover:not(:disabled) { border-color: var(--down); background: var(--down); color: #fff; }
.btn-accent, .btn-accent:hover:not(:disabled) { border-color: var(--accent); background: var(--accent); color: var(--accent-ink); font-weight: 600; }
.btn-soft, .btn-soft:hover:not(:disabled) { border-color: transparent; background: var(--accent-soft); color: var(--accent-text); font-weight: 600; }
.btn-long:hover:not(:disabled), .btn-short.solid:hover:not(:disabled), .btn-accent:hover:not(:disabled) { filter: brightness(1.08); }
.icon-btn { position: relative; width: 32px; height: 32px; flex: none; display: inline-flex; align-items: center; justify-content: center; padding: 0; border: 1px solid var(--line); border-radius: var(--r-md); background: transparent; color: var(--text-2); }
.icon-btn:hover:not(:disabled) { border-color: var(--line-strong); color: var(--text); }
.icon-btn .dot { position: absolute; top: 5px; right: 5px; width: 6px; height: 6px; background: var(--accent); display: none; }
.icon-btn.has-dot .dot { display: block; }

/* dots, pills, tags, sides, scores */
.dot { display: inline-block; flex: none; width: 7px; height: 7px; border-radius: 50%; background: var(--text-3); }
.dot.up { background: var(--up); } .dot.down { background: var(--down); } .dot.warn { background: var(--warn); } .dot.acc { background: var(--accent); } .dot.info { background: var(--info); } .dot.skip { background: var(--skip); }
.pill { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 9px; border-radius: 12px; background: var(--surface-2); color: var(--text-2); font-size: 12px; font-weight: 600; white-space: nowrap; }
.pill.up { background: var(--up-soft); color: var(--up); } .pill.down { background: var(--down-soft); color: var(--down-text); } .pill.warn { background: var(--warn-soft); color: var(--warn); } .pill.acc { background: var(--accent-soft); color: var(--accent-text); }
.pill.up .dot { background: var(--up); } .pill.down .dot { background: var(--down); } .pill.warn .dot { background: var(--warn); } .pill.acc .dot { background: var(--accent); }
.tag { display: inline-block; padding: 2px 7px; border-radius: var(--r-sm); background: var(--surface-2); color: var(--text-2); font: 11.5px var(--font-num); white-space: nowrap; }
.tag.acc { background: var(--accent-soft); color: var(--accent-text); font-family: var(--font-ui); font-weight: 600; }
.side { display: inline-block; padding: 2px 8px; border-radius: var(--r-sm); font-size: 12px; font-weight: 600; white-space: nowrap; }
.side.long { background: var(--up-soft); color: var(--up); } .side.short { background: var(--down-soft); color: var(--down-text); }
.s-long { color: var(--up); } .s-short { color: var(--down); }
.score-hi { color: var(--up); } .score-mid { color: var(--warn); } .score-lo { color: var(--text-3); }
.bars { display: inline-flex; gap: 2px; color: inherit; } .bars i { width: 9px; height: 4px; border-radius: 2px; background: var(--line-strong); } .bars i.on { background: currentColor; }

/* coin: avatar + name + second line */
.coin { display: flex; align-items: center; gap: 10px; min-width: 0; }
.av { flex: none; width: 28px; height: 28px; display: flex; align-items: center; justify-content: center; border-radius: 50%; color: #fff; font-size: 11.5px; font-weight: 700; }
.av-sm { width: 24px; height: 24px; font-size: 10.5px; } .av-xs { width: 20px; height: 20px; font-size: 9.5px; } .av-lg { width: 34px; height: 34px; font-size: 13px; } .av-xl { width: 36px; height: 36px; font-size: 13px; font-weight: 800; }
.coin-t { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.coin-n { overflow: hidden; color: var(--text); font-weight: 600; white-space: nowrap; text-overflow: ellipsis; }
.coin-n small { color: var(--text-3); font-size: .9em; font-weight: 400; }
.coin-s { overflow: hidden; color: var(--text-3); font-size: 12px; white-space: nowrap; text-overflow: ellipsis; }

/* switch */
.switch { position: relative; flex: none; width: 36px; height: 20px; padding: 0; border: 0; border-radius: 10px; background: var(--line-strong); }
.switch::after { content: ''; position: absolute; top: 3px; left: 3px; width: 14px; height: 14px; border-radius: 50%; background: var(--text-2); transition: left .15s; }
.switch[aria-checked="true"] { background: var(--accent); }
.switch[aria-checked="true"]::after { left: 19px; background: var(--accent-ink); }
.switch.lg { width: 44px; height: 26px; border-radius: 13px; } .switch.lg::after { width: 20px; height: 20px; } .switch.lg[aria-checked="true"]::after { left: 21px; }

/* stop → target track of a position */
.track { position: relative; height: 6px; border-radius: 3px; background: var(--surface-3); }
.track .fill { position: absolute; top: 0; height: 100%; border-radius: 3px; }
.track .fill.up { background: var(--up); } .track .fill.down { background: var(--down); }
.track .entry { position: absolute; top: -3px; width: 2px; height: 12px; margin-left: -1px; border-radius: 1px; background: var(--text-3); }
.track .now { position: absolute; top: -3px; width: 12px; height: 12px; margin-left: -6px; border: 2px solid var(--surface); border-radius: 50%; background: var(--text); }
.t-lbl { display: flex; justify-content: space-between; gap: 8px; color: var(--text-3); font: 11.5px var(--font-num); white-space: nowrap; }
.t-lbl .lock { display: inline-flex; align-items: center; gap: 4px; color: var(--accent-text); }

/* key-number cards */
.kpi { position: relative; min-width: 0; overflow: hidden; display: flex; flex-direction: column; justify-content: space-between; gap: 6px; padding: 16px 18px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); }
.kpi-k { font-size: 12.5px; color: var(--text-2); }
.kpi-v { font: 500 28px/1 var(--font-num); letter-spacing: -.02em; white-space: nowrap; }
.kpi-v small { margin-left: 6px; color: var(--text-3); font-size: 12px; letter-spacing: 0; }
.kpi-s { overflow: hidden; color: var(--text-3); font-size: 12.5px; white-space: nowrap; text-overflow: ellipsis; }
.kpi-art { position: absolute; top: 14px; right: 16px; }

/* messages and notes */
.msg { padding: 8px 10px; border: 1px solid; border-radius: var(--r-md); font-size: 12.5px; line-height: 1.45; }
.msg.warn { border-color: var(--accent-line); background: var(--warn-soft); color: var(--warn); }
.msg.bad { border-color: var(--down-line); background: var(--down-soft); color: var(--down-text); }
.msg.ok { border-color: var(--up-line); background: var(--up-soft); color: var(--up); }
.note { margin: 0; color: var(--text-3); font-size: 12px; line-height: 1.5; }
.note b { color: var(--text-2); }

/* form fields */
.fld { display: flex; flex-direction: column; gap: 5px; min-width: 0; color: var(--text-3); font-size: 12px; }
.fld input, .fld select, .inp { width: 100%; height: 32px; padding: 0 9px; border: 1px solid var(--line-strong); border-radius: var(--r-md); background: var(--inset); color: var(--text); }
.fld input[type=number] { font-family: var(--font-num); text-align: right; }
.fld input:focus, .fld select:focus, .inp:focus { outline: none; border-color: var(--accent); }
/* a field the save refused (automation.js checkFields): red until its next input - after :focus, so it stays red while being fixed */
.fld input.bad, .mm.bad { border-color: var(--down); background: var(--down-soft); }
.g2, .g3, .g4 { display: grid; gap: 10px 14px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } .g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
/* a switch card (a div, no label): only its checkbox switches - inside .sw-hit, a 44 x 44 px target pulled back by its margins: the checkbox
   keeps its place (centred in it, 2 px under the text's top as before), the text starts 8 px further right, clear of the target; the text,
   the fields in it and the gaps switch nothing */
.sw { display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface-2); color: var(--text); cursor: default; }
.sw-hit { display: inline-flex; align-items: center; justify-content: center; flex: none; min-width: 44px; min-height: 44px; margin: -12px -6px -12px -14px; cursor: pointer; }
.sw input[type=checkbox] { flex: none; width: 16px; height: 16px; margin: 0; accent-color: var(--accent); }
.sw small { display: block; margin-top: 2px; color: var(--text-3); font-size: 12px; line-height: 1.4; }
.sw:has(input:checked) { border-color: var(--accent-line); }
.sw.danger:has(input:checked) { border-color: var(--down-line); background: var(--down-soft); }
.sec { display: flex; flex-direction: column; gap: 10px; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); }
.sec > h3 { margin: 0; color: var(--accent-text); font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }

/* tables (Statisztika, Visszateszt) */
.tbl-wrap { overflow: auto; }
.tbl { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.tbl th { position: sticky; top: 0; z-index: 1; padding: 8px 10px; border-bottom: 1px solid var(--line); background: var(--surface); color: var(--text-3); font-size: 12px; font-weight: 500; text-align: left; white-space: nowrap; }
.tbl td { padding: 8px 10px; border-bottom: 1px solid var(--line-soft); white-space: nowrap; }
.tbl .r { text-align: right; } .tbl .num { font-family: var(--font-num); }
.tbl tbody tr:hover td { background: var(--sel); }
.tbl tr.on td { background: var(--accent-softer); }

/* filter chips */
.chips { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-width: 0; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 4px 0 9px; border-radius: var(--r-sm); background: var(--surface-2); color: var(--text-btn); font-size: 12px; white-space: nowrap; }
.chip button { width: 18px; height: 18px; display: flex; align-items: center; justify-content: center; padding: 0; border: 0; border-radius: 5px; background: transparent; color: var(--text-3); }
.chip button:hover { color: var(--text); }

/* below 1280 px every layout falls back to one column without horizontal page scroll (spec §5.2: full layout from 1280 px) */
@media (max-width: 1279px) {
  :root[data-layout] .app { display: flex; flex-direction: column; height: auto; min-height: 100vh; padding: 0; }
  :root[data-layout] .side, :root[data-layout] .hdr { display: flex; flex-flow: row wrap; align-items: center; gap: 8px; height: auto; padding: 8px 12px; border: 0; border-bottom: 1px solid var(--line); background: var(--side); }
  :root[data-layout] :is(.nav-fill, .sys, .upd-card, #updBtn, .hdr-right > [data-open-settings]) { display: none; }
  :root[data-layout] .nav-list { display: flex; flex-flow: row wrap; gap: 2px; padding: 0; border: 0; background: none; }
  :root[data-layout] .nav-list a { height: 32px; padding: 0 10px; }
  :root[data-layout] .nav-foot { display: flex; flex-direction: row; border: 0; }
  :root[data-layout] .nav-row { height: 32px; padding: 0 10px; }
  :root[data-layout] .hdr-right { flex-wrap: wrap; margin-left: 0; }
  :root[data-layout] .main { overflow: visible; padding: 12px; }
  :root[data-layout] :is(.ov, .kpis) { display: flex; flex-direction: column; gap: 12px; height: auto; }
  :root[data-layout] .ov > .panel { min-height: 220px; }
  :root[data-layout] .app::before { display: none; }
  :root[data-layout] #page-scan { height: auto; }
  :root[data-layout] #page-scan .scan-body { display: flex; flex-direction: column; gap: 12px; height: auto; min-height: 0; }
  :root[data-layout] .scan-detail { min-height: 320px; }
}

/* admin-only controls (spec docs/superpowers/specs/2026-10-12-multi-user-design.md 1.5): hidden until /api/me says admin - the server
   refuses them anyway; the menu's admin pages are left out in shell.js */
html:not([data-role="admin"]) :is([data-update], #updCard, #moreUpd, #setGhSec, [data-view-user]) { display: none !important; }
[data-logout] { cursor: pointer; } /* an <a> without an address (the logout is a POST, shell.js) */
