:root {
  --ink: #171612;
  --muted: #6b675e;
  --paper: #f7f6f2;
  --surface: #ffffff;
  --line: #dedbd2;
  --line-strong: #c9c4b8;
  --gold: #b98819;
  --gold-dark: #76550d;
  --gold-pale: #f4ead0;
  --red: #d53535;
  --red-dark: #8f1f1f;
  --red-pale: #fae9e7;
  --green: #15825e;
  --green-dark: #0d5b42;
  --green-pale: #e5f3ed;
  --warning: #b55d09;
  --warning-pale: #fff0dd;
  --shadow: 0 10px 28px rgba(31, 27, 18, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  background: var(--paper);
  color: var(--ink);
  font-family: "Microsoft YaHei", "Segoe UI", Arial, sans-serif;
}

body {
  margin: 0;
  min-width: 320px;
}

button,
input,
textarea {
  font: inherit;
}

button {
  letter-spacing: 0;
}

.shell {
  margin: 0 auto;
  max-width: 1480px;
  padding-left: 28px;
  padding-right: 28px;
  width: 100%;
}

.topbar {
  background: #1c1a16;
  border-bottom: 1px solid #3c372d;
  color: #fff;
}

.topbar-inner {
  align-items: center;
  display: flex;
  justify-content: space-between;
  min-height: 82px;
}

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

.brand-mark {
  align-items: center;
  background: var(--gold);
  border: 1px solid #d1a43a;
  border-radius: 6px;
  color: #17120a;
  display: inline-flex;
  flex: 0 0 44px;
  font-family: Georgia, serif;
  font-size: 21px;
  font-weight: 700;
  height: 44px;
  justify-content: center;
}

.brand-block h1 {
  font-size: 20px;
  line-height: 1.3;
  margin: 0;
}

.brand-block p {
  color: #bcb5a8;
  font-size: 12px;
  margin: 4px 0 0;
}

.topbar-actions {
  align-items: center;
  display: flex;
  gap: 12px;
}

.button-logout {
  background: transparent;
  border: 1px solid #5b554a;
  color: #ddd7cc;
  text-decoration: none;
}

.button-logout:hover {
  border-color: #8d8372;
  color: #fff;
}

.login-page {
  background: #f1f0eb;
  min-height: 100vh;
}

.login-shell {
  align-items: center;
  display: flex;
  justify-content: center;
  min-height: 100vh;
  padding: 28px 18px;
}

.login-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-top: 4px solid var(--gold);
  border-radius: 6px;
  box-shadow: var(--shadow);
  max-width: 430px;
  padding: 34px;
  width: 100%;
}

.login-brand {
  align-items: center;
  display: flex;
  gap: 14px;
}

.login-brand p {
  color: var(--gold-dark);
  font-size: 11px;
  font-weight: 700;
  margin: 0 0 4px;
}

.login-brand h1 {
  font-size: 20px;
  line-height: 1.35;
  margin: 0;
}

.login-rule {
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
  margin: 24px 0;
  padding-bottom: 20px;
}

.login-form {
  display: grid;
  gap: 9px;
}

.login-form label {
  color: #39362f;
  font-size: 13px;
  font-weight: 700;
  margin-top: 5px;
}

.login-form input {
  background: #fff;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  color: var(--ink);
  min-height: 44px;
  padding: 9px 11px;
  width: 100%;
}

.login-form input:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(185, 136, 25, 0.15);
  outline: none;
}

.login-submit {
  margin-top: 12px;
  width: 100%;
}

.login-error {
  background: var(--red-pale);
  border: 1px solid #e6b9b5;
  border-radius: 5px;
  color: var(--red-dark);
  font-size: 13px;
  margin-bottom: 16px;
  padding: 10px 12px;
}

.login-notice {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.6;
  margin: 20px 0 0;
  text-align: center;
}

.refresh-clock {
  align-items: center;
  color: #c8c1b4;
  display: flex;
  font-size: 12px;
  gap: 7px;
}

.refresh-clock strong {
  color: #fff;
  font-size: 14px;
  min-width: 30px;
}

