:root {
  color-scheme: light;
  --background: #fafafa;
  --surface: #ffffff;
  --surface-strong: #f4f4f5;
  --text: #0f0f0f;
  --muted: #71717a;
  --line: #e4e4e7;
  --primary: #16a34a;
  --primary-strong: #15803d;
  --active: #0f0f0f;
  --accent: #2563eb;
  --warning: #b45309;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 4px 16px rgba(0, 0, 0, 0.04);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--background);
  color: var(--text);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

button,
a,
input,
select,
textarea {
  transition:
    background-color 160ms ease,
    border-color 160ms ease,
    color 160ms ease,
    box-shadow 160ms ease;
}

.shell {
  width: min(1440px, 100%);
  margin: 0 auto;
  padding: 28px;
}

.workspace {
  min-height: calc(100vh - 56px);
  display: grid;
  gap: 24px;
  align-content: start;
}

.intro {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 430px);
  align-items: end;
  gap: 24px;
  padding: 10px 2px 0;
}

.brand {
  display: inline-flex;
  margin-bottom: 18px;
  color: var(--text);
  font-size: 2rem;
  font-weight: 900;
  letter-spacing: 0;
  line-height: 1;
  text-decoration: none;
}

.brand span:last-child {
  color: var(--primary);
}

.cheyx-word span {
  color: var(--primary);
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  max-width: 780px;
  font-size: clamp(2.4rem, 5vw, 5rem);
  line-height: 0.94;
  letter-spacing: 0;
}

.intro-copy {
  color: var(--muted);
  font-size: 1.02rem;
  line-height: 1.6;
}

.layout {
  display: grid;
  grid-template-columns: minmax(360px, 0.82fr) minmax(560px, 1.18fr);
  gap: 20px;
  align-items: start;
}

.panel {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.input-panel,
.results-panel {
  padding: 20px;
}

.panel-header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.panel-header h2 {
  font-size: 1.05rem;
}

.panel-header p {
  margin-top: 5px;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.45;
}

.icon-button {
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-strong);
  color: var(--muted);
  font-size: 1.4rem;
  line-height: 1;
}

.icon-button:hover {
  background: #ffffff;
  color: var(--text);
}

textarea {
  width: 100%;
  min-height: 260px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: #fbfdfe;
  color: var(--text);
  line-height: 1.55;
  outline: none;
}

textarea:focus,
input:focus,
select:focus {
  border-color: rgba(15, 15, 15, 0.72);
  box-shadow: 0 0 0 4px rgba(15, 15, 15, 0.08);
}

.control-stack {
  display: grid;
  gap: 16px;
  margin: 14px 0 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-strong);
  padding: 14px;
}

.context-panel {
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-strong);
}

.context-panel summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 48px;
  color: var(--text);
  font-weight: 850;
  cursor: pointer;
  padding: 0 14px;
}

.context-panel summary::marker {
  color: var(--muted);
}

.context-panel summary small {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 750;
  text-align: right;
}

.context-grid {
  display: grid;
  gap: 10px;
  border-top: 1px solid var(--line);
  padding: 14px;
}

.file-drop,
.doc-paste {
  display: grid;
  gap: 7px;
}

.file-drop span,
.doc-paste span {
  color: var(--muted);
  font-size: 0.83rem;
  font-weight: 800;
}

.file-drop input {
  width: 100%;
  border: 1px dashed #c7c7cc;
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
  padding: 12px;
}

.doc-paste textarea {
  min-height: 110px;
  padding: 12px;
}

#clearDocs {
  justify-self: start;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  font-weight: 800;
  padding: 0 13px;
}

#clearDocs:hover,
#shareLink:hover {
  border-color: #c7c7cc;
  background: #ffffff;
}

.action-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 14px;
}

#checkCost {
  min-height: 46px;
  border: 0;
  border-radius: 8px;
  background: var(--active);
  color: #fff;
  font-weight: 900;
  padding: 0 22px;
}

#checkCost:hover {
  background: #2a2a2a;
}

#estimateStatus {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 750;
}

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

.stats-grid div,
.summary-strip div {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-strong);
  padding: 12px;
}

