/* ============================================================
   TekproAI — calculator.css  v2.0  [FLUID TYPOGRAPHY + RESPONSIVE]
   Home Loan Calculator (calculator.html)
   
   Typography: all use CSS custom properties with clamp()
   Minimum font size: 12px — never goes below
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Bebas+Neue&family=Outfit:wght@400;500;600;700&family=DM+Mono:wght@400;500&display=swap');

/* ── Design Tokens ── */
:root {
  /* Backgrounds */
  --bg:         #F8F9FA;
  --surface:    #FFFFFF;
  --surface2:   #F3F4F6;
  --glass:      rgba(255, 255, 255, 0.94);

  /* Brand */
  --green:       #00C853;
  --green-text:  #006B32;
  --green-dim:   rgba(0, 200, 83, 0.10);
  --green-mid:   rgba(0, 200, 83, 0.25);
  --green-glow:  0 0 16px rgba(0, 200, 83, 0.18);
  --gold:        #E67F00;
  --red:         #C62828;
  --accent2:     #007A3A;

  /* Text */
  --text:   #111827;
  --text2:  #374151;
  --muted:  #6B7280;
  --muted2: #9CA3AF;

  /* Borders */
  --border:   #E5E7EB;
  --border-g: rgba(0, 200, 83, 0.35);

  /* Aliases */
  --accent:  #00C853;
  --accent3: #E67F00;
  --danger:  #C62828;

  /* Font stacks */
  --f-display: 'Bebas Neue', sans-serif;
  --f-body:    'Outfit', sans-serif;
  --f-mono:    'DM Mono', monospace;

  /* ── FLUID TYPOGRAPHY SCALE ──
     Minimum: 12px everywhere
     Mobile (360px) → Desktop (1280px)            */
  --fs-hero:    clamp(52px,  11vw,  100px);
  --fs-h1:      clamp(36px,  6vw,   62px);
  --fs-h2:      clamp(19px,  3vw,   24px);
  --fs-h3:      clamp(16px,  2.2vw, 20px);
  --fs-body:    clamp(14px,  1.5vw, 16px);
  --fs-label:   clamp(13px,  1.3vw, 14px);
  --fs-mono:    clamp(13px,  1.2vw, 14px);
  --fs-small:   clamp(12px,  1.1vw, 13px);
  --fs-badge:   12px;
  --fs-nav:     clamp(12px,  1.1vw, 13px);
  --fs-btn:     clamp(15px,  1.6vw, 17px);
  --fs-eyebrow: clamp(10px,  1vw,   12px);

  /* Radii */
  --r-sm:   8px;
  --r-md:   12px;
  --r-lg:   18px;
  --r-pill: 100px;
  --r-card: 12px;
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { height: 100%; scroll-behavior: smooth; }
body {
  background: var(--bg); color: var(--text);
  font-family: var(--f-body); font-size: var(--fs-body);
  min-height: 100vh; overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  line-height: 1.6;
}

/* Background */
body::before {
  content: ''; position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(ellipse 70% 50% at 10% 10%, rgba(0, 200, 83, 0.05) 0%, transparent 60%),
    radial-gradient(ellipse 55% 45% at 90% 85%, rgba(0, 160, 82, 0.03) 0%, transparent 55%),
    linear-gradient(160deg, #F0F7F2 0%, #F8F9FA 50%, #F2F7F4 100%);
}
body::after {
  content: ''; position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background-image:
    linear-gradient(rgba(0, 200, 83, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 200, 83, 0.03) 1px, transparent 1px);
  background-size: 72px 72px;
}

/* ── Page wrapper ── */
.page { position: relative; z-index: 2; max-width: 820px; margin: 0 auto; padding: 0 clamp(12px, 3vw, 20px) 64px; }

/* ══════════════════════════════════════
   NAV
══════════════════════════════════════ */


/* ══════════════════════════════════════
   PAGE HEADER
══════════════════════════════════════ */
.page-header { text-align: center; margin-bottom: clamp(24px, 4vw, 32px); }
.eyebrow {
  font-family: var(--f-mono); font-size: var(--fs-eyebrow);
  color: var(--green-text); letter-spacing: 4px; text-transform: uppercase; margin-bottom: 10px;
}
.eyebrow span { display: inline-block; width: 20px; height: 1px; background: var(--green); vertical-align: middle; margin: 0 8px; }
.page-title {
  font-family: var(--f-display); font-size: var(--fs-hero);
  line-height: 0.9; letter-spacing: 2px; color: var(--text); margin-bottom: 8px;
}
.page-title .g { color: var(--green); }
.page-sub {
  font-family: var(--f-mono); font-size: var(--fs-small);
  color: var(--muted); letter-spacing: 0.5px; line-height: 1.6;
}

/* ══════════════════════════════════════
   INPUT GRID
══════════════════════════════════════ */
.inputs-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(10px, 2vw, 14px);
  margin-bottom: clamp(10px, 2vw, 14px);
}
.input-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-card);
  padding: clamp(10px, 2vw, 14px);
  transition: border-color 0.2s;
}
.input-box:focus-within { border-color: var(--green); }
.input-box label {
  display: block;
  font-family: var(--f-mono); font-size: var(--fs-badge);
  color: var(--muted); text-transform: uppercase;
  letter-spacing: 1px; margin-bottom: 6px;
}
.input-box input,
.input-box select {
  width: 100%; background: none; border: none;
  color: var(--green-text);
  font-family: var(--f-body);
  font-size: var(--fs-h3);
  font-weight: 500; outline: none;
}
.input-box select { cursor: pointer; }
.input-box select option { background: #F0F4F1; color: var(--text); }
.input-box input::placeholder { color: var(--muted2); }
.full-width { grid-column: 1 / -1; }

/* ── Prepay Toggle ── */
.prepay-toggle {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-card);
  padding: clamp(10px, 2vw, 14px) 16px;
  margin-bottom: clamp(10px, 2vw, 14px);
  display: flex; align-items: center; justify-content: space-between;
  cursor: pointer; user-select: none;
  transition: border-color 0.2s;
}
.prepay-toggle:hover { border-color: var(--border-g); }
.prepay-toggle span { font-size: var(--fs-label); color: var(--text); }

