/*
 * Retirement Tax Planning Calculator
 * Suite UI aligned with TFLS / RetirementCalculators.uk
 */

:root {
  --rtp-ink: #0b1220;
  --rtp-muted: #1e293b;
  --rtp-navy: #083141;
  --rtp-teal: #0f766e;
}

#rtp-root,
.rtp-app {
  width: 100%;
  max-width: 1120px;
  margin: 28px auto 0;
  padding: 0 8px;
  box-sizing: border-box;
  overflow-x: clip;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--rtp-ink);
  line-height: 1.5;
}

#rtp-root *,
.rtp-app * {
  box-sizing: border-box;
}

.rtp-shell {
  max-width: 1180px;
  margin: 0 auto;
  padding: 22px 18px 30px;
  border: 2px solid rgba(8, 49, 65, 0.18);
  border-radius: 22px;
  box-shadow: 0 20px 60px rgba(2, 6, 23, 0.1);
  background:
    linear-gradient(180deg, #f7fbfc 0%, #ffffff 120px);
  width: 100%;
  min-width: 0;
  overflow-x: clip;
  position: relative;
}

.rtp-shell::before {
  content: "";
  position: absolute;
  top: 0;
  left: 18px;
  right: 18px;
  height: 4px;
  border-radius: 0 0 8px 8px;
  background: linear-gradient(90deg, #0c4a6e 0%, #0f766e 55%, #083141 100%);
}

/* Hero */
.rtp-hero {
  border: 2px solid #083141;
  border-radius: 18px;
  padding: 22px;
  background: linear-gradient(152deg, #0c4a6e 0%, #083141 42%, #0f172a 100%);
  color: #fff;
  box-shadow: 0 12px 32px rgba(8, 49, 65, 0.2);
}

.rtp-eyebrow {
  margin: 0 0 8px;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #9fd4cf;
}

.rtp-title {
  margin: 0 0 10px;
  font-size: clamp(1.55rem, 3.6vw, 2.15rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.15;
  color: #fff;
}

.rtp-lead {
  margin: 0;
  color: #fff;
  font-weight: 600;
  line-height: 1.55;
  max-width: 720px;
}

.rtp-hero-note {
  margin: 14px 0 0;
  color: #cbd5e1;
  font-size: 0.92rem;
  font-weight: 700;
  line-height: 1.5;
}

.rtp-hero-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.rtp-hero-chip {
  display: inline-flex;
  align-items: center;
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid rgba(159, 212, 207, 0.45);
  background: rgba(255, 255, 255, 0.08);
  color: #e2e8f0;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}

/* Panels */
.rtp-panel {
  margin-top: 18px;
  padding: 0;
  border-radius: 18px;
  border: 2px solid rgba(8, 49, 65, 0.14);
  background: linear-gradient(180deg, #ffffff 0%, #f4f8fa 100%);
  box-shadow: 0 14px 36px rgba(8, 49, 65, 0.08);
  overflow: hidden;
}

.rtp-panel__head {
  padding: 18px 20px 16px;
  background:
    linear-gradient(120deg, rgba(12, 74, 110, 0.08) 0%, rgba(15, 118, 110, 0.06) 48%, rgba(255, 255, 255, 0) 100%),
    #eef6f7;
  border-bottom: 1px solid rgba(8, 49, 65, 0.1);
}

.rtp-panel__eyebrow {
  margin: 0 0 6px;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #0f766e;
}

.rtp-panel__title {
  margin: 0;
  font-size: clamp(1.35rem, 3vw, 1.75rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.15;
  color: var(--rtp-navy);
}

.rtp-panel__lead {
  margin: 8px 0 0;
  font-size: 0.95rem;
  font-weight: 600;
  color: #334155;
  line-height: 1.45;
  max-width: 36rem;
}

.rtp-panel__body {
  padding: 18px 20px 20px;
}

.rtp-subsection {
  margin-top: 18px;
}

.rtp-subsection:first-child {
  margin-top: 0;
}

.rtp-subsection__title {
  margin: 0 0 12px;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--rtp-navy);
}

.rtp-subsection__lead {
  margin: -4px 0 12px;
  font-size: 0.9rem;
  font-weight: 600;
  color: #64748b;
  line-height: 1.45;
}

.rtp-subsection__title--spaced {
  margin-top: 22px;
}

/* Fields */
.rtp-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: 1fr;
  align-items: stretch;
}

@media (min-width: 640px) {
  .rtp-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .rtp-grid--3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.rtp-field {
  display: grid;
  gap: 6px;
  min-width: 0;
  align-content: start;
  padding: 14px;
  border-radius: 14px;
  border: 1px solid #d7e2e8;
  background: #fff;
  box-shadow: 0 1px 0 rgba(8, 49, 65, 0.04);
}

.rtp-label {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--rtp-navy);
  line-height: 1.25;
}

.rtp-hint {
  margin: 0;
  font-size: 0.82rem;
  font-weight: 600;
  color: #64748b;
  line-height: 1.35;
}

.rtp-method-note {
  margin-top: 14px;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid #c5d4dc;
  background: #f7fbfb;
}

.rtp-method-note__title {
  display: block;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--rtp-navy);
  margin-bottom: 6px;
}

.rtp-method-note__text {
  margin: 0;
  font-size: 0.88rem;
  font-weight: 600;
  color: #475569;
  line-height: 1.45;
}

.rtp-lump-switch {
  margin-top: 14px;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid #d7e2e8;
  background: #fff;
}

.rtp-lump-switch__label {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--rtp-navy);
  line-height: 1.25;
}

.rtp-lump-switch__lead {
  margin: 6px 0 12px;
  font-size: 0.84rem;
  font-weight: 600;
  color: #64748b;
  line-height: 1.4;
}

.rtp-lump-switch__row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.rtp-lump-switch .rtp-field {
  margin-top: 4px;
  padding: 0;
  border: none;
  background: transparent;
  box-shadow: none;
}

.rtp-lump-switch .rtp-hint {
  margin-top: 2px;
}

.rtp-input {
  width: 100%;
  border: 2px solid #c5d4dc;
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--rtp-ink);
  background: #f8fafc;
  min-height: 48px;
  font-variant-numeric: tabular-nums;
  font-family: inherit;
}

.rtp-input:focus {
  outline: 2px solid #0f766e;
  outline-offset: 1px;
  border-color: #0f766e;
  background: #fff;
}

.rtp-sp-toggle {
  margin-top: 14px;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid #d7e2e8;
  background: linear-gradient(135deg, #f7fbfb 0%, #ffffff 100%);
}

.rtp-sp-toggle label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--rtp-navy);
  cursor: pointer;
  line-height: 1.35;
}

.rtp-sp-toggle input[type="checkbox"] {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  accent-color: #0f766e;
  cursor: pointer;
}

.rtp-sp-toggle__hint {
  margin: 10px 0 0 28px;
  font-size: 0.84rem;
  font-weight: 600;
  color: #64748b;
  line-height: 1.4;
}

/* Priority */
.rtp-priority {
  margin-top: 18px;
  padding: 16px;
  border-radius: 14px;
  border: 1px solid #d4dee5;
  background: #fff;
}

.rtp-priority__label {
  margin: 0 0 4px;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--rtp-navy);
}

