/* ==========================================================================
   RateCraftPro — Boutique Consultant Theme
   Palette: Warm Terracotta (#c2410c), Amber (#d97706), Deep Espresso (#1c1917)
   Surface: Warm Ivory (#fffbeb / #fafaf9) & Crisp Studio Cards (#ffffff)
   Zero External Dependencies • Responsive • Print-Ready
   ========================================================================== */

:root {
  --bg-ivory: #fafaf9;
  --bg-warm: #fffbeb;
  --bg-warm-subtle: #fef3c7;
  --surface: #ffffff;
  --surface-muted: #f5f5f4;
  --espresso: #1c1917;
  --espresso-soft: #292524;
  --ink-body: #44403c;
  --ink-muted: #78716c;
  --terracotta: #c2410c;
  --terracotta-hover: #9a3412;
  --terracotta-soft: #ffedd5;
  --amber: #d97706;
  --amber-soft: #fef3c7;
  --sage: #15803d;
  --sage-soft: #dcfce7;
  --border: #e7e5e4;
  --border-strong: #d6d3d1;
  --shadow-sm: 0 1px 3px rgba(28, 25, 23, 0.06), 0 1px 2px rgba(28, 25, 23, 0.04);
  --shadow-md: 0 10px 25px -5px rgba(28, 25, 23, 0.07), 0 4px 10px -4px rgba(28, 25, 23, 0.04);
  --shadow-lg: 0 20px 40px -12px rgba(28, 25, 23, 0.12);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --container-max: 1180px;
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  color: var(--ink-body);
  background: linear-gradient(180deg, var(--bg-warm) 0%, var(--bg-ivory) 380px, var(--bg-ivory) 100%);
  line-height: 1.6;
  font-size: 16px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main {
  flex: 1;
}

h1, h2, h3, h4 {
  color: var(--espresso);
  line-height: 1.22;
  margin-top: 0;
  letter-spacing: -0.02em;
}

a {
  color: var(--terracotta);
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color 0.15s ease;
}

a:hover {
  color: var(--terracotta-hover);
}

.tabular {
  font-variant-numeric: tabular-nums;
}

.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 20px;
}

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

/* ==========================================================================
   SwiftKitHub Global Top Bar & Internal Linking Mesh
   ========================================================================== */

.skh-topbar {
  background: var(--espresso);
  color: #d6d3d1;
  font-size: 0.81rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.09);
}

.skh-topbar-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
  padding-top: 8px;
  padding-bottom: 8px;
}

.skh-breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  line-height: 1.4;
}

.skh-breadcrumbs a {
  color: #fdba74;
  text-decoration: none;
  font-weight: 600;
}

.skh-breadcrumbs a:hover {
  color: #fffbeb;
  text-decoration: underline;
}

.skh-breadcrumbs .skh-sep {
  color: #78716c;
  user-select: none;
}

.skh-breadcrumbs span:not(.skh-sep) {
  color: #f5f5f4;
  font-weight: 600;
}

.skh-all-tools {
  color: #fffbeb;
  background: rgba(255, 255, 255, 0.09);
  border: 1px solid rgba(253, 186, 116, 0.3);
  border-radius: 999px;
  padding: 3px 11px;
  font-size: 0.78rem;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.skh-all-tools:hover {
  background: var(--terracotta);
  border-color: var(--terracotta);
  color: #ffffff;
}

.calculator-shell > .quote-estimator-band:first-child {
  border-top: none;
  border-bottom: 1px solid var(--border);
}

.related-section {
  padding: 48px 0 56px;
  background: var(--bg-warm);
  border-top: 1px solid var(--border);
}

.related-header {
  max-width: 860px;
  margin-bottom: 26px;
}

.related-header h2 {
  font-family: var(--font-serif);
  font-size: clamp(1.55rem, 2.8vw, 2rem);
  margin-bottom: 6px;
}

.related-header p {
  margin: 0;
  color: var(--ink-muted);
  font-size: 0.95rem;
}

.related-group-title {
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--espresso-soft);
  margin: 0 0 12px;
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
  margin-bottom: 28px;
}

