/* ============================================================
   Property Deal Tools — shared calculator page styles
   Mirrors the visual language of the home page (style.css).
   ============================================================ */

:root {
  /* Brand & primary */
  --brand-blue: #097BC0;
  --primary: #0A6BAA;
  --primary-hover: #085A8F;
  --primary-subtle: #E8F2FB;
  --primary-subtle-light: #F2F7FC;

  /* Secondary & accent */
  --secondary: #0E2A47;
  --accent: #F5A623;
  --accent-hover: #D88E0F;

  /* Neutrals */
  --ink: #1A2433;
  --muted-ink: #5A6675;
  --light-ink: #8A95A3;
  --border: #D9E1EA;
  --border-strong: #C0CBDA;
  --surface: #FFFFFF;
  --page: #F7F9FC;

  /* Semantic */
  --success: #1F9D55;
  --success-bg: #F0FAF5;
  --success-border: #C6E9D1;
  --warning: #E0A800;
  --warning-bg: #FEF9E9;
  --warning-border: #F6E2A3;
  --danger: #C03434;
  --danger-bg: #FDF2F2;
  --danger-border: #F0C7C7;

  --font-display: 'DM Sans', -apple-system, sans-serif;
  --font-body: 'Inter', -apple-system, sans-serif;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;

  --shadow-sm: 0 1px 2px rgba(14, 42, 71, 0.05);
  --shadow-md: 0 4px 12px rgba(14, 42, 71, 0.08);
  --shadow-lg: 0 12px 32px rgba(14, 42, 71, 0.12);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--page);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-hover); }

.container { max-width: 1280px; margin: 0 auto; padding: 0 24px; }

/* ===== HEADER ===== */
header {
  background: var(--brand-blue);
  color: white;
  padding: 18px 0;
  position: sticky; top: 0; z-index: 100;
}
.header-inner {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 24px;
  align-items: center;
}
.logo {
  font-family: var(--font-display);
  font-weight: 700; font-size: 19px;
  color: white; letter-spacing: -0.012em;
  display: inline-flex; align-items: center; gap: 10px;
  text-decoration: none; white-space: nowrap; line-height: 1;
}
.logo-mark {
  width: 32px; height: 32px;
  background: white; color: var(--secondary);
  border-radius: 7px;
  display: inline-flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding-top: 3px;
  font-family: var(--font-display);
  flex-shrink: 0; line-height: 0.92;
}
.logo-mark .lm-ltrs {
  font-weight: 700; font-size: 15px; letter-spacing: -0.04em;
}
.logo-mark .lm-rule {
  display: block; width: 14px; height: 2px; border-radius: 99px;
  background: var(--accent); margin-top: 3px;
}
.logo-word {
  display: inline-flex; align-items: center; gap: 7px;
  font-weight: 700; font-size: 19px;
  color: white; letter-spacing: -0.012em; line-height: 1;
}
.logo-word .logo-dot {
  display: inline-block; width: 5px; height: 5px;
  border-radius: 99px; background: var(--accent); flex-shrink: 0;
}

/* Header search */
.header-search {
  position: relative;
  width: 100%;
  max-width: 380px;
  margin: 0 auto;
}
.header-search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: rgba(255, 255, 255, 0.7);
  pointer-events: none;
}
.header-search input {
  width: 100%;
  padding: 8px 14px 8px 36px;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 999px;
  color: white;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 400;
  transition: background 0.15s, border-color 0.15s, box-shadow 0.15s;
}
.header-search input::placeholder {
  color: rgba(255, 255, 255, 0.62);
}
.header-search input:focus {
  outline: none;
  background: rgba(255, 255, 255, 0.22);
  border-color: rgba(255, 255, 255, 0.45);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.12);
}
.header-search input:focus + .header-search-icon,
.header-search input:focus ~ .header-search-icon { color: white; }
nav ul { display: flex; gap: 32px; list-style: none; }
nav a { color: white; font-weight: 500; font-size: 15px; opacity: 0.92; }
nav a:hover { opacity: 1; color: white; }
nav a.current { opacity: 1; border-bottom: 2px solid var(--accent); padding-bottom: 2px; }

/* ===== BREADCRUMB ===== */
.breadcrumb-strip {
  background: var(--page);
  border-bottom: 1px solid var(--border);
  padding: 14px 0;
  font-size: 13px;
  color: var(--muted-ink);
}
.breadcrumb { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.breadcrumb a { color: var(--muted-ink); font-weight: 500; }
.breadcrumb a:hover { color: var(--primary); }
.breadcrumb .sep { color: var(--light-ink); }
.breadcrumb .current { color: var(--ink); font-weight: 600; }

/* ===== CALC HERO ===== */
.calc-hero {
  background: linear-gradient(180deg, var(--page) 0%, #EEF4FA 100%);
  padding: 48px 0 40px;
  border-bottom: 1px solid var(--border);
  position: relative;
  overflow: hidden;
}
.calc-hero::before {
  content: '';
  position: absolute;
  top: -120px; right: -120px;
  width: 380px; height: 380px;
  background: radial-gradient(circle, rgba(9, 123, 192, 0.08) 0%, transparent 70%);
  border-radius: 50%;
}
.calc-hero-inner { position: relative; max-width: 780px; }
.pill-row { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.pill {
  font-size: 11px; font-weight: 700;
  background: var(--accent); color: var(--secondary);
  padding: 4px 9px; border-radius: 4px;
  text-transform: uppercase; letter-spacing: 0.08em;
}
.pill.category {
  background: var(--primary-subtle);
  color: var(--primary);
  border: 1px solid #C6DEEE;
}
h1.calc-title {
  font-family: var(--font-display);
  font-size: clamp(32px, 4vw, 44px);
  font-weight: 600; line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--secondary);
  margin-bottom: 14px;
}
.calc-sub {
  font-size: 17px; color: var(--muted-ink);
  max-width: 620px; line-height: 1.55;
}

/* ===== MAIN GRID ===== */
.calc-main { padding: 40px 0 64px; }
.calc-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 28px;
  align-items: start;
}
.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  overflow: hidden;
}
@media (min-width: 981px) {
  .results-panel {
    position: sticky;
    top: 76px;
    max-height: calc(100vh - 92px);
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-gutter: stable;
  }
  .results-panel::-webkit-scrollbar { width: 8px; }
  .results-panel::-webkit-scrollbar-track { background: transparent; }
  .results-panel::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
  .results-panel::-webkit-scrollbar-thumb:hover { background: var(--border-strong); }
}
.panel-head {
  padding: 20px 24px;
  background: var(--primary-subtle);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.panel-head h2 {
  font-family: var(--font-display);
  font-size: 18px; font-weight: 700;
  color: var(--secondary);
  display: flex; align-items: center; gap: 10px;
}
.panel-head .panel-meta { font-size: 12px; color: var(--muted-ink); font-weight: 500; }
.panel-body { padding: 24px; }

/* ===== INPUTS ===== */
.input-section + .input-section {
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}
.input-section h3 {
  font-family: var(--font-display);
  font-size: 15px; font-weight: 600;
  color: var(--secondary);
  margin-bottom: 14px;
  display: flex; align-items: center; gap: 8px;
}
.input-section h3 .num {
  width: 22px; height: 22px;
  border-radius: 5px;
  background: var(--primary-subtle);
  color: var(--primary);
  font-family: var(--font-body);
  font-size: 11px; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center;
}
.input-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.input-grid.single { grid-template-columns: 1fr; }
.field { display: flex; flex-direction: column; position: relative; }
.field.full { grid-column: 1 / -1; }
.field label {
  display: flex; align-items: center; gap: 6px;
  font-size: 13px; font-weight: 600;
  color: var(--ink);
  margin-bottom: 6px;
}
.field .tooltip-icon {
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--border);
  color: var(--muted-ink);
  font-size: 10px; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center;
  cursor: help;
  position: static;
}
.field .tooltip-icon:hover { background: var(--primary); color: white; }

