/* ══════════════════════════════
   calculator-page.css
   Styles for calculator templates (percentage-calculator, etc.)
   ══════════════════════════════ */

.calc-card {
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding: 24px;
}

/* ══════════════════════════════
   Card header (icon + title + subtitle)
   ══════════════════════════════ */
.calc-card-header {
  display: flex;
  align-items: center;
  gap: 14px;
}

.calc-card-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  background: var(--accent-soft);
  color: var(--accent);
  border-radius: 50%;
}
.calc-card-icon svg { width: 22px; height: 22px; }

.calc-card-headings h2 {
  font-size: 18px;
  font-weight: 800;
  color: var(--text-strong);
  line-height: 1.2;
  margin: 0 0 2px;
}
.calc-card-headings p {
  font-size: 13px;
  color: var(--muted);
  margin: 0;
  line-height: 1.4;
}


/* ══════════════════════════════
   Calculator strip (value × percent = result + button)
   Mobile: row 1 = value × percent · row 2 = result + button
   ══════════════════════════════ */
.pct-strip {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  grid-template-areas:
    "v op-x p"
    "r r r"
    "btn btn btn";
  align-items: end;
  gap: 12px 10px;
}

/* Discount strip: adds a "savings" cell next to the result.
   Mobile: r and sav stacked. Desktop: side-by-side (handled in media query). */
.pct-strip-savings {
  grid-template-columns: 1fr auto 1fr;
  grid-template-areas:
    "v op-x p"
    "r r r"
    "sav sav sav"
    "btn btn btn";
}

.pct-strip-savings .pct-savings-field { grid-area: sav; }

/* Tip strip: 3 inputs + 2 outputs.
   Mobile: inputs row, outputs row, button row. */
.pct-strip-tip {
  grid-template-columns: 1fr 1fr 1fr;
  grid-template-areas:
    "v p ppl"
    "r r r"
    "sav sav sav"
    "btn btn btn";
  gap: 12px 10px;
}
.pct-strip-tip .pct-field:nth-of-type(1) { grid-area: v; }
.pct-strip-tip .pct-field:nth-of-type(2) { grid-area: p; }
.pct-strip-tip .pct-field:nth-of-type(3) { grid-area: ppl; }
.pct-strip-tip .pct-result-field         { grid-area: r; }
.pct-strip-tip .pct-savings-field        { grid-area: sav; }
.pct-strip-tip .pct-op {
  /* All operators hidden on mobile; "=" only appears on desktop side-by-side layout */
  display: none;
}
.pct-strip-tip .pct-op:last-of-type {
  display: none;
}

/* Savings display — secondary, no box, just teal accent text */
.pct-savings-display {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 46px;
  padding: 0 4px;
  font-family: 'DM Mono', monospace;
  font-size: 14px;
  color: var(--accent);
  font-weight: 600;
  text-align: center;
}
.pct-savings-display strong {
  font-weight: 700;
  color: var(--accent);
  font-size: 16px;
}

.pct-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.pct-strip .pct-field:nth-of-type(1) { grid-area: v; }
.pct-strip .pct-field:nth-of-type(2) { grid-area: p; }
.pct-strip .pct-result-field         { grid-area: r; }

.pct-strip .pct-op {
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'DM Mono', monospace;
  font-size: 22px;
  font-weight: 600;
  color: var(--accent);
  padding-bottom: 5px;
}
.pct-strip .pct-op-of {
  font-size: 14px;
  font-weight: 700;
  text-transform: lowercase;
  color: var(--muted);
  padding-bottom: 12px;
}
.pct-strip .pct-op:first-of-type  { grid-area: op-x; }
/* Hide the "=" operator on mobile (its own dedicated class makes this surgical). */
.pct-strip .pct-op-eq { display: none !important; }

.pct-result-display {
  width: 100%;
  padding: 0 14px;
  font-family: 'DM Mono', monospace;
  font-size: 18px;
  font-weight: 700;
  color: var(--accent);
  background: rgba(13,148,136,0.06);
  border: 1px solid var(--card-stroke);
  border-radius: var(--radius-sm);
  text-align: center;
  height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease;
}

.pct-calc-btn {
  grid-area: btn;
  width: 100%;
  height: 46px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
}
.pct-calc-btn svg {
  width: 18px;
  height: 18px;
  margin-left: 4px;
}


