:root {
  --bg: #f4f6f8;
  --surface: #ffffff;
  --surface-soft: #eef4ff;
  --ink: #111820;
  --muted: #687480;
  --line: #dfe5eb;
  --dark: #0c1117;
  --teal: #0e9e96;
  --green: #138a5b;
  --blue: #165dce;
  --amber: #b87312;
  --red: #c94b4b;
  --shadow: 0 8px 22px rgba(17, 24, 32, 0.06);
  --radius: 6px;
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.hidden {
  display: none !important;
}

.login-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: linear-gradient(135deg, #132027, #0f4b4b 62%, #1d6b61);
}

.login-panel {
  width: min(440px, 100%);
  background: rgba(255, 255, 255, 0.97);
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: var(--radius);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.26);
  padding: 24px;
  display: grid;
  gap: 16px;
}

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

.brand-row.compact {
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.brand-logo {
  display: block;
  flex: 0 0 auto;
  object-fit: contain;
  background: transparent;
  border: 0;
  border-radius: 0;
}

.login-brand-logo {
  width: 86px;
  height: 86px;
}

.sidebar-brand-logo {
  width: 72px;
  height: 72px;
}

.mobile-brand-logo {
  display: none;
  width: 48px;
  height: 48px;
}

.brand-row h1 {
  margin: 0;
  font-size: 18px;
  letter-spacing: 0;
  line-height: 1.15;
}

.brand-row p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.sidebar .brand-row p {
  color: rgba(236, 244, 241, 0.7);
}

.login-copy {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 14px 0;
  display: grid;
  gap: 4px;
}

.login-copy strong {
  font-size: 16px;
}

.login-copy span,
.field span {
  color: var(--muted);
  font-size: 13px;
}

.field {
  display: grid;
  gap: 7px;
}

input,
select {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 9px 11px;
  background: #fff;
  color: var(--ink);
}

input:focus,
select:focus,
button:focus-visible {
  outline: 3px solid rgba(0, 139, 132, 0.22);
  outline-offset: 2px;
}

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

.primary-action,
.secondary-action {
  min-height: 40px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  padding: 9px 14px;
  font-weight: 750;
}

.primary-action {
  background: var(--teal);
  color: white;
}

.primary-action.small {
  min-height: 34px;
  padding: 7px 11px;
}

.secondary-action {
  background: white;
  color: var(--ink);
  border-color: var(--line);
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
}

.sidebar {
  background: var(--dark);
  color: #ecf4f1;
  padding: 20px 16px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.nav {
  display: grid;
  gap: 6px;
}

.nav button {
  width: 100%;
  min-height: 40px;
  border: 0;
  border-radius: var(--radius);
  padding: 9px 10px;
  background: transparent;
  color: rgba(236, 244, 241, 0.76);
  text-align: left;
  font-weight: 680;
}

.nav button.active {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.sidebar-status {
  margin-top: auto;
  display: grid;
  gap: 4px;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.07);
}

.sidebar-status span,
.sidebar-status small {
  color: rgba(236, 244, 241, 0.68);
  font-size: 12px;
}

.workspace {
  min-width: 0;
  display: grid;
  align-content: start;
}

.topbar {
  min-height: 84px;
  padding: 18px 24px;
  background: white;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

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

.topbar h2 {
  margin: 0;
  font-size: 24px;
  letter-spacing: 0;
}

.topbar p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.top-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.pill,
.status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  border-radius: 99px;
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 760;
  background: #eef4f2;
  color: #27524e;
}

.status.green {
  background: #e8f5ef;
  color: #176b43;
}

.status.blue {
  background: #e9f0fd;
  color: #214e9a;
}

.status.amber {
  background: #fff4df;
  color: #8b560f;
}

.status.red {
  background: #fdecec;
  color: #9b2f2f;
}

.metrics {
  padding: 18px 24px 0;
  display: grid;
  grid-template-columns: repeat(6, minmax(132px, 1fr));
  gap: 12px;
}

.metrics article,
.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.metrics article {
  min-height: 102px;
  padding: 14px;
  display: grid;
  align-content: space-between;
  gap: 6px;
}

.metrics span,
.metrics small {
  color: var(--muted);
  font-size: 12px;
}

.metrics strong {
  font-size: 26px;
  letter-spacing: 0;
}

.view {
  display: none;
  padding: 18px 24px 28px;
}

.view.active {
  display: block;
}

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

.span-2 {
  grid-column: 1 / -1;
}

.panel {
  min-width: 0;
  overflow: hidden;
}

.panel.highlight {
  border-color: rgba(45, 110, 211, 0.28);
}

.panel-head {
  min-height: 68px;
  padding: 15px 16px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.panel-head h3 {
  margin: 0;
  font-size: 16px;
  letter-spacing: 0;
}

.panel-head span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.panel-head .status {
  margin-top: 0;
}

.panel-body,
.wallet-panel,
.boundary-panel {
  padding: 16px;
}

.summary-grid,
.portfolio-grid,
.wallet-grid,
.boundary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.summary-item,
.portfolio-item,
.wallet-item,
.boundary-item {
  min-height: 74px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
  background: #fbfcfd;
  display: grid;
  align-content: space-between;
  gap: 5px;
}

.summary-item label,
.portfolio-item label,
.wallet-item label,
.boundary-item label {
  color: var(--muted);
  font-size: 12px;
}

.summary-item strong,
.portfolio-item strong,
.wallet-item strong,
.boundary-item strong {
  font-size: 15px;
}

.resource-strip,
.resource-list,
.task-list,
.service-market,
.timeline {
  padding: 14px;
  display: grid;
  gap: 10px;
}

.resource-strip {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.resource-card,
.task-card,
.service-card,
.log-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfcfd;
  padding: 12px;
}

.resource-card {
  min-height: 140px;
  display: grid;
  align-content: space-between;
  gap: 10px;
}

.resource-button {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  padding: 12px;
  text-align: left;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
}

.resource-button.active {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(0, 139, 132, 0.12);
}

.resource-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--surface-soft);
  color: var(--teal);
  font-weight: 900;
}

.resource-card h4,
.resource-button h4,
.task-card h4,
.service-card h4,
.log-card h4 {
  margin: 0;
  font-size: 14px;
  letter-spacing: 0;
}

.resource-card p,
.resource-button p,
.task-card p,
.service-card p,
.log-card p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.quality {
  min-width: 58px;
  text-align: right;
  font-size: 12px;
  color: var(--muted);
}

.bar {
  display: block;
  width: 100%;
  height: 7px;
  margin-top: 6px;
  border: 0;
  border-radius: 99px;
  appearance: none;
  overflow: hidden;
}

.bar::-webkit-progress-bar {
  background: #e6edf0;
  border-radius: 99px;
}

.bar::-webkit-progress-value {
  background: var(--teal);
  border-radius: 99px;
}

.bar::-moz-progress-bar {
  background: var(--teal);
  border-radius: 99px;
}

.passport-detail {
  padding: 16px;
  display: grid;
  gap: 14px;
}

.passport-visual {
  min-height: 168px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(0, 139, 132, 0.12), rgba(45, 110, 211, 0.1)),
    repeating-linear-gradient(90deg, transparent, transparent 25px, rgba(23, 33, 43, 0.04) 26px);
  display: grid;
  place-items: center;
  text-align: center;
  padding: 16px;
}

.passport-visual strong {
  display: block;
  font-size: 20px;
}

