/**
 * ═══════════════════════════════════════════════════════════════
 * MORTGAGE CALCULATOR - STYLESHEET
 * ═══════════════════════════════════════════════════════════════
 * 
 * Main styling for the mortgage calculator application.
 * Features a modern, professional design with:
 * - Responsive grid layouts
 * - Smooth animations and transitions
 * - Accessible color palette (dark theme with gold accents)
 * - Mobile-optimized layout
 * 
 * Author: https://codecanyon.net/user/0x1312f59
 * Version: 1.0.0
 */

/* ═══════════════════════════════════════════════════════════════
   CSS VARIABLES & DESIGN TOKENS
   ═══════════════════════════════════════════════════════════════ */

:root {
  /* Text colors - from darkest to lightest */
  --ink: #1a1b1e;
  --ink-2: #2c2d32;
  --ink-3: #44464f;

  /* Primary accent - gold/warm tones */
  --gold: #b8892c;
  --gold-2: #d4a84b;
  --gold-pale: #faf4e8;

  /* Neutral background colors */
  --cream: #f7f5f0;
  --cream-2: #ece8df;
  --white: #fdfcfa;

  /* Semantic colors for status/information */
  --sage: #3a7055;
  --sage-pale: #e8f2ec;
  --rose: #a84040;
  --rose-pale: #f5e8e8;
  --sky: #2c5fa0;
  --sky-pale: #e5edf8;
  --amber: #b85c00;

  /* UI elements */
  --border: rgba(0, 0, 0, 0.08);
  --shadow-sm: 0 1px 6px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.09);
  --shadow-lg: 0 12px 48px rgba(0, 0, 0, 0.12);

  /* Border radius */
  --r: 12px;
  --r-sm: 8px;
}

/* ═══════════════════════════════════════════════════════════════
   GLOBAL RESET & BASE STYLES
   ═══════════════════════════════════════════════════════════════ */

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: "DM Sans", sans-serif;
  background: var(--cream);
  color: var(--ink);
  min-height: 100vh;
  overflow-x: hidden;
}

svg.lucide {
  display: inline-block;
  vertical-align: middle;
  flex-shrink: 0;
}

/* ═══════════════════════════════════════════════════════════════
   LAYOUT
   ═══════════════════════════════════════════════════════════════ */

.page-wrap {
  max-width: 1120px;
  margin: 0 auto;
  padding: 40px 20px 80px;
}

/* ═══════════════════════════════════════════════════════════════
   HEADER
   ═══════════════════════════════════════════════════════════════ */

header {
  margin-bottom: 28px;
  animation: fadeDown 0.5s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--ink);
  color: var(--gold-2);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 4px 12px;
  border-radius: 100px;
  margin-bottom: 12px;
}

h1 {
  font-family: "Fraunces", serif;
  font-size: clamp(28px, 4vw, 46px);
  font-weight: 400;
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}

h1 em {
  color: var(--gold);
  font-style: italic;
}

.header-desc {
  font-size: 13px;
  color: #888;
  line-height: 1.6;
}

/* ═══════════════════════════════════════════════════════════════
   NOTICE BAR
   ═══════════════════════════════════════════════════════════════ */

.notice-bar {
  display: none;
  align-items: flex-start;
  gap: 10px;
  background: var(--white);
  border: 1px solid var(--border);
  border-left: 3px solid var(--gold);
  border-radius: var(--r-sm);
  padding: 12px 16px;
  margin-bottom: 18px;
  font-size: 12.5px;
  color: #666;
  line-height: 1.55;
  animation: fadeUp 0.4s both;
}

.notice-bar.show {
  display: flex;
}

.notice-bar strong {
  color: var(--ink);
}