/* ══════════════════════════════
   "How it's calculated" info box
   ══════════════════════════════ */
.pct-explain {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 16px;
  padding: 18px 20px;
  background: linear-gradient(135deg, rgba(94,234,212,0.18), rgba(209,250,229,0.5));
  border: 1px solid var(--accent-border);
  border-radius: var(--radius);
}

.pct-explain-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  background: rgba(255,255,255,0.7);
  color: var(--accent);
  border-radius: 50%;
  flex-shrink: 0;
  align-self: start;
}
.pct-explain-icon svg { width: 22px; height: 22px; }

.pct-explain-cols {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  min-width: 0;
}

.pct-explain-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 6px;
}

.pct-explain-formula {
  font-family: 'DM Mono', monospace;
  font-size: 13px;
  color: var(--text);
  line-height: 1.6;
}
.pct-explain-formula + .pct-explain-formula { color: var(--text-strong); font-weight: 500; }

.pct-explain-steps {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.pct-explain-steps li {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: 'DM Mono', monospace;
  font-size: 13px;
  color: var(--text-strong);
  line-height: 1.4;
}
.pct-step-check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  background: var(--accent);
  color: #ffffff;
  border-radius: 50%;
}
.pct-step-check svg { width: 11px; height: 11px; }


/* ══════════════════════════════
   Average Calculator — value list
   Grid layout: 2 cols on mobile, 4 cols on desktop.
   Each cell holds a labeled input with a small floating × close badge
   in the top-right.
   ══════════════════════════════ */

.avg-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.avg-list-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
  position: relative;
}
.avg-list-row .cb-label {
  margin-bottom: 0;
}

/* Close badge — small floating × in the top-right corner of the input cell */
.avg-list-row .avg-remove {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 1px solid var(--card-stroke);
  background: #ffffff;
  color: var(--muted);
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  z-index: 2;
  box-shadow: 0 2px 6px rgba(13,148,136,0.10);
  transition: background 0.18s, color 0.18s, border-color 0.18s, transform 0.18s;
}
.avg-list-row .avg-remove:hover {
  background: var(--accent);
  color: #ffffff;
  border-color: var(--accent);
  transform: scale(1.08);
}
.avg-list-row .avg-remove:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}
.avg-list-row .avg-remove:disabled:hover {
  background: #ffffff;
  color: var(--muted);
  border-color: var(--card-stroke);
  transform: none;
}

/* Toolbar: Add value (left) + Calculate (right) */
.avg-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: flex-start;
}
.avg-toolbar .pct-calc-btn {
  margin-left: auto;
}

.avg-add-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 12px 18px;
  border-radius: var(--radius-sm);
  border: 1px dashed var(--accent-border);
  background: rgba(13,148,136,0.06);
  color: var(--accent);
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.18s, border-color 0.18s;
}
.avg-add-btn:hover {
  background: rgba(13,148,136,0.12);
  border-color: var(--accent);
}
.avg-add-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* Outputs row: average (primary) + sum + count (secondary) */
.avg-output {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}
.avg-primary {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 16px 18px;
  background: rgba(13,148,136,0.08);
  border: 1px solid var(--accent-border);
  border-radius: var(--radius);
}
.avg-primary .cb-label { color: var(--accent); margin-bottom: 0; }
.avg-primary-value {
  font-family: 'DM Mono', monospace;
  font-size: 28px;
  font-weight: 700;
  color: var(--accent);
  line-height: 1.1;
}

