:root {
  --app-bg: #e7e5dc;
  --app-panel: #fbfaf5;
  --app-line: #c5c8c2;
  --app-line-dark: #344349;
  --app-ink: #172126;
  --app-muted: #69767a;
  --app-orange: #ff6b35;
  --app-cyan: #80d4d3;
  --app-green: #4d9271;
  --app-yellow: #9a7b16;
  --app-red: #a94f47;
}

html,
.workspace-page {
  height: 100%;
  background: var(--night);
}

.workspace-page { overflow: hidden; }
.workspace-page .mast-nav a[aria-current="page"] { color: var(--white); }

.workspace-main {
  height: calc(100dvh - 70px);
  min-height: 0;
  padding: 0;
  background: #111b1f;
}

.workspace-app {
  display: grid;
  height: 100%;
  grid-template-rows: 72px minmax(0, 1fr);
  overflow: hidden;
  color: var(--app-ink);
  background: var(--app-bg);
}

.app-topbar {
  display: grid;
  grid-template-columns: minmax(270px, 1fr) minmax(245px, .78fr) minmax(310px, .82fr) 180px;
  align-items: stretch;
  color: #d9e0e0;
  background: #172226;
  border-bottom: 1px solid var(--app-line-dark);
}

.app-identity,
.app-connection {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 22px;
  border-right: 1px solid var(--app-line-dark);
}