.stats-grid div {
  border: 0;
  border-right: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  padding: 0 12px;
}

.stats-grid div:first-child {
  padding-left: 0;
}

.stats-grid div:last-child {
  border-right: 0;
  padding-right: 0;
}

.stats-grid span,
.summary-strip span {
  display: block;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 700;
}

.stats-grid strong,
.summary-strip strong {
  display: block;
  margin-top: 5px;
  font-size: 1.12rem;
}

.control-group {
  margin: 0;
  padding: 0;
  border: 0;
}

.control-group legend,
.range-row span,
.currency-grid span,
.custom-grid span {
  color: var(--muted);
  font-size: 0.83rem;
  font-weight: 800;
}

.segments {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-top: 8px;
}

.segments button {
  display: grid;
  align-content: center;
  min-height: 58px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  text-align: left;
  padding: 9px 10px;
}

.segments button:hover:not(.is-active),
.pill-group button:hover:not(.is-active),
.provider-grid label:hover {
  border-color: #c7c7cc;
  background: #ffffff;
}

.segments button span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.3;
  white-space: normal;
  word-break: break-word;
}

.segments .is-active {
  border-color: var(--active);
  background: var(--active);
  color: #ffffff;
}

.segments .is-active span {
  color: rgba(255, 255, 255, 0.55);
}

.use-case-segments {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.use-case-segments button {
  min-height: 36px;
  font-size: 0.78rem;
  font-weight: 800;
  padding: 7px 4px;
  text-align: center;
  white-space: normal;
  word-break: break-word;
  line-height: 1.3;
}

.provider-filter {
  border-top: 1px solid var(--line);
  padding-top: 2px;
}

.provider-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.provider-grid label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--text);
  font-size: 0.78rem;
  font-weight: 800;
  padding: 6px 10px;
}

.provider-grid label:has(input:focus-visible) {
  border-color: rgba(15, 15, 15, 0.72);
  box-shadow: 0 0 0 4px rgba(15, 15, 15, 0.08);
}

.provider-grid input {
  width: 14px;
  height: 14px;
  accent-color: var(--active);
}

.range-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 8px;
}

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

.currency-panel {
  margin: 18px 0 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-strong);
  padding: 14px;
}

.currency-panel legend {
  padding: 0 6px;
  color: var(--muted);
  font-size: 0.83rem;
  font-weight: 800;
}

.currency-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 10px;
}

.currency-grid label {
  display: grid;
  gap: 7px;
}

.currency-grid input,
.currency-grid select {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  padding: 0 11px;
  outline: none;
}

#currencyStatus {
  margin-top: 10px;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.4;
}

.custom-model {
  margin-top: 18px;
  border-top: 1px solid var(--line);
  padding-top: 16px;
}

.custom-model summary {
  color: var(--text);
  font-weight: 800;
  cursor: pointer;
}

.custom-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr 1fr auto;
  gap: 10px;
  align-items: end;
  margin-top: 14px;
}

.custom-grid label {
  display: grid;
  gap: 7px;
}

.custom-grid input {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 11px;
  outline: none;
}

.custom-grid button,
#copySummary {
  min-height: 42px;
  border: 0;
  border-radius: 8px;
  background: var(--text);
  color: #fff;
  font-weight: 800;
  padding: 0 16px;
}

.secondary-link {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-strong);
  color: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.88rem;
  font-weight: 800;
  line-height: 1;
  padding: 0 14px;
  text-decoration: none;
  white-space: nowrap;
}

.secondary-link:hover {
  border-color: #c7c7cc;
  background: #ffffff;
}

.summary-strip {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr;
  gap: 10px;
  margin-bottom: 16px;
}

.recommendation-panel {
  display: grid;
  grid-template-columns: 0.95fr 1fr 0.95fr;
  gap: 10px;
  margin-bottom: 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #ffffff;
  padding: 12px;
}

.recommendation-panel div {
  border-radius: 8px;
  background: var(--surface-strong);
  padding: 10px;
}

.recommendation-panel span {
  display: block;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 800;
}

.recommendation-panel strong {
  display: block;
  margin-top: 5px;
  font-size: 1rem;
}

