  :root { --ink:#0f172a; --muted:#64748b; --line:#334155; --accent:#1d4ed8; --accent-soft:color-mix(in srgb, var(--accent) 10%, #fff); --accent-ring:color-mix(in srgb, var(--accent) 40%, #fff); }
  * { box-sizing: border-box; }
  body { margin:0; font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,Arial,sans-serif; color:#1e293b; background:#eef2f7; }
  h2,h3,h4,p,ul { margin:0; padding:0; }
  ul { list-style:none; }
  button, select { font-family:inherit; cursor:pointer; }
  #app { display:flex; flex-direction:column; height:100vh; height:100dvh; background:#f8fafc; }
  #app.cards-view { height:auto; min-height:100vh; }
  #app.cards-view main { flex:none; }
  #app.cards-view #list-view { position:static; overflow:visible; }
  #app.cards-view .about-cue { position:fixed; }
  .about-cue.hidden { display:none; }
  /* Expand/Collapse/Reset view only act on the tree */
  #app.cards-view .toolbar-left .btn, #app.cards-view .zoom-hint { display:none; }
  .jump-wrap { display:none; }

  header { background:#fff; border-bottom:1px solid #e2e8f0; display:flex; flex-direction:column; z-index:20; }
  .row { display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:8px; }
  /* search leads the toolbar; the tree-only buttons sit at the far right */
  .search-group { flex:1 1 180px; max-width:270px; min-width:150px; order:-3; }
  .seg { order:-2; }
  .group-wrap { order:-2; display:inline-flex; align-items:center; gap:5px; }
  .group-wrap .seg { order:0; }
  .sort-wrap { order:-1; display:inline-flex; align-items:center; gap:5px; }
  .sort-label { font-size:12.5px; font-weight:700; color:#475569; white-space:nowrap; }
  #sort-by { height:32px; padding:0 8px; border:1px solid #cbd5e1; border-radius:8px; background:#fff; color:#1e293b; font-size:12.5px; font-weight:700; outline:none; }
  #sort-by:hover { border-color:#94a3b8; }
  #sort-by:focus-visible { border-color:var(--accent-ring); box-shadow:0 0 0 3px var(--accent-soft); }
  .toolbar-left { margin-left:auto; }
  .toolbar-hint { margin-left:8px; padding-left:10px; border-left:1px solid #cbd5e1; color:var(--muted); font-size:13px; white-space:nowrap; }
  .toolbar-hint kbd { font:600 11px/1 inherit; font-family:inherit; padding:2px 6px; border:1px solid #cbd5e1; border-bottom-width:2px; border-radius:4px; background:#f8fafc; color:#475569; }
  .search { position:relative; width:100%; }
  .search svg { position:absolute; left:10px; top:50%; transform:translateY(-50%); width:16px; height:16px; color:#94a3b8; }
  .search input { width:100%; height:36px; border:1px solid #cbd5e1; border-radius:8px; background:#f8fafc; padding:0 34px; font-size:14px; outline:none; color:#1e293b; transition:border-color .15s,box-shadow .15s,background .15s; }
  .search input:hover { border-color:#94a3b8; background:#fff; }
  .search input:focus { border-color:var(--accent-ring); background:#fff; box-shadow:0 0 0 3px var(--accent-soft); }
  #clear-search { position:absolute; right:7px; top:50%; transform:translateY(-50%); border:0; background:none; color:#94a3b8; font-size:16px; display:none; }
  #clear-search:hover { color:#334155; }
  .search-kbd { position:absolute; right:10px; top:50%; transform:translateY(-50%); font-size:11px; font-weight:600; line-height:1; padding:3px 7px; border:1px solid #cbd5e1; border-bottom-width:2px; border-radius:4px; background:#fff; color:#64748b; pointer-events:none; }
  .search input:focus ~ .search-kbd, .search input:not(:placeholder-shown) ~ .search-kbd { display:none; }
  #clear-search:focus-visible { outline:2px solid var(--accent-ring); outline-offset:1px; border-radius:4px; }
  .btn { background:#fff; border:1px solid #cbd5e1; color:#475569; padding:6px 10px; border-radius:7px; font-size:12.5px; font-weight:700; white-space:nowrap; }
  .btn-icon { vertical-align:-2px; margin-right:5px; }
  .btn:hover { background:#f1f5f9; }
  .btn.primary { color:var(--accent); border-color:var(--accent-ring); }
  .btn.primary:hover { background:var(--accent-soft); }
  .toolbar-row { padding:8px 20px 6px; }
  .toolbar-left { display:flex; flex-wrap:nowrap; gap:6px; align-items:center; }
  .seg { display:flex; background:#e2e8f0; border:1px solid #cbd5e1; border-radius:8px; padding:2px; gap:2px; }
  .seg button { border:0; background:transparent; color:#475569; padding:5px 10px; border-radius:6px; font-size:12.5px; font-weight:600; white-space:nowrap; }
  .seg button.active { background:#fff; color:var(--accent); font-weight:700; box-shadow:0 2px 4px rgba(0,0,0,.08); }

  .filter-toggle, .group-select { display:none; }
  .filter-badge { display:inline-flex; align-items:center; justify-content:center; min-width:17px; height:17px; padding:0 5px; border-radius:999px; background:var(--accent); color:#fff; font-size:11px; font-weight:700; }
  .filter-badge[hidden] { display:none; }
  /* Filter bar row */
  .filter-bar { display:flex; flex-wrap:wrap; align-items:center; gap:6px 10px; padding:4px 20px 8px; border-top:1px solid #f1f5f9; background:#fcfcfd; }
  .filter-group { display:flex; flex-wrap:wrap; align-items:center; gap:5px; }
  .filter-label { font-size:12px; font-weight:700; color:#475569; margin-right:1px; white-space:nowrap; }
  .filter-sep { width:1px; height:18px; background:#cbd5e1; }
  .f-chip { display:inline-flex; align-items:center; gap:5px; height:28px; padding:0 9px; border:1px solid #cbd5e1; border-radius:999px; background:#fff; color:#334155; font-size:12px; font-weight:600; white-space:nowrap; transition:background .15s, border-color .15s, color .15s, box-shadow .15s; }
  .f-chip[hidden] { display:none; }
  .f-chip:hover { background:#f1f5f9; border-color:#94a3b8; }
  .f-chip:focus-visible { outline:2px solid var(--accent-ring); outline-offset:2px; }
  .f-chip[aria-pressed="true"] { background:#1d4ed8; border-color:#1e40af; color:#fff; font-weight:700; box-shadow:0 0 0 3px rgba(37,99,235,.22); }
  .f-chip[aria-pressed="true"]::before { content:"✓"; font-weight:800; font-size:11px; }
  .f-chip[aria-pressed="true"] .f-cnt { color:rgba(255,255,255,.88); }
  .f-chip[aria-pressed="true"] .f-dot { box-shadow:0 0 0 1.5px #fff; }
  .f-dot { width:8px; height:8px; border-radius:50%; flex:none; }
  .f-dot.plat-cloud { background:#0284c7; }
  .f-dot.plat-desktop { background:#0d9488; }
  .f-dot.type-module { background:#2563eb; }
  .f-dot.type-learningPath { background:#9333ea; }
  .f-cnt { font-size:11px; font-weight:600; color:#64748b; }
  .f-chip.f-reset { border-color:#bfdbfe; background:#eff6ff; color:#1e40af; border-radius:7px; font-weight:700; }
  .f-chip.f-reset:hover { background:#dbeafe; }
  #status { margin-left:auto; font-size:12px; font-weight:700; color:var(--muted); white-space:nowrap; }

  html { scroll-behavior:smooth; }
  main { position:relative; flex:1; min-height:0; }
  .about-cue { position:absolute; left:50%; bottom:12px; transform:translateX(-50%); z-index:25; padding:6px 14px; border:1px solid var(--accent-ring); border-radius:999px; background:rgba(255,255,255,.92); color:var(--accent); font-size:12.5px; font-weight:700; text-decoration:none; box-shadow:0 4px 10px rgba(15,23,42,.12); }
  .about-cue:hover { background:var(--accent-soft); }
  .about-cue:focus-visible { outline:3px solid var(--accent-ring); outline-offset:2px; }
  .sr-only { position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip:rect(0,0,0,0); white-space:nowrap; border:0; }
  .seo-content { padding:48px 24px; background:#fff; border-top:1px solid #e2e8f0; }
  .seo-inner { max-width:900px; margin:0 auto; }
  .seo-content h2 { margin-bottom:12px; color:var(--ink); font-size:26px; font-weight:800; }
  .seo-content h3 { margin:28px 0 10px; color:var(--ink); font-size:19px; font-weight:700; }
  .seo-content p { margin:0 0 12px; color:#475569; font-size:15px; line-height:1.7; }
  .seo-content code { color:var(--accent); background:var(--accent-soft); padding:2px 5px; border-radius:4px; }
  .seo-browse, .seo-faq details { border:1px solid #e2e8f0; border-radius:8px; margin:10px 0; }
  .seo-browse { border-color:#bfdbfe; background:#eff6ff; }
  .seo-browse summary, .seo-faq summary { padding:12px 16px; color:var(--ink); font-weight:700; cursor:pointer; }
  .seo-browse[open] { padding:0; background:#eff6ff; }
  .seo-browse[open] summary { border-bottom:1px solid #bfdbfe; background:#eff6ff; }
  .seo-browse-content { padding:1px 16px 16px; border-radius:0 0 7px 7px; background:#fff; }
  .seo-browse h3 { margin:20px 0 6px; font-size:16px; }
  .seo-browse p { margin-bottom:8px; font-size:14px; }
  .seo-browse ul { padding-left:20px; list-style:disc; }
  .seo-browse li { margin:6px 0; color:#475569; font-size:14px; line-height:1.6; }
  .seo-meta { color:#64748b; font-size:12.5px; }
  .seo-browse a, .seo-more-tools a { color:var(--accent); text-decoration:underline; text-underline-offset:3px; }
  .seo-faq details { border-color:#bfdbfe; background:#eff6ff; }
  .seo-faq summary { background:#eff6ff; }
  .seo-faq details[open] { background:#eff6ff; }
  .seo-faq details[open] summary { border-bottom:1px solid #bfdbfe; }
  .seo-faq-content { padding:1px 16px 14px; border-radius:0 0 7px 7px; background:#fff; }
  .seo-faq details p { margin:0; }
  .seo-more-tools { margin-top:28px !important; }

  #tree-view, #list-view { position:absolute; inset:0; }
  #tree-view { overflow:auto; cursor:grab; user-select:none; background-image:radial-gradient(#cbd5e1 1.2px, transparent 1.2px); background-size:24px 24px; }
  #tree-view { scrollbar-width:none; }
  #tree-view::-webkit-scrollbar { display:none; }
  #tree-view.dragging { cursor:grabbing; }
  #sizer { position:relative; }
  #canvas { position:absolute; left:0; top:0; transform-origin:0 0; padding:60px; width:max-content; }
  #connections { position:absolute; left:0; top:0; pointer-events:none; overflow:visible; }
  .connector { fill:none; stroke:#94a3b8; stroke-width:3; stroke-linejoin:round; }
  .connector.branch { stroke-opacity:.7; }
  #nodes { position:relative; display:flex; align-items:center; gap:90px; }
  .cats { display:flex; flex-direction:column; gap:48px; }
  .cat-row, .sub-row { display:flex; align-items:center; gap:90px; }
  .children { display:flex; flex-direction:column; gap:12px; }
  .children:has(> .cat-row, > .sub-row) { gap:48px; }
  #nodes:has(.sub-lvl.open) .children[id$=":learningPath"] { margin-left:310px; }
  #nodes:has(.sub-topic.open) .children[id$=":learningPath"] { margin-left:430px; }
  #nodes:has(.sub-lvl.open):has(.sub-topic.open) .children[id$=":learningPath"] { margin-left:740px; }

  .node { background:#fff; border:2px solid #cbd5e1; border-radius:14px; }
  .root { display:flex; align-items:center; gap:16px; padding:20px 24px; width:396px; background:linear-gradient(135deg,#2563eb,#1e3a8a); border-color:#1e40af; cursor:pointer; position:relative; transition:box-shadow .2s, transform .2s; }
  .root h2, .root p { color:#fff; }
  .root h2 { font-size:20px; font-weight:800; }
  .root p { font-size:13px; opacity:.92; }
  .root .badge { background:rgba(255,255,255,.2); border:1.5px solid rgba(255,255,255,.6); }
  .root-chev { display:flex; align-items:center; justify-content:center; flex:none; width:32px; height:32px; margin-left:auto; border-radius:8px; background:rgba(255,255,255,.18); color:#fff; }
  .root-chev svg { width:18px; height:18px; transition:transform .2s; }
  .root.open .root-chev svg { transform:rotate(180deg); }
  .root:focus-visible { outline:3px solid #93c5fd; outline-offset:3px; }
  .root:hover { box-shadow:0 8px 20px -6px rgba(29,78,216,.5); transform:translateY(-1px); }
  .root:hover .root-chev { background:rgba(255,255,255,.28); }
  .badge { width:50px; height:50px; border-radius:12px; flex-shrink:0; display:flex; align-items:center; justify-content:center; color:#fff; font-weight:800; font-size:22px; }
  .cat { display:flex; align-items:center; gap:14px; width:410px; padding:10px 14px; cursor:pointer; position:relative; transition:box-shadow .2s, transform .2s, background-color .2s; }
  .cat:hover { background:color-mix(in srgb, var(--c) 7%, #fff); box-shadow:0 0 0 2px var(--c), 0 8px 20px -6px rgba(0,0,0,.2); transform:translateY(-1px); z-index:5; }
  .cat .txt { flex:1; min-width:0; }
  .cat h3 { font-size:17px; font-weight:700; color:var(--ink); }
  .cat p { display:none; }
  .cat .badge { width:40px; height:40px; border-radius:10px; font-size:18px; }
  .count { display:flex; align-items:center; gap:6px; background:#f8fafc; border:1px solid #e2e8f0; border-radius:8px; padding:8px 10px; font-weight:700; color:#475569; }
  .count svg { width:14px; height:14px; transition:transform .2s; }
  .cat.open .count svg, .sub.open .count svg { transform:rotate(180deg); }
  .sub { display:flex; align-items:center; gap:12px; width:270px; padding:9px 13px; cursor:pointer; position:relative; transition:box-shadow .2s, transform .2s, background-color .2s; }
  .sub.sub-lvl { width:220px; }
  .sub.sub-topic { width:340px; }
  .sub:hover { background:color-mix(in srgb, var(--c) 7%, #fff); box-shadow:0 0 0 2px var(--c), 0 8px 20px -6px rgba(0,0,0,.2); transform:translateY(-1px); z-index:5; }
  .sub .txt { flex:1; min-width:0; }
  .sub h4 { font-size:15.5px; font-weight:700; color:var(--ink); }
  .sub .badge { width:34px; height:34px; border-radius:9px; font-size:14px; }
  .sub .count { padding:6px 9px; font-size:13px; }

  /* Course cards (.node.fn) in Tree and Cards view */
  .fn { display:flex; align-items:center; justify-content:space-between; gap:12px; width:480px; min-height:84px; padding:12px 14px 12px 18px; cursor:pointer; border-radius:12px; border-width:1px; position:relative; overflow:hidden; text-align:left; transition:box-shadow .2s, transform .2s, background-color .2s, border-color .2s; animation:scaleIn .3s cubic-bezier(.175,.885,.32,1.275) both; }
  .fn::before { content:""; position:absolute; left:0; top:0; bottom:0; width:6px; background:var(--c); }
  .fn:hover { background:color-mix(in srgb, var(--c) 7%, #fff); border-color:color-mix(in srgb, var(--c) 60%, #cbd5e1); box-shadow:0 8px 20px -6px rgba(0,0,0,.2); transform:translateX(3px); }
  .fn:hover .fn-side > svg { color:var(--c); }
  .fn .txt { flex:1; min-width:0; display:flex; flex-direction:column; gap:4px; }
  .fn-kicker { display:flex; align-items:center; gap:10px; font-size:11px; font-weight:800; letter-spacing:.08em; text-transform:uppercase; color:#64748b; }
  .fn-type.is-lp { color:#1d4ed8; }
  .fn-type.is-mod { color:#475569; }
  .fn-dur { display:inline-flex; align-items:center; gap:4px; font-weight:600; letter-spacing:0; text-transform:none; color:#64748b; }
  .ico-clock { width:13px; height:13px; flex:none; }
  .fn h4 { font-size:15.5px; font-weight:700; line-height:1.3; color:#005fb8; }
  .fn:hover h4 { color:#004578; text-decoration:underline; text-underline-offset:2px; }
  .fn p { font-size:12.5px; color:#334155; line-height:1.38; display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; }
  .fn-meta { display:flex; flex-wrap:wrap; align-items:center; gap:5px; margin-top:3px; }
  .meta-pill { display:inline-flex; align-items:center; gap:4px; padding:2px 7px; border-radius:999px; font-size:11px; font-weight:700; line-height:1.35; }
  .meta-pill.plat-cloud { background:#e0f2fe; color:#0369a1; border:1px solid #bae6fd; }
  .meta-pill.plat-desktop { background:#ccfbf1; color:#0f766e; border:1px solid #99f6e4; }
  .meta-pill.lvl-beginner { background:#ecfdf5; color:#047857; border:1px solid #a7f3d0; }
  .meta-pill.lvl-intermediate { background:#fffbeb; color:#b45309; border:1px solid #fde68a; }
  .meta-pill.lvl-advanced { background:#f5f3ff; color:#6d28d9; border:1px solid #ddd6fe; }
  .meta-pill.meta-neutral { background:#f1f5f9; color:#475569; border:1px solid #e2e8f0; }
  .fn-roles { font-size:11.5px; color:#64748b; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; max-width:220px; }
  .fn-side { display:flex; align-items:center; gap:8px; flex:none; }
  .fn-badge-wrap { width:44px; height:44px; border-radius:50%; background:#f8fafc; border:1.5px solid #cbd5e1; display:flex; align-items:center; justify-content:center; overflow:hidden; flex:none; padding:4px; }
  .course-ico { width:100%; height:100%; object-fit:contain; display:block; }
  .course-badge-fallback { font-size:13px; font-weight:800; color:#1d4ed8; }
  .fn-side > svg { width:18px; height:18px; color:#94a3b8; flex-shrink:0; }
  .fn.hit { box-shadow:0 0 0 2px #93c5fd; }
  .fn.current { background:color-mix(in srgb, var(--c) 7%, #fff); box-shadow:0 0 0 2px var(--c); }
  .fn.spot { box-shadow:0 0 0 4px #2563eb, 0 8px 24px -6px rgba(37,99,235,.55); }
  mark { background:#dbeafe; color:inherit; border-radius:3px; }
  @keyframes scaleIn { from { transform:scale(.92); opacity:0; } to { transform:scale(1); opacity:1; } }
  .tip { position:absolute; left:50%; top:100%; transform:translateX(-50%); margin-top:8px; background:#1e3a8a; color:#fff; padding:8px 14px; border-radius:8px; font-size:13px; font-weight:600; white-space:nowrap; opacity:0; visibility:hidden; transition:opacity .2s; pointer-events:none; z-index:50; }
  .cat:hover .tip, .sub:hover .tip, .root:hover .tip { opacity:1; visibility:visible; transition-delay:.3s; }

  #controls { position:absolute; top:20px; right:24px; z-index:30; display:flex; flex-direction:column; gap:4px; background:#fff; padding:6px; border-radius:8px; border:1px solid #cbd5e1; box-shadow:0 10px 15px -3px rgba(0,0,0,.1); }
  #controls button { border:0; background:#fff; width:36px; height:36px; border-radius:6px; font-size:20px; font-weight:700; color:#475569; }
  #controls button:hover { background:#f1f5f9; color:var(--ink); }
  #controls #zoom-level { text-align:center; font-size:12px; font-weight:700; color:#475569; padding:4px 0; }
  #controls button:focus-visible { outline:3px solid var(--accent-ring); outline-offset:1px; }
  #controls hr { border:0; border-top:1px solid #e2e8f0; width:100%; margin:2px 0; }

  #list-view { display:none; overflow-y:auto; padding:32px; }
  .list-cat { max-width:1300px; margin:0 auto 36px; }
  .list-cat > header { all:unset; display:flex; align-items:center; gap:14px; margin-bottom:16px; }
  .list-cat h3 { font-size:20px; font-weight:800; color:var(--ink); }
  .list-cat .d { font-size:14px; color:var(--muted); }
  .grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(360px,1fr)); gap:16px; }
  .grid .fn { width:auto; align-items:flex-start; }
  .empty { text-align:center; color:var(--muted); padding:48px 24px; margin:40px auto; max-width:560px; font-size:16px; border:2px dashed #cbd5e1; border-radius:20px; background:rgba(255,255,255,.55); }
  .empty-ico { width:56px; height:56px; color:#64748b; margin:0 auto 14px; display:block; }
  .empty p { font-weight:700; font-size:20px; color:var(--ink); margin:0; }
  .suggestions { margin-top:10px; }
  .suggestions button { border:0; padding:0; background:none; color:var(--accent); font:inherit; font-weight:700; text-decoration:underline; cursor:pointer; }

  #drawer { position:fixed; inset:0; z-index:100; display:none; }
  html:has(#drawer.show) { overflow:hidden; }
  #backdrop { position:absolute; inset:0; background:rgba(15,23,42,.55); opacity:0; transition:opacity .3s; }
  #panel { position:absolute; top:0; bottom:0; right:0; width:100%; max-width:560px; background:#fff; box-shadow:-10px 0 25px -5px rgba(0,0,0,.15); transform:translateX(100%); transition:transform .3s cubic-bezier(.16,1,.3,1); display:flex; flex-direction:column; }
  #drawer.show #backdrop { opacity:1; }
  #drawer.show #panel { transform:none; }
  #panel .body { flex:1; overflow-y:auto; padding:40px; position:relative; }
  #close { position:absolute; top:20px; right:20px; width:40px; height:40px; border:0; border-radius:50%; background:#f1f5f9; color:#64748b; font-size:20px; }
  #share { position:absolute; top:20px; right:72px; width:40px; height:40px; border:0; border-radius:50%; background:transparent; color:#64748b; display:flex; align-items:center; justify-content:center; cursor:pointer; }
  #share:hover { background:#f1f5f9; color:#334155; }
  #share:focus-visible { outline:3px solid var(--accent-ring); outline-offset:2px; }
  #share::after { content:attr(data-tip); position:absolute; top:46px; right:0; white-space:nowrap; background:#0f172a; color:#fff; font-size:12px; font-weight:600; padding:6px 10px; border-radius:6px; opacity:0; pointer-events:none; transition:opacity .15s; z-index:5; }
  #share:hover::after, #share:focus-visible::after { opacity:1; }
  #link-toast { position:absolute; bottom:92px; right:calc(min(100vw, 560px) / 2); transform:translate(50%,12px); max-width:calc(100vw - 40px); font-size:14px; font-weight:700; color:#fff; background:#047857; border-radius:999px; padding:10px 18px; box-shadow:0 8px 20px rgba(0,0,0,.25); opacity:0; pointer-events:none; transition:opacity .2s, transform .2s; z-index:10; }
  #link-toast.show { opacity:1; transform:translate(50%,0); }
  #link-toast.err { background:#b91c1c; }
  #share .ico-done { display:none; }
  #share.done { background:#d1fae5; color:#047857; }
  #share.done .ico-share { display:none; }
  #share.done .ico-done { display:inline; }
  #share.done::after { opacity:0; }

  .d-head { display:flex; gap:14px; align-items:flex-start; margin-bottom:18px; }
  .d-ico { width:56px; height:56px; border-radius:14px; flex-shrink:0; display:flex; align-items:center; justify-content:center; color:#fff; font-weight:800; font-size:20px; padding:8px; overflow:hidden; }
  .d-ico .course-badge-fallback { color:#fff; font-size:18px; }
  .d-title { flex:1; min-width:0; }
  .d-chips { display:flex; flex-wrap:wrap; gap:6px; max-width:calc(100% - 100px); }
  .d-title h2 { overflow-wrap:anywhere; font-size:22px; font-weight:800; color:var(--ink); margin-top:8px; line-height:1.3; }
  .chip { display:inline-block; max-width:100%; background:#f1f5f9; border:1px solid #e2e8f0; border-radius:999px; padding:4px 11px; font-size:11px; font-weight:800; letter-spacing:.05em; color:#475569; text-transform:uppercase; }
  .chip.type-chip.is-lp { background:#eff6ff; border-color:#bfdbfe; color:#1d4ed8; }
  .chip.type-chip.is-mod { background:#eff6ff; border-color:#bfdbfe; color:#1d4ed8; }
  .d-badges { display:flex; flex-wrap:wrap; gap:6px; margin-bottom:22px; }
  .box { border-radius:12px; padding:18px 20px; margin-bottom:24px; border:1px solid #e2e8f0; border-left-width:5px; }
  .box .lbl { font-size:11px; font-weight:800; letter-spacing:.06em; text-transform:uppercase; margin-bottom:8px; }
  #drawer-content { --c-text:color-mix(in srgb, var(--c, var(--accent)) 55%, var(--ink)); }
  .obj { background:color-mix(in srgb, var(--c, var(--accent)) 10%, #fff); border-color:color-mix(in srgb, var(--c, var(--accent)) 35%, #fff); border-left-color:var(--c, var(--accent)); }
  .obj .lbl { color:var(--c-text); }
  .obj p { font-size:15.5px; font-weight:500; line-height:1.6; color:var(--ink); }
  .impl { margin-bottom:24px; }
  .impl h4 { color:var(--ink); font-size:16px; font-weight:700; margin-bottom:12px; }
  .impl li { display:flex; gap:12px; align-items:flex-start; border:1px solid #e2e8f0; border-radius:10px; padding:12px 16px; margin-bottom:8px; font-size:14px; color:#334155; }
  .impl li.k-info::before { content:""; flex-shrink:0; width:8px; height:8px; margin:6px 4px 0; border-radius:50%; background:var(--c, var(--accent)); }
  .learn-cta { display:inline-flex; align-items:center; justify-content:center; gap:8px; width:100%; padding:13px 18px; margin-bottom:10px; border-radius:10px; background:var(--accent); color:#fff; font-size:15px; font-weight:700; text-decoration:none; transition:background .15s; }
  .learn-cta:hover { background:#1e40af; }
  .learn-cta:focus-visible { outline:3px solid var(--accent-ring); outline-offset:2px; }
  .learn-link { display:inline-block; margin-top:4px; color:var(--c-text); font-size:12.5px; font-weight:500; text-decoration:none; }
  .learn-link:hover { text-decoration:underline; }
  .foot { background:#f8fafc; border-top:1px solid #e2e8f0; display:flex; align-items:center; justify-content:flex-end; padding:12px 24px; font-size:14px; }
  .foot-pager { display:flex; align-items:center; gap:10px; }
  .foot-title { min-width:72px; color:#475569; font-size:13px; font-weight:600; text-align:center; white-space:nowrap; }
  .drawer-nav { display:inline-flex; align-items:center; gap:6px; min-height:44px; padding:0 14px; border:1px solid #cbd5e1; border-radius:8px; background:#fff; color:#334155; font:inherit; font-weight:700; cursor:pointer; }
  .drawer-nav:hover:not(:disabled) { background:#f1f5f9; }
  .drawer-nav:disabled { border-color:#e2e8f0; background:#f8fafc; color:#94a3b8; cursor:not-allowed; }
  .drawer-nav:focus-visible, #close:focus-visible, .suggestions button:focus-visible { outline:3px solid var(--accent-ring); outline-offset:2px; }

  @media (max-width:1520px) {
    .zoom-hint { display:none; }
  }

  @media (min-width:701px) and (max-width:1180px) {
    .toolbar-row { padding:6px 16px; gap:6px; }
    .filter-bar { padding:4px 16px 8px; }
    .filter-sep, .sort-label { display:none; }
    .search-group { flex:1 1 150px; max-width:210px; min-width:130px; }
    .seg button { padding:5px 8px; font-size:12px; }
    .btn { padding:5px 8px; font-size:12px; }
    .btn-icon { margin-right:3px; }
  }

  @media (max-width:700px) {
    .toolbar-row { padding:6px 14px; gap:6px; }
    .filter-bar { display:none; padding:6px 14px 8px; gap:6px; }
    .filter-bar.open { display:flex; }
    .filter-sep, .sort-label, .plat-prefix { display:none; }
    .zoom-hint, .search-kbd { display:none; }
    .search-group { flex:1 1 0; max-width:none; min-width:0; order:-3; }
    .search input { height:32px; padding:0 28px 0 30px; font-size:13px; }
    .seg { order:-2; }
    .sort-wrap { order:-1; }
    #sort-by { height:32px; padding:0 6px; font-size:12px; }
    .filter-toggle { display:inline-flex; align-items:center; gap:4px; order:-1; height:32px; padding:0 9px; font-size:12px; }
    .filter-toggle[aria-expanded="true"] { border-color:var(--accent); color:var(--accent); background:var(--accent-soft); }
    .seg.group-seg { order:0; flex:1 0 100%; }
    .group-seg button { flex:1; }
    .toolbar-left { flex:1 0 100%; gap:6px; }
    .toolbar-left .btn { padding:6px 8px; font-size:12px; }
    .seg button { padding:5px 10px; font-size:12px; }
    #app.cards-view .toolbar-left { display:none; }
    #app.cards-view .group-seg { display:none; }
    #app.cards-view .group-select { display:block; flex:none; height:32px; padding:0 8px; border:1px solid #cbd5e1; border-radius:8px; background:#fff; color:var(--accent); font-size:12.5px; font-weight:700; }
    .dark #app.cards-view .group-select { border-color:#334155; background:#020617; color:#93c5fd; }

    #list-view { padding:14px; }
    .list-cat { margin-bottom:22px; }
    .list-cat > header { gap:10px; margin-bottom:10px; }
    .list-cat .badge { width:32px; height:32px; border-radius:8px; font-size:15px; }
    .list-cat h3 { font-size:16px; }
    .list-cat h3 + .d { display:none; }
    .grid { grid-template-columns:1fr; gap:10px; }
    .grid .fn { min-height:0; padding:10px 12px 10px 16px; }
    .grid .fn::before { width:4px; }
    .grid .fn h4 { font-size:15px; }
    .panel .body { padding:28px 20px; }
    .seo-content { padding:32px 16px; }
    .seo-content h2 { font-size:22px; }
    .foot { padding:10px 16px; }
    .foot-pager { flex:1; justify-content:space-between; gap:6px; }
    .foot-title { min-width:0; }
    .drawer-nav { padding:0 12px; }

    #app.cards-view > header { position:sticky; top:calc(-1 * var(--hero-h, 0px)); }
    #app.cards-view .jump-wrap { display:flex; align-items:center; gap:6px; padding:0 14px 8px; }
    .jump-track { display:flex; align-items:center; gap:6px; position:relative; flex:1; min-width:0; }
    .jump-wrap .seg.group-seg { flex:none; order:0; }
    .jump-bar { display:flex; flex:1; min-width:0; position:relative; gap:6px; overflow-x:auto; scrollbar-width:none; }
    .jump-wrap.can-next .jump-bar { -webkit-mask-image:linear-gradient(90deg,#000 calc(100% - 32px),transparent); mask-image:linear-gradient(90deg,#000 calc(100% - 32px),transparent); }
    .jump-wrap.can-prev .jump-bar { -webkit-mask-image:linear-gradient(90deg,transparent,#000 32px); mask-image:linear-gradient(90deg,transparent,#000 32px); }
    .jump-wrap.can-prev.can-next .jump-bar { -webkit-mask-image:linear-gradient(90deg,transparent,#000 32px,#000 calc(100% - 32px),transparent); mask-image:linear-gradient(90deg,transparent,#000 32px,#000 calc(100% - 32px),transparent); }
    .jump-bar::-webkit-scrollbar { display:none; }
    .jump-bar button { flex:none; min-width:36px; height:32px; padding:0 10px; border:1px solid #cbd5e1; border-radius:999px; background:#fff; font-size:13px; font-weight:600; color:#334155; }
    .jump-bar button[aria-current="true"] { background:var(--accent); border-color:var(--accent); color:#fff; }
    .jump-bar button:disabled { opacity:.35; cursor:default; }
    .jump-bar:has(.letter) { gap:2px; }
    .jump-bar button.letter { min-width:0; width:30px; height:30px; padding:0; border-color:transparent; border-radius:50%; background:none; }
    .jump-bar button.letter:not(:disabled):not([aria-current="true"]):hover { background:var(--accent-soft); }
    .jump-bar button.letter[aria-current="true"] { background:var(--accent); color:#fff; }
    .jump-arrow { display:none; flex:none; width:32px; height:32px; align-items:center; justify-content:center; padding:0 0 3px; border:1px solid #cbd5e1; border-radius:50%; background:#fff; box-shadow:0 2px 6px rgba(15,23,42,.15); font-size:22px; line-height:1; color:#334155; }
    .jump-arrow:hover { background:#f1f5f9; }
    .jump-arrow.prev { order:-1; }
    .jump-arrow.next { order:1; }
    .list-cat { scroll-margin-top:calc(var(--pinned-h, 0px) + 8px); }
  }

  @media (max-width:700px) and (hover:hover) and (pointer:fine) {
    .jump-wrap.can-prev .jump-arrow.prev, .jump-wrap.can-next .jump-arrow.next { display:flex; }
  }

  .back-to-top { position:fixed; right:24px; bottom:24px; z-index:30; width:48px; height:48px; border:1px solid var(--accent); border-radius:50%; background:#0f172a; color:#fff; box-shadow:0 4px 14px rgba(15,23,42,.25); font-size:25px; line-height:1; }
  .back-to-top:hover { background:var(--accent); }
  .back-to-top:focus-visible { outline:3px solid var(--accent-ring); outline-offset:3px; }
  @media (max-width:600px) {
    .back-to-top { right:16px; bottom:16px; width:44px; height:44px; }
  }

  @media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration:.01ms !important; animation-iteration-count:1 !important; scroll-behavior:auto !important; transition-duration:.01ms !important; }
  }

  .theme-switch { position:relative; flex:none; width:52px; height:32px; padding:0; border:1px solid #cbd5e1; border-radius:999px; background:#f1f5f9; }
  .theme-switch:hover { border-color:#94a3b8; }
  .theme-switch:focus-visible { outline:2px solid var(--fme-accent, #1d4ed8); outline-offset:2px; }
  .dark .theme-switch { border-color:#475569; background:#1e293b; }
  .dark .theme-switch:hover { border-color:#64748b; }
  .dark .theme-switch:focus-visible { outline-color:#60a5fa; }
  .theme-switch-knob { position:absolute; top:3px; left:3px; display:grid; width:24px; height:24px; place-items:center; border-radius:999px; background:#fff; box-shadow:0 1px 3px rgba(15,23,42,.25); color:#1d4ed8; transition:transform .15s ease; }
  .theme-switch-knob svg { width:14px; height:14px; }
  .theme-moon { display:none; }
  .dark .theme-switch-knob { transform:translateX(20px); background:#334155; color:#bfdbfe; }
  .dark .theme-sun { display:none; }
  .dark .theme-moon { display:block; }
  @media (max-width:700px) {
    .theme-switch { width:36px; height:36px; border-color:#e2e8f0; border-radius:8px; background:#fff; }
    .dark .theme-switch { border-color:#334155; background:#1e293b; }
    .theme-switch-knob, .dark .theme-switch-knob { top:5px; left:5px; transform:none; background:transparent; box-shadow:none; }
    .theme-switch-knob svg { width:16px; height:16px; }
  }

  /* Dark mode */
  .dark { color-scheme:dark; --ink:#f1f5f9; --muted:#94a3b8; --accent:#60a5fa; --accent-soft:color-mix(in srgb, #3b82f6 18%, #0f172a); --accent-ring:color-mix(in srgb, #3b82f6 60%, #0f172a); }
  .dark .fme-hdr { background:#0f172a; border-bottom-color:#3b82f6; color:#f8fafc; }
  .dark .fme-hdr h1 { color:#fff; }
  .dark .fme-hdr .fme-tagline, .dark .fme-hdr .fme-crumb, .dark .fme-hdr .fme-trust-text { color:#cbd5e1; }
  .dark .fme-hdr .fme-crumb:has(+ .fme-crumb)::after { color:#64748b; }
  .dark .fme-hdr .fme-crumb:hover { color:#fff; }
  .dark .fme-hdr .fme-crumb-logo { padding:1px; background:#fff; }
  .dark .fme-hdr .fme-trust { color:#34d399; }
  .dark .fme-hdr .fme-trust:hover, .dark .fme-hdr .fme-trust[aria-expanded="true"] { background:#1e293b; }
  .dark .fme-hdr .fme-action { border-color:#334155; background:#1e293b; color:#e2e8f0; }
  .dark .fme-hdr .fme-action:hover { border-color:#475569; background:#334155; color:#fff; }
  .dark .fme-hdr :is(.fme-crumb, .fme-pill, .fme-trust, .fme-action):focus-visible { outline-color:#60a5fa; }
  .dark body { background:#020617; color:#cbd5e1; }
  .dark #app { background:#020617; }
  .dark #app > header { background:#0f172a; border-bottom-color:#1e293b; }
  .dark .toolbar-hint { border-left-color:#334155; }
  .dark .toolbar-hint kbd, .dark .search-kbd { border-color:#475569; background:#1e293b; color:#cbd5e1; }
  .dark .search input, .dark #sort-by { border-color:#334155; background:#020617; color:#f1f5f9; }
  .dark .search input::placeholder { color:#64748b; }
  .dark .search input:hover, .dark #sort-by:hover { border-color:#475569; background:#020617; }
  .dark .search input:focus { background:#020617; }
  .dark .sort-label, .dark .filter-label { color:#cbd5e1; }
  .dark #clear-search:hover { color:#e2e8f0; }
  .dark .btn { border-color:#334155; background:#1e293b; color:#cbd5e1; }
  .dark .btn:hover { background:#334155; color:#fff; }
  .dark .seg { border-color:#334155; background:#020617; }
  .dark .seg button { color:#94a3b8; }
  .dark .seg button.active { background:#334155; color:#bfdbfe; box-shadow:none; }
  .dark .filter-bar { border-top-color:#1e293b; background:#0b1222; }
  .dark .filter-sep { background:#334155; }
  .dark .f-chip { border-color:#334155; background:#1e293b; color:#e2e8f0; }
  .dark .f-chip:hover { border-color:#475569; background:#334155; }
  .dark .f-chip[aria-pressed="true"] { background:#1d4ed8; border-color:#3b82f6; color:#fff; }
  .dark .f-cnt { color:#94a3b8; }
  .dark .f-chip.f-reset { border-color:#1e3a8a; background:#172554; color:#bfdbfe; }
  .dark .f-chip.f-reset:hover { background:#1e3a8a; }
  .dark .about-cue { background:rgba(15,23,42,.92); box-shadow:0 4px 10px rgba(0,0,0,.4); }

  .dark #tree-view { background-image:radial-gradient(#1e293b 1.2px, transparent 1.2px); }
  .dark .connector { stroke:#475569; }
  .dark .node:not(.root) { background:#1e293b; border-color:#334155; }
  .dark .root { background:linear-gradient(135deg,#1d4ed8,#1e3a8a); border-color:#3b82f6; }
  .dark .root:hover { background:linear-gradient(135deg,#2563eb,#1d4ed8); border-color:#60a5fa; box-shadow:0 8px 24px -6px rgba(59,130,246,.5); }
  .dark .count { border-color:#334155; background:#0f172a; color:#cbd5e1; }
  .dark .fn, .dark .cat, .dark .sub { transition:box-shadow .2s, transform .2s, background-color .2s, border-color .2s; }
  .dark .cat:hover, .dark .sub:hover { background:color-mix(in srgb, var(--c) 12%, #1e293b); box-shadow:0 0 0 2px var(--c), 0 8px 20px -6px rgba(0,0,0,.6); }
  .dark .fn:hover { background:color-mix(in srgb, var(--c) 12%, #1e293b); border-color:color-mix(in srgb, var(--c) 65%, #334155); }
  .dark .fn h4 { color:#60a5fa; }
  .dark .fn:hover h4 { color:#93c5fd; }
  .dark .fn-kicker, .dark .fn-dur, .dark .fn-roles { color:#94a3b8; }
  .dark .fn-type.is-lp { color:#93c5fd; }
  .dark .fn-type.is-mod { color:#cbd5e1; }
  .dark .fn p { color:#cbd5e1; }
  .dark .fn-badge-wrap { background:#0f172a; border-color:#334155; }
  .dark .course-badge-fallback { color:#93c5fd; }
  .dark .meta-pill.plat-cloud { background:#082f49; color:#7dd3fc; border-color:#0369a1; }
  .dark .meta-pill.plat-desktop { background:#042f2e; color:#5eead4; border-color:#0f766e; }
  .dark .meta-pill.lvl-beginner { background:#022c22; color:#6ee7b7; border-color:#047857; }
  .dark .meta-pill.lvl-intermediate { background:#271705; color:#fcd34d; border-color:#b45309; }
  .dark .meta-pill.lvl-advanced { background:#2e1065; color:#c4b5fd; border-color:#6d28d9; }
  .dark .meta-pill.meta-neutral { background:#1e293b; color:#cbd5e1; border-color:#334155; }
  .dark .fn.hit:not(.spot) { box-shadow:0 0 0 2px rgba(96,165,250,.45); }
  .dark .fn.current:not(.spot) { background:color-mix(in srgb, var(--c) 12%, #1e293b); box-shadow:0 0 0 2px var(--c); }
  .dark mark { background:#1e3a8a; color:#dbeafe; }
  .dark #controls { border-color:#334155; background:#0f172a; box-shadow:0 10px 15px -3px rgba(0,0,0,.5); }
  .dark #controls button { background:#0f172a; color:#cbd5e1; }
  .dark #controls button:hover { background:#1e293b; color:#fff; }
  .dark #controls #zoom-level { color:#cbd5e1; }
  .dark #controls hr { border-color:#334155; }
  .dark .empty { border-color:#334155; background:rgba(15,23,42,.6); }
  .dark .empty-ico { color:#94a3b8; }

  .dark #backdrop { background:rgba(2,6,23,.5); }
  .dark #panel { background:#0f172a; border-left:1px solid #334155; box-shadow:-10px 0 25px -5px rgba(0,0,0,.6); }
  .dark #close { background:#1e293b; color:#cbd5e1; }
  .dark #share { color:#cbd5e1; }
  .dark #share:hover { background:#1e293b; color:#fff; }
  .dark #share::after { background:#334155; }
  .dark #share.done { background:#064e3b; color:#6ee7b7; }
  .dark .chip { border-color:#334155; background:#1e293b; color:#cbd5e1; }
  .dark .chip.type-chip.is-lp { background:#172554; border-color:#1e40af; color:#bfdbfe; }
  .dark .chip.type-chip.is-mod { background:#172554; border-color:#1e40af; color:#93c5fd; }
  .dark .box { border-color:#334155; }
  .dark .obj { background:color-mix(in srgb, var(--c, var(--accent)) 14%, #0f172a); border-color:color-mix(in srgb, var(--c, var(--accent)) 30%, #0f172a); border-left-color:var(--c, var(--accent)); }
  .dark .impl li { border-color:#334155; color:#cbd5e1; }
  .dark .learn-cta { background:#2563eb; color:#fff; }
  .dark .learn-cta:hover { background:#3b82f6; }
  .dark .learn-link:hover { color:#bfdbfe; }
  .dark .foot { border-top-color:#1e293b; background:#0f172a; }
  .dark .foot-title { color:#94a3b8; }
  .dark .drawer-nav { border-color:#334155; background:#1e293b; color:#e2e8f0; }
  .dark .drawer-nav:hover:not(:disabled) { background:#334155; }
  .dark .drawer-nav:disabled { border-color:#1e293b; background:#0f172a; color:#475569; }

  .dark .jump-bar button, .dark .jump-arrow { border-color:#334155; background:#1e293b; color:#e2e8f0; }
  .dark .jump-bar button.letter { border-color:transparent; background:none; }
  .dark .jump-bar button[aria-current="true"], .dark .jump-bar button.letter[aria-current="true"] { border-color:#2563eb; background:#2563eb; color:#fff; }
  .dark .jump-arrow:hover { background:#334155; }
  .dark .back-to-top { background:#1e293b; }
  .dark .back-to-top:hover { background:#2563eb; }

  .dark .seo-content { border-top-color:#1e293b; background:#0f172a; }
  .dark .seo-content p, .dark .seo-browse li { color:#cbd5e1; }
  .dark .seo-browse, .dark .seo-faq details, .dark .seo-browse[open], .dark .seo-faq details[open],
  .dark .seo-browse summary, .dark .seo-faq summary, .dark .seo-browse[open] summary { border-color:#1e3a8a; background:#172554; }
  .dark .seo-faq details[open] summary { border-bottom-color:#1e3a8a; }
  .dark .seo-browse-content, .dark .seo-faq-content { background:#0f172a; }
  .dark support-card { --support-card-text:#f1f5f9; --support-card-bg:#0f172a; --support-card-border:#1e3a8a; --support-card-muted:#94a3b8; }

  .dark .fme-pop { border-color:#334155; background:#0f172a; color:#cbd5e1; box-shadow:0 10px 30px rgba(0,0,0,.5); }
  .dark .fme-pop-title { color:#f1f5f9; }
  .dark .fme-pop li::before { color:#34d399; }
  .dark .fme-pop a { color:#bfdbfe; }
  .dark .fme-hint { border-top-color:#1e293b; background:#172554; color:#bfdbfe; }
  .dark .fme-hint-close { color:#bfdbfe; }
  .dark .fme-hint-close:hover { background:#1e3a8a; }
  .dark .fme-toast { background:#1e293b; }
  .dark .fme-foot { background:#0f172a; color:#94a3b8; }
  .dark .fme-foot-logo, .dark .fme-foot-h { color:#f1f5f9; }
  .dark .fme-foot-social a, .dark .fme-foot-legal { color:#94a3b8; }
  .dark .fme-foot-col a, .dark .fme-foot-col button, .dark .fme-foot-legal a { color:#cbd5e1; }
  .dark .fme-foot-social a:hover, .dark .fme-foot-col a:hover, .dark .fme-foot-col button:hover, .dark .fme-foot-legal a:hover { color:#bfdbfe; }
  .dark .fme-foot a:focus-visible, .dark .fme-foot button:focus-visible { outline-color:#60a5fa; }
  .dark .fme-foot-legal-in { border-top-color:#1e293b; }
