/* =====================================================================
   AiHisab Knowledge — "AI" design system
   Dark theme = Help Center · Light theme = Admin
   ===================================================================== */
:root {
  --bg: #05080f;
  --panel: rgba(255, 255, 255, .035);
  --panel-2: rgba(255, 255, 255, .06);
  --line: rgba(255, 255, 255, .08);
  --line-2: rgba(255, 255, 255, .14);
  --text: #e6edf7;
  --muted: #8b97ad;
  --teal: #2dd4bf;
  --cyan: #22d3ee;
  --violet: #a78bfa;
  --pink: #f472b6;
  --grad: linear-gradient(120deg, #2dd4bf 0%, #22d3ee 35%, #a78bfa 70%, #f472b6 100%);
}

/* ---------- base ---------- */
body.theme-dark { background: var(--bg); color: var(--text); }
body.theme-light { background: #f5f7fb; color: #1e293b; }
::selection { background: rgba(45, 212, 191, .35); color: #fff; }

.kb-grad-text { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.kb-muted { color: var(--muted); }

/* ---------- ambient background ---------- */
.kb-aurora { position: fixed; inset: 0; z-index: -2; overflow: hidden; pointer-events: none; }
.kb-aurora span { position: absolute; border-radius: 50%; filter: blur(90px); opacity: .35; animation: kb-float 22s ease-in-out infinite; }
.kb-aurora span:nth-child(1) { width: 560px; height: 560px; background: #0d9488; top: -180px; left: -120px; }
.kb-aurora span:nth-child(2) { width: 520px; height: 520px; background: #7c3aed; top: -120px; right: -160px; animation-delay: -7s; }
.kb-aurora span:nth-child(3) { width: 460px; height: 460px; background: #0891b2; top: 420px; left: 35%; opacity: .18; animation-delay: -14s; }
@keyframes kb-float { 0%, 100% { transform: translate(0, 0) scale(1); } 33% { transform: translate(60px, 40px) scale(1.08); } 66% { transform: translate(-40px, 30px) scale(.95); } }
.kb-grid { position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background-image: linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px);
  background-size: 44px 44px; mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 30%, transparent 75%); -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 30%, transparent 75%); }

/* ---------- top bar ---------- */
.kb-topbar { position: sticky; top: 0; z-index: 40; background: rgba(5, 8, 15, .72); backdrop-filter: blur(16px) saturate(140%); -webkit-backdrop-filter: blur(16px) saturate(140%); border-bottom: 1px solid var(--line); }
.kb-logo { width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; color: #fff; font-size: 16px; background: var(--grad); background-size: 200% 200%; animation: kb-shift 6s ease infinite; box-shadow: 0 0 24px rgba(45, 212, 191, .35); }
@keyframes kb-shift { 0%, 100% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } }
.kb-nav { white-space: nowrap; display: inline-flex; align-items: center; gap: .45rem; padding: .45rem .75rem; border-radius: 10px; color: #aab4c6; transition: .15s; }
.kb-nav span { display: none; }
@media (min-width: 1180px) { .kb-nav span { display: inline; } }
.kb-nav:hover { color: #fff; background: rgba(255, 255, 255, .06); }
.kb-nav.is-active { color: #fff; background: rgba(45, 212, 191, .12); box-shadow: inset 0 0 0 1px rgba(45, 212, 191, .3); }
.kb-app-btn { white-space: nowrap; margin-left: .4rem; display: inline-flex; align-items: center; gap: .45rem; padding: .45rem .8rem; border-radius: 10px; color: #fff; font-weight: 500; background: rgba(255,255,255,.06); border: 1px solid var(--line-2); transition: .15s; }
.kb-app-btn:hover { border-color: rgba(45, 212, 191, .6); box-shadow: 0 0 18px rgba(45, 212, 191, .25); }
.kb-cmd-trigger { white-space: nowrap; align-items: center; gap: .6rem; width: 190px; padding: .5rem .75rem; border-radius: 11px; font-size: .85rem; color: #7c889e; background: rgba(255,255,255,.04); border: 1px solid var(--line); transition: .15s; }
.kb-cmd-trigger:hover { border-color: var(--line-2); color: #cbd5e1; }
.kb-cmd-trigger kbd { margin-left: auto; font-family: 'JetBrains Mono', monospace; font-size: .68rem; padding: .1rem .4rem; border-radius: 6px; border: 1px solid var(--line-2); color: #94a3b8; }

/* ---------- glass cards ---------- */
.kb-card { position: relative; background: var(--panel); border: 1px solid var(--line); border-radius: 18px; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); transition: transform .2s, border-color .2s, box-shadow .2s, background .2s; }
a.kb-card:hover, .kb-card.is-hover:hover { transform: translateY(-3px); border-color: rgba(45, 212, 191, .35); background: var(--panel-2); box-shadow: 0 18px 40px -18px rgba(45, 212, 191, .35); }
.kb-glow-border { position: relative; }
.kb-glow-border::before { content: ""; position: absolute; inset: -1px; border-radius: inherit; padding: 1px; background: var(--grad); background-size: 300% 300%; animation: kb-shift 8s linear infinite;
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; pointer-events: none; }
.kb-chip { display: inline-flex; align-items: center; gap: .4rem; font-size: .8rem; padding: .4rem .8rem; border-radius: 999px; color: #cbd5e1; background: rgba(255,255,255,.04); border: 1px solid var(--line); transition: .15s; }
.kb-chip:hover { color: #fff; border-color: rgba(167, 139, 250, .5); background: rgba(167, 139, 250, .1); }
.kb-badge { display: inline-flex; align-items: center; gap: .4rem; font-size: .72rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; padding: .3rem .7rem; border-radius: 999px; color: #99f6e4; background: rgba(45, 212, 191, .1); border: 1px solid rgba(45, 212, 191, .25); }
.kb-icon-tile { width: 46px; height: 46px; border-radius: 13px; display: grid; place-items: center; font-size: 18px; color: #fff; flex-shrink: 0; }

/* ---------- AI orb ---------- */
.kb-orb { position: relative; width: 84px; height: 84px; border-radius: 50%; margin: 0 auto; }
.kb-orb::before { content: ""; position: absolute; inset: 0; border-radius: 50%; background: conic-gradient(from 0deg, #2dd4bf, #22d3ee, #a78bfa, #f472b6, #2dd4bf); animation: kb-spin 6s linear infinite; filter: blur(1px); }
.kb-orb::after { content: ""; position: absolute; inset: 5px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #1e293b, #05080f 70%); box-shadow: inset 0 0 22px rgba(45, 212, 191, .35); }
.kb-orb i { position: absolute; inset: 0; display: grid; place-items: center; z-index: 1; color: #fff; font-size: 28px; text-shadow: 0 0 18px rgba(45, 212, 191, .9); }
.kb-orb .kb-orb-halo { position: absolute; inset: -18px; border-radius: 50%; background: radial-gradient(circle, rgba(45, 212, 191, .25), transparent 65%); animation: kb-pulse 3s ease-in-out infinite; }
.kb-orb.is-thinking::before { animation-duration: 1.2s; }
@keyframes kb-spin { to { transform: rotate(360deg); } }
@keyframes kb-pulse { 0%, 100% { transform: scale(.9); opacity: .6; } 50% { transform: scale(1.15); opacity: 1; } }

/* ---------- hero search ---------- */
.kb-search { position: relative; border-radius: 20px; background: rgba(10, 15, 26, .85); box-shadow: 0 20px 60px -20px rgba(34, 211, 238, .35); }
.kb-search input { width: 100%; background: transparent; color: #fff; font-size: 1.05rem; padding: 1.15rem 8.5rem 1.15rem 3.4rem; outline: none; border-radius: 20px; }
.kb-search input::placeholder { color: #64748b; }
.kb-search .kb-search-ico { position: absolute; left: 1.25rem; top: 50%; transform: translateY(-50%); color: var(--teal); }
.kb-search button[type=submit] { position: absolute; right: .5rem; top: 50%; transform: translateY(-50%); display: inline-flex; align-items: center; gap: .5rem; padding: .7rem 1.1rem; border-radius: 14px; font-weight: 600; font-size: .9rem; color: #04121a; background: var(--grad); background-size: 200% 200%; animation: kb-shift 6s ease infinite; transition: box-shadow .2s; }
.kb-search button[type=submit]:hover { box-shadow: 0 0 24px rgba(45, 212, 191, .55); }
.kb-suggest { position: absolute; z-index: 30; left: 0; right: 0; top: calc(100% + 10px); border-radius: 16px; overflow: hidden; background: rgba(12, 18, 30, .97); border: 1px solid var(--line-2); box-shadow: 0 30px 60px -20px rgba(0,0,0,.8); text-align: left; }
.kb-suggest a { display: block; padding: .8rem 1.1rem; border-bottom: 1px solid var(--line); }
.kb-suggest a:hover { background: rgba(45, 212, 191, .08); }

/* ---------- AI answer ---------- */
.kb-answer { border-radius: 22px; background: linear-gradient(180deg, rgba(20, 30, 48, .75), rgba(10, 15, 26, .8)); }
.kb-answer-head { display: flex; align-items: center; gap: .7rem; padding: 1rem 1.4rem; border-bottom: 1px solid var(--line); }
.kb-mini-orb { width: 30px; height: 30px; border-radius: 50%; background: conic-gradient(from 0deg, #2dd4bf, #22d3ee, #a78bfa, #f472b6, #2dd4bf); animation: kb-spin 4s linear infinite; position: relative; flex-shrink: 0; }
.kb-mini-orb::after { content: ""; position: absolute; inset: 3px; border-radius: 50%; background: #0b1220; }
.kb-mini-orb.is-thinking { animation-duration: .9s; }
.kb-answer-body { padding: 1.4rem; font-size: 1rem; line-height: 1.75; }
.kb-answer-lead { font-size: 1.08rem; color: #f1f5f9; }
.kb-caret::after { content: ""; display: inline-block; width: 8px; height: 1.1em; margin-left: 2px; vertical-align: -3px; background: var(--teal); animation: kb-blink 1s steps(2) infinite; }
@keyframes kb-blink { 50% { opacity: 0; } }
.kb-steps { counter-reset: s; margin-top: 1.1rem; display: grid; gap: .55rem; }
.kb-steps li { counter-increment: s; position: relative; padding: .7rem .9rem .7rem 3rem; border-radius: 12px; background: rgba(255,255,255,.03); border: 1px solid var(--line); opacity: 0; transform: translateY(6px); animation: kb-in .35s ease forwards; }
.kb-steps li::before { content: counter(s); position: absolute; left: .8rem; top: .7rem; width: 1.5rem; height: 1.5rem; border-radius: 8px; display: grid; place-items: center; font-size: .75rem; font-weight: 700; color: #04121a; background: var(--grad); }
.kb-points li { position: relative; padding-left: 1.4rem; margin-top: .55rem; color: #cbd5e1; opacity: 0; animation: kb-in .35s ease forwards; }
.kb-points li::before { content: ""; position: absolute; left: .2rem; top: .7em; width: 6px; height: 6px; border-radius: 50%; background: var(--violet); box-shadow: 0 0 10px var(--violet); }
@keyframes kb-in { to { opacity: 1; transform: none; } }
.kb-ans-table-wrap { margin-top: 1rem; overflow-x: auto; border: 1px solid var(--line, rgba(127,127,127,.25)); border-radius: 12px; }
.kb-ans-table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.kb-ans-table th, .kb-ans-table td { padding: .5rem .8rem; text-align: left; border-bottom: 1px solid var(--line, rgba(127,127,127,.2)); white-space: nowrap; }
.kb-ans-table th { font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; opacity: .75; }
.kb-ans-table tr:last-child td { border-bottom: 0; }
.kb-ans-table td:last-child, .kb-ans-table th:last-child { text-align: right; font-variant-numeric: tabular-nums; }
.kb-source { display: inline-flex; align-items: center; gap: .45rem; font-size: .8rem; padding: .35rem .7rem; border-radius: 10px; color: #cbd5e1; background: rgba(255,255,255,.04); border: 1px solid var(--line); }
a.kb-source:hover { border-color: rgba(45, 212, 191, .5); color: #fff; }
.kb-skeleton { height: .9rem; border-radius: 6px; margin: .6rem 0; background: linear-gradient(90deg, rgba(255,255,255,.04), rgba(255,255,255,.12), rgba(255,255,255,.04)); background-size: 200% 100%; animation: kb-shimmer 1.3s linear infinite; }
@keyframes kb-shimmer { to { background-position: -200% 0; } }
.kb-thinking-text { background: linear-gradient(90deg, #64748b, #e2e8f0, #64748b); background-size: 200% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; animation: kb-shimmer 1.6s linear infinite; }

/* ---------- stats strip ---------- */
.kb-stat { display: flex; align-items: center; gap: .6rem; font-size: .82rem; color: var(--muted); }
.kb-stat b { color: #fff; font-weight: 700; font-size: 1rem; }
.kb-dot-live { width: 8px; height: 8px; border-radius: 50%; background: #34d399; box-shadow: 0 0 0 0 rgba(52, 211, 153, .6); animation: kb-ping 2s infinite; display: inline-block; }
@keyframes kb-ping { 0% { box-shadow: 0 0 0 0 rgba(52, 211, 153, .6); } 70% { box-shadow: 0 0 0 8px rgba(52, 211, 153, 0); } 100% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0); } }

/* ---------- reveal on scroll ---------- */
/* Hidden only when JavaScript runs (html.js is set in <head>); without JS the content simply shows. */
html.js .kb-reveal { opacity: 0; transform: translateY(14px); transition: opacity .6s ease, transform .6s ease; }
html.js .kb-reveal.is-in { opacity: 1; transform: none; }

/* ---------- article reading ---------- */
.kb-progress { position: fixed; top: 0; left: 0; height: 3px; width: 0; z-index: 60; background: var(--grad); box-shadow: 0 0 12px rgba(45, 212, 191, .8); }
.kb-toc a { display: block; padding: .35rem .75rem; border-left: 2px solid var(--line); color: var(--muted); font-size: .85rem; transition: .15s; }
.kb-toc a:hover { color: #fff; }
.kb-toc a.is-active { color: #fff; border-left-color: var(--teal); background: linear-gradient(90deg, rgba(45, 212, 191, .1), transparent); }

/* ---------- command palette ---------- */
.kb-cmd { position: fixed; inset: 0; z-index: 80; display: flex; justify-content: center; align-items: flex-start; padding: 12vh 16px 16px; }
.kb-cmd.hidden { display: none; }
.kb-cmd-backdrop { position: absolute; inset: 0; background: rgba(2, 6, 14, .7); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.kb-cmd-panel { position: relative; width: 100%; max-width: 620px; border-radius: 18px; overflow: hidden; background: rgba(12, 18, 30, .98); border: 1px solid var(--line-2); box-shadow: 0 40px 120px -20px rgba(34, 211, 238, .35); color: #e2e8f0; animation: kb-pop .18s ease; }
@keyframes kb-pop { from { transform: scale(.97); opacity: 0; } }
.kb-cmd-input { display: flex; align-items: center; gap: .8rem; padding: 1rem 1.2rem; border-bottom: 1px solid var(--line); }
.kb-cmd-input i { color: var(--teal); }
.kb-cmd-input input { flex: 1; background: transparent; outline: none; font-size: 1rem; color: #fff; }
.kb-cmd-list { max-height: 50vh; overflow-y: auto; padding: .4rem; }
.kb-cmd-item { display: flex; align-items: center; gap: .8rem; padding: .65rem .8rem; border-radius: 12px; color: #e2e8f0; }
.kb-cmd-item.is-sel, .kb-cmd-item:hover { background: rgba(45, 212, 191, .1); }
.kb-cmd-ico { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; flex-shrink: 0; background: rgba(255,255,255,.05); color: #94a3b8; }
.kb-cmd-ico.is-ai { background: linear-gradient(135deg, rgba(45,212,191,.25), rgba(167,139,250,.25)); color: #fff; }
.kb-cmd-foot { display: flex; gap: 1rem; padding: .6rem 1.2rem; font-size: .72rem; color: #64748b; border-top: 1px solid var(--line); }
.kb-cmd-foot kbd { margin-right: .2rem; }

/* ---------- footer ---------- */
.kb-footer { border-top: 1px solid var(--line); color: var(--muted); margin-top: 3rem; }
.theme-light .kb-footer { border-color: #e2e8f0; color: #94a3b8; }

/* ---------- article typography (light defaults) ---------- */
.kb-h2 { font-size: 1.4rem; font-weight: 700; margin: 2rem 0 .7rem; color: #0f172a; letter-spacing: -.01em; }
.kb-h3 { font-size: 1.2rem; font-weight: 700; margin: 2rem 0 .7rem; color: #0f172a; letter-spacing: -.01em; scroll-margin-top: 90px; }
.kb-h4 { font-size: 1rem; font-weight: 600; margin: 1.4rem 0 .5rem; color: #334155; scroll-margin-top: 90px; }
.kb-p { line-height: 1.8; margin: .7rem 0; }
.kb-ul, .kb-ol { margin: .7rem 0 .7rem 1.4rem; line-height: 1.8; }
.kb-ul { list-style: disc; }
.kb-ol { list-style: decimal; }
.kb-ul li, .kb-ol li { margin: .3rem 0; padding-left: .2rem; }
.kb-link { color: #0d9488; text-decoration: underline; text-underline-offset: 3px; }
.kb-code { font-family: 'JetBrains Mono', monospace; background: #f1f5f9; border: 1px solid #e2e8f0; border-radius: 5px; padding: .05rem .35rem; font-size: .86em; }
.kb-pre { font-family: 'JetBrains Mono', monospace; background: #0b1220; color: #e2e8f0; border-radius: 12px; padding: 1rem 1.2rem; overflow-x: auto; font-size: .85rem; margin: 1rem 0; border: 1px solid rgba(255,255,255,.08); }
.kb-kbd { display: inline-block; font-family: 'JetBrains Mono', monospace; font-size: .78em; background: #fff; border: 1px solid #cbd5e1; border-bottom-width: 3px; border-radius: 6px; padding: .05rem .45rem; color: #0f172a; line-height: 1.5; }
.kb-tip { display: flex; gap: .8rem; background: #f0fdfa; border: 1px solid #99f6e4; padding: .9rem 1.1rem; border-radius: 12px; margin: 1.2rem 0; line-height: 1.65; }
.kb-tip i { color: #0d9488; margin-top: .3rem; }
.kb-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: .92rem; border: 1px solid #e2e8f0; border-radius: 12px; overflow: hidden; }
.kb-table th, .kb-table td { padding: .6rem .85rem; text-align: left; border-bottom: 1px solid #e2e8f0; }
.kb-table tr:last-child td { border-bottom: 0; }
.kb-table th { background: #f8fafc; font-weight: 600; }

/* ---------- dark overrides for article content ---------- */
.theme-dark .kb-h2, .theme-dark .kb-h3 { color: #f8fafc; }
.theme-dark .kb-h4 { color: #cbd5e1; }
.theme-dark .kb-p, .theme-dark .kb-ul, .theme-dark .kb-ol { color: #c8d2e1; }
.theme-dark .kb-ul li::marker { color: var(--teal); }
.theme-dark .kb-ol li::marker { color: var(--teal); font-weight: 700; }
.theme-dark strong { color: #fff; }
.theme-dark .kb-link { color: var(--teal); }
.theme-dark .kb-code { background: rgba(255,255,255,.06); border-color: var(--line-2); color: #99f6e4; }
.theme-dark .kb-kbd { background: rgba(255,255,255,.06); border-color: rgba(255,255,255,.18); color: #f1f5f9; box-shadow: 0 2px 0 rgba(255,255,255,.06); }
.theme-dark .kb-tip { background: linear-gradient(90deg, rgba(45,212,191,.1), rgba(167,139,250,.06)); border-color: rgba(45,212,191,.25); color: #d5f5ef; }
.theme-dark .kb-tip i { color: var(--teal); }
.theme-dark .kb-table { border-color: var(--line-2); }
.theme-dark .kb-table th, .theme-dark .kb-table td { border-color: var(--line); color: #cbd5e1; }
.theme-dark .kb-table th { background: rgba(255,255,255,.05); color: #f1f5f9; }
.theme-dark .kb-table tr:hover td { background: rgba(45,212,191,.04); }

/* ---------- light theme (admin) touches ---------- */
.theme-light .kb-topbar { background: rgba(5, 8, 15, .92); }
.theme-light .kb-cmd-trigger { color: #94a3b8; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  html.js .kb-reveal, .kb-reveal, .kb-steps li, .kb-points li { opacity: 1; transform: none; }
}

#kb-body > :first-child { margin-top: 0; }

/* =====================================================================
   Mobile & tablet
   ===================================================================== */
html { -webkit-text-size-adjust: 100%; }
body { overflow-x: hidden; }
body.kb-noscroll { overflow: hidden; }
img, table { max-width: 100%; }

.kb-icon-btn { width: 42px; height: 42px; border-radius: 12px; display: inline-grid; place-items: center; color: #cbd5e1; background: rgba(255,255,255,.05); border: 1px solid var(--line); font-size: 16px; transition: .15s; }
.kb-icon-btn:hover, .kb-icon-btn:active { color: #fff; border-color: rgba(45,212,191,.5); }
.theme-light .kb-sheet-panel { color: #e2e8f0; }

/* Bottom tab bar */
.kb-tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 45; display: grid; grid-template-columns: repeat(5, 1fr);
  padding: 6px 8px calc(6px + env(safe-area-inset-bottom)); background: rgba(5, 8, 15, .88);
  backdrop-filter: blur(16px) saturate(140%); -webkit-backdrop-filter: blur(16px) saturate(140%); border-top: 1px solid var(--line); }
.kb-tab { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-height: 52px; border-radius: 12px; font-size: 10.5px; font-weight: 500; color: #8b97ad; -webkit-tap-highlight-color: transparent; }
.kb-tab i { font-size: 17px; }
.kb-tab.is-active { color: #fff; }
.kb-tab.is-active i { color: var(--teal); filter: drop-shadow(0 0 8px rgba(45,212,191,.6)); }
.kb-tab-ask { color: #fff; }
.kb-tab-orb { width: 46px; height: 46px; margin-top: -22px; border-radius: 50%; display: grid; place-items: center; background: var(--grad); background-size: 200% 200%; animation: kb-shift 6s ease infinite;
  box-shadow: 0 8px 24px -6px rgba(45,212,191,.7), 0 0 0 4px #05080f; color: #04121a; }
.kb-tab-orb i { font-size: 18px; }
@media (max-width: 1023px) {
  body { padding-bottom: calc(72px + env(safe-area-inset-bottom)); }
  .kb-footer { margin-top: 1.5rem; }
}

/* Menu sheet */
.kb-sheet { position: fixed; inset: 0; z-index: 70; }
.kb-sheet.hidden { display: none; }
.kb-sheet-backdrop { position: absolute; inset: 0; background: rgba(2, 6, 14, .7); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
.kb-sheet-panel { position: absolute; left: 0; right: 0; bottom: 0; max-height: 85vh; overflow-y: auto; padding: 10px 16px calc(18px + env(safe-area-inset-bottom));
  border-radius: 22px 22px 0 0; background: #0b1220; border-top: 1px solid var(--line-2); box-shadow: 0 -30px 80px -20px rgba(34,211,238,.3); animation: kb-up .22s ease; }
@keyframes kb-up { from { transform: translateY(40px); opacity: 0; } }
.kb-sheet-grip { width: 42px; height: 4px; border-radius: 99px; background: rgba(255,255,255,.18); margin: 2px auto 12px; }
.kb-sheet-link { display: flex; align-items: center; gap: .7rem; padding: .8rem .85rem; border-radius: 14px; background: rgba(255,255,255,.04); border: 1px solid var(--line); min-width: 0; }
.kb-sheet-link i { width: 20px; text-align: center; color: var(--teal); }
.kb-sheet-link.is-active { border-color: rgba(45,212,191,.5); background: rgba(45,212,191,.1); }

/* Horizontal chip rows that scroll instead of wrapping */
.kb-scroll-x { display: flex; flex-wrap: nowrap !important; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; gap: .5rem; padding-bottom: 2px; }
.kb-scroll-x::-webkit-scrollbar { display: none; }
.kb-scroll-x > * { flex: 0 0 auto; }

@media (max-width: 639px) {
  /* 16px inputs stop iOS from zooming in */
  input, select, textarea, .tool-i { font-size: 16px !important; }
  .kb-search input { padding: 1rem 4rem 1rem 3rem; font-size: 16px; }
  .kb-search .kb-search-ico { left: 1.05rem; }
  .kb-search button[type=submit] { padding: .7rem .85rem; }
  .kb-card { border-radius: 16px; }
  .kb-answer-body { padding: 1.1rem; font-size: .97rem; }
  .kb-answer-head { padding: .85rem 1.1rem; }
  .kb-answer-lead { font-size: 1rem; }
  .kb-steps li { padding: .65rem .75rem .65rem 2.7rem; }
  .kb-steps li::before { left: .65rem; }
  .kb-orb { width: 68px; height: 68px; }
  .kb-orb i { font-size: 22px; }
  .kb-table { font-size: .85rem; }
  .kb-table th, .kb-table td { padding: .5rem .6rem; }
  .kb-pre { font-size: .8rem; }
  .kb-toc a { padding: .5rem .75rem; }
  .kb-chip { padding: .5rem .85rem; }          /* bigger touch targets */
  .kb-source { padding: .45rem .75rem; }
  /* Command palette becomes a full-height sheet */
  .kb-cmd { padding: 0; align-items: stretch; }
  .kb-cmd-panel { max-width: none; border-radius: 0; height: 100%; display: flex; flex-direction: column; padding-top: env(safe-area-inset-top); }
  .kb-cmd-list { max-height: none; flex: 1; }
  .kb-cmd-item { padding: .8rem .7rem; }
  html.js .kb-reveal { transition-duration: .35s; }
}
@media (hover: none) {
  a.kb-card:hover, .kb-card.is-hover:hover { transform: none; }
}
@media (max-width: 639px) {
  .kb-scroll-mobile { flex-wrap: nowrap !important; justify-content: flex-start !important; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none;
    margin-left: -1rem; margin-right: -1rem; padding: 0 1rem 4px; mask-image: linear-gradient(90deg, transparent 0, #000 16px, #000 calc(100% - 24px), transparent 100%); -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 16px, #000 calc(100% - 24px), transparent 100%); }
  .kb-scroll-mobile::-webkit-scrollbar { display: none; }
  .kb-scroll-mobile > * { flex: 0 0 auto; }
  .kb-scroll-mobile .w-px { display: none; }
}
@media (max-width: 639px) { .kb-cmd-foot, .kb-cmd-input .kb-kbd { display: none !important; } }
@media (min-width: 640px) { .kb-cmd-input .kb-icon-btn { display: none; } }

/* ---------- v5: learning paths, topic pages, library ---------- */
.kb-path { overflow: hidden; }
.kb-path::after { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 3px; background: var(--g); opacity: .9; }
.kb-path::before { content: ""; position: absolute; width: 260px; height: 260px; right: -90px; top: -120px; border-radius: 50%; background: var(--g); opacity: .10; filter: blur(40px); pointer-events: none; }
.kb-path-count { display: flex; flex-direction: column; align-items: flex-end; font-weight: 800; font-size: 1.5rem; line-height: 1; color: #fff; }
.kb-path-count small { font-size: .62rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-top: .3rem; }
.kb-path-link { display: flex; align-items: center; gap: .6rem; min-width: 0; padding: .65rem .8rem; border-radius: 12px; font-size: .88rem; color: #dbe4f0; background: rgba(255,255,255,.03); border: 1px solid var(--line); transition: .15s; }
.kb-path-link > i:first-child { width: 1rem; text-align: center; color: #99f6e4; font-size: .8rem; }
.kb-path-link:hover { background: rgba(255,255,255,.07); border-color: var(--line-2); color: #fff; }
.kb-step-no { flex-shrink: 0; width: 46px; height: 46px; border-radius: 13px; display: grid; place-items: center; font-family: 'JetBrains Mono', monospace; font-weight: 700; font-size: .95rem; color: #fff;
  background: linear-gradient(rgba(10,15,26,.9), rgba(10,15,26,.9)) padding-box, var(--grad) border-box; border: 1.5px solid transparent; }
.kb-topic-head { overflow: hidden; }
.kb-topic-head::before { content: ""; position: absolute; inset: 0; background: var(--g); opacity: .08; pointer-events: none; border-radius: inherit; }
.kb-chip.is-on { color: #04121a; background: var(--grad); border-color: transparent; font-weight: 600; }
.kb-footer { border-top: 1px solid var(--line); background: linear-gradient(180deg, rgba(255,255,255,.015), rgba(255,255,255,.035)); }
.kb-lib-nav { position: sticky; top: 64px; z-index: 20; background: rgba(5, 8, 15, .82); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); }
.kb-lib-item { display: flex; gap: .75rem; align-items: flex-start; padding: .7rem .6rem; margin: 0 -.6rem; border-radius: 10px; transition: .15s; }
.kb-lib-item:hover { background: rgba(255,255,255,.05); }
.kb-lib-item .n { font-family: 'JetBrains Mono', monospace; font-size: .72rem; color: var(--muted); padding-top: .15rem; width: 1.4rem; flex-shrink: 0; }
.kb-pn { display: flex; flex-direction: column; gap: .2rem; padding: 1rem 1.2rem; min-width: 0; }
.kb-pn small { font-size: .7rem; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); }
[id] { scroll-margin-top: 130px; }
@media (max-width: 1023px) { .kb-lib-nav { top: 64px; } }
@media (min-width: 1024px) { .kb-tabbar, #kb-menu { display: none !important; } }
.out-box { border-radius: 12px; padding: .7rem .9rem; background: rgba(255,255,255,.04); border: 1px solid var(--line); }

/* PWA install buttons stay hidden until the browser can install */
[data-pwa-install][hidden]{display:none!important}


/* ---------- v10 fixes ---------- */
/* Legal information banner on notice / dispute / recovery guides */
.kb-legal-note { display: flex; gap: .75rem; align-items: flex-start; padding: .9rem 1.1rem; border-radius: 14px;
  border: 1px solid rgba(183,121,31,.35); background: rgba(183,121,31,.08); font-size: .9rem; line-height: 1.55; }
.kb-legal-note i { color: #B7791F; margin-top: .25rem; flex-shrink: 0; }
.kb-legal-note p { margin: 0; }
/* Topic chips inside learning-path cards: wrap long names instead of cutting them off */
.kb-path-chip-name { white-space: normal; overflow-wrap: anywhere; line-height: 1.3; }
/* Section headings on the home page (Popular guides, AI Audit, Tools & quick reference) */
.kb-section-title { font-size: 1.25rem; line-height: 1.3; letter-spacing: -.01em; margin-bottom: 1rem; display: flex; align-items: center; gap: .5rem; }
@media (min-width: 640px) { .kb-section-title { font-size: 1.4rem; } }
/* Learning library: cards keep their own height instead of stretching to the tallest neighbour */
.kb-grid-start { align-items: start; }
/* Keyboard focus that is visible on every theme */
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible {
  outline: 2px solid var(--accent, #14b8a6); outline-offset: 2px; }
