/* Focused reference directories */
.production-theme #settings [hidden], .production-theme #referenceVenuePicker [hidden] { display: none !important; }
.production-theme #settings.reference-workspace.active { display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: 24px; align-items: start; }
.production-theme #referenceNav { display: grid; gap: 4px; position: sticky; top: 90px; padding: 8px 0; }
.production-theme #referenceNav button { display: flex; gap: 10px; align-items: center; text-align: left; min-height: 42px; padding: 10px 12px; border: 0; background: transparent; color: #58615e; border-radius: 4px; font-size: 13px; }
.production-theme #referenceNav button.active { background: #e6f1ef; color: #086b60; box-shadow: inset 3px 0 #08776b; font-weight: 750; }
.production-theme #referenceNav svg { flex: 0 0 18px; width: 18px; height: 18px; }
.production-theme .reference-main { min-width: 0; }
.production-theme .reference-main .settings-grid { display: block; }
.production-theme .reference-main .panel { border: 0; border-radius: 0; box-shadow: none; padding: 14px 0; background: transparent; margin-bottom: 12px; }
.production-theme [data-reference-section][hidden], .production-theme .reference-legacy-form, .production-theme .reference-workspace .panel-head[hidden] { display: none !important; }
.production-theme .reference-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; border-bottom: 1px solid #d6dedd; padding: 8px 0 18px; }
.production-theme .reference-head h2 { margin: 0 0 5px; font-size: 23px; }
.production-theme .reference-head { flex-wrap: wrap; }
.production-theme .reference-head > div:first-child { flex: 1; }
.production-theme #referenceExportExcel { display: inline-flex; align-items: center; gap: 7px; }
.production-theme #libraryExportDialog { width: min(580px, calc(100vw - 24px)); max-height: calc(100dvh - 32px); padding: 0; }
.production-theme #libraryExportForm { padding: 22px; gap: 16px; }
.production-theme #libraryExportForm > label { display: grid; gap: 8px; }
.production-theme #libraryExportDialog [hidden] { display: none !important; }
.production-theme .library-export-options { display: grid; gap: 14px; margin: 0; padding: 16px; border: 1px solid #dce3e0; }
.production-theme .library-export-options legend { padding: 0 6px; font-weight: 650; }
.production-theme .library-export-options label { display: flex; align-items: center; gap: 10px; }
.production-theme .library-export-options input { width: 17px; height: 17px; min-height: 17px; flex: 0 0 17px; }
.production-theme #libraryExportDialog p { margin: 0; line-height: 1.5; overflow-wrap: anywhere; }
.production-theme #libraryExportCount { color: #086b60; font-weight: 650; }
.production-theme #libraryExportStatus:empty { display: none; }
.production-theme #referenceCount { font-size: 12px; color: #65736d; }
.production-theme #referenceAdd, .production-theme #referencePickerAdd { display: inline-flex; align-items: center; gap: 7px; }
.production-theme .reference-toolbar { display: flex; gap: 18px; align-items: center; margin: 18px 0 0; }
.production-theme #referenceSearch { flex: 1; min-width: 0; }
.production-theme #referenceArchiveLabel { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }
.production-theme #referenceArchiveLabel input, .production-theme .reference-role-picker input { width: 16px; min-height: 16px; height: 16px; }
.production-theme .reference-records { display: grid; gap: 0; }
.production-theme .reference-record { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) auto; gap: 18px; align-items: center; background: white; padding: 18px 14px; border-bottom: 1px solid #dce3e0; min-width: 0; }
.production-theme .reference-record:first-child { border-top: 1px solid #dce3e0; }
.production-theme .reference-record-main, .production-theme .reference-record-meta { display: grid; gap: 6px; min-width: 0; overflow-wrap: anywhere; }
.production-theme .reference-record-main strong { font-size: 15px; }
.production-theme .reference-record-main span, .production-theme .reference-record-meta { font-size: 12px; color: #5b6963; }
.production-theme .reference-actions { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.production-theme .reference-empty { padding: 36px 16px; color: #65736d; text-align: center; border-bottom: 1px solid #dce3e0; }
.production-theme #referenceEditor { width: min(740px, calc(100vw - 24px)); max-height: calc(100dvh - 32px); padding: 0; }
.production-theme #referenceEditorForm { padding: 22px; gap: 18px; }
.production-theme #referenceVenuePicker { width: min(660px, calc(100vw - 24px)); max-height: calc(100dvh - 32px); padding: 22px; }
.production-theme .reference-dialog-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.production-theme .reference-dialog-head h3 { font-size: 18px; margin: 0; overflow-wrap: anywhere; }
.production-theme .reference-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.production-theme .reference-fields label { display: grid; gap: 6px; min-width: 0; font-size: 12px; color: #56635d; }
.production-theme .reference-fields input, .production-theme .reference-fields select, .production-theme .reference-fields textarea { width: 100%; min-width: 0; }
.production-theme .reference-wide { grid-column: 1 / -1; }
.production-theme .reference-fields summary { padding: 10px 0; cursor: pointer; font-size: 13px; }
.production-theme .reference-dialog-actions { display: flex; justify-content: flex-end; gap: 10px; padding-top: 14px; border-top: 1px solid #dce3e0; margin-top: 16px; }
.production-theme #referenceEditorError { color: #ae2929; margin: 0; }
.production-theme #referenceEditorError:empty { display: none; }
.production-theme .reference-roles { display: grid; gap: 8px; font-size: 12px; }
.production-theme .reference-role-picker { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 12px; max-height: 176px; overflow-y: auto; padding: 10px; background: #f4f6f5; }
.production-theme .reference-role-picker label { display: flex; gap: 7px; align-items: center; line-height: 1.4; }
.production-theme .reference-role-picker input { flex: 0 0 16px; }
.production-theme #referenceVenueChoices { display: grid; gap: 6px; max-height: 52dvh; overflow: auto; margin-top: 16px; }
.production-theme .reference-venue-choice { display: grid; text-align: left; gap: 6px; padding: 14px; min-width: 0; border: 1px solid #dce3e0; background: white; border-radius: 4px; white-space: normal; }
.production-theme .reference-venue-choice:hover { border-color: #0f776a; background: #f0f7f5; }
.production-theme .reference-venue-choice span, .production-theme .reference-venue-choice small { font-size: 12px; color: #607068; overflow-wrap: anywhere; }
.production-theme #projectVenueBar { display: flex; align-items: center; gap: 12px; padding: 12px 0; margin-bottom: 12px; border-bottom: 1px solid #dce3e0; order: 0; }
.production-theme #projectVenueBar > svg { width: 20px; color: #a52c2c; flex: 0 0 20px; }
.production-theme #projectVenueBar > div:not(.reference-actions) { display: grid; gap: 4px; min-width: 0; flex: 1; overflow-wrap: anywhere; }
.production-theme #projectVenueBar span, .production-theme #projectVenueBar small { font-size: 12px; color: #607068; }
.production-theme #projectVenueBar strong { font-size: 14px; }
@media (max-width: 900px) {
  .production-theme #settings.reference-workspace.active { grid-template-columns: 1fr; gap: 12px; }
  .production-theme #referenceNav { display: flex; overflow-x: auto; position: static; padding: 0 0 8px; }
  .production-theme #referenceNav button { flex: 0 0 auto; }
}
@media (max-width: 540px) {
  .production-theme .reference-record { grid-template-columns: minmax(0,1fr) auto; gap: 12px; }
  .production-theme .reference-record-meta { grid-row: 2; grid-column: 1; }
  .production-theme .reference-record .reference-actions { grid-row: 1 / 3; grid-column: 2; }
  .production-theme .reference-fields { grid-template-columns: 1fr; }
  .production-theme .reference-role-picker { grid-template-columns: 1fr; }
  .production-theme #projectVenueBar { flex-wrap: wrap; }
  .production-theme #projectVenueBar .reference-actions { width: 100%; padding-left: 32px; }
  .production-theme .reference-dialog-actions { flex-wrap: wrap; }
  .production-theme .reference-head h2 { font-size: 20px; }
}
