:root {
  color-scheme: light;
  --bg: #eef2f5;
  --surface: #ffffff;
  --surface-soft: #f7f9fb;
  --header-bg: #fbfcfd;
  --button-hover-bg: #f8fafc;
  --button-hover-border: #a9b7c7;
  --chart-bg: #fbfdff;
  --chart-grid: #dfe7ef;
  --chart-grid-faint: #edf2f6;
  --axis: #8795a7;
  --balance-scale-bg: linear-gradient(90deg, rgb(194 65 59 / 15%) 0 25%, rgb(237 190 93 / 18%) 25% 75%, rgb(24 121 78 / 15%) 75% 100%), #eef3f7;
  --balance-marker-bg: #ffffff;
  --balance-marker-border: #0f1720;
  --dead-zone-bg: linear-gradient(90deg, #fbfdff 0 20%, #f4f8fb 20% 80%, #eef3f7 80% 100%);
  --dead-zone-marker-ring: #ffffff;
  --line: #d7dee7;
  --line-strong: #aeb9c7;
  --text: #18212c;
  --muted: #637083;
  --blue: #1f6feb;
  --green: #18794e;
  --red: #c2413b;
  --amber: #a46612;
  --ink: #0f1720;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #101820;
  --surface: #17212b;
  --surface-soft: #202c38;
  --header-bg: #121b24;
  --button-hover-bg: #243242;
  --button-hover-border: #526174;
  --chart-bg: #121b24;
  --chart-grid: #344354;
  --chart-grid-faint: #263442;
  --axis: #91a0b4;
  --balance-scale-bg: linear-gradient(90deg, rgb(255 123 114 / 32%) 0 25%, rgb(226 166 79 / 34%) 25% 75%, rgb(98 192 139 / 32%) 75% 100%), #1a2530;
  --balance-marker-bg: #f5f8fb;
  --balance-marker-border: #05070a;
  --dead-zone-bg: linear-gradient(90deg, rgb(98 192 139 / 22%) 0 20%, rgb(226 166 79 / 24%) 20% 80%, rgb(255 123 114 / 24%) 80% 100%), #1a2530;
  --dead-zone-marker-ring: #05070a;
  --line: #344354;
  --line-strong: #66768a;
  --text: #edf3f8;
  --muted: #a3afbd;
  --blue: #6da3ff;
  --green: #62c08b;
  --red: #ff7b72;
  --amber: #e2a64f;
  --ink: #f5f8fb;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: "Segoe UI", Arial, sans-serif;
}

button,
input,
select {
  font: inherit;
}

input:not([type="checkbox"]):not([type="radio"]) {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text);
  padding: 0 10px;
}

input[type="checkbox"],
input[type="radio"] {
  width: 14px;
  height: 14px;
  min-width: 14px;
  margin: 0;
  accent-color: var(--blue);
}

button {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
}

button:hover {
  border-color: var(--button-hover-border);
  background: var(--button-hover-bg);
}

button.primary {
  border-color: var(--blue);
  background: var(--blue);
  color: #fff;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.app-shell {
  display: grid;
  grid-template-columns: 300px minmax(720px, 1fr);
  flex: 1;
  min-height: 0;
}

.app-header {
  border-bottom: 1px solid var(--line);
  background: var(--header-bg);
}

.app-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 18px;
}

.app-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.app-brand-mark {
  display: grid;
  width: 44px;
  height: 44px;
  min-width: 44px;
  place-items: center;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--surface);
  padding: 4px;
}

.app-brand-copy {
  display: grid;
  gap: 2px;
}

.app-brand-copy strong {
  font-size: 17px;
  line-height: 1.1;
}

.app-brand-copy small {
  color: var(--muted);
  font-size: 12px;
}

.app-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.header-visitors {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 30px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  padding: 5px 10px;
  font-size: 12px;
  line-height: 1;
}

.header-visitors.hidden {
  display: none;
}

.header-visitors strong {
  color: var(--text);
  font-size: 13px;
}

#themeToggleBtn[aria-pressed="true"] {
  border-color: rgb(109 163 255 / 45%);
  background: rgb(109 163 255 / 14%);
  color: var(--blue);
}

.sidebar-heading {
  display: grid;
  gap: 4px;
  padding: 2px 0 6px;
}

.sidebar-heading p {
  color: var(--muted);
  line-height: 1.35;
  font-size: 13px;
}

.login-screen {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  background: rgb(238 242 245 / 92%);
  backdrop-filter: blur(8px);
  padding: 20px;
}

.login-screen.hidden {
  display: none;
}

.login-shell {
  display: grid;
  width: min(560px, 100%);
}

.login-surface {
  display: grid;
  gap: 0;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: 0 18px 50px rgb(15 23 32 / 18%);
  overflow: hidden;
}

