/*
 * Typography normalization
 * Loaded after feature styles so text is readable without changing icons,
 * previews or the application-wide layout scale.
 */
:root {
  --ui-text-caption: 11px;
  --ui-text-label: 12px;
  --ui-text-control: 13px;
  --ui-text-body: 13px;
  --ui-line-compact: 1.4;
  --ui-line-body: 1.55;
}

/* Script workspace ------------------------------------------------------- */
.script-page-v2 .sw-step span,
.script-page-v2 .sw-hero-copy > span,
.script-page-v2 .sw-format-state small,
.script-page-v2 .sw-format-state span,
.script-page-v2 .sw-format-box .format-selector-header small,
.script-page-v2 .sw-editor-head > div > span,
.script-page-v2 .sw-editor-footer span,
.script-page-v2 .sw-editor-footer > small,
.script-page-v2 .sw-create-bar small,
.script-page-v2 .sw-settings-head small,
.script-page-v2 .sw-ready-dot,
.script-page-v2 .sw-group > summary small,
.script-page-v2 .sw-file > label small {
  font-size: var(--ui-text-caption);
  line-height: var(--ui-line-compact);
}

.script-page-v2 .sw-hero-copy p,
.script-page-v2 .sw-format-state b,
.script-page-v2 .sw-format-box .format-selector-header b,
.script-page-v2 .sw-switch,
.script-page-v2 .sw-create-bar b,
.script-page-v2 .sw-settings-head b,
.script-page-v2 .sw-group > summary b,
.script-page-v2 .sw-group .field > label,
.script-page-v2 .sw-file > label span {
  font-size: var(--ui-text-label);
  line-height: var(--ui-line-compact);
}

.script-page-v2 .sw-format-box .premium-select,
.script-page-v2 .sw-group .field input:not([type="file"]),
.script-page-v2 .sw-group .field select,
.script-page-v2 .sw-segment span,
.script-page-v2 .sw-file input[type="file"],
.script-page-v2 .sw-file input[type="file"]::file-selector-button,
.script-page-v2 .sw-create-bar button {
  font-size: var(--ui-text-control);
}

.script-page-v2 .sw-group .field input:not([type="file"]),
.script-page-v2 .sw-group .field select {
  min-height: 40px;
}

.script-page-v2 .sw-editor-footer span {
  min-height: 28px;
  padding: 5px 9px;
}

/* Prompt catalog -------------------------------------------------------- */
#promptCatalogMount .pc-head span,
#promptCatalogMount .pc-stats small,
#promptCatalogMount .pc-format-title > span,
#promptCatalogMount .pc-format-count small,
#promptCatalogMount .pc-format-body header span,
#promptCatalogMount .pc-format footer > span {
  font-size: var(--ui-text-caption);
  line-height: var(--ui-line-compact);
}

#promptCatalogMount .pc-head p,
#promptCatalogMount .pc-note,
#promptCatalogMount .pc-format-title p,
#promptCatalogMount .pc-format-body header b,
#promptCatalogMount .pc-format-body li p,
#promptCatalogMount .pc-feature {
  font-size: var(--ui-text-label);
  line-height: var(--ui-line-body);
}

#promptCatalogMount .pc-head button,
#promptCatalogMount .pc-format footer button {
  min-height: 38px;
  font-size: var(--ui-text-control);
}

#promptCatalogMount .pc-format-title h4 {
  font-size: 14px;
  line-height: var(--ui-line-compact);
}

#promptCatalogMount .pc-format-title p {
  padding-top: 1px;
}

#promptCatalogMount .pc-feature {
  min-height: 30px;
  padding: 6px 9px;
}