.notice-chips {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.chip {
  font-size: 10.5px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 100px;
}

.chip.green {
  background: var(--sage-pale);
  color: var(--sage);
}

.chip.amber {
  background: #fdf0e0;
  color: var(--amber);
}

.chip.red {
  background: var(--rose-pale);
  color: var(--rose);
}

.chip.gray {
  background: var(--cream-2);
  color: #777;
}

/* ═══════════════════════════════════════════════════════════════
   MAIN CARD & GRID
   ═══════════════════════════════════════════════════════════════ */

.calc-card {
  background: var(--white);
  border-radius: 20px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  animation: fadeUp 0.5s 0.05s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.calc-grid {
  display: grid;
  grid-template-columns: 440px 1fr;
}

/* ═══════════════════════════════════════════════════════════════
   INPUT PANEL
   ═══════════════════════════════════════════════════════════════ */

.input-panel {
  padding: 32px 28px;
  border-right: 1px solid var(--border);
  background: linear-gradient(170deg, var(--white) 55%, var(--cream) 100%);
}

.panel-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 22px;
}

.panel-title .icon-box {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.panel-title h2 {
  font-family: "Fraunces", serif;
  font-size: 17px;
  font-weight: 400;
}

/* ═══════════════════════════════════════════════════════════════
   FORM FIELD STYLES
   ═══════════════════════════════════════════════════════════════ */

.field {
  margin-bottom: 16px;
}

.field-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.field-label-left {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #999;
}

.field-tip {
  font-size: 10px;
  color: #bbb;
  background: var(--cream);
  padding: 2px 8px;
  border-radius: 100px;
  cursor: help;
  transition: all 0.15s;
}

.field-tip:hover {
  background: var(--gold-pale);
  color: var(--gold);
}

/* ═══════════════════════════════════════════════════════════════
   AMOUNT INPUT - Custom number input with step buttons
   ═══════════════════════════════════════════════════════════════ */

.amount-input {
  display: flex;
  align-items: center;
  border: 1.5px solid var(--cream-2);
  border-radius: var(--r-sm);
  background: var(--cream);
  overflow: hidden;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

.amount-input:focus-within {
  border-color: var(--gold);
  background: var(--white);
  box-shadow: 0 0 0 3px rgba(184, 137, 44, 0.12);
}

.step-btn {
  flex-shrink: 0;
  width: 42px;
  height: 46px;
  border: none;
  background: transparent;
  color: var(--gold);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  user-select: none;
}

.step-btn:hover {
  background: var(--gold-pale);
}

.step-btn:active {
  background: var(--cream-2);
}

.input-core {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-width: 0;
  padding: 0 4px;
}

.input-affix {
  font-size: 13px;
  font-weight: 600;
  color: var(--gold);
  flex-shrink: 0;
}

.amount-input input[type="number"] {
  width: 100%;
  border: none;
  background: transparent;
  font-family: "DM Mono", monospace;
  font-size: 14px;
  font-weight: 500;
  color: var(--ink);
  text-align: center;
  padding: 11px 2px;
  outline: none;
  -moz-appearance: textfield;
  -webkit-appearance: none;
  appearance: none;
}

.amount-input input::-webkit-inner-spin-button,
.amount-input input::-webkit-outer-spin-button {
  -webkit-appearance: none;
}

/* Smaller variant of amount-input */
.amount-input.sm .step-btn {
  width: 36px;
  height: 40px;
}

.amount-input.sm input[type="number"] {
  font-size: 13px;
  padding: 9px 2px;
}

/* ═══════════════════════════════════════════════════════════════
   SLIDER & RANGE INPUT
   ═══════════════════════════════════════════════════════════════ */

.slider-row {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: 7px;
}

.slider-tag {
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 700;
  color: var(--gold);
  background: var(--gold-pale);
  border: 1px solid rgba(184, 137, 44, 0.2);
  padding: 3px 9px;
  border-radius: 100px;
  min-width: 52px;
  text-align: center;
  font-family: "DM Mono", monospace;
}

input[type="range"] {
  flex: 1;
  -webkit-appearance: none;
  appearance: none;
  height: 4px;
  border-radius: 100px;
  outline: none;
  cursor: pointer;
  border: none;
  background: linear-gradient(
    to right,
    var(--gold) 0%,
    var(--gold) var(--val, 40%),
    var(--cream-2) var(--val, 40%),
    var(--cream-2) 100%
  );
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  background: var(--white);
  border: 2.5px solid var(--gold);
  box-shadow: 0 1px 6px rgba(184, 137, 44, 0.3);
  cursor: pointer;
  transition: transform 0.15s;
}

input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.18);
}

input[type="range"]::-moz-range-thumb {
  width: 17px;
  height: 17px;
  border-radius: 50%;
  background: var(--white);
  border: 2.5px solid var(--gold);
  cursor: pointer;
}

/* ═══════════════════════════════════════════════════════════════
   DOWN PAYMENT EQUITY BAR
   ═══════════════════════════════════════════════════════════════ */

.equity-wrap {
  margin-top: 7px;
}

.equity-track {
  height: 5px;
  background: var(--cream-2);
  border-radius: 100px;
  overflow: hidden;
}

.equity-fill {
  height: 100%;
  border-radius: 100px;
  background: linear-gradient(90deg, var(--rose) 0%, var(--amber) 40%, var(--sage) 70%);
  transition: width 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.equity-labels {
  display: flex;
  justify-content: space-between;
  font-size: 9.5px;
  color: #bbb;
  margin-top: 3px;
  font-weight: 500;
}

/* ═══════════════════════════════════════════════════════════════
   TERM PILLS - Loan term selector
   ═══════════════════════════════════════════════════════════════ */

.term-pills {
  display: flex;
  gap: 5px;
}

.pill {
  flex: 1;
  padding: 10px 4px;
  text-align: center;
  border: 1.5px solid var(--cream-2);
  border-radius: var(--r-sm);
  background: var(--cream);
  font-size: 11px;
  font-weight: 600;
  color: #bbb;
  cursor: pointer;
  transition: all 0.16s;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  touch-action: manipulation;
}

.pill:hover {
  border-color: var(--gold);
  color: var(--gold-2);
  background: var(--gold-pale);
}

.pill.active {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--gold-2);
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.16);
}

