/* ═══════════════════════════════════════════════════════════════════
   dr.megolo.com — Tıbbi Hesaplama Merkezi
   Modern, clinical, soft. Plus Jakarta Sans · soft blues & teal.
   ═══════════════════════════════════════════════════════════════════ */

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

:root {
  /* Palette — Clinical soft blue */
  --bg: #f6f8fb;
  --bg-grad-1: #f0f5fb;
  --bg-grad-2: #f8fafc;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --surface-hover: #f1f5f9;

  --ink: #0f172a;
  --ink-2: #334155;
  --ink-3: #64748b;
  --ink-4: #94a3b8;
  --line: #e2e8f0;
  --line-2: #cbd5e1;

  --brand: #1e40af;
  --brand-2: #2563eb;
  --brand-soft: #eff6ff;
  --teal: #0d9488;
  --teal-soft: #f0fdfa;
  --rose: #e11d48;
  --rose-soft: #fff1f2;
  --amber: #d97706;
  --amber-soft: #fffbeb;
  --green: #059669;
  --green-soft: #ecfdf5;
  --gold: #b45309;
  --gold-soft: #fef3c7;

  /* Type */
  --font: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;

  /* Radii */
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-xl: 20px;
  --r-pill: 999px;

  /* Shadow */
  --sh-1: 0 1px 2px rgba(15, 23, 42, 0.04), 0 0 0 1px rgba(15, 23, 42, 0.04);
  --sh-2: 0 2px 8px rgba(15, 23, 42, 0.06), 0 0 0 1px rgba(15, 23, 42, 0.04);
  --sh-3: 0 8px 24px rgba(15, 23, 42, 0.08), 0 0 0 1px rgba(15, 23, 42, 0.04);
  --sh-focus: 0 0 0 3px rgba(37, 99, 235, 0.15);

  /* Motion */
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --t-fast: 180ms;
  --t-med: 320ms;
  --t-slow: 520ms;
}

html, body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.55;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  min-height: 100vh;
  background:
    radial-gradient(ellipse 1200px 600px at 50% -100px, #e0ecff 0%, transparent 60%),
    radial-gradient(ellipse 800px 400px at 100% 100%, #d1fae5 0%, transparent 50%),
    var(--bg);
  background-attachment: fixed;
}

button { font-family: inherit; cursor: pointer; border: none; background: none; }
input { font-family: inherit; }
a { color: inherit; text-decoration: none; }
[hidden] { display: none !important; }

/* ═══════════════════════════════════════
   TOP NAV
   ═══════════════════════════════════════ */
.topnav {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 32px;
  background: rgba(246, 248, 251, 0.85);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color var(--t-med) var(--ease);
}
.topnav.is-stuck { border-bottom-color: var(--line); }

.topnav__left,
.topnav__right {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.topnav__left {
  min-width: 42px;
  justify-content: flex-start;
}
.topnav__right {
  margin-left: auto;
}

.topnav__back {
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--r-pill);
  color: var(--ink-2);
  background: var(--surface);
  box-shadow: var(--sh-1);
  opacity: 0;
  pointer-events: none;
  transform: translateX(-4px);
  transition: all var(--t-fast) var(--ease);
}
.topnav.is-compact .topnav__back {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(0);
}
.topnav__back:hover {
  color: var(--brand);
  background: var(--brand-soft);
  transform: translateX(-2px);
  box-shadow: var(--sh-2);
}
.topnav__back svg { width: 18px; height: 18px; }
.topnav:not(.is-compact) .topnav__back {
  width: 0;
  overflow: hidden;
  box-shadow: none;
}

.topnav__brand {
  position: absolute;
  left: 50%;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-weight: 700;
  letter-spacing: -0.01em;
  opacity: 0;
  transform: translate(-50%, -4px);
  pointer-events: none;
  transition: opacity var(--t-med) var(--ease), transform var(--t-med) var(--ease);
}
.topnav.is-compact .topnav__brand {
  opacity: 1;
  transform: translate(-50%, 0);
  pointer-events: auto;
}
.topnav__logo {
  width: 30px;
  height: 30px;
  object-fit: contain;
  filter: drop-shadow(0 3px 8px rgba(37, 99, 235, 0.16));
}
.topnav__name {
  font-size: 15px;
  white-space: nowrap;
}

/* Language toggle */
.topnav__lang {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px 8px 10px;
  height: 38px;
  border-radius: var(--r-pill);
  background: var(--surface);
  color: var(--ink-2);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  box-shadow: var(--sh-1);
  transition: all var(--t-fast) var(--ease);
}
.topnav__lang:hover {
  color: var(--brand);
  background: var(--brand-soft);
  transform: translateY(-1px);
  box-shadow: var(--sh-2);
}
.topnav__lang-flag { font-size: 14px; line-height: 1; }
.topnav__lang-arrow { width: 12px; height: 12px; opacity: 0.5; }

/* Action buttons (Categories, Popular) */
.topnav__action {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0 14px 0 12px;
  height: 38px;
  border-radius: var(--r-pill);
  background: var(--surface);
  color: var(--ink-2);
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: -0.005em;
  box-shadow: var(--sh-1);
  transition: all var(--t-fast) var(--ease);
}
.topnav__action svg { width: 16px; height: 16px; }
.topnav__action:hover {
  color: var(--brand);
  background: var(--brand-soft);
  transform: translateY(-1px);
  box-shadow: var(--sh-2);
}
.topnav__action.is-active {
  color: var(--brand);
  background: var(--brand-soft);
  box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.25);
}
/* Favorites button */
.topnav__fav {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: var(--r-pill);
  color: var(--ink-2);
  background: var(--surface);
  box-shadow: var(--sh-1);
  transition: all var(--t-fast) var(--ease);
}
.topnav__fav svg { width: 18px; height: 18px; }
.topnav__fav:hover {
  color: var(--rose);
  background: var(--rose-soft);
  transform: translateY(-1px);
  box-shadow: var(--sh-2);
}
.topnav__fav.is-active {
  color: var(--rose);
  background: var(--rose-soft);
  box-shadow: 0 0 0 1px rgba(225, 29, 72, 0.25);
}
.topnav__fav.is-active svg { fill: var(--rose); }
.topnav__fav-count {
  position: absolute;
  top: -3px;
  right: -3px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: var(--r-pill);
  background: var(--rose);
  color: white;
  font-size: 10.5px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--bg);
  opacity: 0;
  transform: scale(0.5);
  transition: all var(--t-fast) var(--ease);
}
.topnav__fav-count.is-visible {
  opacity: 1;
  transform: scale(1);
}