.avg-secondary {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.avg-secondary > div {
  padding: 12px 14px;
  background: rgba(255,255,255,0.6);
  border: 1px solid var(--card-stroke);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.avg-secondary-value {
  font-family: 'DM Mono', monospace;
  font-size: 18px;
  font-weight: 700;
  color: var(--text-strong);
  line-height: 1.1;
}


/* ══════════════════════════════
   Age Calculator
   Single date input + Calculate, then a result card with primary
   age (years) and a secondary "years, months, days" line.
   ══════════════════════════════ */

.age-input-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: end;
}

/* The date field grows to fill available space; button stays compact */
.age-input-row .pct-field {
  flex: 1 1 240px;
  min-width: 0;
}

/* <input type="date"> needs special handling:
   - explicit width to fill its container (some browsers shrink to content)
   - explicit min-height matching other inputs (otherwise Chrome can collapse it)
   - display: block to prevent inline-block weirdness
   - appearance: none then re-add native picker via ::-webkit-calendar-picker-indicator
*/
.age-input-row input[type="date"] {
  display: block;
  width: 100%;
  min-width: 0;
  min-height: 46px;
  box-sizing: border-box;
  -webkit-appearance: none;
  appearance: none;
}
/* Restore the native calendar picker icon */
.age-input-row input[type="date"]::-webkit-calendar-picker-indicator {
  cursor: pointer;
  opacity: 0.6;
}
.age-input-row input[type="date"]::-webkit-calendar-picker-indicator:hover {
  opacity: 1;
}

.age-input-row .pct-calc-btn {
  flex: 0 0 auto;
  height: 46px;
  min-width: 150px;
  padding: 0 26px;
}

/* Result card — the only output cell, designed to breathe */
.age-result {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 22px 24px;
  background: rgba(13,148,136,0.08);
  border: 1px solid var(--accent-border);
  border-radius: var(--radius);
}
.age-result .cb-label { color: var(--accent); margin-bottom: 0; }
.age-result-primary {
  font-family: 'DM Mono', monospace;
  font-size: 32px;
  font-weight: 700;
  color: var(--accent);
  line-height: 1.1;
}
.age-result-secondary {
  font-family: 'DM Mono', monospace;
  font-size: 15px;
  font-weight: 600;
  color: var(--text-strong);
  line-height: 1.4;
}
.age-result-error {
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  color: #b91c1c;
}


/* ══════════════════════════════
   Word Counter
   Live-updating tool with a textarea, a stat strip, and a details card.
   ══════════════════════════════ */

/* Header actions: Clear + Copy Text buttons */
.wc-header-actions {
  display: flex;
  gap: 8px;
  margin-left: auto;
  flex-shrink: 0;
}
.wc-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: rgba(255,255,255,0.7);
  border: 1px solid var(--card-stroke);
  border-radius: var(--radius-sm);
  color: var(--text-strong);
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.18s, border-color 0.18s, color 0.18s;
}
.wc-action-btn:hover {
  background: rgba(13,148,136,0.08);
  border-color: var(--accent-border);
  color: var(--accent);
}
.wc-action-btn svg {
  width: 14px;
  height: 14px;
}
/* Make the calc-card-header allow actions to wrap nicely */
.wc-card .calc-card-header {
  flex-wrap: wrap;
}

/* Textarea */
.wc-textarea {
  width: 100%;
  min-height: 220px;
  padding: 16px 18px;
  font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 15px;
  line-height: 1.6;
  color: var(--text-strong);
  background: rgba(255,255,255,0.7);
  border: 1px solid var(--card-stroke);
  border-radius: var(--radius);
  resize: vertical;
  transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
  -webkit-appearance: none;
  appearance: none;
}
.wc-textarea:focus {
  outline: none;
  border-color: var(--accent);
  background: rgba(255,255,255,0.95);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.wc-textarea::placeholder {
  color: var(--muted);
  opacity: 0.6;
}

/* Main stat strip */
.wc-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
  padding: 20px 22px;
  background: rgba(13,148,136,0.06);
  border: 1px solid var(--accent-border);
  border-radius: var(--radius);
}
.wc-stat {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.wc-stat-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  background: var(--accent-soft);
  color: var(--accent);
  border-radius: 50%;
  font-family: 'DM Mono', monospace;
  font-weight: 700;
  font-size: 14px;
}
.wc-stat-icon svg { width: 18px; height: 18px; }
.wc-stat-content {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.wc-stat-value {
  font-family: 'DM Mono', monospace;
  font-size: 24px;
  font-weight: 800;
  color: var(--text-strong);
  line-height: 1.05;
}
.wc-stat-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  line-height: 1.3;
}

/* Details card */
.wc-details-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px 28px;
  padding: 16px 18px;
  background: rgba(255,255,255,0.5);
  border: 1px solid var(--card-stroke);
  border-radius: var(--radius);
}
.wc-detail-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 14px;
}
.wc-detail-row::before {
  content: '';
  display: inline-block;
  width: 8px;
  height: 8px;
  background: var(--accent);
  border-radius: 50%;
  flex-shrink: 0;
}
.wc-detail-label {
  flex: 1;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text);
}
.wc-detail-value {
  font-family: 'DM Mono', monospace;
  font-weight: 700;
  color: var(--text-strong);
}