.button {
  border: 1px solid transparent;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 700;
  min-height: 38px;
  padding: 8px 14px;
  transition: background-color 120ms ease, border-color 120ms ease, color 120ms ease;
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.button-primary {
  background: var(--gold);
  border-color: var(--gold);
  color: #1b1509;
}

.button-primary:hover:not(:disabled) {
  background: #c99a2e;
}

.button-secondary {
  background: #fff;
  border-color: var(--line-strong);
  color: var(--ink);
}

.button-secondary:hover:not(:disabled) {
  background: #efede7;
}

.button-buy {
  background: var(--red);
  border-color: var(--red);
  color: #fff;
}

.button-buy:hover:not(:disabled),
.button-danger:hover:not(:disabled) {
  background: var(--red-dark);
}

.button-danger {
  background: #fff;
  border-color: var(--red);
  color: var(--red-dark);
}

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

.command-band {
  background: #25221d;
  color: #fff;
}

.command-grid {
  align-items: stretch;
  display: grid;
  gap: 24px;
  grid-template-columns: minmax(260px, 0.9fr) minmax(360px, 1.25fr) minmax(310px, 0.9fr);
  min-height: 176px;
  padding-bottom: 25px;
  padding-top: 25px;
}

.instrument-block {
  align-self: center;
  min-width: 0;
}

.instrument-meta {
  align-items: center;
  color: #beb7aa;
  display: flex;
  flex-wrap: wrap;
  font-size: 12px;
  gap: 10px;
}

.status-badge,
.position-badge,
.override-status,
.independent-badge {
  border: 1px solid transparent;
  border-radius: 999px;
  display: inline-flex;
  font-size: 12px;
  font-weight: 700;
  padding: 4px 8px;
}

.status-loading {
  background: #3d3931;
  border-color: #5a5449;
  color: #ddd7ca;
}

.status-live {
  background: rgba(21, 130, 94, 0.2);
  border-color: #2e9e79;
  color: #9ee3c9;
}

.status-cache {
  background: rgba(185, 136, 25, 0.2);
  border-color: #a98431;
  color: #f1d892;
}

.status-stale,
.status-partial {
  background: rgba(213, 53, 53, 0.18);
  border-color: #a84b4b;
  color: #ffc4c4;
}

.price-line {
  align-items: baseline;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 15px;
}

.price-line strong {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 46px;
  font-weight: 600;
  line-height: 1;
}

.price-unit {
  color: #bdb6a8;
  font-size: 13px;
}

.price-change {
  border-radius: 4px;
  font-size: 13px;
  font-weight: 700;
  padding: 3px 6px;
}

.price-up {
  background: rgba(213, 53, 53, 0.18);
  color: #ff9f9f;
}

.price-down {
  background: rgba(21, 130, 94, 0.2);
  color: #94dfc3;
}

.secondary-text {
  color: #a9a295;
  font-size: 12px;
  margin: 12px 0 0;
}

.action-block {
  align-self: stretch;
  border: 1px solid #514b40;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
  padding: 22px 24px;
}

.action-block strong {
  font-size: 28px;
  line-height: 1.25;
  margin-top: 7px;
  overflow-wrap: anywhere;
}

.action-block p {
  color: #d0cabf;
  font-size: 13px;
  line-height: 1.7;
  margin: 9px 0 0;
}

.action-kicker,
.eyebrow {
  color: var(--gold);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0;
}

.action-success {
  background: rgba(213, 53, 53, 0.1);
  border-color: #914141;
}

.action-success strong {
  color: #ff8c8c;
}

.action-danger {
  background: var(--red);
  border-color: #ed6565;
}

.action-danger .action-kicker,
.action-danger strong,
.action-danger p {
  color: #fff;
}

.action-warning {
  background: rgba(181, 93, 9, 0.2);
  border-color: #a2662c;
}

.action-warning strong {
  color: #ffc47f;
}

.action-neutral strong {
  color: #f0ece3;
}

.lamp-strip {
  align-items: center;
  align-self: center;
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  min-width: 0;
}

.compact-lamp {
  align-items: center;
  color: #c5beb1;
  display: flex;
  flex-direction: column;
  font-size: 12px;
  gap: 9px;
  min-width: 0;
}

.lamp {
  border: 2px solid rgba(255, 255, 255, 0.25);
  border-radius: 50%;
  display: inline-block;
  flex: 0 0 auto;
  height: 34px;
  width: 34px;
}

.lamp-red {
  background: var(--red);
  border-color: #ff9393;
  box-shadow: 0 0 0 5px rgba(213, 53, 53, 0.16), 0 0 22px rgba(213, 53, 53, 0.55);
}

.lamp-green {
  background: var(--green);
  border-color: #83d6b8;
  box-shadow: 0 0 0 5px rgba(21, 130, 94, 0.16), 0 0 22px rgba(21, 130, 94, 0.45);
}

.lamp-pending {
  background: #625d53;
  border-color: #8e877a;
}

.risk-banner {
  background: var(--warning-pale);
  border-bottom: 1px solid #e2b575;
  color: #713904;
}

.risk-banner-inner {
  align-items: center;
  display: flex;
  gap: 14px;
  min-height: 48px;
}

.hidden {
  display: none !important;
}

.workspace-band,
.lights-band,
.news-band,
.control-band,
.details-band {
  padding-bottom: 34px;
  padding-top: 34px;
}

.workspace-band,
.control-band {
  background: var(--surface);
}

.lights-band,
.details-band {
  background: var(--paper);
  border-top: 1px solid var(--line);
}

.news-band {
  background: #24211c;
  color: #fff;
}

.market-layout {
  display: grid;
  gap: 28px;
  grid-template-columns: minmax(0, 1.7fr) minmax(300px, 0.7fr);
}

.chart-panel,
.position-panel,
.override-panel,
.alerts-panel {
  min-width: 0;
}

.position-panel {
  border-left: 1px solid var(--line);
  padding-left: 28px;
}

.section-heading {
  align-items: flex-start;
  display: flex;
  justify-content: space-between;
  margin-bottom: 18px;
}

.section-heading h2 {
  font-size: 20px;
  line-height: 1.3;
  margin: 4px 0 0;
}

.section-heading-wide {
  align-items: flex-end;
}

.section-heading-wide > p {
  color: var(--muted);
  font-size: 12px;
  margin: 0;
  max-width: 520px;
  text-align: right;
}

.chart-legend {
  align-items: center;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  font-size: 11px;
  gap: 13px;
  justify-content: flex-end;
}

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

.legend-line {
  display: inline-block;
  height: 3px;
  width: 18px;
}

.legend-price {
  background: var(--ink);
}

.legend-ma20 {
  background: var(--gold);
}

.legend-ma60 {
  background: var(--green);
}

.chart-wrap {
  height: 318px;
  position: relative;
  width: 100%;
}

#priceChart {
  display: block;
  height: 318px;
  width: 100%;
}