.pill .yr-big {
  display: block;
  font-size: 15px;
  font-weight: 700;
  font-family: "DM Mono", monospace;
}

.pill .yr-lbl {
  font-size: 9px;
  opacity: 0.65;
}

/* ═══════════════════════════════════════════════════════════════
   TERM COMPARISON TABLE
   ═══════════════════════════════════════════════════════════════ */

.term-compare {
  margin-top: 8px;
  padding: 10px 12px;
  background: var(--cream);
  border-radius: var(--r-sm);
  border: 1px solid var(--border);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.tc-item {
  font-size: 11px;
}

.tc-lbl {
  color: #aaa;
  font-size: 9px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 2px;
}

.tc-val {
  font-family: "DM Mono", monospace;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink);
}

.tc-val.good {
  color: var(--sage);
}

.tc-val.warn {
  color: var(--amber);
}

/* ═══════════════════════════════════════════════════════════════
   FIELD ROW - Two-column field layout
   ═══════════════════════════════════════════════════════════════ */

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

/* ═══════════════════════════════════════════════════════════════
   CALCULATE BUTTON
   ═══════════════════════════════════════════════════════════════ */

.calc-btn {
  width: 100%;
  margin-top: 20px;
  height: 48px;
  background: var(--ink);
  color: var(--gold-2);
  font-family: "DM Sans", sans-serif;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  border: none;
  border-radius: var(--r-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  position: relative;
  overflow: hidden;
  transition: transform 0.15s, box-shadow 0.15s;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.calc-btn::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--gold), var(--gold-2));
  opacity: 0;
  transition: opacity 0.25s;
}

.calc-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.2);
  color: var(--ink);
}

.calc-btn:hover::before {
  opacity: 1;
}

.calc-btn:active {
  transform: scale(0.98);
}

.calc-btn > * {
  position: relative;
  z-index: 1;
}

/* ═══════════════════════════════════════════════════════════════
   EXPORT BUTTON
   ═══════════════════════════════════════════════════════════════ */

