:root {
  color-scheme: light;
  --ink: #16191d;
  --ink-soft: #252b31;
  --muted: #66717a;
  --muted-light: #8a949c;
  --line: #d9dfe3;
  --line-dark: #bdc6cc;
  --surface: #ffffff;
  --canvas: #f4f6f7;
  --wash: #f8f9fa;
  --openai: #10a37f;
  --openai-soft: #e9f7f3;
  --aws: #ff9900;
  --blue: #3273a8;
  --red: #b23b33;
  font-family:
    Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-width: 1180px;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--canvas);
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
}

.global-header {
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.global-header__inner,
.app-shell,
.global-footer > div {
  width: 1260px;
  margin: 0 auto;
}

.global-header__inner {
  display: flex;
  height: 72px;
  align-items: center;
  justify-content: space-between;
}

.brand-lockup {
  display: inline-flex;
  height: 46px;
  align-items: center;
  color: inherit;
  text-decoration: none;
}

.brand-lockup__aws {
  width: 48px;
  height: 39px;
  object-fit: contain;
}

.brand-lockup__openai {
  width: 74px;
  height: 34px;
  object-fit: contain;
}

.brand-lockup__cross {
  margin: 0 12px;
  color: #69727a;
  font-size: 19px;
}

.brand-lockup__rule {
  width: 1px;
  height: 28px;
  margin: 0 16px;
  background: var(--line);
}

.brand-lockup__product {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0;
}

.header-meta {
  display: flex;
  gap: 18px;
  align-items: center;
}

.provider-label {
  color: var(--muted);
  font-size: 11px;
}

.service-state {
  display: inline-flex;
  height: 30px;
  padding: 0 10px;
  gap: 7px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 3px;
  color: var(--muted);
  background: var(--wash);
  font-size: 11px;
}

.service-state__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #aeb6bc;
}

.service-state__dot.is-online {
  background: var(--openai);
  box-shadow: 0 0 0 3px var(--openai-soft);
}

.service-state__dot.is-offline {
  background: var(--red);
}

.app-shell {
  padding: 34px 0 40px;
}

.page-heading {
  display: flex;
  min-height: 122px;
  align-items: flex-start;
  justify-content: space-between;
}

.page-heading__index {
  display: block;
  margin-bottom: 8px;
  color: var(--openai);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0;
}

.page-heading h1 {
  margin: 0;
  font-size: 28px;
  line-height: 1.25;
  letter-spacing: 0;
}

.page-heading p {
  margin: 9px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.scope-summary {
  display: grid;
  grid-template-columns: repeat(3, 132px);
  margin: 5px 0 0;
  border-top: 1px solid var(--ink);
}

.scope-summary div {
  padding: 10px 12px 0 0;
}

.scope-summary dt {
  margin-bottom: 5px;
  color: var(--muted-light);
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
}

.scope-summary dd {
  margin: 0;
  font-size: 11px;
  font-weight: 650;
}

.workbench {
  display: grid;
  grid-template-columns: 520px 1fr;
  overflow: hidden;
  min-height: 674px;
  border: 1px solid var(--line-dark);
  border-radius: 4px;
  background: var(--surface);
}

.request-pane {
  padding: 24px 26px 26px;
  border-right: 1px solid var(--line);
  background: var(--surface);
}

.result-pane {
  display: flex;
  min-width: 0;
  flex-direction: column;
  background: var(--wash);
}

.pane-heading {
  display: flex;
  height: 58px;
  gap: 12px;
  align-items: center;
  border-bottom: 1px solid var(--line);
}

.pane-heading__number {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border: 1px solid var(--ink);
  border-radius: 3px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 10px;
  font-weight: 700;
}

.pane-heading h2 {
  margin: 0;
  font-size: 15px;
  letter-spacing: 0;
}

.pane-heading p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 10px;
}

.pane-heading--result {
  height: 83px;
  padding: 0 24px;
  background: var(--surface);
}

.result-actions {
  display: flex;
  margin-left: auto;
  gap: 6px;
}

.icon-button {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: var(--surface);
}

.icon-button:hover:not(:disabled) {
  border-color: var(--line-dark);
  background: var(--canvas);
}

.icon-button:disabled {
  opacity: 0.38;
}

.icon-button img {
  width: 15px;
  height: 15px;
}

#recommendationForm {
  padding-top: 22px;
}

