/* One type scale for administration, including dialogs appended to <body>.
   Deliberately excluded from the player. Page/hero titles and icons keep their
   established hierarchy. Never shrink essential information on small screens. */
#admin-shell {
  --admin-font-increment: 1px;
  font-size: 17px;
  --admin-text-micro: 13px;
  --admin-text-detail: 14px;
  --admin-text-body: 15px;
  --admin-text-lead: 16px;
  --admin-text-intro: 17px;
}
/* Drawers follow the readable scale of the administration settings pages.
   Their headings keep their existing size. */
#admin-shell dialog {
  --admin-text-micro: 15px;
  --admin-text-detail: 16px;
  --admin-text-body: 17px;
  --admin-text-lead: 18px;
  --admin-text-intro: 19px;
  font-size: var(--admin-text-body);
}
#admin-shell :is(label, input, select, textarea, .check, .folder-item, .folder-row,
  .notice, .empty, .waiting, .option-list, .tabs button, .library-pref-tabs button) {
  font-size: var(--admin-text-body);
}
#admin-shell :is(.primary, .secondary, .quiet, .library-menu-options > button) {
  font-size: var(--admin-text-body);
}
#admin-shell :is(.form-note, .muted, .path, .issue-path, .advanced, .chosen-path > span,
  .option-list small, .text-stack > small, .login small, .library-pref-row small,
  .library-pref-toggle small) { font-size: var(--admin-text-detail); line-height: 1.55; }
#admin-shell :is(.pill, .tag-row span, .badge-state, .network-tag, .journal-nav-badge,
  .eyebrow, th, .admin-main footer, .library-drawer-footer > span) {
  font-size: var(--admin-text-micro);
}
/* The same resource components occur in the overview AND its side drawers. */
#admin-shell :is(.overview-resource > div, .overview-resource strong,
  .overview-definition, .overview-definition dt, .overview-definition dd,
  .overview-conversions, .overview-conversions .text-stack small,
  .overview-disk > div:first-child, .resource-measure > span,
  .library-playback-examples > div, .overview-track, .overview-online-user,
  .journal-copy-file-name, .journal-identification-comparison) {
  font-size: var(--admin-text-body); line-height: 1.5;
}
#admin-shell :is(.overview-conversions > small, .overview-drawer .overview-small,
  .overview-drawer p, .overview-track small, .overview-track strong,
  .overview-reading-hero p, .overview-reading-state, .resource-caption,
  .resource-measure small, .overview-available) {
  font-size: var(--admin-text-detail); line-height: 1.55;
}
#admin-shell .overview-resource > div { flex-wrap: wrap; gap: 4px 10px; }
#admin-shell .overview-resource > div > strong { margin-left: auto; }
#admin-shell .overview-definition > div { min-width: 0; }
#admin-shell .overview-definition dd { overflow-wrap: anywhere; }
#admin-shell .overview-drawer :is(.primary, .secondary, .quiet),
#admin-shell .library-drawer :is(.primary, .secondary, .quiet),
#admin-shell .journal-copy-dialog :is(.primary, .secondary, .quiet) {
  font-size: var(--admin-text-body);
}
#admin-shell .library-drawer-footer { flex-wrap: wrap; }
#admin-shell .library-drawer-footer .actions { flex-wrap: wrap; margin-left: auto; }
#admin-shell .library-pref-tabs { overflow-x: auto; }
#admin-shell .library-pref-tabs > button { flex-shrink: 0; }
#admin-shell .library-folder-name small.network-tag { line-height: 1.4; }
#admin-shell .library-folder-name > small { line-height: 1.5; }
#admin-shell .library-folder-name > strong { line-height: 1.5; }
@media(max-width:700px) {
  /* Native form controls stay readable and avoid automatic focus zoom. */
  #admin-shell :is(input:not([type=checkbox]):not([type=radio]), select, textarea) { font-size: var(--admin-text-intro); }
  #admin-shell :is(.library-pref-row, .library-config-folder) { min-width: 0; }
  #admin-shell .overview-drawer > footer { flex-wrap: wrap; }
}

