/* Content studio (flags new_ui + content_studio): the board of gaps and
   articles, the editor screen's bar and brief, and the studio's modal.
   Markup from js/views/content-studio.js and content-assign.js. Colors only
   from css/ui-tokens.css. */
#viewContent:not(.cts-on) :is(#ctsBoard, #ctsBar, #ctsBriefCard, #ctsBriefMini) { display: none !important; }
#viewContent.cts-on #ctUiHead { display: none; }
#viewContent.cts-on:not(.cts-edit) :is(.ct-wrap, #ctsBar, #ctsBriefMini) { display: none; }
/* The document's actions live in the studio's bar (New, Copy, Download in ⋯; autosave). */
#viewContent.cts-on .ct-tb-actions { display: none !important; }
#viewContent.cts-on .ct-toolbar { flex-wrap: nowrap !important; overflow-x: auto; position: sticky; top: 0; z-index: 2; scrollbar-width: none; }
#viewContent.cts-on .ct-toolbar::-webkit-scrollbar { display: none; }
/* Outline placeholders: grey, gone once written, never saved. */
#ctDoc [data-ph]:empty::before { content: attr(data-ph); color: var(--ui-ink-3); font-style: italic; font-weight: 400; pointer-events: none; }
#ctCheck .ct-fix { display: block; font-size: 12px; color: var(--ui-ink-3); margin-top: 1px; }
/* The folded brief above the text is for phones; the rail card for wider screens. */
#viewContent.cts-on #ctsBriefMini { display: none; }
#viewContent.cts-on.cts-edit #ctsBoard { display: none; }
/* In the editor the brief takes the rail; the gap list and the article list live on the board. */
#viewContent.cts-on :is(#ctHistCard, .ct-rail-card:has(#ctOppList)) { display: none; }

/* Header: the AI drafts left sit next to the actions. */
body.new-ui .cts-quota { font-size: 13px; color: var(--ui-ink-2); padding: 0 6px; }
body.new-ui .cts-quota.none { color: var(--ui-neg); }

/* KPI row: tiles as tall as their content; counts in sans with tabular
   figures (mono is for code); the two proportions carry a thin bar. */
body.new-ui .cts-kpis .ui-kpi { padding: 16px 18px; gap: 4px; justify-content: flex-start; }
body.new-ui .cts-kpis .ui-kpi .big { font-family: var(--ui-font); font-variant-numeric: tabular-nums; letter-spacing: -.03em; font-size: 34px; margin-top: 4px; }
body.new-ui .cts-kpis .ui-kpi.ui-lead .big { font-size: 44px; }
body.new-ui .cts-kpis .ui-kpi .big small { margin-left: 2px; font-family: var(--ui-font); font-variant-numeric: tabular-nums; }
body.new-ui .cts-meter { display: block; height: 6px; border-radius: 99px; background: var(--ui-line-2); overflow: hidden; margin-top: 4px; }
body.new-ui .cts-meter > i { display: block; height: 100%; background: var(--ui-ink); border-radius: inherit; }
body.new-ui .ui-kpi.hero .cts-meter { background: color-mix(in srgb, var(--ui-bg) 22%, transparent); }

/* What to write next: one row per measured gap. */
body.new-ui .cts-next .ui-card-b { padding-top: 6px; }
body.new-ui .cts-gap { padding: 16px 0; border-top: 1px solid var(--ui-line-2); }
body.new-ui .cts-gap:first-child { border-top: 0; padding-top: 6px; }
body.new-ui .cts-gap-q { margin: 8px 0 0; font-size: 16.5px; line-height: 1.35; font-weight: 600; letter-spacing: -.015em; color: var(--ui-ink); }
body.new-ui .cts-gap.published .cts-gap-q { font-weight: 500; }
body.new-ui .cts-gap-meta { display: flex; flex-wrap: wrap; gap: 4px 16px; margin-top: 6px; font-size: 13px; color: var(--ui-ink-2); }
/* The per-AI line has its own row, so who is named instead always starts below it. */
body.new-ui .cts-gap-meta > .cts-ans { flex-basis: 100%; }
body.new-ui .cts-src { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px; }
body.new-ui .cts-site { white-space: nowrap; }
body.new-ui .cts-fav { width: 14px; height: 14px; border-radius: 3px; vertical-align: -2px; margin-right: 4px; }
body.new-ui .cts-gap-acts { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; margin-top: 12px; }
body.new-ui .cts-gap-acts .ui-link { font-size: 13.5px; margin-left: 4px; }
body.new-ui .cts-gap-when { font-size: 13px; color: var(--ui-ink-3); }
body.new-ui .cts-empty { padding: 18px 0 6px; color: var(--ui-ink-2); font-size: 14px; }
body.new-ui .cts-empty p { margin: 0 0 12px; max-width: 60ch; }

