:root {
  font-family: Inter, "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  color: #18293a;
  background: #f3f6f8;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  min-height: 100%;
  background: #f3f6f8;
}

body {
  min-width: 320px;
  min-height: 100%;
  margin: 0;
  background:
    radial-gradient(circle at 88% -10%, rgba(38, 126, 154, 0.1), transparent 30rem),
    #f3f6f8;
}

button,
input,
select {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

a {
  color: inherit;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1:focus,
h2:focus {
  outline: none;
}

.app-shell {
  display: flex;
  min-height: 100vh;
  flex-direction: column;
}

.topbar {
  position: sticky;
  z-index: 20;
  top: 0;
  display: grid;
  grid-template-columns: minmax(190px, 1fr) auto minmax(190px, 1fr);
  align-items: center;
  gap: 24px;
  min-height: 74px;
  padding: 11px clamp(20px, 4vw, 58px);
  color: #fff;
  background: rgba(20, 48, 72, 0.97);
  box-shadow: 0 8px 28px rgba(14, 37, 57, 0.18);
  backdrop-filter: blur(16px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  width: fit-content;
  text-decoration: none;
}

.brand-mark,
.loading-mark {
  display: inline-grid;
  width: 43px;
  height: 43px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 12px;
  color: #143048;
  background: #8ed6e9;
  font-weight: 850;
  letter-spacing: 0.04em;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.42);
}

.brand-copy strong,
.brand-copy small {
  display: block;
}

.brand-copy strong {
  font-size: 1.02rem;
}

.brand-copy small {
  margin-top: 2px;
  color: #bfd0dc;
  font-size: 0.73rem;
}

.primary-nav {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 4px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
}

.primary-nav a {
  padding: 9px 13px;
  border-radius: 8px;
  color: #cbd9e3;
  font-size: 0.82rem;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}

.primary-nav a:hover,
.primary-nav a.active {
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
}

.boundary-badge,
.health-pill {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  width: fit-content;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 750;
  white-space: nowrap;
}

.boundary-badge {
  justify-self: end;
  padding: 8px 11px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #d4e3eb;
}

.status-dot {
  width: 9px;
  height: 9px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #4bc487;
  box-shadow: 0 0 0 4px rgba(75, 196, 135, 0.12);
}

.workspace {
  width: min(1240px, calc(100% - 40px));
  margin: 0 auto;
  padding: clamp(32px, 5vw, 62px) 0 54px;
}

.app-footer {
  display: flex;
  justify-content: space-between;
  width: min(1240px, calc(100% - 40px));
  margin: auto auto 0;
  padding: 24px 0 30px;
  border-top: 1px solid #d9e2e8;
  color: #718391;
  font-size: 0.75rem;
}

.page-heading {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 36px;
  margin-bottom: 26px;
}

.page-heading h1 {
  max-width: 850px;
  margin-bottom: 15px;
  color: #143048;
  font-size: clamp(2.35rem, 5.5vw, 4.6rem);
  line-height: 0.99;
  letter-spacing: -0.05em;
}

.page-heading p {
  max-width: 760px;
  margin-bottom: 0;
  color: #566d7e;
  font-size: clamp(0.98rem, 1.7vw, 1.12rem);
  line-height: 1.68;
}

.compact-heading {
  align-items: center;
}

.compact-heading h1 {
  margin-bottom: 11px;
  font-size: clamp(2.15rem, 4vw, 3.45rem);
}

.eyebrow,
.metric-label,
.card-kicker,
.section-note {
  display: block;
  margin-bottom: 9px;
  color: #277995;
  font-size: 0.71rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.back-link {
  display: block;
  width: fit-content;
  margin-bottom: 20px;
  color: #4f7183;
  font-size: 0.82rem;
  font-weight: 700;
  text-decoration: none;
}

.back-link:hover {
  color: #1f6f8b;
}

.button {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  padding: 10px 17px;
  border: 1px solid transparent;
  border-radius: 10px;
  font-weight: 760;
  text-decoration: none;
  cursor: pointer;
  transition: transform 120ms ease, box-shadow 120ms ease, background 120ms ease;
}

.button:hover {
  transform: translateY(-1px);
}

.button-primary {
  color: #fff;
  background: #1f6f8b;
  box-shadow: 0 10px 22px rgba(31, 111, 139, 0.19);
}

.button-primary:hover {
  background: #185f78;
}

.button-quiet {
  min-height: 38px;
  padding: 8px 12px;
  border-color: #ccd9e0;
  color: #4f6676;
  background: #fff;
  box-shadow: none;
}

.status-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  overflow: hidden;
  margin: 30px 0 42px;
  border: 1px solid #d7e2e8;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 12px 34px rgba(20, 48, 72, 0.05);
}

.status-strip article {
  padding: 20px 24px;
}

.status-strip article + article {
  border-left: 1px solid #dfe7ec;
}

.status-strip strong,
.status-strip small {
  display: block;
}

.status-strip strong {
  margin-bottom: 3px;
  color: #17364f;
  font-size: 1.05rem;
}

.status-strip small {
  color: #758895;
  font-size: 0.77rem;
}

.metric-label {
  margin-bottom: 7px;
  color: #718591;
  font-size: 0.66rem;
}

.section-heading,
.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.section-heading {
  margin-bottom: 15px;
}

.section-heading h2,
.panel-heading h2 {
  margin-bottom: 0;
  color: #17364f;
  font-size: 1.3rem;
  letter-spacing: -0.02em;
}

.section-heading .eyebrow {
  margin-bottom: 4px;
}

.section-note {
  margin: 0;
  color: #7b8c98;
}

.workflow-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.workflow-card {
  display: flex;
  min-height: 280px;
  flex-direction: column;
  padding: 23px;
  border: 1px solid #d7e2e8;
  border-radius: 18px;
  color: inherit;
  background: #fff;
  box-shadow: 0 13px 34px rgba(20, 48, 72, 0.045);
  text-decoration: none;
}

.workflow-card-ready {
  border-color: #9ecad8;
  box-shadow: inset 0 4px 0 #2b809b, 0 16px 38px rgba(20, 48, 72, 0.07);
  transition: transform 140ms ease, box-shadow 140ms ease;
}

.workflow-card-ready:hover {
  transform: translateY(-3px);
  box-shadow: inset 0 4px 0 #2b809b, 0 20px 42px rgba(20, 48, 72, 0.11);
}

.workflow-icon {
  display: grid;
  width: 46px;
  height: 46px;
  margin-bottom: 25px;
  place-items: center;
  border-radius: 13px;
  color: #fff;
  background: #1f6f8b;
  font-size: 0.75rem;
  font-weight: 850;
  letter-spacing: 0.07em;
}

.workflow-icon-neutral {
  color: #4a687a;
  background: #e6eef2;
}

.workflow-card h3 {
  margin-bottom: 9px;
  color: #17364f;
  font-size: 1.18rem;
}

.workflow-card p {
  margin-bottom: 20px;
  color: #667b89;
  font-size: 0.9rem;
  line-height: 1.58;
}

.workflow-card .card-kicker {
  margin-bottom: 6px;
  font-size: 0.65rem;
}

.card-action,
.card-state {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  color: #1f6f8b;
  font-size: 0.8rem;
  font-weight: 800;
}

.card-state {
  color: #718591;
}

.panel {
  border: 1px solid #d7e2e8;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 15px 38px rgba(20, 48, 72, 0.055);
}

.migration-panel {
  margin-top: 22px;
  padding: 25px;
}

.health-pill {
  padding: 8px 12px;
  border: 1px solid #b9ddc9;
  color: #276244;
  background: #f2faf5;
}

.proof-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  margin-top: 24px;
  padding-top: 22px;
  border-top: 1px solid #e2e9ed;
}

.proof-grid > div {
  padding-right: 14px;
}

.proof-grid strong {
  display: block;
  margin-bottom: 7px;
  color: #28465c;
  font-size: 0.9rem;
}

.proof-grid p {
  margin: 0;
  color: #71838f;
  font-size: 0.82rem;
  line-height: 1.55;
}

.analysis-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(340px, 0.85fr);
  align-items: start;
  gap: 22px;
}

