.tree li { margin: 2px 0; }
.tree .node-row { display: flex; align-items: center; gap: .4rem; padding: .15rem .25rem; border-radius: .4rem; }
.tree .node-row.active { background: rgba(13,110,253,.08); }
.tree .caret { cursor: pointer; user-select: none; width: 1rem; text-align: center; }
.tree .caret::before { content: "▸"; display: inline-block; transform: translateY(-1px); }
.tree .caret.open::before { content: "▾"; }
.tree ul { margin-left: 1.2rem; border-left: 1px dashed #ddd; padding-left: .6rem; }
.add-inline { display: none; margin-left: 1.6rem; }
.add-inline input { height: 2rem; padding: .25rem .5rem; }
.btn-icon { border: none; background: transparent; padding: 0 .25rem; }
.badge + .badge { margin-left: .25rem; }

/* Global loading overlay */
.loading-overlay { position: fixed; inset: 0; background: rgba(255,255,255,.7); display: flex; flex-direction: column; align-items: center; justify-content: center; z-index: 2000; text-align: center; }
.d-none { display: none !important; }

/* Make tree area scrollable */
#tree-root {
  max-height: 65vh; /* fits nicely alongside filters/details */
  overflow-y: auto;
  padding-right: .25rem; /* room for scrollbar */
}

/* Adjacent duplicate title highlight */
.tree .node-row.adjacent-dup { border: 2px solid hotpink; }

/* Split pane layout */
.split-pane { display: flex; gap: 0; align-items: stretch; }
.pane { flex: 0 0 auto; min-width: 200px; }
#pane-tree { width: 35%; max-width: 80%; }
#pane-detail { flex: 1 1 auto; min-width: 280px; }
.splitter { width: 8px; cursor: col-resize; position: relative; background: transparent; }
.splitter::before { content: ""; position: absolute; left: 3px; top: 0; bottom: 0; width: 2px; background: #dee2e6; }
.splitter:hover::before, .splitter.dragging::before { background: #0d6efd; }

@media (max-width: 992px) {
  /* Stack on small screens to avoid awkward resizing */
  .split-pane { flex-direction: column; }
  #pane-tree, #pane-detail { width: auto !important; min-width: 0; }
  .splitter { display: none; }
}


/* Scoped About styles from worms.html */
#page-about .about-container {
    max-width: 720px;
    margin: 24px auto;
}
#page-about .card {
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 1px 4px rgba(0,0,0,.04);
    padding: 16px 18px;
}
#page-about h1 { font-size: 28px; margin: 0 0 12px 0; }
#page-about p { margin: 10px 0; line-height: 1.6; }
#page-about .actions { margin-top: 16px; display:flex; gap: 10px; }
#page-about .btn-link {
    display:inline-block; padding:10px 14px; border-radius:8px; border:1px solid #dcdcdc;
    text-decoration:none; color:#1a73e8; background:#f8faff;
}
#page-about .btn-link:hover { background:#eef4ff; }

/* Scoped FAQ styles from worms.html */
#page-faq .faq-container { max-width: 820px; margin: 24px auto; }
#page-faq .card { border: 1px solid #e5e7eb; border-radius: 12px; background: #fff; box-shadow: 0 1px 4px rgba(0,0,0,.04); padding: 16px 18px; }
#page-faq h1 { font-size: 28px; margin: 0 0 12px 0; }
#page-faq details { border:1px solid #eee; border-radius:10px; padding:10px 12px; margin:10px 0; }
#page-faq summary { cursor:pointer; font-weight:600; }
#page-faq .lang-switch { text-align:right; margin-bottom:8px; }
#page-faq .lang-switch a { text-decoration:none; color:#1a73e8; padding:2px 4px; }
#page-faq .small-muted { color:#6b7280; font-size: 12px; }
#page-faq .btn-link { display:inline-block; padding:10px 14px; border-radius:8px; border:1px solid #dcdcdc; text-decoration:none; color:#1a73e8; background:#f8faff; }
#page-faq .btn-link:hover { background:#eef4ff; }
/* Scoped RTL adjustments */
#page-faq { direction: ltr; text-align: left; }
#page-faq.rtl { direction: rtl; text-align: right; }
#page-faq.rtl .lang-switch { text-align: left; }

/* Scoped Tag Policy styles from worms.html */
#page-tag-policy .policy-container { max-width: 820px; margin: 24px auto; }
#page-tag-policy .card { border: 1px solid #e5e7eb; border-radius: 12px; background: #fff; box-shadow: 0 1px 4px rgba(0,0,0,.04); padding: 16px 18px; }
#page-tag-policy .lang-switch { text-align:right; margin-bottom:8px; }
#page-tag-policy .lang-switch a { text-decoration:none; color:#1a73e8; padding:2px 4px; }
#page-tag-policy .btn-link { display:inline-block; padding:10px 14px; border-radius:8px; border:1px solid #dcdcdc; text-decoration:none; color:#1a73e8; background:#f8faff; }
#page-tag-policy .btn-link:hover { background:#eef4ff; }
#page-tag-policy { direction: ltr; text-align: left; }
#page-tag-policy.rtl { direction: rtl; text-align: right; }
#page-tag-policy.rtl .lang-switch { text-align: left; }
