/* B1: compact reading rows with two stable, usable filters. */
.browse-view{max-width:900px;margin:0 auto;padding:24px 24px 60px}
.browse-heading{margin:0 0 16px}.browse-heading h1{font:400 30px/1.25 var(--art-serif);margin:0}
#browse-eyebrow,#browse-description{display:none}
.browse-tools{display:grid;grid-template-columns:minmax(0,1.1fr) minmax(0,1fr);align-items:center;gap:12px;margin:0 0 16px}
.browse-search{min-width:0;max-width:none;width:100%;height:44px;min-height:44px;margin:0;padding:0 12px;gap:9px;border-radius:10px;border-color:var(--border);background:var(--surface);box-shadow:none}
.browse-search input{font-family:var(--font);font-size:14px;height:42px}.browse-search>span{flex:none}.browse-search svg{width:17px;height:17px}
.browse-filters{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;min-width:0;margin:0}
.browse-filters .filter-field{display:grid;grid-template-rows:44px;min-width:0}
.browse-filters select{min-width:0;width:100%;font:14px var(--font);color:var(--text);background:var(--surface);border:1px solid var(--border);border-radius:8px;height:44px;padding:0 8px;cursor:pointer;text-overflow:ellipsis}
.browse-filters option{color:var(--text);background:var(--surface)}
.browse-filters select:focus-visible{outline:2px solid var(--accent);outline-offset:3px}
.browse-layout{display:block}.results-toolbar{margin:0;padding:0 0 12px;gap:14px;border-bottom:1px solid var(--border)}
.results-toolbar h2{font-size:14px;line-height:1.5;color:var(--muted);font-weight:400;margin:0;overflow-wrap:anywhere}
.results-toolbar>span{font-size:12px;color:var(--muted);white-space:nowrap}
.result-grid{display:block}.term-card.term-row{display:flex;flex-direction:row;align-items:center;width:100%;gap:12px;min-height:72px;padding:12px 2px;border:0;border-bottom:1px solid var(--border);border-radius:0;background:transparent;text-align:left;transform:none}
.term-card.term-row:hover{transform:none;background:color-mix(in srgb,var(--accent) 5%,transparent)}
.term-row-body{min-width:0;flex:1}.term-row-heading{display:flex;gap:10px;align-items:baseline;min-width:0}
.term-card.term-row h3{font:400 17px/1.45 var(--art-serif);overflow-wrap:anywhere;margin:0;flex:1}
.term-card.term-row .definition{display:block;color:var(--muted);font-size:14px;line-height:1.5;white-space:normal;overflow:visible;overflow-wrap:anywhere;margin:3px 0 0}
.row-arrow{font-size:24px;line-height:1;color:var(--muted);flex-shrink:0}.row-kind,.row-status{font-size:10px;font-weight:400;line-height:1.5;color:var(--muted);white-space:nowrap;flex-shrink:0}.row-status{color:#d7b880}
.empty-state{padding:32px 16px;margin-top:16px;border:0}.empty-actions{display:flex;justify-content:center;gap:10px;flex-wrap:wrap}.empty-state h3{font-size:18px}.empty-state p{font-size:14px}
.load-more{display:block;margin:24px auto 0;min-height:44px}
.reading-more{margin:20px 0;border-top:1px solid var(--border);padding-top:16px}.reading-more>summary{cursor:pointer;min-height:44px;display:flex;align-items:center;font-size:16px;gap:10px}.reading-more>summary::after{content:'＋';margin-left:auto;color:var(--muted)}.reading-more[open]>summary::after{content:'−'}
.reading-more p,.detail-section p{line-height:1.85}.technical-source{margin-top:20px;color:var(--muted);font-size:13px}.technical-source summary{cursor:pointer;min-height:44px;display:flex;align-items:center}.technical-source p{line-height:1.8}
@media(max-width:620px){
 .browse-view{padding:14px 16px 40px}.browse-heading{margin-bottom:12px}.browse-heading h1{font-size:22px}
 .browse-tools{grid-template-columns:minmax(0,1fr);gap:10px}.browse-filters{gap:8px;width:100%}
 .browse-filters select{font-size:14px}
 .term-card.term-row{padding:9px 0;min-height:64px;gap:8px}.term-card.term-row h3{font-size:16px}
 .term-card.term-row .definition{font-size:14px;margin-top:2px}.row-kind{font-size:10px}.row-status{max-width:70px;white-space:normal}
 .results-toolbar h2{font-size:13px}.browse-search{min-width:0;margin:0}.detail-summary{padding:16px}.detail-summary p{font-size:16px;line-height:1.75}
}
@media(prefers-reduced-motion:reduce){.term-card.term-row{transition:none}}

.row-labels{display:flex;flex-direction:column;align-items:flex-end;gap:2px;flex:0 0 auto;max-width:40%}.row-labels .row-kind{white-space:normal;text-align:right;overflow-wrap:anywhere}.row-labels .row-status{text-align:right}

/* Shared editorial hierarchy: serif names, sans-serif explanations and controls. */
#term-content>h2,.detail-section>h3,.reading-more>summary{font-family:var(--art-serif);font-weight:400}


/* Favorites share one small control across curiosity cards and term details. */
.browse-heading{display:flex;align-items:center;justify-content:space-between;gap:16px}
.browse-tabs{display:flex;align-items:baseline;gap:28px}
.browse-tab{position:relative;display:inline-flex;align-items:center;justify-content:center;min-width:44px;min-height:44px;padding:0 0 8px;color:var(--muted);font:400 17px/1.4 var(--font);background:transparent;border:0;white-space:nowrap}
.browse-tab[aria-current="page"]{color:var(--text)}
.browse-tab[aria-current="page"]::after{content:"";position:absolute;left:50%;bottom:0;width:2em;height:2px;transform:translateX(-50%);background:#d7bc87;border-radius:1px}
.browse-tab:hover{color:var(--text)}
.browse-tab:focus-visible{outline:2px solid var(--accent);outline-offset:4px;border-radius:2px}
.favorite-toggle{display:inline-flex;align-items:center;justify-content:center;flex:0 0 44px;width:44px;height:44px;min-height:44px;padding:0;border:0;background:transparent;color:#c4c5ce;cursor:pointer;border-radius:8px}
.favorite-toggle svg{display:block;width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:1.5;stroke-linejoin:round}
.favorite-toggle[aria-pressed="true"]{color:#dfc28b}
.favorite-toggle[aria-pressed="true"] svg{fill:currentColor}
.favorite-toggle:hover{background:#ffffff08}
.favorite-toggle:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
.favorite-toggle:disabled{opacity:.4;cursor:default}
.detail-top-actions{display:flex;align-items:center;flex-shrink:0;gap:4px}
.detail-top-actions .icon-button{width:44px;height:44px}
#term-content .dialog-top>.eyebrow{min-width:0;overflow-wrap:anywhere}
.saved-marker{display:inline-flex;margin-left:7px;vertical-align:middle;color:#dfc28b}
.saved-marker svg{width:12px;height:12px;fill:currentColor;stroke:currentColor;stroke-width:1.5}
.favorites-storage-note{max-width:900px;padding:0 24px 28px;margin:-24px auto 0;color:var(--muted);font:12px/1.7 var(--font);text-align:center}
body[data-view="favorites"] .browse-tools{grid-template-columns:minmax(0,1fr)}
.browse-filters[hidden],.browse-tabs[hidden],.saved-marker[hidden]{display:none}
@media(max-width:620px){body[data-view="favorites"] .browse-heading h1{font-size:22px}.favorites-storage-note{padding:0 16px 24px;margin-top:-12px}}

/* Related terms remain lightweight links, with native open-in-new-tab support. */
.related-terms a{font-size:13px;color:#aebfda;background:#1a2537;border:1px solid #2d405d;border-radius:7px;padding:5px 10px;text-decoration:none}
.related-terms a:hover{border-color:#59739b}
.detail-nav{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:12px}
.detail-back{min-height:44px;margin:0;padding:0 2px}
.detail-identity{font:12px/1.6 var(--font);color:var(--muted);margin:0 0 6px;overflow-wrap:anywhere}
#term-content>h2{font-size:28px;margin:4px 0 6px}
#term-content>.term-english{font-size:13px;margin:0 0 8px;overflow-wrap:anywhere}
.detail-review{display:flex;align-items:center;flex-wrap:wrap;gap:2px 12px;color:var(--muted);font:11px/1.6 var(--font);margin:0 0 14px}
.detail-review button{color:var(--accent);font:inherit;min-height:32px;padding:0;text-decoration:underline;text-underline-offset:3px}
.detail-limit{font:12px/1.7 var(--font);color:#d7b880;margin:0 0 16px}
#term-content .detail-summary{background:#ffffff03;border-color:var(--border);padding:15px 17px}
#term-content .detail-summary p{font-size:16px;line-height:1.75}
.model-identity{margin:0 0 12px}.model-identity>div{display:grid;grid-template-columns:76px minmax(0,1fr);gap:10px;padding:10px 0;border-bottom:1px solid var(--border)}
.model-identity dt{font:12px/1.7 var(--font);color:var(--muted)}.model-identity dd{margin:0;font:14px/1.6 var(--font);overflow-wrap:anywhere}.model-identity a{color:var(--accent);text-decoration:underline;text-underline-offset:3px}
#term-content .related-note,.entry-note{font:12px/1.7 var(--font);color:var(--muted);margin:8px 0 12px}
.official-entry{display:inline-flex;align-items:center;gap:8px;min-height:44px;padding:0 13px;border:1px solid var(--border);border-radius:8px;color:var(--text);font:13px var(--font);text-decoration:none}
.official-entry svg{width:15px;height:15px;fill:none;stroke:currentColor;stroke-width:1.5}
.detail-source>summary{cursor:pointer;min-height:44px;display:flex;align-items:center;color:var(--text);font:16px var(--art-serif)}
.detail-source>summary:after{content:'＋';margin-left:auto;color:var(--muted)}.detail-source[open]>summary:after{content:'−'}
.detail-source>strong{display:block;margin-top:10px}.detail-source p{line-height:1.8}.detail-source a svg{width:12px;height:12px;fill:none;stroke:currentColor;stroke-width:1.5}
#term-dialog{scrollbar-width:thin;scrollbar-color:#3d4758 transparent}
@media(max-width:620px){#term-content>h2{font-size:26px}.detail-section{margin:18px 0}.detail-section h3{font-size:16px}.detail-section p{font-size:14px}}


/* A: anchored single-choice menus; overlays never reflow the reading list. */
.browse-filters select[hidden]{display:none}
.filter-trigger{display:flex;align-items:center;justify-content:space-between;gap:12px;width:100%;height:44px;min-width:0;padding:0 12px;border:1px solid var(--border);border-radius:10px;background:color-mix(in srgb,var(--surface) 65%,transparent);color:var(--text);font:14px/1.4 var(--font);text-align:left;transition:border-color .15s,background .15s}
.filter-value{min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.filter-trigger svg{width:14px;height:14px;flex:none;fill:none;stroke:currentColor;stroke-width:1.4;stroke-linecap:round;stroke-linejoin:round;color:var(--muted);transition:transform .15s}
.filter-trigger:hover{border-color:#77766d}
.filter-trigger[aria-expanded="true"]{border-color:#bda474;color:#e4c68d;background:color-mix(in srgb,var(--surface) 88%,transparent)}
.filter-trigger[aria-expanded="true"] svg{transform:rotate(180deg);color:inherit}
.filter-trigger:focus-visible{outline:2px solid #bda474;outline-offset:3px}
.filter-menu{position:fixed;z-index:40;box-sizing:border-box;margin:0;padding:6px;overflow-y:auto;overscroll-behavior:contain;scrollbar-width:thin;scrollbar-color:#64635c transparent;border:1px solid #56574f;border-radius:12px;background:color-mix(in srgb,var(--surface) 94%,#777 6%);box-shadow:0 14px 38px #0007,0 2px 6px #0003;color:var(--text);font:14px/1.5 var(--font);outline:none}
.filter-menu[hidden]{display:none}
.filter-option{display:flex;align-items:center;justify-content:space-between;gap:14px;min-height:44px;padding:10px 12px;box-sizing:border-box;border-radius:6px;cursor:pointer;user-select:none}
.filter-option>span{overflow-wrap:anywhere}
.filter-option svg{width:16px;height:16px;flex:none;fill:none;stroke:currentColor;stroke-width:1.6;stroke-linecap:round;stroke-linejoin:round;visibility:hidden}
.filter-option[aria-selected="true"]{color:#e4c68d}
.filter-option[aria-selected="true"] svg{visibility:visible}
.filter-option.is-active,.filter-option:hover{background:#ffffff09}
@media(prefers-reduced-motion:reduce){.filter-trigger,.filter-trigger svg{transition:none}}

/* Content clarity: short essentials first, deeper material stays discoverable. */
#term-dialog{background:var(--surface,#11151b)}
#term-content>h2{font-size:24px;line-height:1.4;margin:6px 0 8px}
#term-content .detail-summary{padding:0 0 22px;border:0;border-bottom:1px solid var(--border);border-radius:0;background:none;margin:0 0 24px}
#term-content .detail-summary p{font-size:17px;margin:0;color:var(--muted);line-height:1.8}
.detail-section h3,.detail-example h3{font-family:var(--art-serif);font-weight:400;color:var(--text);font-size:16px;margin:0 0 12px}
.detail-example{padding:20px 22px;border:1px solid var(--border);border-radius:8px;background:#ffffff03;margin:22px 0}
.detail-example p{font-size:15px;line-height:1.85;color:var(--text);margin:0;white-space:pre-line;overflow-wrap:anywhere}
.detail-example .detail-boundary{font-size:13px;color:var(--muted);margin-top:16px}
#term-content>.reading-more,#term-content>.detail-source{border-top:1px solid var(--border);margin:0;padding:6px 0}
#term-content>.detail-source{border-bottom:1px solid var(--border)}
#term-content>.reading-more>summary,#term-content>.detail-source>summary{min-height:48px;font:14px var(--art-serif);color:var(--text);list-style:none}
#term-content summary::-webkit-details-marker{display:none}
.reading-more>p{font-size:14px;color:var(--muted)}
.reading-more .technical-source{border-top:1px solid var(--border);padding-top:2px}
.reading-more .technical-source h3{font:13px var(--font);color:var(--muted)}
.reading-more .technical-source p{font-size:13px}
#term-content>.detail-review{margin:0 0 12px}
#term-content .detail-actions .outline-button{border:0;padding:8px 4px;font-size:13px}
#term-content .detail-actions{gap:20px;border-top:1px solid var(--border);padding-top:12px}
@media(max-width:620px){
 #term-content>h2{font-size:24px}
 #term-content .detail-summary{padding-bottom:18px;margin-bottom:20px}
 #term-content .detail-summary p{font-size:15px}
 .detail-example{padding:16px;margin:20px 0}
 .detail-example p{font-size:14px}
 .detail-section h3,.detail-example h3{font-size:16px}
}

.browse-end{min-height:48px;display:flex;align-items:center;justify-content:center;margin-top:16px;color:var(--muted);font-size:12px}
.browse-end[hidden]{display:none}

/* Neutral actions stay consistent across all themes; filled favorites retain their saved state. */
.curiosity-top-actions,.detail-top-actions{--term-action-color:#c4c5ce}
.curiosity-top-actions .favorite-toggle[aria-pressed="false"],.detail-top-actions .favorite-toggle[aria-pressed="false"],.detail-top-actions .icon-button,.detail-top-actions .share-button{color:var(--term-action-color)}
.share-button{display:inline-flex;align-items:center;justify-content:center;flex:0 0 44px;width:44px;height:44px;min-height:44px;padding:0;border:0;background:transparent;color:var(--term-action-color,#c4c5ce);cursor:pointer;border-radius:8px}
.share-button svg{display:block;width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:1.5;stroke-linecap:round;stroke-linejoin:round}
.share-button:hover{background:#ffffff08}
.share-button:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
.share-button[aria-busy="true"]{opacity:.55;cursor:progress}
@media(max-width:380px){.detail-nav{gap:4px}.detail-top-actions{gap:0}.detail-back{font-size:13px;min-width:0}}

/* B: small floating glass discs with labels outside the glass. */
.share-dialog{box-sizing:border-box;width:min(400px,calc(100% - 32px));max-height:calc(100dvh - 32px);padding:20px;color:var(--text);background:linear-gradient(150deg,#dce9ff0d,#b2bfd504 60%),#0d1420c2;backdrop-filter:blur(24px);-webkit-backdrop-filter:blur(24px);border:1px solid #dae5ff29;border-radius:20px;box-shadow:0 16px 48px #0005,inset 0 1px 0 #ffffff0a;overflow-y:auto}
.share-panel-header{display:flex;align-items:center;justify-content:space-between;gap:16px;margin-bottom:14px}
.share-panel-header h2{margin:0;font-size:20px;font-weight:400;letter-spacing:1px}
.share-panel-header .icon-button{flex:0 0 36px;width:36px;height:36px;color:#b8c0cc}
.share-preview-area{display:flex;align-items:center;justify-content:center;min-height:130px;background:transparent;border-radius:7px;overflow:hidden}
#share-preview{display:block;width:auto;max-width:100%;height:auto;max-height:clamp(130px,calc(100dvh - 230px),380px);object-fit:contain;border-radius:7px;box-shadow:0 8px 20px #0005}
#share-image-empty{padding:40px 16px;text-align:center;color:var(--muted);font-size:14px}
.share-panel-footer{margin-top:18px}
#share-status{font-size:12px;line-height:1.6;color:var(--muted);margin:12px 0 0;overflow-wrap:anywhere}
#share-status:empty{display:none}
.share-panel-actions{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:4px}
.share-panel-actions button{display:flex;align-items:center;justify-content:center;flex-direction:column;gap:8px;min-width:0;min-height:72px;padding:0;border:0;border-radius:12px;font:inherit;font-size:12px;line-height:1.4;color:#dce3ed;background:transparent;box-shadow:none;white-space:nowrap;cursor:pointer}
.share-action-disc{box-sizing:border-box;display:flex;align-items:center;justify-content:center;flex:0 0 44px;width:44px;height:44px;border-radius:50%;background:linear-gradient(140deg,#edf4ff10,#d2deff02);border:1px solid #dce8ff30;box-shadow:inset 0 1px 0 #ffffff11,0 4px 12px #0002;backdrop-filter:blur(12px);-webkit-backdrop-filter:blur(12px);transition:background .2s,border-color .2s,transform .2s}
.share-panel-actions button:hover:not(:disabled) .share-action-disc{background:#d5e2ff20;border-color:#dde9ff55}
.share-panel-actions button:active:not(:disabled) .share-action-disc{transform:scale(.95)}
#share-dialog .share-panel-actions button:focus-visible{outline:none}
html:not([data-touch-controls]) .share-panel-actions button:focus-visible .share-action-disc{outline:2px solid #cbd6ee;outline-offset:3px}
.share-panel-actions button:disabled{opacity:.4;cursor:default}
.share-panel-actions svg{width:23px;height:23px;fill:none;stroke:currentColor;stroke-width:1.5;stroke-linecap:round;stroke-linejoin:round}
.share-panel-actions button .share-brand-icon{fill:currentColor;stroke:none}
.share-panel-actions [data-share-destination="moments"] .share-brand-icon{width:22px;height:22px}
.share-dialog [hidden]{display:none!important}
@media(max-width:620px){.share-dialog{width:min(400px,calc(100% - 24px));max-height:calc(100dvh - 24px);margin:auto;padding:18px 16px}.share-panel-header{margin-bottom:12px}.share-panel-footer{margin-top:16px}}
@media(prefers-reduced-motion:reduce){.share-action-disc{transition:none}}

/* Favorite feedback C: one star and text, no surface or decorative sparkles. */
.toast.toast-favorite{inset:auto;position:fixed;left:50%;bottom:max(30px,env(safe-area-inset-bottom));transform:translateX(-50%);margin:0;display:flex;align-items:center;gap:10px;width:max-content;max-width:calc(100vw - 40px);padding:8px 10px;border:0;border-radius:0;background:transparent;box-shadow:none;backdrop-filter:none;color:#e3e5eb;font:400 14px/1.6 var(--font-sans,sans-serif);letter-spacing:.04em;text-align:center;text-shadow:0 1px 5px #000,0 0 12px #000;pointer-events:none;z-index:1000;overflow:visible}
.toast.toast-favorite[hidden]{display:none}
.toast-favorite::backdrop{background:transparent;pointer-events:none}
.toast-favorite-icon{display:flex;flex:none;color:#bcc3d1;filter:drop-shadow(0 1px 3px #0009)}
.toast-favorite-icon svg{width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:1.65;stroke-linejoin:round}
.toast-favorite-saved .toast-favorite-icon{color:#f1cf71}
.toast-favorite-saved .toast-favorite-icon svg{fill:currentColor;stroke-width:1.2}
.toast-favorite:not([hidden]){animation:favorite-feedback-in .18s ease-out both}
@keyframes favorite-feedback-in{from{opacity:0;translate:0 4px}to{opacity:1;translate:0 0}}
@media(prefers-reduced-motion:reduce){.toast-favorite:not([hidden]){animation:none}}
body[data-motion-enabled="false"] .toast-favorite{animation:none}
