:root {
  --bg: #f5efe3;
  --bg-soft: rgba(255, 251, 245, 0.82);
  --panel: rgba(255, 255, 255, 0.72);
  --panel-strong: rgba(255, 255, 255, 0.92);
  --text: #12231f;
  --muted: #536560;
  --border: rgba(18, 35, 31, 0.1);
  --shadow: 0 22px 55px rgba(40, 64, 58, 0.12);
  --aiml: #ff7a00;
  --comet: #0d9488;
  --cloudflare: #f97316;
  --accent: #11352b;
  --accent-soft: #dff6eb;
  --warning: #7a2e2e;
  --warning-soft: #ffe5de;
  --ok: #1d5f4e;
  --ok-soft: #d8f5e9;
  --font-display: "Space Grotesk", sans-serif;
  --font-mono: "IBM Plex Mono", monospace;
  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 16px;
  --radius-sm: 12px;
}

* {
  box-sizing: border-box;
}

html {
  font-size: 16px;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(247, 178, 103, 0.22), transparent 28rem),
    radial-gradient(circle at top right, rgba(58, 199, 164, 0.2), transparent 30rem),
    linear-gradient(180deg, #fbf6eb 0%, #f4ebde 100%);
  font-family: var(--font-display);
}

button,
input {
  font: inherit;
}

.page-shell {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
}

.background-orb {
  position: fixed;
  border-radius: 999px;
  filter: blur(24px);
  opacity: 0.55;
  pointer-events: none;
  z-index: 0;
}

.orb-a {
  width: 26rem;
  height: 26rem;
  top: -8rem;
  right: -8rem;
  background: rgba(245, 129, 39, 0.22);
}

.orb-b {
  width: 24rem;
  height: 24rem;
  bottom: -8rem;
  left: -8rem;
  background: rgba(24, 159, 138, 0.16);
}

.background-grid {
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.28) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.28) 1px, transparent 1px);
  background-size: 4rem 4rem;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.65), transparent 75%);
  pointer-events: none;
  z-index: 0;
}

.app-root {
  position: relative;
  z-index: 1;
  width: min(1320px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 1.25rem 0 3rem;
}

.shell {
  display: grid;
  gap: 1rem;
}

.hero-band {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.94), rgba(245, 251, 248, 0.84)),
    radial-gradient(circle at top right, rgba(17, 53, 43, 0.08), transparent 40%);
}

.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(320px, 1fr);
  gap: 1rem;
  padding: 1.25rem;
  overflow: hidden;
  position: relative;
}

.hero::after {
  content: "";
  position: absolute;
  inset: auto 1rem 1rem auto;
  width: 14rem;
  height: 14rem;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(24, 159, 138, 0.14), transparent 70%);
  pointer-events: none;
}

.hero-copy {
  display: grid;
  gap: 0.9rem;
}

.eyebrow {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.hero h1,
.panel h2,
.panel h3 {
  margin: 0;
}

.hero h1 {
  font-size: clamp(2.1rem, 4vw, 4rem);
  line-height: 0.95;
  letter-spacing: -0.05em;
  max-width: 14ch;
}

.hero p {
  margin: 0;
  color: var(--muted);
  max-width: 62ch;
  line-height: 1.55;
}

.hero-tags,
.preset-row,
.quick-actions,
.badge-row,
.candidate-row,
.source-list,
.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.tag,
.badge,
.mini-chip,
.preset-pill,
.candidate-pill,
.legend-chip {
  border-radius: 999px;
  border: 1px solid rgba(18, 35, 31, 0.1);
  background: rgba(255, 255, 255, 0.66);
  padding: 0.5rem 0.85rem;
  font-size: 0.86rem;
  line-height: 1;
}

.hero-stats {
  display: grid;
  gap: 0.75rem;
}

.stat-card {
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.88), rgba(245, 249, 246, 0.92));
  border: 1px solid rgba(18, 35, 31, 0.1);
  padding: 1rem 1.05rem;
  min-height: 6.75rem;
  display: grid;
  gap: 0.35rem;
}