.related-grid:last-child {
  margin-bottom: 0;
}

.related-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  text-decoration: none;
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.related-card:hover {
  transform: translateY(-2px);
  border-color: var(--terracotta);
  box-shadow: var(--shadow-md);
}

.related-card-tag {
  display: inline-block;
  font-size: 0.71rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--terracotta-hover);
  margin-bottom: 5px;
}

.related-card-title {
  display: block;
  font-size: 0.98rem;
  font-weight: 700;
  color: var(--espresso);
  line-height: 1.35;
  margin-bottom: 6px;
}

.related-card-desc {
  display: block;
  font-size: 0.83rem;
  color: var(--ink-muted);
  line-height: 1.45;
}

/* ==========================================================================
   Sticky Header & Navigation
   ========================================================================== */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 251, 235, 0.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  gap: 16px;
}

.brand-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--espresso);
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: -0.025em;
}

.brand-link:hover {
  color: var(--espresso);
}

.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: linear-gradient(135deg, var(--terracotta) 0%, #ea580c 100%);
  color: #fffbeb;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 3px 8px rgba(194, 65, 12, 0.28);
  flex-shrink: 0;
}

.brand-pro {
  color: var(--terracotta);
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 6px;
}

.site-nav a {
  text-decoration: none;
  color: var(--ink-body);
  font-size: 0.92rem;
  font-weight: 600;
  padding: 7px 12px;
  border-radius: var(--radius-sm);
  transition: background-color 0.15s ease, color 0.15s ease;
}

.site-nav a:hover,
.site-nav a[aria-current="page"] {
  background: var(--terracotta-soft);
  color: var(--terracotta-hover);
}

.nav-toggle {
  display: none;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 7px 10px;
  color: var(--espresso);
  cursor: pointer;
  align-items: center;
  gap: 6px;
  font-size: 0.88rem;
  font-weight: 600;
}

/* ==========================================================================
   AdSense Container Slots
   ========================================================================== */

.ad-slot {
  margin: 16px auto;
  max-width: var(--container-max);
  padding: 0 20px;
}

.ad-slot[hidden] {
  display: none !important;
}

.ad-placeholder-box {
  border: 1.5px dashed var(--border-strong);
  background: rgba(255, 255, 255, 0.65);
  border-radius: var(--radius-md);
  padding: 18px;
  text-align: center;
  color: var(--ink-muted);
  font-size: 0.82rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* ==========================================================================
   Hero Section (Compact Above-the-Fold Boutique Header)
   ========================================================================== */

.hero-section {
  padding: 28px 0 18px;
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--terracotta-soft);
  color: var(--terracotta-hover);
  border: 1px solid #fed7aa;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  margin-bottom: 12px;
}

.hero-header {
  max-width: 820px;
}

.hero-title {
  font-family: var(--font-serif);
  font-size: clamp(1.85rem, 3.6vw, 2.65rem);
  font-weight: 700;
  color: var(--espresso);
  margin-bottom: 10px;
}

.hero-subtitle {
  font-size: 1.04rem;
  color: var(--ink-body);
  margin: 0;
  max-width: 740px;
}

/* ==========================================================================
   Core Interactive Calculator Workspace
   ========================================================================== */

.tool-section {
  padding: 8px 0 36px;
}

.calculator-shell {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

/* Mode Tabs */
.mode-tabs {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  background: #f5f5f2;
  border-bottom: 1px solid var(--border);
  padding: 8px;
  gap: 8px;
}

.mode-tab {
  appearance: none;
  border: 1px solid transparent;
  background: transparent;
  padding: 13px 16px;
  border-radius: var(--radius-md);
  cursor: pointer;
  text-align: left;
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--ink-body);
  transition: all 0.16s ease;
  font-family: inherit;
}

.mode-tab:hover {
  background: rgba(255, 255, 255, 0.7);
  color: var(--espresso);
}

