.retroactive-page {
  --retro-credit: #0f8a60;
  --retro-credit-soft: #eaf8f2;
  --retro-debit: #c24152;
  --retro-debit-soft: #fff0f2;
  --retro-border: rgba(47, 72, 174, .14);
}

.retro-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  padding: clamp(1.35rem, 2vw, 2rem);
  background: linear-gradient(135deg, rgba(255,255,255,.95), rgba(239,244,255,.9));
}

.retro-hero-copy { max-width: 830px; }
.retro-title {
  margin: .45rem 0 .6rem;
  color: var(--shell-ink);
  font-size: clamp(1.85rem, 3vw, 3rem);
  line-height: 1.08;
  font-weight: 850;
  letter-spacing: -.025em;
}
.retro-flow {
  display: grid;
  grid-template-columns: repeat(4, max-content);
  align-items: center;
  gap: .65rem;
  flex: 0 0 auto;
}
.retro-flow span {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  color: #52617b;
  font-size: .82rem;
  font-weight: 700;
  white-space: nowrap;
}
.retro-flow b {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #fff;
  color: var(--shell-blue);
  border: 1px solid #c9d7f2;
}

.retro-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(440px, .92fr);
  gap: 1rem;
  align-items: start;
}
.retro-form-card,
.retro-result-card { min-width: 0; overflow: hidden; }
.retro-result-card { position: sticky; top: 108px; }
.retro-form-card .card-body,
.retro-result-card .card-body { padding: clamp(1rem, 1.7vw, 1.5rem); }

.retro-custom-percentages {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 42px minmax(0, 1fr);
  align-items: end;
  gap: .8rem;
  padding: 1rem;
  background: #f8faff;
  border: 1px solid var(--retro-border);
  border-radius: 18px;
}
.retro-percentage-arrow {
  height: 42px;
  display: grid;
  place-items: center;
  color: var(--shell-blue);
}

.retro-divider {
  margin: 1.35rem 0;
  border-color: rgba(47,72,174,.16);
}
.retro-fieldset-title {
  display: flex;
  align-items: center;
  gap: .5rem;
  margin: 0 0 .25rem;
  color: var(--shell-ink);
  font-size: 1rem;
  font-weight: 800;
}
.retro-segmented {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .5rem;
  padding: .35rem;
  background: #f3f6fb;
  border: 1px solid #dbe3ef;
  border-radius: 15px;
}
.retro-segmented .btn {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  border: 0;
  color: #5a6880;
  font-weight: 700;
  border-radius: 11px;
}
.retro-segmented .btn-check:checked + .btn {
  background: #fff;
  color: var(--shell-blue);
  box-shadow: 0 3px 10px rgba(31,61,112,.1);
}
.retro-segmented .btn:focus-visible {
  outline: 3px solid rgba(37,99,235,.24);
  outline-offset: 2px;
}

.retro-base-items { display: grid; gap: .65rem; }
.retro-base-row {
  display: grid;
  grid-template-columns: 88px minmax(150px, 1fr) minmax(130px, .55fr) 42px;
  gap: .55rem;
  align-items: center;
}
.retro-base-row .btn-remove-base {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  padding: 0;
  border-radius: 50%;
}
.retro-base-total {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: .85rem;
  padding-top: .85rem;
  border-top: 1px solid #dbe3ef;
  color: #5c6880;
}
.retro-base-total strong { color: var(--shell-blue); font-size: 1.08rem; }

.retro-dsr-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 1rem;
  padding: .9rem 1rem;
  background: #f8fbff;
  border: 1px solid var(--retro-border);
  border-radius: 18px;
}
.retro-dsr-panel .app-toggle { margin: 0; }
.retro-dsr-fields {
  display: grid;
  grid-template-columns: repeat(2, 92px);
  gap: .55rem;
}
.retro-dsr-fields label { margin: 0; }
.retro-dsr-fields small {
  display: block;
  margin-bottom: .25rem;
  color: #66748a;
  font-weight: 700;
}
.retro-dsr-fields input { text-align: center; font-weight: 750; }
.retro-codes {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .75rem;
}
.retro-primary-cta {
  min-height: 52px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  border-radius: 15px;
  font-weight: 800;
  box-shadow: 0 10px 22px rgba(37,99,235,.18);
}