.stat-label {
  color: var(--muted);
  font-size: 0.86rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.stat-value {
  font-size: clamp(1.55rem, 3vw, 2.25rem);
  line-height: 1;
  letter-spacing: -0.05em;
}

.stat-subtext {
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.35;
}

.top-strip {
  display: grid;
  gap: 1rem;
  grid-template-columns: minmax(0, 1fr) auto;
  padding: 0.95rem 1rem;
  align-items: center;
}

.top-strip h2 {
  font-size: 1.15rem;
  letter-spacing: -0.03em;
}

.top-strip p {
  margin: 0.2rem 0 0;
  color: var(--muted);
}

.quick-actions {
  justify-content: flex-end;
}

.main-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: minmax(280px, 0.94fr) minmax(320px, 1.06fr);
  align-items: start;
}

.stack {
  display: grid;
  gap: 1rem;
}

.provider-panel,
.workload-panel,
.route-panel,
.combo-panel,
.note-panel {
  padding: 1rem;
}

.section-head {
  display: grid;
  gap: 0.35rem;
  margin-bottom: 0.95rem;
}

.section-head p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.provider-list,
.workload-list,
.route-list,
.combo-grid,
.source-stack {
  display: grid;
  gap: 0.9rem;
}

.provider-card,
.workload-card,
.route-card,
.source-card {
  background: var(--panel-strong);
  border-radius: var(--radius-lg);
  border: 1px solid rgba(18, 35, 31, 0.08);
  padding: 1rem;
}

.provider-card {
  position: relative;
  overflow: hidden;
}

.provider-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 0.42rem;
  background: var(--brand);
}

.provider-top,
.route-top,
.workload-top {
  display: flex;
  gap: 0.85rem;
  justify-content: space-between;
  align-items: flex-start;
}

.provider-top h3,
.workload-top h3,
.route-top h3 {
  font-size: 1.12rem;
}

.provider-top p,
.workload-top p,
.route-top p {
  margin: 0.3rem 0 0;
  color: var(--muted);
  line-height: 1.45;
}

.switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  width: 3.35rem;
  min-width: 3.35rem;
  height: 2rem;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}

.slider {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: rgba(18, 35, 31, 0.12);
  transition: background 160ms ease;
}

.slider::before {
  content: "";
  position: absolute;
  width: 1.45rem;
  height: 1.45rem;
  left: 0.28rem;
  top: 0.28rem;
  border-radius: 50%;
  background: white;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.12);
  transition: transform 160ms ease;
}

.switch input:checked + .slider {
  background: color-mix(in srgb, var(--brand) 74%, white 26%);
}

.switch input:checked + .slider::before {
  transform: translateX(1.34rem);
}

.provider-stats,
.route-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.7rem;
  margin: 0.95rem 0;
}

.mini-stat {
  border-radius: var(--radius-md);
  padding: 0.8rem 0.85rem;
  background: rgba(245, 248, 245, 0.95);
  border: 1px solid rgba(18, 35, 31, 0.06);
}

.mini-stat span {
  display: block;
  color: var(--muted);
  font-size: 0.82rem;
  margin-bottom: 0.35rem;
}

.mini-stat strong {
  font-size: 1rem;
}

.range-head {
  display: flex;
  justify-content: space-between;
  gap: 0.65rem;
  align-items: center;
  margin-bottom: 0.55rem;
}

.range-head span {
  color: var(--muted);
  font-size: 0.9rem;
}

.mono {
  font-family: var(--font-mono);
  letter-spacing: -0.02em;
}

input[type="range"] {
  width: 100%;
  accent-color: var(--brand, var(--accent));
}

.provider-footer,
.route-footer {
  margin-top: 0.95rem;
}

.workload-grid {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 0.95rem;
}

.field {
  display: grid;
  gap: 0.4rem;
}

.field label {
  color: var(--muted);
  font-size: 0.86rem;
}

.field input[type="number"] {
  border-radius: var(--radius-sm);
  border: 1px solid rgba(18, 35, 31, 0.12);
  background: rgba(255, 255, 255, 0.92);
  padding: 0.75rem 0.82rem;
  color: var(--text);
}

.field input[type="number"]:focus,
.action-button:focus,
.combo-card:focus {
  outline: 2px solid rgba(17, 53, 43, 0.18);
  outline-offset: 2px;
}

.quality-block {
  margin-top: 1rem;
  padding: 0.9rem;
  border-radius: var(--radius-md);
  background: rgba(245, 248, 245, 0.95);
  border: 1px solid rgba(18, 35, 31, 0.06);
}

.quality-meta {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: baseline;
  margin-bottom: 0.5rem;
}

