/*
 * FileRackRack core UI foundation
 * --------------------------------
 * Structural and reusable UI rules live here.
 * Themes should prefer overriding --frr-* tokens and theme-scoped classes,
 * rather than changing functional IDs or page markup.
 * Runtime UI colors use the canonical 18-color role tokens directly.
 */

:root {
  /* Safe baseline tokens are always available, including setup/login pages
   * that intentionally do not load an installed theme. */
  --frr-bg-fill:#ffffff;
  --frr-bg-text:#333333;
  --frr-panel-fill:#f7f7f7;
  --frr-panel-line:#aaaaaa;
  --frr-panel-text:#222222;
  --frr-support-text:#666666;
  --frr-button1-fill:#ffffff;
  --frr-button1-line:#aaaaaa;
  --frr-button1-text:#222222;
  --frr-button2-fill:#111111;
  --frr-button2-line:#111111;
  --frr-button2-text:#ffffff;
  --frr-input-bg:#ffffff;
  --frr-input-border:#aaaaaa;
  --frr-input-text:#222222;
  --frr-input-placeholder:var(--frr-support-text);
  --frr-border-focus:#3b82c4;
  --frr-input-focus:var(--frr-border-focus);
  --frr-focus-glow:none;
  --frr-focus-outline-width:3px;
  --frr-focus-outline-offset:2px;
  --frr-link:#0000ee;
  --frr-link-visited:#551a8b;
  /* Text-role weights. Custom color presets may switch each role 400/700. */
  --frr-weight-bg-text:400;
  --frr-weight-muted:400;
  --frr-weight-panel-text:400;
  --frr-weight-button1-text:400;
  --frr-weight-button2-text:700;
  --frr-weight-input-text:400;
  --frr-weight-link:400;
  --frr-weight-link-visited:400;
  /* Semantic defaults remain independent from the 18 color roles. */
  --frr-semantic-mix:10%;
  --frr-semantic-emphasis:70%;
  --frr-semantic-border-mix:70%;
  --fr-status-danger:#d64045;
  --fr-status-added:#f28c28;
  --fr-status-previous:#77c9e8;
  --fr-status-success:#2f9e6f;
  --fr-status-warning:#e0ad25;
  --fr-status-info:#3b82c4;
  --fr-status-inactive:#8a929f;
  --fr-status-quick-upload:#4f9cff;
  /* Edition identity is intentionally independent from Simple Color/Theme. */
  --fr-edition-pro-bg:#3f2b78;
  --fr-edition-pro-text:#e7c76b;
  --fr-system-text:var(--frr-bg-text);
  --frr-border-subtle:color-mix(in srgb,var(--frr-panel-line) 62%,transparent);
  --frr-border-default:var(--frr-panel-line);
  --frr-border-control:var(--frr-button1-line);
  --frr-border-strong:var(--frr-button2-line);
  --frr-border-width-default:1px;
  --frr-border-width-strong:2px;
  --frr-radius-sm:6px;
  --frr-radius-md:8px;
  --frr-radius-lg:12px;
  --frr-radius-panel:14px;
  --frr-shadow-panel:0 14px 36px rgba(0,0,0,.12);
  --frr-shadow-modal:0 18px 52px rgba(0,0,0,.24);
  --frr-control-height:44px;
  --frr-space-1:6px;
  --frr-space-2:10px;
  --frr-space-3:14px;
  --frr-space-4:18px;
  --frr-theme-component-schema:2;
}

/* Functional state helpers. Themes may style them, but must not change behavior. */

[hidden],.hidden {
  display:none!important;
}

.is-disabled {
  opacity:.62;
  cursor:not-allowed;
}

.is-loading {
  cursor:wait;
}

.frr-feedback-auto-hide {
  transition:opacity .28s ease,visibility .28s ease;
}

.frr-feedback-auto-hide.is-hiding {
  opacity:0!important;
  visibility:hidden;
  pointer-events:none;
}

/* Shared layout helpers. */

.frr-inline-controls {
  display:flex;
  align-items:center;
  gap:14px;
  flex-wrap:wrap;
}