/* Status chips in ink with a dot: Draft hollow, Published filled. Priority
   is a plain label; high carries the only colour. */
body.new-ui .cts-st { display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 8px; border-radius: 6px;
  font-size: 12px; font-weight: 500; background: none; color: var(--ui-ink); border: 1px solid var(--ui-line); white-space: nowrap; }
body.new-ui .cts-st > i { width: 7px; height: 7px; border-radius: 50%; flex: none; }
body.new-ui .cts-st.draft > i { border: 1.5px solid var(--ui-ink-3); }
body.new-ui .cts-st.pub > i { background: var(--ui-good); }
body.new-ui .cts-st.prio { color: var(--ui-ink-2); border-color: var(--ui-line-2); }
body.new-ui .cts-st.prio.high { color: var(--ui-ink); border-color: var(--ui-line); font-weight: 500; }

/* Your articles. */
body.new-ui .cts-arts-b { padding-top: 8px; display: flex; flex-direction: column; gap: 2px; }
body.new-ui .cts-art { display: flex; flex-direction: column; align-items: stretch; gap: 6px; width: 100%; text-align: left;
  padding: 10px 10px; margin: 0 -10px; width: calc(100% + 20px); border: 0; border-radius: 10px; background: none; color: var(--ui-ink);
  font: inherit; cursor: pointer; box-shadow: none; }
body.new-ui .cts-art:hover:not(:disabled) { background: var(--ui-hover); }
body.new-ui .cts-art-t { font-size: 14px; font-weight: 500; line-height: 1.35; }
body.new-ui .cts-art-m { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; font-size: 12.5px; color: var(--ui-ink-3); }
body.new-ui .cts-imp { font-size: 12.5px; color: var(--ui-ink-2); }
body.new-ui .cts-imp.up { color: var(--ui-accent-ink); font-weight: 500; }
body.new-ui .cts-imp.down { color: var(--ui-neg); }
body.new-ui .cts-muted { margin: 0; font-size: 13px; color: var(--ui-ink-3); line-height: 1.5; }

/* How it gets measured. */
body.new-ui .cts-steps { list-style: none; margin: 0 0 12px; padding: 0; display: flex; flex-direction: column; gap: 10px; }
body.new-ui .cts-steps li { display: flex; gap: 10px; font-size: 13.5px; color: var(--ui-ink); line-height: 1.45; }
body.new-ui .cts-steps b { flex: none; width: 22px; height: 22px; border-radius: 50%; border: 1px solid var(--ui-line);
  display: inline-flex; align-items: center; justify-content: center; font: 500 12px var(--ui-mono); color: var(--ui-ink-2); }

/* Editor screen: back, status and Mark as published above the editor. */
body.new-ui .cts-bar { display: flex; align-items: center; flex-wrap: nowrap; gap: 10px; margin: 0 0 14px; min-width: 0; }
body.new-ui .cts-bar .cts-back { font-size: 14px; margin-right: 4px; white-space: nowrap; }
body.new-ui .cts-bar #ctsSaved { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
body.new-ui .cts-bar-acts { margin-left: auto; display: flex; align-items: center; gap: 8px; flex: none; }
body.new-ui .cts-bar-acts .ui-btn:disabled { opacity: .45; cursor: not-allowed; }
body.new-ui .cts-more { position: relative; }
body.new-ui .cts-more > summary { list-style: none; cursor: pointer; min-width: 36px; justify-content: center; }
body.new-ui .cts-more > summary::-webkit-details-marker { display: none; }
body.new-ui .cts-more-m { position: absolute; right: 0; top: calc(100% + 6px); z-index: 20; min-width: 170px; padding: 6px;
  background: var(--ui-card); border: 1px solid var(--ui-line); border-radius: 10px; box-shadow: 0 8px 24px rgba(0, 0, 0, .12);
  display: flex; flex-direction: column; }
body.new-ui .cts-more-m button { text-align: left; background: none; border: 0; border-radius: 7px; padding: 9px 10px; font: 14px var(--ui-font);
  color: var(--ui-ink); cursor: pointer; box-shadow: none; }
