.simplified-dashboard { align-items: start; }
.sidebar { overflow-y: auto; scrollbar-width: none; -ms-overflow-style: none; }
.sidebar::-webkit-scrollbar { display: none; width: 0; height: 0; }
.sidebar,.page { transition: width .18s ease,margin-left .18s ease,padding .18s ease; }
.sidebar-brand { gap: 10px; }
.sidebar-logo-toggle { display: grid; flex: 0 0 auto; place-items: center; width: 38px; height: 38px; padding: 0; border: 0; background: transparent; cursor: pointer; }
.sidebar-logo-toggle img { transition: transform .15s ease; }
.sidebar-logo-toggle:hover img { transform: scale(1.06); }
.sidebar-brand-title { white-space: nowrap; }
body.sidebar-collapsed .sidebar { width: 64px; padding-inline: 9px; overflow-x: hidden; overflow-y: auto; overscroll-behavior-y: contain; }
body.sidebar-collapsed .page { margin-left: 64px; }
body.sidebar-collapsed .sidebar .brand { justify-content: center; padding-inline: 0; }
body.sidebar-collapsed .sidebar-brand-title { display: none; }
.sidebar-nav { align-content: start; }
.sidebar-icon-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.sidebar-primary-link,.sidebar-catalog-tree > summary { display: flex; align-items: center; gap: 11px; }
.sidebar-nav-icon { width: 20px; height: 20px; flex: 0 0 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
body.sidebar-collapsed .sidebar-nav { display: grid; justify-items: center; gap: 7px; }
body.sidebar-collapsed .sidebar-primary-link,body.sidebar-collapsed .sidebar-catalog-tree > summary { width: 44px; height: 44px; justify-content: center; padding: 0; border-radius: 12px; }
body.sidebar-collapsed .sidebar-primary-link > span,body.sidebar-collapsed .sidebar-catalog-tree > summary > span,body.sidebar-collapsed .sidebar-catalog-tree > summary::after,body.sidebar-collapsed .sidebar-catalog-tree > .sidebar-tree-level { display: none; }
body.sidebar-collapsed .sidebar-catalog-tree { position: relative; width: 44px; }
body.sidebar-collapsed .sidebar-catalog-tree[open] > summary { background: #e5efff; color: var(--blue); }
body.sidebar-collapsed .sidebar-catalog-tree[open] > .sidebar-tree-level { display: grid; position: fixed; z-index: 40; top: var(--sidebar-catalog-top, 80px); left: 64px; width: min(370px,calc(100vw - 82px)); max-height: calc(100vh - 96px); margin: 0; padding: 14px; overflow-y: auto; scrollbar-width: none; border: 1px solid var(--border); border-radius: 16px; background: #fff; box-shadow: 0 16px 46px rgba(31,49,80,.18); }
body.sidebar-collapsed .sidebar-catalog-tree[open] > .sidebar-tree-level::-webkit-scrollbar { display: none; }
.sidebar-catalog-tree { color: #445066; }
.sidebar-catalog-tree > summary { position: relative; list-style: none; cursor: pointer; padding: 11px 34px 11px 14px; border-radius: 10px; }
.sidebar-catalog-tree > summary::-webkit-details-marker,.sidebar-tree-node > summary::-webkit-details-marker { display: none; }
.sidebar-catalog-tree > summary::after,.sidebar-tree-node > summary::after { content: '›'; position: absolute; right: 13px; top: 50%; transform: translateY(-50%); color: #8993a3; transition: transform .15s ease; }
.sidebar-catalog-tree[open] > summary::after,.sidebar-tree-node[open] > summary::after { transform: translateY(-50%) rotate(90deg); }
.sidebar-catalog-tree > summary:hover,.sidebar-tree-node > summary:hover { background: #edf4ff; color: var(--blue); }
.sidebar-tree-level { display: grid; gap: 2px; margin: 3px 0 5px 10px; padding-left: 8px; border-left: 1px solid #e5e9f0; }
.sidebar-catalog-tree .sidebar-all-link,.sidebar-catalog-tree .sidebar-category-link { margin: 0; padding: 7px 9px; font-size: 13px; color: var(--blue); }
.sidebar-tree-node > summary { position: relative; list-style: none; cursor: pointer; padding: 8px 28px 8px 9px; border-radius: 8px; font-size: 13px; line-height: 1.35; }
.sidebar-group-node > summary { color: #59657a; }
.sidebar-question-list { display: grid; margin: 2px 0 5px 8px; padding-left: 7px; border-left: 1px solid #e8ebf1; }
.sidebar-question-list a { display: grid; grid-template-columns: auto minmax(0,1fr); gap: 6px; margin: 0; padding: 7px 8px; font-size: 12px; line-height: 1.35; }
.sidebar-question-list a b { color: var(--blue); font-weight: 700; }
.sidebar-question-list a span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-question-list a.active { background: #e5efff; color: #234f99; box-shadow: inset 3px 0 0 var(--blue); }
.sidebar-question-list a.active b { color: #234f99; }
.sidebar-question-list small,.sidebar-tree-level > small { padding: 7px 9px; color: var(--muted); }
.source-status-row > span:first-child { display: grid; gap: 3px; }
.processing-status { display: inline-flex; align-items: center; width: fit-content; border-radius: 999px; padding: 4px 9px; background: #eef2f7; color: #5d6879; font-size: 12px; white-space: nowrap; }
.processing-status.ready { background: #e9f7ee; color: #287647; }
.processing-status.processing,.processing-status.queued { background: #edf3ff; color: #315da8; }
.processing-status.failed { background: #fff0f0; color: #a12e2e; }
.category-card-grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(260px,1fr)); gap: 16px; }
.category-card { display: grid; gap: 12px; min-height: 150px; align-content: center; transition: transform .15s ease,box-shadow .15s ease; }
.category-card:hover { transform: translateY(-2px); }
.category-card h2,.category-card p { margin: 0; }
.category-card p { color: var(--muted); }
.category-card span { color: var(--blue); font-weight: 650; }
.category-content-grid { display: grid; grid-template-columns: minmax(0,1.6fr) minmax(280px,.7fr); gap: 18px; align-items: start; }
.group-block + .group-block { margin-top: 22px; }
.group-block { scroll-margin-top: 24px; }
.group-block h3 { margin: 0 0 8px; }
.simple-dialog { width: min(560px,calc(100vw - 28px)); border: 0; border-radius: 18px; padding: 22px; box-shadow: 0 24px 80px rgba(20,35,60,.22); }
.simple-dialog::backdrop { background: rgba(20,29,45,.38); }
.dialog-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.dialog-head h2 { margin: 0; }
.dialog-x { border: 0; background: transparent; font-size: 26px; color: var(--muted); cursor: pointer; }
.stack-form { display: grid; gap: 14px; }
.stack-form label { display: grid; gap: 6px; font-size: 14px; font-weight: 650; }
.stack-form input,.stack-form textarea { width: 100%; border: 1px solid var(--border); border-radius: 10px; padding: 11px 12px; background: #fff; }
.source-section-list { display: grid; gap: 18px; }
.source-section-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.page-head .head-actions { flex-wrap: wrap; justify-content: flex-end; }
.source-detail-head { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: start; gap: 28px; }
.source-title-block { min-width: 0; }
.source-title-block h1 { overflow-wrap: anywhere; line-height: 1.24; }
.source-action-bar { display: flex; align-items: center; gap: 9px; white-space: nowrap; }
.source-action-bar > .button,.source-more-menu > summary { min-height: 40px; padding: 8px 13px; border-radius: 9px; font-size: 14px; }
.source-more-menu { position: relative; }
.source-more-menu > summary { list-style: none; }
.source-more-menu > summary::-webkit-details-marker { display: none; }
.source-more-menu > summary::after { content: '›'; display: inline-block; margin-left: 7px; transform: rotate(90deg); color: var(--muted); }
.source-more-popover { position: absolute; z-index: 20; top: calc(100% + 8px); right: 0; width: 156px; padding: 6px; border: 1px solid var(--border); border-radius: 11px; background: #fff; box-shadow: 0 14px 38px rgba(25,39,68,.16); }
.source-more-popover form { margin: 0; }
.source-more-popover button { width: 100%; border: 0; border-radius: 7px; padding: 10px 11px; background: transparent; color: var(--text); text-align: left; cursor: pointer; }
.source-more-popover button:hover { background: #f2f5fa; }
.source-more-popover .menu-danger { color: #a13434; }
.source-more-popover .menu-danger:hover { background: #fff0f0; }
.source-section { padding: 0; overflow: hidden; }
.source-section > header { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 17px 20px; border-bottom: 1px solid var(--border); background: #fbfcfe; }
.source-section > header h2 { margin: 0 0 4px; font-size: 17px; }
.source-section > header p { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 0; color: var(--muted); font-size: 13px; }
.source-section-content { min-height: 0; padding: 22px; }
.source-section-content > :first-child { margin-top: 0; }
.source-section-content > :last-child { margin-bottom: 0; }
.source-section-content figure { margin: 18px 0; text-align: center; }
.source-section-content figcaption { color: var(--muted); font-size: 12px; }
.source-section-content table { width: 100%; border-collapse: collapse; margin: 16px 0; }
.source-section-content th,.source-section-content td { border: 1px solid #d9dee8; padding: 10px 12px; vertical-align: top; }
.source-section-content th { background: #eef3fa; }
.source-section-note { margin: 0; padding: 12px 20px; border-top: 1px solid var(--border); color: var(--muted); font-size: 13px; }
.processing-panel { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; padding: 18px 20px; border: 1px solid #cfdcf2; border-radius: 14px; background: #f4f8ff; }
.processing-panel p { margin: 4px 0 0; color: var(--muted); }
.spinner { width: 22px; height: 22px; border: 3px solid #cdd9ed; border-top-color: var(--blue); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.processing-summary { display: flex; flex-wrap: wrap; gap: 10px 22px; margin-bottom: 18px; padding: 13px 16px; border-radius: 12px; background: #edf7f0; color: #356548; }
.section-result-list { display: grid; }
.section-result-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 0; border-bottom: 1px solid var(--border); }
.section-result-row:last-child { border-bottom: 0; }
.section-result-row > div { display: grid; gap: 4px; }
.section-result-row small { color: var(--muted); }
.source-table { display: grid; }
.source-table-head,.source-table-row { display: grid; grid-template-columns: minmax(260px,1.6fr) minmax(150px,.7fr) 120px 150px; align-items: center; gap: 15px; padding: 12px 8px; }
.source-table-head { color: var(--muted); font-size: 12px; border-bottom: 1px solid var(--border); }
.source-table-row { border-bottom: 1px solid var(--border); }
.source-table-row:hover { background: #f8faff; }
.source-table-row > span:first-child { display: grid; gap: 4px; }
.source-table-row small { color: var(--muted); }
@media(max-width:900px){.category-content-grid{grid-template-columns:1fr}.source-table-head{display:none}.source-table-row{grid-template-columns:1fr auto;gap:7px}.source-table-row>span:nth-child(2){display:none}.source-table-row>span:last-child{grid-column:1/-1;color:var(--muted);font-size:12px}.source-section>header{align-items:flex-start}.source-section-content{padding:17px}.source-section-content table{display:block;overflow-x:auto}.source-detail-head{grid-template-columns:1fr;gap:14px}.source-action-bar{white-space:normal;flex-wrap:wrap}.source-action-bar>.button{flex:1}.source-more-menu{flex:0 0 auto}}
@media(max-width:800px){body.sidebar-collapsed .page{margin-left:0}}

/* mobile-document-width-v1: do not disable local diagram interactions */
@media(max-width:800px){
html,body{max-width:100%;overflow-x:hidden;overflow-x:clip;overscroll-behavior-x:none}
.page{width:100%;min-width:0;max-width:100%}
.page>*,.card,.reading-content,.source-section,.source-section-content{min-width:0;max-width:100%}
.reading-content,.source-section-content{overflow-wrap:anywhere}
.reading-content img,.source-section-content img,iframe{max-width:100%}
.page-head,.head-actions,.quick-actions,.card-head{flex-wrap:wrap}
.tabs{flex-wrap:wrap;overflow:visible}
.bottom-nav a{min-width:0;overflow-wrap:anywhere}
}