.frr-check-inline {
  display:flex;
  align-items:center;
  gap:8px;
  margin:0;
}

.frr-check-inline>input[type=checkbox],.frr-check-inline>input[type=radio] {
  width:auto;
  margin:0;
}

.frr-control-compact {
  max-width:120px;
}

.frr-actions {
  display:flex;
  align-items:center;
  gap:10px;
  flex-wrap:wrap;
}

.frr-actions--center {
  justify-content:center;
}

.frr-text-break {
  overflow-wrap:anywhere;
}

.frr-list-spaced {
  padding-left:24px;
}

.frr-list-spaced>li {
  padding:6px 0;
  overflow-wrap:anywhere;
}

/* -------------------------------------------------------------------------
 * Canonical role presentation
 * -------------------------------------------------------------------------
 * Static components live here. Runtime/theme code only changes the tokens.
 */

html,
body {
  background:var(--frr-bg-fill)!important;
  color:var(--frr-bg-text)!important;
  font-weight:var(--frr-weight-bg-text);
}

html body :where(a:link) {
  color:var(--frr-link);
  font-weight:var(--frr-weight-link);
}

html body :where(a:visited) {
  color:var(--frr-link-visited);
  font-weight:var(--frr-weight-link-visited);
}

html body :is(.note,.small,.meta,.lead,.note-inline,.file-help,.brand-optional-note) {
  color:var(--frr-support-text)!important;
  font-weight:var(--frr-weight-muted);
}

html body :is(
  .box,.card,.parts,.settings-section,.value,.url,.comment,.share,.resetbox,
  .notify-box,.folder-info,.progressbox,.brand-preview,.important,code,
  .settings th,.allbox,.storage,.msg,.admin-memo,.large-upload-panel,
  .file-preview-box,.file-list-details,.filters-details,.emergency-dialog,
  .hist,.progress>div
) {
  background:var(--frr-panel-fill)!important;
  color:var(--frr-panel-text)!important;
  font-weight:var(--frr-weight-panel-text);
}

html body :is(form,.box,.card,.parts,.settings-section,.error,.value,.brand-preview-stage) {
  border-color:var(--frr-panel-line)!important;
}

html body .settings-section summary {
  background:var(--frr-panel-fill)!important;
  color:var(--frr-panel-text)!important;
}

html body :is(
  .dropzone,.share,.resetbox,.notify-box,.brand-preview,.value,.url,
  .file-preview-box,.file-list-details,.filters-details,.emergency-dialog
) {
  border-color:var(--frr-panel-line)!important;
}

/* Custom Color owns one shared structural border width. Internal separators and Focus remain independent. */
html body :is(
  .box,.card,.parts,.settings-section,.value,.brand-preview-stage,.dropzone,.share,.resetbox,
  .notify-box,.brand-preview,.file-preview-box,.file-list-details,.filters-details,.emergency-dialog,
  .frr-surface,.frr-surface-secondary,.settings-frame,.frr-dialog-panel,.upload-step,.picker-choice-panel,.large-upload-panel
) {
  border-width:var(--frr-border-width-default,1px)!important;
}

html body :is(
  .notify-box,.notify-box label,.notify-box .notify-title,.notify-box .notify-check span,
  .thumbnail-option,.thumbnail-option label,.ip-share-box,.ip-share-box label,
  .advanced-note,.advanced-note strong,.comment
) {
  color:var(--frr-panel-text)!important;
}

html body :is(
  .notify-box .note,.thumbnail-option .note,.ip-share-box .note,.advanced-note .note,
  .note-inline,.admin-memo .small,.recipient-comment .small,.internal-memo .small,
  .large-upload-mode-lead
) {
  color:var(--frr-support-text)!important;
  font-weight:var(--frr-weight-muted);
}

html body :is(
  .dropzone strong,.drop-summary,.urltext,.value,.comment,.badge,.important,code,
  .settings th,.settings td,.admin-memo .memo-text,.recipient-comment .memo-text,
  .internal-memo .memo-text,.large-upload-mode-title,.file-list-name,
  .filters-details summary,.emergency-dialog h2,.emergency-dialog p
) {
  color:var(--frr-panel-text)!important;
}