.retro-status-badge {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .42rem .7rem;
  border: 1px solid #d7deea;
  border-radius: 999px;
  background: #f8fafc;
  color: #64748b;
  font-size: .78rem;
  font-weight: 800;
  white-space: nowrap;
}
.retro-status-badge.is-credit { color: var(--retro-credit); background: var(--retro-credit-soft); border-color: #bde8d6; }
.retro-status-badge.is-debit { color: var(--retro-debit); background: var(--retro-debit-soft); border-color: #f4c8cf; }
.retro-empty-state {
  min-height: 340px;
  display: grid;
  place-items: center;
  align-content: center;
  text-align: center;
  padding: 2rem;
  color: #6b778d;
}
.retro-empty-state > .material-icons-round {
  width: 72px;
  height: 72px;
  display: grid;
  place-items: center;
  margin-bottom: 1rem;
  border-radius: 22px;
  background: #eef3ff;
  color: var(--shell-blue);
  font-size: 38px;
}
.retro-empty-state strong { color: var(--shell-ink); font-size: 1.15rem; }
.retro-empty-state p { max-width: 390px; margin: .35rem 0 0; }

.retro-summary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .75rem;
}
.retro-summary-card {
  min-width: 0;
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  grid-template-areas: "icon label" "icon value";
  align-items: center;
  column-gap: .65rem;
  padding: .9rem;
  background: #fff;
  border: 1px solid #dbe3f0;
  border-radius: 17px;
}
.retro-summary-card > .material-icons-round {
  grid-area: icon;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 13px;
  background: #eef3ff;
}
.retro-summary-card small { grid-area: label; color: #68758b; font-weight: 700; }
.retro-summary-card strong { grid-area: value; min-width: 0; color: var(--shell-ink); font-size: 1.12rem; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.retro-summary-total {
  grid-column: 1 / -1;
  background: linear-gradient(135deg, #f6f9ff, #eaf1ff);
  border-color: #bfcff0;
}
.retro-summary-total strong { color: var(--shell-blue); font-size: 1.45rem; }
.retro-summary-total.is-credit { background: linear-gradient(135deg, #f5fffb, var(--retro-credit-soft)); border-color: #bde8d6; }
.retro-summary-total.is-credit strong { color: var(--retro-credit); }
.retro-summary-total.is-debit { background: linear-gradient(135deg, #fff8f9, var(--retro-debit-soft)); border-color: #f0c4cc; }
.retro-summary-total.is-debit strong { color: var(--retro-debit); }

.retro-results-table {
  border: 1px solid #dbe3ef;
  border-radius: 16px;
  overflow: hidden;
}
.retro-results-table thead th {
  background: #f3f6fb;
  color: #526078;
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .045em;
  white-space: nowrap;
}
.retro-result-description strong,
.retro-result-description small { display: block; }
.retro-result-description small { color: #728096; margin-top: .15rem; }
.retro-value-credit { color: var(--retro-credit) !important; }
.retro-value-debit { color: var(--retro-debit) !important; }

.retro-memory-list { display: grid; gap: .8rem; }
.retro-memory-item {
  padding: .9rem 0;
  border-bottom: 1px solid #dbe3ef;
}
.retro-memory-item:first-child { padding-top: 0; }
.retro-memory-item:last-child { padding-bottom: 0; border-bottom: 0; }
.retro-memory-item strong { display: block; color: var(--shell-ink); }
.retro-memory-item p { margin: .2rem 0 .55rem; color: #66738a; }
.retro-memory-formula {
  display: block;
  padding: .65rem .75rem;
  border-radius: 11px;
  background: #102943;
  color: #edf7ff;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  line-height: 1.45;
  overflow-wrap: anywhere;
}
.retro-help-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 1.35rem 1.5rem;
}
.retro-help-panel .btn { flex: 0 0 auto; display: inline-flex; align-items: center; gap: .4rem; }

@media (max-width: 1199.98px) {
  .retro-layout { grid-template-columns: 1fr; }
  .retro-result-card { position: static; }
  .retro-hero { align-items: flex-start; }
  .retro-flow { grid-template-columns: repeat(2, max-content); }
}

@media (max-width: 767.98px) {
  .retro-hero { display: block; }
  .retro-flow { margin-top: 1rem; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .retro-flow span { white-space: normal; }
  .retro-custom-percentages { grid-template-columns: 1fr; }
  .retro-percentage-arrow { height: 22px; transform: rotate(90deg); }
  .retro-base-row { grid-template-columns: 82px minmax(0, 1fr) 42px; }
  .retro-base-row .retro-base-description { grid-column: 1 / -1; grid-row: 2; }
  .retro-base-row .retro-base-value { grid-column: 2; grid-row: 1; }
  .retro-base-row .btn-remove-base { grid-column: 3; grid-row: 1; }
  .retro-dsr-panel { grid-template-columns: 1fr; }
  .retro-dsr-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .retro-codes { grid-template-columns: 1fr; }
  .retro-help-panel { align-items: stretch; flex-direction: column; }
  .retro-help-panel .btn { justify-content: center; }
}

@media (max-width: 479.98px) {
  .retro-segmented { grid-template-columns: 1fr; }
  .retro-summary-grid { grid-template-columns: 1fr; }
  .retro-summary-total { grid-column: auto; }
  .retro-base-row { grid-template-columns: minmax(0, 1fr) 42px; }
  .retro-base-row .retro-base-code,
  .retro-base-row .retro-base-value,
  .retro-base-row .retro-base-description { grid-column: 1; }
  .retro-base-row .retro-base-code { grid-row: 1; }
  .retro-base-row .retro-base-description { grid-row: 2; }
  .retro-base-row .retro-base-value { grid-row: 3; }
  .retro-base-row .btn-remove-base { grid-column: 2; grid-row: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .retro-primary-cta,
  .appbar-icon-btn { transition: none !important; }
}

/* ===== v3.3.4 — verbas 135, 147 e 376 ===== */
.retro-verb-rule {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .85rem 1rem;
  border: 1px solid #dbe3ef;
  border-radius: 16px;
  background: #f8fbff;
}
.retro-verb-rule > .material-icons-round { font-size: 1.75rem; }
.retro-verb-rule small { display: block; color: #6b7890; font-weight: 700; }
.retro-verb-rule strong { display: block; color: var(--shell-ink); }
.retro-summary-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.retro-results-table td,
.retro-results-table th { vertical-align: middle; }
.retro-results-table td:not(:first-child) { font-variant-numeric: tabular-nums; }
@media (max-width: 1399.98px) {
  .retro-summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 575.98px) {
  .retro-summary-grid { grid-template-columns: 1fr; }
}

/* ===== v3.3.5 — modo 3 incremental e hero compacto ===== */
.retro-hero-compact {
  min-height: 0;
  display: flex !important;
  justify-content: flex-start;
  align-items: center !important;
  gap: .7rem;
  padding: .62rem .85rem !important;
  background: #fff !important;
}
.retro-hero-icon {
  flex: 0 0 auto;
  font-size: 1.7rem !important;
}
.retro-hero-compact .retro-hero-copy { max-width: none; }
.retro-hero-compact .eyebrow-shell {
  margin-bottom: .1rem;
  font-size: .67rem;
  letter-spacing: .075em;
}
.retro-hero-compact .retro-title {
  margin: 0;
  font-size: clamp(1.05rem, 1.5vw, 1.35rem);
  line-height: 1.15;
  letter-spacing: -.01em;
}
.retro-hero-compact .shell-lead {
  margin-top: .12rem;
  font-size: .78rem;
  line-height: 1.35;
  color: #68758b;
}
.retro-category-panel,
.retro-percent-hint {
  border: 1px solid #e0e7f1;
  border-radius: 13px;
  background: #fbfcff;
}
.retro-category-panel { padding: .75rem; }
.retro-percent-hint {
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .6rem .75rem;
  color: #64748b;
  font-size: .82rem;
}
.retro-verb-rule {
  padding: .58rem .72rem !important;
  border-radius: 12px !important;
  background: #fbfcff !important;
}
.retro-verb-rule > .material-icons-round { font-size: 1.35rem !important; }
.retro-verb-rule small { font-size: .67rem; }
.retro-verb-rule strong { font-size: .86rem; }
.retro-divider { margin: .9rem 0 !important; }
.retro-form-card .card-body,
.retro-result-card .card-body { padding: .9rem !important; }
.retro-summary-card {
  padding: .68rem !important;
  border-radius: 13px !important;
}
.retro-summary-card > .material-icons-round {
  background: transparent !important;
  width: 30px !important;
  height: 30px !important;
  border-radius: 0 !important;
  font-size: 1.25rem;
}
.retro-summary-card { grid-template-columns: 30px minmax(0,1fr); column-gap: .45rem; }
.retro-summary-card strong { font-size: 1rem; }
.retro-summary-total strong { font-size: 1.15rem; }
@media (max-width: 767.98px) {
  .retro-hero-compact { display: flex !important; padding: .55rem .65rem !important; }
  .retro-hero-compact .shell-lead { display: none; }
  .retro-hero-icon { font-size: 1.45rem !important; }
}
