.insurance-evidence-page #main .production-shell h1 {
  max-width: none;
  font-size: clamp(1.65rem, 1.4rem + 1vw, 2.25rem);
  line-height: 1.15;
  letter-spacing: -.035em;
}

.insurance-evidence-page #main .production-shell h2 {
  font-size: clamp(1.15rem, 1.06rem + .35vw, 1.4rem);
  letter-spacing: -.02em;
  margin: 0 0 .6rem;
}

.insurance-evidence-page #main .production-shell h3 {
  margin: 1.35rem 0 .5rem;
  font-size: .92rem;
}

.production-shell {
  color: #18202b;
}

html[data-theme="dark"] .production-shell {
  color: #eaf2ff;
}

.production-shell p {
  max-width: 72ch;
}

.app-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 0 0 1.5rem;
  border-bottom: 1px solid #bbc5ce;
}

html[data-theme="dark"] .app-header {
  border-color: #465363;
}

.kicker {
  margin: 0 0 .55rem;
  color: #1f68d8;
  font: 700 .75rem/1.4 "JetBrains Mono", ui-monospace, monospace;
  letter-spacing: .11em;
  text-transform: uppercase;
}

html[data-theme="dark"] .kicker {
  color: #7bb2ff;
}

.subhead,
.section-head p,
.work-card > p,
.boundary-card > p,
.auth-card p {
  color: #536273;
}

html[data-theme="dark"] .subhead,
html[data-theme="dark"] .section-head p,
html[data-theme="dark"] .work-card > p,
html[data-theme="dark"] .boundary-card > p,
html[data-theme="dark"] .auth-card p {
  color: #a9b7c8;
}

.role-block {
  display: grid;
  grid-template-columns: .65rem minmax(7.5rem, 1fr) auto;
  align-items: center;
  gap: .7rem;
  min-width: 15rem;
  padding: .8rem .9rem;
  border: 1px solid #bbc5ce;
  background: #f7f9fa;
}

html[data-theme="dark"] .role-block {
  border-color: #465363;
  background: #242c36;
}

.role-block small,
.role-block strong {
  display: block;
}

.role-block small {
  color: #536273;
  font-size: .75rem;
}

html[data-theme="dark"] .role-block small {
  color: #a9b7c8;
}

.status-dot {
  width: .55rem;
  height: .55rem;
  border-radius: 50%;
  background: #167047;
}

.app-layout {
  display: grid;
  grid-template-columns: minmax(12.5rem, .25fr) minmax(0, 1fr);
  gap: 1.5rem;
  padding-top: 1.5rem;
}

.app-sidebar {
  min-width: 0;
}

.app-sidebar nav {
  display: grid;
  border: 1px solid #bbc5ce;
  background: #f7f9fa;
}

html[data-theme="dark"] .app-sidebar nav {
  border-color: #465363;
  background: #242c36;
}

.app-sidebar nav button {
  min-height: 46px;
  padding: .7rem .85rem;
  border: 0;
  border-bottom: 1px solid #d7dde3;
  background: transparent;
  text-align: left;
  font-size: .88rem;
  font-weight: 650;
}

html[data-theme="dark"] .app-sidebar nav button {
  border-color: #3a4654;
}

.app-sidebar nav button:last-child {
  border-bottom: 0;
}

.app-sidebar nav button.active {
  background: #e6effc;
  box-shadow: inset 3px 0 #1f68d8;
  color: #123f82;
}

html[data-theme="dark"] .app-sidebar nav button.active {
  background: #18324f;
  color: #dceaff;
}

.custody-card {
  margin-top: 1rem;
  padding: 1rem;
  border: 1px solid #bbc5ce;
  background: #fff;
}

html[data-theme="dark"] .custody-card {
  border-color: #465363;
  background: #202832;
}

.custody-card h2 {
  font-size: .9rem !important;
}

.custody-card dl,
.detail-list {
  margin: 0;
}

.custody-card dl div,
.detail-list div {
  padding: .65rem 0;
  border-top: 1px solid #d7dde3;
}

html[data-theme="dark"] .custody-card dl div,
html[data-theme="dark"] .detail-list div {
  border-color: #3a4654;
}

.custody-card dt,
.detail-list dt {
  color: #536273;
  font-size: .74rem;
}

html[data-theme="dark"] .custody-card dt,
html[data-theme="dark"] .detail-list dt {
  color: #a9b7c8;
}

.custody-card dd,
.detail-list dd {
  margin: .15rem 0 0;
  overflow-wrap: anywhere;
  font-size: .8rem;
  font-weight: 650;
}

.app-content {
  min-width: 0;
}

.section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.25rem;
  margin-bottom: 1rem;
}

.section-head.compact {
  margin-bottom: .5rem;
}