.export-btn {
  width: 100%;
  margin-top: 8px;
  height: 40px;
  background: transparent;
  color: var(--gold);
  font-family: "DM Sans", sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  border: 1.5px solid rgba(184, 137, 44, 0.3);
  border-radius: var(--r-sm);
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.export-btn:hover {
  background: var(--gold-pale);
  border-color: var(--gold);
  transform: translateY(-1px);
}

.export-btn:active {
  transform: scale(0.98);
}

.export-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

/* ═══════════════════════════════════════════════════════════════
   RESULT PANEL
   ═══════════════════════════════════════════════════════════════ */

.result-panel {
  padding: 32px 26px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* ═══════════════════════════════════════════════════════════════
   HERO CARD - Main monthly payment display
   ═══════════════════════════════════════════════════════════════ */

.hero-card {
  background: var(--ink);
  border-radius: var(--r);
  padding: 22px 20px;
  position: relative;
  overflow: hidden;
}

.hero-card::after {
  content: "";
  position: absolute;
  top: -60px;
  right: -40px;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: radial-gradient(
    circle,
    rgba(184, 137, 44, 0.1) 0%,
    transparent 70%
  );
}

.hero-label {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.3);
  margin-bottom: 4px;
}

.hero-amount {
  font-family: "Fraunces", serif;
  font-size: clamp(30px, 3.5vw, 42px);
  color: var(--gold-2);
  line-height: 1;
  position: relative;
  z-index: 1;
  display: flex;
  align-items: flex-start;
  gap: 3px;
}

.hero-amount .currency {
  font-size: 0.5em;
  margin-top: 0.3em;
  opacity: 0.7;
}

.hero-sub {
  font-size: 10px;
  color: rgba(255, 255, 255, 0.3);
  margin-top: 5px;
}

/* ═══════════════════════════════════════════════════════════════
   DTI BADGE - Debt-to-income ratio indicator
   ═══════════════════════════════════════════════════════════════ */

.hero-dti {
  position: absolute;
  right: 16px;
  top: 18px;
  z-index: 2;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 8px 12px;
  text-align: center;
}

.dti-label {
  font-size: 8px;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: rgba(255, 255, 255, 0.3);
  margin-bottom: 2px;
}

.dti-val {
  font-family: "DM Mono", monospace;
  font-size: 15px;
  color: var(--gold-2);
}

.dti-sub {
  font-size: 7.5px;
  color: rgba(255, 255, 255, 0.25);
  margin-top: 1px;
}

/* ═══════════════════════════════════════════════════════════════
   PAYMENT BREAKDOWN BAR
   ═══════════════════════════════════════════════════════════════ */

.bbar-wrap {
  margin-top: 12px;
  position: relative;
  z-index: 1;
}

.bbar-track {
  display: flex;
  height: 6px;
  border-radius: 100px;
  overflow: hidden;
  gap: 1.5px;
  background: rgba(255, 255, 255, 0.06);
}

.bbar-seg {
  height: 100%;
  border-radius: 2px;
  transition: width 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.bbar-seg.pi {
  background: var(--gold-2);
}

.bbar-seg.tax {
  background: var(--sage);
}

.bbar-seg.ins {
  background: #5a9fd4;
}

.bbar-seg.pmi {
  background: var(--rose);
}

.bbar-legend {
  display: flex;
  gap: 9px;
  margin-top: 6px;
  flex-wrap: wrap;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 9px;
  color: rgba(255, 255, 255, 0.35);
}

.legend-dot {
  width: 6px;
  height: 6px;
  border-radius: 2px;
  flex-shrink: 0;
}

.legend-dot.pi {
  background: var(--gold-2);
}

.legend-dot.tax {
  background: var(--sage);
}

.legend-dot.ins {
  background: #5a9fd4;
}

.legend-dot.pmi {
  background: var(--rose);
}

/* ═══════════════════════════════════════════════════════════════
   PAYMENT BREAKDOWN CARDS
   ═══════════════════════════════════════════════════════════════ */

.bk-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.bk-card {
  background: var(--cream);
  border-radius: var(--r-sm);
  padding: 12px 13px 11px;
  border: 1px solid var(--border);
  position: relative;
  overflow: hidden;
  transition: box-shadow 0.2s;
}

.bk-card:hover {
  box-shadow: var(--shadow-sm);
}

.bk-stripe {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
}

.bk-card.pi .bk-stripe {
  background: var(--gold);
}

.bk-card.tax .bk-stripe {
  background: var(--sage);
}

.bk-card.ins .bk-stripe {
  background: var(--sky);
}

.bk-card.pmi .bk-stripe {
  background: var(--rose);
}

.bk-label {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: #aaa;
  font-weight: 600;
  margin-bottom: 5px;
  display: flex;
  align-items: center;
  gap: 3px;
}

.bk-val {
  font-family: "DM Mono", monospace;
  font-size: 19px;
  font-weight: 500;
  color: var(--ink);
  display: flex;
  align-items: baseline;
  gap: 1px;
}

.bk-val .bk-dollar {
  font-size: 0.62em;
  opacity: 0.5;
}

.bk-pct {
  font-size: 9.5px;
  font-weight: 600;
  margin-top: 3px;
  color: #bbb;
  font-family: "DM Mono", monospace;
}

/* ═══════════════════════════════════════════════════════════════
   STATISTICS STRIP
   ═══════════════════════════════════════════════════════════════ */

.stats-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.stat-card {
  background: var(--cream);
  border-radius: var(--r-sm);
  padding: 12px 9px;
  text-align: center;
  border: 1px solid var(--border);
  transition: box-shadow 0.2s;
}

.stat-card:hover {
  box-shadow: var(--shadow-sm);
}

.stat-icon {
  display: flex;
  justify-content: center;
  margin-bottom: 5px;
}

.stat-lbl {
  font-size: 8.5px;
  color: #aaa;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
  margin-bottom: 3px;
}

.stat-val {
  font-family: "DM Mono", monospace;
  font-size: 14px;
  font-weight: 500;
  color: var(--ink);
}

/* ═══════════════════════════════════════════════════════════════
   PMI NOTICE
   ═══════════════════════════════════════════════════════════════ */

.pmi-notice {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 10px 12px;
  border-radius: var(--r-sm);
  font-size: 11.5px;
  line-height: 1.5;
}

.pmi-notice.warn {
  background: #fdf7ec;
  border: 1px solid rgba(184, 137, 44, 0.25);
  color: #705010;
}

.pmi-notice.ok {
  background: var(--sage-pale);
  border: 1px solid rgba(58, 112, 85, 0.25);
  color: #2a5c3c;
}

/* ═══════════════════════════════════════════════════════════════
   SMART INSIGHTS PANEL
   ═══════════════════════════════════════════════════════════════ */

.insights-panel {
  border-top: 1px solid var(--border);
  padding: 22px 26px 26px;
  background: var(--cream);
  display: none;
}

.insights-panel.visible {
  display: block;
}

.insights-head {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 14px;
}

.insights-head h3 {
  font-family: "Fraunces", serif;
  font-size: 16px;
  font-weight: 400;
}

.insights-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 9px;
}

.insight-card {
  background: var(--white);
  border-radius: var(--r-sm);
  border: 1px solid var(--border);
  padding: 13px 13px 11px;
  transition: box-shadow 0.2s;
}

.insight-card:hover {
  box-shadow: var(--shadow-sm);
}

.insight-card-icon {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 8px;
}

.insight-card h4 {
  font-size: 11.5px;
  font-weight: 600;
  margin-bottom: 4px;
  color: var(--ink);
}

.insight-card p {
  font-size: 10.5px;
  color: #888;
  line-height: 1.6;
}

.insight-card p strong {
  color: var(--ink);
  font-weight: 600;
}

/* ═══════════════════════════════════════════════════════════════
   AMORTIZATION SECTION
   ═══════════════════════════════════════════════════════════════ */

.amort-section {
  border-top: 1px solid var(--border);
  display: none;
}

.amort-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 28px;
  cursor: pointer;
  user-select: none;
  transition: background 0.18s;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.amort-trigger:hover {
  background: rgba(184, 137, 44, 0.03);
}

.amort-trigger h3 {
  font-family: "Fraunces", serif;
  font-size: 16px;
  font-weight: 400;
  display: flex;
  align-items: center;
  gap: 7px;
}

.expand-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 600;
  color: var(--gold);
}