.quality-meta span {
  color: var(--muted);
  font-size: 0.9rem;
}

.quality-meta strong {
  font-size: 1.25rem;
}

.route-card {
  border: 1px solid rgba(18, 35, 31, 0.08);
}

.route-card.is-gap {
  border-color: rgba(122, 46, 46, 0.18);
  background: linear-gradient(180deg, rgba(255, 245, 241, 0.92), rgba(255, 255, 255, 0.92));
}

.route-price {
  font-size: 1.25rem;
  letter-spacing: -0.04em;
}

.route-note {
  margin: 0.8rem 0 0;
  color: var(--muted);
  line-height: 1.5;
}

.candidate-pill {
  background: rgba(245, 248, 245, 0.92);
}

.candidate-pill.is-selected {
  background: var(--accent-soft);
  border-color: rgba(17, 53, 43, 0.12);
}

.candidate-pill.is-ineligible {
  opacity: 0.62;
  text-decoration: line-through;
}

.combo-grid {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.combo-card {
  display: grid;
  gap: 0.85rem;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(18, 35, 31, 0.08);
  background: var(--panel-strong);
  padding: 1rem;
  text-align: left;
  cursor: pointer;
  transition:
    transform 160ms ease,
    box-shadow 160ms ease,
    border-color 160ms ease;
}

.combo-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 18px 35px rgba(40, 64, 58, 0.12);
}

.combo-card.is-active {
  border-color: rgba(17, 53, 43, 0.24);
  box-shadow: 0 18px 35px rgba(40, 64, 58, 0.16);
  background: linear-gradient(180deg, rgba(230, 247, 239, 0.92), rgba(255, 255, 255, 0.96));
}

.combo-card.is-invalid {
  background: linear-gradient(180deg, rgba(255, 245, 241, 0.92), rgba(255, 255, 255, 0.96));
}

.combo-name {
  font-size: 1rem;
  font-weight: 700;
}

.combo-cost {
  font-size: 1.45rem;
  letter-spacing: -0.05em;
}

.combo-meta,
.note-list {
  display: grid;
  gap: 0.42rem;
  color: var(--muted);
}

.status-good,
.status-gap {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  width: fit-content;
  border-radius: 999px;
  padding: 0.48rem 0.82rem;
  font-size: 0.84rem;
  border: 1px solid rgba(18, 35, 31, 0.08);
}

.status-good {
  background: var(--ok-soft);
  color: var(--ok);
}

.status-gap {
  background: var(--warning-soft);
  color: var(--warning);
}

.action-button,
.preset-pill {
  border: 1px solid rgba(18, 35, 31, 0.12);
  border-radius: 999px;
  padding: 0.72rem 1rem;
  background: rgba(255, 255, 255, 0.8);
  color: var(--text);
  cursor: pointer;
  transition:
    background 160ms ease,
    transform 160ms ease,
    border-color 160ms ease;
}

.action-button:hover,
.preset-pill:hover {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.94);
}

.action-button.is-primary {
  background: var(--accent);
  color: white;
  border-color: rgba(17, 53, 43, 0.16);
}

.action-button.is-primary:hover {
  background: #0e2d25;
}

.preset-pill.is-active {
  background: var(--accent-soft);
  border-color: rgba(17, 53, 43, 0.12);
}

.source-card a {
  color: var(--accent);
  text-decoration: none;
}

.source-card a:hover {
  text-decoration: underline;
}

.source-meta {
  margin-top: 0.75rem;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.5;
}

.legend {
  margin-top: 0.8rem;
}

.legend-chip {
  background: rgba(245, 248, 245, 0.92);
}

.workspace {
  padding: 1rem;
  background:
    linear-gradient(180deg, rgba(19, 40, 35, 0.96), rgba(17, 30, 28, 0.94)),
    radial-gradient(circle at top left, rgba(255, 170, 92, 0.12), transparent 30rem);
  color: #f4efe3;
  border-color: rgba(255, 255, 255, 0.08);
}

.workspace .eyebrow,
.workspace .footer-note,
.workspace .route-note {
  color: rgba(244, 239, 227, 0.78);
}

.workspace-head {
  display: grid;
  gap: 1rem;
  margin-bottom: 1rem;
}

.tool-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.tool-tab,
.ghost-button,
select {
  font: inherit;
}

