@font-face { font-family: "Titillium Web"; src: url("/assets/fonts/titillium-web-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Titillium Web"; src: url("/assets/fonts/titillium-web-600.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Titillium Web"; src: url("/assets/fonts/titillium-web-700.woff2") format("woff2"); font-weight: 700; font-display: swap; }

:root {
  --orange: #f68d2e;
  --orange-dark: #dc6e08;
  --orange-soft: #fff1e4;
  --ink: #101820;
  --slate: #3f4444;
  --muted: #75787b;
  --blue: #34657f;
  --page: #f5f7f8;
  --card: #fff;
  --border: #e1e5e8;
  --green: #2ba84a;
  --green-soft: #eaf7ed;
  --red: #d64545;
  --red-soft: #fff0f0;
  --shadow: 0 8px 30px rgba(16, 24, 32, .07);
  --sidebar: 286px;
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--page); }
body { margin: 0; font-family: "Titillium Web", system-ui, sans-serif; color: var(--ink); background: var(--page); line-height: 1.35; }
button, input, select { font: inherit; }
button { color: inherit; }
[hidden] { display: none !important; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

.app-shell { min-height: 100vh; }
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 50;
  display: flex;
  width: var(--sidebar);
  flex-direction: column;
  overflow: hidden;
  border-right: 1px solid var(--border);
  background: #fff;
}
.brand-lockup { padding: 28px 26px 24px; text-align: center; }
.brand-lockup img { display: block; width: 220px; max-width: 100%; height: 48px; margin: 0 auto; object-fit: contain; }
.brand-lockup span { display: block; margin-top: 1px; color: var(--orange-dark); font-size: 1rem; font-weight: 600; }
.tabs { position: relative; z-index: 2; display: grid; gap: 2px; padding: 24px 12px; }
.tab {
  position: relative;
  display: flex;
  width: 100%;
  align-items: center;
  gap: 18px;
  padding: 15px 20px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #65717c;
  text-align: left;
  cursor: pointer;
  transition: color .15s ease, background .15s ease;
}
.tab::before { position: absolute; inset: 0 auto 0 -12px; width: 3px; content: ""; background: transparent; }
.tab i { width: 22px; color: #7b8a96; font-size: 1.05rem; text-align: center; }
.tab span { font-size: 1rem; font-weight: 600; }
.tab:hover { color: var(--orange-dark); background: #fff8f2; }
.tab.active { color: var(--orange-dark); background: linear-gradient(90deg, rgba(246, 141, 46, .1), rgba(246, 141, 46, .03)); }
.tab.active::before { background: var(--orange); }
.tab.active i { color: var(--orange); }
.sidebar-illustration {
  position: absolute;
  inset: 310px 0 72px;
  z-index: 0;
  background: url("/assets/brand/sidebar-technical.png") center bottom / 100% auto no-repeat;
  opacity: .72;
  pointer-events: none;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0%, #000 28%, #000 100%);
  mask-image: linear-gradient(to bottom, transparent 0%, #000 28%, #000 100%);
}
.user-card {
  position: relative;
  z-index: 3;
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) 34px;
  align-items: center;
  gap: 10px;
  margin: auto 14px 16px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(255, 255, 255, .94);
  box-shadow: 0 4px 18px rgba(16, 24, 32, .04);
}
.avatar { display: grid; width: 40px; height: 40px; place-items: center; border-radius: 50%; color: #fff; background: #283640; font-weight: 600; }
.user-card-copy { min-width: 0; }
.user-card-copy strong, .user-card-copy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-card-copy strong { font-size: .9rem; }
.user-card-copy small { color: var(--orange-dark); font-size: .76rem; }

.workspace { position: relative; min-height: 100vh; margin-left: var(--sidebar); }
.topbar { position: absolute; top: 14px; right: 28px; z-index: 30; display: flex; min-height: 0; align-items: center; padding: 0; }
.topbar-spacer { flex: 1; }
.mobile-menu { display: none !important; }
.language-selector { position: relative; z-index: 100; }
.current-language {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  cursor: pointer;
}
.current-language:hover, .current-language[aria-expanded="true"] { border-color: var(--border); background: #fff; }
.current-language .fa-chevron-down { font-size: .65rem; }
.og-language-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 180px;
  padding: 6px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  box-shadow: var(--shadow);
}
.language-option { display: block; width: 100%; padding: 9px 11px; border: 0; border-radius: 6px; background: transparent; text-align: left; cursor: pointer; }
.language-option:hover { color: var(--orange-dark); background: var(--orange-soft); }
.page-content { width: min(1420px, calc(100% - 52px)); margin: 0 auto; padding: 22px 0 48px; }
.page-heading { display: grid; grid-template-columns: minmax(420px, 1fr) minmax(600px, 680px); gap: 34px; align-items: center; margin: 0 0 16px; }
.page-heading > div:first-child { padding: 8px 8px 8px 0; }
.section-kicker { color: var(--orange-dark); font-size: .72rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.page-heading h1 { margin: 1px 0 6px; font-size: clamp(2.25rem, 3.3vw, 3.75rem); font-weight: 700; letter-spacing: -.035em; line-height: 1; }
.page-heading p { margin: 0; color: var(--muted); font-size: .96rem; }

.hero-status {
  position: relative;
  min-height: 200px;
  overflow: visible;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
  box-shadow: var(--shadow);
}
.hero-status > img { position: absolute; top: 0; bottom: 0; left: -8%; width: 108%; height: 100%; object-fit: contain; object-position: center; border-radius: 12px; }
.hero-status::after { position: absolute; inset: 0; content: ""; background: linear-gradient(90deg, rgba(255,255,255,.98) 0%, rgba(255,255,255,.94) 25%, rgba(255,255,255,.12) 58%, transparent 100%); }
.hero-status::after { border-radius: 12px; pointer-events: none; }
.hero-metrics { position: relative; z-index: 2; display: grid; width: 245px; gap: 7px; padding: 13px 16px; }
.hero-metrics > div { display: grid; grid-template-columns: 18px 1fr; column-gap: 9px; align-items: center; }
.hero-metrics i, .hero-metrics .status-dot { grid-row: 1 / 3; justify-self: center; color: #6d7c87; }
.hero-metrics strong { font-size: .95rem; }
.hero-metrics small { color: var(--muted); font-size: .72rem; }
.hero-source-picker { margin: 0; }
.hero-source-picker select { min-height: 32px; padding: 4px 28px 4px 9px; border-color: #e2e7e9; background: rgba(255, 255, 255, .9); font-size: .78rem; font-weight: 600; }
.hero-state { position: relative; display: block !important; }
.hero-status-trigger { display: inline-flex; min-width: 0; align-items: center; gap: 8px; padding: 0; border: 0; background: transparent; text-align: left; cursor: pointer; }
.hero-status-trigger:hover strong, .hero-status-trigger[aria-expanded="true"] strong { color: var(--orange-dark); }
.hero-status-trigger:disabled { cursor: default; }
.hero-status-trigger:disabled:hover strong { color: inherit; }
.hero-state > small { grid-column: 2; display: block; margin-left: 27px; }
.hero-issues-popover {
  position: absolute;
  top: 36px;
  left: -2px;
  z-index: 80;
  width: min(370px, calc(100vw - 42px));
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 18px 48px rgba(16, 24, 32, .2);
}
.hero-issues-header { display: flex; align-items: center; justify-content: space-between; padding: 10px 10px 8px 13px; border-bottom: 1px solid var(--border); }
.hero-issues-list { max-height: 290px; overflow-y: auto; padding: 6px; }
.hero-issue-row { display: grid; width: 100%; grid-template-columns: 10px minmax(0, 1fr) auto; gap: 9px; align-items: center; padding: 9px; border: 0; border-radius: 7px; background: transparent; text-align: left; cursor: pointer; }
.hero-issue-row:hover, .hero-issue-row:focus-visible { outline: 0; background: var(--orange-soft); }
.hero-issue-dot { width: 8px; height: 8px; border-radius: 50%; }
.hero-issue-copy { min-width: 0; }
.hero-issue-copy strong, .hero-issue-copy small { display: block; }
.hero-issue-copy strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hero-issue-copy small { color: var(--muted); line-height: 1.25; }
.hero-issue-row > i { color: #8d989f; font-size: .75rem; }
.hero-no-issues { margin: 0; padding: 14px; color: var(--muted); text-align: center; }
.status-dot.warning, .hero-issue-dot.warning { background: #e6a21a; box-shadow: 0 0 0 4px rgba(230,162,26,.12); }
.status-dot.critical, .hero-issue-dot.critical { background: var(--red); box-shadow: 0 0 0 4px rgba(214,69,69,.11); }
.status-dot.healthy, .hero-issue-dot.healthy { background: var(--green); box-shadow: 0 0 0 4px rgba(43,168,74,.11); }

.view { display: none; }
.view.active { display: block; }
.surface { border: 1px solid var(--border); border-radius: 12px; background: var(--card); box-shadow: var(--shadow); }
.section-card { padding: 22px; }
.card-heading { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 18px; }
.card-heading > span { display: grid; width: 34px; height: 34px; flex: 0 0 auto; place-items: center; border-radius: 8px; color: var(--orange-dark); background: var(--orange-soft); }
.card-heading h2 { margin: 0; font-size: 1.15rem; line-height: 1.2; }
.card-heading p { margin: 3px 0 0; color: var(--muted); font-size: .82rem; }
.card-heading.compact { margin-bottom: 14px; }
.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(140px, 1fr)); gap: 14px; margin-bottom: 16px; }
.metric {
  display: grid;
  grid-template-columns: 38px 1fr;
  gap: 0 13px;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: #fff;
  box-shadow: 0 5px 20px rgba(16,24,32,.04);
}
.metric i { grid-row: 1 / 3; display: grid; width: 38px; height: 38px; place-items: center; border-radius: 9px; color: var(--orange-dark); background: var(--orange-soft); }
.metric span { color: var(--muted); font-size: .78rem; }
.metric strong { font-size: 1.65rem; line-height: 1.05; }

.two-column { display: grid; grid-template-columns: minmax(320px, 440px) 1fr; gap: 16px; align-items: start; }
.mapping-layout { display: grid; grid-template-columns: minmax(340px, 36%) 1fr; gap: 16px; align-items: start; }
.mapping-main { display: grid; gap: 14px; }
.forwarding-layout { display: grid; grid-template-columns: minmax(420px, 1.15fr) minmax(300px, .85fr); gap: 16px; align-items: start; }
.tree-panel { min-height: 674px; }
.channel-panel { min-height: 0; }

label { display: grid; gap: 6px; margin: 13px 0; color: #5f6d78; font-size: .82rem; }
input, select {
  width: 100%;
  min-height: 40px;
  padding: 9px 12px;
  border: 1px solid #d3dade;
  border-radius: 7px;
  color: var(--ink);
  background: #fff;
  transition: border .15s ease, box-shadow .15s ease;
}
input:focus, select:focus { outline: 0; border-color: var(--orange); box-shadow: 0 0 0 3px rgba(246,141,46,.14); }
input[readonly] { background: #fbfcfc; }
.field { position: relative; display: block; }
.field > i { position: absolute; top: 50%; left: 13px; z-index: 1; color: #87939c; transform: translateY(-50%); }
.field input { padding-left: 38px; }
.muted { color: var(--muted); }
small.muted { line-height: 1.25; }
.button {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 9px 17px;
  border: 0;
  border-radius: 7px;
  cursor: pointer;
  font-weight: 600;
  transition: transform .12s ease, background .12s ease, box-shadow .12s ease;
}
.button:hover { transform: translateY(-1px); }
.button:disabled { color: #f8f9f9; background: #bfc7cb; box-shadow: none; opacity: 1; cursor: not-allowed; transform: none; }
.button.primary { color: #fff; background: linear-gradient(135deg, var(--orange), #ff7800); box-shadow: 0 5px 14px rgba(246,141,46,.22); }
.button.primary:hover { background: linear-gradient(135deg, #ff9a3d, var(--orange-dark)); }
.button.primary:disabled, .button.primary:disabled:hover { color: #f8f9f9; background: #bfc7cb; box-shadow: none; }
.button.secondary { color: var(--blue); background: #edf5f8; }
.button.danger { color: var(--red); background: var(--red-soft); }
.button.wide { width: 100%; }
.icon-button {
  display: inline-grid;
  width: 34px;
  height: 34px;
  padding: 0;
  place-items: center;
  border: 0;
  border-radius: 7px;
  color: #6f7c86;
  background: transparent;
  cursor: pointer;
}
.icon-button:hover { color: var(--orange-dark); background: var(--orange-soft); }
.error { min-height: 1.2em; color: var(--red); }
.discovery-button { margin-bottom: 8px; }
.discovered-sources { display: grid; gap: 7px; margin: 8px 0 14px; }
.discovered-source { padding: 10px 12px; border: 1px solid var(--border); border-radius: 7px; background: #fff; text-align: left; cursor: pointer; }
.discovered-source:hover { border-color: var(--orange); background: var(--orange-soft); }

.source-list { display: grid; gap: 10px; }
.source-item { position: relative; padding: 16px; border: 1px solid var(--border); border-radius: 10px; background: #fff; transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease; }
.source-item:hover, .source-item:focus-within { border-color: rgba(246,141,46,.6); box-shadow: 0 7px 24px rgba(16,24,32,.07); transform: translateY(-1px); }
.source-item h3 { margin: 0 0 4px; font-size: 1rem; }
.source-item-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.source-item-copy { min-width: 0; }
.source-item-copy .muted { margin: 0; font-size: .86rem; }
.source-menu { position: relative; flex: 0 0 auto; }
.source-menu-button { display: grid; width: 34px; height: 34px; padding: 0; place-items: center; border: 0; border-radius: 7px; color: var(--muted); background: transparent; cursor: pointer; font-size: 1.25rem; }
.source-menu-button:hover, .source-menu-button[aria-expanded="true"] { color: var(--orange-dark); background: var(--orange-soft); }
.source-menu-popover { position: absolute; top: 38px; right: 0; z-index: 20; min-width: 185px; padding: 6px; border: 1px solid var(--border); border-radius: 8px; background: #fff; box-shadow: var(--shadow); }
.source-menu-popover button { width: 100%; padding: 9px 11px; border: 0; border-radius: 6px; background: transparent; text-align: left; cursor: pointer; }
.source-menu-popover button:hover { color: var(--orange-dark); background: var(--orange-soft); }
.channel-chip { display: inline-block; margin: 10px 5px 0 0; padding: 4px 9px; border-radius: 999px; color: #31596d; background: #edf5f8; font-size: .75rem; }

.mapping-form { display: grid; grid-template-columns: repeat(2, minmax(150px, 1fr)); gap: 0 20px; }
.mapping-form label { margin: 5px 0; }
.mapping-save { align-self: end; justify-self: end; min-width: 240px; margin-top: 4px; }
.mapping-form .error { align-self: center; }
.mapping-editor { display: grid; gap: 14px; }
.mapping-placeholder {
  display: grid;
  min-height: 710px;
  place-content: center;
  justify-items: center;
  padding: 48px;
  color: var(--muted);
  text-align: center;
}
.mapping-placeholder > i { margin-bottom: 16px; color: #c2cbd0; font-size: 2.7rem; }
.mapping-placeholder > strong { max-width: 540px; color: var(--ink); font-size: 1.1rem; }
.mapping-placeholder > p { max-width: 560px; margin: 7px 0 0; line-height: 1.45; }
#mappingChannel option.mapped-channel { color: #98a2a8; }
.path-tail-input { direction: ltr; text-align: right; }
.tree-tools { display: grid; grid-template-columns: 1fr 40px; gap: 10px; margin-bottom: 8px; }
.tree-toggle { width: 40px; height: 40px; border: 1px solid var(--border); }
.meter-tree { max-height: 550px; overflow: auto; padding-right: 4px; }
.meter-tree details { margin-left: 10px; }
.meter-tree summary { padding: 5px 3px; cursor: pointer; font-size: .88rem; font-weight: 600; }
.meter-tree summary::marker { color: #5e6d78; }
.meter-tree summary::before { margin-right: 7px; color: #7d8a93; font-family: "Font Awesome 6 Free"; font-weight: 400; content: "\f07b"; }
.meter-button { width: 100%; padding: 7px 9px; border: 0; border-radius: 6px; background: transparent; text-align: left; cursor: pointer; font-size: .86rem; }
.meter-button::before { margin-right: 8px; color: #7d8a93; font-family: "Font Awesome 6 Free"; font-weight: 900; content: "\f3fd"; }
.meter-button:hover, .meter-button.selected { color: var(--orange-dark); background: var(--orange-soft); }
.tree-hidden { display: none !important; }

.chart-card { min-height: 320px; }
.chart-title { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 12px; }
.chart-title > div { display: flex; align-items: center; gap: 10px; }
.section-accent { display: inline-block; width: 3px; height: 22px; border-radius: 2px; background: var(--orange); }
.chart-title small { color: var(--muted); }
.chart-wrap { position: relative; min-height: 245px; overflow: hidden; border: 1px solid #edf0f2; background: repeating-linear-gradient(to bottom, #fff 0, #fff 43px, #eef1f3 44px); }
.sample-chart-canvas { display: block; width: 100%; max-width: 100%; }
.empty-state { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; text-align: center; }
.empty-state i { margin-bottom: 9px; color: #b8c1c7; font-size: 2rem; }
.empty-state strong { color: #677681; font-size: .9rem; }
.empty-state p { margin: 4px 0 0; color: #95a0a7; font-size: .78rem; }
.legend { display: inline-block; width: 16px; height: 3px; margin: 0 6px 3px 12px; }
.green-line { background: var(--green); }
.red-line { background: var(--red); }
.quality-summary { display: flex; flex-wrap: wrap; gap: 7px; padding: 8px; }
.quality-pill { padding: 4px 8px; border-radius: 999px; color: var(--muted); background: #edf2f4; font-size: .74rem; }

.status-list { display: grid; }
.status-row { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 13px 2px; border-bottom: 1px solid #eef1f2; }
.status-row:last-child { border-bottom: 0; }
.status-row span { color: var(--muted); }
.status-dot { display: inline-block; width: 9px; height: 9px; margin-right: 8px; border-radius: 50%; background: #8e999f; box-shadow: 0 0 0 4px rgba(117,120,123,.1); }
.status-dot.green, .green { background: var(--green); }
.status-dot.red, .red { background: var(--red); }
.connected-state { display: grid; grid-template-columns: 48px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 16px; border: 1px solid #cfe8d5; border-radius: 9px; background: var(--green-soft); }
.connected-icon { display: grid; width: 48px; height: 48px; place-items: center; border-radius: 50%; color: #fff; background: var(--green); }
.connected-state p { margin: 3px 0 0; }
.obim-login-form { display: grid; grid-template-columns: 1fr 1fr auto; gap: 14px; align-items: end; }
.obim-login-form label { margin: 0; }
.obim-login-form .error { grid-column: 1 / -1; margin: 0; }
.forwarding-info { min-height: 250px; display: grid; place-content: center; justify-items: center; text-align: center; background: linear-gradient(145deg, #fff, #fbf4ed); }
.forwarding-info > i { margin-bottom: 14px; color: var(--orange); font-size: 2.8rem; }
.forwarding-info h2 { margin: 0 0 6px; }
.forwarding-info p { max-width: 350px; margin: 0; color: var(--muted); }

.sample-dialog { width: min(1100px, calc(100vw - 32px)); max-height: min(90vh, 900px); padding: 0; border: 1px solid var(--border); border-radius: 12px; color: var(--ink); background: #fff; box-shadow: 0 24px 70px rgba(16,24,32,.25); }
.sample-dialog::backdrop { background: rgba(16,24,32,.62); backdrop-filter: blur(3px); }
.sample-dialog-header { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px 22px; border-bottom: 1px solid var(--border); background: #fff; }
.sample-dialog-header h2 { margin: 1px 0 0; font-size: 1.25rem; }
.sample-dialog-body { max-height: calc(min(90vh, 900px) - 78px); padding: 20px 22px 26px; overflow-y: auto; }
.decision-dialog {
  width: min(520px, calc(100vw - 32px));
  padding: 28px;
  border: 1px solid var(--border);
  border-radius: 13px;
  color: var(--ink);
  background: #fff;
  box-shadow: 0 24px 70px rgba(16,24,32,.25);
  text-align: center;
}
.decision-dialog::backdrop { background: rgba(16,24,32,.58); backdrop-filter: blur(3px); }
.decision-dialog-icon { display: grid; width: 48px; height: 48px; margin: 0 auto 13px; place-items: center; border-radius: 50%; color: var(--orange-dark); background: var(--orange-soft); }
.decision-dialog[data-variant="danger"] .decision-dialog-icon { color: var(--red); background: var(--red-soft); }
.decision-dialog h2 { margin: 0 0 8px; font-size: 1.25rem; }
.decision-dialog p { margin: 0; color: var(--muted); line-height: 1.45; }
.decision-dialog-actions { display: flex; justify-content: center; gap: 10px; margin-top: 24px; }
.decision-dialog-actions .button { min-width: 180px; }
.decision-dialog[data-variant="danger"] .decision-dialog-actions .primary { background: var(--red); box-shadow: none; }
.source-chart-panel + .source-chart-panel { margin-top: 24px; }
.source-chart-panel h3 { margin: 0 0 9px; }
.toast { position: fixed; right: 22px; bottom: 22px; z-index: 200; max-width: 380px; padding: 13px 17px; border-radius: 8px; color: #fff; background: var(--ink); box-shadow: var(--shadow); }

.login-view { position: relative; display: grid; min-height: 100vh; place-items: center; overflow: hidden; padding: 40px 24px; background: linear-gradient(120deg, #f8fafb 0%, #fff 58%, #f3f5f6 100%); }
.login-brand { position: absolute; top: 30px; left: 38px; z-index: 2; }
.login-brand img { width: 210px; height: 50px; object-fit: contain; }
.login-brand span { display: block; margin-top: -2px; color: var(--orange-dark); text-align: center; }
.login-card { position: relative; z-index: 2; width: min(430px, 100%); margin-left: -28vw; padding: 34px; }
.login-card h1 { margin: 3px 0 7px; font-size: 2rem; }
.login-card > p { margin: 0 0 20px; color: var(--muted); }
.login-device { position: absolute; right: -7%; bottom: -2%; width: 69vw; max-height: 80vh; object-fit: contain; mix-blend-mode: multiply; }
.sidebar-backdrop { display: none; }

@media (max-width: 1180px) {
  :root { --sidebar: 238px; }
  .brand-lockup img { width: 185px; }
  .page-heading { grid-template-columns: 1fr; gap: 14px; }
  .hero-status { min-height: 180px; }
  .mapping-layout { grid-template-columns: minmax(300px, 38%) 1fr; }
  .metric-grid { grid-template-columns: repeat(2, 1fr); }
  .forwarding-layout { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
  .sidebar { transform: translateX(-100%); transition: transform .2s ease; box-shadow: 12px 0 36px rgba(16,24,32,.18); }
  body.sidebar-open .sidebar { transform: translateX(0); }
  .workspace { margin-left: 0; }
  .mobile-menu { display: inline-grid !important; }
  .topbar { position: relative; top: auto; right: auto; min-height: 58px; padding: 0 20px; }
  .page-content { width: min(100% - 30px, 760px); padding-top: 0; }
  .mapping-layout, .two-column { grid-template-columns: 1fr; }
  .tree-panel { min-height: 0; }
  .meter-tree { max-height: 420px; }
  .sidebar-backdrop { position: fixed; inset: 0; z-index: 40; display: none; border: 0; background: rgba(16,24,32,.42); }
  body.sidebar-open .sidebar-backdrop { display: block; }
  .login-card { margin-left: 0; }
  .login-device { right: -35%; opacity: .22; }
}

@media (max-width: 620px) {
  .page-content { width: calc(100% - 22px); }
  .page-heading h1 { font-size: 2.35rem; }
  .hero-status { min-height: 175px; }
  .hero-status > img { object-position: 64% center; opacity: .8; }
  .hero-status::after { background: linear-gradient(90deg, rgba(255,255,255,.98), rgba(255,255,255,.65)); }
  .metric-grid { grid-template-columns: 1fr 1fr; gap: 9px; }
  .metric { grid-template-columns: 32px 1fr; padding: 13px; }
  .metric i { width: 32px; height: 32px; }
  .metric strong { font-size: 1.35rem; }
  .section-card { padding: 16px; }
  .mapping-form { grid-template-columns: 1fr; }
  .mapping-save { width: 100%; min-width: 0; justify-self: stretch; }
  .mapping-placeholder { min-height: 360px; padding: 34px 24px; }
  .decision-dialog-actions { flex-direction: column-reverse; }
  .decision-dialog-actions .button { width: 100%; min-width: 0; }
  .chart-title { align-items: flex-start; flex-direction: column; }
  .obim-login-form { grid-template-columns: 1fr; }
  .connected-state { grid-template-columns: 44px 1fr; }
  .connected-state .button { grid-column: 1 / -1; }
  .login-brand { top: 20px; left: 50%; transform: translateX(-50%); }
  .login-card { margin-top: 70px; padding: 24px; }
}