/* Custom soft tooltip (overrides browser title tooltip) */
[data-tooltip] {
  position: relative;
}
[data-tooltip]::before,
[data-tooltip]::after {
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.18s ease, visibility 0.18s ease;
  pointer-events: none;
}
[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%);
  background: white;
  color: var(--muted-ink);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  font-family: var(--font-body);
  font-size: 12.5px;
  font-weight: 400;
  line-height: 1.5;
  width: 240px;
  white-space: normal;
  text-align: left;
  box-shadow: 0 6px 20px rgba(14, 42, 71, 0.12);
  z-index: 200;
  letter-spacing: normal;
  text-transform: none;
}
[data-tooltip]::before {
  content: '';
  position: absolute;
  bottom: calc(100% + 4px);
  left: 50%;
  transform: translateX(-50%);
  width: 12px;
  height: 7px;
  background: white;
  clip-path: polygon(0 0, 100% 0, 50% 100%);
  filter: drop-shadow(0 1px 0 var(--border));
  z-index: 201;
}
[data-tooltip]:hover::before,
[data-tooltip]:hover::after,
[data-tooltip]:focus::before,
[data-tooltip]:focus::after,
[data-tooltip]:focus-within::before,
[data-tooltip]:focus-within::after {
  opacity: 1;
  visibility: visible;
}
.input-wrap { position: relative; display: flex; align-items: stretch; }
.input-wrap .affix {
  position: absolute;
  top: 0; bottom: 0;
  display: flex; align-items: center;
  color: var(--muted-ink);
  font-weight: 600; font-size: 15px;
  pointer-events: none;
}
.input-wrap .affix.pre { left: 14px; }
.input-wrap .affix.suf { right: 14px; }
.field input[type="text"], .field input[type="number"], .field select {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 16px; font-weight: 500;
  font-family: var(--font-body);
  color: var(--ink);
  background: white;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.field select {
  appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'><path fill='%235A6675' d='M1.41 0L6 4.59 10.59 0 12 1.41l-6 6-6-6z'/></svg>");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}
.field input.has-prefix { padding-left: 28px; }
.field input.has-suffix { padding-right: 30px; }
.field input:focus, .field select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-subtle);
}
.field .helper { font-size: 12px; color: var(--muted-ink); margin-top: 6px; }

/* Slider */
.slider-row { grid-column: 1 / -1; padding: 6px 0 2px; position: relative; }
.slider-row .tooltip-icon { position: static; }
.slider-row .slider-head {
  display: flex; align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.slider-row .slider-head .lbl { font-size: 13px; font-weight: 600; color: var(--ink); }
.slider-row .slider-head .val {
  font-size: 14px; font-weight: 700;
  color: var(--secondary);
  font-variant-numeric: tabular-nums;
}
.slider-row input[type="range"] {
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 6px;
  border-radius: 999px;
  background: var(--border);
  outline: none;
}
.slider-row input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--primary);
  border: 3px solid white;
  box-shadow: 0 1px 4px rgba(14, 42, 71, 0.2);
  cursor: pointer;
}
.slider-row input[type="range"]::-moz-range-thumb {
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--primary);
  border: 3px solid white;
  box-shadow: 0 1px 4px rgba(14, 42, 71, 0.2);
  cursor: pointer;
}
.slider-row .scale {
  display: flex; justify-content: space-between;
  font-size: 11px; color: var(--muted-ink);
  margin-top: 6px;
}
.slider-row .helper { font-size: 12px; color: var(--muted-ink); margin-top: 8px; }

/* Reset link */
.reset-row {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px dashed var(--border);
  display: flex; justify-content: space-between;
  align-items: center;
}
.reset-link {
  background: none; border: none; padding: 0;
  font-family: var(--font-body);
  font-size: 13px; font-weight: 600;
  color: var(--muted-ink);
  cursor: pointer;
  display: inline-flex; align-items: center; gap: 4px;
}
.reset-link:hover { color: var(--primary); }

/* ===== HERO ANSWER ===== */
.hero-answer {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 28px 24px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.hero-answer .eyebrow {
  font-size: 11px; font-weight: 700;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--muted-ink);
  margin-bottom: 8px;
}
.hero-answer .big-value {
  font-family: var(--font-display);
  font-size: 56px; font-weight: 700;
  line-height: 1;
  color: var(--secondary);
  letter-spacing: -0.02em;
  transition: color 0.2s;
  word-break: break-word;
}
.hero-answer .big-value.tone-success { color: var(--success); }
.hero-answer .big-value.tone-warning { color: var(--warning); }
.hero-answer .big-value.tone-danger { color: var(--danger); }
.hero-answer .subline {
  font-size: 14px; color: var(--muted-ink);
  margin-top: 8px;
}
.hero-answer .context {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  text-align: left;
}
.hero-answer .context.cols-3 { grid-template-columns: 1fr 1fr 1fr; }
.hero-answer .context .ctx-key {
  font-size: 11px; font-weight: 700;
  letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--muted-ink);
  margin-bottom: 4px;
}
.hero-answer .context .ctx-val {
  font-family: var(--font-display);
  font-size: 20px; font-weight: 600;
  color: var(--secondary);
  font-variant-numeric: tabular-nums;
}

/* ===== METRIC GROUPS ===== */
.metric-group { margin-top: 28px; }
.metric-group + .metric-group {
  margin-top: 32px;
  padding-top: 32px;
  border-top: 1px dashed var(--border);
}
.metric-group h4 {
  font-family: var(--font-body);
  font-size: 11px; font-weight: 700;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--muted-ink);
  margin-bottom: 14px;
}
.metric-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.metric {
  padding: 12px 14px;
  background: linear-gradient(0deg, var(--primary-subtle) 0%, var(--surface) 60%);
  border: 1px solid rgba(10, 107, 170, 0.18);
  border-radius: var(--radius-sm);
  min-width: 0;
}
.metric-label {
  font-size: 11px; font-weight: 700;
  letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--muted-ink);
  margin-bottom: 6px;
}
.metric-value {
  font-family: var(--font-display);
  font-size: 20px; font-weight: 600;
  color: var(--secondary);
  line-height: 1.15;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.metric-value.muted { color: var(--muted-ink); }
.metric-value.danger { color: var(--danger); }
.metric-value.success { color: var(--success); }
.metric-meta { font-size: 12px; color: var(--muted-ink); margin-top: 4px; }

.metric-grid.cols-2 { grid-template-columns: 1fr 1fr; }
.metric-grid.cols-4 { grid-template-columns: repeat(4, 1fr); }

/* ===== MESSAGE BOX ===== */
.msg-stack { margin-top: 28px; display: flex; flex-direction: column; gap: 14px; }
.msgbox {
  padding: 16px 18px;
  border-radius: var(--radius-md);
  border: 1px solid;
  border-left-width: 4px;
  background: white;
}
.msgbox.success { background: var(--success-bg); border-color: var(--success-border); border-left-color: var(--success); }
.msgbox.warning { background: var(--warning-bg); border-color: var(--warning-border); border-left-color: var(--warning); }
.msgbox.danger  { background: var(--danger-bg);  border-color: var(--danger-border);  border-left-color: var(--danger); }
.msgbox-title {
  font-family: var(--font-display);
  font-size: 15px; font-weight: 600;
  color: var(--secondary);
  margin-bottom: 6px;
  display: flex; align-items: center; gap: 8px;
}
.msgbox-icon {
  width: 18px; height: 18px;
  border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  color: white;
  font-size: 11px; font-weight: 700;
  flex-shrink: 0;
}
.msgbox.success .msgbox-icon { background: var(--success); }
.msgbox.warning .msgbox-icon { background: var(--warning); }
.msgbox.danger  .msgbox-icon { background: var(--danger); }
.msgbox-body { font-size: 14px; color: var(--ink); line-height: 1.55; }

/* ===== NOTE ===== */
.note {
  margin-top: 28px;
  padding: 16px 18px;
  background: var(--primary-subtle-light);
  border-left: 3px solid var(--primary);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: 13px;
  color: var(--muted-ink);
  line-height: 1.6;
}
.note strong { color: var(--secondary); font-weight: 600; }

/* ===== HOW-IT-WORKS / FORMULA ===== */
.how-it-works {
  background: var(--surface);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 64px 0;
}
.how-grid { display: grid; grid-template-columns: 280px 1fr; gap: 40px; }
.how-meta h2 {
  font-family: var(--font-display);
  font-size: 28px; font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.015em;
  color: var(--secondary);
  margin-bottom: 12px;
}
.how-meta p { color: var(--muted-ink); font-size: 14px; margin-bottom: 18px; }
.how-meta .guide-cta {
  font-size: 14px; font-weight: 600;
  color: var(--primary);
  display: inline-flex; align-items: center; gap: 4px;
}
.formula-card {
  background: var(--page);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
}
.formula-eyebrow {
  font-size: 11px; font-weight: 700;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--primary);
  margin-bottom: 14px;
}
.formula {
  font-family: 'DM Sans', sans-serif;
  font-size: 22px; font-weight: 500;
  color: var(--secondary);
  padding: 18px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  margin-bottom: 18px;
  text-align: center;
  letter-spacing: -0.005em;
}
.formula .num, .formula .den { color: var(--primary); font-weight: 600; }
.formula .divider { color: var(--light-ink); margin: 0 12px; }
.benchmark-list {
  list-style: none;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 18px;
}
.benchmark-list li {
  display: flex; align-items: baseline; gap: 10px;
  font-size: 14px; color: var(--ink);
}
.benchmark-list .dot {
  width: 9px; height: 9px;
  border-radius: 50%;
  flex-shrink: 0;
  position: relative;
  top: 1px;
}
.benchmark-list .dot.warn { background: var(--warning); }
.benchmark-list .dot.good { background: var(--success); }
.benchmark-list .dot.high { background: #2E86C1; }
.benchmark-list .dot.risky { background: var(--danger); }
.benchmark-list strong { color: var(--secondary); font-weight: 700; min-width: 64px; display: inline-block; }
.benchmark-list .desc { color: var(--muted-ink); }

/* ===== RELATED CALCULATORS ===== */
.related { padding: 56px 0; background: var(--page); }
.related-head {
  display: flex; align-items: end; justify-content: space-between;
  margin-bottom: 24px; gap: 24px; flex-wrap: wrap;
}
.related-head h2 {
  font-family: var(--font-display);
  font-size: 24px; font-weight: 600;
  color: var(--secondary);
  letter-spacing: -0.01em;
  margin-bottom: 4px;
}
.related-head p { color: var(--muted-ink); font-size: 14px; }
.related-head .see-all {
  font-size: 14px; font-weight: 600;
  color: var(--primary); white-space: nowrap;
}
.related-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.related-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px;
  transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
  display: block;
  color: inherit;
}
.related-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--primary);
  color: inherit;
}
.related-cat {
  font-size: 11px; font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--primary);
  text-transform: uppercase;
  margin-bottom: 8px;
}
.related-name {
  font-family: var(--font-display);
  font-weight: 600; color: var(--secondary);
  font-size: 17px; line-height: 1.2;
  margin-bottom: 6px;
}
.related-desc { font-size: 13px; color: var(--muted-ink); line-height: 1.5; }