.login-hero-frame {
  position: relative;
  padding: 12px 12px 0;
  background:
    linear-gradient(180deg, #f7f9fb 0%, #f2f5f8 100%);
}

.login-hero-picture {
  display: block;
  width: 100%;
}

.login-hero-image {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 14px;
  border: 1px solid #e7edf3;
  background: #fff;
}

.login-card {
  display: grid;
  gap: 14px;
  width: 100%;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  padding: 20px 22px 22px;
}

.login-card label {
  display: grid;
  gap: 6px;
}

.password-field {
  position: relative;
  display: grid;
}

.password-field input {
  padding-right: 46px;
}

.password-toggle {
  position: absolute;
  right: 8px;
  top: 50%;
  display: inline-grid;
  width: 32px;
  height: 32px;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transform: translateY(-50%);
}

.password-toggle:hover,
.password-toggle.active {
  background: rgb(31 111 235 / 10%);
  color: var(--blue);
}

.password-toggle svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.login-copy {
  display: grid;
  gap: 6px;
}

.login-copy h1 {
  font-size: 22px;
}

.login-copy p {
  color: var(--muted);
  line-height: 1.45;
}

.login-card label span {
  color: var(--muted);
  font-size: 13px;
}

.login-error {
  min-height: 18px;
  color: var(--red);
  font-size: 13px;
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 12px;
  border-right: 1px solid var(--line);
  background: var(--header-bg);
  padding: 16px;
}

.brand-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px 0 8px;
}

.brand-mark {
  display: grid;
  width: 60px;
  height: 60px;
  place-items: center;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--surface);
  padding: 4px;
}

.brand-logo {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
}

.brand-fallback {
  display: none;
  width: 100%;
  height: 100%;
  place-items: center;
  border-radius: 6px;
  background: var(--ink);
  color: #fff;
  font-weight: 800;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  font-size: 20px;
  line-height: 1.2;
}

.brand-row p,
.eyebrow,
small,
.metric-card span {
  color: var(--muted);
}

.panel,
.metric-card,
.chart-panel,
.table-panel,
.report-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.panel {
  padding: 12px;
}

.panel h2 {
  margin-bottom: 10px;
  font-size: 14px;
}

.panel label {
  display: grid;
  gap: 6px;
  margin-bottom: 10px;
}

.panel label span {
  color: var(--muted);
  font-size: 13px;
}

select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text);
  padding: 8px 10px;
}

select:not([multiple]) {
  min-height: 36px;
}

select[multiple] {
  min-height: 134px;
}

select option {
  padding: 5px 6px;
}

.date-picker {
  display: grid;
  gap: 8px;
  margin-bottom: 10px;
}

.date-picker-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.date-picker-head span {
  color: var(--muted);
  font-size: 13px;
}

.date-picker-head small {
  font-size: 12px;
}

.date-check-list {
  display: grid;
  max-height: 148px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  padding: 5px;
}

.date-check-list label {
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 28px;
  margin: 0;
  border-radius: 5px;
  padding: 3px 5px;
  font-size: 13px;
}

.date-check-list label.disabled {
  color: #9aa7b6;
  cursor: not-allowed;
}

.button-row {
  display: grid;
  grid-template-columns: 1fr 110px;
  gap: 8px;
}

.button-row.single {
  grid-template-columns: 1fr;
}

.wide {
  width: 100%;
  margin-top: 6px;
}

.view-switch {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-soft);
  padding: 4px;
}

.view-switch button {
  min-height: 32px;
  border: 0;
  background: transparent;
  padding: 0 8px;
}

.view-switch button.active {
  background: var(--surface);
  box-shadow: 0 1px 3px rgb(15 23 32 / 14%);
}

.chart-mode-switch {
  display: grid;
  grid-template-columns: 1.15fr 1.35fr 0.9fr;
  max-width: 100%;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 6px;
}

.chart-mode-group {
  display: grid;
  align-content: start;
  gap: 5px;
  min-width: 0;
  border-radius: 7px;
  background: var(--surface-soft);
  padding: 7px;
}

.chart-mode-group > span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.chart-mode-group > div {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.chart-mode-switch button {
  min-height: 30px;
  border: 0;
  border-radius: 7px;
  background: var(--surface);
  padding: 0 9px;
  white-space: nowrap;
  font-size: 12px;
  font-weight: 800;
}

.chart-mode-switch button.active {
  background: var(--blue);
  color: #fff;
}

.phase-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.phase-grid label {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 34px;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-soft);
}

.db-panel p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.workspace {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
  padding: 18px;
}

.status-pill {
  min-width: 144px;
  border: 1px solid #badbcc;
  border-radius: 999px;
  background: #eef9f3;
  color: var(--green);
  padding: 7px 12px;
  text-align: center;
  font-size: 12px;
  font-weight: 600;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(130px, 1fr));
  gap: 8px;
}

.metric-card {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-areas:
    "title help"
    "value value"
    "status status";
  gap: 3px 7px;
  align-items: center;
  min-height: 68px;
  padding: 8px 10px;
}

.metric-card strong {
  grid-area: value;
  font-size: 19px;
  line-height: 1.05;
}