.expand-icon {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1.5px solid var(--gold);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.18s;
}

.expand-btn.open .expand-icon {
  background: var(--gold);
}

.expand-icon svg {
  transition: transform 0.28s;
}

.expand-btn.open .expand-icon svg {
  transform: rotate(180deg);
  color: var(--ink);
}

.amort-body {
  display: none;
  padding: 4px 28px 28px;
}

.amort-body.open {
  display: block;
}

.table-wrap {
  border-radius: var(--r-sm);
  overflow: auto;
  border: 1px solid var(--border);
  max-height: 340px;
  -webkit-overflow-scrolling: touch;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  min-width: 420px;
}

thead {
  background: var(--ink);
  color: var(--gold-2);
  position: sticky;
  top: 0;
  z-index: 5;
}

thead th {
  padding: 10px 13px;
  text-align: right;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  white-space: nowrap;
}

thead th:first-child {
  text-align: center;
}

tbody tr {
  border-bottom: 1px solid rgba(0, 0, 0, 0.04);
  transition: background 0.1s;
}

tbody tr:last-child {
  border-bottom: none;
}

tbody tr:nth-child(even) {
  background: var(--cream);
}

tbody tr:hover {
  background: var(--gold-pale);
}

tbody td {
  padding: 8px 13px;
  text-align: right;
  font-family: "DM Mono", monospace;
  font-size: 11.5px;
  color: var(--ink);
}

tbody td:first-child {
  text-align: center;
  font-weight: 600;
  color: var(--gold);
  font-size: 12px;
}

.amort-note {
  font-size: 10px;
  color: #bbb;
  text-align: center;
  margin-top: 8px;
  font-style: italic;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

/* ═══════════════════════════════════════════════════════════════
   TIPS SECTION
   ═══════════════════════════════════════════════════════════════ */

.tips-section {
  background: var(--ink);
  border-radius: 18px;
  padding: 32px 28px;
  margin-top: 22px;
  animation: fadeUp 0.5s 0.15s both cubic-bezier(0.22, 1, 0.36, 1);
}

.tips-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
}

