:root {
  color-scheme: light;
  --bg: #f4f6f1;
  --surface: #ffffff;
  --surface-muted: #eef3ec;
  --ink: #07110d;
  --muted: #596862;
  --line: #d8e0d5;
  --line-strong: #c6d1c3;
  --green: #00c805;
  --green-deep: #007a2d;
  --green-soft: #e7f8e6;
  --blue: #145da0;
  --amber: #8a650f;
  --red: #bd2632;
  --surface-glass: rgba(255, 255, 255, 0.92);
  --surface-elevated: #fffefb;
  --line-soft: rgba(207, 218, 204, 0.82);
  --shadow: 0 8px 24px rgba(20, 34, 27, 0.06);
  --shadow-soft: 0 12px 30px rgba(20, 34, 27, 0.065);
  --shadow-lift: 0 20px 54px rgba(20, 34, 27, 0.1);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  background:
    linear-gradient(135deg, rgba(231, 248, 230, 0.72) 0%, rgba(244, 246, 241, 0) 42%),
    linear-gradient(180deg, #f8fbf5 0%, var(--bg) 48%, #eef4ec 100%);
  color: var(--ink);
  font-family: Aptos, Inter, "Segoe UI Variable", "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 16px;
  line-height: 1.45;
  text-rendering: optimizeLegibility;
}

button,
input,
select,
textarea,
a.secondary-button,
a.primary-button {
  font: inherit;
  letter-spacing: 0;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

:focus-visible {
  outline: 3px solid rgba(0, 200, 5, 0.36);
  outline-offset: 3px;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: clamp(1.9rem, 2.7vw, 2.65rem);
  line-height: 1.02;
  letter-spacing: 0;
}

.title-block {
  display: grid;
  max-width: 780px;
  gap: 6px;
  min-width: 0;
}

.title-block .eyebrow {
  margin-bottom: 2px;
}

.title-subtitle {
  margin: 0;
  color: var(--muted);
  font-size: 1.02rem;
  font-weight: 700;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 3px;
  font-size: 1.04rem;
  line-height: 1.2;
}

.app-shell {
  width: min(1760px, calc(100% - 56px));
  margin: 0 auto;
  padding: 24px 0 52px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  width: 100vw;
  margin: -24px calc(50% - 50vw) 22px;
  border: 0;
  border-bottom: 1px solid var(--line-soft);
  border-radius: 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.82), rgba(248, 251, 246, 0.78));
  box-shadow: none;
  padding: 24px max(28px, calc((100vw - 1760px) / 2 + 28px)) 22px;
}

.topbar-actions {
  display: flex;
  flex: 0 0 auto;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 11px;
}

.strategy-tabs {
  min-width: 164px;
  min-height: 42px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--green-deep);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.session-pill {
  min-width: 180px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: #fffdf3;
  color: var(--muted);
  padding: 10px 18px;
  text-align: center;
  font-size: 0.95rem;
  box-shadow: 0 10px 22px rgba(138, 101, 15, 0.1);
}

.session-pill.ready {
  border-color: #8bdc94;
  background: var(--green-soft);
  color: #00491c;
}

.home-body {
  min-height: 100vh;
  overflow-x: hidden;
}

.home-shell {
  display: grid;
  width: min(1180px, calc(100% - 40px));
  min-height: 100vh;
  min-height: 100svh;
  margin: 0 auto;
  padding: 32px 0;
  place-items: center;
}

.command-center {
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 28px;
  width: 100%;
  padding: 0;
  text-align: center;
}

.command-brand {
  display: grid;
  justify-items: center;
  gap: 18px;
  max-width: 100%;
}

.command-logo {
  display: block;
  width: clamp(68px, 8vw, 104px);
  height: clamp(68px, 8vw, 104px);
  border: 1px solid var(--line);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow-lift);
  object-fit: contain;
  padding: clamp(9px, 1.2vw, 14px);
}

.command-title {
  margin: 0;
  font-size: clamp(1.78rem, 6.9vw, 5.1rem);
  line-height: 0.96;
  max-width: 100%;
  white-space: nowrap;
}

.command-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
}

.command-card {
  display: inline-flex;
  min-width: 156px;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 12px 28px rgba(20, 34, 27, 0.08);
  color: var(--ink);
  padding: 12px 22px;
  font-weight: 850;
  line-height: 1;
  text-decoration: none;
  transition:
    background 0.16s ease,
    border-color 0.16s ease,
    color 0.16s ease,
    box-shadow 0.16s ease,
    transform 0.16s ease;
}

.command-card:hover,
.command-card:focus-visible {
  border-color: var(--green);
  background: var(--green);
  color: #001707;
  box-shadow: 0 18px 40px rgba(0, 200, 5, 0.16);
  transform: translateY(-2px);
}

.session-pill.missing {
  border-color: #e8ce80;
  background: #fff7d8;
  color: #684a00;
}

.connection-band,
.control-band,
.table-section {
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: var(--surface-glass);
  box-shadow: var(--shadow-soft);
}

.connection-band {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 11px 34px;
  margin-bottom: 18px;
  padding: 20px;
}

.connection-panel {
  display: contents;
}

.connection-panel > div:first-child {
  min-width: 0;
}

.connection-subtitle-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 10px;
  max-width: 920px;
}

.connection-help-link {
  white-space: nowrap;
}

.connection-panel p,
.disclosure,
.helper-hero p,
.table-header p,
.guide-section-heading p,
.guide-intro {
  margin-bottom: 0;
  color: var(--muted);
}

.connection-actions {
  display: flex;
  grid-column: 2;
  grid-row: 1 / span 2;
  align-items: center;
  align-self: center;
  gap: 12px;
}