.topnav__specialty {
  position: relative;
}

.specialty-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: min(360px, calc(100vw - 28px));
  max-height: min(520px, calc(100vh - 86px));
  overflow: auto;
  padding: 8px;
  border-radius: var(--r-lg);
  background: var(--surface);
  box-shadow: var(--sh-3);
  border: 1px solid var(--line);
  z-index: 80;
  animation: menuIn 180ms var(--ease-out);
}
@keyframes menuIn {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

.specialty-menu__item {
  width: 100%;
  min-height: 42px;
  display: grid;
  grid-template-columns: 28px 1fr auto;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: var(--r-sm);
  color: var(--ink-2);
  text-align: left;
  transition: all var(--t-fast) var(--ease);
}
.specialty-menu__item:hover,
.specialty-menu__item.is-active {
  color: var(--brand);
  background: var(--brand-soft);
}
.specialty-menu__icon {
  font-size: 18px;
  line-height: 1;
}
.specialty-menu__text {
  min-width: 0;
  font-size: 13.5px;
  font-weight: 650;
}
.specialty-menu__count {
  min-width: 24px;
  padding: 3px 7px;
  border-radius: var(--r-pill);
  background: var(--surface-2);
  color: var(--ink-3);
  font-size: 11px;
  font-weight: 700;
  text-align: center;
}
.specialty-menu__item.is-active .specialty-menu__count {
  color: var(--brand);
  background: var(--surface);
}
.specialty-menu__item--clear {
  color: var(--ink-3);
  border-bottom: 1px solid var(--line);
  border-radius: var(--r-sm) var(--r-sm) 0 0;
  margin-bottom: 6px;
}
.specialty-menu__item--clear .specialty-menu__count {
  visibility: hidden;
}

/* ═══════════════════════════════════════
   STAGE
   ═══════════════════════════════════════ */
.stage {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px 80px;
  min-height: calc(100vh - 80px);
}

/* ═══════════════════════════════════════
   HERO
   ═══════════════════════════════════════ */
.hero {
  text-align: center;
  padding: 64px 0 40px;
  transition: padding var(--t-med) var(--ease);
}
.hero.is-compact { padding: 24px 0 16px; }

.hero__brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 44px;
  transition: opacity var(--t-med) var(--ease), max-height var(--t-med) var(--ease), margin var(--t-med) var(--ease);
  overflow: hidden;
}
.hero.is-compact .hero__brand {
  opacity: 0;
  max-height: 0;
  margin-bottom: 0;
  pointer-events: none;
}