.metric-card-head {
  display: contents;
}

.metric-card-head span {
  grid-area: title;
  align-self: center;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.25;
  text-transform: uppercase;
}

.metric-card-head .help-button {
  grid-area: help;
  justify-self: end;
}

.metric-card small {
  grid-area: status;
  min-height: 0;
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.2;
}

.metric-card small:empty {
  display: none;
}

.help-button {
  display: inline-grid;
  width: 20px;
  height: 20px;
  min-width: 20px;
  min-height: 20px;
  place-items: center;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface-soft);
  color: var(--muted);
  padding: 0;
  font-size: 11px;
  font-weight: 700;
}

.help-button:hover {
  border-color: #a9b7c7;
  background: #eef3f7;
}

.view-section {
  display: none;
}

.view-section.active {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.chart-panel,
.table-panel,
.report-panel,
.visual-panel {
  padding: 14px;
}

.section-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.section-head > div {
  display: grid;
  gap: 4px;
}

.section-head h3 {
  font-size: 17px;
}

.section-head p {
  color: var(--muted);
  font-size: 13px;
}

.segmented {
  display: flex;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-soft);
  padding: 3px;
}

.segmented button {
  min-height: 30px;
  border: 0;
  background: transparent;
  padding: 0 10px;
}

.segmented button.active {
  background: var(--surface);
  box-shadow: 0 1px 3px rgb(15 23 32 / 14%);
}

.legend-strip {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px 12px;
  color: var(--muted);
  font-size: 12px;
}

.legend-strip span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.legend-strip i {
  display: inline-block;
  width: 18px;
  height: 3px;
  border-radius: 999px;
}

.phase-legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
  color: var(--muted);
  font-size: 13px;
}

.phase-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.phase-legend i {
  display: inline-block;
  width: 20px;
  height: 3px;
  border-radius: 999px;
}

.chart-head-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  width: 168px;
  min-width: 168px;
  gap: 10px;
}

.chart-head-meta {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
}

.direction-legend {
  display: inline-flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 7px 10px;
}

.direction-legend span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}

.direction-legend i {
  display: inline-block;
  width: 16px;
  height: 3px;
  border-radius: 999px;
}

.direction-up {
  background: var(--blue);
}

.direction-down {
  background: var(--green);
}

.phase-1 {
  background: var(--blue);
}

.phase-2 {
  background: var(--green);
}

.phase-3 {
  background: var(--red);
}

.chart-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(360px, 1fr));
  gap: 14px;
}

.single-chart-grid {
  display: grid;
  grid-template-columns: 1fr;
}

.speed-dynamics-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
}

.speed-dynamics-control {
  padding: 14px;
}

.speed-step-switch {
  display: grid;
  grid-template-columns: repeat(10, minmax(34px, 1fr));
  gap: 8px;
}

.speed-step-switch button {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-soft);
  color: var(--muted);
  font-weight: 800;
  cursor: pointer;
}

.speed-step-switch button.active {
  border-color: rgb(31 111 235 / 35%);
  background: rgb(31 111 235 / 10%);
  color: var(--blue);
}

.speed-dynamics-grid .compact-chart {
  min-height: 0;
}

.speed-dynamics-chart {
  display: grid;
  gap: 8px;
  height: auto;
  padding: 10px;
  overflow-x: auto;
}

.speed-dynamics-chart svg {
  display: block;
  width: 100%;
  min-width: 980px;
  height: 330px;
  min-height: 330px;
}

.speed-chart-legend {
  min-width: 980px;
  padding-left: 58px;
}

.chart-card {
  min-width: 0;
}

.chart-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.chart-card-head h3 {
  font-size: 16px;
}

.chart-card-head > span,
.chart-head-meta > span {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--muted);
  padding: 5px 10px;
  font-size: 13px;
  font-weight: 600;
}

.chart {
  position: relative;
  min-height: 360px;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background:
    linear-gradient(var(--chart-grid-faint) 1px, transparent 1px),
    linear-gradient(90deg, var(--chart-grid-faint) 1px, transparent 1px),
    var(--chart-bg);
  background-size: 48px 48px;
}

.compact-chart {
  min-height: 300px;
}

.chart svg {
  width: 100%;
  height: 100%;
  min-height: 300px;
}

.chart-bg {
  fill: transparent;
}

.grid-line {
  stroke: var(--chart-grid);
  stroke-width: 1;
}

.grid-line.faint {
  stroke: var(--chart-grid-faint);
}

.axis-line {
  stroke: var(--axis);
  stroke-width: 1.4;
}

.axis-label,
.axis-title {
  fill: var(--muted);
  font-size: 12px;
}