/* ===== FOOTER ===== */
footer { background: var(--brand-blue); color: white; padding: 32px 0 24px; }
.footer-inner {
  display: flex; justify-content: space-between; align-items: center;
  flex-wrap: wrap; gap: 16px; font-size: 14px;
}
footer a { color: white; opacity: 0.92; }
footer a:hover { opacity: 1; color: white; }
.footer-links {
  display: flex;
  align-items: center;
  gap: 0;
}
.footer-links a + a {
  position: relative;
  padding-left: 24px;
  margin-left: 24px;
}
.footer-links a + a::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 1px;
  height: 14px;
  background: rgba(255, 255, 255, 0.4);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 980px) {
  .calc-grid { grid-template-columns: 1fr; }
  .how-grid { grid-template-columns: 1fr; gap: 24px; }
  .related-grid { grid-template-columns: 1fr 1fr; }
  .benchmark-list { grid-template-columns: 1fr; }
  .header-inner {
    grid-template-columns: auto auto;
    grid-template-areas:
      'logo nav'
      'search search';
    gap: 10px 16px;
  }
  .logo { grid-area: logo; }
  nav { grid-area: nav; }
  .header-search { grid-area: search; max-width: none; margin: 0; }
}
@media (max-width: 640px) {
  .container { padding: 0 18px; }
  .input-grid { grid-template-columns: 1fr; }
  .metric-grid, .metric-grid.cols-2, .metric-grid.cols-4 { grid-template-columns: 1fr; }
  .metric { padding: 12px 14px; }
  .hero-answer .context, .hero-answer .context.cols-3 { grid-template-columns: 1fr; }
  .related-grid { grid-template-columns: 1fr; }
  .hero-answer .big-value { font-size: 44px; }
  nav ul { gap: 18px; }
}

/* Tweak hooks */
body[data-layout="stacked"] .calc-grid { grid-template-columns: 1fr; }
body[data-hero-style="banded"] .hero-answer {
  background: linear-gradient(0deg, var(--primary-subtle) 0%, var(--surface) 60%);
}
body[data-hero-style="banded"] .hero-answer .eyebrow { color: var(--primary); }
body[data-density="compact"] .panel-body { padding: 18px; }
body[data-density="compact"] .input-section + .input-section { margin-top: 18px; padding-top: 18px; }
body[data-density="compact"] .hero-answer { padding: 22px 20px; }
body[data-density="compact"] .hero-answer .big-value { font-size: 48px; }

/* ============ PANEL TOOLBAR ============ */
.panel-head { gap: 12px; }
.panel-toolbar {
  display: flex;
  gap: 6px;
  align-items: center;
}
.toolbtn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 11px;
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
  text-decoration: none;
  white-space: nowrap;
}
.toolbtn:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: white;
}
.toolbtn svg { flex-shrink: 0; opacity: 0.7; }
.toolbtn:hover svg { opacity: 1; }

@media (max-width: 640px) {
  .toolbtn span { display: none; }
  .toolbtn { padding: 7px 9px; }
}

/* ============ MODAL ============ */
.pdt-modal-overlay {
  position: fixed; inset: 0;
  background: rgba(14, 42, 71, 0.5);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: pdtFadeIn 0.15s ease-out;
}
@keyframes pdtFadeIn { from { opacity: 0; } to { opacity: 1; } }
.pdt-modal {
  background: white;
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 60px rgba(14, 42, 71, 0.3);
  width: 100%;
  max-width: 440px;
  overflow: hidden;
  animation: pdtSlideUp 0.2s ease-out;
}
@keyframes pdtSlideUp { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.pdt-modal-head {
  padding: 18px 22px;
  background: var(--primary-subtle);
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.pdt-modal-title {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
  color: var(--secondary);
}
.pdt-modal-close {
  background: none;
  border: none;
  font-size: 24px;
  line-height: 1;
  color: var(--muted-ink);
  cursor: pointer;
  padding: 0;
}
.pdt-modal-close:hover { color: var(--secondary); }
.pdt-modal-body { padding: 22px; }
.pdt-modal-sub {
  color: var(--muted-ink);
  font-size: 14px;
  margin-bottom: 16px;
  line-height: 1.5;
}
.pdt-modal-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 6px;
}
.pdt-modal-input {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 16px;
  font-family: var(--font-body);
  color: var(--ink);
}
.pdt-modal-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-subtle);
}
.pdt-modal-foot {
  padding: 14px 22px;
  background: var(--page);
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}
.pdt-btn-primary {
  background: var(--primary);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  padding: 10px 18px;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.pdt-btn-primary:hover { background: var(--primary-hover); }
.pdt-btn-ghost {
  background: white;
  color: var(--muted-ink);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 16px;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.pdt-btn-ghost:hover { color: var(--ink); border-color: var(--border-strong); }

/* Tag suggestions in modal */
.pdt-tag-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}
.pdt-tag-suggestion {
  background: var(--primary-subtle);
  color: var(--primary);
  border: 1px solid #C6DEEE;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  font-family: var(--font-body);
}
.pdt-tag-suggestion:hover { background: var(--primary); color: white; }

/* Tag chips on deal columns */
.deal-col-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 6px;
}
.deal-col-tag {
  display: inline-block;
  background: var(--page);
  border: 1px solid var(--border);
  color: var(--muted-ink);
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 10px;
  font-weight: 600;
  white-space: nowrap;
}