.toggle-switch { width: 40px; height: 22px; background: var(--border); border-radius: 11px; position: relative; transition: background 0.3s; flex-shrink: 0; }
.toggle-switch.on { background: var(--accent); }
.toggle-knob { width: 16px; height: 16px; background: #fff; border-radius: 50%; position: absolute; top: 3px; left: 3px; transition: left 0.3s; box-shadow: 0 1px 3px rgba(0,0,0,0.2); }
.toggle-switch.on .toggle-knob { left: 21px; }

.prepay-inputs { display: none; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 12px; }
.prepay-inputs.visible { display: grid; }

.freq-options { grid-column: 1 / -1; display: flex; gap: 8px; flex-wrap: wrap; }
.freq-btn {
  padding: 7px 14px; border-radius: var(--r-pill);
  border: 1px solid var(--border); background: none;
  color: var(--muted); font-family: var(--f-body);
  font-size: var(--fs-small); cursor: pointer; transition: all 0.2s;
}
.freq-btn.active { background: var(--accent); color: #000; border-color: var(--accent); font-weight: 600; }
.freq-btn:hover:not(.active) { border-color: var(--border-g); color: var(--text); }

/* ── Calculate Button ── */
.update-btn {
  width: 100%; padding: clamp(12px, 2vw, 16px);
  background: var(--accent); color: #000; border: none;
  border-radius: var(--r-md);
  font-family: var(--f-body); font-weight: 700;
  font-size: var(--fs-btn);
  cursor: pointer; letter-spacing: 0.5px;
  margin-bottom: clamp(16px, 3vw, 24px);
  transition: opacity 0.2s, transform 0.15s;
}
.update-btn:hover { opacity: 0.88; transform: translateY(-1px); }

/* ══════════════════════════════════════
   SUMMARY CARD
══════════════════════════════════════ */
.summary-card {
  background: var(--surface); border: 1px solid var(--green);
  border-radius: var(--r-card); padding: clamp(14px, 2.5vw, 18px);
  margin-bottom: 12px;
}
.summary-title {
  font-family: var(--f-display); font-size: var(--fs-small);
  font-weight: 700; color: var(--muted); text-transform: uppercase;
  letter-spacing: 1.5px; margin-bottom: 14px;
}
.summary-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.s-stat-val {
  font-size: var(--fs-h3); /* clamp 16-20px */
  font-weight: 600; display: block;
}
.s-stat-label {
  font-family: var(--f-mono); font-size: var(--fs-badge);
  color: var(--muted); text-transform: uppercase;
  letter-spacing: 0.5px; margin-top: 2px;
  display: block;
}

/* ══════════════════════════════════════
   COMPARISON CARDS
══════════════════════════════════════ */
.comparison { display: flex; flex-direction: column; gap: 10px; margin-bottom: 20px; }
.comp-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-card); padding: clamp(12px, 2vw, 16px); }
.comp-card.highlight { border-color: var(--accent); }
.comp-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.comp-label { font-family: var(--f-display); font-size: var(--fs-label); font-weight: 700; }
.tag { font-family: var(--f-mono); font-size: var(--fs-badge); padding: 3px 8px; border-radius: var(--r-pill); letter-spacing: 0.5px; }
.tag-green { background: rgba(0, 200, 83, 0.12); color: var(--green-text); }
.tag-gray  { background: rgba(107, 114, 128, 0.12); color: var(--muted); }
.tag-blue  { background: rgba(59, 130, 246, 0.12); color: #1D4ED8; }
.comp-stats { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 6px; }
.cs { text-align: center; }
.cs-val { font-size: var(--fs-label); font-weight: 600; display: block; }
.cs-lbl { font-family: var(--f-mono); font-size: var(--fs-badge); color: var(--muted); text-transform: uppercase; letter-spacing: 0.5px; }
.saving-bar { height: 4px; border-radius: 2px; background: var(--border); overflow: hidden; margin-top: 10px; }
.saving-fill { height: 100%; border-radius: 2px; transition: width 0.6s ease; }
.saving-text { font-family: var(--f-mono); font-size: var(--fs-badge); color: var(--muted); margin-top: 4px; }

/* ══════════════════════════════════════
   PIE / DONUT CHARTS
══════════════════════════════════════ */
.chart-section { margin-bottom: 20px; }
.chart-section h2 { font-family: var(--f-display); font-size: var(--fs-h2); margin-bottom: 14px; }
.charts-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 20px; justify-items: center;
}
.pie-wrap { display: flex; flex-direction: column; align-items: center; width: 100%; }
.pie-title { font-family: var(--f-mono); font-size: var(--fs-badge); color: var(--muted); text-transform: uppercase; letter-spacing: 0.8px; margin-bottom: 8px; }
.pie-container { position: relative; width: 140px; height: 140px; background: var(--surface); border-radius: 50%; }
.pie-container canvas { width: 140px !important; height: 140px !important; position: relative; z-index: 1; }
.pie-center {
  position: absolute; top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  text-align: center; pointer-events: none; z-index: 2;
  background: var(--surface); border-radius: 50%;
  width: 72px; height: 72px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 4px; box-shadow: 0 0 0 3px var(--surface);
}
.pie-center-val { font-size: 12px; font-weight: 700; color: var(--text); display: block; line-height: 1.25; white-space: nowrap; }
.pie-center-lbl { font-family: var(--f-mono); font-size: var(--fs-badge); color: var(--muted); text-transform: uppercase; letter-spacing: 0.5px; margin-top: 2px; display: block; }
.legend { margin-top: 10px; display: flex; flex-direction: column; gap: 5px; width: 100%; }
.leg-item { display: flex; align-items: center; gap: 7px; font-family: var(--f-mono); font-size: var(--fs-badge); color: var(--muted); }
.leg-dot { width: 8px; height: 8px; border-radius: 2px; flex-shrink: 0; }