.section-head p {
  margin: .35rem 0 0;
}

.work-card,
.boundary-card,
.result-card,
.empty-card,
.auth-card {
  border: 1px solid #bbc5ce;
  background: #f7f9fa;
  padding: 1.25rem;
}

html[data-theme="dark"] .work-card,
html[data-theme="dark"] .boundary-card,
html[data-theme="dark"] .result-card,
html[data-theme="dark"] .empty-card,
html[data-theme="dark"] .auth-card {
  border-color: #465363;
  background: #242c36;
}

.work-card + .work-card,
.work-card + .boundary-card,
.result-card + .work-card,
.result-card + .two-column,
.two-column + .work-card,
.portfolio-metrics + .work-card,
.portfolio-metrics + .two-column,
.two-column + .boundary-card {
  margin-top: 1rem;
}

.two-column {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(18rem, .75fr);
  gap: 1rem;
}

.two-column > * {
  min-width: 0;
}

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

.production-shell label {
  display: grid;
  gap: .35rem;
  color: #354252;
  font-size: .82rem;
  font-weight: 700;
}

.auth-card label {
  display: grid;
  gap: .35rem;
  color: #354252;
  font-size: .82rem;
  font-weight: 700;
}

html[data-theme="dark"] .auth-card label {
  color: #d7e0ea;
}

.auth-card input,
.auth-card select {
  width: 100%;
  min-width: 0;
  min-height: 44px;
  border: 1px solid #9ca9b6;
  border-radius: 2px;
  background: #fff;
  padding: .62rem .7rem;
}

html[data-theme="dark"] .auth-card input,
html[data-theme="dark"] .auth-card select {
  border-color: #66778a;
  background: #151c24;
  color: #eaf2ff;
}

html[data-theme="dark"] .production-shell label {
  color: #d7e0ea;
}

.production-shell input,
.production-shell select,
.production-shell textarea {
  width: 100%;
  min-width: 0;
  min-height: 44px;
  border: 1px solid #9ca9b6;
  border-radius: 2px;
  background: #fff;
  padding: .62rem .7rem;
}

html[data-theme="dark"] .production-shell input,
html[data-theme="dark"] .production-shell select,
html[data-theme="dark"] .production-shell textarea {
  border-color: #66778a;
  background: #151c24;
  color: #eaf2ff;
}

.production-shell textarea {
  min-height: 7rem;
  resize: vertical;
}

.production-shell input:disabled,
.production-shell select:disabled {
  opacity: .65;
}

.form-actions {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: .65rem;
  align-items: center;
  margin-top: .4rem;
}

.production-shell .primary,
.production-shell .quiet,
.production-shell .danger {
  min-height: 44px;
  padding: .65rem .9rem;
  border: 1px solid transparent;
  border-radius: 2px;
  font-weight: 700;
}

.production-shell .primary {
  color: #fff;
  background: #1f68d8;
}

.production-shell .quiet {
  color: #18202b;
  border-color: #9ca9b6;
  background: #fff;
}

html[data-theme="dark"] .production-shell .quiet {
  color: #eaf2ff;
  border-color: #66778a;
  background: #202832;
}

.production-shell .danger {
  color: #fff;
  background: #a63832;
}

.production-shell button:disabled {
  opacity: .45;
}

.source-profile pre,
.work-card pre {
  max-height: 24rem;
  overflow: auto;
  padding: .85rem;
  background: #18202b;
  color: #f7f9fa;
  font: .75rem/1.55 "JetBrains Mono", ui-monospace, monospace;
  white-space: pre-wrap;
}

html[data-theme="dark"] .source-profile pre,
html[data-theme="dark"] .work-card pre {
  background: #10161d;
}

.source-profile ul,
.work-card ul {
  padding-left: 1.1rem;
}

.history-card ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

.history-card li {
  display: grid;
  grid-template-columns: minmax(11rem, .35fr) 1fr;
  gap: 1rem;
  padding: .7rem 0;
  border-top: 1px solid #d7dde3;
  font-size: .82rem;
}

html[data-theme="dark"] .history-card li {
  border-color: #3a4654;
}

.history-card time,
code {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  overflow-wrap: anywhere;
}

.scenario-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .6rem;
}

.scenario-grid button {
  min-height: 88px;
  padding: .75rem;
  border: 1px solid #9ca9b6;
  background: #fff;
  text-align: left;
}

html[data-theme="dark"] .scenario-grid button {
  border-color: #66778a;
  background: #202832;
}

.scenario-grid button.selected {
  border-color: #1f68d8;
  background: #e6effc;
  box-shadow: inset 3px 0 #1f68d8;
}

html[data-theme="dark"] .scenario-grid button.selected {
  background: #18324f;
}

.scenario-grid strong,
.scenario-grid span {
  display: block;
}