.app-identity > span {
  position: relative;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  background:
    linear-gradient(var(--app-orange), var(--app-orange)) 4px 7px / 25px 2px no-repeat,
    linear-gradient(var(--app-cyan), var(--app-cyan)) 4px 16px / 18px 2px no-repeat,
    linear-gradient(#dfc675, #dfc675) 4px 25px / 22px 2px no-repeat;
  border: 1px solid #415158;
}

.app-identity > span::after {
  content: "";
  position: absolute;
  top: 4px;
  right: 3px;
  width: 5px;
  height: 5px;
  background: var(--app-orange);
  box-shadow: -7px 9px var(--app-cyan), -3px 18px #dfc675;
  border-radius: 50%;
}

.app-identity div,
.app-connection div { display: grid; gap: 2px; min-width: 0; }

.app-identity b {
  overflow: hidden;
  color: #f1f0e9;
  font-family: var(--display);
  font-size: 17px;
  font-weight: 600;
  letter-spacing: .01em;
  line-height: 1;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.app-identity small,
.app-connection small {
  overflow: hidden;
  color: #849296;
  font-family: var(--mono);
  font-size: 10px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-connection i {
  width: 9px;
  height: 9px;
  flex: 0 0 auto;
  background: var(--app-yellow);
  border-radius: 50%;
  box-shadow: 0 0 0 5px rgba(170, 142, 45, .11);
}

.app-connection i.is-live {
  background: var(--app-green);
  box-shadow: 0 0 0 5px rgba(77, 146, 113, .12), 0 0 16px rgba(77, 146, 113, .3);
}

.app-connection i.is-error {
  background: var(--app-red);
  box-shadow: 0 0 0 5px rgba(169, 79, 71, .12);
}

.app-connection b {
  color: #c5ced0;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.global-station {
  display: grid;
  grid-template-columns: auto minmax(150px, 1fr);
  gap: 14px;
  align-items: center;
  padding: 0 18px;
  border-right: 1px solid var(--app-line-dark);
}

.global-station > span {
  color: #8b989c;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.global-station select {
  width: 100%;
  height: 40px;
  padding: 0 34px 0 12px;
  color: #e0e5e4;
  background: #101a1e;
  border: 1px solid #415158;
  border-radius: 0;
  font-family: var(--mono);
  font-size: 11px;
}

.app-product-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 20px;
  color: #c3ccce;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .03em;
  text-decoration: none;
  text-transform: uppercase;
  transition: color .16s ease, background .16s ease;
}

.app-product-link:hover { color: var(--white); background: #223037; }
.app-product-link b { color: var(--app-orange); font-size: 15px; }

.app-body {
  display: grid;
  min-height: 0;
  grid-template-columns: 216px minmax(0, 1fr);
}

.app-sidebar {
  display: flex;
  min-height: 0;
  flex-direction: column;
  padding: 22px 14px 16px;
  overflow-y: auto;
  color: #98a4a7;
  background: #192429;
  border-right: 1px solid var(--app-line-dark);
  scrollbar-color: #425157 transparent;
}

.app-sidebar > p {
  margin: 3px 12px 15px;
  color: #748388;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.app-sidebar button,
.app-sidebar > a {
  display: grid;
  width: 100%;
  min-height: 62px;
  grid-template-columns: 30px 1fr;
  grid-template-rows: 1fr 1fr;
  padding: 10px 12px;
  color: #9ca8aa;
  background: transparent;
  border: 0;
  border-left: 2px solid transparent;
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: color .18s ease, background .18s ease, border-color .18s ease;
}

.app-sidebar button:hover,
.app-sidebar > a:hover { color: #f0f2f1; background: #222f34; }

.app-sidebar button.is-active {
  color: #f6f7f4;
  background: #2a373c;
  border-left-color: var(--app-orange);
}

.app-sidebar button > span,
.app-sidebar > a > span {
  grid-row: 1 / 3;
  align-self: center;
  color: #7d8b8f;
  font-family: var(--mono);
  font-size: 15px;
}

.app-sidebar button.is-active > span { color: var(--app-orange); }
.app-sidebar button b,
.app-sidebar > a b { align-self: end; font-size: 14px; font-weight: 600; }
.app-sidebar button small,
.app-sidebar > a small { align-self: start; color: #91a0a4; font-size: 11px; line-height: 1.35; }
.sidebar-spacer { min-height: 24px; flex: 1; }
.app-sidebar > a { margin-bottom: 15px; text-decoration: none; }

.preview-stamp { padding: 15px 12px 3px; border-top: 1px solid #334248; }
.preview-stamp span {
  display: inline-block;
  padding: 5px 7px;
  color: #ff9b76;
  background: rgba(239, 141, 104, .08);
  border: 1px solid rgba(239, 141, 104, .28);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .08em;
}

.app-content { position: relative; min-width: 0; min-height: 0; overflow: hidden; background: var(--app-bg); }
.view-announce { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.app-view {
  position: absolute;
  inset: 0;
  z-index: 0;
  min-width: 0;
  overflow: auto;
  padding: 32px clamp(24px, 3vw, 48px) 48px;
  opacity: 0;
  transform: translateX(13px);
  visibility: hidden;
  scrollbar-color: #9fa7a3 transparent;
  transition: opacity .18s ease, transform .18s cubic-bezier(.2, .7, .2, 1), visibility 0s linear .18s;
}
.app-view.is-active { z-index: 1; opacity: 1; transform: none; visibility: visible; transition-delay: 0s; }
.app-view.is-leaving { z-index: 2; opacity: 0; transform: translateX(-9px); visibility: visible; }

.view-heading {
  display: flex;
  min-height: 78px;
  align-items: flex-end;
  justify-content: space-between;
  gap: 30px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--app-line);
}

.view-heading p,
.network-panel header p,
.event-card header p,
.trace-card header p,
.integrity-card header p,
.ledger-card header p,
.rules-card header p,
.archive-card header p {
  margin: 0 0 6px;
  color: #748185;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .09em;
  line-height: 1.25;
}

.view-heading h1 {
  margin: 0;
  color: #253238;
  font-family: var(--display);
  font-size: clamp(38px, 3.6vw, 56px);
  font-weight: 600;
  line-height: .92;
  text-transform: uppercase;
}

.view-heading-meta { display: flex; gap: 8px; align-items: center; }
.view-heading-meta span,
.view-heading-meta b,
.planned-chip {
  padding: 7px 9px;
  color: #667377;
  background: #f6f5f0;
  border: 1px solid #c7cac4;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 400;
  letter-spacing: .04em;
  text-transform: uppercase;
  white-space: nowrap;
}
.view-heading-meta b,
.planned-chip { color: #bd5832; background: #f8eee8; border-color: #dfb8a9; }

.network-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 18px; align-items: start; margin-top: 18px; }
.network-primary { min-width: 0; }
.metric-grid { display: grid; grid-template-columns: repeat(4, 1fr); background: var(--app-panel); border: 1px solid var(--app-line); }
.metric-grid article { display: grid; min-height: 112px; gap: 3px; align-content: center; padding: 17px 18px; border-right: 1px solid var(--app-line); }
.metric-grid article:last-child { border-right: 0; }
.metric-grid span { color: #5f6e72; font-family: var(--mono); font-size: 11px; letter-spacing: .04em; text-transform: uppercase; }
.metric-grid strong { color: #27343a; font-family: var(--display); font-size: 38px; font-weight: 600; line-height: 1; }
.metric-grid small { color: #707c7f; font-size: 11px; line-height: 1.35; }

.network-panel,
.event-card,
.trace-card,
.integrity-card,
.ledger-card,
.rules-card,
.archive-card { background: var(--app-panel); border: 1px solid var(--app-line); }
.network-panel { margin-top: 18px; }
.network-panel > header,
.integrity-card > header,
.ledger-card > header,
.rules-card > header,
.archive-card > header {
  display: flex;
  min-height: 68px;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 12px 17px;
  border-bottom: 1px solid var(--app-line);
}
.network-panel h2,
.event-card h2,
.trace-card h2,
.integrity-card h2,
.ledger-card h2,
.rules-card h2,
.archive-card h2 { margin: 0; color: #344147; font-size: 16px; font-weight: 600; line-height: 1.25; }
.network-panel > header > span,
.integrity-card > header > span,
.ledger-card > header > span,
.rules-card > header > span,
.archive-card > header > span { color: #68777b; font-family: var(--mono); font-size: 11px; }
.table-scroll { overflow: auto; }
table { width: 100%; min-width: 780px; border-collapse: collapse; }
th { height: 41px; padding: 0 14px; color: #687579; background: #efeee9; border-bottom: 1px solid var(--app-line); font-family: var(--mono); font-size: 11px; font-weight: 400; letter-spacing: .05em; text-align: left; text-transform: uppercase; white-space: nowrap; }
td { height: 60px; padding: 10px 14px; color: #46565b; border-bottom: 1px solid #d9dbd5; font-family: var(--mono); font-size: 12px; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr { transition: background .15s ease; }
tbody tr:hover { background: #f3f2ed; }
.station-cell { display: grid; gap: 2px; }
.station-cell b { color: #344147; font-family: var(--sans); font-size: 13px; }
.station-cell small { max-width: 150px; overflow: hidden; color: #6f7b7e; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.path-marks { display: flex; gap: 5px; }
.path-marks i { display: grid; width: 25px; height: 25px; place-items: center; color: #326b50; background: #e5eee8; border: 1px solid #a9cab7; border-radius: 50%; font-size: 10px; font-style: normal; }
.path-marks i.is-offline { color: #915e58; background: #f2e8e6; border-color: #d4b4ae; }
.state-tag { display: inline-block; padding: 5px 7px; color: #326b50; background: #e6efe9; border: 1px solid #afd0bd; font-size: 10px; text-transform: uppercase; white-space: nowrap; }
.state-tag.content-difference,
.state-tag.different { color: #9e482b; background: #f5e7e1; border-color: #deb4a5; }
.state-tag.source-lag,
.state-tag.lag { color: #806713; background: #f4efdc; border-color: #d6c68c; }
.state-tag.incomplete { color: #8c4039; background: #f2e4e2; border-color: #d3aaa4; }
.open-station { min-height: 36px; padding: 7px 11px; color: #33464c; background: transparent; border: 1px solid #a8afaa; font-family: var(--mono); font-size: 11px; cursor: pointer; }
.open-station:hover { color: #fff; background: #344349; border-color: #344349; }
.loading-cell { height: 120px; color: #778386; text-align: center; }

.network-visual { min-height: 100%; overflow: hidden; color: #dbe2e1; background: #152126; border: 1px solid #344349; }
.network-visual > header { display: flex; height: 59px; align-items: center; justify-content: space-between; padding: 0 16px; border-bottom: 1px solid #344349; }
.network-visual header span,
.network-visual header b { color: #a0adb0; font-family: var(--mono); font-size: 11px; font-weight: 400; letter-spacing: .04em; }
.signal-chart { position: relative; height: 270px; overflow: hidden; border-bottom: 1px solid #344349; }
.signal-grid { position: absolute; inset: 0; opacity: .36; background-image: linear-gradient(rgba(255,255,255,.065) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.065) 1px, transparent 1px); background-size: 48px 40px; }
.signal-chart svg { position: absolute; right: 0; bottom: 9px; left: 0; width: 100%; height: 238px; }
.signal-chart path { fill: none; stroke-width: 1.7; vector-effect: non-scaling-stroke; }
.signal-a { stroke: var(--app-cyan); }
.signal-b { stroke: var(--app-orange); opacity: .7; }
.signal-c { stroke: #d2be6d; opacity: .58; }
.signal-labels { position: absolute; right: 14px; bottom: 12px; display: flex; gap: 5px; }
.signal-labels span { padding: 5px 7px; color: #c1cacc; background: #1d2a2f; font-family: var(--mono); font-size: 10px; }
.signal-readout { margin: 0; padding: 9px 16px; }
.signal-readout div { display: flex; justify-content: space-between; gap: 12px; padding: 11px 0; border-bottom: 1px solid #2e3c41; }
.signal-readout div:last-child { border-bottom: 0; }
.signal-readout dt { color: #98a6aa; font-size: 12px; }
.signal-readout dd { margin: 0; color: #d0d7d8; font-family: var(--mono); font-size: 11px; text-align: right; }

.station-heading { align-items: center; }
.station-heading-actions { display: flex; align-items: stretch; gap: 8px; }
.station-heading-actions > a {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 0 14px;
  color: #58666a;
  background: var(--app-panel);
  border: 1px solid var(--app-line);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .025em;
  text-decoration: none;
  text-transform: uppercase;
}
.station-heading-actions > a:hover { color: #192429; border-color: #9aa6a8; }
.station-identity { display: flex; align-items: center; gap: 16px; }
.station-identity > span { display: grid; width: 74px; height: 62px; place-items: center; color: #fff; background: #1b272c; font-family: var(--display); font-size: 29px; }
.station-status { display: flex; min-width: 235px; gap: 13px; align-items: center; padding: 13px 16px; background: var(--app-panel); border: 1px solid var(--app-line); }
.station-status > i { width: 9px; height: 9px; background: var(--app-yellow); border-radius: 50%; box-shadow: 0 0 0 5px rgba(170,142,45,.12); }
.station-status > i.aligned { background: var(--app-green); box-shadow: 0 0 0 5px rgba(77,146,113,.12); }
.station-status > i.content-difference { background: var(--app-orange); box-shadow: 0 0 0 5px rgba(239,141,104,.12); }
.station-status > i.source-lag { background: var(--app-yellow); }
.station-status > i.incomplete { background: var(--app-red); box-shadow: 0 0 0 5px rgba(169,79,71,.12); }
.station-status div { display: grid; gap: 3px; }
.station-status b { font-family: var(--mono); font-size: 11px; text-transform: uppercase; }
.station-status small { max-width: 260px; overflow: hidden; color: #718084; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.station-layout { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(330px, .85fr); gap: 18px; margin-top: 18px; }
.event-card > header,
.trace-card > header { display: flex; min-height: 68px; align-items: center; justify-content: space-between; gap: 20px; padding: 12px 17px; border-bottom: 1px solid var(--app-line); }
.event-card header span { color: #ba512b; font-family: var(--mono); font-size: 11px; }
.event-card header code { color: #68767a; font-size: 10px; }
.event-fields { display: grid; grid-template-columns: repeat(3, 1fr); margin: 0; }
.event-fields div { min-width: 0; padding: 15px 17px; border-right: 1px solid var(--app-line); border-bottom: 1px solid var(--app-line); }
.event-fields div:nth-child(3n) { border-right: 0; }
.event-fields dt { color: #657377; font-family: var(--mono); font-size: 10px; letter-spacing: .06em; text-transform: uppercase; }
.event-fields dd { overflow: hidden; margin: 6px 0 0; color: #36444a; font-family: var(--mono); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.raw-record { min-height: 132px; padding: 18px; margin: 17px; color: #dae1e0; background: #111b1f; border-left: 3px solid var(--app-orange); }
.raw-record span,
.record-hash span { display: block; margin-bottom: 9px; color: #98a5a9; font-family: var(--mono); font-size: 10px; letter-spacing: .07em; text-transform: uppercase; }
.raw-record code { color: #edf1f0; font-size: 13px; line-height: 1.7; overflow-wrap: anywhere; }
.record-hash { display: grid; grid-template-columns: 70px minmax(0,1fr); gap: 12px; align-items: baseline; padding: 0 17px 17px; }
.record-hash span { margin: 0; }
.record-hash code { overflow: hidden; color: #5f6e72; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.trace-card > header > span { color: #718084; font-family: var(--mono); font-size: 10px; }
.trace-card ol { position: relative; margin: 0; padding: 10px 17px; list-style: none; }
.trace-card ol::before { content: ""; position: absolute; top: 23px; bottom: 23px; left: 30px; width: 1px; background: #c0c5c0; }
.trace-card li { position: relative; display: grid; min-height: 69px; grid-template-columns: 27px 1fr auto; gap: 11px; align-items: center; }
.trace-card li > i { position: relative; z-index: 1; width: 9px; height: 9px; margin-left: 9px; background: var(--app-green); border: 2px solid var(--app-panel); border-radius: 50%; box-shadow: 0 0 0 1px var(--app-green); }
.trace-card li.is-missing > i { background: var(--app-red); box-shadow: 0 0 0 1px var(--app-red); }
.trace-card li div { display: grid; gap: 3px; }
.trace-card li b { font-size: 12px; }
.trace-card li small { color: #657377; font-size: 11px; }
.trace-card li time { color: #536267; font-size: 11px; }
.integrity-card { grid-column: 1 / -1; }
.integrity-card table { min-width: 850px; }
.integrity-card code { display: block; max-width: 165px; overflow: hidden; color: #647276; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }

.events-layout { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(350px, .8fr); gap: 18px; margin-top: 18px; }
.ledger-card { min-height: 520px; }
.event-timeline { position: relative; margin: 0; padding: 27px 30px; list-style: none; }
.event-timeline::before { content: ""; position: absolute; top: 37px; bottom: 38px; left: 98px; width: 1px; background: #c0c5c0; }
.event-timeline li { position: relative; display: grid; min-height: 91px; grid-template-columns: 58px 20px 1fr; gap: 13px; align-items: start; }
.event-timeline time { padding-top: 3px; color: #59686c; font-family: var(--mono); font-size: 11px; text-align: right; }
.event-timeline i { position: relative; z-index: 1; width: 10px; height: 10px; margin: 2px auto 0; background: var(--app-cyan); border: 2px solid var(--app-panel); border-radius: 50%; box-shadow: 0 0 0 1px var(--app-cyan); }
.event-timeline li.is-event i { background: var(--app-orange); box-shadow: 0 0 0 1px var(--app-orange); }
.event-timeline b { color: #354248; font-size: 13px; }
.event-timeline p { margin: 6px 0 0; color: #606d71; font-size: 12px; line-height: 1.55; }
.ledger-model { padding: clamp(34px, 4vw, 58px); color: #dbe2e1; background: #172327; border: 1px solid #344349; }
.ledger-model > p:first-child { color: #829196; font-family: var(--mono); font-size: 10px; letter-spacing: .09em; }
.ledger-model h2 { margin: 26px 0 19px; color: #eef2f1; font-family: var(--display); font-size: clamp(36px, 3.5vw, 52px); font-weight: 600; line-height: .95; text-transform: uppercase; }
.ledger-model > p:not(:first-child) { color: #abb5b7; font-size: 12px; line-height: 1.7; }
.ledger-model dl { margin: 30px 0; border-top: 1px solid #35444a; }
.ledger-model dl div { display: flex; justify-content: space-between; gap: 16px; padding: 13px 0; border-bottom: 1px solid #35444a; }
.ledger-model dt { color: #91a0a4; font-size: 11px; }
.ledger-model dd { margin: 0; color: #c1c9ca; font-family: var(--mono); font-size: 10px; text-align: right; }
.ledger-model a { display: flex; min-height: 48px; align-items: center; justify-content: space-between; padding: 0 15px; color: #101a1e; background: var(--app-orange); font-family: var(--mono); font-size: 10px; text-transform: uppercase; }

.automation-layout { display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(370px, .92fr); gap: 18px; margin-top: 18px; }
.rules-card,
.archive-card { min-width: 0; }
.rule-list { padding: 0 17px; }
.rule-row { display: grid; min-height: 96px; grid-template-columns: 34px 1fr 78px 32px; gap: 14px; align-items: center; border-bottom: 1px solid #d7d9d3; }
.rule-row > span { color: #858f91; font-family: var(--mono); font-size: 10px; }
.rule-row > div { display: grid; gap: 4px; }
.rule-row b { font-size: 13px; }
.rule-row small { color: #6c797d; font-size: 11px; line-height: 1.45; }
.rule-row em { color: #59676c; font-family: var(--mono); font-size: 10px; font-style: normal; text-align: right; }
.rule-row > i { position: relative; width: 30px; height: 17px; background: #c9ccc6; border-radius: 10px; }
.rule-row > i::after { content: ""; position: absolute; top: 3px; left: 3px; width: 11px; height: 11px; background: #7d8889; border-radius: 50%; }
.archive-card ul { margin: 0; padding: 0 17px; list-style: none; }
.archive-card li { display: grid; min-height: 96px; grid-template-columns: 34px 1fr auto; gap: 13px; align-items: center; border-bottom: 1px solid #d7d9d3; }
.archive-card li:last-child { border-bottom: 0; }
.archive-card li > b { color: #858f91; font-family: var(--mono); font-size: 10px; }
.archive-card li div { display: grid; gap: 4px; }
.archive-card strong { font-size: 13px; }
.archive-card small { color: #6c797d; font-size: 11px; line-height: 1.45; }
.archive-card em { color: #a94d2c; font-family: var(--mono); font-size: 10px; font-style: normal; text-transform: uppercase; }

@media (max-width: 1220px) {
  .app-topbar { grid-template-columns: minmax(250px, 1fr) 235px 295px 155px; }
  .app-body { grid-template-columns: 200px minmax(0, 1fr); }
  .network-layout { grid-template-columns: 1fr; }
  .network-visual { display: grid; min-height: 0; grid-template-columns: minmax(0, 1fr) 300px; grid-template-rows: 59px auto; }
  .network-visual > header { grid-column: 1 / -1; }
  .signal-chart { height: 230px; border-right: 1px solid #344349; border-bottom: 0; }
  .signal-readout { align-self: center; }
}

@media (max-width: 980px) {
  .app-topbar { grid-template-columns: minmax(250px, 1fr) minmax(220px, .8fr) 265px; }
  .app-product-link { display: none; }
  .app-body { grid-template-columns: 1fr; grid-template-rows: 70px minmax(0, 1fr); }
  .app-sidebar { display: grid; min-width: 0; grid-template-columns: repeat(4, 1fr); gap: 5px; padding: 8px; overflow: hidden; border-right: 0; border-bottom: 1px solid var(--app-line-dark); }
  .app-sidebar > p,
  .sidebar-spacer,
  .app-sidebar > a,
  .preview-stamp { display: none; }
  .app-sidebar button { min-height: 52px; grid-template-columns: 27px 1fr; padding: 7px 9px; }
  .app-sidebar button small { display: none; }
  .app-sidebar button b { align-self: center; grid-row: 1 / 3; font-size: 12px; }
  .station-layout,
  .events-layout,
  .automation-layout { grid-template-columns: 1fr; }
  .ledger-card { min-height: 440px; }
}

@media (max-width: 760px) {
  .workspace-main { height: calc(100dvh - 70px); }
  .workspace-app { grid-template-rows: 64px minmax(0, 1fr); }
  .app-topbar { grid-template-columns: minmax(0, 1fr) 72px; }
  .app-identity { padding: 0 14px; }
  .app-identity > span { width: 31px; height: 31px; }
  .app-identity b { font-size: 15px; }
  .app-identity small { font-size: 10px; }
  .app-connection { justify-content: center; padding: 0 10px; border-right: 0; }
  .app-connection div,
  .global-station { display: none; }
  .app-body { grid-template-rows: 62px minmax(0, 1fr); }
  .app-sidebar button { grid-template-columns: 1fr; justify-items: center; padding: 5px 3px; border-left: 0; border-bottom: 2px solid transparent; text-align: center; }
  .app-sidebar button.is-active { border-bottom-color: var(--app-orange); }
  .app-sidebar button > span { grid-row: auto; font-size: 13px; }
  .app-sidebar button b { grid-row: auto; align-self: auto; font-size: 10px; }
  .app-view { padding: 23px 15px 34px; }
  .view-heading { min-height: 66px; gap: 14px; padding-bottom: 14px; }
  .view-heading h1 { font-size: 34px; }
  .view-heading-meta span { display: none; }
  .view-heading-meta b,
  .planned-chip { font-size: 10px; }
  .metric-grid { grid-template-columns: repeat(2, 1fr); }
  .metric-grid article { min-height: 95px; }
  .metric-grid article:nth-child(2) { border-right: 0; }
  .metric-grid article:nth-child(-n+2) { border-bottom: 1px solid var(--app-line); }
  .network-visual { grid-template-columns: 1fr; }
  .network-visual > header { grid-column: 1; }
  .signal-chart { border-right: 0; border-bottom: 1px solid #344349; }
  .signal-readout { display: none; }
  .station-status { min-width: 0; padding: 10px; }
  .station-heading-actions > a { padding: 0 10px; }
  .station-status div { display: none; }
  .station-identity > span { width: 57px; height: 50px; font-size: 24px; }
  .station-identity h1 { font-size: 29px; }
  .event-fields { grid-template-columns: repeat(2, 1fr); }
  .event-fields div:nth-child(3n) { border-right: 1px solid var(--app-line); }
  .event-fields div:nth-child(2n) { border-right: 0; }
  .raw-record { min-height: 135px; }
  .trace-card ol { min-height: 205px; }
  .events-layout,
  .automation-layout { margin-top: 14px; }
  .ledger-card { min-height: 470px; }
  .ledger-model { padding: 30px 24px; }
  .ledger-model h2 { font-size: 38px; }
  .rule-row { grid-template-columns: 28px 1fr 30px; }
  .rule-row em { display: none; }
  .archive-card li { grid-template-columns: 28px 1fr; }
  .archive-card em { display: none; }
}

@media (max-width: 680px) {
  .workspace-main { height: calc(100dvh - 62px); }
}

@media (max-width: 430px) {
  .app-identity small { display: none; }
  .app-identity b { font-size: 14px; }
  .metric-grid span,
  .metric-grid small { font-size: 10px; }
  .metric-grid strong { font-size: 34px; }
  .station-identity { gap: 10px; }
  .station-heading-actions > a { display: none; }
  .station-identity > span { width: 52px; height: 47px; font-size: 22px; }
  .station-identity h1 { font-size: 26px; }
  .event-fields { grid-template-columns: 1fr; }
  .event-fields div,
  .event-fields div:nth-child(2n),
  .event-fields div:nth-child(3n) { border-right: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .app-view,
  .app-sidebar button,
  tbody tr { transition: none; }
}

/* Keep the operational surface compact, but never miniature. */
.workspace-app { font-size: 13px; }

.workspace-app :is(small, dt, time) {
  font-size: 11px !important;
  line-height: 1.45;
}

.workspace-app code { font-size: 12px !important; }

.workspace-app :is(
  .app-identity small,
  .app-connection small,
  .global-station > span,
  .app-product-link,
  .app-sidebar > p,
  .preview-stamp span,
  .view-heading p,
  .network-panel header p,
  .event-card header p,
  .trace-card header p,
  .integrity-card header p,
  .ledger-card header p,
  .rules-card header p,
  .archive-card header p,
  .view-heading-meta span,
  .view-heading-meta b,
  .planned-chip,
  .state-tag,
  .path-marks i,
  .network-visual header span,
  .network-visual header b,
  .signal-labels span,
  .metric-grid span,
  .event-card header span,
  .raw-record span,
  .record-hash span,
  .trace-card > header > span,
  .ledger-model > p:first-child,
  .ledger-model dd,
  .rule-row > span,
  .rule-row em,
  .archive-card li > b,
  .archive-card em
) {
  font-size: 11px;
}

.workspace-app :is(.open-station, .ledger-model a) {
  min-height: 38px;
  font-size: 11px;
}

@media (max-width: 760px) {
  .app-sidebar button b { font-size: 11px; }
  .view-heading-meta b,
  .planned-chip { font-size: 11px; }
}