.field-block {
  margin-bottom: 20px;
}

.field-label,
.priority-field legend,
.select-field,
.usage-section legend,
.usage-grid label {
  color: #31383e;
  font-size: 11px;
  font-weight: 700;
}

.field-label {
  display: flex;
  margin-bottom: 8px;
  justify-content: space-between;
}

.field-label span {
  color: var(--openai);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 9px;
}

textarea,
select,
.number-input {
  border: 1px solid var(--line-dark);
  border-radius: 3px;
  outline: none;
  color: var(--ink);
  background: var(--surface);
  transition:
    border-color 140ms ease,
    box-shadow 140ms ease;
}

textarea {
  display: block;
  width: 100%;
  min-height: 151px;
  padding: 13px;
  resize: vertical;
  font-size: 12px;
  line-height: 1.6;
}

textarea::placeholder,
input::placeholder {
  color: #969fa6;
}

textarea:focus,
select:focus,
.number-input:focus-within {
  border-color: var(--openai);
  box-shadow: 0 0 0 2px rgba(16, 163, 127, 0.12);
}

.field-meta {
  display: flex;
  margin-top: 6px;
  justify-content: space-between;
  color: var(--muted-light);
  font-size: 9px;
}

.constraint-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin-bottom: 20px;
  gap: 12px;
}

.priority-field,
.usage-section {
  padding: 0;
  margin: 0;
  border: 0;
}

.priority-field legend,
.select-field {
  margin-bottom: 8px;
}

.segmented {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  overflow: hidden;
  border: 1px solid var(--line-dark);
  border-radius: 3px;
}

.segmented input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.segmented span {
  display: grid;
  height: 39px;
  place-items: center;
  border-right: 1px solid var(--line);
  color: var(--muted);
  background: var(--surface);
  font-size: 10px;
  font-weight: 650;
}

.segmented label:last-child span {
  border-right: 0;
}

.segmented input:checked + span {
  color: var(--ink);
  background: var(--openai-soft);
  box-shadow: inset 0 -2px 0 var(--openai);
}

.segmented input:focus-visible + span {
  outline: 2px solid var(--openai);
  outline-offset: -2px;
}

.select-field {
  display: block;
}

.select-wrap {
  position: relative;
  display: block;
  margin-top: 8px;
}

.select-wrap select {
  width: 100%;
  height: 41px;
  padding: 0 32px 0 10px;
  appearance: none;
  font-size: 10px;
}

.select-wrap img {
  position: absolute;
  top: 13px;
  right: 10px;
  width: 14px;
  height: 14px;
  pointer-events: none;
}

.usage-section {
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.usage-section legend {
  width: 100%;
  padding: 0;
}

.usage-section legend span,
.usage-section legend small {
  display: inline-block;
}

.usage-section legend small {
  margin-left: 6px;
  color: var(--muted-light);
  font-size: 9px;
  font-weight: 500;
}

.usage-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin-top: 10px;
  gap: 8px;
}

.usage-grid label {
  min-width: 0;
  color: var(--muted);
  font-size: 9px;
}

.number-input {
  display: flex;
  height: 39px;
  margin-top: 6px;
  align-items: center;
}

.number-input input {
  width: 100%;
  min-width: 0;
  height: 37px;
  padding: 0 7px;
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 10px;
}

.number-input i {
  padding-right: 7px;
  color: var(--muted-light);
  font-size: 8px;
  font-style: normal;
}

.primary-button {
  display: flex;
  width: 100%;
  height: 44px;
  padding: 0 15px;
  margin-top: 20px;
  align-items: center;
  justify-content: space-between;
  border: 0;
  border-radius: 3px;
  color: #fff;
  background: var(--ink);
  font-size: 11px;
  font-weight: 700;
}

.primary-button:hover {
  background: #30363c;
}

.primary-button:disabled {
  opacity: 0.55;
}

.primary-button img {
  width: 15px;
  height: 15px;
  filter: invert(1);
}

.primary-button.is-loading img {
  animation: spin 850ms linear infinite;
}

