/* Workstation typography. Keep the reference's clear, substantial headings
   without glow, outlined body copy, remote fonts, or changes to the CUP logo. */
html[data-cup-workstation] {
  --cup-workstation-font: Inter, "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
}

body .studio-main,
body .sidebar {
  --studio-ui-font: "Segoe UI", "PingFang SC", "Microsoft YaHei UI", "Microsoft YaHei", "Noto Sans SC", "Noto Sans CJK SC", sans-serif;
}
body .studio-main {
  font-family: var(--studio-ui-font);
  font-size: 15px;
  line-height: 1.65;
  font-kerning: normal;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
body .studio-main :is(button, input, select, textarea, summary),
body .sidebar :is(#main-nav, .nav-label, .new-project, .side-bottom) {
  font-family: var(--studio-ui-font);
}
body .studio-main :is(h1, h2, h3, label, button, input, select, textarea, p) {
  text-shadow: none;
}

/* A small, deliberate hierarchy: page title, panel heading, then field label. */
body .studio-main #page :is(.page-head h1, .cup-task-heading h1, .agent-chat-header h1) {
  font-size: 32px;
  font-weight: 700;
  line-height: 1.28;
  letter-spacing: -.025em;
  color: var(--text);
}
body .studio-main #page :is(.page-head p, .cup-task-heading p) {
  font-size: 15px;
  font-weight: 400;
  line-height: 1.7;
  letter-spacing: 0;
}
body .studio-main #page :is(.cup-image-workspace, .cup-video-workspace) > .settings-panel > .panel-top,
body .studio-main #page :is(.cup-records-heading h2, .cup-account-card h2, .user-settings-card h2, .config-box h2) {
  font-size: 21px;
  font-weight: 700;
  line-height: 1.4;
  letter-spacing: -.02em;
  color: var(--text);
}
/* Clear, solid headings: contrast, weight and spacing provide the depth.
   The theme owns their foreground, including the dark text in day mode. */
body .studio-main #page :is(.page-head h1, .cup-task-heading h1, .agent-chat-header h1, .cup-records-heading h2, .cup-account-card h2, .user-settings-card h2, .config-box h2),
body .studio-main #page :is(.cup-image-workspace, .cup-video-workspace) > .settings-panel > .panel-top > span {
  background: none;
  color: var(--text);
  -webkit-text-fill-color: currentColor;
  text-shadow: none;
}
body .studio-main #page :is(.cup-image-step-title, .cup-step-title, .field-label) {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.55;
  letter-spacing: 0;
}
body .studio-main #page :is(.cup-image-module-fields, .cup-image-module-field) .field-label {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
}
/* Old module labels can carry an inline 9px size. Override only those labels. */
body .studio-main #page .field-label[style*="font-size:9px"],
body .studio-main #page .field-label[style*="font-size: 9px"] {
  font-size: 14px !important;
  color: var(--text) !important;
}
body .studio-main #page :is(.cup-image-upload-title, .cup-upload-title) {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.5;
}
body .studio-main #page :is(.module-select, .module-option, .cup-channel-current strong, .cup-channel-option strong) {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.6;
}
body .studio-main #page :is(.cup-image-workspace, .cup-video-workspace) #prompt {
  font-size: 15px;
  font-weight: 400;
  line-height: 1.75;
  letter-spacing: 0;
}
body .studio-main #page :is(.cup-image-parameter-grid, .cup-parameter-grid) select {
  font-size: 14px;
  line-height: 1.5;
  font-variant-numeric: tabular-nums;
}
body .studio-main #page .primary {
  font-weight: 600;
  letter-spacing: .015em;
}
body .studio-main #page :is(.cup-image-workspace, .cup-video-workspace) .settings-foot .primary {
  font-size: 16px;
  font-weight: 700;
  line-height: 1.5;
}
body .studio-main #page .cup-record-filters button {
  font-size: 14px;
  font-weight: 500;
}
body .studio-main #page .cup-record-filters button[aria-pressed=true] { font-weight: 600; }
body .studio-main #page .cup-record-meta .cup-record-title {
  font-size: 16px;
  font-weight: 600;
  line-height: 1.5;
  letter-spacing: -.015em;
}
body .studio-main #page .cup-records-toolbar input { font-size: 14px; }
body .studio-main #page .cup-records-empty h3 { font-weight: 600; letter-spacing: -.02em; }

