/* =======================================================================
   /tools — shared calculator hub styles.
   Built on top of /style.css design tokens. Page-specific tweaks belong
   inline in each tool page; this file owns layout primitives that every
   tool reuses (calculator card, input row, result box, ad slot, FAQ).
   ======================================================================= */

/* ---------- Hub layout ---------- */
.tools-hero {
  padding: 56px 20px 24px;
  text-align: center;
  max-width: 880px;
  margin: 0 auto;
}
.tools-hero h1 {
  font-size: clamp(28px, 5vw, 44px);
  line-height: 1.15;
  margin: 0 0 12px;
  color: var(--text);
  font-weight: 800;
}
.tools-hero p {
  font-size: clamp(15px, 2.2vw, 18px);
  color: var(--text-muted);
  margin: 0 auto;
  max-width: 600px;
}
.tools-filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
  margin: 22px auto 0;
  max-width: 720px;
}
.tools-filters button {
  background: var(--surface);
  border: 1px solid var(--border-strong);
  color: var(--text-muted);
  padding: 7px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: inherit;
}
.tools-filters button:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.tools-filters button[aria-pressed="true"] {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.tools-wrap {
  max-width: 1180px;
  margin: 0 auto;
  padding: 24px 20px 60px;
}

.tools-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}
@media (min-width: 640px)  { .tools-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 960px)  { .tools-grid { grid-template-columns: repeat(4, 1fr); } }
@media (min-width: 1200px) { .tools-grid { grid-template-columns: repeat(5, 1fr); } }

