:root {
  color-scheme: light;
  --ink: #202b46;
  --muted: #52607b;
  --surface: #fff;
  --bg: #f3f5fa;
  --line: #cbd4e6;
  --brand: #4861a3;
  --brand-dark: #36508e;
  --accent: #c71969;
  --accent-dark: #aa1257;
  --danger: #a22240;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.55 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
.wrap { max-width: 1200px; margin: 0 auto; padding: 0 1rem; }
header { background: #fff; border-bottom: 4px solid var(--accent); }
header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; min-height: 6rem; flex-wrap: wrap; }
.brand { display: inline-flex; align-items: center; flex: 0 0 auto; }
.brand img { display: block; width: 220px; max-width: 52vw; height: auto; }
.header-controls { display: flex; flex: 1 1 auto; align-items: center; justify-content: flex-end; gap: 1.5rem; min-width: 0; }
nav { display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; }
header nav a:link, header nav a:visited { display: inline-flex; align-items: center; gap: .4rem; padding: .35rem .25rem; color: var(--brand-dark); font-weight: 650; text-decoration: none; white-space: nowrap; }
header nav a:hover, header nav a:focus-visible,
header nav a[aria-current="page"], header nav a[aria-current="page"]:visited,
header nav a[aria-current="page"]:hover { color: var(--accent); text-decoration: none; }
header nav a svg { flex: 0 0 auto; width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
nav form { margin: 0; }
.profile-menu { position: relative; flex: 0 0 auto; }
.profile-menu summary { display: flex; align-items: center; gap: .45rem; padding: .4rem .2rem; color: var(--brand-dark); font-weight: 650; cursor: pointer; list-style: none; }
.profile-menu summary::-webkit-details-marker { display: none; }
.profile-menu summary:hover, .profile-menu[open] summary, .profile-menu summary.is-current { color: var(--accent); }
.profile-menu summary:focus { outline: 3px solid #e0a63d; outline-offset: 2px; }
.profile-menu svg { flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.profile-name { max-width: 20rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profile-chevron { transition: transform .15s ease; }
.profile-menu[open] .profile-chevron { transform: rotate(180deg); }
.profile-popover { position: absolute; z-index: 20; right: 0; top: calc(100% + .4rem); min-width: 16rem; max-width: calc(100vw - 2rem); padding: .4rem; background: #fff; border: 1px solid var(--line); border-radius: .4rem; box-shadow: 0 8px 24px #202b4626; }
.profile-popover a, .profile-popover button { display: flex; align-items: center; gap: .8rem; width: 100%; padding: .65rem .75rem; border: 0; border-radius: .25rem; background: transparent; color: var(--ink); text-align: left; text-decoration: none; font: inherit; font-weight: 400; cursor: pointer; }
.profile-popover a:hover, .profile-popover button:hover { background: #fff0f6; color: var(--accent); }
.profile-popover a[aria-current="page"], .profile-popover a[aria-current="page"]:visited { color: var(--accent); }
.profile-popover form { margin: 0; }
main { padding-top: 2rem !important; padding-bottom: 4rem !important; min-height: 70vh; }
h1 { font-size: clamp(1.7rem, 3vw, 2.3rem); line-height: 1.2; margin: 0 0 1.4rem; color: var(--brand-dark); }
h2 { font-size: 1.25rem; margin: 2rem 0 .7rem; }
p { max-width: 70ch; }
a { color: var(--brand-dark); }
a:hover { text-decoration-thickness: 2px; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: .5rem; padding: 1.25rem; margin: 1rem 0; box-shadow: 0 2px 8px #243a6910; }
.narrow { max-width: 34rem; }
form { margin: 0; }
label { display: block; font-weight: 650; margin: .85rem 0 .3rem; }
input, select { font: inherit; max-width: 100%; padding: .55rem .65rem; border: 1px solid #8291b1; border-radius: .3rem; background: #fff; color: var(--ink); }
input:not([type=checkbox]):not([type=hidden]), select { width: 100%; }
input:focus, select:focus, button:focus, a:focus { outline: 3px solid #e0a63d; outline-offset: 2px; }
button, .button { display: inline-block; border: 1px solid var(--accent); border-radius: .3rem; background: var(--accent); color: #fff; padding: .55rem .9rem; font: inherit; font-weight: 650; cursor: pointer; text-decoration: none; white-space: nowrap; }
button:hover, .button:hover { background: var(--accent-dark); border-color: var(--accent-dark); color: #fff; }
.secondary { background: #fff; border-color: var(--brand); color: var(--brand-dark); }
.secondary:hover { background: #e9eef9; border-color: var(--brand-dark); color: var(--brand-dark); }
.danger { background: var(--danger); border-color: var(--danger); }
.danger:hover { background: #81172f; border-color: #81172f; }
.row { display: flex; gap: .7rem; align-items: flex-start; flex-wrap: wrap; }
.row > * { flex: 1; min-width: 10rem; }
.row input[type=text], .row select, .row button { height: 2.75rem; }
.row button { flex: 0 0 auto; margin-top: calc(1.15rem + 1.55em); }
.notice { padding: .8rem 1rem; border-left: 4px solid var(--brand); background: #eaf0fc; margin: 1rem 0; }
.error { padding: .8rem 1rem; border-left: 4px solid var(--danger); background: #fae9ed; }
.muted { color: var(--muted); }
.warning { background: #fff4d8; border-left: 4px solid #a45d00; padding: .7rem 1rem; }
.table-wrap { overflow-x: auto; background: #fff; border: 1px solid var(--line); border-radius: .4rem; margin: 1rem 0; }
table { border-collapse: collapse; width: max-content; min-width: 100%; font-size: .94rem; }
th, td { border-bottom: 1px solid #dce3ef; text-align: left; padding: .6rem .7rem; vertical-align: top; white-space: nowrap; max-width: none; overflow-wrap: normal; }
th { background: #e8edfa; }
tr:nth-child(even) td { background: #f7f9fd; }
.browse-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.browse-search { display: flex; align-items: center; width: min(100%, 18rem); min-height: 2.65rem; margin-left: auto; border: 1px solid #8291b1; border-radius: .3rem; background: #fff; }
.browse-search:focus-within { outline: 3px solid #e0a63d; outline-offset: 2px; }
.browse-search button { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 2.6rem; align-self: stretch; padding: 0; border: 0; border-radius: .3rem 0 0 .3rem; background: transparent; color: var(--muted); }
.browse-search button:hover { background: #e9eef9; color: var(--accent); }
.browse-search button:focus, .browse-search input:focus { outline: none; }
.browse-search svg { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.browse-search input[type=search] { flex: 1 1 auto; min-width: 0; width: 100%; padding: .45rem .6rem .45rem 0; border: 0; background: transparent; }
.browse-search input::placeholder { color: #8490a4; opacity: 1; }
.browse-reset { flex: 0 0 auto; }
.browse-reset button { min-height: 2.65rem; padding: .45rem .75rem; }
.browse-table th { padding: 0; }
.browse-table .sort-header { display: inline-flex; align-items: center; gap: .4rem; width: 100%; min-height: 2.8rem; padding: .6rem .7rem; border: 0; border-radius: 0; background: transparent; color: var(--ink); text-align: left; font: inherit; font-weight: 650; }
.browse-table .sort-header:hover { background: #f8e5ef; color: var(--accent); }
.browse-table .sort-header:focus-visible { outline-offset: -3px; }
.browse-table th[aria-sort=ascending] .sort-header, .browse-table th[aria-sort=descending] .sort-header { color: var(--accent); }
.sort-arrow { color: var(--accent); font-size: 1.1em; line-height: 1; }
code, pre { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
pre { white-space: pre-wrap; overflow-wrap: anywhere; }
.check-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: .4rem; }
.check-grid label { font-weight: 400; margin: 0; padding: .4rem; border: 1px solid var(--line); border-radius: .25rem; background: #fff; display: flex; align-items: flex-start; gap: .5rem; }
.check-grid input { margin-top: .3rem; }
.actions { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; margin: 1rem 0; }
.object-list { list-style: none; margin: 0; padding: 0; }
.object-item { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .85rem 0; border-bottom: 1px solid var(--line); }
.object-item:last-child { border-bottom: 0; }
.object-name { display: flex; align-items: center; gap: .6rem; min-width: 0; overflow-wrap: anywhere; }
.object-actions { display: flex; align-items: center; gap: .5rem; flex: 0 0 auto; }
.object-actions form { display: inline-flex; }
.object-actions button, .object-actions .button { padding: .4rem .7rem; }
.pill { display: inline-block; border-radius: 99px; padding: .1rem .55rem; font-size: .8rem; background: #e4eafb; color: var(--brand-dark); white-space: nowrap; }
.pill.warn { background: #ffe5ab; color: #503100; }
.catalog-table td { vertical-align: middle; }
.catalog-table input[type=checkbox] { width: 1.25rem; height: 1.25rem; cursor: pointer; }
.catalog-table input[type=text] { min-width: 15rem; }
.catalog-table .drag-handle { display: inline-flex; align-items: center; justify-content: center; vertical-align: middle; padding: .3rem; margin-right: .35rem; background: transparent; border: 0; color: var(--brand-dark); cursor: grab; user-select: none; }
.catalog-table .drag-handle:hover { background: #e9eef9; color: var(--brand-dark); }
.catalog-table .drag-handle:active { cursor: grabbing; }
.drag-handle svg { display: block; pointer-events: none; }
.catalog-table tr.dragging td { background: #e4eafb; }
.skip { position: absolute; left: -10000px; }
.skip:focus { left: 1rem; top: 1rem; background: #fff; padding: .5rem; z-index: 100; }
footer { border-top: 1px solid var(--line); color: var(--muted); padding-top: 1rem !important; padding-bottom: 2rem !important; font-size: .9rem; }

@media (max-width: 750px) {
  header .wrap { padding-top: .8rem; padding-bottom: .8rem; }
  .header-controls { width: 100%; justify-content: space-between; flex-wrap: wrap; }
  .object-item { align-items: flex-start; flex-direction: column; }
  .object-actions { flex-wrap: wrap; }
}
@media (max-width: 650px) {
  .row > * { width: 100%; }
  .row button { margin-top: 0; }
  .table-wrap { max-width: calc(100vw - 2rem); }
  .browse-search { width: 100%; }
  .browse-reset { margin-left: auto; }
}