body.new-ui .cts-more-m button:hover { background: var(--ui-hover); }
body.new-ui .cts-warn { margin: 12px 0 0; font-size: 13px; color: var(--ui-warn); }
/* The folded brief above the editor (phones). */
body.new-ui .cts-brief-mini details { border: 1px solid var(--ui-line); border-radius: 12px; background: var(--ui-card); margin: 0 0 12px; }
body.new-ui .cts-brief-mini summary { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; cursor: pointer; font-size: 13.5px; color: var(--ui-ink-2); }
body.new-ui .cts-brief-mini summary b { color: var(--ui-ink); font-weight: 600; }
body.new-ui .cts-brief-mini .cts-brief { padding: 0 14px 14px; }

/* The brief in the editor's rail. */
body.new-ui .cts-brief-q { margin: 6px 0 10px; font-size: 15px; font-weight: 600; line-height: 1.4; color: var(--ui-ink); }
body.new-ui .cts-brief-k { margin: 12px 0 4px; font-size: 12.5px; font-weight: 500; color: var(--ui-ink-3); }
body.new-ui .cts-brief ul { margin: 0; padding-left: 18px; font-size: 13.5px; color: var(--ui-ink); line-height: 1.5; }
body.new-ui .cts-brief ul:has(.cts-fav) { list-style: none; padding-left: 0; }
body.new-ui .cts-brief .ui-link { margin-top: 12px; font-size: 13.5px; display: inline-block; }

/* The studio's modal: publish, the brief, the writer request. */
body.new-ui .cts-modal { max-width: 560px; font-family: var(--ui-font); color: var(--ui-ink); }
body.new-ui .cts-modal.wide { max-width: 920px; }
body.new-ui .cts-modal h2 { font-size: 20px; letter-spacing: -.02em; margin: 0 0 4px; }
body.new-ui .cts-sheet-head { display: flex; align-items: flex-start; gap: 12px; }
body.new-ui .cts-sheet-head h2 { flex: 1; min-width: 0; }
body.new-ui .cts-sheet-head .modal-close { float: none; flex: none; margin: 0 -6px 0 0; }
/* The brief is a <details> so a phone can fold it; on desktop it stays open
   and its label isn't a toggle. */
body.new-ui .cts-order-brief > summary { list-style: none; pointer-events: none; margin-top: 0; }
body.new-ui .cts-order-brief > summary::-webkit-details-marker { display: none; }
body.new-ui .cts-order-brief > summary .m { display: none; }
body.new-ui .cts-modal .sub { color: var(--ui-ink-2); font-size: 14px; margin: 0 0 16px; }
body.new-ui .cts-field { display: flex; flex-direction: column; gap: 6px; margin: 12px 0 0; font-size: 13px; color: var(--ui-ink-2); }
body.new-ui .cts-field :is(input, textarea) { font: 14px var(--ui-font); color: var(--ui-ink); background: var(--ui-card);
  border: 1px solid var(--ui-line); border-radius: 9px; padding: 10px 12px; width: 100%; box-sizing: border-box; }
body.new-ui .cts-modal-acts { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; flex-wrap: wrap; }
body.new-ui .cts-modal-acts.left { justify-content: flex-start; margin-top: 10px; }
body.new-ui .cts-order { display: grid; grid-template-columns: minmax(0, 1fr); gap: 22px; }
body.new-ui .cts-modal.wide .cts-order { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); }
/* The brief reads as a document; Copy and Download give its Markdown. */
body.new-ui .cts-md { max-height: 52vh; overflow: auto; overflow-wrap: anywhere; font-size: 13.5px; line-height: 1.55;
  color: var(--ui-ink); background: var(--ui-paper-2); border: 1px solid var(--ui-line-2); border-radius: 10px; padding: 4px 18px 14px; }
body.new-ui .cts-md h2 { font-size: 16px; letter-spacing: -.01em; margin: 14px 0 6px; }
body.new-ui .cts-md h2:first-child { font-size: 17px; }
body.new-ui .cts-md h3 { font-size: 13px; font-weight: 600; color: var(--ui-ink-2); margin: 14px 0 4px; }
body.new-ui .cts-md p { margin: 4px 0; }
body.new-ui .cts-md ul { margin: 4px 0; padding-left: 18px; }
body.new-ui .cts-order-form { display: block; }
body.new-ui .cts-order-form .cts-brief-k:first-child { margin-top: 0; }
body.new-ui .cts-opts { display: flex; flex-direction: column; gap: 6px; }
/* The whole card is the choice; the radio is a small check at its corner. */
body.new-ui .cts-opt { position: relative; display: flex; gap: 10px; align-items: flex-start; padding: 10px 40px 10px 12px;
  border: 1px solid var(--ui-line); border-radius: 10px; cursor: pointer; }