html body .frr-bg-text {
  color:var(--frr-bg-text)!important;
}

html body .part {
  border-bottom-color:var(--frr-panel-line)!important;
}

html body :is(.settings th,.settings td) {
  border-color:var(--frr-panel-line)!important;
}

/* Role-based form surfaces. Login/setup pages receive these from baseline tokens too. */

.frr-form-control,
input:not([type=checkbox]):not([type=radio]):not([type=file]):not([type=color]):not([type=submit]):not([type=button]):not([type=reset]):not([type=range]):not([type=image]):not([type=hidden]),
textarea,
select {
  box-sizing:border-box;
  border:var(--frr-border-width-default) solid var(--frr-input-border)!important;
  border-radius:var(--frr-radius-md);
  background:var(--frr-input-bg)!important;
  background-clip:padding-box!important;
  color:var(--frr-input-text)!important;
  font-weight:var(--frr-weight-input-text);
}

input::placeholder,
textarea::placeholder {
  color:var(--frr-input-placeholder)!important;
  opacity:.9;
}

.frr-surface,
.frr-surface-secondary {
  background:var(--frr-panel-fill);
  color:var(--frr-panel-text);
  border:var(--frr-border-width-default) solid var(--frr-panel-line);
}

/* Shared dialogs and status surfaces. */

html body .frr-dialog-panel,
html body :is(.frr-test-license-dialog,.frr-override-dialog) {
  background:var(--frr-panel-fill)!important;
  color:var(--frr-panel-text)!important;
  border:var(--frr-border-width-default,1px) solid var(--frr-panel-line)!important;
  border-radius:14px!important;
  box-shadow:0 18px 52px rgba(0,0,0,.28)!important;
}

html body :is(.frr-dialog-title,.frr-dialog-message,.frr-test-license-dialog strong,.frr-override-dialog strong,.frr-test-license-dialog div,.frr-override-dialog div) {
  color:var(--frr-panel-text)!important;
}

html body .frr-dialog-overlay,
html body :is(.frr-test-license-modal,.frr-override-modal) {
  background:rgba(0,0,0,.46)!important;
}

html body .frr-test-license-modal[hidden],
html body .frr-override-modal[hidden] {
  display:none!important;
}

html body :is(.frr-test-license-modal,.frr-override-modal) {
  position:fixed!important;
  inset:0!important;
  z-index:16000!important;
  display:flex!important;
  align-items:center!important;
  justify-content:center!important;
  padding:20px!important;
}

html body :is(.frr-test-license-dialog,.frr-override-dialog) {
  width:min(520px,calc(100vw - 40px))!important;
  padding:22px!important;
}

html body .frr-test-license-actions {
  display:flex!important;
  justify-content:center!important;
  gap:10px!important;
  margin-top:18px!important;
}

html body .frr-test-license-actions form {
  margin:0!important;
  padding:0!important;
  border:0!important;
}

html body :is(.action-feedback,.frr-feedback) {
  position:fixed!important;
  left:50%!important;
  top:50%!important;
  transform:translate(-50%,-50%)!important;
  z-index:12000!important;
  width:min(680px,calc(100vw - 88px))!important;
  box-sizing:border-box!important;
  padding:18px 20px!important;
  margin:0!important;
  text-align:center!important;
  border:1px solid var(--frr-panel-line)!important;
  border-radius:14px!important;
  background:var(--frr-panel-fill)!important;
  color:var(--frr-panel-text)!important;
  box-shadow:0 0 0 100vmax rgba(12,18,28,.28),0 18px 52px rgba(0,0,0,.24)!important;
}

html body .frr-status-page {
  min-height:100vh!important;
  box-sizing:border-box!important;
  margin:0!important;
  padding:42px 20px!important;
  display:flex!important;
  align-items:center!important;
  justify-content:center!important;
  background:var(--frr-bg-fill)!important;
  color:var(--frr-bg-text)!important;
}

