/* =============================================================================
 * AI-Solutions Wiki - Knowledge Galaxy
 * Theme + layout. All visuals; no content. Drop into static/css/.
 * ========================================================================== */

/* Scoped to .galaxy-app so the deep-space theme tokens never leak into the site chrome. */
.galaxy-app {
  /* surfaces - aligned to the site's dark theme so the galaxy matches the timeline/rest of the wiki */
  --bg-0:        #0a0a0a;
  --bg-1:        #0d0d0d;
  --bg-2:        #161616;
  --panel:       rgba(22, 22, 22, 0.85);
  --panel-solid: #161616;
  --panel-2:     rgba(37, 37, 37, 0.5);
  --border:      rgba(255, 255, 255, 0.08);
  --border-2:    rgba(255, 255, 255, 0.16);

  /* text - site tokens */
  --fg:        #f0f0f0;
  --fg-2:      #999999;
  --fg-3:      #6b6b6b;
  --fg-muted:  #777777;
  --fg-faint:  #555555;

  /* accent - the site brand blue (matches links/buttons across the wiki) */
  --accent:        #5b9bd5;
  --accent-soft:   rgba(91, 155, 213, 0.16);
  --accent-line:   rgba(91, 155, 213, 0.5);

  /* difficulty */
  --d-beginner: #34d399;
  --d-easy:     #22d3ee;
  --d-moderate: #f5b73d;
  --d-hard:     #f43f6b;
  --d-expert:   #a855f7;

  /* link strokes */
  --link:        rgba(160, 162, 170, 0.22);
  --link-strong: rgba(230, 232, 240, 0.45);

  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --topbar-h: 64px;
  --sidebar-w: 300px;
  --detail-h: 192px;

  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 14px;
}

.galaxy-app, .galaxy-app * { box-sizing: border-box; }