body.new-ui .cts-opt:has(input:checked) { border-color: var(--ui-ink); box-shadow: 0 0 0 1px var(--ui-ink); }
body.new-ui .cts-opt input[type=radio] { appearance: none; -webkit-appearance: none; position: absolute; top: 11px; right: 12px; margin: 0;
  width: 18px; height: 18px; border-radius: 50%; border: 1.5px solid var(--ui-line); background: var(--ui-card); cursor: pointer; }
body.new-ui .cts-opt input[type=radio]:checked { background: var(--ui-ink); border-color: var(--ui-ink); }
body.new-ui .cts-opt input[type=radio]:checked::after { content: ""; position: absolute; left: 5px; top: 2px; width: 4px; height: 8px;
  border: solid var(--ui-card); border-width: 0 1.8px 1.8px 0; transform: rotate(45deg); }
body.new-ui .cts-opt input[type=radio]:focus-visible { outline: 2px solid var(--ui-accent); outline-offset: 2px; }
body.new-ui .cts-opt b { display: block; font-size: 14px; font-weight: 500; }
body.new-ui .cts-opt small { display: block; font-size: 12.5px; color: var(--ui-ink-3); }
body.new-ui .cts-price { margin: 14px 0 12px; font-size: 13px; color: var(--ui-ink-2); line-height: 1.5; }
/* One footer for the modal: secondary actions left, the primary right, same height. */
body.new-ui .cts-modal-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap;
  margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--ui-line-2); }