.hero__symbol {
  width: 118px;
  height: 118px;
  margin-bottom: 18px;
  animation: float 6s ease-in-out infinite;
}
.hero__symbol img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 14px 32px rgba(37, 99, 235, 0.18));
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

.hero__title {
  font-size: clamp(38px, 6vw, 56px);
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1;
  color: var(--ink);
  margin-bottom: 12px;
}
.hero__title-accent {
  background: linear-gradient(135deg, var(--brand) 0%, var(--teal) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  font-weight: 800;
}

.hero__tagline {
  font-size: 16px;
  color: var(--ink-3);
  font-weight: 500;
  letter-spacing: -0.005em;
}

/* ═══════════════════════════════════════
   SEARCH
   ═══════════════════════════════════════ */
.search {
  position: relative;
  max-width: 640px;
  margin: 0 auto 44px;
  display: flex;
  align-items: center;
  background: var(--surface);
  border-radius: var(--r-pill);
  box-shadow: var(--sh-2);
  padding: 6px 6px 6px 22px;
  transition: all var(--t-med) var(--ease);
}
.search:focus-within {
  box-shadow: var(--sh-3), var(--sh-focus);
}
.hero.is-compact .search {
  margin-bottom: 32px;
  max-width: 720px;
}

.search__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-3);
  flex-shrink: 0;
}
.search__icon svg { width: 20px; height: 20px; }

.search__input {
  flex: 1;
  border: none;
  background: transparent;
  padding: 18px 16px;
  font-size: 16px;
  color: var(--ink);
  outline: none;
  font-weight: 500;
  min-width: 0;
}
.search__input::placeholder { color: var(--ink-4); font-weight: 400; }

.search__clear {
  width: 36px;
  height: 36px;
  border-radius: var(--r-pill);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-3);
  background: var(--surface-2);
  transition: all var(--t-fast) var(--ease);
  flex-shrink: 0;
}
.search__clear:hover { color: var(--ink); background: var(--surface-hover); }
.search__clear svg { width: 14px; height: 14px; }

/* ═══════════════════════════════════════
   CATEGORIES
   ═══════════════════════════════════════ */
.categories {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  max-width: 1080px;
  margin: 0 auto 24px;
  transition: opacity var(--t-med) var(--ease), max-height var(--t-med) var(--ease), margin var(--t-med) var(--ease);
}
.hero.is-compact .categories {
  opacity: 0;
  max-height: 0;
  margin-bottom: 0;
  pointer-events: none;
  overflow: hidden;
}

.cat {
  position: relative;
  background: var(--surface);
  border-radius: var(--r-lg);
  padding: 22px 16px 18px;
  text-align: center;
  box-shadow: var(--sh-1);
  transition: all var(--t-fast) var(--ease);
  border: 1px solid transparent;
  animation: catIn 520ms var(--ease-out) backwards;
}
.cat:nth-child(1) { animation-delay: 30ms; }
.cat:nth-child(2) { animation-delay: 60ms; }
.cat:nth-child(3) { animation-delay: 90ms; }
.cat:nth-child(4) { animation-delay: 120ms; }
.cat:nth-child(5) { animation-delay: 150ms; }
.cat:nth-child(6) { animation-delay: 180ms; }
.cat:nth-child(7) { animation-delay: 210ms; }
.cat:nth-child(8) { animation-delay: 240ms; }
.cat:nth-child(9) { animation-delay: 270ms; }
.cat:nth-child(10) { animation-delay: 300ms; }
.cat:nth-child(11) { animation-delay: 330ms; }
.cat:nth-child(12) { animation-delay: 360ms; }
.cat:nth-child(13) { animation-delay: 390ms; }
.cat:nth-child(14) { animation-delay: 420ms; }

@keyframes catIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

.cat:hover {
  transform: translateY(-4px);
  box-shadow: var(--sh-3);
  border-color: var(--brand);
}
.cat:active { transform: translateY(-1px); }

