/* ===================================================================
   NtoolBox — site.css
   Tema: wwwroot/tema/index.html + detay.html birleşimi
   =================================================================== */

/* ===== ROOT VARIABLES ===== */
:root {
  --bg: #ffffff;
  --ink: #0f172a;
  --ink-2: #475569;
  --ink-3: #94a3b8;
  --line: #eef0f4;
  --line-2: #e6e9ef;

  --c-math-bg: #eaf2ff;
  --c-math-bg-2: #dbe8ff;
  --c-math-ink: #1e40af;
  --c-math-accent: #2563eb;

  --c-finance-bg: #e6f7ee;
  --c-finance-bg-2: #d3f0df;
  --c-finance-ink: #065f46;
  --c-finance-accent: #059669;

  --c-health-bg: #ffeaf0;
  --c-health-bg-2: #ffd9e3;
  --c-health-ink: #9d174d;
  --c-health-accent: #e11d74;

  --c-fun-bg: #fce7f3;
  --c-fun-bg-2: #fbcfe8;
  --c-fun-ink: #831843;
  --c-fun-accent: #db2777;

  --c-tech-bg: #efe9ff;
  --c-tech-bg-2: #e1d6ff;
  --c-tech-ink: #5b21b6;
  --c-tech-accent: #7c3aed;

  --c-eng-bg: #e6f1f5;
  --c-eng-bg-2: #d2e6ed;
  --c-eng-ink: #075985;
  --c-eng-accent: #0891b2;

  --c-edu-bg: #fff7e0;
  --c-edu-bg-2: #ffecbf;
  --c-edu-ink: #854d0e;
  --c-edu-accent: #ca8a04;

  --c-life-bg: #fff1e0;
  --c-life-bg-2: #ffe2c2;
  --c-life-ink: #9a3412;
  --c-life-accent: #ea7d1a;
}