body.new-ui .cts-modal-foot .l, body.new-ui .cts-modal-foot .r { display: flex; gap: 8px; align-items: center; }
body.new-ui .cts-modal-foot .ui-btn { height: 38px; }
body.new-ui .cts-md ul:has(.cts-fav) { list-style: none; padding-left: 0; }
/* A site without a favicon shows nothing, not a letter that reads like a tag. */
body.new-ui :is(.cts-md, .cts-brief) .cts-fav.fav-letter { display: none; }
body.new-ui .cts-md a { color: var(--ui-ink); text-decoration: underline; text-decoration-color: var(--ui-line); text-underline-offset: 3px; }
body.new-ui .cts-order-done { padding: 16px; border-radius: 10px; background: var(--ui-accent-soft); color: var(--ui-ink); font-size: 14px; }
body.new-ui .cts-order-done p { margin: 4px 0 0; color: var(--ui-ink-2); }
/* Writer of the team (flag content_writers): who has the article. */
body.new-ui .cts-who { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 6px;
  border: 1px solid var(--ui-line); font-size: 12px; color: var(--ui-ink-2); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
body.new-ui .cts-who.mine { background: var(--ui-ink); color: var(--ui-bg); border-color: var(--ui-ink); }
body.new-ui .cts-gap-top { display: flex; flex-wrap: wrap; gap: 6px; }
body.new-ui .cts-opt-new > span { flex: 1; min-width: 0; }
body.new-ui .cts-opt-new input[type=email] { display: block; width: 100%; margin-top: 8px; height: 38px; padding: 0 10px;
  border: 1px solid var(--ui-line); border-radius: 8px; background: var(--ui-bg); color: var(--ui-ink); font: inherit; font-size: 14px; }
body.new-ui .cts-lock { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 2px 0 0; padding: 10px 12px;
  border: 1px dashed var(--ui-line); border-radius: 10px; font-size: 13px; color: var(--ui-ink-2); }
body.new-ui .cts-lock .ct-lock-i { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.5; }
body.new-ui .cts-as-cur { display: flex; flex-wrap: wrap; gap: 8px; align-items: baseline; margin: 0 0 12px; font-size: 13.5px; }
body.new-ui .cts-brief-as { margin: 0 0 10px; }
body.new-ui .cts-brief-as p { margin: 8px 0 0; font-size: 13px; color: var(--ui-ink-2); line-height: 1.5; }
body.new-ui .cts-brief-as b { color: var(--ui-ink); font-weight: 500; }
body.new-ui .cts-order-done .tm-link { display: flex; gap: 8px; align-items: center; margin-top: 10px; }
body.new-ui .cts-order-done .tm-link code { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }

@media (max-width: 900px) {
  body.new-ui .cts-gap-acts .ui-btn { flex: 1 1 auto; }
  body.new-ui .cts-gap-acts .ui-link { min-height: 44px; display: inline-flex; align-items: center; }
  body.new-ui .cts-bar .cts-back { min-height: 44px; display: inline-flex; align-items: center; }
  body.new-ui .cts-bar-acts .ui-btn { height: 40px; }
  body.new-ui .cts-modal.wide .cts-order { grid-template-columns: minmax(0, 1fr); }
  body.new-ui .cts-art { min-height: 44px; }
}
/* How the measurement answered the question: counts, the zero in the negative tint. */
body.new-ui .cts-ans { font-variant-numeric: tabular-nums; color: var(--ui-ink); }
body.new-ui .cts-ai-left { color: var(--ui-ink-3); font-weight: 400; white-space: nowrap; }
/* Dark mode: the lead card doesn't invert to a light block; it sits on the
   raised surface with a full accent border. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) body.new-ui .cts-kpis .ui-kpi.hero { background: var(--ui-paper-2); color: var(--ui-ink); border: 1px solid var(--ui-accent); }
  :root:not([data-theme="light"]) body.new-ui .cts-kpis .ui-kpi.hero :is(.lbl, .sub, .big small) { color: var(--ui-ink-2); }
}
:root[data-theme="dark"] body.new-ui .cts-kpis .ui-kpi.hero { background: var(--ui-paper-2); color: var(--ui-ink); border: 1px solid var(--ui-accent); }
:root[data-theme="dark"] body.new-ui .cts-kpis .ui-kpi.hero :is(.lbl, .sub, .big small) { color: var(--ui-ink-2); }
@media (max-width: 760px) {
  /* The studio's modal is a full sheet: title and ✕ fixed at the top, the
     main action fixed at the bottom, everything between scrolls. */
  body.new-ui .cts-modal-back { align-items: stretch; }
  body.new-ui .cts-modal, body.new-ui .cts-modal.wide { width: 100%; max-width: none; max-height: 100dvh; height: 100dvh;
    border-radius: 0; border: 0; padding: 0 16px; box-sizing: border-box; display: flex; flex-direction: column; }
  body.new-ui .cts-sheet-head { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; gap: 12px;
    min-height: 56px; margin: 0 -16px 8px; padding: 0 8px 0 16px; background: var(--ui-card); border-bottom: 1px solid var(--ui-line-2); }
  body.new-ui .cts-sheet-head h2 { flex: 1; margin: 0; font-size: 17px; }
  body.new-ui .cts-sheet-head .modal-close { margin: 0; width: 44px; height: 44px; }
  body.new-ui .cts-modal > * { flex: none; }
  body.new-ui .cts-modal-foot { position: sticky; bottom: 0; z-index: 2; margin: auto -16px 0;
    padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); background: var(--ui-card); }
  /* Folded, the brief is a disclosure line with what's inside, not a box
     that reads like a select. */
  body.new-ui .cts-order-brief > summary { pointer-events: auto; cursor: pointer; display: flex; align-items: baseline; gap: 6px;
    min-height: 44px; margin: 0; padding: 12px 0; border-bottom: 1px solid var(--ui-line-2); color: var(--ui-ink); font-size: 14px; }
  body.new-ui .cts-order-brief > summary .d { display: none; }
  body.new-ui .cts-order-brief > summary .m { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; min-width: 0; }
  body.new-ui .cts-order-brief > summary .m b { font-weight: 500; text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--ui-line); }
  body.new-ui .cts-order-brief > summary .m small { color: var(--ui-ink-3); font-size: 12.5px; }
  body.new-ui .cts-order-brief > summary::after { content: "›"; margin-left: auto; color: var(--ui-ink-3); font-size: 18px; line-height: 1;
    transition: transform .15s; }
  body.new-ui .cts-order-brief[open] > summary::after { transform: rotate(90deg); }
  body.new-ui .cts-order-brief[open] > summary { margin-bottom: 8px; }
  body.new-ui .cts-md { max-height: none; }
  body.new-ui .cts-modal .cts-order { gap: 14px; }
  #viewContent.cts-on #ctsBriefMini:not([hidden]) { display: block; }
  #viewContent.cts-on #ctsBriefCard { display: none; }
  /* Phone: one bar row (back arrow, state, ⋯, Mark as published) and the
     format toolbar fixed at the bottom, over the keyboard, not above the text. */
  body.new-ui .cts-bar .cts-back { font-size: 20px; min-width: 40px; justify-content: center; margin: 0; }
  body.new-ui .cts-bar .cts-back span, body.new-ui .cts-bar #ctsSaved, body.new-ui .cts-bar .cts-st.draft { display: none; }
  /* Before the first save, why Publish is grey: its own line under the buttons. */
  body.new-ui .cts-bar:has(#ctsSaved.wait) { flex-wrap: wrap; }
  body.new-ui .cts-bar #ctsSaved.wait { display: block; order: 10; flex: 1 0 100%; font-size: 12px; text-align: right; white-space: normal; }
  body.new-ui .cts-bar { gap: 8px; }
  #viewContent.cts-on.cts-edit .ct-toolbar { position: fixed; left: 0; right: 0; bottom: 0; top: auto; z-index: 30;
    background: var(--ui-card); border-top: 1px solid var(--ui-line); border-bottom: 0; padding: 6px 10px calc(6px + env(safe-area-inset-bottom)); }
  #viewContent.cts-on.cts-edit { padding-bottom: 64px; }
}