.cat__icon {
  font-size: 32px;
  line-height: 1;
  margin-bottom: 12px;
  display: block;
  filter: saturate(1.1);
}
.cat__name {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.01em;
  margin-bottom: 2px;
}
.cat__count {
  font-size: 11px;
  color: var(--ink-4);
  font-weight: 500;
}

/* ═══════════════════════════════════════
   RESULTS SECTION (category, search, popular, favorites)
   ═══════════════════════════════════════ */
.results-section {
  padding: 16px 0 0;
  animation: secIn 420ms var(--ease-out);
}
@keyframes secIn {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

.results-header {
  text-align: center;
  margin-bottom: 36px;
}
.results-header__eyebrow {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--brand);
  background: var(--brand-soft);
  padding: 6px 12px;
  border-radius: var(--r-pill);
  margin-bottom: 16px;
}
.results-header__title {
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--ink);
  margin-bottom: 8px;
}
.results-header__sub {
  font-size: 15px;
  color: var(--ink-3);
}

.results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}

/* TEST CARD */
.test {
  position: relative;
  background: var(--surface);
  border-radius: var(--r-lg);
  padding: 20px 22px 18px;
  box-shadow: var(--sh-1);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all var(--t-fast) var(--ease);
  text-align: left;
  animation: testIn 420ms var(--ease-out) backwards;
}
.test:nth-child(1) { animation-delay: 20ms; }
.test:nth-child(2) { animation-delay: 40ms; }
.test:nth-child(3) { animation-delay: 60ms; }
.test:nth-child(4) { animation-delay: 80ms; }
.test:nth-child(5) { animation-delay: 100ms; }
.test:nth-child(6) { animation-delay: 120ms; }
.test:nth-child(7) { animation-delay: 140ms; }
.test:nth-child(8) { animation-delay: 160ms; }

@keyframes testIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.test:hover {
  transform: translateY(-3px);
  box-shadow: var(--sh-3);
  border-color: var(--brand);
}

.test__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
}

.test__category {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--brand);
}

.test__fav {
  width: 30px;
  height: 30px;
  border-radius: var(--r-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-4);
  background: transparent;
  transition: all var(--t-fast) var(--ease);
  flex-shrink: 0;
}
.test__fav svg { width: 16px; height: 16px; }
.test__fav:hover {
  color: var(--rose);
  background: var(--rose-soft);
}
.test__fav.is-active {
  color: var(--rose);
  background: var(--rose-soft);
}
.test__fav.is-active svg { fill: var(--rose); }

.test__name {
  font-size: 16px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.015em;
  margin: 8px 0 6px;
  line-height: 1.3;
}
.test__desc {
  font-size: 13.5px;
  color: var(--ink-3);
  line-height: 1.5;
}

.results-empty {
  text-align: center;
  padding: 80px 24px;
  color: var(--ink-3);
}
.results-empty svg { width: 56px; height: 56px; margin: 0 auto 16px; color: var(--ink-4); }
.results-empty p { font-size: 18px; font-weight: 600; color: var(--ink); margin-bottom: 4px; }
.results-empty span { font-size: 14px; }

/* REPORT */
.report-section {
  max-width: 720px;
  margin: 0 auto;
  padding: 16px 0 0;
  animation: secIn 420ms var(--ease-out);
}
.report-form {
  display: grid;
  gap: 18px;
  padding: 28px;
  border-radius: var(--r-xl);
  background: var(--surface);
  box-shadow: var(--sh-2);
}
.report-form__textarea {
  min-height: 160px;
  resize: vertical;
  font-family: var(--font);
  line-height: 1.55;
}
.report-form__actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

/* ═══════════════════════════════════════
   CALCULATOR DETAIL
   ═══════════════════════════════════════ */
.calc {
  max-width: 760px;
  margin: 0 auto;
  animation: secIn 420ms var(--ease-out);
}

.calc__back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-2);
  padding: 10px 14px 10px 10px;
  border-radius: var(--r-md);
  margin-bottom: 24px;
  transition: all var(--t-fast) var(--ease);
}
.calc__back svg { width: 18px; height: 18px; }
.calc__back:hover { background: var(--surface); color: var(--brand); transform: translateX(-2px); }

