:root {
  --bg: #f3f1eb;
  --surface: #fffefa;
  --ink: #232b29;
  --muted: #626a65;
  --line: #d9d9d0;
  --red: #b6342e;
  --red-hover: #962923;
  --sidebar: #19201e;
  --font: 'Manrope', sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 16px/1.65 var(--font); }
body:has(dialog[open]) { overflow: hidden; }
button, input, textarea, select { font: inherit; }
button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button:disabled, input:disabled, select:disabled, textarea:disabled { cursor: not-allowed; }
button:disabled { opacity: .55; }
a { color: inherit; text-decoration: none; }
button { color: inherit; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { line-height: 1.15; font-weight: 600; letter-spacing: -.045em; }
img { display: block; max-width: 100%; }
fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
input, select, textarea { width: 100%; min-width: 0; background: var(--surface); color: var(--ink); border: 1px solid #b9c0b9; border-radius: 3px; padding: 12px 14px; min-height: 48px; line-height: 1.5; font-size: 16px; }
input::placeholder, textarea::placeholder { color: #737a75; opacity: 1; }
textarea { min-height: 112px; resize: vertical; }
input[readonly] { color: var(--muted); background: #ebece5; }
input[aria-invalid='true'], select[aria-invalid='true'], textarea[aria-invalid='true'] { border-color: var(--red); box-shadow: 0 0 0 1px var(--red); }
:focus-visible { outline: 3px solid #577769; outline-offset: 4px; }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline-offset: 1px; }
button, a { touch-action: manipulation; }
.skip-link { position: fixed; z-index: 30; top: 12px; left: 12px; padding: 10px 16px; color: #fff; background: var(--ink); transform: translateY(-160%); }
.skip-link:focus { transform: none; }
.eyebrow { color: var(--muted); font-size: 14px; line-height: 1.6; font-weight: 600; letter-spacing: .035em; }
.button { display: inline-flex; justify-content: center; align-items: center; gap: 8px; min-height: 46px; border: 1px solid transparent; border-radius: 3px; padding: 10px 19px; font-size: 14px; font-weight: 600; line-height: 1.5; white-space: nowrap; background: transparent; transition: background .16s, border-color .16s; }
.button-primary, .button-danger { background: var(--red); border-color: var(--red); color: #fff; }
.button-primary:hover:not(:disabled), .button-danger:hover:not(:disabled) { background: var(--red-hover); border-color: var(--red-hover); }
.button-quiet { border-color: var(--line); background: transparent; }
.button-quiet:hover:not(:disabled) { background: #e4e7df; border-color: #a9b1a9; }
.button-small { min-height: 42px; padding: 8px 15px; border-color: var(--line); }
.button-small:hover:not(:disabled) { background: #e9ece5; }
.button-danger-quiet { color: var(--red); border-color: transparent; }
.button-danger-quiet:hover:not(:disabled) { color: #902721; background: #f5e4de; }
.text-link { display: inline-block; font-size: 14px; font-weight: 600; border-bottom: 1px solid #a4ada5; padding-bottom: 3px; }
.text-link:hover { color: var(--red); border-color: var(--red); }
.brand-logo { display: inline-flex; width: fit-content; flex-direction: column; color: #f1f0ea; line-height: .92; }
.brand-logo > span { font-family: 'Barlow Condensed', sans-serif; font-weight: 700; font-size: 43px; letter-spacing: .03em; }
.brand-logo > small { font-size: 12px; letter-spacing: .28em; line-height: 1.5; margin-top: 7px; }
.login-view { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); min-height: 100svh; }
.login-brand { display: flex; flex-direction: column; padding: 56px max(48px, 8vw); color: #f1f0ea; background: var(--sidebar); border-top: 5px solid var(--red); }
.login-brand-copy { margin: auto 0; padding-block: 75px; }
.login-brand-copy .eyebrow { color: #b5c0b7; margin-bottom: 27px; }
.login-brand h1 { font-size: clamp(47px, 5.2vw, 78px); line-height: 1.06; font-weight: 500; letter-spacing: -.055em; }
.login-brand-copy > p:last-child { max-width: 390px; color: #b5c0b7; margin-top: 30px; }
.brand-footnote { color: #a6b2a9; font-size: 12px; }
.login-panel { padding: 60px max(42px, 7vw); display: flex; flex-direction: column; justify-content: center; }
.login-panel form { width: 100%; max-width: 420px; margin: auto; }
.login-panel h2 { font-size: 38px; margin-top: 18px; }
.form-intro { margin-top: 16px; margin-bottom: 34px; color: var(--muted); }
.login-panel .field + .field { margin-top: 23px; }
.login-submit { width: 100%; margin-top: 28px; }
.login-panel .text-link { margin-top: 28px; }
.password-field { position: relative; }
.password-field input { padding-right: 82px; }
.password-toggle { position: absolute; top: 1px; right: 1px; height: calc(100% - 2px); border: 0; background: none; padding: 0 13px; font-size: 14px; font-weight: 600; }
.form-message { padding: 14px 16px; margin-top: 20px; border: 1px solid var(--line); border-left: 3px solid #607566; background: #e9eee6; font-size: 14px; line-height: 1.7; overflow-wrap: anywhere; }
.form-message[data-tone='error'] { color: #842b25; background: #f7e8e2; border-color: #dcb9ac; border-left-color: var(--red); }
.form-message[data-tone='success'] { color: #244933; background: #e5eee3; border-color: #b1c8ad; }
.admin-shell { min-height: 100svh; }
.sidebar { position: fixed; z-index: 20; width: 244px; inset: 0 auto 0 0; display: flex; flex-direction: column; background: var(--sidebar); color: #e9eee6; padding: 35px 24px 26px; }
.sidebar-brand { margin-left: 10px; }
.sidebar-label { margin: 57px 12px 16px; font-size: 12px; color: #a9b7ad; letter-spacing: .04em; }
.nav-list { display: flex; flex-direction: column; gap: 7px; }
.nav-item { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 53px; width: 100%; border: 0; border-left: 3px solid transparent; background: transparent; padding: 12px 14px 12px 12px; color: #c5cfc7; font-size: 15px; text-align: left; }
.nav-item:hover { color: #fff; background: #25332c; }
.nav-item[aria-current='page'] { background: #303b35; color: #fff; border-left-color: #df6b60; font-weight: 600; }
.nav-count { color: #bdc9bf; font-size: 12px; font-variant-numeric: tabular-nums; }
.sidebar-footer { margin-top: auto; padding: 28px 11px 0; }
.site-link { display: block; font-size: 14px; padding-bottom: 12px; border-bottom: 1px solid #405047; }
.site-link:hover { color: #fff; }
.sidebar-footer p { margin-top: 15px; font-size: 12px; color: #9dad9f; }
.workspace { margin-left: 244px; min-width: 0; }
.topbar { position: sticky; top: 0; z-index: 10; min-height: 83px; padding: 20px 44px; display: flex; align-items: center; justify-content: space-between; gap: 20px; border-bottom: 1px solid var(--line); background: var(--bg); }
.topbar-context { color: var(--muted); font-size: 14px; }
.user-menu { display: flex; align-items: center; gap: 21px; min-width: 0; margin-left: auto; }
#session-username { font-size: 14px; max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.workspace-main { max-width: 1500px; margin: auto; padding: 42px 44px 65px; }
.page-heading { display: flex; justify-content: space-between; align-items: end; gap: 35px; margin-bottom: 34px; }
.page-heading h1 { margin-top: 12px; font-size: clamp(35px, 3.7vw, 52px); font-weight: 500; }
.page-heading p:last-child { color: var(--muted); margin-top: 14px; max-width: 660px; }
.summary-strip { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); border-top: 1px solid #aeb6ac; border-bottom: 1px solid var(--line); margin-bottom: 33px; }
.summary-item { padding: 17px 27px; display: flex; justify-content: space-between; align-items: baseline; gap: 12px; border-right: 1px solid var(--line); }
.summary-item:first-child { padding-left: 0; }
.summary-item:last-child { border-right: 0; padding-right: 0; }
.summary-item > span { font-size: 14px; color: var(--muted); }
.summary-item > strong { font-size: 27px; font-weight: 500; letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.content-toolbar { display: flex; align-items: end; gap: 20px; margin-bottom: 29px; }
.search-field { flex: 1; min-width: 180px; max-width: 580px; }
.filter-field { width: 220px; }
.content-toolbar label { display: block; font-size: 14px; margin-bottom: 9px; font-weight: 600; }
.result-count { margin: 0 0 13px auto; font-size: 12px; color: var(--muted); white-space: nowrap; }
#global-message { margin: 0 0 24px; }
.record-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 25px; }
.record-card { min-width: 0; display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: 3px; overflow: hidden; }
.record-media { position: relative; width: 100%; aspect-ratio: 1.45; overflow: hidden; background: #e2e5dc; border-bottom: 1px solid var(--line); }
.record-media img { width: 100%; height: 100%; object-fit: cover; }
.reference-card .record-media { background: #fff; }
.reference-card .record-media img { object-fit: contain; padding: 31px; }
.record-body { padding: 22px 23px; flex: 1; }
.record-kicker { color: var(--red); font-size: 12px; margin-bottom: 11px; font-weight: 600; }
.record-body h2 { font-size: 21px; line-height: 1.35; font-weight: 500; letter-spacing: -.025em; overflow-wrap: anywhere; }
.record-description { color: var(--muted); margin-top: 13px; font-size: 16px; line-height: 1.65; overflow-wrap: anywhere; }
.record-tags { display: flex; flex-wrap: wrap; gap: 5px 13px; margin-top: 18px; }
.record-tags > span { font-size: 12px; color: #5e6b60; border-bottom: 1px solid #d0d8ca; }
.record-actions { display: flex; flex-wrap: wrap; gap: 8px; border-top: 1px solid var(--line); padding: 14px 23px; }
.record-actions > button:last-child { margin-left: auto; }
.media-placeholder { width: 100%; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 9px; padding: 25px; color: #69776b; font-size: 14px; text-align: center; }
.media-placeholder strong { font-size: 26px; font-weight: 500; letter-spacing: -.035em; }
.empty-state, .loading-state { border: 1px solid var(--line); background: var(--surface); text-align: center; padding: 65px 30px; }
.empty-state h2 { font-size: 27px; font-weight: 500; }
.empty-state p { margin: 17px auto 0; max-width: 520px; color: var(--muted); }
.empty-state .button { margin-top: 25px; }
.loading-state { color: var(--muted); }
.icon-button { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; min-width: 44px; min-height: 44px; padding: 8px; border: 1px solid var(--line); border-radius: 3px; background: transparent; }
.icon-button:hover { background: #e9ece4; }
.close-button { font-size: 29px; font-weight: 400; line-height: 1; }
.menu-toggle { display: none; flex-direction: column; gap: 4px; }
.menu-toggle span { width: 18px; height: 2px; background: currentColor; }
.sidebar-backdrop { display: none; }
dialog { color: var(--ink); background: var(--bg); border: 1px solid #b8c0b6; border-radius: 5px; box-shadow: 0 20px 80px #101a164d; padding: 0; width: min(820px, calc(100vw - 42px)); max-height: calc(100svh - 40px); overflow: auto; }
dialog::backdrop { background: #102019ad; }
.dialog-header { display: flex; justify-content: space-between; gap: 25px; align-items: start; padding: 27px 31px; border-bottom: 1px solid var(--line); }
.dialog-header h2 { margin-top: 10px; font-size: 29px; font-weight: 500; }
.dialog-header p:not(.eyebrow) { font-size: 14px; color: var(--muted); margin-top: 13px; }
.dialog-body { padding: 28px 31px; }
.dialog-footer { position: sticky; bottom: 0; z-index: 2; background: var(--bg); border-top: 1px solid var(--line); padding: 20px 31px; display: flex; align-items: center; justify-content: space-between; gap: 22px; }
.dialog-actions { display: flex; gap: 12px; margin-left: auto; }
.save-note { font-size: 12px; max-width: 260px; color: var(--muted); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 23px; }
.field, .upload-field { min-width: 0; }
.field-full { grid-column: 1 / -1; }
.field-label { display: block; margin-bottom: 9px; font-size: 14px; font-weight: 600; }
.required-mark { color: var(--red); margin-left: 3px; }
.field-help { margin-top: 9px; font-size: 12px; color: var(--muted); line-height: 1.7; }
.field-error { margin-top: 9px; font-size: 14px; color: #922d26; line-height: 1.6; }
.checkbox-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px 16px; }
.checkbox-option { min-height: 42px; display: flex; align-items: center; gap: 10px; font-size: 14px; }
.checkbox-option input { width: 18px; height: 18px; min-height: 18px; margin: 0; flex: 0 0 auto; accent-color: var(--red); }
.upload-field { padding: 20px; border: 1px solid var(--line); background: #eceee7; border-radius: 3px; }
.upload-preview { display: flex; align-items: center; justify-content: center; height: 150px; margin: 13px 0 16px; background: #fff; border: 1px solid var(--line); overflow: hidden; }
.upload-preview img { width: 100%; height: 100%; object-fit: contain; }
.upload-preview video { width: 100%; height: 100%; object-fit: contain; background: #19201e; }
.file-placeholder { color: var(--muted); font-size: 14px; padding: 20px; text-align: center; }
.file-input { padding: 8px; background: var(--surface); font-size: 14px; max-width: 100%; }
.file-input::file-selector-button { padding: 7px 10px; border: 1px solid #bdc8b9; border-radius: 2px; background: #e5e9df; color: var(--ink); font: 600 14px/1.5 var(--font); margin-right: 10px; cursor: pointer; }
.upload-status { font-size: 14px; color: var(--muted); margin-top: 13px; overflow-wrap: anywhere; }
.upload-status[data-tone='error'] { color: #922d26; }
.upload-status[data-tone='success'] { color: #36583c; }
.upload-actions { display: flex; gap: 9px 14px; flex-wrap: wrap; margin-top: 10px; }
.upload-actions button { border: 0; border-bottom: 1px solid #a8b4a3; padding: 3px 0; font-size: 14px; color: #384a3d; background: none; }
.confirm-dialog { width: min(500px, calc(100vw - 36px)); }
.confirm-dialog .dialog-header h2 { margin: 0; font-size: 27px; }
.confirm-dialog .dialog-body p { white-space: pre-line; overflow-wrap: anywhere; }
.confirm-dialog .dialog-footer { justify-content: end; }
.status-toast { position: fixed; bottom: 24px; right: 24px; z-index: 40; max-width: min(440px, calc(100vw - 48px)); padding: 15px 21px; border-left: 4px solid #b2cca7; background: #223c2a; color: #fff; font-size: 14px; box-shadow: 0 5px 25px #0c180f26; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }
@media (max-width: 1250px) {
  .sidebar { width: 220px; padding-inline: 18px; }
  .workspace { margin-left: 220px; }
  .workspace-main { padding: 35px 30px 55px; }
  .topbar { padding-inline: 30px; }
  .record-grid { grid-template-columns: repeat(2, minmax(0,1fr)); gap: 23px; }
  .content-toolbar { flex-wrap: wrap; gap: 16px; }
  .result-count { width: 100%; margin: 0; }
  .filter-field { width: 195px; }
  .page-heading { align-items: start; }
  .page-heading > .button { margin-top: 10px; }
  .login-brand { padding-inline: 44px; }
  .login-panel { padding-inline: 44px; }
}
@media (max-width: 850px) {
  .login-view { grid-template-columns: .85fr 1.15fr; }
  .login-brand { padding: 35px 27px; }
  .login-panel { padding: 45px 30px; }
  .login-brand h1 { font-size: 43px; }
  .login-brand-copy { padding-block: 50px; }
  .login-brand-copy p:last-child { font-size: 16px; }
  .sidebar { width: 196px; padding-inline: 13px; }
  .workspace { margin-left: 196px; }
  .workspace-main { padding-inline: 24px; }
  .topbar { padding-inline: 24px; }
  .topbar-context { display: none; }
  .page-heading { display: block; }
  .page-heading > .button { margin-top: 23px; }
  .summary-item { padding-inline: 14px; }
  .summary-item > strong { font-size: 24px; }
  .record-grid { grid-template-columns: 1fr; }
  .record-media { aspect-ratio: 1.75; }
  .filter-field { width: 180px; }
}
@media (max-width: 680px) {
  .login-view { display: block; }
  .login-brand { padding: 25px 25px 27px; border-top-width: 4px; }
  .login-brand-copy { padding: 29px 0 0; }
  .login-brand-copy .eyebrow { margin-bottom: 14px; font-size: 12px; }
  .login-brand h1 { font-size: 37px; }
  .login-brand h1 br { display: none; }
  .login-brand-copy > p:last-child, .brand-footnote { display: none; }
  .login-panel { padding: 35px 25px 45px; }
  .login-panel h2 { font-size: 32px; }
  .sidebar { z-index: 30; width: min(285px, calc(100vw - 65px)); padding: 28px 20px; transform: translateX(-100%); visibility: hidden; transition: transform .2s, visibility .2s; }
  body.menu-open .sidebar { transform: none; visibility: visible; }
  body.menu-open { overflow: hidden; }
  .sidebar-backdrop { position: fixed; z-index: 25; inset: 0; display: block; width: 100%; height: 100%; border: 0; background: #14251dc2; }
  .workspace { margin-left: 0; }
  .topbar { padding: 12px 20px; min-height: 73px; gap: 12px; }
  .menu-toggle { display: inline-flex; }
  .user-menu { gap: 13px; }
  #session-username { max-width: 135px; font-size: 12px; }
  .topbar .button { padding-inline: 12px; }
  .workspace-main { padding: 29px 20px 48px; }
  .page-heading h1 { font-size: 37px; }
  .page-heading > .button { width: 100%; }
  .summary-item { display: block; padding-block: 16px; }
  .summary-item > span { font-size: 14px; }
  .summary-item > strong { display: block; margin-top: 3px; }
  .content-toolbar { gap: 17px 14px; }
  .search-field { min-width: 100%; }
  .filter-field { width: auto; flex: 1; }
  .result-count { width: auto; margin: 0 0 15px; }
  .record-grid { gap: 20px; }
  .record-body { padding: 22px; }
  .record-actions { padding-inline: 22px; }
  .empty-state { padding: 46px 22px; }
  .empty-state h2 { font-size: 25px; }
  dialog { width: calc(100vw - 24px); max-height: calc(100svh - 24px); }
  .dialog-header { padding: 23px 20px; gap: 18px; }
  .dialog-header h2 { font-size: 26px; }
  .dialog-body { padding: 23px 20px; }
  .dialog-footer { padding: 17px 20px; flex-wrap: wrap; gap: 15px; }
  .save-note { max-width: none; }
  .dialog-actions { width: 100%; flex-wrap: wrap; }
  .dialog-actions .button { flex: 1; }
  .form-grid { grid-template-columns: 1fr; gap: 22px; }
  .field-full { grid-column: 1; }
  .checkbox-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px 12px; }
  .upload-field { padding: 17px; }
  .confirm-dialog .dialog-footer { display: grid; grid-template-columns: minmax(0, 1fr); }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; } }