.connection-disclosure {
  display: grid;
  max-width: none;
  gap: 4px;
  padding-right: 0;
}

.connection-disclosure p {
  margin: 0;
}

.connection-disclosure p:first-child {
  white-space: nowrap;
}

.text-link {
  color: var(--green-deep);
  font-weight: 750;
  text-decoration: underline;
  text-decoration-color: rgba(0, 122, 45, 0.35);
  text-underline-offset: 3px;
}

.text-link:hover {
  text-decoration-color: currentColor;
}

.disclosure .text-link {
  margin-left: 6px;
}

.control-band {
  display: grid;
  grid-template-columns:
    minmax(156px, 184px)
    minmax(292px, 304px)
    minmax(0, 1fr)
    minmax(360px, 396px)
    minmax(232px, 248px)
    minmax(116px, 126px)
    minmax(132px, 142px);
  align-items: end;
  gap: 12px;
  padding: 18px 20px;
}

body[data-strategy="csp"] .control-band > .csp-control:first-child {
  grid-column: 1;
}

body[data-strategy="csp"] .return-field {
  grid-column: 2;
}

body[data-strategy="csp"] .csp-screener-control {
  grid-column: 4;
}

body[data-strategy="csp"] .source-control {
  grid-column: 5;
}

body[data-strategy="csp"] #runButton {
  grid-column: 6;
}

body[data-strategy="csp"] #exportButton {
  grid-column: 7;
}

body[data-strategy="csp"][data-csp-input-mode="manual"] .source-control {
  grid-column: 4;
}

body[data-strategy="csp"][data-csp-input-mode="manual"] #runButton {
  grid-column: 5;
}

body[data-strategy="csp"][data-csp-input-mode="manual"] #exportButton {
  grid-column: 6;
}

body[data-strategy="csp"][data-csp-input-mode="manual"] .control-band {
  grid-template-columns:
    minmax(156px, 184px)
    minmax(292px, 304px)
    minmax(0, 1fr)
    minmax(232px, 248px)
    minmax(116px, 126px)
    minmax(132px, 142px);
}

body[data-strategy="cc"] .control-band {
  grid-template-columns:
    minmax(292px, 304px)
    minmax(0, 1fr)
    minmax(232px, 260px)
    minmax(126px, 142px)
    minmax(142px, 160px);
  justify-content: stretch;
}

body[data-strategy="cc"] .return-field {
  grid-column: 1;
}

body[data-strategy="cc"] .source-control {
  grid-column: 3;
}

body[data-strategy="cc"] #runButton {
  grid-column: 4;
}

body[data-strategy="cc"] #exportButton {
  grid-column: 5;
}

.field {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.field > span,
.metric span {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 800;
}

.field > span {
  line-height: 1;
}

input[type="number"],
input[type="email"],
input[type="text"],
select {
  width: 100%;
  height: 46px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
  color: var(--ink);
  font-size: 0.96rem;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  padding: 0 14px;
  outline: none;
  box-shadow: none;
}

.return-input-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  align-items: end;
}

.mini-field {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.mini-field span {
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 850;
  line-height: 1;
  letter-spacing: 0;
  text-transform: uppercase;
}

.mini-field input {
  height: 46px;
  padding: 0 10px;
}

input[type="number"]:focus,
input[type="email"]:focus,
input[type="text"]:focus,
select:focus {
  border-color: var(--green-deep);
  box-shadow: 0 0 0 3px rgba(0, 200, 5, 0.14);
}

.screener-select-row {
  display: grid;
  grid-template-columns: minmax(230px, 1fr) auto;
  gap: 8px;
}

.segmented {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  min-width: 0;
  min-height: 46px;
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  overflow: hidden;
  background: rgba(238, 243, 236, 0.92);
  padding: 3px;
}

.segment {
  min-width: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  padding: 0 12px;
  cursor: pointer;
  overflow: visible;
  white-space: nowrap;
  transition:
    background 0.18s ease,
    color 0.18s ease,
    box-shadow 0.18s ease;
}

.segment:last-child {
  border-right: 0;
}

.segment.active {
  background: var(--green);
  color: #03130a;
  font-weight: 800;
  box-shadow: 0 8px 18px rgba(0, 200, 5, 0.16);
}

.primary-button,
.secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 128px;
  height: 46px;
  border-radius: 999px;
  padding: 0 18px;
  font-weight: 780;
  cursor: pointer;
  white-space: nowrap;
  text-decoration: none;
  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease,
    background 0.18s ease,
    border-color 0.18s ease;
}

.primary-button {
  border: 1px solid #07110d;
  background: #07110d;
  color: #ffffff;
  box-shadow: 0 10px 22px rgba(7, 17, 13, 0.15);
}

#runButton.run-scan,
#runButton.run-refresh {
  border-color: #07110d;
  background: #07110d;
  color: #ffffff;
  box-shadow: 0 10px 22px rgba(7, 17, 13, 0.15);
}

#runButton.run-busy {
  border-color: #647069;
  background: #647069;
  color: #ffffff;
}

.secondary-button {
  border: 1px solid var(--line-soft);
  background: rgba(255, 255, 255, 0.72);
  color: var(--ink);
  box-shadow: 0 7px 16px rgba(20, 34, 27, 0.045);
}

.primary-button:hover:not(:disabled),
.secondary-button:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 12px 24px rgba(20, 34, 27, 0.09);
}

.guide-link-button {
  min-width: 112px;
}

.compact-button {
  min-width: 96px;
  padding: 0 14px;
}

#connectButton {
  min-width: 174px;
  border-color: var(--green);
  background: var(--green);
  color: #03130a;
  box-shadow: 0 10px 22px rgba(0, 200, 5, 0.14);
}

.primary-button:disabled,
.secondary-button:disabled,
.segment:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