.tool-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 18px;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}
.tool-card:hover {
  transform: translateY(-4px) scale(1.01);
  box-shadow: var(--shadow-lg);
  border-color: var(--accent);
}
.tool-card .icon-box {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  line-height: 1;
  background: var(--accent-soft);
  color: var(--accent);
}
.tool-card .icon-box.finance  { background: #d1fae5; color: #047857; }
.tool-card .icon-box.property { background: #dbeafe; color: #1d4ed8; }
.tool-card .icon-box.health   { background: #ffedd5; color: #c2410c; }
.tool-card .icon-box.travel   { background: #ede9fe; color: #6d28d9; }
.tool-card h2 {
  font-size: 15.5px;
  margin: 0;
  font-weight: 700;
  color: var(--text);
  line-height: 1.25;
}
.tool-card p {
  font-size: 13px;
  margin: 0;
  color: var(--text-muted);
  line-height: 1.45;
}

/* ---------- Individual tool page ---------- */
.tool-page {
  max-width: 760px;
  margin: 0 auto;
  padding: 20px 20px 60px;
}
.breadcrumb {
  font-size: 13px;
  color: var(--text-subtle);
  margin: 14px 0 0;
}
.breadcrumb a { color: var(--text-muted); text-decoration: none; }
.breadcrumb a:hover { color: var(--accent); }
.tool-page h1 {
  font-size: clamp(26px, 4.2vw, 36px);
  margin: 18px 0 10px;
  color: var(--text);
  font-weight: 800;
  line-height: 1.15;
}
.tool-page > .intro {
  font-size: 16px;
  color: var(--text-muted);
  line-height: 1.6;
  margin: 0 0 22px;
}

.calc-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 24px 22px;
  box-shadow: var(--shadow);
  margin-bottom: 24px;
}
.calc-card label {
  display: block;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}
.calc-card label .hint {
  font-weight: 400;
  color: var(--text-subtle);
  margin-left: 6px;
}
.calc-card .row {
  margin-bottom: 16px;
}
.calc-card .row.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.calc-card input[type="number"],
.calc-card input[type="text"],
.calc-card select {
  width: 100%;
  font-family: inherit;
  font-size: 16px;
  padding: 12px 14px;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.calc-card input:focus,
.calc-card select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.preset-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.preset-row button {
  flex: 1 1 auto;
  min-width: 60px;
  padding: 10px 12px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  border-radius: 10px;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  font-family: inherit;
  color: var(--text-muted);
  transition: all 0.15s ease;
}
.preset-row button:hover { border-color: var(--accent); color: var(--accent); }
.preset-row button.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.unit-toggle {
  display: inline-flex;
  background: var(--surface-2);
  border-radius: 10px;
  padding: 4px;
  gap: 0;
}
.unit-toggle button {
  background: transparent;
  border: none;
  padding: 8px 14px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 13.5px;
  cursor: pointer;
  font-family: inherit;
  color: var(--text-muted);
}
.unit-toggle button.active {
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-sm);
}

.btn-calc {
  display: block;
  width: 100%;
  padding: 14px 18px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 12px;
  font-family: inherit;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.05s ease;
}
.btn-calc:hover { background: var(--accent-hover); }
.btn-calc:active { transform: scale(0.99); }
.btn-calc.finance  { background: #1a7f3c; } .btn-calc.finance:hover  { background: #146030; }
.btn-calc.property { background: #1d4ed8; } .btn-calc.property:hover { background: #1e40af; }
.btn-calc.health   { background: #ea580c; } .btn-calc.health:hover   { background: #c2410c; }
.btn-calc.travel   { background: #7c3aed; } .btn-calc.travel:hover   { background: #6d28d9; }

.result-box {
  margin-top: 22px;
  padding: 20px;
  background: var(--accent-soft);
  border: 1px solid var(--accent);
  border-radius: 14px;
  opacity: 0;
  max-height: 0;
  overflow: hidden;
  transition: opacity 0.3s ease, max-height 0.4s ease, padding 0.3s ease, margin 0.3s ease;
}
.result-box.show {
  opacity: 1;
  max-height: 1200px;
}
.result-box .primary {
  font-size: clamp(28px, 5vw, 36px);
  font-weight: 800;
  color: var(--text);
  line-height: 1.1;
  margin: 0 0 6px;
}
.result-box .primary .label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 2px;
}
.result-box .secondary {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 18px;
  margin: 14px 0 16px;
}
.result-box .secondary div {
  font-size: 13px;
  color: var(--text-muted);
}
.result-box .secondary div b {
  display: block;
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
}
.result-box.bmi-normal     { background: #dcfce7; border-color: #16a34a; }
.result-box.bmi-overweight { background: #fef9c3; border-color: #ca8a04; }
.result-box.bmi-obese      { background: #fee2e2; border-color: #dc2626; }
.result-box.bmi-under      { background: #dbeafe; border-color: #2563eb; }
.result-box.error          { background: #fef2f2; border-color: #ef4444; }
.result-box.error .primary { font-size: 18px; color: #991b1b; font-weight: 600; }
.result-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 8px;
}
.result-actions button {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border-strong);
  padding: 8px 14px;
  border-radius: 9px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease;
}
.result-actions button:hover { background: var(--surface-2); }
.result-actions .reset-btn {
  background: transparent;
  border: none;
  color: var(--text-subtle);
  padding: 8px 12px;
  font-weight: 500;
}
.result-actions .reset-btn:hover { color: var(--danger); }

/* ---------- AdSense slots ---------- */
.ad-slot {
  display: block;
  margin: 22px auto;
  text-align: center;
  min-height: 90px;
  background: var(--surface-2);
  border: 1px dashed var(--border);
  border-radius: 8px;
  padding: 8px;
  font-size: 11px;
  color: var(--text-subtle);
  max-width: 728px;
}
.ad-slot ins.adsbygoogle {
  display: block;
  margin: 0 auto;
}
.ad-slot.ad-result { max-width: 336px; }

/* ---------- Mobile app CTA ---------- */
.mobile-cta {
  background: linear-gradient(135deg, var(--accent-soft), var(--surface));
  border: 1px solid var(--accent);
  border-radius: 16px;
  padding: 20px 22px;
  margin: 28px 0;
  display: flex;
  align-items: center;
  gap: 16px;
  text-decoration: none;
  color: inherit;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.mobile-cta:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.mobile-cta .emoji {
  font-size: 32px;
  flex-shrink: 0;
}
.mobile-cta .text { flex: 1; }
.mobile-cta h3 {
  margin: 0 0 4px;
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
}
.mobile-cta p {
  margin: 0;
  font-size: 13.5px;
  color: var(--text-muted);
  line-height: 1.5;
}
.mobile-cta .chev { color: var(--accent); font-size: 22px; font-weight: 700; }

/* ---------- Sections (How / FAQ / More) ---------- */
.tool-page h2 {
  font-size: clamp(20px, 3vw, 24px);
  margin: 36px 0 14px;
  color: var(--text);
  font-weight: 700;
}
.tool-page h3 {
  font-size: 16px;
  margin: 16px 0 6px;
  color: var(--text);
  font-weight: 700;
}
.tool-page .step-list {
  list-style: none;
  padding: 0;
  margin: 0 0 14px;
  counter-reset: step;
}
.tool-page .step-list li {
  position: relative;
  padding-left: 40px;
  margin-bottom: 12px;
  font-size: 15px;
  color: var(--text);
  line-height: 1.6;
  counter-increment: step;
}
.tool-page .step-list li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
}
.tool-page p, .tool-page li { font-size: 15px; line-height: 1.65; color: var(--text); }
.tool-page .formula {
  background: var(--surface-2);
  border-left: 3px solid var(--accent);
  padding: 12px 16px;
  border-radius: 6px;
  font-family: 'SF Mono', Menlo, monospace;
  font-size: 13.5px;
  color: var(--text);
  margin: 12px 0;
  overflow-x: auto;
}

.faq-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 18px;
  margin-bottom: 10px;
}
.faq-item summary {
  font-weight: 600;
  cursor: pointer;
  list-style: none;
  color: var(--text);
  font-size: 15px;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: "+";
  float: right;
  color: var(--text-subtle);
  font-size: 18px;
  line-height: 1;
}
.faq-item[open] summary::after { content: "−"; }
.faq-item[open] summary { margin-bottom: 8px; }
.faq-item p {
  color: var(--text-muted);
  font-size: 14.5px;
  line-height: 1.6;
  margin: 6px 0 0;
}

.more-tools {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-top: 12px;
}
@media (min-width: 640px) { .more-tools { grid-template-columns: repeat(3, 1fr); } }
.more-tools .tool-card { padding: 14px; }
.more-tools .tool-card .icon-box { width: 44px; height: 44px; font-size: 22px; border-radius: 12px; }

/* Long Weekend specific list */
.holiday-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-top: 14px;
}
.holiday-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 14px;
}
.holiday-card .date-badge {
  background: var(--accent-soft);
  color: var(--accent-hover);
  font-weight: 700;
  border-radius: 10px;
  padding: 6px 10px;
  font-size: 13px;
  min-width: 86px;
  text-align: center;
}
.holiday-card .holiday-meta { flex: 1; }
.holiday-card .holiday-meta b { font-size: 15px; color: var(--text); display: block; margin-bottom: 2px; }
.holiday-card .holiday-meta span { font-size: 12.5px; color: var(--text-muted); }

/* Growth table (investment / dividend) */
.growth-table-wrap { margin-top: 14px; }
.growth-table-wrap summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 13.5px;
  color: var(--accent);
  margin-bottom: 8px;
}
.growth-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}
.growth-table th, .growth-table td {
  border-bottom: 1px solid var(--border);
  padding: 8px 6px;
  text-align: right;
}
.growth-table th:first-child, .growth-table td:first-child { text-align: left; }
.growth-table th {
  background: var(--surface-2);
  font-weight: 700;
  color: var(--text-muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

/* Long Weekend holiday list (ul/li variant) */
.holiday-list {
  list-style: none;
  padding: 0;
  margin: 14px 0 0;
  display: grid;
  gap: 8px;
}
.holiday-list li {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--border-strong);
  border-radius: 10px;
  padding: 10px 14px;
  display: grid;
  grid-template-columns: 130px 1fr;
  align-items: baseline;
  gap: 6px 14px;
  font-size: 14px;
  line-height: 1.4;
}
.holiday-list li .date { font-weight: 700; color: var(--text); }
.holiday-list li .name { color: var(--text); }
.holiday-list li .hint { grid-column: 2 / -1; font-size: 12.5px; color: var(--text-muted); }
.holiday-list li.star    { border-left-color: #f59e0b; background: #fffbeb; }
.holiday-list li.good    { border-left-color: #16a34a; background: #f0fdf4; }
.holiday-list li.mid     { border-left-color: #94a3b8; }
.holiday-list li.weekend { border-left-color: #cbd5e1; opacity: 0.7; }
@media (max-width: 480px) {
  .holiday-list li { grid-template-columns: 1fr; }
  .holiday-list li .hint { grid-column: 1; }
}

/* ============================================================
   Premium subscription system
   ============================================================ */

/* PRO badge */
.premium-badge {
  display: inline-block;
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  padding: 3px 7px;
  border-radius: 5px;
  letter-spacing: 0.6px;
  vertical-align: middle;
  box-shadow: 0 1px 3px rgba(245, 158, 11, 0.4);
}

/* PRO badge corner overlay on tool cards in the hub */
.tool-card .pro-corner {
  position: absolute;
  top: 8px;
  right: 8px;
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #fff;
  font-size: 9.5px;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 4px;
  letter-spacing: 0.4px;
  z-index: 2;
}
.tool-card { position: relative; }

/* Premium banner (top of page when subscribed) */
.premium-banner {
  background: linear-gradient(90deg, #f0fdf4, #ecfeff);
  border-bottom: 1px solid #a7f3d0;
  color: #065f46;
  padding: 10px 18px;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
}
.premium-banner .premium-logout {
  background: transparent;
  border: 1px solid #a7f3d0;
  color: #047857;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}
.premium-banner .premium-logout:hover { background: #d1fae5; }

/* Paywall modal */
.paywall-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.65);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  overflow-y: auto;
  animation: paywall-fade 0.18s ease-out;
}
.paywall-overlay[hidden] { display: none; }
@keyframes paywall-fade { from { opacity: 0; } to { opacity: 1; } }

.paywall-card {
  background: var(--surface);
  border-radius: 18px;
  padding: 32px 28px 24px;
  max-width: 480px;
  width: 100%;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  position: relative;
  max-height: calc(100vh - 40px);
  overflow-y: auto;
}
.paywall-close {
  position: absolute;
  top: 12px;
  right: 14px;
  background: transparent;
  border: none;
  font-size: 24px;
  line-height: 1;
  color: var(--text-subtle);
  cursor: pointer;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-family: inherit;
}
.paywall-close:hover { background: var(--surface-2); color: var(--text); }
.paywall-card h2 {
  font-size: 22px;
  margin: 0 0 8px;
  color: var(--text);
  font-weight: 800;
}
.paywall-card h2 .paywall-feature { color: #d97706; }
.paywall-card .paywall-sub {
  font-size: 14.5px;
  color: var(--text-muted);
  margin: 0 0 4px;
}
.plan-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 20px 0 16px;
}
.plan-card {
  border: 2px solid var(--border);
  border-radius: 14px;
  padding: 18px 12px 16px;
  position: relative;
  background: var(--surface);
}
.plan-card.featured {
  border-color: #10b981;
  background: linear-gradient(180deg, #f0fdf4, var(--surface));
}
.plan-card .plan-badge {
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  background: #10b981;
  color: #fff;
  font-size: 10.5px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 999px;
  letter-spacing: 0.4px;
}
.plan-card .plan-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin-bottom: 4px;
}
.plan-card .price {
  font-size: 28px;
  font-weight: 800;
  color: var(--text);
  line-height: 1;
}
.plan-card .period {
  font-size: 12.5px;
  color: var(--text-muted);
  margin: 6px 0 14px;
}
.btn-plan {
  display: block;
  background: #10b981;
  color: #fff;
  text-decoration: none;
  padding: 11px 12px;
  border-radius: 10px;
  font-weight: 700;
  font-size: 14px;
  transition: background 0.15s ease;
}
.btn-plan:hover { background: #059669; }
.btn-plan.outline {
  background: transparent;
  color: #047857;
  border: 2px solid #10b981;
  padding: 9px 12px;
}
.btn-plan.outline:hover { background: #d1fae5; }
.plan-features {
  list-style: none;
  padding: 0;
  margin: 14px 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px 12px;
  font-size: 13px;
  color: var(--text);
  text-align: left;
}
.plan-features li { padding: 2px 0; }
.paywall-fineprint {
  font-size: 12px;
  color: var(--text-subtle);
  margin: 6px 0 0;
}
.paywall-fineprint a { color: var(--accent); text-decoration: none; }
@media (max-width: 480px) {
  .plan-cards { grid-template-columns: 1fr; }
  .plan-features { grid-template-columns: 1fr; }
  .paywall-card { padding: 28px 18px 20px; }
}

/* Locked premium feature sections */
.premium-locked {
  position: relative;
  overflow: hidden;
}
.premium-locked .premium-blur {
  filter: blur(4px);
  pointer-events: none;
  user-select: none;
  opacity: 0.55;
}
.premium-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, rgba(255,255,255,0.5), rgba(255,255,255,0.85));
  backdrop-filter: blur(2px);
  text-align: center;
  padding: 20px;
  gap: 10px;
}
.premium-overlay h3 {
  margin: 0;
  font-size: 17px;
  font-weight: 800;
  color: var(--text);
}
.premium-overlay h3::before { content: "🔒 "; }
.premium-overlay p {
  margin: 0;
  font-size: 13.5px;
  color: var(--text-muted);
  max-width: 320px;
}
.btn-upgrade {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #fff;
  border: none;
  padding: 10px 18px;
  border-radius: 10px;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  font-family: inherit;
  box-shadow: 0 4px 14px rgba(245, 158, 11, 0.35);
  transition: transform 0.15s ease;
}
.btn-upgrade:hover { transform: translateY(-1px); }

/* Premium section card wrapper */
.premium-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 22px;
  margin: 22px 0;
  position: relative;
}
.premium-section h2 {
  font-size: 18px;
  margin: 0 0 6px;
  color: var(--text);
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 10px;
}
.premium-section h2 .premium-badge { font-size: 9.5px; }
.premium-section .premium-intro {
  font-size: 13.5px;
  color: var(--text-muted);
  margin: 0 0 14px;
}

/* History panel */
.history-panel {
  margin: 18px 0 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px 18px;
}
.history-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  font-size: 14px;
  color: var(--text);
}
.history-clear, .history-load, .history-delete {
  background: transparent;
  border: 1px solid var(--border-strong);
  color: var(--text-muted);
  padding: 4px 9px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}
.history-clear:hover, .history-load:hover { border-color: var(--accent); color: var(--accent); }
.history-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.history-list li {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  gap: 8px;
  align-items: center;
  padding: 8px 10px;
  background: var(--surface-2);
  border-radius: 8px;
  font-size: 13px;
}
.history-list .when { color: var(--text-subtle); font-size: 12px; white-space: nowrap; }
.history-list .summary { color: var(--text); }
.history-list .history-delete { padding: 2px 7px; border: none; font-size: 16px; }
.history-list .history-delete:hover { color: var(--danger); }
.history-empty { color: var(--text-muted); font-size: 13.5px; margin: 4px 0 0; }
.history-locked {
  text-align: center;
  padding: 6px 4px;
}
.history-locked h3 { margin: 0 0 6px; font-size: 16px; color: var(--text); font-weight: 700; }
.history-locked p { margin: 0 0 12px; font-size: 13.5px; color: var(--text-muted); }

/* Save / PDF buttons in result-actions */
.result-actions .btn-save,
.result-actions .btn-pdf {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border-strong);
}
.result-actions .btn-save:hover { border-color: #10b981; color: #047857; }
.result-actions .btn-pdf:hover  { border-color: #d97706; color: #b45309; }

/* Ad hiding for Premium users */
body.ads-hidden .ad-slot { display: none !important; }

/* Hub Premium section */
.hub-premium {
  max-width: 1180px;
  margin: 40px auto 0;
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
  border-radius: 24px;
  padding: 40px 28px;
  text-align: center;
}
.hub-premium h2 {
  font-size: clamp(22px, 3vw, 30px);
  font-weight: 800;
  color: #78350f;
  margin: 0 0 8px;
}
.hub-premium > p {
  font-size: 15px;
  color: #92400e;
  margin: 0 auto 24px;
  max-width: 540px;
}
.hub-premium-features {
  list-style: none;
  padding: 0;
  max-width: 560px;
  margin: 0 auto 24px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 18px;
  text-align: left;
  font-size: 14px;
  color: #78350f;
}
.hub-premium-features li { padding: 4px 0; font-weight: 600; }
.hub-premium .plan-cards {
  max-width: 480px;
  margin: 0 auto;
}
.hub-premium .plan-card { background: #fff; border-color: #fff; }
.hub-premium .plan-card.featured { background: #fff; border-color: #10b981; }
@media (max-width: 540px) {
  .hub-premium-features { grid-template-columns: 1fr; }
}

/* Premium-tool stack: multi-portfolio / multi-debt / multi-property rows */
.pro-stack {
  display: grid;
  gap: 12px;
  margin-bottom: 14px;
}
.pro-row {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
  position: relative;
}
.pro-row .pro-row-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.pro-row .pro-row-name { font-weight: 700; font-size: 14px; color: var(--text); }
.pro-row .pro-row-remove {
  background: transparent;
  border: none;
  color: var(--text-subtle);
  font-size: 18px;
  cursor: pointer;
  line-height: 1;
  padding: 2px 6px;
  border-radius: 6px;
  font-family: inherit;
}
.pro-row .pro-row-remove:hover { background: #fee2e2; color: var(--danger); }
.pro-row .pro-row-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 8px;
}
.pro-row label { font-size: 12px; color: var(--text-muted); font-weight: 600; }
.pro-row input, .pro-row select {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  background: var(--surface);
  color: var(--text);
}
.btn-add-row {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  border: 2px dashed var(--border-strong);
  color: var(--text-muted);
  padding: 10px 16px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 13.5px;
  cursor: pointer;
  font-family: inherit;
  width: 100%;
  justify-content: center;
}
.btn-add-row:hover { border-color: var(--accent); color: var(--accent); }

/* Pro summary boxes / comparison tables */
.pro-summary {
  background: var(--accent-soft);
  border: 1px solid var(--accent);
  border-radius: 12px;
  padding: 14px 16px;
  margin-top: 12px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
}
.pro-summary div { font-size: 12.5px; color: var(--text-muted); }
.pro-summary div b { display: block; font-size: 17px; font-weight: 800; color: var(--text); margin-top: 2px; }

.pro-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  margin-top: 12px;
}
.pro-table th, .pro-table td {
  border-bottom: 1px solid var(--border);
  padding: 8px 6px;
  text-align: right;
}
.pro-table th:first-child, .pro-table td:first-child { text-align: left; }
.pro-table th {
  background: var(--surface-2);
  font-weight: 700;
  color: var(--text-muted);
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}
.pro-table tr.best td { background: #f0fdf4; color: #065f46; font-weight: 700; }
.pro-table tr.worst td { background: #fef2f2; color: #991b1b; }

/* Calendar grid (dividend monthly calendar) */
.div-calendar {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-top: 12px;
}
@media (min-width: 640px) { .div-calendar { grid-template-columns: repeat(6, 1fr); } }
@media (min-width: 900px) { .div-calendar { grid-template-columns: repeat(12, 1fr); } }
.div-cal-month {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 6px;
  text-align: center;
  font-size: 11px;
}
.div-cal-month .m { font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.4px; }
.div-cal-month .amt { font-size: 13px; font-weight: 700; color: var(--text); margin-top: 4px; }
.div-cal-month.high { background: #dcfce7; border-color: #16a34a; }
.div-cal-month.mid  { background: #ecfccb; }
.div-cal-month.low  { background: var(--surface-2); }
.div-cal-month.zero .amt { color: var(--text-subtle); }

/* Sensitivity table for mortgage rates */
.sens-table tr.affordable td { background: #f0fdf4; }
.sens-table tr.stretch td    { background: #fef9c3; }
.sens-table tr.danger td     { background: #fee2e2; color: #991b1b; }

/* Debt freedom timeline (horizontal bars) */
.timeline {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}
.timeline-row {
  display: grid;
  grid-template-columns: 110px 1fr 90px;
  gap: 10px;
  align-items: center;
  font-size: 13px;
}
.timeline-row .name { font-weight: 700; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.timeline-row .bar {
  height: 22px;
  background: var(--surface-2);
  border-radius: 6px;
  overflow: hidden;
  position: relative;
}
.timeline-row .fill {
  height: 100%;
  background: linear-gradient(90deg, #1a7f3c, #16a34a);
  border-radius: 6px;
}
.timeline-row .end { font-size: 12px; color: var(--text-muted); text-align: right; }

/* Slider + range output */
.range-row { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: center; }
.range-row input[type="range"] { width: 100%; }
.range-row .range-val { font-weight: 700; color: var(--text); font-size: 14px; min-width: 90px; text-align: right; }

/* ============================================================
   Print styles — PDF export
   ============================================================ */
@media print {
  body { background: #fff !important; color: #000 !important; }
  .site-header, .footer, .ad-slot, .paywall-overlay, .premium-banner,
  .mobile-cta, .btn-calc, .result-actions, .breadcrumb, .more-tools,
  .nav-toggle, .site-nav, .site-cta, .premium-section .btn-upgrade,
  .premium-overlay, .btn-add-row, .pro-row-remove, h2 + .step-list, .faq-item {
    display: none !important;
  }
  .tool-page { max-width: 100%; padding: 0; }
  .calc-card, .result-box, .premium-section, .history-panel {
    box-shadow: none !important;
    border: 1px solid #ccc !important;
    page-break-inside: avoid;
  }
  .result-box { background: #f9fafb !important; opacity: 1 !important; max-height: none !important; }
  .tool-page h1 { font-size: 22px; margin: 0 0 8px; }
  .tool-page h2 { font-size: 16px; margin: 14px 0 6px; }
  .premium-badge { background: #d97706 !important; color: #fff !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  body::after {
    content: "Generated by todays-tasks.com — " attr(data-print-date);
    display: block;
    text-align: center;
    font-size: 10px;
    color: #666;
    margin-top: 14px;
    border-top: 1px solid #ddd;
    padding-top: 8px;
  }
}
