/* Centered page layout — single column, aligned ads & content */

:root {
  --layout-max: 1040px;
  --layout-pad: 1.25rem;
}

.site-shell {
  width: 100%;
  max-width: var(--layout-max);
  margin: 0 auto;
  padding: 1rem var(--layout-pad) 2.5rem;
}

.site-main {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

/* Sidebar rail removed from grid — use inline ad slots instead */
.ad-rail {
  display: none;
}

/* All in-flow ads align to content width */
.site-main > .ad-slot {
  width: 100%;
}

.ad-slot--leaderboard {
  max-width: 728px;
  margin-left: auto;
  margin-right: auto;
}

.ad-slot--rectangle.ad-slot--center {
  max-width: 336px;
  margin-left: auto;
  margin-right: auto;
}

.ad-rail--mobile {
  display: block;
  max-width: 336px;
  margin-left: auto;
  margin-right: auto;
}

@media (min-width: 900px) {
  .ad-rail--mobile {
    display: none;
  }
}

/* Desktop: leaderboard full content width */
@media (min-width: 900px) {
  .ad-slot--leaderboard {
    max-width: 100%;
  }
}

/* Ad slots */
.ad-slot {
  background: var(--surface);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
  overflow: hidden;
  text-align: center;
}

.ad-slot__label {
  display: block;
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  padding: 0.4rem 0.5rem;
  background: var(--surface-muted);
  border-bottom: 1px dashed var(--border);
}

.ad-slot__creative {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 90px;
  padding: 0.5rem;
  background: linear-gradient(180deg, var(--surface-muted) 0%, var(--surface) 100%);
}

.ad-slot__placeholder {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--muted);
}

.ad-slot--leaderboard .ad-slot__creative {
  min-height: 90px;
}

.ad-slot--rectangle .ad-slot__creative {
  min-height: 250px;
}

.ad-slot--banner .ad-slot__creative {
  min-height: 100px;
}

/* Unified calculator */
.calc-unified {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.calc-unified__toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.5rem;
  background: linear-gradient(180deg, var(--surface-muted) 0%, var(--surface) 100%);
  border-bottom: 1px solid var(--border);
}

.calc-unified__toolbar h2 {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
}

.calc-unified__toolbar p {
  margin: 0.15rem 0 0;
  font-size: 0.8rem;
  color: var(--muted);
}

.calc-unified__live {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
  padding: 0.35rem 0.65rem;
  background: var(--surface-muted);
  border: 1px solid var(--border);
  border-radius: 999px;
}

.calc-unified__grid {
  display: grid;
}

/* Tablet: stack panels (desktop uses side-by-side at 900px+) */
@media (min-width: 600px) and (max-width: 899px) {
  .calc-unified__grid {
    display: flex;
    flex-direction: column;
  }

  .calc-panel--results {
    order: -1;
  }
}

@media (min-width: 900px) {
  .calc-unified__grid {
    grid-template-columns: 1fr 1fr;
    align-items: start;
  }
}

.calc-panel {
  padding: 1.5rem;
  min-width: 0;
}

@media (min-width: 900px) {
  .calc-panel--inputs {
    border-right: 1px solid var(--border);
  }

  /* No sticky — prevents overlap on scroll with ads/FAQ below */
  .calc-panel--results {
    align-self: stretch;
  }
}

.calc-panel__title {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin: 0 0 1.25rem;
}

.calc-panel--results .result-hero {
  border-radius: var(--radius);
  margin: 0;
}

/* Content below calculator — full width of column */
.content-section {
  width: 100%;
  display: grid;
  gap: 1.25rem;
}

@media (min-width: 600px) {
  .content-section {
    grid-template-columns: 1fr 1fr;
    align-items: start;
  }
}

@media (max-width: 599px) {
  .content-section {
    grid-template-columns: 1fr;
  }
}

.content-section .card {
  box-shadow: var(--shadow);
  min-width: 0;
}

.page-hero {
  margin-bottom: 0;
  width: 100%;
}

.page-hero h1 {
  max-width: 100%;
}

/* Hub */
.hub-shell {
  max-width: var(--layout-max);
  margin: 0 auto;
  padding: 2rem var(--layout-pad) 3rem;
  width: 100%;
}

.hub-shell .ad-slot {
  width: 100%;
  max-width: 728px;
  margin-left: auto;
  margin-right: auto;
}

/* Footer matches content column */
.site-footer {
  width: 100%;
  max-width: var(--layout-max);
  margin: 0 auto;
  padding: 0 var(--layout-pad) 2rem;
  text-align: center;
}

.site-footer__inner {
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  font-size: 0.8rem;
  color: var(--muted);
}

.site-network {
  margin-top: 0.75rem;
}

.site-network a {
  color: var(--text);
  font-weight: 600;
}

.site-network a:hover {
  color: var(--primary);
}

.site-footer .ad-slot {
  width: 100%;
  max-width: 728px;
  margin: 0 auto 1.25rem;
}

.expense-insight {
  background: var(--primary-soft);
  border-color: var(--border-strong);
}

.calc-panel--results .waterfall,
.calc-panel--results .stat-row,
.calc-panel--results .schedule,
.calc-panel--results .chart-section,
.calc-panel--results .bracket-section {
  border-color: var(--border);
}

.calc-panel--results .stat-row {
  border-radius: 0;
}

.calc-panel--results .affiliate-strip {
  margin: 0;
  border-left: none;
  border-right: none;
  border-radius: 0;
}

.calc-panel--results .disclaimer-bar {
  margin: 1rem 0 0;
}