.position-badge {
  background: #efede7;
  border-color: var(--line);
  color: var(--muted);
}

.position-badge.open {
  background: var(--red-pale);
  border-color: #ebb2ae;
  color: var(--red-dark);
}

.position-stats {
  display: grid;
  gap: 0;
  grid-template-columns: 1fr 1fr;
  margin: 0;
}

.position-stats div {
  border-bottom: 1px solid var(--line);
  padding: 15px 0;
}

.position-stats div:nth-child(odd) {
  padding-right: 16px;
}

.position-stats div:nth-child(even) {
  border-left: 1px solid var(--line);
  padding-left: 16px;
}

.position-stats dt {
  color: var(--muted);
  font-size: 12px;
}

.position-stats dd {
  font-size: 22px;
  font-weight: 800;
  margin: 7px 0 0;
}

.execution-actions {
  display: grid;
  gap: 10px;
  grid-template-columns: 1fr 1fr;
  margin-top: 20px;
}

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

.lights-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.light-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  min-width: 0;
  overflow: hidden;
}

.light-card.red {
  border-top: 4px solid var(--red);
}

.light-card.green {
  border-top: 4px solid var(--green);
}

.light-card-head {
  align-items: center;
  display: flex;
  gap: 12px;
  padding: 18px 18px 14px;
}

.light-card-head .lamp {
  height: 28px;
  width: 28px;
}

.light-title {
  flex: 1;
  min-width: 0;
}

.light-title h3 {
  font-size: 17px;
  margin: 0;
}

.light-title span {
  color: var(--muted);
  display: block;
  font-size: 11px;
  margin-top: 3px;
}

.score-block {
  text-align: right;
}

.score-block strong {
  display: block;
  font-size: 23px;
}