/* Tag filter strip on Compare page */
.tag-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 18px;
  padding: 12px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  align-items: center;
}
.tag-filter-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted-ink);
  margin-right: 4px;
}
.tag-filter {
  background: var(--page);
  border: 1px solid var(--border);
  color: var(--muted-ink);
  border-radius: 999px;
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  font-family: var(--font-body);
  transition: all 0.15s;
}
.tag-filter:hover { color: var(--ink); border-color: var(--border-strong); }
.tag-filter.active {
  background: var(--secondary);
  color: white;
  border-color: var(--secondary);
}
.tag-filter .count {
  display: inline-block;
  margin-left: 4px;
  padding: 0 5px;
  background: rgba(0,0,0,0.08);
  border-radius: 999px;
  font-size: 10px;
}
.tag-filter.active .count { background: rgba(255,255,255,0.25); }

/* ============ POPOVER (saved deals list) ============ */
.pdt-popover {
  position: absolute;
  z-index: 9999;
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: 0 12px 32px rgba(14, 42, 71, 0.18);
  width: 320px;
  overflow: hidden;
  animation: pdtSlideUp 0.15s ease-out;
}
.pdt-popover-head {
  padding: 12px 16px;
  background: var(--page);
  border-bottom: 1px solid var(--border);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted-ink);
}
.pdt-popover-empty {
  padding: 18px;
  text-align: center;
}
.pdt-popover-list {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 320px;
  overflow-y: auto;
}
.pdt-popover-list li {
  display: flex;
  align-items: stretch;
  border-bottom: 1px solid var(--border);
}
.pdt-popover-list li:last-child { border-bottom: none; }
.pdt-popover-item {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 4px 12px;
  padding: 10px 14px;
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
  font-family: var(--font-body);
  color: inherit;
}
.pdt-popover-item:hover { background: var(--primary-subtle-light); }
.pdt-popover-name {
  font-weight: 600;
  font-size: 14px;
  color: var(--secondary);
  grid-column: 1;
  grid-row: 1;
}
.pdt-popover-val {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 14px;
  color: var(--primary);
  grid-column: 2;
  grid-row: 1;
}
.pdt-popover-date {
  font-size: 11px;
  color: var(--muted-ink);
  grid-column: 1 / -1;
  grid-row: 2;
}
.pdt-popover-delete {
  padding: 0 12px;
  background: none;
  border: none;
  border-left: 1px solid var(--border);
  color: var(--light-ink);
  font-size: 18px;
  cursor: pointer;
}
.pdt-popover-delete:hover { color: var(--danger); background: var(--danger-bg); }
.pdt-popover-foot {
  padding: 10px 16px;
  background: var(--page);
  border-top: 1px solid var(--border);
  text-align: right;
}
.pdt-popover-link {
  font-size: 13px;
  font-weight: 600;
  color: var(--primary);
}

/* ============ TOAST ============ */
.pdt-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--secondary);
  color: white;
  padding: 12px 20px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 500;
  box-shadow: 0 8px 24px rgba(14, 42, 71, 0.3);
  opacity: 0;
  transition: opacity 0.2s, transform 0.2s;
  z-index: 10001;
  pointer-events: none;
}
.pdt-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ============================================================
   GUIDES — single long-form article page
   ============================================================ */

/* Reading progress bar */
.reading-progress {
  position: fixed;
  top: 0; left: 0;
  height: 3px;
  width: 0;
  background: var(--accent);
  z-index: 200;
  transition: width 0.1s linear;
}

/* Guide hero variant */
.guide-hero .calc-hero-inner { max-width: 820px; }
.guide-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 18px;
  margin-top: 18px;
  font-size: 13px;
  color: var(--muted-ink);
}
.guide-meta .dot-sep { width: 3px; height: 3px; border-radius: 50%; background: var(--light-ink); }
.guide-meta strong { color: var(--secondary); font-weight: 600; }

/* Guide layout: body + sticky sidebar TOC */
.guide-main { padding: 40px 0 72px; }
.guide-layout {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 48px;
  align-items: start;
}

/* Table of contents */
.guide-toc { position: sticky; top: 84px; }
.guide-toc-label {
  font-size: 11px; font-weight: 700;
  letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--muted-ink);
  margin-bottom: 14px;
}
.guide-toc ul { list-style: none; display: flex; flex-direction: column; gap: 2px; }
.guide-toc a {
  display: block;
  padding: 7px 14px;
  font-size: 13.5px;
  color: var(--muted-ink);
  border-left: 2px solid var(--border);
  line-height: 1.4;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}
.guide-toc a:hover { color: var(--primary); background: var(--primary-subtle-light); }
.guide-toc a.active {
  color: var(--primary);
  border-left-color: var(--primary);
  font-weight: 600;
}

/* Article body — long-form typography */
.guide-body { max-width: 720px; }
.guide-body > * + * { margin-top: 22px; }
.guide-body h2 {
  font-family: var(--font-display);
  font-size: 28px; font-weight: 600;
  color: var(--secondary);
  letter-spacing: -0.015em;
  line-height: 1.2;
  margin-top: 48px;
  scroll-margin-top: 90px;
}
.guide-body h2:first-child { margin-top: 0; }
.guide-body h3 {
  font-family: var(--font-display);
  font-size: 20px; font-weight: 600;
  color: var(--secondary);
  margin-top: 32px;
  scroll-margin-top: 90px;
}
.guide-body p { font-size: 17px; line-height: 1.7; color: var(--ink); text-wrap: pretty; }
.guide-body a:not(.guide-inline-cta) {
  color: var(--primary);
  font-weight: 500;
  text-decoration: underline;
  text-decoration-color: var(--border-strong);
  text-underline-offset: 2px;
}
.guide-body a:not(.guide-inline-cta):hover { text-decoration-color: var(--primary); }
.guide-body ul, .guide-body ol { padding-left: 24px; font-size: 17px; line-height: 1.7; color: var(--ink); }
.guide-body li + li { margin-top: 8px; }
.guide-body strong { color: var(--secondary); font-weight: 600; }
.guide-body hr { border: none; border-top: 1px solid var(--border); margin: 40px 0; }
.guide-body .lead { font-size: 20px; line-height: 1.6; color: var(--muted-ink); }
.guide-section-num {
  display: inline-block;
  font-family: var(--font-body);
  font-size: 12px; font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--accent);
  text-transform: uppercase;
  margin-bottom: 6px;
}

/* "What you'll learn" summary card */
.learn-card {
  background: linear-gradient(135deg, var(--surface) 0%, var(--primary-subtle-light) 100%);
  border: 1px solid rgba(10, 107, 170, 0.18);
  border-radius: var(--radius-lg);
  padding: 24px 28px;
}
.learn-card h2 {
  font-family: var(--font-display);
  font-size: 16px !important;
  font-weight: 700;
  color: var(--secondary);
  margin: 0 0 14px !important;
  letter-spacing: 0;
}
.learn-card ul { list-style: none; padding: 0; display: grid; gap: 10px; font-size: 15px; }
.learn-card li { display: flex; align-items: flex-start; gap: 10px; color: var(--ink); line-height: 1.5; }
.learn-card li svg { flex-shrink: 0; color: var(--success); margin-top: 2px; }

/* Pull quote */
.pull-quote {
  border-left: 3px solid var(--accent);
  padding: 4px 0 4px 24px;
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 500;
  line-height: 1.4;
  color: var(--secondary);
  letter-spacing: -0.01em;
}

/* Callout box */
.guide-callout {
  background: var(--primary-subtle-light);
  border-left: 3px solid var(--primary);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 18px 20px;
  font-size: 15px;
  line-height: 1.6;
  color: var(--ink);
}
.guide-callout strong { color: var(--secondary); }