html body .frr-status-stack {
  width:min(680px,100%)!important;
  text-align:center!important;
}

html body :is(.frr-status-box,.pausebox,.accessbox) {
  box-sizing:border-box!important;
  width:100%!important;
  margin:0 auto!important;
  padding:24px 26px!important;
  border:1px solid var(--frr-panel-line)!important;
  border-radius:14px!important;
  background:var(--frr-panel-fill)!important;
  color:var(--frr-panel-text)!important;
  box-shadow:0 14px 36px rgba(0,0,0,.12)!important;
  text-align:center!important;
}

html body .frr-value-chip,
html body :is(.frr-log-controls a,.frr-log-pager a,.frr-log-pager span),
html body .frr-log-summary-box {
  background:var(--frr-panel-fill)!important;
  color:var(--frr-panel-text)!important;
  border-color:var(--frr-panel-line)!important;
}

html body :is(.frr-log-controls a.active,.frr-log-pager .current) {
  background:var(--frr-button2-fill)!important;
  color:var(--frr-button2-text)!important;
  border-color:var(--frr-button2-line)!important;
  font-weight:var(--frr-weight-button2-text);
}

/* License/edition identity is a separate visual category. */

html body .frr-edition-badge {
  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;
  align-self:center!important;
  margin-left:10px!important;
  padding:2px 8px!important;
  border-radius:999px!important;
  font-size:.72em!important;
  font-weight:700!important;
  line-height:1.45!important;
  vertical-align:baseline!important;
  white-space:nowrap!important;
  flex:0 0 auto!important;
}

html body .frr-edition-pro {
  background:var(--fr-edition-pro-bg)!important;
  color:var(--fr-edition-pro-text)!important;
  border:1px solid color-mix(in srgb,var(--fr-edition-pro-text) 58%,transparent)!important;
}

html body .app-version-mark,
html body .frr-system-info {
  color:var(--fr-system-text,var(--frr-bg-text))!important;
  opacity:.82!important;
  text-shadow:0 1px 2px rgba(127,127,127,.35)!important;
}

html body .frr-license-core-info {
  color:var(--frr-panel-text)!important;
  background:var(--frr-panel-fill)!important;
  border-color:var(--frr-panel-line)!important;
}

html body .frr-license-core-info :is(strong,span:not(.frr-edition-badge)) {
  color:var(--frr-panel-text)!important;
}

html body .frr-license-core-info .note {
  color:var(--frr-support-text)!important;
}

/* Rescue UI intentionally ignores user colors. */

html body :is(.color-rescue,.color-reset-rescue,.brand-confirm-wrap) {
  background:#fff!important;
  color:#111!important;
  border-color:#111!important;
}

html body :is(.color-rescue *,.color-reset-rescue *,.brand-confirm-wrap h2,.brand-confirm-wrap p,.brand-confirm-wrap strong) {
  color:#111!important;
}

html body :is(.color-rescue .restore-saved,.brand-confirm-actions .commit) {
  background:#111!important;
  color:#fff!important;
  border-color:#111!important;
}

html body :is(.color-rescue .reset-default,.color-reset-rescue button,.brand-confirm-actions .cancel) {
  background:#fff!important;
  color:#111!important;
  border-color:#111!important;
}

/* Shared management upload/replacement components. */

.management-drop-zone {
  border:2px dashed var(--frr-panel-line);
  border-radius:var(--frr-radius-md);
  padding:12px 16px;
  text-align:center;
  font-size:.9rem;
  color:var(--frr-panel-text);
  background:var(--frr-panel-fill);
  min-width:160px;
}

.management-drop-zone.dragover {
  border-color:var(--frr-button2-fill);
  background:var(--frr-panel-fill);
}

.replacement-preview {
  margin-top:6px;
  font-weight:600;
  color:var(--frr-panel-text);
  overflow-wrap:anywhere;
}

.old-file-meta {
  overflow-wrap:anywhere;
}

.replacement-controls {
  display:flex;
  flex-direction:column;
  gap:10px;
  max-width:320px;
}

.replacement-controls input {
  max-width:100%;
}

