/* ═══════════════════════════════════════════
   FinCalc.kz — Единый стиль (Kaspi-inspired)
   ═══════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
  --red:       #e31e24;
  --red-dark:  #c41a1f;
  --red-light: #fff0f0;
  --red-mid:   #ffd6d7;
  --bg:        #f4f5f7;
  --surface:   #ffffff;
  --surface2:  #f9fafb;
  --border:    #e8eaed;
  --border2:   #d1d5db;
  --ink:       #1a1d23;
  --ink2:      #374151;
  --muted:     #6b7280;
  --muted2:    #9ca3af;
  --green:     #12b76a;
  --green-bg:  #ecfdf5;
  --orange:    #f59e0b;
  --orange-bg: #fffbeb;
  --blue:      #2563eb;
  --blue-bg:   #eff6ff;
  --shadow-sm: 0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.04);
  --shadow:    0 4px 16px rgba(0,0,0,.08), 0 2px 6px rgba(0,0,0,.04);
  --shadow-lg: 0 10px 40px rgba(0,0,0,.1), 0 4px 12px rgba(0,0,0,.05);
  --radius-sm: 8px;
  --radius:    12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
}

/* ── RESET ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; overflow-x: hidden; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  max-width: 100vw;
}

/* ── NAV ── */
.nav {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 200;
  box-shadow: var(--shadow-sm);
}
.nav-inner {
  max-width: 960px; margin: 0 auto;
  display: flex; align-items: center;
  justify-content: space-between;
  padding: 0 24px; height: 60px;
}
.nav-logo {
  display: flex; align-items: center; gap: 8px;
  text-decoration: none;
}
.nav-logo-icon {
  width: 32px; height: 32px;
  background: var(--red);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  color: white; font-weight: 700; font-size: 14px;
  letter-spacing: -.5px;
}
.nav-logo-text {
  font-size: 16px; font-weight: 700;
  color: var(--ink); letter-spacing: -.3px;
}
.nav-logo-text span { color: var(--red); }
.nav-links {
  display: flex; align-items: center; gap: 4px;
}
.nav-links a {
  padding: 6px 14px; border-radius: var(--radius-sm);
  color: var(--muted); text-decoration: none;
  font-size: 13px; font-weight: 500;
  transition: background .15s, color .15s;
  white-space: nowrap;
}
.nav-links a:hover { background: var(--bg); color: var(--ink); }
.nav-links a.active {
  background: var(--red-light);
  color: var(--red); font-weight: 600;
}

/* ── PAGE HEADER ── */
.page-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0;
}
.page-header-inner {
  max-width: 960px; margin: 0 auto;
  padding: 32px 24px;
}
.page-header-breadcrumb {
  display: flex; align-items: center; gap: 6px;
  font-size: 12px; color: var(--muted);
  margin-bottom: 12px;
}
.page-header-breadcrumb a {
  color: var(--muted); text-decoration: none;
  transition: color .15s;
}
.page-header-breadcrumb a:hover { color: var(--red); }
.page-header-breadcrumb span { color: var(--muted2); }
.page-header h1 {
  font-size: 24px; font-weight: 700;
  color: var(--ink); letter-spacing: -.4px;
  margin-bottom: 6px;
}
.page-header p {
  font-size: 14px; color: var(--muted);
  max-width: 560px;
}

