/* ADL400 Logger – a PLS100 / tcps config felületek stílusát követi. Színek: theme.css (világos/sötét). */
* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; }
body {
  font-family: 'Segoe UI', Tahoma, sans-serif; background: var(--bg); color: var(--text);
  height: 100vh; display: flex; flex-direction: column; overflow: hidden; font-size: 16.1px;
}
[hidden] { display: none !important; }
.mono { font-family: var(--mono); }
.num { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.muted { color: var(--text-3); }
.small { font-size: .8em; }
a { color: var(--primary); }

/* ── Fejléc ───────────────────────────────────────── */
.header {
  background: var(--header-grad); color: #fff;
  padding: 8px 20px; display: flex; align-items: center; justify-content: space-between; gap: 16px;
  box-shadow: 0 2px 8px rgba(0,0,0,.15); flex-shrink: 0;
}
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand .logo { width: 32px; height: 32px; flex-shrink: 0; }
.header h1 { font-size: 1.15em; font-weight: 600; white-space: nowrap; }
.header .version { font-size: .65em; opacity: .7; font-weight: 400; }
.header .vendor { font-size: .66em; font-weight: 600; letter-spacing: .5px; margin-left: 10px; padding-left: 10px; border-left: 1px solid rgba(255,255,255,.35); opacity: .85; vertical-align: middle; }
.header .site { font-size: .78em; opacity: .85; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hdr-center { display: flex; align-items: center; gap: 8px; flex: 1; justify-content: center; min-width: 0; }
.hdr-dev-label { font-size: .75em; text-transform: uppercase; letter-spacing: .5px; opacity: .8; }
.hdr-select {
  background: rgba(255,255,255,.15); color: #fff; border: 1px solid rgba(255,255,255,.3); border-radius: 5px;
  padding: 5px 8px; font-size: .9em; min-width: 220px; max-width: 420px;
}
.hdr-select option, .hdr-select optgroup { color: var(--text); background: var(--surface); }
.conn-area { display: flex; align-items: center; gap: 8px; }
.conn-status {
  display: inline-flex; align-items: center; gap: 6px; font-size: .8em; padding: 4px 10px; border-radius: 12px;
  background: rgba(255,255,255,.15); white-space: nowrap; cursor: default;
}
.conn-dot { width: 10px; height: 10px; border-radius: 50%; background: #95a5a6; flex-shrink: 0; }
.conn-dot.ok { background: #2ecc71; box-shadow: 0 0 6px #2ecc71; }
.conn-dot.warn { background: #f1c40f; }
.conn-dot.err { background: #e74c3c; }
.hdr-btn { background: rgba(255,255,255,.15); color: #fff; border: 1px solid rgba(255,255,255,.25); border-radius: 5px; padding: 4px 9px; cursor: pointer; font-size: .9em; }
.hdr-btn:hover { background: rgba(255,255,255,.28); }
.hdr-btn.active { background: rgba(255,255,255,.35); }
.hdr-btn.sm { font-size: .75em; padding: 2px 7px; }
.lang-switch, .theme-switch { display: inline-flex; border: 1px solid rgba(255,255,255,.3); border-radius: 5px; overflow: hidden; }
.lang-switch button, .theme-switch button { background: transparent; color: #fff; border: none; padding: 4px 7px; font-size: .75em; font-weight: 600; cursor: pointer; opacity: .7; font-family: inherit; }
.theme-switch button { font-size: .85em; padding: 3px 8px; line-height: 1; }
.lang-switch button.active, .theme-switch button.active { background: rgba(255,255,255,.3); opacity: 1; }
.user-box { font-size: .8em; display: inline-flex; align-items: center; gap: 6px; }

/* ── Fülek ────────────────────────────────────────── */
.tab-bar { background: var(--tab-bg); display: flex; border-bottom: 2px solid var(--primary); flex-shrink: 0; overflow-x: auto; }
.tab-btn {
  padding: 10px 22px; border: none; background: transparent; font-size: .9em; font-weight: 600; color: var(--tab-text); cursor: pointer;
  border-bottom: 3px solid transparent; margin-bottom: -2px; transition: all .2s; white-space: nowrap; font-family: inherit;
}
.tab-btn:hover { color: var(--primary); }
.tab-btn.active { color: var(--primary); border-bottom-color: var(--primary); background: var(--tab-active-bg); }

/* ── Fő terület ───────────────────────────────────── */
.main { flex: 1; display: flex; min-height: 0; }
.content { flex: 1; overflow: auto; padding: 16px 20px; min-width: 0; }
.view { display: none; }
.view.active { display: block; }
.view.fill.active { display: flex; flex-direction: column; height: 100%; min-height: 0; }

/* ── Gombok ───────────────────────────────────────── */
.btn {
  padding: 6px 14px; border: none; border-radius: 5px; font-size: .85em; font-weight: 600; cursor: pointer;
  display: inline-flex; align-items: center; gap: 5px; transition: all .15s; white-space: nowrap; font-family: inherit;
}
.btn:hover { filter: brightness(1.1); transform: translateY(-1px); }
.btn:active { transform: none; }
.btn:disabled { opacity: .4; cursor: not-allowed; filter: none; transform: none; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-success { background: var(--ok); color: #fff; }
.btn-warning { background: var(--warn); color: #fff; }
.btn-danger { background: var(--err); color: #fff; }
.btn-secondary { background: var(--muted); color: #fff; }
.btn-outline { background: var(--btn-outline-bg); color: var(--btn-outline-text); border: 1px solid var(--border); }
.btn-outline.active { background: var(--sel); border-color: var(--primary); color: var(--primary); }
.btn-sm { padding: 3px 9px; font-size: .78em; }
.btn-group { display: inline-flex; }
.btn-group .btn { border-radius: 0; margin-left: -1px; }
.btn-group .btn:first-child { border-radius: 5px 0 0 5px; margin-left: 0; }
.btn-group .btn:last-child { border-radius: 0 5px 5px 0; }
.btn-group .btn:hover { transform: none; }

/* ── Kártyák ──────────────────────────────────────── */
.section { background: var(--surface); border-radius: 8px; box-shadow: var(--shadow-sm); overflow: hidden; }
.section-head {
  background: var(--head); color: var(--head-text); padding: 7px 14px; font-size: .88em; font-weight: 600;
  display: flex; align-items: center; gap: 8px; min-height: 34px;
}
.section-head .spacer { flex: 1; }
.section-head .hint { font-weight: 400; opacity: .7; font-size: .9em; }
.section-body { padding: 14px; }
.section-body.tight { padding: 0; }
.mb { margin-bottom: 16px; }

/* ── Űrlap ────────────────────────────────────────── */
.form-row { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.form-row:last-child { margin-bottom: 0; }
.form-label { font-size: .75em; font-weight: 600; text-transform: uppercase; letter-spacing: .5px; color: var(--text-3); min-width: 130px; flex-shrink: 0; }
.form-input, .form-select, .dt-input {
  font-family: var(--mono); font-size: .88em; padding: 5px 9px; border: 1px solid var(--border); border-radius: 4px;
  background: var(--input-bg); color: var(--text); min-width: 0;
}
.form-select { font-family: inherit; }
.form-input:focus, .form-select:focus, .dt-input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 2px rgba(41,128,185,.2); }
.form-input[readonly] { background: var(--input-ro); color: var(--text-3); }
.form-input::placeholder { color: var(--text-4); }
.form-input.w-xs { width: 70px; } .form-input.w-s { width: 110px; } .form-input.w-m { width: 190px; } .form-input.w-l { width: 320px; } .form-input.grow { flex: 1; }
.form-hint { font-size: .75em; color: var(--text-4); }
.chk { display: inline-flex; align-items: center; gap: 5px; font-size: .88em; cursor: pointer; user-select: none; }
.chk input { accent-color: var(--primary); width: 15px; height: 15px; }
.toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.toolbar .sep { width: 1px; height: 22px; background: var(--sep); margin: 0 2px; }
.toolbar label.lbl { font-size: .72em; font-weight: 600; text-transform: uppercase; color: var(--text-3); letter-spacing: .4px; }

/* ── Táblázat ─────────────────────────────────────── */
.tbl-wrap { overflow: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: .82em; }
.tbl th {
  background: var(--head); color: var(--head-text); font-weight: 600; text-align: left; padding: 6px 9px; position: sticky; top: 0; z-index: 1;
  font-size: .9em; white-space: nowrap;
}
.tbl th.r, .tbl td.r { text-align: right; }
.tbl th .unit { opacity: .65; font-weight: 400; }
.tbl td { padding: 4px 9px; border-bottom: 1px solid var(--line-2); white-space: nowrap; }
.tbl tbody tr:nth-child(even) td { background: var(--zebra); }
.tbl tbody tr:hover td, .tbl tbody tr:nth-child(even):hover td { background: var(--hover); }
.tbl td.num { font-family: var(--mono); text-align: right; }
.tbl td.hi { color: var(--hi); font-weight: 600; }
.tbl td.lo { color: var(--lo); font-weight: 600; }
.tbl tr.clickable { cursor: pointer; }
.tbl tr.sel td { background: var(--sel) !important; }
.tbl tbody tr.fresh td { animation: rowFresh 1.8s ease-out; }
@keyframes rowFresh { from { background: var(--ok-bg); } }
.tbl tfoot td { font-weight: 700; background: var(--surface-2); border-top: 2px solid var(--sep); }
.pager { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-top: 1px solid var(--line); font-size: .85em; background: var(--surface-2); flex-wrap: wrap; }
.pager .info { color: var(--text-3); }

/* ── Állapot jelzők ───────────────────────────────── */
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: #95a5a6; vertical-align: middle; }
.dot.ok { background: var(--ok2); } .dot.err { background: var(--err); } .dot.warn { background: #f1c40f; }
.badge { display: inline-block; padding: 1px 8px; border-radius: 10px; font-size: .75em; font-weight: 600; background: var(--surface-3); color: var(--text-2); }
.badge.ok { background: var(--ok-bg); color: var(--ok-fg); } .badge.err { background: var(--err-bg); color: var(--err-fg); }
.badge.warn { background: var(--warn-bg); color: var(--warn-fg); } .badge.info { background: var(--info-bg); color: var(--info-fg); }
.note { font-size: .82em; padding: 8px 12px; border-radius: 6px; background: var(--note-bg); color: var(--note-fg); border: 1px solid var(--note-bd); line-height: 1.45; }
.note.warn { background: var(--note-warn-bg); color: var(--note-warn-fg); border-color: var(--note-warn-bd); }
.note.err { background: var(--note-err-bg); color: var(--note-err-fg); border-color: var(--note-err-bd); }
.empty { padding: 40px; text-align: center; color: var(--text-3); }

/* ── Közös dashboard elemek ───────────────────────── */
.ph-table { width: 100%; border-collapse: collapse; font-size: .88em; }
.ph-table th { font-size: .72em; text-transform: uppercase; letter-spacing: .4px; color: var(--text-3); font-weight: 600; text-align: right; padding: 4px 6px; border-bottom: 1px solid var(--line); }
.ph-table th:first-child { text-align: left; }
.ph-table td { padding: 6px 6px; border-bottom: 1px solid var(--line-2); text-align: right; font-family: var(--mono); color: var(--text-strong); }
.ph-table td:first-child { text-align: left; font-family: inherit; font-weight: 600; color: var(--text-2); }
.ph-table tr:last-child td { border-bottom: none; }
.ph-table tr.total td { font-weight: 700; background: var(--surface-2); }
.kv-grid { display: grid; grid-template-columns: auto 1fr; gap: 5px 14px; font-size: .85em; }
.kv-grid .k { color: var(--text-3); }
.kv-grid .v { font-family: var(--mono); text-align: right; color: var(--text-strong); }
.subhead { font-size: .72em; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; color: var(--text-3); margin: 12px 0 6px; padding-bottom: 3px; border-bottom: 1px solid var(--line); }
.subhead:first-child { margin-top: 0; }

/* ── Trend ────────────────────────────────────────── */
.trend-layout { display: flex; gap: 14px; flex: 1; min-height: 0; }
.trend-side { width: 305px; flex-shrink: 0; display: flex; flex-direction: column; gap: 12px; min-height: 0; }
.trend-side .section { display: flex; flex-direction: column; min-height: 0; }
.trend-side .pens-src { flex: 1; }
.trend-side .section-body { overflow: auto; }
.tag-group { margin-bottom: 6px; }
.tag-group-h { font-size: .72em; font-weight: 700; text-transform: uppercase; color: var(--text-3); letter-spacing: .5px; padding: 5px 2px 3px; cursor: pointer; user-select: none; display: flex; align-items: center; gap: 5px; }
.tag-group-h .arr { transition: transform .15s; font-size: .8em; }
.tag-group.open .arr { transform: rotate(90deg); }
.tag-group .tags { display: none; padding-left: 4px; }
.tag-group.open .tags { display: block; }
.tag-item { display: flex; align-items: center; gap: 6px; font-size: .84em; padding: 2px 3px; border-radius: 3px; cursor: pointer; }
.tag-item:hover { background: var(--sel); }
.tag-item input { accent-color: var(--primary); }
.tag-item .u { margin-left: auto; color: var(--text-4); font-size: .85em; font-family: var(--mono); }
.trend-side .pens-src { min-height: 180px; }
/* kiugrás-keresés */
.trend-side .xf { flex: 0 1 auto; max-height: 58%; }
.xf-head { cursor: pointer; user-select: none; }
.xf-head .arr { transition: transform .15s; opacity: .7; }
.xf.collapsed .arr { transform: rotate(-90deg); }
.xf.collapsed .section-body { display: none; }
.trend-side .xf .section-body { overflow: hidden; }
.xf-body { display: flex; flex-direction: column; gap: 6px; padding: 8px 10px; min-height: 0; }
.xf-modes { display: flex; }
.xf-modes .btn { flex: 1; padding-left: 4px; padding-right: 4px; }
.xf-row { display: flex; align-items: center; gap: 6px; font-size: .84em; }
.xf-row label { color: var(--text-3); min-width: 66px; }
.xf-row .form-input { flex: 1; width: 0; font-family: var(--mono); }
.xf-row .u { color: var(--text-4); font-family: var(--mono); font-size: .9em; min-width: 22px; }
#xGo.busy { opacity: .6; cursor: progress; }
.xf-sum { font-size: .78em; color: var(--text-3); display: flex; align-items: center; gap: 6px; min-height: 18px; }
.xf-list { overflow: auto; min-height: 0; display: flex; flex-direction: column; gap: 4px; padding-bottom: 2px; }
.xf-item { border: 1px solid var(--line-2); border-left: 3px solid var(--warn); border-radius: 5px; padding: 4px 8px; cursor: pointer; font-size: .82em; transition: background .12s; }
.xf-item:hover { background: var(--sel); }
.xf-item.sel { background: var(--sel); border-color: var(--primary); border-left-color: var(--warn); box-shadow: 0 0 0 1px var(--primary) inset; }
.xf-item.up { border-left-color: var(--hi); } .xf-item.down { border-left-color: var(--lo); }
.xf-top { display: flex; justify-content: space-between; align-items: baseline; gap: 6px; }
.xf-t { font-family: var(--mono); color: var(--text-2); white-space: nowrap; }
.xf-rank { color: var(--text-4); margin-right: 5px; font-size: .9em; }
.xf-v { font-family: var(--mono); font-weight: 700; white-space: nowrap; }
.xf-v small { font-weight: 400; color: var(--text-4); }
.xf-item.up .xf-v { color: var(--hi); } .xf-item.down .xf-v { color: var(--lo); }
.xf-d { color: var(--text-3); font-size: .92em; font-family: var(--mono); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.xf-d.more { color: var(--text-4); }
.trend-main { flex: 1; display: flex; flex-direction: column; min-width: 0; min-height: 0; gap: 10px; }
.trend-toolbar { background: var(--surface); border-radius: 8px; box-shadow: var(--shadow-sm); padding: 8px 10px; }
.trend-chart-wrap { background: var(--surface); border-radius: 8px; box-shadow: var(--shadow-sm); flex: 1; min-height: 260px; position: relative; padding: 6px 4px 0; }
.trend-chart { position: absolute; inset: 6px 4px 0 4px; }
.trend-overlay { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: var(--text-3); pointer-events: none; font-size: .95em; }
.trend-info { position: absolute; right: 10px; top: 8px; font-size: .72em; color: var(--text-4); font-family: var(--mono); pointer-events: none; z-index: 2; background: var(--tip-bg); padding: 1px 6px; border-radius: 3px; }
.loading-bar { position: absolute; left: 0; top: 0; height: 3px; background: var(--primary); width: 0; transition: width .3s; z-index: 3; border-radius: 8px 8px 0 0; }
.loading-bar.on { width: 70%; transition: width 3s; }
.pen-table-wrap { background: var(--surface); border-radius: 8px; box-shadow: var(--shadow-sm); max-height: 30%; overflow: auto; flex-shrink: 0; }
.pen-table td, .pen-table th { padding: 3px 8px; }
.pen-swatch { width: 26px; height: 14px; border-radius: 3px; border: 1px solid rgba(0,0,0,.15); cursor: pointer; position: relative; display: inline-block; vertical-align: middle; }
.pen-swatch input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; }
.pen-table tr.off td { opacity: .45; }
.pen-table .cur { font-weight: 700; color: var(--text-strong); }
.icon-btn { background: none; border: none; cursor: pointer; color: var(--text-4); font-size: 1em; padding: 0 4px; }
.icon-btn:hover { color: var(--err); }
.dt-input { font-size: .82em; padding: 4px 6px; }
.popover { position: absolute; z-index: 20; background: var(--surface); color: var(--text); border-radius: 8px; box-shadow: var(--shadow-pop); border: 1px solid var(--line); padding: 12px; min-width: 260px; }
.popover h4 { font-size: .78em; text-transform: uppercase; color: var(--text-3); margin-bottom: 8px; letter-spacing: .5px; }
.u-legend { display: none; }
.uplot { font-family: 'Segoe UI', Tahoma, sans-serif; }
.u-select { background: rgba(41,128,185,.14); border: 1px solid rgba(41,128,185,.45); }

/* ── Adatok ───────────────────────────────────────── */
.filter-bar { background: var(--surface); border-radius: 8px; box-shadow: var(--shadow-sm); padding: 10px 12px; margin-bottom: 12px; display: flex; flex-direction: column; gap: 8px; }
.cond { display: inline-flex; align-items: center; gap: 4px; background: var(--sel); border: 1px solid var(--note-bd); border-radius: 14px; padding: 2px 4px 2px 10px; font-size: .8em; }
.data-wrap { flex: 1; min-height: 0; display: flex; flex-direction: column; background: var(--surface); border-radius: 8px; box-shadow: var(--shadow-sm); overflow: hidden; }
.data-wrap .tbl-wrap { flex: 1; }
.col-pop { max-height: 420px; overflow: auto; width: 330px; }
.col-pop .grp { margin-bottom: 8px; }
.col-pop .grp-h { font-size: .72em; font-weight: 700; text-transform: uppercase; color: var(--text-3); margin-bottom: 3px; display: flex; gap: 8px; align-items: center; }
.col-pop .grp-h a { font-weight: 400; text-transform: none; color: var(--primary); cursor: pointer; }
.col-pop .chk { width: 48%; font-size: .82em; margin: 1px 0; }

/* ── Fogyasztás ───────────────────────────────────── */
.cons-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 14px; }
.cons-chart { height: 300px; }

/* ── Beállítások ──────────────────────────────────── */
.settings-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(520px, 1fr)); gap: 16px; align-items: start; }
.settings-grid .wide { grid-column: 1 / -1; }
.save-bar { position: sticky; top: -16px; z-index: 5; background: var(--bg); padding: 4px 0 12px; display: flex; gap: 10px; align-items: center; }
.save-bar .dirty { color: var(--warn-fg); font-size: .85em; font-weight: 600; }
.edit-tbl td { padding: 4px 6px; }
.edit-tbl .form-input, .edit-tbl .form-select { width: 100%; }
.det-ports { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 10px; }
.progress { height: 20px; background: var(--surface-3); border: 1px solid var(--border); border-radius: 9px; overflow: hidden; position: relative; }
.progress .p-fill { height: 100%; background: linear-gradient(90deg, #27ae60, #2ecc71); transition: width .2s; }
.progress .p-text { position: absolute; inset: 0; text-align: center; font-family: var(--mono); font-size: 11.5px; line-height: 20px; font-weight: 600; color: var(--text-strong); }
.key-cell { display: flex; gap: 4px; align-items: center; }
.key-cell .form-input { flex: 1; }

/* ── Napló panel (mindkét témában sötét) ──────────── */
.side-panel { width: 380px; background: #2c3e50; color: #ecf0f1; display: flex; flex-direction: column; flex-shrink: 0; }
:root[data-theme="dark"] .side-panel { background: #111a23; border-left: 1px solid var(--line); }
.side-panel .panel-header { padding: 8px 14px; background: #1a252f; font-weight: 600; font-size: .85em; display: flex; justify-content: space-between; align-items: center; }
.log-search-bar { padding: 6px 10px; background: #34495e; border-bottom: 1px solid #1a252f; }
:root[data-theme="dark"] .log-search-bar { background: #18222d; }
.log-search-bar input { width: 100%; padding: 4px 8px; font-size: .78em; border: 1px solid #4a6278; border-radius: 3px; background: #2c3e50; color: #ecf0f1; font-family: var(--mono); }
.log-search-bar input:focus { outline: none; border-color: var(--primary); }
.log-area { flex: 1; overflow-y: auto; padding: 6px 10px; font-family: var(--mono); font-size: .72em; line-height: 1.5; }
.log-line { margin: 1px 0; word-break: break-all; }
.log-line .t { color: #7f8c8d; margin-right: 6px; }
.log-line.tx { color: #e67e22; } .log-line.rx { color: #1abc9c; } .log-line.err { color: #e74c3c; } .log-line.info { color: #3498db; }
.log-footer { padding: 6px 10px; background: #1a252f; display: flex; align-items: center; gap: 10px; }
.log-footer label { font-size: .75em; display: flex; align-items: center; gap: 4px; cursor: pointer; color: #95a5a6; }

/* ── Belépés, toast ───────────────────────────────── */
.login-overlay { position: fixed; inset: 0; background: var(--header-grad); display: flex; align-items: center; justify-content: center; z-index: 100; }
.login-card { background: var(--surface); color: var(--text); border-radius: 10px; box-shadow: 0 10px 40px rgba(0,0,0,.3); width: 360px; overflow: hidden; }
.login-head { background: var(--head); color: var(--head-text); padding: 14px 18px; font-weight: 600; font-size: 1.1em; }
.login-body { padding: 18px; display: flex; flex-direction: column; gap: 4px; }
.login-body .form-label { min-width: 100px; }
.login-body .form-input { flex: 1; }
.login-body .btn { align-self: flex-end; margin-top: 8px; }
.login-err { color: var(--err); font-size: .85em; min-height: 1.2em; }
.toast-wrap { position: fixed; right: 18px; bottom: 18px; display: flex; flex-direction: column; gap: 8px; z-index: 200; }
.toast { background: #2c3e50; color: #fff; padding: 9px 14px; border-radius: 6px; box-shadow: 0 4px 14px rgba(0,0,0,.25); font-size: .88em; max-width: 420px; animation: tin .2s; }
.toast.ok { background: #1e8449; } .toast.err { background: #b03a2e; }
@keyframes tin { from { transform: translateY(10px); opacity: 0; } }

@media (max-width: 1100px) {
  .trend-side { width: 250px; }
  .hdr-dev-label { display: none; }
  .settings-grid { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .header { flex-wrap: wrap; padding: 8px 12px; }
  .hdr-center { order: 3; flex: 1 1 100%; justify-content: flex-start; }
  .hdr-select { min-width: 0; flex: 1; }
  .content { padding: 12px; }
  .trend-layout { flex-direction: column; }
  .trend-side { width: auto; max-height: 260px; }
  .side-panel { position: fixed; right: 0; top: 0; bottom: 0; z-index: 50; width: 90vw; }
}

/* ── Tooltip (trend, fogyasztás) ──────────────────── */
.t-tip { position: absolute; z-index: 10; pointer-events: none; background: var(--tip-bg); border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow-pop); padding: 8px 11px; font-size: 14px; min-width: 195px; }
.t-tip .tt-h { font-family: var(--mono); font-weight: 700; color: var(--text-strong); margin-bottom: 4px; padding-bottom: 4px; border-bottom: 1px solid var(--line); }
.t-tip > div:not(.tt-h) { display: flex; align-items: center; gap: 6px; line-height: 1.6; color: var(--text-2); white-space: nowrap; }
.t-tip i { width: 12px; height: 3px; border-radius: 2px; display: inline-block; flex-shrink: 0; }
.t-tip b { margin-left: auto; padding-left: 12px; font-family: var(--mono); color: var(--text-strong); }
.t-tip span { color: var(--text-4); font-size: .9em; min-width: 26px; }

/* ── Modális ablak ────────────────────────────────── */
.modal-bg { position: fixed; inset: 0; background: rgba(10,16,22,.55); z-index: 90; display: flex; align-items: center; justify-content: center; padding: 20px; }
.modal { background: var(--surface); color: var(--text); border-radius: 10px; box-shadow: 0 20px 60px rgba(0,0,0,.35); width: min(900px, 100%); max-height: 90vh; overflow: auto; }
.hexdump { font-family: var(--mono); font-size: .78em; background: #111a23; color: #9fe0c5; padding: 10px 12px; border-radius: 6px; line-height: 1.7; word-break: break-all; white-space: pre-wrap; }
.hexdump span:hover { background: #2980b9; color: #fff; }
.content.no-pad-bottom { padding-bottom: 8px; }

/* görgetősáv sötétben */
:root[data-theme="dark"] ::-webkit-scrollbar { width: 11px; height: 11px; }
:root[data-theme="dark"] ::-webkit-scrollbar-track { background: var(--bg); }
:root[data-theme="dark"] ::-webkit-scrollbar-thumb { background: #2c3b4a; border-radius: 6px; border: 2px solid var(--bg); }
:root[data-theme="dark"] ::-webkit-scrollbar-thumb:hover { background: #3a4c5e; }

/* ── Beállítások: fülek, kompakt táblák, „⚙ / Haladó” ── */
.save-bar .spacer { flex: 1; }
.seg2.seg-lg button { font-size: .85em; padding: 5px 16px; }
.s-tab { display: flex; flex-direction: column; gap: 14px; }
.s-tab.settings-grid { display: grid; }
.section-head .lbl-h { font-weight: 400; opacity: .75; font-size: .9em; }
.section-head .form-select { padding: 2px 6px; font-size: .85em; }
.section-head .chk { font-weight: 500; }
.tbl.compact th, .tbl.compact td { padding: 3px 6px; }
.tbl .c-chk { width: 26px; text-align: center; }
.tbl .c-xs { width: 80px; } .tbl .c-s { width: 110px; }
.tbl .c-act { width: 1%; text-align: right; white-space: nowrap; }
.icon-btn.gear:hover, .icon-btn.gear.on { color: var(--primary); }
.adv-row td { background: var(--surface-2) !important; }
.adv-inline { display: flex; flex-wrap: wrap; gap: 6px 18px; align-items: center; font-size: .9em; padding: 3px 0; }
.adv-inline label { display: inline-flex; align-items: center; gap: 6px; color: var(--text-3); }
details.adv { margin-top: 10px; }
details.adv > summary { cursor: pointer; font-size: .75em; font-weight: 600; text-transform: uppercase; letter-spacing: .5px; color: var(--text-3); user-select: none; list-style: none; }
details.adv > summary::-webkit-details-marker { display: none; }
details.adv > summary::before { content: '▸ '; }
details.adv[open] > summary::before { content: '▾ '; }
.adv-body { padding-top: 8px; }
.dep-body { margin-top: 12px; }
.scan-panel { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); }
.mb-s { margin-bottom: 10px; }
.ellip { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; flex: 1; }
#view-settings { max-width: 1240px; }
.adv-inline .form-input { width: 80px; }
