/* Local layout follows Purlins. Shared platform styles own the shell. */
*{box-sizing:border-box}body{margin:0;font:14px "Segoe UI",Inter,Arial,sans-serif;color:#111827;background:#F4F7FA}
button,input,select{font:inherit}button{cursor:pointer}button,a,input,select{touch-action:manipulation}
.dnode-mark img{display:block;width:100%;height:100%;object-fit:contain}
.subtabs{display:flex;align-items:center;gap:5px;position:sticky;z-index:40;padding:8px 22px;border-bottom:1px solid;overflow:auto;min-height:52px}
.subtabs button{display:flex;align-items:center;gap:8px;min-height:34px;padding:7px 16px;border:1px solid transparent;border-radius:6px;font-size:13px;font-weight:650;white-space:nowrap}
.family-icon{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:1.5;stroke-linejoin:round;flex:0 0 auto}
.library-page{max-width:1900px;margin:0 auto;padding:18px 22px 36px}h1{font-size:23px;font-weight:800;margin:0 0 14px;color:#111}
.card{border:1px solid #CBD5E1;border-radius:9px;background:#fff;box-shadow:0 2px 10px rgba(15,45,91,.08);overflow:hidden}
.card-head{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:13px 16px;border-bottom:1px solid #BFD1EC;border-left:4px solid #2563EB;background:#DCEAFF}
.card-head h2{margin:0;font-size:16px;color:#111}.card-head #count{font-size:12px;font-weight:500;color:#475569}.card-body{padding:16px}
.library-controls{display:flex;align-items:center;justify-content:space-between;gap:32px;margin-bottom:16px;min-height:166px}
.filters{flex:1;max-width:920px}.toolbar{display:flex;align-items:flex-end;gap:14px;flex-wrap:wrap}
.toolbar label{display:block;min-width:190px;font-size:12px;font-weight:650;color:#2f3b43}.toolbar .library-search{flex:1;min-width:230px;max-width:380px}
input,select{display:block;width:100%;height:36px;border:1px solid #aab6bd;border-radius:5px;padding:8px 9px;background:#fff;color:#111;margin-top:5px;font-size:13px}
select{text-align:center;text-align-last:center}.secondary{min-height:36px;padding:8px 13px;font-size:12px;font-weight:700;white-space:nowrap}input:focus,select:focus{outline:2px solid #BFDBFE;border-color:#2563EB}
.grade-filter{border:0;padding:0;margin:20px 0 0;min-width:0}.grade-filter legend{font-size:12px;color:#2f3b43;font-weight:650;padding:0;margin-bottom:7px}
.grade-options{display:flex;gap:6px;flex-wrap:wrap}.grade-options button{min-width:78px;padding:7px 13px;min-height:33px;background:#fff;border:1px solid #aab6bd;border-radius:5px;font-size:12px;font-weight:650;color:#334155}
.grade-options button:hover{background:#F0F6FF}.grade-options button[aria-pressed=true]{background:#111827;color:#fff;border-color:#111827}
.section-shape{flex:0 0 246px;align-self:center}.section-shape svg{width:246px;height:170px;display:block}
.section-shape .profile{fill:#fff;stroke:#425e7a;stroke-width:1.5;stroke-linejoin:round}.section-shape .dimension{fill:none;stroke:#71869b;stroke-width:.85}
.section-shape .centreline{fill:none;stroke:#a0b2c4;stroke-width:.7;stroke-dasharray:5 3}.section-shape text{font:italic 14px Georgia,serif;fill:#243b53;stroke:none;text-anchor:middle;dominant-baseline:middle}
.library-scroll{max-height:calc(100vh - 486px);min-height:280px;overflow:auto;scrollbar-gutter:stable;border:1px solid #b7bec2}
.library-table{width:100%;table-layout:fixed;border-collapse:separate;border-spacing:0;white-space:nowrap;font-size:12px;font-variant-numeric:tabular-nums;user-select:none;-webkit-user-select:none}
.library-table th,.library-table td{text-align:center;border-right:1px solid #b7bec2;border-bottom:1px solid #b7bec2;background:#fff;padding:8px 9px;height:35px;color:#111827}
.library-table th:last-child,.library-table td:last-child{border-right:0}.library-table th{background:#DCE8F8;position:sticky;top:0;z-index:3;font-weight:800;padding:0}
.library-table th:first-child{left:0;z-index:4}.library-table td:first-child{position:sticky;left:0;z-index:1}
.library-sort{display:block;width:100%;padding:10px 12px;min-height:53px;text-align:center;border:0;border-radius:0;background:transparent;color:inherit;font:inherit;font-weight:800;cursor:pointer}
.library-sort:hover{background:#cadcf3}.library-sort .unit{display:block;font-size:11px;font-weight:500;margin-top:3px;color:#586777}.library-table tbody tr:nth-child(even) td{background:#FAF6EA}.library-table tbody tr:hover td{background:#F2EBD8}
.section-link{border:0;padding:0;background:none;font:inherit;font-weight:700;color:#111111;text-align:center}.section-link:hover{text-decoration:underline}
#empty{padding:24px;text-align:center;color:#64748B}.error{background:#fff2ed;color:#9b391f;padding:12px;margin-bottom:14px}.error button{margin-left:10px}
:focus-visible{outline:2px solid #2563EB;outline-offset:2px}.library-sort:focus-visible{outline-offset:-2px}.sr-only{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0,0,0,0)}
dialog{width:min(880px,calc(100% - 28px));max-height:88vh;border:1px solid #CBD5E1;border-radius:9px;padding:0;color:#111827;box-shadow:0 20px 60px #0f172a40}
dialog::backdrop{background:#15243880}.dialog-heading{display:flex;align-items:center;justify-content:space-between;padding:13px 18px;background:#DCEAFF;border-bottom:1px solid #BFD1EC}.dialog-heading h2{font-size:18px;margin:0}.dialog-heading button{font-size:26px;line-height:1;border:0;background:none;color:#475569;padding:3px 5px}
#detailContent{padding:0 18px 18px}.detail-group{margin:22px 0 10px;font-size:14px}.detail-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px}.detail-grid>div{background:#F3F7FD;border:1px solid #d3deeb;border-radius:5px;padding:10px;text-align:center;font-size:12px}.detail-grid span{display:block;color:#64748B;margin-bottom:6px}.detail-grid strong{font-weight:650}
@media(min-width:1600px){.filters{max-width:1100px}.toolbar .library-search{max-width:480px}}
@media(max-width:900px){.library-controls{gap:16px}.section-shape{flex-basis:216px}.section-shape svg{width:216px;height:166px}.toolbar label{min-width:170px}.toolbar .library-search{flex-basis:100%;max-width:none}.grade-filter{margin-top:14px}.library-scroll{max-height:600px}.subtabs{padding-left:16px;padding-right:16px}}
@media(max-width:600px){.library-page{padding:16px 10px 28px}h1{font-size:21px}.subtabs{padding:7px 10px;gap:4px;min-height:48px}.subtabs button{padding:6px 12px;min-height:32px}.family-icon{display:none}.card-head{padding:12px}.card-head h2{font-size:14px}.card-head #count{font-size:11px}.card-body{padding:12px}.library-controls{display:grid;grid-template-columns:1fr;gap:8px;margin-bottom:14px}.filters{grid-row:2}.section-shape{justify-self:center}.section-shape svg{width:240px;height:156px}.toolbar{gap:10px}.toolbar label{flex:1;min-width:155px}.toolbar .library-search{flex-basis:100%}.grade-filter{margin-top:16px}.grade-options button{flex:1;min-width:70px}.library-scroll{max-height:570px;min-height:240px}.detail-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:560px){.subtabs{top:56px!important}}