/* Inline mid-article calculator CTA */
.guide-inline-cta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  background: var(--secondary);
  border-radius: var(--radius-lg);
  padding: 22px 26px;
  color: white;
  text-decoration: none;
  transition: transform 0.15s, box-shadow 0.15s;
}
.guide-inline-cta:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); color: white; }
.guide-inline-cta .cta-text .cta-eyebrow {
  font-size: 11px; font-weight: 700;
  letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 5px;
}
.guide-inline-cta .cta-text .cta-title {
  font-family: var(--font-display);
  font-size: 19px; font-weight: 600;
  line-height: 1.25;
}
.guide-inline-cta .cta-text .cta-sub { font-size: 14px; color: rgba(255,255,255,0.8); margin-top: 4px; }
.guide-inline-cta .cta-arrow {
  flex-shrink: 0;
  width: 44px; height: 44px;
  border-radius: 50%;
  background: rgba(255,255,255,0.14);
  display: flex; align-items: center; justify-content: center;
  transition: background 0.15s;
}
.guide-inline-cta:hover .cta-arrow { background: var(--accent); }

/* Data table inside guides */
.guide-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
}
.guide-table thead th {
  background: var(--primary-subtle);
  color: var(--secondary);
  font-family: var(--font-display);
  font-weight: 600;
  text-align: left;
  padding: 12px 16px;
  font-size: 13px;
}
.guide-table td { padding: 12px 16px; border-top: 1px solid var(--border); color: var(--ink); }
.guide-table tbody tr:nth-child(even) { background: var(--page); }
.guide-table td:first-child { font-weight: 600; color: var(--secondary); }

/* End-of-article sections */
.guide-tools { padding: 56px 0; background: var(--page); border-top: 1px solid var(--border); }
.guide-related { padding: 56px 0; background: var(--surface); border-top: 1px solid var(--border); }
.guide-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
  color: inherit;
  height: 100%;
}
.guide-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: var(--primary); color: inherit; }
.guide-card .guide-card-cat {
  font-size: 11px; font-weight: 700;
  letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--primary);
}
.guide-card .guide-card-title {
  font-family: var(--font-display);
  font-size: 18px; font-weight: 600;
  color: var(--secondary);
  line-height: 1.25;
}
.guide-card .guide-card-desc { font-size: 14px; color: var(--muted-ink); line-height: 1.5; flex: 1; }
.guide-card .guide-card-meta {
  font-size: 12px; color: var(--light-ink);
  display: flex; align-items: center; gap: 8px;
  margin-top: 4px;
}

@media (max-width: 900px) {
  .guide-layout { grid-template-columns: 1fr; gap: 24px; }
  .guide-toc {
    position: static;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 18px;
    background: var(--page);
  }
  .guide-toc ul { gap: 0; }
}
@media (max-width: 640px) {
  .guide-body h2 { font-size: 24px; }
  .guide-body p, .guide-body ul, .guide-body ol { font-size: 16px; }
  .guide-inline-cta { flex-direction: column; align-items: flex-start; gap: 14px; }
  .pull-quote { font-size: 19px; }
}

/* ============================================================
   GUIDE HUB — directory of all guides
   ============================================================ */
.hub-hero h1 { font-size: clamp(36px, 5vw, 52px); }
.hub-main { padding: 48px 0 72px; }

.featured-guide {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 0;
  background: var(--secondary);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 40px;
  color: white;
}
.featured-guide .featured-body { padding: 40px; display: flex; flex-direction: column; justify-content: center; }
.featured-guide .featured-tag {
  display: inline-flex;
  align-self: flex-start;
  align-items: center;
  gap: 6px;
  background: var(--accent);
  color: var(--secondary);
  font-size: 11px; font-weight: 700;
  letter-spacing: 0.08em; text-transform: uppercase;
  padding: 5px 11px;
  border-radius: 4px;
  margin-bottom: 16px;
}
.featured-guide h2 {
  font-family: var(--font-display);
  font-size: 32px; font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin-bottom: 14px;
  color: white;
}
.featured-guide p { font-size: 16px; line-height: 1.6; color: rgba(255,255,255,0.82); margin-bottom: 24px; }
.featured-guide .featured-cta {
  display: inline-flex;
  align-self: flex-start;
  align-items: center;
  gap: 8px;
  background: white;
  color: var(--secondary);
  font-weight: 600;
  font-size: 15px;
  padding: 12px 22px;
  border-radius: var(--radius-md);
  text-decoration: none;
}
.featured-guide .featured-cta:hover { background: var(--primary-subtle); color: var(--secondary); }
.featured-guide .featured-side {
  background: linear-gradient(135deg, rgba(255,255,255,0.08) 0%, rgba(255,255,255,0) 100%);
  border-left: 1px solid rgba(255,255,255,0.12);
  padding: 40px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 14px;
}
.featured-guide .featured-side-label {
  font-size: 11px; font-weight: 700;
  letter-spacing: 0.12em; text-transform: uppercase;
  color: rgba(255,255,255,0.6);
  margin-bottom: 4px;
}
.featured-guide .featured-stat { display: flex; flex-direction: column; gap: 2px; }
.featured-guide .featured-stat .stat-val {
  font-family: var(--font-display);
  font-size: 28px; font-weight: 700;
  color: white;
}
.featured-guide .featured-stat .stat-key { font-size: 13px; color: rgba(255,255,255,0.7); }

.hub-group { margin-bottom: 40px; }
.hub-group-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 16px; margin-bottom: 18px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.hub-group-head h2 {
  font-family: var(--font-display);
  font-size: 22px; font-weight: 600;
  color: var(--secondary);
  letter-spacing: -0.01em;
}
.hub-group-head .group-count { font-size: 13px; color: var(--muted-ink); font-weight: 500; }
.guide-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }

@media (max-width: 900px) {
  .featured-guide { grid-template-columns: 1fr; }
  .featured-guide .featured-side { border-left: none; border-top: 1px solid rgba(255,255,255,0.12); flex-direction: row; flex-wrap: wrap; gap: 24px; }
  .guide-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
  .guide-grid { grid-template-columns: 1fr; }
  .featured-guide .featured-body { padding: 28px; }
  .featured-guide h2 { font-size: 26px; }
}

/* ============================================================
   GLOSSARY
   ============================================================ */
.glossary-main { padding: 40px 0 72px; }
.az-nav {
  position: sticky;
  top: 80px;            /* sits flush directly below the 80px sticky header */
  z-index: 50;
  background: var(--page);
  border-bottom: 1px solid var(--border);
  padding: 14px 0;
  margin-bottom: 8px;
}
.az-nav-inner { display: flex; flex-wrap: wrap; gap: 4px; }
.az-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px; height: 34px;
  border-radius: var(--radius-sm);
  font-family: var(--font-display);
  font-size: 14px; font-weight: 600;
  color: var(--primary);
  background: var(--surface);
  border: 1px solid var(--border);
  text-decoration: none;
  transition: all 0.15s;
}
.az-link:hover { background: var(--primary); color: white; border-color: var(--primary); }
.az-link.disabled { color: var(--light-ink); background: transparent; border-color: transparent; pointer-events: none; opacity: 0.5; }

.glossary-section { padding-top: 32px; scroll-margin-top: 155px; }
.glossary-letter {
  font-family: var(--font-display);
  font-size: 40px; font-weight: 700;
  color: var(--primary-subtle);
  line-height: 1;
  margin-bottom: 16px;
  -webkit-text-stroke: 1px var(--border-strong);
}
.glossary-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.term-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 22px 24px;
  scroll-margin-top: 155px;
}
.term-card .term-name {
  font-family: var(--font-display);
  font-size: 19px; font-weight: 600;
  color: var(--secondary);
  margin-bottom: 4px;
}
.term-card .term-aka { font-size: 12px; color: var(--light-ink); font-style: italic; margin-bottom: 10px; }
.term-card .term-def { font-size: 15px; line-height: 1.6; color: var(--ink); }
.term-card .term-def + .term-xlink { margin-top: 14px; }
.term-xlink {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  font-weight: 600;
  color: var(--primary);
  background: var(--primary-subtle-light);
  border: 1px solid #C6DEEE;
  border-radius: 999px;
  padding: 6px 14px;
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
}
.term-xlink:hover { background: var(--primary); color: white; }
.term-xlink svg { flex-shrink: 0; }
.term-seealso { margin-top: 12px; font-size: 13px; color: var(--muted-ink); }
.term-seealso a { color: var(--primary); font-weight: 500; text-decoration: none; }
.term-seealso a:hover { text-decoration: underline; }

