*,
*::before,
*::after {
  box-sizing: border-box;
}

/* Accent: design-tokens core colors.lettuce.500 */
:root {
  --lettuce: #9fe963;
  --ink: #1a202c;
  --ink-muted: #4a5568;
  --line: #e2e8f0;
  --surface: #f7fafc;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink);
  background: #fff;
  -webkit-font-smoothing: antialiased;
}

.num {
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.page {
  max-width: 1220px;
  margin: 0 auto;
  padding: 28px 22px 48px;
}

.page-header {
  margin-bottom: 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line);
}

.page-header h1 {
  font-size: 1.35rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin: 0 0 8px;
  color: var(--ink);
}

.lede {
  margin: 0;
  max-width: 62ch;
  color: var(--ink-muted);
  font-size: 0.95rem;
}

.brand-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.brand-row img {
  height: 28px;
  width: auto;
}

.comparison {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  align-items: start;
}

@media (max-width: 960px) {
  .comparison {
    grid-template-columns: 1fr;
  }
}

.panel {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  overflow: hidden;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.04);
}

.panel--new {
  border-color: #edf2f7;
  box-shadow: 0 8px 30px rgba(26, 32, 44, 0.06);
}

.panel__head {
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  font-weight: 600;
  font-size: 0.8rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--ink-muted);
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.panel__body {
  padding: 0;
  min-height: 480px;
}

.panel__body--pdf {
  height: min(78vh, 900px);
}

.pdf-frame {
  width: 100%;
  height: 100%;
  min-height: 480px;
  border: 0;
  display: block;
}

.pdf-fallback {
  padding: 20px;
}

.pdf-fallback a {
  color: var(--ink);
  font-weight: 600;
}

/* ----- Redesigned stub ----- */

.stub-new {
  padding: 20px 20px 28px;
  background: #fff;
}

.stub-new__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.stub-new__logo {
  display: block;
  height: 22px;
  width: auto;
}

.stub-new__product-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--ink-muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.party-block {
  margin-bottom: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.maker-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px 20px;
  flex-wrap: wrap;
  padding-bottom: 14px;
}

.maker-strip__brand {
  display: flex;
  align-items: center;
  gap: 12px 16px;
  flex-wrap: wrap;
  min-width: 0;
}

.maker-strip__logo {
  height: 44px;
  width: auto;
  display: block;
  flex-shrink: 0;
}

.maker-strip__name {
  margin: 0;
  font-size: 1.02rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ink);
  line-height: 1.25;
}

.party-block__divider {
  width: 100%;
  height: 0;
  margin: 0 0 16px;
  border: 0;
  border-top: 1px solid var(--line);
}

.party-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px 32px;
  align-items: start;
}

@media (max-width: 520px) {
  .party-grid {
    grid-template-columns: 1fr;
  }
}

.party {
  font-size: 0.9rem;
  line-height: 1.45;
  color: var(--ink);
}

.party__name {
  margin: 0 0 6px;
  font-size: 1rem;
  font-weight: 600;
}

.party__masked-id {
  margin: 0 0 10px;
  font-size: 0.85rem;
  color: var(--ink-muted);
  letter-spacing: 0.04em;
}

.party__masked-id--caps {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.party__addr {
  margin: 0 0 2px;
}

.party__addr--phone {
  margin-top: 6px;
  font-variant-numeric: tabular-nums;
}

.party-block__notes {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.reflection {
  margin-top: 36px;
  padding-top: 28px;
  border-top: 1px solid var(--line);
}

.reflection__title {
  margin: 0 0 10px;
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.reflection__lede {
  margin: 0 0 22px;
  max-width: 75ch;
  color: var(--ink-muted);
  font-size: 0.92rem;
  line-height: 1.55;
}

.reflection__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  align-items: start;
}

@media (max-width: 960px) {
  .reflection__grid {
    grid-template-columns: 1fr;
  }
}

.reflection__card {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 18px 18px 20px;
  background: #fff;
  height: 100%;
}

.reflection__card-title {
  margin: 0 0 12px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--lettuce);
}

.reflection__list {
  margin: 0;
  padding-left: 18px;
  color: var(--ink);
  font-size: 0.88rem;
  line-height: 1.55;
}

.reflection__list li {
  margin-bottom: 10px;
}

.reflection__list li:last-child {
  margin-bottom: 0;
}

.reflection__list strong {
  font-weight: 600;
  color: var(--ink);
}

.card {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 18px 18px 20px;
  margin-bottom: 14px;
  background: #fff;
}

.card--hero {
  background: linear-gradient(180deg, var(--surface) 0%, #fff 100%);
  border-color: #edf2f7;
  padding: 22px 20px 20px;
}

.card--footer {
  background: var(--surface);
  margin-bottom: 0;
}

.card__title {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin: 0 0 6px;
}

.card__hint {
  margin: 0 0 14px;
  font-size: 0.8rem;
  color: var(--ink-muted);
  line-height: 1.45;
}

.hero__eyebrow {
  margin: 0 0 6px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

.hero__amount {
  margin: 0 0 16px;
  font-size: clamp(2.25rem, 5vw, 2.75rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.05;
  color: var(--lettuce);
}

.hero__meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 20px;
  margin: 0 0 18px;
  padding: 0;
}

.hero__meta div {
  margin: 0;
}

.hero__meta dt {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-muted);
  margin-bottom: 2px;
}

.hero__meta dd {
  margin: 0;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--ink);
}

.hero__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.chip {
  display: inline-flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 12px;
  border-radius: 10px;
  background: #fff;
  border: 1px solid var(--line);
  min-width: 120px;
}

.chip__label {
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-muted);
}

.chip__value {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--ink);
}

.table-wrap {
  overflow-x: visible;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.data-table th,
.data-table td {
  padding: 10px 8px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

.data-table thead th {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-muted);
  text-align: left;
  border-bottom: 1px solid #cbd5e0;
}

.data-table thead th.num {
  text-align: right;
}

.data-table tbody th {
  font-weight: 500;
  text-align: left;
  color: var(--ink);
}

.data-table tbody td.num {
  font-weight: 600;
}

.data-table__total th,
.data-table__total td {
  border-bottom: none;
  padding-top: 12px;
  font-weight: 700;
}

.row-sub {
  display: block;
  margin-top: 4px;
  font-size: 0.72rem;
  font-weight: 400;
  color: var(--ink-muted);
  line-height: 1.35;
  max-width: 36ch;
}

.tax-group {
  margin-bottom: 16px;
}

.tax-group__title {
  margin: 0 0 8px;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--ink);
}

.tax-lines {
  list-style: none;
  margin: 0;
  padding: 0;
}

.tax-lines li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid #f0f4f8;
  font-size: 0.9rem;
}

.tax-lines li:last-child {
  border-bottom: none;
}

.tax-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 8px;
  padding-top: 14px;
  border-top: 2px solid var(--ink);
  font-weight: 700;
  font-size: 0.95rem;
}

.ytd-dl {
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
}

.ytd-dl div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.ytd-dl div:last-of-type {
  border-bottom: none;
  padding-bottom: 0;
}

.ytd-dl dt {
  font-size: 0.88rem;
  color: var(--ink-muted);
}

.ytd-dl dd {
  margin: 0;
  font-weight: 700;
}

.page-footer {
  margin-top: 32px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  font-size: 0.8rem;
  color: var(--ink-muted);
}

.page-footer code {
  font-size: 0.78rem;
}