/* Keep secondary information readable without giving it headline weight. */
body .studio-main #page :is(
  .cup-image-step-side, .cup-step-side, .cup-image-upload-details, .cup-upload-details,
  .cup-image-inline, .cup-video-inline, .cup-channel-health, .cup-channel-availability,
  .cup-image-model-meta, .cup-video-model-meta, .cup-channel-current small,
  .cup-channel-option small, .cup-records-count, .cup-record-kind,
  .cup-record-details > small, .cup-record-meta .cup-record-cost, .cup-record-card-footer time
) {
  font-size: 12px;
  font-weight: 400;
  line-height: 1.6;
}
body .studio-main #page :is(.cup-image-prompt-tools, .cup-prompt-tools) .chip,
body .studio-main #page .cup-record-card .status-tag {
  font-size: 12px;
  font-weight: 500;
  line-height: 1.5;
}
body .studio-main #page :is(.cup-image-template, .cup-image-advanced) > summary {
  font-size: 14px;
  font-weight: 500;
  line-height: 1.6;
}
body .studio-main #page :is(.cup-image-cost, .cup-video-cost, .cup-record-cost) {
  font-variant-numeric: tabular-nums;
}
body .studio-main .breadcrumb { font-size: 14px; line-height: 1.5; }
html[data-cup-workstation] body .studio-main .topbar .breadcrumb strong {
  font-family: var(--cup-workstation-font);
  font-weight: 400;
}
body .studio-main .top-actions > .quiet { font-size: 13px; font-weight: 500; }

/* Rail width is owned by the layout layer. Larger labels retain its scroll area. */
body .sidebar #main-nav button {
  font-family: var(--studio-ui-font);
  font-size: 15px;
  font-weight: 400;
  line-height: 1.5;
  letter-spacing: 0;
}
html[data-cup-workstation] body .sidebar #main-nav > button[data-view] { min-height: 46px; }
body .sidebar #main-nav button.active { font-weight: 600; }
body .sidebar #main-nav button small { font-size: 12px; line-height: 1.4; }
body .sidebar .nav-label { font-size: 12px; font-weight: 500; line-height: 1.5; letter-spacing: .025em; }
body .sidebar .new-project { font-size: 14px; font-weight: 600; line-height: 1.5; }
body .sidebar .new-project kbd { font-size: 12px; line-height: 1.25; }
body .sidebar .connection { font-size: 13px; line-height: 1.5; }
body .sidebar .side-bottom > a { font-size: 13px; line-height: 1.5; }
body .sidebar .user { font-size: 14px; font-weight: 500; line-height: 1.5; }
body .sidebar :is(.connection small, .user small) { font-size: 12px; font-weight: 400; line-height: 1.5; }

@media (max-width: 760px) {
  body .studio-main #page :is(.page-head h1, .cup-task-heading h1, .agent-chat-header h1) {
    font-size: 28px;
    letter-spacing: -.02em;
  }
  body .studio-main #page :is(.cup-image-workspace, .cup-video-workspace) > .settings-panel > .panel-top,
  body .studio-main #page :is(.cup-records-heading h2, .cup-account-card h2, .user-settings-card h2, .config-box h2) {
    font-size: 20px;
  }
}
@media (forced-colors: active) {
  body .studio-main #page :is(.page-head h1, .cup-task-heading h1, .agent-chat-header h1, .cup-records-heading h2, .cup-account-card h2, .user-settings-card h2, .config-box h2),
  body .studio-main #page :is(.cup-image-workspace, .cup-video-workspace) > .settings-panel > .panel-top > span {
    background: none !important;
    color: CanvasText !important;
    -webkit-text-fill-color: currentColor !important;
    text-shadow: none !important;
  }
}
/* Keep navigation scrollable without drawing a scrollbar. */
html[data-cup-workstation] body .sidebar #main-nav {
  scrollbar-width: none;
}