.tool-tab {
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.06);
  color: #f4efe3;
  border-radius: 999px;
  padding: 0.75rem 1rem;
  cursor: pointer;
  transition:
    transform 160ms ease,
    background 160ms ease,
    border-color 160ms ease;
}

.tool-tab:hover,
.ghost-button:hover {
  transform: translateY(-1px);
}

.tool-tab.is-active {
  background: #f4efe3;
  color: #132823;
  border-color: transparent;
}

.tool-panels {
  display: grid;
}

.tool-panel {
  display: none;
  gap: 1rem;
}

.tool-panel.is-active {
  display: grid;
}

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

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

.field-grid.three-up {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.compact-grid {
  align-items: end;
}

.field {
  display: grid;
  gap: 0.55rem;
}

.field.full-span {
  grid-column: 1 / -1;
}

.field span {
  font-size: 0.9rem;
  color: rgba(244, 239, 227, 0.78);
}

textarea,
input,
select {
  width: 100%;
  border-radius: 18px;
  border: 1px solid rgba(18, 35, 31, 0.12);
  background: rgba(255, 251, 245, 0.96);
  color: var(--text);
  padding: 0.9rem 1rem;
  resize: vertical;
  outline: none;
}

textarea:focus,
input:focus,
select:focus {
  border-color: rgba(17, 53, 43, 0.3);
  box-shadow: 0 0 0 3px rgba(223, 246, 235, 0.4);
}

.calc-result {
  display: grid;
  max-width: 24rem;
}

.todo-list {
  display: grid;
  gap: 0.75rem;
}

.memory-card {
  display: grid;
  gap: 0.8rem;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 18px;
  padding: 1rem;
}

.todo-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.8rem;
  align-items: center;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 18px;
  padding: 0.85rem 1rem;
}

.todo-row span {
  color: #f4efe3;
}

.todo-row.is-done span {
  text-decoration: line-through;
  color: rgba(244, 239, 227, 0.54);
}

.ghost-button {
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  background: transparent;
  color: #f4efe3;
  padding: 0.5rem 0.8rem;
  cursor: pointer;
}

.empty-state {
  border: 1px dashed rgba(255, 255, 255, 0.16);
  border-radius: 18px;
  padding: 1rem;
  color: rgba(244, 239, 227, 0.78);
}

.mini-link-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.mini-link {
  display: inline-flex;
  align-items: center;
  padding: 0.72rem 1rem;
  border-radius: 999px;
  text-decoration: none;
  color: var(--accent);
  background: rgba(223, 246, 235, 0.72);
  border: 1px solid rgba(17, 53, 43, 0.12);
}

.mini-link:hover {
  background: rgba(223, 246, 235, 0.94);
}

.tool-page-workspace {
  padding: 1rem;
}

.footer-note {
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.5;
}

.launch-card,
.cluster-card,
.money-card,
.language-card {
  align-content: start;
}

.launch-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.panel-lite {
  padding: 1rem;
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid rgba(18, 35, 31, 0.08);
}

.inline-path {
  margin-top: 0.35rem;
  letter-spacing: 0.04em;
}

.provider-top,
.workload-top,
.route-top {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 1rem;
  margin-bottom: 1rem;
}

.provider-stats,
.route-stats,
.workload-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.provider-panel,
.workload-panel,
.route-panel,
.combo-panel,
.note-panel {
  padding: 1rem;
}

@media (max-width: 1120px) {
  .hero,
  .main-grid,
  .top-strip {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 760px) {
  .app-root {
    width: min(100% - 1rem, 1320px);
    padding: 0.5rem 0 2rem;
  }

  .hero,
  .provider-panel,
  .workload-panel,
  .route-panel,
  .combo-panel,
  .note-panel {
    padding: 0.9rem;
  }

  .hero h1 {
    max-width: none;
    font-size: clamp(2rem, 12vw, 3rem);
  }

  .provider-stats,
  .route-stats,
  .workload-grid,
  .field-grid,
  .field-grid.two-up,
  .field-grid.three-up {
    grid-template-columns: 1fr;
  }

  .provider-top,
  .workload-top,
  .route-top,
  .workspace-head {
    flex-direction: column;
  }

  .todo-row {
    grid-template-columns: auto 1fr;
  }

  .ghost-button {
    grid-column: 1 / -1;
  }
}
