/* I058: PF prototype visual language; shared production primitives, version 1. */
:root {
  --pf-red-logo: #ff0000; --pf-red: #c8102e; --pf-red-hover: #a90d26;
  --pf-red-soft: #fff1f3; --ink: #171819; --ink-2: #292b2d;
  --muted: #676b6f; --app: #f6f5f3; --sidebar: #fbfaf9;
  --surface: #fff; --surface-2: #f1f0ed; --border: #dedbd7; --border-strong: #aaa8a4;
  --success: #146c43; --success-bg: #eaf7f0; --warning: #805500; --warning-bg: #fff6de;
  --danger: #9d172a; --danger-bg: #fdebed; --info: #2455a4; --info-bg: #edf3ff;
  --sans: "Open Sans", Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --serif: "Roboto Slab", Rockwell, Georgia, ui-serif, serif;
}
* { box-sizing: border-box; }
html, body { min-height: 100%; }
body { margin: 0; color: var(--ink-2); background: var(--app); font: 14px/1.5 var(--sans); -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 8px; color: var(--ink); font: 700 30px/1.2 var(--serif); letter-spacing: -.5px; overflow-wrap: anywhere; }
h2 { margin-bottom: 8px; color: var(--ink); font-size: 19px; line-height: 1.3; }
h3 { margin-bottom: 6px; font-size: 15px; }
p { margin-bottom: 14px; color: var(--muted); }
a { color: var(--pf-red); text-underline-offset: 3px; }
a:hover { color: var(--pf-red-hover); }
small { display: block; color: var(--muted); font-size: 12px; }
hr { margin: 20px 0; border: 0; border-top: 1px solid var(--border); }
:focus-visible { outline: 3px solid var(--pf-red); outline-offset: 3px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip-link { position: fixed; left: 12px; top: -80px; z-index: 100; padding: 12px 20px; background: white; border: 2px solid var(--pf-red); border-radius: 8px; }
.skip-link:focus { top: 12px; }
.eyebrow { display: block; margin: 0 0 6px; color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.lead { font-size: 17px; line-height: 1.6; }
.muted { color: var(--muted); }
.wordmark { min-height: 78px; padding: 20px 24px; display: inline-flex; align-items: center; color: var(--ink); font-size: 23px; font-weight: 900; font-style: italic; letter-spacing: -1px; text-decoration: none; white-space: nowrap; }
.wordmark i { color: var(--ink); margin-right: 2px; }
.wordmark span { color: var(--pf-red-logo); font-size: 21px; font-style: normal; letter-spacing: -.8px; }
.app-shell { min-height: 100vh; display: flex; }
.sidebar { width: 228px; position: fixed; inset: 0 auto 0 0; z-index: 20; border-right: 1px solid var(--border); display: flex; flex-direction: column; background: var(--sidebar); overflow-y: auto; }
.sidebar-nav { padding: 12px 13px; }
.nav-item { min-height: 45px; margin-bottom: 4px; padding: 10px 12px; position: relative; border-radius: 8px; display: flex; align-items: center; gap: 12px; color: #3f4245; font-weight: 650; text-decoration: none; }
.nav-item:hover { background: var(--surface-2); color: var(--ink); }
.nav-item.active { color: var(--pf-red); background: var(--pf-red-soft); }
.nav-item.active::before { width: 3px; position: absolute; inset: 8px auto 8px -13px; border-radius: 0 3px 3px 0; content: ""; background: var(--pf-red); }
.nav-glyph { flex: 0 0 23px; width: 23px; font-size: 23px; font-weight: 400; text-align: center; line-height: 1; }
.sidebar-context { margin-top: auto; padding: 22px; border-top: 1px solid var(--border); }
.sidebar-context p { font-size: 12px; margin: 0; }
.sidebar-footer { padding: 14px 16px; border-top: 1px solid var(--border); display: flex; align-items: center; gap: 9px; background: white; }
.sidebar-footer > div { min-width: 0; overflow-wrap: anywhere; }
.sidebar-footer strong { font-size: 12px; }
.avatar { width: 36px; height: 36px; flex: 0 0 auto; display: inline-grid; place-items: center; border: 1px solid var(--border); border-radius: 50%; background: var(--surface-2); font-size: 12px; font-weight: 800; }
.app-column { min-width: 0; min-height: 100vh; margin-left: 228px; flex: 1; }
.topbar { min-height: 66px; padding: 12px 28px; border-bottom: 1px solid var(--border); display: flex; gap: 16px; justify-content: space-between; align-items: center; background: white; }
.workspace-label { font-weight: 600; }
.workspace-label .muted { margin-left: 12px; font-weight: 400; }
.logout-form { margin: 0; }
.mobile-menu { display: none !important; }
.page-content { max-width: 1920px; padding: 26px 28px 48px; margin: 0 auto; }
.page-content:focus { outline: none; }
.page-head { margin-bottom: 24px; display: flex; gap: 20px; align-items: flex-start; justify-content: space-between; }
.page-head p:last-child { margin-bottom: 0; max-width: 78ch; }
.page-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.form-link-control { padding: 0; border: 0; color: var(--pf-red); background: transparent; font: inherit; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.form-link-control:hover { color: var(--pf-red-hover); }
.form-link-control:focus-visible { outline: 2px solid var(--pf-red); outline-offset: 3px; border-radius: 2px; }
.button { min-height: 42px; padding: 9px 16px; border: 1px solid transparent; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; gap: 9px; font-weight: 700; line-height: 1.4; text-decoration: none; text-align: center; }
.button-primary { color: white; background: var(--pf-red); border-color: var(--pf-red); }
.button-primary:hover { color: white; background: var(--pf-red-hover); }
.button-secondary { color: var(--ink-2); background: white; border-color: var(--border-strong); }
.button-secondary:hover { color: var(--ink); background: var(--surface-2); }
.button-danger { color: var(--danger); border-color: var(--danger); background: var(--danger-bg); }
.button.compact { min-height: 36px; padding: 6px 11px; font-size: 12px; }
.button:disabled, .button[aria-disabled="true"] { cursor: wait; opacity: .7; }
.button[data-unavailable]:disabled { cursor: not-allowed; opacity: .55; }
.card { min-width: 0; padding: 20px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
.card + .card { margin-top: 16px; }
.card-head, .section-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; margin-bottom: 16px; }
.card-head h2, .section-head h2 { margin: 0; }
.breadcrumbs { margin-bottom: 18px; font-size: 12px; }
.breadcrumbs ol { padding: 0; margin: 0; list-style: none; display: flex; flex-wrap: wrap; gap: 8px; }
.breadcrumbs li + li::before { content: "/"; margin-right: 8px; color: var(--muted); }
.breadcrumbs a { color: var(--muted); }
.detail-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(250px, 1fr); gap: 16px; align-items: start; }
.detail-grid .card + .card { margin-top: 0; }
.definition-list { display: grid; grid-template-columns: minmax(120px, 1fr) minmax(0, 2fr); gap: 0 18px; margin: 0; }
.definition-list dt, .definition-list dd { margin: 0; padding: 10px 0; border-bottom: 1px solid var(--surface-2); overflow-wrap: anywhere; }
.definition-list dt { color: var(--muted); font-size: 12px; }
.definition-list dd { font-weight: 600; }
.preserve-lines { white-space: pre-wrap; overflow-wrap: anywhere; }
.text-content { max-width: 82ch; overflow-wrap: anywhere; }
.text-content p, .text-content ul, .text-content ol { color: inherit; }
.table-wrap { max-width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; }
caption { padding: 0 0 14px; text-align: left; font-weight: 700; font-size: 18px; }
th { padding: 9px 10px; background: var(--surface-2); color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .03em; }
td { padding: 13px 10px; border-bottom: 1px solid var(--border); vertical-align: top; overflow-wrap: anywhere; }
tbody tr:last-child td { border-bottom: 0; }
td a { color: var(--ink-2); font-weight: 650; }
td a:hover { color: var(--pf-red); }
.record-number { display: block; color: var(--muted); font-size: 11px; font-weight: 500; }
.chip { min-height: 25px; padding: 3px 9px; border: 1px solid var(--border); border-radius: 999px; display: inline-flex; align-items: center; font-size: 11px; font-weight: 700; line-height: 1.4; }
.chip-neutral { color: #53575a; background: #eff0f1; }
.chip-success { color: var(--success); background: var(--success-bg); border-color: #c7e6d4; }
.chip-warning { color: var(--warning); background: var(--warning-bg); border-color: #e0c887; }
.chip-danger { color: var(--danger); background: var(--danger-bg); border-color: #f2c4cc; }
.chip-info { color: var(--info); background: var(--info-bg); border-color: #cad9fa; }
.filters, .filter-bar { display: flex; flex-wrap: wrap; align-items: end; gap: 12px; margin-bottom: 18px; }
.filters label { display: block; margin-bottom: 5px; color: var(--muted); font-size: 12px; }
.form-card { max-width: 1100px; }
.prompt-template + .prompt-template { margin-top: 20px; }
.prompt-template-state { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; margin: 6px 0 0; color: var(--muted); font-size: 13px; }
.prompt-template-state .button[hidden] { display: none; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px 24px; }
.field { min-width: 0; }
.field:has(textarea), .field.full-width { grid-column: 1 / -1; }
.field > label, .field-label > label { margin-bottom: 6px; display: block; font-weight: 650; font-size: 13px; }
input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]), select, textarea { width: 100%; min-width: 0; min-height: 42px; padding: 9px 11px; border: 1px solid var(--border-strong); border-radius: 7px; background: white; }
textarea { min-height: 120px; resize: vertical; }
input[type="checkbox"], input[type="radio"] { width: 19px; height: 19px; accent-color: var(--pf-red); }
.field-checkbox { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px 12px; align-items: center; }
.field-checkbox > label, .field-checkbox > .field-label { order: 1; margin: 0; }
.field small { margin-top: 5px; }
.field-error input, .field-error select, .field-error textarea { border-color: var(--danger) !important; }
.field-errors { margin: 6px 0 0; padding-left: 18px; color: var(--danger); font-size: 12px; }
.required-mark { color: var(--danger); }
fieldset { min-width: 0; padding: 0; margin: 0 0 26px; border: 0; }
legend { padding: 0; margin-bottom: 15px; color: var(--ink); font-size: 18px; font-weight: 700; }
.form-actions { margin-top: 28px; padding-top: 20px; border-top: 1px solid var(--border); display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.notice { padding: 14px 16px; margin-bottom: 18px; border: 1px solid var(--border); border-radius: 8px; }
.notice h2 { font: 700 15px/1.4 var(--sans); color: inherit; }
.notice p:last-child, .notice ul:last-child { margin-bottom: 0; }
.notice-error { color: var(--danger); background: var(--danger-bg); border-color: #d99fa3; }
.notice-success { color: var(--success); background: var(--success-bg); border-color: #a7d0b9; }
.notice-warning { color: var(--warning); background: var(--warning-bg); border-color: #dfc879; }
.notice-info { color: var(--info); background: var(--info-bg); border-color: #b1c3e2; }
.notice a { color: inherit; }
.empty-state { padding: 36px 16px; text-align: center; }
.empty-state p { max-width: 55ch; margin: 0 auto 18px; }
.empty-glyph { display: block; margin-bottom: 12px; color: var(--pf-red); font-size: 36px; }
.pagination { display: flex; justify-content: flex-end; gap: 10px; padding-top: 18px; }
.entry-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.entry-card { display: flex; align-items: center; gap: 14px; padding: 22px; border: 1px solid var(--border); border-radius: 10px; color: var(--ink-2); text-decoration: none; }
.entry-card strong { flex: 1; }
.entry-card:hover { background: var(--pf-red-soft); border-color: var(--pf-red); color: var(--pf-red); }
.public-header { min-height: 78px; padding-right: 30px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; background: white; }
.public-header > span { color: var(--muted); font-size: 12px; }
.public-content { max-width: 1500px; }
.login-layout { min-height: calc(100vh - 158px); display: grid; grid-template-columns: 1fr 1fr; align-items: stretch; }
.login-copy { max-width: 610px; align-self: center; padding: 55px 45px 70px 20px; }
.login-copy h1 { margin: 22px 0; font-size: clamp(32px, 3.2vw, 49px); }
.button-login { width: 100%; min-height: 56px; margin-top: 18px; font-size: 16px; justify-content: space-between; }
.login-note { margin-top: 16px; font-size: 13px; }
.login-brand { min-height: 600px; position: relative; overflow: hidden; border-radius: 12px; background: #eeece8; }
.brand-lines { position: absolute; inset: 0; opacity: .45; }
.brand-lines i { width: 2px; height: 110%; position: absolute; top: -42%; background: #95938f; transform: rotate(26deg); }
.brand-lines i:nth-child(1) { left: 45%; }
.brand-lines i:nth-child(2) { left: 63%; }
.brand-lines i:nth-child(3) { left: 75%; background: var(--pf-red); }
.brand-promise { padding: 40px; position: absolute; bottom: 0; }
.brand-promise h2 { font-family: var(--serif); font-size: 27px; }
.brand-promise ul { list-style: none; margin: 20px 0 0; padding: 0; }
.brand-promise li { padding: 14px 0; border-top: 1px solid #cecac4; }
.brand-promise strong, .brand-promise span { display: block; }
.brand-promise span { color: var(--muted); font-size: 13px; }
.error-card { max-width: 750px; }
.error-code { margin: 0; color: var(--pf-red); font-size: 48px; font-weight: 800; }
.request-indicator { display: none; color: var(--muted); font-size: 12px; }
form[aria-busy="true"] .request-indicator, .htmx-request .request-indicator { display: inline; }
dialog { max-width: min(580px, calc(100vw - 32px)); padding: 24px; border: 1px solid var(--border); border-radius: 12px; color: var(--ink-2); background: white; }
dialog::backdrop { background: rgb(23 24 25 / 40%); }
.confirm-dialog { width: min(480px, calc(100vw - 32px)); }
.confirm-dialog h2 { margin: 0 0 10px; font-size: 18px; line-height: 1.35; color: var(--ink); }
.confirm-dialog-message { margin: 0; white-space: pre-line; }
.confirm-dialog-actions { margin-top: 24px; display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; }
.button-danger:hover { color: white; background: var(--danger); }
.confirm-inline { display: inline; margin: 0; }
.table-popover .confirm-inline { display: block; }
.table-popover .confirm-inline > button { width: 100%; }
@media (max-width: 520px) {
  .confirm-dialog-actions { flex-direction: column-reverse; }
  .confirm-dialog-actions .button { width: 100%; }
}
.timeline { padding: 0; list-style: none; }
.timeline > li { padding: 16px 0; border-bottom: 1px solid var(--border); }
.timeline > li:last-child { border-bottom: 0; }
.timeline p { margin: 6px 0; color: var(--ink-2); white-space: pre-wrap; overflow-wrap: anywhere; }
.timeline-meta { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px; color: var(--muted); font-size: 12px; }
@media (max-width: 1100px) { .detail-grid { grid-template-columns: minmax(0, 1fr); } .entry-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .page-head { flex-direction: column; } .login-copy { padding-right: 26px; } }
@media (max-width: 820px) { .sidebar { display: none; top: 66px; box-shadow: 10px 10px 28px rgb(0 0 0 / 12%); } .sidebar.is-open { display: flex; } .sidebar > .wordmark { display: none; } .app-column { margin-left: 0; } .mobile-menu { display: inline-flex !important; } .topbar { padding: 12px 16px; } .workspace-label .muted { display: none; } .page-content { padding: 22px 16px 36px; } .login-layout { display: block; } .login-copy { max-width: 620px; margin: 0 auto; padding: 32px 8px; } .login-brand { display: none; } .public-header > span { display: none; } }
@media (max-width: 540px) { h1 { font-size: 26px; } .form-grid, .entry-grid { grid-template-columns: minmax(0, 1fr); } .card { padding: 16px; } .workspace-label { font-size: 12px; } .page-actions { width: 100%; } .definition-list { grid-template-columns: minmax(0, 1fr); } .definition-list dt { padding-bottom: 0; border: 0; } .definition-list dd { padding-top: 4px; } .pagination { justify-content: space-between; } table { font-size: 12px; } th, td { padding: 10px 7px; } .button { padding: 9px 12px; } .login-copy h1 { font-size: 34px; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; } }
/* The screen control also states the bounded scope of each printed view. */
.print-metadata { display: none; }

.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }
.section-heading h2 { margin: 0; }
.table-subtitle { display: block; color: var(--muted); font-weight: 400; margin-top: 4px; }
.link-list { list-style: none; margin: 0; padding: 0; }
.link-list li { display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; padding: 16px 0; border-bottom: 1px solid var(--border); }
.link-list li:last-child { border-bottom: 0; }

.field-checkbox > input { grid-column: 1; grid-row: 1; }
.field-checkbox > label, .field-checkbox > .field-label { grid-column: 2; grid-row: 1; }
.field-checkbox > small, .field-checkbox > .field-errors { grid-column: 2; }

.detail-grid + .card, .page-actions + .detail-grid, .page-actions + .card { margin-top: 16px; }

.card + .detail-grid { margin-top: 16px; }
.placement-employment-action { margin-top: 16px; }

/* Shared catalog input for single choices and equal multi-value selections. */
.catalog-picker { position: relative; }
.catalog-selection { display: flex; flex-wrap: wrap; gap: 6px; }
.catalog-selection:not(:empty) { margin-bottom: 8px; }
.catalog-chip { display: inline-flex; align-items: center; gap: 8px; padding: 5px 10px; border: 1px solid var(--border); border-radius: 6px; background: var(--surface-2); font-size: 14px; }
.catalog-remove { border: 0; background: transparent; color: var(--pf-red); padding: 0 3px; font-size: 22px; line-height: 1; cursor: pointer; }
.catalog-results { position: absolute; z-index: 30; left: 0; right: 0; max-height: 260px; overflow-y: auto; background: white; border: 1px solid var(--border); border-radius: 8px; box-shadow: 0 8px 24px #1822381a; }
.catalog-option { display: flex; flex-direction: column; text-align: left; width: 100%; border: 0; border-bottom: 1px solid var(--border); background: transparent; padding: 10px 12px; cursor: pointer; color: inherit; font: inherit; }
.catalog-option:hover, .catalog-option[aria-selected=true] { background: var(--pf-red-soft); }
.catalog-option small, .catalog-status { color: var(--muted); }
.catalog-status:empty { display: none; }
.catalog-create { border: 0; padding: 8px 0 0; background: transparent; color: var(--pf-red); text-align: left; cursor: pointer; font: inherit; }
.catalog-dialog { width: min(680px, calc(100vw - 40px)); max-height: calc(100vh - 60px); overflow-y: auto; border: 1px solid var(--border); border-radius: 12px; padding: 28px; color: var(--ink-2); }
.catalog-dialog::backdrop { background: #18223866; }

.form-section + .form-section { border-top: 1px solid var(--border); padding-top: 24px; }
.form-section legend { font-weight: 700; font-size: 17px; margin-bottom: 16px; color: var(--ink); }

.kv-pdf-preview { display: block; width: 100%; height: 75vh; min-height: 420px; border: 1px solid var(--border); border-radius: 8px; }

.record-workspace.kv-workspace { grid-template-columns: minmax(0, 2fr) minmax(300px, 1fr); }
.kv-workspace > aside { display: grid; align-content: start; gap: 1rem; }
.kv-version { padding: 1rem 0; border-bottom: 1px solid var(--border); overflow-wrap: anywhere; }
.kv-version p { margin: .3rem 0 .55rem; }
.kv-upload .form-grid { grid-template-columns: minmax(0, 1fr); }
@media (max-width: 1000px) { .record-workspace.kv-workspace { grid-template-columns: minmax(0, 1fr); } }

.administration-nav { display:flex; gap:24px; border-bottom:1px solid var(--border); margin-bottom:28px; overflow-x:auto; }
.administration-nav a { flex-shrink:0; padding:14px 16px; border-bottom:3px solid transparent; color:var(--muted); text-decoration:none; font-weight:600; }
.administration-nav a:hover { color:var(--pf-red); }
.administration-nav a[aria-current="page"] { color:var(--pf-red); border-bottom-color:var(--pf-red); }
.administration-list-heading { display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:16px; margin-bottom:20px; }
.administration-list-heading h2 { margin:0; }
.administration-list-heading h2 span { margin-left:10px; font-size:15px; font-weight:400; color:var(--muted); }
.administration-help { margin-top:20px; padding:18px 22px; border:1px solid var(--border); border-radius:8px; background:white; }
.administration-help p { color:var(--muted); margin-bottom:0; }
.catalog-secondary { margin-top:18px; color:var(--muted); font-size:14px; }
.catalog-secondary a { color:var(--muted); }
.agreement-field-preview { margin-top: 10px; padding: 12px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface-2); font-size: 14px; overflow-wrap: anywhere; }
.agreement-field-preview p { margin: 0 0 8px; }
.agreement-field-preview p:last-child { margin-bottom: 0; }
.agreement-field-preview a { display: inline-flex; margin: 0 10px 4px 0; }
.consent-next-step { flex-basis: 100%; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-top: 10px; }
.sender-availability { margin-block: 16px; }

/* Shared contextual help. Input rules remain visible below the control. */
.field[hidden] { display: none !important; }
.field-label { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.field-label > label { margin: 0; }
/* I269: an inline form or panel opens only from a visibly labelled button, never a bare triangle. */
.action-disclosure > summary { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; width: fit-content; max-width: 100%; list-style: none; cursor: pointer; }
.action-disclosure > summary::-webkit-details-marker { display: none; }
.action-disclosure > summary:focus-visible { outline: none; }
.action-disclosure > summary:focus-visible > .button { outline: 2px solid var(--pf-red); outline-offset: 3px; }
.action-disclosure > summary:hover > .button-secondary, .action-disclosure[open] > summary > .button-secondary { color: var(--ink); background: var(--surface-2); }
.action-disclosure[open] > summary > .button-secondary { border-color: var(--ink-2); }
.action-disclosure-hint { color: var(--muted); font-size: 12px; }
.action-disclosure-panel { margin-top: 12px; padding: 16px 18px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); }
.field-help { position: relative; display: inline-block; flex: 0 0 auto; font-weight: 400; }
.field-help > summary { list-style: none; display: grid; place-items: center; width: 22px; height: 22px; border: 1px solid var(--border); border-radius: 50%; color: var(--muted); cursor: pointer; font-size: 13px; font-weight: 700; }
.field-help > summary::-webkit-details-marker { display: none; }
.field-help > summary:focus-visible { outline: 2px solid var(--pf-red); outline-offset: 3px; }
.field-help[open] > summary { color: var(--pf-red); border-color: var(--pf-red); }
.field-help-content { position: absolute; z-index: 20; top: calc(100% + 8px); left: -16px; width: 290px; max-width: 70vw; padding: 14px 16px; background: var(--surface, white); color: var(--ink); border: 1px solid var(--border); border-radius: 8px; box-shadow: 0 8px 24px #18233220; font-size: 13px; line-height: 1.5; }
@media (max-width: 640px) { .field-help-content { position: fixed; inset: auto 16px 20px; width: auto; max-width: none; } }

[data-avatar-image][hidden] { display: none; }

/* I237: partial date text with a calendar button for exact days. */
.partial-date { display: flex; align-items: center; gap: 6px; }
.partial-date > input { flex: 1 1 auto; }
.partial-date-picker { position: relative; display: inline-flex; flex: 0 0 auto; }
.partial-date-picker > input[type="date"] { position: absolute; inset: 0; width: 100%; min-height: 0; padding: 0; opacity: 0; pointer-events: none; border: 0; }

/* I251/F06: the one document shelf and its upload rows. */
.document-shelf { container: document-shelf / inline-size; scroll-margin-top: 24px; }
.document-shelf-upload { margin-bottom: 16px; }
.document-shelf .document-upload-head { display: grid; grid-template-columns: auto minmax(0, 42rem) auto; justify-content: start; }
.document-shelf .document-upload-head p { font-size: .85rem; }
.document-shelf .document-upload-list:empty { margin-top: 0; }
.document-upload-rows [hidden] { display: none; }
.document-upload-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; }
.document-upload-head p { margin: 0; }
.document-upload-list { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 8px; }
.document-upload-row { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1.4fr) minmax(0, 1.2fr) auto; gap: 8px 12px; align-items: end; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); }
.document-upload-row-error { border-color: var(--danger); }
.document-upload-file { min-width: 0; overflow-wrap: anywhere; display: grid; gap: 4px; }
.document-upload-row select, .document-upload-row input[type="text"] { width: 100%; }
.document-shelf-table table { table-layout: fixed; }
.document-shelf-kind { width: 18%; }
.document-shelf-date { width: 7rem; }
.document-shelf-actions-column { width: 18rem; }
.document-shelf-name { font-weight: 650; }
.document-shelf-table small { display: block; margin-top: 4px; font-weight: 400; }
/* Keep the td a table-cell so its separator follows the complete row height. */
.document-shelf-actions { display: flex; flex-wrap: wrap; gap: 4px 12px; justify-content: flex-end; align-items: baseline; }
.document-shelf-actions a, .document-shelf-actions button { white-space: nowrap; }
.document-shelf-pages { display: flex; flex-wrap: wrap; gap: 8px 16px; margin-top: 8px; }
.document-shelf-folder { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--border); }
.document-shelf-folder h3 { font-size: 1rem; margin: 0 0 12px; overflow-wrap: anywhere; }
.document-drop-overlay { position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center; background: rgb(255 255 255 / 0.86); border: 3px dashed var(--pf-red); font-size: 1.25rem; font-weight: 600; pointer-events: none; }
.document-drop-overlay[hidden] { display: none; }
@media (min-width: 641px) {
  .document-shelf .field-help-content { left: auto; right: 0; }
}
@media (max-width: 720px) {
  .document-upload-row { grid-template-columns: 1fr; }
}
/* Use the shelf's real width, also when the history column is open. */
@container document-shelf (max-width: 760px) {
  .document-upload-row { grid-template-columns: minmax(0, 1fr); }
  .document-shelf .document-upload-head { display: grid; grid-template-columns: minmax(0, 1fr) auto; }
  .document-shelf .document-upload-pick { justify-self: start; }
  .document-shelf .document-upload-head p { grid-column: 1; grid-row: 2; }
  .document-shelf .document-upload-head .field-help { grid-column: 2; grid-row: 2; }
  .document-shelf-actions { justify-content: flex-start; gap: 4px 16px; }
  .document-shelf-actions a, .document-shelf-actions button { display: inline-flex; align-items: center; min-height: 32px; }
  .document-shelf-table table, .document-shelf-table tbody { display: block; }
  .document-shelf-table thead { display: none; }
  .document-shelf-table tr { display: block; padding: 12px 0; border-bottom: 1px solid var(--border); }
  .document-shelf-table tr:last-child { border-bottom: 0; padding-bottom: 0; }
  .document-shelf-table td { display: block; width: auto; padding: 4px 0; border: 0; }
  .document-shelf-table td[data-label]::before { content: attr(data-label) ": "; color: var(--muted); }
  .document-shelf-table td.document-shelf-name::before { content: none; }
  .document-shelf-table .document-shelf-actions-cell { padding-top: 8px; }
}