/* ── TABS ── */
.tabs-wrap {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.tabs-inner {
  max-width: 960px; margin: 0 auto;
  padding: 0 24px;
  display: flex; gap: 0;
}
.tab-btn {
  padding: 14px 20px;
  background: none; border: none;
  color: var(--muted); font-family: 'Inter', sans-serif;
  font-size: 13px; font-weight: 500;
  cursor: pointer; position: relative;
  transition: color .15s; white-space: nowrap;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.tab-btn:hover { color: var(--ink); }
.tab-btn.active { color: var(--red); border-bottom-color: var(--red); }

/* ── MAIN CONTAINER ── */
.container {
  max-width: 960px; margin: 0 auto;
  padding: 24px;
  overflow-x: hidden;
}

/* ── GRID LAYOUTS ── */
.layout-2col {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 20px; align-items: start;
  min-width: 0;
}
.layout-2eq {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  min-width: 0;
}
.layout-3col {
  display: grid;
  grid-template-columns: repeat(3,1fr);
  gap: 16px;
  min-width: 0;
}
.layout-4col {
  display: grid;
  grid-template-columns: repeat(4,1fr);
  gap: 16px;
  min-width: 0;
}

/* ── CARDS ── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  min-width: 0;
  overflow: hidden;
}
.card + .card { margin-top: 16px; }
.card-title {
  font-size: 11px; font-weight: 600;
  letter-spacing: .08em; text-transform: uppercase;
  color: var(--muted); margin-bottom: 20px;
}

/* ── FORM ELEMENTS ── */
.field { margin-bottom: 16px; }
.field:last-child { margin-bottom: 0; }
.field > label {
  display: block; font-size: 12px; font-weight: 500;
  color: var(--ink2); margin-bottom: 6px;
}
.input-wrap { position: relative; max-width: 100%; }
.input-wrap input,
.input-wrap select {
  width: 100%;
  max-width: 100%;
  background: var(--surface);
  border: 1.5px solid var(--border2);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  color: var(--ink);
  font-family: 'Inter', sans-serif;
  font-size: 16px; /* 16px prevents iOS zoom on focus */
  font-weight: 400;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
  -webkit-appearance: none;
}
.input-wrap input:focus,
.input-wrap select:focus {
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(227,30,36,.1);
}
.input-unit {
  position: absolute; right: 12px; top: 50%;
  transform: translateY(-50%);
  color: var(--muted); font-size: 12px; font-weight: 500;
  pointer-events: none;
}
.has-unit input { padding-right: 44px; }

/* Range slider */
.slider-wrap { margin-top: 8px; overflow: hidden; }
input[type=range] {
  -webkit-appearance: none;
  width: 100%;
  max-width: 100%;
  height: 4px;
  background: var(--border2);
  border-radius: 2px; outline: none; cursor: pointer;
}
input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--red);
  border: 2px solid white;
  box-shadow: 0 1px 4px rgba(227,30,36,.4);
  transition: transform .15s;
}
input[type=range]::-webkit-slider-thumb:hover { transform: scale(1.15); }

/* Segment control */
.segment {
  display: flex;
  background: var(--bg);
  border: 1.5px solid var(--border2);
  border-radius: var(--radius-sm);
  padding: 3px; gap: 2px;
}
.segment button {
  flex: 1; padding: 7px 6px;
  background: none; border: none;
  color: var(--muted); font-family: 'Inter', sans-serif;
  font-size: 12px; font-weight: 500;
  cursor: pointer; border-radius: 6px;
  transition: background .15s, color .15s;
}
.segment button.active {
  background: var(--surface);
  color: var(--red); font-weight: 600;
  box-shadow: var(--shadow-sm);
}
.segment button:not(.active):hover { color: var(--ink); }

/* Toggle */
.toggle-row {
  display: flex; align-items: center;
  justify-content: space-between;
  padding: 10px 0; border-bottom: 1px solid var(--border);
}
.toggle-row:last-child { border-bottom: none; }
.toggle-label { font-size: 13px; font-weight: 400; color: var(--ink2); }
.toggle {
  width: 44px; height: 24px;
  background: var(--border2);
  border-radius: 12px; position: relative;
  cursor: pointer; border: none;
  transition: background .2s; outline: none;
}
.toggle.on { background: var(--red); }
.toggle::after {
  content: '';
  position: absolute; top: 2px; left: 2px;
  width: 20px; height: 20px;
  background: white; border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0,0,0,.2);
  transition: transform .2s;
}
.toggle.on::after { transform: translateX(20px); }

/* Section divider */
.section-sep {
  display: flex; align-items: center; gap: 10px;
  margin: 16px 0;
}
.section-sep::before, .section-sep::after {
  content: ''; flex: 1; height: 1px; background: var(--border);
}
.sep-label {
  font-size: 11px; font-weight: 600;
  letter-spacing: .06em; text-transform: uppercase;
  white-space: nowrap; padding: 3px 10px;
  border-radius: 20px;
}
.sep-red    { background: var(--red-light);  color: var(--red); }
.sep-green  { background: var(--green-bg);   color: var(--green); }
.sep-blue   { background: var(--blue-bg);    color: var(--blue); }
.sep-orange { background: var(--orange-bg);  color: var(--orange); }
.sep-gray   { background: var(--bg);         color: var(--muted); border: 1px solid var(--border); }