#runButton:disabled {
  cursor: wait;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin: 18px 0;
}

.metric {
  min-height: 94px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: linear-gradient(180deg, var(--surface-elevated), rgba(255, 255, 255, 0.82));
  padding: 18px 20px;
  box-shadow: var(--shadow);
}

.metric span {
  display: block;
  margin-bottom: 8px;
  text-transform: uppercase;
}

.metric strong {
  display: block;
  font-size: 1.55rem;
  line-height: 1.15;
}

.notice {
  margin-bottom: 18px;
  border: 1px solid #c9dfc6;
  border-radius: 8px;
  background: #f2faf1;
  color: #1e4d24;
  padding: 13px 16px;
  box-shadow: 0 8px 18px rgba(20, 34, 27, 0.045);
}

.notice.error {
  border-color: #e6a5aa;
  background: #fff1f2;
  color: var(--red);
}

.table-section {
  overflow: hidden;
}

.table-header {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(260px, 420px);
  align-items: start;
  gap: 18px 24px;
  padding: 20px 22px;
  border-bottom: 1px solid var(--line-soft);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.86), rgba(251, 253, 249, 0.86));
}

.table-heading-copy {
  min-width: 0;
}

.table-source-toolbar {
  display: grid;
  justify-items: end;
  justify-self: end;
  gap: 8px;
  width: min(340px, 100%);
  min-width: 0;
}

.table-source-control {
  width: 100%;
  min-width: 0;
}

.table-header .check-control {
  justify-self: end;
  margin-top: 1px;
}

.check-control {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--muted);
  font-size: 0.95rem;
  white-space: nowrap;
}

.check-control input {
  width: 15px;
  height: 15px;
  accent-color: var(--green-deep);
}

.table-wrap {
  overflow-x: hidden;
  background: rgba(255, 255, 255, 0.58);
}

table {
  width: 100%;
  min-width: 0;
  border-collapse: collapse;
  table-layout: fixed;
}

