html {
  font-size: 15px;
  min-height: 100%;
  position: relative;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  background: #f4f6f8;
  color: #20242a;
  font-family: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  margin-bottom: 64px;
}

.landing-shell {
  background: #080907;
  color: #f7f0e6;
  margin-bottom: 0;
  min-height: 100%;
}

.landing-shell a {
  color: #b9f5e5;
}

.landing-topbar {
  align-items: center;
  display: flex;
  gap: 18px;
  justify-content: space-between;
  left: 0;
  padding: 20px max(24px, calc((100vw - 1180px) / 2));
  position: absolute;
  right: 0;
  top: 0;
  z-index: 5;
}

.landing-brand,
.landing-nav {
  align-items: center;
  display: inline-flex;
}

.landing-brand {
  color: #f7f0e6;
  font-weight: 780;
  gap: 10px;
  text-decoration: none;
}

.landing-brand:hover {
  color: #ffffff;
}

.landing-mark {
  background: #05090b;
  border: 1px solid rgba(247, 240, 230, 0.36);
  border-radius: 7px;
  box-shadow: 0 0 18px rgba(87, 222, 205, 0.18);
  display: block;
  height: 34px;
  object-fit: cover;
  width: 34px;
}

.landing-nav {
  backdrop-filter: blur(16px);
  background: rgba(8, 9, 7, 0.7);
  border: 1px solid rgba(247, 240, 230, 0.22);
  border-radius: 8px;
  gap: 4px;
  padding: 4px;
}

.landing-nav a {
  border-radius: 6px;
  color: #f7f0e6;
  font-size: 0.88rem;
  font-weight: 720;
  padding: 8px 10px;
  text-decoration: none;
}

.landing-nav a:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

.landing-main {
  min-height: 100svh;
  overflow: hidden;
}

.landing-hero {
  align-items: center;
  display: grid;
  gap: 36px;
  grid-template-columns: minmax(0, 0.94fr) minmax(360px, 0.8fr);
  isolation: isolate;
  min-height: 86svh;
  padding: 112px max(24px, calc((100vw - 1180px) / 2)) 54px;
  position: relative;
}

.landing-hero::before {
  background-image:
    linear-gradient(90deg, rgba(8, 9, 7, 0.96) 0%, rgba(8, 9, 7, 0.74) 38%, rgba(8, 9, 7, 0.2) 68%, rgba(8, 9, 7, 0.78) 100%),
    linear-gradient(180deg, rgba(8, 9, 7, 0.26) 0%, rgba(8, 9, 7, 0) 44%, rgba(8, 9, 7, 0.92) 100%),
    url("/img/threshold-hero.png");
  background-position: center;
  background-size: cover;
  content: "";
  inset: 0;
  position: absolute;
  z-index: -2;
}

.landing-hero::after {
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(120deg, rgba(231, 108, 62, 0.16), rgba(87, 222, 205, 0.04) 45%, rgba(255, 190, 99, 0.12));
  background-size: 84px 84px, 84px 84px, 100% 100%;
  content: "";
  inset: 0;
  mix-blend-mode: screen;
  opacity: 0.66;
  position: absolute;
  z-index: -1;
}

.landing-hero-inner {
  max-width: 680px;
  min-width: 0;
}

.landing-kicker {
  color: #f1915f;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  margin: 0 0 12px;
  text-transform: uppercase;
}

.landing-hero h1 {
  color: #fff8ed;
  font-size: 5rem;
  font-weight: 820;
  line-height: 0.96;
  margin: 0;
  text-shadow: 0 18px 42px rgba(0, 0, 0, 0.5);
}

.landing-copy {
  color: #e9dfcf;
  font-size: 1.24rem;
  line-height: 1.55;
  margin: 22px 0 0;
  max-width: 650px;
}

.landing-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 30px;
}

.landing-button {
  align-items: center;
  border-radius: 7px;
  display: inline-flex;
  font-weight: 780;
  justify-content: center;
  min-height: 44px;
  min-width: 148px;
  padding: 11px 16px;
  text-decoration: none;
}

.landing-button.primary {
  background: #ed7d45;
  border: 1px solid #ff9c69;
  box-shadow: 0 12px 28px rgba(237, 125, 69, 0.24);
  color: #140c08;
}

.landing-button.secondary {
  background: rgba(8, 9, 7, 0.5);
  border: 1px solid rgba(185, 245, 229, 0.46);
  color: #e8fff8;
}

.landing-button:hover {
  filter: brightness(1.08);
}

.landing-stage {
  display: grid;
  gap: 14px;
  justify-self: end;
  max-width: 460px;
  min-width: 0;
  perspective: 1200px;
  width: 100%;
}