.batch-actions {
  margin-top:16px;
}

.share-files-status {
  white-space:pre-wrap;
  overflow-wrap:anywhere;
  margin-top:12px;
}

.frr-file-list {
  padding-left:24px;
}

.frr-file-list li {
  padding:6px 0;
  overflow-wrap:anywhere;
}

.frr-file-list li button {
  margin-left:12px;
  font-size:.85em;
}

/* Version mark is structural UI, not a theme asset. */

.app-version-mark {
  position:fixed;
  right:14px;
  bottom:10px;
  z-index:9998;
  font-size:11px;
  opacity:.58;
  color:var(--frr-support-text);
  pointer-events:none;
  white-space:nowrap;
}

/* Details disclosure contract: functional +/- groups and informational triangles
 * intentionally remain different component types. */

.frr-disclosure-functional>summary {
  cursor:pointer;
}

.frr-disclosure-info>summary {
  cursor:pointer;
}

/* JS hooks are data-frr-role attributes. They intentionally have no visual style. */

.quick-upload-setting-line {
  margin-top:10px;
  gap:22px;
}

.settings-frame--spaced {
  margin-top:14px;
}

.frr-file-row {
  padding:6px 0;
  border-top:1px solid var(--frr-panel-line);
}

/* -------------------------------------------------------------------------
 * Responsive UI foundation (v1.06)
 * -------------------------------------------------------------------------
 * FRR is PC-first, but not PC-only. These are Core-owned layout contracts.
 * Themes may change presentation tokens, but must not change feature
 * availability or make these structures impossible to reflow.
 *
 * UI modes are viewport-based:
 *   mobile : 0–767px
 *   tablet : 768–1199px
 *   pc     : 1200px+
 */

/* Prevent flex/grid children from forcing desktop-width overflow. */

.frr-responsive-item,
.frr-responsive-row>* ,
.frr-responsive-grid>* {
  min-width:0;
}

.frr-responsive-row {
  display:flex;
  align-items:center;
  gap:var(--frr-space-3);
  flex-wrap:wrap;
}

.frr-responsive-grid {
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:var(--frr-space-3);
}

.frr-responsive-stack {
  display:flex;
  flex-direction:column;
  gap:var(--frr-space-3);
}

.frr-responsive-scroll-x {
  max-width:100%;
  overflow-x:auto;
  -webkit-overflow-scrolling:touch;
}

.frr-responsive-scroll-x>table {
  min-width:max-content;
}

.frr-responsive-media {
  max-width:100%;
  height:auto;
}

.frr-responsive-dialog {
  width:min(92vw,760px);
  max-height:min(88vh,900px);
  overflow:auto;
}

.frr-responsive-actions {
  display:flex;
  align-items:center;
  gap:10px;
  flex-wrap:wrap;
}

/* Future feature-mode hooks. Hidden unless the active Core mode matches. */

.frr-only-mobile,.frr-only-tablet,.frr-only-pc {
  display:none!important;
}

html[data-frr-ui-mode="mobile"] .frr-only-mobile {
  display:revert!important;
}

html[data-frr-ui-mode="tablet"] .frr-only-tablet {
  display:revert!important;
}

html[data-frr-ui-mode="pc"] .frr-only-pc {
  display:revert!important;
}

html[data-frr-ui-mode="mobile"] .frr-hide-mobile,
html[data-frr-ui-mode="tablet"] .frr-hide-tablet,
html[data-frr-ui-mode="pc"] .frr-hide-pc {
  display:none!important;
}

/* Mode indicator is ready for the later feature-limited modes, but is not
 * emitted globally until those modes become product behavior. */

.frr-ui-mode-indicator {
  position:fixed;
  left:12px;
  bottom:10px;
  z-index:9997;
  min-height:32px;
  padding:5px 10px;
  border:1px solid var(--frr-panel-line);
  border-radius:999px;
  background:var(--frr-panel-fill);
  color:var(--frr-panel-text);
  font:inherit;
  font-size:12px;
  line-height:1.2;
  cursor:pointer;
  box-shadow:0 4px 14px rgba(0,0,0,.12);
}