@media (max-width: 700px) {
  .glossary-grid { grid-template-columns: 1fr; }
  .az-link { width: 30px; height: 30px; font-size: 13px; }
}

/* ============================================================
   WORKFLOWS — shared
   ============================================================ */
.wf-hero h1 { font-size: clamp(36px, 5vw, 52px); }
.wf-hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 26px; }
.btn-primary {
  display: inline-flex; align-items: center; gap: 9px;
  background: var(--primary); color: white;
  font-family: var(--font-body); font-weight: 600; font-size: 15px;
  padding: 13px 24px; border-radius: var(--radius-md);
  border: none; cursor: pointer; text-decoration: none;
  transition: background 0.15s, transform 0.15s, box-shadow 0.15s;
}
.btn-primary:hover { background: var(--primary-hover); color: white; transform: translateY(-1px); box-shadow: var(--shadow-md); }
.btn-secondary {
  display: inline-flex; align-items: center; gap: 9px;
  background: white; color: var(--secondary);
  font-family: var(--font-body); font-weight: 600; font-size: 15px;
  padding: 13px 22px; border-radius: var(--radius-md);
  border: 1px solid var(--border-strong); cursor: pointer; text-decoration: none;
  transition: border-color 0.15s, color 0.15s;
}
.btn-secondary:hover { border-color: var(--primary); color: var(--primary); }

/* Premium / lock treatment */
.premium-badge {
  display: inline-flex; align-items: center; gap: 5px;
  background: linear-gradient(135deg, #F5A623 0%, #E0892F 100%);
  color: var(--secondary);
  font-size: 10px; font-weight: 800;
  letter-spacing: 0.08em; text-transform: uppercase;
  padding: 3px 8px; border-radius: 4px;
  white-space: nowrap;
}
.btn-premium {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  background: white; color: var(--secondary);
  border: 1.5px solid var(--accent);
  font-family: var(--font-body); font-weight: 600; font-size: 15px;
  padding: 12px 22px; border-radius: var(--radius-md);
  cursor: pointer; text-decoration: none;
  transition: background 0.15s;
}
.btn-premium:hover { background: var(--warning-bg); color: var(--secondary); }
.btn-premium svg { color: var(--accent-hover); }

/* ============ WORKFLOW HUB ============ */
.wf-main { padding: 48px 0 72px; }
.wf-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin-bottom: 16px;
}
.wf-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 26px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  transition: box-shadow 0.15s, border-color 0.15s, transform 0.15s;
}
.wf-card:hover { box-shadow: var(--shadow-md); border-color: var(--border-strong); transform: translateY(-2px); }
.wf-card-icon {
  width: 48px; height: 48px;
  border-radius: var(--radius-md);
  background: var(--primary-subtle);
  color: var(--primary);
  display: flex; align-items: center; justify-content: center;
}
.wf-card-num {
  font-size: 11px; font-weight: 700;
  letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--light-ink);
}
.wf-card h3 {
  font-family: var(--font-display);
  font-size: 20px; font-weight: 600;
  color: var(--secondary);
  line-height: 1.2;
}
.wf-card p { font-size: 14px; line-height: 1.55; color: var(--muted-ink); flex: 1; }
.wf-card-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
.wf-card-actions .btn-primary { padding: 9px 16px; font-size: 13.5px; }
.wf-card-actions .btn-secondary { padding: 9px 14px; font-size: 13.5px; }

/* How workflows work */
.wf-how { background: var(--surface); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); padding: 64px 0; scroll-margin-top: 80px; }
.wf-how-head { text-align: center; max-width: 640px; margin: 0 auto 36px; }
.wf-how-head h2 { font-family: var(--font-display); font-size: 30px; font-weight: 600; color: var(--secondary); letter-spacing: -0.015em; margin-bottom: 10px; }
.wf-how-head p { color: var(--muted-ink); font-size: 16px; }
.wf-how-steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; position: relative; }
.wf-how-step {
  background: var(--page);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 26px;
  position: relative;
}
.wf-how-step .step-badge {
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--primary); color: white;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-weight: 700; font-size: 15px;
  margin-bottom: 14px;
}
.wf-how-step h4 { font-family: var(--font-display); font-size: 17px; font-weight: 600; color: var(--secondary); margin-bottom: 6px; }
.wf-how-step p { font-size: 13.5px; line-height: 1.55; color: var(--muted-ink); }
.wf-how-arrow { color: var(--border-strong); display: flex; align-items: center; }

/* Recommended starting points */
.wf-rec { padding: 56px 0; }
.wf-rec-card {
  background: linear-gradient(135deg, var(--surface) 0%, var(--primary-subtle-light) 100%);
  border: 1px solid rgba(10, 107, 170, 0.18);
  border-radius: var(--radius-lg);
  padding: 32px 36px;
}
.wf-rec-card h2 { font-family: var(--font-display); font-size: 24px; font-weight: 600; color: var(--secondary); margin-bottom: 16px; letter-spacing: -0.01em; }
.wf-rec-list { display: flex; flex-direction: column; gap: 14px; }
.wf-rec-item { display: flex; gap: 12px; align-items: baseline; font-size: 16px; line-height: 1.5; color: var(--ink); }
.wf-rec-item strong { color: var(--secondary); font-weight: 600; }
.wf-rec-item a { color: var(--primary); font-weight: 600; }
.wf-rec-item .arrow { color: var(--accent); font-weight: 700; flex-shrink: 0; }

/* ============ WORKFLOW LANDING ============ */
.wf-section { padding: 48px 0; }
.wf-section.alt { background: var(--surface); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.wf-section h2 { font-family: var(--font-display); font-size: 28px; font-weight: 600; color: var(--secondary); letter-spacing: -0.015em; margin-bottom: 16px; }
.wf-section .wf-section-lead { font-size: 18px; line-height: 1.65; color: var(--ink); max-width: 720px; }
.wf-section .wf-section-lead .chain-inline { color: var(--primary); font-weight: 600; }

.wf-who-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 8px; }
.wf-who-item {
  display: flex; gap: 12px; align-items: flex-start;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: 18px 20px;
}
.wf-who-item svg { flex-shrink: 0; color: var(--primary); margin-top: 2px; }
.wf-who-item .who-title { font-weight: 600; color: var(--secondary); font-size: 15px; margin-bottom: 2px; }
.wf-who-item .who-desc { font-size: 13.5px; color: var(--muted-ink); line-height: 1.5; }

/* Chain preview (read-only sequence) */
.chain-preview { display: flex; align-items: stretch; gap: 0; flex-wrap: nowrap; overflow-x: auto; padding-bottom: 10px; scrollbar-width: thin; }
.chain-step {
  flex: 1 0 200px;
  min-width: 200px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px;
  display: flex; flex-direction: column; gap: 8px;
}
.chain-step .chain-step-n {
  font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--primary);
}
.chain-step .chain-step-name { font-family: var(--font-display); font-size: 16px; font-weight: 600; color: var(--secondary); line-height: 1.25; }
.chain-step .chain-step-output {
  font-size: 12.5px; color: var(--muted-ink); flex: 1;
}
.chain-step .chain-step-output strong { color: var(--secondary); font-weight: 600; }
.chain-step .chain-step-link { font-size: 13px; font-weight: 600; color: var(--primary); }
.chain-arrow { display: flex; align-items: center; justify-content: center; color: var(--border-strong); flex: 0 0 28px; }

/* What you'll get — output chips */
.wf-outputs { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 8px; }
.wf-output-chip {
  display: flex; flex-direction: column; gap: 2px;
  background: var(--surface); border: 1px solid var(--border);
  border-left: 3px solid var(--primary);
  border-radius: var(--radius-sm); padding: 14px 18px; min-width: 150px;
}
.wf-output-chip .chip-label { font-size: 11px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted-ink); }
.wf-output-chip .chip-desc { font-size: 13px; color: var(--ink); }

.wf-cta-band { background: var(--secondary); border-radius: var(--radius-lg); padding: 40px; text-align: center; }
.wf-cta-band h2 { color: white; margin-bottom: 8px; }
.wf-cta-band p { color: rgba(255,255,255,0.8); font-size: 16px; margin-bottom: 22px; }
.wf-cta-band .btn-primary { background: var(--accent); color: var(--secondary); }
.wf-cta-band .btn-primary:hover { background: var(--accent-hover); }