/* ── RESULT TILES ── */
.result-grid {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 12px; margin-bottom: 16px; min-width: 0;
}
.result-grid-3 {
  display: grid; grid-template-columns: repeat(3,1fr);
  gap: 12px; margin-bottom: 16px; min-width: 0;
}
.result-grid-4 {
  display: grid; grid-template-columns: repeat(4,1fr);
  gap: 12px; margin-bottom: 16px; min-width: 0;
}
.rtile {
  background: var(--surface2);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
}
.rtile.primary {
  background: var(--red-light);
  border-color: var(--red-mid);
}
.rtile.success {
  background: var(--green-bg);
  border-color: #a7f3d0;
}
.rtile.info {
  background: var(--blue-bg);
  border-color: #bfdbfe;
}
.rtile.warning {
  background: var(--orange-bg);
  border-color: #fde68a;
}
.rtile-label {
  font-size: 11px; font-weight: 500;
  color: var(--muted); text-transform: uppercase;
  letter-spacing: .06em; margin-bottom: 8px;
}
.rtile.primary .rtile-label { color: var(--red); }
.rtile.success .rtile-label { color: var(--green); }
.rtile.info    .rtile-label { color: var(--blue); }
.rtile-value {
  font-size: 20px; font-weight: 700;
  color: var(--ink); letter-spacing: -.4px; line-height: 1.1;
}
.rtile.primary .rtile-value { color: var(--red); }
.rtile.success .rtile-value { color: var(--green); }
.rtile.info    .rtile-value { color: var(--blue); }
.rtile-sub {
  font-size: 11px; color: var(--muted);
  margin-top: 4px;
}
.badge {
  display: inline-block;
  font-size: 11px; font-weight: 600;
  padding: 2px 8px; border-radius: 20px;
  margin-top: 6px;
}
.badge-green  { background: var(--green-bg); color: var(--green); }
.badge-red    { background: var(--red-light); color: var(--red); }
.badge-blue   { background: var(--blue-bg); color: var(--blue); }
.badge-orange { background: var(--orange-bg); color: var(--orange); }