html[data-frr-ui-mode="pc"] .frr-ui-mode-indicator {
  display:none!important;
}

/* Tablet: preserve nearly full operation, but allow dense desktop structures
 * to reflow without changing their semantic order. */

@media (min-width:768px) and (max-width:1199px){
  .frr-tablet-stack {
    flex-direction:column;
    align-items:stretch!important;
  }

  .frr-responsive-grid {
    grid-template-columns:repeat(2,minmax(0,1fr));
  }

  .frr-responsive-actions {
    row-gap:10px;
  }

  .frr-tablet-full {
    width:100%!important;
    max-width:none!important;
  }
}

/* Mobile: future day-to-day operation UI can opt into these contracts. */

@media (max-width:767px){
  .frr-responsive-row,
  .frr-mobile-stack {
    flex-direction:column;
    align-items:stretch!important;
  }

  .frr-responsive-grid {
    grid-template-columns:minmax(0,1fr);
  }

  .frr-responsive-actions {
    align-items:stretch;
  }

  .frr-responsive-actions>* {
    max-width:100%;
  }

  .frr-mobile-full {
    width:100%!important;
    max-width:none!important;
  }

  .frr-responsive-dialog {
    width:calc(100vw - 24px);
    max-height:calc(100vh - 24px);
  }

  .frr-file-list {
    padding-left:18px;
  }

  .frr-file-list li button {
    margin-left:0;
    margin-top:6px;
  }

  .app-version-mark {
    right:8px;
    bottom:7px;
    font-size:10px;
  }
}

/* Shared file and progress presentation used by real pages and preview. */

.file-change-badge {
  margin-left:7px;
  vertical-align:middle;
}

.downloaded-check {
  display:none;
  margin-left:7px;
  font-size:.82em;
}

.download-track-row.is-downloaded .downloaded-check {
  display:inline;
}

.download-track-row.is-downloaded {
  opacity:.76;
}

.download-track-row.is-downloaded .file-change-badge {
  opacity:.72;
}

.progressbar {
  height:18px;
  border-radius:999px;
  border:1px solid var(--frr-panel-line);
  background:var(--frr-panel-fill);
  overflow:hidden;
}

.progressbar>span {
  display:block;
  height:100%;
  min-height:18px;
  background:var(--frr-button2-fill);
}

.frr-table-scroll {
  max-width:100%;
  overflow-x:auto;
}

/* v1.30: message consistency */

.frr-notice-box,.frr-message-text,.frr-feedback,.action-feedback,.flash.msg,.flash.error {
  box-sizing:border-box;
  text-align:center;
  font-size:1rem;
  line-height:1.6;
  font-weight:600;
}

.frr-notice-box p,.frr-message-text p,.frr-feedback p,.action-feedback p {
  text-align:center;
}

.frr-notice-box .small,.frr-message-text .small,.frr-feedback .small,.action-feedback .small {
  font-size:.92em;
  font-weight:500;
}

/* v1.37 Shared FRR confirmation / alert dialog */

.frr-dialog-overlay {
  position:fixed;
  inset:0;
  z-index:18000;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:20px;
  background:rgba(0,0,0,.46);
  box-sizing:border-box;
}

.frr-dialog-overlay[hidden] {
  display:none!important;
}

.frr-dialog-panel {
  width:min(520px,calc(100vw - 40px));
  max-height:calc(100vh - 40px);
  overflow:auto;
  box-sizing:border-box;
  padding:22px;
  border:1px solid var(--frr-panel-line);
  border-radius:var(--frr-radius-panel);
  background:var(--frr-panel-fill);
  color:var(--frr-panel-text);
  box-shadow:var(--frr-shadow-modal);
}

.frr-dialog-title {
  margin:0 0 10px;
  font-size:1.08rem;
  font-weight:800;
  line-height:1.45;
  color:inherit;
  text-align:center;
}

.frr-dialog-message {
  margin:0;
  white-space:pre-wrap;
  overflow-wrap:anywhere;
  line-height:1.65;
  color:inherit;
  text-align:center;
}