/* Upload-Post: channel content, interactions and analytics -------------- */
#channel-content .upc-eyebrow,
#channel-content .upc-overview small,
#channel-content .upc-overview aside,
#channel-content .upc-preview > span,
#channel-content .upc-copy header span,
#channel-content .upc-copy time,
#channel-content .upc-copy > small,
#channel-content .upc-modal-head span,
#channel-content .upc-modal-head p,
#channel-content .upc-modal-title > span,
#channel-content .upc-modal-meta,
#channel-content .upc-score small,
#channel-content .upc-score span,
#channel-content .upc-metric-heading small,
#channel-content .upc-metrics small,
#channel-content .upc-metrics article span,
#channel-content .upc-api-note,
#channel-content .upc-modal-loading span,
#channel-content .upc-modal-error span,
#channel-content .upc-modal-empty span {
  font-size: var(--ui-text-caption);
  line-height: var(--ui-line-compact);
}

#channel-content .upc-toolbar label span,
#channel-content .upc-status,
#channel-content .upc-overview b,
#channel-content .upc-copy h3,
#channel-content .upc-empty span,
#channel-content .upc-caption-card summary span,
#channel-content .upc-caption-card summary p,
#channel-content .upc-metric-heading b,
#channel-content .upc-modal-error p {
  font-size: var(--ui-text-label);
  line-height: var(--ui-line-body);
}

#channel-content button,
#channel-content select,
#channel-content input,
#channel-content .upc-copy footer a,
#channel-content .upc-copy footer button,
#channel-content .upc-metric-heading a {
  font-size: var(--ui-text-control);
}

#channel-content .upc-toolbar select,
#channel-content .upc-search,
#channel-content .upc-copy footer a,
#channel-content .upc-copy footer button {
  min-height: 40px;
}

#customer-interactions .upi-eyebrow,
#customer-interactions .upi-panel-head small,
#customer-interactions .upi-media-copy small,
#customer-interactions .upi-post-header span,
#customer-interactions .upi-post-header p,
#customer-interactions .upi-comment-body time,
#customer-interactions .upi-composer small,
#customer-interactions .upi-empty span {
  font-size: var(--ui-text-caption);
  line-height: var(--ui-line-compact);
}

#customer-interactions .upi-toolbar label span,
#customer-interactions .upi-scope,
#customer-interactions .upi-status,
#customer-interactions .upi-media-copy b,
#customer-interactions .upi-comment-body header b,
#customer-interactions .upi-comment-body > p,
#customer-interactions .upi-empty b,
#customer-interactions .upi-loading {
  font-size: var(--ui-text-label);
  line-height: var(--ui-line-body);
}

#customer-interactions button,
#customer-interactions select,
#customer-interactions input,
#customer-interactions textarea,
#customer-interactions .upi-post-header a {
  font-size: var(--ui-text-control);
}

#customer-interactions select,
#customer-interactions input,
#customer-interactions button {
  min-height: 36px;
}

#analytics .upa-eyebrow,
#analytics .upa-card-head p,
#analytics .upa-section-title p,
#analytics .upa-legend-note,
#analytics .upa-platform-card small,
#analytics .upa-kpis small {
  font-size: var(--ui-text-caption);
  line-height: var(--ui-line-compact);
}

#analytics .upa-toolbar label span,
#analytics .upa-status,
#analytics .upa-kpis span,
#analytics .upa-chart-empty,
#analytics .upa-summary span,
#analytics .upa-platform-card > div span,
#analytics .upa-platform-card > div b {
  font-size: var(--ui-text-label);
  line-height: var(--ui-line-body);
}

#analytics button,
#analytics select,
#analytics input {
  font-size: var(--ui-text-control);
  min-height: 36px;
}

/* Upload publisher ------------------------------------------------------ */
#uploadPostModal small,
#uploadPostModal .upp-drop span,
#uploadPostModal .upp-head small,
#uploadPostModal .upp-grid small,
#uploadPostModal .upp-grid label,
#uploadPostModal .upp-note {
  font-size: var(--ui-text-caption) !important;
  line-height: var(--ui-line-compact);
}

#uploadPostModal label,
#uploadPostModal .upp-drop b,
#uploadPostModal .upp-head b,
#uploadPostModal .upp-grid p,
#uploadPostModal .upp-settings label,
#uploadPostModal #upContentTypeSwitch button > span {
  font-size: var(--ui-text-label) !important;
  line-height: var(--ui-line-compact);
}