.analysis-form,
.result-panel {
  padding: clamp(22px, 3vw, 31px);
}

.form-heading > div,
.result-panel .panel-heading > div {
  display: flex;
  align-items: center;
  gap: 13px;
}

.panel-heading p {
  margin: 4px 0 0;
  color: #71838f;
  font-size: 0.8rem;
}

.step-number {
  display: grid;
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 11px;
  color: #1e6e89;
  background: #e6f2f5;
  font-size: 0.7rem;
  font-weight: 850;
  letter-spacing: 0.06em;
}

fieldset {
  margin: 28px 0 0;
  padding: 0;
  border: 0;
}

legend {
  width: 100%;
  margin-bottom: 14px;
  padding-bottom: 9px;
  border-bottom: 1px solid #e2e9ed;
  color: #36566b;
  font-size: 0.76rem;
  font-weight: 850;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 15px;
}

.field-grid-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.field-grid-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.field-span-2 {
  grid-column: span 2;
}

label > span {
  display: block;
  margin-bottom: 6px;
  color: #526b7b;
  font-size: 0.75rem;
  font-weight: 750;
}

label > small {
  display: block;
  margin-top: 5px;
  color: #86959f;
  font-size: 0.68rem;
}

input,
select {
  width: 100%;
  min-height: 43px;
  padding: 9px 11px;
  border: 1px solid #c9d6dd;
  border-radius: 9px;
  outline: none;
  color: #1e3749;
  background: #fbfcfd;
}

