:root {
  --deep-green: #12695c;
  --dark-green: #12695c;
  --emerald: #70eb94;
  --light-green: #ddffda;
  --white: #ffffff;
  --grey-100: #f7f8f8;
  --grey-200: #e2e2e2;
  --grey-300: #c9c9c9;
  --grey-500: #6d6d6d;
  --support-lilac: #f0f0ff;
  --text: var(--deep-green);
  --muted: var(--grey-500);
  --panel: rgba(255, 255, 255, 0.96);
  --panel-border: rgba(2, 46, 52, 0.1);
  --shadow: 0 24px 60px rgba(2, 46, 52, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  font-size: 16px;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Montserrat", sans-serif;
  color: var(--text);
  background: linear-gradient(180deg, #fafafa 0%, #ffffff 100%);
  overflow-x: hidden;
}

.topbar {
  background: transparent;
  border-bottom: 0;
}

.topbar-inner {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  min-height: 28px;
}

.shell {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  padding: 20px 0 88px;
}

.hero {
  margin-bottom: 40px;
  display: block;
}

.hero-copy {
  padding-top: 12px;
  max-width: 920px;
}

.card-label {
  margin: 0 0 12px;
  color: var(--deep-green);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  max-width: 900px;
  font-family: "IvyPrestoHeadline", "Cormorant Garamond", serif;
  font-size: clamp(2.9rem, 6vw, 4.9rem);
  line-height: 0.96;
  letter-spacing: -0.035em;
}

.lede {
  max-width: 760px;
  margin: 24px 0 0;
  color: var(--muted);
  font-size: 1.08rem;
  line-height: 1.72;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 28px;
  box-shadow: var(--shadow);
}

.form-grid,
.result-grid {
  display: grid;
  gap: 18px;
}

.form-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  padding: 32px;
}

.result-grid {
  margin-top: 24px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.models-panel {
  margin-top: 24px;
  padding: 28px;
}

.table-controls {
  display: grid;
  grid-template-columns: minmax(0, 420px);
  gap: 12px;
  margin-bottom: 18px;
}

.table-filter {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.table-filter span {
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 500;
}

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

.models-caption {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.models-table-wrap {
  overflow-x: auto;
  overflow-y: visible;
  -webkit-overflow-scrolling: touch;
}

.models-table {
  width: max-content;
  min-width: 100%;
  min-width: 1420px;
  border-collapse: collapse;
}

.models-table th,
.models-table td {
  padding: 14px 12px;
  border-bottom: 1px solid rgba(2, 46, 52, 0.08);
  text-align: left;
  vertical-align: top;
}

.models-table th {
  padding-top: 0;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}

.models-table th:first-child,
.models-table td:first-child {
  min-width: 280px;
}

.models-table th:nth-child(2),
.models-table th:nth-child(3),
.models-table td:nth-child(2),
.models-table td:nth-child(3) {
  min-width: 180px;
}

.models-table th:nth-child(4),
.models-table th:nth-child(5),
.models-table td:nth-child(4),
.models-table td:nth-child(5) {
  min-width: 140px;
}

.models-table th:nth-child(6),
.models-table td:nth-child(6) {
  min-width: 180px;
}

.models-table th:nth-child(7),
.models-table td:nth-child(7) {
  min-width: 260px;
}

.models-table tbody tr:last-child td {
  border-bottom: 0;
}

.model-cell strong,
.model-cell span {
  display: block;
}

.model-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
  min-width: 0;
}

.model-cell strong {
  font-size: 0.97rem;
  line-height: 1.35;
}

.model-cell span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.82rem;
}

.feature-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.feature-chip {
  display: inline-flex;
  align-items: center;
  padding: 5px 9px;
  border: 1px solid rgba(18, 105, 92, 0.14);
  border-radius: 999px;
  background: rgba(18, 105, 92, 0.06);
  color: var(--deep-green);
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
}

.muted-chip {
  background: rgba(2, 46, 52, 0.04);
  border-color: rgba(2, 46, 52, 0.08);
  color: var(--muted);
}

.model-info-button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  padding: 0;
  border: 1px solid rgba(2, 46, 52, 0.18);
  border-radius: 999px;
  background: var(--white);
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1;
  cursor: help;
  transform: none !important;
  box-shadow: none;
}

.model-info-button:hover,
.model-info-button:focus {
  transform: none !important;
  background: var(--white);
  color: var(--deep-green);
}

.floating-tooltip {
  position: fixed;
  z-index: 2000;
  width: min(320px, calc(100vw - 24px));
  padding: 12px 14px;
  color: var(--text);
  background: var(--white);
  border: 1px solid rgba(2, 46, 52, 0.12);
  border-radius: 14px;
  box-shadow: 0 18px 40px rgba(2, 46, 52, 0.16);
  font-size: 0.82rem;
  font-weight: 500;
  line-height: 1.5;
  text-align: left;
  pointer-events: none;
}

.sort-button {
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  white-space: nowrap;
  transform: none !important;
}

.sort-button.active {
  color: var(--text);
}

.sort-button[data-direction="asc"]::after {
  content: " ↑";
}

.sort-button[data-direction="desc"]::after {
  content: " ↓";
}

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

.field {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.field span,
.field legend {
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 500;
}

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

.search-wrap {
  position: relative;
}

.suggestions {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  z-index: 20;
  display: grid;
  gap: 8px;
  max-height: 320px;
  overflow-y: auto;
  padding: 10px;
  border: 1px solid rgba(2, 46, 52, 0.12);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.99);
  box-shadow: 0 18px 40px rgba(2, 46, 52, 0.12);
}

.suggestions[hidden] {
  display: none !important;
}

.suggestion-item,
.suggestion-empty {
  width: 100%;
  padding: 12px 14px;
  text-align: left;
  border-radius: 14px;
}

.suggestion-item {
  border: 1px solid rgba(2, 46, 52, 0.08);
  background: var(--white);
  color: var(--text);
}

.suggestion-item strong,
.suggestion-item span {
  display: block;
}

.suggestion-item strong {
  font-size: 0.96rem;
}

.suggestion-item span {
  margin-top: 4px;
  font-size: 0.82rem;
  color: var(--muted);
}

.suggestion-item mark {
  padding: 0 2px;
  color: inherit;
  background: rgba(112, 235, 148, 0.45);
  border-radius: 4px;
}

.suggestion-item.active,
.suggestion-item.highlighted,
.suggestion-item:hover {
  border-color: rgba(2, 46, 52, 0.16);
  background: rgba(221, 255, 218, 0.72);
}

.suggestion-empty {
  border: 1px dashed rgba(2, 46, 52, 0.14);
  color: var(--muted);
  background: rgba(247, 248, 248, 0.82);
}

select,
input,
button {
  font: inherit;
}

select,
input {
  width: 100%;
  padding: 16px 18px;
  color: var(--text);
  background: var(--white);
  border: 1px solid rgba(2, 46, 52, 0.12);
  border-radius: 18px;
  outline: none;
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.search-wrap input {
  padding-right: 52px;
}

.clear-search {
  position: absolute;
  top: 50%;
  right: 12px;
  width: 32px;
  height: 32px;
  padding: 0;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-radius: 999px;
  font-weight: 700;
  line-height: 1;
  transform: translateY(-50%);
  transition: none;
}

.clear-search:hover {
  transform: translateY(-50%);
}

select:focus,
input:focus {
  border-color: rgba(2, 46, 52, 0.5);
  transform: translateY(-1px);
}

.mode-switch {
  padding: 0;
  margin: 0;
  border: 0;
}

.mode-switch legend {
  margin-bottom: 10px;
}

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

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

.output-option {
  padding: 16px 18px;
  border: 1px solid rgba(2, 46, 52, 0.12);
  border-radius: 18px;
  background: var(--white);
  color: var(--text);
  font-weight: 500;
  text-align: center;
  transform: none !important;
}

.output-option.active {
  background: #12695c;
  border-color: #12695c;
  color: var(--white);
}

.mode-option {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  align-items: center;
  column-gap: 12px;
  min-height: 56px;
  margin: 0;
  padding: 16px 18px;
  color: var(--text);
  background: var(--grey-100);
  border: 1px solid rgba(2, 46, 52, 0.12);
  border-radius: 18px;
}

.mode-option input {
  position: relative;
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  margin: 0;
  padding: 0;
  appearance: none;
  background: var(--white);
  border: 1.5px solid rgba(2, 46, 52, 0.28);
  border-radius: 6px;
  grid-row: 1 / span 2;
}

.mode-option input:checked {
  background: var(--deep-green);
  border-color: var(--deep-green);
}

.mode-option input:checked::after {
  content: "✓";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--white);
  font-size: 0.85rem;
  font-weight: 800;
}

.mode-option-head {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.mode-option-title {
  color: var(--text);
  font-weight: 600;
  line-height: 1.35;
}

.mode-option-info {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  padding: 0;
  border: 1px solid rgba(2, 46, 52, 0.18);
  border-radius: 999px;
  background: var(--white);
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1;
  cursor: help;
  transform: none !important;
  box-shadow: none;
}

.mode-option-info:hover,
.mode-option-info:focus-visible {
  background: var(--white);
  color: var(--deep-green);
}

.mode-option-tooltip {
  position: absolute;
  left: calc(100% + 10px);
  top: 50%;
  z-index: 15;
  display: block;
  width: min(320px, calc(100vw - 80px));
  padding: 12px 14px;
  border: 1px solid rgba(2, 46, 52, 0.12);
  border-radius: 14px;
  background: var(--white);
  box-shadow: 0 18px 40px rgba(2, 46, 52, 0.14);
  color: var(--text);
  font-size: 0.82rem;
  font-weight: 500;
  line-height: 1.5;
  text-align: left;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-50%);
  transition: opacity 0.16s ease;
}

.mode-option-info:hover .mode-option-tooltip,
.mode-option-info:focus-visible .mode-option-tooltip {
  opacity: 1;
}

.actions {
  display: flex;
  gap: 12px;
  padding-top: 6px;
}

button {
  padding: 15px 24px;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  transition: transform 0.2s ease, opacity 0.2s ease, background 0.2s ease;
}

button:hover {
  transform: translateY(-1px);
}

button[type="submit"] {
  color: var(--white);
  background: var(--deep-green);
  font-weight: 700;
}

button.secondary {
  color: var(--text);
  background: var(--white);
  border: 1px solid rgba(2, 46, 52, 0.14);
}

.result-card {
  padding: 28px;
}

.summary {
  font-size: 1.02rem;
  line-height: 1.7;
}

.summary strong {
  display: block;
  margin-bottom: 12px;
  font-family: "Montserrat", sans-serif;
  font-size: 2.6rem;
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.02em;
}

.pricing-list {
  margin: 0;
}

.pricing-list div {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid rgba(2, 46, 52, 0.08);
}

.pricing-list div:last-child {
  border-bottom: 0;
}

.pricing-list dt {
  color: var(--muted);
}

.pricing-list dd {
  margin: 0;
  font-weight: 700;
  text-align: right;
}

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

@media (max-width: 800px) {
  .topbar-inner,
  .shell {
    width: min(100%, calc(100% - 24px));
  }

  .topbar-inner {
    min-height: auto;
    padding: 24px 0;
  }

  .hero,
  .form-grid,
  .result-grid,
  .mode-options,
  .output-options,
  .table-controls {
    grid-template-columns: 1fr;
  }

  .actions {
    flex-direction: column;
  }

  .form-grid,
  .result-card {
    padding-left: 20px;
    padding-right: 20px;
  }
}