.mode-tab[aria-selected="true"] {
  background: var(--surface);
  border-color: var(--border);
  box-shadow: var(--shadow-sm);
  color: var(--espresso);
}

.mode-tab-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--surface-muted);
  color: var(--ink-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.16s ease;
}

.mode-tab[aria-selected="true"] .mode-tab-icon {
  background: var(--terracotta);
  color: #fffbeb;
}

.mode-tab-title {
  display: block;
  font-weight: 700;
  font-size: 0.96rem;
  color: inherit;
}

.mode-tab-sub {
  display: block;
  font-size: 0.79rem;
  color: var(--ink-muted);
  margin-top: 1px;
}

/* Presets Bar */
.presets-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 24px;
  background: var(--bg-warm);
  border-bottom: 1px solid var(--border);
}

.presets-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
}

.presets-label {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--ink-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-right: 4px;
}

.preset-chip {
  appearance: none;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--espresso-soft);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 5px 11px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: inherit;
}

.preset-chip:hover,
.preset-chip.is-active {
  border-color: var(--terracotta);
  background: var(--terracotta-soft);
  color: var(--terracotta-hover);
}

.preset-reset {
  background: transparent;
  border: none;
  color: var(--ink-muted);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
  padding: 4px 6px;
  font-family: inherit;
}

.preset-reset:hover {
  color: var(--espresso);
}

/* Two-Column Calculator Grid */
.calc-pane[hidden] {
  display: none !important;
}

.calc-grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  align-items: start;
}

.inputs-column {
  padding: 26px 28px;
  border-right: 1px solid var(--border);
}

.outputs-column {
  padding: 26px 28px;
  background: linear-gradient(180deg, #fffdf7 0%, #fafaf9 100%);
}

.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.panel-heading h2 {
  font-size: 1.08rem;
  margin: 0;
}

.panel-badge {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--terracotta-hover);
  background: var(--terracotta-soft);
  padding: 3px 9px;
  border-radius: 999px;
}

/* Form Controls */
.field-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

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

.field-grid .field-group {
  margin-bottom: 0;
}

.field-label-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}

.field-label {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--espresso-soft);
}

.field-value-pill {
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--terracotta);
  background: var(--terracotta-soft);
  padding: 2px 8px;
  border-radius: 6px;
}

.input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.input-prefix,
.input-suffix {
  position: absolute;
  color: var(--ink-muted);
  font-weight: 600;
  font-size: 0.92rem;
  pointer-events: none;
}

.input-prefix {
  left: 12px;
}

.input-suffix {
  right: 12px;
}

.num-input,
.text-input,
.select-input {
  width: 100%;
  height: 42px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--espresso);
  font-size: 0.96rem;
  font-weight: 600;
  font-family: inherit;
  padding: 0 12px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  font-variant-numeric: tabular-nums;
}

.has-prefix .num-input {
  padding-left: 28px;
}

.has-suffix .num-input {
  padding-right: 46px;
}

.num-input:focus,
.text-input:focus,
.select-input:focus {
  outline: none;
  border-color: var(--terracotta);
  box-shadow: 0 0 0 3px rgba(194, 65, 12, 0.15);
}

.field-hint {
  margin: 5px 0 0;
  font-size: 0.78rem;
  color: var(--ink-muted);
  line-height: 1.45;
}

/* Custom Range Slider */
.range-slider {
  width: 100%;
  accent-color: var(--terracotta);
  height: 6px;
  cursor: pointer;
  margin: 6px 0 2px;
}

.utilization-callout {
  margin-top: 8px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--bg-warm);
  border: 1px solid #fde68a;
  font-size: 0.8rem;
  color: var(--espresso-soft);
  line-height: 1.45;
}

.utilization-callout strong {
  color: var(--terracotta-hover);
}

/* Direction Switcher in Tab 2 */
.direction-toggle {
  display: inline-grid;
  grid-template-columns: 1fr 1fr;
  background: var(--surface-muted);
  border: 1px solid var(--border);
  padding: 4px;
  border-radius: var(--radius-sm);
  width: 100%;
  margin-bottom: 18px;
  gap: 4px;
}