#uploadPostModal button,
#uploadPostModal input,
#uploadPostModal textarea,
#uploadPostModal select,
#uploadPostModal .upp-drop button,
#uploadPostModal .upp-head button,
#uploadPostModal .upp-settings select {
  font-size: var(--ui-text-control) !important;
}

#uploadPostModal input:not([type="checkbox"]):not([type="radio"]),
#uploadPostModal select,
#uploadPostModal button {
  min-height: 36px;
}

/* Updater --------------------------------------------------------------- */
.tool-update-card .tool-update-head > div > small,
.tool-update-card .tool-update-version,
.tool-update-card .tool-update-help {
  font-size: var(--ui-text-caption);
  line-height: var(--ui-line-compact);
}

.tool-update-card .tool-update-head p,
.tool-update-card .tool-update-status {
  font-size: var(--ui-text-label);
  line-height: var(--ui-line-body);
}

.tool-update-card .tool-update-actions button {
  min-height: 40px;
  font-size: var(--ui-text-control);
  line-height: 1.25;
  white-space: nowrap;
}

.tool-update-card .tool-update-actions {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.tool-update-card #installToolUpdateBtn {
  grid-column: 1 / -1;
}

@media (max-width: 520px) {
  .tool-update-card .tool-update-actions {
    grid-template-columns: 1fr;
  }

  .tool-update-card #installToolUpdateBtn {
    grid-column: auto;
  }
}

/* HyperFrames ----------------------------------------------------------- */
#hyperFramesModal .hf-heading-copy > small,
#hyperFramesModal .hf-source small,
#hyperFramesModal .hf-ready,
#hyperFramesModal .hf-section-title small,
#hyperFramesModal .hf-auto-badge,
#hyperFramesModal .hf-options label > span:nth-child(2) small,
#hyperFramesModal .hf-success small,
#hyperFramesModal .hf-success-badge,
#hyperFramesModal .hf-progress small,
#hyperFramesModal .hf-action-hint,
#hyperFramesModal .hf-card-report {
  font-size: var(--ui-text-caption);
  line-height: var(--ui-line-compact);
}

#hyperFramesModal .hf-header p,
#hyperFramesModal .hf-section-title strong,
#hyperFramesModal .hf-grid label,
#hyperFramesModal .hf-options label > span:nth-child(2),
#hyperFramesModal .hf-note,
#hyperFramesModal .hf-note strong {
  font-size: var(--ui-text-label);
  line-height: var(--ui-line-body);
}

#hyperFramesModal button,
#hyperFramesModal input,
#hyperFramesModal textarea,
#hyperFramesModal select {
  font-size: var(--ui-text-control);
}

#hyperFramesModal input:not([type="checkbox"]),
#hyperFramesModal textarea,
#hyperFramesModal select,
#hyperFramesModal button {
  min-height: 40px;
}

/* Scene manager and timeline ------------------------------------------- */
#scenes .scene-image-map small,
#scenes .scene-image-empty,
#scenes .master-face-lock small {
  font-size: var(--ui-text-caption);
  line-height: var(--ui-line-compact);
}

#scenes .scene-image-map b,
#scenes .master-face-lock b,
#scenes .master-face-lock span,
#scenes .clip-order,
#scenes .clip b,
#scenes .opening-label {
  font-size: var(--ui-text-label);
  line-height: var(--ui-line-compact);
}

#scenes .scene-image-map select,
#scenes .clip-transition,
#scenes .clip-tools button {
  font-size: var(--ui-text-control);
}

#scenes .clip-tools button,
#scenes .clip-transition {
  min-height: 32px;
}

/* Keep compact layouts stable on narrower extension windows. */
@media (max-width: 820px) {
  :root {
    --ui-text-control: 12px;
    --ui-text-body: 12px;
  }

  #promptCatalogMount .pc-format-title h4 {
    font-size: 13px;
  }
}