.score-block span {
  color: var(--muted);
  font-size: 10px;
}

.score-track {
  background: #ece9e2;
  height: 4px;
  margin: 0 18px;
  overflow: hidden;
}

.score-track span {
  display: block;
  height: 100%;
}

.light-card.red .score-track span {
  background: var(--red);
}

.light-card.green .score-track span {
  background: var(--green);
}

.light-summary {
  color: #4d4941;
  font-size: 12px;
  line-height: 1.7;
  margin: 14px 18px;
  min-height: 82px;
}

.criteria-list {
  border-top: 1px solid var(--line);
  list-style: none;
  margin: 0;
  padding: 0;
}

.criterion-row {
  align-items: flex-start;
  border-bottom: 1px solid #ece9e3;
  display: grid;
  font-size: 11px;
  gap: 7px;
  grid-template-columns: 16px minmax(0, 1fr) auto;
  line-height: 1.45;
  padding: 10px 15px;
}

.criterion-row:last-child {
  border-bottom: 0;
}

.criterion-state {
  align-items: center;
  border-radius: 50%;
  color: #fff;
  display: inline-flex;
  font-size: 9px;
  height: 15px;
  justify-content: center;
  margin-top: 1px;
  width: 15px;
}

.criterion-pass {
  background: var(--red);
}

.criterion-fail {
  background: var(--green);
}

.criterion-copy {
  min-width: 0;
}

.criterion-copy strong {
  display: block;
  overflow-wrap: anywhere;
}

.criterion-copy span {
  color: var(--muted);
  display: block;
  margin-top: 2px;
  overflow-wrap: anywhere;
}

.criterion-points {
  color: var(--muted);
  white-space: nowrap;
}

.loading-card {
  color: var(--muted);
  grid-column: 1 / -1;
  padding: 28px;
}

.news-band .section-heading h2 {
  color: #fff;
}

.news-band .eyebrow {
  color: #ddb54f;
}

.independent-badge {
  background: rgba(221, 181, 79, 0.12);
  border-color: #766536;
  color: #efd27e;
}

.news-summary {
  border-bottom: 1px solid #49443a;
  color: #c9c1b4;
  font-size: 13px;
  padding-bottom: 18px;
}

.news-dimensions {
  display: grid;
  gap: 0;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  margin-top: 18px;
}

.news-dimension {
  border-left: 1px solid #49443a;
  min-width: 0;
  padding: 5px 15px 10px;
}

.news-dimension:first-child {
  border-left: 0;
  padding-left: 0;
}

.news-dimension h3 {
  color: #fff;
  font-size: 13px;
  margin: 0;
}

.news-state {
  display: inline-block;
  font-size: 12px;
  font-weight: 800;
  margin-top: 9px;
}

.state-bullish {
  color: #ff8f8f;
}

.state-bearish {
  color: #71d2af;
}

.state-neutral {
  color: #e3c36d;
}

.news-dimension p {
  color: #a9a295;
  font-size: 11px;
  line-height: 1.55;
  margin: 7px 0 0;
  overflow-wrap: anywhere;
}

.news-feed {
  border-top: 1px solid #49443a;
  margin-top: 22px;
  padding-top: 18px;
}

.news-feed h3 {
  font-size: 14px;
  margin: 0 0 12px;
}

.feed-list {
  display: grid;
  gap: 0;
  grid-template-columns: 1fr 1fr;
}

.feed-item {
  border-bottom: 1px solid #403c34;
  display: grid;
  gap: 10px;
  grid-template-columns: 102px 42px minmax(0, 1fr);
  padding: 10px 12px 10px 0;
}

.feed-time {
  color: #8f897e;
  font-size: 10px;
}

.feed-state {
  font-size: 10px;
  font-weight: 800;
}