.result-body {
  display: flex;
  min-height: 328px;
  padding: 25px;
  align-items: stretch;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.empty-state,
.loading-state {
  width: 100%;
  margin: auto;
  text-align: center;
}

.decision-preview {
  width: 420px;
  padding: 16px 18px;
  margin: 0 auto 20px;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: var(--wash);
}

.decision-preview__axis {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 10px;
  align-items: center;
  color: var(--muted-light);
  font-size: 8px;
  text-transform: uppercase;
}

.decision-preview__axis i {
  height: 1px;
  background: var(--line-dark);
}

.decision-preview__models {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin-top: 13px;
  gap: 8px;
}

.model-node {
  display: grid;
  height: 52px;
  place-content: center;
  border: 1px solid var(--line);
  border-top-width: 3px;
  background: var(--surface);
}

.model-node--luna {
  border-top-color: var(--openai);
}

.model-node--terra {
  border-top-color: var(--blue);
}

.model-node--sol {
  border-top-color: var(--aws);
}

.model-node b,
.model-node small {
  display: block;
}

.model-node b {
  font-size: 10px;
}

.model-node small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 8px;
}

.empty-state h3,
.loading-state h3,
.error-state h3 {
  margin: 0;
  font-size: 13px;
  letter-spacing: 0;
}

.empty-state > p,
.loading-state p,
.error-state p {
  max-width: 470px;
  margin: 7px auto 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.6;
}

.loader {
  display: block;
  width: 26px;
  height: 26px;
  margin: 0 auto 15px;
  border: 2px solid var(--line);
  border-top-color: var(--openai);
  border-radius: 50%;
  animation: spin 850ms linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.recommendation {
  width: 100%;
}

.recommendation__meta {
  display: flex;
  margin-bottom: 16px;
  align-items: center;
  justify-content: space-between;
}

.recommendation__meta span {
  display: inline-flex;
  gap: 5px;
  align-items: center;
  color: var(--openai);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 9px;
  font-weight: 700;
}

.recommendation__meta img {
  width: 13px;
  height: 13px;
}

.recommendation__meta small {
  color: var(--muted-light);
  font-size: 8px;
}

#recommendationText {
  color: #2b3237;
  font-size: 11px;
  line-height: 1.75;
  white-space: pre-wrap;
}

.error-state {
  display: flex;
  width: 100%;
  padding: 16px;
  margin: auto;
  gap: 10px;
  align-items: flex-start;
  border: 1px solid #e6bcb8;
  border-radius: 3px;
  background: #fff5f4;
}

.error-state > img {
  width: 16px;
  height: 16px;
}

.error-state p {
  margin: 4px 0 0;
}

.price-reference {
  padding: 21px 24px 19px;
}

.price-reference__heading {
  display: flex;
  margin-bottom: 12px;
  align-items: flex-end;
  justify-content: space-between;
}

.price-reference__heading h3 {
  margin: 0;
  font-size: 12px;
}

.price-reference__heading p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 8px;
}

.price-source {
  color: var(--muted-light);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 8px;
}

.price-table {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: var(--surface);
}

.price-row {
  display: grid;
  grid-template-columns: 1.2fr 0.75fr 0.75fr 0.75fr 1fr;
  min-height: 36px;
  padding: 0 11px;
  align-items: center;
  border-bottom: 1px solid var(--line);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 9px;
}

.price-row:last-child {
  border-bottom: 0;
}

.price-row--header {
  min-height: 29px;
  color: var(--muted);
  background: #eef1f3;
  font-size: 8px;
  font-weight: 700;
}

.price-row--featured {
  background: #f4faf8;
}

.price-row--legacy {
  color: #5f6971;
  background: #fbfbfc;
}

.price-row strong {
  display: flex;
  gap: 7px;
  align-items: center;
}

.tier {
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

.tier--luna {
  background: var(--openai);
}

.tier--terra {
  background: var(--blue);
}

.tier--sol {
  background: var(--aws);
}

.tier--legacy {
  border: 1px solid #7b858d;
  background: transparent;
}

.price-note {
  display: flex;
  margin-top: 10px;
  gap: 6px;
  align-items: flex-start;
}

.price-note img {
  width: 12px;
  height: 12px;
  margin-top: 1px;
}

.price-note p {
  margin: 0;
  color: var(--muted);
  font-size: 8px;
  line-height: 1.5;
}

.global-footer {
  border-top: 1px solid var(--line);
  background: var(--surface);
}

.global-footer > div {
  display: flex;
  height: 50px;
  align-items: center;
  justify-content: space-between;
  color: var(--muted-light);
  font-size: 9px;
}

[hidden] {
  display: none !important;
}