.galaxy-app {
  color: var(--fg);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

.galaxy-app button { font-family: inherit; color: inherit; cursor: pointer; }

/* ===================== App shell ======================================== */
.galaxy-app {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  grid-template-rows: 1fr;
  grid-template-areas: "sidebar stage";
  background: radial-gradient(1200px 820px at 58% 26%, #18181b 0%, #0d0d0d 55%, #0a0a0a 100%);
}
@media (max-width: 820px) {
  .galaxy-app { grid-template-columns: 1fr; grid-template-areas: "stage"; }
  .galaxy-app .sidebar { display: none; }
}
/* drag-to-resize handle for the left sidebar, at its right boundary */
.gx-rail-resize { position: absolute; top: 0; bottom: 0; left: var(--sidebar-w); width: 11px; transform: translateX(-6px); cursor: ew-resize; z-index: 22; touch-action: none; }
.gx-rail-resize::after { content: ""; position: absolute; top: 0; bottom: 0; left: 50%; width: 2px; transform: translateX(-50%); background: transparent; transition: background .12s; }
.gx-rail-resize:hover::after, .galaxy-app.gx-rail-resizing .gx-rail-resize::after { background: #e0314b; }
.galaxy-app.gx-rail-resizing { user-select: none; }
@media (max-width: 820px) { .gx-rail-resize { display: none; } }

/* ===================== Top bar ========================================== */
.topbar {
  grid-area: topbar;
  display: flex;
  align-items: center;
  gap: 28px;
  padding: 0 22px;
  border-bottom: 1px solid var(--border);
  background: rgba(22, 22, 22, 0.72);
  backdrop-filter: blur(14px);
  z-index: 30;
}
.brand { display: flex; align-items: center; gap: 11px; min-width: var(--sidebar-w); }
.brand .logo {
  width: 36px; height: 36px; border-radius: 9px;
  display: grid; place-items: center;
  background: linear-gradient(150deg, #1b2342, #0d1326);
  border: 1px solid var(--border-2);
  color: var(--accent);
}
.brand .logo svg { width: 20px; height: 20px; }
.brand b { font-size: 15px; font-weight: 600; letter-spacing: -0.01em; }

.nav { display: flex; gap: 4px; }
.nav a {
  padding: 8px 14px; border-radius: 7px;
  color: var(--fg-2); text-decoration: none;
  font-size: 14px; font-weight: 500;
  position: relative; transition: color .2s, background .2s;
}
.nav a:hover { color: var(--fg); background: rgba(255,255,255,.04); }
.nav a.active { color: var(--fg); }
.nav a.active::after {
  content: ""; position: absolute; left: 14px; right: 14px; bottom: -1px; height: 2px;
  background: var(--accent); border-radius: 2px;
}

.topbar .spacer { flex: 1; }

.search {
  display: flex; align-items: center; gap: 9px;
  width: 300px; height: 38px; padding: 0 12px;
  background: rgba(255,255,255,.04); border: 1px solid var(--border);
  border-radius: 9px; color: var(--fg-muted);
  transition: border-color .2s;
}
.search:focus-within { border-color: var(--border-2); }
.search svg { width: 15px; height: 15px; flex: none; }
.search input {
  flex: 1; background: none; border: 0; outline: 0;
  color: var(--fg); font-size: 14px;
}
.search input::placeholder { color: var(--fg-muted); }
.search .kbd {
  font-size: 11px; color: var(--fg-3); border: 1px solid var(--border);
  border-radius: 5px; padding: 2px 6px; letter-spacing: .04em;
}

.pill-btn {
  display: flex; align-items: center; gap: 8px;
  height: 38px; padding: 0 14px;
  background: rgba(255,255,255,.04); border: 1px solid var(--border);
  border-radius: 9px; font-size: 13px; font-weight: 500; color: var(--fg-2);
  transition: border-color .2s, color .2s;
}
.pill-btn:hover { border-color: var(--border-2); color: var(--fg); }
.pill-btn svg { width: 15px; height: 15px; }

.avatar {
  width: 38px; height: 38px; border-radius: 50%;
  background: linear-gradient(150deg, #2a3358, #151b34);
  border: 1px solid var(--border-2); flex: none;
  background-size: cover; background-position: center;
}

/* ===================== Sidebar ========================================== */
.sidebar {
  grid-area: sidebar;
  border-right: 1px solid var(--border);
  background: rgba(22, 22, 22, 0.72);
  backdrop-filter: blur(10px);
  padding: 22px 18px;
  overflow-y: auto; overflow-x: hidden;
  display: flex; flex-direction: column; gap: 24px;
  z-index: 20;
}
.sidebar .search { width: 100%; }   /* was 300px (topbar size) and overflowed the 256px rail */
.sidebar::-webkit-scrollbar { width: 8px; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(120,140,200,.16); border-radius: 8px; }

.s-title { font-size: 16px; font-weight: 600; letter-spacing: -0.01em; }
.s-desc { font-size: 14px; line-height: 1.6; color: var(--fg-2); margin-top: 8px; }

.s-label {
  font-size: 12.5px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase;
  color: var(--fg-3); margin-bottom: 12px;
}

/* view layers */
.layers { display: flex; flex-direction: column; gap: 6px; }
.layer {
  display: flex; align-items: center; gap: 11px;
  padding: 9px 11px; border-radius: 9px;
  border: 1px solid transparent; background: transparent;
  font-size: 13.5px; font-weight: 500; color: var(--fg-2);
  width: 100%; text-align: left; transition: background .2s, border-color .2s, color .2s;
}
.layer:hover { background: rgba(255,255,255,.035); color: var(--fg); }
.layer.active {
  background: var(--accent-soft); border-color: var(--accent-line); color: var(--fg);
}
.layer .lnum {
  width: 26px; height: 26px; border-radius: 7px; flex: none;
  display: grid; place-items: center;
  background: rgba(255,255,255,.05); border: 1px solid var(--border);
  font-size: 12px; color: var(--fg-2);
}
.layer.active .lnum { background: var(--accent); border-color: transparent; color: #fff; }

/* filters */
.field { margin-bottom: 16px; }
.field:last-child { margin-bottom: 0; }
.field > span { display: block; font-size: 12.5px; color: var(--fg-2); margin-bottom: 7px; }
.select {
  position: relative; width: 100%;
}
.select select {
  appearance: none; width: 100%; height: 38px; padding: 0 32px 0 12px;
  background: rgba(255,255,255,.04); border: 1px solid var(--border); border-radius: 8px;
  color: var(--fg); font-size: 13.5px; font-family: inherit; cursor: pointer;
}
.select::after {
  content: ""; position: absolute; right: 13px; top: 50%; width: 8px; height: 8px;
  border-right: 1.5px solid var(--fg-muted); border-bottom: 1.5px solid var(--fg-muted);
  transform: translateY(-65%) rotate(45deg); pointer-events: none;
}

/* Filter chips (click to toggle, multi-select) */
.gx-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.gx-chip {
  appearance: none; display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 11px; border-radius: 999px; cursor: pointer;
  background: rgba(255,255,255,.04); border: 1px solid var(--border);
  color: var(--fg-2); font-size: 13px; font-family: inherit; line-height: 1;
  transition: border-color .12s, background .12s, color .12s;
}
.gx-chip:hover { border-color: var(--fg-muted); color: var(--fg); }
.gx-chip.on { background: var(--accent-soft); border-color: var(--accent-line); color: var(--fg); }
.gx-chip-dot { width: 9px; height: 9px; border-radius: 50%; flex: none; box-shadow: 0 0 6px currentColor; }

.toggle-row { display: flex; align-items: center; justify-content: space-between; }
.toggle-row span { font-size: 13.5px; color: var(--fg-2); }
.switch {
  width: 40px; height: 22px; border-radius: 999px; border: 0;
  background: rgba(120,140,200,.22); position: relative; transition: background .2s; flex: none;
}
.switch::after {
  content: ""; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px;
  border-radius: 50%; background: #fff; transition: transform .2s;
}
.switch[aria-checked="true"] { background: var(--accent); }
.switch[aria-checked="true"]::after { transform: translateX(18px); }

/* legend */
.legend { margin-top: auto; border: 1px solid var(--border); border-radius: var(--radius-lg);
  background: var(--panel-2); padding: 16px; }
.legend h4 { margin: 0 0 13px; font-size: 13px; font-weight: 600; }
.legend-row { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.legend-row:last-child { margin-bottom: 0; }
.legend-dot { width: 13px; height: 13px; border-radius: 50%; flex: none;
  box-shadow: 0 0 8px 1px currentColor; }
.legend-row .name { font-size: 13px; color: var(--fg); flex: 1; }
.legend-row .range { font-size: 12px; color: var(--fg-muted); }

/* ===================== Stage =========================================== */
.stage-wrap { grid-area: stage; position: relative; overflow: hidden; }

.starfield { position: absolute; inset: 0; z-index: 0; pointer-events: none; }

.viewport {
  position: absolute; inset: 0; z-index: 1;
  cursor: grab;
  user-select: none; -webkit-user-select: none;   /* dragging to pan must not select node labels */
}
.viewport.panning { cursor: grabbing; }

.scene {
  position: absolute; top: 0; left: 0;
  transform-origin: 0 0;
  will-change: transform;
}

.links-svg { position: absolute; top: 0; left: 0; overflow: visible; pointer-events: none; }
.links-svg path { fill: none; transition: stroke .2s, opacity .2s; }

/* nodes */
.node { position: absolute; transform: translate(-50%, -50%); }
.node.dim { opacity: .15; }
.node.deemph { opacity: .26; transition: opacity .15s; }
.node.hidden { display: none; }
.node > .label { position: absolute; inset: 0; z-index: 4; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; pointer-events: none; padding: 0 8px; }

.planet-canvas { display: block; position: relative; z-index: 2; border-radius: 50%; transition: transform .2s ease-out; cursor: pointer; }
.node:hover .planet-canvas { transform: scale(1.03); }
.pring-c {
  position: absolute; left: 50%; top: 50%;
  transform: translate(-50%, -50%); pointer-events: none;
}
.pring-c.back { z-index: 1; }
.pring-c.front { z-index: 3; }

/* domain label */
.pname { font-weight: 600; color: #fff; letter-spacing: -0.01em; text-shadow: 0 2px 18px rgba(0,0,0,.75); }
.phours { color: rgba(255,255,255,.74); margin-top: 3px; font-weight: 500; text-shadow: 0 1px 12px rgba(0,0,0,.75); }

/* subdomain label */
.blabel {
  position: absolute; left: 50%; top: calc(100% + 4px); transform: translateX(-50%);
  white-space: nowrap; text-align: center; pointer-events: none;
}
.blabel.inside { top: 50%; transform: translate(-50%,-50%); }
.bname { display: block; color: #fff; font-weight: 600; font-size: 13px; text-shadow: 0 1px 10px rgba(0,0,0,.85); }
.bhours { display: block; color: var(--fg-2); font-size: 11.5px; margin-top: 1px; text-shadow: 0 1px 8px rgba(0,0,0,.85); }
.blabel.inside .bname { font-size: 12px; }
.blabel.inside .bhours { color: rgba(255,255,255,.72); }

/* concept dot */
/* Subdomains + concepts as small drifting stars (clean at scale, looks like a real galaxy) */
.starnode {
  border-radius: 50%; cursor: pointer; position: relative;
  background: radial-gradient(circle at 38% 34%, #fff, var(--sc) 56%, transparent 74%);
  box-shadow: 0 0 7px 1px var(--sc);
  animation: star-life var(--dur, 4.2s) ease-in-out infinite;
  animation-delay: var(--dly, 0s);
}
.starnode.sub { box-shadow: 0 0 11px 2px var(--sc); }
.node:hover .starnode { filter: brightness(1.6); box-shadow: 0 0 15px 4px var(--sc); }
.node.selected .starnode { box-shadow: 0 0 0 3px rgba(255,255,255,.42), 0 0 16px 4px var(--sc); }
@keyframes star-life {
  0%, 100% { opacity: .58; transform: translate(0, 0) scale(1); }
  50%      { opacity: 1;   transform: translate(1.5px, -2px) scale(1.12); }
}
.starnode .clabel {
  position: absolute; left: 50%; top: calc(100% + 5px); transform: translateX(-50%);
  white-space: nowrap; text-align: center; pointer-events: none; opacity: 0; transition: opacity .15s;
}
/* Subdomain stars are always labelled (the structure stays readable); concept stars label on hover. */
.starnode.sub .clabel { opacity: 0.88; }
.starnode.sub .cname { font-weight: 600; }
.node:hover .starnode .clabel, .node.selected .starnode .clabel { opacity: 1 !important; }

.concept {
  width: 15px; height: 15px; border-radius: 50%; cursor: pointer; position: relative;
  border: 2px solid currentColor; box-shadow: 0 0 9px 1px currentColor; transition: transform .15s;
}
.node:hover .concept { transform: scale(1.45); }
.concept .clabel {
  position: absolute; left: 50%; top: calc(100% + 5px); transform: translateX(-50%);
  white-space: nowrap; text-align: center; pointer-events: none; transition: opacity .15s;
}
.cname { display: block; color: var(--fg); font-size: 11.5px; font-weight: 500; text-shadow: 0 1px 8px rgba(0,0,0,.9); }
.chours { display: block; color: var(--fg-muted); font-size: 11.5px; text-shadow: 0 1px 8px rgba(0,0,0,.9); }

.node.selected .concept { transform: scale(1.5); box-shadow: 0 0 0 3px rgba(255,255,255,.3), 0 0 12px 2px currentColor; }

/* ===================== Zoom controls =================================== */
.zoom-ctl {
  position: absolute; left: 20px; top: 20px; z-index: 10;
}
.zoom-ctl .zlabel { font-size: 12px; font-weight: 600; letter-spacing: .08em;
  text-transform: uppercase; color: var(--fg-3); margin-bottom: 8px; }
.zoom-ctl .btns { display: flex; flex-direction: column;
  background: var(--panel); border: 1px solid var(--border); border-radius: 10px;
  backdrop-filter: blur(10px); overflow: hidden; }
.zoom-ctl button {
  width: 40px; height: 40px; display: grid; place-items: center;
  background: transparent; border: 0; color: var(--fg-2);
  border-bottom: 1px solid var(--border); transition: background .2s, color .2s;
}
.zoom-ctl button:last-child { border-bottom: 0; }
.zoom-ctl button:hover { background: rgba(255,255,255,.05); color: var(--fg); }
.zoom-ctl svg { width: 17px; height: 17px; }

/* ===================== Minimap (overview) ============================== */
.overview {
  position: absolute; right: 20px; top: 20px; z-index: 10;
  width: 218px; padding: 14px;
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius-lg);
  backdrop-filter: blur(12px);
}
.overview h4 { margin: 0 0 11px; font-size: 12.5px; font-weight: 600; color: var(--fg); }
.minimap {
  position: relative; width: 100%; aspect-ratio: 2800 / 1700;
  background: rgba(0,0,0,.4); border: 1px solid var(--border); border-radius: 8px;
  overflow: hidden; cursor: pointer;
}
.minimap .mm-dot { position: absolute; border-radius: 50%; transform: translate(-50%,-50%); }
.minimap .mm-view {
  position: absolute; border: 1px solid rgba(255,255,255,.6); border-radius: 2px;
  background: rgba(255,255,255,.06); pointer-events: none;
}
.recenter {
  width: 100%; margin-top: 11px; height: 34px; border-radius: 8px;
  background: rgba(255,255,255,.04); border: 1px solid var(--border);
  font-size: 13px; font-weight: 500; color: var(--fg-2); transition: background .2s, color .2s;
}
.recenter:hover { background: rgba(255,255,255,.08); color: var(--fg); }

/* ===================== Detail panel (right side, matches Knowledge Graph) === */
.gx-panel {
  position: absolute; right: 18px; top: 18px; bottom: 18px; z-index: 15;
  width: var(--gx-panel-w, 380px);
  background: var(--panel-solid); border: 1px solid var(--border-2); border-radius: 14px;
  display: flex; flex-direction: column; overflow: hidden;
  box-shadow: 0 18px 50px rgba(0,0,0,.55);
}
.gx-panel-inner {
  flex: 1; overflow-y: auto; overflow-x: hidden;
  padding: 18px 18px 22px; display: flex; flex-direction: column;
}
.gx-panel-inner::-webkit-scrollbar { width: 8px; }
.gx-panel-inner::-webkit-scrollbar-thumb { background: rgba(255,255,255,.14); border-radius: 8px; }

/* drag-to-resize handle on the inner (left) edge */
.gx-panel-resize { position: absolute; top: 0; left: -4px; width: 10px; height: 100%; cursor: ew-resize; z-index: 18; touch-action: none; }
.gx-panel-resize::after { content: ""; position: absolute; left: 4px; top: 0; bottom: 0; width: 2px; background: transparent; transition: background .12s; }
.gx-panel-resize:hover::after, .gx-panel.gx-resizing .gx-panel-resize::after { background: #e0314b; }
.gx-panel.gx-resizing { user-select: none; }

/* collapse / reopen */
.gx-panel-collapse { position: absolute; top: 12px; right: 12px; z-index: 20; width: 26px; height: 26px;
  display: grid; place-items: center; padding: 0; border-radius: 7px;
  background: rgba(255,255,255,.05); border: 1px solid var(--border-2); color: var(--fg-2); cursor: pointer; }
.gx-panel-collapse:hover { color: var(--fg); border-color: #e0314b; }
.gx-panel-collapse svg { width: 15px; height: 15px; }
.gx-panel-reopen { display: none; }
.gx-panel.gx-collapsed { width: 40px; }
.gx-panel.gx-collapsed .gx-panel-inner, .gx-panel.gx-collapsed .gx-panel-collapse, .gx-panel.gx-collapsed .gx-panel-resize { display: none; }
.gx-panel.gx-collapsed .gx-panel-reopen { display: grid; place-items: center; width: 100%; height: 100%; background: none; border: 0; color: var(--fg-2); cursor: pointer; }
.gx-panel.gx-collapsed .gx-panel-reopen:hover { color: var(--fg); }
.gx-panel.gx-collapsed .gx-panel-reopen svg { width: 18px; height: 18px; }
.gx-panel.gx-empty .gx-panel-collapse { display: none; }

/* header */
.gx-head { display: flex; gap: 13px; align-items: flex-start; }
.d-icon { width: 46px; height: 46px; border-radius: 12px; flex: none; display: grid; place-items: center; border: 1px solid var(--border-2); }
.d-icon svg { width: 22px; height: 22px; color: #fff; }
.gx-head-txt { min-width: 0; padding-right: 30px; }
.d-title { font-size: 18px; font-weight: 700; letter-spacing: -0.01em; line-height: 1.2; }
.d-title a { color: inherit; text-decoration: none; }
.d-title a:hover { text-decoration: underline; }
.d-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.tag { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; padding: 3px 8px; border-radius: 5px;
  background: rgba(255,255,255,.05); border: 1px solid var(--border); color: var(--fg-2); }
.tag .dot { width: 8px; height: 8px; border-radius: 50%; }
.d-blurb { font-size: 13px; line-height: 1.55; color: var(--fg-2); margin: 12px 0 10px; }
.d-link { display: inline-flex; align-items: center; gap: 7px; color: #e0314b; font-size: 13px; font-weight: 600; text-decoration: none; }
.d-link:hover { text-decoration: underline; }
.d-link svg { width: 15px; height: 15px; }

/* sections */
.gx-sec { padding-top: 14px; margin-top: 14px; border-top: 1px solid var(--border); }
.gx-sec h5 { margin: 0 0 8px; font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--fg-3); }
.d-list { display: flex; flex-direction: column; gap: 2px; }
.d-item { display: flex; align-items: center; gap: 9px; width: 100%; text-align: left;
  font-size: 13px; padding: 6px 8px; border-radius: 7px; border: 0; background: none; color: inherit;
  cursor: pointer; transition: background .12s; text-decoration: none; font-family: inherit; }
.d-item:hover { background: rgba(255,255,255,.06); }
.d-item .dot { width: 9px; height: 9px; border-radius: 50%; flex: none; box-shadow: 0 0 6px currentColor; }
.d-item .dot.base { background: var(--fg-3); box-shadow: none; }
.d-item .iname { flex: 1; min-width: 0; color: var(--fg); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.d-item.base { cursor: default; }
.d-item.base[href] { cursor: pointer; }
.d-item .ihours { color: var(--fg-muted); font-size: 12.5px; flex: none; }
.d-empty { font-size: 12.5px; color: var(--fg-muted); padding: 4px 8px; }
.view-all { margin-top: 6px; font-size: 12.5px; color: #e0314b; cursor: pointer; background: none; border: 0; padding: 4px 8px; font-weight: 600; text-align: left; font-family: inherit; }
.view-all:hover { text-decoration: underline; }

/* connection legend */
.conn-row { display: flex; align-items: center; gap: 11px; margin-bottom: 9px; }
.conn-row .swatch { width: 42px; flex: none; }
.conn-row .swatch svg { display: block; width: 42px; height: 8px; }
.conn-row span { font-size: 12px; color: var(--fg-2); }

/* empty state */
.detail-empty { display: flex; align-items: flex-start; gap: 14px; color: var(--fg-muted); }
.detail-empty .pulse { width: 40px; height: 40px; border-radius: 50%; flex: none;
  background: var(--accent-soft); border: 1px solid var(--accent-line); display: grid; place-items: center; }
.detail-empty .pulse svg { width: 18px; height: 18px; color: var(--accent); }
.detail-empty b { color: var(--fg); font-size: 15px; display: block; margin-bottom: 5px; }
.detail-empty p { margin: 0; font-size: 14px; line-height: 1.6; }

/* rich teaching sections (mental model, outline, self-test, build task) */
.gx-note { font-size: 13px; line-height: 1.55; color: var(--fg-2); margin: 0 0 6px; }
.gx-note b { color: var(--fg); font-weight: 600; }
.gx-outline { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.gx-outline li { position: relative; padding-left: 16px; font-size: 13px; line-height: 1.45; color: var(--fg-2); }
.gx-outline li::before { content: ""; position: absolute; left: 3px; top: 8px; width: 5px; height: 5px; border-radius: 50%; background: var(--fg-3); }
.gx-steps { margin: 6px 0 0; padding-left: 18px; display: flex; flex-direction: column; gap: 5px; }
.gx-steps li { font-size: 12.5px; line-height: 1.45; color: var(--fg-2); }
.gx-try { border-left: 2px solid #e0314b; padding-left: 12px; }
.gx-try h5 { color: #e0314b; }

/* tag with an inline icon (reading time) */
.tag svg { width: 11px; height: 11px; margin-right: 1px; }
.tag-area { background: none; border-color: transparent; color: var(--fg-3); padding-left: 0; }

/* header action buttons */
.gx-actions { display: flex; flex-wrap: wrap; gap: 7px; margin: 12px 0 2px; }
.gx-btn { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; font-family: inherit;
  padding: 7px 11px; border-radius: 8px; cursor: pointer; text-decoration: none;
  background: rgba(255,255,255,.05); border: 1px solid var(--border-2); color: var(--fg); transition: background .12s, border-color .12s; }
.gx-btn:hover { background: rgba(255,255,255,.1); }
.gx-btn svg { width: 14px; height: 14px; }
.gx-btn.primary { background: #e0314b; border-color: #e0314b; color: #fff; }
.gx-btn.primary:hover { background: #c72942; }
.gx-btn.on { border-color: #e0314b; color: #e0314b; }

/* per-row action buttons (reveal on hover) */
.d-item { position: relative; }
.d-acts { display: flex; align-items: center; gap: 2px; margin-left: auto; opacity: 0; transition: opacity .12s; flex: none; }
.d-item:hover .d-acts, .d-item:focus-within .d-acts { opacity: 1; }
.d-act { display: inline-grid; place-items: center; width: 24px; height: 24px; padding: 0; border-radius: 6px;
  background: none; border: 0; color: var(--fg-2); cursor: pointer; text-decoration: none; }
.d-act:hover { background: rgba(255,255,255,.1); color: var(--fg); }
.d-act svg { width: 14px; height: 14px; }
.d-act.on { color: #e0314b; }
.d-item .ihours svg { width: 10px; height: 10px; opacity: .6; }

/* hover preview card (mirrors the wiki .gl-hover) */
.gx-hover { position: fixed; z-index: 60; width: 300px; max-width: 320px;
  background: var(--panel-solid); border: 1px solid var(--border-2); border-radius: 12px;
  padding: 13px 14px; box-shadow: 0 16px 40px rgba(0,0,0,.6); pointer-events: auto; }
.gx-hover[hidden] { display: none; }
.gx-hv-term { font-size: 14px; font-weight: 700; color: var(--fg); margin-bottom: 7px; }
.gx-hv-tags { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 8px; }
.gx-hv-sum { font-size: 12.5px; line-height: 1.5; color: var(--fg-2); }
.gx-hv-rel { display: flex; flex-wrap: wrap; gap: 5px; align-items: center; margin-top: 9px; }
.gx-hv-rel-l { font-size: 11.5px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--fg-3); margin-right: 2px; }
.gx-hv-rel span:not(.gx-hv-rel-l) { font-size: 12.5px; color: var(--fg-2); background: rgba(255,255,255,.05); border: 1px solid var(--border); border-radius: 5px; padding: 2px 7px; }
.gx-hv-hint { font-size: 12px; color: var(--fg-3); margin-top: 9px; }

/* reading-list sidebar button */
.rl-btn { display: flex; align-items: center; gap: 9px; width: 100%; padding: 10px 12px; border-radius: 9px;
  background: rgba(255,255,255,.04); border: 1px solid var(--border); color: var(--fg-2);
  font-size: 13.5px; font-weight: 500; font-family: inherit; cursor: pointer; transition: background .15s, border-color .15s, color .15s; }
.rl-btn:hover { background: rgba(255,255,255,.07); color: var(--fg); }
.rl-btn.has { border-color: var(--accent-line); color: var(--fg); }
.rl-btn-ic { display: inline-grid; place-items: center; }
.rl-btn-ic svg { width: 16px; height: 16px; }
.rl-btn-label { flex: 1; text-align: left; }
.rl-count { min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px; display: inline-grid; place-items: center;
  background: var(--accent); color: #fff; font-size: 11px; font-weight: 700; }

/* read / progress */
.gx-progress { margin-top: 14px; }
.gx-progress-top { display: flex; justify-content: space-between; font-size: 12px; color: var(--fg-2); margin-bottom: 6px; }
.gx-progress-top span:last-child { color: #22c55e; font-weight: 600; font-family: var(--mono); }
.gx-progress-bar { height: 6px; border-radius: 999px; background: rgba(255,255,255,.08); overflow: hidden; }
.gx-progress-fill { height: 100%; width: 0; background: #22c55e; border-radius: 999px; transition: width .4s ease; }
/* read concept stars get a soft green ring; read domains/subdomains unaffected */
.node.read .starnode { box-shadow: 0 0 0 2px rgba(34,197,94,.7), 0 0 10px 2px rgba(34,197,94,.5); }
.node.read.selected .starnode { box-shadow: 0 0 0 3px rgba(255,255,255,.42), 0 0 0 5px rgba(34,197,94,.6); }
.tag-read { color: #22c55e; border-color: rgba(34,197,94,.4); }
.tag-read svg { width: 11px; height: 11px; }

/* reading-list drawer */
.gx-readlist { position: fixed; right: 18px; bottom: 18px; z-index: 55; width: 340px; max-width: calc(100vw - 36px); max-height: 70vh;
  background: var(--panel-solid); border: 1px solid var(--border-2); border-radius: 14px; overflow: hidden;
  display: flex; flex-direction: column; box-shadow: 0 18px 50px rgba(0,0,0,.6); }
.gx-readlist[hidden] { display: none; }
.rl-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; padding: 14px 14px 12px; border-bottom: 1px solid var(--border); }
.rl-head b { font-size: 14px; }
.rl-sub { display: block; font-size: 12.5px; color: var(--fg-3); margin-top: 2px; }
.rl-body { overflow-y: auto; padding: 8px; }
.rl-row { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 7px; }
.rl-row:hover { background: rgba(255,255,255,.05); }
.rl-row .dot { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.rl-name { flex: 1; min-width: 0; text-align: left; background: none; border: 0; color: var(--fg); font: inherit; font-size: 13px; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rl-name:hover { color: var(--accent); }
.rl-time { font-size: 12px; color: var(--fg-muted); flex: none; }
.rl-empty { font-size: 12.5px; color: var(--fg-muted); line-height: 1.5; padding: 6px 8px; margin: 0; }

@media (max-width: 820px) {
  .gx-readlist { right: 0; left: 0; bottom: 0; width: 100%; max-width: 100%; border-radius: 14px 14px 0 0; }
}

/* floating tooltip */
.tooltip {
  position: fixed; z-index: 50; pointer-events: none;
  background: var(--panel-solid); border: 1px solid var(--border-2); border-radius: 8px;
  padding: 7px 11px; font-size: 12.5px; color: var(--fg);
  box-shadow: 0 8px 24px rgba(0,0,0,.5); opacity: 0; transition: opacity .12s;
  white-space: nowrap;
}
.tooltip.show { opacity: 1; }
.tooltip .tt-hours { color: var(--fg-muted); margin-left: 7px; }

@media (max-width: 1100px) {
  .overview { display: none; }
}
@media (max-width: 820px) {
  .gx-panel, .gx-panel.gx-collapsed { right: 0; left: 0; top: auto; bottom: 0; width: 100%; height: 52%; border-radius: 14px 14px 0 0; }
  .gx-panel.gx-collapsed { height: 46px; }
  .gx-panel.gx-collapsed .gx-panel-reopen { display: grid; }
  .gx-panel-resize { display: none; }
}