.frr-dialog-actions {
  display:flex;
  align-items:center;
  justify-content:center;
  gap:10px;
  flex-wrap:wrap;
  margin-top:20px;
}

.frr-dialog-actions button {
  min-width:96px;
}

body.frr-dialog-open {
  overflow:hidden;
}

/* Reusable chips for IP / IDs / code-like values. */

.frr-value-chip {
  display:inline-flex;
  align-items:center;
  max-width:100%;
  padding:4px 8px;
  border:1px solid var(--frr-panel-line);
  border-radius:7px;
  background:var(--frr-panel-fill)!important;
  color:var(--frr-panel-text)!important;
  font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono",monospace;
  line-height:1.35;
  overflow-wrap:anywhere;
  word-break:break-word;
}

/* Shared log navigation controls: readable in normal state, including CRT themes. */

.frr-log-controls a,.frr-log-pager a,.frr-log-pager span {
  background:var(--frr-panel-fill)!important;
  color:var(--frr-panel-text)!important;
  border-color:var(--frr-panel-line)!important;
}

.frr-log-controls a.active,.frr-log-pager .current {
  background:var(--frr-button2-fill)!important;
  color:var(--frr-button2-text)!important;
  border-color:var(--frr-button2-fill)!important;
  font-weight:var(--frr-weight-button2-text);
}

.frr-log-pager .disabled {
  opacity:.5!important;
}

/* Access-log summary semantics. Zero-count cards stay neutral. */

.frr-log-summary-box {
  background:var(--frr-panel-fill)!important;
  color:var(--frr-panel-text)!important;
  border-color:var(--frr-panel-line)!important;
}

.frr-log-summary-box.is-warning-active {
  border-color:color-mix(in srgb,var(--fr-status-warning) var(--frr-semantic-emphasis),var(--frr-panel-line))!important;
}

.frr-log-summary-box.is-danger-active {
  border-color:color-mix(in srgb,var(--fr-status-danger) var(--frr-semantic-emphasis),var(--frr-panel-line))!important;
}

@media (max-width:600px){
  .frr-dialog-panel {
    width:calc(100vw - 24px);
    padding:18px;
  }

  .frr-dialog-actions {
    align-items:stretch;
  }

  .frr-dialog-actions button {
    width:100%;
  }
}

/* v1.39 shared horizontal row contracts */

.frr-inline-row,.frr-check-row,.frr-input-action-row,.frr-value-action-row {
  display:flex;
  align-items:center;
  gap:10px;
  flex-wrap:wrap;
  min-width:0;
}

.frr-inline-row>* ,.frr-check-row>* ,.frr-input-action-row>* ,.frr-value-action-row>* {
  margin-top:0;
  margin-bottom:0;
}

.frr-check-row>input[type=checkbox],.frr-check-row>input[type=radio] {
  flex:0 0 auto;
  margin:0;
}

.frr-input-action-row>input,.frr-value-action-row>.frr-value {
  flex:1 1 220px;
  min-width:0;
}

.frr-edition-badge {
  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;
  vertical-align:middle!important;
  line-height:1.2!important;
}

/* v1.49 grouped information/action layout contract.
   Keep semantic information together; allow action groups to wrap independently. */

.frr-info-action-row,.frr-section-heading-row {
  display:flex;
  align-items:center;
  gap:10px;
  flex-wrap:wrap;
  min-width:0;
}

.frr-section-heading-row {
  justify-content:space-between;
}

.frr-section-heading-row>h1,.frr-section-heading-row>h2,.frr-section-heading-row>h3,.frr-section-heading-row>h4 {
  margin-top:0;
  margin-bottom:0;
}

.frr-info-group {
  display:inline-flex;
  align-items:center;
  gap:6px;
  min-width:0;
}

.frr-info-group--nowrap {
  white-space:nowrap;
  flex-wrap:nowrap;
}

.frr-action-group {
  display:flex;
  align-items:center;
  gap:10px;
  flex-wrap:wrap;
  min-width:0;
  margin-left:auto;
}

.frr-action-group>* {
  margin-top:0;
  margin-bottom:0;
}

