/* /ugc-rates/ cluster. Loaded on top of seo.css + site-system.css, so it only
   adds the two components those files do not already have: the benchmark table
   and the inline calculators. Tokens are inherited from seo.css. */

.rates-page .seo-byline { flex-wrap: wrap; gap: 6px 16px; }
.rates-page .seo-byline a { color: var(--primary); font-weight: 700; }
.rates-page .rates-lede { max-width: 72ch; margin: 0 0 18px; color: var(--ink); font-size: 1.0625rem; line-height: 1.62; }
.rates-page .seo-article-section { scroll-margin-top: 104px; }

/* ---------- benchmark table ---------- */

.rt-wrap {
  position: relative;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: 0 1px 2px rgb(18 18 18 / 0.03), 0 24px 60px -48px rgb(18 18 18 / 0.35);
  scrollbar-width: thin;
}
.rt-wrap:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

.rt {
  width: 100%;
  min-width: 720px;
  border-collapse: separate;
  border-spacing: 0;
  font-variant-numeric: tabular-nums;
}
.rt th,
.rt td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}
.rt thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #fbfbfc;
}
.rt thead th:first-child { z-index: 3; }
.rt tbody th,
.rt thead th:first-child {
  position: sticky;
  left: 0;
  z-index: 1;
  min-width: 208px;
  background: var(--card);
  box-shadow: 1px 0 0 var(--line);
}
.rt thead th:first-child { background: #fbfbfc; }
.rt th strong,
.rt th span { display: block; color: var(--ink); font-size: 0.875rem; font-weight: 800; }
.rt th small,
.rt td small { display: block; margin-top: 3px; color: var(--muted); font-size: 0.75rem; font-weight: 600; }
.rt td { color: var(--ink); font-size: 0.9375rem; }
.rt td strong { font-size: 1rem; font-weight: 800; }
.rt tbody tr:last-child th,
.rt tbody tr:last-child td { border-bottom: 0; }
.rt tbody tr:hover td { background: rgb(56 71 254 / 0.035); }

.rt-group th {
  position: sticky;
  left: 0;
  padding: 7px 14px;
  background: #fbfbfc;
  color: var(--muted);
  font-size: 0.6875rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  box-shadow: none;
}

.rt-note { max-width: 78ch; margin: 12px 0 0; color: var(--muted); font-size: 0.875rem; line-height: 1.55; }
.rt-note strong { color: var(--ink); font-weight: 750; }
.rt-note a { color: var(--primary); font-weight: 650; }

/* ---------- inline calculators ---------- */

.rc { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 16px; align-items: start; margin-top: 18px; }
.rc-form { display: grid; gap: 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); }
.rc-form fieldset { margin: 0; padding: 15px 18px; border: 0; border-bottom: 1px solid var(--line); }
.rc-form fieldset:last-child { border-bottom: 0; }
.rc-form fieldset[hidden] { display: none; }
.rc-form legend { padding: 0 0 9px; color: var(--ink); font-size: 0.8125rem; font-weight: 800; }

.rc-chips { display: flex; flex-wrap: wrap; gap: 7px; }
.rc-chip { position: relative; }
.rc-chip input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.rc-chip span {
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  min-height: 38px;
  padding: 4px 13px;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--muted);
  font-size: 0.8125rem;
  font-weight: 700;
  line-height: 1.25;
  cursor: pointer;
  transition: border-color 140ms ease, background 140ms ease, color 140ms ease, transform 140ms cubic-bezier(0.23, 1, 0.32, 1);
}
.rc-chip span small { color: inherit; font-size: 0.6875rem; font-weight: 600; opacity: 0.8; }
.rc-chip:hover span { border-color: rgb(56 71 254 / 0.35); color: var(--ink); }
.rc-chip:active span { transform: scale(0.97); }
.rc-chip input:checked + span { border-color: var(--primary); background: var(--soft); color: var(--primary); }
.rc-chip input:focus-visible + span { outline: 2px solid var(--primary); outline-offset: 2px; }

.rc-num { display: inline-flex; align-items: center; gap: 8px; }
.rc-num button {
  width: 36px;
  height: 36px;
  border: 1.5px solid var(--line);
  border-radius: 9px;
  background: #fff;
  color: var(--ink);
  font-size: 1rem;
  font-weight: 800;
  cursor: pointer;
  transition: border-color 140ms ease, background 140ms ease, transform 140ms cubic-bezier(0.23, 1, 0.32, 1);
}
.rc-num button:hover { border-color: rgb(56 71 254 / 0.35); background: var(--soft); }
.rc-num button:active { transform: scale(0.94); }
.rc-num button:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.rc-num input {
  width: 108px;
  height: 36px;
  padding: 0 10px;
  border: 1.5px solid var(--line);
  border-radius: 9px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 0.9375rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}