.dir-btn {
  appearance: none;
  border: none;
  background: transparent;
  padding: 8px 10px;
  border-radius: 6px;
  font-size: 0.83rem;
  font-weight: 700;
  color: var(--ink-muted);
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s ease;
}

.dir-btn.is-active {
  background: var(--espresso);
  color: #fffbeb;
  box-shadow: var(--shadow-sm);
}

/* ==========================================================================
   Live Output Cards & Metrics
   ========================================================================== */

.hero-rate-card {
  background: var(--espresso);
  color: #fffbeb;
  border-radius: var(--radius-md);
  padding: 22px 24px;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-md);
  margin-bottom: 16px;
}

.hero-rate-card::after {
  content: "";
  position: absolute;
  top: -40px;
  right: -40px;
  width: 150px;
  height: 150px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(217, 119, 6, 0.28) 0%, rgba(194, 65, 12, 0) 70%);
  pointer-events: none;
}

.hero-rate-eyebrow {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: #fdba74;
  font-weight: 700;
  margin-bottom: 4px;
}

.hero-rate-main {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
}

.hero-rate-number {
  font-family: var(--font-serif);
  font-size: clamp(2.35rem, 4vw, 3.05rem);
  font-weight: 700;
  line-height: 1.05;
  color: #ffffff;
}

.hero-rate-unit {
  font-size: 1rem;
  color: #d6d3d1;
  font-weight: 600;
}

.hero-rate-floor {
  margin-top: 8px;
  font-size: 0.83rem;
  color: #e7e5e4;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.hero-rate-floor span {
  background: rgba(255, 255, 255, 0.1);
  padding: 3px 9px;
  border-radius: 6px;
}

/* Secondary Metric Grid */
.metric-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}

.metric-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 16px;
}

.metric-box-label {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--ink-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.metric-box-value {
  font-size: 1.42rem;
  font-weight: 800;
  color: var(--espresso);
  margin-top: 3px;
}

.metric-box-sub {
  font-size: 0.77rem;
  color: var(--ink-muted);
  margin-top: 2px;
}

/* Retainer Tiers Box */
.retainer-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 16px;
}

.retainer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.retainer-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--espresso);
}

.discount-pills {
  display: inline-flex;
  gap: 4px;
  background: var(--surface-muted);
  padding: 3px;
  border-radius: 7px;
}

.discount-pill {
  appearance: none;
  border: none;
  background: transparent;
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--ink-muted);
  padding: 4px 8px;
  border-radius: 5px;
  cursor: pointer;
  font-family: inherit;
}

.discount-pill.is-active {
  background: var(--terracotta);
  color: #ffffff;
}

.retainer-tiers-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.retainer-tier {
  background: var(--bg-ivory);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 10px;
  text-align: center;
}

.retainer-tier-hrs {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--ink-muted);
}

.retainer-tier-price {
  font-size: 1.12rem;
  font-weight: 800;
  color: var(--espresso);
  margin: 3px 0 1px;
}

.retainer-tier-eff {
  font-size: 0.72rem;
  color: var(--terracotta);
  font-weight: 600;
}

/* Annual Breakdown Bar & Bridge List */
.breakdown-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 16px;
}

.stacked-bar {
  display: flex;
  height: 10px;
  border-radius: 999px;
  overflow: hidden;
  background: var(--surface-muted);
  margin: 10px 0 14px;
  gap: 2px;
}

.bar-seg-net { background: var(--espresso); }
.bar-seg-tax { background: var(--terracotta); }
.bar-seg-cost { background: var(--amber); }
.bar-seg-profit { background: var(--sage); }

.breakdown-list {
  list-style: none;
  padding: 0;
  margin: 0;
  font-size: 0.84rem;
}

.breakdown-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 0;
  border-bottom: 1px dashed var(--border);
}

.breakdown-list li:last-child {
  border-bottom: none;
  padding-bottom: 0;
  font-weight: 800;
  color: var(--espresso);
}

.dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  margin-right: 7px;
}

/* Action Row Buttons */
.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  font-family: inherit;
  transition: all 0.15s ease;
  border: 1px solid transparent;
}

.btn-primary {
  background: var(--terracotta);
  color: #ffffff;
}

.btn-primary:hover {
  background: var(--terracotta-hover);
  color: #ffffff;
}

.btn-secondary {
  background: var(--surface);
  color: var(--espresso);
  border-color: var(--border-strong);
}

.btn-secondary:hover {
  border-color: var(--espresso);
  background: var(--bg-ivory);
}

/* ==========================================================================
   Bonus Section: Fixed-Fee Project Quote Estimator
   ========================================================================== */

.quote-estimator-band {
  border-top: 1px solid var(--border);
  background: linear-gradient(135deg, #fffbeb 0%, #fff7ed 100%);
  padding: 26px 28px;
}

.quote-band-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.quote-band-title {
  display: flex;
  align-items: center;
  gap: 10px;
}

.quote-band-title h3 {
  margin: 0;
  font-size: 1.15rem;
}

.bonus-pill {
  background: var(--espresso);
  color: #fdba74;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 4px 9px;
  border-radius: 999px;
}

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

.risk-selector {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.risk-btn {
  appearance: none;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  border-radius: var(--radius-sm);
  padding: 9px 8px;
  cursor: pointer;
  text-align: center;
  font-family: inherit;
  transition: all 0.15s ease;
}

.risk-btn strong {
  display: block;
  font-size: 0.84rem;
  color: var(--espresso);
}

.risk-btn span {
  display: block;
  font-size: 0.74rem;
  color: var(--ink-muted);
}

.risk-btn.is-active {
  border-color: var(--terracotta);
  background: var(--terracotta-soft);
  box-shadow: 0 0 0 1px var(--terracotta);
}

.risk-btn.is-active strong {
  color: var(--terracotta-hover);
}

.proposal-preview-card {
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  padding: 18px;
  box-shadow: var(--shadow-sm);
}

.proposal-top-summary {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 12px;
}

.proposal-total-price {
  font-family: var(--font-serif);
  font-size: 1.85rem;
  font-weight: 700;
  color: var(--espresso);
}

.proposal-text-output {
  width: 100%;
  min-height: 158px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-ivory);
  color: var(--espresso-soft);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.8rem;
  line-height: 1.5;
  padding: 12px;
  resize: vertical;
  margin-bottom: 12px;
}

/* ==========================================================================
   Contextual Affiliate Partner Cards (#recommended-tools)
   ========================================================================== */

.partners-section {
  padding: 20px 0 44px;
}

.partners-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
}

.partners-header h2 {
  font-family: var(--font-serif);
  font-size: 1.6rem;
  margin-bottom: 4px;
}

.partners-header p {
  margin: 0;
  color: var(--ink-muted);
  font-size: 0.94rem;
}

.ftc-subtle-note {
  font-size: 0.78rem;
  color: var(--ink-muted);
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 5px 11px;
  border-radius: 999px;
}

.affiliate-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.affiliate-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 22px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: var(--shadow-sm);
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}

.affiliate-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: #fdba74;
}

.affiliate-badge {
  display: inline-block;
  font-size: 0.74rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--terracotta-hover);
  background: var(--terracotta-soft);
  padding: 4px 10px;
  border-radius: 999px;
  margin-bottom: 12px;
}

.affiliate-name {
  font-size: 1.18rem;
  font-weight: 800;
  color: var(--espresso);
  margin-bottom: 8px;
}

.affiliate-desc {
  font-size: 0.92rem;
  color: var(--ink-body);
  margin: 0 0 18px;
  line-height: 1.55;
}

.affiliate-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 11px 16px;
  border-radius: var(--radius-sm);
  background: var(--espresso);
  color: #fffbeb;
  text-decoration: none;
  font-weight: 700;
  font-size: 0.9rem;
  transition: background-color 0.15s ease;
}