.rtp-priority__lead {
  margin: 0 0 12px;
  font-size: 0.88rem;
  font-weight: 600;
  color: #64748b;
  line-height: 1.4;
}

.rtp-priority__row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.rtp-prio {
  appearance: none;
  border: 1.5px solid #c5d4dc;
  background: #f8fafc;
  color: var(--rtp-navy);
  font-weight: 700;
  font-size: 0.88rem;
  padding: 11px 15px;
  border-radius: 999px;
  cursor: pointer;
  font-family: inherit;
  min-height: 44px;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.rtp-prio:hover {
  border-color: #0f766e;
  color: #0f766e;
}

.rtp-prio--on {
  border-color: #083141;
  background: #083141;
  color: #fff;
}

/* Results / impact */
.rtp-results {
  margin-top: 18px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.rtp-impact {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  padding: 0;
  border-radius: 18px;
  border: 2px solid #083141;
  background: #fff;
  overflow: hidden;
}

.rtp-scoreboard {
  padding: 22px 20px 18px;
  background: linear-gradient(145deg, #0c4a6e 0%, #083141 55%, #0f172a 100%);
  color: #fff;
}

.rtp-scoreboard__top {
  display: grid;
  gap: 16px;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
}

.rtp-scoreboard__main {
  min-width: 0;
}

.rtp-scoreboard__label {
  margin: 0 0 8px;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #9fd4cf;
}

.rtp-scoreboard__path {
  margin: 0 0 6px;
  font-size: clamp(1.05rem, 2.5vw, 1.25rem);
  font-weight: 800;
  color: #fff;
  line-height: 1.25;
}

.rtp-scoreboard__desc {
  margin: 0 0 12px;
  font-size: 0.92rem;
  font-weight: 600;
  color: #cbd5e1;
  line-height: 1.4;
}

.rtp-scoreboard__amount {
  margin: 0;
  font-size: clamp(2.4rem, 8vw, 3.5rem);
  font-weight: 800;
  letter-spacing: -0.045em;
  line-height: 0.92;
  font-variant-numeric: tabular-nums;
  color: #fff;
  white-space: nowrap;
}

.rtp-scoreboard__amount-label {
  margin: 8px 0 0;
  font-size: 0.9rem;
  font-weight: 700;
  color: #cbd5e1;
}

.rtp-scoreboard__score {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 124px;
  padding: 16px 18px 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.22);
}

.rtp-scoreboard__score-num {
  font-size: clamp(2.85rem, 7vw, 3.6rem);
  font-weight: 800;
  line-height: 0.92;
  letter-spacing: -0.05em;
  color: #fff;
  font-variant-numeric: tabular-nums;
}

.rtp-scoreboard__score-den {
  margin-top: 2px;
  font-size: 0.95rem;
  font-weight: 800;
  color: #cbd5e1;
}

.rtp-scoreboard__score-label {
  margin-top: 10px;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #9fd4cf;
}

.rtp-score-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 16px;
}

@media (min-width: 720px) {
  .rtp-score-metrics {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.rtp-score-metric {
  min-width: 0;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.rtp-score-metric__k {
  display: block;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #94a3b8;
}

.rtp-score-metric__v {
  display: block;
  margin-top: 5px;
  font-size: clamp(0.95rem, 2.2vw, 1.22rem);
  font-weight: 800;
  color: #fff;
  line-height: 1.15;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Ranking */
.rtp-rank-panel {
  padding: 16px 16px 18px;
  background: #fff;
}

.rtp-rank-panel__head {
  margin: 0 0 12px;
}

.rtp-rank-panel__title {
  margin: 0 0 4px;
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--rtp-navy);
}

.rtp-rank-panel__lead {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 600;
  color: #475569;
  line-height: 1.4;
}

.rtp-table-wrap {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.rtp-rank-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
  min-width: 640px;
}

.rtp-rank-table th {
  text-align: left;
  padding: 10px 8px;
  border-bottom: 2px solid #083141;
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #0f766e;
  white-space: nowrap;
}

.rtp-rank-table td {
  padding: 14px 8px;
  border-bottom: 1px solid #e2e8f0;
  font-weight: 700;
  color: #0f172a;
  font-variant-numeric: tabular-nums;
  vertical-align: middle;
}

.rtp-rank-num {
  color: #64748b !important;
  font-weight: 800 !important;
  font-size: 1.05rem !important;
}

.rtp-rank-num--top {
  color: var(--rtp-teal) !important;
}

.rtp-rank-title {
  font-weight: 800 !important;
  color: var(--rtp-navy) !important;
  min-width: 10rem;
  font-size: 1.02rem !important;
  white-space: normal;
}

.rtp-rank-desc {
  display: block;
  margin-top: 2px;
  font-size: 0.82rem;
  font-weight: 600;
  color: #64748b;
  line-height: 1.35;
}

.rtp-rank-cash {
  font-size: 1.08rem !important;
  font-weight: 800 !important;
  letter-spacing: -0.02em;
  color: #083141 !important;
  white-space: nowrap;
}

.rtp-rank-score__pill {
  display: inline-flex;
  align-items: baseline;
  justify-content: center;
  gap: 1px;
  min-width: 3.6rem;
  padding: 7px 10px;
  border-radius: 999px;
  background: #083141;
  color: #fff;
  font-weight: 800;
  line-height: 1;
}

.rtp-rank-score__num {
  font-size: 1.15rem;
  letter-spacing: -0.03em;
}

.rtp-rank-score__den {
  font-size: 0.72rem;
  color: #cbd5e1;
}

.rtp-rank-row {
  cursor: pointer;
}

.rtp-rank-row:hover td {
  background: #f4f7f8;
}

.rtp-rank-row--on td {
  background: #eef6f7;
}

.rtp-rank-row--best td:first-child {
  box-shadow: inset 3px 0 0 #0f766e;
}

.rtp-rank-row--on .rtp-rank-title {
  color: #0f766e !important;
}

.rtp-rank-row--on .rtp-rank-score__pill,
.rtp-rank-row--best .rtp-rank-score__pill {
  background: #0f766e;
  color: #fff;
}

.rtp-rank-row--on .rtp-rank-score__den,
.rtp-rank-row--best .rtp-rank-score__den {
  color: #d8eeec;
}

/* Insight blocks */
.rtp-section {
  margin-top: 16px;
  padding: 16px;
  border-radius: 16px;
  border: 1px solid #d4dee5;
  background: #fff;
}

.rtp-section__title {
  margin: 0 0 6px;
  font-size: clamp(1.1rem, 2.4vw, 1.3rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--rtp-navy);
}

.rtp-section__lead {
  margin: 0 0 12px;
  font-size: 0.92rem;
  font-weight: 600;
  color: #334155;
  line-height: 1.45;
}

.rtp-section--spotlight {
  border: 2px solid rgba(8, 49, 65, 0.18);
  box-shadow: 0 12px 32px rgba(8, 49, 65, 0.08);
  background: linear-gradient(180deg, #ffffff 0%, #f4f8fa 100%);
}

.rtp-section--before {
  border-left: 4px solid #083141;
  padding-left: 16px;
}

.rtp-section--outside {
  border-left: 4px solid #0f766e;
  padding-left: 16px;
  background: linear-gradient(90deg, rgba(15, 118, 110, 0.06) 0%, transparent 55%);
  border-radius: 0 12px 12px 0;
}

.rtp-chart-fallback {
  margin: 8px 0 0;
  font-size: 0.88rem;
  font-weight: 600;
  color: #64748b;
  line-height: 1.4;
}

.rtp-chips {
  display: grid;
  gap: 10px;
  width: 100%;
  min-width: 0;
}

@media (min-width: 720px) {
  .rtp-chips {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1100px) {
  .rtp-chips {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.rtp-chip {
  min-width: 0;
  padding: 14px;
  border-radius: 14px;
  border: 1px solid #c7dde0;
  background: #f7fbfb;
  display: flex;
  flex-direction: column;
  gap: 6px;
  box-shadow: 0 1px 0 rgba(8, 49, 65, 0.04);
}

.rtp-chip__k {
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #0f766e;
  line-height: 1.3;
}

.rtp-chip__v {
  font-size: clamp(1.05rem, 2.3vw, 1.28rem);
  font-weight: 800;
  color: var(--rtp-navy);
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
}

.rtp-chip__s {
  font-size: 0.86rem;
  font-weight: 600;
  color: #475569;
  line-height: 1.4;
}

/* Breakdown */
.rtp-breakdown-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

@media (min-width: 720px) {
  .rtp-breakdown-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.rtp-breakdown {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  border: 1px solid #d7e2e8;
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
}

.rtp-breakdown thead {
  background: #083141;
  color: #fff;
}

.rtp-breakdown th {
  padding: 12px 14px;
  text-align: left;
  font-weight: 800;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.rtp-breakdown td {
  padding: 10px 14px;
  border-top: 1px solid #e2e8f0;
  font-weight: 600;
  color: #0f172a;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.rtp-breakdown td:first-child {
  color: #475569;
  font-weight: 600;
  white-space: normal;
}

.rtp-breakdown td:last-child {
  text-align: right;
  font-weight: 800;
  color: var(--rtp-navy);
}

.rtp-breakdown tr.total td {
  font-weight: 800;
  background: #eef6f7;
  border-top: 2px solid #0f766e;
  color: var(--rtp-navy);
}

/* Export */
.rtp-export {
  margin-top: 16px;
  padding: 28px 22px;
  border-radius: 18px;
  border: 2px solid #083141;
  background:
    linear-gradient(145deg, rgba(12, 74, 110, 0.06) 0%, rgba(15, 118, 110, 0.08) 45%, #fff 100%);
  text-align: center;
  box-shadow: 0 14px 36px rgba(8, 49, 65, 0.08);
}

.rtp-export__badge {
  display: inline-block;
  margin: 0 0 10px;
  padding: 5px 12px;
  border-radius: 999px;
  background: #083141;
  color: #fff;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.rtp-export__title {
  margin: 0 0 8px;
  font-size: clamp(1.35rem, 3vw, 1.7rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--rtp-navy);
}

.rtp-export__lead {
  margin: 0 auto 18px;
  max-width: 28rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: #334155;
  line-height: 1.45;
}

.rtp-export__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  min-width: 240px;
  padding: 14px 28px;
  border-radius: 12px;
  border: none;
  background: #083141;
  color: #fff;
  font-size: 1rem;
  font-weight: 800;
  cursor: pointer;
  font-family: inherit;
  box-shadow: 0 1px 0 rgba(8, 49, 65, 0.35);
}

.rtp-export__btn:hover {
  background: #0f766e;
}

/* Modal */
.rtp-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(8, 49, 65, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999999;
  padding: 20px;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--rtp-ink);
  box-sizing: border-box;
}

.rtp-modal-overlay *,
.rtp-modal-overlay *::before,
.rtp-modal-overlay *::after {
  box-sizing: border-box;
}

.rtp-modal {
  background: #fff;
  border: 1px solid #d4dee5;
  border-radius: 16px;
  max-width: min(520px, 100%);
  width: 100%;
  min-width: 0;
  max-height: 90vh;
  overflow-x: hidden;
  overflow-y: auto;
  box-shadow: 0 20px 50px rgba(8, 49, 65, 0.28);
}

.rtp-modal__head {
  padding: 18px 20px;
  background: linear-gradient(135deg, #0c4a6e, #083141);
}

.rtp-modal__head-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.rtp-modal-close {
  flex: 0 0 auto;
  border: none;
  background: transparent;
  color: #fff;
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
  padding: 0 2px;
  opacity: 0.85;
}

.rtp-modal-close:hover {
  opacity: 1;
}

.rtp-modal__head h2 {
  margin: 0;
  color: #fff;
  font-size: 1.28rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.rtp-modal-label {
  display: block;
  margin: 0 0 6px;
  font-size: 0.82rem;
  font-weight: 700;
  color: #334155;
}

.rtp-modal-error {
  display: none;
  margin: 0 0 12px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid #fecaca;
  background: #fef2f2;
  color: #991b1b;
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.4;
}

.rtp-modal-error[data-show] {
  display: block;
}

.rtp-modal__body {
  padding: 18px 20px 20px;
  min-width: 0;
}

.rtp-modal-form {
  min-width: 0;
  max-width: 100%;
}

.rtp-modal-snapshot {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 0 0 16px;
  min-width: 0;
}

.rtp-modal-row {
  background: #e7f3f4;
  border: 1px solid #b7d0d3;
  border-radius: 10px;
  padding: 10px 12px;
  min-width: 0;
  overflow: hidden;
}

.rtp-modal-row span {
  display: block;
  font-size: 0.76rem;
  color: #3d4d58;
  font-weight: 700;
}

.rtp-modal-row strong {
  display: block;
  font-size: 1.02rem;
  font-weight: 800;
  color: #083141;
  margin-top: 4px;
  line-height: 1.25;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.rtp-modal-form > p {
  margin: 0 0 12px;
  font-size: 0.92rem;
  font-weight: 600;
  color: #475569;
}

.rtp-modal-form input {
  display: block;
  width: 100%;
  max-width: 100%;
  padding: 12px 14px;
  border: 2px solid #c5d4dc;
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 700;
  font-family: inherit;
  margin-bottom: 10px;
  background: #f8fafc;
  color: var(--rtp-ink);
}

.rtp-modal-form input:focus {
  outline: 2px solid #0f766e;
  outline-offset: 1px;
  border-color: #0f766e;
  background: #fff;
}

.rtp-modal-actions {
  display: flex;
  gap: 10px;
  margin-top: 8px;
  min-width: 0;
}

.rtp-modal-submit {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 48px;
  padding: 12px 18px;
  background: #083141;
  color: #fff;
  border: none;
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 800;
  font-family: inherit;
  cursor: pointer;
}

.rtp-modal-submit:hover {
  background: #0f766e;
}

.rtp-modal-cancel {
  flex: 0 1 auto;
  min-width: 0;
  min-height: 48px;
  padding: 12px 18px;
  background: #fff;
  color: #475569;
  border: 2px solid #c5d4dc;
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
}

.rtp-modal-cancel:hover {
  border-color: #083141;
  color: #083141;
}

.rtp-verdict {
  margin-top: 16px;
  padding: 18px 18px 16px;
  border-radius: 18px;
  border: 2px solid rgba(15, 118, 110, 0.28);
  background:
    linear-gradient(135deg, rgba(15, 118, 110, 0.08) 0%, rgba(12, 74, 110, 0.05) 45%, #fff 100%);
  box-shadow: 0 10px 28px rgba(8, 49, 65, 0.06);
}

.rtp-verdict__eyebrow {
  margin: 0 0 8px;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #0f766e;
}

.rtp-verdict__text {
  margin: 0 0 14px;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--rtp-navy);
  line-height: 1.45;
  max-width: 52rem;
}

.rtp-verdict__grid {
  display: grid;
  gap: 10px;
  grid-template-columns: 1fr;
}

@media (min-width: 720px) {
  .rtp-verdict__grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.rtp-verdict__stat {
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid #d7e2e8;
  background: #fff;
  min-width: 0;
}

.rtp-verdict__k {
  display: block;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #64748b;
}

.rtp-verdict__v {
  display: block;
  margin-top: 6px;
  font-size: clamp(1.05rem, 2.2vw, 1.25rem);
  font-weight: 800;
  color: var(--rtp-navy);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rtp-glossary {
  margin-top: 16px;
  padding: 16px;
  border-radius: 16px;
  border: 1px solid #d4dee5;
  background: #fff;
}

.rtp-glossary--inline {
  margin: 0 0 14px;
  padding: 12px;
}

.rtp-glossary__grid {
  display: grid;
  gap: 10px;
  grid-template-columns: 1fr;
}

@media (min-width: 720px) {
  .rtp-glossary__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1100px) {
  .rtp-glossary__grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.rtp-glossary__item {
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  display: grid;
  gap: 4px;
}

.rtp-glossary__item strong {
  color: var(--rtp-navy);
  font-size: 0.95rem;
  font-weight: 800;
}

.rtp-glossary__item span {
  color: #475569;
  font-size: 0.88rem;
  font-weight: 600;
  line-height: 1.4;
}

.rtp-charts__grid {
  display: grid;
  gap: 14px;
  grid-template-columns: 1fr;
}

@media (min-width: 900px) {
  .rtp-charts__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .rtp-charts__grid .rtp-chart-card:last-child:nth-child(odd),
  .rtp-charts__grid .rtp-chart-card--full {
    grid-column: 1 / -1;
  }
}

.rtp-chart-card {
  padding: 14px;
  border-radius: 16px;
  border: 1px solid #d7e2e8;
  background: linear-gradient(180deg, #ffffff 0%, #f7fbfb 100%);
  box-shadow: 0 1px 0 rgba(8, 49, 65, 0.04);
  min-width: 0;
}

.rtp-chart-card__title {
  margin: 0 0 4px;
  font-size: 1.02rem;
  font-weight: 800;
  color: var(--rtp-navy);
  letter-spacing: -0.02em;
}

.rtp-chart-card__lead {
  margin: 0 0 10px;
  font-size: 0.88rem;
  font-weight: 600;
  color: #64748b;
  line-height: 1.4;
}

.rtp-chart-wrap {
  position: relative;
  width: 100%;
  height: 260px;
  min-width: 0;
}

.rtp-chart-wrap--wide {
  height: 320px;
}

@media (max-width: 640px) {
  .rtp-shell {
    padding: 16px 12px 22px;
    border-radius: 16px;
  }

  .rtp-scoreboard__top {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .rtp-scoreboard__score {
    flex-direction: row;
    justify-content: flex-start;
    gap: 8px;
    align-items: baseline;
    min-width: 0;
  }

  .rtp-scoreboard__score-label {
    margin-top: 0;
    margin-left: auto;
  }

  .rtp-modal-snapshot {
    grid-template-columns: 1fr;
  }

  .rtp-modal-actions {
    flex-direction: column;
  }

  .rtp-export__btn {
    width: 100%;
    min-width: 0;
  }

  .rtp-chart-wrap {
    height: 220px;
  }

  .rtp-chart-wrap--wide {
    height: 260px;
  }

  .rtp-verdict__text {
    font-size: 0.98rem;
  }
}
