/* ============================================
   TIP CALCULATOR — page styles
   Accent: orange (#f97316 dark / #ea580c light) — Other category
   ============================================ */

/* ---- Page wrapper ---- */
.calc-page {
  position: relative; z-index: 1;
  max-width: 1380px; margin: 0 auto;
  padding: 48px 24px 80px;
  display: grid;
  grid-template-columns: 1fr 480px;
  grid-template-rows: auto auto;
  gap: 48px; align-items: start;
}
.calc-page-info {
  position: static;
}

/* ---- Breadcrumb ---- */
.calc-breadcrumb {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; color: var(--text-dim); margin-bottom: 20px; flex-wrap: wrap;
}
.calc-breadcrumb a { color: var(--text-dim); transition: color var(--transition); }
.calc-breadcrumb a:hover { color: #f97316; }
body.light-theme .calc-breadcrumb a:hover { color: #ea580c; }
.calc-breadcrumb i { font-size: 10px; }

/* ---- Category tag ---- */
.calc-page-tag {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 4px 12px 4px 8px;
  background: rgba(249,115,22,0.10); border: 1px solid rgba(249,115,22,0.28);
  border-radius: 100px; font-size: 12px; font-weight: 600; color: #f97316;
  text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 18px;
}
body.light-theme .calc-page-tag {
  background: rgba(234,88,12,0.08); border-color: rgba(234,88,12,0.22); color: #ea580c;
}

/* ---- Title ---- */
.calc-page-title {
  font-family: 'Bricolage Grotesque', sans-serif;
  font-size: clamp(28px, 3.2vw, 44px); font-weight: 800;
  line-height: 1.1; letter-spacing: -1.5px; color: var(--text); margin-bottom: 16px;
}
.calc-page-title span { color: #f97316; }
body.light-theme .calc-page-title span { color: #ea580c; }
.calc-page-desc { font-size: 16px; line-height: 1.75; color: var(--text-muted); margin-bottom: 32px; }

/* ---- Feature pills ---- */
.calc-features { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 40px; }
.calc-feature-pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 100px; font-size: 13px; font-weight: 500; color: var(--text-muted);
}
.calc-feature-pill i { color: #f97316; font-size: 12px; }
body.light-theme .calc-feature-pill i { color: #ea580c; }

/* ---- Content blocks ---- */
.calc-page-content {
  margin-top: 0;
  min-width: 0;
}

.calc-page-content.fade-up {
  opacity: 1;
  transform: none;
  animation: none;
  transition: none;
  visibility: visible;
}
.content-block { margin-bottom: 44px; }
.content-block h2 {
  font-family: 'Bricolage Grotesque', sans-serif; font-size: 22px; font-weight: 700;
  letter-spacing: -0.5px; color: var(--text); margin-bottom: 14px;
}
.content-block p { font-size: 15px; line-height: 1.8; color: var(--text-muted); margin-bottom: 12px; }
.content-block strong { color: var(--text); font-weight: 600; }

/* ---- Formula grid ---- */
.tip-formula-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 16px;
}
.tip-formula-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 14px 16px; display: flex; flex-direction: column; gap: 6px;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.tip-formula-card:hover { border-color: #f97316; box-shadow: 0 0 0 1px rgba(249,115,22,0.15); }
body.light-theme .tip-formula-card:hover { border-color: #ea580c; box-shadow: 0 0 0 1px rgba(234,88,12,0.12); }
.tfc-label {
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.08em; color: #f97316;
}
body.light-theme .tfc-label { color: #ea580c; }
.tfc-formula {
  font-family: 'DM Mono', monospace; font-size: 13px; font-weight: 500;
  color: var(--text); background: var(--bg-3); padding: 5px 9px;
  border: 1px solid var(--border); border-radius: 6px;
}
.tfc-example { font-size: 11px; color: var(--text-dim); font-style: italic; }

/* ---- Tipping guide table ---- */
.tip-guide-table-wrap { overflow-x: auto; margin-top: 16px; border-radius: var(--radius-sm); border: 1px solid var(--border); }
.tip-guide-table {
  width: 100%; border-collapse: collapse; font-size: 13px; color: var(--text-muted);
  min-width: 500px;
}
.tip-guide-table thead th {
  padding: 11px 14px; background: var(--bg-3); border-bottom: 1px solid var(--border);
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--text-dim); text-align: left; white-space: nowrap;
}
.tip-guide-table tbody td {
  padding: 10px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; line-height: 1.5;
}
.tip-guide-table tbody tr:last-child td { border-bottom: none; }
.tip-guide-table tbody tr:hover td { background: var(--bg-3); }
.tip-guide-table td:first-child { color: var(--text); font-weight: 500; white-space: nowrap; }
.tip-guide-table td i { color: #f97316; margin-right: 6px; font-size: 12px; }
body.light-theme .tip-guide-table td i { color: #ea580c; }
.tip-badge {
  display: inline-block; padding: 2px 8px; border-radius: 100px;
  font-size: 11px; font-weight: 700; white-space: nowrap;
}
.tip-badge-good { background: rgba(16,185,129,0.14); color: #10b981; border: 1px solid rgba(16,185,129,0.28); }
.tip-badge-fair { background: rgba(249,115,22,0.12); color: #f97316; border: 1px solid rgba(249,115,22,0.28); }
.tip-badge-low  { background: rgba(148,163,184,0.12); color: var(--text-dim); border: 1px solid var(--border); }
body.light-theme .tip-badge-good { background: rgba(5,150,105,0.08); color: #059669; border-color: rgba(5,150,105,0.22); }
body.light-theme .tip-badge-fair { background: rgba(234,88,12,0.08); color: #ea580c; border-color: rgba(234,88,12,0.22); }

/* ---- FAQ ---- */
.faq-list { display: flex; flex-direction: column; gap: 8px; }
.faq-item {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); overflow: hidden;
}
.faq-item:hover { border-color: var(--border-hover); }
.faq-question {
  width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 18px; background: transparent; border: none; cursor: pointer;
  font-family: 'DM Sans', sans-serif; font-size: 15px; font-weight: 600;
  color: var(--text); text-align: left; transition: color var(--transition);
}
.faq-question:hover { color: #f97316; }
body.light-theme .faq-question:hover { color: #ea580c; }
.faq-question i { font-size: 12px; color: var(--text-dim); flex-shrink: 0; transition: transform var(--transition), color var(--transition); }
.faq-item.open .faq-question i { transform: rotate(180deg); color: #f97316; }
body.light-theme .faq-item.open .faq-question i { color: #ea580c; }
.faq-answer {
  max-height: 0; overflow: hidden;
  transition: max-height 0.35s ease, padding 0.35s ease;
  font-size: 14px; line-height: 1.75; color: var(--text-muted); padding: 0 18px;
}
.faq-item.open .faq-answer { max-height: 280px; padding: 0 18px 16px; }

/* ---- Also search ---- */
.also-search-grid { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.also-search-chip {
  display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 100px;
  font-size: 13px; font-weight: 500; color: var(--text-muted);
  transition: background var(--transition), border-color var(--transition), color var(--transition);
}
.also-search-chip:hover { background: rgba(249,115,22,0.08); border-color: #f97316; color: #f97316; }
body.light-theme .also-search-chip:hover { background: rgba(234,88,12,0.06); border-color: #ea580c; color: #ea580c; }
.also-search-chip i { color: #f97316; font-size: 12px; }
body.light-theme .also-search-chip i { color: #ea580c; }

/* ============================================
   CALC CARD
   ============================================ */
.calc-panel { position: sticky; top: calc(var(--header-h, 68px) + 24px); }
.calc-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); overflow: hidden;
  box-shadow: var(--shadow-lg), 0 0 60px rgba(249,115,22,0.05);
}
.calc-card-header {
  padding: 20px 24px 18px; background: var(--bg-2); border-bottom: 1px solid var(--border);
  display: none; align-items: center; gap: 12px;
}
@media (max-width: 1024px) { .calc-card-header { display: flex; } }
.calc-card-icon {
  width: 40px; height: 40px; border-radius: 10px;
  background: rgba(249,115,22,0.10); border: 1px solid rgba(249,115,22,0.26);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; color: #f97316; flex-shrink: 0;
}
body.light-theme .calc-card-icon { background: rgba(234,88,12,0.07); border-color: rgba(234,88,12,0.22); color: #ea580c; }
.calc-card-header-text h3 { font-family: 'Bricolage Grotesque', sans-serif; font-size: 16px; font-weight: 700; color: var(--text); margin-bottom: 2px; }
.calc-card-header-text p  { font-size: 12px; color: var(--text-dim); }
.calc-card-body { padding: 20px 22px 22px; display: flex; flex-direction: column; gap: 14px; }

/* ============================================
   BILL ROW — currency + amount side by side
   ============================================ */
.tip-bill-row {
  display: grid; grid-template-columns: 120px 1fr; gap: 10px; align-items: end;
}
.form-group { display: flex; flex-direction: column; gap: 7px; }
.form-label {
  display: flex; align-items: center; gap: 7px;
  font-size: 12px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.05em; color: var(--text-muted);
}
.form-label i { color: #f97316; font-size: 11px; }
body.light-theme .form-label i { color: #ea580c; }
.form-input {
  width: 100%; padding: 10px 12px; background: var(--bg-2);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  color: var(--text); font-family: 'DM Sans', sans-serif; font-size: 14px;
  outline: none; transition: border-color var(--transition), box-shadow var(--transition);
  -moz-appearance: textfield; appearance: none;
}
.form-input::-webkit-outer-spin-button, .form-input::-webkit-inner-spin-button { -webkit-appearance: none; }
.form-input:hover { border-color: var(--border-hover); }
.form-input:focus { border-color: #f97316; box-shadow: 0 0 0 3px rgba(249,115,22,0.14); }
body.light-theme .form-input:focus { border-color: #ea580c; box-shadow: 0 0 0 3px rgba(234,88,12,0.10); }
.form-select { appearance: auto; cursor: pointer; }

/* Layout sub-groups (extend .form-group, no extra rules needed) */
.tip-currency-group {}
.tip-bill-group { flex: 1; }

/* Bill input with symbol prefix */
.tip-bill-input-wrap { position: relative; }
.tip-bill-symbol {
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  font-size: 14px; font-weight: 600; color: var(--text-dim); pointer-events: none;
  font-family: 'Bricolage Grotesque', sans-serif;
}
.tip-bill-input { padding-left: 28px !important; font-family: 'Bricolage Grotesque', sans-serif !important; font-size: 18px !important; font-weight: 700 !important; }

/* ============================================
   TIP PRESET PILLS
   ============================================ */
.tip-presets {
  display: flex; flex-wrap: wrap; gap: 6px; margin-top: 2px;
}
.tip-preset-pill {
  padding: 8px 14px; border-radius: 100px;
  background: var(--bg-2); border: 1px solid var(--border);
  color: var(--text-muted); font-family: 'DM Sans', sans-serif;
  font-size: 13px; font-weight: 600; cursor: pointer; outline: none;
  transition: background var(--transition), border-color var(--transition),
              color var(--transition), box-shadow var(--transition), transform 0.12s;
}
.tip-preset-pill:hover:not(.active) {
  background: rgba(249,115,22,0.08); border-color: rgba(249,115,22,0.30); color: #f97316;
}
body.light-theme .tip-preset-pill:hover:not(.active) {
  background: rgba(234,88,12,0.06); border-color: rgba(234,88,12,0.26); color: #ea580c;
}
.tip-preset-pill.active {
  background: #f97316; border-color: #f97316; color: #fff;
  box-shadow: 0 2px 12px rgba(249,115,22,0.40);
}
body.light-theme .tip-preset-pill.active {
  background: #ea580c; border-color: #ea580c; color: #fff;
  box-shadow: 0 2px 10px rgba(234,88,12,0.35);
}
.tip-preset-pill:active { transform: scale(0.93); }
.tip-preset-custom {
  background: var(--bg-3); border-style: dashed;
}

/* Custom % input */
.tip-custom-row {
  display: flex; align-items: center; gap: 8px; margin-top: 8px;
}
.tip-custom-input {
  flex: 1; text-align: center;
  font-family: 'DM Mono', monospace !important; font-size: 16px !important; font-weight: 700 !important;
}
.tip-custom-unit {
  font-size: 16px; font-weight: 700; color: var(--text-dim);
  font-family: 'Bricolage Grotesque', sans-serif;
}

/* ============================================
   PEOPLE STEPPER
   ============================================ */
.tip-stepper-row {
  display: flex; align-items: center; gap: 12px;
}
.tip-stepper-btn {
  width: 40px; height: 40px; border-radius: 50%;
  background: rgba(249,115,22,0.10); border: 1px solid rgba(249,115,22,0.28);
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; color: #f97316; cursor: pointer; outline: none; flex-shrink: 0;
  transition: background var(--transition), box-shadow var(--transition), transform 0.14s;
}
body.light-theme .tip-stepper-btn { background: rgba(234,88,12,0.07); border-color: rgba(234,88,12,0.24); color: #ea580c; }
.tip-stepper-btn:hover { background: #f97316; color: #fff; box-shadow: 0 2px 12px rgba(249,115,22,0.40); }
body.light-theme .tip-stepper-btn:hover { background: #ea580c; color: #fff; }
.tip-stepper-btn:active { transform: scale(0.88); }
.tip-stepper-btn:disabled { opacity: 0.35; cursor: not-allowed; pointer-events: none; }

.tip-stepper-display {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px;
  background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 10px 0;
}
.tip-stepper-val {
  font-family: 'Bricolage Grotesque', sans-serif; font-size: 26px; font-weight: 800;
  color: var(--text); line-height: 1;
}
.tip-stepper-label { font-size: 11px; color: var(--text-dim); font-weight: 500; }

/* ============================================
   LIVE RESULT BANNER
   ============================================ */
.tip-result-banner {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 18px 20px;
  background: linear-gradient(135deg, rgba(249,115,22,0.10) 0%, rgba(249,115,22,0.04) 100%);
  border: 1px solid rgba(249,115,22,0.26); border-radius: var(--radius-sm);
  transition: border-color var(--transition);
}
body.light-theme .tip-result-banner {
  background: linear-gradient(135deg, rgba(234,88,12,0.08) 0%, rgba(234,88,12,0.02) 100%);
  border-color: rgba(234,88,12,0.22);
}
.tip-result-banner.has-result { border-color: #f97316; box-shadow: 0 0 0 1px rgba(249,115,22,0.18); }
body.light-theme .tip-result-banner.has-result { border-color: #ea580c; box-shadow: 0 0 0 1px rgba(234,88,12,0.15); }
.tip-banner-label {
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.09em; color: var(--text-dim);
}
.tip-banner-val {
  font-family: 'Bricolage Grotesque', sans-serif; font-size: 36px; font-weight: 800;
  color: #f97316; line-height: 1; transition: color var(--transition);
}
body.light-theme .tip-banner-val { color: #ea580c; }
.tip-banner-val.empty { font-size: 24px; color: var(--text-dim); }
.tip-banner-sub { font-size: 12px; color: var(--text-dim); }

/* ============================================
   4 STAT CHIPS
   ============================================ */
.tip-stat-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
}
.tip-stat-chip {
  display: flex; align-items: center; gap: 10px; padding: 12px 14px;
  background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--radius-sm);
  transition: border-color var(--transition);
}
.tip-stat-chip:hover { border-color: var(--border-hover); }
.tip-stat-highlight {
  border-color: rgba(249,115,22,0.32);
  background: rgba(249,115,22,0.06);
}
body.light-theme .tip-stat-highlight {
  border-color: rgba(234,88,12,0.26); background: rgba(234,88,12,0.04);
}
.tip-stat-icon {
  width: 32px; height: 32px; border-radius: 8px; flex-shrink: 0;
  background: rgba(249,115,22,0.10); border: 1px solid rgba(249,115,22,0.22);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; color: #f97316;
}
body.light-theme .tip-stat-icon { background: rgba(234,88,12,0.07); border-color: rgba(234,88,12,0.18); color: #ea580c; }
.tip-stat-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.tip-stat-label { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.07em; color: var(--text-dim); }
.tip-stat-val {
  font-family: 'Bricolage Grotesque', sans-serif; font-size: 16px; font-weight: 800;
  color: var(--text); line-height: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.tip-stat-highlight .tip-stat-val { color: #f97316; }
body.light-theme .tip-stat-highlight .tip-stat-val { color: #ea580c; }

/* ============================================
   QUALITY METER
   ============================================ */
.tip-meter-section {
  background: var(--bg-2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 14px 16px;
}
.tip-meter-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 10px;
}
.tip-meter-label {
  display: flex; align-items: center; gap: 7px;
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.08em; color: #f97316;
}
body.light-theme .tip-meter-label { color: #ea580c; }
.tip-meter-label i { font-size: 12px; }
.tip-meter-level {
  font-family: 'Bricolage Grotesque', sans-serif; font-size: 13px; font-weight: 800;
  color: var(--text);
}
/* Colour states for the level label */
.tip-meter-level.level-low        { color: #64748b; }
.tip-meter-level.level-fair       { color: #f97316; }
body.light-theme .tip-meter-level.level-fair { color: #ea580c; }
.tip-meter-level.level-good       { color: #10b981; }
body.light-theme .tip-meter-level.level-good { color: #059669; }
.tip-meter-level.level-generous   { color: #6366f1; }
.tip-meter-level.level-exceptional{ color: #ec4899; }

.tip-meter-track {
  height: 10px; border-radius: 100px; background: var(--bg-3);
  border: 1px solid var(--border); overflow: hidden;
}
.tip-meter-fill {
  height: 100%; border-radius: 100px; width: 0%;
  transition: width 0.55s cubic-bezier(0.34,1.56,0.64,1), background-color 0.4s ease;
}
/* Fill colours per level */
.tip-meter-fill.level-low        { background: #94a3b8; }
.tip-meter-fill.level-fair       { background: #f97316; }
body.light-theme .tip-meter-fill.level-fair { background: #ea580c; }
.tip-meter-fill.level-good       { background: #10b981; }
body.light-theme .tip-meter-fill.level-good { background: #059669; }
.tip-meter-fill.level-generous   { background: #6366f1; }
.tip-meter-fill.level-exceptional{ background: linear-gradient(90deg, #ec4899, #f97316); }

.tip-meter-scale {
  display: flex; justify-content: space-between; margin-top: 5px;
  font-size: 9px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.05em; color: var(--text-dim);
}

/* ============================================
   RESET + ERROR + RESULT NOTE
   ============================================ */
.tip-clear-btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; padding: 9px 16px; background: transparent;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  color: var(--text-dim); font-family: 'DM Sans', sans-serif;
  font-size: 13px; font-weight: 600; cursor: pointer;
  transition: background var(--transition), border-color var(--transition), color var(--transition);
}
.tip-clear-btn:hover { background: var(--bg-3); border-color: var(--border-hover); color: var(--text); }

.calc-error {
  display: flex; align-items: center; gap: 10px; padding: 12px 16px;
  background: rgba(251,113,133,0.08); border: 1px solid rgba(251,113,133,0.28);
  border-radius: var(--radius-sm); color: #fb7185;
  font-size: 14px; font-weight: 500;
  opacity: 0; transform: translateY(-6px);
  transition: opacity 0.3s ease, transform 0.3s ease; pointer-events: none;
}
body.light-theme .calc-error { color: #e11d48; background: rgba(225,29,72,0.07); border-color: rgba(225,29,72,0.26); }
.calc-error.show { opacity: 1; transform: translateY(0); pointer-events: auto; }

.result-note {
  display: flex; align-items: flex-start; gap: 8px;
  font-size: 11px; color: var(--text-dim); line-height: 1.6;
}
.result-note i { color: #f97316; font-size: 11px; flex-shrink: 0; margin-top: 1px; }
body.light-theme .result-note i { color: #ea580c; }

/* ============================================
   TOPIC CLUSTER
   ============================================ */
.topic-cluster-section {
  position: relative; z-index: 1; background: var(--bg-2);
  border-top: 1px solid var(--border); border-bottom: 1px solid var(--border);
}
.topic-cluster-inner { max-width: 1380px; margin: 0 auto; padding: 56px 24px; }
.topic-cluster-header { max-width: 680px; margin-bottom: 40px; }
.topic-cluster-tag {
  display: inline-flex; align-items: center; gap: 7px; padding: 4px 12px 4px 8px;
  background: rgba(249,115,22,0.10); border: 1px solid rgba(249,115,22,0.24);
  border-radius: 100px; font-size: 12px; font-weight: 600; color: #f97316;
  text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 16px;
}
body.light-theme .topic-cluster-tag { background: rgba(234,88,12,0.07); border-color: rgba(234,88,12,0.20); color: #ea580c; }
.topic-cluster-header h2 {
  font-family: 'Bricolage Grotesque', sans-serif; font-size: clamp(22px,2.5vw,30px);
  font-weight: 800; letter-spacing: -0.8px; color: var(--text); margin-bottom: 12px;
}
.topic-cluster-header p { font-size: 15px; line-height: 1.75; color: var(--text-muted); }

.cluster-grid { display: grid; grid-template-columns: 280px 1fr; gap: 24px; margin-bottom: 40px; align-items: start; }
.cluster-primary { background: var(--surface); border: 2px solid #f97316; border-radius: var(--radius); padding: 22px; position: relative; }
body.light-theme .cluster-primary { border-color: #ea580c; }
.cluster-primary::before { content: ''; position: absolute; inset: 0; border-radius: inherit; background: linear-gradient(135deg, rgba(249,115,22,0.07) 0%, transparent 60%); pointer-events: none; }
.cluster-primary-label { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: #f97316; margin-bottom: 10px; }
body.light-theme .cluster-primary-label { color: #ea580c; }
.cluster-primary h3 { font-family: 'Bricolage Grotesque', sans-serif; font-size: 18px; font-weight: 700; color: var(--text); margin-bottom: 8px; position: relative; }
.cluster-primary p  { font-size: 13px; line-height: 1.65; color: var(--text-muted); margin-bottom: 14px; position: relative; }
.cluster-keywords { display: flex; flex-wrap: wrap; gap: 6px; position: relative; }
.cluster-keywords span { padding: 3px 9px; background: rgba(249,115,22,0.10); border: 1px solid rgba(249,115,22,0.22); border-radius: 100px; font-size: 11px; font-weight: 600; color: #f97316; }
body.light-theme .cluster-keywords span { background: rgba(234,88,12,0.07); border-color: rgba(234,88,12,0.18); color: #ea580c; }

.cluster-links { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.cluster-links h3 { font-family: 'Bricolage Grotesque', sans-serif; font-size: 14px; font-weight: 700; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.06em; padding: 14px 20px; border-bottom: 1px solid var(--border); background: var(--bg-3); }
.cluster-link-list { display: flex; flex-direction: column; }
.cluster-link-item { display: flex; align-items: center; gap: 14px; padding: 14px 20px; border-bottom: 1px solid var(--border); transition: background var(--transition); }
.cluster-link-item:last-child { border-bottom: none; }
.cluster-link-item:hover { background: var(--bg-3); }
.cluster-link-icon { flex-shrink: 0; width: 34px; height: 34px; border-radius: 8px; background: rgba(249,115,22,0.09); display: flex; align-items: center; justify-content: center; font-size: 15px; color: #f97316; }
body.light-theme .cluster-link-icon { background: rgba(234,88,12,0.07); color: #ea580c; }
.cluster-link-text { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.cluster-link-text strong { font-size: 14px; font-weight: 600; color: var(--text); }
.cluster-link-text span   { font-size: 12px; color: var(--text-dim); }
.cluster-link-arrow { color: var(--text-dim); font-size: 12px; transition: transform var(--transition), color var(--transition); }
.cluster-link-item:hover .cluster-link-arrow { transform: translateX(3px); color: #f97316; }
body.light-theme .cluster-link-item:hover .cluster-link-arrow { color: #ea580c; }
.cluster-link-all { background: var(--bg-2); }

.cluster-crosslinks { padding-top: 32px; border-top: 1px solid var(--border); }
.cluster-crosslinks h3 { font-family: 'Bricolage Grotesque', sans-serif; font-size: 18px; font-weight: 700; letter-spacing: -0.3px; color: var(--text); margin-bottom: 6px; }
.cluster-crosslinks > p { font-size: 14px; color: var(--text-muted); margin-bottom: 20px; }
.crosslink-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.crosslink-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 16px; display: flex; flex-direction: column; gap: 8px; transition: border-color var(--transition), transform var(--transition), box-shadow var(--transition); }
.crosslink-card:hover { border-color: #f97316; transform: translateY(-3px); box-shadow: var(--shadow); }
body.light-theme .crosslink-card:hover { border-color: #ea580c; }
.crosslink-card i { font-size: 20px; color: #f97316; }
body.light-theme .crosslink-card i { color: #ea580c; }
.crosslink-card strong { font-family: 'Bricolage Grotesque', sans-serif; font-size: 14px; font-weight: 700; color: var(--text); }
.crosslink-card span { font-size: 12px; line-height: 1.5; color: var(--text-dim); }

/* Ad + fade */
.ad-slot { position: relative; z-index: 1; max-width: 1380px; margin: 0 auto; padding: 0 24px 40px; }
.ad-slot > div { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.fade-up { opacity: 0; transform: translateY(16px); transition: opacity 0.5s ease, transform 0.5s ease; }
.fade-up.visible { opacity: 1; transform: translateY(0); }

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 1024px) {
  .calc-page { grid-template-columns: 1fr; padding: 32px 20px 60px; gap: 32px; }
  .calc-page-info { position: static; }
  .calc-panel { position: static; order: 2; }
  .calc-page-content { order: 3; }
  .cluster-grid { grid-template-columns: 1fr; }
  .crosslink-grid { grid-template-columns: 1fr 1fr; }
  .tip-formula-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
  .calc-page { padding: 24px 16px 48px; }
  .crosslink-grid { grid-template-columns: 1fr; }
  .topic-cluster-inner { padding: 36px 16px; }
  .tip-formula-grid { grid-template-columns: 1fr; }
  .tip-stat-grid { grid-template-columns: 1fr 1fr; }
  .tip-bill-row { grid-template-columns: 100px 1fr; }
  .tip-presets { gap: 5px; }
  .tip-preset-pill { padding: 7px 10px; font-size: 12px; }
  .tip-banner-val { font-size: 28px; }
}
@media (max-width: 380px) {
  .tip-stat-grid { grid-template-columns: 1fr; }
  .tip-bill-row { grid-template-columns: 1fr; }
}

@media (min-width: 1025px) {
  .calc-page-info {
    grid-row: 1 / 2;
    grid-column: 1 / 2;
  }
  .calc-page-content {
    grid-row: 2 / 3;
    grid-column: 1 / 2;
  }
  .calc-panel {
    grid-row: 1 / 3;
    grid-column: 2 / 3;
    align-self: start;
    position: sticky;
    top: calc(var(--header-h, 68px) + 24px);
  }
}