.recommendation-panel p {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.5;
}

.tradeoff-box {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  border-top: 1px solid var(--line);
  padding-top: 10px;
}

.tradeoff-box div {
  background: #ffffff;
}

.tradeoff-box small {
  display: block;
  margin-top: 4px;
  color: var(--text);
  font-weight: 800;
}

.tradeoff-box p {
  grid-column: 1 / -1;
  margin: 0;
  color: var(--muted);
  font-size: 0.84rem;
}

.results-controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: end;
  margin-bottom: 16px;
}

.results-controls p {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.4;
}

.results-controls fieldset {
  margin: 0;
  padding: 0;
  border: 0;
}

.results-controls legend {
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
}

.pill-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pill-group button {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-strong);
  color: var(--text);
  font-weight: 800;
  padding: 8px 12px;
}

.pill-group button span {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 700;
}

.pill-group .is-active {
  border-color: var(--active);
  background: var(--active);
  color: #ffffff;
}

.pill-group .is-active span {
  color: rgba(255, 255, 255, 0.55);
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

th,
td {
  padding: 12px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
  overflow-wrap: anywhere;
}

th:nth-child(1),
td:nth-child(1) {
  width: 25%;
}

th:nth-child(2),
td:nth-child(2) {
  width: 27%;
}

th:nth-child(3),
td:nth-child(3),
th:nth-child(4),
td:nth-child(4) {
  width: 16%;
}

th:nth-child(5),
td:nth-child(5) {
  width: 16%;
}

.recommendation {
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.3;
}

th {
  background: var(--surface-strong);
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
}

tr:last-child td {
  border-bottom: 0;
}

td small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.72rem;
}

td a {
  color: var(--accent);
  font-weight: 700;
  text-decoration: none;
}

.money {
  display: grid;
  gap: 2px;
  line-height: 1.15;
}

.money span + span {
  color: var(--muted);
}

.model-cell {
  display: grid;
  gap: 4px;
}

.model-cell small {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.model-cell span {
  width: fit-content;
  border-radius: 999px;
  background: #dcfce7;
  color: var(--primary-strong);
  font-size: 0.72rem;
  font-weight: 800;
  padding: 4px 8px;
}

.is-cheapest {
  background: #f0fdf4;
}

.is-cheapest:hover td {
  background: #dcfce7;
}

.muted {
  color: var(--muted);
}

.notes {
  display: grid;
  gap: 8px;
  margin-top: 14px;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.55;
}

.footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 2px 4px;
  color: var(--muted);
  font-size: 0.88rem;
}

.footer-brand {
  color: var(--text);
  font-size: 1.25rem;
  font-weight: 900;
  text-decoration: none;
  white-space: nowrap;
}

.footer-brand span:last-child {
  color: var(--primary);
}

.footer p {
  flex: 1;
}

.footer a {
  color: var(--text);
  font-weight: 800;
  text-decoration: none;
}

.footer nav {
  display: flex;
  gap: 16px;
}

.footer-copy {
  color: var(--muted);
  font-size: 0.8rem;
  white-space: nowrap;
  margin: 0;
}

.compare-shell {
  max-width: 1280px;
}

.compare-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 24px;
  padding-top: 10px;
}

.compare-hero h1 {
  max-width: 720px;
  font-size: clamp(2.2rem, 4vw, 4.6rem);
  line-height: 0.98;
  text-wrap: balance;
}

.compare-hero-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.compare-overview {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--line);
}

.compare-overview div {
  min-height: 96px;
  padding: 18px;
  background: #ffffff;
}

.compare-overview span,
.compare-toolbar span {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.compare-overview strong {
  display: block;
  margin-top: 8px;
  font-size: 1rem;
  line-height: 1.28;
}

.compare-panel {
  padding: 18px;
}

.compare-toolbar {
  display: grid;
  grid-template-columns: minmax(260px, 1.4fr) repeat(3, minmax(150px, 0.75fr));
  gap: 12px;
  margin-bottom: 16px;
}

.compare-toolbar label {
  display: grid;
  gap: 7px;
}

.compare-toolbar input,
.compare-toolbar select {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--text);
  padding: 0 12px;
}

