/* Local tree-first landing preview. The source controls remain in the DOM. */
body { --bg: #f7f9fb; --panel: #fbfcfe; --panel-border: #e0e6ec; --text: #253445; --muted: #637285; --accent: #3768a4; --accent-soft: #ecf3fa; --link: #3768a4; }
.topbar {
  min-height: 59px;
  justify-content: flex-start;
  gap: 1rem;
  padding: .55rem 1.45rem;
  border-bottom: 0;
  background: #fbfcfe;
}
.topbar .brand h1 { margin: 0; font-size: .94rem; letter-spacing: .01em; font-weight: 700; color: #3b4f65; }
.topbar .subtitle { display: none; }
.sidebar-toggle {
  width: 34px; height: 34px; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 4px; border: 0; border-radius: 9px; background: transparent; color: #52677f; cursor: pointer;
}
.sidebar-toggle:hover, .sidebar-toggle:focus-visible { background: #eaf0f6; outline: none; }
.sidebar-toggle span { width: 17px; height: 1.5px; border-radius: 2px; background: currentColor; }
.site-sidebar {
  position: fixed; z-index: 110; inset: 0 auto 0 0; width: min(345px, 90vw); overflow-y: auto;
  padding: 1.15rem 1rem 2rem; background: #f9fbfd; border-right: 1px solid #d9e3ed;
  box-shadow: 12px 0 40px rgba(30, 48, 70, .13); transform: translateX(-105%);
  visibility: hidden; transition: transform .22s ease, visibility .22s ease;
}
.sidebar-open .site-sidebar { transform: translateX(0); visibility: visible; }
.sidebar-scrim { position: fixed; z-index: 109; inset: 0; background: rgba(26, 40, 55, .28); }
.sidebar-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.15rem; padding: 0 .35rem; color: #344c66; }
.sidebar-head strong { font-size: 1rem; }
.sidebar-head button { border: 0; background: transparent; color: #536c85; font-size: 1.55rem; cursor: pointer; }
.sidebar-section { padding: .75rem .35rem; border-top: 1px solid #e5ebf1; }
.sidebar-section:empty { display: none; }
.sidebar-section > button, .sidebar-section > select { margin: .25rem .3rem .25rem 0; }
.sidebar-section .view-tabs { margin: .3rem 0; padding: 0; }
.sidebar-section .view-tab { padding: .45rem .3rem; font-size: .82rem; }
.sidebar-section .oncotree-topbar { display: block; }
.sidebar-section .oncotree-title { margin: 0 0 .45rem; font-size: .78rem; letter-spacing: .1em; text-transform: uppercase; color: #718499; }
.sidebar-section .oncotree-toolbar { margin: .1rem 0; }
.sidebar-section .topbar-links { align-items: flex-start; text-align: left; max-width: none; gap: .65rem; }
.sidebar-section .topbar-links a, .sidebar-section > nav a, .sidebar-section > footer a { color: #466b98; }
.sidebar-section > footer[style], .sidebar-section > nav[aria-label] { padding: .5rem .2rem !important; text-align: left !important; }
.sidebar-section .privacy-banner { border: 0; border-radius: 10px; padding: .8rem; font-size: .78rem; }
.sidebar-section .responsible-use { padding: .55rem 0; border: 0; background: none; }
.sidebar-section .bottom-stack-toggle { padding: .3rem 0; border: 0; background: none; }
.sidebar-section .bottom-stack { display: block; }
.sidebar-section .controls-summary-hint { display: none; }
.sidebar-section .global-feedback { margin-top: .75rem; }
.sidebar-section .query-overlay-model { display: block; max-width: 100%; }
.sidebar-section .query-overlay-debug { margin-top: .5rem; }

.query-overlay, body[data-active-view="tutor"] .query-overlay {
  position: sticky; top: 0; z-index: 45; display: grid; grid-template-columns: minmax(0, min(850px, calc(100vw - 170px))) auto;
  justify-content: center; align-items: center; gap: .55rem .65rem;
  padding: .48rem 1rem .6rem; background: rgba(251, 252, 254, .96); border-bottom: 1px solid #e6ecf2;
  box-shadow: none;
}
.query-overlay .query-input-wrap { width: 100%; min-width: 0; }
.query-overlay #query-input { height: 46px; border: 1px solid #d8e2ec; border-radius: 15px; padding-left: 3.1rem; font-size: .93rem; box-shadow: 0 3px 13px rgba(44, 66, 90, .085); }
.query-overlay #query-input:focus { outline: 2px solid #88a9d2; outline-offset: 0; }
.query-highlight-overlay, body[data-active-view="tutor"] .query-highlight-overlay { border-radius: 15px; padding-left: 3.1rem; background: #fff; box-shadow: 0 3px 13px rgba(44, 66, 90, .085); }
.query-search-icon { position: absolute; z-index: 3; left: 1.15rem; top: 50%; transform: translateY(-50%); display: flex; color: #8193a5; pointer-events: none; }
.query-overlay #send-btn { min-width: 80px; height: 43px; padding: .4rem .9rem; border-radius: 13px; background: #486fa2; border-color: #486fa2; color: #fff; font-weight: 650; }
.search-actions { grid-column: 1 / -1; display: flex; justify-content: center; flex-wrap: wrap; gap: .35rem; }
.search-action { border: 1px solid transparent; border-radius: 999px; padding: .27rem .68rem; color: #78899b; background: transparent; font-size: .76rem; cursor: pointer; }
.search-action:hover, .search-action:focus-visible { color: #355f93; background: #edf3f9; }
.search-action.active { color: #345d90; background: #e8f0f8; border-color: #d9e5f1; font-weight: 700; }
.search-action.update-action { color: #587b9d; }
.query-overlay .input-privacy-warning { grid-column: 1 / -1; text-align: center; font-size: .7rem; color: #8b806b; }

.layout, .chat-panel { background: #fbfcfe; }
.chat-panel > .view-tabs { display: none; }
.view-panel#browse-view { padding: .25rem clamp(.8rem, 2.5vw, 2.5rem) 2rem; background: #fbfcfe; }
.browse-breadcrumbs:empty { display: none; }
.oncotree-container { border: 0; border-radius: 0; background: transparent; margin-top: .1rem; }
.oncotree-node { color: #43576b; transition: opacity .2s, color .2s, background .2s; }
.oncotree-node.oncotree-group .oncotree-label { color: #698092; }
.oncotree-node.oncotree-supergroup .oncotree-label { color: #6981a0; }
body[data-active-view="browse"]:not(.ui-engaged) .oncotree-node { opacity: .55; }
body[data-active-view="browse"]:not(.ui-engaged) .oncotree-links { opacity: .45; }
body[data-active-view="browse"] .oncotree-node:hover, body[data-active-view="browse"] .oncotree-node:focus-visible { opacity: 1; color: #254f80; background: #eaf2fa; }
body[data-active-view="browse"] .oncotree-node.oncotree-match { opacity: 1; }
.page-search-results { width: min(880px, 100%); align-self: center; margin: .9rem auto 1.5rem; padding: 1.2rem; border: 1px solid #e1e9f1; border-radius: 18px; background: #fff; box-shadow: 0 9px 25px rgba(44, 66, 90, .06); }
.search-results-head { margin-bottom: .85rem; }
.search-results-head h2 { margin: .2rem 0 .45rem; font-size: 1.1rem; color: #344b63; }
.search-results-head p, .page-search-results > p { margin: .3rem 0 .7rem; color: #66788b; font-size: .88rem; line-height: 1.5; }
.search-results-eyebrow { color: #718daa; font-size: .7rem; font-weight: 750; letter-spacing: .09em; text-transform: uppercase; }
.saved-result { width: 100%; display: flex; flex-direction: column; gap: .25rem; padding: .75rem .8rem; border: 0; border-top: 1px solid #e7edf3; background: transparent; color: #41566d; text-align: left; cursor: pointer; }
.saved-result:hover, .saved-result:focus-visible { background: #f1f6fb; }
.saved-result strong { color: #365d8a; font-size: .9rem; }
.saved-result small { color: #8191a3; font-size: .72rem; }
.saved-result span { color: #738396; font-size: .8rem; line-height: 1.4; }
.saved-page-missing { max-width: 750px; padding: 1.2rem; border: 1px solid #e0e9f2; border-radius: 14px; background: #fff; color: #44586f; }
.saved-page-missing p { margin: .5rem 0 0; color: #718398; line-height: 1.5; }
body[data-active-view="tutor"] #tutor-view { background: #fbfcfe; }
body[data-active-view="tutor"] .tutor-toolbar { display: none; }
body[data-active-view="tutor"] .tutor-context { margin-top: 1rem; }

@media (max-width: 720px) {
  .topbar { min-height: 52px; padding: .4rem .75rem; }
  .query-overlay, body[data-active-view="tutor"] .query-overlay { grid-template-columns: minmax(0, 1fr) auto; padding: .4rem .6rem .55rem; }
  .query-overlay #query-input { font-size: .86rem; }
  .query-overlay #send-btn { min-width: 62px; }
  .search-actions { justify-content: flex-start; }
  .query-overlay .input-privacy-warning { text-align: left; }
  .view-panel#browse-view { padding: .2rem .5rem 1.5rem; }
}
@media (prefers-reduced-motion: reduce) {
  .site-sidebar, .oncotree-node { transition: none; }
}
#page-search-results.hidden { display: none !important; }

/* Keep only controls that perform an available action in the current mode. */
.global-feedback [data-global-feedback], .query-overlay-debug, #controls-details { display: none !important; }
body[data-active-view="tutor"] #sidebar-tree-tools, body[data-active-view="tutor"] .update-action { display: none !important; }
body[data-active-view="browse"] #tutor-reset { display: none !important; }
.sidebar-control-label { margin: 0 0 .35rem; color: #74869a; font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .045em; }
.tutor-retry { margin-top: .5rem; }
.saved-manual-page { border-top: 1px solid #e1e9f1; padding: .85rem 0; }
.saved-manual-page > summary { color: #365d8a; font-weight: 650; cursor: pointer; }
.saved-manual-continuation { color: #738396; font-size: .8rem; margin-top: .8rem; }
.saved-manual-text { white-space: pre-wrap; color: #41566d; line-height: 1.65; font-size: .9rem; margin: 1rem 0; }
.saved-manual-figures { display: flex; flex-wrap: wrap; gap: .8rem; }
.saved-manual-figures img { display: block; max-width: 100%; width: 260px; max-height: 300px; object-fit: contain; border: 1px solid #e1e9f1; border-radius: 8px; background: white; }
