/* Round 23: a calm last layer.
   Loaded after every other stylesheet. It only changes how things look:
   no ids, classes or handlers are touched.
   ":not(#_calm)" adds id-level specificity so these rules win over the
   older ":is(... #licenseActivateBtn)" primary-button rules without a
   pile of !important chains. Keep it that way when adding rules here. */

html[data-ui-skin] { --calm-sub: #5c5c63; }
html.creative-ui[data-ui-skin] { --calm-sub: #b4b4bd; }

/* 1. Primary buttons keep the brand's purple flowing fill (refined-ui.css).
   Only the "↗" goes: it reads as "opens a link", not "generate".
   Busy keeps the faster flow and adds a small spinner in the arrow's place. */
html[data-ui-skin] .app .btn.primary:not(#_calm)::after { content: none !important; }
html[data-ui-skin] .app .btn.primary:not(#_calm):is([aria-busy="true"], .is-reversing) { cursor: progress; }
html[data-ui-skin] .app .btn.primary:not(#_calm):is([aria-busy="true"], .is-reversing)::after {
  content: "" !important;
  display: inline-block;
  width: 11px;
  height: 11px;
  margin-left: 8px;
  border: 1.5px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  background: none;
  animation: calm-spin .8s linear infinite;
}
/* The send button keeps an arrow: it is its only label. */
html[data-ui-skin] .app .composer .btn.primary.agent-send:not(#_calm)::after { content: "\2191" !important; margin: 0 !important; font-size: 15px; animation: none; border: 0; width: auto; height: auto; }
@keyframes calm-spin { to { transform: rotate(360deg); } }

/* 2. Text: two sizes. Secondary text is 12px and bright enough to read; nothing below 11px. */
html[data-ui-skin] .app :is(.field > label, .field > span:first-child) { font-size: 12px !important; color: var(--calm-sub) !important; }
html[data-ui-skin] .app :is(.empty-result, .slot > b, .prompt-label) { font-size: 12px !important; }
html[data-ui-skin] .app .empty-result { color: var(--calm-sub) !important; }
html[data-ui-skin] .app .action-chip { font-size: 12px !important; }
html[data-ui-skin] .app .video-mode-option b { font-size: 12.5px !important; }
html[data-ui-skin] .app .video-mode-option span { font-size: 11.5px !important; color: var(--calm-sub) !important; opacity: 1 !important; }
html[data-ui-skin] .app :is(.video-section-title small, .video-upload-copy span) { font-size: 11.5px !important; color: var(--calm-sub) !important; }
html[data-ui-skin] .app .video-workspace-tabs button { font-size: 12px !important; }
html[data-ui-skin] .app .service p { font-size: 12px !important; color: var(--calm-sub) !important; opacity: 1 !important; }
html[data-ui-skin] .app :is(.service-note, .service > small, .settings-shared-note) { font-size: 11.5px !important; color: var(--calm-sub) !important; opacity: 1 !important; }
html[data-ui-skin] .app .result footer span { font-size: 11.5px !important; }
html[data-ui-skin] .app .app-legal-footer :is(span, button, a) { font-size: 11px !important; }
html[data-ui-skin] .app :is(.feishu-demo p, .feishu-demo span, .feishu-demo small, .feishu-demo-kicker) { font-size: 11.5px !important; }

/* 3. Settings: the Feishu demo sits folded under the services. */
.feishu-demo-fold { grid-column: 1 / -1; margin-top: 14px; }
.feishu-demo-fold > summary { cursor: pointer; padding: 8px 2px; color: var(--calm-sub); font-size: 12px; list-style: none; }
.feishu-demo-fold > summary::-webkit-details-marker { display: none; }
.feishu-demo-fold > summary::before { content: "\203A"; display: inline-block; width: 14px; transition: transform .2s ease; }
.feishu-demo-fold[open] > summary::before { transform: rotate(90deg); }

/* Round 41: Codex automation keys, under the services in settings. */
.automation-keys { grid-column: 1 / -1; margin-top: 16px; padding: 16px 18px; border-radius: 14px; background: rgba(127,127,140,.07); box-shadow: inset 0 0 0 1px rgba(127,127,140,.16); }
.automation-head { display: flex; gap: 16px; align-items: flex-start; justify-content: space-between; }
.automation-head h4 { margin: 0 0 4px; font-size: 14px; }
.automation-head p, .automation-note, .automation-fresh p { margin: 0; font-size: 12px; line-height: 1.6; color: var(--calm-sub); }
.automation-head .btn { flex: none; }
.automation-fresh { margin-top: 12px; display: grid; gap: 8px; }
.automation-fresh pre { margin: 0; padding: 10px 12px; border-radius: 10px; font-size: 12px; white-space: pre-wrap; word-break: break-all; background: rgba(0,0,0,.28); color: inherit; user-select: all; }
html[data-ui-skin="light"] .automation-fresh pre { background: rgba(0,0,0,.05); }
.automation-fresh .btn { justify-self: start; }
.automation-note { margin-top: 10px; } .automation-note.is-error { color: #e0656b; }
.automation-list { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 6px; }
.automation-list li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 10px; border-radius: 10px; background: rgba(127,127,140,.08); font-size: 12.5px; }
.automation-list li span { display: grid; gap: 2px; min-width: 0; } .automation-list code { font-size: 11.5px; opacity: .8; }
.automation-list small { font-size: 11px; color: var(--calm-sub); }
@media (max-width: 760px) { .automation-head { flex-direction: column; } }

/* 4. Top bar: when the invite code is active, a green dot says enough; the full text is the tooltip. */
html:not(.mobile-screen)[data-ui-skin] .topbar #licenseStatusPill.ok {
  width: 34px; max-width: 34px; padding: 0 !important; overflow: hidden; white-space: nowrap;
  text-indent: -999px; display: inline-flex; align-items: center; justify-content: center;
}
html:not(.mobile-screen)[data-ui-skin] .topbar #licenseStatusPill.ok::before { text-indent: 0; margin: 0 !important; }

/* 6. Video empty plan: one quiet line on what to do next. */
html[data-ui-skin] .app .video-analysis-empty small { display: block; margin-top: 6px; font-size: 12px; color: var(--calm-sub); }

/* Round 24: the Agent composer no longer jumps when a model is picked.
   It used to grow on :focus-within (refined-ui.css), so focusing the model
   button grew it and picking an option (the list lives outside the composer)
   shrank it again, animated. Now the box is tall while it is focused or holds
   text, and low while it is empty and not focused, wherever focus goes. */
html:not(.mobile-screen)[data-ui-skin] .view[data-view="agent"] .composer.agent-composer #agentInput:placeholder-shown:not(:focus):not(#_calm) { min-height: 46px !important; }
html:not(.mobile-screen)[data-ui-skin] .view[data-view="agent"] .composer.agent-composer #agentInput:is(:focus, :not(:placeholder-shown)):not(#_calm) { min-height: 112px !important; }
/* Toolbar items keep their width; a long row scrolls instead of squeezing the summary into a column. */
html:not(.mobile-screen)[data-ui-skin] .composer .agent-setting-strip > :is(.agent-tool, .agent-output-summary) { flex-shrink: 0; white-space: nowrap; }
/* Midjourney options: the "风格" label stays on one line. */
.mj-settings > label.field { white-space: nowrap; }
.mj-settings > label.field > select { flex: 1 1 auto; min-width: 0; }
.composer .mj-settings { padding-left: 12px; padding-right: 12px; }
/* The global "button:hover lifts 1px" made the toolbar buttons twitch under the mouse. */
html[data-ui-skin] .composer .agent-tool-row button:hover:not(#_calm) { transform: none; }

/* Remove only the Agent panel's left-edge flare; keep its glass, stars and controls. */
html.creative-ui[data-ui-skin] .view[data-view="agent"] section.chat {
  background: linear-gradient(180deg, rgba(24, 26, 30, .58), rgba(14, 15, 18, .7)) !important;
}