@media (max-width:600px){
  .frr-action-group {
    margin-left:0;
  }
}

/* v1.39 dialog text alignment contract */

.frr-dialog-message--detail,.frr-dialog-detail {
  text-align:left;
}

.frr-dialog-panel>strong:first-child {
  display:block;
  text-align:center;
  font-size:1.08rem;
  line-height:1.45;
  margin:0 0 10px;
}

/* v1.39 notification disclosure */

.frr-notify-category {
  margin:8px 0;
  border:0;
  border-radius:0;
  overflow:visible;
  background:transparent;
}

.frr-notify-category>summary {
  display:flex;
  align-items:center;
  gap:10px;
  cursor:pointer;
  padding:7px 0;
  font-weight:700;
  list-style:none;
  background:transparent;
}

.frr-notify-category>summary::-webkit-details-marker {
  display:none;
}

.frr-notify-category>summary::before {
  content:'▶';
  font-size:.78em;
  width:1.1em;
  flex:0 0 1.1em;
}

.frr-notify-category[open]>summary::before {
  content:'▼';
}

.frr-notify-parent {
  display:inline-flex;
  align-items:center;
  gap:8px;
  margin:0;
  cursor:pointer;
}

.frr-notify-parent input {
  margin:0;
}

.frr-notify-body {
  padding:0 0 8px 26px;
}

.frr-notify-body label {
  display:block;
  margin:8px 0;
}

.frr-notify-supplement {
  margin:10px 0 0 22px;
  padding:10px 12px;
  border-left:2px solid var(--frr-border-subtle);
}

/* Generic file thumbnail: #f5f5f5 document sheet with a genuinely transparent folded outer corner. */

.file-preview-generic {
  position:relative;
  isolation:isolate;
  background:transparent!important;
  color:var(--frr-fallback-color,#4b5563)!important;
}

.file-preview-generic::before {
  content:"";
  position:absolute;
  inset:10px 16px;
  border:4px solid currentColor;
  border-radius:8px;
  box-sizing:border-box;
  background:#f5f5f5;
  pointer-events:none;
}

.file-preview-generic::after {
  content:none;
}

.file-preview-generic span {
  position:relative;
  z-index:1;
  color:inherit;
  font-size:1rem;
  font-weight:800;
  letter-spacing:.02em;
  line-height:1;
  max-width:calc(100% - 28px);
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}

.file-list-row .file-preview-generic::before {
  inset:6px 10px;
  border-width:3px;
  border-radius:6px;
}

.file-list-row .file-preview-generic::after {
  content:none;
}

.file-list-row .file-preview-generic span {
  font-size:.72rem;
  max-width:calc(100% - 14px);
}

/* v1.50 theme-component extension boundary.
 * Core keeps CSS rendering as the universal fallback. Future Theme Editor
 * output may opt individual component families into image renderers without
 * changing page markup or product semantics. */

html body :is(.box,.card,.settings-frame,.settings-section,.notify-box,.preview-card,.filter-form,.share,.value,.url) {
  --frr-component-family:panel;
}

html body :is(.frr-dialog-panel,.frr-test-license-dialog,.frr-override-dialog) {
  --frr-component-family:dialog;
}

html body :is(input,textarea,select) {
  --frr-component-family:input;
}

html body :is(.frr-edition-badge,.frr-badge-info,.frr-badge-success,.frr-badge-warning,.frr-badge-danger,.frr-badge-inactive) {
  --frr-component-family:badge;
}

/* Shared independent-page layout. All standalone admin/support pages should use a Core page layout contract. */

.frr-standard-page-container {
  box-sizing:border-box;
  width:100%;
  margin:0 auto;
  padding:24px;
  border:1px solid var(--frr-border-default,var(--frr-panel-line));
  border-radius:14px;
  background:var(--frr-panel-fill);
  color:var(--frr-panel-text);
  box-shadow:0 10px 30px rgba(0,0,0,.08);
}

@media (max-width:640px){
  .frr-standard-page-container {
    padding:18px 14px;
    border-radius:11px;
  }
}