.feed-content {
  color: #c5beb2;
  font-size: 11px;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.control-layout {
  display: grid;
  gap: 40px;
  grid-template-columns: minmax(320px, 0.75fr) minmax(0, 1.25fr);
}

.alerts-panel {
  border-left: 1px solid var(--line);
  padding-left: 40px;
}

.override-status {
  background: #efede7;
  border-color: var(--line);
  color: var(--muted);
}

.override-status.active {
  background: var(--warning-pale);
  border-color: #e8b16f;
  color: #7b3f05;
}

.segmented-control {
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin-bottom: 15px;
}

.segmented-control label {
  cursor: pointer;
}

.segmented-control input {
  height: 1px;
  opacity: 0;
  position: absolute;
  width: 1px;
}

.segmented-control span {
  background: #f1efe9;
  border: 1px solid var(--line-strong);
  display: block;
  font-size: 12px;
  font-weight: 700;
  padding: 9px 12px;
  text-align: center;
}

.segmented-control label:first-child span {
  border-radius: 6px 0 0 6px;
}

.segmented-control label:last-child span {
  border-left: 0;
  border-radius: 0 6px 6px 0;
}

.segmented-control input:checked + span {
  background: var(--warning-pale);
  border-color: #d39047;
  color: #743b04;
}

.field-label {
  color: var(--muted);
  display: block;
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 7px;
}

textarea {
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  color: var(--ink);
  display: block;
  line-height: 1.5;
  padding: 10px 12px;
  resize: vertical;
  width: 100%;
}

textarea:focus {
  border-color: var(--gold);
  outline: 2px solid var(--gold-pale);
}

.form-actions {
  display: flex;
  gap: 10px;
  margin-top: 12px;
}

.alert-list {
  max-height: 330px;
  overflow: auto;
}

.alert-row {
  align-items: flex-start;
  border-bottom: 1px solid var(--line);
  display: grid;
  gap: 12px;
  grid-template-columns: 74px minmax(0, 1fr) 120px;
  padding: 11px 0;
}

.alert-type {
  border-radius: 4px;
  font-size: 10px;
  font-weight: 800;
  padding: 4px 6px;
  text-align: center;
}

.alert-type.buy {
  background: var(--red-pale);
  color: var(--red-dark);
}

.alert-type.sell {
  background: var(--green-pale);
  color: var(--green-dark);
}

.alert-type.news {
  background: var(--warning-pale);
  color: #7a4007;
}

.alert-copy strong {
  display: block;
  font-size: 12px;
}

.alert-copy span {
  color: var(--muted);
  display: block;
  font-size: 11px;
  line-height: 1.5;
  margin-top: 3px;
}

.alert-time {
  color: var(--muted);
  font-size: 10px;
  text-align: right;
}

.empty-text {
  color: var(--muted);
  font-size: 12px;
}

.details-layout {
  display: grid;
  gap: 42px;
  grid-template-columns: 1fr 1fr;
}

.table-wrap {
  overflow-x: auto;
}

.data-table {
  border-collapse: collapse;
  font-size: 11px;
  width: 100%;
}

.data-table th,
.data-table td {
  border-bottom: 1px solid var(--line);
  line-height: 1.5;
  padding: 10px 9px;
  text-align: left;
  vertical-align: top;
}

.data-table th {
  color: var(--muted);
  font-weight: 700;
  white-space: nowrap;
}

.source-status {
  font-weight: 800;
  white-space: nowrap;
}

.source-live {
  color: var(--green-dark);
}

.source-cache {
  color: var(--gold-dark);
}

.source-stale,
.source-unavailable {
  color: var(--red-dark);
}

.quality-warnings {
  color: var(--red-dark);
  font-size: 11px;
  line-height: 1.6;
  margin-top: 12px;
}

.quality-warnings p {
  margin: 5px 0;
}

.footer {
  background: #1c1a16;
  color: #d4cdc0;
  font-size: 11px;
  padding: 22px 0;
}

.footer .shell {
  align-items: center;
  display: flex;
  gap: 22px;
  justify-content: space-between;
}

.footer strong {
  color: #fff;
}

.signal-dialog {
  background: var(--surface);
  border: 0;
  border-radius: 8px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.32);
  max-width: 560px;
  padding: 0;
  width: calc(100% - 32px);
}

.signal-dialog::backdrop {
  background: rgba(20, 18, 14, 0.72);
}

.dialog-accent {
  background: var(--gold);
  height: 7px;
}

.dialog-accent.buy {
  background: var(--red);
}

.dialog-accent.sell {
  background: var(--green);
}

.dialog-content {
  padding: 28px;
}

.dialog-content h2 {
  font-size: 27px;
  margin: 7px 0 10px;
}

.dialog-content p {
  color: var(--muted);
  line-height: 1.7;
}

