* { box-sizing: border-box; }

:root {
    font: 93.75%/1.5 system-ui, sans-serif;
    color: #171717;
    background: #f1f2f4;
    --line: #e9e9e9;
    --outline: #d6d6d6;
    --surface: #fff;
    --muted: #525258;
    --blue: #1c64d6;
    --blue-soft: #eef4ff;
}

body { margin: 0; min-height: 100dvh; display: grid; grid-template-columns: clamp(15rem, 18vw, 18rem) minmax(0, 1fr); }
a { color: inherit; }
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible {
    outline: 2px solid var(--blue);
    outline-offset: 3px;
}
:is(input, textarea, select):focus-visible,
:is(.details, .table-wrap, .catalog-subgroup) :is(a, button, summary):focus-visible { outline-offset: -2px; }
:is(.details, .catalog-subgroup) summary:focus-visible { outline: 2px solid var(--blue); }
.sr-only, .skip:not(:focus) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.skip:focus { position: fixed; z-index: 3; top: 1rem; left: 1rem; background: white; padding: .5rem; }

.sidebar { position: sticky; top: 0; height: 100dvh; padding: 1.25rem .8rem; display: flex; flex-direction: column; }
.brand { display: block; min-width: 0; max-width: 100%; margin: 0 .2rem .85rem; }
.brand-image { display: block; width: 12.25rem; max-width: 100%; height: auto; }
.modules button, .admin-menu-link { display: flex; align-items: center; gap: .65rem; width: 100%; min-height: 2.75rem; padding: .55rem .65rem; border: 0; border-radius: .45rem; background: transparent; color: #30343b; text-align: left; font-size: .95rem; font-weight: 500; text-transform: uppercase;}
.modules button:hover, .submenu a:hover { background: #e6e8ec; }
.admin-menu-link { text-decoration: none; margin-bottom: .85rem; }
.admin-menu-link:hover { background: #e6e8ec; }
.admin-menu-link[aria-current] { background: #e1e4e9; color: #20252b; }
.menu-item::after { content: ""; width: .38rem; height: .38rem; margin-left: auto; border-right: 1px solid currentColor; border-bottom: 1px solid currentColor; transform: rotate(-45deg); }
.modules .menu-back { min-height: 2.85rem; margin-bottom: .75rem; background: #dfe2e7; }
.modules .menu-back:hover { background: #d6dae1; }
.module-icon, .back-icon { flex: none; width: 1.15rem; height: 1.15rem; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.back-icon { margin-left: auto; }
.submenu { margin: .3rem 0 .55rem; padding: 0 .2rem; }
.catalog-submenu { min-height: 0; overflow-y: auto; scrollbar-width: thin; }
.nomenclature-scope { margin-top: .9rem; border: 1px solid var(--line); border-radius: .75rem; background: var(--surface); }
.nomenclature-scope > summary {
    display: flex; align-items: center; gap: .6rem; padding: .8rem 1rem; cursor: pointer; list-style: none;
    border-radius: inherit; font-weight: 550;
}
.nomenclature-scope > summary::-webkit-details-marker { display: none; }
.nomenclature-scope > summary::after {
    content: ""; width: .4rem; height: .4rem; margin-inline-start: auto; margin-inline-end: .2rem;
    border: solid var(--muted); border-width: 0 1.5px 1.5px 0; transform: rotate(45deg);
}
.nomenclature-scope[open] > summary { border-bottom: 1px solid var(--line); border-radius: .75rem .75rem 0 0; }
.nomenclature-scope[open] > summary::after { transform: rotate(225deg); }
.nomenclature-scope > summary:hover { background: #f6f7f8; }
.nomenclature-scope > summary:focus-visible { outline: 2px solid var(--blue); outline-offset: -2px; }
.nomenclature-scope > form, .nomenclature-scope > p { margin: 0; padding: .9rem 1rem; }
.nomenclature-scope > form { display: block; }
.scope-objects {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 15.5rem), 1fr)); gap: .5rem;
    min-inline-size: 0; border: 0; margin: 0; padding: 0;
}
.scope-option {
    position: relative; display: flex; align-items: center; justify-content: space-between; gap: .6rem;
    min-height: 2.65rem; padding: .5rem .65rem; border: 1px solid var(--line); border-radius: .5rem; cursor: pointer;
}
.scope-option:hover { background: #f6f7f8; }
.scope-option:has(.scope-switch:checked) { border-color: #c8e6ff; background: #f2f9ff; }
.scope-switch { position: absolute; appearance: none; opacity: 0; inline-size: 1px; block-size: 1px; }
.scope-track { flex: none; position: relative; width: 2rem; height: 1.15rem; border-radius: 1rem; background: #757e8a; }
.scope-track::after {
    content: ""; position: absolute; inset: .15rem auto auto .15rem; width: .85rem; height: .85rem;
    border-radius: 50%; background: white;
}
.scope-switch:checked + .scope-track { background: var(--blue); }
.scope-switch:checked + .scope-track::after { transform: translateX(.85rem); }
.scope-switch:focus-visible + .scope-track { outline: 2px solid var(--blue); outline-offset: 3px; }
.scope-actions { display: flex; justify-content: flex-end; padding-top: .85rem; }
@media (prefers-reduced-motion: no-preference) {
    .scope-track { transition: background-color .15s ease; }
    .scope-track::after { transition: transform .15s ease; }
}
@media (forced-colors: active) {
    .scope-track, .scope-track::after { outline: 1px solid ButtonText; }
    .scope-switch:checked + .scope-track { outline: 2px solid Highlight; }
}
.modules { display: flex; flex-direction: column; min-height: 0; }
.modules [data-menu]:not([hidden]) { min-height: 0; display: flex; flex-direction: column; }
.modules .menu-back, .brand-row { flex-shrink: 0; }
.submenu a, .planned li { display: block; padding: .4rem .55rem; border-radius: .35rem; font-size: .95rem; line-height: 1.45; text-decoration: none; }
.submenu [aria-current="page"] { color: #20252b; background: #e1e4e9; font-weight: 500; }
.submenu [aria-current="page"]:hover { background: #dadee4; }
.planned { color: var(--muted); list-style: none; }
.sidebar-admin { flex-shrink: 0; margin-top: auto; padding-top: .7rem; border-top: 1px solid var(--outline); }
.sidebar-admin h2 { margin: 0 .55rem .5rem; color: var(--muted); font-size: .82rem; font-weight: 500; }
.operator-profile { position: relative; }
.operator-profile summary {
    display: flex; align-items: center; gap: .6rem; padding: .55rem;
    border-radius: .5rem; cursor: pointer; list-style: none;
}
.operator-profile summary::-webkit-details-marker { display: none; }
.operator-profile summary:hover { background: #e6e8ec; }
.operator-profile summary:focus-visible { outline: 2px solid var(--blue); outline-offset: -2px; }
.operator-profile[open] summary svg { transform: rotate(180deg); }
.profile-avatar {
    display: grid; place-items: center; flex: none; width: 2.15rem; height: 2.15rem;
    border: 1px solid #d6dae1; border-radius: 50%; background: var(--surface);
}
.profile-name { flex: 1; min-width: 0; overflow-wrap: anywhere; font-size: .9rem; }
.profile-name small { display: block; color: var(--muted); font-size: .8rem; }
.profile-panel {
    position: absolute; z-index: 4; inset: auto .1rem calc(100% + .65rem); display: grid; gap: .45rem;
    padding: .9rem .9rem .45rem; border: 1px solid var(--line); border-radius: .8rem; background: var(--surface);
    box-shadow: 0 8px 24px #17243822; overflow-wrap: anywhere; font-size: .9rem;
}
.profile-identity { display: grid; gap: .1rem; padding: .15rem .25rem; }
.profile-identity strong { font-weight: 550; }
.profile-identity span { color: var(--muted); font-size: .82rem; }
.profile-languages { display: grid; grid-template-columns: 1fr 1fr; padding: .15rem; border-radius: 1.15rem; background: #f1f2f4; text-align: center; }
.profile-languages span, .profile-languages button { padding: .28rem .5rem; border: 1px solid transparent; border-radius: 1rem; }
.profile-languages [aria-current] { background: var(--surface); border-color: var(--line); font-weight: 600; }
.profile-languages button { background: transparent; min-height: 0; color: var(--muted); cursor: default; }
.profile-actions { display: grid; }
.profile-action {
    display: flex; align-items: center; gap: .6rem; width: 100%; min-height: 2.35rem;
    padding: .3rem .25rem; border: 0; border-radius: .4rem; background: transparent; color: inherit; text-align: left;
}
.profile-action:disabled { cursor: default; }
.profile-action:not(:disabled):hover { background: #f1f2f4; }
.profile-action:disabled:hover, .profile-languages button:hover { background: transparent; }
.profile-logout { padding-top: .25rem; border-top: 1px solid var(--line); }
@media (max-width: 600px) {
    .sidebar-admin { display: none; margin-top: .65rem; }
    .sidebar.menu-expanded .sidebar-admin { display: block; }
    .profile-panel { inset: calc(100% + .4rem) 0 auto; }
}

main { display: flex; flex-direction: column; margin: .55rem .55rem .55rem 0; border: 1px solid var(--line); border-radius: .85rem; background: var(--surface); grid-template-columns: minmax(0, 1fr); min-width: 0; }
.catalog, .details { padding: clamp(.9rem, 1.6vw, 1.65rem); }
.catalog { min-width: 0; }
.section-header > p { margin: 0 0 .85rem; color: var(--muted); font-size: .9rem; }
.heading { display: flex; flex-wrap: wrap; align-items: center; gap: .65rem 1rem; }
h1, h2, h3 { margin: 0; }
h1 { font-size: clamp(1.55rem, 1.85vw, 1.9rem); letter-spacing: -.025em; font-weight: 550; line-height: 1.2; }
.count, .value-label, .scope-count {
    display: inline-flex; align-items: center; justify-content: center; max-width: 100%;
    padding: .16rem .55rem; border-radius: .4rem; background: var(--blue-soft);
    color: var(--blue); font-size: .82rem; font-weight: 550; font-variant-numeric: tabular-nums;
}
.count, .scope-count { white-space: nowrap; }
.value-label { overflow-wrap: anywhere; }
.catalog-usage-count { min-width: 1.85rem; }
.catalog-usage-count:hover { background: #dce8ff; }
.catalog-reference-link { color: var(--blue); text-underline-offset: .15em; }
.catalog-table-signature .value-label { background: #f1f2f4; color: var(--muted); }
.toolbar { margin-top: 1.4rem; padding: 1.15rem 0; border-top: 1px solid var(--line); }
form { display: flex; flex-wrap: wrap; gap: .55rem; align-items: center; }
form label { color: var(--muted); }
:is(input, textarea, select) { color: #171717; }
:is(input, textarea)::placeholder { color: #626a75; opacity: 1; }
.has-date-picker input[type="date"]:not(:disabled):not([readonly]) { cursor: pointer; }
.has-date-picker input[type="date"]::-webkit-calendar-picker-indicator { pointer-events: none; }
.date-picker {
    position: fixed; inset: auto; z-index: 6; width: min(19rem, calc(100vw - 16px));
    max-height: calc(100dvh - 16px); margin: 0; overflow: auto; padding: .55rem;
    border: 1px solid var(--outline); border-radius: .65rem; background: var(--surface);
    color: #171717; box-shadow: 0 10px 26px #15192324;
}
.date-picker-header { display: grid; grid-template-columns: auto 1fr 4.5rem auto; align-items: center; gap: .25rem; }
.date-picker-header span { text-align: center; text-transform: capitalize; font-weight: 600; }
.date-picker .date-picker-header input {
    min-height: 2.1rem; padding: .2rem .35rem; text-align: center; border-radius: .4rem;
    font-variant-numeric: tabular-nums;
}
.date-picker table { table-layout: fixed; text-align: center; margin-block: .35rem; }
.date-picker :is(th, td) { padding: .08rem; border: 0; background: none; width: auto; }
.date-picker th { font-size: .8rem; color: var(--muted); }
.date-picker th:first-child { width: auto; }
.date-picker td { height: 2.15rem; }
.date-picker button {
    min-height: 2.1rem; min-width: 2.1rem; padding: .2rem .35rem; border-radius: .4rem;
    border: 1px solid transparent; background: var(--surface); color: #273442;
}
.date-picker td button { width: 100%; min-width: 0; font-variant-numeric: tabular-nums; }
.date-picker button:hover:not(:disabled) { background: var(--blue-soft); color: var(--blue); }
.date-picker button:focus-visible { outline-offset: -2px; }
.date-picker button[aria-current="date"] { border-color: var(--blue); }
.date-picker [aria-selected="true"] button:not(:disabled) { background: var(--blue); color: white; }
.date-picker button:disabled { opacity: .45; cursor: default; }
.date-picker-actions { display: flex; justify-content: space-between; padding-top: .35rem; border-top: 1px solid var(--line); }
.date-picker-actions button:not(:disabled) { color: var(--blue); }
.search-field { position: relative; flex: 0 1 21rem; min-width: min(12rem, 100%); }
.search-icon { position: absolute; left: .9rem; top: .86rem; width: .95rem; height: .95rem; border: 1.6px solid var(--muted); border-radius: 50%; pointer-events: none; }
.search-icon::after { content: ""; position: absolute; width: .4rem; height: 1.6px; background: var(--muted); bottom: -.12rem; right: -.28rem; transform: rotate(45deg); }
input, button { font: inherit; border-radius: .65rem; min-height: 2.75rem; }
input { width: 100%; border: 1px solid var(--outline); padding: .55rem .75rem .55rem 2.55rem; background: var(--surface); }
button { border: 1px solid var(--blue); background: var(--blue); color: white; padding: .55rem 1rem; font-weight: 500; cursor: pointer; }
button:hover { background: #174fa9; }
.clear { padding: .35rem; font-size: .85rem; }
.table-wrap { position: relative; overflow-x: auto; }
table { width: 100%; border-collapse: separate; border-spacing: 0; text-align: left; }
th, td { padding: .7rem .75rem; border-bottom: 1px solid var(--line); }
th { font-weight: 500; color: #4a5059; background: #f5f6f7; border-top: 1px solid var(--line); font-size: .91rem; white-space: nowrap; }
tr.selected td { background: #f1f4fc; }
td { font-size: .97rem; }
td:first-child { font-variant-numeric: tabular-nums; color: var(--muted); }
td a { font-weight: 400; text-decoration: none; }
td a:hover { text-decoration: underline; }

.details { position: fixed; inset: 0 0 0 auto; margin: 0; width: min(100%, clamp(28rem, 43vw, 48rem)); max-width: none; height: 100dvh; max-height: none; overflow: auto; border: 0; outline: none; background: var(--surface); box-shadow: -8px 0 30px #15192324; }
.details[open] { animation: drawer-in 260ms cubic-bezier(.2, .72, .2, 1) both; }
.details::backdrop { background: #171c2860; animation: backdrop-in 220ms ease-out both; }
.details.closing { animation: drawer-out 200ms ease-in both; }
.details.closing::backdrop { animation: backdrop-out 200ms ease-in both; }
.details .close:focus:not(:focus-visible) { outline: none; }
@keyframes drawer-in { from { transform: translateX(100%); } to { transform: translateX(0); } }
@keyframes drawer-out { to { transform: translateX(100%); } }
@keyframes backdrop-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes backdrop-out { to { opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
    .details[open], .details::backdrop { animation: none; }
}
.details header { display: flex; align-items: flex-start; justify-content: space-between; gap: .75rem; }
.details h2 { font-size: 1.55rem; font-weight: 550; letter-spacing: -.025em; }
.close { display: grid; place-items: center; width: 2rem; height: 2rem; border-radius: .45rem; font-size: 1.6rem; line-height: 1; text-decoration: none; }
.details .close { flex: 0 0 2rem; width: 2rem; height: 2rem; min-height: 2rem; padding: 0; }
.close:hover { background: #ededee; }
.details h3 { position: relative; margin-top: 1.45rem; padding: .65rem 0 .8rem; border-bottom: 1px solid var(--line); font-size: .9rem; font-weight: 500; }
.record-properties { margin: 0 0 1.25rem; }
.record-properties > div { display: grid; grid-template-columns: minmax(7rem, 36%) minmax(0, 1fr); gap: 1rem; align-items: baseline; padding: .8rem 0; border-bottom: 1px solid var(--line); }
.record-properties dt { color: var(--muted); font-size: .92rem; overflow-wrap: anywhere; }
.record-properties dd { margin: 0; font-size: .97rem; overflow-wrap: anywhere; }
.details p { color: var(--muted); font-size: .875rem; }

@media (max-width: 600px) {
    body { display: block; }
    .sidebar { position: static; height: auto; border-right: 0; border-bottom: 1px solid var(--line); }
    .brand { margin-bottom: .5rem; }
    main { margin: .5rem; }
}

.workbar { min-height: 3.8rem; display: flex; align-items: center; justify-content: space-between; gap: .8rem; padding: .6rem clamp(.9rem, 1.6vw, 1.65rem); border-bottom: 1px solid var(--line); font-size: .95rem; }
.nomenclature-directory { padding: clamp(1rem, 2.1vw, 2rem); }
.directory-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; gap: 1.65rem clamp(1rem, 2.1vw, 2rem); }
.directory-group { border: 1px solid var(--line); border-radius: .65rem; }
.directory-group h2 { padding: .65rem 1.05rem; border-radius: .6rem .6rem 0 0; background: #e9ebee; font-size: 1.05rem; font-weight: 550; }
.directory-group ul { margin: 0; padding: 0; list-style: none; }
.directory-group a {
    display: flex; justify-content: space-between; align-items: center; gap: .65rem;
    min-height: 2.8rem; padding: .55rem 1.05rem; border-top: 1px solid var(--line); text-decoration: none;
}
.directory-group li:last-child a { border-radius: 0 0 .6rem .6rem; }
.directory-group a:hover { background: #f6f7f8; }
.directory-group a:focus-visible { outline-offset: -3px; }
.directory-group summary { padding: .48rem 1.05rem; border-top: 1px solid var(--line); color: var(--muted); cursor: pointer; font-size: .86rem; }
.directory-group summary:focus-visible { outline-offset: -3px; }
.directory-empty { color: var(--muted); }
@media (max-width: 900px) {
    .directory-grid { grid-template-columns: minmax(0, 1fr); }
}
.quiet { background: white; color: #353d47; padding: .45rem .8rem; text-decoration: none; border: 1px solid var(--outline); border-radius: .55rem; font-weight: 450; }
.quiet:hover { background: #f3f4f6; }
.primary-action { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; background: #273442; color: white; padding: .6rem 1rem; border-radius: .6rem; text-decoration: none; font-weight: 500; }
.heading .primary-action { margin-left: auto; }
.crumb, .details small { color: var(--muted); }
.details small { display: block; margin-bottom: .3rem; font-size: .9rem; }
.photo { max-width: 100%; max-height: 16rem; }
.sheet-form { display: grid; gap: 1.1rem; margin-top: 1.5rem; }
.sheet-form label { display: block; margin-bottom: .3rem; font-weight: 500; }
.sheet-form input, .sheet-form textarea, .sheet-form select { font: inherit; border: 1px solid #cbd0d8; border-radius: .55rem; width: 100%; padding: .58rem .75rem; background: white; }
.sheet-form input[readonly] { background: #f3f4f6; }
.sheet-form .toggle { appearance: none; width: 2.65rem; height: 1.55rem; min-height: 0; cursor: pointer; background: #777f8c; border: none; border-radius: 1rem; padding: .2rem; }
.toggle::before { content: ""; display: block; border-radius: 50%; width: 1.15rem; height: 1.15rem; background: white; }
.sheet-form .toggle:checked { background: #345dbe; }
.toggle:checked::before { transform: translateX(1.1rem); }
.sheet-actions { display: flex; justify-content: flex-end; align-items: center; gap: .65rem; }
.sheet-actions { position: sticky; bottom: -1px; background: white; padding: .8rem 0; border-top: 1px solid var(--line); }
.pagination { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: .65rem 1rem; margin: 1rem 0; }
.pagination-summary { margin: 0; color: var(--muted); font-size: .85rem; }
.pagination-pages { display: flex; flex-wrap: wrap; align-items: center; gap: .2rem; padding: 0; margin: 0; list-style: none; }
.pagination-page {
    display: grid; place-items: center; min-width: 2rem; min-height: 2rem; padding: 0 .35rem;
    border-radius: .5rem; color: var(--muted); font-weight: 550; font-size: .87rem; text-decoration: none;
}
a.pagination-page:hover { background: var(--blue-soft); color: var(--blue); }
.pagination-page[aria-current="page"] { background: var(--blue); color: white; }
.pagination-page[aria-disabled="true"] { opacity: .55; }
.notice { padding: .7rem .8rem; background: #eaf6ef; border-radius: .5rem; }
.error { display: block; margin-top: .25rem; color: #a32629; }
@media (max-width: 600px) {
    .workbar { flex-wrap: wrap; }
    .heading .primary-action { margin-left: 0; }
    .details { width: 100%; }
}

.brand-row { display: flex; align-items: center; justify-content: space-between; gap: .65rem; }
.mobile-menu-button { display: none; }
.details[open] { display: flex; flex-direction: column; }
.sheet-form[data-editor] { display: flex; flex: 1; flex-direction: column; align-items: stretch; flex-wrap: nowrap; }
.sheet-actions { margin-top: auto; }
.long-text { white-space: pre-line; }
@media (max-width: 600px) {
    .brand { margin: 0; }
    .mobile-menu-button { display: block; }
    .mobile-menu-button[aria-expanded="false"] { color: #394151; }
    .sidebar .modules { display: none; }
    .sidebar.menu-expanded .modules { display: flex; margin-top: .7rem; }
    .sheet-form input, .sheet-form textarea, .sheet-form select, .search-field input { font-size: max(1rem, 16px); }
}

.login-page { display: grid; grid-template-columns: minmax(0, 1fr); place-items: center; min-height: 100svh; padding: 1rem; }
.login-card { width: min(100%, 26rem); margin: 0; padding: clamp(1.5rem, 4vw, 2.5rem); border-radius: 1rem; }
.login-card .brand { margin: 0 0 2rem; }
.login-card .brand-image { width: 15rem; }
.login-card h1 { font-size: 1.65rem; }
.login-card .sheet-form button { margin-top: .25rem; background: #273442; border-color: #273442; color: white; }

.toolbar { display: flex; align-items: center; flex-wrap: wrap; justify-content: space-between; gap: .6rem; }
.toolbar form { flex: 1 1 auto; }
.toolbar.directory-filters { justify-content: flex-start; }
.directory-filters .searchable-select { flex: 0 1 15rem; }
.directory-filters [role="combobox"] { padding-inline: .75rem 2.4rem; }
.list-options { position: relative; }
.list-options summary, .system-fields summary { cursor: pointer; color: #454f5b; font-size: .93rem; }
.list-options summary { padding: .4rem .6rem; }
.list-options > div { position: absolute; right: 0; z-index: 1; width: max-content; padding: .3rem; background: white; border: 1px solid var(--line); border-radius: .5rem; box-shadow: 0 4px 18px #181f2912; }
.list-options a { display: block; padding: .45rem .7rem; text-decoration: none; }
.list-options a:hover { background: #f2f3f5; }
th:first-child { width: 7.5rem; }
th:has(+ th + .action-col):nth-child(2) { width: 9rem; }
th a { color: inherit; text-decoration: none; }
.table-sort { display: inline-flex; align-items: center; gap: .35rem; text-decoration: none; }
.table-sort span { color: var(--muted); }
th[aria-sort] .table-sort span, .table-sort:hover { color: var(--blue); }
.catalog-table-tools { display: flex; justify-content: flex-end; margin: -.5rem 0 .6rem; }
.action-col { width: 1%; white-space: nowrap; text-align: right; }
.row-edit { display: inline-flex; align-items: center; gap: .4rem; padding: .15rem .45rem; color: #475565; border-radius: .35rem; font-size: .87rem; }
.row-edit svg { width: 1rem; height: 1rem; fill: none; stroke: currentColor; stroke-width: 1.65; stroke-linejoin: round; }
.row-edit:hover { background: #eef0f3; text-decoration: none; }
.drawer-edit { align-self: flex-start; margin-top: 1rem; }
.empty-value { color: #737a81; }
.system-fields { margin: .5rem 0 1rem; }
.system-fields summary { font-weight: 500; padding: .5rem 0; }
.sheet-actions .delete-action { margin-right: auto; color: #963d3d; background: none; border: 0; }
.sheet-form .remove-photo { display: flex; align-items: center; gap: .5rem; font-weight: 400; }
.remove-photo input { width: auto; min-height: 1.4rem; }
.print-page { display: block; background: white; margin: 2rem; }
.print-page header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1rem; }
.book-heading-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin-left: auto; }
.book-card-page { max-width: 50rem; margin: 2rem auto; padding-inline: 1rem; }
.book-card-page main { display: block; margin: 0; border: 0; }
.book-card-page header { flex-wrap: wrap; gap: .75rem; }
.book-card-page header h1 { margin: 0; font-size: 1.4rem; }
.book-card-page header .book-back { margin: 0; }
.bibliographic-card { padding: 1.5rem; border: 1px solid var(--line); border-radius: .65rem; overflow-wrap: anywhere; }
.bibliographic-card h2 { margin: .45rem 0; font-size: 1.3rem; }
.bibliographic-card p { margin: .4rem 0; white-space: pre-line; }
.bibliographic-card .card-volume { margin-top: .9rem; }
@media (max-width: 600px) {
    .row-edit { min-width: 2.5rem; min-height: 2.5rem; justify-content: center; }
    .row-edit span { display: none; }
    th, td { padding-inline: .5rem; }
}
@media print {
    .print-page { margin: 0; }
    .print-page button { display: none; }
    .book-card-page { max-width: none; padding: 0; }
    .book-card-page header { display: none; }
    .bibliographic-card { padding: 0; border: 0; }
    tr { break-inside: avoid; }
}

#details-title:focus { outline: none; }
.details:has([data-editor]) { overflow: hidden; padding-bottom: 0; }
.details:has([data-editor]) header { flex-shrink: 0; }
.sheet-form[data-editor] { min-height: 0; gap: 0; margin-top: .9rem; }
.editor-fields { min-height: 0; overflow-y: auto; flex: 1; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; align-content: start; padding: .2rem .2rem 1rem; }
.editor-fields .field-wide, .editor-fields > .error, .editor-fields .system-number, .editor-fields .system-fields { grid-column: 1 / -1; }
.editor-fields .system-number { margin: 0 0 .2rem; }
.sheet-actions { flex-shrink: 0; position: static; padding: .8rem 0; }
.sheet-form .field input, .sheet-form .field textarea, .sheet-form .field select { font-weight: 400; }
@media (max-width: 600px) {
    .editor-fields { grid-template-columns: minmax(0, 1fr); }
    th:first-child { width: auto; }
}

.planned li:has(> a) { padding: 0; }
.catalog-list-table th:first-child:not(.catalog-table-signature) { width: auto; }
.catalog-list-table .catalog-table-number { width: 8rem; white-space: nowrap; }
.catalog-list-table .catalog-table-title { color: inherit; overflow-wrap: anywhere; }
.catalog-table-title a { font-weight: 600; }
.catalog-list-table .catalog-table-signature { width: 12rem; }
.catalog-list-table .catalog-table-quantity { width: 7rem; text-align: center; }
.catalog-table-quantity .value-label { min-width: 1.85rem; }
.catalog-table-quantity a.value-label:hover { background: #dce8ff; }
.book-list-table th:nth-child(3) { width: 25%; }
.book-list-table td:nth-child(4) { font-variant-numeric: tabular-nums; }
.book-list-table .catalog-table-code { width: 12rem; }
.book-repeat { min-width: 0; margin: .25rem 0; border: 1px solid var(--line); border-radius: .65rem; padding: .7rem; }
.book-repeat-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; gap: .65rem; margin-bottom: .7rem; padding-bottom: .7rem; border-bottom: 1px solid var(--line); }
.book-repeat-row > .quiet { justify-self: end; }
.book-repeat-row .book-check { display: flex; align-items: center; gap: .4rem; align-self: center; font-weight: 400; }
.classification-row-header { grid-column: 1 / -1; display: flex; align-items: center; flex-wrap: wrap; gap: .5rem; }
.classification-actions { display: flex; gap: .35rem; margin-left: auto; }
.classification-actions button { min-height: 2.15rem; }
.classification-actions button:disabled { opacity: .45; cursor: default; }
.classification-first { display: none; font-size: .83rem; font-weight: 400; color: var(--muted); }
.classification-row:first-child .classification-first, .classification-preview .classification-first { display: inline; }
.classification-preview { margin: 0; padding-left: 1.6rem; }
.classification-preview li { padding: .45rem 0; }
.classification-preview .classification-first { margin-left: .6rem; }
.inventory-kinds { display: flex; flex-wrap: wrap; gap: .45rem; margin-top: 1rem; }
.inventory-kinds [aria-current] { background: #e1e4e9; }
.catalog-subgroup { margin: 0 0 .8rem; border: 1px solid var(--line); border-radius: .55rem; }
.catalog-subgroup > summary, .catalog-subgroup > h3 { padding: .65rem .85rem; background: #f1f2f4; border-radius: .5rem; font-weight: 550; }
.catalog-subgroup > summary, .catalog-holding-preview > summary { cursor: pointer; }
.catalog-subgroup > div, .catalog-subgroup > dl, .catalog-subgroup > ul, .catalog-subgroup > p { padding: .8rem; }
.catalog-subgroup > .editor-fields { padding: .8rem; }
.catalog-detail-row { grid-template-columns: minmax(0, 1fr); }
.catalog-detail-row > .catalog-subgroup { margin: 0; }
.catalog-row-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: .45rem; }
.catalog-index-list { margin: 0; padding-inline-start: 2rem !important; }
.catalog-holding-preview { padding: .45rem .85rem; }
.catalog-holding-preview dl { margin-top: .6rem; }
.book-field-groups { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .8rem; }
.book-field-card { min-width: 0; margin: 0; }
.book-field-card-wide { grid-column: 1 / -1; }
.book-field-card > h3 { display: flex; align-items: center; gap: .55rem; }
.book-field-values { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .6rem 1rem; margin: 0; }
.book-field-values dt { color: var(--muted); font-size: .85rem; }
.book-field-values dd { margin: .15rem 0 0; overflow-wrap: anywhere; }
.book-field-values .field-wide { grid-column: 1 / -1; }
@media (max-width: 900px) {
    .book-field-groups { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 600px) {
    .book-field-values { grid-template-columns: minmax(0, 1fr); }
}
.book-check input { width: auto; min-height: 1rem; }
@media (max-width: 600px) {
    .book-repeat-row { grid-template-columns: 1fr; }
    .book-list-table { min-width: 55rem; }
    .material-list-table { min-width: 36rem; }
}

.book-editor { width: min(100%, 88rem); margin-inline: auto; display: flex; flex: 1; flex-direction: column; }
.book-record {
    display: flex; flex-direction: column; min-width: 0; margin-top: 1.35rem;
    border: 1px solid var(--line); border-radius: .8rem;
}
.book-back { display: inline-block; margin-bottom: .8rem; color: var(--muted); text-decoration: none; }
.book-back:hover { text-decoration: underline; }
.book-editor-title { margin: .4rem 0 0; color: var(--muted); }
.record-tabs {
    display: flex; align-items: flex-end; gap: .35rem;
    padding: .5rem .75rem 0; overflow-x: auto; overscroll-behavior-inline: contain; scrollbar-width: thin;
    border-radius: .8rem .8rem 0 0; box-shadow: inset 0 -1px var(--line); background: #f1f2f4;
}
.record-tabs a {
    display: inline-flex; align-items: center; gap: .52rem; flex: 0 0 auto;
    padding: .65rem .9rem; white-space: nowrap; color: var(--muted); font-size: .95rem;
    text-decoration: none; border: 1px solid transparent; border-radius: .5rem .5rem 0 0;
}
.record-tabs a svg {
    flex: none; width: 1.2rem; height: 1.2rem; fill: none; stroke: var(--blue);
    stroke-width: 1.65; stroke-linecap: round; stroke-linejoin: round;
}
.record-tabs a:hover { color: #171717; background: #e9ebee; border-bottom-color: var(--line); }
.record-tabs a[aria-selected="true"] {
    color: #171717; background: var(--surface); border-color: var(--line);
    border-bottom-color: var(--surface);
}
.record-tabs a:focus-visible { outline: 2px solid currentColor; outline-offset: -3px; }
[data-tab-panel][hidden], .record-tabs a[hidden], [data-open-record-tab][hidden] { display: none; }
.book-editor-form {
    display: flex; flex-direction: column; flex-wrap: nowrap; align-items: stretch;
    margin: 0; padding-inline: clamp(.85rem, 2vw, 1.6rem);
}
.book-editor-form > section { padding: 1.15rem 0 .5rem; scroll-margin-block: 1rem 6rem; }

.book-editor-form h2 { margin-bottom: .8rem; font-size: 1.1rem; font-weight: 550; }
.book-editor-form .editor-fields { overflow: visible; padding: 0; gap: .75rem 1.1rem; }
.book-editor-form .catalog-subgroup > .editor-fields { padding: .7rem .85rem .8rem; }
.book-editor-form label { margin-bottom: .22rem; }
.book-editor-form input:not([type="checkbox"]), .book-editor-form textarea {
    min-height: 2.4rem; padding: .36rem .7rem; border-radius: .45rem;
}
.book-editor-form button { min-height: 2.4rem; padding-block: .35rem; }
.book-editor-form .searchable-select > button.select-chevron { min-height: 0; }
.book-editor-form .select-popup li { padding-block: .42rem; }
.book-editor-form .select-popup li[aria-selected="true"]::after { top: .42rem; }
.classification-term-groups { margin-top: .85rem; }
.classification-term-groups .book-index-field { margin: 0; }
.index-tags-control {
    display: flex; flex-wrap: wrap; align-items: center; gap: .35rem; min-width: 0;
    border: 1px solid #cbd0d8; border-radius: .45rem; background: var(--surface); padding: .3rem;
}
.index-tags-control:focus-within { outline: 2px solid var(--blue); outline-offset: -2px; }
.index-tags-control .searchable-select { flex: 1 1 9rem; min-width: min(100%, 9rem); }
.book-editor-form .index-tags-control .searchable-select [role="combobox"] { border: 0; min-height: 1.85rem; background: transparent; }
.index-tags-control .searchable-select [role="combobox"]:focus { outline: none; }
.index-tag-list { display: flex; flex-wrap: wrap; gap: .3rem; margin: 0; padding: 0; list-style: none; min-width: 0; }
.index-tags-control .index-tag-list:empty { display: none; }
.index-tag {
    display: inline-flex; align-items: center; gap: 3px; min-width: 0; padding: 2px 7px;
    border-radius: .4rem; background: var(--blue-soft); color: var(--blue);
    font-size: 14px; line-height: 20px; font-weight: 500; overflow-wrap: anywhere;
}
.book-editor-form .index-tag button {
    flex: none; display: grid; place-items: center; min-width: 20px; min-height: 20px; padding: 0;
    background: transparent; color: inherit; border: 0; border-radius: .3rem; font-size: 16px; line-height: 1;
}
.book-editor-form .index-tag button:hover { background: #dce8ff; color: #174fa9; }
.index-tag-note { margin: .45rem 0 0; }
.book-editor-actions { position: sticky; z-index: 2; bottom: 0; margin-top: .35rem; }
.book-editor-actions button { background: #273442; border-color: #273442; color: white; }
.book-editor-actions button:hover { background: #192631; border-color: #192631; }
.book-saved {
    display: flex; align-items: center; gap: .7rem; margin-bottom: 1rem;
    padding: .6rem .8rem; border: 1px solid #ade4c3; border-radius: .65rem;
    background: #ebfbf2; color: #14623c; font-size: .9rem;
}
.book-saved-icon {
    flex: none; display: grid; place-items: center; width: 1.05rem; height: 1.05rem;
    border: 1px solid currentColor; border-radius: 50%; font-size: .72rem; line-height: 1;
}
.book-saved-close {
    margin-left: auto; padding: 0; min-width: 2.25rem; min-height: 2.25rem; border: 0;
    border-radius: .4rem; background: transparent; color: inherit; font-size: 1.2rem;
}
.book-saved-close:hover { background: #d7f3e3; }
.book-preview .heading { justify-content: space-between; }
.book-preview-content { padding: 1.15rem clamp(.85rem, 2vw, 1.6rem); }
.book-preview-grid {
    display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; margin: 0;
}
.book-preview-grid > div { padding: .75rem .9rem; border: 1px solid var(--line); border-radius: .55rem; }
.book-preview-grid .field-wide { grid-column: 1 / -1; }
.book-preview-grid dt, .book-preview-note { color: var(--muted); font-size: .875rem; }
.book-preview-grid dd { margin: .15rem 0 0; overflow-wrap: anywhere; }
.book-preview-grid dd + dt { margin-top: .55rem; }
.book-preview-note { margin-top: 0; }
@keyframes book-preview-in {
    from { opacity: .45; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}
@media (prefers-reduced-motion: no-preference) {
    .book-preview-content { animation: book-preview-in 180ms ease-out; }
}
@media (max-width: 600px) {
    .book-preview-grid { grid-template-columns: minmax(0, 1fr); }
}
.book-editor input, .book-editor select, .book-editor textarea { scroll-margin-bottom: 6rem; }
.searchable-select { position: relative; min-width: 0; }
.select-with-create { display: flex; gap: .4rem; align-items: stretch; }
.select-with-create .searchable-select { flex: 1; }
.select-create { flex: none; width: 2.75rem; padding: 0; font-size: 1.2rem; line-height: 1; }
.select-create svg { width: 1.15rem; height: 1.15rem; vertical-align: middle; fill: none; stroke: currentColor; stroke-width: 1.75; }
.term-drawer { overflow: hidden; padding-bottom: 0; }
.term-drawer header { align-items: center; }
.term-drawer .close { min-height: 2rem; padding: 0; }
.term-drawer [data-term-content] { display: flex; flex: 1; min-height: 0; }
.term-form { flex: 1; min-height: 0; display: flex; flex-direction: column; align-items: stretch; flex-wrap: nowrap; }
.term-form .sheet-actions { margin-top: 0; }
.term-form .sheet-actions button:disabled { opacity: .6; cursor: wait; }
.term-form [data-field-error]:empty { display: none; }
.term-matches > p { font-size: .88rem; margin: .55rem 0 .35rem; color: var(--muted); }
.term-matches ul { margin: .35rem 0 .55rem; padding: 0; list-style: none; border: 1px solid var(--line); border-radius: .5rem; }
.term-matches li { display: flex; justify-content: space-between; align-items: center; gap: .6rem; padding: .35rem .55rem; }
.term-matches li + li { border-top: 1px solid var(--line); }
.term-matches li > span { min-width: 0; overflow-wrap: anywhere; }
.term-matches li small { display: block; color: var(--muted); }
.term-matches li .quiet { flex: none; min-height: 2.2rem; }
.sheet-form .match-confirmation { display: flex; align-items: center; gap: .5rem; font-weight: 400; }
.sheet-form .match-confirmation[hidden] { display: none; }
.sheet-form .match-confirmation input { width: auto; min-height: 0; }
.term-lookup { flex: 1; min-width: 0; display: flex; flex-direction: column; margin-top: 1.1rem; }
.term-lookup-groups:not([hidden]) { display: flex; flex-wrap: wrap; gap: .35rem; margin-bottom: .7rem; }
.term-lookup-groups button { padding: .3rem .6rem; min-height: 2.15rem; }
.term-lookup-groups button[aria-pressed="true"] { background: #e1e4e9; color: #171717; }
.term-lookup input { padding-inline: .75rem; }
.term-lookup-status:empty { display: none; }
.term-lookup-results { min-height: 0; overflow-y: auto; list-style: none; margin: .65rem 0 1rem; padding: 0; }
.term-lookup-results button {
    width: 100%; text-align: left; border: 0; border-radius: .35rem; color: var(--ink, #171717);
    background: var(--surface); font-weight: 400; overflow-wrap: anywhere;
}
.term-lookup-results button:hover, .term-lookup-results button:focus-visible { background: #f1f2f4; }
.term-lookup-results button:focus-visible { outline-offset: -3px; }
.sheet-form .searchable-select [role="combobox"] { padding-right: 2.4rem; }
.searchable-select .select-chevron {
    position: absolute; top: 1px; right: 1px; bottom: 1px; min-height: 0; width: 2.35rem;
    display: grid; place-items: center; padding: 0; border: 0; background: transparent; color: #59616d;
}
.select-chevron:hover { color: #222a35; }
.select-chevron svg { width: .95rem; height: .95rem; fill: none; stroke: currentColor; stroke-width: 1.4; }
[aria-expanded="true"] ~ .select-chevron svg { transform: rotate(180deg); }
.select-popup {
    position: fixed; inset: auto; z-index: 5; max-width: none; margin: 0; padding: .3rem; overflow-y: auto;
    overscroll-behavior: contain; border: 1px solid var(--outline); border-radius: .65rem; background: white;
    color: #222a35; box-shadow: 0 8px 22px #17243822;
}
.select-popup ul { list-style: none; margin: 0; padding: 0; }
.select-popup li { position: relative; padding: .58rem 1.85rem .58rem .65rem; border-radius: .4rem; overflow-wrap: anywhere; cursor: pointer; }
.select-popup li:hover, .select-popup li[data-active] { background: #edf1f6; }
.select-popup li[aria-selected="true"] { background: #f0f1f3; font-weight: 550; }
.select-popup li[aria-selected="true"]::after { content: '✓'; position: absolute; top: .58rem; right: .65rem; }
.select-popup [role="status"]:not(:empty) { display: block; padding: .45rem .65rem; color: var(--muted); font-size: .85rem; }
.book-heading-picker { position: relative; }
.book-heading-picker input[name="r_p"] { padding-right: 2.5rem; }
.book-editor-form .book-heading-picker input[name="r_p"] { padding-inline-end: 2.5rem; }
.book-heading-picker summary {
    position: absolute; inset: 1px 1px 1px auto; width: 2.35rem; display: grid; place-items: center;
    list-style: none; cursor: pointer; color: #59616d;
}
.book-heading-picker summary::-webkit-details-marker { display: none; }
.book-heading-picker details[open] summary svg { transform: rotate(180deg); }
.book-heading-picker .book-heading-options {
    position: absolute; inset: calc(100% + .25rem) 0 auto; max-height: 16rem; list-style: none;
}
.book-heading-options li { padding: 0; }
.book-heading-options button {
    width: 100%; display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: .2rem .7rem;
    background: transparent; border: 0; color: inherit; text-align: left; font-weight: 400;
}
.book-heading-options button:hover, .book-heading-options button:focus-visible { background: #edf1f6; }
.book-heading-options small { color: var(--muted); }
.book-heading-actions {
    position: sticky; bottom: -.3rem; margin-top: .25rem; padding-top: .3rem;
    border-top: 1px solid var(--line); background: var(--surface);
}
.book-heading-actions button { border-radius: .4rem; background: #f4f8fd; color: #174e83; font-weight: 550; }
.book-heading-actions button:hover, .book-heading-actions button:focus-visible { background: #e6f0fc; }
.book-heading-action-label { display: inline-flex; align-items: baseline; gap: .45rem; }
.book-heading-action-label > span { font-size: 1.1em; line-height: 1; }
.book-heading-actions small { font-weight: 400; }

.book-inventory-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .65rem; }
.book-inventory-toolbar .inventory-kinds { margin: 0; }
.book-inventory-toolbar [aria-pressed="true"] { background: #e9f3fc; color: #174e83; border-color: #c7def4; }
.book-inventory-search, .book-editor-form .book-inventory-search {
    display: block; width: min(100%, 28rem); margin: .8rem 0 1rem;
}
.book-editor-form .book-inventory-search input { padding-inline-start: 2.55rem; }
.book-editor-form .book-inventory-search .search-icon { top: .66rem; }
.book-inventory-table { min-width: 35rem; }
.book-inventory-table td, .book-inventory-table th { padding-block: .48rem; }
.book-inventory-table a { color: #174e83; }
.book-inventory-table .inventory-expand { min-height: 2rem; padding: .2rem .4rem; }
.book-inventory-table [data-inventory-expand][aria-expanded="true"] { background: #e8f2fb; }
.inventory-detail-cell { background: #f8f9fa; }
.inventory-copy-details { padding: .45rem .5rem; }
.inventory-archive-note { margin: .55rem 0 .15rem; color: var(--muted); font-size: .88rem; }
.inventory-history-title { margin: .75rem 0 .35rem; font-size: .95rem; }
.inventory-history { margin: 0; padding-inline-start: 1.25rem; }
.inventory-history li + li { margin-top: .4rem; }
.inventory-drawer header { display: flex; justify-content: space-between; align-items: center; gap: .5rem; }
.inventory-drawer form { align-items: stretch; flex: 1; }
.inventory-drawer .editor-fields { margin: 0; }
.inventory-drawer fieldset { min-width: 0; border: 0; }
.inventory-drawer [hidden] { display: none; }
.inventory-drawer .sheet-actions { margin-top: auto; }
.inventory-drawer p { margin: .25rem 0; }
.inventory-signatures:not([hidden]) { display: flex; flex-wrap: wrap; gap: .4rem; }

.catalog-search-views {
    display: flex; flex-wrap: wrap; align-items: stretch; gap: .3rem; margin-top: 1rem;
    border-bottom: 1px solid var(--line);
}
.catalog-search-views + .toolbar { margin-top: 0; border-top: 0; }
.catalog-search-view {
    display: flex; align-items: center; gap: .35rem; min-height: 2.6rem; min-width: 0; padding: .45rem .65rem;
    color: var(--muted); border-bottom: 2px solid transparent; text-decoration: none; font-size: .9rem;
}
.catalog-search-view[aria-current="page"] {
    border-bottom-color: var(--blue); color: var(--blue); font-weight: 550;
}
.catalog-search-view-selected { border-bottom-color: var(--blue); color: #171717; font-weight: 600; }
.catalog-search-view-selected a { text-decoration: none; overflow-wrap: anywhere; }
.catalog-view-close { display: grid; place-items: center; flex: none; width: 1.5rem; height: 1.5rem; border-radius: .3rem; }
.catalog-view-close:hover { background: var(--blue-soft); }
.catalog-saved-views { position: relative; }
.catalog-saved-views > summary { list-style: none; cursor: pointer; }
.catalog-saved-views > summary::-webkit-details-marker { display: none; }
.catalog-saved-views > summary::after { content: '▾'; color: var(--blue); }
.catalog-saved-views svg {
    width: 1rem; height: 1rem; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linejoin: round;
}
.catalog-saved-menu {
    position: absolute; z-index: 6; inset: calc(100% + .35rem) auto auto 0; width: min(16rem, calc(100vw - 2rem));
    max-height: 18rem; overflow: auto; padding: .35rem; border: 1px solid var(--line); border-radius: .6rem;
    background: var(--surface); box-shadow: 0 8px 24px #15192320;
}
.catalog-saved-menu a, .catalog-saved-menu p { display: block; margin: 0; padding: .42rem .55rem; overflow-wrap: anywhere; }
.catalog-saved-menu a { border-radius: .35rem; color: var(--muted); font-size: .85rem; text-decoration: none; }
.catalog-saved-menu a:hover:not([aria-current]) { background: #f1f2f4; }
.catalog-saved-menu a[aria-current="page"] { color: #171717; font-weight: 600; }
.catalog-saved-menu p { color: var(--muted); font-size: .9rem; }
.catalog-saved-menu [hidden] { display: none; }
.catalog-saved-menu-title { display: block; padding: .4rem .55rem; border-bottom: 1px solid var(--line); font-size: .9rem; }
.catalog-saved-item { display: flex; align-items: center; gap: .15rem; }
.catalog-saved-item a { flex: 1 1 auto; min-width: 0; }
.catalog-saved-item button {
    flex: none; display: grid; place-items: center; width: 1.8rem; min-height: 1.8rem; padding: 0;
    border: 0; border-radius: 50%; background: transparent; color: var(--muted);
}
.catalog-saved-item button svg { stroke-width: 1.4; stroke-linecap: round; }
.catalog-saved-item button:hover { background: #fbe9ea; color: #a32629; }
.catalog-smart-search { position: relative; width: 100%; }
.catalog-smart-search [hidden], .catalog-save-dialog [hidden] { display: none; }
.catalog-search-bar {
    position: relative; display: flex; flex: 1 0 100%; flex-wrap: wrap; align-items: center; gap: .35rem;
    min-width: 0; padding: .3rem .45rem .3rem 2.6rem; border: 1px solid var(--outline);
    border-radius: .6rem; background: var(--surface);
}
.catalog-search-bar:focus-within { outline: 2px solid var(--blue); outline-offset: -1px; }
.catalog-search-bar > .search-icon { top: .9rem; }
.catalog-search-bar > input[type="search"] {
    flex: 1 1 14rem; width: auto; min-width: min(100%, 12rem); min-height: 2.2rem;
    padding: .3rem .2rem; border: 0; outline: none;
}
.catalog-search-filters > summary {
    padding: .35rem .45rem; font-size: .87rem; color: var(--muted); cursor: pointer; text-underline-offset: .15em;
}
.catalog-search-filters > summary { list-style: none; border-radius: .4rem; }
.catalog-search-filters > summary::-webkit-details-marker { display: none; }
.catalog-search-filters > summary::after { content: ' ▾'; }
.catalog-search-controls { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: .15rem; margin-inline-start: auto; }
.catalog-search-control {
    display: inline-flex; align-items: center; gap: .3rem; min-height: 2.2rem; padding: .3rem .45rem;
    border: 0; border-radius: .35rem; color: var(--muted); background: transparent;
    font-size: .87rem; font-weight: 500; text-decoration: none;
}
.catalog-search-control:hover:not(:disabled) { color: var(--blue); background: var(--blue-soft); }
.catalog-search-control svg {
    flex: none; width: 1rem; height: 1rem; fill: none; stroke: currentColor;
    stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round;
}
.catalog-search-save { color: var(--blue); }
.catalog-search-save:disabled { opacity: .55; cursor: default; }
.catalog-search-chip {
    display: inline-flex; align-items: stretch; min-width: 0; max-width: 100%; border-radius: .4rem;
    background: var(--blue-soft); color: var(--blue); font-size: .87rem; overflow-wrap: anywhere;
}
.catalog-search-chip button, .catalog-search-chip a, .catalog-search-chip-text {
    min-height: 1.9rem; padding: .18rem .48rem; border: 0; background: transparent;
    color: inherit; font: inherit; text-decoration: none;
}
.catalog-search-chip button { text-align: left; min-width: 0; }
.catalog-search-chip :is(button, .catalog-search-chip-text) > span { color: var(--muted); }
.catalog-search-chip a { display: grid; place-items: center; border-inline-start: 1px solid #dbe7fb; border-radius: 0 .4rem .4rem 0; }
.catalog-search-chip :is(button, a):hover { background: #dce8ff; }
.catalog-filter-panel {
    position: relative; padding: .6rem; min-width: 0; border: 1px solid var(--line); border-radius: .65rem;
    background: var(--surface); box-shadow: 0 8px 24px #15192320;
}
[data-search-ready] .catalog-filter-panel {
    position: absolute; z-index: 5; inset: calc(100% + .35rem) auto auto 0; width: min(100%, 23rem);
}
.catalog-filter-header { display: flex; align-items: center; gap: .45rem; padding-bottom: .45rem; }
.catalog-filter-header strong { flex: 1; }
.catalog-filter-header button {
    min-width: 2rem; min-height: 2rem; padding: .15rem .4rem; border: 0; background: transparent; color: #273442;
}
.catalog-filter-header button:hover { background: var(--blue-soft); }
.catalog-filter-menu { display: grid; gap: .15rem; max-height: min(20rem, 43vh); overflow: auto; scrollbar-width: thin; }
.catalog-filter-menu :is(button, a) {
    min-height: 2.2rem; padding: .35rem .55rem; border: 0; border-radius: .4rem;
    color: #273442; background: var(--surface); text-align: left; text-decoration: none; font-weight: 400;
}
.catalog-filter-menu :is(button, a):hover { background: var(--blue-soft); color: var(--blue); }
.catalog-filter-editor { min-width: 0; margin: 0; padding: .35rem 0; border: 0; }
.catalog-filter-editor label { display: grid; gap: .25rem; font-size: .9rem; }
.catalog-filter-editor input { min-height: 2.2rem; min-width: 0; padding: .3rem .55rem; }
.catalog-filter-options { display: grid; gap: .35rem; }
.catalog-filter-options label { display: flex; align-items: center; gap: .5rem; padding: .25rem .4rem; }
.catalog-filter-options input { width: auto; min-height: 0; margin: 0; accent-color: var(--blue); }
.catalog-filter-editor small { display: block; margin-top: .35rem; color: var(--muted); }
.catalog-filter-years { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .6rem; }
.catalog-filter-actions { display: flex; justify-content: flex-end; margin-top: .35rem; }
.catalog-filter-actions button { min-height: 2.2rem; }
.catalog-save-dialog {
    width: min(25rem, calc(100% - 2rem)); padding: 1.2rem; border: 1px solid var(--line); border-radius: .8rem;
    color: #171717; background: var(--surface); box-shadow: 0 12px 28px #1519232b;
}
.catalog-save-dialog::backdrop { background: #15192350; }
.catalog-save-dialog form { display: grid; gap: .45rem; }
.catalog-save-dialog input { padding-inline: .65rem; }
.catalog-save-actions { display: flex; justify-content: flex-end; gap: .5rem; margin-top: .3rem; }
.catalog-smart-search > .error { flex: 1 0 100%; margin: 0; }
@media (max-width: 600px) {
    .catalog-search-views { position: relative; }
    .catalog-saved-views { position: static; }
    .catalog-search-bar { padding-inline-start: .45rem; }
    .catalog-search-bar > .search-icon { display: none; }
    .catalog-search-bar > input[type="search"] { font-size: 16px; }
}

.book-editor-subsection { margin-block: 0 .8rem; }
.book-editor-subsection + .catalog-subgroup { margin-block-start: .8rem; }
.book-editor-subsection > :is(.book-repeat, .book-preview-grid, .book-preview-note) { margin: .75rem; }
.related-table-body { display: grid; gap: .6rem; padding: .7rem; }
.related-table-body > button { justify-self: start; }
.related-table-body > .book-preview-note { margin: 0; }
.related-table { min-width: min(30rem, 100%); }
.related-table td { vertical-align: middle; overflow-wrap: anywhere; }
.related-table th:first-child { width: auto; }
.related-table td.action-col { white-space: nowrap; }
.related-table .quiet { min-height: 2rem; padding: .3rem .55rem; }
.related-drawer form { align-items: stretch; flex: 1; }
.related-drawer-fields { width: 100%; }
.related-drawer .sheet-actions { width: 100%; margin-top: auto; }
.related-drawer .sheet-actions .related-remove { margin-inline-end: auto; }
.related-drawer [hidden] { display: none; }

.inventory-actions, .inventory-signature-field { display: flex; align-items: center; flex-wrap: wrap; gap: .5rem; }
.inventory-signature-field input { flex: 1 1 10rem; min-width: 0; }
.inventory-drawer .close svg { width: 1rem; height: 1rem; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; }
.inventory-drawer .sheet-form { display: flex; flex-direction: column; gap: .9rem; }
.inventory-drawer .editor-fields { align-content: start; overflow: visible; flex: none; min-width: 0; padding: .35rem .35rem; gap: .65rem .9rem; }
.inventory-drawer fieldset legend { padding: 0; font-weight: 550; margin-bottom: .3rem; }
.inventory-drawer .sheet-form .book-check input { width: auto; margin-inline-end: .35rem; }
.inventory-drawer .catalog-subgroup .editor-fields { padding: .7rem .8rem; }
.inventory-copy-details + .quiet, .inventory-archive-note + .quiet { margin-top: .6rem; }

.material-specific-card > h3 { background: #edf2f7; }

.content-credit-row + .content-credit-row { margin-top: .6rem; border-top: 1px solid var(--line); }
.content-credit-row > button { justify-self: start; }