/* Tooltip on (i) icons */
.wc-info {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  color: var(--muted);
  cursor: help;
  position: relative;
}
.wc-info svg { width: 14px; height: 14px; }
.wc-info::after {
  content: attr(data-tip);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--text-strong);
  color: #ffffff;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 500;
  font-family: inherit;
  line-height: 1.4;
  white-space: normal;
  width: max-content;
  max-width: 240px;
  box-shadow: 0 4px 14px rgba(0,0,0,0.15);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s;
  z-index: 10;
}
.wc-info:hover::after,
.wc-info:focus::after {
  opacity: 1;
}

/* Subtle pulse animation for stat values when they update */
@keyframes wc-pulse {
  0%   { transform: scale(1); }
  50%  { transform: scale(1.06); }
  100% { transform: scale(1); }
}
.wc-stat-value.is-updated {
  animation: wc-pulse 0.25s ease;
}


/* ══════════════════════════════
   BMI Calculator
   Unit toggle + height/weight inputs + result card with category badge
   ══════════════════════════════ */

/* Unit toggle (segmented control) */
.bmi-unit-toggle {
  display: inline-flex;
  background: rgba(255,255,255,0.6);
  border: 1px solid var(--card-stroke);
  border-radius: var(--radius-sm);
  padding: 3px;
  gap: 0;
  align-self: flex-start;
}
.bmi-unit-btn {
  padding: 8px 18px;
  background: transparent;
  border: none;
  color: var(--muted);
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  border-radius: calc(var(--radius-sm) - 3px);
  cursor: pointer;
  transition: background 0.18s, color 0.18s;
}
.bmi-unit-btn:hover {
  color: var(--accent);
}
.bmi-unit-btn.is-active {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #ffffff;
}

/* Input rows (one for metric, one for imperial — toggled via JS) */
.bmi-inputs {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: end;
}
.bmi-inputs[hidden] { display: none; }

.bmi-inputs .pct-field {
  flex: 1 1 140px;
  min-width: 0;
}
/* Imperial height pair (ft + in) sit closer together */
.bmi-inputs .bmi-ft  { flex: 1 1 100px; }
.bmi-inputs .bmi-in  { flex: 1 1 100px; }

.bmi-inputs .pct-calc-btn {
  flex: 0 0 auto;
  height: 46px;
  min-width: 150px;
  padding: 0 26px;
}

/* Result card */
.bmi-result {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 22px 24px;
  background: rgba(13,148,136,0.06);
  border: 1px solid var(--accent-border);
  border-radius: var(--radius);
}
.bmi-result-top {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.bmi-result-value {
  font-family: 'DM Mono', monospace;
  font-size: 38px;
  font-weight: 700;
  color: var(--accent);
  line-height: 1;
}
.bmi-result-label {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--muted);
}