html[data-cup-workstation] body .sidebar #main-nav::-webkit-scrollbar {
  display: none;
  width: 0;
}

/* An eligible account has no access notice. Leave actionable states visible. */
html[data-cup-workstation] body .studio-main #page :is(.cup-image-access, .cup-video-access):empty {
  display: none;
}

html[data-cup-workstation] body .studio-main #page :is(.cup-task-eyebrow, .cup-image-step-number, .cup-step-number) {
  display: none;
}

html[data-cup-workstation] body .studio-main #page:is([data-view=assets], [data-view=favorites], [data-view=settings]) .page-head:not(.cup-section-heading) > div > p:first-of-type,
html[data-cup-workstation] body .studio-main #page .cup-task-heading:not(.cup-section-heading) > div > p {
  display: none;
}

html[data-cup-workstation] body .studio-main #page .cup-section-heading:not(.agent-welcome) {
  flex-wrap: wrap;
  row-gap: 12px;
}

html[data-cup-workstation] body .studio-main #page .page-head.cup-section-heading {
  padding: 30px calc(var(--studio-gutter) + clamp(0px, 1vw, 16px)) 24px;
}

html[data-cup-workstation] body .studio-main #page .cup-section-heading:not(.page-head, .agent-welcome) {
  padding-inline-start: clamp(0px, 1vw, 16px);
}

.cup-section-heading > div {
  min-width: 0;
}

:is(.cup-section-heading, [data-cup-credit-panel] .cup-account-card-head) .cup-section-label {
  display: block;
  margin-bottom: 12px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 400;
  line-height: 1.4;
  letter-spacing: 1.7px;
}

html[data-cup-workstation] body .studio-main #page[data-view] .cup-section-heading h1,
html[data-cup-workstation][data-cup-theme] body .studio-main #page[data-view=agent] .agent-reference[data-mode=welcome] .agent-welcome.cup-section-heading h1 {
  margin: 0;
  color: color-mix(in srgb, var(--text) 92%, var(--muted));
  font-family: var(--cup-workstation-font);
  font-size: 27px;
  font-weight: 550;
  line-height: 1.4;
  letter-spacing: normal;
  overflow-wrap: break-word;
}

html[data-cup-workstation] body .studio-main #page[data-view] .cup-section-heading p,
html[data-cup-workstation][data-cup-theme] body .studio-main #page[data-view=agent] .agent-reference[data-mode=welcome] .agent-welcome.cup-section-heading > p {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 14px;
  font-weight: 400;
  line-height: 1.9;
}

html[data-cup-workstation] body .studio-main #page .cup-context-title {
  font-family: var(--cup-workstation-font);
  font-size: clamp(17px, 1.6vw, 22px);
  font-weight: 550;
  line-height: 1.34;
  letter-spacing: 0;
}

@media (max-width: 760px) {
  html[data-cup-workstation] body .studio-main #page[data-view] .cup-section-heading h1,
  html[data-cup-workstation][data-cup-theme] body .studio-main #page[data-view=agent] .agent-reference[data-mode=welcome] .agent-welcome.cup-section-heading h1 {
    font-size: 24px;
  }
  html[data-cup-workstation] body .studio-main #page .page-head.cup-section-heading {
    padding: 22px var(--studio-gutter) 20px;
  }
  html[data-cup-workstation] body .studio-main #page .cup-section-heading:not(.page-head, .agent-welcome) {
    padding-inline-start: 0;
  }
}