.calc__head {
  position: relative;
  background: var(--surface);
  border-radius: var(--r-xl);
  padding: 32px 32px 28px;
  box-shadow: var(--sh-2);
  margin-bottom: 24px;
}
.calc__category {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--brand);
  background: var(--brand-soft);
  padding: 6px 12px;
  border-radius: var(--r-pill);
  margin-bottom: 16px;
}
.calc__title {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ink);
  margin-bottom: 8px;
  padding-right: 56px;
}
.calc__desc {
  font-size: 15px;
  color: var(--ink-3);
  padding-right: 56px;
}
.calc__fav {
  position: absolute;
  top: 28px;
  right: 28px;
  width: 42px;
  height: 42px;
  border-radius: var(--r-pill);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-3);
  background: var(--surface-2);
  transition: all var(--t-fast) var(--ease);
}
.calc__fav svg { width: 20px; height: 20px; }
.calc__fav:hover { color: var(--rose); background: var(--rose-soft); transform: scale(1.05); }
.calc__fav.is-active { color: var(--rose); background: var(--rose-soft); }
.calc__fav.is-active svg { fill: var(--rose); }

.calc__body {
  background: var(--surface);
  border-radius: var(--r-xl);
  padding: 32px;
  box-shadow: var(--sh-2);
}

.calc__form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  margin-bottom: 28px;
}
.calc__form:has(.field--choice) {
  grid-template-columns: 1fr;
}

.field { display: flex; flex-direction: column; gap: 8px; }
.field--choice { gap: 10px; }
.field__label {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink-2);
  letter-spacing: -0.005em;
}
.field__hint { font-size: 12px; color: var(--ink-4); margin-top: -2px; }
.field__input,
.field__select {
  appearance: none;
  -webkit-appearance: none;
  width: 100%;
  padding: 12px 14px;
  font-size: 15px;
  font-weight: 500;
  color: var(--ink);
  background: var(--surface-2);
  border: 1.5px solid var(--line);
  border-radius: var(--r-md);
  transition: all var(--t-fast) var(--ease);
  font-family: var(--font-mono);
}
.field__select { font-family: var(--font); padding-right: 36px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2.5'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; background-size: 12px; }
.field__input::placeholder { color: var(--ink-4); }
.field__input:focus,
.field__select:focus {
  outline: none;
  border-color: var(--brand);
  background: var(--surface);
  box-shadow: var(--sh-focus);
}
.field__input--err {
  border-color: var(--rose);
  background: var(--rose-soft);
}

.choice-box {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
  gap: 8px;
  padding: 6px;
  border: 1.5px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--surface-2);
  transition: border-color var(--t-fast) var(--ease), background var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease);
}
.choice-box:focus-within {
  border-color: var(--brand);
  background: var(--surface);
  box-shadow: var(--sh-focus);
}
.choice-box.field__input--err {
  border-color: var(--rose);
  background: var(--rose-soft);
}
.choice-box__option {
  min-height: 48px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: var(--r-md);
  color: var(--ink-2);
  background: transparent;
  text-align: left;
  transition: all var(--t-fast) var(--ease);
}
.choice-box__option:hover {
  color: var(--brand);
  background: var(--surface);
  box-shadow: var(--sh-1);
}
.choice-box__option.is-selected {
  color: var(--brand);
  background: var(--surface);
  box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.28), var(--sh-1);
}
.choice-box__score {
  width: 28px;
  min-width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--r-sm);
  background: var(--surface);
  color: var(--ink-3);
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  box-shadow: inset 0 0 0 1px var(--line);
}
.choice-box__option.is-selected .choice-box__score {
  color: white;
  background: var(--brand);
  box-shadow: none;
}
.choice-box__label {
  min-width: 0;
  font-size: 13.5px;
  font-weight: 650;
  line-height: 1.3;
}

.calc__actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 24px;
  font-size: 14.5px;
  font-weight: 600;
  border-radius: var(--r-md);
  letter-spacing: -0.005em;
  transition: all var(--t-fast) var(--ease);
}
.btn--primary {
  background: var(--brand);
  color: white;
  box-shadow: 0 1px 3px rgba(30, 64, 175, 0.25), inset 0 1px 0 rgba(255,255,255,0.1);
}
.btn--primary:hover { background: var(--brand-2); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(30, 64, 175, 0.3); }
.btn--primary:active { transform: translateY(0); }
.btn--ghost { background: var(--surface-2); color: var(--ink-2); }
.btn--ghost:hover { background: var(--surface-hover); color: var(--ink); }