th,
td {
  border-bottom: 1px solid var(--line-soft);
  padding: 12px 10px;
  text-align: right;
  vertical-align: middle;
  font-size: 0.9rem;
  font-variant-numeric: tabular-nums;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

th {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 850;
  line-height: 1.15;
  text-transform: uppercase;
}

.highlight-column {
  color: var(--ink);
  font-weight: 700;
}

th.highlight-column {
  font-weight: 800;
}

th:nth-child(2),
td:nth-child(2),
th:nth-child(3),
td:nth-child(3) {
  text-align: left;
}

tbody tr:hover {
  background: rgba(231, 248, 230, 0.28);
}

tbody tr:last-child td {
  border-bottom: 0;
}

th:nth-child(1),
td:nth-child(1) {
  width: 4%;
}

th:nth-child(2),
td:nth-child(2) {
  width: 8%;
}

th:nth-child(3),
td:nth-child(3) {
  width: 9%;
}

th:nth-child(4),
td:nth-child(4),
th:nth-child(5),
td:nth-child(5),
th:nth-child(6),
td:nth-child(6),
th:nth-child(7),
td:nth-child(7) {
  width: 7%;
}

th:nth-child(8),
td:nth-child(8) {
  width: 8%;
}

th:nth-child(9),
td:nth-child(9) {
  width: 8%;
}

th:nth-child(10),
td:nth-child(10) {
  width: 7%;
}

th:nth-child(11),
td:nth-child(11) {
  width: 5%;
}

th:nth-child(12),
td:nth-child(12) {
  width: 7%;
}

th:nth-child(13),
td:nth-child(13) {
  width: 7%;
}

th:nth-child(14),
td:nth-child(14) {
  width: 9%;
}

body[data-strategy="cc"] th:nth-child(1),
body[data-strategy="cc"] td:nth-child(1) {
  width: 13%;
  text-align: left;
}

.cc-symbol-header {
  min-width: 0;
  white-space: nowrap;
}

.cc-header-remove-spacer {
  display: inline-block;
  width: 28px;
  margin-right: 10px;
  vertical-align: middle;
}

.cc-header-label {
  display: inline-block;
  white-space: nowrap;
  vertical-align: middle;
}

body[data-strategy="cc"] th:nth-child(2),
body[data-strategy="cc"] td:nth-child(2) {
  width: 8%;
  text-align: left;
}

body[data-strategy="cc"] th:nth-child(3),
body[data-strategy="cc"] td:nth-child(3) {
  width: 9%;
  text-align: right;
}

body[data-strategy="cc"] th:nth-child(4),
body[data-strategy="cc"] td:nth-child(4),
body[data-strategy="cc"] th:nth-child(5),
body[data-strategy="cc"] td:nth-child(5),
body[data-strategy="cc"] th:nth-child(6),
body[data-strategy="cc"] td:nth-child(6),
body[data-strategy="cc"] th:nth-child(7),
body[data-strategy="cc"] td:nth-child(7) {
  width: 7%;
}

body[data-strategy="cc"] th:nth-child(8),
body[data-strategy="cc"] td:nth-child(8),
body[data-strategy="cc"] th:nth-child(9),
body[data-strategy="cc"] td:nth-child(9),
body[data-strategy="cc"] th:nth-child(10),
body[data-strategy="cc"] td:nth-child(10),
body[data-strategy="cc"] th:nth-child(11),
body[data-strategy="cc"] td:nth-child(11) {
  width: 7%;
}

body[data-strategy="cc"] th:nth-child(12),
body[data-strategy="cc"] td:nth-child(12) {
  width: 14%;
}

body[data-strategy="csp"][data-csp-input-mode="manual"] th:nth-child(1),
body[data-strategy="csp"][data-csp-input-mode="manual"] td:nth-child(1) {
  width: 12%;
  text-align: left;
}

body[data-strategy="csp"][data-csp-input-mode="manual"] th:nth-child(2),
body[data-strategy="csp"][data-csp-input-mode="manual"] td:nth-child(2) {
  width: 9%;
  text-align: left;
}

body[data-strategy="csp"][data-csp-input-mode="manual"] th:nth-child(3),
body[data-strategy="csp"][data-csp-input-mode="manual"] td:nth-child(3),
body[data-strategy="csp"][data-csp-input-mode="manual"] th:nth-child(4),
body[data-strategy="csp"][data-csp-input-mode="manual"] td:nth-child(4),
body[data-strategy="csp"][data-csp-input-mode="manual"] th:nth-child(5),
body[data-strategy="csp"][data-csp-input-mode="manual"] td:nth-child(5),
body[data-strategy="csp"][data-csp-input-mode="manual"] th:nth-child(6),
body[data-strategy="csp"][data-csp-input-mode="manual"] td:nth-child(6) {
  width: 7%;
}

body[data-strategy="csp"][data-csp-input-mode="manual"] th:nth-child(7),
body[data-strategy="csp"][data-csp-input-mode="manual"] td:nth-child(7),
body[data-strategy="csp"][data-csp-input-mode="manual"] th:nth-child(8),
body[data-strategy="csp"][data-csp-input-mode="manual"] td:nth-child(8) {
  width: 8%;
}

body[data-strategy="csp"][data-csp-input-mode="manual"] th:nth-child(9),
body[data-strategy="csp"][data-csp-input-mode="manual"] td:nth-child(9) {
  width: 7%;
}

body[data-strategy="csp"][data-csp-input-mode="manual"] th:nth-child(10),
body[data-strategy="csp"][data-csp-input-mode="manual"] td:nth-child(10) {
  width: 5%;
}

body[data-strategy="csp"][data-csp-input-mode="manual"] th:nth-child(11),
body[data-strategy="csp"][data-csp-input-mode="manual"] td:nth-child(11),
body[data-strategy="csp"][data-csp-input-mode="manual"] th:nth-child(12),
body[data-strategy="csp"][data-csp-input-mode="manual"] td:nth-child(12) {
  width: 7%;
}

body[data-strategy="csp"][data-csp-input-mode="manual"] th:nth-child(13),
body[data-strategy="csp"][data-csp-input-mode="manual"] td:nth-child(13) {
  width: 9%;
}

body[data-strategy="csp"][data-csp-input-mode="manual"] th:nth-child(n + 3),
body[data-strategy="csp"][data-csp-input-mode="manual"] td:nth-child(n + 3) {
  text-align: right;
}

.cc-list-row td {
  padding-top: 9px;
  padding-bottom: 9px;
}

.manual-csp-row td {
  padding-top: 9px;
  padding-bottom: 9px;
}

.cc-symbol-cell {
  display: grid;
  grid-template-columns: 28px minmax(8ch, 10ch);
  align-items: center;
  justify-content: start;
  gap: 10px;
  min-width: 0;
}

.manual-symbol-cell {
  display: grid;
  grid-template-columns: 28px minmax(8ch, 12ch);
  align-items: center;
  justify-content: start;
  gap: 10px;
  min-width: 0;
}

.cc-inline-input {
  width: 100%;
  min-width: 0;
  min-height: 34px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
  color: var(--ink);
  font: inherit;
  font-size: 0.9rem;
  font-weight: 520;
  padding: 6px 8px;
  text-align: right;
}

.cc-inline-input:focus {
  border-color: var(--green);
  outline: 2px solid rgba(0, 200, 5, 0.18);
  outline-offset: 1px;
}

.cc-inline-input[readonly] {
  background: #f8faf7;
  color: var(--ink);
}

.cc-symbol-input {
  width: 10ch;
  max-width: 10ch;
  text-align: left;
  text-transform: uppercase;
  color: var(--blue);
  font-weight: 850;
}

.manual-csp-symbol-input {
  width: 12ch;
  max-width: 12ch;
  text-align: left;
  text-transform: uppercase;
  color: var(--blue);
  font-weight: 850;
}

.cc-average-cost-input {
  width: 11ch;
  max-width: 11ch;
}

.cc-contracts-input {
  width: 7ch;
  max-width: 7ch;
  font-weight: 700;
  text-align: center;
}

.cc-remove-button {
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  border: 1px solid #f0b5b8;
  border-radius: 999px;
  background: #fff4f5;
  color: var(--red);
  cursor: pointer;
  font-size: 1rem;
  font-weight: 900;
  line-height: 1;
}

.cc-remove-button:hover,
.cc-remove-button:focus-visible {
  border-color: var(--red);
  background: #ffe7e9;
  outline: none;
}

body[data-cc-input-mode="auto"] .cc-remove-button {
  visibility: hidden;
}

.cc-list-actions {
  align-items: center;
  border-top: 1px solid var(--line-soft);
  display: flex;
  justify-content: center;
  padding: 16px 20px;
  background: rgba(251, 253, 249, 0.66);
}

.add-entry-button {
  min-width: 132px;
}

.symbol-link {
  color: var(--blue);
  font-weight: 850;
  text-decoration: none;
}

.symbol-link:hover {
  text-decoration: underline;
}

.status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 76px;
  border-radius: 999px;
  padding: 4px 9px;
  font-size: 0.74rem;
  font-weight: 850;
}

.status.eligible {
  background: var(--green-soft);
  color: #005c20;
}

.status.ineligible {
  background: #edf0ea;
  color: var(--muted);
}

.status.unused {
  background: #fff7df;
  color: var(--amber);
}

.status.skip {
  background: #fff3e6;
  color: #9a4f00;
}

