:root {
  color-scheme: dark;
  --bg: #08090a;
  --panel: #101214;
  --panel-2: #151719;
  --panel-3: #1d2022;
  --line: #292c2f;
  --line-strong: #3a3e42;
  --text: #f4f1eb;
  --muted: #a4a5a4;
  --faint: #7f8284;
  --cyan: #f7931e;
  --green: #9bbb9d;
  --violet: #c4a0d8;
  --amber: #ffac3d;
  --red: #e27d68;
  --orange-deep: #9c4800;
  --shadow: 0 14px 34px rgba(0, 0, 0, .25);
}

* { box-sizing: border-box; }
html, body { min-height: 100%; height: 100%; overflow: hidden; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: "Aptos", "Helvetica Neue", Arial, sans-serif; font-size: 13px; letter-spacing: .005em; }
button { font: inherit; }
.app-shell { min-height: 100vh; display: flex; background: radial-gradient(circle at 72% -8%, rgba(247, 147, 30, .08), transparent 34%), var(--bg); }
.sidebar { width: 260px; flex: 0 0 260px; border-right: 1px solid var(--line); background: rgba(16, 18, 20, .92); padding: 20px 12px 14px; display: flex; flex-direction: column; }
.brand { display: flex; align-items: center; gap: 10px; padding: 0 10px 24px; }
.brand-mark { width: 25px; height: 25px; border: 1px solid rgba(247, 147, 30, .5); border-radius: 8px; display: flex; align-items: flex-end; justify-content: center; gap: 3px; padding: 5px; background: rgba(247, 147, 30, .08); box-shadow: inset 0 0 14px rgba(247, 147, 30, .08); }
.brand-mark span { width: 3px; border-radius: 3px; background: var(--cyan); display: block; }.brand-mark span:nth-child(1) { height: 7px; opacity: .55; }.brand-mark span:nth-child(2) { height: 12px; }.brand-mark span:nth-child(3) { height: 9px; opacity: .75; }
.brand-name { font-size: 14px; font-weight: 750; letter-spacing: .02em; }.brand-caption { color: var(--faint); font-size: 10px; margin-top: 3px; }
.sidebar-section-head { display: flex; align-items: center; justify-content: space-between; padding: 0 9px 8px; color: var(--faint); font-size: 9px; font-weight: 700; letter-spacing: .15em; }.count-badge { color: var(--muted); background: rgba(164, 165, 164, .1); padding: 2px 6px; border-radius: 99px; font-size: 9px; letter-spacing: 0; }
.meter-list { display: flex; flex-direction: column; gap: 4px; }.meter-item { border: 1px solid transparent; border-radius: 8px; padding: 10px 9px; cursor: pointer; transition: .18s ease; }.meter-item:hover { border-color: var(--line); background: rgba(255,255,255,.025); }.meter-item.is-active { border-color: rgba(247, 147, 30, .28); background: linear-gradient(100deg, rgba(247, 147, 30, .1), rgba(247, 147, 30, .025)); box-shadow: inset 3px 0 0 var(--cyan); }.meter-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }.meter-name { font-weight: 650; }.meter-ip { color: var(--muted); font-size: 11px; margin-top: 4px; font-variant-numeric: tabular-nums; }.meter-status { display: inline-flex; align-items: center; gap: 5px; color: var(--muted); font-size: 10px; margin-top: 6px; }.meter-status .status-dot { width: 5px; height: 5px; }
.status-dot, .live-dot, .mini-dot { display: inline-block; border-radius: 50%; }.status-dot { width: 7px; height: 7px; background: var(--faint); }.status-online .status-dot, .meter-status.online .status-dot { background: var(--green); box-shadow: 0 0 0 3px rgba(155, 187, 157, .1); }.status-offline .status-dot, .meter-status.offline .status-dot { background: var(--red); }.live-dot { width: 6px; height: 6px; background: var(--green); box-shadow: 0 0 0 3px rgba(155, 187, 157, .09); }
.sidebar-footer { margin-top: auto; }.bridge-card { border: 1px solid var(--line); background: rgba(255,255,255,.025); border-radius: 8px; padding: 9px; display: flex; align-items: center; gap: 8px; }.bridge-icon { width: 25px; height: 25px; display: grid; place-items: center; border-radius: 7px; background: rgba(155, 187, 157, .1); color: var(--green); font-size: 17px; }.bridge-title { font-size: 10px; font-weight: 650; }.bridge-subtitle { color: var(--faint); font-size: 9px; margin-top: 2px; }.bridge-card .live-dot { margin-left: auto; }.version { color: var(--faint); font-size: 9px; margin: 10px 3px 0; }
.main-content { min-width: 0; width: 100%; max-width: 1440px; height: 100vh; min-height: 0; margin: 0 auto; padding: 0 24px; display: flex; flex-direction: column; overflow: hidden; }.topbar { height: 62px; flex: 0 0 62px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }.breadcrumbs { color: var(--faint); font-size: 11px; }.breadcrumbs i { font-style: normal; color: var(--line-strong); padding: 0 7px; }.breadcrumbs strong { color: var(--muted); font-weight: 600; }.topbar-actions { display: flex; align-items: center; gap: 18px; }.connection-indicator { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 11px; }.button { border: 0; border-radius: 6px; padding: 8px 11px; color: var(--text); cursor: pointer; transition: .18s ease; font-size: 12px; }.button-secondary { border: 1px solid var(--line-strong); background: rgba(255,255,255,.035); color: var(--text); }.button-secondary:hover { background: rgba(247,147,30,.08); border-color: rgba(247,147,30,.45); color: var(--text); }.button-icon { color: var(--cyan); margin-right: 4px; font-size: 15px; vertical-align: -1px; }
.page-heading { padding: 24px 0 20px; display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; }.eyebrow { color: var(--cyan); font-weight: 750; font-size: 10px; letter-spacing: .14em; }.page-heading h1 { font-size: 30px; line-height: 1.15; letter-spacing: -.035em; margin: 0 0 8px; }.page-heading p { color: var(--muted); margin: 0; }.status-pill { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 99px; padding: 8px 12px; color: var(--muted); font-size: 12px; white-space: nowrap; }.status-pill.status-online { color: var(--green); border-color: rgba(80, 215, 160, .22); background: rgba(80, 215, 160, .06); }.status-pill.status-offline { color: var(--red); border-color: rgba(251,114,122,.22); background: rgba(251,114,122,.05); }.status-pill.status-reading { color: var(--cyan); border-color: rgba(72,215,231,.22); background: rgba(72,215,231,.06); }
.tabs { display: flex; gap: 26px; border-bottom: 1px solid var(--line); }.tab { position: relative; border: 0; color: var(--faint); background: none; padding: 0 1px 14px; cursor: pointer; font-size: 13px; }.tab:hover { color: var(--muted); }.tab.is-active { color: var(--text); }.tab.is-active::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; border-radius: 4px; background: var(--cyan); box-shadow: 0 0 12px rgba(72,215,231,.45); }.tab-icon { color: var(--faint); margin-right: 7px; }.tab.is-active .tab-icon { color: var(--cyan); }
.tab-panel { display: none; flex: 1 1 auto; min-height: 0; padding: 27px 0 5px; overflow-y: auto; overflow-x: hidden; scrollbar-gutter: stable; }.tab-panel.is-visible { display: block; }.tab-panel::-webkit-scrollbar { width: 8px; }.tab-panel::-webkit-scrollbar-track { background: transparent; }.tab-panel::-webkit-scrollbar-thumb { background: rgba(139,154,172,.28); border: 2px solid transparent; background-clip: padding-box; border-radius: 99px; }.hero-grid, .overview-grid, .measurement-grid, .operation-grid { display: grid; gap: 14px; }.hero-grid { grid-template-columns: 1.07fr .93fr; }.overview-grid { grid-template-columns: repeat(4, 1fr); }.measurement-grid { grid-template-columns: repeat(3, 1fr); }.card { border: 1px solid var(--line); background: linear-gradient(135deg, rgba(18, 25, 35, .97), rgba(12, 17, 24, .97)); border-radius: 11px; box-shadow: var(--shadow); }.balance-card, .identity-card { min-height: 190px; padding: 23px 25px; position: relative; overflow: hidden; }.balance-card::after { content: ""; position: absolute; width: 270px; height: 180px; right: -95px; bottom: -130px; background: rgba(72,215,231,.2); filter: blur(40px); border-radius: 50%; }.card-topline { display: flex; align-items: center; justify-content: space-between; position: relative; z-index: 1; }.card-label, .detail-label { color: var(--faint); font-size: 10px; font-weight: 750; letter-spacing: .13em; }.soft-chip, .obis-chip, .guard-chip { border: 1px solid var(--line); border-radius: 99px; padding: 4px 8px; color: var(--muted); font-size: 9px; font-weight: 700; letter-spacing: .07em; }.soft-chip { color: var(--cyan); border-color: rgba(72,215,231,.18); background: rgba(72,215,231,.05); }.obis-chip { letter-spacing: .02em; color: #718093; }.balance-value { position: relative; z-index: 1; font-size: 42px; font-weight: 720; letter-spacing: -.055em; margin: 23px 0 5px; font-variant-numeric: tabular-nums; }.balance-meta { display: flex; align-items: center; gap: 8px; color: var(--green); font-size: 12px; position: relative; z-index: 1; }.mini-dot { width: 6px; height: 6px; background: var(--green); }.balance-sparkline { height: 38px; display: flex; align-items: end; gap: 5px; opacity: .45; position: absolute; right: 24px; bottom: 23px; }.balance-sparkline span { width: 5px; border-radius: 4px; background: var(--cyan); }.balance-sparkline span:nth-child(1) { height: 12px; }.balance-sparkline span:nth-child(2) { height: 18px; }.balance-sparkline span:nth-child(3) { height: 14px; }.balance-sparkline span:nth-child(4) { height: 25px; }.balance-sparkline span:nth-child(5) { height: 19px; }.balance-sparkline span:nth-child(6) { height: 29px; }.balance-sparkline span:nth-child(7) { height: 23px; }.balance-sparkline span:nth-child(8) { height: 34px; }.balance-sparkline span:nth-child(9) { height: 27px; }.balance-sparkline span:nth-child(10) { height: 31px; }.balance-sparkline span:nth-child(11) { height: 36px; }.balance-sparkline span:nth-child(12) { height: 31px; }
.identity-value { font-size: 28px; font-weight: 680; letter-spacing: .015em; margin: 25px 0 10px; font-variant-numeric: tabular-nums; }.identity-meta { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 12px; }.identity-icon { color: var(--violet); }.identity-rule { border-top: 1px solid var(--line); margin: 19px 0 12px; }.identity-footer { display: flex; justify-content: space-between; color: var(--faint); font-size: 11px; }.identity-footer strong { color: var(--muted); font-weight: 600; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin: 32px 0 14px; }.section-heading h2 { font-size: 15px; letter-spacing: -.01em; margin: 0 0 5px; }.section-heading p { color: var(--muted); font-size: 12px; margin: 0; }.section-accent { width: 35px; height: 2px; background: var(--cyan); border-radius: 2px; opacity: .65; }.detail-card { min-height: 131px; padding: 18px; display: flex; gap: 13px; }.measurement-card { min-height: 124px; }.measurement-card .detail-value { font-size: 18px; }.detail-icon, .operation-icon { width: 31px; height: 31px; flex: 0 0 31px; display: grid; place-items: center; border-radius: 9px; font-size: 17px; }.detail-icon.cyan { color: var(--cyan); background: rgba(72,215,231,.1); }.detail-icon.violet { color: var(--violet); background: rgba(164,139,255,.1); }.detail-icon.green { color: var(--green); background: rgba(80,215,160,.1); }.detail-icon.amber { color: var(--amber); background: rgba(243,183,101,.1); }.detail-icon.red { color: var(--red); background: rgba(251,114,122,.1); }.detail-value { margin-top: 11px; font-size: 14px; font-weight: 650; word-break: break-word; font-variant-numeric: tabular-nums; }.detail-value.compact { font-size: 12px; line-height: 1.4; }.detail-note { color: var(--faint); font-size: 10px; margin-top: 6px; }
.error-banner { margin-top: 15px; color: #ffb0b4; background: rgba(251,114,122,.08); border: 1px solid rgba(251,114,122,.2); border-radius: 8px; padding: 11px 13px; font-size: 12px; }.hidden { display: none; }
.periodic-heading { margin-top: 0; }.table-card { overflow: hidden; }.table-header { display: flex; align-items: center; justify-content: space-between; padding: 17px 20px; border-bottom: 1px solid var(--line); font-size: 12px; font-weight: 650; }.table-muted { color: var(--faint); font-weight: 500; font-size: 11px; }.table-wrap { overflow-x: auto; }table { border-collapse: collapse; width: 100%; min-width: 650px; }th, td { padding: 14px 20px; border-bottom: 1px solid var(--line); text-align: left; font-size: 12px; }th { color: var(--faint); font-size: 10px; letter-spacing: .1em; font-weight: 700; text-transform: uppercase; }td { color: var(--muted); }td:first-child { color: var(--text); font-weight: 600; }.empty-cell { text-align: center; color: var(--faint); padding: 38px; }.info-callout, .safety-callout { margin-top: 15px; display: flex; align-items: flex-start; gap: 12px; padding: 17px 19px; }.callout-icon, .safety-icon { width: 23px; height: 23px; flex: 0 0 23px; display: grid; place-items: center; border-radius: 50%; color: var(--cyan); border: 1px solid rgba(72,215,231,.35); font-weight: 750; }.info-callout strong, .safety-callout strong { font-size: 12px; }.info-callout p, .safety-callout p { color: var(--muted); margin: 5px 0 0; line-height: 1.55; font-size: 12px; }
.guard-chip { color: var(--amber); border-color: rgba(243,183,101,.22); background: rgba(243,183,101,.05); display: inline-flex; align-items: center; gap: 5px; }.guard-chip.small { font-size: 9px; color: var(--faint); border-color: var(--line); background: transparent; }.operation-grid { grid-template-columns: repeat(3, 1fr); }.operation-card { padding: 20px; min-height: 245px; }.operation-head { display: flex; align-items: center; justify-content: space-between; }.operation-icon.red { color: var(--red); background: rgba(251,114,122,.1); }.operation-icon.amber { color: var(--amber); background: rgba(243,183,101,.1); }.operation-icon.green { color: var(--green); background: rgba(80,215,160,.1); }.operation-card h3 { font-size: 15px; margin: 18px 0 8px; }.operation-card p { color: var(--muted); font-size: 12px; line-height: 1.55; min-height: 57px; margin: 0 0 17px; }.button-disabled { background: rgba(255,255,255,.055); border: 1px solid var(--line); width: 100%; color: var(--faint); cursor: not-allowed; }.operation-note { color: var(--faint); font-size: 10px; line-height: 1.45; margin-top: 12px; }.safety-callout { border-color: rgba(80,215,160,.15); }.safety-icon { color: var(--green); border-color: rgba(80,215,160,.3); background: rgba(80,215,160,.06); }
.footer { color: #465364; border-top: 1px solid var(--line); margin-top: 46px; padding: 19px 0 25px; display: flex; justify-content: space-between; font-size: 10px; }.toast { position: fixed; right: 28px; bottom: 25px; opacity: 0; transform: translateY(8px); pointer-events: none; transition: .2s ease; background: #19232f; color: var(--text); border: 1px solid var(--line-strong); border-radius: 8px; box-shadow: var(--shadow); padding: 11px 14px; font-size: 12px; z-index: 5; }.toast.show { opacity: 1; transform: translateY(0); }
.balance-card, .identity-card { min-height: 160px; padding: 18px 20px; }.balance-value { margin: 18px 0 4px; }.identity-value { margin: 20px 0 8px; }.identity-rule { margin: 14px 0 9px; }.detail-card { min-height: 0; padding: 14px; gap: 11px; }.measurement-card { min-height: 0; padding: 14px; }.detail-value { margin-top: 8px; }.detail-note { margin-top: 4px; }
.sts-heading { margin-top: 28px; }.sts-card { margin-bottom: 2px; }.sts-table th, .sts-table td { padding-top: 10px; padding-bottom: 10px; }.sts-table td:first-child { width: 38%; }.sts-value { color: var(--text); font-variant-numeric: tabular-nums; }.sts-obis { color: var(--faint); font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 11px; }.sts-error { display: inline-block; margin-left: 8px; color: var(--amber); font-size: 10px; font-weight: 500; }
@media (max-width: 1050px) { .main-content { padding: 0 27px; }.overview-grid, .measurement-grid { grid-template-columns: repeat(2, 1fr); }.operation-grid { grid-template-columns: 1fr; }.operation-card { min-height: 0; } }
@media (max-width: 720px) { .app-shell { display: block; }.sidebar { width: auto; border-right: 0; border-bottom: 1px solid var(--line); padding: 18px 14px 14px; }.brand { padding-bottom: 18px; }.sidebar-footer { display: none; }.meter-list { flex-direction: row; overflow-x: auto; padding-bottom: 3px; }.meter-item { min-width: 210px; }.main-content { padding: 0 16px; }.topbar { height: 56px; flex-basis: 56px; }.topbar-actions { gap: 10px; }.connection-indicator { display: none; }.button-secondary { padding: 8px 10px; }.page-heading { padding: 20px 0 18px; align-items: flex-start; flex-direction: column; }.page-heading h1 { font-size: 26px; }.hero-grid, .overview-grid, .measurement-grid { grid-template-columns: 1fr; }.tabs { gap: 18px; overflow-x: auto; }.tab { white-space: nowrap; }.footer { gap: 10px; flex-wrap: wrap; } }
@media (max-width: 720px) { html, body { height: auto; min-height: 100%; overflow: auto; }.app-shell { min-height: 100vh; height: auto; overflow: visible; }.main-content { height: auto; min-height: 100vh; overflow: visible; display: block; }.tab-panel { flex: none; min-height: 0; overflow: visible; } }

/* Callysta Engineering palette and compact operational UI. */
h1, h2, h3, .brand-name, .tab, .button { font-family: "Arial Narrow", "Aptos Display", "Helvetica Neue", Arial, sans-serif; }
.main-content { padding-left: 24px; padding-right: 24px; }
.page-heading { padding-top: 20px; padding-bottom: 16px; }
.page-heading h1 { font-size: 26px; }
.tabs { gap: 22px; }
.tab { font-size: 12px; padding-bottom: 11px; }
.tab-panel { padding-top: 20px; }
.hero-grid, .overview-grid, .measurement-grid, .operation-grid { gap: 12px; }
.card { border-radius: 9px; box-shadow: var(--shadow); }
.card { background: linear-gradient(135deg, rgba(21, 23, 25, .97), rgba(16, 18, 20, .97)); }
.balance-card, .identity-card { min-height: 144px; padding: 16px 18px; }
.balance-value { font-size: 36px; margin: 16px 0 3px; }
.identity-value { font-size: 24px; margin: 16px 0 7px; }
.identity-rule { margin: 11px 0 8px; }
.section-heading { margin: 24px 0 10px; }
.section-heading h2 { font-size: 14px; margin-bottom: 4px; }
.section-heading p { font-size: 11px; }
.detail-card { padding: 12px; gap: 10px; }
.measurement-card { min-height: 0; }
.detail-icon, .operation-icon { width: 28px; height: 28px; flex-basis: 28px; border-radius: 7px; font-size: 15px; }
.detail-value { margin-top: 6px; font-size: 13px; }
.measurement-card .detail-value { font-size: 16px; }
.detail-value.compact { font-size: 11px; }
.detail-note { font-size: 9px; margin-top: 3px; }
.table-header { padding: 13px 16px; font-size: 11px; }
.table-muted { font-size: 10px; }
th, td { padding: 10px 16px; font-size: 11px; }
th { font-size: 9px; }
.empty-cell { padding: 28px; }
.sts-table th, .sts-table td { padding-top: 8px; padding-bottom: 8px; }
.sts-heading, .fault-heading { margin-top: 22px; }
.info-callout, .safety-callout { margin-top: 12px; gap: 10px; padding: 13px 15px; }
.operation-card { padding: 16px; min-height: 0; }
.operation-card h3 { font-size: 14px; margin: 14px 0 6px; }
.operation-card p { font-size: 11px; min-height: 0; margin-bottom: 13px; }
.operation-note { font-size: 9px; margin-top: 9px; }
.footer { margin-top: 28px; padding: 14px 0 18px; }
.balance-card::after { background: rgba(247, 147, 30, .16); }
.soft-chip { background: rgba(247, 147, 30, .06); }
.soft-chip { border-color: rgba(247, 147, 30, .22); }
.tab.is-active::after { box-shadow: 0 0 12px rgba(247, 147, 30, .35); }
.detail-icon.cyan { background: rgba(247, 147, 30, .1); }
.callout-icon { border-color: rgba(247, 147, 30, .35); }
.status-reading .status-dot { background: var(--cyan); box-shadow: 0 0 0 3px rgba(247, 147, 30, .1); }
.status-pill.status-reading { border-color: rgba(247, 147, 30, .22); background: rgba(247, 147, 30, .06); }
.button-disabled { background: rgba(255,255,255,.045); }
@media (max-width: 1050px) { .main-content { padding-left: 20px; padding-right: 20px; } }
@media (max-width: 720px) { .main-content { padding-left: 14px; padding-right: 14px; }.topbar { height: 52px; flex-basis: 52px; }.page-heading { padding-top: 16px; padding-bottom: 15px; }.page-heading h1 { font-size: 24px; }.tab-panel { padding-top: 16px; } }

/* Compact meter header with the original wider type treatment. */
body { font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; font-size: 14px; letter-spacing: .01em; }
h1, h2, h3, .brand-name, .tab, .button { font-family: inherit; }
.topbar { height: 54px; flex-basis: 54px; }
.page-heading { padding-top: 12px; padding-bottom: 10px; align-items: stretch; border-bottom: 1px solid var(--line); }
.page-heading-copy { display: flex; flex-direction: column; justify-content: flex-end; }
.page-heading h1 { font-size: 26px; }
.page-heading-side { display: flex; flex-direction: column; align-items: flex-end; justify-content: space-between; gap: 8px; }
.heading-controls { display: flex; align-items: center; justify-content: flex-end; gap: 8px; }
.button-icon-only { width: 32px; height: 32px; padding: 0; display: inline-grid; place-items: center; }
.button-icon-only .button-icon { margin: 0; }
.page-heading-side .tabs { gap: 20px; border-bottom: 0; }
.page-heading-side .tab { padding-bottom: 8px; }
.tab.is-active::after { bottom: 0; }
.tab-panel { padding-top: 16px; }
.tab-panel { margin-right: -12px; padding-right: 12px; }
.tab-panel > * { width: calc(100% + 12px); }
@media (max-width: 720px) { .topbar { height: 50px; flex-basis: 50px; }.page-heading { padding-top: 14px; padding-bottom: 10px; align-items: stretch; }.page-heading-side { align-items: flex-end; width: 100%; }.page-heading-side .tabs { max-width: 100%; overflow-x: auto; align-self: flex-end; }.page-heading h1 { font-size: 24px; } }

/* Single-line meter header: navigation sits immediately before status controls. */
.page-heading { padding-top: 9px; padding-bottom: 8px; align-items: center; min-height: 52px; }
.page-heading-copy { justify-content: center; }
.page-heading h1 { font-size: 24px; margin: 0; }
.page-heading-side { flex-direction: row; align-items: center; justify-content: flex-end; gap: 16px; }
.page-heading-side .tabs { gap: 16px; }
.page-heading-side .tab { padding-bottom: 7px; }
@media (max-width: 720px) { .page-heading { padding-top: 9px; padding-bottom: 8px; min-height: 0; align-items: flex-start; }.page-heading-copy { width: 100%; }.page-heading-side { width: 100%; align-items: center; justify-content: flex-end; gap: 10px; }.page-heading-side .tabs { max-width: calc(100% - 82px); overflow-x: auto; } }
@media (max-width: 720px) { .tab-panel { margin-right: 0; padding-right: 0; } }

/* Dynamic meter registry. */
.sidebar-head-actions { display: inline-flex; align-items: center; gap: 7px; }
.logout-button { color: var(--muted); font-size: 16px; }
.logout-button:hover { color: var(--text); border-color: rgba(247,147,30,.5); background: rgba(247,147,30,.08); }
.logout-icon { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.history-toolbar { display: flex; align-items: end; justify-content: space-between; gap: 14px; margin: 0 0 12px; }
.history-dates { display: flex; gap: 8px; }
.history-toolbar label { display: grid; gap: 5px; color: var(--faint); font-size: 10px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.history-toolbar input, .history-toolbar select { height: 32px; padding: 0 9px; border: 1px solid var(--line-strong); border-radius: 6px; background: rgba(255,255,255,.035); color: var(--text); font: inherit; font-size: 12px; letter-spacing: 0; text-transform: none; }
.history-toolbar input:focus, .history-toolbar select:focus { border-color: rgba(247,147,30,.7); outline: none; box-shadow: 0 0 0 2px rgba(247,147,30,.12); }
.history-toolbar select { color-scheme: dark; background-color: var(--panel); color: var(--text); }
.history-toolbar select option { background-color: var(--panel); color: var(--text); }
.history-type { min-width: 160px; }
@media (max-width: 600px) { .history-toolbar { align-items: stretch; flex-direction: column; }.history-dates { justify-content: space-between; }.history-dates label, .history-dates input, .history-type, .history-type select { flex: 1; width: 100%; } }
.manage-meters-button { border: 1px solid var(--line-strong); border-radius: 5px; padding: 3px 7px; color: var(--muted); background: transparent; cursor: pointer; font-size: 10px; letter-spacing: 0; transition: .18s ease; }
.manage-meters-button:hover { color: var(--text); border-color: rgba(247,147,30,.5); background: rgba(247,147,30,.08); }
.meter-type { color: var(--muted); font-weight: 500; }
.meter-id { color: var(--text); font-size: 11px; margin-top: 5px; font-variant-numeric: tabular-nums; letter-spacing: .02em; }

.registry-dialog { width: min(1080px, calc(100vw - 32px)); max-height: calc(100vh - 32px); padding: 0; border: 1px solid var(--line-strong); border-radius: 11px; background: var(--panel); color: var(--text); box-shadow: 0 24px 70px rgba(0,0,0,.55); }
.registry-dialog::backdrop { background: rgba(0,0,0,.72); backdrop-filter: blur(3px); }
.registry-dialog-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; padding: 18px 20px 15px; border-bottom: 1px solid var(--line); }
.registry-dialog-header h2 { margin: 5px 0 4px; font-size: 18px; letter-spacing: -.02em; }
.registry-dialog-header p { margin: 0; color: var(--muted); font-size: 11px; }
.registry-close { border: 1px solid var(--line); border-radius: 6px; width: 28px; height: 28px; padding: 0; color: var(--muted); background: transparent; cursor: pointer; font-size: 19px; line-height: 1; }
.registry-close:hover { color: var(--text); border-color: var(--line-strong); }
.registry-form { display: grid; grid-template-columns: repeat(4, minmax(130px, 1fr)) auto; align-items: end; gap: 10px; padding: 15px 20px; border-bottom: 1px solid var(--line); }
.registry-form label { display: grid; gap: 5px; color: var(--faint); font-size: 10px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.registry-form input { width: 100%; min-width: 0; height: 34px; padding: 0 9px; border: 1px solid var(--line-strong); border-radius: 6px; outline: none; background: rgba(255,255,255,.035); color: var(--text); font: inherit; font-size: 12px; letter-spacing: 0; text-transform: none; }
.registry-form input:focus { border-color: rgba(247,147,30,.7); box-shadow: 0 0 0 2px rgba(247,147,30,.12); }
.registry-form-actions { display: flex; gap: 7px; }
.button-primary { border: 1px solid rgba(247,147,30,.65); background: var(--cyan); color: #17110a; font-weight: 700; white-space: nowrap; }
.button-primary:hover { background: var(--amber); }
.registry-table-wrap { max-height: min(52vh, 480px); overflow: auto; }
.registry-table { min-width: 760px; }
.registry-table th, .registry-table td { padding: 11px 15px; vertical-align: middle; }
.registry-table td { white-space: nowrap; }
.registry-mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 11px; }
.registry-status { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 11px; }
.registry-status .status-dot { width: 6px; height: 6px; }
.registry-status.online { color: var(--green); }
.registry-status.online .status-dot { background: var(--green); }
.registry-status.offline { color: var(--red); }
.registry-status.offline .status-dot { background: var(--red); }
.registry-status.reading { color: var(--amber); }
.registry-status.reading .status-dot { background: var(--amber); }
.registry-row-actions { display: inline-flex; gap: 5px; }
.table-action { border: 1px solid var(--line-strong); border-radius: 5px; padding: 5px 8px; color: var(--muted); background: transparent; cursor: pointer; font-size: 10px; }
.table-action:hover { color: var(--text); border-color: rgba(247,147,30,.5); background: rgba(247,147,30,.08); }
.table-action-danger:hover { color: var(--red); border-color: rgba(226,125,104,.45); background: rgba(226,125,104,.08); }
@media (max-width: 820px) { .registry-form { grid-template-columns: repeat(2, 1fr); }.registry-form-actions { grid-column: 1 / -1; }.registry-form-actions .button { flex: 1; } }
@media (max-width: 720px) { .registry-dialog { width: calc(100vw - 20px); max-height: calc(100vh - 20px); }.registry-dialog-header { padding: 15px; }.registry-form { padding: 13px 15px; }.registry-table th, .registry-table td { padding-left: 12px; padding-right: 12px; } }
@media (max-width: 720px) { .tab-panel > * { width: 100%; } }

/* Show progress on the exact card whose DLMS value is currently being read. */
.card { position: relative; }
.card-topline-tools, .table-header-tools { display: inline-flex; align-items: center; gap: 8px; }
.card-loading { display: none; align-items: center; gap: 5px; color: var(--amber); font-size: 9px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; white-space: nowrap; }
.card-loading.is-visible { display: inline-flex; }
.detail-card > .card-loading { position: absolute; top: 11px; right: 12px; }
.loading-spinner { width: 10px; height: 10px; border: 1px solid rgba(247,147,30,.28); border-top-color: var(--amber); border-radius: 50%; animation: card-spin .8s linear infinite; }
.card.is-reading { border-color: rgba(247,147,30,.34); }
@keyframes card-spin { to { transform: rotate(360deg); } }

/* Keep STS and Fault/Alert/Tamper table columns on the same vertical guides. */
.sts-table { table-layout: fixed; }
.sts-table th:nth-child(1), .sts-table td:nth-child(1) { width: 38%; }
.sts-table th:nth-child(2), .sts-table td:nth-child(2) { width: 30%; }
.sts-table th:nth-child(3), .sts-table td:nth-child(3) { width: 32%; }
.sts-table td { overflow-wrap: anywhere; }
.sts-card { margin-top: 22px; }
.fault-card { margin-top: 22px; }

/* Extend only the scroll container so the cards keep their existing right edge. */
.tab-panel { margin-right: -20px; padding-right: 20px; }
@media (max-width: 720px) { .tab-panel { margin-right: 0; padding-right: 0; } }

/* Top-up credit card (Operations tab). */
.topup-field { display: grid; gap: 8px; margin-bottom: 2px; }
.topup-field label { display: grid; gap: 6px; color: var(--muted); font-size: 10px; font-weight: 700; letter-spacing: .08em; }
.topup-field input { height: 34px; padding: 0 9px; border: 1px solid var(--line-strong); border-radius: 6px; background: rgba(255,255,255,.035); color: var(--text); font: inherit; font-size: 13px; }
.topup-field input:focus { border-color: rgba(247,147,30,.7); outline: none; box-shadow: 0 0 0 2px rgba(247,147,30,.12); }
#topup-prepare-button { width: 100%; }
.topup-status { min-height: 16px; font-size: 11px; color: var(--muted); margin: 8px 0 0; }
.topup-status.is-error { color: #e27d68; }
.topup-result { margin-top: 10px; border: 1px solid var(--line-strong); border-radius: 8px; padding: 10px 12px; display: grid; gap: 6px; font-size: 12px; }
.topup-result.hidden { display: none; }
.topup-token { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 15px; letter-spacing: .06em; color: var(--amber); overflow-wrap: anywhere; }
.topup-row { display: flex; justify-content: space-between; gap: 10px; color: var(--muted); }
.topup-row strong { color: var(--text); font-variant-numeric: tabular-nums; text-align: right; }
.topup-row .delta { color: var(--green); }
.topup-actions { display: flex; gap: 8px; margin-top: 4px; }
.topup-actions .button { flex: 1; }

/* Limiter card reuses the top-up form styles for a consistent look. */
#limiter-prepare-button { width: 100%; }

/* Histories and Operations open directly with a section heading. */
#tab-periodic, #tab-operations { padding-top: 8px; }

/* First heading in a tab sits directly under the page rule. */
.tab-panel > .section-heading:first-child { margin-top: 0; }

/* Busy state for action buttons (token generation / submission). */
.button.is-loading { opacity: .65; cursor: wait; }
.button .loading-spinner { width: 12px; height: 12px; display: inline-block; vertical-align: -2px; margin-right: 7px; }
.button-primary .loading-spinner { border-color: rgba(23,17,10,.3); border-top-color: #17110a; }

/* Payment-mode and tamper cards reuse the top-up form styles. */
.operation-icon.violet { color: var(--violet); background: rgba(164,139,255,.1); }
.operation-icon.cyan { color: var(--cyan); background: rgba(72,215,231,.1); }
.topup-field select { height: 34px; padding: 0 9px; border: 1px solid var(--line-strong); border-radius: 6px; background: rgba(255,255,255,.035); color: var(--text); font: inherit; font-size: 13px; }
.topup-field select:focus { border-color: rgba(247,147,30,.7); outline: none; box-shadow: 0 0 0 2px rgba(247,147,30,.12); }
#paymode-submit-button, #tamper-prepare-button { width: 100%; }

/* Dark dropdown options for card selects (same as history toolbar). */
.topup-field select option { background-color: var(--panel); color: var(--text); }

/* Content fills the available horizontal space instead of centering. */
.main-content { max-width: none; margin: 0; }

/* Compact sidebar with collapse and resize. */
.sidebar { width: var(--sidebar-width, 240px); flex: 0 0 var(--sidebar-width, 240px); padding: 16px 10px 12px; position: relative; }
.brand { padding: 0 6px 18px; }
.sidebar-toggle { margin-left: auto; border: 1px solid var(--line-strong); border-radius: 5px; padding: 2px 7px; color: var(--muted); background: transparent; cursor: pointer; font-size: 11px; line-height: 1.4; transition: .18s ease; }
.sidebar-toggle:hover { color: var(--text); border-color: rgba(247,147,30,.5); background: rgba(247,147,30,.08); }
.sidebar-resizer { position: absolute; top: 0; right: -3px; width: 6px; height: 100%; cursor: ew-resize; z-index: 5; }
.sidebar-resizer:hover, .sidebar-resizer.is-dragging { background: rgba(247,147,30,.25); }
.app-shell.is-collapsed .sidebar { --sidebar-width: 54px; width: 54px; flex-basis: 54px; padding-left: 8px; padding-right: 8px; }
.app-shell.is-collapsed .brand { justify-content: center; padding-left: 0; padding-right: 0; }
.app-shell.is-collapsed .brand > div:nth-child(2), .app-shell.is-collapsed .sidebar-section-head, .app-shell.is-collapsed .meter-name, .app-shell.is-collapsed .meter-id, .app-shell.is-collapsed .meter-ip, .app-shell.is-collapsed .bridge-card > div:nth-child(2), .app-shell.is-collapsed .bridge-card .live-dot, .app-shell.is-collapsed .sidebar-resizer { display: none; }
.app-shell.is-collapsed .sidebar-toggle { display: none; }
.app-shell.is-collapsed .brand-mark { cursor: pointer; }
.app-shell.is-collapsed .meter-row { justify-content: center; }
.app-shell.is-collapsed .meter-item { padding-left: 4px; padding-right: 4px; text-align: center; }
.app-shell.is-collapsed .meter-status { margin-top: 0; }
.app-shell.is-collapsed .sidebar-footer .bridge-card { justify-content: center; }
@media (max-width: 720px) { .sidebar-toggle, .sidebar-resizer { display: none; } }

/* Meter list rows are flat; selection shows as a side accent only. */
.meter-item { border: 0; border-left: 3px solid transparent; border-radius: 0; }
.meter-item:hover { border-color: transparent; border-left-color: var(--line-strong); background: rgba(255,255,255,.03); }
.meter-item.is-active { border: 0; border-left: 3px solid var(--cyan); border-radius: 0; background: rgba(247,147,30,.08); box-shadow: none; }

/* Brand title stays on one line; minimum sidebar width fits it. */
.brand-name { white-space: nowrap; }

/* Brand row shares the page-heading geometry so icon, title, and the
collapse button sit on the content title's vertical center. */
.sidebar { padding-top: 0; }
.brand { min-height: 52px; padding: 9px 6px 8px; }

/* Brand row never wraps or pushes the toggle out. */
.brand > div:nth-child(2) { min-width: 0; flex-shrink: 1; }
.sidebar-toggle { flex-shrink: 0; }

/* History dates sit right-aligned, directly left of the history type. */
.history-toolbar { justify-content: flex-end; }

/* Histories header: title left, controls right on one row. */
.history-heading { align-items: flex-end; }
.history-controls { display: flex; align-items: flex-end; gap: 8px; }
.history-type-buttons { display: inline-flex; border: 1px solid var(--line-strong); border-radius: 6px; overflow: hidden; background: rgba(255,255,255,.035); }
.history-type-buttons button { border: 0; background: transparent; color: var(--muted); font-size: 14px; height: 32px; min-width: 38px; padding: 0 8px; cursor: pointer; transition: .18s ease; }
.history-type-buttons button + button { border-left: 1px solid var(--line); }
.history-type-buttons button:hover { color: var(--text); background: rgba(247,147,30,.08); }
.history-type-buttons button.is-active { color: #17110a; background: var(--cyan); font-weight: 700; }
.history-controls .history-dates { display: flex; gap: 8px; }
.history-controls .history-dates input { height: 32px; padding: 0 9px; border: 1px solid var(--line-strong); border-radius: 6px; background: rgba(255,255,255,.035); color: var(--text); font: inherit; font-size: 12px; color-scheme: dark; }
.history-controls .history-dates input:focus { border-color: rgba(247,147,30,.7); outline: none; box-shadow: 0 0 0 2px rgba(247,147,30,.12); }
@media (max-width: 720px) { .history-heading { align-items: flex-start; flex-direction: column; } .history-controls { width: 100%; justify-content: flex-end; flex-wrap: wrap; } }

/* Monotone history-type icons follow the button color. */
.history-type-buttons svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; vertical-align: -3px; }

/* Date group header inside grouped history tables. */
.history-day-row td { background: rgba(255,255,255,.03); color: var(--text); font-weight: 700; font-size: 11px; letter-spacing: .04em; }

/* History grid: own scroll viewport with sticky headers filling the client height. */
#tab-periodic.is-visible { display: flex; flex-direction: column; overflow: hidden; }
#tab-periodic .table-card { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
#tab-periodic .table-wrap { flex: 1 1 auto; min-height: 0; overflow: auto; }
#tab-periodic thead th { position: sticky; top: 0; z-index: 1; background: var(--panel); }

/* Slim date separator inside grouped history tables. */
.history-day-row td { padding-top: 4px; padding-bottom: 4px; }

/* History tables size to their content instead of stretching. */
#tab-periodic table { width: auto; min-width: 0; }
#tab-periodic th, #tab-periodic td { white-space: nowrap; }