/* RESULT */
.calc__result {
  margin-top: 28px;
  padding: 24px;
  background: linear-gradient(135deg, var(--brand-soft) 0%, var(--teal-soft) 100%);
  border-radius: var(--r-lg);
  border: 1px solid #dbeafe;
  animation: resultIn 420ms var(--ease-out);
}
.calc__result.is-error {
  background: var(--rose-soft);
  border-color: #fecdd3;
}
.calc__result.is-error .calc__result-head {
  color: var(--rose);
}
@keyframes resultIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
.calc__result-head {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--brand);
  margin-bottom: 16px;
}
.calc__result-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
}
.calc__result-item {
  background: var(--surface);
  padding: 16px 18px;
  border-radius: var(--r-md);
  box-shadow: var(--sh-1);
}
.calc__result-key {
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 4px;
}
.calc__result-value {
  font-size: 22px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.02em;
  font-family: var(--font-mono);
}
.calc__result-value--text {
  font-size: 16px;
  font-family: var(--font);
  letter-spacing: -0.01em;
}
.calc__result-note {
  margin-top: 16px;
  padding: 14px 16px;
  background: var(--surface);
  border-radius: var(--r-md);
  font-size: 13.5px;
  color: var(--ink-2);
  line-height: 1.55;
  border-left: 3px solid var(--brand);
}

/* FORMULA box */
.calc__formula {
  margin-top: 20px;
  padding: 20px 22px;
  background: var(--surface-2);
  border-radius: var(--r-md);
  border: 1px dashed var(--line-2);
}
.calc__formula h4 {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 8px;
}
.calc__formula div {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--ink-2);
  line-height: 1.7;
}

/* ═══════════════════════════════════════
   FOOTER
   ═══════════════════════════════════════ */
.footer {
  margin-top: 60px;
  padding: 32px 24px;
  border-top: 1px solid var(--line);
  background: rgba(255,255,255,0.6);
}
.footer__inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  color: var(--ink-3);
}
.footer__brand { color: var(--brand); font-weight: 700; }
.footer__sep { color: var(--ink-4); }
.footer__warn { color: var(--ink-3); }
.footer__report {
  color: var(--brand);
  font-weight: 700;
}
.footer__report:hover {
  text-decoration: underline;
}

/* ═══════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════ */
@media (max-width: 860px) {
  .topnav__action-text { display: none; }
  .topnav__action { padding: 0 10px; }
  .specialty-menu { right: -46px; }
  .topnav__brand {
    gap: 6px;
  }
  .topnav__name {
    font-size: 13px;
  }
}

@media (max-width: 720px) {
  .topnav { padding: 12px 14px; gap: 8px; }
  .topnav__lang-label { display: none; }
  .topnav__lang { padding: 8px 10px; }
  .topnav.is-compact .topnav__right {
    max-width: 190px;
    overflow-x: auto;
    scrollbar-width: none;
  }
  .topnav.is-compact .topnav__right::-webkit-scrollbar {
    display: none;
  }
  .stage { padding: 0 16px 60px; }
  .hero { padding: 48px 0 24px; }
  .hero.is-compact { padding: 16px 0 12px; }
  .hero__symbol { width: 86px; height: 86px; margin-bottom: 14px; }
  .hero__brand { margin-bottom: 32px; }
  .search { padding: 5px 5px 5px 18px; margin-bottom: 32px; }
  .search__input { padding: 14px 12px; font-size: 15px; }
  .categories { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .cat { padding: 16px 8px 14px; }
  .cat__icon { font-size: 26px; margin-bottom: 8px; }
  .cat__name { font-size: 12px; }
  .cat__count { font-size: 10px; }
  .results-header__title { font-size: 24px; }
  .results-grid { grid-template-columns: 1fr; }
  .calc__head, .calc__body { padding: 22px; }
  .calc__title { font-size: 22px; padding-right: 48px; }
  .calc__fav { top: 18px; right: 18px; }
  .choice-box { grid-template-columns: 1fr; }
  .report-form { padding: 22px; }
}

@media (max-width: 480px) {
  .categories { grid-template-columns: repeat(2, 1fr); }
  .topnav {
    padding-inline: 10px;
  }
  .topnav__right {
    gap: 6px;
  }
  .topnav__logo {
    width: 28px;
    height: 28px;
  }
}