/* ── BREAKDOWN TABLE ── */
.breakdown {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.brow {
  display: flex; align-items: center;
  justify-content: space-between;
  padding: 11px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.brow:last-child { border-bottom: none; }
.brow.brow-header {
  background: var(--bg);
  font-size: 10px; font-weight: 600;
  letter-spacing: .08em; text-transform: uppercase;
  color: var(--muted);
}
.brow .bl { color: var(--muted); }
.brow .bv { font-weight: 600; color: var(--ink); }
.bv-red    { color: var(--red)!important; }
.bv-green  { color: var(--green)!important; }
.bv-blue   { color: var(--blue)!important; }
.bv-muted  { color: var(--muted)!important; font-weight:400!important; }

/* ── VERDICT BANNER ── */
.verdict {
  border-radius: var(--radius);
  padding: 16px 18px;
  display: flex; align-items: flex-start; gap: 14px;
  margin-bottom: 16px;
}
.verdict.v-red    { background: var(--red-light);  border: 1.5px solid var(--red-mid); }
.verdict.v-green  { background: var(--green-bg);   border: 1.5px solid #a7f3d0; }
.verdict.v-blue   { background: var(--blue-bg);    border: 1.5px solid #bfdbfe; }
.verdict.v-gray   { background: var(--bg);         border: 1.5px solid var(--border2); }
.verdict.v-orange { background: var(--orange-bg);  border: 1.5px solid #fde68a; }
.verdict-icon {
  width: 36px; height: 36px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; flex-shrink: 0;
}
.verdict.v-red    .verdict-icon { background: var(--red-mid); }
.verdict.v-green  .verdict-icon { background: #a7f3d0; }
.verdict.v-blue   .verdict-icon { background: #bfdbfe; }
.verdict.v-gray   .verdict-icon { background: var(--border2); }
.verdict-body { flex: 1; }
.verdict-title {
  font-size: 14px; font-weight: 700;
  margin-bottom: 4px;
}
.verdict.v-red    .verdict-title { color: var(--red); }
.verdict.v-green  .verdict-title { color: var(--green); }
.verdict.v-blue   .verdict-title { color: var(--blue); }
.verdict.v-gray   .verdict-title { color: var(--muted); }
.verdict-desc { font-size: 13px; color: var(--ink2); line-height: 1.6; }
.verdict-desc strong { color: var(--ink); font-weight: 600; }

/* ── DUEL CARDS ── */
.duel {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 12px; margin-bottom: 16px;
}
.duel-card {
  background: var(--surface2);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
}
.duel-card.dc-a { border-top: 3px solid var(--red); }
.duel-card.dc-b { border-top: 3px solid var(--blue); }
.duel-card.dc-c { border-top: 3px solid var(--green); }
.dc-head {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 16px;
}
.dc-icon {
  width: 36px; height: 36px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
}
.dc-a .dc-icon { background: var(--red-light); }
.dc-b .dc-icon { background: var(--blue-bg); }
.dc-c .dc-icon { background: var(--green-bg); }
.dc-name { font-size: 15px; font-weight: 700; color: var(--ink); }
.dc-a .dc-name { color: var(--red); }
.dc-b .dc-name { color: var(--blue); }
.dc-c .dc-name { color: var(--green); }
.dc-metric { margin-bottom: 12px; }
.dc-metric:last-child { margin-bottom: 0; }
.dc-lbl { font-size: 11px; color: var(--muted); font-weight: 500; margin-bottom: 3px; text-transform: uppercase; letter-spacing: .04em; }
.dc-val { font-size: 18px; font-weight: 700; color: var(--ink); letter-spacing: -.3px; }
.dc-a .dc-val { color: var(--red); }
.dc-b .dc-val { color: var(--blue); }
.dc-sub { font-size: 11px; color: var(--muted); margin-top: 2px; }

/* ── CHART ── */
.chart-wrap { position: relative; height: 260px; }
.chart-wrap.sm { height: 200px; }
.chart-wrap.lg { height: 320px; }

/* ── DATA TABLE ── */
.data-table { width: 100%; border-collapse: collapse; }
.data-table th {
  text-align: left; padding: 10px 14px;
  font-size: 11px; font-weight: 600;
  letter-spacing: .06em; text-transform: uppercase;
  color: var(--muted); background: var(--bg);
  border-bottom: 1.5px solid var(--border);
}
.data-table td {
  padding: 11px 14px; font-size: 13px;
  border-bottom: 1px solid var(--border); color: var(--ink2);
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: var(--bg); }

/* ── HINT ── */
.hint {
  font-size: 12px; color: var(--muted);
  line-height: 1.6; padding: 8px 12px; margin-top: 6px;
  background: var(--bg); border-radius: var(--radius-sm);
  border-left: 3px solid var(--border2);
}

/* ── BUTTON ── */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 12px 24px; border-radius: var(--radius-sm);
  font-family: 'Inter', sans-serif; font-size: 13px;
  font-weight: 600; cursor: pointer; border: none;
  text-decoration: none; transition: all .15s;
}
.btn-primary {
  background: var(--red); color: white;
}
.btn-primary:hover { background: var(--red-dark); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(227,30,36,.3); }
.btn-outline {
  background: white; color: var(--red);
  border: 1.5px solid var(--red);
}
.btn-outline:hover { background: var(--red-light); }

/* ── CHART TOOLTIP OVERRIDE ── */
.chart-tooltip {
  background: var(--ink)!important;
  border-radius: var(--radius-sm)!important;
}

/* ── FOOTER ── */
.footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  margin-top: 60px;
}
.footer-inner {
  max-width: 960px; margin: 0 auto;
  padding: 24px;
  display: flex; align-items: center;
  justify-content: space-between;
  gap: 20px; flex-wrap: wrap;
}
.footer-logo {
  font-size: 14px; font-weight: 700; color: var(--ink);
}
.footer-logo span { color: var(--red); }
.footer-note { font-size: 12px; color: var(--muted); }
.footer-links { display: flex; gap: 20px; }
.footer-links a {
  font-size: 12px; color: var(--muted);
  text-decoration: none; transition: color .15s;
}
.footer-links a:hover { color: var(--red); }

/* ── HAMBURGER BUTTON ── */
.nav-burger {
  display: none;
  background: none; border: none;
  width: 40px; height: 40px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  flex-direction: column;
  align-items: center; justify-content: center;
  gap: 5px; padding: 8px;
  transition: background .15s;
  flex-shrink: 0;
}
.nav-burger:hover { background: var(--bg); }
.nav-burger span {
  display: block; width: 20px; height: 2px;
  background: var(--ink); border-radius: 2px;
  transition: transform .25s, opacity .25s;
}
.nav-burger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-burger.open span:nth-child(2) { opacity: 0; }
.nav-burger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ── MOBILE DRAWER ── */
.nav-drawer {
  display: none;
  position: fixed;
  top: 60px; left: 0; right: 0; bottom: 0;
  background: var(--surface);
  z-index: 199;
  padding: 8px 16px 32px;
  flex-direction: column; gap: 2px;
  overflow-y: auto;
}
.nav-drawer.open { display: flex; }
.nav-drawer a {
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  color: var(--ink2); text-decoration: none;
  font-size: 15px; font-weight: 500;
  transition: background .15s, color .15s;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 10px;
}
.nav-drawer a:last-child { border-bottom: none; }
.nav-drawer a:hover,
.nav-drawer a:active { background: var(--bg); }
.nav-drawer a.active {
  background: var(--red-light);
  color: var(--red); font-weight: 600;
}

/* ── RESPONSIVE ── */
@media (max-width: 960px) {
  .nav-links { display: none; }
  .nav-burger { display: flex; }
}

@media (max-width: 900px) {
  .container { padding: 16px; }
  .page-header { padding: 24px 16px; }
  .page-header h1 { font-size: 20px; }
  .layout-2col { grid-template-columns: 1fr; }
  .layout-2eq  { grid-template-columns: 1fr; }
  .layout-3col { grid-template-columns: 1fr 1fr; }
  .layout-4col { grid-template-columns: 1fr 1fr; }
  .result-grid-4 { grid-template-columns: 1fr 1fr; }
  .result-grid-3 { grid-template-columns: 1fr 1fr; }
  .duel { grid-template-columns: 1fr; }
  .chart-wrap { height: 220px; }
  .chart-wrap.lg { height: 240px; }
}

@media (max-width: 600px) {
  .nav-inner { padding: 0 16px; height: 56px; }
  .nav-drawer { top: 56px; }
  .container { padding: 12px; }
  .page-header { padding: 16px 12px; }
  .page-header h1 { font-size: 18px; }
  .page-header p { font-size: 13px; }
  .layout-3col { grid-template-columns: 1fr; }
  .layout-4col { grid-template-columns: 1fr 1fr; }
  .result-grid { grid-template-columns: 1fr 1fr; }
  .result-grid-3 { grid-template-columns: 1fr 1fr; }
  .result-grid-4 { grid-template-columns: 1fr 1fr; }
  .card { padding: 16px; }
  .duel-card { padding: 14px; }
  .rtile { padding: 12px; }
  .rtile-value { font-size: 16px; }
  .rtile-label { font-size: 10px; }
  .dc-val { font-size: 15px; }
  .dc-name { font-size: 14px; }
  .chart-wrap { height: 190px; }
  .chart-wrap.sm { height: 160px; }
  .chart-wrap.lg { height: 200px; }
  .breakdown .brow { font-size: 12px; padding: 9px 12px; flex-wrap: wrap; gap: 2px; }
  .breakdown .brow .bl { flex: 1 1 60%; }
  .breakdown .brow .bv { flex: 0 0 auto; }
  .tabs-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .tabs-inner { min-width: max-content; }
  .tab-btn { padding: 12px 14px; font-size: 12px; white-space: nowrap; }
  .footer-inner { flex-direction: column; gap: 10px; text-align: center; padding: 20px 16px; }
  .section-sep { margin: 10px 0; }
  .verdict { padding: 12px 14px; gap: 10px; }
  .verdict-icon { width: 28px; height: 28px; font-size: 14px; flex-shrink: 0; border-radius: 8px; }
  .verdict-title { font-size: 13px; }
  .verdict-desc { font-size: 12px; }
  .btn { padding: 11px 20px; font-size: 13px; }
  .field > label { font-size: 13px; }
  .segment button { font-size: 11px; padding: 8px 4px; }
  .toggle-row { padding: 8px 0; }
  .toggle-label { font-size: 12px; }
  .brow.brow-header { font-size: 9px; }
}

/* ── TOOLTIPS ── */
.tip {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  cursor: help;
  border-bottom: 1px dashed var(--border2);
}
.tip-icon {
  display: inline-flex;
  align-items: center; justify-content: center;
  width: 14px; height: 14px;
  background: var(--muted2);
  color: white;
  border-radius: 50%;
  font-size: 9px; font-weight: 700;
  font-style: normal;
  flex-shrink: 0;
  line-height: 1;
  cursor: help;
}
.tip-box {
  display: none;
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--ink);
  color: white;
  font-size: 12px; font-weight: 400;
  line-height: 1.55;
  padding: 10px 14px;
  border-radius: 10px;
  width: 240px;
  z-index: 999;
  box-shadow: 0 4px 16px rgba(0,0,0,.2);
  pointer-events: none;
  white-space: normal;
  text-align: left;
  font-family: 'Inter', sans-serif;
  letter-spacing: 0;
}
.tip-box::after {
  content: '';
  position: absolute;
  top: 100%; left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: var(--ink);
}
.tip:hover .tip-box,
.tip-icon:hover + .tip-box,
.tip-icon:focus + .tip-box {
  display: block;
}
/* Mobile: show on tap */
.tip-box.visible { display: block; }
