:root{--blue950:#102a56;--blue800:#18468f;--blue100:#e9f0fb;--red700:#a3212d;--red100:#fae8e9;--paper:#f8f6f0;--surface:#fff;--ink:#172033;--muted:#657086;--line:#d7dce5;--shadow:0 8px 24px rgba(19,38,75,.12)}
*{box-sizing:border-box}html,body{height:100%}body{margin:0;color:var(--ink);background:var(--paper);font-family:Arial,Helvetica,sans-serif;overflow:hidden}button,input,select{font:inherit}button{cursor:pointer}
.site-header{min-height:72px;display:flex;align-items:center;justify-content:flex-start;gap:24px;padding:10px 22px;color:#fff;background:linear-gradient(100deg,var(--blue950),var(--blue800));border-bottom:4px solid var(--red700)}
.brand{display:flex;align-items:center;gap:12px;padding:0;color:inherit;text-align:left;border:0;background:transparent}.brand-mark{width:43px;height:43px;display:grid;place-items:center;border:1px solid rgba(255,255,255,.58);border-radius:50%;font:700 27px/1 Georgia,serif;background:rgba(255,255,255,.08)}.brand strong{display:block;font:700 25px/1.05 Georgia,serif}.brand small{display:block;margin-top:3px;color:#dce7fa;font-size:12px}
.header-actions{flex:1;display:flex;align-items:center;gap:20px}.volume-label{display:flex;align-items:center;gap:8px;font-size:13px;font-weight:700}.volume-label select{min-width:190px;padding:8px 10px;color:var(--ink);border:0;border-radius:5px;background:#fff}.text-button{margin-left:auto;padding:8px 0;color:#fff;border:0;border-bottom:1px solid #a9c5f6;background:none}
.toolbar{position:relative;height:54px;display:flex;align-items:center;gap:9px;padding:7px 16px;background:var(--surface);border-bottom:1px solid var(--line);box-shadow:0 2px 8px rgba(24,47,88,.06)}
.toolbar button,.view-switch button{min-width:38px;height:36px;padding:0 12px;color:var(--blue950);border:1px solid #b8c4d7;border-radius:5px;background:#fff;font-weight:700}.toolbar button:hover,.view-switch button:hover{background:var(--blue100)}.toolbar label{display:flex;align-items:center;gap:7px;color:var(--muted);font-size:13px}.toolbar input{width:78px;height:36px;padding:5px 8px;border:1px solid #b8c4d7;border-radius:5px}.toolbar-spacer{flex:1}.display-controls{position:absolute;left:50%;display:flex;align-items:center;gap:9px;transform:translateX(-50%)}.view-switch{display:flex}.view-switch button{border-radius:0}.view-switch button:first-child{border-radius:5px 0 0 5px}.view-switch button:last-child{margin-left:-1px;border-radius:0 5px 5px 0}.view-switch button.active{color:#fff;border-color:var(--blue800);background:var(--blue800)}.zoom-controls{display:flex}.zoom-controls button{min-width:36px;padding:0 9px;border-radius:0}.zoom-controls button:first-child{border-radius:5px 0 0 5px}.zoom-controls button+button{margin-left:-1px}.zoom-controls button:last-child{border-radius:0 5px 5px 0}.toolbar button:disabled{cursor:default;opacity:.45}.location-label{color:var(--muted);font-size:13px}.download-link{color:var(--red700);font-size:13px;font-weight:700;text-decoration:none}.download-link:hover{text-decoration:underline}
.workspace{height:calc(100% - 126px);display:grid;grid-template-columns:minmax(285px,355px) 1fr}.sidebar{min-width:0;background:var(--surface);border-right:1px solid var(--line);overflow:hidden}.sidebar-tabs{height:48px;display:grid;grid-template-columns:repeat(3,1fr);border-bottom:1px solid var(--line)}.sidebar-tabs.contents-hidden{grid-template-columns:repeat(2,1fr)}.sidebar-tabs button{color:var(--muted);border:0;border-bottom:3px solid transparent;background:#fff;font-weight:700}.sidebar-tabs button:hover{color:var(--blue800);background:#f7f9fc}.sidebar-tabs button.active{color:var(--blue800);border-bottom-color:var(--red700)}
.side-panel{height:calc(100% - 48px);display:none;overflow:hidden}.side-panel.active{display:flex;flex-direction:column}.filter-label,.search-form{padding:14px;border-bottom:1px solid var(--line);color:var(--muted);font-size:12px;font-weight:700}.filter-label input,.search-form .search-query input{width:100%;margin-top:7px;padding:10px 11px;border:1px solid #b8c4d7;border-radius:5px}.navigation-list{flex:1;padding:8px 0 24px;overflow:auto}.nav-item{display:flex;align-items:flex-start;gap:8px;padding:7px 12px;border-bottom:1px solid #eef0f4}.nav-item.level-1{padding-left:30px}.nav-item.level-2{padding-left:48px}.nav-item.level-3{padding-left:66px}.register-item.level-1 .nav-title,.register-item.level-2 .nav-title,.register-item.level-3 .nav-title{color:#4d586c}.nav-item:hover{background:#f4f7fc}.nav-title{flex:1;font:14px/1.35 Georgia,serif}.page-links{display:flex;flex-wrap:wrap;justify-content:flex-end;gap:3px}.page-link,.page-label{padding:2px 5px;color:var(--red700);border:0;border-radius:3px;background:var(--red100);font-size:12px;font-weight:700}.external-page-link{text-decoration:none}.register-letter{position:sticky;top:0;z-index:1;padding:7px 12px;color:#fff;background:var(--blue800);font:700 17px Georgia,serif}.register-heading{padding:10px 12px 5px;color:var(--blue950);background:#f7f9fc;border-bottom:1px solid #eef0f4;font:700 15px Georgia,serif}.loading,.empty,.notice{padding:18px;color:var(--muted);font-style:italic}
.search-form{display:grid;grid-template-columns:1fr auto auto;align-items:end;gap:10px}.search-query{grid-column:1/-1}.search-form label{font-size:12px}.search-form button{height:38px;padding:0 14px;color:#fff;border:0;border-radius:5px;background:var(--blue800);font-weight:700}.search-form .secondary-button{color:var(--blue800);border:1px solid #b8c4d7;background:#fff}.search-form .secondary-button:hover{background:#f4f7fc}.search-options{grid-column:1/-1;display:flex;flex-wrap:wrap;gap:7px 14px;margin:0;padding:8px 10px;border:1px solid #d7dce5;border-radius:5px}.search-options legend{padding:0 4px;color:var(--blue950);font-size:11px}.search-options label{display:flex;align-items:center;gap:5px;color:#3f4757;font-weight:400}.search-options input{margin:0;accent-color:var(--blue800)}.search-help,.search-status{margin:10px 14px 0;color:var(--muted);font-size:12px;line-height:1.45}.search-results{flex:1;overflow:auto;padding:8px 0 24px}.unified-result{padding:11px 14px;border-bottom:1px solid #e7eaf0;background:#fff}.unified-result:hover{background:#f7f9fc}.unified-result-heading{display:flex;align-items:flex-start;justify-content:space-between;gap:8px;margin-bottom:7px}.unified-result-heading strong{color:var(--red700);font-size:12px;line-height:1.35}.source-badges{display:flex;flex-wrap:wrap;justify-content:flex-end;gap:4px}.source-badge{padding:2px 5px;color:var(--blue800);border:1px solid #cbd5e5;border-radius:3px;background:#f3f6fb;font-size:10px;font-weight:700}.unified-title,.unified-context,.unified-snippet{display:block}.unified-title{margin-bottom:5px;color:#283247;font:14px/1.4 Georgia,serif}.unified-context{margin:-2px 0 6px;color:var(--muted);font:italic 12px/1.35 Georgia,serif}.unified-snippet{margin:7px 0;color:#3f4757;font:13px/1.45 Georgia,serif}.unified-result .page-links{justify-content:flex-start;margin-top:7px}.search-mark,.ocr-content mark{padding:0 .06em;color:inherit;background:#ffe66a;box-shadow:0 0 0 1px rgba(176,130,0,.18)}
.viewer{min-width:0;position:relative;background:#dfe3e9;overflow:hidden}.view-pane{position:absolute;inset:0;display:none}.view-pane.active{display:block}.pdf-stage{width:100%;height:100%;padding:26px;overflow:auto;text-align:center;background:#cfd5de}.scan-page{position:relative;display:none;width:max-content;margin:0 auto;background:#fff;box-shadow:0 8px 28px rgba(12,30,62,.25)}.scan-page.ready{display:block}.scan-page canvas{display:block;background:#fff}.scan-highlights{position:absolute;inset:0;pointer-events:none;overflow:hidden}.scan-highlight{position:absolute;border-radius:2px;background:rgba(255,220,40,.42);box-shadow:0 0 0 1px rgba(198,145,0,.38);mix-blend-mode:multiply}.pdf-status{max-width:520px;margin:22vh auto 0;padding:18px 22px;color:var(--blue950);border-radius:6px;background:rgba(255,255,255,.9);line-height:1.5}.pdf-status.error{color:var(--red700)}.ocr-toolbar{height:46px;display:flex;align-items:center;gap:7px;padding:7px 14px;background:#fff;border-bottom:1px solid var(--line)}.ocr-toolbar button{height:31px;min-width:38px;color:var(--blue950);border:1px solid #b8c4d7;border-radius:4px;background:#fff;font-weight:700}.ocr-toolbar span{margin-left:5px;color:var(--muted);font-size:12px}.ocr-content{height:calc(100% - 46px);padding:28px clamp(22px,6vw,80px) 80px;overflow:auto;background:var(--paper);font-size:18px}.ocr-page{max-width:980px;margin:0 auto;padding:clamp(24px,5vw,62px);background:#fff;border:1px solid #d9d5ca;box-shadow:var(--shadow);font:1em/1.6 Georgia,serif}.ocr-page .flow{margin-bottom:1.2em}.ocr-page p{margin:0 0 .75em}.ocr-page img{display:block;max-width:100%;height:auto;margin:.5em auto}
dialog{width:min(620px,calc(100vw - 36px));padding:30px 34px;color:var(--ink);border:0;border-top:6px solid var(--red700);border-radius:7px;box-shadow:0 20px 70px rgba(0,0,0,.35)}dialog::backdrop{background:rgba(10,25,50,.62)}dialog h2{margin-top:0;color:var(--blue950);font:700 27px Georgia,serif}dialog p{line-height:1.6}.dialog-close{position:absolute;top:10px;right:13px;color:var(--muted);border:0;background:none;font-size:28px}
@media(max-width:1050px){.location-label{display:none}.zoom-controls #scanFit{display:none}}
@media(max-width:900px){.site-header{min-height:62px;padding:8px 12px}.brand small,.text-button{display:none}.brand strong{font-size:20px}.brand-mark{width:36px;height:36px;font-size:22px}.volume-label{font-size:0}.volume-label select{min-width:160px;font-size:12px}.toolbar{padding:7px 8px}.download-link{display:none}.workspace{height:calc(100% - 116px);grid-template-columns:42% 58%}}
@media(max-width:650px){body{overflow:auto}.toolbar{position:sticky;top:0;z-index:5}.display-controls{position:static;transform:none}.toolbar-spacer,#pageTotal,.zoom-controls{display:none}.workspace{height:auto;min-height:calc(100vh - 116px);display:block}.sidebar{height:42vh;border-right:0;border-bottom:1px solid var(--line)}.viewer{height:62vh}.ocr-toolbar span{display:none}.pdf-stage{padding:12px}}


@media(max-width:650px){
  .sidebar:has(#searchPanel.active .search-results:not(:empty)){
    height:78vh;
  }
  .sidebar:has(#searchPanel.active .search-results:not(:empty)) .search-help{
    display:none;
  }
}