.data-line {
  fill: none;
  stroke-width: 3.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.diagnostic-chart {
  min-height: 340px;
}

.scatter-dot {
  fill: var(--amber);
  stroke: #fff;
  stroke-width: 2;
}

.bubble-dot {
  fill: rgb(164 102 18 / 34%);
  stroke: var(--amber);
  stroke-width: 2;
}

.point-label {
  fill: var(--text);
  font-size: 12px;
  font-weight: 700;
}

.heatmap {
  display: grid;
  grid-template-columns: 86px repeat(auto-fit, minmax(92px, 1fr));
  gap: 8px;
  align-items: stretch;
}

.heatmap strong {
  display: grid;
  min-height: 34px;
  place-items: center;
  color: var(--muted);
  font-size: 13px;
}

.heatmap span {
  display: grid;
  min-height: 48px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: linear-gradient(90deg, rgb(242 179 91 / 42%) calc(var(--level) * 100%), #f4f8fb 0);
  color: var(--text);
  font-weight: 700;
}

.empty-state {
  display: grid;
  min-height: 160px;
  place-items: center;
  border: 1px dashed #b8c3cf;
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--muted);
  padding: 16px;
  text-align: center;
}

.metrics-below {
  overflow: hidden;
}

.chart-note {
  max-width: 980px;
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.wide-bars,
.split-bars {
  display: grid;
  gap: 12px;
}

.split-bars {
  grid-template-columns: repeat(2, minmax(260px, 1fr));
}

.split-bars h3 {
  margin-bottom: 10px;
  font-size: 15px;
}

.wide-bar-row {
  display: grid;
  grid-template-columns: 150px 1fr 96px;
  align-items: center;
  gap: 10px;
  min-height: 32px;
  font-size: 13px;
}

.wide-bar-row span {
  color: var(--muted);
}

.wide-bar-row strong {
  text-align: right;
}

.wide-bar-row.warn .bar-track i {
  background: var(--amber);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 10px 8px;
  text-align: left;
}

th {
  color: var(--muted);
  font-weight: 600;
}

.status-ok {
  color: var(--green);
  font-weight: 700;
}

.status-warn {
  color: var(--amber);
  font-weight: 700;
}

.report-panel {
  min-height: 180px;
}

.score-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(180px, 1fr));
  gap: 12px;
}

.system-overview-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(180px, 1fr));
  gap: 12px;
}

.score-card {
  display: grid;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 14px;
}

.score-card span,
.score-card small {
  color: var(--muted);
}

.score-card strong {
  font-size: 22px;
}

.score-card.excellent strong {
  color: var(--green);
}

.score-card.good strong {
  color: var(--blue);
}

.score-card.normal strong {
  color: var(--amber);
}

.score-card.poor strong {
  color: var(--red);
}

.metric-visual-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(240px, 1fr));
  gap: 14px;
}

.metric-visual-grid.compact {
  grid-template-columns: repeat(3, minmax(260px, 1fr));
}

.visual-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.visual-panel h3 {
  margin-bottom: 5px;
  font-size: 16px;
}

.visual-panel p {
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.bar-chart {
  display: grid;
  gap: 10px;
}

.bar-row {
  display: grid;
  grid-template-columns: 116px 1fr 82px;
  align-items: center;
  gap: 8px;
  font-size: 12px;
}

.bar-row span {
  color: var(--muted);
}

.bar-row strong {
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
  text-align: right;
}

.bar-track {
  height: 10px;
  border-radius: 999px;
  background: #e7edf3;
  overflow: hidden;
}

.bar-track i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--blue);
}

.bar-row.warn .bar-track i {
  background: var(--amber);
}

.radar-panel {
  min-height: 250px;
}

.radar-panel svg {
  width: 100%;
  min-height: 250px;
}

.radar-panel circle {
  fill: none;
  stroke: #dfe7ef;
}

.radar-panel polygon {
  fill: rgb(31 111 235 / 18%);
  stroke: var(--blue);
  stroke-width: 3;
}

.radar-panel text {
  fill: var(--muted);
  font-size: 12px;
}

.report-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 12px;
}

.report-card {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 14px;
}

.report-card span {
  color: var(--muted);
  font-size: 13px;
}

.report-card strong {
  font-size: 18px;
}

.report-card.ok strong {
  color: var(--green);
}

.report-card.good strong {
  color: var(--green);
}

.report-card.warn strong {
  color: var(--amber);
}

.report-card.bad strong {
  color: var(--red);
}

.chart-title-stack {
  display: grid;
  gap: 3px;
}

.chart-title-stack small {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
}

.group-badge {
  display: inline-grid;
  min-width: 22px;
  min-height: 22px;
  place-items: center;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.group-reference {
  background: rgb(31 111 235 / 14%);
  color: var(--blue);
}

.group-compare {
  background: rgb(194 65 59 / 14%);
  color: var(--red);
}

.comparison-grid,
.balance-grid,
.balance-date-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(280px, 1fr));
  gap: 14px;
}

.balance-date-grid {
  grid-template-columns: 1fr;
}

.mini-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  padding: 12px;
}

.mini-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.mini-panel-head strong {
  font-size: 14px;
}