/* Category badge — color shifts based on category */
.bmi-badge {
  display: inline-flex;
  align-items: center;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  border: 1px solid;
}
.bmi-badge[data-cat="under"]  { background: rgba(96,165,250,0.12); border-color: rgba(96,165,250,0.4); color: #1d4ed8; }
.bmi-badge[data-cat="normal"] { background: rgba(13,148,136,0.12); border-color: var(--accent-border); color: var(--accent); }
.bmi-badge[data-cat="over"]   { background: rgba(245,158,11,0.12); border-color: rgba(245,158,11,0.4); color: #b45309; }
.bmi-badge[data-cat="obese"]  { background: rgba(220,38,38,0.10);  border-color: rgba(220,38,38,0.35); color: #b91c1c; }
.bmi-badge[data-cat=""]       { background: rgba(0,0,0,0.04); border-color: var(--card-stroke); color: var(--muted); }

/* Range scale visualization */
.bmi-scale {
  position: relative;
  margin-top: 4px;
}
.bmi-scale-bar {
  display: grid;
  /* Proportional widths: under(0-18.5), normal(18.5-25), over(25-30), obese(30+ shown up to 40) */
  grid-template-columns: 18.5fr 6.5fr 5fr 10fr;
  height: 10px;
  border-radius: 999px;
  overflow: hidden;
}
.bmi-scale-bar > div:nth-child(1) { background: rgba(96,165,250,0.55); }
.bmi-scale-bar > div:nth-child(2) { background: rgba(13,148,136,0.55); }
.bmi-scale-bar > div:nth-child(3) { background: rgba(245,158,11,0.55); }
.bmi-scale-bar > div:nth-child(4) { background: rgba(220,38,38,0.5); }

.bmi-scale-marker {
  position: absolute;
  top: -4px;
  left: 50%; /* default position; JS updates on calculate */
  width: 18px;
  height: 18px;
  background: #ffffff;
  border: 3px solid var(--accent);
  border-radius: 50%;
  transform: translateX(-50%);
  box-shadow: 0 2px 6px rgba(0,0,0,0.12);
  transition: left 0.4s ease;
  pointer-events: none;
}

.bmi-scale-labels {
  display: grid;
  grid-template-columns: 18.5fr 6.5fr 5fr 10fr;
  margin-top: 8px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--muted);
}
.bmi-scale-labels span {
  text-align: center;
  white-space: nowrap;
}

.bmi-disclaimer {
  font-size: 12px;
  line-height: 1.5;
  color: var(--muted);
  margin-top: 4px;
}

/* Error state for invalid input */
.bmi-result-error {
  font-size: 14px;
  font-weight: 600;
  color: #b91c1c;
}


/* ══════════════════════════════
   Date Difference Calculator
   Two date inputs + Calculate, then a result card with a big calendar
   icon + primary "N days" on the left and a secondary list on the right.
   ══════════════════════════════ */

.dd-input-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: end;
}
.dd-input-row .pct-field {
  flex: 1 1 200px;
  min-width: 0;
}
.dd-input-row input[type="date"] {
  display: block;
  width: 100%;
  min-width: 0;
  min-height: 46px;
  box-sizing: border-box;
  -webkit-appearance: none;
  appearance: none;
}
.dd-input-row input[type="date"]::-webkit-calendar-picker-indicator {
  cursor: pointer;
  opacity: 0.6;
}
.dd-input-row input[type="date"]::-webkit-calendar-picker-indicator:hover {
  opacity: 1;
}
.dd-input-row .pct-calc-btn {
  flex: 0 0 auto;
  height: 46px;
  min-width: 150px;
  padding: 0 26px;
}

/* Result card */
.dd-result {
  display: grid;
  grid-template-columns: 1fr;
  gap: 22px;
  padding: 22px 24px;
  background: rgba(13,148,136,0.06);
  border: 1px solid var(--accent-border);
  border-radius: var(--radius);
}

/* Primary block: big calendar icon + label + value */
.dd-primary {
  display: flex;
  align-items: center;
  gap: 18px;
}
.dd-primary-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 80px;
  height: 80px;
  flex-shrink: 0;
  background: var(--accent-soft);
  color: var(--accent);
  border-radius: 50%;
}
.dd-primary-icon svg { width: 38px; height: 38px; }

.dd-primary-text {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.dd-primary-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
}
.dd-primary-value {
  font-family: 'DM Mono', monospace;
  font-size: 32px;
  font-weight: 800;
  color: var(--text-strong);
  line-height: 1;
}