.icon-circle {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(184, 137, 44, 0.12);
  border: 1px solid rgba(184, 137, 44, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.tips-header h2 {
  font-family: "Fraunces", serif;
  font-size: 20px;
  font-weight: 400;
  color: var(--gold-2);
}

.tips-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 10px;
}

.tip-card {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: var(--r-sm);
  padding: 14px 13px;
  transition: all 0.2s;
}

.tip-card:hover {
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(184, 137, 44, 0.2);
  transform: translateY(-2px);
}

.tip-icon {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 9px;
}

.tip-card h4 {
  font-size: 11.5px;
  font-weight: 600;
  color: #e8d4a8;
  margin-bottom: 5px;
}

.tip-card p {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.38);
  line-height: 1.6;
}

/* ═══════════════════════════════════════════════════════════════
   STICKY BAR - Mobile fixed footer
   ═══════════════════════════════════════════════════════════════ */

.sticky-bar {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 300;
  background: var(--ink);
  padding: 11px 18px calc(11px + env(safe-area-inset-bottom));
  box-shadow: 0 -3px 20px rgba(0, 0, 0, 0.25);
  border-top: 1px solid rgba(184, 137, 44, 0.15);
}

.sticky-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 500px;
  margin: 0 auto;
  gap: 14px;
}

.sticky-left .lbl {
  font-size: 8.5px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.3);
  margin-bottom: 1px;
}

.sticky-left .amt {
  font-family: "DM Mono", monospace;
  font-size: 22px;
  color: var(--gold-2);
  line-height: 1;
}

.sticky-chunks {
  display: flex;
  gap: 11px;
}

.sticky-chunk {
  font-size: 9px;
  color: rgba(255, 255, 255, 0.3);
  line-height: 1.4;
}

.sticky-chunk strong {
  display: block;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.65);
}

.sticky-cta {
  flex-shrink: 0;
  background: var(--gold);
  color: var(--ink);
  border: none;
  border-radius: 7px;
  font-family: "DM Sans", sans-serif;
  font-size: 11px;
  font-weight: 700;
  padding: 8px 13px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 5px;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.15s;
}

.sticky-cta:hover {
  background: var(--gold-2);
}

/* ═══════════════════════════════════════════════════════════════
   ANIMATIONS
   ═══════════════════════════════════════════════════════════════ */

@keyframes fadeDown {
  from {
    opacity: 0;
    transform: translateY(-14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.num {
  display: inline-block;
  transition: opacity 0.14s, transform 0.14s;
}

.num.out {
  opacity: 0;
  transform: translateY(4px);
}

/* ═══════════════════════════════════════════════════════════════
   TOOLTIP
   ═══════════════════════════════════════════════════════════════ */

[data-tooltip] {
  position: relative;
}

[data-tooltip]:hover::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 5px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--ink);
  color: #ddd;
  font-size: 10px;
  line-height: 1.5;
  padding: 5px 9px;
  border-radius: 6px;
  pointer-events: none;
  z-index: 100;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
  font-family: "DM Sans", sans-serif;
  font-weight: 400;
  max-width: 180px;
  white-space: normal;
  text-align: center;
}

/* ═══════════════════════════════════════════════════════════════
   RESPONSIVE DESIGN
   ═══════════════════════════════════════════════════════════════ */

/* Tablets and medium screens */
@media (max-width: 840px) {
  .calc-grid {
    grid-template-columns: 1fr;
  }

  .input-panel {
    border-right: none;
    border-bottom: 1px solid var(--border);
    padding: 24px 18px;
  }

  .result-panel {
    padding: 22px 18px;
  }

  .amort-trigger {
    padding: 16px 18px;
  }

  .amort-body {
    padding: 4px 18px 22px;
  }

  .insights-panel {
    padding: 18px;
  }

  .insights-grid {
    grid-template-columns: 1fr 1fr;
  }

  /* Show sticky bar on mobile */
  .sticky-bar {
    display: block;
  }

  body {
    padding-bottom: 72px;
  }

  .page-wrap {
    padding: 20px 13px 32px;
  }
}

/* Mobile phones - small screens */
@media (max-width: 460px) {
  .insights-grid {
    grid-template-columns: 1fr;
  }

  .field-row {
    grid-template-columns: 1fr;
  }

  .stats-strip {
    grid-template-columns: 1fr 1fr;
  }

  .sticky-chunks {
    display: none;
  }
}