/* ============ WORKFLOW TOOL ============ */
/* Sticky step indicator */
.wf-stepbar {
  position: sticky; top: 60px; z-index: 60;
  background: rgba(255,255,255,0.94);
  backdrop-filter: saturate(180%) blur(8px);
  border-bottom: 1px solid var(--border);
}
.wf-stepbar-inner { display: flex; align-items: center; gap: 8px; padding: 12px 0; }
.wf-step {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 16px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--page);
  color: var(--muted-ink); font-weight: 600; font-size: 13.5px;
  cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: all 0.15s;
}
.wf-step:hover { border-color: var(--border-strong); color: var(--ink); }
.wf-step.active { background: var(--primary); color: white; border-color: var(--primary); }
.wf-step .wf-step-n {
  width: 20px; height: 20px; border-radius: 50%;
  background: rgba(0,0,0,0.08); color: inherit;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; flex-shrink: 0;
}
.wf-step.active .wf-step-n { background: rgba(255,255,255,0.25); }
.wf-step-divider { flex: 1; height: 1px; background: var(--border); min-width: 12px; max-width: 40px; }

.wf-tool-section { padding: 40px 0; scroll-margin-top: 130px; border-top: 1px solid var(--border); }
.wf-tool-section:first-of-type { border-top: none; }
.wf-tool-head { margin-bottom: 24px; }
.wf-tool-head .wf-tool-eyebrow { font-size: 12px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent); margin-bottom: 6px; }
.wf-tool-head h2 { font-family: var(--font-display); font-size: 26px; font-weight: 600; color: var(--secondary); letter-spacing: -0.015em; }
.wf-tool-head p { color: var(--muted-ink); font-size: 15px; margin-top: 6px; max-width: 680px; }

/* Screener */
.screener-grid { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: 24px; align-items: start; }
.screener-panel, .summary-panel {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); overflow: hidden;
}
.screener-panel .panel-head, .summary-panel .panel-head { background: var(--primary-subtle); }
.screener-inputs { padding: 22px; display: grid; gap: 16px; }
.screener-outputs { padding: 22px; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; align-content: start; }
.screen-out {
  border-radius: var(--radius-md); padding: 16px 18px;
  border: 1px solid var(--border);
  background: linear-gradient(135deg, var(--surface) 0%, var(--primary-subtle-light) 100%);
}
.screen-out .so-label { font-size: 11px; font-weight: 700; letter-spacing: 0.07em; text-transform: uppercase; color: var(--muted-ink); margin-bottom: 6px; }
.screen-out .so-value { font-family: var(--font-display); font-size: 28px; font-weight: 700; color: var(--secondary); line-height: 1; font-variant-numeric: tabular-nums; }
.screen-out.tone-success { background: var(--success-bg); border-color: var(--success-border); }
.screen-out.tone-success .so-value { color: var(--success); }
.screen-out.tone-warning { background: var(--warning-bg); border-color: var(--warning-border); }
.screen-out.tone-warning .so-value { color: var(--warning); }
.screen-out.tone-danger { background: var(--danger-bg); border-color: var(--danger-border); }
.screen-out.tone-danger .so-value { color: var(--danger); }
.screen-out .so-note { font-size: 11.5px; color: var(--muted-ink); margin-top: 5px; }
.screener-footer { padding: 0 22px 22px; display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.screener-footer .screener-hint { font-size: 12.5px; color: var(--light-ink); }
.btn-primary:disabled, .btn-primary[aria-disabled="true"] { background: var(--border-strong); cursor: not-allowed; pointer-events: none; transform: none; box-shadow: none; }

/* Deal summary dashboard */
.summary-metrics { padding: 22px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.summary-metric { background: linear-gradient(135deg, var(--surface) 0%, var(--primary-subtle-light) 100%); border: 1px solid rgba(10,107,170,0.18); border-radius: var(--radius-sm); padding: 14px; }
.summary-metric .sm-label { font-size: 10.5px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted-ink); margin-bottom: 6px; line-height: 1.3; }
.summary-metric .sm-value { font-family: var(--font-display); font-size: 19px; font-weight: 600; color: var(--secondary); font-variant-numeric: tabular-nums; }
.summary-metric.empty .sm-value { color: var(--light-ink); }
.summary-empty-note { padding: 0 22px 18px; font-size: 13px; color: var(--muted-ink); font-style: italic; }
.summary-foot { padding: 18px 22px; border-top: 1px solid var(--border); background: var(--page); display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.summary-foot .sf-text { font-size: 13px; color: var(--muted-ink); max-width: 360px; }

/* Calculator chain (interactive) */
.wf-chain-row {
  display: grid; grid-auto-flow: column; grid-auto-columns: minmax(230px, 1fr);
  gap: 14px;
}
.chain-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: 18px; display: flex; flex-direction: column; gap: 12px;
  position: relative;
}
.chain-card.is-current { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-subtle); }
.chain-card.is-complete { border-color: var(--success-border); background: var(--success-bg); }
.chain-card-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.chain-card-step { font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--light-ink); }
.chain-status { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 700; padding: 3px 9px; border-radius: 999px; white-space: nowrap; }
.chain-status.start { background: var(--primary-subtle); color: var(--primary); }
.chain-status.incomplete { background: var(--page); color: var(--light-ink); border: 1px solid var(--border); }
.chain-status.complete { background: var(--success); color: white; }
.chain-card h3 { font-family: var(--font-display); font-size: 16px; font-weight: 600; color: var(--secondary); line-height: 1.25; }
.chain-card .chain-key-output { font-size: 13px; color: var(--muted-ink); flex: 1; }
.chain-card .chain-key-output .ck-val { font-family: var(--font-display); font-weight: 700; color: var(--success); font-size: 18px; }
.chain-card .chain-flow-note { font-size: 11.5px; color: var(--light-ink); display: flex; align-items: center; gap: 5px; }
.chain-card .btn-open {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 9px 14px; border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 600; text-decoration: none; cursor: pointer;
  border: 1px solid var(--border-strong); background: white; color: var(--secondary);
  transition: border-color 0.15s, color 0.15s;
}
.chain-card .btn-open:hover { border-color: var(--primary); color: var(--primary); }
.chain-card.is-current .btn-open { background: var(--primary); color: white; border-color: var(--primary); }
.chain-card.is-current .btn-open:hover { background: var(--primary-hover); color: white; }

/* Auto-populated field treatment */
.autopop-field { margin-top: 4px; }
.autopop-field label { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: var(--ink); margin-bottom: 5px; }
.autopop-badge {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 9.5px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase;
  background: var(--primary-subtle); color: var(--primary);
  border: 1px solid #C6DEEE; border-radius: 4px; padding: 1px 6px;
}
.autopop-input-wrap { position: relative; display: flex; align-items: center; }
.autopop-input-wrap .affix { position: absolute; left: 12px; color: var(--muted-ink); font-weight: 600; font-size: 14px; pointer-events: none; }
.autopop-input {
  width: 100%; padding: 9px 12px 9px 26px;
  border: 1.5px solid var(--primary); border-radius: var(--radius-sm);
  background: var(--primary-subtle-light);
  font-size: 15px; font-weight: 600; font-family: var(--font-body); color: var(--secondary);
  transition: background 0.15s, border-color 0.15s;
}
.autopop-input:focus { outline: none; box-shadow: 0 0 0 3px var(--primary-subtle); }
.autopop-input.overridden { background: white; border-color: var(--warning); }
.autopop-reset {
  display: none; align-items: center; gap: 5px;
  margin-top: 7px; font-size: 12px; font-weight: 600; color: var(--primary);
  background: none; border: none; cursor: pointer; padding: 0;
}
.autopop-reset.show { display: inline-flex; }
.autopop-reset:hover { color: var(--primary-hover); }