.compare-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.compare-table {
  min-width: 940px;
}

.compare-table th,
.compare-table td {
  vertical-align: top;
}

.compare-table td:nth-child(3) {
  max-width: 280px;
}

.muted-cell {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.74rem;
}

.compare-note {
  margin-top: 12px;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.5;
}

@media (max-width: 1060px) {
  .layout,
  .intro {
    grid-template-columns: 1fr;
  }

  .intro-copy {
    max-width: 720px;
  }
}

@media (max-width: 700px) {
  .shell {
    padding: 14px;
  }

  .workspace {
    min-height: calc(100vh - 28px);
  }

  h1 {
    font-size: 2.5rem;
  }

  .panel {
    box-shadow: 0 12px 36px rgba(19, 32, 43, 0.1);
  }

  .input-panel,
  .results-panel {
    padding: 14px;
  }

  .stats-grid,
  .summary-strip,
  .recommendation-panel,
  .results-controls,
  .segments,
  .use-case-segments,
  .currency-grid,
  .compare-overview,
  .compare-toolbar,
  .compare-hero,
  .custom-grid {
    grid-template-columns: 1fr;
  }

  .compare-hero-actions {
    justify-content: flex-start;
  }

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

  .stats-grid div {
    padding: 0 8px;
  }

  .stats-grid div:first-child {
    padding-left: 0;
  }

  .stats-grid div:last-child {
    padding-right: 0;
  }

  .panel-header {
    align-items: stretch;
  }

  .results-controls {
    align-items: stretch;
  }

  .action-row {
    align-items: stretch;
    flex-direction: column;
  }

  #checkCost {
    width: 100%;
  }

  .context-panel summary {
    align-items: start;
    flex-direction: column;
    justify-content: center;
    padding-block: 10px;
  }

  .context-panel summary small {
    text-align: left;
  }

  .footer {
    display: grid;
    gap: 10px;
  }

  .company-contact {
    grid-template-columns: 1fr;
    padding: 18px;
  }

  .company-contact a {
    width: 100%;
  }

  .contact-page {
    grid-template-columns: 1fr;
  }

  #copySummary {
    padding-inline: 12px;
  }

  table {
    min-width: 860px;
  }

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

  .use-case-segments {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .tradeoff-box {
    grid-template-columns: 1fr;
  }
}

/* ── Monthly projection panel ─────────────────────────── */

.monthly-panel {
  margin: 14px 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-strong);
  padding: 14px 16px;
}

.monthly-header {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
  align-items: start;
  margin-bottom: 12px;
}

.monthly-header h3 {
  margin: 0 0 3px;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
}

.monthly-header p {
  color: var(--muted);
  font-size: 0.82rem;
}

.runs-control {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  min-width: 180px;
}

.runs-label {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-size: 0.82rem;
  color: var(--muted);
  white-space: nowrap;
}

.runs-label strong {
  font-size: 1rem;
  font-weight: 800;
  color: var(--text);
  min-width: 40px;
  text-align: right;
}

.runs-control input[type="range"] {
  width: 100%;
  accent-color: var(--active);
}

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

.monthly-card {
  border-radius: 6px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  background: var(--surface);
}