/* Secondary list: simple dot + line per breakdown unit */
.dd-secondary {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.dd-secondary-row {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  color: var(--text-strong);
  font-weight: 600;
}
.dd-secondary-row::before {
  content: '';
  display: inline-block;
  width: 8px;
  height: 8px;
  background: var(--accent);
  border-radius: 50%;
  flex-shrink: 0;
}


/* ══════════════════════════════
   Quick Examples
   ══════════════════════════════ */
.calc-card-icon-soft {
  background: var(--accent-soft);
  color: var(--accent);
}

.pct-examples-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.pct-example-tile {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  padding: 14px 16px;
  background: rgba(255,255,255,0.6);
  border: 1px solid var(--card-stroke);
  border-radius: var(--radius);
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  transition: transform 0.15s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}
.pct-example-tile:hover {
  transform: translateY(-2px);
  border-color: var(--accent-border);
  box-shadow: 0 6px 14px rgba(13,148,136,0.10);
}
.pct-example-tile strong {
  font-size: 14px;
  font-weight: 800;
  color: var(--text-strong);
  line-height: 1.2;
}
.pct-example-tile span {
  font-family: 'DM Mono', monospace;
  font-size: 13px;
  color: var(--muted);
}


/* ══════════════════════════════
   Page body (override for inner pages — flat)
   ══════════════════════════════ */
.page-body .card {
  background: none;
  border: 0;
  padding: 0;
  box-shadow: none;
  border-radius: 0;
}


/* ══════════════════════════════
   Desktop overrides (≥ 769px)
   ══════════════════════════════ */
@media (min-width: 769px) {
  .calc-card { padding: 32px 36px; gap: 26px; }

  .calc-card-icon { width: 52px; height: 52px; }
  .calc-card-icon svg { width: 26px; height: 26px; }
  .calc-card-headings h2 { font-size: 22px; }
  .calc-card-headings p  { font-size: 14px; }

  /* Calculator strip — single row */
  .pct-strip {
    grid-template-columns: 1.4fr auto 1.4fr auto 1.4fr auto;
    grid-template-areas: "v op-x p op-eq r btn";
    align-items: end;
    gap: 14px;
  }
  .pct-strip .pct-op-eq {
    display: flex !important;
    grid-area: op-eq;
  }

  /* Discount strip: result + savings + button on one row */
  .pct-strip-savings {
    grid-template-columns: 1.4fr auto 1.4fr auto 1.4fr auto auto;
    grid-template-areas: "v op-x p op-eq r sav btn";
  }
  .pct-savings-display {
    height: 46px;
    align-self: end;
  }

  /* Tip strip: 3 inputs + tip + per-person + button, all in one row */
  .pct-strip-tip {
    grid-template-columns: 1.2fr 1fr 0.7fr auto 0.8fr auto auto;
    grid-template-areas: "v p ppl op-eq r sav btn";
    gap: 14px;
  }
  .pct-strip-tip .pct-op:last-of-type {
    display: flex;
    grid-area: op-eq;
    padding-bottom: 5px;
  }
  .pct-strip-tip .pct-savings-display {
    align-self: baseline;
    padding-left: 0;
  }
  .pct-calc-btn {
    width: auto;
    min-width: 150px;
    padding: 0 26px;
    height: 46px;
  }
  .pct-result-display {
    font-size: 20px;
  }

  /* "How it's calculated" — two columns */
  .pct-explain { padding: 22px 26px; }
  .pct-explain-cols { grid-template-columns: 1fr 1fr; gap: 32px; }

  /* Quick Examples — 5 across */
  .pct-examples-grid {
    grid-template-columns: repeat(5, 1fr);
    gap: 14px;
  }
  .pct-example-tile { padding: 16px 18px; }

  /* Average — outputs side by side */
  .avg-output {
    grid-template-columns: 2fr 1fr;
    align-items: stretch;
  }
  .avg-secondary {
    grid-template-columns: 1fr 1fr;
  }
  .avg-primary { padding: 18px 22px; }
  .avg-primary-value { font-size: 36px; }

  /* Average — 4 inputs per row */
  .avg-list {
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
  }

  /* Age — bigger result on desktop (input/button layout already handled at 600px) */
  .age-result { padding: 26px 28px; }
  .age-result-primary   { font-size: 42px; }
  .age-result-secondary { font-size: 16px; }

  /* Word Counter — stat strip 5 across, details 2-col */
  .wc-stats {
    grid-template-columns: repeat(5, 1fr);
    gap: 14px;
  }
  .wc-stats .wc-stat {
    /* On desktop, soft vertical dividers between stats */
    position: relative;
  }
  .wc-stats .wc-stat + .wc-stat::before {
    content: '';
    position: absolute;
    left: -7px;
    top: 4px;
    bottom: 4px;
    width: 1px;
    background: var(--card-stroke);
  }
  .wc-details-list {
    grid-template-columns: 1fr 1fr;
  }

  /* BMI — bigger result and a touch more breathing room */
  .bmi-result { padding: 28px 30px; }
  .bmi-result-value { font-size: 52px; }

  /* Date Difference — primary on left, secondary list on right */
  .dd-result {
    grid-template-columns: 1fr 1fr;
    align-items: center;
    padding: 26px 28px;
    column-gap: 32px;
  }
  .dd-primary-value { font-size: 42px; }
  .dd-primary-icon { width: 92px; height: 92px; }
  .dd-primary-icon svg { width: 44px; height: 44px; }
}