.affiliate-cta:hover {
  background: var(--terracotta);
  color: #ffffff;
}

/* ==========================================================================
   SEO Guide Section (#guide) & Benchmark Tables
   ========================================================================== */

.guide-section {
  padding: 48px 0;
  background: var(--surface);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.guide-container {
  max-width: 880px;
  margin: 0 auto;
}

.section-kicker {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--terracotta);
  margin-bottom: 8px;
}

.guide-container h2 {
  font-family: var(--font-serif);
  font-size: clamp(1.65rem, 3vw, 2.15rem);
  margin-bottom: 16px;
}

.guide-container h3 {
  font-size: 1.24rem;
  margin-top: 32px;
  margin-bottom: 10px;
  color: var(--espresso);
}

.guide-container p,
.guide-container li {
  font-size: 1rem;
  line-height: 1.72;
  color: var(--ink-body);
}

.guide-container ul,
.guide-container ol {
  padding-left: 22px;
  margin-bottom: 20px;
}

.guide-container li {
  margin-bottom: 8px;
}

.formula-callout {
  background: var(--bg-warm);
  border-left: 4px solid var(--terracotta);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  padding: 18px 22px;
  margin: 22px 0;
}

.formula-callout strong {
  display: block;
  color: var(--espresso);
  margin-bottom: 6px;
}

.formula-callout code {
  display: block;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.9rem;
  color: var(--terracotta-hover);
  background: rgba(255, 255, 255, 0.75);
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid #fed7aa;
  overflow-x: auto;
}

.table-scroll {
  overflow-x: auto;
  margin: 22px 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.benchmark-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
  background: var(--surface);
}

.benchmark-table th,
.benchmark-table td {
  padding: 12px 15px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.benchmark-table th {
  background: var(--bg-warm);
  color: var(--espresso);
  font-weight: 800;
  font-size: 0.83rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.benchmark-table tr:last-child td {
  border-bottom: none;
}

/* ==========================================================================
   Interactive FAQ Accordion (#faq)
   ========================================================================== */

.faq-section {
  padding: 52px 0;
}

.faq-container {
  max-width: 860px;
  margin: 0 auto;
}

.faq-header {
  margin-bottom: 24px;
}

.faq-header h2 {
  font-family: var(--font-serif);
  font-size: clamp(1.6rem, 2.8vw, 2.05rem);
  margin-bottom: 8px;
}

.faq-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.faq-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.faq-trigger {
  width: 100%;
  appearance: none;
  background: transparent;
  border: none;
  padding: 18px 22px;
  text-align: left;
  font-size: 1.02rem;
  font-weight: 700;
  color: var(--espresso);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  font-family: inherit;
}

.faq-trigger:hover {
  color: var(--terracotta);
}

.faq-chevron {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  color: var(--terracotta);
  transition: transform 0.2s ease;
}

.faq-trigger[aria-expanded="true"] .faq-chevron {
  transform: rotate(180deg);
}

.faq-panel {
  padding: 0 22px 18px;
  color: var(--ink-body);
  font-size: 0.96rem;
  line-height: 1.65;
}

.faq-panel[hidden] {
  display: none;
}

/* ==========================================================================
   Content & Legal Pages (About, Contact, Privacy, Terms)
   ========================================================================== */

.legal-section {
  padding: 44px 0 64px;
}

.legal-card {
  max-width: 840px;
  margin: 0 auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 38px 42px;
  box-shadow: var(--shadow-md);
}

.legal-card h1 {
  font-family: var(--font-serif);
  font-size: clamp(1.85rem, 3.2vw, 2.35rem);
  margin-bottom: 8px;
}

.legal-updated {
  font-size: 0.86rem;
  color: var(--ink-muted);
  margin-bottom: 28px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--border);
}

.legal-card h2 {
  font-size: 1.25rem;
  margin-top: 28px;
  margin-bottom: 10px;
}

.legal-card p,
.legal-card li {
  line-height: 1.7;
  color: var(--ink-body);
}

.contact-box {
  background: var(--bg-warm);
  border: 1px solid #fed7aa;
  border-radius: var(--radius-md);
  padding: 20px 22px;
  margin: 20px 0 28px;
}

.contact-form {
  display: grid;
  gap: 16px;
  margin-top: 20px;
}

.textarea-input {
  width: 100%;
  min-height: 130px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--espresso);
  font-size: 0.96rem;
  font-family: inherit;
  padding: 12px;
  resize: vertical;
}