.phase-bar-list,
.dead-zone-list {
  display: grid;
  gap: 10px;
}

.phase-bar-card {
  display: grid;
  gap: 8px;
}

.phase-bar-head,
.dead-zone-row-head,
.phase-summary-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.phase-bar-head span,
.dead-zone-row-head span,
.phase-summary-head span,
.date-badge-card small {
  color: var(--muted);
}

.dual-bar {
  display: grid;
  gap: 6px;
}

.dual-bar-track {
  height: 12px;
  border-radius: 999px;
  background: #e7edf3;
  overflow: hidden;
}

.dual-bar-track i {
  display: block;
  height: 100%;
  border-radius: inherit;
}

.dual-bar-track.up i {
  background: var(--blue);
}

.dual-bar-track.down i {
  background: var(--green);
}

.balance-card {
  display: grid;
  gap: 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 11px;
}

.balance-date-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  padding: 12px;
}

.balance-phase-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(180px, 1fr));
  gap: 10px;
}

.balance-card-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.balance-card-top span {
  color: var(--muted);
  font-weight: 700;
}

.balance-card-top strong {
  font-size: 22px;
}

.balance-card.good .balance-number,
.balance-card.good .balance-card-top strong {
  color: var(--green);
}

.balance-card.warn .balance-number,
.balance-card.warn .balance-card-top strong {
  color: var(--amber);
}

.balance-card.bad .balance-number,
.balance-card.bad .balance-card-top strong {
  color: var(--red);
}

.balance-number {
  font-size: 34px;
  font-weight: 700;
  line-height: 1;
}

.balance-scale {
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 40px;
  border-radius: 999px;
  background: var(--balance-scale-bg);
  padding: 0 12px;
  color: var(--muted);
  font-size: 12px;
}

.balance-scale i {
  position: absolute;
  top: 50%;
  width: 14px;
  height: 14px;
  border: 3px solid var(--balance-marker-border);
  border-radius: 999px;
  background: var(--balance-marker-bg);
  transform: translate(-50%, -50%);
}

.selected-drop {
  stroke: currentColor;
  stroke-width: 2;
  stroke-dasharray: 4 4;
  opacity: 0.75;
}

.radar-card {
  min-height: 260px;
}

.radar-card svg {
  width: 100%;
  min-height: 250px;
}

.radar-grid,
.radar-axis {
  fill: none;
  stroke: #dfe7ef;
}

.radar-fill {
  fill: rgb(31 111 235 / 18%);
  stroke: var(--blue);
  stroke-width: 3;
}

.radar-card text {
  fill: var(--muted);
  font-size: 12px;
}

.trend-chart {
  display: grid;
  gap: 8px;
  padding: 12px;
}

.trend-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  color: var(--muted);
  font-size: 12px;
}

.trend-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.trend-legend i {
  display: inline-block;
  width: 18px;
  height: 3px;
  border-radius: 999px;
}

.selected-line {
  stroke-width: 2;
  stroke-dasharray: 5 4;
}

.selected-line.reference,
.selected-drop.reference {
  stroke: rgb(31 111 235 / 45%);
}

.selected-line.compare,
.selected-drop.compare {
  stroke: rgb(194 65 59 / 45%);
}

.selected-tag {
  font-size: 11px;
  font-weight: 700;
  paint-order: stroke;
  stroke: #fff;
  stroke-width: 3px;
  stroke-linejoin: round;
}

.selected-tag.reference {
  fill: var(--blue);
}

.selected-tag.compare {
  fill: var(--red);
}

.trend-date-label {
  font-size: 11px;
}

.dead-zone-row {
  display: grid;
  gap: 8px;
}

.dead-zone-scale {
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--dead-zone-bg);
  padding: 0 12px;
  color: var(--muted);
  font-size: 12px;
}

.dead-zone-scale i {
  position: absolute;
  top: 50%;
  width: 12px;
  height: 12px;
  border-radius: 999px;
  box-shadow: 0 0 0 3px var(--dead-zone-marker-ring);
  transform: translate(-50%, -50%);
}

.dead-zone-scale i.up {
  background: var(--blue);
}

.dead-zone-scale i.down {
  background: var(--green);
  top: calc(50% + 8px);
}

.date-badge-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(140px, 1fr));
  gap: 12px;
}

.date-badge-card {
  display: grid;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 12px;
}

.date-badge-card strong {
  font-size: 15px;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(180px, 1fr));
  gap: 12px;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(280px, 360px) 1fr;
  gap: 14px;
}

.rating-panel {
  gap: 14px;
}

.rating-confidence {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 12px;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.rating-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(180px, 1fr));
  gap: 12px;
}

.rating-summary article {
  display: grid;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  padding: 12px;
}

.rating-summary span,
.rating-summary small {
  color: var(--muted);
}

.rating-summary strong {
  font-size: 18px;
}

.rating-list {
  display: grid;
  max-height: 430px;
  overflow: auto;
  gap: 10px;
  padding-right: 4px;
}