.status.unavailable,
.status.missing-data,
.status.missing-current {
  background: #fff0f1;
  color: var(--red);
}

.empty-cell {
  color: var(--muted);
  padding: 36px 16px;
  text-align: center !important;
}

.empty-row .empty-cell {
  width: 100%;
  text-align: center !important;
}

.helper-page {
  max-width: 1120px;
}

.helper-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 24px;
}

.helper-hero-copy {
  min-width: 0;
  max-width: 850px;
}

.helper-hero-action {
  justify-self: end;
}

.helper-steps ol {
  margin: 0;
  padding: 20px 30px 26px 44px;
}

.helper-steps li {
  margin-bottom: 10px;
  color: var(--muted);
}

code {
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--surface-muted);
  color: var(--ink);
  overflow-wrap: anywhere;
  padding: 1px 5px;
}

.onboarding-dialog {
  width: min(620px, calc(100% - 32px));
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: var(--surface-elevated);
  color: var(--ink);
  padding: 0;
  box-shadow: var(--shadow-lift);
}

.onboarding-dialog::backdrop {
  background: rgba(7, 17, 13, 0.38);
}

.settings-dialog {
  width: min(720px, calc(100% - 32px));
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: var(--surface-elevated);
  color: var(--ink);
  padding: 0;
  box-shadow: var(--shadow-lift);
}

.settings-dialog::backdrop {
  background: rgba(7, 17, 13, 0.38);
}

.settings-dialog-content {
  display: grid;
  gap: 18px;
  padding: 24px;
}

.settings-dialog-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}

.settings-dialog-heading h2 {
  margin-bottom: 6px;
  font-size: 1.35rem;
}

.settings-dialog-heading p:not(.eyebrow) {
  margin-bottom: 0;
  color: var(--muted);
}

.screener-manager-list {
  display: grid;
  gap: 10px;
}

.screener-manager-row,
.screener-add-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  gap: 8px;
  align-items: center;
}

.screener-manager-row input,
.screener-add-row input {
  min-width: 0;
}

.screener-add-row {
  grid-template-columns: minmax(0, 1fr) auto;
  border-top: 1px solid var(--line);
  padding-top: 16px;
}

.select-screener-button,
.delete-screener-button {
  min-width: 84px;
  height: 40px;
}

.delete-screener-button {
  border-color: #f0b5b8;
  background: #fff4f5;
  color: var(--red);
}

.delete-screener-button:disabled {
  opacity: 0.42;
}

.settings-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.release-panel {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  background: rgba(238, 243, 236, 0.72);
  padding: 12px;
}

.release-panel div {
  display: grid;
  gap: 4px;
}

.release-panel span {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 850;
  text-transform: uppercase;
}

.release-panel strong {
  font-size: 0.96rem;
}

.onboarding-content {
  padding: 24px;
}

.onboarding-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}

.onboarding-heading h2 {
  max-width: 470px;
  font-size: 1.45rem;
  line-height: 1.18;
}

.icon-button {
  display: inline-flex;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line-soft);
  border-radius: 50%;
  background: var(--surface-muted);
  color: var(--muted);
  cursor: pointer;
  font-size: 1.45rem;
  line-height: 1;
}

.onboarding-steps {
  display: grid;
  gap: 12px;
  margin: 20px 0 22px;
  padding: 0;
  list-style: none;
  counter-reset: onboarding-step;
}

.onboarding-steps li {
  display: grid;
  grid-template-columns: 30px 1fr;
  column-gap: 12px;
  counter-increment: onboarding-step;
}

.onboarding-steps li::before {
  display: inline-flex;
  width: 30px;
  height: 30px;
  grid-row: span 2;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--green-soft);
  color: var(--green-deep);
  content: counter(onboarding-step);
  font-size: 0.82rem;
  font-weight: 850;
}

.onboarding-steps span {
  color: var(--muted);
  font-size: 0.92rem;
}

.onboarding-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.guide-page {
  max-width: 1180px;
}

.guide-intro {
  max-width: 760px;
  margin-top: 10px;
}

.guide-section {
  margin-bottom: 16px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: var(--surface-glass);
  padding: 22px;
  box-shadow: var(--shadow-soft);
}

.guide-section-heading {
  max-width: 850px;
}

.guide-section-heading h2 {
  margin-bottom: 6px;
  font-size: 1.2rem;
}

.step-kicker {
  margin-bottom: 7px !important;
  color: var(--green-deep) !important;
  font-size: 0.74rem;
  font-weight: 850;
  text-transform: uppercase;
}

.flow-diagram {
  display: grid;
  grid-template-columns: 1fr auto 1fr auto 1fr auto 1fr;
  align-items: center;
  gap: 10px;
  margin-top: 20px;
}

.flow-node {
  display: flex;
  min-height: 74px;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line-soft);
  border-radius: 7px;
  background: #fbfcfa;
  padding: 14px;
}

.flow-node span {
  display: inline-flex;
  width: 26px;
  height: 26px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--green-soft);
  color: var(--green-deep);
  font-size: 0.76rem;
  font-weight: 850;
}

.flow-node strong {
  font-size: 0.9rem;
  line-height: 1.2;
}

.flow-arrow {
  color: var(--green-deep);
  font-size: 1.25rem;
  font-weight: 850;
}

.guide-callout {
  margin-top: 18px;
  border-left: 3px solid var(--green);
  background: var(--green-soft);
  color: #164923;
  padding: 12px 14px;
}

.guide-callout.neutral {
  border-left-color: var(--line-strong);
  background: var(--surface-muted);
  color: var(--muted);
}

.guide-steps {
  margin: 16px 0 0;
  padding-left: 22px;
  color: var(--muted);
}

