.main-nav { align-items: center; }
.nav-more { position: relative; }
.nav-more > summary { list-style: none; }
.nav-more > summary::-webkit-details-marker { display: none; }
.nav-more-links { position: absolute; right: 0; top: calc(100% + 8px); min-width: 220px; padding: 6px; border: 1px solid var(--border); border-radius: 12px; background: var(--panel); box-shadow: var(--shadow); }
.nav-more-links a { display: block; padding: 10px 12px; border-radius: 7px; color: var(--text); text-decoration: none; }
.nav-more-links a:hover, .nav-more-links a:focus-visible { background: var(--panel-3); }
.reference-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 20px; }
.reference-grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(230px,1fr)); gap: 16px; }
.reference-card { color: var(--text); text-decoration: none; }
.reference-card:hover { border-color: var(--blue); }
.reference-row { display: flex; justify-content: space-between; gap: 16px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--border-soft); }
.reference-row > span { min-width: 0; overflow-wrap: anywhere; }
.reference-row > a { flex-shrink: 0; }
.reference-embedded .site-header, .reference-embedded .site-footer { display: none; }
.reference-embedded .page-shell { width: calc(100% - 24px); padding-top: 12px; }
.reference-embedded h1 { font-size: 24px; }
.reference-modal { width: min(800px,calc(100vw - 24px)); max-width: 100%; padding: 0; color: var(--text); background: var(--bg); border: 1px solid var(--border); border-radius: 12px; }
.reference-modal::backdrop { background: #0009; }
.reference-modal-header { display: flex; align-items: center; justify-content: space-between; padding: 10px 16px; }
.reference-modal iframe { width: 100%; height: min(680px,75vh); display: block; border: 0; }
.reference-editor-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
@media (max-width: 1050px) { .site-header-inner { flex-wrap: wrap; padding-block: 12px; gap: 12px; } .main-nav { justify-content: flex-start; } }
@media (max-width: 500px) { .main-nav .nav-link { padding: 8px 10px; font-size: 14px; } .nav-more-links { position: fixed; left: 12px; right: 12px; top: auto; min-width: 0; margin-top: 8px; } }

.inventory-badge { display: inline-block; padding: .15em .5em; border-radius: .4em; font-weight: 600; }

[data-reference-editor-form] input[type="color"] { width: 72px; height: 40px; padding: 3px; background: var(--panel-2); border: 1px solid var(--border); border-radius: 8px; cursor: pointer; }