.monthly-card__label {
  display: block;
  font-size: 0.75rem;
  color: var(--muted);
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.monthly-card__amount {
  display: block;
  font-size: 1.05rem;
  font-weight: 800;
  line-height: 1.2;
  word-break: break-all;
}

.monthly-card__sub {
  display: block;
  font-size: 0.75rem;
  color: var(--muted);
  margin-top: 3px;
}

.monthly-card--cheap .monthly-card__amount {
  color: var(--primary-strong);
}

.monthly-card--expensive .monthly-card__amount {
  color: #c0392b;
}

.monthly-card--saving {
  border-color: rgba(12, 124, 112, 0.35);
  background: rgba(12, 124, 112, 0.06);
}

.monthly-card--saving .monthly-card__amount {
  color: var(--primary-strong);
}

.monthly-empty {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 0.85rem;
}

@media (max-width: 900px) {
  .monthly-header {
    grid-template-columns: 1fr;
  }

  .runs-control {
    align-items: stretch;
    min-width: unset;
  }

  .runs-label {
    justify-content: space-between;
  }

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

/* ── Hover tooltip ───────────────────────────────────────────────────────── */

.cx-tooltip {
  position: fixed;
  z-index: 9999;
  max-width: 260px;
  background: #0f0f0f;
  color: #e4e4e7;
  font-size: 0.82rem;
  line-height: 1.55;
  padding: 10px 14px;
  border-radius: 8px;
  border: 1px solid #2a2a2a;
  pointer-events: none;
  opacity: 0;
  transition: opacity 120ms ease;
  box-shadow: 0 4px 16px rgba(0,0,0,0.25);
}

.cx-tooltip.visible {
  opacity: 1;
}

/* ── Install banner ──────────────────────────────────────────────────────── */

.install-banner {
  background: #0f0f0f;
  border-radius: 10px;
  padding: 14px 20px;
  margin-bottom: 8px;
}

.install-banner[hidden] {
  display: none;
}

/* ── Notify strip ────────────────────────────────────────────────────────── */

.notify-strip {
  background: var(--text);
  border-radius: 10px;
  padding: 14px 20px;
  margin-bottom: 4px;
}

.notify-inner {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}

.notify-text {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
  flex: 1;
  min-width: 200px;
}

.notify-text strong {
  color: #ffffff;
  font-size: 0.92rem;
  font-weight: 800;
  white-space: nowrap;
}

.notify-text span {
  color: rgba(255, 255, 255, 0.65);
  font-size: 0.85rem;
}

.notify-btn {
  display: inline-block;
  flex-shrink: 0;
  min-height: 40px;
  line-height: 40px;
  border-radius: 8px;
  background: #ffffff;
  color: var(--active) !important;
  font-weight: 800;
  font-size: 0.88rem;
  padding: 0 20px;
  text-decoration: none !important;
  white-space: nowrap;
}

.notify-btn:hover {
  background: #f4f4f5;
}

/* ── Company contact ─────────────────────────────────────────────────────── */

.company-contact {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 22px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #ffffff;
  box-shadow: var(--shadow);
  padding: 22px;
}

.company-contact span:first-child {
  display: block;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.company-contact h2 {
  font-size: 1.35rem;
  line-height: 1.15;
}

.company-contact p {
  max-width: 760px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.55;
}

.company-contact a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  border-radius: 8px;
  background: var(--active);
  color: #ffffff;
  font-weight: 900;
  padding: 0 20px;
  text-decoration: none;
  white-space: nowrap;
}

.company-contact a:hover {
  background: #2a2a2a;
}

.contact-shell {
  max-width: 980px;
}

.contact-page {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 28px;
  align-items: start;
  margin-top: 24px;
}

.contact-copy {
  padding-top: 10px;
}

.contact-copy h1 {
  font-size: clamp(2.6rem, 7vw, 5rem);
}

.contact-copy p:not(.eyebrow) {
  max-width: 520px;
  margin-top: 16px;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.6;
}

.contact-form {
  display: grid;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #ffffff;
  box-shadow: var(--shadow);
  padding: 22px;
}

.contact-form label {
  display: grid;
  gap: 7px;
}

.contact-form span {
  color: var(--muted);
  font-size: 0.83rem;
  font-weight: 800;
}

.contact-form input,
.contact-form textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdfe;
  color: var(--text);
  outline: none;
}

.contact-form input {
  min-height: 44px;
  padding: 0 12px;
}

.contact-form textarea {
  min-height: 150px;
  padding: 12px;
}

.contact-form button {
  min-height: 46px;
  border: 0;
  border-radius: 8px;
  background: var(--active);
  color: #ffffff;
  font-weight: 900;
  padding: 0 18px;
}

.contact-form button:hover {
  background: #2a2a2a;
}

.contact-form p {
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.45;
}

/* ── Referral CTA link ───────────────────────────────────────────────────── */

.referral-cta {
  display: inline-block;
  margin-left: 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--text) !important;
  background: var(--surface-strong);
  font-size: 0.72rem !important;
  font-weight: 800;
  padding: 3px 8px;
  text-decoration: none !important;
  white-space: nowrap;
}