/* Workflow complete panel */
.wf-complete {
  margin-top: 28px;
  background: linear-gradient(135deg, var(--secondary) 0%, #123456 100%);
  border-radius: var(--radius-lg); padding: 32px; color: white;
}
.wf-complete.hidden { display: none; }
.wf-complete-head { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; }
.wf-complete-head .wc-check { width: 36px; height: 36px; border-radius: 50%; background: var(--success); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.wf-complete-head h3 { font-family: var(--font-display); font-size: 22px; font-weight: 600; color: white; }
.wf-complete-metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 24px; }
.wc-metric { background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.12); border-radius: var(--radius-sm); padding: 14px; }
.wc-metric .wc-label { font-size: 10.5px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: rgba(255,255,255,0.6); margin-bottom: 5px; }
.wc-metric .wc-value { font-family: var(--font-display); font-size: 20px; font-weight: 700; }
.wf-complete-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.wf-complete-actions .btn-primary { background: var(--accent); color: var(--secondary); }
.wf-complete-actions .btn-primary:hover { background: var(--accent-hover); }

@media (max-width: 900px) {
  .wf-grid { grid-template-columns: 1fr 1fr; }
  .wf-how-steps { grid-template-columns: 1fr; }
  .screener-grid { grid-template-columns: 1fr; }
  .summary-metrics { grid-template-columns: repeat(2, 1fr); }
  .wf-complete-metrics { grid-template-columns: repeat(2, 1fr); }
  .wf-who-grid { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .wf-grid { grid-template-columns: 1fr; }
  .screener-outputs { grid-template-columns: 1fr 1fr; }
  /* Calculator chain: horizontal scroll-snap with peeking next card */
  .wf-chain-row {
    grid-auto-columns: 80%;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    padding-bottom: 10px;
    margin: 0 -18px; padding-left: 18px; padding-right: 18px;
  }
  .chain-card { scroll-snap-align: start; }
  .wf-stepbar-inner { overflow-x: auto; }
  .wf-step-divider { display: none; }
}

/* ============ PRINT ============ */
@media print {
  body { background: white !important; }
  .no-print { display: none !important; }
  .print-only { display: block !important; }

  .calc-hero {
    padding: 0 0 16px 0 !important;
    background: white !important;
    border-bottom: 2px solid var(--secondary) !important;
    margin-bottom: 20px;
  }
  .calc-hero::before { display: none !important; }
  .calc-hero-inner { max-width: none; }
  h1.calc-title { font-size: 28px !important; margin-bottom: 6px; }
  .calc-sub { font-size: 13px !important; max-width: none; }

  .calc-main { padding: 0 !important; }
  .calc-grid { grid-template-columns: 1fr !important; gap: 18px; }
  .panel {
    box-shadow: none !important;
    border-radius: 8px;
    page-break-inside: auto;
  }
  .results-panel {
    position: static !important;
    max-height: none !important;
    overflow: visible !important;
    page-break-before: auto;
  }
  .panel-head {
    background: var(--page) !important;
    padding: 12px 18px !important;
  }
  .panel-head h2 { font-size: 14px !important; }
  .panel-body { padding: 18px !important; }

  .hero-answer {
    box-shadow: none !important;
    background: white !important;
    border: 2px solid var(--secondary) !important;
    padding: 18px !important;
    page-break-inside: avoid;
  }
  .hero-answer .big-value { font-size: 36px !important; }
  .hero-answer .context, .hero-answer .context.cols-3 {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
  }

  .input-section h3 .num { background: white !important; border: 1px solid var(--border); }
  .field input[type="text"], .field input[type="number"], .field select {
    border: 1px solid var(--border-strong) !important;
    box-shadow: none !important;
    background: white !important;
  }

  /* Print: metric cards stay boxed but stack cleanly */
  .metric-group { page-break-inside: avoid; margin-top: 16px; }
  .metric-grid {
    grid-template-columns: repeat(3, 1fr) !important;
  }
  .metric-grid.cols-2 { grid-template-columns: 1fr 1fr !important; }
  .metric { padding: 8px 12px !important; background: white !important; border: 1px solid var(--border) !important; }
  .metric-value { font-size: 16px !important; }

  .msgbox { page-break-inside: avoid; }
  .note { page-break-inside: avoid; }

  .container { max-width: none !important; padding: 0 !important; }
  @page {
    margin: 14mm 14mm 18mm;
    size: letter;
  }
  body::after {
    content: 'propertydealtools.com';
    position: fixed;
    bottom: 6mm;
    left: 0; right: 0;
    text-align: center;
    font-size: 10px;
    color: var(--muted-ink);
    font-family: var(--font-body);
  }

  /* Make sure tweaks panel/modal/popover don't print */
  #tweaks-panel, #__pdt-modal, #__pdt-popover, .pdt-toast { display: none !important; }

  /* ===== Compare Deals print layout ===== */
  .tabs-strip, .tag-filters, .deal-col-delete, .deal-col.add-deal,
  .compare-actions, .danger-btn { display: none !important; }
  .compare-header { display: block !important; margin-bottom: 14px !important; }
  .compare-header h2 { font-size: 22px !important; margin-bottom: 2px; }
  .compare-header p { font-size: 11px !important; }
  .deal-columns {
    display: grid !important;
    grid-auto-flow: row !important;
    grid-auto-columns: unset !important;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)) !important;
    gap: 10px !important;
    overflow: visible !important;
  }
  .deal-col {
    box-shadow: none !important;
    page-break-inside: avoid;
  }
  .deal-col-head {
    background: var(--page) !important;
    padding: 10px 12px !important;
  }
  .deal-col-name { font-size: 13px !important; }
  .deal-col-meta { font-size: 10px !important; }
  .deal-col-body { padding: 12px !important; }
  .deal-hero { padding: 12px 8px !important; margin-bottom: 12px !important; }
  .deal-hero-value { font-size: 24px !important; }
  .deal-hero-eyebrow { font-size: 9px !important; }
  .deal-section { margin-bottom: 10px !important; }
  .deal-section-label { font-size: 9px !important; margin-bottom: 6px !important; }
  .deal-row { padding: 4px 0 !important; font-size: 11px !important; }
  .deal-col-foot { display: none !important; }
  .deal-col-tag { font-size: 9px !important; padding: 1px 6px !important; }
}


/* ===== Global sitemap footer (used across all pages) ===== */
footer.sitemap {
  background: var(--brand-blue); color: white;
  padding: 56px 0 0;
}
footer.sitemap .container { max-width: 1100px; }
footer.sitemap .sm-grid {
  display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr 1fr;
  gap: 36px; padding-bottom: 48px;
}
footer.sitemap .sm-brand .logo { margin-bottom: 6px; }
footer.sitemap .sm-brand h4 {
  font-family: var(--font-display); font-weight: 700;
  font-size: 18px; margin: 14px 0 10px; color: white;
}
footer.sitemap .sm-brand p { color: rgba(255,255,255,0.72); font-size: 13.5px; line-height: 1.55; max-width: 280px; margin: 0; }
footer.sitemap h5 {
  font-family: var(--font-display); font-weight: 700;
  font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase;
  color: rgba(255,255,255,0.55); margin: 0 0 16px;
}
footer.sitemap ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 9px; }
footer.sitemap ul a {
  color: rgba(255,255,255,0.86); font-size: 13.5px;
  text-decoration: none;
}
footer.sitemap ul a:hover { color: white; }
footer.sitemap ul a.see-all { color: var(--accent); font-weight: 600; }
footer.sitemap .sm-bottom {
  border-top: 1px solid rgba(255,255,255,0.16);
  padding: 22px 0; display: flex; justify-content: space-between; align-items: center;
  flex-wrap: wrap; gap: 14px; font-size: 13px; color: rgba(255,255,255,0.66);
}
footer.sitemap .sm-bottom-links { display: flex; gap: 22px; align-items: center; }
footer.sitemap .sm-bottom-links a { color: rgba(255,255,255,0.86); text-decoration: none; position: relative; }
footer.sitemap .sm-bottom-links a + a::before {
  content: '\00b7'; position: absolute; left: -13px; color: rgba(255,255,255,0.5); font-weight: 700;
}
footer.sitemap .sm-bottom-links a:hover { color: white; }
@media (max-width: 900px) {
  footer.sitemap .sm-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 540px) {
  footer.sitemap .sm-grid { grid-template-columns: 1fr; gap: 28px; }
}