.guide-steps li {
  margin-bottom: 8px;
  padding-left: 3px;
}

.name-list {
  display: grid;
  gap: 8px;
  margin-top: 18px;
}

.name-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border: 1px solid var(--line-soft);
  border-radius: 7px;
  background: #fbfcfa;
  padding: 12px 14px;
}

.name-row div {
  display: grid;
  gap: 5px;
}

.name-row span {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 850;
  text-transform: uppercase;
}

.copy-button {
  min-width: 72px;
  height: 34px;
  border: 1px solid var(--line-soft);
  border-radius: 6px;
  background: var(--surface-muted);
  color: var(--green-deep);
  cursor: pointer;
  font-weight: 800;
}

.copy-status {
  min-height: 20px;
  margin: 8px 0 0;
  color: var(--green-deep);
  font-size: 0.84rem;
}

.guide-footnote {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.inline-action {
  margin-top: 16px;
}

.glossary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  margin: 18px 0 0;
  overflow: hidden;
  border: 1px solid var(--line-soft);
  border-radius: 7px;
  background: var(--line);
}

.glossary-grid div {
  background: #fbfcfa;
  padding: 12px 14px;
}

.glossary-grid dt,
.troubleshooting-list dt {
  color: var(--ink);
  font-size: 0.86rem;
  font-weight: 850;
}

.glossary-grid dd,
.troubleshooting-list dd {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.troubleshooting-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 16px 0 0;
}

.troubleshooting-list div {
  border-left: 3px solid var(--line-strong);
  padding: 4px 12px;
}

.guide-disclosure {
  border-left: 4px solid var(--green-deep);
}

.simple-page {
  max-width: 1180px;
}

.page-hero-band {
  width: 100vw;
  margin: 0 calc(50% - 50vw) 22px;
  border-bottom: 1px solid var(--line-soft);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.86), rgba(248, 251, 246, 0.78));
  padding: 28px 0 24px;
}

.page-hero-inner {
  display: flex;
  width: min(1180px, calc(100% - 56px));
  margin: 0 auto;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
}

.page-topbar {
  align-items: flex-start;
}

.page-intro {
  max-width: 780px;
  margin: 6px 0 0;
  color: var(--muted);
}

.content-grid,
.article-grid,
.calculator-grid {
  display: grid;
  gap: 16px;
}

.content-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 18px;
}

.article-grid,
.calculator-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.resource-card,
.article-card,
.calculator-card {
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: var(--surface-glass);
  box-shadow: var(--shadow-soft);
  padding: 20px;
}

.resource-card h2,
.resource-card h3,
.article-card h2,
.calculator-card h2 {
  margin-bottom: 8px;
  font-size: 1.1rem;
}

.resource-card p,
.article-card p,
.calculator-card p,
.legal-page p,
.faq-list dd {
  color: var(--muted);
}

.article-card {
  min-height: 220px;
}

.calculator-card {
  display: grid;
  align-content: start;
  gap: 14px;
}

.calculator-fields {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.calculator-fields.two-up {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.calculator-output {
  display: block;
  border: 1px solid #b9e1b7;
  border-radius: 8px;
  background: var(--green-soft);
  color: #06451b;
  padding: 12px 14px;
  font-weight: 850;
}

.calculator-output.secondary-output {
  border-color: var(--line-soft);
  background: var(--surface-muted);
  color: var(--ink);
}

.faq-list {
  display: grid;
  gap: 12px;
  margin: 0;
}

.faq-list div {
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: #fbfcfa;
  padding: 16px;
}

.faq-list dt {
  color: var(--ink);
  font-weight: 850;
}

.faq-list dd {
  margin: 6px 0 0;
}

.legal-page {
  display: grid;
  gap: 10px;
}

.legal-page h2 {
  margin: 12px 0 0;
  font-size: 1.08rem;
}

.legal-page p {
  margin-bottom: 0;
}

.legal-note,
.plain-note {
  border-left: 3px solid var(--green);
  background: var(--green-soft);
  color: #164923 !important;
  padding: 12px 14px;
}

.legal-list {
  margin: 6px 0 0;
  padding-left: 22px;
  color: var(--muted);
}

.legal-list li {
  margin-bottom: 8px;
}

.contact-form {
  display: grid;
  gap: 16px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.form-grid .full-span {
  grid-column: 1 / -1;
}

textarea {
  width: 100%;
  min-height: 170px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
  color: var(--ink);
  font-size: 0.96rem;
  font-weight: 500;
  padding: 12px 14px;
  outline: none;
  box-shadow: none;
}

textarea:focus {
  border-color: var(--green-deep);
  box-shadow: 0 0 0 3px rgba(0, 200, 5, 0.14);
}

.form-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.form-status {
  min-height: 24px;
  color: var(--muted);
  font-weight: 650;
}

.form-status.success {
  color: var(--green-deep);
}

.form-status.error {
  color: var(--red);
}

.health-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 18px 22px 22px;
}

.health-card {
  position: relative;
  display: grid;
  gap: 6px;
  min-height: 132px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  padding: 18px 18px 18px 42px;
}

.health-card h3 {
  margin: 0;
  font-size: 1rem;
}

.health-card p,
.health-card small {
  margin: 0;
  color: var(--muted);
}

.status-dot {
  position: absolute;
  top: 20px;
  left: 18px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--line-strong);
}

.health-card.ok .status-dot {
  background: var(--green);
}

.health-card.warn .status-dot {
  background: #f0bc3f;
}

.health-card.error .status-dot {
  background: var(--red);
}

.site-footer {
  display: block;
  width: 100vw;
  margin: 132px calc(50% - 50vw) -52px;
  border: 0;
  border-top: 1px solid var(--line-soft);
  border-radius: 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(251, 253, 249, 0.9));
  box-shadow: none;
  padding: 34px max(28px, calc((100vw - 1760px) / 2 + 28px));
}