input:focus,
select:focus {
  border-color: #3987a1;
  box-shadow: 0 0 0 3px rgba(57, 135, 161, 0.13);
}

input.invalid,
select.invalid {
  border-color: #bd5d5d;
}

.comparison-grid {
  display: grid;
  grid-template-columns: minmax(100px, 0.72fr) repeat(2, minmax(0, 1fr));
  align-items: center;
  gap: 10px;
}

.comparison-grid strong {
  color: #567080;
  font-size: 0.73rem;
  text-align: center;
}

.comparison-grid > span {
  color: #4b6576;
  font-size: 0.78rem;
  font-weight: 750;
}

.form-actions {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-top: 30px;
  padding-top: 20px;
  border-top: 1px solid #e2e9ed;
}

.form-actions span {
  color: #7b8d98;
  font-size: 0.72rem;
}

.form-message,
.validation-summary {
  margin-top: 18px;
  padding: 11px 13px;
  border-radius: 9px;
  font-size: 0.8rem;
}

.form-message-error,
.validation-summary {
  border: 1px solid #ebc0c0;
  color: #7f3232;
  background: #fff5f5;
}

.validation-summary:empty {
  display: none;
}

.validation-summary ul {
  margin: 0;
  padding-left: 18px;
}

.results-column {
  position: sticky;
  top: 96px;
}

.result-empty {
  display: grid;
  min-height: 330px;
  place-items: center;
  align-content: center;
  padding: 35px;
  color: #708491;
  text-align: center;
}

.result-empty-mark {
  display: grid;
  width: 54px;
  height: 54px;
  margin-bottom: 15px;
  place-items: center;
  border: 1px solid #bfd5de;
  border-radius: 16px;
  color: #287a96;
  background: #edf6f8;
  font-size: 1.35rem;
  font-weight: 700;
}

.result-empty strong {
  color: #34566b;
}

.result-empty p {
  max-width: 290px;
  margin: 7px 0 0;
  font-size: 0.82rem;
  line-height: 1.55;
}

.decision-banner {
  margin-top: 23px;
  padding: 16px;
  border-radius: 12px;
}

.decision-banner span,
.decision-banner strong {
  display: block;
}

.decision-banner span {
  margin-bottom: 3px;
  font-size: 0.68rem;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.decision-banner strong {
  font-size: 0.94rem;
}

.decision-review {
  border: 1px solid #e6c68a;
  color: #78591f;
  background: #fff9ec;
}

.decision-clear {
  border: 1px solid #add9bf;
  color: #286043;
  background: #f1faf5;
}

.result-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 11px;
  margin-top: 13px;
}

.result-metrics article {
  padding: 15px;
  border: 1px solid #dee7eb;
  border-radius: 11px;
  background: #f8fafb;
}

.result-metrics span,
.result-metrics strong,
.result-metrics small {
  display: block;
}

.result-metrics span {
  color: #6b7f8c;
  font-size: 0.7rem;
  font-weight: 750;
}

.result-metrics strong {
  margin: 6px 0 2px;
  color: #17364f;
  font-size: 1.55rem;
  letter-spacing: -0.04em;
}

.result-metrics small {
  color: #748793;
  font-size: 0.7rem;
}

.result-table-wrap {
  overflow-x: auto;
  margin-top: 13px;
  border: 1px solid #dee7eb;
  border-radius: 11px;
}

.result-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.72rem;
  white-space: nowrap;
}

.result-table th,
.result-table td {
  padding: 10px;
  border-bottom: 1px solid #e6ecef;
  text-align: right;
}

.result-table th:first-child {
  text-align: left;
}