.passport-kv {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.service-form {
  padding: 16px;
  display: grid;
  gap: 12px;
}

.route-switch {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.route-switch button {
  min-height: 38px;
  border: 0;
  background: #fff;
  color: var(--muted);
  font-weight: 750;
}

.route-switch button.active {
  background: var(--teal);
  color: #fff;
}

.quote-box {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfcfd;
  display: grid;
}

.quote-row {
  min-height: 36px;
  padding: 9px 11px;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  border-bottom: 1px solid var(--line);
}

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

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

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

.task-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.task-card button {
  min-width: 86px;
}

.wallet-note {
  margin-top: 12px;
  padding: 12px;
  border: 1px solid #ffe3ad;
  border-radius: var(--radius);
  background: #fff9ee;
  color: #765018;
  line-height: 1.5;
  font-size: 13px;
}

.service-market {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.service-card {
  min-height: 160px;
  display: grid;
  align-content: space-between;
  gap: 10px;
}

.unit-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.unit-list span {
  border: 1px solid var(--line);
  border-radius: 99px;
  padding: 4px 8px;
  background: white;
  color: var(--muted);
  font-size: 12px;
}

.log-card {
  display: grid;
  gap: 4px;
}

@media (max-width: 1100px) {
  .metrics {
    grid-template-columns: repeat(3, minmax(140px, 1fr));
  }

  .resource-strip,
  .service-market {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 820px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: sticky;
    top: 0;
    z-index: 10;
    padding: 12px;
  }

  .brand-row.compact,
  .sidebar-status {
    display: none;
  }

  .nav {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    overflow-x: auto;
  }

  .nav button {
    text-align: center;
    white-space: nowrap;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
    padding: 16px;
  }

  .mobile-brand-logo {
    display: block;
  }

  .metrics,
  .view {
    padding-left: 16px;
    padding-right: 16px;
  }

  .metrics,
  .dashboard-grid,
  .resource-strip,
  .service-market,
  .summary-grid,
  .portfolio-grid,
  .wallet-grid,
  .boundary-grid,
  .passport-kv {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 520px) {
  .nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .resource-button,
  .task-card {
    grid-template-columns: 1fr;
  }

  .quality {
    text-align: left;
  }
}

/* V1.1-S owner live operations workspace */
.live-operations-head {
  min-height: 72px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-bottom: 0;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.live-operations-head h3,
.live-operations-head p {
  margin: 0;
}

.live-operations-head h3 {
  font-size: 16px;
}

.live-operations-head p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.live-operations-actions {
  min-width: 0;
  display: flex;
  align-items: end;
  gap: 10px;
}

.live-project-filter {
  width: min(280px, 34vw);
}

.live-project-filter select {
  min-height: 36px;
}

.live-operations-actions .status {
  min-height: 36px;
  margin: 0;
  display: inline-flex;
  align-items: center;
}

.live-operations-boundary {
  min-height: 38px;
  padding: 0 16px;
  border: 1px solid var(--line);
  background: #f7f9fb;
  display: flex;
  align-items: center;
  gap: 0;
  overflow-x: auto;
}

.live-operations-boundary span {
  min-width: max-content;
  padding: 0 14px;
  border-right: 1px solid var(--line);
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
}

.live-operations-boundary span:first-child {
  padding-left: 0;
  color: var(--blue);
}

.live-operations-boundary span:last-child {
  border-right: 0;
}

.live-operations-metrics {
  margin-top: 14px;
  border: 1px solid var(--line);
  background: var(--line);
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 1px;
}

.live-operations-metrics article {
  min-width: 0;
  min-height: 94px;
  padding: 15px 16px;
  background: #fff;
  display: grid;
  align-content: space-between;
  gap: 7px;
}

.live-operations-metrics span,
.live-operations-metrics small {
  color: var(--muted);
  font-size: 11px;
}

.live-operations-metrics strong {
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: 22px;
  font-variant-numeric: tabular-nums;
}

.live-operations-metrics small {
  font-size: 9px;
  font-weight: 800;
}

.live-operations-message {
  min-height: 20px;
  margin: 8px 0 0;
}

.live-operations-stations {
  display: grid;
  gap: 14px;
}

.live-station {
  min-width: 0;
  border: 1px solid var(--line);
  background: #fff;
}

.live-station-head {
  min-height: 84px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(440px, 1.4fr);
  align-items: center;
  gap: 20px;
}

.live-station-head h4,
.live-station-head p,
.live-station-summary,
.live-station-summary dd {
  margin: 0;
}

.live-station-head h4 {
  margin-top: 5px;
  font-size: 15px;
}

.live-station-head p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
  overflow-wrap: anywhere;
}

.live-station-kind {
  color: var(--blue);
  font-size: 10px;
  font-weight: 800;
}

.live-station-kind.solar {
  color: var(--amber);
}

.live-station-kind.storage {
  color: var(--green);
}

.live-station-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.live-station-summary div {
  min-width: 0;
  padding: 4px 14px;
  border-left: 1px solid var(--line);
}

.live-station-summary dt {
  color: var(--muted);
  font-size: 10px;
}

.live-station-summary dd {
  margin-top: 6px;
  overflow-wrap: anywhere;
  font-size: 15px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.live-station-weather {
  min-width: 0;
  padding: 10px 16px;
  border-bottom: 1px solid var(--line);
  background: #f7faf9;
  display: grid;
  grid-template-columns: minmax(190px, 0.8fr) minmax(0, 2.2fr);
  align-items: center;
  gap: 18px;
}

.live-weather-source {
  min-width: 0;
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  align-items: baseline;
  gap: 3px 8px;
}

.live-weather-source span,
.live-weather-source small,
.live-weather-source em {
  color: var(--muted);
  font-size: 9px;
  font-style: normal;
}

.live-weather-source span {
  color: var(--green);
  font-weight: 800;
  text-transform: uppercase;
}

.live-weather-source strong {
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: 11px;
}

.live-weather-source small,
.live-weather-source em {
  grid-column: 2;
}

.live-weather-source em {
  color: #8b6600;
  font-weight: 700;
}

.live-weather-metrics {
  min-width: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.live-weather-metrics div {
  min-width: 0;
  padding: 2px 10px;
  border-left: 1px solid #dfe8e4;
}

.live-weather-metrics dt {
  color: var(--muted);
  font-size: 9px;
}

.live-weather-metrics dd {
  margin: 4px 0 0;
  overflow-wrap: anywhere;
  font-size: 12px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.live-asset-grid {
  padding: 12px;
  display: grid;
  grid-template-columns: repeat(11, minmax(0, 1fr));
  gap: 7px;
}

.live-asset {
  min-width: 0;
  min-height: 76px;
  padding: 10px;
  border: 1px solid #e2e7ec;
  border-radius: 4px;
  background: #fff;
  display: grid;
  align-content: space-between;
  gap: 10px;
}

.live-asset-title,
.live-asset-values {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 6px;
}

.live-asset-title i {
  width: 7px;
  height: 7px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--green);
}

.live-asset-title strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 10px;
}

.live-asset-title span {
  margin-left: auto;
  color: var(--green);
  font-size: 9px;
}

.live-asset-values {
  justify-content: space-between;
  font-variant-numeric: tabular-nums;
}

.live-asset-values span {
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: 11px;
  font-weight: 800;
}

.live-asset-values small {
  color: var(--muted);
  font-size: 9px;
}

.live-asset-anomaly {
  display: grid;
  gap: 2px;
  margin: 8px 0 0;
  padding-top: 8px;
  border-top: 1px solid #f4c8c8;
  color: #9f2424;
  font-size: 11px;
  line-height: 1.35;
}

.live-asset-anomaly strong,
.live-asset-anomaly span {
  display: block;
}

.live-asset-anomaly span {
  color: #7a3b3b;
}

.live-asset[data-status="idle"] .live-asset-title i,
.live-asset[data-status="curtailed"] .live-asset-title i {
  background: var(--amber);
}

.live-asset[data-status="idle"] .live-asset-title span,
.live-asset[data-status="curtailed"] .live-asset-title span {
  color: var(--amber);
}

.live-asset[data-status="degraded"],
.live-asset[data-status="alarm"] {
  border-color: #e9c9a5;
  background: #fffaf3;
}

.live-asset[data-status="degraded"] .live-asset-title i,
.live-asset[data-status="alarm"] .live-asset-title i {
  background: var(--red);
}

.live-asset[data-status="degraded"] .live-asset-title span,
.live-asset[data-status="alarm"] .live-asset-title span {
  color: var(--red);
}

.live-asset[data-status="offline"] {
  background: #f3f5f7;
  color: var(--muted);
}

.live-asset[data-status="offline"] .live-asset-title i {
  background: #8a96a3;
}

.live-asset[data-status="offline"] .live-asset-title span {
  color: var(--muted);
}

@media (max-width: 1280px) {
  .live-asset-grid {
    grid-template-columns: repeat(8, minmax(0, 1fr));
  }

  .live-operations-metrics {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .live-operations-metrics article:last-child {
    grid-column: span 2;
  }
}

@media (max-width: 900px) {
  .live-station-head {
    grid-template-columns: 1fr;
  }

  .live-station-summary div:first-child {
    border-left: 0;
  }

  .live-station-weather {
    grid-template-columns: 1fr;
  }

  .live-weather-metrics div:first-child {
    border-left: 0;
  }

  .live-asset-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
}

@media (max-width: 620px) {
  .live-operations-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .live-operations-boundary {
    padding: 0;
    overflow: visible;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .live-weather-metrics {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    row-gap: 10px;
  }

  .live-weather-metrics div:nth-child(4) {
    border-left: 0;
  }

  .live-operations-boundary span {
    min-width: 0;
    min-height: 36px;
    padding: 8px 10px;
    border-right: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    display: flex;
    align-items: center;
    overflow-wrap: anywhere;
    line-height: 1.35;
  }

  .live-operations-boundary span:first-child {
    padding-left: 10px;
  }

  .live-operations-boundary span:nth-child(2n),
  .live-operations-boundary span:last-child {
    border-right: 0;
  }

  .live-operations-boundary span:nth-last-child(-n + 2) {
    border-bottom: 0;
  }

  .live-operations-actions {
    width: 100%;
    align-items: end;
  }

  .live-project-filter {
    width: auto;
    min-width: 0;
    flex: 1;
  }

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

  .live-operations-metrics article:last-child {
    grid-column: span 2;
  }

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

  .live-station-summary div:nth-child(3) {
    border-left: 0;
  }

  .live-station-summary div:nth-child(-n + 2) {
    border-bottom: 1px solid var(--line);
  }

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

.asset-os-job-panel {
  margin-top: 14px;
}

.optimization-review-queue-panel {
  margin-top: 14px;
}

.optimization-review-queue {
  display: grid;
}

.optimization-review-queue-item {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto auto;
  gap: 14px;
  align-items: center;
  min-width: 0;
  padding: 13px 18px;
  border-top: 1px solid var(--line);
}

.optimization-review-queue-item > div {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.optimization-review-queue-item strong,
.optimization-review-queue-item span {
  overflow-wrap: anywhere;
}

.optimization-review-queue-item > div span {
  color: var(--muted);
  font-size: 11px;
}

.asset-os-job-layout {
  display: grid;
  grid-template-columns: minmax(520px, 1fr) minmax(420px, 1fr);
  min-height: 260px;
}

.asset-os-job-controls {
  padding: 18px;
  border-right: 1px solid var(--line);
  display: grid;
  gap: 13px;
  align-content: start;
}

.asset-os-job-result {
  min-width: 0;
  padding: 18px;
  display: grid;
  align-content: start;
  gap: 12px;
}

.asset-os-result-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.asset-os-result-grid div {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f8fafc;
  display: grid;
  gap: 5px;
}

.asset-os-result-grid span,
.asset-os-result-meta {
  color: var(--muted);
  font-size: 11px;
}

.asset-os-result-grid strong {
  overflow-wrap: anywhere;
}

.asset-os-parameter-group {
  border-top: 1px solid var(--line);
  padding-top: 13px;
  display: grid;
  gap: 11px;
}

.asset-os-parameter-head,
.asset-os-check-grid,
.asset-os-inline-check,
.optimization-boundary {
  display: flex;
  align-items: center;
}

.asset-os-parameter-head {
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.asset-os-parameter-head strong,
.asset-os-parameter-label {
  font-size: 12px;
}

.asset-os-parameter-head span,
.asset-os-workload-legend,
.optimization-boundary span {
  color: var(--muted);
  font-size: 11px;
}

.asset-os-parameter-grid,
.asset-os-route-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
}

.asset-os-check-grid {
  flex-wrap: wrap;
  gap: 8px 18px;
}

.asset-os-check-grid label,
.asset-os-inline-check {
  min-height: 28px;
  gap: 7px;
  color: var(--muted);
  font-size: 11px;
}

.asset-os-check-grid input,
.asset-os-inline-check input {
  width: 16px;
  height: 16px;
  accent-color: var(--primary);
}

.asset-os-workload-list {
  display: grid;
  gap: 7px;
}

.asset-os-workload-row,
.asset-os-workload-legend {
  display: grid;
  grid-template-columns: minmax(88px, 1.25fr) repeat(3, minmax(58px, 0.72fr)) minmax(86px, 0.9fr) minmax(72px, 0.78fr);
  gap: 6px;
  align-items: center;
}

.asset-os-workload-row {
  padding-top: 7px;
  border-top: 1px solid var(--line);
}

.asset-os-workload-row input,
.asset-os-workload-row select {
  width: 100%;
  min-width: 0;
  min-height: 34px;
  padding: 7px 8px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #fff;
  color: var(--ink);
  font: inherit;
}

.asset-os-workload-field {
  min-width: 0;
}

.asset-os-workload-field > span {
  display: none;
}

.optimization-table {
  display: grid;
  border-top: 1px solid var(--line);
}

.optimization-table-row {
  display: grid;
  grid-template-columns: minmax(130px, 1.35fr) repeat(2, minmax(90px, 0.85fr)) auto;
  gap: 10px;
  align-items: center;
  min-width: 0;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
  font-size: 12px;
}

.optimization-table-row strong,
.optimization-table-row span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.optimization-table-row > span:not(.status) {
  color: var(--muted);
}

.optimization-boundary {
  align-items: flex-start;
  gap: 9px;
  padding: 11px 12px;
  border-left: 3px solid var(--accent);
  background: #f7faf9;
}

.optimization-boundary strong {
  flex: 0 0 auto;
  font-size: 12px;
}

.asset-os-domain-output {
  border-top: 1px solid var(--line);
  padding-top: 14px;
  display: grid;
  gap: 12px;
}

.asset-os-domain-head,
.asset-os-attention-list div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.asset-os-domain-head strong {
  font-size: 14px;
}

.asset-os-attention-list {
  display: grid;
  border-top: 1px solid var(--line);
}

.asset-os-attention-list div {
  min-width: 0;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
  font-size: 12px;
}

.asset-os-attention-list strong {
  overflow-wrap: anywhere;
}

.asset-os-attention-list span {
  color: var(--muted);
}

.report-decision-controls,
.report-approval-record {
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

.report-decision-controls {
  display: grid;
  gap: 12px;
}

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

.secondary-action.small {
  min-height: 34px;
  padding: 7px 11px;
}

.report-approval-record {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 4px 10px;
  font-size: 12px;
}

.report-approval-record span,
.report-approval-record small {
  color: var(--muted);
}

.report-approval-record small {
  grid-column: 1 / -1;
  overflow-wrap: anywhere;
}

.notification-outbox-panel {
  margin-top: 14px;
}

.notification-outbox {
  display: grid;
}

.notification-outbox-row {
  min-width: 0;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
}

.notification-outbox-copy,
.notification-outbox-actions {
  min-width: 0;
  display: grid;
  gap: 5px;
}

.notification-outbox-copy span,
.notification-outbox-copy small,
.notification-outbox-actions small {
  color: var(--muted);
  font-size: 11px;
  overflow-wrap: anywhere;
}

.notification-outbox-actions {
  justify-items: end;
  text-align: right;
}

.organization-admin-layout {
  display: grid;
  grid-template-columns: minmax(320px, 0.85fr) minmax(460px, 1.15fr);
  gap: 14px;
  align-items: start;
}

.organization-directory {
  max-height: 700px;
  overflow-y: auto;
}

.organization-directory-row {
  width: 100%;
  min-height: 92px;
  padding: 14px 16px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  text-align: left;
}

.organization-directory-row:hover,
.organization-directory-row.active {
  background: #f5f8fd;
}

.organization-directory-row.active {
  box-shadow: inset 3px 0 0 var(--blue);
}

.organization-directory-main,
.organization-directory-meta {
  min-width: 0;
  display: grid;
  gap: 5px;
}

.organization-directory-main strong,
.organization-directory-main small {
  overflow-wrap: anywhere;
}

.organization-directory-main small,
.organization-directory-meta small {
  color: var(--muted);
  font-size: 11px;
}

.organization-directory-meta {
  justify-items: end;
  text-align: right;
}

.organization-form {
  padding: 18px;
  display: grid;
  gap: 18px;
}

@media (max-width: 980px) {
  .asset-os-job-layout,
  .organization-admin-layout {
    grid-template-columns: 1fr;
  }

  .asset-os-job-controls {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
}

@media (max-width: 600px) {
  .asset-os-result-grid,
  .organization-form .form-grid {
    grid-template-columns: 1fr;
  }

  .organization-form-actions button {
    width: 100%;
  }

  .report-decision-actions,
  .report-decision-actions button {
    width: 100%;
  }

  .optimization-review-queue-item {
    grid-template-columns: 1fr auto;
  }

  .optimization-review-queue-item button {
    grid-column: 1 / -1;
    width: 100%;
  }

  .asset-os-parameter-grid,
  .asset-os-route-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .asset-os-parameter-grid {
    grid-template-columns: 1fr;
  }

  .asset-os-workload-legend {
    display: none;
  }

  .asset-os-workload-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    min-width: 0;
    gap: 9px;
    padding: 12px 0;
  }

  .asset-os-workload-field {
    display: grid;
    gap: 5px;
  }

  .asset-os-workload-field > span {
    display: block;
    color: var(--muted);
    font-size: 11px;
  }

  .asset-os-inline-check {
    align-self: end;
    min-height: 34px;
  }

  .optimization-table-row {
    grid-template-columns: minmax(110px, 1fr) minmax(90px, 0.8fr);
  }

  .notification-outbox-row {
    grid-template-columns: 1fr;
  }

  .notification-outbox-actions {
    justify-items: start;
    text-align: left;
  }
}

.operations-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(300px, 0.8fr);
  gap: 14px;
  align-items: start;
}

.operations-head-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.operations-head-actions .icon-action {
  width: 36px;
  min-width: 36px;
  height: 36px;
  padding: 0;
  font-size: 21px;
  line-height: 1;
}

.operations-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 16px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.operations-metrics > div {
  min-width: 0;
  display: grid;
  gap: 7px;
  padding: 18px 16px;
  border-right: 1px solid var(--line);
}

.operations-metrics > div:last-child {
  border-right: 0;
}

.operations-metrics span,
.operations-metrics small,
.operations-details dt,
.operations-boundary span {
  color: var(--muted);
}

.operations-metrics span {
  font-size: 12px;
  font-weight: 700;
}

.operations-metrics strong {
  font-size: 24px;
  line-height: 1.15;
}

.operations-metrics strong[data-status="ok"] {
  color: var(--green);
}

.operations-metrics strong[data-status="warning"],
.operations-metrics strong[data-status="not_configured"] {
  color: #9a6800;
}

.operations-metrics strong[data-status="critical"] {
  color: var(--red);
}

.operations-metrics small {
  min-height: 30px;
  overflow-wrap: anywhere;
  font-size: 10px;
  line-height: 1.45;
}

#operationsMessage:not(:empty) {
  margin-top: 12px;
}

.operations-details {
  display: grid;
  margin: 12px 0 0;
}

.operations-details > div {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(120px, 1fr) minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
}

.operations-details dt,
.operations-details dd {
  margin: 0;
  font-size: 12px;
}

.operations-details dd {
  min-width: 0;
  overflow-wrap: anywhere;
  text-align: right;
  font-weight: 750;
}

.operations-boundary {
  display: grid;
  gap: 6px;
  padding-top: 16px;
}

.operations-boundary strong {
  font-size: 12px;
}

.operations-boundary span {
  font-size: 11px;
  line-height: 1.6;
}

@media (max-width: 1060px) {
  .operations-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .operations-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .operations-metrics > div:nth-child(2) {
    border-right: 0;
  }

  .operations-metrics > div:nth-child(-n + 2) {
    border-bottom: 1px solid var(--line);
  }
}

@media (max-width: 420px) {
  .operations-metrics {
    grid-template-columns: 1fr;
  }

  .operations-metrics > div,
  .operations-metrics > div:nth-child(2) {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .operations-metrics > div:last-child {
    border-bottom: 0;
  }

  .operations-details > div {
    grid-template-columns: 1fr;
    gap: 5px;
  }

  .operations-details dd {
    text-align: left;
  }
}

/* V0.9 ZWATT append-only demo ledger */
.ledger-workspace,
.ledger-correction-panel {
  margin-top: 14px;
}

#view-wallet .timeline,
#view-wallet .log-card {
  min-width: 0;
}

#view-wallet .log-card h4,
#view-wallet .log-card p {
  min-width: 0;
  overflow-wrap: anywhere;
}

.wallet-overview-panel,
.audit-workspace {
  grid-column: 1 / -1;
}

.audit-filters {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  background: #fbfcfe;
  display: grid;
  grid-template-columns: repeat(4, minmax(140px, 1fr));
  gap: 10px;
  align-items: end;
}

.audit-filters input,
.audit-filters select {
  min-width: 0;
  min-height: 36px;
  padding-top: 7px;
  padding-bottom: 7px;
}

.audit-filter-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.audit-filter-actions button {
  min-height: 36px;
  white-space: nowrap;
}

#auditMessage {
  min-height: 0;
  padding: 0 16px;
}

#auditMessage:not(:empty) {
  padding-top: 12px;
}

.audit-entries {
  padding: 14px 16px 16px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}

.audit-entry-head {
  min-width: 0;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}

.audit-entry-head h4 {
  min-width: 0;
  overflow-wrap: anywhere;
}

.ledger-filters {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  background: #fbfcfe;
  display: grid;
  grid-template-columns: repeat(5, minmax(130px, 1fr)) auto;
  gap: 10px;
  align-items: end;
}

.ledger-filters input,
.ledger-filters select {
  min-width: 0;
  min-height: 36px;
  padding-top: 7px;
  padding-bottom: 7px;
}

.ledger-filter-actions {
  display: grid;
  grid-template-columns: repeat(2, max-content);
  gap: 8px;
}

.ledger-filter-actions button {
  min-height: 36px;
  white-space: nowrap;
}

#ledgerMessage {
  min-height: 0;
  padding: 0 16px;
}

#ledgerMessage:not(:empty) {
  padding-top: 12px;
}

.ledger-entries {
  padding: 14px 16px 16px;
  display: grid;
  gap: 9px;
}

.ledger-entry {
  min-width: 0;
  border: 1px solid #e1e7ed;
  border-left: 3px solid var(--blue);
  border-radius: var(--radius);
  padding: 13px 14px;
  background: #fff;
  display: grid;
  gap: 11px;
}

.ledger-entry.correction {
  border-left-color: var(--amber);
  background: #fffdf7;
}

.ledger-entry-head,
.ledger-entry-foot {
  min-width: 0;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.ledger-entry-head > div {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.ledger-entry-head strong {
  font-size: 13px;
  overflow-wrap: anywhere;
}

.ledger-entry-head span,
.ledger-entry-foot span {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.ledger-entry-head .status {
  color: inherit;
  flex: 0 0 auto;
}

.ledger-entry-values {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.ledger-entry-values > div {
  min-width: 0;
  min-height: 54px;
  padding: 9px 10px;
  border-right: 1px solid var(--line);
  display: grid;
  gap: 4px;
  align-content: center;
}

.ledger-entry-values > div:last-child {
  border-right: 0;
}

.ledger-entry-values span {
  color: var(--muted);
  font-size: 10px;
}

.ledger-entry-values strong {
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

.ledger-correction-form {
  padding: 16px;
  display: grid;
  grid-template-columns: minmax(240px, 1.4fr) repeat(3, minmax(150px, 0.7fr));
  gap: 12px;
  align-items: end;
}

.correction-reason-field,
.ledger-correction-actions,
#ledgerCorrectionMessage {
  grid-column: 1 / -1;
}

.ledger-correction-form textarea {
  width: 100%;
  min-height: 90px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px 11px;
  background: #fff;
  color: var(--ink);
  resize: vertical;
  font: inherit;
}

.ledger-correction-form textarea:focus {
  outline: 3px solid rgba(0, 139, 132, 0.22);
  outline-offset: 2px;
}

.ledger-correction-actions {
  justify-content: flex-end;
  padding-top: 2px;
}

@media (max-width: 1180px) {
  .audit-filters {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .ledger-filters {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .ledger-filter-actions {
    align-self: end;
  }

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

  .correction-reference-field {
    grid-column: 1 / -1;
  }
}

@media (max-width: 700px) {
  .audit-filters,
  .audit-entries {
    grid-template-columns: 1fr;
  }

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

  .audit-filter-actions button {
    white-space: normal;
  }

  .audit-entry-head {
    display: grid;
  }

  .ledger-filters,
  .ledger-correction-form,
  .ledger-entry-values {
    grid-template-columns: 1fr;
  }

  .correction-reference-field,
  .correction-reason-field,
  .ledger-correction-actions,
  #ledgerCorrectionMessage {
    grid-column: auto;
  }

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

  .ledger-filter-actions button {
    white-space: normal;
  }

  .ledger-entry-head,
  .ledger-entry-foot {
    display: grid;
  }

  .ledger-entry-values > div {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .ledger-entry-values > div:last-child {
    border-bottom: 0;
  }

  .ledger-correction-actions {
    display: grid;
  }
}

/* V0.9 task management */
.task-management-layout {
  display: grid;
  grid-template-columns: minmax(380px, 0.9fr) minmax(560px, 1.1fr);
  gap: 14px;
  align-items: start;
}

.task-directory-panel .panel-head,
.task-editor-panel .panel-head,
.task-directory-panel .panel-head > div,
.task-editor-panel .panel-head > div {
  min-width: 0;
}

.task-directory-panel .panel-head span,
.task-editor-panel .panel-head span {
  overflow-wrap: anywhere;
}

.task-filters {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  background: #fbfcfe;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}

.project-filters {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  background: #fbfcfe;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}

.business-query-filters .business-search-field,
.business-query-filters .business-filter-actions,
.business-query-filters .filter-message {
  grid-column: 1 / -1;
}

.compact-field input {
  min-height: 36px;
  padding-top: 7px;
  padding-bottom: 7px;
}

.business-filter-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.business-filter-actions button {
  min-width: 0;
  width: 100%;
}

.filter-message {
  min-height: 0;
  margin: 0;
  color: var(--red);
  font-size: 11px;
  line-height: 1.4;
}

.filter-message:empty {
  display: none;
}

.filter-message.success {
  color: var(--green);
}

.task-directory-panel .task-list {
  max-height: 760px;
  overflow-y: auto;
}

.task-directory-row {
  width: 100%;
  min-height: 102px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  padding: 12px;
  color: var(--ink);
  text-align: left;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
}

.task-directory-row:hover {
  border-color: #b8c9dd;
  background: #f8fafd;
}

.task-directory-row.active {
  border-color: var(--blue);
  box-shadow: inset 3px 0 0 var(--blue);
}

.task-directory-main {
  min-width: 0;
  display: grid;
  gap: 5px;
}

.task-directory-main strong {
  font-size: 13px;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.task-directory-main small {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.task-directory-meta {
  min-width: 62px;
  display: grid;
  justify-items: end;
  gap: 5px;
}

.task-directory-meta .status {
  min-width: 54px;
  text-align: center;
  font-style: normal;
}

.task-form {
  padding: 18px;
  display: grid;
  gap: 18px;
}

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

.task-form-grid textarea {
  width: 100%;
  resize: vertical;
  min-height: 104px;
}

.task-governance-boundary {
  border-left: 3px solid var(--blue);
  background: #f3f7fc;
  color: var(--muted);
  padding: 10px 12px;
  font-size: 11px;
  line-height: 1.5;
}

.task-form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

textarea:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

@media (max-width: 1080px) {
  .task-management-layout {
    grid-template-columns: 1fr;
  }

  .task-directory-panel .task-list {
    max-height: 460px;
  }
}

@media (max-width: 620px) {
  .project-filters,
  .task-filters,
  .task-form-grid {
    grid-template-columns: 1fr;
  }

  .task-form-grid .span-2 {
    grid-column: auto;
  }

  .task-directory-row {
    grid-template-columns: 1fr;
  }

  .task-directory-meta {
    grid-template-columns: repeat(2, auto);
    justify-items: start;
    justify-content: start;
  }

  .task-form-actions {
    display: grid;
    grid-template-columns: 1fr;
  }
}

/* V0.9 resource passport management */
.resource-management-layout {
  display: grid;
  grid-template-columns: minmax(360px, 0.85fr) minmax(560px, 1.15fr);
  gap: 14px;
  align-items: start;
}

.resource-directory-panel .panel-head,
.resource-editor-panel .panel-head {
  min-width: 0;
}

.resource-directory-panel .panel-head > div,
.resource-editor-panel .panel-head > div {
  min-width: 0;
}

.resource-directory-panel .panel-head span,
.resource-editor-panel .panel-head span {
  overflow-wrap: anywhere;
}

.resource-filters {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  background: #fbfcfe;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}

.compact-field {
  gap: 5px;
}

.compact-field span {
  font-size: 10px;
}

.compact-field select {
  min-height: 36px;
  padding-top: 7px;
  padding-bottom: 7px;
}

.resource-directory-panel .resource-list {
  max-height: 760px;
  overflow-y: auto;
}

.resource-button {
  min-height: 88px;
  grid-template-columns: 60px minmax(0, 1fr) auto;
}

.resource-button .resource-icon {
  width: 54px;
  height: 38px;
  padding: 0 5px;
  border-radius: 4px;
  font-size: 10px;
  line-height: 1.1;
  text-align: center;
  white-space: nowrap;
}

.resource-button:hover {
  border-color: #b8c9dd;
  background: #f8fafd;
}

.resource-button.active {
  border-color: var(--blue);
  box-shadow: inset 3px 0 0 var(--blue);
}

.resource-row-meta {
  min-width: 76px;
  display: grid;
  justify-items: end;
  gap: 3px;
}

.resource-row-meta .bar {
  width: 72px;
}

.resource-form {
  padding: 18px;
  display: grid;
  gap: 18px;
}

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

.resource-history-band {
  border-top: 1px solid var(--line);
  padding-top: 16px;
  display: grid;
  gap: 12px;
}

.resource-dq-band {
  border-top: 1px solid var(--line);
  padding-top: 16px;
  display: grid;
  gap: 12px;
}

.resource-dq-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.resource-dq-summary {
  display: grid;
  grid-template-columns: minmax(110px, 0.7fr) repeat(3, minmax(0, 1fr));
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.resource-dq-summary > div {
  min-width: 0;
  padding: 12px;
  border-right: 1px solid var(--line);
}

.resource-dq-summary > div:last-child {
  border-right: 0;
}

.resource-dq-summary span,
.resource-dq-components span,
.resource-dq-history span {
  display: block;
  color: var(--muted);
  font-size: 11px;
}

.resource-dq-summary strong {
  display: block;
  margin-top: 4px;
  font-size: 14px;
  overflow-wrap: anywhere;
}

.resource-dq-summary .resource-dq-score strong {
  color: var(--blue);
  font-size: 28px;
  line-height: 1;
}

.resource-dq-components {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

.resource-dq-component {
  min-width: 0;
  padding: 10px 0;
}

.resource-dq-component strong {
  display: block;
  margin: 4px 0 7px;
  font-size: 13px;
}

.resource-dq-component progress {
  width: 100%;
}

.resource-dq-history {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 32px;
  overflow-x: auto;
}

.resource-dq-deductions {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.6;
}

.resource-dq-deductions strong {
  color: var(--ink);
}

.resource-dq-history strong {
  flex: 0 0 auto;
  font-size: 11px;
}

.resource-dq-history ol {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.resource-dq-history li {
  min-width: 52px;
  padding-left: 8px;
  border-left: 2px solid var(--line);
}

.resource-dq-history li.good {
  border-color: var(--green);
}

.resource-dq-history li.watch {
  border-color: var(--amber);
}

.resource-dq-history li.poor {
  border-color: var(--red);
}

.section-heading-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.section-heading-row h4 {
  margin: 0 0 4px;
  font-size: 14px;
  letter-spacing: 0;
}

.section-heading-row span:not(.status) {
  color: var(--muted);
  font-size: 11px;
}

.resource-history {
  max-height: 390px;
  overflow-y: auto;
  display: grid;
  gap: 9px;
}

.resource-history-entry {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfcfe;
  overflow: hidden;
}

.resource-history-head {
  min-height: 44px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.resource-history-head strong {
  font-size: 13px;
}

.resource-history-head span {
  color: var(--muted);
  font-size: 11px;
  text-align: right;
}

.resource-history-changes {
  display: grid;
}

.resource-history-changes > div {
  min-height: 38px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--line);
  display: grid;
  grid-template-columns: minmax(110px, 0.35fr) minmax(0, 1fr);
  gap: 12px;
  align-items: center;
}

.resource-history-changes > div:last-child {
  border-bottom: 0;
}

.resource-history-changes span {
  color: var(--muted);
  font-size: 11px;
}

.resource-history-changes strong {
  min-width: 0;
  font-size: 11px;
  font-weight: 750;
  overflow-wrap: anywhere;
}

@media (max-width: 1080px) {
  .resource-management-layout {
    grid-template-columns: 1fr;
  }

  .resource-directory-panel .resource-list {
    max-height: 460px;
  }
}

@media (max-width: 620px) {
  .resource-filters,
  .resource-form-grid {
    grid-template-columns: 1fr;
  }

  .resource-form-grid .span-2 {
    grid-column: auto;
  }

  .resource-button {
    grid-template-columns: 60px minmax(0, 1fr);
  }

  .resource-row-meta {
    grid-column: 2;
    justify-items: start;
  }

  .resource-history-head,
  .section-heading-row {
    align-items: flex-start;
  }

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

  .resource-dq-summary > div:nth-child(2) {
    border-right: 0;
  }

  .resource-dq-summary > div:nth-child(-n + 2) {
    border-bottom: 1px solid var(--line);
  }

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

  .resource-history-head {
    display: grid;
  }

  .resource-history-head span {
    text-align: left;
  }

  .resource-history-changes > div {
    grid-template-columns: 1fr;
    gap: 4px;
  }
}

/* V0.9 user administration and account security */
button:disabled,
input:disabled,
select:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

.text-action {
  min-height: 36px;
  border: 0;
  background: transparent;
  color: var(--blue);
  font-weight: 700;
}

.password-change-layout {
  width: min(860px, 100%);
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(360px, 1.1fr);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 24px 64px rgba(30, 55, 87, 0.14);
}

.password-change-context {
  padding: 42px;
  background: #eaf2ff;
  display: grid;
  align-content: center;
  gap: 20px;
}

.password-change-context h2 {
  margin: 4px 0 0;
  font-size: 28px;
  letter-spacing: 0;
}

.password-change-context > p {
  margin: -8px 0 0;
  color: var(--muted);
  line-height: 1.65;
}

.password-rule-list {
  border-top: 1px solid #cbd8e9;
  display: grid;
}

.password-rule-list span {
  min-height: 42px;
  padding: 11px 0;
  border-bottom: 1px solid #cbd8e9;
  color: #52677f;
  font-size: 13px;
}

.password-change-form {
  padding: 42px;
  display: grid;
  align-content: center;
  gap: 16px;
}

.account-context {
  margin-bottom: 4px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
  display: grid;
  gap: 5px;
}

.account-context span {
  color: var(--muted);
  font-size: 12px;
}

.account-context strong {
  overflow-wrap: anywhere;
}

.user-admin-layout {
  display: grid;
  grid-template-columns: minmax(320px, 0.8fr) minmax(480px, 1.2fr);
  gap: 14px;
  align-items: start;
}

.user-directory {
  max-height: 690px;
  overflow-y: auto;
}

.user-directory-row {
  width: 100%;
  min-height: 92px;
  padding: 14px 16px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) auto;
  gap: 11px;
  align-items: center;
  text-align: left;
}

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

.user-directory-row:hover,
.user-directory-row.active {
  background: #f5f8fd;
}

.user-directory-row.active {
  box-shadow: inset 3px 0 0 var(--blue);
}

.user-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #edf3fc;
  color: var(--blue);
  display: grid;
  place-items: center;
  font-weight: 850;
}

.user-directory-copy {
  min-width: 0;
  display: grid;
  gap: 5px;
}

.user-directory-copy strong,
.user-directory-copy small {
  overflow-wrap: anywhere;
}

.user-directory-copy small,
.user-directory-flags small {
  color: var(--muted);
  font-size: 11px;
}

.user-directory-flags {
  max-width: 150px;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px;
  text-align: right;
}

.user-directory-flags i {
  font-style: normal;
}

.user-admin-form {
  padding: 18px;
  display: grid;
  gap: 18px;
}

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

.form-section {
  padding-top: 18px;
  border-top: 1px solid var(--line);
  display: grid;
  gap: 13px;
}

.form-section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.form-section-head strong {
  font-size: 14px;
}

.form-section-head span {
  color: var(--muted);
  font-size: 11px;
  text-align: right;
}

.project-assignments {
  border-top: 1px solid var(--line);
}

.project-assignment-row {
  min-height: 54px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr) 110px;
  gap: 10px;
  align-items: center;
}

.project-assignment-row input[type="checkbox"] {
  width: 18px;
  min-height: 18px;
  margin: 0;
  accent-color: var(--blue);
}

.project-assignment-row select {
  min-height: 36px;
  padding-top: 6px;
  padding-bottom: 6px;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.inline-notice {
  padding: 11px 12px;
  border-left: 3px solid var(--amber);
  background: #fff8ea;
  color: #765018;
  font-size: 13px;
  line-height: 1.5;
}

.form-error.success {
  color: var(--green);
}

.password-reset-section {
  padding: 18px;
  border-top: 1px solid var(--line);
  display: grid;
  gap: 14px;
}

.password-reset-section > div:first-child {
  display: grid;
  gap: 5px;
}

.password-reset-section span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.password-reset-controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: end;
}

.danger-action {
  color: #9b2f2f;
  border-color: #efcaca;
}

/* V1.3 service identities and one-time API credentials */
.usage-event-readiness {
  margin-bottom: 14px;
  border: 1px solid var(--line);
  background: #fff;
}

.usage-event-readiness-head {
  min-height: 70px;
  padding: 15px 18px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.usage-event-readiness-head > div,
.usage-event-readiness-state {
  min-width: 0;
  display: grid;
  gap: 5px;
}

.usage-event-readiness-head h3 {
  margin: 0;
  font-size: 16px;
}

.usage-event-readiness-head span,
.usage-event-readiness-state small {
  color: var(--muted);
  font-size: 11px;
}

.usage-event-readiness-state {
  justify-items: end;
  text-align: right;
}

.usage-event-readiness-metrics {
  display: grid;
  grid-template-columns: 1.35fr repeat(4, minmax(0, 1fr));
  border-bottom: 1px solid var(--line);
}

.usage-event-readiness-metrics > div {
  min-width: 0;
  min-height: 74px;
  padding: 13px 16px;
  border-right: 1px solid var(--line);
  display: grid;
  align-content: center;
  gap: 7px;
}

.usage-event-readiness-metrics > div:last-child {
  border-right: 0;
}

.usage-event-readiness-metrics span,
.usage-event-readiness-metrics strong {
  min-width: 0;
  overflow-wrap: anywhere;
}

.usage-event-readiness-metrics span {
  color: var(--muted);
  font-size: 10px;
}

.usage-event-readiness-metrics strong {
  font-size: 15px;
}

.usage-event-readiness-checklist {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-bottom: 1px solid var(--line);
}

.usage-event-readiness-check {
  min-width: 0;
  min-height: 68px;
  padding: 12px 14px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  gap: 4px 7px;
  align-content: center;
}

.usage-event-readiness-check:nth-child(4n) {
  border-right: 0;
}

.usage-event-readiness-check:nth-last-child(-n + 3) {
  border-bottom: 0;
}

.usage-event-readiness-check > span {
  grid-row: 1 / span 2;
  width: 18px;
  height: 18px;
  border: 1px solid currentColor;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 11px;
}

.usage-event-readiness-check.passed > span {
  color: #15705e;
}

.usage-event-readiness-check.pending > span {
  color: #9b6a1d;
}

.usage-event-readiness-check strong,
.usage-event-readiness-check small {
  min-width: 0;
  overflow-wrap: anywhere;
}

.usage-event-readiness-check strong {
  font-size: 11px;
}

.usage-event-readiness-check small {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.45;
}

.usage-event-readiness-blockers {
  padding: 12px 16px;
  background: #fff9ef;
  display: flex;
  flex-wrap: wrap;
  gap: 7px 12px;
  align-items: center;
  font-size: 11px;
}

.usage-event-readiness-blockers strong {
  color: #8a5a16;
}

.usage-event-readiness-blockers span {
  color: #68563a;
}

.usage-event-readiness-boundary {
  margin: 0;
  padding: 10px 16px;
  border-top: 1px solid #bfe2dc;
  background: #edf9f6;
  color: #46645f;
  font-size: 10px;
  line-height: 1.55;
}

.service-account-layout {
  display: grid;
  grid-template-columns: minmax(300px, 0.78fr) minmax(520px, 1.22fr);
  gap: 14px;
  align-items: start;
}

.service-account-boundary {
  padding: 13px 16px;
  border-bottom: 1px solid #bfe2dc;
  background: #edf9f6;
  display: grid;
  gap: 4px;
}

.service-account-boundary strong {
  color: #126f64;
  font-size: 12px;
}

.service-account-boundary span {
  color: #46645f;
  font-size: 11px;
  line-height: 1.55;
}

.service-account-directory {
  max-height: 690px;
  overflow-y: auto;
}

.service-account-directory-row {
  width: 100%;
  min-height: 78px;
  padding: 13px 15px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: #fff;
  color: inherit;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  text-align: left;
  cursor: pointer;
}

.service-account-directory-row:hover,
.service-account-directory-row.active {
  background: #f4f8fd;
}

.service-account-directory-row.active {
  box-shadow: inset 3px 0 0 var(--blue);
}

.service-account-directory-main,
.service-account-directory-meta {
  min-width: 0;
  display: grid;
  gap: 6px;
}

.service-account-directory-main strong,
.service-account-directory-main small,
.service-account-directory-meta small {
  overflow-wrap: anywhere;
}

.service-account-directory-main small,
.service-account-directory-meta small {
  color: var(--muted);
  font-size: 11px;
}

.service-account-directory-meta {
  justify-items: end;
  text-align: right;
}

.service-account-directory-meta i {
  font-style: normal;
}

.service-account-form {
  padding: 18px;
  display: grid;
  gap: 18px;
}

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

.service-scope-grid fieldset {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 1px solid var(--line);
}

.service-scope-grid legend {
  margin-left: 10px;
  padding: 0 5px;
  color: var(--muted);
  font-size: 11px;
}

.service-scope-options {
  max-height: 230px;
  padding: 5px 10px;
  overflow-y: auto;
}

.service-scope-option {
  min-height: 50px;
  padding: 8px 2px;
  border-bottom: 1px solid var(--line);
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  cursor: pointer;
}

.service-scope-option:last-child {
  border-bottom: 0;
}

.service-scope-option.disabled {
  opacity: 0.46;
}

.service-scope-option input {
  width: 17px;
  min-height: 17px;
  margin: 0;
  accent-color: var(--blue);
}

.service-scope-option span {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.service-scope-option strong,
.service-scope-option small {
  overflow-wrap: anywhere;
}

.service-scope-option strong {
  font-size: 12px;
  font-weight: 650;
}

.service-scope-option small,
.service-scope-empty {
  color: var(--muted);
  font-size: 10px;
}

.service-scope-empty {
  display: block;
  padding: 16px 4px;
}

.service-token-reveal {
  margin: 18px 18px 0;
  padding: 15px;
  border: 1px solid #e6bd6d;
  background: #fff8e8;
  display: grid;
  gap: 12px;
}

.service-token-reveal > div:first-child {
  display: grid;
  gap: 4px;
}

.service-token-reveal strong {
  color: #80540e;
  font-size: 14px;
}

.service-token-reveal span,
.service-token-reveal small {
  color: #735f38;
  font-size: 11px;
  line-height: 1.5;
}

.service-token-copy-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 8px;
  align-items: center;
}

.service-token-copy-row input {
  width: 100%;
  min-width: 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
}

.service-token-management {
  margin: 0 18px 18px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  display: grid;
  gap: 12px;
}

.service-token-history {
  border-top: 1px solid var(--line);
}

.service-token-row {
  min-height: 68px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
}

.service-token-row > div {
  min-width: 0;
  display: grid;
  gap: 5px;
}

.service-token-row > div:last-child {
  justify-items: end;
  text-align: right;
}

.service-token-row strong,
.service-token-row span,
.service-token-row small {
  overflow-wrap: anywhere;
}

.service-token-row strong {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
}

.service-token-row span,
.service-token-row small {
  color: var(--muted);
  font-size: 10px;
}

.service-token-row i {
  font-style: normal;
}

.service-token-actions {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) auto auto;
  gap: 8px;
  align-items: end;
}

.service-metering-section {
  margin: 22px 24px 26px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}

.service-metering-head,
.service-metering-section-head {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
}

.service-metering-head > div,
.service-metering-section-head {
  min-width: 0;
}

.service-metering-head strong,
.service-metering-head span,
.service-metering-section-head strong,
.service-metering-section-head span {
  display: block;
}

.service-metering-head strong {
  font-size: 15px;
}

.service-metering-head span,
.service-metering-section-head span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
}

.service-metering-boundary {
  margin-top: 14px;
  padding: 12px 14px;
  border-left: 3px solid var(--green);
  background: #edf8f3;
}

.service-metering-boundary strong,
.service-metering-boundary span {
  display: block;
}

.service-metering-boundary strong {
  color: #126345;
  font-size: 12px;
}

.service-metering-boundary span {
  margin-top: 4px;
  color: #3e6256;
  font-size: 11px;
  line-height: 1.55;
}

.service-metering-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 14px;
  border: 1px solid var(--line);
}

.service-metering-metrics > div {
  min-width: 0;
  min-height: 94px;
  padding: 14px;
  border-right: 1px solid var(--line);
  background: var(--panel);
}

.service-metering-metrics > div:last-child {
  border-right: 0;
}

.service-metering-metrics span,
.service-metering-metrics strong,
.service-metering-metrics small {
  display: block;
}

.service-metering-metrics span {
  color: var(--muted);
  font-size: 10px;
}

.service-metering-metrics strong {
  margin-top: 7px;
  font-size: 21px;
}

.service-metering-metrics small {
  margin-top: 5px;
  color: var(--muted);
  font-size: 10px;
}

.service-metering-data-grid,
.service-metering-action-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0;
  margin-top: 16px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.service-execution-trace-section {
  margin-top: 16px;
  padding: 16px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.service-execution-trace-list {
  max-height: 440px;
  margin-top: 10px;
  overflow: auto;
}

.service-execution-trace {
  min-width: 0;
  padding: 12px 0 14px;
  border-bottom: 1px solid var(--line);
}

.service-execution-trace:last-child {
  border-bottom: 0;
}

.service-execution-trace-head {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  justify-content: space-between;
}

.service-execution-trace-head > div {
  min-width: 0;
}

.service-execution-trace-head strong,
.service-execution-trace-head span,
.service-execution-trace-head small {
  display: block;
  overflow-wrap: anywhere;
}

.service-execution-trace-head strong {
  font-size: 12px;
}

.service-execution-trace-head span,
.service-execution-trace-head small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
}

.service-execution-stages {
  display: grid;
  grid-template-columns: repeat(5, minmax(110px, 1fr));
  margin-top: 10px;
  border: 1px solid var(--line);
}

.service-execution-stage {
  min-width: 0;
  min-height: 82px;
  padding: 10px;
  border-right: 1px solid var(--line);
  background: var(--panel);
}

.service-execution-stage:last-child {
  border-right: 0;
}

.service-execution-stage > span,
.service-execution-stage > strong,
.service-execution-stage > small {
  display: block;
  overflow-wrap: anywhere;
}

.service-execution-stage > span {
  color: var(--muted);
  font-size: 9px;
  text-transform: uppercase;
}

.service-execution-stage > strong {
  margin-top: 5px;
  font-size: 10px;
}

.service-execution-stage > small {
  margin-top: 5px;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.4;
}

.service-metering-data-section,
.service-metering-form {
  min-width: 0;
  padding: 16px;
}

.service-metering-data-section + .service-metering-data-section,
.service-metering-form + .service-metering-form {
  border-left: 1px solid var(--line);
}

.service-metering-list {
  max-height: 330px;
  margin-top: 10px;
  overflow: auto;
}

.service-metering-row {
  min-width: 0;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
}

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

.service-metering-row > div {
  min-width: 0;
}

.service-metering-row strong,
.service-metering-row span,
.service-metering-row small {
  display: block;
  overflow-wrap: anywhere;
}

.service-metering-row strong {
  font-size: 12px;
}

.service-metering-row span,
.service-metering-row small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
}

.service-metering-row-meta {
  text-align: right;
}

.service-metering-action-grid {
  margin-top: 0;
  border-top: 0;
}

.service-metering-form-grid {
  margin: 12px 0;
}

.service-metering-form .secondary-action {
  width: 100%;
}

@media (max-width: 980px) {
  .user-admin-layout {
    grid-template-columns: 1fr;
  }

  .user-directory {
    max-height: 430px;
  }

  .service-account-layout {
    grid-template-columns: 1fr;
  }

  .service-account-directory {
    max-height: 360px;
  }

  .usage-event-readiness-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .usage-event-readiness-metrics > div {
    border-bottom: 1px solid var(--line);
  }

  .usage-event-readiness-metrics > div:nth-child(2n) {
    border-right: 0;
  }

  .usage-event-readiness-metrics > div:last-child {
    border-bottom: 0;
  }

  .usage-event-readiness-checklist {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .usage-event-readiness-check:nth-child(2n) {
    border-right: 0;
  }

  .usage-event-readiness-check:nth-last-child(-n + 3) {
    border-bottom: 1px solid var(--line);
  }

  .usage-event-readiness-check:last-child {
    border-bottom: 0;
  }

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

  .service-metering-metrics > div:nth-child(2) {
    border-right: 0;
  }

  .service-metering-metrics > div:nth-child(-n + 2) {
    border-bottom: 1px solid var(--line);
  }

  .service-metering-data-grid,
  .service-metering-action-grid {
    grid-template-columns: 1fr;
  }

  .service-execution-stages {
    grid-template-columns: repeat(3, minmax(110px, 1fr));
  }

  .service-execution-stage:nth-child(3) {
    border-right: 0;
  }

  .service-execution-stage:nth-child(-n + 3) {
    border-bottom: 1px solid var(--line);
  }

  .service-metering-data-section + .service-metering-data-section,
  .service-metering-form + .service-metering-form {
    border-left: 0;
    border-top: 1px solid var(--line);
  }
}

@media (max-width: 700px) {
  .password-change-layout {
    grid-template-columns: 1fr;
  }

  .password-change-context,
  .password-change-form {
    padding: 28px;
  }

  .password-change-context .password-rule-list {
    display: none;
  }

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

  .service-scope-grid,
  .service-token-copy-row,
  .service-token-actions {
    grid-template-columns: 1fr;
  }

  .usage-event-readiness-head {
    align-items: flex-start;
  }

  .usage-event-readiness-metrics,
  .usage-event-readiness-checklist {
    grid-template-columns: 1fr;
  }

  .usage-event-readiness-metrics > div,
  .usage-event-readiness-check,
  .usage-event-readiness-check:nth-child(2n) {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .service-metering-section {
    margin-left: 14px;
    margin-right: 14px;
  }

  .service-metering-metrics {
    grid-template-columns: 1fr;
  }

  .service-metering-metrics > div,
  .service-metering-metrics > div:nth-child(2) {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .service-metering-metrics > div:last-child {
    border-bottom: 0;
  }

  .service-metering-row {
    grid-template-columns: 1fr;
  }

  .service-execution-trace-section {
    padding-left: 0;
    padding-right: 0;
  }

  .service-execution-trace-head {
    display: block;
  }

  .service-execution-trace-head .status {
    display: inline-block;
    margin-top: 8px;
  }

  .service-execution-stages {
    grid-template-columns: 1fr;
  }

  .service-execution-stage,
  .service-execution-stage:nth-child(3) {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .service-execution-stage:last-child {
    border-bottom: 0;
  }

  .service-metering-row-meta {
    text-align: left;
  }

  .service-scope-options {
    max-height: 180px;
  }

  .service-token-copy-row button,
  .service-token-actions button {
    width: 100%;
  }
}

@media (max-width: 520px) {
  .password-change-layout {
    min-height: 100vh;
    border: 0;
    border-radius: 0;
  }

  .password-change-context {
    padding: 22px;
  }

  .password-change-context h2 {
    font-size: 24px;
  }

  .password-change-form {
    padding: 24px 22px 30px;
  }

  .user-directory-row {
    grid-template-columns: 36px minmax(0, 1fr);
  }

  .user-avatar {
    width: 36px;
    height: 36px;
  }

  .user-directory-flags {
    grid-column: 2;
    max-width: none;
    justify-content: flex-start;
    text-align: left;
  }

  .project-assignment-row,
  .password-reset-controls {
    grid-template-columns: 20px minmax(0, 1fr);
  }

  .project-assignment-row select {
    grid-column: 2;
  }

  .password-reset-controls .field,
  .password-reset-controls button {
    grid-column: 1 / -1;
  }

  .form-actions {
    display: grid;
    grid-template-columns: 1fr;
  }
}

/* V0.7 financial control-room layout */
.login-screen {
  min-height: 100vh;
  padding: 32px;
  background: var(--dark);
}

.login-layout {
  width: min(1120px, 100%);
  min-height: 620px;
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(380px, 0.65fr);
  overflow: hidden;
  border: 1px solid #26313d;
  border-radius: 8px;
  background: #101820;
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.34);
}

.login-stage {
  min-width: 0;
  padding: 48px;
  color: #fff;
  border-right: 1px solid #26313d;
  display: flex;
  flex-direction: column;
}

.login-stage-brand {
  align-items: center;
}

.stage-brand-logo {
  width: 58px;
  height: 58px;
}

.login-stage-brand strong,
.login-stage-brand span {
  display: block;
}

.login-stage-brand strong {
  font-size: 18px;
}

.login-stage-brand span {
  margin-top: 3px;
  color: #9daab7;
  font-size: 12px;
}

.login-stage-brand .ecosystem-tagline {
  color: #0b58bd;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.2;
}

.login-stage-brand .brand-descriptor {
  margin-top: 2px;
  font-size: 10px;
  line-height: 1.2;
}

.login-stage-copy {
  max-width: 620px;
  margin: auto 0 40px;
}

.eyebrow {
  color: #58d4cc;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.login-stage-copy h1 {
  max-width: 620px;
  margin: 14px 0 16px;
  font-size: 36px;
  line-height: 1.15;
  letter-spacing: 0;
  text-wrap: balance;
}

.login-stage-copy p {
  margin: 0;
  color: #aeb9c4;
  font-size: 16px;
  line-height: 1.65;
}

.login-data-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-top: 1px solid #31404e;
  border-bottom: 1px solid #31404e;
}

.login-data-grid article {
  min-width: 0;
  padding: 22px 18px;
  border-right: 1px solid #31404e;
  display: grid;
  gap: 7px;
}

.login-data-grid article:first-child {
  padding-left: 0;
}

.login-data-grid article:last-child {
  border-right: 0;
}

.login-data-grid strong {
  font-size: 26px;
}

.login-live-stat-label {
  display: flex;
  align-items: center;
  gap: 7px;
  line-height: 1.3;
  color: #425b73;
  font-size: 11px;
  font-weight: 700;
}

.login-live-stat-label::before {
  content: "";
  flex: 0 0 auto;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #0aa89e;
  box-shadow: 0 0 0 3px rgba(10, 168, 158, 0.12);
}

.login-estimate-status {
  margin: 10px 0 0;
  color: #58d4cc;
  font-size: 11px;
  line-height: 1.4;
}

.login-estimate-status[data-status="unavailable"],
.login-estimate-status[data-status="stale"] {
  color: #c7a35e;
}

.login-data-grid span {
  color: #9daab7;
  font-size: 12px;
}

.login-boundary {
  padding-top: 20px;
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  color: #8f9ca8;
  font-size: 11px;
  text-transform: uppercase;
}

.login-panel {
  width: auto;
  padding: 48px;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  background: #fff;
  align-content: center;
  gap: 18px;
}

.login-form-brand {
  margin-bottom: 8px;
}

.login-brand-logo {
  width: 64px;
  height: 64px;
}

.login-copy {
  padding: 16px 0;
}

.login-footnote {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  text-align: center;
}

.login-legal {
  margin: -10px 0 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: #8b98a8;
  font-size: 10px;
  font-weight: 700;
  text-align: center;
}

.login-legal-logo {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  object-fit: contain;
}

.app-shell {
  display: block;
  background: var(--bg);
}

.sidebar {
  position: sticky;
  top: 0;
  z-index: 30;
  min-height: 64px;
  padding: 0 24px;
  background: var(--dark);
  flex-direction: row;
  align-items: center;
  gap: 24px;
}

.brand-row.compact {
  flex: 0 0 auto;
  padding: 0;
  border: 0;
}

.sidebar-brand-logo {
  width: 40px;
  height: 40px;
}

.brand-row.compact h1 {
  color: #fff;
  font-size: 15px;
}

.sidebar .brand-row p {
  color: #8f9ca8;
  font-size: 10px;
}

.nav {
  min-width: 0;
  display: flex;
  align-self: stretch;
  gap: 2px;
  overflow-x: auto;
  scrollbar-width: none;
}

.nav::-webkit-scrollbar,
.status-ticker::-webkit-scrollbar,
.metrics::-webkit-scrollbar {
  display: none;
}

.nav button {
  width: auto;
  min-height: 64px;
  padding: 0 13px;
  border-radius: 0;
  color: #aeb9c4;
  text-align: center;
  white-space: nowrap;
  font-size: 13px;
}

.nav button.active {
  background: transparent;
  color: #fff;
  box-shadow: inset 0 -3px 0 var(--blue);
}

.sidebar-status {
  min-width: max-content;
  margin: 0 0 0 auto;
  padding: 0;
  border: 0;
  background: transparent;
  display: flex;
  align-items: center;
  gap: 7px;
}

.sidebar-status strong,
.sidebar-status small {
  color: #c2ccd5;
  font-size: 11px;
}

@media (max-width: 1320px) {
  .sidebar-status small {
    display: none;
  }
}

.live-dot {
  width: 7px;
  height: 7px;
  flex: 0 0 auto;
  display: inline-block;
  border-radius: 50%;
  background: #23c483;
  box-shadow: 0 0 0 3px rgba(35, 196, 131, 0.14);
}

.workspace {
  min-height: calc(100vh - 64px);
}

.topbar {
  min-height: 94px;
  padding: 22px 32px;
}

.topbar h2 {
  font-size: 26px;
}

.mobile-brand-logo {
  display: none;
}

.primary-action {
  background: var(--blue);
}

.primary-action:hover {
  background: #0f4fb5;
}

.status-ticker {
  min-height: 42px;
  padding: 0 32px;
  border-bottom: 1px solid var(--line);
  background: #fff;
  display: flex;
  align-items: center;
  gap: 0;
  overflow-x: auto;
  scrollbar-width: none;
}

.status-ticker span {
  min-width: max-content;
  padding: 0 18px;
  border-right: 1px solid var(--line);
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
}

.status-ticker span:first-child {
  padding-left: 0;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.status-ticker strong {
  color: var(--ink);
}

.metrics {
  margin: 20px 32px 0;
  padding: 0;
  gap: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.metrics article {
  min-height: 98px;
  padding: 16px 18px;
  border: 0;
  border-right: 1px solid var(--line);
  border-radius: 0;
  box-shadow: none;
}

.metrics article:last-child {
  border-right: 0;
}

.metrics strong {
  font-size: 28px;
  font-variant-numeric: tabular-nums;
}

.metrics small {
  font-size: 10px;
  font-weight: 800;
}

.view {
  padding: 18px 32px 32px;
}

#view-overview > .metrics {
  margin: 0 0 18px;
}

.view-overview,
#view-overview .dashboard-grid {
  min-width: 0;
}

#view-overview .dashboard-grid {
  grid-template-columns: minmax(0, 1.45fr) minmax(300px, 0.75fr);
}

.metrics article,
.panel {
  box-shadow: none;
}

.panel {
  border-color: #dfe5eb;
}

.panel.highlight {
  border-color: #bdd0f5;
}

.portfolio-panel .panel-head {
  background: #f3f7fd;
  box-shadow: inset 3px 0 0 var(--blue);
}

.portfolio-panel .portfolio-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.panel-head {
  min-height: 64px;
}

.panel-head h3 {
  font-size: 15px;
}

.summary-item,
.portfolio-item,
.wallet-item,
.boundary-item,
.resource-card,
.task-card,
.service-card,
.log-card {
  border-color: #e2e7ec;
  background: #fff;
}

.summary-item,
.portfolio-item,
.wallet-item,
.boundary-item {
  min-height: 70px;
}

.resource-card {
  min-height: 132px;
}

.resource-icon {
  background: #edf3fc;
  color: var(--blue);
}

.resource-button.active {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(22, 93, 206, 0.1);
}

.bar::-webkit-progress-value,
.bar::-moz-progress-bar {
  background: var(--blue);
}

.passport-visual {
  background: #f3f7fd;
}

.route-switch button.active {
  background: var(--blue);
}

.pill,
.status {
  border-radius: 4px;
}

@media (max-width: 1040px) {
  .sidebar {
    gap: 14px;
  }

  .brand-row.compact p,
  .sidebar-status small {
    display: none;
  }

  .nav button {
    padding: 0 10px;
  }

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

@media (max-width: 820px) {
  .login-screen {
    padding: 18px;
  }

  .login-layout {
    max-width: 540px;
    grid-template-columns: 1fr;
  }

  .login-stage {
    padding: 26px;
    border-right: 0;
    border-bottom: 1px solid #26313d;
  }

  .login-stage-copy {
    margin: 40px 0 28px;
  }

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

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

  .login-data-grid article:nth-child(2) {
    border-right: 0;
  }

  .login-data-grid article:nth-child(-n + 2) {
    border-bottom: 1px solid #cbd8e9;
  }

  .login-data-grid article:nth-child(3) {
    padding-left: 0;
  }

  .login-panel {
    padding: 30px;
  }

  .app-shell {
    display: block;
  }

  .sidebar {
    min-height: 58px;
    padding: 8px 14px;
    display: flex;
    flex-wrap: nowrap;
  }

  .brand-row.compact {
    display: flex;
  }

  .sidebar-brand-logo {
    width: 38px;
    height: 38px;
  }

  .sidebar-status {
    display: none;
  }

  .nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 40;
    align-self: auto;
    padding: 7px 8px calc(7px + env(safe-area-inset-bottom));
    background: var(--dark);
    border-top: 1px solid #26313d;
    overflow-x: auto;
  }

  .nav button {
    min-width: 92px;
    min-height: 44px;
    padding: 0 10px;
    border-radius: 4px;
    font-size: 12px;
  }

  .nav button.active {
    background: #1a2530;
    box-shadow: inset 0 -2px 0 var(--blue);
  }

  .workspace {
    min-height: calc(100vh - 58px);
    padding-bottom: 66px;
  }

  .topbar {
    padding: 18px;
  }

  .mobile-brand-logo {
    display: none;
  }

  .status-ticker {
    padding: 0 18px;
  }

  .metrics {
    margin: 16px 18px 0;
    display: flex;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .metrics article {
    min-width: 152px;
  }

  .view {
    padding: 16px 18px 24px;
  }

  #view-overview .dashboard-grid,
  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .span-2 {
    grid-column: auto;
  }
}

@media (max-width: 520px) {
  .login-screen {
    padding: 0;
    place-items: stretch;
  }

  .login-layout {
    min-height: 100vh;
    border: 0;
    border-radius: 0;
  }

  .login-stage {
    padding: 22px;
  }

  .login-stage-copy {
    margin: 30px 0 24px;
  }

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

  .login-stage-copy p {
    font-size: 14px;
  }

  .login-data-grid article {
    padding: 16px 10px;
  }

  .login-data-grid article:first-child {
    padding-left: 0;
  }

  .login-data-grid strong {
    font-size: 19px;
  }

  .login-boundary {
    gap: 10px;
  }

  .login-panel {
    padding: 24px 22px 30px;
  }

  .topbar h2 {
    font-size: 22px;
  }

  .top-actions {
    justify-content: flex-start;
  }

  .portfolio-panel .portfolio-grid {
    grid-template-columns: 1fr;
  }
}

/* V0.8 light Swordfish product system */
:root {
  --bg: #f4f7fb;
  --surface-soft: #edf4ff;
  --ink: #172033;
  --muted: #65758a;
  --line: #dbe4ef;
  --dark: #ffffff;
  --teal: #008f87;
  --shadow: 0 10px 30px rgba(24, 49, 83, 0.08);
}

.login-screen {
  background: #f1f5fa;
}

.login-layout {
  border-color: #d7e1ed;
  background: #ffffff;
  box-shadow: 0 24px 64px rgba(30, 55, 87, 0.14);
}

.login-stage {
  color: var(--ink);
  border-color: #cfdaea;
  background: #eaf2ff;
}

.login-stage-brand span,
.login-stage-copy p,
.login-data-grid span,
.login-boundary {
  color: #60738a;
}

.eyebrow {
  color: #087f79;
}

.login-data-grid {
  border-color: #cbd8e9;
}

.login-data-grid article {
  border-color: #cbd8e9;
}

.login-boundary span {
  padding: 6px 8px;
  border: 1px solid #c7d6e9;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.58);
}

.login-panel {
  background: #ffffff;
}

.sidebar {
  border-bottom: 1px solid var(--line);
  background: #ffffff;
  box-shadow: 0 3px 16px rgba(24, 49, 83, 0.06);
}

.brand-row.compact h1 {
  color: var(--ink);
}

.sidebar .brand-row p,
.sidebar-status strong,
.sidebar-status small {
  color: var(--muted);
}

.nav button {
  color: #5d6d80;
}

.nav button:hover {
  color: var(--blue);
  background: #f5f8fd;
}

.nav button.active {
  color: var(--blue);
  background: #f7faff;
}

.topbar {
  background: rgba(255, 255, 255, 0.9);
}

.status-ticker {
  background: #fbfcfe;
}

@media (max-width: 820px) {
  .login-stage {
    border-color: #cfdaea;
  }

  .nav {
    border-color: var(--line);
    background: #ffffff;
    box-shadow: 0 -6px 20px rgba(24, 49, 83, 0.08);
  }

  .nav button.active {
    color: var(--blue);
    background: #edf4ff;
  }
}

@media (max-width: 520px) {
  .login-stage {
    background: #eef5ff;
  }

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

  .login-form-brand p {
    font-size: 12px;
  }
}

/* V0.9 project management */
.nav button {
  padding-left: 11px;
  padding-right: 11px;
}

textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px 11px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  line-height: 1.55;
  resize: vertical;
}

textarea:focus {
  outline: 3px solid rgba(0, 139, 132, 0.22);
  outline-offset: 2px;
}

.project-management-layout {
  display: grid;
  grid-template-columns: minmax(320px, 0.82fr) minmax(500px, 1.18fr);
  gap: 14px;
  align-items: start;
}

.project-directory {
  max-height: 720px;
  overflow-y: auto;
}

.project-directory-row {
  width: 100%;
  min-height: 96px;
  padding: 15px 16px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  text-align: left;
}

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

.project-directory-row:hover,
.project-directory-row.active {
  background: #f5f8fd;
}

.project-directory-row.active {
  box-shadow: inset 3px 0 0 var(--blue);
}

.project-directory-main,
.project-directory-meta {
  min-width: 0;
  display: grid;
  gap: 6px;
}

.project-directory-main strong,
.project-directory-main small {
  overflow-wrap: anywhere;
}

.project-directory-main small,
.project-directory-meta small {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

.project-directory-meta {
  justify-items: end;
  text-align: right;
}

.project-form {
  padding: 18px;
  display: grid;
  gap: 18px;
}

.project-editor-panel .panel-head > div {
  min-width: 0;
}

.project-editor-panel .panel-head span {
  overflow-wrap: anywhere;
}

.project-form-grid .span-field {
  grid-column: 1 / -1;
}

.project-linked-summary {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  overflow: hidden;
}

.project-linked-summary:empty {
  display: none;
}

.project-linked-summary .summary-item {
  min-height: 68px;
  border: 0;
  border-right: 1px solid var(--line);
  border-radius: 0;
  background: #fbfcfe;
}

.project-linked-summary .summary-item:last-child {
  border-right: 0;
}

.project-form-actions {
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.confirmation-dialog {
  width: min(500px, calc(100% - 32px));
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: #fff;
  box-shadow: 0 24px 70px rgba(23, 32, 51, 0.2);
}

.confirmation-dialog::backdrop {
  background: rgba(23, 32, 51, 0.42);
}

.confirmation-dialog-body {
  padding: 24px;
  display: grid;
  gap: 16px;
}

.confirmation-dialog-body h3 {
  margin: 0;
  font-size: 20px;
  letter-spacing: 0;
}

.confirmation-dialog-body p {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}

.confirmation-actions {
  padding-top: 16px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.danger-primary {
  background: #b83d3d;
}

.danger-primary:hover {
  background: #9d3030;
}

@media (max-width: 980px) {
  .project-management-layout {
    grid-template-columns: 1fr;
  }

  .project-directory {
    max-height: 430px;
  }
}

@media (max-width: 700px) {
  .project-linked-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .project-linked-summary .summary-item:nth-child(2) {
    border-right: 0;
  }

  .project-linked-summary .summary-item:nth-child(-n + 2) {
    border-bottom: 1px solid var(--line);
  }
}

@media (max-width: 520px) {
  .project-directory-row {
    grid-template-columns: 1fr;
  }

  .project-directory-meta {
    justify-items: start;
    text-align: left;
  }

  .project-form-grid .span-field {
    grid-column: auto;
  }

  .project-form-actions,
  .confirmation-actions {
    display: grid;
    grid-template-columns: 1fr;
  }
}

/* V0.9 OP-012 management workspace states */
.global-progress {
  position: fixed;
  inset: 0 0 auto;
  z-index: 120;
  height: 3px;
  overflow: hidden;
  background: rgba(22, 93, 206, 0.12);
}

.global-progress i {
  display: block;
  width: 42%;
  height: 100%;
  background: var(--blue);
  transform: translateX(-110%);
  animation: request-progress 1s ease-in-out infinite;
}

@keyframes request-progress {
  50% { transform: translateX(140%); }
  100% { transform: translateX(350%); }
}

html[data-loading="true"] {
  cursor: progress;
}

button[aria-busy="true"] {
  cursor: progress;
  opacity: 0.72;
}

.toast-region {
  position: fixed;
  top: 78px;
  right: 18px;
  z-index: 110;
  width: min(360px, calc(100vw - 36px));
  display: grid;
  gap: 8px;
  pointer-events: none;
}

.toast {
  min-width: 0;
  padding: 13px 12px 13px 14px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--blue);
  border-radius: 6px;
  background: #fff;
  box-shadow: 0 16px 40px rgba(23, 32, 51, 0.16);
  display: grid;
  grid-template-columns: minmax(0, 1fr) 30px;
  gap: 10px;
  pointer-events: auto;
}

.toast.success {
  border-left-color: var(--green);
}

.toast.error {
  border-left-color: var(--red);
}

.toast strong,
.toast span {
  display: block;
  overflow-wrap: anywhere;
}

.toast strong {
  margin-bottom: 3px;
  font-size: 13px;
}

.toast span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.toast-close,
.icon-action {
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  display: inline-grid;
  place-items: center;
  font-weight: 800;
}

.toast-close {
  width: 30px;
  height: 30px;
  border: 0;
  color: var(--muted);
  font-size: 18px;
}

.mobile-actions-trigger {
  display: none;
}

.empty-state {
  min-height: 112px;
  padding: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 13px;
  color: var(--muted);
  text-align: left;
}

.empty-state-mark {
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--blue);
  background: #f6f9fd;
  font-weight: 800;
}

.empty-state strong,
.empty-state p {
  display: block;
  overflow-wrap: anywhere;
}

.empty-state strong {
  color: var(--ink);
  font-size: 13px;
}

.empty-state p {
  margin: 4px 0 0;
  font-size: 12px;
  line-height: 1.5;
}

.empty-state .compact-action {
  min-width: max-content;
  margin-left: auto;
}

.portfolio-grid,
.summary-grid,
.wallet-grid,
.boundary-grid {
  gap: 0;
}

.portfolio-grid .summary-item,
.summary-grid .summary-item,
.wallet-grid .summary-item,
.boundary-grid .summary-item {
  min-height: 72px;
  border: 0;
  border-top: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
}

.topbar {
  min-height: 78px;
  padding-top: 15px;
  padding-bottom: 15px;
}

.metrics article {
  min-height: 88px;
}

.project-directory-row,
.resource-button,
.task-directory-row,
.user-directory-row {
  min-height: 76px;
}

.project-form,
.resource-form,
.task-form,
.user-admin-form {
  gap: 15px;
}

@media (max-width: 820px) {
  .topbar {
    min-height: 78px;
    padding: 13px 16px;
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
  }

  .topbar-heading {
    min-width: 0;
  }

  .topbar-heading > div {
    min-width: 0;
  }

  .topbar h2 {
    font-size: 20px;
  }

  .topbar p {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .mobile-actions-trigger {
    display: inline-grid;
  }

  .top-actions {
    position: absolute;
    top: calc(100% - 4px);
    right: 14px;
    z-index: 70;
    width: min(310px, calc(100vw - 28px));
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #fff;
    box-shadow: 0 18px 48px rgba(23, 32, 51, 0.18);
    display: none;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .top-actions.open {
    display: grid;
  }

  .top-actions .pill {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }

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

  .nav button {
    min-width: 82px;
  }

  .toast-region {
    top: 72px;
  }
}

@media (max-width: 520px) {
  .sidebar {
    min-height: 54px;
  }

  .sidebar-brand-logo {
    width: 34px;
    height: 34px;
  }

  .brand-row.compact h1 {
    font-size: 14px;
  }

  .topbar {
    min-height: 72px;
    padding: 11px 14px;
  }

  .topbar h2 {
    font-size: 18px;
  }

  .topbar p {
    font-size: 11px;
  }

  .status-ticker {
    min-height: 36px;
    padding: 0 14px;
  }

  .metrics {
    margin: 12px 14px 0;
  }

  .metrics article {
    min-width: 132px;
    min-height: 82px;
    padding: 12px 14px;
  }

  .metrics strong {
    font-size: 24px;
  }

  .view {
    padding: 12px 14px 22px;
  }

  .panel-head {
    min-height: 58px;
    padding: 13px 14px;
  }

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

  .panel-body,
  .project-form,
  .resource-form,
  .task-form,
  .user-admin-form,
  .service-account-form {
    padding-left: 14px;
    padding-right: 14px;
  }

  .service-token-reveal,
  .service-token-management {
    margin-left: 14px;
    margin-right: 14px;
  }

  .empty-state {
    min-height: 128px;
    padding: 20px 14px;
    flex-wrap: wrap;
    justify-content: flex-start;
  }

  .empty-state .compact-action {
    width: 100%;
    margin: 4px 0 0;
  }

  .toast-region {
    inset: auto 10px calc(68px + env(safe-area-inset-bottom));
    width: auto;
  }
}

/* V1.1-S ZGA-SIM governance workspace */
.zga-sim-head {
  min-height: 76px;
  padding: 15px 16px;
  border: 1px solid var(--line);
  border-bottom: 0;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.zga-sim-head h3,
.zga-sim-head .eyebrow,
.zga-sim-register-head h3 {
  margin: 0;
}

.zga-sim-head h3 {
  margin-top: 5px;
  font-size: 17px;
}

.zga-sim-head-status {
  display: flex;
  align-items: center;
  gap: 10px;
}

.zga-sim-boundary {
  min-height: 38px;
  padding: 0 16px;
  border: 1px solid var(--line);
  background: #f7f9fb;
  display: flex;
  align-items: center;
  overflow-x: auto;
}

.zga-sim-boundary span {
  min-width: max-content;
  padding: 0 14px;
  border-right: 1px solid var(--line);
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.zga-sim-boundary span:first-child {
  padding-left: 0;
  color: var(--amber);
}

.zga-sim-boundary span:last-child {
  border-right: 0;
}

.zga-sim-metrics {
  margin-top: 14px;
  border: 1px solid var(--line);
  background: #fff;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.zga-sim-metrics article {
  min-width: 0;
  min-height: 92px;
  padding: 15px 16px;
  border-right: 1px solid var(--line);
  display: grid;
  align-content: space-between;
  gap: 7px;
}

.zga-sim-metrics article:last-child {
  border-right: 0;
}

.zga-sim-metrics span,
.zga-sim-metrics small {
  color: var(--muted);
  font-size: 10px;
}

.zga-sim-metrics strong {
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: 23px;
  font-variant-numeric: tabular-nums;
}

.zga-sim-message {
  min-height: 20px;
  margin: 8px 0 0;
}

.zga-sim-governance {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.zga-sim-control {
  min-width: 0;
}

.zga-sim-form {
  padding: 16px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.zga-sim-form .span-2 {
  grid-column: 1 / -1;
}

.zga-sim-divider {
  height: 1px;
  margin: 0 16px;
  background: var(--line);
}

.zga-sim-register {
  min-width: 0;
  margin-top: 14px;
  border: 1px solid var(--line);
  background: #fff;
}

.zga-sim-register-head {
  min-height: 54px;
  padding: 0 16px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.zga-sim-register-head h3 {
  font-size: 14px;
}

.zga-sim-register-head span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
}

.zga-sim-run-list,
.zga-sim-record-list {
  padding: 12px;
  display: grid;
  gap: 9px;
}

.zga-sim-run {
  min-width: 0;
  border: 1px solid #e2e7ec;
  border-left: 3px solid var(--green);
  border-radius: 4px;
  background: #fff;
  display: grid;
  grid-template-columns: minmax(220px, 0.8fr) minmax(460px, 1.4fr);
  align-items: center;
}

.zga-sim-run[data-status="paused"] {
  border-left-color: var(--amber);
  background: #fffaf3;
}

.zga-sim-run-main {
  min-width: 0;
  padding: 14px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.zga-sim-run-main div {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.zga-sim-run-main strong,
.zga-sim-run-main small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.zga-sim-run-main strong {
  font-size: 13px;
}

.zga-sim-run-main small,
.zga-sim-run footer {
  color: var(--muted);
  font-size: 10px;
}

.zga-sim-run dl {
  min-width: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.zga-sim-run dl div {
  min-width: 0;
  padding: 10px 12px;
  border-left: 1px solid var(--line);
}

.zga-sim-run dt {
  color: var(--muted);
  font-size: 9px;
}

.zga-sim-run dd {
  margin: 5px 0 0;
  overflow-wrap: anywhere;
  font-size: 12px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.zga-sim-run footer {
  grid-column: 1 / -1;
  min-height: 32px;
  padding: 0 14px;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.zga-sim-register-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.zga-sim-record {
  min-width: 0;
  padding: 12px;
  border: 1px solid #e2e7ec;
  border-radius: 4px;
  background: #fff;
  display: grid;
  gap: 9px;
}

.zga-sim-record header,
.zga-sim-record footer,
.zga-sim-record-value {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.zga-sim-record header strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
}

.zga-sim-record-value strong {
  font-size: 20px;
  font-variant-numeric: tabular-nums;
}

.zga-sim-record-value span,
.zga-sim-record p,
.zga-sim-record footer {
  color: var(--muted);
  font-size: 9px;
}

.zga-sim-record p {
  margin: 0;
  overflow-wrap: anywhere;
}

@media (max-width: 1100px) {
  .zga-sim-governance,
  .zga-sim-register-grid {
    grid-template-columns: 1fr;
  }

  .zga-sim-metrics {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .zga-sim-metrics article:nth-child(3) {
    border-right: 0;
  }

  .zga-sim-run {
    grid-template-columns: 1fr;
  }

  .zga-sim-run dl div:first-child {
    border-left: 0;
  }
}

@media (max-width: 620px) {
  .zga-sim-head {
    align-items: flex-start;
  }

  .zga-sim-boundary {
    padding: 0;
    overflow: visible;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .zga-sim-boundary span {
    min-width: 0;
    min-height: 36px;
    padding: 8px 10px;
    border-right: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    display: flex;
    align-items: center;
    overflow-wrap: anywhere;
    line-height: 1.35;
  }

  .zga-sim-boundary span:first-child {
    padding-left: 10px;
  }

  .zga-sim-boundary span:nth-child(2n) {
    border-right: 0;
  }

  .zga-sim-boundary span:last-child {
    grid-column: 1 / -1;
    border-right: 0;
    border-bottom: 0;
  }

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

  .zga-sim-metrics article,
  .zga-sim-metrics article:nth-child(3) {
    border-right: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
  }

  .zga-sim-metrics article:nth-child(2n) {
    border-right: 0;
  }

  .zga-sim-metrics article:last-child {
    grid-column: 1 / -1;
    border-right: 0;
    border-bottom: 0;
  }

  .zga-sim-form {
    grid-template-columns: 1fr;
  }

  .zga-sim-form .span-2 {
    grid-column: auto;
  }

  .zga-sim-run dl {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .zga-sim-run dl div:nth-child(odd) {
    border-left: 0;
  }

  .zga-sim-run dl div:nth-child(-n + 2) {
    border-bottom: 1px solid var(--line);
  }

  .zga-sim-run footer {
    align-items: flex-start;
    flex-direction: column;
    padding-top: 8px;
    padding-bottom: 8px;
  }
}

/* Keep the single workspace grid track inside narrow viewports. */
.workspace {
  grid-template-columns: minmax(0, 1fr);
}

/* V1.2 locale controls */
.locale-row {
  min-height: 34px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

.locale-control {
  width: max-content;
  display: inline-grid;
  grid-template-columns: auto minmax(92px, auto);
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.locale-control select {
  width: auto;
  min-width: 96px;
  min-height: 34px;
  padding: 5px 28px 5px 9px;
  color: var(--ink);
  background-color: #fff;
}

.top-locale {
  padding: 2px 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.top-locale select {
  min-height: 30px;
  border: 0;
  padding-top: 3px;
  padding-bottom: 3px;
}

@media (max-width: 820px) {
  .nav button {
    min-width: max-content;
  }

  .top-actions .top-locale {
    width: 100%;
    grid-column: 1 / -1;
    grid-template-columns: 1fr minmax(112px, auto);
  }
}

@media (max-width: 520px) {
  .login-panel .locale-control,
  .password-change-form .locale-control {
    width: 100%;
    grid-template-columns: 1fr minmax(112px, auto);
  }
}

/* Floating governed AI assistant */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.assistant-launcher {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 88;
  width: 62px;
  height: 62px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  box-shadow: 0 12px 28px rgba(9, 83, 194, 0.28);
  overflow: visible;
}

.assistant-launcher:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 34px rgba(9, 83, 194, 0.34);
}

.assistant-launcher:focus-visible {
  outline: 3px solid rgba(10, 108, 255, 0.3);
  outline-offset: 4px;
}

.swordfish-brand-mark,
.assistant-product-mark {
  display: block;
  flex: 0 0 auto;
  aspect-ratio: 1 / 1;
  overflow: visible;
  border-radius: 0;
  clip-path: none;
  background-color: transparent;
  background-image: url("/swordfish-mark-v2.png?v=1.6.0-dev.38");
  background-position: center;
  background-repeat: no-repeat;
  background-size: contain;
}

.assistant-launcher .assistant-product-mark {
  width: 100%;
  height: 100%;
}

.assistant-launcher-status {
  position: absolute;
  right: 1px;
  bottom: 4px;
  width: 13px;
  height: 13px;
  border: 3px solid #fff;
  border-radius: 50%;
  background: #20a874;
}

.assistant-launcher.unavailable .assistant-launcher-status {
  background: var(--amber);
}

.assistant-panel {
  position: fixed;
  right: 24px;
  bottom: 98px;
  z-index: 90;
  width: min(420px, calc(100vw - 32px));
  height: min(680px, calc(100dvh - 122px));
  min-height: 460px;
  overflow: hidden;
  border: 1px solid #cbd8eb;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 22px 64px rgba(20, 42, 72, 0.24);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto auto auto;
}

.assistant-panel-header {
  min-height: 72px;
  padding: 12px 12px 12px 14px;
  border-bottom: 1px solid var(--line);
  background: #f8fbff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.assistant-product {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.assistant-product .assistant-product-mark {
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
}

.assistant-product h2 {
  margin: 0;
  color: #0b3473;
  font-size: 16px;
  line-height: 1.25;
}

.assistant-product p {
  max-width: 230px;
  margin: 3px 0 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.assistant-panel-controls {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 6px;
}

.assistant-close-button {
  width: 34px;
  height: 34px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #526579;
  display: inline-grid;
  place-items: center;
  font-size: 26px;
  font-weight: 400;
  line-height: 1;
}

.assistant-close-button:hover {
  background: #e8eef7;
  color: #153f78;
}

.assistant-close-button:focus-visible {
  outline: 3px solid rgba(10, 108, 255, 0.24);
  outline-offset: 1px;
}

.assistant-messages {
  min-height: 0;
  overflow-y: auto;
  padding: 16px;
  background: #f7f9fc;
  display: grid;
  align-content: start;
  gap: 11px;
}

.assistant-welcome {
  padding: 18px 4px;
}

.assistant-welcome strong {
  color: #163d70;
  font-size: 15px;
}

.assistant-welcome p,
.assistant-privacy-note {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.assistant-message {
  width: 88%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px 12px;
  background: #fff;
}

.assistant-message.user {
  justify-self: end;
  border-color: #b8d5ff;
  background: #eaf3ff;
}

.assistant-message > span {
  color: var(--blue);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.assistant-message p {
  margin: 5px 0 0;
  font-size: 13px;
  line-height: 1.55;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.assistant-citation-disclosure {
  margin: 9px 0 0;
  border-radius: 6px;
  background: #f1f5fa;
  color: var(--muted);
}

.assistant-citation-disclosure summary {
  padding: 7px 9px;
  cursor: pointer;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.4;
}

.assistant-citation-disclosure[open] summary {
  border-bottom: 1px solid var(--line);
}

.assistant-citations {
  margin: 0;
  padding: 7px 8px 8px 27px;
  font-size: 11px;
  line-height: 1.5;
}

.assistant-suggestions {
  padding: 10px 12px 0;
  border-top: 1px solid var(--line);
  background: #fff;
  display: flex;
  gap: 7px;
  overflow-x: auto;
  scrollbar-width: thin;
}

.assistant-suggestions button {
  min-width: max-content;
  min-height: 32px;
  padding: 6px 9px;
  text-align: left;
  font-size: 11px;
}

.assistant-boundary {
  border-top: 1px solid var(--line);
  background: #fff;
}

.assistant-boundary summary {
  padding: 8px 14px;
  color: #526579;
  cursor: pointer;
  font-size: 11px;
  font-weight: 700;
}

.assistant-boundary[open] {
  max-height: 210px;
  overflow-y: auto;
  background: #fbfcfe;
}

.assistant-boundaries {
  padding: 0 14px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 12px;
}

.assistant-boundaries > div {
  padding: 8px 0;
  border-top: 1px solid var(--line);
}

.assistant-boundaries strong,
.assistant-boundaries span {
  display: block;
}

.assistant-boundaries strong {
  font-size: 11px;
}

.assistant-boundaries span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.4;
}

.assistant-privacy-note {
  margin: 4px 14px 12px;
  padding: 8px 9px;
  border-left: 3px solid var(--amber);
  background: #fff9ed;
}

.assistant-form {
  padding: 10px 12px 12px;
  border-top: 1px solid var(--line);
  background: #fff;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.assistant-question-field {
  grid-column: 1 / -1;
}

.assistant-form textarea {
  width: 100%;
  min-height: 68px;
  max-height: 148px;
  resize: vertical;
  border: 1px solid #b9c9dc;
  border-radius: 6px;
  padding: 9px 10px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 13px;
  line-height: 1.45;
}

.assistant-form textarea:focus {
  border-color: #0a6cff;
  outline: 3px solid rgba(10, 108, 255, 0.16);
  outline-offset: 1px;
}

.assistant-form-actions {
  grid-column: 1 / -1;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.assistant-form-actions button {
  min-height: 34px;
  padding: 7px 11px;
  font-size: 12px;
}

.assistant-form .form-error {
  grid-column: 1 / -1;
  min-height: 0;
  margin: 0;
  font-size: 11px;
}

@media (max-width: 820px) {
  .assistant-launcher {
    right: 16px;
    bottom: 76px;
  }

  .assistant-panel {
    inset: 8px 8px 68px;
    width: auto;
    height: auto;
    min-height: 0;
  }
}

@media (max-width: 520px) {
  .assistant-launcher {
    width: 56px;
    height: 56px;
  }

  .assistant-panel {
    inset: 0 0 60px;
    border-right: 0;
    border-left: 0;
    border-radius: 0;
  }

  .assistant-panel-header {
    min-height: 66px;
    padding: 10px 9px 10px 12px;
  }

  .assistant-product .assistant-product-mark {
    width: 38px;
    height: 38px;
  }

  .assistant-product p {
    max-width: 48vw;
  }

  .assistant-messages {
    padding: 12px;
  }

  .assistant-message {
    width: 94%;
  }

  .assistant-boundaries {
    grid-template-columns: 1fr;
  }

  .assistant-form {
    padding-bottom: calc(10px + env(safe-area-inset-bottom));
  }
}

@media (prefers-reduced-motion: reduce) {
  .assistant-launcher:hover {
    transform: none;
  }
}

/* V1.5 ZWATT-SIM real-time projection and 15-minute settlement */
.zwatt-sim-boundary span:first-child {
  color: var(--green);
}

.zwatt-sim-metrics {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.zwatt-sim-current {
  margin-top: 2px;
  border: 1px solid var(--line);
  background: #fff;
}

.zwatt-sim-current .zga-sim-register-head > div:first-child {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.zwatt-sim-current .zga-sim-register-head > div:first-child span {
  overflow-wrap: anywhere;
}

.zwatt-sim-countdown {
  min-width: 120px;
  display: grid;
  justify-items: end;
  gap: 3px;
}

.zwatt-sim-countdown span {
  color: var(--muted);
  font-size: 9px;
  font-weight: 700;
}

.zwatt-sim-countdown strong {
  color: var(--blue);
  font-size: 18px;
  font-variant-numeric: tabular-nums;
}

.zwatt-sim-projects {
  padding: 12px;
  display: grid;
  gap: 10px;
}

.zwatt-sim-project {
  min-width: 0;
  border: 1px solid #dce4e2;
  border-left: 3px solid var(--green);
  border-radius: 4px;
  background: #fff;
}

.zwatt-sim-project > header {
  min-height: 56px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.zwatt-sim-project > header div {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.zwatt-sim-project > header div span {
  color: var(--muted);
  font-size: 9px;
}

.zwatt-sim-project > header strong {
  overflow-wrap: anywhere;
  font-size: 13px;
}

.zwatt-sim-flow {
  min-width: 0;
  padding: 13px 14px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 12px;
}

.zwatt-sim-flow div {
  min-width: 0;
  display: grid;
  gap: 5px;
}

.zwatt-sim-flow span {
  color: var(--muted);
  font-size: 9px;
}

.zwatt-sim-flow strong {
  overflow-wrap: anywhere;
  font-size: 17px;
  font-variant-numeric: tabular-nums;
}

.zwatt-sim-flow i {
  color: var(--muted);
  font-style: normal;
}

.zwatt-sim-project dl {
  min-width: 0;
  margin: 0;
  border-top: 1px solid var(--line);
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.zwatt-sim-project dl div {
  min-width: 0;
  padding: 9px 14px;
  border-right: 1px solid var(--line);
}

.zwatt-sim-project dl div:last-child {
  border-right: 0;
}

.zwatt-sim-project dt {
  color: var(--muted);
  font-size: 8px;
}

.zwatt-sim-project dd {
  margin: 4px 0 0;
  overflow-wrap: anywhere;
  font-size: 11px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.zwatt-sim-policy {
  margin-top: 14px;
  border: 1px solid var(--line);
  background: #f8fafc;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.zwatt-sim-policy div {
  min-width: 0;
  min-height: 64px;
  padding: 11px 14px;
  border-right: 1px solid var(--line);
  display: grid;
  align-content: center;
  gap: 5px;
}

.zwatt-sim-policy div:last-child {
  border-right: 0;
}

.zwatt-sim-policy span {
  color: var(--muted);
  font-size: 9px;
}

.zwatt-sim-policy strong {
  overflow-wrap: anywhere;
  font-size: 11px;
}

.zwatt-sim-window-values {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.zwatt-sim-window-values div {
  min-width: 0;
  padding: 3px 8px;
  border-right: 1px solid var(--line);
  display: grid;
  gap: 4px;
}

.zwatt-sim-window-values div:first-child {
  padding-left: 0;
}

.zwatt-sim-window-values div:last-child {
  padding-right: 0;
  border-right: 0;
}

.zwatt-sim-window-values span {
  color: var(--muted);
  font-size: 8px;
}

.zwatt-sim-window-values strong {
  overflow-wrap: anywhere;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}

@media (max-width: 1100px) {
  .zwatt-sim-metrics {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .zwatt-sim-metrics article:nth-child(3) {
    border-right: 0;
  }

  .zwatt-sim-metrics article:nth-child(-n + 3) {
    border-bottom: 1px solid var(--line);
  }

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

  .zwatt-sim-policy div:nth-child(2) {
    border-right: 0;
  }

  .zwatt-sim-policy div:nth-child(-n + 2) {
    border-bottom: 1px solid var(--line);
  }
}

@media (max-width: 620px) {
  .zwatt-sim-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .zwatt-sim-metrics article,
  .zwatt-sim-metrics article:nth-child(3),
  .zwatt-sim-metrics article:last-child {
    grid-column: auto;
    border-right: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
  }

  .zwatt-sim-metrics article:nth-child(2n) {
    border-right: 0;
  }

  .zwatt-sim-metrics article:nth-last-child(-n + 2) {
    border-bottom: 0;
  }

  .zwatt-sim-flow {
    grid-template-columns: 1fr;
  }

  .zwatt-sim-flow i {
    display: none;
  }

  .zwatt-sim-project dl {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .zwatt-sim-project dl div {
    border-right: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
  }

  .zwatt-sim-project dl div:nth-child(2n) {
    border-right: 0;
  }

  .zwatt-sim-project dl div:last-child {
    grid-column: 1 / -1;
    border-right: 0;
    border-bottom: 0;
  }

  .zwatt-sim-policy {
    grid-template-columns: 1fr;
  }

  .zwatt-sim-policy div,
  .zwatt-sim-policy div:nth-child(2) {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .zwatt-sim-policy div:last-child {
    border-bottom: 0;
  }
}

/* V1.6 DEV platform-admin station GIS */
.station-gis-shell {
  display: grid;
  gap: 14px;
}

.station-gis-summary {
  border: 1px solid var(--line);
  background: #fff;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.station-gis-summary > div {
  min-width: 0;
  min-height: 92px;
  padding: 16px 18px;
  border-right: 1px solid var(--line);
  display: grid;
  align-content: center;
  gap: 5px;
}

.station-gis-summary > div:last-child {
  border-right: 0;
}

.station-gis-summary span,
.station-gis-summary small {
  color: var(--muted);
  font-size: 11px;
}

.station-gis-summary strong {
  color: #172033;
  font-size: 24px;
  font-variant-numeric: tabular-nums;
}

.station-gis-summary-joined strong {
  color: #b91c1c;
}

.station-gis-summary-reference strong {
  color: #1d4ed8;
}

.station-gis-toolbar {
  padding: 12px;
  border: 1px solid var(--line);
  background: #fff;
  display: grid;
  grid-template-columns: minmax(200px, 1fr) auto minmax(120px, 0.32fr) minmax(140px, 0.4fr) minmax(120px, 0.3fr) 42px;
  gap: 10px;
  align-items: end;
}

.station-gis-toolbar label,
.station-gis-status-filter {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
  display: grid;
  gap: 6px;
}

.station-gis-toolbar label > span,
.station-gis-status-filter legend {
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
}

.station-gis-toolbar input,
.station-gis-toolbar select {
  min-height: 38px;
}

.segmented-control {
  min-height: 38px;
  padding: 2px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #f3f6fa;
  display: flex;
}

.segmented-control button {
  min-width: 0;
  padding: 6px 10px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
  white-space: nowrap;
}

.segmented-control button.active {
  background: #fff;
  color: #172033;
  box-shadow: 0 1px 3px rgba(23, 32, 51, 0.12);
}

.station-gis-refresh {
  width: 42px;
  height: 38px;
}

.station-gis-message {
  padding: 11px 13px;
  border: 1px solid #d7a3a3;
  background: #fff5f5;
  color: #9f2424;
  font-size: 12px;
}

.station-gis-workspace {
  min-width: 0;
  border: 1px solid var(--line);
  background: #fff;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 310px;
}

.station-gis-map-panel {
  min-width: 0;
  border-right: 1px solid var(--line);
}

.station-gis-map-head {
  min-height: 46px;
  padding: 9px 12px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.station-gis-map-head > strong {
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
}

.station-gis-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.station-gis-legend > span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #445166;
  font-size: 11px;
}

.station-gis-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  display: inline-block;
}

.station-gis-dot.joined {
  background: #dc2626;
  box-shadow: 0 0 0 2px rgba(220, 38, 38, 0.15);
}

.station-gis-dot.not-joined {
  background: #2563eb;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.13);
}

.station-gis-map {
  width: 100%;
  height: 640px;
  min-height: 640px;
  background: #eaf0f6;
}

.station-gis-detail {
  min-width: 0;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.station-gis-detail-head {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.station-gis-detail .eyebrow {
  color: var(--blue);
  font-size: 9px;
}

.station-gis-detail h3 {
  margin: 4px 0 0;
  overflow-wrap: anywhere;
  font-size: 18px;
  line-height: 1.35;
}

.station-gis-detail > p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.station-gis-detail-list {
  margin: 6px 0 0;
  border-top: 1px solid var(--line);
}

.station-gis-detail-list > div {
  min-width: 0;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  display: grid;
  grid-template-columns: 86px minmax(0, 1fr);
  gap: 8px;
}

.station-gis-detail-list dt {
  color: var(--muted);
  font-size: 10px;
}

.station-gis-detail-list dd {
  margin: 0;
  overflow-wrap: anywhere;
  color: #28364c;
  font-size: 11px;
  font-weight: 750;
  text-align: right;
}

.station-gis-boundary {
  margin-top: auto;
  padding: 13px;
  border-left: 3px solid #b7791f;
  background: #fff9eb;
  display: grid;
  gap: 5px;
}

.station-gis-boundary strong {
  color: #875514;
  font-size: 11px;
}

.station-gis-boundary span {
  color: #725c39;
  font-size: 10px;
  line-height: 1.55;
}

.station-gis-popup {
  display: grid;
  gap: 5px;
  color: #172033;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.station-gis-popup strong {
  font-size: 13px;
  line-height: 1.35;
}

.station-gis-popup span {
  color: #5e6b7d;
  font-size: 10px;
  line-height: 1.4;
}

.station-gis-popup-status {
  width: fit-content;
  padding: 2px 6px;
  border-radius: 3px;
  font-weight: 800;
}

.station-gis-popup-status.joined {
  background: #fee2e2;
  color: #991b1b;
}

.station-gis-popup-status.not-joined {
  background: #dbeafe;
  color: #1d4ed8;
}

.station-gis-map .leaflet-control-zoom a {
  color: #172033;
}

.station-gis-map .leaflet-control-attribution {
  color: #6a7789;
  font-size: 8px;
}

@media (max-width: 1180px) {
  .station-gis-toolbar {
    grid-template-columns: minmax(210px, 1fr) auto minmax(120px, 0.42fr) minmax(140px, 0.5fr) 42px;
  }

  .station-gis-toolbar label:has(#stationGisMinimumCapacity) {
    display: none;
  }

  .station-gis-workspace {
    grid-template-columns: minmax(0, 1fr) 270px;
  }
}

@media (max-width: 820px) {
  .station-gis-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .station-gis-summary > div:nth-child(2) {
    border-right: 0;
  }

  .station-gis-summary > div:nth-child(-n + 2) {
    border-bottom: 1px solid var(--line);
  }

  .station-gis-toolbar {
    grid-template-columns: minmax(0, 1fr) 42px;
  }

  .station-gis-status-filter,
  .station-gis-toolbar label:has(#stationGisEnergyType),
  .station-gis-toolbar label:has(#stationGisGridRegion) {
    grid-column: 1 / -1;
  }

  .station-gis-search {
    grid-column: 1;
  }

  .station-gis-refresh {
    grid-column: 2;
    grid-row: 1;
  }

  .station-gis-workspace {
    grid-template-columns: 1fr;
  }

  .station-gis-map-panel {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .station-gis-map {
    height: 500px;
    min-height: 500px;
  }

  .station-gis-detail {
    min-height: 360px;
  }
}

@media (max-width: 520px) {
  .station-gis-summary > div {
    min-height: 82px;
    padding: 13px;
  }

  .station-gis-summary strong {
    font-size: 20px;
  }

  .station-gis-toolbar {
    padding: 10px;
  }

  .segmented-control button {
    flex: 1 1 0;
    padding-inline: 5px;
    white-space: normal;
  }

  .station-gis-map-head {
    align-items: flex-start;
  }

  .station-gis-legend {
    display: grid;
    gap: 6px;
  }

  .station-gis-map {
    height: 460px;
    min-height: 460px;
  }

  .station-gis-detail {
    min-height: 390px;
    padding: 16px;
  }
}
