/* Linux Distro Guide — LeetCode-inspired theme.
   Dark UI, problem-table layout, signature Easy/Medium/Hard difficulty colors. */

:root {
  --bg:        #1a1a1a;
  --bg-layer:  #282828;
  --bg-panel:  #282828;
  --bg-hover:  #303030;
  --bg-alt:    #2d2d2d;
  --border:    #3e3e3e;
  --border-hi: #4a4a4a;
  --text:      #eff1f6;
  --text-2:    #b3b3b3;
  --text-3:    #808080;
  --brand:     #ffa116;   /* LeetCode logo orange */
  --easy:      #1cbaba;   /* teal */
  --medium:    #ffb800;   /* yellow */
  --hard:      #f63636;   /* red */
  --link:      #4895ef;
  --mono: "Menlo", "JetBrains Mono", ui-monospace, "SF Mono", Consolas, monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", "Inter", Roboto, Arial, sans-serif;
  --maxw: 1080px;
  --radius: 8px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--link); text-decoration: none; }
a:hover { color: #6ba8f2; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }

/* ---- top nav ---- */
.topbar {
  background: var(--bg-layer);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 20;
  height: 50px;
}
.topbar .wrap { display: flex; align-items: center; height: 50px; gap: 28px; }
.brand {
  font-weight: 700; font-size: 17px; color: var(--text);
  display: flex; align-items: center; gap: 1px; letter-spacing: -0.3px;
}
.brand .lc { color: var(--brand); }
.brand .rest { color: var(--text); }
.topbar nav { display: flex; gap: 22px; }
.topbar nav a { color: var(--text-2); font-size: 14px; font-weight: 500; }
.topbar nav a:hover { color: var(--text); }
.topbar nav a.active { color: var(--text); }
.topbar .spacer { flex: 1; }

/* difficulty pills, reused everywhere */
.diff { font-weight: 600; font-size: 13px; }
.diff.easy { color: var(--easy); }
.diff.medium { color: var(--medium); }
.diff.hard { color: var(--hard); }
.pill {
  display: inline-block; border-radius: 999px; padding: 3px 11px;
  font-size: 12px; font-weight: 600; line-height: 1.4;
}
.pill.easy   { color: var(--easy);   background: rgba(28,186,186,0.12); }
.pill.medium { color: var(--medium); background: rgba(255,184,0,0.12); }
.pill.hard   { color: var(--hard);   background: rgba(246,54,54,0.12); }

/* ---- hero ---- */
.hero { padding: 46px 0 30px; }
.hero h1 { font-size: 30px; font-weight: 700; margin: 0 0 12px; letter-spacing: -0.5px; color: var(--text); }
.hero p.lead { font-size: 15px; color: var(--text-2); max-width: 680px; margin: 0; }
.hero .path {
  margin-top: 22px; font-family: var(--mono); font-size: 12.5px;
  color: var(--text-3); display: flex; flex-wrap: wrap; gap: 6px 4px; align-items: center;
}
.hero .path .sep { color: var(--brand); }
.hero .path span { color: var(--text-2); }

/* ---- stat chips row ---- */
.statrow { display: flex; gap: 12px; flex-wrap: wrap; margin: 24px 0 8px; }
.stat {
  background: var(--bg-panel); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 12px 18px; min-width: 120px;
}
.stat .n { font-size: 20px; font-weight: 700; }
.stat .l { font-size: 12px; color: var(--text-3); margin-top: 2px; }
.stat .n.easy { color: var(--easy); }
.stat .n.medium { color: var(--medium); }
.stat .n.hard { color: var(--hard); }

/* ---- problem table ---- */
.panel {
  background: var(--bg-panel); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
}
table.problems { width: 100%; border-collapse: collapse; }
table.problems thead th {
  text-align: left; font-size: 12px; font-weight: 600; color: var(--text-3);
  text-transform: none; padding: 12px 18px; border-bottom: 1px solid var(--border);
  background: var(--bg-layer);
}
table.problems tbody tr { border-bottom: 1px solid var(--border); transition: background .12s; }
table.problems tbody tr:last-child { border-bottom: none; }
table.problems tbody tr:nth-child(odd) { background: rgba(255,255,255,0.015); }
table.problems tbody tr:hover { background: var(--bg-hover); }
table.problems td { padding: 13px 18px; vertical-align: middle; }
table.problems td.num { color: var(--text-3); font-size: 13px; width: 48px; }
table.problems td.title a { color: var(--text); font-weight: 500; font-size: 14.5px; }
table.problems td.title a:hover { color: var(--brand); }
table.problems td.title .sub { color: var(--text-3); font-size: 12.5px; margin-top: 2px; }
table.problems td.base { color: var(--text-2); font-family: var(--mono); font-size: 12.5px; }
table.problems td.cat { color: var(--text-2); font-size: 13px; }
table.problems td.diff { width: 110px; }
.status-dot {
  width: 9px; height: 9px; border-radius: 50%; display: inline-block;
  border: 1.5px solid var(--text-3);
}

/* ---- generic section ---- */
section { padding: 34px 0; }
.section-title {
  font-size: 16px; font-weight: 600; color: var(--text); margin: 0 0 16px;
}
.muted { color: var(--text-2); }

/* ---- distro page header ---- */
.distro-head { padding: 30px 0 6px; }
.backlink { font-size: 13px; color: var(--text-2); }
.backlink:hover { color: var(--brand); }
.distro-title { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin: 16px 0 8px; }
.distro-title h1 { font-size: 26px; font-weight: 700; margin: 0; letter-spacing: -0.4px; }
.distro-head .lead { font-size: 15px; color: var(--text-2); max-width: 720px; margin: 8px 0 0; }
.distro-head .base-tag { font-family: var(--mono); font-size: 12.5px; color: var(--text-3); }

/* ---- spec strip ---- */
.specs {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1px; background: var(--border); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden; margin: 24px 0;
}
.specs > div { background: var(--bg-panel); padding: 14px 16px; }
.specs .k { font-size: 11px; color: var(--text-3); margin-bottom: 5px; }
.specs .v { font-size: 14px; color: var(--text); }

/* ---- prose ---- */
.prose { max-width: 760px; }
.prose h3 {
  font-size: 17px; font-weight: 600; margin: 30px 0 12px; color: var(--text);
  padding-bottom: 8px; border-bottom: 1px solid var(--border);
}
.prose p { margin: 0 0 14px; color: var(--text-2); }
.prose ul { margin: 0 0 14px; padding-left: 20px; }
.prose li { margin-bottom: 7px; color: var(--text-2); }
.prose strong { color: var(--text); font-weight: 600; }
.prose a { color: var(--link); }

/* ---- callouts ---- */
.note, .warn-box {
  border-radius: var(--radius); padding: 13px 16px; margin: 0 0 14px;
  font-size: 13.5px; color: var(--text-2); border: 1px solid var(--border);
}
.note { background: rgba(28,186,186,0.06); border-color: rgba(28,186,186,0.3); }
.warn-box { background: rgba(255,184,0,0.06); border-color: rgba(255,184,0,0.3); }
.note .label, .warn-box .label {
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px;
  display: block; margin-bottom: 6px;
}
.note .label { color: var(--easy); }
.warn-box .label { color: var(--medium); }

/* ---- code ---- */
code {
  font-family: var(--mono); font-size: 12.5px;
  background: var(--bg-hover); border-radius: 4px; padding: 2px 6px; color: #e8a45e;
}
pre {
  background: #1e1e1e; border: 1px solid var(--border);
  border-radius: var(--radius); padding: 15px 17px; overflow-x: auto; margin: 0 0 14px;
}
pre code { background: none; padding: 0; font-size: 12.5px; line-height: 1.75; color: #d4d4d4; }
pre .c { color: #6a9955; }    /* comment green */
pre .p { color: var(--brand); }

/* ---- troubleshooting accordions ---- */
.trouble { display: grid; gap: 10px; }
details.tcard {
  background: var(--bg-panel); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
}
details.tcard summary {
  cursor: pointer; padding: 14px 16px; font-weight: 500; font-size: 14px; color: var(--text);
  list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
details.tcard summary::-webkit-details-marker { display: none; }
details.tcard summary::after { content: "+"; color: var(--text-3); font-size: 18px; line-height: 1; }
details.tcard[open] summary::after { content: "−"; }
details.tcard[open] summary { color: var(--brand); }
details.tcard summary:hover { color: var(--brand); }
details.tcard .body { padding: 2px 16px 16px; border-top: 1px solid var(--border); }
details.tcard .body p:first-child { margin-top: 14px; }
details.tcard .body p, details.tcard .body li { color: var(--text-2); }

/* ---- related next/prev ---- */
.related { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 8px; }
.related a {
  flex: 1 1 200px; background: var(--bg-panel); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 13px 15px; color: var(--text);
}
.related a:hover { border-color: var(--border-hi); background: var(--bg-hover); }
.related a .lbl { font-size: 11px; color: var(--text-3); text-transform: uppercase; letter-spacing: .5px; }
.related a .nm { display: block; margin-top: 3px; font-weight: 600; }

/* ---- footer ---- */
footer { border-top: 1px solid var(--border); padding: 26px 0 44px; margin-top: 30px; }
footer .wrap { color: var(--text-3); font-size: 13px; }
footer a { color: var(--text-2); }

@media (max-width: 640px) {
  .hero h1 { font-size: 24px; }
  .topbar nav a.hide-sm { display: none; }
  table.problems td.base, table.problems th.base { display: none; }
  table.problems td.cat, table.problems th.cat { display: none; }
}

/* =================================================================
   Additions: family tree, auth, completion, search/filter, modal
   ================================================================= */

/* ---- auth area in topbar ---- */
.auth { display: flex; align-items: center; gap: 12px; }
.auth .user { color: var(--text); font-weight: 600; font-size: 14px; display: flex; align-items: center; gap: 7px; }
.auth .avatar {
  width: 24px; height: 24px; border-radius: 50%; background: var(--brand);
  color: #1a1a1a; font-weight: 700; font-size: 12px; display: grid; place-items: center;
}
.btn {
  font-family: inherit; font-size: 13px; font-weight: 600; cursor: pointer;
  border-radius: 6px; padding: 6px 14px; border: 1px solid var(--border-hi);
  background: transparent; color: var(--text); transition: all .12s;
}
.btn:hover { background: var(--bg-hover); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #1a1a1a; }
.btn.primary:hover { background: #ffb53d; filter: none; }
.btn.success { background: var(--easy); border-color: var(--easy); color: #06241f; }
.btn.success:hover { background: #2fcfcf; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.ghost { border-color: transparent; color: var(--text-2); }
.btn.ghost:hover { color: var(--text); background: var(--bg-hover); }

/* ---- progress bar on home ---- */
.progress-wrap { margin: 18px 0 0; }
.progress-bar { height: 8px; background: var(--bg-hover); border-radius: 999px; overflow: hidden; }
.progress-bar > span { display: block; height: 100%; background: var(--easy); width: 0; transition: width .4s; }
.progress-label { font-size: 12.5px; color: var(--text-2); margin-top: 7px; }

/* ---- table status (completed) ---- */
.status-dot.done { background: var(--easy); border-color: var(--easy); position: relative; }
.status-dot.done::after {
  content: ""; position: absolute; left: 2.5px; top: 0.5px; width: 3px; height: 6px;
  border: solid #06241f; border-width: 0 1.5px 1.5px 0; transform: rotate(40deg);
}
tr.completed td.title a { color: var(--text-2); }

/* ---- search + filter bar ---- */
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin: 0 0 14px; }
.search {
  flex: 1 1 240px; display: flex; align-items: center; gap: 8px;
  background: var(--bg-panel); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 8px 12px;
}
.search input { flex: 1; background: none; border: none; outline: none; color: var(--text); font-size: 14px; font-family: inherit; }
.search input::placeholder { color: var(--text-3); }
.search .ic { color: var(--text-3); font-size: 14px; }
.filters { display: flex; gap: 6px; flex-wrap: wrap; }
.filters button {
  font-family: inherit; font-size: 13px; cursor: pointer; border-radius: 999px;
  padding: 7px 14px; border: 1px solid var(--border); background: var(--bg-panel); color: var(--text-2);
}
.filters button:hover { color: var(--text); }
.filters button.on { color: var(--text); border-color: var(--border-hi); background: var(--bg-hover); }
.filters button.on.easy { color: var(--easy); border-color: var(--easy); }
.filters button.on.medium { color: var(--medium); border-color: var(--medium); }
.filters button.on.hard { color: var(--hard); border-color: var(--hard); }

/* ---- family tree ---- */
.tree { margin: 8px 0 4px; }
.tree-root {
  text-align: center; margin: 0 auto 8px; max-width: 460px;
  background: var(--bg-panel); border: 1px solid var(--border-hi); border-radius: var(--radius);
  padding: 14px 18px;
}
.tree-root .t { font-weight: 700; font-size: 16px; color: var(--text); }
.tree-root .s { font-size: 12.5px; color: var(--text-3); margin-top: 2px; }
.tree-stem { width: 2px; height: 22px; background: var(--border-hi); margin: 0 auto; }
.tree-cols {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px;
}
.branch { background: var(--bg-panel); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.branch > .head {
  padding: 12px 15px; border-bottom: 1px solid var(--border); background: var(--bg-layer);
}
.branch > .head .bn { font-weight: 700; font-size: 14.5px; color: var(--text); }
.branch > .head .by { font-size: 11.5px; color: var(--text-3); font-family: var(--mono); }
.branch > .head .bb { font-size: 12px; color: var(--text-2); margin-top: 5px; line-height: 1.5; }
.leaves { padding: 8px 8px 10px; }
.leaf {
  display: flex; align-items: center; gap: 8px; padding: 6px 9px; border-radius: 6px;
  color: var(--text-2); font-size: 13.5px; cursor: pointer; text-decoration: none;
}
.leaf:hover { background: var(--bg-hover); color: var(--text); }
.leaf .tick {
  width: 8px; height: 8px; border-radius: 50%; border: 1.5px solid var(--text-3); flex-shrink: 0;
}
.leaf.done .tick { background: var(--easy); border-color: var(--easy); }
.leaf .dd { margin-left: auto; font-size: 11px; font-weight: 700; }
.leaf .dd.easy { color: var(--easy); } .leaf .dd.medium { color: var(--medium); } .leaf .dd.hard { color: var(--hard); }

/* ---- distro completion panel ---- */
.complete-box {
  background: var(--bg-panel); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px 20px; margin: 4px 0 24px;
}
.complete-box h3 { margin: 0 0 6px; font-size: 16px; color: var(--text); border: none; padding: 0; }
.complete-box p.hint { font-size: 13px; color: var(--text-2); margin: 0 0 12px; }
.complete-box textarea {
  width: 100%; min-height: 84px; resize: vertical; background: #1e1e1e; color: #d4d4d4;
  border: 1px solid var(--border); border-radius: 6px; padding: 10px 12px;
  font-family: var(--mono); font-size: 12.5px; outline: none;
}
.complete-box textarea:focus { border-color: var(--border-hi); }
.complete-box .row { display: flex; align-items: center; gap: 12px; margin-top: 12px; flex-wrap: wrap; }
.complete-box .msg { font-size: 13px; }
.complete-box .msg.ok { color: var(--easy); }
.complete-box .msg.err { color: var(--hard); }
.done-banner {
  display: flex; align-items: center; gap: 10px; background: rgba(28,186,186,0.08);
  border: 1px solid rgba(28,186,186,0.35); border-radius: var(--radius); padding: 14px 18px;
  margin: 4px 0 24px; color: var(--easy); font-weight: 600; font-size: 14px;
}
.signin-prompt {
  background: var(--bg-panel); border: 1px dashed var(--border-hi); border-radius: var(--radius);
  padding: 16px 20px; margin: 4px 0 24px; color: var(--text-2); font-size: 14px;
}

/* ---- modal ---- */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,0.6); z-index: 100;
  display: grid; place-items: center; padding: 20px;
}
.modal {
  background: var(--bg-layer); border: 1px solid var(--border); border-radius: 12px;
  width: 100%; max-width: 380px; padding: 26px;
}
.modal h2 { margin: 0 0 4px; font-size: 20px; }
.modal .sub { color: var(--text-3); font-size: 13px; margin: 0 0 18px; }
.modal label { display: block; font-size: 12.5px; color: var(--text-2); margin: 12px 0 5px; }
.modal input {
  width: 100%; background: var(--bg); border: 1px solid var(--border); border-radius: 6px;
  padding: 10px 12px; color: var(--text); font-size: 14px; font-family: inherit; outline: none;
}
.modal input:focus { border-color: var(--border-hi); }
.modal .actions { margin-top: 20px; display: flex; gap: 10px; }
.modal .actions .btn { flex: 1; justify-content: center; text-align: center; }
.modal .switch { text-align: center; margin-top: 16px; font-size: 13px; color: var(--text-3); }
.modal .switch a { cursor: pointer; }
.modal .err { color: var(--hard); font-size: 13px; margin-top: 12px; min-height: 18px; }
.modal .close { float: right; cursor: pointer; color: var(--text-3); font-size: 20px; line-height: 1; margin: -6px -6px 0 0; }
.modal .close:hover { color: var(--text); }

/* =================================================================
   Family tree timeline (GLDT-style) + motion
   ================================================================= */
.tl-legend {
  display: flex; flex-wrap: wrap; gap: 14px; margin: 0 0 14px;
  font-size: 12.5px; color: var(--text-2);
}
.tl-legend span { display: flex; align-items: center; gap: 7px; }
.tl-legend i { width: 16px; height: 3px; border-radius: 2px; background: var(--c); display: inline-block; }

.tl-wide { max-width: 1380px; margin: 0 auto; padding: 0 24px; }
.tl-scroll {
  overflow: auto; max-height: 80vh; position: relative;
  border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg-panel);
  animation: rise .4s ease both;
}
.tl-inner { position: relative; }
.tl-yaxis {
  position: sticky; left: 0; width: 50px; z-index: 4; pointer-events: none;
  background: linear-gradient(to right, var(--bg-panel) 62%, transparent);
}
.tl-yaxis span {
  position: absolute; left: 7px; transform: translateY(-50%);
  font-size: 9.5px; font-family: var(--mono); color: var(--text-3); white-space: nowrap;
}
.tl-svg { display: block; position: absolute; left: 0; top: 0; }
.tl-grid { stroke: var(--border); opacity: .14; }
.tl-kernel { stroke: #c9cfda; stroke-width: 2.5; }
.tl-kernel-label { fill: var(--text); font-size: 11px; font-weight: 700; font-family: var(--mono); }

.tl-item { cursor: pointer; transition: opacity .15s; }
.tl-hit { fill: transparent; pointer-events: all; }
.tl-line { stroke: var(--c); stroke-width: 2.2; }
.tl-branch { stroke: var(--c); stroke-width: 1.5; fill: none; opacity: .45; }
.tl-dot { fill: var(--c); }
/* dark halo so names stay readable on top of the lines */
.tl-name {
  fill: #e6eaf1; font-size: 11px; font-weight: 500; pointer-events: none;
  paint-order: stroke; stroke: #15171c; stroke-width: 3.2px; stroke-linejoin: round;
  transition: fill .12s;
}
.tl-item.done .tl-name { fill: var(--easy); }
/* hover focus: fade the rest, light up the hovered lineage */
.tl-svg:hover .tl-item { opacity: .32; }
.tl-svg:hover .tl-item:hover { opacity: 1; }
.tl-item:hover .tl-line { stroke-width: 4; }
.tl-item:hover .tl-branch { opacity: 1; stroke-width: 2.4; }
.tl-item:hover .tl-name { fill: #fff; font-weight: 700; }
.tl-item:hover .tl-dot { stroke: #fff; stroke-width: 1.5; }

/* draw-in animation, gently staggered via --d */
.tl-line, .tl-branch {
  stroke-dasharray: 1; stroke-dashoffset: 1;
  animation: tl-draw .6s ease forwards; animation-delay: var(--d);
}
.tl-dot, .tl-name { opacity: 0; animation: tl-fade .4s ease forwards; animation-delay: var(--d); }
@keyframes tl-draw { to { stroke-dashoffset: 0; } }
@keyframes tl-fade { to { opacity: 1; } }

/* light page-entrance motion (used sparingly) */
.hero { animation: rise .4s ease both; }
.distro-head { animation: rise .35s ease both; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.card, .stat, .branch { transition: transform .15s, border-color .15s; }
.stat:hover { transform: translateY(-2px); border-color: var(--border-hi); }

@media (prefers-reduced-motion: reduce) {
  .tl-line, .tl-branch, .tl-dot, .tl-name, .hero, .distro-head, .tl-scroll {
    animation: none !important; opacity: 1 !important; stroke-dashoffset: 0 !important; transform: none !important;
  }
}

/* =================================================================
   Family tree — clean nested hierarchy (replaces the timeline)
   ================================================================= */
.kernel-root {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  background: var(--bg-panel); border: 1px solid var(--border-hi); border-radius: var(--radius);
  padding: 13px 18px; margin: 0 0 18px; font-size: 14px; color: var(--text-2);
}
.kernel-root b { color: var(--text); }
.kernel-root .kr-dot { width: 11px; height: 11px; border-radius: 50%; background: #c9cfda;
  box-shadow: 0 0 0 4px rgba(201,207,218,.12); flex: none; }
.kernel-root .kr-sub { color: var(--text-3); font-size: 12.5px; }

.famgrid { columns: 3 290px; column-gap: 16px; }
.famcard {
  break-inside: avoid; -webkit-column-break-inside: avoid;
  background: var(--bg-panel); border: 1px solid var(--border); border-left: 3px solid var(--c);
  border-radius: var(--radius); padding: 14px 16px 10px; margin: 0 0 16px;
  animation: rise .4s ease both; animation-delay: var(--d);
}
.famhead { display: flex; align-items: center; gap: 10px; }
.famdot { width: 10px; height: 10px; border-radius: 50%; background: var(--c); flex: none; }
.famname { font-weight: 700; font-size: 15px; color: var(--text); }
.fammeta { font-size: 11.5px; color: var(--text-3); font-family: var(--mono); }
.famblurb { font-size: 12.5px; color: var(--text-2); margin: 8px 0 8px; line-height: 1.5; }

/* nested tree with connector lines */
.ftree, .ftree ul { list-style: none; margin: 0; padding: 0; }
.ftree ul { padding-left: 14px; }
.ftree li { position: relative; padding-left: 14px; }
.ftree li::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; border-left: 1px solid var(--border); }
.ftree li:last-child::before { bottom: auto; height: 16px; }
.ftree li::after { content: ""; position: absolute; left: 0; top: 16px; width: 10px; border-top: 1px solid var(--border); }
.ftree > li { padding-left: 0; }
.ftree > li::before, .ftree > li::after { display: none; }
.tnode { display: flex; align-items: center; gap: 8px; padding: 4px 7px; border-radius: 5px; color: var(--text-2); }
.tnode:hover { background: var(--bg-hover); color: var(--text); text-decoration: none; }
.tnode .tdot { width: 7px; height: 7px; border-radius: 50%; border: 1.5px solid var(--text-3); flex: none; }
.tnode.done .tdot { background: var(--easy); border-color: var(--easy); }
.tnm { font-size: 13.5px; }
.tnode:hover .tnm { color: var(--text); }
.tyr { margin-left: auto; font-size: 10.5px; color: var(--text-3); font-family: var(--mono); }
.tdiff { font-size: 10px; font-weight: 700; width: 13px; text-align: center; flex: none; }
.tdiff.easy { color: var(--easy); } .tdiff.medium { color: var(--medium); } .tdiff.hard { color: var(--hard); }

@media (max-width: 560px) { .famgrid { columns: 1; } }

/* =================================================================
   Logos — bundled brand marks + aligned monogram fallback tiles
   ================================================================= */
.brand { gap: 8px; }
.brandmark { display: block; flex: none; }

.logo {
  width: 22px; height: 22px; border-radius: 5px; flex: none;
  display: grid; place-items: center; overflow: hidden;
  background: #f4f6f9; box-shadow: inset 0 0 0 1px rgba(0,0,0,.06);
}
.logo img { width: 100%; height: 100%; padding: 3px; object-fit: contain; display: block; }
.logo .mono { font-size: 11px; font-weight: 800; color: var(--c); line-height: 1; font-family: var(--sans); }
.logo.lg { width: 48px; height: 48px; border-radius: 12px; box-shadow: inset 0 0 0 1px rgba(0,0,0,.07); }
.logo.lg img { padding: 9px; }
.logo.lg .mono { font-size: 22px; }

/* table title cell with logo */
.titlewrap { display: flex; align-items: center; gap: 11px; }
.titletext { min-width: 0; }

/* distro header with logo */
.distro-title { align-items: flex-start; flex-wrap: nowrap; gap: 16px; }
.distro-titletext { min-width: 0; }
.distro-titlerow { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.distro-titlerow h1 { font-size: 26px; font-weight: 700; margin: 0; letter-spacing: -0.4px; }
.distro-head .distro-title .lead { margin-top: 8px; }
@media (max-width: 560px) { .logo.lg { width: 40px; height: 40px; } }

/* keep the account avatar aligned and consistent with the logo language */
.auth { gap: 14px; }
.auth .avatar { box-shadow: inset 0 0 0 1px rgba(0,0,0,.12); }

/* =================================================================
   Extra features: select filters, result count, sibling grid
   ================================================================= */
.sel {
  font-family: inherit; font-size: 13px; color: var(--text); cursor: pointer;
  background: var(--bg-panel); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 9px 12px; outline: none;
}
.sel:hover { border-color: var(--border-hi); }
.sel:focus { border-color: var(--border-hi); }
.toolbar .btn { padding: 9px 14px; }

.result-count { margin-left: auto; color: var(--text-3); font-size: 12.5px; font-family: var(--mono); align-self: center; }

.sib-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; margin: 4px 0 8px; }
.sib {
  display: flex; align-items: center; gap: 10px; padding: 9px 12px; color: var(--text-2);
  background: var(--bg-panel); border: 1px solid var(--border); border-radius: var(--radius);
}
.sib:hover { border-color: var(--border-hi); background: var(--bg-hover); color: var(--text); text-decoration: none; }
.sib-nm { font-size: 13.5px; font-weight: 500; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sib .diff { margin-left: auto; font-size: 12px; }