.result-table thead th {
  color: #71848f;
  background: #f6f8fa;
  font-size: 0.64rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.result-table tbody tr:last-child th,
.result-table tbody tr:last-child td {
  border-bottom: 0;
}

.result-detail {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid #e2e9ed;
}

.result-detail span,
.result-detail strong,
.result-detail small {
  display: block;
}

.result-detail span {
  color: #788b97;
  font-size: 0.67rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.result-detail strong {
  overflow: hidden;
  margin: 5px 0 2px;
  color: #2a485d;
  font-size: 0.82rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.result-detail small {
  color: #85949e;
  font-size: 0.69rem;
}

.boundary-panel {
  margin-top: 13px;
  padding: 17px 19px;
  border: 1px solid #d3dfe5;
  border-radius: 13px;
  color: #506a7a;
  background: #eaf0f3;
}

.boundary-panel strong {
  display: block;
  margin-bottom: 5px;
  color: #345268;
  font-size: 0.78rem;
}

.boundary-panel p {
  margin: 0;
  font-size: 0.73rem;
  line-height: 1.5;
}

.empty-state {
  max-width: 700px;
  margin: 40px auto;
  padding: clamp(30px, 6vw, 60px);
  text-align: center;
}

.empty-state .result-empty-mark {
  margin-right: auto;
  margin-left: auto;
}

.empty-state h1 {
  margin-bottom: 12px;
  color: #17364f;
  font-size: clamp(2rem, 5vw, 3.2rem);
}

.empty-state p {
  margin-bottom: 24px;
  color: #647b8a;
}

.loading-shell {
  display: flex;
  min-height: 100vh;
  align-items: center;
  justify-content: center;
  gap: 14px;
  color: #526b7b;
}

#blazor-error-ui {
  position: fixed;
  z-index: 1000;
  right: 20px;
  bottom: 20px;
  left: 20px;
  display: none;
  padding: 14px 48px 14px 18px;
  border: 1px solid #e2a9a9;
  border-radius: 10px;
  color: #6f1d1d;
  background: #fff1f1;
  box-shadow: 0 12px 36px rgba(75, 18, 18, 0.15);
}

#blazor-error-ui .reload {
  margin-left: 8px;
  font-weight: 700;
}

#blazor-error-ui .dismiss {
  position: absolute;
  top: 9px;
  right: 10px;
  border: 0;
  color: #6f1d1d;
  background: transparent;
  cursor: pointer;
}

@media (max-width: 1050px) {
  .topbar {
    grid-template-columns: 1fr auto;
  }

  .primary-nav {
    grid-column: 1 / -1;
    grid-row: 2;
    justify-self: center;
  }

  .boundary-badge {
    grid-column: 2;
    grid-row: 1;
  }

  .workflow-grid,
  .proof-grid {
    grid-template-columns: 1fr;
  }

  .workflow-card {
    min-height: 0;
  }

  .analysis-layout {
    grid-template-columns: 1fr;
  }

  .results-column {
    position: static;
  }
}

@media (max-width: 720px) {
  .topbar {
    gap: 10px;
    padding: 10px 15px;
  }

  .brand-copy small,
  .boundary-badge {
    display: none;
  }

  .primary-nav {
    width: 100%;
  }

  .primary-nav a {
    flex: 1;
    text-align: center;
  }

  .workspace,
  .app-footer {
    width: min(100% - 24px, 1240px);
  }

  .page-heading {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .page-heading .button,
  .compact-heading .health-pill {
    justify-self: start;
  }

  .status-strip {
    grid-template-columns: 1fr;
  }

  .status-strip article + article {
    border-top: 1px solid #dfe7ec;
    border-left: 0;
  }

  .section-heading,
  .panel-heading,
  .form-actions {
    align-items: flex-start;
  }

  .field-grid,
  .field-grid-2,
  .field-grid-3 {
    grid-template-columns: 1fr;
  }

  .field-span-2 {
    grid-column: auto;
  }

  .form-actions {
    flex-direction: column;
  }

  .form-actions .button {
    width: 100%;
  }

  .app-footer {
    flex-direction: column;
    gap: 5px;
  }
}

@media (max-width: 430px) {
  .brand-copy strong {
    font-size: 0.92rem;
  }

  .primary-nav a {
    padding: 8px 7px;
    font-size: 0.74rem;
  }

  .workspace {
    padding-top: 28px;
  }

  .comparison-grid {
    grid-template-columns: 82px repeat(2, minmax(0, 1fr));
    gap: 7px;
  }

  .comparison-grid input {
    padding-right: 7px;
    padding-left: 7px;
  }

  .result-metrics {
    grid-template-columns: 1fr;
  }
}