.scenario-grid span {
  margin-top: .3rem;
  color: #536273;
  font-size: .76rem;
}

html[data-theme="dark"] .scenario-grid span {
  color: #a9b7c8;
}

.result-card {
  display: grid;
  grid-template-columns: minmax(14rem, .7fr) minmax(0, 1.3fr);
  gap: 1.25rem;
  background: #fff;
}

html[data-theme="dark"] .result-card {
  background: #202832;
}

.big-state {
  display: block;
  margin: .25rem 0 .65rem;
  font-size: clamp(1.35rem, 1.1rem + .8vw, 1.85rem);
  line-height: 1.2;
  text-transform: capitalize;
}

.big-state.satisfied,
.state.satisfied {
  color: #167047;
}

html[data-theme="dark"] .big-state.satisfied,
html[data-theme="dark"] .state.satisfied {
  color: #65dfad;
}

.big-state.not_satisfied,
.state.not_satisfied,
.big-state.indeterminate,
.state.indeterminate {
  color: #ad2921;
}

html[data-theme="dark"] .big-state.not_satisfied,
html[data-theme="dark"] .state.not_satisfied,
html[data-theme="dark"] .big-state.indeterminate,
html[data-theme="dark"] .state.indeterminate {
  color: #ffaaa5;
}

.state {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: .25rem .55rem;
  border: 1px solid currentColor;
  font: 700 .72rem/1.2 "JetBrains Mono", ui-monospace, monospace;
  text-transform: uppercase;
}

.state.missing {
  color: #854515;
}

html[data-theme="dark"] .state.missing {
  color: #ffc28c;
}

.metric-grid,
.portfolio-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border: 1px solid #bbc5ce;
}

html[data-theme="dark"] .metric-grid,
html[data-theme="dark"] .portfolio-metrics {
  border-color: #465363;
}

.metric-grid div,
.portfolio-metrics div {
  min-width: 0;
  padding: .8rem;
  border-right: 1px solid #d7dde3;
  border-bottom: 1px solid #d7dde3;
}

html[data-theme="dark"] .metric-grid div,
html[data-theme="dark"] .portfolio-metrics div {
  border-color: #3a4654;
}

.metric-grid div:nth-child(4n),
.portfolio-metrics div:last-child {
  border-right: 0;
}

.metric-grid span,
.portfolio-metrics span {
  display: block;
  color: #536273;
  font-size: .72rem;
}

html[data-theme="dark"] .metric-grid span,
html[data-theme="dark"] .portfolio-metrics span {
  color: #a9b7c8;
}

.metric-grid strong,
.portfolio-metrics strong {
  display: block;
  margin-top: .15rem;
  font-size: 1.15rem;
}

.separation-note {
  grid-column: 1 / -1;
  margin: 0;
  padding-top: .8rem;
  border-top: 1px solid #d7dde3;
  color: #536273;
  font-size: .8rem;
}

html[data-theme="dark"] .separation-note {
  border-color: #3a4654;
  color: #a9b7c8;
}

.empty-card {
  text-align: left;
  padding: 2rem;
}

.inline-form {
  display: flex;
  align-items: end;
  gap: .75rem;
}

.inline-form label {
  flex: 1;
}

.auth-form {
  display: grid;
  align-items: stretch;
  gap: .75rem;
}

.table-wrap {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  margin-top: 1rem;
}

.production-shell table {
  min-width: 42rem;
}

.production-shell th,
.production-shell td {
  padding: .7rem .65rem;
  border-bottom: 1px solid #d7dde3;
  text-align: left;
  vertical-align: top;
  font-size: .8rem;
}

html[data-theme="dark"] .production-shell th,
html[data-theme="dark"] .production-shell td {
  border-color: #3a4654;
}

.production-shell th {
  color: #536273;
}

html[data-theme="dark"] .production-shell th {
  color: #a9b7c8;
}

.table-link {
  min-height: 36px !important;
  padding: 0;
  color: #1f68d8 !important;
  text-align: left;
  text-decoration: underline;
  text-underline-offset: 3px;
}

html[data-theme="dark"] .table-link {
  color: #7bb2ff !important;
}

.tag {
  margin-left: .5rem;
  color: #536273;
  font: 700 .68rem/1 "JetBrains Mono", ui-monospace, monospace;
  text-transform: uppercase;
}

.boundary-card {
  margin-top: 1rem;
  background: #fff;
}

html[data-theme="dark"] .boundary-card {
  background: #202832;
}

.path-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  margin: 1rem 0;
  border: 1px solid #bbc5ce;
  background: #bbc5ce;
}

html[data-theme="dark"] .path-list {
  border-color: #465363;
  background: #465363;
}

