/* The original v6 controls and cloned v7 controls have separate groups. */
.mode-switch-top .mode-group { display: flex; flex: 1 1 0; min-width: 0; gap: 10px; }
.mode-switch-top .mode-group-v7 { border-left: 1px solid var(--border, #eadbd0); padding-left: 14px; }
.mode-switch-top .mode-group .mode-btn { display: flex; align-items: center; justify-content: center; min-width: 0; box-sizing: border-box; text-align: center; text-decoration: none; white-space: nowrap; }
@media (max-width: 700px) {
  .mode-switch-top { flex-wrap: wrap; }
  .mode-switch-top .mode-group { flex: 1 1 100%; gap: 8px; }
  .mode-switch-top .mode-group-v7 { border-left: 0; border-top: 1px solid var(--border, #eadbd0); padding: 8px 0 0; }
  .mode-switch-top .mode-group .mode-btn { font-size: 12.5px; padding: 11px 2px; letter-spacing: 0; }
}
.result.mode-database .tab-content#tab-coverage { display: none !important; }
.result.mode-database .tab-content#tab-coverage.active,
.result.mode-database .tab-content#tab-mother-tree.active { display: block !important; }
.result.mode-database .tab-content#tab-mother-tree:not(.active) { display: none !important; }
.result:not(.mode-database) .tab-content#tab-mother-tree { display: none !important; }
.result .tabs .tab[data-pname="mother-tree"] { display: none !important; }

.v6-tree { color: var(--ink-2, #453b33); line-height: 1.6; }
.v6-tree button, .v6-tree input { font: inherit; }
.v6-tree-header { display: flex; justify-content: space-between; align-items: start; gap: 16px; margin-bottom: 18px; }
.v6-tree-header h2 { margin: 0 0 6px; font-size: 1.55rem; color: var(--ink, #332922); }
.v6-tree-header p { margin: 0; font-size: .91rem; }
.v6-tree-download, .v6-tree-more { flex-shrink: 0; border: 1px solid var(--accent-light, #d5bca5); border-radius: 999px; background: var(--card-2, #fff9f4); color: var(--ink-2, #453b33); padding: 8px 14px; text-decoration: none; cursor: pointer; font-weight: 600; }
.v6-tree-toolbar { display: grid; grid-template-columns: auto minmax(180px, 1fr) auto; align-items: center; gap: 10px; margin-bottom: 18px; }
.v6-tree-toolbar label { font-weight: 600; }
.v6-tree-toolbar input { min-width: 0; width: 100%; border: 1px solid var(--accent-light, #d5bca5); border-radius: 8px; padding: 10px 12px; background: #fff; color: #332922; }
.v6-tree-toolbar span { color: var(--muted, #766b63); font-size: .88rem; }
.v6-tree-layout { display: grid; grid-template-columns: minmax(210px, 26%) minmax(0, 1fr); gap: 18px; }
.v6-tree-chapters, .v6-tree-detail { background: var(--card-2, #fff9f4); border: 1px solid var(--border, #eadbd0); border-radius: 12px; padding: 16px; min-width: 0; }
.v6-tree-chapters h3 { margin: 0 0 8px; font-size: 1rem; }
.v6-tree-chapters > div { max-height: 65vh; overflow: auto; }
.v6-tree-chapters button { display: block; width: 100%; padding: 9px 10px; text-align: left; border: 0; border-radius: 8px; background: none; cursor: pointer; color: inherit; }
.v6-tree-chapters button:hover, .v6-tree-chapters button.active { background: var(--accent-light, #ead4bf); }
.v6-tree-id { font-family: ui-monospace, Consolas, monospace; white-space: nowrap; font-size: .85rem; color: #71583e; }
.v6-tree-path { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 12px; }
.v6-tree-path button { background: none; border: 0; color: #785333; cursor: pointer; padding: 3px 4px; text-decoration: underline; }
.v6-tree-node-title { margin: 0 0 8px; font-size: 1.24rem; overflow-wrap: anywhere; }
.v6-tree-node-note { margin: 0 0 16px; color: var(--muted, #766b63); }
.v6-tree-children-title { margin: 12px 0 8px; font-size: 1rem; }
.v6-tree-list { list-style: none; margin: 0; padding: 0; }
.v6-tree-list li + li { border-top: 1px solid var(--border, #eadbd0); }
.v6-tree-list button { display: block; width: 100%; text-align: left; background: transparent; color: inherit; border: 0; padding: 10px 4px; cursor: pointer; overflow-wrap: anywhere; }
.v6-tree-list button:hover { color: #9b653a; }
.v6-tree-list .v6-tree-id { margin-right: 9px; }
.v6-tree-more { margin-top: 10px; }
.v6-tree-results { border: 1px solid var(--border, #eadbd0); background: #fff; border-radius: 12px; padding: 12px 16px; margin: 0 0 18px; }
.v6-tree-results h3 { font-size: 1rem; margin: 0 0 6px; }
.v6-tree-results .v6-tree-list { max-height: 360px; overflow: auto; }
@media (max-width: 760px) {
  .v6-tree-header { flex-direction: column; }
  .v6-tree-toolbar { grid-template-columns: 1fr; }
  .v6-tree-layout { grid-template-columns: 1fr; }
  .v6-tree-chapters > div { max-height: 180px; }
  .v6-tree-chapters, .v6-tree-detail { padding: 12px; }
}