.stage-screen {
  background:
    linear-gradient(110deg, rgba(10, 15, 16, 0.96), rgba(19, 23, 22, 0.82)),
    linear-gradient(90deg, rgba(87, 222, 205, 0.16), rgba(255, 190, 99, 0.09));
  border: 1px solid rgba(239, 232, 220, 0.18);
  border-radius: 8px;
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.42);
  min-height: 124px;
  overflow: hidden;
  padding: 18px;
  position: relative;
  transform: rotateY(-8deg);
}

.stage-screen::before {
  background: linear-gradient(90deg, #57decd, #ffbe63, #ed7d45);
  content: "";
  height: 3px;
  left: 0;
  position: absolute;
  right: 0;
  top: 0;
}

.stage-screen span,
.stage-screen strong,
.stage-screen em {
  display: block;
}

.stage-screen span,
.stage-screen em {
  font-family: Consolas, "Courier New", monospace;
  font-style: normal;
}

.stage-screen span {
  color: #57decd;
  font-size: 0.8rem;
  margin-bottom: 12px;
  text-transform: uppercase;
}

.stage-screen strong {
  color: #fff8ed;
  font-size: 1.32rem;
  line-height: 1.12;
}

.stage-screen em {
  color: #c9c0b2;
  font-size: 0.82rem;
  margin-top: 16px;
}

.map-screen {
  margin-left: 44px;
}

.map-screen::before {
  background: linear-gradient(90deg, #69c36d, #57decd);
}

.ai-screen {
  margin-left: 88px;
}

.ai-screen::before {
  background: linear-gradient(90deg, #ffbe63, #b889ff);
}

.showroom-band,
.systems-band {
  background: #0e0f0c;
  border-top: 1px solid rgba(247, 240, 230, 0.12);
  padding: 58px max(24px, calc((100vw - 1180px) / 2)) 68px;
}

.showroom-intro {
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(0, 0.82fr) minmax(260px, 0.46fr);
  margin-bottom: 24px;
}

.showroom-intro h2,
.systems-panel h2 {
  color: #fff8ed;
  font-size: 2.25rem;
  font-weight: 800;
  line-height: 1.08;
  margin: 0;
  max-width: 740px;
}

.showroom-intro p:not(.landing-kicker) {
  align-self: end;
  color: #c9c0b2;
  font-size: 1.02rem;
  line-height: 1.55;
  margin: 0;
}

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

.product-card {
  background:
    linear-gradient(145deg, rgba(19, 23, 22, 0.98), rgba(11, 13, 12, 0.98)),
    linear-gradient(90deg, rgba(87, 222, 205, 0.08), rgba(237, 125, 69, 0.1));
  border: 1px solid rgba(247, 240, 230, 0.13);
  border-radius: 8px;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.28);
  display: grid;
  gap: 12px;
  grid-column: span 2;
  min-height: 330px;
  min-width: 0;
  padding: 18px;
  position: relative;
}

.product-card::before {
  background: #57decd;
  content: "";
  height: 4px;
  left: 18px;
  position: absolute;
  right: 18px;
  top: 0;
}

.product-atlas::before {
  background: #69c36d;
}

.product-ai::before {
  background: #b889ff;
}

.product-circle::before {
  background: #20a7e0;
}

.product-news::before {
  background: #ffbe63;
}

.product-geo::before {
  background: #ed7d45;
}

.product-topline {
  align-items: center;
  display: flex;
  gap: 8px;
  justify-content: space-between;
}

.product-code,
.product-state {
  border-radius: 6px;
  display: inline-flex;
  font-size: 0.72rem;
  font-weight: 800;
  line-height: 1.2;
  padding: 5px 7px;
  text-transform: uppercase;
}

.product-code {
  background: rgba(247, 240, 230, 0.08);
  color: #efe8dc;
}

.product-state {
  background: rgba(87, 222, 205, 0.14);
  border: 1px solid rgba(87, 222, 205, 0.28);
  color: #9bf7e9;
}

.product-state.pending {
  background: rgba(255, 190, 99, 0.12);
  border-color: rgba(255, 190, 99, 0.3);
  color: #ffd499;
}

.product-card h3 {
  color: #fff8ed;
  font-size: 1.45rem;
  font-weight: 800;
  line-height: 1.12;
  margin: 6px 0 0;
}

.product-card p {
  color: #d1c8ba;
  font-size: 0.97rem;
  line-height: 1.55;
  margin: 0;
}

.product-card dl {
  display: grid;
  gap: 10px;
  margin: auto 0 0;
}

.product-card dl div {
  border-top: 1px solid rgba(247, 240, 230, 0.11);
  display: grid;
  gap: 3px;
  padding-top: 9px;
}

.product-card dt {
  color: #8a8277;
  font-size: 0.72rem;
  font-weight: 800;
  margin: 0;
  text-transform: uppercase;
}

.product-card dd {
  color: #f1eadf;
  font-size: 0.92rem;
  margin: 0;
  overflow-wrap: anywhere;
}

.product-link {
  align-items: center;
  background: rgba(247, 240, 230, 0.08);
  border: 1px solid rgba(247, 240, 230, 0.16);
  border-radius: 7px;
  color: #f7f0e6;
  display: inline-flex;
  font-weight: 780;
  justify-content: center;
  min-height: 40px;
  padding: 9px 12px;
  text-decoration: none;
}

.product-link:hover {
  background: rgba(247, 240, 230, 0.14);
  color: #ffffff;
}

.product-link.disabled {
  color: #9c9488;
}

.systems-band {
  background:
    linear-gradient(180deg, #0e0f0c, #080907 72%),
    linear-gradient(90deg, rgba(237, 125, 69, 0.12), rgba(87, 222, 205, 0.1));
  padding-bottom: 84px;
}

.systems-panel {
  border: 1px solid rgba(247, 240, 230, 0.13);
  border-radius: 8px;
  padding: 24px;
}

.systems-flow {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  margin-top: 24px;
}

.systems-flow div {
  background: rgba(247, 240, 230, 0.06);
  border: 1px solid rgba(247, 240, 230, 0.1);
  border-radius: 8px;
  min-height: 136px;
  padding: 15px;
}

.systems-flow strong {
  color: #ffbe63;
  display: block;
  font-size: 1.08rem;
  margin-bottom: 10px;
}

.systems-flow span {
  color: #d1c8ba;
  display: block;
  font-size: 0.94rem;
  line-height: 1.5;
}

a {
  color: #166d7a;
}

.btn:focus,
.btn:active:focus,
.btn-link.nav-link:focus,
.form-control:focus,
.form-check-input:focus,
button:focus,
input:focus {
  box-shadow: 0 0 0 0.15rem rgba(22, 109, 122, 0.2);
  outline: 2px solid transparent;
}

.app-nav {
  background: #ffffff;
  border-bottom: 1px solid #d9e0e7;
  box-shadow: 0 1px 12px rgba(32, 36, 42, 0.05);
}

.app-nav-inner {
  gap: 18px;
  min-height: 64px;
}

.brand-lockup {
  align-items: center;
  color: #20242a;
  display: inline-flex;
  font-weight: 750;
  gap: 10px;
}

.brand-lockup:hover {
  color: #20242a;
}

.brand-mark {
  background: #20242a;
  border: 1px solid #20242a;
  border-radius: 7px;
  display: block;
  height: 32px;
  object-fit: cover;
  width: 32px;
}

.app-tabs {
  background: #eef2f4;
  border: 1px solid #d9e0e7;
  border-radius: 8px;
  gap: 3px;
  margin-left: auto;
  padding: 3px;
}

.app-tabs .nav-link {
  border-radius: 6px;
  color: #4f5b66;
  font-size: 0.93rem;
  font-weight: 650;
  line-height: 1.2;
  padding: 8px 12px;
}

.app-tabs .nav-link:hover {
  background: #ffffff;
  color: #20242a;
}

.app-tabs .nav-link.active {
  background: #ffffff;
  box-shadow: 0 1px 4px rgba(32, 36, 42, 0.08);
  color: #20242a;
}

.navbar-toggler {
  border-color: #cbd4dc;
}

.navbar-toggler-icon {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%2832,36,42,.78%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

.app-container {
  max-width: 1180px;
}

.app-main {
  padding: 28px 0 36px;
}

.dashboard-header,
.page-header {
  align-items: end;
  display: flex;
  gap: 24px;
  justify-content: space-between;
  margin-bottom: 22px;
}

.dashboard-header h1,
.page-header h1 {
  font-size: 2rem;
  font-weight: 760;
  line-height: 1.1;
  margin: 0;
}

.dashboard-header > div,
.page-header > div {
  min-width: 0;
}

.page-summary {
  color: #5d6874;
  margin: 8px 0 0;
  max-width: 720px;
}

.eyebrow {
  color: #166d7a;
  font-size: 0.78rem;
  font-weight: 760;
  letter-spacing: 0;
  margin: 0 0 5px;
  text-transform: uppercase;
}

.test-form,
.source-form {
  align-items: end;
  background: #ffffff;
  border: 1px solid #d9e0e7;
  border-radius: 8px;
  box-shadow: 0 1px 6px rgba(32, 36, 42, 0.04);
  display: grid;
  gap: 10px;
  max-width: 100%;
  padding: 12px;
  width: 100%;
}

.test-form {
  grid-template-columns: minmax(170px, 220px) minmax(220px, 320px) auto;
}

.source-form {
  grid-template-columns: minmax(130px, 170px) minmax(170px, 220px) minmax(280px, 1fr) auto auto;
}

.field-group {
  color: #4f5b66;
  display: grid;
  font-size: 0.78rem;
  font-weight: 700;
  gap: 5px;
  margin: 0;
  min-width: 0;
}

.field-group input,
.test-form input,
.source-form input {
  background: #fbfcfd;
  border: 1px solid #cbd4dc;
  border-radius: 6px;
  color: #20242a;
  min-height: 38px;
  min-width: 0;
  padding: 8px 10px;
  width: 100%;
}

.source-hash input {
  font-family: Consolas, "Courier New", monospace;
  font-size: 0.86rem;
}

.primary-action,
.test-form button,
.source-form button {
  align-items: center;
  background: #166d7a;
  border: 1px solid #166d7a;
  border-radius: 6px;
  color: #ffffff;
  display: inline-flex;
  font-weight: 750;
  justify-content: center;
  min-height: 38px;
  padding: 8px 14px;
  white-space: nowrap;
}

.secondary-action {
  align-items: center;
  background: #eef2f4;
  border: 1px solid #cbd4dc;
  border-radius: 6px;
  color: #3d464f;
  display: inline-flex;
  font-weight: 750;
  justify-content: center;
  min-height: 38px;
  padding: 8px 14px;
  white-space: nowrap;
}

.primary-action:hover,
.test-form button:hover,
.source-form button:hover {
  background: #0f5964;
  border-color: #0f5964;
}

.secondary-action:hover {
  background: #e3e8ee;
  color: #20242a;
}

.compact-action {
  min-height: 32px;
  padding: 6px 10px;
}

.row-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.row-actions form {
  margin: 0;
}

.check-row {
  align-items: center;
  color: #3d464f;
  display: flex;
  font-weight: 650;
  gap: 7px;
  margin: 0;
  min-height: 38px;
  white-space: nowrap;
}

.check-row input {
  height: 16px;
  width: 16px;
}

.metric-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 22px;
  max-width: 100%;
}

.metric {
  background: #ffffff;
  border: 1px solid #d9e0e7;
  border-left: 4px solid #166d7a;
  border-radius: 8px;
  min-height: 118px;
  padding: 16px;
}

.metric:nth-child(2) {
  border-left-color: #3d7b4f;
}

.metric:nth-child(3) {
  border-left-color: #8a5d1f;
}

.metric:nth-child(4) {
  border-left-color: #7b4d88;
}

.metric span,
.metric em {
  color: #5d6874;
  display: block;
  font-size: 0.84rem;
  font-style: normal;
}

.metric strong {
  color: #20242a;
  display: block;
  font-size: 2rem;
  font-weight: 760;
  line-height: 1.05;
  margin: 8px 0 6px;
}

.data-section,
.operator-notes {
  background: #ffffff;
  border: 1px solid #d9e0e7;
  border-radius: 8px;
  box-shadow: 0 1px 6px rgba(32, 36, 42, 0.04);
  margin-top: 18px;
  max-width: 100%;
  min-width: 0;
  padding: 18px;
}

.section-title-row {
  align-items: center;
  display: flex;
  gap: 16px;
  justify-content: space-between;
  margin-bottom: 14px;
}

.section-title-row h2 {
  font-size: 1.12rem;
  font-weight: 760;
  line-height: 1.2;
  margin: 0;
}

.quiet-link {
  border: 1px solid #cbd4dc;
  border-radius: 6px;
  color: #3d464f;
  font-size: 0.88rem;
  font-weight: 700;
  line-height: 1.2;
  padding: 7px 10px;
  text-decoration: none;
}

.quiet-link:hover {
  background: #eef2f4;
  color: #20242a;
}

.table-wrap {
  max-width: 100%;
  overflow-x: auto;
  width: 100%;
}

.data-table {
  margin: 0;
  min-width: 760px;
}

.data-table thead th {
  border-bottom: 1px solid #cbd4dc;
  color: #5d6874;
  font-size: 0.76rem;
  font-weight: 760;
  text-transform: uppercase;
  white-space: nowrap;
}

.data-table tbody td {
  border-color: #e3e8ee;
  color: #2f3740;
  vertical-align: middle;
}

.data-table tbody tr:hover {
  background: #f7fafb;
}

.status-pill {
  background: #eef2f4;
  border: 1px solid #d9e0e7;
  border-radius: 999px;
  color: #3d464f;
  display: inline-flex;
  font-size: 0.78rem;
  font-weight: 720;
  line-height: 1.2;
  padding: 4px 8px;
  white-space: nowrap;
}

.status-pill.ok {
  background: #ebf6ef;
  border-color: #c8e3d0;
  color: #2d6b3f;
}

.status-pill.muted {
  background: #f1f2f4;
  border-color: #d9dde2;
  color: #68737f;
}

.status-pill.dispatch {
  background: #fff6e6;
  border-color: #ecd7a8;
  color: #745019;
}

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

.readiness-grid div {
  background: #f7fafb;
  border: 1px solid #e3e8ee;
  border-radius: 8px;
  min-height: 82px;
  padding: 12px;
}

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

.readiness-grid strong {
  color: #20242a;
  font-size: 0.94rem;
  margin-bottom: 6px;
}

.readiness-grid span {
  color: #5d6874;
  font-size: 0.88rem;
}

.mono-cell {
  font-family: Consolas, "Courier New", monospace;
  font-size: 0.86rem;
  max-width: 280px;
  overflow-wrap: anywhere;
}

.nowrap {
  white-space: nowrap;
}

.empty {
  color: #68737f;
  padding: 28px 12px;
  text-align: center;
}

.alert {
  border-radius: 8px;
  overflow-wrap: anywhere;
}

.app-footer {
  border-top: 1px solid #d9e0e7;
  bottom: 0;
  line-height: 60px;
  position: absolute;
  width: 100%;
}

@media (max-width: 900px) {
  body {
    overflow-x: hidden;
  }

  .landing-topbar {
    padding-left: 18px;
    padding-right: 18px;
  }

  .landing-hero {
    gap: 28px;
    grid-template-columns: 1fr;
    min-height: 84svh;
    padding: 104px 18px 48px;
  }

  .landing-hero-inner {
    max-width: 620px;
  }

  .landing-hero h1 {
    font-size: 3.4rem;
  }

  .landing-copy {
    font-size: 1.08rem;
  }

  .landing-stage {
    justify-self: stretch;
    max-width: 620px;
  }

  .stage-screen {
    transform: none;
  }

  .map-screen,
  .ai-screen {
    margin-left: 0;
  }

  .showroom-band,
  .systems-band {
    padding-left: 18px;
    padding-right: 18px;
  }

  .showroom-intro,
  .systems-flow {
    grid-template-columns: 1fr;
  }

  .showroom-intro h2,
  .systems-panel h2 {
    font-size: 1.8rem;
  }

  .product-card {
    grid-column: span 3;
  }

  .app-container {
    max-width: 100%;
    overflow-x: hidden;
    padding-left: 12px;
    padding-right: 12px;
    width: 100%;
  }

  .dashboard-header,
  .page-header {
    align-items: stretch;
    flex-direction: column;
    max-width: 100%;
    overflow-x: hidden;
  }

  .page-summary {
    max-width: 100%;
    overflow-wrap: anywhere;
  }

  .test-form,
  .source-form,
  .metric-grid,
  .readiness-grid {
    grid-template-columns: 1fr;
  }

  .metric {
    min-height: 0;
  }
}

@media (max-width: 575px) {
  .landing-topbar {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
  }

  .landing-nav {
    width: 100%;
  }

  .landing-nav a {
    flex: 1 1 0;
    text-align: center;
  }

  .landing-hero {
    min-height: auto;
    padding-top: 142px;
  }

  .landing-hero h1 {
    font-size: 2.72rem;
  }

  .landing-copy {
    font-size: 1rem;
  }

  .landing-button {
    width: 100%;
  }

  .landing-stage {
    display: none;
  }

  .showroom-band,
  .systems-band {
    padding-bottom: 46px;
    padding-top: 42px;
  }

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

  .product-card {
    grid-column: auto;
    min-height: 0;
  }

  .systems-panel {
    padding: 18px;
  }

  .app-tabs {
    align-items: stretch;
    background: transparent;
    border: 0;
    margin: 12px 0 0;
    padding: 0;
  }

  .app-tabs .nav-link {
    background: #eef2f4;
    margin-bottom: 4px;
  }

  .app-main {
    padding-top: 20px;
  }

  .data-section,
  .operator-notes {
    padding: 14px;
  }
}