.dialog-lights {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(4, 1fr);
  margin: 20px 0;
}

.dialog-light {
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  display: flex;
  flex-direction: column;
  font-size: 11px;
  gap: 8px;
  padding: 12px 5px;
}

.dialog-light .lamp {
  height: 25px;
  width: 25px;
}

.dialog-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

.toast {
  background: #1c1a16;
  border: 1px solid #4b453a;
  border-radius: 6px;
  bottom: 22px;
  color: #fff;
  display: none;
  font-size: 12px;
  left: 50%;
  max-width: min(620px, calc(100% - 28px));
  padding: 12px 15px;
  position: fixed;
  transform: translateX(-50%);
  z-index: 1000;
}

.toast.show {
  display: block;
}

@media (max-width: 1120px) {
  .command-grid {
    grid-template-columns: 1fr 1.2fr;
  }

  .lamp-strip {
    grid-column: 1 / -1;
    max-width: 480px;
    width: 100%;
  }

  .lights-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .news-dimensions {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .news-dimension:nth-child(5) {
    border-left: 0;
    padding-left: 0;
  }
}

@media (max-width: 840px) {
  .shell {
    padding-left: 18px;
    padding-right: 18px;
  }

  .topbar-inner {
    align-items: flex-start;
    gap: 14px;
    padding-bottom: 16px;
    padding-top: 16px;
  }

  .brand-block h1 {
    font-size: 17px;
  }

  .refresh-clock {
    display: none;
  }

  .command-grid,
  .market-layout,
  .control-layout,
  .details-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .command-grid {
    gap: 18px;
  }

  .action-block {
    min-height: 132px;
  }

  .position-panel,
  .alerts-panel {
    border-left: 0;
    border-top: 1px solid var(--line);
    padding-left: 0;
    padding-top: 28px;
  }

  .section-heading-wide {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }

  .section-heading-wide > p {
    text-align: left;
  }

  .news-dimensions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .news-dimension:nth-child(odd) {
    border-left: 0;
    padding-left: 0;
  }

  .feed-list {
    grid-template-columns: 1fr;
  }

  .footer .shell {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }
}

@media (max-width: 560px) {
  .topbar-inner {
    align-items: center;
  }

  .brand-mark {
    flex-basis: 38px;
    height: 38px;
  }

  .brand-block p {
    display: none;
  }

  .button {
    min-height: 40px;
  }

  .topbar-actions .button {
    font-size: 0;
    min-width: 42px;
    padding: 8px;
  }

  .topbar-actions .button::after {
    content: "↻";
    font-size: 22px;
  }

  .topbar-actions .button-logout {
    display: none;
  }

  .login-panel {
    padding: 26px 22px;
  }

  .price-line strong {
    font-size: 38px;
  }

  .command-grid {
    padding-bottom: 22px;
    padding-top: 22px;
  }

  .lamp-strip {
    gap: 7px;
    max-width: none;
    width: 100%;
  }

  .lamp {
    height: 30px;
    width: 30px;
  }

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

  .chart-panel .section-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }

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

  .light-summary {
    min-height: 0;
  }

  .news-dimensions {
    grid-template-columns: 1fr;
  }

  .news-dimension,
  .news-dimension:nth-child(5),
  .news-dimension:nth-child(odd) {
    border-bottom: 1px solid #49443a;
    border-left: 0;
    padding: 12px 0;
  }

  .feed-item {
    grid-template-columns: 86px 38px minmax(0, 1fr);
  }

  .execution-actions,
  .segmented-control {
    grid-template-columns: 1fr;
  }

  .execution-actions .button {
    width: 100%;
  }

  .segmented-control label:first-child span,
  .segmented-control label:last-child span {
    border: 1px solid var(--line-strong);
    border-radius: 6px;
  }

  .segmented-control label:last-child span {
    margin-top: 7px;
  }

  .form-actions {
    flex-direction: column;
  }

  .alert-row {
    grid-template-columns: 64px minmax(0, 1fr);
  }

  .alert-time {
    grid-column: 2;
    text-align: left;
  }

  .dialog-content {
    padding: 22px;
  }

  .dialog-lights {
    grid-template-columns: repeat(2, 1fr);
  }

  .dialog-actions {
    flex-direction: column;
  }
}