.rc-num input:focus-visible { border-color: var(--primary); outline: 2px solid var(--primary); outline-offset: 1px; }
.rc-num span { color: var(--muted); font-size: 0.8125rem; font-weight: 700; }

.rc-slider { display: grid; gap: 10px; }
.rc-slider input[type="range"] { width: 100%; accent-color: var(--primary); }
.rc-hint { margin: 8px 0 0; color: var(--muted); font-size: 0.75rem; font-weight: 650; line-height: 1.45; }

.rc-out {
  position: sticky;
  top: 96px;
  display: grid;
  gap: 10px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgb(56 71 254 / 0.06), rgb(255 255 255 / 0) 42%), var(--card);
  box-shadow: 0 1px 2px rgb(18 18 18 / 0.03), 0 22px 56px -44px rgb(18 18 18 / 0.35);
}
.rc-out-label { color: var(--muted); font-size: 0.6875rem; font-weight: 800; letter-spacing: 0.04em; text-transform: uppercase; }
.rc-out > strong { color: var(--ink); font-size: clamp(2rem, 3vw, 2.5rem); line-height: 1; font-weight: 800; letter-spacing: -0.01em; font-variant-numeric: tabular-nums; }
.rc-range { color: var(--muted); font-size: 0.8125rem; font-weight: 650; font-variant-numeric: tabular-nums; }
.rc-range b { color: var(--ink); font-weight: 800; }
.rc-month { margin: 0; color: var(--ink); font-size: 0.875rem; font-weight: 650; }
.rc-month b { font-weight: 800; font-variant-numeric: tabular-nums; }

.rc-alt { display: grid; gap: 6px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: #fbfbfc; }
.rc-alt strong { color: var(--ink); font-size: 1.375rem; font-weight: 800; font-variant-numeric: tabular-nums; }

.rc-lines { display: grid; gap: 0; margin: 4px 0 0; padding: 0; list-style: none; border-top: 1px solid var(--line); }
.rc-lines li { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.rc-lines strong { display: block; color: var(--ink); font-size: 0.8125rem; font-weight: 750; }
.rc-lines small { display: block; margin-top: 2px; color: var(--muted); font-size: 0.6875rem; font-weight: 600; }
.rc-lines b { flex: 0 0 auto; color: var(--ink); font-size: 0.8125rem; font-weight: 800; text-align: right; font-variant-numeric: tabular-nums; }
.rc-per { margin: 0; color: var(--ink); font-size: 0.875rem; font-weight: 750; font-variant-numeric: tabular-nums; }

.rc-open { display: inline-flex; align-items: center; gap: 6px; color: var(--primary); font-size: 0.8125rem; font-weight: 750; text-decoration: none; }
.rc-open svg { width: 14px; height: 14px; transition: transform 160ms cubic-bezier(0.23, 1, 0.32, 1); }
.rc-open:hover svg { transform: translateX(3px); }
.rc-fine { margin: 0; color: var(--muted); font-size: 0.6875rem; font-weight: 600; line-height: 1.5; }

/* ---------- related links ---------- */

.rates-related-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.rates-related-grid h3 { margin: 0 0 10px; color: var(--ink); font-size: 0.9375rem; font-weight: 800; }
.rates-link-list { display: grid; gap: 0; margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--line); }
.rates-link-list li { padding: 9px 0; border-bottom: 1px solid var(--line); }
.rates-link-list a { display: inline-flex; align-items: center; gap: 6px; color: var(--ink); font-size: 0.9375rem; font-weight: 700; text-decoration: none; }
.rates-link-list a svg { width: 14px; height: 14px; color: var(--primary); transition: transform 160ms cubic-bezier(0.23, 1, 0.32, 1); }
.rates-link-list a:hover { color: var(--primary); }
.rates-link-list a:hover svg { transform: translateX(3px); }
.rates-link-list small { display: block; margin-top: 3px; color: var(--muted); font-size: 0.75rem; font-weight: 600; line-height: 1.45; }

@media (max-width: 1000px) {
  .rc { grid-template-columns: 1fr; }
  .rc-out { position: static; }
}

@media (max-width: 720px) {
  .rt-wrap { border-radius: 14px; }
  .rt th, .rt td { padding: 9px 12px; }
  .rt tbody th, .rt thead th:first-child { min-width: 168px; }
  .rates-related-grid { grid-template-columns: 1fr; }
  .rc-num input { width: 92px; }
}

@media (prefers-reduced-motion: reduce) {
  .rc-chip span,
  .rc-num button,
  .rc-open svg,
  .rates-link-list a svg { transition: none; }
}