/* ===== BASE ===== */
html, body { background: var(--bg); color: var(--ink); margin: 0; }
body {
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* ===== UTILITY ===== */
.container-x { max-width: 1180px; }

/* ===== NAVBAR ===== */
.topbar {
  border-bottom: 1px solid rgba(15,23,42,.06);
  background: #ddf4e7;
  position: sticky; top: 0; z-index: 50;
}
.brand {
  display: inline-flex; align-items: center; gap: .6rem;
  font-weight: 800; font-size: 1.15rem; color: var(--ink); text-decoration: none;
  letter-spacing: -0.01em;
}
.brand-mark {
  width: 34px; height: 34px; border-radius: 9px;
  display: grid; place-items: center;
  background: linear-gradient(135deg, #2563eb, #7c3aed);
  color: #fff; font-size: 1.05rem;
}
.brand .dot { color: #94a3b8; font-weight: 600; }
.brand .tld { color: #64748b; font-weight: 600; }
.nav-link-soft { color: var(--ink-2); font-weight: 500; }
.nav-link-soft:hover { color: var(--ink); }

.search-pill {
  background: #ffffff;
  border: 1px solid rgba(15,23,42,.08);
  border-radius: 999px;
  padding: .32rem .8rem .32rem 2.05rem;
  font-size: .82rem;
  width: 220px; max-width: 100%;
  transition: border-color .15s, background .15s, box-shadow .15s, width .15s;
}
.search-pill:focus {
  outline: none;
  background: #fff;
  border-color: #94c8a8;
  box-shadow: 0 0 0 4px rgba(5,150,105,.12);
  width: 260px;
}
.search-wrap { position: relative; }
.search-wrap .bi-search {
  position: absolute; left: .75rem; top: 50%; transform: translateY(-50%);
  color: #94a3b8; font-size: .85rem;
}

/* Language switcher */
.lang-switcher {
  position: relative;
}
.lang-btn {
  background: rgba(255,255,255,.6);
  border: 1px solid rgba(15,23,42,.08);
  border-radius: 8px;
  padding: 6px 10px;
  font-size: .82rem; font-weight: 600; color: var(--ink);
  cursor: pointer; display: inline-flex; align-items: center; gap: 5px;
  transition: background .15s;
}
.lang-btn:hover { background: rgba(255,255,255,.85); }
.lang-dropdown {
  position: absolute; right: 0; top: calc(100% + 6px);
  background: #fff; border: 1px solid rgba(15,23,42,.06);
  border-radius: 12px;
  box-shadow: 0 12px 30px -10px rgba(15,23,42,.2);
  padding: 6px; min-width: 160px;
  opacity: 0; visibility: hidden;
  transform: translateY(4px);
  transition: opacity .14s, transform .14s, visibility .14s;
  z-index: 70;
}
.lang-switcher:hover .lang-dropdown,
.lang-switcher:focus-within .lang-dropdown {
  opacity: 1; visibility: visible; transform: translateY(0);
}
.lang-item {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 10px; border-radius: 8px;
  text-decoration: none; color: var(--ink);
  font-size: .88rem; font-weight: 500;
  transition: background .12s;
}
.lang-item:hover { background: #f5f7fa; }
.lang-item.active { font-weight: 700; color: var(--c-math-accent); }

/* Hover dropdown menü */
.nav-hover { position: relative; }
.nav-hover > .nav-link {
  display: inline-flex; align-items: center; gap: 4px;
  padding: .5rem .75rem; border-radius: 8px;
}
.nav-hover > .nav-link .caret { font-size: .7rem; transition: transform .18s ease; opacity: .65; }
.nav-hover:hover > .nav-link,
.nav-hover:focus-within > .nav-link { background: rgba(255,255,255,.55); color: var(--ink); }
.nav-hover:hover > .nav-link .caret,
.nav-hover:focus-within > .nav-link .caret { transform: rotate(180deg); }
.nav-mega {
  position: absolute; left: 0; top: 100%;
  min-width: 280px; background: #fff;
  border: 1px solid rgba(15,23,42,.06); border-radius: 14px;
  box-shadow: 0 18px 40px -18px rgba(15,23,42,.25), 0 4px 14px -8px rgba(15,23,42,.1);
  padding: 8px; opacity: 0; visibility: hidden;
  transform: translateY(6px);
  transition: opacity .16s ease, transform .16s ease, visibility .16s;
  z-index: 60;
}
.nav-hover:hover .nav-mega,
.nav-hover:focus-within .nav-mega { opacity: 1; visibility: visible; transform: translateY(0); }
.nav-hover::after { content: ""; position: absolute; left: 0; right: 0; top: 100%; height: 10px; }
.nav-mega .mega-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: 9px;
  color: var(--ink); text-decoration: none;
  font-size: .9rem; font-weight: 500; transition: background .12s;
}
.nav-mega .mega-item:hover { background: #f5f7fa; }
.nav-mega .mega-item .ico {
  width: 28px; height: 28px; border-radius: 7px;
  display: grid; place-items: center; font-size: .85rem; flex-shrink: 0;
}
.nav-mega .mega-item .meta { color: var(--ink-3); font-size: .72rem; font-weight: 500; margin-top: 1px; }

@media (max-width: 991.98px) {
  .nav-mega { position: static; opacity: 1; visibility: visible; transform: none;
    box-shadow: none; border: none; padding: 4px 0 4px 38px; min-width: 0; }
  .nav-hover::after { display: none; }
  .lang-dropdown { position: static; opacity: 1; visibility: visible; transform: none;
    box-shadow: none; border: none; padding: 4px 0 4px 4px; }
}

/* ===== ICO COLOR CHIPS ===== */
.ico-blue    { background: var(--c-math-bg);    color: var(--c-math-accent); }
.ico-green   { background: var(--c-finance-bg); color: var(--c-finance-accent); }
.ico-pink    { background: var(--c-health-bg);  color: var(--c-health-accent); }
.ico-fuchsia { background: var(--c-fun-bg);     color: var(--c-fun-accent); }
.ico-purple  { background: var(--c-tech-bg);    color: var(--c-tech-accent); }
.ico-cyan    { background: var(--c-eng-bg);     color: var(--c-eng-accent); }
.ico-amber   { background: var(--c-edu-bg);     color: var(--c-edu-accent); }
.ico-orange  { background: var(--c-life-bg);    color: var(--c-life-accent); }

/* ===== HOME — INTRO ===== */
.intro { padding: 28px 0 8px; }
.intro h1 {
  font-weight: 800; font-size: clamp(1.4rem, 2.4vw, 2rem);
  letter-spacing: -0.02em; margin: 0;
}
.intro p { color: var(--ink-2); margin: .35rem 0 0; }

/* ===== HOME — CATEGORY GRID ===== */
.cat-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 14px;
}
@media (max-width: 1199px) { .cat-grid { grid-template-columns: repeat(4, 1fr); } }
@media (max-width: 991px)  { .cat-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 575px)  { .cat-grid { grid-template-columns: repeat(2, 1fr); } }

.cat-tile {
  position: relative;
  border-radius: 18px;
  padding: 22px 20px 20px;
  text-decoration: none;
  color: var(--ink);
  overflow: hidden;
  transition: transform .18s ease, box-shadow .18s ease;
  border: 1px solid rgba(15,23,42,.04);
  min-height: 150px;
  display: flex; flex-direction: column; justify-content: space-between;
}
.cat-tile:hover { transform: translateY(-3px); box-shadow: 0 14px 30px -18px rgba(15,23,42,.25); }
.cat-tile .icon-box {
  width: 44px; height: 44px; border-radius: 12px;
  display: grid; place-items: center;
  background: rgba(255,255,255,.6); backdrop-filter: blur(4px); font-size: 1.25rem;
}
.cat-tile .name { font-weight: 700; font-size: 1rem; letter-spacing: -0.01em; margin-top: 14px; }
.cat-tile .meta { margin-top: 4px; color: rgba(15,23,42,.55); font-size: .85rem; font-weight: 500; }
.cat-tile .arrow {
  position: absolute; right: 16px; bottom: 16px;
  width: 28px; height: 28px; border-radius: 50%;
  display: grid; place-items: center;
  background: rgba(255,255,255,.7); color: var(--ink); font-size: .85rem;
  transition: transform .18s ease;
}
.cat-tile:hover .arrow { transform: translateX(3px); }

.cat-math     { background: linear-gradient(160deg, var(--c-math-bg),    var(--c-math-bg-2));    color: var(--c-math-ink); }
.cat-finance  { background: linear-gradient(160deg, var(--c-finance-bg), var(--c-finance-bg-2)); color: var(--c-finance-ink); }
.cat-health   { background: linear-gradient(160deg, var(--c-health-bg),  var(--c-health-bg-2));  color: var(--c-health-ink); }
.cat-fun      { background: linear-gradient(160deg, var(--c-fun-bg),     var(--c-fun-bg-2));     color: var(--c-fun-ink); }
.cat-tech     { background: linear-gradient(160deg, var(--c-tech-bg),    var(--c-tech-bg-2));    color: var(--c-tech-ink); }
.cat-eng      { background: linear-gradient(160deg, var(--c-eng-bg),     var(--c-eng-bg-2));     color: var(--c-eng-ink); }
.cat-tile .icon-box i { color: inherit; }

/* ===== HOME — POPULAR CARDS ===== */
.section-eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  color: var(--ink-2); font-weight: 600; font-size: .82rem;
  letter-spacing: .12em; text-transform: uppercase;
}
.section-eyebrow .dot { width: 6px; height: 6px; border-radius: 50%; background: #cbd5e1; }
.section-title { font-weight: 800; font-size: clamp(1.35rem, 2.2vw, 1.75rem); letter-spacing: -0.02em; margin: 6px 0 0; }
.section-sub { color: var(--ink-2); margin-top: 4px; }

.pop-card {
  border: 1px solid var(--line); border-radius: 14px; padding: 14px;
  background: #fff; text-decoration: none; color: var(--ink);
  display: flex; align-items: center; gap: 12px;
  transition: border-color .15s, transform .15s, box-shadow .15s;
}
.pop-card:hover {
  border-color: #d8def0; transform: translateY(-2px);
  box-shadow: 0 10px 22px -14px rgba(15,23,42,.18);
}
.pop-card .ico { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; flex-shrink: 0; font-size: 1.05rem; }
.pop-card .t { font-weight: 600; font-size: .95rem; line-height: 1.25; }
.pop-card .s { color: var(--ink-3); font-size: .78rem; margin-top: 2px; }

/* ===== HOME — CATEGORY SECTIONS ===== */
.cat-section { padding-top: 56px; }
.cat-head { display: flex; align-items: center; gap: 14px; margin-bottom: 22px; flex-wrap: wrap; }
.cat-head .badge-ico { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; font-size: 1.2rem; }
.cat-head .titles { flex: 1; min-width: 200px; }
.cat-head h2 { font-weight: 800; font-size: 1.5rem; letter-spacing: -0.02em; margin: 0; }
.cat-head .titles p { color: var(--ink-2); margin: 2px 0 0; font-size: .95rem; }
.cat-head .see-all {
  font-weight: 600; font-size: .9rem; text-decoration: none;
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 14px; border-radius: 999px;
  border: 1px solid var(--line); color: var(--ink); background: #fff;
  transition: background .15s, border-color .15s;
}
.cat-head .see-all:hover { background: #f7f8fb; border-color: #d8dde6; }

.calc-card {
  border: 1px solid var(--line); border-radius: 14px; padding: 16px;
  background: #fff; text-decoration: none; color: var(--ink);
  display: block; height: 100%;
  transition: border-color .15s, transform .15s, box-shadow .15s, background .15s;
  position: relative;
}
.calc-card:hover { border-color: transparent; transform: translateY(-2px); box-shadow: 0 14px 28px -18px rgba(15,23,42,.22); }
.calc-card .ico { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; font-size: 1rem; margin-bottom: 12px; }
.calc-card .t { font-weight: 600; font-size: .98rem; letter-spacing: -.005em; line-height: 1.3; }
.calc-card .s { color: var(--ink-3); font-size: .8rem; margin-top: 4px; line-height: 1.4; }
.calc-card .go { position: absolute; right: 14px; top: 14px; color: #cbd5e1; font-size: .9rem; transition: color .15s, transform .15s; }
.calc-card:hover .go { color: var(--ink); transform: translate(2px, -2px); }

.calc-card.h-math:hover     { background: var(--c-math-bg); }
.calc-card.h-finance:hover  { background: var(--c-finance-bg); }
.calc-card.h-health:hover   { background: var(--c-health-bg); }
.calc-card.h-fun:hover      { background: var(--c-fun-bg); }
.calc-card.h-tech:hover     { background: var(--c-tech-bg); }
.calc-card.h-eng:hover      { background: var(--c-eng-bg); }

/* ===== DETAIL — BREADCRUMB ===== */
.crumb { font-size: .85rem; color: var(--ink-3); padding: 18px 0 6px; }
.crumb a { color: var(--ink-2); text-decoration: none; }
.crumb a:hover { color: var(--ink); }
.crumb .sep { margin: 0 8px; color: #cbd5e1; }
.crumb .now { color: var(--ink); font-weight: 600; }

/* ===== DETAIL — PAGE HEAD ===== */
.page-head { padding: 6px 0 24px; }
.page-head .badge-ico { width: 56px; height: 56px; border-radius: 14px; display: grid; place-items: center; font-size: 1.55rem; }
.page-head h1 { font-weight: 800; font-size: clamp(1.6rem, 2.6vw, 2.1rem); letter-spacing: -0.02em; margin: 0; }
.page-head .lead { color: var(--ink-2); margin: 4px 0 0; max-width: 60ch; }
.meta-row { display: flex; flex-wrap: wrap; gap: 16px; color: var(--ink-3); font-size: .85rem; margin-top: 12px; }
.meta-row span { display: inline-flex; align-items: center; gap: 6px; }

/* ===== DETAIL — CALCULATOR SHELL ===== */
.calc-shell {
  background: #fff; border: 1px solid var(--line); border-radius: 18px;
  padding: 0; overflow: hidden; box-shadow: 0 1px 0 rgba(15,23,42,.02);
}
.calc-tabs { display: flex; gap: 0; border-bottom: 1px solid var(--line); background: #fafbfc; overflow-x: auto; }
.calc-tab {
  padding: 14px 18px; background: none; border: 0;
  font-weight: 600; font-size: .92rem; color: var(--ink-2); cursor: pointer;
  border-bottom: 2px solid transparent; white-space: nowrap;
  transition: color .15s, border-color .15s, background .15s;
}
.calc-tab:hover { color: var(--ink); }
.calc-tab.active { color: var(--tab-accent, var(--c-math-accent)); border-bottom-color: var(--tab-accent, var(--c-math-accent)); background: #fff; }
.calc-body { padding: 26px; }

/* ===== DETAIL — FORM ELEMENTS ===== */
.field-label {
  font-size: .82rem; font-weight: 600; color: var(--ink-2);
  text-transform: uppercase; letter-spacing: .08em; margin-bottom: 8px; display: block;
}
.num-input {
  width: 100%; background: #fff; border: 1.5px solid var(--line-2); border-radius: 12px;
  padding: 14px 16px; font-size: 1.4rem; font-weight: 600;
  font-variant-numeric: tabular-nums; color: var(--ink);
  transition: border-color .15s, box-shadow .15s;
}
.num-input:focus { outline: none; border-color: var(--field-accent, var(--c-math-accent)); box-shadow: 0 0 0 4px rgba(37,99,235,.1); }
.num-input::placeholder { color: #cbd5e1; font-weight: 500; }
.num-input.is-error { border-color: #ef4444 !important; box-shadow: 0 0 0 4px rgba(239,68,68,.12) !important; animation: shake .35s; }
@keyframes shake {
  10%,90% { transform: translateX(-2px); }
  20%,80% { transform: translateX(3px); }
  30%,50%,70% { transform: translateX(-5px); }
  40%,60% { transform: translateX(5px); }
}

.select-input {
  width: 100%; background: #fff; border: 1.5px solid var(--line-2); border-radius: 12px;
  padding: 12px 16px; font-size: 1rem; font-weight: 500; color: var(--ink);
  transition: border-color .15s, box-shadow .15s;
}
.select-input:focus { outline: none; border-color: var(--field-accent, var(--c-math-accent)); box-shadow: 0 0 0 4px rgba(37,99,235,.1); }

.equation-line { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.equation-line .frag { color: var(--ink-2); font-weight: 600; font-size: .95rem; padding: 0 4px; }
.equation-line .field { flex: 1; min-width: 140px; }
.equation-line .field .num-input { padding: 10px 14px; font-size: 1.15rem; }

/* ===== DETAIL — RESULT CARD ===== */
.result-card {
  margin-top: 20px;
  background: linear-gradient(135deg, var(--rc-bg, var(--c-math-bg)), var(--rc-bg2, #f0f6ff));
  border: 1px solid var(--rc-border, #d8e7ff);
  border-radius: 14px; padding: 18px 20px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
}
.result-card .label { font-size: .8rem; font-weight: 600; color: var(--rc-ink, var(--c-math-ink)); letter-spacing: .08em; text-transform: uppercase; }
.result-card .value {
  font-size: clamp(1.6rem, 3.2vw, 2.4rem); font-weight: 800; color: var(--rc-ink, var(--c-math-ink));
  letter-spacing: -0.02em; font-variant-numeric: tabular-nums; line-height: 1.1; margin-top: 2px;
}
.result-card .formula {
  font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .85rem; color: #475569; background: rgba(255,255,255,.7);
  padding: 8px 12px; border-radius: 8px; border: 1px solid var(--rc-border, #d8e7ff);
}

/* ===== DETAIL — BUTTONS ===== */
.btn-row { display: flex; gap: 10px; margin-top: 18px; flex-wrap: wrap; }
.btn-calc {
  background: var(--btn-accent, var(--c-math-accent)); color: #fff;
  border: 0; border-radius: 12px; padding: 12px 24px; font-size: 1rem; font-weight: 600;
  cursor: pointer; display: inline-flex; align-items: center; gap: 8px;
  transition: filter .15s, transform .1s, box-shadow .15s;
  box-shadow: 0 4px 12px -4px var(--btn-shadow, rgba(37,99,235,.4));
}
.btn-calc:hover { filter: brightness(.9); }
.btn-calc:active { transform: translateY(1px); }
.btn-clear {
  background: #fff; color: var(--ink-2); border: 1.5px solid var(--line-2); border-radius: 12px;
  padding: 12px 20px; font-size: 1rem; font-weight: 600;
  cursor: pointer; display: inline-flex; align-items: center; gap: 8px;
  transition: background .15s, border-color .15s;
}
.btn-clear:hover { background: #f7f9fc; border-color: #cbd5e1; color: var(--ink); }

/* ===== DETAIL — RESULT ACTIONS ===== */
.result-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.act-btn {
  background: #fff; border: 1px solid var(--line-2); border-radius: 10px; padding: 8px 14px;
  font-size: .88rem; font-weight: 600; color: var(--ink-2);
  cursor: pointer; display: inline-flex; align-items: center; gap: 6px;
  transition: background .15s, border-color .15s, color .15s;
}
.act-btn:hover { background: #f7f9fc; border-color: #cbd5e1; color: var(--ink); }
.act-btn.danger { color: #b91c1c; border-color: #fecaca; }
.act-btn.danger:hover { background: #fef2f2; border-color: #fca5a5; }

/* ===== DETAIL — TOAST ===== */
.toast-stack {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%);
  z-index: 1080; display: flex; flex-direction: column-reverse;
  gap: 10px; pointer-events: none; width: min(420px, calc(100% - 32px));
}
.toast-msg {
  background: #fff; border: 1px solid var(--line); border-left: 4px solid #ef4444;
  border-radius: 12px; padding: 12px 16px 12px 14px;
  box-shadow: 0 12px 32px -10px rgba(15,23,42,.25);
  display: flex; align-items: flex-start; gap: 10px;
  font-size: .92rem; color: var(--ink); pointer-events: auto;
  animation: toastIn .35s cubic-bezier(.2,.9,.3,1.2) both;
}
.toast-msg.leaving { animation: toastOut .25s ease forwards; }
.toast-msg .ico { width: 28px; height: 28px; border-radius: 8px; background: #fee2e2; color: #b91c1c; display: grid; place-items: center; font-size: 1rem; flex-shrink: 0; }
.toast-msg .body { flex: 1; line-height: 1.4; }
.toast-msg .body strong { display: block; font-weight: 700; margin-bottom: 1px; }
.toast-msg .body span { color: var(--ink-2); font-size: .85rem; }
.toast-msg button.x { background: none; border: 0; padding: 2px 6px; color: var(--ink-3); cursor: pointer; font-size: 1rem; align-self: flex-start; }
.toast-msg button.x:hover { color: var(--ink); }
@keyframes toastIn { from { opacity: 0; transform: translateY(40px) scale(.96); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes toastOut { to { opacity: 0; transform: translateY(20px) scale(.97); } }

/* ===== DETAIL — MODAL ===== */
.modal-backdrop-x {
  position: fixed; inset: 0; background: rgba(15,23,42,.5);
  z-index: 1000; display: none; align-items: center; justify-content: center; padding: 20px;
}
.modal-backdrop-x.show { display: flex; animation: fadeIn .15s; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal-x { background: #fff; border-radius: 16px; max-width: 460px; width: 100%; box-shadow: 0 20px 50px -10px rgba(0,0,0,.3); animation: slideUp .2s; }
@keyframes slideUp { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.modal-x .head { padding: 18px 22px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; }
.modal-x .head h4 { margin: 0; font-size: 1.1rem; font-weight: 700; }
.modal-x .head .close { background: none; border: 0; font-size: 1.3rem; color: var(--ink-3); cursor: pointer; width: 32px; height: 32px; border-radius: 8px; }
.modal-x .head .close:hover { background: #f5f6f8; color: var(--ink); }
.modal-x .body { padding: 20px 22px; }
.modal-x .body label { font-size: .82rem; font-weight: 600; color: var(--ink-2); margin-bottom: 6px; display: block; }
.modal-x .body .form-input, .modal-x .body textarea {
  width: 100%; border: 1.5px solid var(--line-2); border-radius: 10px;
  padding: 10px 12px; font-size: .95rem; font-family: inherit;
  transition: border-color .15s, box-shadow .15s;
}
.modal-x .body .form-input:focus, .modal-x .body textarea:focus { outline: none; border-color: var(--c-math-accent); box-shadow: 0 0 0 3px rgba(37,99,235,.1); }
.modal-x .body textarea { min-height: 90px; resize: vertical; }
.modal-x .foot { padding: 14px 22px 18px; display: flex; justify-content: flex-end; gap: 8px; }
.captcha-box { display: flex; align-items: center; gap: 10px; background: #f7f9fc; border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; }
.captcha-box .q { font-family: 'JetBrains Mono', ui-monospace, monospace; font-weight: 700; font-size: 1.05rem; color: var(--ink); letter-spacing: .03em; }
.captcha-box input { width: 90px; border: 1.5px solid var(--line-2); border-radius: 8px; padding: 6px 10px; font-size: .95rem; text-align: center; }
.captcha-box .reload { background: none; border: 0; color: var(--ink-3); cursor: pointer; padding: 4px; }
.captcha-box .reload:hover { color: var(--c-math-accent); }

/* ===== DETAIL — SIDE CARDS ===== */
.side-card { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 20px; }
.side-card h3 { font-size: 1rem; font-weight: 700; letter-spacing: -0.01em; margin: 0 0 12px; display: flex; align-items: center; gap: 8px; }
.side-card h3 i { color: var(--btn-accent, var(--c-math-accent)); }
.side-card .formula-box {
  font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  background: #f7f9fc; border: 1px solid var(--line); border-radius: 10px;
  padding: 10px 12px; font-size: .88rem; color: var(--ink); margin-bottom: 8px;
  overflow-x: auto; white-space: nowrap;
}
.side-card .formula-box .var { color: var(--btn-accent, var(--c-math-accent)); font-weight: 600; }
.side-card .formula-cap { color: var(--ink-3); font-size: .8rem; margin: 6px 0 0; }

.related-list { display: grid; gap: 8px; }
.related-list a { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; text-decoration: none; color: var(--ink); border: 1px solid transparent; font-size: .92rem; font-weight: 500; transition: background .15s, border-color .15s; }
.related-list a:hover { background: #f7f9fc; border-color: var(--line); }
.related-list a .ico { width: 32px; height: 32px; border-radius: 8px; display: grid; place-items: center; font-size: .9rem; }

/* ===== DETAIL — HOW TO + FAQ ===== */
.prose-section { padding: 50px 0 0; }
.prose-section h2 { font-weight: 800; font-size: 1.5rem; letter-spacing: -0.02em; margin: 0 0 16px; }
.prose-section p { color: var(--ink-2); line-height: 1.65; }

.step-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.step-list li { display: flex; gap: 14px; align-items: flex-start; padding: 14px 16px; background: #fff; border: 1px solid var(--line); border-radius: 12px; }
.step-list .num { width: 28px; height: 28px; border-radius: 8px; flex-shrink: 0; background: var(--c-math-bg); color: var(--c-math-accent); display: grid; place-items: center; font-weight: 700; font-size: .9rem; }
.step-list .body { flex: 1; }
.step-list .body strong { display: block; margin-bottom: 2px; }
.step-list .body span { color: var(--ink-2); font-size: .92rem; }

.faq-item { border: 1px solid var(--line); border-radius: 12px; background: #fff; overflow: hidden; }
.faq-item + .faq-item { margin-top: 10px; }
.faq-item summary { list-style: none; cursor: pointer; padding: 16px 18px; font-weight: 600; font-size: .98rem; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: "\f282"; font-family: bootstrap-icons; color: var(--ink-3); transition: transform .2s; font-size: 1rem; }
.faq-item[open] summary::after { transform: rotate(180deg); }
.faq-item .ans { padding: 0 18px 16px; color: var(--ink-2); line-height: 1.6; }

/* ===== DETAIL — EXAMPLE TABLE ===== */
.ex-table { width: 100%; border-collapse: separate; border-spacing: 0; background: #fff; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.ex-table th, .ex-table td { padding: 12px 16px; text-align: left; font-size: .92rem; border-bottom: 1px solid var(--line); }
.ex-table th { background: #f7f9fc; font-weight: 600; color: var(--ink-2); font-size: .82rem; text-transform: uppercase; letter-spacing: .06em; }
.ex-table tr:last-child td { border-bottom: 0; }
.ex-table .res { color: var(--btn-accent, var(--c-math-accent)); font-weight: 700; font-variant-numeric: tabular-nums; }

/* ===== DETAIL — SEO SECTION ===== */
.seo-section { background: #fafbfc; border: 1px solid var(--line); border-radius: 16px; padding: 28px 30px; margin-top: 30px; }
.seo-section h2 { font-size: 1.4rem; font-weight: 800; letter-spacing: -0.02em; margin: 0 0 14px; }
.seo-section h3 { font-size: 1.05rem; font-weight: 700; margin: 22px 0 8px; }
.seo-section p, .seo-section li { color: var(--ink-2); line-height: 1.7; }
.seo-section ul { padding-left: 1.2rem; }

/* ===== DETAIL — COMMENTS ===== */
.comments-wrap { margin-top: 50px; }
.comments-wrap h2 { font-weight: 800; font-size: 1.5rem; letter-spacing: -0.02em; margin: 0 0 16px; }
.comment-form { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 20px 22px; margin-bottom: 20px; }
.comment-form .form-input, .comment-form textarea { width: 100%; border: 1.5px solid var(--line-2); border-radius: 10px; padding: 10px 12px; font-size: .95rem; font-family: inherit; transition: border-color .15s, box-shadow .15s; }
.comment-form .form-input:focus, .comment-form textarea:focus { outline: none; border-color: var(--c-math-accent); box-shadow: 0 0 0 3px rgba(37,99,235,.1); }
.comment-form label { font-size: .82rem; font-weight: 600; color: var(--ink-2); margin-bottom: 6px; display: block; }
.stars { display: inline-flex; gap: 4px; }
.stars .star { background: none; border: 0; cursor: pointer; padding: 2px; color: #cbd5e1; font-size: 1.5rem; transition: color .12s, transform .1s; }
.stars .star:hover { transform: scale(1.1); }
.stars .star.on { color: #f59e0b; }
.comment-item { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; margin-bottom: 12px; }
.comment-item .head { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.comment-item .avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--c-math-bg); color: var(--c-math-accent); display: grid; place-items: center; font-weight: 700; font-size: .9rem; }
.comment-item .name { font-weight: 700; color: var(--ink); }
.comment-item .date { color: var(--ink-3); font-size: .82rem; margin-left: auto; }
.comment-item .rating { color: #f59e0b; font-size: .9rem; }
.comment-item .body { color: var(--ink-2); line-height: 1.6; margin-top: 4px; }

/* ===== FOOTER ===== */
footer.site { margin-top: 80px; border-top: 1px solid var(--line); background: #fafbfc; padding: 28px 0 26px; }
footer.site .links a { color: var(--ink-2); text-decoration: none; font-size: .9rem; font-weight: 500; }
footer.site .links a:hover { color: var(--ink); }
footer.site .copy { color: var(--ink-3); font-size: .85rem; }
