/* ═══════════════════════════════════════════════════════
   THE QUANT RESEARCHER — Shared Stylesheet
═══════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:ital,wght@0,700;0,800;1,700;1,800&family=DM+Mono:wght@400;500&family=DM+Sans:wght@300;400;500;600&display=swap');

:root {
  --bg:      #f0ede6;
  --surface: #ffffff;
  --surface2:#e8e4dc;
  --border:  #d5cfc4;
  --accent:  #1e6b45;
  --accent2: #2d8a5a;
  --text:    #1a2318;
  --muted:   #6b7a65;
  --danger:  #b83232;
  --success: #1e6b45;
  --nav:     #1e5c3a;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
  font-size: 15px;
  line-height: 1.6;
  min-height: 100vh;
}

/* ── NAV ── */
nav {
  position: sticky; top: 0; z-index: 100;
  background: #1e5c3a;
  border-bottom: 1px solid #174d30;
  padding: 0 2rem;
  display: flex; align-items: center; gap: 0;
  height: 56px;
}
.nav-logo {
  font-family: 'Fraunces', serif;
  font-size: 1.2rem; color: #fff; font-weight: 700;
  letter-spacing: -0.01em; flex-shrink: 0;
  text-decoration: none; margin-right: 1.5rem;
}
.nav-logo span { color: rgba(255,255,255,0.55); }
.nav-links { display: flex; gap: 0.15rem; list-style: none; flex: 1; }
.nav-links a {
  color: rgba(255,255,255,0.6);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.83rem; font-weight: 500;
  padding: 0.4rem 0.85rem; border-radius: 6px;
  cursor: pointer; transition: all 0.15s; white-space: nowrap;
  text-decoration: none; display: block;
}
.nav-links a:hover { color: #fff; background: rgba(255,255,255,0.1); }
.nav-links a.active { color: #fff; background: rgba(255,255,255,0.15); }

/* ── LAYOUT ── */
main { max-width: 780px; margin: 0 auto; padding: 2.5rem 1.5rem 5rem; }

@keyframes fadeUp { from { opacity:0; transform:translateY(8px); } to { opacity:1; transform:none; } }
.fade-in { animation: fadeUp 0.2s ease; }

/* ── PAGE HERO ── */
.page-hero {
  padding: 2.5rem 0 2rem; margin-bottom: 2.5rem;
  border-bottom: 1px solid var(--border);
}
.page-hero h1 {
  font-family: 'Fraunces', serif;
  font-size: clamp(1.9rem, 4.5vw, 2.8rem);
  font-weight: 800; line-height: 1.05; letter-spacing: -0.02em; margin-bottom: 0.75rem;
}
.page-hero h1 em { color: var(--accent); font-style: italic; }
.page-hero p { color: var(--muted); font-size: 0.97rem; max-width: 520px; line-height: 1.65; }

/* ── SECTION HEADING ── */
.section-heading {
  font-family: 'Fraunces', serif;
  font-size: 1.3rem; font-weight: 700;
  color: var(--text); margin-top: 2.5rem; margin-bottom: 0.3rem;
  padding-top: 2rem; border-top: 1px solid var(--border);
}
.section-sub { font-size: 0.84rem; color: var(--muted); line-height: 1.6; max-width: 560px; margin-bottom: 1.2rem; }

/* ── CARDS GRID ── */
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 1rem; }
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; padding: 1.5rem;
  cursor: pointer; transition: all 0.18s;
  position: relative; overflow: hidden;
  text-decoration: none; color: inherit; display: block;
}
.card::after {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: var(--accent); transform: scaleX(0); transform-origin: left; transition: transform 0.2s;
}
.card:hover { border-color: var(--accent); transform: translateY(-2px); background: var(--surface2); box-shadow: 0 4px 16px rgba(0,0,0,0.07); }
.card:hover::after { transform: scaleX(1); }
.card-icon { margin-bottom: 0.9rem; color: var(--accent); display: block; }
.card-icon svg { display: block; }
.card h3 { font-size: 0.97rem; font-weight: 600; margin-bottom: 0.35rem; }
.card p { font-size: 0.82rem; color: var(--muted); line-height: 1.55; }
.card-badge {
  display: inline-block; margin-top: 0.85rem;
  font-size: 0.7rem; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase;
  padding: 0.18rem 0.55rem; border-radius: 4px;
}
.card-badge.live { background: rgba(30,107,69,0.1); color: var(--accent); }
.card-badge.soon { background: rgba(107,122,101,0.1); color: var(--muted); }
.card.coming-soon { cursor: default; border-style: dashed; opacity: 0.6; pointer-events: none; }

