/* Approved office interface theme: #007EC3, retained compact font sizes.
 * Loaded after module styles. All rules are screen-only.
 * Original font families and weights come from app and module styles.
 */

/* theme.css */
@media screen {
  :root {
    --desktop-bg: #f6f8fa;
    --panel: #ffffff;
    --text: #202124;
    --muted: #5f6368;
    --line: #dadce0;
    --line-light: #e8eaed;
    --tab: #f6f8fa;
    --tab-active: #d9edfa;
    --blue: #007ec3;
    --blue-dark: #0069a6;
    --weekend: #f3f9fd;
    --danger: #b3261e;
    --success: #137333;
    --warning: #8b6200;
  }

  body { background: #f6f8fa; color: #202124; }
  .desktop-header { background: #f6f8fa; border-color: transparent; box-shadow: none; }
  .window-titlebar { background: #f6f8fa; color: #202124; border-color: transparent; }
  .app-icon { color: #007ec3; background: #e7f3fc; border-radius: 7px; }
  .window-version, .window-account { color: #747775; }
  .desktop-menubar { background: #f6f8fa; padding-bottom: 12px; }
  .main-tab { color: #444746; background: transparent; border-color: transparent; border-radius: 999px; box-shadow: none; }
  .main-tab:hover { color: #1f1f1f; background: #e8eaed; }
  .main-tab.active { color: #0069a6; background: #d9edfa; border-color: transparent; box-shadow: none; }
  .system-menu summary { color: #444746; background: #edf0f3; border-color: transparent; border-radius: 999px; }
  .system-menu-panel, .person-context-menu { color: #202124; background: #fff; border-color: transparent; border-radius: 14px; box-shadow: 0 8px 24px rgba(60, 64, 67, .16), 0 1px 3px rgba(60, 64, 67, .1); }
  .system-menu-panel a, .menu-button, .person-context-menu a, .person-context-menu button { color: #303134; border-radius: 8px; }
  .system-menu-panel a:hover, .menu-button:hover, .person-context-menu a:hover, .person-context-menu button:hover { color: #202124; background: #f0f3f6; }
  .system-menu-panel form, .person-context-menu hr { border-color: #e8eaed; }
  .site-footer { color: #747775; background: #f6f8fa; border-color: transparent; }
  .site-footer a { color: #747775; }

  /* Containment comes from light surface tones; only editable controls have outlines. */
  .desktop-group, .deskcard-group, .letter-group, .agenda-group,
  .reminder-window, .panel, .auth-card, .filter-bar, .holiday-preview-window,
  .holiday-dialog-window { color: #202124; background: #fff; border-color: transparent; border-radius: 16px; box-shadow: 0 1px 2px rgba(60, 64, 67, .045); }
  .agenda-subgroup { color: #202124; background: #f8f9fa; border-color: transparent; border-radius: 12px; }
  .desktop-group > legend, .deskcard-group > legend, .letter-group > legend,
  .agenda-group > legend, .agenda-subgroup > legend, .agenda-unit-card > legend { color: #202124; }
  .auth-card { box-shadow: 0 4px 16px rgba(60, 64, 67, .08); }
  .page-heading h1, .reminder-heading h1, .week-navigation strong,
  .preview-titlebar > strong, .organizer-preview-toolbar > strong { color: #202124; }
  .desktop-note, .muted, .help, .calendar-help, .letter-body-note,
  .agenda-host-fields small, .agenda-person-head, .agenda-preview-toolbar,
  #letter-status, #agenda-status, #organizer-status,
  .organizer-preview-note, .organizer-file-card p { color: #5f6368; }

  /* Three action levels: filled primary, quiet tonal secondary, plain text links. */
  .desktop-button, .button, .deskcard-button, .letter-button, .agenda-button,
  .recognition-dialog button { color: #303134; background: #f0f3f6; border-color: transparent; border-radius: 999px; box-shadow: none; }
  .desktop-button:hover, .button:hover, .deskcard-button:hover:not(:disabled),
  .letter-button:hover, .agenda-button:hover, .recognition-dialog button:hover { color: #202124; background: #e4e9ef; border-color: transparent; }
  .desktop-button.primary, .button-primary, .organizer-primary,
  .recognition-dialog .recognition-primary,
  #desk-card-recognize, #desk-card-preview,
  #official-document-preview, #letter-preview, #letter-save-edit, #agenda-save-edit, #agenda-import, #agenda-import-deskcards { color: #fff; background: #007ec3; border-color: transparent; box-shadow: none; }
  .desktop-button.primary:hover, .button-primary:hover, .organizer-primary:hover,
  .recognition-dialog .recognition-primary:hover,
  #desk-card-recognize:hover:not(:disabled), #desk-card-preview:hover:not(:disabled),
  #official-document-preview:hover, #letter-preview:hover, #letter-save-edit:hover, #agenda-save-edit:hover, #agenda-import:hover, #agenda-import-deskcards:hover { color: #fff; background: #0069a6; border-color: transparent; box-shadow: 0 1px 3px rgba(60, 64, 67, .16); }
  .desktop-button.danger { color: #b3261e; background: #fce8e6; border-color: transparent; box-shadow: none; }
  .desktop-button.danger:hover { color: #8c1d18; background: #f9d9d6; border-color: transparent; }
  .desktop-button:disabled, .people-toolbar .desktop-button:disabled,
  .deskcard-button:disabled, .letter-button:disabled, .agenda-button:disabled,
  .recognition-dialog button:disabled { color: #9aa0a6; background: #f1f3f4; border-color: transparent; box-shadow: none; }
  .deskcard-upload-button { color: #0069a6; background: #e7f3fc; border-color: transparent; }
  .table-link-button, .deskcard-candidate, .deskcard-select-all,
  .agenda-select-all, .agenda-text-action:hover { color: #007ec3; }

  /* Explicit editing controls avoid altering the rendered paper and its contents. */
  .month-inputs input, .holiday-generate select, .start-person-select,
  .version-picker select, .field input, .field select, .field textarea,
  .deskcard-input-group textarea, .deskcard-row input,
  .letter-form-row input, .letter-form-row select,
  .official-document-list-row input,
  .agenda-form-row input, .agenda-unit-card input, .agenda-content-row input,
  .agenda-dialog input, .agenda-dialog select,
  .reminder-message, .organizer-paste-editor,
  .recognition-source-panel textarea, .recognition-table input[type="text"] {
    color: #202124; background: #fff; border-color: #c4c7c5; border-radius: 8px;
  }
  .month-inputs input:focus, .holiday-generate select:focus, .start-person-select:focus,
  .version-picker select:focus, .field input:focus, .field select:focus, .field textarea:focus,
  .deskcard-input-group textarea:focus, .deskcard-row input:focus,
  .letter-form-row input:focus, .letter-form-row select:focus,
  .official-document-list-row input:focus,
  .agenda-form-row input:focus, .agenda-unit-card input:focus,
  .agenda-content-row input:focus, .organizer-paste-editor:focus,
  .reminder-message:focus { border-color: #007ec3; outline-color: #d9edfa; }
  .start-person-select:disabled, .agenda-time-row input, .letter-date-row input { color: #747775; background: #f8f9fa; border-color: #e0e3e7; }
  #letter-body, #official-document-body { color: #202124; background: #fff; border-color: #c4c7c5; border-radius: 10px; }

  .sub-tabs { border-color: #e8eaed; }
  .sub-tabs a, .holiday-dialog-tabs button { color: #5f6368; background: transparent; border-color: transparent; border-radius: 999px; box-shadow: none; }
  .sub-tabs a:hover, .holiday-dialog-tabs button:hover { color: #202124; background: #f1f3f4; }
  .sub-tabs a.active, .holiday-dialog-tabs button.active { color: #0069a6; background: #e7f3fc; border-color: transparent; box-shadow: none; }

  /* Personnel and calendar states retain their existing semantic distinctions. */
  .start-person-box { background: #fff; border-color: #e8eaed; }
  .start-person-box > div + div, .start-person-form { border-color: #edf0f2; }
  .start-person-heading { background: #f8f9fa; }
  .start-person-box span:first-child, .start-person-heading span:not(:first-child) { color: #5f6368; }
  .person-list { background: #f8f9fa; border-color: transparent; border-radius: 12px; }
  .person-card, .person-card:nth-child(even) { background: #fff; border-color: #e8eaed; border-radius: 9px; }
  .person-drag-bar, .person-card:nth-child(even) .person-drag-bar { color: #747775; background: #f8f9fa; }
  .person-card:not(.inactive) .person-drag-bar { color: #5f6368; }
  .person-name-input { color: #303134; }
  .duty-state { color: #5f6368; }
  .person-card:not(.inactive) .duty-state:not(.scheduled-active):not(.scheduled-away) { color: #5f6368; }
  .person-card.selected { background: #eff7fc; border-color: #007ec3; }
  .person-card.selected .person-drag-bar { background: #d9edfa; }
  .person-card.inactive, .person-card.inactive .person-name-input { color: #9aa0a6; }
  .inactive .duty-state { color: #b3261e; }
  .calendar-wrap { background: #f1f3f4; border-radius: 12px; }
  .calendar-head > div { color: #444746; background: #f1f3f4; }
  .calendar-head > div.weekend { color: #007ec3; background: #eff7fc; }
  .calendar-cell { background: #fff; border-color: #eef0f2; border-radius: 8px; }
  .calendar-cell.weekend { background: #f3f9fd; }
  .calendar-cell.holiday { background: #fff9e8; border-color: #f3e9ce; }
  .calendar-cell.outside { background: #f1f3f4; }
  .calendar-datebar, .calendar-datebar small { color: #5f6368; }
  .calendar-cell.weekend .calendar-datebar small { color: #007ec3; }
  .calendar-cell.holiday .calendar-datebar small { color: #8b6200; }
  .calendar-person { color: #202124; }
  .calendar-leader { color: #5f6368; background: #f8f9fa; }
  .calendar-cell.weekend .calendar-leader { color: #4d7892; background: #eff7fc; }
  .calendar-cell.holiday .calendar-leader { color: #80651d; background: #fff3cf; }
  .calendar-empty { color: #9aa0a6; }

  .table-wrap, .reminder-table, .deskcard-table, .recognition-table-wrap,
  .holiday-grid-panel { background: #fff; border-color: #e0e3e7; border-radius: 12px; }
  .table-wrap > table > thead > tr > th, .reminder-table-head,
  .deskcard-table-header, .recognition-table th { color: #444746; background: #f8f9fa; border-color: #e8eaed; }
  .table-wrap > table > tbody > tr > td, .reminder-row + .reminder-row,
  .reminder-row > * + *, .deskcard-row,
  .recognition-table th, .recognition-table td { border-color: #eceff1; }
  .table-wrap > table > tbody > tr:hover { background: #f1f8fc; }
  .reminder-row.unavailable { color: #9aa0a6; background: #f8f9fa; }
  .deskcard-row-select { color: #007ec3; background: #eff7fc; border-radius: 999px; }
  .deskcard-row-select:not(.selected) { color: #9aa0a6; }
  .deskcard-rows-empty, .empty, .empty-panel { color: #80868b; }

  .message, .notice, .query-summary, .recognition-status { color: #3c4043; background: #edf6fc; border-color: transparent; border-radius: 12px; }
  .message-success, .sender-status-online { color: #137333; background: #e6f4ea; border-color: transparent; }
  .message-error, .form-errors, .recognition-status.error { color: #b3261e; background: #fce8e6; border-color: transparent; border-radius: 12px; }
  .sender-status-offline { color: #8b6200; background: #fef7e0; border-color: transparent; }
  .status-label, .badge { color: #5f6368; background: #f1f3f4; border-color: transparent; border-radius: 999px; }
  .status-draft, .status-preview { color: #8b6200; background: #fef7e0; border-color: transparent; }
  .status-finalized { color: #0069a6; background: #e7f3fc; border-color: transparent; }
  .status-published { color: #137333; background: #e6f4ea; border-color: transparent; }
  .status-archived { color: #747775; background: #f1f3f4; border-color: transparent; }

  /* Surrounding editing chrome only; document pages and print media are untouched. */
  .letter-splitter, .agenda-splitter { background: #f6f8fa; border-color: transparent; }
  .letter-splitter:hover, .letter-splitter.dragging,
  .agenda-splitter:hover, .agenda-splitter.dragging { background: #d9edfa; border-color: transparent; }
  .agenda-unit-card { background: #f1f3f4; border-color: transparent; border-radius: 10px; }
  .agenda-preview-viewport { background: #f0f3f6; border-color: transparent; border-radius: 12px; }
  .agenda-preview-placeholder { color: #3c4043; background: #fff; }
  .agenda-preview-placeholder span { color: #80868b; }
  .organizer-sources, .organizer-preview-panel { background: #fff; border-color: transparent; border-radius: 16px; box-shadow: 0 1px 2px rgba(60, 64, 67, .045); }
  .organizer-source-tabs [aria-selected="true"] { color: #0069a6; background: #d9edfa; border-color: transparent; }
  .organizer-file-panel { background: #f8f9fa; border-color: #e0e3e7; border-radius: 12px; }
  .organizer-file-icon { color: #007ec3; background: #e7f3fc; border-color: transparent; border-radius: 12px; }
  .organizer-file-card h2 { color: #303134; }
  .organizer-file-limit, .organizer-empty { color: #80868b; }
  .organizer-empty strong { color: #5f6368; }
  .organizer-preview-toolbar { background: #fff; }
  .organizer-preview-pages { background: #f0f3f6; border-color: #e8eaed; }

  .desktop-dialog, .letter-dialog, .agenda-dialog, .deskcard-dialog,
  .recognition-dialog { color: #202124; background: #fff; border-color: transparent; border-radius: 24px; box-shadow: 0 16px 48px rgba(60, 64, 67, .18), 0 2px 6px rgba(60, 64, 67, .12); }
  .desktop-dialog::backdrop, .letter-dialog::backdrop, .agenda-dialog::backdrop,
  .deskcard-dialog::backdrop, .recognition-dialog::backdrop { background: rgba(32, 33, 36, .28); }
}


/* completion.css */
@media screen {
  /* Query campus picker keeps its native box metrics, with Google containment. */
  .campus-checks {
    color: #5f6368;
    background: #f8f9fa;
    border-color: transparent;
    border-radius: 12px;
    box-shadow: inset 0 0 0 1px #e0e3e7;
  }
  /* Low-specificity interface links; explicitly exclude editable and paper contents. */
  a:not(:where([contenteditable] *, .letter-preview-page *, .agenda-preview-page *, .deskcard-print-page *)) { color: #007ec3; }
  a:not(:where([contenteditable] *, .letter-preview-page *, .agenda-preview-page *, .deskcard-print-page *)):hover { color: #0069a6; }
  /* Missing field families: server dialogs and JS-created review-role selects. */
  .start-person-password-form input:not([type="hidden"]),
  .add-person-dialog-form input:not([type="hidden"]),
  .person-status-date-row input,
  .organizer-structure-row select {
    color: #202124;
    background: #ffffff;
    border-color: #c4c7c5;
    border-radius: 8px;
    box-shadow: none;
  }
  .start-person-password-form input:not([type="hidden"]):hover:not(:disabled),
  .add-person-dialog-form input:not([type="hidden"]):hover:not(:disabled),
  .person-status-date-row input:hover:not(:disabled),
  .organizer-structure-row select:hover:not(:disabled) { border-color: #80868b; }

  /* Existing fields' missing focus and readonly states; no new outline width. */
  .start-person-password-form input:focus,
  .add-person-dialog-form input:focus,
  .person-status-date-row input:focus,
  .organizer-structure-row select:focus,
  .agenda-dialog input:focus, .agenda-dialog select:focus,
  .recognition-source-panel textarea:focus,
  .recognition-table input[type="text"]:focus,
  #letter-body:focus, #official-document-body:focus {
    border-color: #007ec3;
    outline-color: #d9edfa;
    box-shadow: none;
  }
  .person-name-input:focus { outline-color: #007ec3; box-shadow: none; }
  .draggable-item.drag-source, .calendar-cell.drag-source-cell { outline-color: #007ec3; }
  .reminder-message[readonly] { color: #5f6368; background: #f8f9fa; border-color: #e0e3e7; }
  .field :is(input, textarea)[readonly] { color: #5f6368; background: #f8f9fa; border-color: #e0e3e7; }
  :is(.field, .deskcard-input-group, .letter-form-row,
      .official-document-list-row, .agenda-form-row, .agenda-unit-card,
      .recognition-source-panel, .recognition-table)
    :is(input, textarea)::placeholder { color: #747775; opacity: 1; }
  #organizer-text:empty::before { color: #747775; }

  /* Native checked states keep their actual control size and browser behavior. */
  :is(.field, .campus-checks, .deskcard-mode-group, .letter-without-number,
      .person-status-option, .reminder-row, .recognition-scope-list, .recognition-table)
    :is(input[type="checkbox"], input[type="radio"]) { accent-color: #007ec3; }
  :is(.field, .campus-checks, .deskcard-mode-group, .letter-without-number,
      .person-status-option, .reminder-row, .recognition-scope-list, .recognition-table)
    :is(input[type="checkbox"], input[type="radio"]):focus-visible {
    outline-color: #007ec3;
    box-shadow: none;
  }
  :is(.field, .campus-checks, .deskcard-mode-group, .letter-without-number,
      .person-status-option, .reminder-row, .recognition-scope-list, .recognition-table)
    :is(input[type="checkbox"], input[type="radio"]):disabled { accent-color: #9aa0a6; }
  .field input[type="file"]::file-selector-button {
    color: #303134; background: #f0f3f6; border-color: transparent; border-radius: 999px; box-shadow: none;
  }
  .field input[type="file"]::file-selector-button:hover { color: #202124; background: #e4e9ef; }
  .field input[type="file"]:focus-visible { outline-color: #007ec3; }

  /* Role actions absent from the original overlay, including native dialogs. */
  :is(#desk-card-start-print, #official-document-save, #agenda-time-confirm) {
    color: #ffffff; background: #007ec3; border-color: transparent; border-radius: 999px; box-shadow: none;
  }
  :is(#desk-card-start-print, #official-document-save, #agenda-time-confirm):hover:not(:disabled) {
    color: #ffffff; background: #0069a6; border-color: transparent; box-shadow: 0 1px 3px rgba(60, 64, 67, .16);
  }
  .person-status-reservation-delete {
    color: #b3261e; background: #fce8e6; border-color: transparent; border-radius: 999px; box-shadow: none;
  }
  .person-status-reservation-delete:hover:not(:disabled) { color: #8c1d18; background: #f9d9d6; border-color: transparent; }

  /* Fill in pressed / keyboard states, retaining the theme's normal buttons. */
  .desktop-button:active:not(:disabled), .button:active:not(:disabled),
  .deskcard-button:active:not(:disabled), .letter-button:active:not(:disabled),
  .agenda-button:active:not(:disabled), .recognition-dialog button:active:not(:disabled) {
    background: #d9edfa;
    border-color: transparent;
  }
  :is(.desktop-button.primary, .button-primary, .organizer-primary,
      .recognition-dialog .recognition-primary,
      #desk-card-recognize, #desk-card-preview, #desk-card-start-print,
      #letter-preview, #letter-save-edit, #official-document-preview, #official-document-save,
      #agenda-save-edit, #agenda-import, #agenda-import-deskcards, #agenda-time-confirm):active:not(:disabled) {
    color: #ffffff; background: #0069a6; border-color: transparent; box-shadow: none;
  }
  .desktop-button.danger:active:not(:disabled), .person-status-reservation-delete:active:not(:disabled) {
    color: #8c1d18; background: #f9d9d6; border-color: transparent;
  }
  :is(.desktop-button, .button, .deskcard-button, .letter-button, .agenda-button,
      .recognition-dialog button, .person-status-reservation-delete,
      .letter-calendar-day, .deskcard-select-all, .deskcard-candidate,
      .deskcard-row-select, .agenda-text-action, .agenda-select-dot,
      .table-link-button, .duty-state, .menu-button,
      .person-context-menu button, .holiday-dialog-tabs button,
      .system-menu summary):focus-visible {
    outline-color: #007ec3;
    box-shadow: none;
  }
  :is(#desk-card-recognize, #desk-card-preview, #desk-card-start-print,
      #letter-preview, #letter-save-edit, #official-document-preview, #official-document-save,
      #agenda-save-edit, #agenda-import, #agenda-import-deskcards, #agenda-time-confirm):focus-visible { outline-color: #007ec3; box-shadow: none; }
  .organizer-choose-file:has(+ input:focus-visible) { outline-color: #007ec3; box-shadow: none; }
  .organizer-file-name, #organizer-references summary { color: #007ec3; }
  #organizer-references summary:hover { color: #0069a6; }
  #organizer-references summary:focus-visible { outline-color: #007ec3; }
  .deskcard-drop-zone.drag-over { border-color: #007ec3; background: #e7f3fc; }

  /* Disabled precedence also wins against ID-specific primary and hover rules. */
  :is(.desktop-button, .people-toolbar .desktop-button, .button,
      .deskcard-button, .letter-button, .agenda-button, .recognition-dialog button,
      .person-status-reservation-delete, .letter-calendar-day,
      #desk-card-recognize, #desk-card-preview, #desk-card-start-print,
      #letter-preview, #letter-save-edit, #official-document-preview, #official-document-save,
      #agenda-save-edit, #agenda-import, #agenda-import-deskcards, #agenda-time-confirm):disabled {
    color: #9aa0a6;
    background: #f1f3f4;
    border-color: transparent;
    box-shadow: none;
    opacity: 1;
  }
  :is(.field, .start-person-password-form, .add-person-dialog-form,
      .person-status-date-row, .deskcard-row, .letter-form-row,
      .official-document-list-row, .agenda-form-row, .agenda-unit-card,
      .agenda-content-row, .agenda-dialog, .recognition-source-panel,
      .recognition-table, .organizer-structure-row)
    :is(input:not([type="checkbox"]):not([type="radio"]), select, textarea):disabled {
    color: #9aa0a6; background: #f1f3f4; border-color: #e0e3e7; box-shadow: none;
  }

  /* Date calendar and dynamic list selection controls did not use button classes. */
  .letter-calendar-day {
    color: #303134; background: #f0f3f6; border-color: transparent; border-radius: 999px; box-shadow: none;
  }
  .letter-calendar-day:hover:not(:disabled) { color: #202124; background: #d9edfa; border-color: transparent; }
  .letter-calendar-day.selected:hover:not(:disabled) { color: #9b1c31; background: #f0f3f6; border-color: #9b1c31; }
  .letter-calendar-weekday, .letter-date-dialog label, .agenda-dialog label { color: #5f6368; }
  .agenda-select-dot:not(.selected) { color: #007ec3; background: transparent; }
  .agenda-text-action { color: #5f6368; }
  .agenda-text-action:hover { color: #007ec3; }
  .agenda-select-all { color: #007ec3; }

  /* Person-state dialog: more-specific original rules require this completion. */
  .desktop-dialog.person-status-dialog {
    color: #202124; background: #ffffff; border-color: transparent; border-radius: 24px;
    box-shadow: 0 16px 48px rgba(60, 64, 67, .18), 0 2px 6px rgba(60, 64, 67, .12);
  }
  .desktop-dialog.person-status-dialog::backdrop { background: rgba(32, 33, 36, .28); }
  .person-status-dialog-form h2, .person-status-dialog .dialog-actions { border-color: #e8eaed; }
  .person-status-dialog-note { color: #5f6368; background: #f0f3f6; border-color: #007ec3; border-radius: 12px; }
  .person-status-fieldset { color: #202124; background: #f8f9fa; border-color: transparent; border-radius: 12px; }
  .person-status-fieldset legend, .person-status-date-row,
  .person-status-reservations > strong { color: #5f6368; }
  .person-status-option { color: #303134; background: #ffffff; border-color: #e0e3e7; border-radius: 12px; }
  .person-status-option:hover { color: #202124; background: #f0f3f6; border-color: #c4c7c5; }
  .person-status-option:has(input:checked) { color: #0069a6; background: #d9edfa; border-color: #007ec3; box-shadow: none; }
  .person-status-reservation-item { color: #303134; background: #f8f9fa; border-color: #e0e3e7; border-radius: 12px; }
  .person-status-reservation-item.scheduled-away { border-left-color: #8b6200; }
  .person-status-reservation-item.scheduled-active { border-left-color: #137333; }
  .duty-state.scheduled-away { color: #8b6200; }
  .duty-state.scheduled-active { color: #137333; }

  /* Errors already exist in the app; only their missing visual treatment is added. */
  .letter-template-error { color: #b3261e; background: #fce8e6; border-color: transparent; border-radius: 12px; }
  .errorlist, .field-error, .start-person-password-form .field-error,
  #organizer-alert, .official-document-required { color: #b3261e; }
  :is(.field:has(.errorlist) :is(input, select, textarea),
      .field :is(input, select, textarea)[aria-invalid="true"],
      #official-document-app :is(input, select, textarea)[aria-invalid="true"],
      #letter-body[aria-invalid="true"], #official-document-body[aria-invalid="true"],
      #organizer-text[aria-invalid="true"]) {
    border-color: #b3261e; outline-color: #fce8e6; box-shadow: none;
  }
  .official-document-file-status, .official-document-save-shell > p { color: #5f6368; }
  .official-document-file-status.saved { color: #137333; }
  .official-document-file-status.failed { color: #b3261e; }
  .official-document-save-row { color: #202124; background: #f8f9fa; border-color: transparent; border-radius: 12px; }
  .organizer-structure-row, #organizer-references details { border-color: #e8eaed; }

  /* Recognition-generated controls and review statuses outside the original theme. */
  .recognition-toolbar span, .recognition-help, .recognition-footer > span,
  .recognition-table .recognition-source-ref, .recognition-unused small,
  .recognition-table-wrap > p { color: #5f6368; }
  .recognition-source-panel fieldset { border-color: #e0e3e7; border-radius: 12px; }
  .recognition-table tr.needs-review { background: #fef7e0; }
  .recognition-table .recognition-issue, .recognition-warnings { color: #8b6200; }
  .recognition-unused > div { border-color: #e8eaed; }
  .recognition-table tr.recognition-drop-before > td { box-shadow: inset 0 3px #007ec3; }
  .recognition-table tr.recognition-drop-after > td { box-shadow: inset 0 -3px #007ec3; }
  .recognition-dialog progress { accent-color: #007ec3; }
  .recognition-dialog progress::-webkit-progress-bar { background: #e8eaed; }
  .recognition-dialog progress::-webkit-progress-value { background: #007ec3; }
  .recognition-dialog progress::-moz-progress-bar { background: #007ec3; }
  .recognition-source-panel details > summary { color: #007ec3; }
  .recognition-source-panel details > summary:hover { color: #0069a6; }
  .recognition-source-panel details > summary:focus-visible { outline-color: #007ec3; }
}


/* spacing.css */
@media screen {
  .campus-tabs:has(+ .calendar-wrap) {
    margin-bottom: 12px;
    border-bottom-color: transparent;
  }
}


/* typography.css */
@media screen {
  /* Reduce only the original 14px interface roles; retain their line boxes.
   * 10–13px dates, notes, personnel names and compact controls stay unchanged. */
  :is(.main-tab, .system-menu summary, .system-menu-panel a, .menu-button,
      .desktop-button, .button, .deskcard-button,
      .desktop-group > legend, .deskcard-group > legend,
      .letter-group > legend, .agenda-group > legend, .agenda-subgroup > legend,
      .month-generate > label, .holiday-generate > label,
      .month-inputs input, .field > label, .field > input, .field > textarea,
      .version-picker label, .preview-titlebar > strong,
      .campus-tabs > a, .calendar-head > div, .calendar-person,
      .letter-form-row > label, .agenda-form-row > label,
      .reminder-table-head > div, .deskcard-table-header > div,
      .table-wrap > table > thead > tr > th) {
    font-size: 13px;
    line-height: 20.3px;
  }

  /* These controls already have explicit heights and native line metrics. */
  :is(.holiday-generate select, .start-person-select, .version-picker select,
      .field > select, .letter-form-row input, .letter-form-row select,
      .official-document-list-row input, .agenda-form-row input,
      .agenda-unit-card input, .agenda-content-row input) { font-size: 13px; }

  :is(.page-heading h1, .reminder-heading h1, .auth-card h1, .panel > h1) {
    font-size: 20px;
    line-height: 31.9px;
  }
  .holiday-preview-toolbar h1 { font-size: 19px; line-height: 29px; }
  :is(.auth-card h2, .section h2, .panel > h2, .desktop-dialog h2,
      .letter-dialog h2, .agenda-dialog h2, .organizer-file-card h2) {
    font-size: 16px;
    line-height: 24.65px;
  }
  .start-person-password-form h2 { font-size: 14px; line-height: 21.75px; }
  .week-navigation strong { font-size: 15px; line-height: 23.2px; }

  /* A single heading, with plain rows instead of the former nested table box. */
  .start-person-box { border: 0; background: transparent; box-shadow: none; }
  .start-person-box > .start-person-heading {
    display: block;
    padding: 5px 0;
    background: transparent;
    font-size: 13px;
    line-height: 20.3px;
    color: #202124;
  }
  .start-person-box > div + div, .start-person-box .start-person-form { border: 0; }

  /* Header bars retain a consistent inset at every viewport width. */
  .desktop-header { --header-right-inset: 12px; }
  .window-titlebar, .desktop-menubar { padding-right: var(--header-right-inset); }
  .desktop-menubar .main-tabs { min-width: 0; overflow-x: auto; overflow-y: hidden; padding-bottom: 1px; }
  .desktop-menubar .system-menu, .desktop-menubar .viewer-logout-form { flex-shrink: 0; }
  .system-menu summary { white-space: nowrap; }
}

/* Local interface refinements; document page contents keep their own styles. */
@media screen {
  .reminder-campus-tabs { border-bottom-color: transparent; }
  .window-account { margin-left: 16px; }

  .start-person-box > .start-person-options {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
    gap: 8px;
    align-items: center;
  }
  .start-person-options .start-person-form {
    display: grid;
    grid-template-columns: max-content minmax(0, 1fr);
    gap: 6px;
    align-items: center;
    padding: 3px 0;
  }
  .start-person-options .start-person-form > label { white-space: nowrap; color: #5f6368; }
  .start-person-options .start-person-controls { display: block; min-width: 0; }
  .start-person-options .start-person-unlock { min-height: 29px; height: 29px; padding: 3px 8px; }
  .holiday-maintenance-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }

  .organizer-preview-pages {
    margin: 0 12px;
    padding: 12px;
    border: 1px solid transparent;
    border-radius: 12px;
    background: #f0f3f6;
  }
}
