:root {
  font-family: Inter, system-ui, sans-serif;
  color: #eef4ff;
  background: #07111f;
  color-scheme: dark;
}
html { scroll-padding-top: 16px; }
button:disabled { cursor: not-allowed; opacity: .55; }
a { color: #70edc9; }
input, select, button, video, fieldset, textarea { max-width: 100%; }
textarea { background:#0d1b2b; color:#eef4ff; border:1px solid #38536d; border-radius:12px; padding:12px; font:inherit; }
.preset-setting { display:grid; gap:8px; margin-top:12px; border:1px solid #38536d; border-radius:12px; }
pre, p, dd, strong { overflow-wrap: anywhere; }
pre { white-space:pre-wrap; }
.app-nav { display:flex; flex-wrap:wrap; gap:8px; margin:18px 0; }
.app-nav a { padding:10px 12px; background:#15273d; border-radius:12px; text-decoration:none; }
.install-bar { display:flex; flex-wrap:wrap; align-items:center; gap:8px; font-size:.85rem; color:#9fb1c6; }
.install-bar p { flex:1; min-width:180px; }
#qr-camera { width:100%; max-height:320px; background:#07111f; border-radius:12px; }
#stats-chart { display:grid; gap:8px; }
.energy-bar { display:grid; grid-template-columns:90px 1fr; align-items:center; gap:8px; text-align:left; font-size:.8rem; }
.energy-bar > span:last-child { grid-column:1 / -1; }
.bar-track { background:#07111f; height:12px; border-radius:6px; overflow:hidden; }
.bar-track > span { display:block; background:#29c69e; height:100%; }
dialog { color:#eef4ff; background:#15273d; border:1px solid #38536d; border-radius:18px; padding:20px; width:min(700px,calc(100% - 24px)); max-height:90vh; overflow:auto; }
dialog::backdrop { background:#020812cc; }
.sample-series { margin:16px 0; }
.sample-series svg { width:100%; height:auto; }
.sample-series text { font-size:12px; }
.range-editor { display:grid; gap:12px; padding-top:16px; }
.range-station { border-top:1px solid #38536d; margin-top:16px; padding-top:8px; }
#notification-settings fieldset { display:grid; gap:10px; border-radius:12px; }
@media (max-width:480px) { .row { flex-wrap:wrap; } .hero h1 { font-size:25px; } .two-column { align-items:start; flex-wrap:wrap; } }
* { box-sizing: border-box; }
body { margin: 0; background: radial-gradient(circle at top, #12304f, #07111f 52%); }
main { max-width: 760px; margin: auto; padding: 20px; min-height: 100vh; }
header, .row, .hero, .two-column { display: flex; gap: 10px; justify-content: space-between; align-items: center; }
.section-head { display: flex; gap: 12px; justify-content: space-between; align-items: start; }
.brand { font-weight: 850; letter-spacing: .08em; color: #65e0c2; }
.hidden { display: none !important; }
#station-select { width: 100%; max-width: 100%; }
button, input, select { border: 1px solid #38536d; border-radius: 12px; padding: 12px; background: #0d1b2b; color: #eef4ff; font: inherit; min-width: 0; }
button { font-weight: 750; cursor: pointer; background: #23354b; }
button:hover { border-color: #65e0c2; }
.ghost { background: transparent; }
.primary { background: #29c69e; color: #041712; }
.danger { background: #b43e54; }
.panel { display: grid; gap: 12px; background: rgba(21, 39, 61, .92); border: 1px solid #29445f; border-radius: 18px; padding: 16px; margin: 18px 0; }
.auth { margin-top: 50px; }
.panel h1, .panel h2 { margin: 0; }
.panel label { display: grid; gap: 7px; }
.hint, .message, small { color: #9fb1c6; }
.hero { margin: 28px 0 16px; }
.hero h1 { font-size: 31px; margin: 6px 0; }
.pill { padding: 8px 12px; border-radius: 99px; background: #26384d; white-space: nowrap; }
.pill.online { background: #123e37; color: #70edc9; }
.data-message, .command-message { margin: 8px 0; padding: 12px; border-radius: 12px; background: #463817; border: 1px solid #796128; color: #ffe3a1; overflow-wrap: anywhere; }
.command-message.success { background: #123e37; border-color: #287663; color: #a7f4dc; }
.command-message.error { background: #522735; border-color: #a34e62; color: #ffd1d9; }
.metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 9px; margin: 16px 0; }
.identity-metrics { grid-template-columns: repeat(3, 1fr); }
.metrics article { background: #15273d; border: 1px solid #29445f; border-radius: 16px; padding: 13px; }
.metrics span { display: block; color: #92a8bf; font-size: 12px; }
.metrics strong { display: block; margin-top: 7px; }
.passport-summary { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.passport-summary article { min-width: 0; padding: 12px; border-radius: 14px; background: #102238; }
.passport-summary span, .capability-card small { display: block; color: #92a8bf; font-size: 12px; }
.passport-summary strong { display: block; margin-top: 5px; overflow-wrap: anywhere; }
.status-badge { padding: 7px 10px; border-radius: 99px; background: #293c52; white-space: nowrap; font-size: 12px; }
.status-badge.verified { color: #70edc9; background: #123e37; }
.status-badge.declared { color: #ffd983; background: #493b19; }
.status-badge.unsupported { color: #ff9cae; background: #522735; }
.synthetic-warning { margin: 0; padding: 12px; border-radius: 12px; color: #ffe3a1; background: #463817; border: 1px solid #796128; }
details { border-top: 1px solid #29445f; padding-top: 12px; }
summary { cursor: pointer; font-weight: 750; }
.technical-grid { display: grid; grid-template-columns: minmax(120px, .7fr) 1.3fr; gap: 7px 12px; }
.technical-grid dt { color: #92a8bf; }
.technical-grid dd { margin: 0; overflow-wrap: anywhere; }
.capability-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.capability-card { min-width: 0; padding: 11px; border-radius: 12px; border: 1px solid #29445f; overflow-wrap: anywhere; }
.capability-card b { display: block; margin-bottom: 4px; }
.capability-card .verified { color: #70edc9; }
.capability-card .declared { color: #ffd983; }
.capability-card .unsupported { color: #ff9cae; }
button:disabled, input:disabled { opacity: .45; cursor: not-allowed; }
.actions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.two-column > * { flex: 1; margin: 0; display: grid; gap: 6px; }
.check { grid-template-columns: auto 1fr !important; justify-content: start; align-items: center; }
.check input { width: 20px; height: 20px; }
fieldset { border: 1px solid #38536d; border-radius: 12px; display: flex; flex-wrap: wrap; gap: 12px; }
fieldset label { display: flex !important; align-items: center; gap: 4px !important; }
fieldset:disabled { opacity: .45; }
.interval-row { display: grid; grid-template-columns: 1fr auto 1fr auto; gap: 9px; align-items: center; margin: 9px 0; }
.log { overflow: hidden; border: 1px solid #29445f; border-radius: 14px; }
.history-head { display: grid; grid-template-columns: 1fr 1fr; color: #9fb1c6; font-size: 12px; padding: 0 13px; }
.event { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding: 11px 13px; border-bottom: 1px solid #29445f; }
.event:last-child { border: 0; }
.event time, .event small { display: block; font-size: 12px; margin-top: 4px; }
.event dl { margin: 0; font-size: 12px; }
.event dt { color: #9fb1c6; }
.event dd { margin: 2px 0 7px; overflow-wrap: anywhere; }
.journal-pending { margin: 0; padding: 12px; border-radius: 12px; color: #ffe3a1; background: #463817; border: 1px solid #796128; }
.journal-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.journal-tab.active { background: #29c69e; color: #041712; border-color: #65e0c2; }
.event-filters { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; align-items: end; }
.event-filters label { min-width: 0; color: #9fb1c6; font-size: 12px; }
.event-filters input, .event-filters select { width: 100%; }
.event-journal { display: grid; gap: 10px; }
.user-event { min-width: 0; padding: 13px; border: 1px solid #29445f; border-radius: 14px; background: #0d1b2b; overflow-wrap: anywhere; }
.user-event h3, .user-event p { margin: 4px 0; }
.user-event-head { display: flex; gap: 10px; justify-content: space-between; align-items: start; }
.event-change { display: grid; grid-template-columns: 1fr auto 1fr; gap: 8px; align-items: center; margin-top: 10px; }
.event-value { padding: 9px; border-radius: 10px; background: #15273d; white-space: pre-wrap; }
.event-meta { color: #9fb1c6; font-size: 12px; }
.journal-connection { min-width: 0; padding: 14px; border: 1px solid #29445f; border-radius: 16px; background: #0d1b2b; }
.journal-connection + .journal-connection { margin-top: 12px; }
.journal-title { display: flex; gap: 10px; justify-content: space-between; align-items: center; }
.journal-title h3, .journal-title h4 { margin: 3px 0; }
.journal-total { display: grid; gap: 4px; padding: 12px; border-radius: 12px; background: #102238; }
.journal-total span, .journal-total small { color: #92a8bf; }
.journal-transactions { display: grid; gap: 10px; }
.journal-transaction { min-width: 0; padding: 12px; border-left: 3px solid #526a82; background: #15273d; border-radius: 10px; overflow-wrap: anywhere; }
.journal-transaction.active { border-left-color: #65e0c2; }
.journal-transaction p { margin: 7px 0; }
.journal-end { display: flex; flex-wrap: wrap; gap: 6px 14px; color: #c1cee0; }
.status-badge.active { color: #70edc9; background: #123e37; }
.status-badge.ended { color: #c8d4e2; background: #293c52; }
.journal-technical { margin-top: 12px; padding-top: 12px; border-top: 1px solid #29445f; }
.stats-days { display: grid; gap: 9px; }
.stats-day { display: grid; grid-template-columns: minmax(95px, 1fr) 1fr 1fr; gap: 8px; text-align: left; align-items: center; }
.stats-day small { grid-column: 1 / -1; color: #9fb1c6; }
.tariff-editor { display: grid; gap: 10px; margin-top: 12px; }
.tariff-zones { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.tariff-editor label { display: grid; gap: 5px; }
.tariff-editor input, .tariff-editor select { width: 100%; }
.advanced { display: none; }
body.expanded .advanced { display: grid; }
pre { white-space: pre-wrap; word-break: break-all; color: #65e0c2; }
footer { color: #748aa0; font-size: 12px; text-align: center; margin: 28px 0; }
@media (max-width: 620px) {
  main { padding: 14px; }
  .electrical { grid-template-columns: repeat(2, 1fr); }
  .actions { grid-template-columns: 1fr; }
  .interval-row { grid-template-columns: 1fr auto 1fr; }
  .remove-interval { grid-column: 1 / -1; }
  .event { grid-template-columns: 1fr; }
  .event-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stats-day { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 410px) {
  .row, .hero, .two-column { align-items: stretch; flex-direction: column; }
  .metrics, .identity-metrics { grid-template-columns: 1fr; }
  .metrics article { display: flex; justify-content: space-between; }
  .hero h1 { font-size: 27px; }
  .passport-summary, .capability-list { grid-template-columns: 1fr; }
  .section-head { align-items: stretch; flex-direction: column; }
  .status-badge { align-self: flex-start; }
  .technical-grid { grid-template-columns: 1fr; }
  .technical-grid dd { margin-bottom: 7px; }
  .journal-title { align-items: flex-start; }
  .event-filters { grid-template-columns: 1fr; }
  .user-event-head, .event-change { grid-template-columns: 1fr; display: grid; }
}