.referral-cta:hover {
  background: var(--active);
  color: #ffffff !important;
}

/* ── Header actions (share + copy) ──────────────────────────────────────── */

.header-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

#shareLink {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-strong);
  color: var(--text);
  font-weight: 800;
  padding: 0 14px;
  font-size: 0.88rem;
}

#shareLink:hover {
  border-color: #c7c7cc;
  background: #ffffff;
}

/* ── Context window warning ──────────────────────────────────────────────── */

.ctx-warning {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 1px solid #f5c24a;
  border-radius: 6px;
  background: #fffbec;
  color: #7a5800;
  font-size: 0.78rem;
  font-weight: 800;
  padding: 5px 9px;
  white-space: nowrap;
}

/* ── Batch badge ─────────────────────────────────────────────────────────── */

.batch-badge {
  display: inline-block;
  border-radius: 999px;
  background: #eaf4ff;
  color: #1565c0;
  font-size: 0.68rem;
  font-weight: 800;
  padding: 3px 7px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* ── Cost history panel ──────────────────────────────────────────────────── */

.history-panel {
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-strong);
}

.history-panel summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 46px;
  color: var(--text);
  font-weight: 800;
  cursor: pointer;
  padding: 0 14px;
  font-size: 0.9rem;
}

.history-panel summary::marker {
  color: var(--muted);
}

.history-panel summary small {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 700;
}

#historyList {
  border-top: 1px solid var(--line);
  padding: 8px 0;
}

.history-entry {
  display: grid;
  grid-template-columns: 60px 1fr auto auto;
  gap: 10px;
  align-items: center;
  padding: 8px 14px;
  font-size: 0.82rem;
  border-bottom: 1px solid var(--line);
}

.history-entry:last-child {
  border-bottom: 0;
}

.history-time {
  color: var(--muted);
  font-size: 0.74rem;
  white-space: nowrap;
}

.history-prompt {
  color: var(--text);
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  min-width: 0;
}

.history-model {
  color: var(--text);
  font-weight: 800;
  white-space: nowrap;
}

.history-cost {
  font-weight: 800;
  color: var(--text);
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 5px;
}

.history-badge {
  display: inline-block;
  border-radius: 999px;
  background: #eaf4ff;
  color: #1565c0;
  font-size: 0.65rem;
  font-weight: 800;
  padding: 2px 6px;
  text-transform: uppercase;
}

.history-empty {
  padding: 12px 14px;
  color: var(--muted);
  font-size: 0.85rem;
  margin: 0;
}

/* ── CheyX dark product theme ─────────────────────────────────────────────── */

:root {
  color-scheme: dark;
  --background: #0f0f0f;
  --surface: #161616;
  --surface-strong: #0c0c0c;
  --text: #f7f7f7;
  --muted: #8a8a8a;
  --line: #252525;
  --primary: #16a34a;
  --primary-strong: #22c55e;
  --active: #ffffff;
  --accent: #60a5fa;
  --warning: #f59e0b;
  --shadow: none;
}

body {
  background:
    radial-gradient(circle at 50% -20%, rgba(22, 163, 74, 0.08), transparent 34rem),
    var(--background);
}

.panel,
.terms-wrap,
.company-contact,
.contact-form,
.compare-overview div,
.compare-panel {
  background: var(--surface);
  border-color: var(--line);
  box-shadow: none;
}

.terms-wrap {
  border: 1px solid var(--line);
  border-radius: 12px;
  margin-top: 28px;
  margin-bottom: 28px;
}

.control-stack,
.context-panel,
.currency-panel,
.custom-model,
.monthly-panel,
.recommendation-panel,
.history-panel,
.notify-strip,
.install-banner {
  background: #111111;
  border-color: var(--line);
}

textarea,
input,
select,
.custom-grid input,
.currency-grid input,
.currency-grid select,
.compare-toolbar input,
.compare-toolbar select,
.contact-form input,
.contact-form textarea {
  background: #0c0c0c;
  border-color: var(--line);
  color: var(--text);
}