/* A close control is an icon, not a text button. Its geometry must not inherit
   the body font scale. Covers static dialogs and all dynamically built drawers. */
#admin-shell dialog button[aria-label="Fermer"]:is(.icon, .overview-close) {
  position: relative;
  display: inline-grid;
  place-items: center;
  flex: 0 0 40px;
  width: 40px;
  min-width: 40px;
  height: 40px;
  min-height: 40px;
  margin: 0;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: #bdd2e5;
  font-size: 0;
  line-height: 1;
  box-shadow: none;
  transform: none;
}
#admin-shell dialog button[aria-label="Fermer"]:is(.icon, .overview-close)::before,
#admin-shell dialog button[aria-label="Fermer"]:is(.icon, .overview-close)::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 26px;
  height: 2px;
  background: currentColor;
  border-radius: 1px;
  pointer-events: none;
  transform: translate(-50%, -50%) rotate(45deg);
}
#admin-shell dialog button[aria-label="Fermer"]:is(.icon, .overview-close)::after {
  transform: translate(-50%, -50%) rotate(-45deg);
}
#admin-shell dialog button[aria-label="Fermer"]:is(.icon, .overview-close):hover {
  background: #173044;
  border-color: #2d4b61;
  color: #f1f6fa;
}
#admin-shell dialog button[aria-label="Fermer"]:is(.icon, .overview-close):focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 2px;
}
@media(max-width:700px) {
  #admin-shell dialog button[aria-label="Fermer"]:is(.icon, .overview-close) {
    flex-basis: 44px;
    width: 44px;
    min-width: 44px;
    height: 44px;
    min-height: 44px;
  }
}

/* Desktop text at browser 100% follows the proportions Julien preferred at 90%.
   Keep the layout, icons, tap targets, and mobile form sizes independent. */
