/* Reference Shelf: private collection, shared save controls, and note editors. */
.shelf-icon { width:18px; height:18px; flex:0 0 auto; vertical-align:middle; }
.page-reference-shelf .boatyard-head { padding-top:1.75rem; }
.page-reference-shelf .boatyard-head__intro { font-style:normal; font-family:var(--font-sans); font-size:.94rem; color:var(--ivory-muted); }
.shelf-section { padding-block:2.25rem 4rem; }
.shelf-heading { display:flex; justify-content:space-between; align-items:center; gap:1rem; margin-bottom:1.25rem; }
.shelf-heading h2 { margin:0; font-size:1.7rem; font-weight:500; }
.shelf-heading p { margin:.25rem 0 0; font-size:.8rem; color:var(--ink-muted); }
.shelf-private { display:inline-flex; align-items:center; gap:.45rem; font-size:.75rem; color:var(--ink-muted); }
.shelf-private .shelf-icon { width:15px; height:15px; }
.shelf-filters { display:flex; flex-wrap:wrap; align-items:center; gap:.65rem; padding:.7rem; margin-bottom:1.5rem; background:#fffdf8; border:1px solid var(--navy-hairline); border-radius:8px; box-shadow:0 3px 10px rgba(8,42,69,.025); }
.shelf-filters label { margin:0; min-width:0; }
.shelf-filters__search { position:relative; flex:1 1 18rem; }
.shelf-filters__search > .shelf-icon { position:absolute; left:.9rem; top:50%; transform:translateY(-50%); color:var(--ink-muted); pointer-events:none; }
.shelf-filters input[type="search"], .shelf-filters select { width:100%; height:44px; margin:0; border:1px solid var(--navy-hairline); border-radius:5px; background:#fffdf8; color:var(--navy); font:inherit; font-size:.86rem; padding:.65rem .8rem; }
.shelf-filters input[type="search"] { padding-left:2.6rem; background:#f7f5ef; border-color:transparent; }
.shelf-filters input::placeholder { color:#6c7474; opacity:1; }
.shelf-filters__type { flex:0 1 11rem; }
.shelf-filters .btn { height:44px; padding:.8rem 1.45rem; border-radius:5px; letter-spacing:.07em; }
.shelf-reset { padding:.5rem; font-size:.78rem; white-space:nowrap; }
.shelf-empty { padding:3rem 2rem 0; border:1px solid var(--brass-hairline); border-radius:10px; background:#fffdf8; text-align:center; overflow:hidden; box-shadow:0 8px 25px -18px rgba(8,42,69,.2); }
.shelf-empty__icon { display:grid; place-items:center; width:64px; height:64px; margin:0 auto 1.4rem; border-radius:50%; background:var(--brass-soft); color:var(--brass-text); }
.shelf-empty__icon .shelf-icon { width:29px; height:29px; }
.shelf-empty > .label { margin-bottom:.65rem; font-size:.65rem; }
.shelf-empty h2 { margin:0 auto .85rem; max-width:26ch; font-size:clamp(2rem,3.5vw,2.65rem); line-height:1.12; font-weight:500; }
.shelf-empty__copy { max-width:36rem; margin:0 auto; font-size:.91rem; color:var(--ink-muted); line-height:1.85; }
.shelf-empty__copy strong { color:var(--navy); font-weight:500; }
.shelf-empty__actions { display:flex; flex-wrap:wrap; align-items:center; justify-content:center; gap:1rem 1.5rem; margin:1.7rem 0 2.75rem; }
.shelf-empty__actions .btn { border-radius:5px; }
.shelf-text-link { display:inline-flex; align-items:center; gap:.5rem; font-size:.81rem; font-weight:500; text-underline-offset:4px; text-decoration-color:var(--brass-hairline); }
.shelf-empty__steps { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:1.5rem; list-style:none; margin:0 -2rem; padding:1.5rem 2rem; border-top:1px solid var(--brass-hairline); background:#f7f4eb; text-align:left; }
.shelf-empty__steps li { display:flex; gap:.75rem; margin:0; }
.shelf-empty__steps li > span { color:var(--brass-text); font-size:.73rem; padding-top:.15rem; }
.shelf-empty__steps strong { font-size:.8rem; font-weight:600; color:var(--navy); }
.shelf-empty__steps p { margin:.3rem 0 0; font-size:.76rem; line-height:1.6; color:var(--ink-muted); }
.shelf-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:1.3rem; align-items:start; }
.shelf-card { min-width:0; overflow:hidden; border:1px solid var(--navy-hairline); border-radius:8px; background:#fffdf8; box-shadow:0 5px 16px -12px rgba(8,42,69,.2); overflow-wrap:anywhere; }
.shelf-card__photo { display:block; background:#ebe8dd; border-bottom:1px solid var(--navy-hairline); }
.shelf-card__photo img { display:block; width:100%; height:230px; object-fit:contain; }
.shelf-card__body { padding:1.35rem; }
.shelf-card__type { display:flex; align-items:center; gap:.4rem; font-size:.64rem; color:var(--brass-text); text-transform:uppercase; letter-spacing:.1em; margin:0 0 .65rem; }
.shelf-card__type .shelf-icon { width:14px; height:14px; }
.shelf-card__title { margin:0 0 .6rem; font-size:1.75rem; line-height:1.12; font-weight:500; }
.shelf-card__title a { text-decoration:none; }
.shelf-card__byline { display:flex; flex-wrap:wrap; gap:.25rem .65rem; margin:0 0 1rem; color:var(--ink-muted); font-size:.76rem; line-height:1.6; }
.shelf-card__byline span + span { border-left:1px solid var(--brass-hairline); padding-left:.65rem; }
.shelf-card__excerpt { margin:.8rem 0 1.2rem; color:var(--ink-muted); font-size:.86rem; line-height:1.8; }
.shelf-card__credit { margin:0 0 .8rem; color:var(--ink-muted); font-size:.72rem; }
.shelf-card__lessons { margin:.8rem 0 1rem; }
.shelf-card__lessons dt { margin-top:.75rem; font-size:.64rem; font-weight:600; letter-spacing:.08em; text-transform:uppercase; color:var(--brass-text); }
.shelf-card__lessons dt:first-child { margin-top:0; }
.shelf-card__lessons dd { margin:.25rem 0 0; color:var(--ink-muted); font-size:.86rem; line-height:1.7; }
.shelf-card__notebook { margin-top:1.25rem; padding:.85rem; border:1px solid #e8e0cf; border-radius:5px; background:#f8f4e9; }
.shelf-note-editor summary { display:flex; align-items:center; gap:.4rem; list-style:none; cursor:pointer; font-size:.73rem; font-weight:500; color:var(--navy); }
.shelf-note-editor summary::-webkit-details-marker { display:none; }
.shelf-note-editor summary .shelf-icon { width:14px; height:14px; color:var(--brass-text); }
.shelf-note-editor__action { margin-left:auto; font-size:.67rem; color:var(--brass-text); text-decoration:underline; text-underline-offset:3px; }
.shelf-note-editor[open] + .shelf-note-preview { display:none; }
.shelf-note-preview { white-space:pre-wrap; margin:.65rem 0 0; font-size:.81rem; color:var(--ink); line-height:1.75; }
.shelf-note-preview--empty { color:var(--ink-muted); font-style:italic; }
.shelf-note { margin-top:.75rem; }
.shelf-note textarea, .shelf-quick-note textarea { display:block; width:100%; min-width:0; margin:.45rem 0 .7rem; padding:.7rem; border:1px solid var(--brass-hairline); border-radius:4px; background:#fffdf8; color:var(--ink); font-family:var(--font-sans); font-size:.83rem; line-height:1.65; resize:vertical; }
.shelf-note__actions { display:flex; flex-wrap:wrap; align-items:center; gap:.6rem; }
.shelf-note__actions .btn { border-radius:4px; letter-spacing:.05em; }
.shelf-note [role="status"] { color:var(--ink-muted); font-size:.73rem; }
.shelf-remove { display:flex; align-items:center; justify-content:flex-end; flex-wrap:wrap; gap:.5rem; margin:1rem 0 -.25rem; }
.shelf-remove__button { display:inline-flex; align-items:center; gap:.35rem; padding:.4rem .15rem; background:none; border:0; color:var(--ink-muted); font:inherit; font-size:.73rem; cursor:pointer; }
.shelf-remove__button .shelf-icon { width:14px; height:14px; }
.shelf-remove__button:hover { color:var(--navy); text-decoration:underline; }
.shelf-pagination { display:flex; flex-wrap:wrap; align-items:center; justify-content:center; gap:1rem; margin-top:2rem; font-size:.8rem; }
.shelf-card:target { outline:2px solid var(--brass); outline-offset:3px; }
.shelf-control { display:flex; flex-wrap:wrap; align-items:center; gap:.3rem .85rem; margin:.35rem 0; font-family:var(--font-sans); }
.shelf-control form { margin:0; }
/* A quiet bookmark link, not a button that competes with the work beside it. */
.shelf-save-button { display:inline-flex; align-items:center; gap:.3rem; min-height:32px; max-width:100%; padding:.25rem .1rem; border:0; background:none; color:var(--ink-muted); font:inherit; font-size:.72rem; font-weight:500; line-height:1.3; text-decoration:none; cursor:pointer; transition:color .15s; }
.shelf-save-button .shelf-icon { width:15px; height:15px; }
.shelf-save-button:hover, .shelf-save-button:focus-visible { color:var(--navy); text-decoration:underline; text-underline-offset:3px; }
.shelf-save-button[aria-pressed="true"] { color:var(--brass-text); }
.shelf-save-button[aria-pressed="true"] .shelf-icon { fill:currentColor; }
.shelf-save-button:disabled, .shelf-remove__button:disabled { opacity:.6; cursor:wait; }
.shelf-control [hidden], .shelf-quick-note[hidden] { display:none!important; }
.shelf-control__note { color:var(--ink-muted); font-size:.73rem; text-underline-offset:3px; }
.shelf-control__status { flex-basis:100%; color:var(--ink-muted); font-size:.75rem; }
.shelf-control__status:empty { display:none; }
.shelf-quick-note { max-width:38rem; }
.shelf-quick-note summary { cursor:pointer; color:var(--brass-text); font-size:.73rem; }
.shelf-quick-note[open] { flex-basis:100%; }
.shelf-quick-note[open] summary { margin-bottom:.5rem; }
.shelf-quick-note form { padding:1rem; border:1px solid var(--brass-hairline); border-radius:5px; background:#f8f4e9; color:var(--navy); }
.shelf-quick-note label { display:block; font-size:.76rem; font-weight:500; }
.shelf-photo-anchor { display:block; height:0; scroll-margin-top:7rem; }
.wb-card > .shelf-control { margin:.65rem 1.25rem; }
.builder-knowledge-panel > .shelf-control { justify-content:flex-end; margin:0 0 .5rem; }
.gallery__item > .shelf-control { padding-inline:.25rem; }
.lightbox__shelf { position:absolute; bottom:3.2rem; left:50%; transform:translateX(-50%); width:max-content; max-width:calc(100% - 2rem); max-height:40vh; overflow:auto; background:#fffdf8; color:var(--navy); padding:.5rem .85rem; border:1px solid var(--brass-hairline); border-radius:7px; box-shadow:0 8px 30px rgba(0,0,0,.15); z-index:3; }
.lightbox__shelf:empty { display:none; }
.lightbox__shelf .shelf-control { margin:0; }
@media(max-width:1050px) { .shelf-grid { grid-template-columns:repeat(2,minmax(0,1fr)); } }
@media(max-width:650px) {
 .shelf-section { padding-block:1.5rem 3rem; }
 .shelf-heading { align-items:flex-start; flex-direction:column; gap:.65rem; }
 .shelf-heading > div { display:flex; align-items:baseline; gap:.8rem; }
 .shelf-heading h2 { font-size:1.5rem; }
 .shelf-filters { gap:.6rem; padding:.65rem; }
 .shelf-filters__search { flex:1 1 100%; }
 .shelf-filters__type { flex:1 1 9rem; }
 .shelf-filters .btn { flex:0 0 auto; }
 .shelf-reset { flex-basis:100%; text-align:center; }
 .shelf-grid { grid-template-columns:minmax(0,1fr); }
 .shelf-empty { padding:2rem 1.25rem 0; }
 .shelf-empty h2 { font-size:2.1rem; }
 .shelf-empty__copy { font-size:.85rem; }
 .shelf-empty__actions { flex-direction:column; gap:1rem; margin-bottom:2rem; }
 .shelf-empty__steps { grid-template-columns:1fr; gap:1rem; padding:1.25rem; margin:0 -1.25rem; }
 .shelf-card__body { padding:1.2rem; }
 .shelf-card__photo img { height:240px; }
 .lightbox__shelf { bottom:1rem; }
}
@media(prefers-reduced-motion:reduce) { .shelf-save-button { transition:none; } }
@media print { .shelf-control, .shelf-filters, .shelf-remove, .shelf-note__actions { display:none; } .shelf-card { break-inside:avoid; box-shadow:none; } }