textarea::placeholder,
input::placeholder {
  color: #555555;
}

textarea:focus,
input:focus,
select:focus {
  border-color: rgba(22, 163, 74, 0.52);
  box-shadow: 0 0 0 4px rgba(22, 163, 74, 0.12);
}

.icon-button,
#clearDocs,
.secondary-link,
#shareLink,
.pill-group button,
.segments button,
.provider-grid label,
.file-drop input,
.summary-strip div,
.stats-grid div,
.monthly-card,
.tradeoff-box div,
.history-entry,
.table-wrap,
.compare-table-wrap {
  background: #0c0c0c;
  border-color: var(--line);
  color: var(--text);
}

.icon-button:hover,
#clearDocs:hover,
#shareLink:hover,
.secondary-link:hover,
.segments button:hover,
.provider-grid label:hover,
.pill-group button:hover {
  background: #181818;
  border-color: #343434;
}

#checkCost,
#copySummary,
.custom-grid button,
.contact-form button,
.company-contact a {
  background: #ffffff;
  color: #0f0f0f;
}

#checkCost:hover,
#copySummary:hover,
.custom-grid button:hover,
.contact-form button:hover,
.company-contact a:hover {
  background: #e8e8e8;
}

.segments .is-active,
.pill-group .is-active {
  border-color: var(--primary);
  background: var(--primary);
  color: #ffffff;
}

.segments .is-active span,
.pill-group .is-active span {
  color: rgba(255, 255, 255, 0.65);
}

.provider-grid input,
.pricing-mode input {
  accent-color: var(--primary);
}

table {
  background: #0c0c0c;
}

th {
  background: #111111;
  color: #cfcfcf;
}

td {
  border-color: var(--line);
}

tbody tr:hover td {
  background: #151515;
}

.is-cheapest {
  background: rgba(22, 163, 74, 0.08);
}

.is-cheapest:hover td {
  background: rgba(22, 163, 74, 0.12);
}

.model-cell span {
  background: rgba(22, 163, 74, 0.12);
  color: var(--primary-strong);
}

.notify-strip,
.install-banner {
  color: #ffffff;
}

.notify-btn {
  background: #ffffff;
  color: #0f0f0f !important;
}

.notify-btn:hover {
  background: #e8e8e8;
}

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

.ctx-warning {
  background: rgba(245, 158, 11, 0.12);
  color: #fbbf24;
}

.history-saving,
.monthly-saving {
  background: rgba(96, 165, 250, 0.14);
  color: #93c5fd;
}

@media (max-width: 600px) {
  .history-entry {
    grid-template-columns: 50px 1fr auto;
  }

  .history-model {
    display: none;
  }

  .header-actions {
    flex-direction: column;
    gap: 6px;
  }
}


/* ═══════════════════════════════════════════════════════════════════════════
   Mobile optimisations  (≤ 600px)
   ═══════════════════════════════════════════════════════════════════════════ */