@media (min-width: 701px) {
  #admin-shell {
    --admin-font-increment: -1px;
    --admin-page-title: 32px;
    --admin-section-title: 19px;
    --admin-text-micro: 12px;
    --admin-text-detail: 13px;
    --admin-text-body: 14px;
    --admin-text-lead: 14.5px;
    --admin-text-intro: 15px;
    font-size: 15px;
  }
  #admin-shell dialog {
    --admin-text-micro: 13.5px;
    --admin-text-detail: 14.5px;
    --admin-text-body: 15.5px;
    --admin-text-lead: 16px;
    --admin-text-intro: 17px;
  }
  #admin-shell .sidebar .brand > span { font-size: 18px; }
  #admin-shell .login h1 { font-size: 44px; }
  #admin-shell .login-card .brand > span { font-size: 21px; }
  #admin-shell .view .section-title h2,
  #admin-shell .setting-section h2,
  #admin-shell #overview .section-title h2 { font-size: 19px; }
  #admin-shell .reading-top h3,
  #admin-shell .disk-top h2,
  #admin-shell #activity .activity-empty-title,
  #admin-shell #activity .activity-reading-copy h3,
  #admin-shell #libraries .collection-card-heading h3 { font-size: 18px; }
  #admin-shell .maintenance-page h2 { font-size: 16px; }
  #admin-shell #libraries .library-name h2,
  #admin-shell #libraries .collection-panel .library-name h2 { font-size: 28px; }
  #admin-shell #libraries .collection-detail-heading h1,
  #admin-shell #collections .collection-detail-heading h1 { font-size: 32px; }
  #admin-shell #collections .saga-page-heading h1 { font-size: 27px; }
  #admin-shell #collections .saga-films-heading h2 { font-size: 21px; }
  #admin-shell #collections .collection-page-card-copy strong { font-size: 18px; }
  #admin-shell #backups .backup-card h2 { font-size: 20px; }
  #admin-shell #backups .backup-destination h2 { font-size: 18px; }
  #admin-shell .overview-stats strong { font-size: 28px; }
  #admin-shell .inline-stats strong { font-size: 27px; }
  #admin-shell .overview-reading-heading h3 { font-size: 16px; }
  #admin-shell .overview-drawer > header h2 { font-size: 24px; }
  #admin-shell .overview-reading-hero h3 { font-size: 19px; }
  #admin-shell .overview-confirm h2 { font-size: 21px; }
  #admin-shell .journal-options-dialog h2,
  #admin-shell .journal-copy-dialog .dialog-title h2 { font-size: 21px; }
  #admin-shell .journal-item-heading h3,
  #admin-shell .journal-check-heading h2 { font-size: 19px; }
  #admin-shell #journals #journal-scans > h2,
  #admin-shell #journals #journal-playback > h2 { font-size: 17px; }
  #admin-shell .journal-detail-drawer .dialog-title h2 { font-size: 23px; }
  #admin-shell .identification-layout .dialog-title h2,
  #admin-shell .library-drawer-header .dialog-title h2 { font-size: 24px; }
  #admin-shell .drawer .dialog-title h2,
  #admin-shell .dialog-title h2,
  #admin-shell #library-preferences-dialog h2 { font-size: 22px; }
  #admin-shell .library-drawer h3 { font-size: 19px; }
  #admin-shell .overview-drawer h3 { font-size: 15.5px; }
  #admin-shell .identification-card h3 { font-size: 21px; }
  #admin-shell #identify-dialog .identification-choice-state { font-size: 13.5px; }
  #admin-shell .collection-drawer .collection-editor-heading p { font-size: 12px; }
  #admin-shell .automatic-network-heading h2 { font-size: 21px; }
  #admin-shell .automatic-network-options h3 { font-size: 17px; }
  #admin-shell #machines .power-card-heading h2 { font-size: 21px; }
  #admin-shell #users .user-directory-name { font-size: 19px; }
  #admin-shell #users-manager-dialog .user-directory-dialog-header h2 { font-size: 22px; }
  #admin-shell #users-manager-dialog .profile-heading h1 { font-size: 25px; }
  #admin-shell #activity .activity-resource-copy strong { font-size: 27px; }
  #admin-shell #settings .settings-content > .view > .page-heading h1 { font-size: 25px; }
  #admin-shell .maintenance-page th,
  #admin-shell .maintenance-page .intro-track-labels { font-size: 12px; }
  #admin-shell #collections .saga-editor { font-size: 14px; }
  #admin-shell #collections .saga-page-heading p,
  #admin-shell #collections .saga-fields :is(label, input, textarea),
  #admin-shell #collections .saga-empty { font-size: 14px; }
  #admin-shell #collections .saga-editor button,
  #admin-shell #collections .saga-films-heading p,
  #admin-shell #collections .saga-film-top { font-size: 13.5px; }
  #admin-shell #collections .saga-cover-choices h3,
  #admin-shell #collections .saga-film-copy h3 { font-size: 15px; }
  #admin-shell #collections .saga-cover-choices small,
  #admin-shell #collections .saga-film-copy p,
  #admin-shell #collections .saga-film-copy .badge-state,
  #admin-shell #collections .saga-file-item > span:last-child,
  #admin-shell #collections .saga-film-menu button { font-size: 12.5px; }
  body#admin-shell dialog.saga-modal { font-size: 15px; }
  body#admin-shell dialog.saga-modal h2 { font-size: 21px; }
  body#admin-shell dialog.saga-modal :is(button, input, select, p) { font-size: 14px; }
}
@media (min-width: 701px) and (max-width: 1250px) {
  #admin-shell #libraries .library-name h2,
  #admin-shell #libraries .collection-panel .library-name h2 { font-size: 27px; }
  #admin-shell .overview-stats strong { font-size: 24px; }
}
@media (min-width: 701px) and (max-width: 1000px) {
  #admin-shell #libraries .library-name h2,
  #admin-shell #libraries .collection-panel .library-name h2 { font-size: 24px; }
  #admin-shell { --admin-page-title: 29px; }
}
