/* Home controls use the selected palette and share one spacing rhythm. */
html[data-theme] .hero {
  align-items: center;
  gap: 48px;
}
html[data-theme] .hero-copy {
  min-width: 0;
}
html[data-theme] .hero-description {
  max-width: 500px;
  margin-top: 24px;
}
html[data-theme] .finder-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0;
  min-width: 0;
  padding: 26px;
  border: 1px solid var(--theme-line, #dce8df);
  border-radius: 22px;
  background: var(--theme-surface, #fff);
  box-shadow: 0 10px 36px color-mix(in srgb, var(--theme-ink, #183c35) 7%, transparent);
}
html[data-theme] .finder-card .finder-heading {
  grid-area: auto;
  margin: 0 0 22px;
  gap: 14px;
}
html[data-theme] .finder-card .finder-heading .section-kicker {
  max-width: none;
  font-size: 13px;
  line-height: 1.5;
  letter-spacing: .045em;
  color: var(--theme-muted, #526d62);
}
html[data-theme] .finder-symbol {
  width: 32px;
  height: 32px;
  font-size: 21px;
  color: var(--theme-accent, #185848);
  background: var(--theme-soft, #edf6f0);
}
html[data-theme] .finder-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
  gap: 18px;
  min-width: 0;
}
html[data-theme] .finder-field {
  min-width: 0;
}
html[data-theme] .finder-card .field-label {
  display: block;
  margin: 0 0 9px;
  font-size: 14px;
  line-height: 1.5;
  font-weight: 600;
  color: var(--theme-ink, #183c35);
}
html[data-theme] .finder-card .amount-control,
html[data-theme] .finder-card .term-control {
  min-width: 0;
  width: 100%;
  min-height: 56px;
  margin: 0;
  border: 1px solid var(--theme-line, #dce8df);
  border-radius: 14px;
  background: var(--theme-soft, #edf6f0);
}
html[data-theme] .finder-card .amount-control {
  display: flex;
  gap: 8px;
  padding: 0 14px;
}
html[data-theme] .finder-card .amount-control input {
  flex: 1;
  min-width: 0;
  width: 100%;
  min-height: 54px;
  margin: 0;
  padding: 10px 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  font-size: 20px;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: 0;
  color: var(--theme-ink, #183c35);
  appearance: textfield;
  -moz-appearance: textfield;
}
html[data-theme] .finder-card .amount-control input::placeholder {
  font-size: 16px;
  font-weight: 500;
  letter-spacing: 0;
  color: var(--theme-muted, #526d62);
  opacity: 1;
}
html[data-theme] .finder-card .amount-control input::-webkit-inner-spin-button,
html[data-theme] .finder-card .amount-control input::-webkit-outer-spin-button {
  margin: 0;
  appearance: none;
  -webkit-appearance: none;
}
html[data-theme] .finder-card .amount-control>span {
  display: block;
  flex: none;
  font-size: 14px;
  font-weight: 500;
  color: var(--theme-muted, #526d62);
}
html[data-theme] .finder-card .term-control select {
  display: block;
  min-width: 0;
  width: 100%;
  min-height: 54px;
  padding: 12px 40px 12px 14px;
  border-radius: 13px;
  background: transparent;
  font-size: 16px;
  font-weight: 500;
  line-height: 1.5;
  color: var(--theme-ink, #183c35);
}
html[data-theme] .finder-card .term-control .icon {
  top: 18px;
  right: 14px;
  width: 18px;
  height: 18px;
  color: var(--theme-accent, #185848);
}
html[data-theme] .finder-card :is(.amount-control, .term-control):focus-within {
  outline: 2px solid var(--theme-accent, #185848);
  outline-offset: 3px;
}
html[data-theme] .finder-card :is(.amount-control input, .term-control select):focus-visible {
  outline: none;
}
html[data-theme] .finder-card .amount-range {
  display: block;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  height: 36px;
  margin: 7px 0 0;
  padding: 0;
  background-size: 100% 4px !important;
  border-radius: 8px;
}
html[data-theme] .finder-card .range-labels {
  gap: 8px;
  margin: 0;
  font-size: 12px;
  line-height: 1.5;
  color: var(--theme-muted, #526d62);
}
html[data-theme] .finder-card .amount-selection-status {
  min-height: 0;
  margin: 8px 0 0;
  font-size: 12px;
  line-height: 1.6;
  overflow-wrap: anywhere;
  color: var(--theme-muted, #526d62);
}
html[data-theme] .finder-help {
  grid-area: auto;
  position: static;
  min-width: 0;
  margin-top: 7px;
}
html[data-theme] .finder-help summary {
  justify-content: flex-start;
  gap: 7px;
  min-height: 44px;
  width: fit-content;
  max-width: 100%;
  padding: 8px 0;
  border-radius: 7px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--theme-muted, #526d62);
}
html[data-theme] .finder-help summary .icon {
  width: 16px;
  height: 16px;
  color: var(--theme-accent, #185848);
}
html[data-theme] .finder-help .period-hint {
  position: static;
  width: auto;
  max-width: 100%;
  margin: 0;
  padding: 12px 13px;
  border-radius: 12px;
  background: var(--theme-soft, #edf6f0);
  box-shadow: none;
  font-size: 13px;
  line-height: 1.65;
  color: var(--theme-text, #36564b);
  overflow-wrap: anywhere;
}
html[data-theme] .finder-card>.finder-submit {
  grid-area: auto;
  width: 100%;
  min-height: 50px;
  margin: 22px 0 0;
  padding: 13px 17px;
  border-radius: 14px;
  font-size: 15px;
}
html[data-theme] .finder-card>.finder-caption {
  grid-area: auto;
  margin: 10px 0 0;
  font-size: 12px;
  line-height: 1.65;
  color: var(--theme-muted, #526d62);
}

/* Filters, sorting and the current result count belong to one panel. */
html[data-theme] .catalog-filter-panel {
  min-width: 0;
  margin: 26px 0 17px;
  padding: 18px;
  border: 1px solid var(--theme-line, #dce8df);
  border-radius: 18px;
  background: var(--theme-surface, #fff);
}
html[data-theme] .catalog-toolbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px 20px;
  min-width: 0;
  margin: 0;
}
html[data-theme] .filter-pills {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
  min-width: 0;
  max-width: 100%;
}
html[data-theme] .filter-pill {
  gap: 7px;
  min-height: 44px;
  max-width: 100%;
  padding: 10px 13px;
  border: 0;
  border-radius: 10px;
  background: var(--theme-soft, #edf6f0);
  font-size: 13px;
  line-height: 1.5;
  font-weight: 600;
  color: var(--theme-text, #36564b);
}
html[data-theme] .filter-pill:hover {
  background: var(--theme-highlight, #d8eee1);
  color: var(--theme-ink, #183c35);
}
html[data-theme] .filter-pill.is-active,
html[data-theme] .filter-pill.is-active:hover {
  background: var(--theme-accent, #185848);
  color: #fff;
}
html[data-theme] .filter-pill>span {
  padding: 2px 6px;
  border-radius: 5px;
  background: color-mix(in srgb, currentColor 10%, transparent);
  font-size: 12px;
  line-height: 1.3;
}
html[data-theme] .sort-control {
  display: grid;
  flex: 0 1 268px;
  gap: 6px;
  min-width: 0;
  max-width: 100%;
  width: 268px;
}
html[data-theme] .sort-label {
  font-size: 12px;
  line-height: 1.5;
  color: var(--theme-muted, #526d62);
}
html[data-theme] .sort-control select {
  min-width: 0;
  width: 100%;
  max-width: 100%;
  min-height: 44px;
  padding: 10px 36px 10px 13px;
  border: 1px solid var(--theme-line, #dce8df);
  border-radius: 10px;
  background: var(--theme-page, #fbfdfb);
  font-size: 13px;
  line-height: 1.5;
  color: var(--theme-ink, #183c35);
}
html[data-theme] .sort-control .icon {
  top: auto;
  bottom: 14px;
  right: 13px;
  width: 16px;
  height: 16px;
  color: var(--theme-accent, #185848);
}
html[data-theme] .catalog-meta {
  gap: 8px 18px;
  min-height: 0;
  margin-top: 16px;
  padding: 13px 0 0;
  border-top: 1px solid var(--theme-line, #dce8df);
}
html[data-theme] .catalog-meta p,
html[data-theme] .catalog-tip,
html[data-theme] .applied-filters {
  font-size: 13px;
  line-height: 1.6;
  color: var(--theme-muted, #526d62);
}
html[data-theme] .catalog-tip {
  gap: 7px;
}
html[data-theme] .catalog-tip .icon {
  color: var(--theme-accent, #185848);
}
html[data-theme] .applied-filters .text-button {
  min-height: 44px;
  border-radius: 8px;
  font-size: 13px;
  color: var(--theme-accent, #185848);
}
html[data-theme] .sort-note {
  max-width: none;
  margin: 12px 0 0;
  padding: 12px 14px;
  border-radius: 10px;
  background: var(--theme-soft, #edf6f0);
  font-size: 13px;
  line-height: 1.7;
  color: var(--theme-text, #36564b);
}
html[data-theme] .catalog-partnership {
  margin: 0 0 22px;
  font-size: 14px;
  line-height: 1.8;
}

/* The table scrolls independently; its footer has its own breathing room. */
html[data-theme] .compare-dialog {
  width: min(1060px, calc(100% - 40px));
  max-height: calc(100dvh - 40px);
  padding: 0;
  border: 0;
  border-radius: 22px;
  background: var(--theme-surface, #fff);
  color: var(--theme-ink, #183c35);
  box-shadow: 0 24px 90px color-mix(in srgb, var(--theme-ink, #183c35) 24%, transparent);
  overflow: auto;
  overscroll-behavior: contain;
}
html[data-theme] .compare-dialog::backdrop {
  background: color-mix(in srgb, var(--theme-ink, #183c35) 58%, transparent);
  backdrop-filter: blur(4px);
}
html[data-theme] .compare-dialog .dialog-header {
  position: sticky;
  top: 0;
  z-index: 10;
  align-items: center;
  gap: 20px;
  min-width: 0;
  padding: 24px 28px 20px;
  background: var(--theme-surface, #fff);
  box-shadow: 0 1px 0 var(--theme-line, #dce8df);
}
html[data-theme] .dialog-header>div {
  min-width: 0;
}
html[data-theme] .dialog-header .eyebrow {
  margin-bottom: 6px;
  font-size: 12px;
  line-height: 1.5;
  letter-spacing: .06em;
  color: var(--theme-accent, #185848);
}
html[data-theme] .dialog-header h2 {
  font-size: 28px;
  line-height: 1.25;
  color: var(--theme-ink, #183c35);
}
html[data-theme] .dialog-header .icon-button {
  flex: none;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--theme-soft, #edf6f0);
  color: var(--theme-accent, #185848);
}
html[data-theme] .dialog-header .icon-button:hover {
  background: var(--theme-highlight, #d8eee1);
}
html[data-theme] .dialog-body {
  min-width: 0;
  padding: 20px 28px 0;
}
html[data-theme] .compare-scroll-hint {
  margin: 0 0 16px;
  font-size: 13px;
  line-height: 1.7;
  color: var(--theme-muted, #526d62);
}
html[data-theme] .compare-table-scroll {
  min-width: 0;
  width: 100%;
  max-height: min(54dvh, 600px);
  border: 1px solid var(--theme-line, #dce8df);
  border-radius: 12px;
  background: var(--theme-surface, #fff);
  overflow: auto;
  scrollbar-color: var(--theme-muted, #526d62) var(--theme-soft, #edf6f0);
  scrollbar-width: thin;
}
html[data-theme] .compare-table-scroll th,
html[data-theme] .compare-table-scroll td {
  padding: 16px;
  background: var(--theme-surface, #fff);
  box-shadow: inset -1px 0 0 var(--theme-line, #dce8df), inset 0 -1px 0 var(--theme-line, #dce8df);
  font-size: 16px;
  line-height: 1.55;
  color: var(--theme-ink, #183c35);
}
html[data-theme] .compare-table-scroll thead th {
  background: var(--theme-card-band, #e2f0e7);
  font-size: 18px;
  letter-spacing: -.015em;
}
html[data-theme] .compare-table-scroll thead th:first-child {
  width: 170px;
  background: var(--theme-soft, #edf6f0);
  font-size: 13px;
  letter-spacing: 0;
  color: var(--theme-muted, #526d62);
}
html[data-theme] .compare-table-scroll tbody th {
  width: 170px;
  background: var(--theme-card-soft, var(--theme-soft, #edf6f0));
  font-weight: 600;
}
html[data-theme] .compare-table-scroll .button {
  min-height: 44px;
  padding: 11px 12px;
  border-radius: 10px;
  background: var(--theme-accent, #185848);
  font-size: 14px;
  line-height: 1.5;
  color: #fff;
}
html[data-theme] .compare-table-scroll .button:hover {
  transform: none;
  background: var(--theme-accent-hover, #123f35);
}
html[data-theme] .dialog-footer {
  display: grid;
  justify-items: start;
  gap: 13px;
  min-width: 0;
  margin-top: 24px;
  padding: 22px 28px 25px;
  border-top: 1px solid var(--theme-line, #dce8df);
  background: var(--theme-card-footer, var(--theme-soft, #edf6f0));
}
html[data-theme] .dialog-footer .button {
  gap: 10px;
  min-height: 46px;
  max-width: 100%;
  padding: 11px 16px;
  border: 1px solid var(--theme-line, #dce8df);
  border-radius: 11px;
  background: var(--theme-surface, #fff);
  font-size: 14px;
  line-height: 1.5;
  color: var(--theme-accent, #185848);
}
html[data-theme] .dialog-footer .button:hover {
  transform: none;
  background: var(--theme-soft, #edf6f0);
}
html[data-theme] .dialog-disclaimer {
  max-width: 820px;
  margin: 0;
  font-size: 13px;
  line-height: 1.75;
  color: var(--theme-muted, #526d62);
}
html[data-theme]:has(.compare-dialog[open]),
html[data-theme] body:has(.compare-dialog[open]) {
  overflow: hidden;
}

/* A narrow tray keeps both actions on a separate, predictable row. */
html[data-theme] .compare-tray {
  bottom: calc(16px + env(safe-area-inset-bottom));
  width: min(780px, calc(100% - 32px));
  padding: 15px 18px;
  border: 1px solid var(--theme-line, #dce8df);
  border-radius: 16px;
  background: var(--theme-surface, #fff);
  color: var(--theme-ink, #183c35);
  box-shadow: 0 10px 45px color-mix(in srgb, var(--theme-ink, #183c35) 18%, transparent);
}
html[data-theme] .compare-tray-inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
}
html[data-theme] .compare-tray-info {
  gap: 11px;
  min-width: 0;
}
html[data-theme] .compare-tray-info>.icon {
  width: 23px;
  height: 23px;
  color: var(--theme-accent, #185848);
}
html[data-theme] .compare-tray-info strong {
  font-size: 14px;
  line-height: 1.5;
}
html[data-theme] .compare-tray-info small {
  max-width: 100%;
  margin-top: 3px;
  font-size: 12px;
  line-height: 1.5;
  color: var(--theme-muted, #526d62);
}
html[data-theme] .compare-tray-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  margin: 0;
}
html[data-theme] .compare-tray-actions .button,
html[data-theme] .compare-tray-actions .text-button {
  justify-content: center;
  min-height: 44px;
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 14px;
  line-height: 1.5;
  white-space: nowrap;
}
html[data-theme] .compare-tray-actions .text-button {
  color: var(--theme-muted, #526d62);
}
html[data-theme] .compare-tray-actions .text-button:hover {
  background: var(--theme-soft, #edf6f0);
  color: var(--theme-ink, #183c35);
}
html[data-theme] .compare-tray-actions .button:hover {
  transform: none;
}
html[data-theme] .compare-tray-actions .button:disabled {
  background: var(--theme-soft, #edf6f0);
  color: var(--theme-muted, #526d62);
}
html[data-theme] :is(.finder-card, .catalog-filter-panel, .compare-dialog, .compare-tray) :is(a, button, input, select, summary, [tabindex]):focus-visible {
  outline: 3px solid var(--theme-accent, #185848);
  outline-offset: 3px;
}
html[data-theme] .finder-card :is(.amount-control input, .term-control select):focus-visible {
  outline: none;
}
html[data-theme] .toast {
  background: var(--theme-ink, #183c35);
  color: #fff;
}
html[data-theme] .toast-action {
  color: #fff;
}
html[data-theme] body:not(.has-comparison) .toast {
  bottom: calc(24px + env(safe-area-inset-bottom));
}

@media (max-width: 1100px) {
  html[data-theme] .hero { gap: 30px; }
  html[data-theme] .finder-card { padding: 23px; }
  html[data-theme] .finder-fields { gap: 14px; }
}
@media (max-width: 900px) {
  html[data-theme] .hero { gap: 28px; }
  html[data-theme] .finder-card { width: 100%; max-width: 650px; }
  html[data-theme] .hero-description { max-width: 580px; }
  html[data-theme] .sort-control { margin-left: auto; }
}
@media (max-width: 560px) {
  html[data-theme] .finder-card { padding: 22px; border-radius: 18px; }
  html[data-theme] .finder-fields { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  html[data-theme] .finder-card .finder-heading { margin-bottom: 20px; }
  html[data-theme] .finder-card>.finder-submit { margin-top: 18px; }
  html[data-theme] .finder-help { margin-top: 3px; }
  html[data-theme] .finder-help summary { min-height: 44px; }
  html[data-theme] .catalog-filter-panel { margin-top: 22px; padding: 14px; border-radius: 16px; }
  html[data-theme] .catalog-toolbar { display: grid; grid-template-columns: minmax(0, 1fr); gap: 17px; }
  html[data-theme] .filter-pills { gap: 6px; }
  html[data-theme] .filter-pill { padding: 10px 11px; font-size: 12px; }
  html[data-theme] .sort-control { width: 100%; margin: 0; }
  html[data-theme] .catalog-meta { margin-top: 14px; padding-top: 12px; gap: 7px; }
  html[data-theme] .catalog-tip { flex-basis: 100%; margin-left: 0; }
  html[data-theme] .catalog-partnership { font-size: 13px; }
  html[data-theme] .compare-dialog { width: calc(100% - 20px); max-height: calc(100dvh - 20px); border-radius: 18px; }
  html[data-theme] .compare-dialog .dialog-header { gap: 12px; padding: 18px 16px 16px; }
  html[data-theme] .dialog-header .eyebrow { font-size: 11px; }
  html[data-theme] .dialog-header h2 { font-size: 23px; }
  html[data-theme] .dialog-body { padding: 16px 16px 0; }
  html[data-theme] .compare-scroll-hint { font-size: 12px; }
  html[data-theme] .compare-table-scroll { max-height: 48dvh; }
  html[data-theme] .compare-table-scroll th,
  html[data-theme] .compare-table-scroll td { padding: 14px 12px; }
  html[data-theme] .compare-table-scroll thead th:first-child,
  html[data-theme] .compare-table-scroll tbody th { width: 145px; }
  html[data-theme] .dialog-footer { gap: 12px; margin-top: 18px; padding: 18px 16px 20px; }
  html[data-theme] .dialog-footer .button { width: 100%; }
  html[data-theme] .dialog-disclaimer { font-size: 12px; }
  html[data-theme] .compare-tray { bottom: calc(10px + env(safe-area-inset-bottom)); width: calc(100% - 24px); padding: 12px 14px; }
  html[data-theme] .compare-tray-inner { grid-template-columns: minmax(0, 1fr); gap: 11px; }
  html[data-theme] .compare-tray-actions { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: 9px; width: 100%; }
  html[data-theme] body.has-comparison { padding-bottom: calc(180px + env(safe-area-inset-bottom)); }
  html[data-theme] body.has-comparison .toast { bottom: calc(170px + env(safe-area-inset-bottom)); }
}
@media (max-width: 360px) {
  html[data-theme] .finder-card { padding: 19px; }
  html[data-theme] .finder-card .finder-heading .section-kicker { font-size: 12px; letter-spacing: .025em; }
  html[data-theme] .filter-pill { padding-inline: 10px; }
  html[data-theme] .compare-tray-actions .button { padding-inline: 11px; gap: 7px; }
}

html[data-theme] .compare-share-fallback { width:100%; min-width:0; }
html[data-theme] .compare-share-fallback:not([hidden]) { display:grid; gap:8px; }
html[data-theme] .compare-share-fallback label { font-size:13px; font-weight:600; color:var(--theme-ink); }
html[data-theme] .compare-share-fallback input {
  width:100%; min-width:0; min-height:46px; padding:10px 12px; border:1px solid var(--theme-line);
  border-radius:12px; background:var(--theme-surface); color:var(--theme-ink); font-size:14px;
}
html[data-theme] .compare-share-fallback small { font-size:12px; color:var(--theme-muted); }