.rating-row {
  display: grid;
  grid-template-columns: 68px 1fr;
  gap: 12px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 10px;
}

.rating-rank {
  display: grid;
  place-items: center;
  gap: 4px;
  min-height: 68px;
  border-radius: 8px;
  background: var(--surface-soft);
}

.rating-rank strong {
  font-size: 15px;
}

.rating-rank span {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 50%;
  background: var(--blue);
  color: #fff;
  font-weight: 800;
}

.rating-main {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.rating-row-head {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.rating-row-head > strong {
  font-size: 15px;
}

.rating-row-head > span:last-child {
  margin-left: auto;
  color: var(--text);
  font-weight: 800;
}

.rating-bar {
  height: 10px;
  border-radius: 999px;
  background: #e7edf3;
  overflow: hidden;
}

.rating-bar i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--blue);
}

.rating-row.grade-a .rating-bar i,
.rating-row.grade-b .rating-bar i {
  background: var(--green);
}

.rating-row.grade-d .rating-bar i,
.rating-row.grade-e .rating-bar i {
  background: var(--red);
}

.rating-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
}

.rating-meta small {
  color: var(--muted);
}

.gauge-panel {
  display: grid;
  place-items: center;
  min-height: 280px;
}

.gauge-shell {
  position: relative;
  width: 240px;
  height: 240px;
}

.gauge-arc,
.gauge-fill {
  position: absolute;
  inset: 0;
  border-radius: 50%;
}

.gauge-arc {
  background:
    conic-gradient(from 180deg, rgb(194 65 59 / 22%) 0 20%, rgb(237 190 93 / 24%) 20% 50%, rgb(24 121 78 / 20%) 50% 100%);
  clip-path: inset(0 0 50% 0);
}

.gauge-fill {
  background:
    linear-gradient(90deg, transparent 48%, var(--ink) 48% 52%, transparent 52%);
  clip-path: polygon(49% 50%, 51% 50%, 100% 44%, 100% 56%);
  transform-origin: 50% 50%;
}

.gauge-center {
  position: absolute;
  inset: 58px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 6px;
  border-radius: 50%;
  background: var(--surface);
  text-align: center;
  box-shadow: inset 0 0 0 1px var(--line);
}

.gauge-center strong {
  font-size: 30px;
  line-height: 1;
}

.gauge-center span,
.gauge-center small {
  color: var(--muted);
}

.traffic-matrix {
  display: grid;
  grid-template-columns: 120px repeat(3, minmax(120px, 1fr));
  gap: 8px;
  align-items: stretch;
  overflow-x: auto;
}

.traffic-matrix strong {
  display: grid;
  min-height: 36px;
  place-items: center;
  color: var(--muted);
  font-size: 13px;
}

.traffic-cell {
  display: grid;
  gap: 4px;
  min-height: 74px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  text-align: center;
  padding: 8px;
}

.traffic-cell.good {
  background: rgb(24 121 78 / 12%);
}

.traffic-cell.warn {
  background: rgb(237 190 93 / 14%);
}

.traffic-cell.bad {
  background: rgb(194 65 59 / 12%);
}

.traffic-cell b {
  font-size: 13px;
}

.traffic-cell small {
  color: var(--muted);
  font-size: 11px;
}

.phase-summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(200px, 1fr));
  gap: 12px;
}

.phase-summary-card {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  padding: 14px;
}

.phase-summary-head strong {
  font-size: 16px;
}

.phase-health-bar {
  height: 12px;
  border-radius: 999px;
  background: #e7edf3;
  overflow: hidden;
}

.phase-health-bar i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--blue);
}

.phase-summary-meta {
  display: grid;
  gap: 6px;
}

.phase-summary-meta small {
  color: var(--muted);
}

.report-section-list,
.recommendation-list {
  display: grid;
  gap: 12px;
}

.report-section,
.recommendation-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  padding: 14px;
}

.report-section.note {
  background: rgb(237 190 93 / 14%);
}

.report-section h4,
.recommendation-card h4 {
  margin: 0 0 8px;
  font-size: 15px;
}

.report-section p,
.recommendation-card p {
  color: var(--text);
  line-height: 1.45;
}

.recommendation-group {
  display: grid;
  gap: 10px;
}

.recommendation-group h4 {
  margin-bottom: 0;
}

.recommendation-group-items {
  display: grid;
  gap: 8px;
}

.recommendation-group-item {
  display: grid;
  gap: 5px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.recommendation-group-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.recommendation-group-head strong {
  font-size: 13px;
}

.recommendation-group-head span {
  flex: 0 0 auto;
  border-radius: 999px;
  background: rgb(37 99 235 / 10%);
  color: var(--blue);
  padding: 3px 8px;
  font-size: 11px;
  font-weight: 700;
}

.recommendation-group-item p {
  margin: 0;
}

.recommendation-group-item small {
  color: var(--muted);
  line-height: 1.35;
}

.help-modal {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 20px;
}

.help-modal.hidden {
  display: none;
}

.help-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgb(15 23 32 / 45%);
  backdrop-filter: blur(4px);
}