/* ── Divider ── */
.divider { border: none; border-top: 1px solid var(--border); margin: clamp(16px, 3vw, 24px) 0; }

/* ══════════════════════════════════════
   AMORTIZATION TABLE
══════════════════════════════════════ */
.table-section { margin-bottom: 24px; }
.table-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; flex-wrap: wrap; gap: 8px; }
.table-header h2 { font-family: var(--f-display); font-size: var(--fs-h2); }
.view-tabs { display: flex; gap: 6px; }
.tab-btn {
  padding: 6px 14px; border-radius: var(--r-pill);
  border: 1px solid var(--border); background: none;
  color: var(--muted); font-family: var(--f-body);
  font-size: var(--fs-small); cursor: pointer; transition: all 0.2s;
}
.tab-btn.active { background: var(--accent); color: #000; border-color: var(--accent); font-weight: 600; }
.table-wrap { overflow-x: auto; border-radius: var(--r-card); border: 1px solid var(--border); -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; font-size: var(--fs-small); min-width: 460px; }
thead tr { background: var(--surface2); }
th {
  padding: clamp(8px, 1.5vw, 12px) clamp(8px, 1.5vw, 13px);
  text-align: right; font-family: var(--f-mono);
  font-size: var(--fs-badge);
  color: var(--muted); text-transform: uppercase;
  letter-spacing: 0.8px; font-weight: 500;
  border-bottom: 1px solid var(--border); white-space: nowrap;
}
th:first-child { text-align: left; }
td {
  padding: clamp(8px, 1.5vw, 10px) clamp(8px, 1.5vw, 13px);
  text-align: right; border-bottom: 1px solid var(--border);
  font-family: var(--f-mono); font-size: var(--fs-small); white-space: nowrap;
}
td:first-child { text-align: left; color: var(--muted); }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: rgba(0, 200, 83, 0.025); }
.yr-row { background: var(--surface2); cursor: pointer; user-select: none; }
.yr-row td:first-child { color: var(--accent3); font-weight: 600; }
.yr-row:hover { background: #E8F5EC; }
.mo-rows { display: none; }
.mo-rows.open { display: table-row-group; }
.mo-rows td:first-child { padding-left: 24px; }
.prepay-row td { color: var(--green-text) !important; }
.bal-cell  { color: var(--text); }
.int-cell  { color: #C62828; }
.prin-cell { color: #15803D; }
tfoot td { padding: clamp(8px, 1.5vw, 11px) clamp(8px, 1.5vw, 13px); text-align: right; font-weight: 600; border-top: 2px solid var(--border); font-family: var(--f-mono); font-size: var(--fs-small); }
tfoot td:first-child { text-align: left; color: var(--muted); }

/* ── Buttons ── */
.pdf-btn {
  padding: 6px 12px; border-radius: var(--r-pill);
  border: 1px solid var(--border-g); background: none;
  color: var(--green-text); font-family: var(--f-body);
  font-size: var(--fs-small); cursor: pointer; transition: all 0.2s; white-space: nowrap;
}
.pdf-btn:hover { background: var(--green-dim); }
.collapse-btn {
  width: 30px; height: 30px; border-radius: 50%;
  border: 1px solid var(--border); background: var(--surface);
  color: var(--green-text); font-size: 18px; line-height: 1;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  font-family: var(--f-body); font-weight: 700; flex-shrink: 0; transition: all 0.2s;
}
.collapse-btn:hover { background: var(--green-dim); border-color: var(--green); }

/* ══════════════════════════════════════
   HISTOGRAM
══════════════════════════════════════ */
.histogram-section { margin-bottom: 24px; }
.histogram-section h2 { font-family: var(--f-display); font-size: var(--fs-h2); margin-bottom: 4px; }
.histogram-sub { font-family: var(--f-mono); font-size: var(--fs-small); color: var(--muted); margin-bottom: 14px; }
.hist-legend { display: flex; gap: 14px; margin-bottom: 10px; flex-wrap: wrap; }
.hist-leg { display: flex; align-items: center; gap: 5px; font-family: var(--f-mono); font-size: var(--fs-small); color: var(--muted); }
.hist-leg-dot { width: 10px; height: 10px; border-radius: 2px; }
.histogram-wrap { overflow-x: auto; padding-bottom: 8px; -webkit-overflow-scrolling: touch; }
.bar-chart { display: flex; align-items: flex-end; gap: 4px; height: 160px; padding: 0 4px; min-width: max-content; }
.bar-group { display: flex; flex-direction: column; align-items: center; flex: 1; cursor: pointer; min-width: 28px; }
.bar-group:hover .bar-int, .bar-group:hover .bar-prin { opacity: 0.75; }
.bar-stack { display: flex; flex-direction: column; align-items: center; width: 100%; justify-content: flex-end; }
.bar-int  { width: 100%; background: #EF9A9A; border-radius: 3px 3px 0 0; }
.bar-prin { width: 100%; background: #81C784; }
.bar-label { font-family: var(--f-mono); font-size: var(--fs-badge); color: var(--muted); margin-top: 4px; text-align: center; }
.bar-group.active .bar-int  { background: #E53935; }
.bar-group.active .bar-prin { background: #2E7D32; }

/* ── Flip card ── */
.flip-card { margin-top: 12px; background: var(--surface2); border: 1px solid var(--green); border-radius: var(--r-card); padding: clamp(12px, 2vw, 16px); display: none; }
.flip-card.show { display: block; }
.flip-title { font-family: var(--f-display); font-size: var(--fs-label); font-weight: 700; color: var(--accent3); margin-bottom: 10px; }
.flip-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 10px; }
.flip-stat { background: var(--surface); border-radius: var(--r-sm); padding: 10px; }
.flip-val { font-size: var(--fs-h3); font-weight: 600; display: block; }
.flip-lbl { font-family: var(--f-mono); font-size: var(--fs-badge); color: var(--muted); text-transform: uppercase; letter-spacing: 0.5px; }
.flip-mo-table { width: 100%; border-collapse: collapse; font-family: var(--f-mono); font-size: var(--fs-small); margin-top: 8px; }
.flip-mo-table th { padding: 6px 8px; text-align: right; font-size: var(--fs-badge); color: var(--muted); text-transform: uppercase; border-bottom: 1px solid var(--border); font-weight: 500; }
.flip-mo-table th:first-child { text-align: left; }
.flip-mo-table td { padding: 6px 8px; text-align: right; border-bottom: 1px solid var(--border); }
.flip-mo-table td:first-child { text-align: left; color: var(--muted); }
.flip-mo-table tbody tr:last-child td { border-bottom: none; }
.flip-close { font-family: var(--f-mono); font-size: var(--fs-small); color: var(--muted); cursor: pointer; text-align: right; margin-top: 8px; }
.flip-close:hover { color: var(--green-text); }

/* ══════════════════════════════════════
   MF vs PREPAYMENT
══════════════════════════════════════ */
.mf-section { margin-bottom: 24px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: clamp(16px, 3vw, 20px); }
.mf-section h2 { font-family: var(--f-display); font-size: var(--fs-h2); margin-bottom: 4px; }
.mf-sub { font-family: var(--f-mono); font-size: var(--fs-small); color: var(--muted); margin-bottom: 16px; line-height: 1.6; }
.mf-btn {
  width: 100%; padding: 14px; background: var(--surface);
  border: 1.5px solid var(--accent3); color: var(--accent3);
  border-radius: var(--r-md);
  font-family: var(--f-body); font-weight: 700;
  font-size: var(--fs-btn); cursor: pointer; transition: all 0.2s; margin-top: 12px;
}
.mf-btn:hover { background: rgba(230, 127, 0, 0.07); }
.mf-result { margin-top: 16px; display: none; }
.mf-result.show { display: block; }
.mf-verdict { border-radius: var(--r-card); padding: clamp(12px, 2vw, 16px); margin-bottom: 14px; text-align: center; }
.mf-verdict.prepay-wins { background: rgba(0, 200, 83, 0.07); border: 1px solid rgba(0, 200, 83, 0.3); }
.mf-verdict.mf-wins     { background: rgba(59, 130, 246, 0.07); border: 1px solid rgba(59, 130, 246, 0.3); }
.mf-verdict-title { font-family: var(--f-display); font-size: var(--fs-h3); margin-bottom: 4px; }
.mf-verdict-sub   { font-family: var(--f-mono); font-size: var(--fs-small); color: var(--muted); }
.mf-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; }
.mf-card { background: var(--surface2); border-radius: var(--r-card); padding: clamp(10px, 2vw, 14px); border: 1px solid var(--border); }
.mf-card.winner { border-color: var(--green); }
.mf-card-title { font-family: var(--f-mono); font-size: var(--fs-badge); font-weight: 700; margin-bottom: 10px; text-transform: uppercase; letter-spacing: 0.5px; }
.mf-stat { margin-bottom: 8px; }
.mf-stat-val { font-size: var(--fs-label); font-weight: 600; display: block; }
.mf-stat-lbl  { font-family: var(--f-mono); font-size: var(--fs-badge); color: var(--muted); }
.mf-note { font-family: var(--f-mono); font-size: var(--fs-small); color: var(--muted); line-height: 1.65; padding: 12px; background: var(--surface2); border-radius: var(--r-sm); border-left: 3px solid var(--accent3); }

/* ══════════════════════════════════════
   SHARE
══════════════════════════════════════ */
.share-section { margin-bottom: 24px; }
.share-section h2 { font-family: var(--f-display); font-size: var(--fs-h2); margin-bottom: 12px; }
.share-buttons { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.share-btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: clamp(11px, 2vw, 14px); border: none; border-radius: var(--r-md);
  font-family: var(--f-body); font-size: var(--fs-label);
  font-weight: 600; cursor: pointer; transition: opacity 0.2s, transform 0.15s;
}
.share-btn:hover { opacity: 0.87; transform: translateY(-1px); }
.share-btn.whatsapp { background: #25D366; color: #fff; }
.share-btn.twitter  { background: #000;    color: #fff; border: 1px solid #333; }
.share-btn.linkedin { background: #0A66C2; color: #fff; }
.share-btn.copylink { background: var(--surface); color: var(--text); border: 1px solid var(--border); }
.share-toast { display: none; margin-top: 10px; text-align: center; font-family: var(--f-mono); font-size: var(--fs-small); color: var(--green-text); background: rgba(0, 200, 83, 0.07); border: 1px solid rgba(0, 200, 83, 0.25); border-radius: var(--r-sm); padding: 9px; }
.share-toast.show { display: block; }

/* ══════════════════════════════════════
   FEEDBACK
══════════════════════════════════════ */
.feedback-section { margin-bottom: 24px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: clamp(16px, 3vw, 20px); }
.feedback-section h2 { font-family: var(--f-display); font-size: var(--fs-h2); margin-bottom: 4px; }
.feedback-sub { font-family: var(--f-mono); font-size: var(--fs-small); color: var(--muted); margin-bottom: 14px; line-height: 1.6; }
.rating-row { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.rating-label { font-family: var(--f-mono); font-size: var(--fs-small); color: var(--muted); }
.stars { display: flex; gap: 5px; }
.star { font-size: clamp(22px, 4vw, 26px); color: var(--border); cursor: pointer; transition: color 0.15s; line-height: 1; -webkit-tap-highlight-color: transparent; }
.star.active { color: var(--accent3); }
.quick-tags { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 12px; }
.qtag {
  font-family: var(--f-mono); font-size: var(--fs-small);
  padding: 6px 12px; border-radius: var(--r-pill);
  border: 1px solid var(--border); color: var(--muted);
  cursor: pointer; transition: all 0.2s; user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.qtag.selected { background: var(--green-dim); border-color: var(--green); color: var(--green-text); }
.feedback-input {
  width: 100%; background: var(--surface2); border: 1px solid var(--border);
  border-radius: var(--r-sm); padding: 12px 14px; color: var(--text);
  font-family: var(--f-body); font-size: 16px; /* 16px: prevent iOS zoom */
  min-height: 88px; resize: vertical; outline: none; margin-bottom: 8px;
  transition: border-color 0.2s; line-height: 1.6;
}
.feedback-name {
  width: 100%; background: var(--surface2); border: 1px solid var(--border);
  border-radius: var(--r-sm); padding: 11px 14px; color: var(--text);
  font-family: var(--f-body); font-size: 16px; /* 16px: prevent iOS zoom */
  outline: none; margin-bottom: 10px; transition: border-color 0.2s;
}
.feedback-input:focus, .feedback-name:focus { border-color: var(--green); box-shadow: 0 0 0 3px var(--green-dim); }
.feedback-input::placeholder, .feedback-name::placeholder { color: var(--muted2); }
.feedback-btn {
  width: 100%; padding: 14px; background: var(--surface);
  border: 1.5px solid var(--green); color: var(--green-text);
  border-radius: var(--r-md);
  font-family: var(--f-body); font-weight: 700; font-size: var(--fs-btn);
  cursor: pointer; transition: all 0.2s; margin-bottom: 10px;
}
.feedback-btn:hover { background: var(--green-dim); }
.feedback-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.ai-response { margin-top: 14px; background: var(--surface2); border: 1px solid rgba(0, 200, 83, 0.28); border-radius: var(--r-md); overflow: hidden; }
.ai-header { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-bottom: 1px solid var(--border); background: #F0F8F3; }
.ai-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); animation: pulse 1.5s infinite; }
.ai-title { font-family: var(--f-mono); font-size: var(--fs-small); font-weight: 600; color: var(--green-text); }
.ai-body { padding: 14px; font-family: var(--f-mono); font-size: var(--fs-small); line-height: 1.7; color: var(--text); min-height: 40px; }
.ai-footer { padding: 6px 14px; font-family: var(--f-mono); font-size: var(--fs-badge); color: var(--muted); border-top: 1px solid var(--border); text-align: right; }
.feedback-thanks { margin-top: 12px; text-align: center; font-family: var(--f-mono); font-size: var(--fs-small); color: var(--green-text); padding: 12px; background: rgba(0, 200, 83, 0.07); border-radius: var(--r-sm); }
.email-status { margin-top: 8px; font-family: var(--f-mono); font-size: var(--fs-small); text-align: center; color: var(--muted); }
.email-status.ok   { color: var(--green-text); }
.email-status.fail { color: var(--danger); }

/* ── Tips ── */
.tips-section h2 { font-family: var(--f-display); font-size: var(--fs-label); font-weight: 700; color: var(--green-text); margin-bottom: 12px; text-transform: uppercase; letter-spacing: 1px; }
.tip { display: flex; gap: 10px; margin-bottom: 10px; font-size: var(--fs-label); line-height: 1.6; color: var(--muted); }
.tip-dot { flex-shrink: 0; width: 6px; height: 6px; border-radius: 50%; background: var(--green-text); margin-top: 7px; }

/* ── Footer ── */
.page-footer, .pfoot { text-align: center; padding-top: 28px; border-top: 1px solid var(--border); margin-top: 28px; }
.page-footer a, .pfoot a { color: var(--green-text); text-decoration: none; }
.page-footer p, .pfoot p { font-family: var(--f-mono); font-size: var(--fs-small); color: var(--muted); line-height: 2; letter-spacing: 0.3px; }

/* ── Utility colours ── */
.green  { color: var(--green-text); }
.orange { color: var(--accent3); }
.red    { color: var(--danger); }
.blue   { color: #1D4ED8; }

/* ── Animations ── */
@keyframes pulse  { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }
@keyframes blink  { 0%, 100% { opacity: 1; } 50% { opacity: 0.1; } }

/* ══════════════════════════════════════
   RESPONSIVE
══════════════════════════════════════ */
@media (max-width: 600px) {
  .inputs-grid { grid-template-columns: 1fr; }
  .charts-row  { grid-template-columns: 1fr; }
  .pie-container { width: 160px; height: 160px; }
  .pie-container canvas { width: 160px !important; height: 160px !important; }
  .pie-center { width: 80px; height: 80px; }
  .pie-center-val { font-size: 13px; }
  .comp-stats { grid-template-columns: 1fr 1fr; }
  .mf-cards { grid-template-columns: 1fr; }
  .share-buttons { grid-template-columns: 1fr 1fr; }
  .nav-badge { display: none; }
  .nav-link { padding: 6px 10px; font-size: var(--fs-badge); }
}

@media (max-width: 400px) {
  .share-buttons { grid-template-columns: 1fr; }
  .summary-grid  { grid-template-columns: 1fr; }
}