/* Write it with your AI (flag content_ai_writer): the panel in the brief modal. */
body.new-ui .cts-ai { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; font-size: 14px; }
body.new-ui .cts-ai .cts-brief-k { margin: 0; }
body.new-ui .cts-ai .cts-muted { margin: 0; font-size: 13px; color: var(--ui-ink-2); line-height: 1.5; }
body.new-ui .cts-ai-back { font-size: 13px; }
body.new-ui .cts-ai-seg { align-self: flex-start; }
body.new-ui .cts-ai-status { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 13px; color: var(--ui-ink-2); }
body.new-ui .cts-ai-status i { width: 8px; height: 8px; border-radius: 50%; background: var(--ui-good); flex: none; }
body.new-ui .cts-ai-steps { list-style: none; margin: 0; padding: 0; width: 100%; display: flex; flex-direction: column; gap: 12px; counter-reset: cts-ai; }
body.new-ui .cts-ai-steps li { counter-increment: cts-ai; display: flex; flex-direction: column; align-items: flex-start; gap: 8px;
  padding-left: 30px; position: relative; font-size: 13.5px; color: var(--ui-ink); line-height: 1.5; min-width: 0; }
body.new-ui .cts-ai-steps li::before { content: counter(cts-ai); position: absolute; left: 0; top: 0; width: 20px; height: 20px; border-radius: 50%;
  border: 1px solid var(--ui-line); font-size: 12px; line-height: 18px; text-align: center; color: var(--ui-ink-2); }
body.new-ui .cts-ai-steps li > span { min-width: 0; max-width: 100%; }
body.new-ui .cts-ai-addr, body.new-ui .cts-ai-key { display: flex; align-items: center; gap: 8px; max-width: 100%; min-width: 0; }
body.new-ui .cts-ai-addr code, body.new-ui .cts-ai-key code { flex: 1; min-width: 0; padding: 7px 10px; border-radius: 8px; border: 1px solid var(--ui-line-2);
  background: var(--ui-paper-2); color: var(--ui-ink); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
body.new-ui .cts-ai-key { width: 100%; }
body.new-ui .cts-ai-fine { margin: 6px 0 0; font-size: 12.5px; color: var(--ui-ink-3); line-height: 1.5; }
body.new-ui .cts-ai-ico { width: 14px; height: 14px; margin-right: 8px; flex: none; vertical-align: -2px; }
body.new-ui .cts-modal-foot .ui-link { font-size: 13.5px; }
@media (max-width: 760px) {
  body.new-ui .cts-ai-back, body.new-ui .cts-modal-foot .ui-link { min-height: 44px; display: inline-flex; align-items: center; }
  body.new-ui .cts-modal-foot .l { gap: 12px; }
  /* The primary is the whole bottom row; Copy brief and Download sit above it. */
  body.new-ui .cts-modal-foot:has(.l .ui-link) .l { flex: 1 0 100%; }
  body.new-ui .cts-modal-foot:has(.l .ui-link) .r { flex: 1 0 100%; }
  body.new-ui .cts-modal-foot:has(.l .ui-link) .r .ui-btn { width: 100%; justify-content: center; }
}