.help-modal-dialog {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 14px;
  width: min(520px, 100%);
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: 0 20px 60px rgb(15 23 32 / 25%);
  padding: 18px;
}

.help-modal-dialog.wide {
  width: min(760px, 100%);
}

.help-modal-dialog.data-dialog {
  width: min(1120px, 100%);
  max-height: min(86vh, 820px);
}

.help-modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.help-modal-head h3 {
  font-size: 18px;
}

.help-modal-head p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.help-modal-close {
  min-height: 32px;
  padding: 0 12px;
}

.help-modal-body {
  display: grid;
  gap: 10px;
}

.help-modal-body p {
  color: var(--text);
  line-height: 1.5;
}

.help-modal-list {
  display: grid;
  gap: 8px;
}

.help-modal-list div {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  padding: 10px 12px;
}

.help-modal-list strong {
  display: block;
  margin-bottom: 4px;
  font-size: 13px;
}

.help-modal-list span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.chart-help-layout {
  display: grid;
  grid-template-columns: 210px 1fr;
  gap: 12px;
}

.chart-help-nav {
  display: grid;
  align-content: start;
  gap: 6px;
}

.chart-help-nav button {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-soft);
  padding: 0 10px;
  text-align: left;
  font-weight: 800;
}

.chart-help-nav button.active {
  border-color: rgb(31 111 235 / 35%);
  background: rgb(31 111 235 / 10%);
  color: var(--blue);
}

.chart-help-content {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.chart-help-content h4 {
  font-size: 16px;
}

.chart-help-content p {
  margin: 0;
}

.database-modal-body {
  gap: 14px;
}

.measurement-table-body {
  max-height: 68vh;
  overflow: auto;
  padding-right: 4px;
}

.measurement-date-block {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-soft);
  padding: 12px;
}

.measurement-date-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.measurement-date-head strong {
  font-size: 15px;
}

.measurement-table-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(250px, 1fr));
  gap: 8px;
}

.measurement-direction-card {
  display: grid;
  gap: 6px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 8px;
}

.measurement-direction-card h4 {
  margin: 0;
  font-size: 13px;
}

.measurement-table-scroll {
  overflow-x: auto;
}

.measurement-compact-table {
  width: 100%;
  table-layout: fixed;
  min-width: 330px;
  border-collapse: collapse;
  font-size: 11px;
}

.measurement-compact-table th,
.measurement-compact-table td {
  border-bottom: 1px solid var(--line);
  padding: 4px 3px;
  text-align: center;
  white-space: nowrap;
}

.measurement-compact-table th:first-child,
.measurement-compact-table td:first-child {
  text-align: center;
}

.measurement-compact-table .u-col {
  width: 28px;
}

.measurement-compact-table th {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
}

.measurement-compact-table .time-group,
.measurement-compact-table .time-start {
  border-left: 2px solid var(--line-strong);
}

.measurement-compact-table tbody tr:last-child td {
  border-bottom: 0;
}