.textarea-input:focus {
  outline: none;
  border-color: var(--terracotta);
  box-shadow: 0 0 0 3px rgba(194, 65, 12, 0.15);
}

/* ==========================================================================
   Site Footer
   ========================================================================== */

.site-footer {
  background: var(--espresso);
  color: #d6d3d1;
  padding: 44px 0 32px;
  margin-top: auto;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr;
  gap: 32px;
  padding-bottom: 28px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.footer-brand {
  color: #fffbeb;
  font-weight: 800;
  font-size: 1.15rem;
  text-decoration: none;
  display: inline-block;
  margin-bottom: 10px;
}

.footer-brand:hover {
  color: #fdba74;
}

.footer-desc {
  font-size: 0.88rem;
  color: #a8a29e;
  margin: 0 0 14px;
  max-width: 420px;
}

.footer-disclosure {
  font-size: 0.8rem;
  color: #d6d3d1;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-sm);
  padding: 10px 13px;
  line-height: 1.5;
}

.footer-col h3 {
  color: #fffbeb;
  font-size: 0.86rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 12px;
}

.footer-links {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 8px;
}

.footer-links a {
  color: #d6d3d1;
  text-decoration: none;
  font-size: 0.9rem;
}

.footer-links a:hover {
  color: #fdba74;
  text-decoration: underline;
}

.footer-bottom {
  padding-top: 22px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  font-size: 0.82rem;
  color: #a8a29e;
}

/* Toast Notification */
.toast-msg {
  position: fixed;
  bottom: 22px;
  right: 22px;
  background: var(--espresso);
  color: #fffbeb;
  border: 1px solid var(--terracotta);
  padding: 11px 18px;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  font-weight: 600;
  box-shadow: var(--shadow-lg);
  z-index: 200;
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.toast-msg.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ==========================================================================
   Responsive Breakpoints
   ========================================================================== */

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

  .inputs-column {
    border-right: none;
    border-bottom: 1px solid var(--border);
  }

  .affiliate-grid {
    grid-template-columns: 1fr;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }
}

@media (max-width: 720px) {
  .nav-toggle {
    display: inline-flex;
  }

  .site-nav {
    display: none;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    background: var(--bg-warm);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    align-items: stretch;
    padding: 12px 20px;
    box-shadow: var(--shadow-md);
  }

  .site-nav.is-open {
    display: flex;
  }

  .mode-tabs {
    grid-template-columns: 1fr;
  }

  .field-grid,
  .metric-grid-2,
  .retainer-tiers-grid {
    grid-template-columns: 1fr;
  }

  .inputs-column,
  .outputs-column,
  .quote-estimator-band,
  .legal-card {
    padding: 20px 18px;
  }
}

/* ==========================================================================
   Print Stylesheet (Clean Rate Sheet & Proposal PDF Export)
   ========================================================================== */

@media print {
  body {
    background: #ffffff;
    color: #000000;
  }

  .skh-topbar,
  .site-header,
  .presets-bar,
  .action-row,
  .partners-section,
  .guide-section,
  .faq-section,
  .related-section,
  .site-footer,
  .ad-slot,
  .toast-msg {
    display: none !important;
  }

  .calculator-shell {
    box-shadow: none;
    border: 1px solid #cccccc;
  }

  .hero-rate-card {
    background: #f5f5f4 !important;
    color: #1c1917 !important;
    border: 1px solid #1c1917;
  }

  .hero-rate-number,
  .hero-rate-eyebrow,
  .hero-rate-unit,
  .hero-rate-floor {
    color: #1c1917 !important;
  }
}