.simple-page .site-footer {
  padding-left: max(28px, calc((100vw - 1180px) / 2 + 28px));
  padding-right: max(28px, calc((100vw - 1180px) / 2 + 28px));
}

.footer-inner {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(420px, 1.4fr);
  gap: 34px;
}

.footer-brand h2 {
  margin-bottom: 8px;
  font-size: 1.15rem;
}

.footer-brand p:not(.eyebrow) {
  max-width: 360px;
  margin: 0;
  color: var(--muted);
}

.footer-columns {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px;
}

.footer-column {
  display: grid;
  align-content: start;
  gap: 8px;
}

.footer-column h3 {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 850;
  text-transform: uppercase;
}

.footer-column a {
  color: var(--ink);
  font-size: 0.94rem;
  text-decoration: none;
}

.footer-column a:hover,
.footer-column a:focus-visible {
  color: var(--green-deep);
  text-decoration: underline;
  text-underline-offset: 3px;
}

@media (max-width: 1400px) {
  body[data-strategy="csp"][data-csp-input-mode="auto"] .control-band {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }

  body[data-strategy="csp"][data-csp-input-mode="auto"] .control-band > .csp-control:first-child,
  body[data-strategy="csp"][data-csp-input-mode="auto"] .return-field,
  body[data-strategy="csp"][data-csp-input-mode="auto"] .csp-screener-control,
  body[data-strategy="csp"][data-csp-input-mode="auto"] .source-control,
  body[data-strategy="csp"][data-csp-input-mode="auto"] #runButton,
  body[data-strategy="csp"][data-csp-input-mode="auto"] #exportButton {
    grid-column: auto;
  }

  body[data-strategy="csp"][data-csp-input-mode="auto"] .source-control {
    grid-column: 1 / -1;
  }

  body[data-strategy="csp"][data-csp-input-mode="auto"] .control-band #runButton,
  body[data-strategy="csp"][data-csp-input-mode="auto"] .control-band #exportButton {
    align-self: stretch;
  }
}

@media (max-width: 1180px) {
  body[data-strategy="csp"] .control-band {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }

  body[data-strategy="csp"] .control-band > .csp-control:first-child,
  body[data-strategy="csp"] .return-field,
  body[data-strategy="csp"] .csp-screener-control,
  body[data-strategy="csp"] .source-control,
  body[data-strategy="csp"] #runButton,
  body[data-strategy="csp"] #exportButton,
  body[data-strategy="csp"][data-csp-input-mode="manual"] .source-control,
  body[data-strategy="csp"][data-csp-input-mode="manual"] #runButton,
  body[data-strategy="csp"][data-csp-input-mode="manual"] #exportButton {
    grid-column: auto;
  }

  body[data-strategy="csp"] .source-control {
    grid-column: 1 / -1;
  }

  body[data-strategy="csp"][data-csp-input-mode="manual"] .source-control {
    grid-column: 1 / -1;
  }

  body[data-strategy="csp"] .control-band #runButton,
  body[data-strategy="csp"] .control-band #exportButton {
    align-self: stretch;
  }
}

@media (max-width: 980px) {
  body[data-strategy="cc"] .control-band {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }

  body[data-strategy="cc"] .return-field,
  body[data-strategy="cc"] .source-control,
  body[data-strategy="cc"] #runButton,
  body[data-strategy="cc"] #exportButton {
    grid-column: auto;
  }

  body[data-strategy="cc"] .source-control {
    grid-column: 1 / -1;
  }
}