.database-choice {
  display: inline-grid;
  grid-template-columns: repeat(2, minmax(150px, 1fr));
  gap: 6px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.database-choice button {
  min-height: 36px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  font-weight: 800;
}

.database-choice button.active {
  border-color: rgb(31 111 235 / 35%);
  background: var(--surface);
  color: var(--blue);
}

.database-panel {
  display: none;
  gap: 12px;
}

.database-panel.active {
  display: grid;
}

.database-panel label {
  display: grid;
  gap: 6px;
  font-size: 13px;
  font-weight: 800;
}

.database-panel input,
.database-panel select {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  color: var(--text);
  padding: 0 10px;
}

:root[data-theme="dark"] .login-screen {
  background: rgb(10 15 20 / 92%);
}

:root[data-theme="dark"] .login-hero-frame {
  background: linear-gradient(180deg, #17212b 0%, #111a23 100%);
}

:root[data-theme="dark"] .login-hero-image {
  border-color: var(--line);
  background: var(--surface-soft);
}

:root[data-theme="dark"] .status-pill,
:root[data-theme="dark"] .group-badge,
:root[data-theme="dark"] .chart-card-head > span,
:root[data-theme="dark"] .chart-head-meta > span {
  background: var(--surface-soft);
  color: var(--muted);
}

:root[data-theme="dark"] .help-modal-backdrop {
  background: rgb(3 7 12 / 62%);
}

:root[data-theme="dark"] .data-line,
:root[data-theme="dark"] .data-dot {
  filter: drop-shadow(0 0 2px rgb(0 0 0 / 45%));
}

:root[data-theme="dark"] .balance-scale {
  border: 1px solid rgb(145 160 180 / 55%);
  color: #d7e1eb;
}

:root[data-theme="dark"] .balance-scale i {
  box-shadow: 0 0 0 2px rgb(245 248 251 / 75%), 0 0 10px rgb(109 163 255 / 35%);
}

:root[data-theme="dark"] .dead-zone-scale {
  border-color: rgb(145 160 180 / 55%);
  color: #d7e1eb;
}

:root[data-theme="dark"] .dead-zone-scale i.up {
  background: #8ab7ff;
}

:root[data-theme="dark"] .dead-zone-scale i.down {
  background: #74d69d;
}

.database-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.database-note {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.external-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(180px, 1fr));
  gap: 12px;
}

pre {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: Consolas, "Courier New", monospace;
  line-height: 1.45;
}

pre {
  min-height: 120px;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #101820;
  color: #e8eef5;
  padding: 14px;
  overflow: auto;
  white-space: pre-wrap;
  font: 14px/1.5 Consolas, "Courier New", monospace;
}

@media (max-width: 1100px) {
  .app-header-inner {
    flex-direction: column;
    align-items: stretch;
  }

  .app-shell {
    grid-template-columns: 1fr;
  }

  .chart-mode-switch {
    grid-template-columns: 1fr;
  }

  .sidebar {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .summary-grid,
  .report-summary-grid,
  .date-badge-row,
  .kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .chart-grid,
  .comparison-grid,
  .balance-grid,
  .dashboard-grid,
  .phase-summary-grid,
  .measurement-table-grid,
  .system-overview-grid,
  .metric-visual-grid,
  .split-bars {
    grid-template-columns: 1fr;
  }

  .traffic-matrix {
    min-width: 500px;
  }
}

@media (max-width: 820px) {
  .app-header-inner {
    padding: 14px;
  }

  .login-shell {
    width: min(500px, 100%);
  }

  .sidebar,
  .workspace {
    padding: 14px;
  }

  .brand-row {
    gap: 10px;
  }

  .brand-mark {
    width: 52px;
    height: 52px;
  }

  h1 {
    font-size: 18px;
  }

  .summary-grid,
  .report-summary-grid,
  .date-badge-row,
  .kpi-grid {
    grid-template-columns: 1fr;
  }

  .chart-card-head,
  .mini-panel-head,
  .phase-bar-head,
  .dead-zone-row-head,
  .phase-summary-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .section-head {
    grid-template-columns: 1fr;
    align-items: flex-start;
  }

  .phase-legend {
    justify-content: flex-start;
  }

  .chart-head-actions {
    width: auto;
    min-width: 0;
    justify-content: flex-start;
  }

  .view-switch {
    grid-template-columns: 1fr;
  }

  .phase-grid {
    grid-template-columns: 1fr;
  }

  .date-picker-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .chart-mode-switch button {
    padding: 8px 10px;
  }

  .chart {
    min-height: 280px;
  }

  .compact-chart {
    min-height: 260px;
  }

  .chart svg {
    min-height: 240px;
  }

  .wide-bar-row,
  .bar-row {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .wide-bar-row strong,
  .bar-row strong {
    text-align: left;
  }

  .traffic-matrix {
    min-width: 460px;
  }

  .gauge-shell {
    width: 220px;
    height: 220px;
  }
}

@media (max-width: 560px) {
  .app-header-inner {
    padding: 10px;
  }

  .login-shell {
    width: 100%;
  }

  .app-header-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .status-pill,
  #logoutBtn {
    width: 100%;
    min-width: 0;
  }

  .login-card {
    padding: 16px 16px 18px;
  }

  .login-hero-frame {
    padding: 10px 10px 0;
  }

  .login-hero-image {
    border-radius: 12px;
  }


  .sidebar,
  .workspace {
    padding: 10px;
  }

  .panel,
  .metric-card,
  .chart-panel,
  .table-panel,
  .report-panel,
  .visual-panel,
  .mini-panel,
  .score-card,
  .report-card,
  .report-section,
  .recommendation-card,
  .phase-summary-card,
  .date-badge-card {
    padding: 12px;
  }

  .metric-card strong,
  .balance-number,
  .gauge-center strong {
    font-size: 26px;
  }

  .metric-card strong {
    font-size: 19px;
  }

  .balance-phase-grid {
    grid-template-columns: 1fr;
  }

  .help-modal {
    padding: 12px;
  }

  .help-modal-dialog {
    padding: 14px;
  }

  .measurement-table-body {
    max-height: 62vh;
  }

  .help-modal-head {
    flex-direction: column;
    align-items: stretch;
  }

  .chart-help-layout {
    grid-template-columns: 1fr;
  }

  .chart-help-nav {
    grid-template-columns: 1fr 1fr;
  }

  .chart-help-nav button {
    min-height: 32px;
    padding: 0 8px;
    font-size: 12px;
  }

  .date-check-list {
    max-height: 140px;
  }

  .traffic-matrix {
    min-width: 420px;
  }

  .gauge-shell {
    width: 196px;
    height: 196px;
  }

  .gauge-center {
    inset: 48px;
  }
}