@media (max-width: 600px) {

  /* ── Results table → card layout ───────────────────────────────────────── */
  /* Override the desktop min-width that forces horizontal scrolling          */
  table       { min-width: unset !important; width: 100%; }
  .table-wrap { overflow: visible; }

  /* Hide column headers — labels come from the card structure instead */
  thead { display: none; }

  /* Each row becomes a 2-column card: info left, price right */
  tbody tr {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 2px 12px;
    padding: 12px 14px;
    border-bottom: 1px solid var(--line);
    background: transparent;
  }

  tbody tr td {
    display: block;
    border: none !important;
    padding: 0;
  }

  /* Col 1 — model name + provider badge */
  tbody td:nth-child(1) { grid-column: 1; grid-row: 1; }

  /* Col 2 — "Recommended for" label underneath model name */
  tbody td:nth-child(2) {
    grid-column: 1;
    grid-row: 2;
    font-size: 0.75rem;
    color: var(--muted);
  }

  /* Col 3 & 4 — individual input/output rates; too granular for mobile */
  tbody td:nth-child(3),
  tbody td:nth-child(4) { display: none; }

  /* Col 5 — total cost, right-aligned across both card rows */
  tbody td:nth-child(5) {
    grid-column: 2;
    grid-row: 1 / 3;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    text-align: right;
    white-space: nowrap;
  }

  tbody td:nth-child(5) strong,
  tbody td:nth-child(5) .money,
  tbody td:nth-child(5) .money span {
    white-space: nowrap;
    display: block;
  }

  /* Hide source / referral links inline — not useful in scan view */
  tbody td:nth-child(5) small { display: none; }

  /* Total cost number — slightly larger so it's scannable */
  tbody td:nth-child(5) strong { font-size: 1rem; }

  /* Show only USD in the price column — one readable line */
  tbody td:nth-child(5) .money {
    display: block;
  }
  tbody td:nth-child(5) .money span + span {
    display: none;
  }

  .model-cell strong { font-size: 0.88rem; }
  .model-cell small  { font-size: 0.74rem; }

  /* ── Results panel header ───────────────────────────────────────────────── */
  /* "Compare outputs" lives in footer nav too — remove from cramped header   */
  .header-actions .secondary-link { display: none; }

  #shareLink,
  #copySummary {
    font-size: 0.8rem;
    padding: 0 10px;
    min-height: 40px;
  }

  /* ── Notify strip — keep it one tight line ─────────────────────────────── */
  .notify-text span   { display: none; }           /* hide subtext on mobile  */
  .notify-inner       { gap: 10px; }
  .notify-btn {
    min-height: 36px;
    line-height: 36px;
    padding: 0 14px;
    font-size: 0.82rem;
  }

  /* ── Touch targets — 44px minimum ─────────────────────────────────────── */
  .segments button,
  .use-case-segments button,
  .pill-group button {
    min-height: 44px;
  }

  #checkCost { min-height: 48px; font-size: 1rem; }

  /* ── Summary strip — bigger numbers for quick scanning ─────────────────── */
  .summary-strip div  { padding: 10px 12px; }
  .summary-strip strong { font-size: 1rem; }

  /* ── Intro / hero section ───────────────────────────────────────────────── */
  .intro { gap: 8px; }
}


/* ═══════════════════════════════════════════════════════════════════════════
   Guided tour
   ═══════════════════════════════════════════════════════════════════════════ */

.cx-tour-highlight {
  position: fixed;
  z-index: 1000;
  border-radius: 8px;
  box-shadow: 0 0 0 4px #16a34a, 0 0 0 9999px rgba(0, 0, 0, 0.68);
  pointer-events: none;
  transition: top 0.32s ease, left 0.32s ease, width 0.32s ease, height 0.32s ease;
}

.cx-tour-card {
  position: fixed;
  z-index: 1001;
  background: #161616;
  border: 1px solid rgba(22, 163, 74, 0.5);
  border-radius: 14px;
  padding: 18px 20px 16px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.7);
  transition: top 0.32s ease, left 0.32s ease;
}

.cx-tour-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(22, 163, 74, 0.12);
  border: 1px solid rgba(22, 163, 74, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  margin-bottom: 10px;
}

.cx-tour-step {
  font-size: 10px;
  color: #16a34a;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  margin-bottom: 4px;
  font-family: 'Geist Mono', monospace;
}

.cx-tour-title {
  font-size: 15px;
  font-weight: 700;
  color: #f0f0f0;
  margin-bottom: 6px;
  letter-spacing: -0.01em;
}

.cx-tour-text {
  font-size: 13px;
  color: #888;
  line-height: 1.6;
  margin: 0 0 16px;
}

.cx-tour-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.cx-tour-dots {
  display: flex;
  gap: 5px;
  align-items: center;
}

.cx-tour-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #2a2a2a;
  transition: background 0.2s;
}

.cx-tour-dot.active {
  background: #16a34a;
}

.cx-tour-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.cx-tour-skip {
  font-size: 12px;
  color: #555;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  font-family: inherit;
  transition: color 0.15s;
}

.cx-tour-skip:hover { color: #888; }

.cx-tour-next {
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  background: #16a34a;
  border: none;
  border-radius: 7px;
  padding: 8px 18px;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s;
  white-space: nowrap;
}

.cx-tour-next:hover { background: #15803d; }