@media (max-width: 820px) {
  .home-shell {
    width: min(100% - 28px, 1180px);
    padding: 26px 0;
  }

  .command-center {
    gap: 24px;
    padding: 0;
  }

  .health-grid,
  .release-panel {
    grid-template-columns: 1fr;
  }

  .command-actions {
    width: min(100%, 380px);
  }

  .command-card {
    min-height: 48px;
    min-width: 150px;
    padding: 12px 20px;
  }

  .app-shell {
    width: min(100% - 28px, 1760px);
    padding-top: 24px;
  }

  h1 {
    font-size: 1.8rem;
  }

  .topbar,
  .table-header,
  .helper-hero {
    align-items: stretch;
  }

  .table-header {
    grid-template-columns: 1fr;
  }

  .table-source-toolbar {
    justify-items: stretch;
    justify-self: stretch;
    width: 100%;
  }

  .table-header .check-control {
    justify-self: start;
  }

  .topbar {
    flex-direction: column;
    margin-top: -24px;
    padding-left: 14px;
    padding-right: 14px;
  }

  .topbar,
  .connection-band,
  .control-band,
  .table-section,
  .metric,
  .guide-section {
    box-shadow: 0 8px 20px rgba(20, 34, 27, 0.055);
  }

  .topbar-actions {
    align-items: stretch;
    justify-content: stretch;
  }

  .connection-band {
    grid-template-columns: 1fr;
  }

  .connection-panel {
    display: grid;
    gap: 14px;
  }

  .connection-actions {
    grid-column: auto;
    grid-row: auto;
    align-self: stretch;
  }

  .connection-disclosure {
    max-width: none;
    padding-right: 0;
  }

  .connection-disclosure p:first-child {
    white-space: normal;
  }

  .connection-subtitle-row {
    max-width: none;
  }

  .session-pill {
    width: 100%;
  }

  .control-band {
    grid-template-columns: 1fr;
  }

  body[data-strategy="csp"] .control-band {
    grid-template-columns: 1fr;
  }

  body[data-strategy="csp"][data-csp-input-mode="manual"] .control-band {
    grid-template-columns: 1fr;
  }

  body[data-strategy="csp"] .control-band > .csp-control:first-child,
  body[data-strategy="csp"] .return-field,
  body[data-strategy="csp"] .csp-screener-control,
  body[data-strategy="csp"] .source-control,
  body[data-strategy="csp"] #runButton,
  body[data-strategy="csp"] #exportButton {
    grid-column: auto;
  }

  body[data-strategy="csp"][data-csp-input-mode="manual"] .source-control,
  body[data-strategy="csp"][data-csp-input-mode="manual"] #runButton,
  body[data-strategy="csp"][data-csp-input-mode="manual"] #exportButton {
    grid-column: auto;
  }

  body[data-strategy="cc"] .control-band {
    grid-template-columns: 1fr;
  }

  body[data-strategy="cc"] .return-field,
  body[data-strategy="cc"] .source-control,
  body[data-strategy="cc"] #runButton,
  body[data-strategy="cc"] #exportButton {
    grid-column: auto;
  }

  .connection-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .connection-actions .secondary-button {
    width: 100%;
  }

  .summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .flow-diagram {
    grid-template-columns: 1fr;
  }

  .flow-node {
    min-height: 58px;
  }

  .flow-arrow {
    line-height: 1;
    text-align: center;
    transform: rotate(90deg);
  }

  .glossary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .content-grid,
  .article-grid,
  .calculator-grid,
  .footer-inner,
  .footer-columns {
    grid-template-columns: 1fr;
  }

  .helper-hero {
    grid-template-columns: 1fr;
  }

  .helper-hero-action {
    justify-self: stretch;
  }

  .helper-hero-action .primary-button {
    width: 100%;
  }

  .calculator-fields,
  .calculator-fields.two-up {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .check-control {
    align-items: flex-start;
    white-space: normal;
  }

  .table-wrap {
    overflow-x: visible;
  }

  table,
  thead,
  tbody,
  tr,
  td {
    display: block;
    width: 100%;
  }

  thead {
    display: none;
  }

  tbody tr {
    border-bottom: 1px solid var(--line);
    padding: 10px 14px;
  }

  tbody tr:last-child {
    border-bottom: 0;
  }

  th,
  td,
  th:nth-child(n),
  td:nth-child(n) {
    width: 100%;
  }

  td {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    border-bottom: 0;
    padding: 8px 0;
    text-align: right;
    font-size: 0.94rem;
  }

  td::before {
    flex: 0 0 auto;
    color: var(--muted);
    content: attr(data-label);
    font-size: 0.74rem;
    font-weight: 850;
    text-transform: uppercase;
  }

  td.highlight-column::before {
    color: var(--ink);
    font-weight: 800;
  }

  td:nth-child(2),
  td:nth-child(3) {
    text-align: right;
  }

  .cc-symbol-cell {
    grid-template-columns: 28px minmax(0, 1fr);
  }

  .manual-symbol-cell {
    width: min(100%, 240px);
    grid-template-columns: 28px minmax(0, 1fr);
  }

  .cc-symbol-input,
  .manual-csp-symbol-input,
  .cc-average-cost-input,
  .cc-contracts-input {
    width: 100%;
    max-width: none;
  }

  .empty-cell {
    display: block;
    text-align: center;
  }

  .empty-cell::before {
    content: "";
  }
}

@media (max-width: 540px) {
  body {
    font-size: 15px;
  }

  .home-shell {
    width: min(100% - 24px, 1180px);
    padding: 24px 0;
  }

  .command-logo {
    width: 66px;
    height: 66px;
    border-radius: 18px;
  }

  .command-title {
    font-size: clamp(1.72rem, 7.2vw, 2.1rem);
    line-height: 1.02;
    white-space: normal;
  }

  .command-actions {
    gap: 10px;
  }

  .command-card {
    min-width: 142px;
    min-height: 46px;
    padding: 11px 16px;
    font-size: 0.95rem;
  }

  .app-shell {
    width: min(100% - 18px, 1760px);
    padding-top: 16px;
  }

  .connection-band,
  .control-band,
  .table-header {
    padding: 14px;
  }

  .topbar {
    gap: 18px;
    padding-top: 18px;
    padding-bottom: 18px;
  }

  .title-block {
    gap: 4px;
  }

  .title-subtitle {
    font-size: 0.94rem;
  }

  input[type="number"],
  input[type="email"],
  input[type="text"],
  select,
  .primary-button,
  .secondary-button {
    min-height: 48px;
  }

  .summary-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .segmented {
    grid-auto-flow: column;
  }

  .screener-select-row {
    grid-template-columns: 1fr;
  }

  .segment {
    padding: 0 8px;
    font-size: 0.94rem;
    min-height: 42px;
    border-right: 0;
    border-bottom: 0;
  }

  .csp-input-mode-control .segment,
  .cc-input-mode-control .segment {
    font-size: 0.9rem;
  }

  .segment:last-child {
    border-bottom: 0;
  }

  .onboarding-content,
  .guide-section {
    padding: 16px;
  }

  .onboarding-actions,
  .onboarding-actions .primary-button,
  .onboarding-actions .secondary-button,
  .name-row,
  .topbar-actions,
  .topbar-actions .secondary-button,
  .topbar-actions .guide-link-button,
  .topbar-actions .session-pill,
  .strategy-tabs {
    width: 100%;
  }

  .name-row {
    align-items: stretch;
    flex-direction: column;
  }

  .glossary-grid,
  .troubleshooting-list,
  .calculator-fields,
  .calculator-fields.two-up {
    grid-template-columns: 1fr;
  }

  .site-footer,
  .simple-page .site-footer {
    padding-left: 18px;
    padding-right: 18px;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .form-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .form-actions .primary-button {
    width: 100%;
  }
}