/* ── TOOL HEADER ── */
.tool-header {
  display: flex; align-items: flex-start; gap: 1rem;
  margin-bottom: 2rem; padding-bottom: 1.4rem;
  border-bottom: 1px solid var(--border);
}
.back-btn {
  background: var(--surface); border: 1px solid var(--border);
  color: var(--muted); font-family: 'DM Sans', sans-serif;
  font-size: 0.82rem; padding: 0.38rem 0.9rem;
  border-radius: 6px; cursor: pointer; transition: all 0.15s;
  flex-shrink: 0; margin-top: 0.3rem; text-decoration: none;
}
.back-btn:hover { color: var(--text); border-color: var(--accent); }
.tool-header-text h2 {
  font-family: 'Fraunces', serif;
  font-size: 1.8rem; font-weight: 800; line-height: 1.05; letter-spacing: -0.01em;
}
.tool-header-text p { font-size: 0.85rem; color: var(--muted); margin-top: 0.25rem; }

/* ── FORM CARDS ── */
.form-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 14px; padding: 1.7rem 1.8rem; margin-bottom: 0.85rem;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}
.form-card-title {
  font-size: 0.73rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--muted); margin-bottom: 1.3rem;
  display: flex; align-items: center; gap: 0.5rem;
}
.form-card-title::before {
  content: ''; width: 6px; height: 6px;
  background: var(--accent); border-radius: 50%; flex-shrink: 0;
}
.field-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(185px, 1fr)); gap: 1.1rem; }
.field { display: flex; flex-direction: column; gap: 0.42rem; }
.field-label {
  display: flex; align-items: center; gap: 0.42rem;
  font-size: 0.84rem; font-weight: 500; color: var(--text);
}
.field input, .field select, .field textarea {
  background: #faf9f6; border: 1px solid var(--border);
  color: var(--text); font-family: 'DM Mono', monospace;
  font-size: 0.92rem; padding: 0.62rem 0.9rem;
  border-radius: 8px; transition: border-color 0.15s, box-shadow 0.15s; width: 100%;
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(30,107,69,0.12);
}
.field select option { background: #fff; }

/* ── TOOLTIP ── */
.info-wrap { position: relative; display: inline-flex; align-items: center; }
.info-icon {
  width: 16px; height: 16px;
  background: var(--surface2); border: 1px solid var(--border);
  color: var(--muted); border-radius: 50%;
  font-size: 0.65rem; font-weight: 700; font-style: normal;
  display: inline-flex; align-items: center; justify-content: center;
  cursor: default; flex-shrink: 0; transition: all 0.15s; user-select: none;
}
.info-icon:hover { background: var(--accent); color: #fff; border-color: var(--accent); }
.tooltip {
  position: absolute; bottom: calc(100% + 9px); left: 50%; transform: translateX(-50%);
  background: #1e5c3a; border: 1px solid #174d30;
  color: #fff; font-size: 0.79rem; font-weight: 400; line-height: 1.55;
  font-family: 'DM Sans', sans-serif;
  padding: 0.55rem 0.8rem; border-radius: 8px;
  width: 220px; pointer-events: none; opacity: 0;
  transition: opacity 0.15s; z-index: 50;
  box-shadow: 0 6px 24px rgba(0,0,0,0.15);
}
.tooltip::after {
  content: ''; position: absolute; top: 100%; left: 50%; transform: translateX(-50%);
  border: 5px solid transparent; border-top-color: #1e5c3a;
}
.info-wrap:hover .tooltip { opacity: 1; }

/* ── BUTTONS ── */
.calc-btn {
  background: var(--accent); color: #fff; border: none;
  font-family: 'DM Sans', sans-serif; font-size: 0.93rem; font-weight: 600;
  padding: 0.72rem 2rem; border-radius: 8px; cursor: pointer;
  transition: all 0.15s; margin-top: 1.3rem;
}
.calc-btn:hover { background: #174d30; transform: translateY(-1px); box-shadow: 0 4px 18px rgba(30,107,69,0.25); }
.calc-btn:active { transform: none; box-shadow: none; }

/* ── MODE TABS ── */
.mode-tabs {
  display: flex; gap: 0; margin-bottom: 0.6rem;
  border: 1px solid var(--border); border-radius: 8px;
  overflow: hidden; width: fit-content;
}
.mode-btn {
  background: var(--surface); border: none;
  color: var(--muted); font-family: 'DM Sans', sans-serif;
  font-size: 0.84rem; font-weight: 500;
  padding: 0.5rem 1.2rem; cursor: pointer;
  transition: all 0.15s; border-right: 1px solid var(--border);
}
.mode-btn:last-child { border-right: none; }
.mode-btn.active { background: var(--accent); color: #fff; }
.mode-btn:not(.active):hover { background: var(--surface2); color: var(--text); }

/* ── VS DIVIDER ── */
.vs-divider {
  display: flex; align-items: center; gap: 1rem;
  font-size: 0.72rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted);
  padding: 0.3rem 0; margin-bottom: 0.85rem;
}
.vs-divider::before, .vs-divider::after { content: ''; flex: 1; height: 1px; background: var(--border); }

/* ── RESULTS ── */
.result-card {
  background: #f0f7f3; border: 1px solid #b8d9c8;
  border-radius: 14px; padding: 1.7rem 1.8rem; margin-top: 0.85rem;
  display: none;
}
.result-card.show { display: block; animation: fadeUp 0.25s ease; }
.result-label {
  font-size: 0.73rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--accent); margin-bottom: 1rem;
}
.result-hero {
  font-family: 'DM Mono', monospace;
  font-size: 2.6rem; font-weight: 500; line-height: 1; margin-bottom: 0.5rem;
}
.col-neutral { color: var(--accent); }
.col-success { color: #155d36; }
.col-danger  { color: var(--danger); }
.result-sub { font-size: 0.88rem; color: var(--muted); line-height: 1.6; max-width: 560px; }
.result-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 1rem; margin-top: 1.3rem; padding-top: 1.3rem;
  border-top: 1px solid #b8d9c8;
}
.result-stat .val {
  font-family: 'DM Mono', monospace; font-size: 1.2rem; font-weight: 500;
  color: var(--accent);
}
.result-stat .lbl { font-size: 0.77rem; color: var(--muted); margin-top: 0.15rem; }

/* ── FORMULA BOX ── */
.formula-box {
  margin-top: 0.85rem; border: 1px solid var(--border);
  border-radius: 10px; background: var(--surface);
}
.formula-box summary.formula-title {
  list-style: none; cursor: pointer;
  font-size: 0.73rem; font-weight: 600; letter-spacing: 0.07em;
  text-transform: uppercase; color: var(--muted);
  padding: 0.85rem 1.2rem;
  display: flex; align-items: center; gap: 0.5rem;
  user-select: none; transition: color 0.15s;
}
.formula-box summary.formula-title::-webkit-details-marker { display: none; }
.formula-box summary.formula-title::before {
  content: '›'; font-size: 1rem; line-height: 1;
  transition: transform 0.2s; display: inline-block;
}
.formula-box[open] summary.formula-title::before { transform: rotate(90deg); }
.formula-box summary.formula-title:hover { color: var(--accent); }
.formula-box .formula-row, .formula-box .formula-note { padding: 0 1.2rem; }
.formula-box .formula-row:first-of-type { padding-top: 0.2rem; }
.formula-box .formula-note { padding-bottom: 1rem; }
.formula-row { display: flex; align-items: baseline; gap: 1rem; margin-bottom: 0.5rem; flex-wrap: wrap; }
.formula-label { font-size: 0.78rem; color: var(--muted); min-width: 180px; flex-shrink: 0; }
.formula { font-family: 'DM Mono', monospace; font-size: 0.82rem; color: var(--accent); letter-spacing: 0.02em; }
.formula-note {
  font-size: 0.76rem; color: var(--muted); line-height: 1.6;
  margin-top: 0.4rem; padding-top: 0.6rem; border-top: 1px solid var(--border);
}
.formula-note em { color: var(--accent); font-style: normal; }

/* ── EXPLAINER ── */
.explainer {
  background: #f0f7f3; border: 1px solid #b8d9c8;
  border-radius: 10px; padding: 1rem 1.2rem; margin-top: 0.85rem;
  font-size: 0.84rem; color: var(--muted); line-height: 1.65;
}
.explainer strong { color: var(--text); }

/* ── SLIDER ── */
input[type="range"] {
  -webkit-appearance: none; appearance: none;
  height: 4px; border-radius: 2px;
  background: var(--border); outline: none; cursor: pointer;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--accent); cursor: pointer;
  box-shadow: 0 0 0 3px rgba(30,107,69,0.15); transition: box-shadow 0.15s;
}
input[type="range"]::-webkit-slider-thumb:hover { box-shadow: 0 0 0 5px rgba(30,107,69,0.2); }

/* ── REFERENCE / BATCH TABLES ── */
.ref-table-wrap { margin-top: 1rem; border-radius: 12px; overflow: hidden; border: 1px solid var(--border); }
.ref-table, .bat-table { width: 100%; border-collapse: collapse; font-size: 0.86rem; }
.ref-table thead tr, .bat-table thead tr { background: #f0f7f3; }
.ref-table th, .bat-table th {
  text-align: left; padding: 0.75rem 1rem;
  font-size: 0.73rem; font-weight: 600; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--muted); border-bottom: 1px solid #b8d9c8;
}
.ref-table td, .bat-table td { padding: 0.7rem 1rem; border-top: 1px solid var(--border); font-family: 'DM Mono', monospace; }
.bat-table td { border-top: none; border-bottom: 1px solid var(--border); padding: 0.7rem 1.2rem; }
.bat-table tbody tr:last-child td { border-bottom: none; }
.ref-table tbody tr, .bat-table tbody tr { background: var(--surface); transition: background 0.12s; }
.ref-table tbody tr:hover td, .bat-table tbody tr:hover td { background: #f8fbf9; }
.bat-table td:first-child { font-family: 'DM Sans', sans-serif; font-weight: 500; color: var(--text); }
.bat-sig-up   { color: #1e6b45; font-weight: 600; }
.bat-sig-down { color: #9b1c1c; font-weight: 600; }
.bat-ns       { color: var(--muted); }

/* ── RATING BADGES ── */
.rating {
  display: inline-block; font-family: 'DM Sans', sans-serif;
  font-size: 0.72rem; font-weight: 700; letter-spacing: 0.04em;
  text-transform: uppercase; padding: 0.22rem 0.65rem; border-radius: 4px;
}
.rating.poor  { background: #fde8e8; color: #9b1c1c; border: 1px solid #f5c0c0; }
.rating.weak  { background: #fef3e2; color: #92400e; border: 1px solid #f6d9a0; }
.rating.ok    { background: #fef9e7; color: #7d6608; border: 1px solid #f0d96a; }
.rating.good  { background: #e8f5ee; color: #155d36; border: 1px solid #9dd4b4; }
.rating.great { background: #dff0e8; color: #1e6b45; border: 1px solid #7ec9a0; }

/* ── BATCH SPECIFIC ── */
.bat-col-headers { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 0; margin-bottom: 0.4rem; }
.bat-col-headers span {
  font-size: 0.72rem; font-weight: 600; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--muted); padding: 0 0.2rem;
}
.bat-manual-header { display: grid; grid-template-columns: 2fr 1fr 1fr 28px; gap: 0.5rem; margin-bottom: 0.4rem; }
.bat-manual-header span {
  font-size: 0.72rem; font-weight: 600; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--muted); padding: 0 0.2rem;
}
.bat-manual-row { display: grid; grid-template-columns: 2fr 1fr 1fr 28px; gap: 0.5rem; margin-bottom: 0.5rem; align-items: center; }
.bat-manual-row input[type="text"],
.bat-manual-row input[type="number"] {
  background: #faf9f6; border: 1px solid var(--border);
  color: var(--text); font-family: 'DM Sans', sans-serif;
  font-size: 0.88rem; padding: 0.5rem 0.7rem; border-radius: 7px; width: 100%; transition: border-color 0.15s;
}
.bat-manual-row input[type="number"] { font-family: 'DM Mono', monospace; }
.bat-manual-row input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(30,107,69,0.1); }
.bat-remove-btn {
  background: none; border: 1px solid var(--border);
  color: var(--muted); border-radius: 6px;
  width: 28px; height: 28px; font-size: 1rem; line-height: 1;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: all 0.15s; flex-shrink: 0;
}
.bat-remove-btn:hover { background: #fde8e8; border-color: #f5c0c0; color: #9b1c1c; }
.bat-add-btn {
  background: none; border: 1px dashed var(--border);
  color: var(--muted); font-family: 'DM Sans', sans-serif;
  font-size: 0.84rem; font-weight: 500;
  padding: 0.5rem 1rem; border-radius: 7px;
  cursor: pointer; width: 100%; margin-top: 0.3rem; margin-bottom: 0.5rem; transition: all 0.15s;
}
.bat-add-btn:hover { border-color: var(--accent); color: var(--accent); background: #f0f7f3; }

/* ── ESS SUB TABS ── */
.sub-tab-btn {
  background: var(--surface2); border: 1px solid var(--border);
  color: var(--muted); font-family: 'DM Sans', sans-serif;
  font-size: 0.82rem; font-weight: 500;
  padding: 0.4rem 1rem; border-radius: 6px; cursor: pointer; transition: all 0.15s;
}
.sub-tab-btn.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.sub-tab-btn:not(.active):hover { color: var(--text); background: var(--surface2); border-color: var(--accent); }

/* ── CONTENT PAGE (accordion sections) ── */
.content-intro {
  font-size: 0.96rem; color: var(--muted); line-height: 1.75;
  max-width: 620px; margin-bottom: 2rem;
}
.content-intro strong { color: var(--text); }
.accordion { margin-bottom: 0.6rem; }
.accordion-header {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; padding: 1.1rem 1.4rem;
  cursor: pointer; display: flex; align-items: center; justify-content: space-between;
  transition: all 0.15s; box-shadow: 0 1px 3px rgba(0,0,0,0.05);
  user-select: none;
}
.accordion-header:hover { border-color: var(--accent); background: #fafef9; }
.accordion.open .accordion-header { border-radius: 10px 10px 0 0; border-color: var(--accent); background: #fafef9; }
.accordion-title {
  display: flex; align-items: center; gap: 0.8rem;
}
.accordion-icon { flex-shrink: 0; color: var(--accent); display: flex; align-items: center; }
.accordion-title h3 { font-size: 0.97rem; font-weight: 600; color: var(--text); }
.accordion-title p { font-size: 0.8rem; color: var(--muted); margin-top: 0.1rem; }
.accordion-arrow {
  color: var(--muted); font-size: 1rem; transition: transform 0.2s; flex-shrink: 0;
}
.accordion.open .accordion-arrow { transform: rotate(90deg); color: var(--accent); }
.accordion-body {
  display: none; background: var(--surface);
  border: 1px solid var(--accent); border-top: none;
  border-radius: 0 0 10px 10px; padding: 1.5rem 1.6rem;
}
.accordion.open .accordion-body { display: block; animation: fadeUp 0.2s ease; }

/* Content typography inside accordions */
.accordion-body h4 {
  font-family: 'Fraunces', serif; font-weight: 700; font-size: 1.05rem;
  color: var(--text); margin: 1.4rem 0 0.5rem;
}
.accordion-body h4:first-child { margin-top: 0; }
.accordion-body p { font-size: 0.9rem; color: var(--muted); line-height: 1.75; margin-bottom: 0.8rem; }
.accordion-body p strong { color: var(--text); }
.accordion-body ul, .accordion-body ol {
  padding-left: 1.4rem; margin-bottom: 0.8rem;
}
.accordion-body li { font-size: 0.9rem; color: var(--muted); line-height: 1.7; margin-bottom: 0.25rem; }
.accordion-body li strong { color: var(--text); }

/* ── WORKED EXAMPLE BOX ── */
.worked-example {
  background: #f8fdf9; border: 1px solid #b8d9c8;
  border-left: 3px solid var(--accent);
  border-radius: 0 8px 8px 0; padding: 1.1rem 1.3rem; margin: 1rem 0;
}
.worked-example .ex-label {
  font-size: 0.68rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--accent); margin-bottom: 0.6rem;
}
.worked-example p { font-size: 0.88rem; color: var(--text); line-height: 1.7; margin-bottom: 0.5rem; }
.worked-example p:last-child { margin-bottom: 0; }
.worked-example table { width: 100%; border-collapse: collapse; margin: 0.7rem 0; font-size: 0.85rem; }
.worked-example th {
  background: #e8f5ee; padding: 0.45rem 0.75rem; text-align: left;
  font-size: 0.73rem; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase;
  color: var(--accent); border-bottom: 1px solid #b8d9c8;
}
.worked-example td { padding: 0.45rem 0.75rem; border-bottom: 1px solid #d8eee3; font-family: 'DM Mono', monospace; font-size: 0.84rem; }
.worked-example tr:last-child td { border-bottom: none; }

/* ── PRO/CON TAGS ── */
.tag-pro, .tag-con, .tag-neutral {
  display: inline-block; font-size: 0.7rem; font-weight: 700;
  letter-spacing: 0.05em; text-transform: uppercase;
  padding: 0.15rem 0.5rem; border-radius: 4px; margin-right: 0.3rem;
}
.tag-pro     { background: #e8f5ee; color: #155d36; border: 1px solid #9dd4b4; }
.tag-con     { background: #fde8e8; color: #9b1c1c; border: 1px solid #f5c0c0; }
.tag-neutral { background: var(--surface2); color: var(--muted); border: 1px solid var(--border); }

/* ── CODE BLOCK ── */
.code-block {
  background: #1a2318; border-radius: 8px; padding: 1.1rem 1.3rem; margin: 0.8rem 0;
  overflow-x: auto;
}
.code-block pre {
  font-family: 'DM Mono', monospace; font-size: 0.83rem;
  color: #c8e6c9; line-height: 1.7; white-space: pre;
}
.code-block .kw  { color: #81c784; } /* keywords: GET FILE, FREQ etc */
.code-block .cm  { color: #6b7a65; font-style: italic; } /* comments */
.code-block .st  { color: #fff176; } /* strings */
.code-block .nm  { color: #80deea; } /* numbers/values */
.code-block .vr  { color: #fff; }    /* variable names */
.code-copy-btn {
  float: right; background: rgba(255,255,255,0.1); border: 1px solid rgba(255,255,255,0.2);
  color: rgba(255,255,255,0.6); font-family: 'DM Sans', sans-serif; font-size: 0.75rem;
  padding: 0.25rem 0.7rem; border-radius: 5px; cursor: pointer;
  transition: all 0.15s; margin-bottom: 0.5rem;
}
.code-copy-btn:hover { background: rgba(255,255,255,0.18); color: #fff; }
.code-copy-btn.copied { color: #81c784; border-color: #81c784; }

/* ── FOOTER ── */
footer {
  border-top: 1px solid var(--border);
  padding: 1.5rem; text-align: center;
}
footer p { font-size: 0.75rem; color: #b0a898; max-width: 640px; margin: 0 auto; line-height: 1.6; }

/* ── RESPONSIVE ── */
@media (max-width: 680px) {
  nav { padding: 0 1rem; gap: 0.5rem; flex-wrap: wrap; height: auto; min-height: 56px; }
  .nav-links { gap: 0.1rem; }
  .nav-links a { font-size: 0.78rem; padding: 0.35rem 0.6rem; }
  main { padding: 1.5rem 1rem 4rem; }
  .form-card { padding: 1.2rem; }
  .result-hero { font-size: 1.9rem; }
  .field-row { grid-template-columns: 1fr; }
  .card-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 420px) {
  .card-grid { grid-template-columns: 1fr; }
}