.path-list a {
  display: grid;
  min-height: 76px;
  align-content: center;
  padding: .8rem;
  background: #f7f9fa;
  text-decoration: none;
}

html[data-theme="dark"] .path-list a {
  background: #242c36;
}

.path-list span {
  color: #536273;
  font-size: .78rem;
}

html[data-theme="dark"] .path-list span {
  color: #a9b7c8;
}

.auth-card {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(18rem, .8fr);
  gap: 2rem;
  width: min(100%, 960px);
  margin: 4rem auto;
  padding: 1.75rem;
}

.landing-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
}

.sample-actions {
  margin-block: 1.25rem;
}

.sample-inputs,
.sample-preview .two-column + .work-card,
.sample-preview .work-card + .result-card,
.optional-generation {
  margin-top: 1rem;
}

.sample-preview details,
.optional-generation summary {
  margin-top: .75rem;
}

.sample-preview summary,
.optional-generation summary {
  min-height: 44px;
  padding-block: .65rem;
  font-weight: 700;
  cursor: pointer;
}

.optional-generation summary {
  margin-top: 0;
}

.sample-preview pre {
  overflow-wrap: anywhere;
}

.sample-preview .big-state.satisfied {
  color: #1f68d8;
}

html[data-theme="dark"] .sample-preview .big-state.satisfied {
  color: #7bb2ff;
}

.app-feedback {
  margin: 0 0 1rem;
  padding: .75rem .9rem;
  border: 1px solid currentColor;
  background: #fff;
  font-weight: 650;
}

html[data-theme="dark"] .app-feedback {
  background: #202832;
}

.app-feedback.good,
.check-result.good {
  color: #167047;
}

.app-feedback.bad,
.check-result.bad {
  color: #ad2921;
}

html[data-theme="dark"] .app-feedback.good,
html[data-theme="dark"] .check-result.good {
  color: #65dfad;
}

html[data-theme="dark"] .app-feedback.bad,
html[data-theme="dark"] .check-result.bad {
  color: #ffaaa5;
}

.check-result {
  margin-top: .8rem;
  font-weight: 700;
}

.file-label input {
  padding: .45rem;
}

.split-fields {
  display: grid;
  grid-template-columns: 1fr 8rem;
  gap: .7rem;
  margin-top: .7rem;
}

#challenge-form,
#correction-form,
#loss-form {
  display: grid;
  gap: .7rem;
  margin-top: .8rem;
}

.supporting-loss-panel {
  margin-top: 1rem;
}

.supporting-loss-record {
  padding: 1rem;
  border: 1px solid #d7dde3;
  background: #f7f9fb;
}

.supporting-loss-record + .supporting-loss-record {
  margin-top: .85rem;
}

.supporting-loss-record h3,
.supporting-loss-record h4 {
  margin: .2rem 0 .7rem;
}

.review-boundary-list {
  margin-top: .6rem;
}

html[data-theme="dark"] .supporting-loss-record {
  border-color: #3a4654;
  background: #18202a;
}

#correction-form {
  padding-top: 1rem;
  border-top: 1px solid #d7dde3;
}

html[data-theme="dark"] #correction-form {
  border-color: #3a4654;
}

.portfolio-metrics {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  background: #f7f9fa;
}

html[data-theme="dark"] .portfolio-metrics {
  background: #242c36;
}

@media (max-width: 920px) {
  .app-layout,
  .two-column,
  .auth-card {
    grid-template-columns: 1fr;
  }

  .app-sidebar nav {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .app-sidebar nav button {
    border-right: 1px solid #d7dde3;
  }

  .custody-card {
    display: none;
  }

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

@media (max-width: 620px) {
  .app-header,
  .section-head,
  .inline-form {
    align-items: stretch;
    flex-direction: column;
  }

  .role-block {
    min-width: 0;
  }

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

  .form-grid,
  .scenario-grid,
  .result-card,
  .path-list {
    grid-template-columns: 1fr;
  }

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

  .metric-grid div:nth-child(2n) {
    border-right: 0;
  }

  .history-card li {
    grid-template-columns: 1fr;
    gap: .25rem;
  }

  .production-shell .primary,
  .production-shell .quiet,
  .production-shell .danger,
  .auth-card .primary,
  .auth-card .quiet {
    width: 100%;
  }

  .auth-form label {
    width: 100%;
  }
}
.production-shell :is(button, a, input, select, textarea, summary):focus-visible,
.auth-card :is(button, a, input, select, textarea):focus-visible {
  outline: 3px solid #0b57b7;
  outline-offset: 3px;
}

html[data-theme="dark"] .production-shell :is(button, a, input, select, textarea, summary):focus-visible,
html[data-theme="dark"] .auth-card :is(button, a, input, select, textarea):focus-visible {
  outline-color: #9bc5ff;
}
