/* Shared warm-paper surfaces. Load after the existing page styles.
   Homepage composition, proof stages and upload/dropzone geometry stay local. */
:root {
  --surface-rule: rgba(23, 19, 15, .11);
  --surface-rule-strong: rgba(23, 19, 15, .24);
  --surface-inset: #f0eadd;
  --surface-quiet: #6c6257;
  --surface-input-line: #978675;
  --code-paper: #efe9dd;
  --code-ink: #3b332a;
}

body {
  background: var(--paper);
  caret-color: var(--signal-strong);
  scrollbar-color: #b9ae9d var(--paper);
}
body::before { content: none; }
/* A document field carries the converter's visual language beyond its hero. */
main { position: relative; isolation: isolate; }
main::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(ellipse 65% 480px at 90% 26%, #c7d2b32b, transparent), radial-gradient(ellipse 55% 500px at 8% 72%, #e6b88e20, transparent);
}
body[data-home-page] #capability-directory,
body[data-home-page] #access-methods,
body[data-converter-page] .content-section,
body.source-page .faq-section {
  position: relative;
  isolation: isolate;
}
body[data-home-page] #capability-directory::before,
body[data-home-page] #access-methods::before,
body[data-converter-page] main::after,
body[data-docs-page] main::after,
body[data-pricing-page] main::after {
  content: "";
  position: absolute;
  z-index: -1;
  pointer-events: none;
  width: min(960px,100%);
  height: 600px;
  right: 0;
  top: -130px;
  background: url('/document-field.svg') right top / contain no-repeat;
}
body[data-home-page] #access-methods::before { top: -90px; opacity: .6; }
body[data-converter-page] main::after { top: 600px; }
body[data-docs-page] main::after,
body[data-pricing-page] main::after { top: 120px; }
:is(h1,h2,h3) { text-wrap: balance; }
@supports (animation-timeline: view()) {
  @media(prefers-reduced-motion:no-preference) {
    body[data-home-page] #capability-directory::before {
      animation: document-field-pass linear both;
      animation-timeline: view();
      animation-range: entry 0% exit 100%;
    }
  }
}
@keyframes document-field-pass { from { transform: translateY(32px); opacity: .5; } to { transform: translateY(-24px); opacity: 1; } }
@media(max-width:760px) {
  body[data-home-page] #capability-directory::before,
  body[data-home-page] #access-methods::before,
  body[data-converter-page] main::after { top: -30px; opacity: .7; height: 420px; }
  body[data-converter-page] main::after { top: 500px; }
}
::selection { background: #eed3be; color: var(--ink); }
:where(a, button, input, textarea, select, summary, [tabindex]):focus-visible {
  outline: 2px solid var(--signal-strong);
  outline-offset: 4px;
}

/* Shared navigation retains its existing desktop and mobile arrangement. */
body .site-header {
  min-height: 72px;
  border-bottom-color: transparent;
  background: color-mix(in srgb, var(--paper) 94%, transparent);
  box-shadow: none;
}
.site-header .nav-links {
  border-color: var(--surface-rule);
  background: color-mix(in srgb, var(--surface) 72%, transparent);
  box-shadow: none;
  font-size: .9rem;
}
.site-header :is(.account-link, .task-inbox-trigger, .site-menu-toggle) {
  border-color: var(--surface-rule);
  background: transparent;
  box-shadow: none;
}
.site-header .account-link.is-authenticated { background: #f0eadd; }
.site-header .header-account-popover {
  border-color: var(--surface-rule);
  background: var(--surface);
  box-shadow: 0 14px 36px rgba(45, 32, 20, .1);
}
.site-header :is(.nav-links a, .account-link, .task-inbox-trigger, .site-menu-toggle) {
  transition: background-color 160ms ease, color 160ms ease, border-color 160ms ease;
}
.site-header :is(.account-link, .task-inbox-trigger, .site-menu-toggle):hover,
.header-account-popover :is(a, button):hover {
  border-color: var(--surface-rule-strong);
  background: var(--surface-inset);
  color: var(--ink);
}
.site-header .nav-links a[aria-current="page"] {
  background: var(--ink);
  color: var(--surface);
}
body:not([data-home-page]) .site-footer {
  border-color: var(--surface-rule);
  background: transparent;
  box-shadow: none;
}

/* Converter and provider explanations use the same open reading surface. */
body[data-converter-page] .hero-shell {
  background: transparent;
  box-shadow: none;
}
body[data-converter-page] .hero-copy h1 {
  letter-spacing: -.025em;
  text-wrap: balance;
}
body.source-page[data-converter-page] .hero-copy h1 {
  font-size: clamp(2.5rem, 4.7vw, 4.1rem);
  line-height: 1.03;
}
body[data-converter-page] :is(.hero-lede, .source-boundary) {
  color: var(--surface-quiet);
  line-height: 1.65;
}
body[data-converter-page] .upload-panel {
  border-color: var(--surface-rule);
  background: var(--surface);
  box-shadow: none;
}
body[data-converter-page] .section-band {
  width: min(1120px, calc(100% - 64px));
  padding-block: clamp(40px, 5vw, 64px);
  border-color: var(--surface-rule);
  background: transparent;
  box-shadow: none;
}
body[data-converter-page] .section-heading {
  display: grid;
  grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr);
  gap: 24px 56px;
  align-items: start;
}
body[data-converter-page] .section-heading h2 {
  margin-top: 0;
  font-size: clamp(1.75rem, 2.8vw, 2.5rem);
  line-height: 1.12;
  letter-spacing: -.02em;
  text-wrap: balance;
}
body[data-converter-page] .section-heading > p {
  max-width: 66ch;
  margin-top: 0;
  color: var(--surface-quiet);
  font-size: .97rem;
  line-height: 1.75;
}
body[data-converter-page] :is(.flow-steps, .developer-lanes) > article {
  border: 0;
  border-top: 1px solid var(--surface-rule);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
body[data-converter-page] .developer-lanes > article { padding: 24px 0; }
body[data-converter-page] .converter-tool-discovery {
  border-color: var(--surface-rule);
  background: transparent;
}
body[data-converter-page] .converter-tool-discovery a {
  border-color: var(--surface-rule);
  color: var(--surface-quiet);
  font-family: var(--sans);
  font-size: .86rem;
  font-weight: 600;
}
body[data-converter-page] .converter-tool-discovery a:hover,
body[data-converter-page] .converter-tool-discovery a[aria-current="page"] {
  background: var(--surface-inset);
  color: var(--ink);
}
body[data-converter-page] .faq-section details {
  padding: 0;
  border: 0;
  border-bottom: 1px solid var(--surface-rule);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
body[data-converter-page] .faq-section summary {
  min-height: 44px;
  padding-block: 20px;
  color: var(--ink);
  font-size: .98rem;
  line-height: 1.5;
}
body[data-converter-page] .faq-section details p {
  max-width: 72ch;
  margin: 0 0 22px;
  color: var(--surface-quiet);
  font-size: .94rem;
  line-height: 1.7;
}
body[data-converter-page] .url-estimate {
  border-color: var(--surface-rule);
  background: transparent;
}
body[data-converter-page] .primary-action { box-shadow: none; }

/* Account overview and settings: large paper surfaces, quiet inset groups. */
.app-page :is(.account-overview, .app-card) {
  border-color: var(--surface-rule);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: none;
}
.app-page .account-overview { padding: clamp(24px, 4vw, 40px); }
.app-page .account-section-nav {
  border-color: var(--surface-rule);
  background: var(--paper);
  box-shadow: none;
}
.app-page .account-section-nav a { min-height: 44px; }
.app-page .account-section-nav a:hover { background: var(--surface-inset); color: var(--ink); }
.app-page .account-section-nav a.active { background: var(--ink); color: var(--surface); }
.app-page :is(.account-primary-metrics article, .account-access-details, .account-setting-panel,
  .connected-methods, .account-strip > span, .overview-grid > span, .compact-form) {
  border-color: var(--surface-rule);
  background: var(--paper);
  box-shadow: none;
}
.app-page .account-primary-metrics .credit-balance-card {
  border-color: transparent;
  background: #e8ebe0;
  color: var(--ink);
}
.app-page .account-primary-metrics .credit-balance-card :is(span, small) { color: #56614e; }
.app-page .account-primary-metrics strong { font-weight: 600; font-variant-numeric: tabular-nums; }
.app-page .account-avatar { border: 0; background: var(--green); box-shadow: none; }
.app-page :is(.app-card h2, .account-setting-panel h2) { font-weight: 600; line-height: 1.2; }
.app-page :is(.app-card p, .account-setting-panel p, .empty-state) { color: var(--surface-quiet); line-height: 1.6; }
.app-page .table-row { border-color: var(--surface-rule); }
.app-page .table-row:not(.table-head):hover { background: color-mix(in srgb, var(--paper) 64%, transparent); }

/* Authentication and native dialogs keep their existing focus and scroll model. */
.auth-card {
  padding: clamp(24px, 4vw, 36px);
  border-color: var(--surface-rule);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: 0 16px 44px rgba(45, 32, 20, .08);
}
.auth-card-title h2,
.auth-gate-title h2 { font-weight: 600; letter-spacing: -.025em; line-height: 1.08; }
.auth-card-title p:last-child { color: var(--surface-quiet); line-height: 1.6; }
.auth-gate-card { padding-top: 48px; }
:is(.auth-gate-dialog, .surface-dialog)::backdrop {
  background: rgba(40, 32, 25, .38);
  backdrop-filter: blur(4px);
}
:is(.auth-tabs, .auth-intent, .auth-alert, .verification-mark) {
  border-color: var(--surface-rule);
  background: var(--paper);
}
.auth-tabs button.active { background: var(--surface); box-shadow: none; }
.auth-alert.is-error { border-color: #d6a28b; background: #faeade; }
.auth-card .auth-form { padding: 0; border: 0; background: transparent; }
.social-button { border-color: var(--surface-rule-strong); background: var(--surface); box-shadow: none; font-weight: 600; }
.social-button:not(:disabled):hover { border-color: var(--ink); background: var(--paper); box-shadow: none; transform: none; }
:is(.auth-gate-close, .surface-dialog-close, .feedback-close) {
  min-width: 44px;
  min-height: 44px;
  border: 1px solid var(--surface-rule);
  background: var(--surface);
  color: var(--ink);
  box-shadow: none;
}
:is(.auth-gate-close, .surface-dialog-close, .feedback-close):hover { background: var(--surface-inset); border-color: var(--surface-rule-strong); }
:is(.task-inbox-shell) { border-color: var(--surface-rule); background: var(--surface); box-shadow: -12px 0 44px rgba(45, 32, 20, .1); }
:is(.surface-dialog-header) h2 { font-size: clamp(1.8rem, 2.7vw, 2.35rem); font-weight: 600; line-height: 1.12; }
.task-inbox-item { border-color: var(--surface-rule); border-radius: 9px; background: var(--paper); }
.task-inbox-empty { border: 0; background: var(--paper); }
.task-inbox-copy strong { font-weight: 600; }
.task-inbox-copy span { color: var(--surface-quiet); }
.result-panel { border-color: var(--surface-rule); border-radius: 12px; background: var(--surface); box-shadow: none; }
.result-panel h2 { font-weight: 600; line-height: 1.12; letter-spacing: -.015em; }
.result-review-warning { border-color: #dec2a4; background: #f6ecdc; color: #6c4f28; }

/* Inputs and actions retain useful boundaries; dark primary labels stay white. */
:is(.app-page, .auth-card) :is(input, select, textarea),
#feedback-form :is(input, textarea) {
  border-color: var(--surface-input-line);
  background: var(--surface);
  color: var(--ink);
}
:is(.app-page, .auth-card) :is(input, select, textarea):focus,
#feedback-form :is(input, textarea):focus {
  border-color: var(--signal-strong);
  outline: 2px solid var(--signal-strong);
  outline-offset: 2px;
  box-shadow: none;
}
:is(.app-page, .auth-card) :is(input, textarea)::placeholder,
#feedback-form :is(input, textarea)::placeholder { color: #7d7063; opacity: 1; }
:is(.app-page, .auth-card) button,
.result-actions :is(a, button), .feedback-submit {
  min-height: 44px;
  font-weight: 600;
  box-shadow: none;
  transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease;
}
.result-actions :is(a, button) { font-weight: 600; }
:is(.app-page, .auth-card) .ghost-action,
.result-actions .secondary { border-color: var(--surface-rule-strong); background: var(--surface); color: var(--ink); }
:is(.app-page, .auth-card) .text-action { background: transparent; color: var(--surface-quiet); }
:is(.app-page, .auth-card) :is(.ghost-action, .text-action):not(:disabled):hover,
.result-actions .secondary:hover { background: var(--surface-inset); color: var(--ink); }
:is(.task-inbox-actions, .result-actions) button:not(.secondary):not(:disabled):hover { background: var(--ink-soft); color: var(--surface); }

.feedback-toggle { min-height: 44px; border-color: var(--surface-rule); background: var(--surface); box-shadow: 0 4px 16px rgba(45, 32, 20, .06); }
.feedback-panel { border-color: var(--surface-rule); border-radius: 12px; background: var(--surface); box-shadow: 0 16px 44px rgba(45, 32, 20, .13); }
.feedback-panel h2 { font-weight: 600; line-height: 1.12; }
.feedback-submit { background: var(--signal-strong); color: var(--surface); font-weight: 600; }
.feedback-submit:not(:disabled):hover { background: #a93716; }

/* Shared light code palette, excluding the separately maintained homepage proof. */
body:not([data-home-page]) .code-frame,
.surface-dialog .code-frame { border-color: var(--surface-rule); border-radius: 10px; background: var(--code-paper); box-shadow: none; }
body:not([data-home-page]) .code-toolbar,
.surface-dialog .code-toolbar { border-color: var(--surface-rule); background: var(--code-paper); }
body:not([data-home-page]) .code-frame pre.copyable-code,
.surface-dialog .code-frame pre.copyable-code { background: var(--code-paper); color: var(--code-ink); font-size: .82rem; line-height: 1.75; }
:is(.docs-page, .app-page .developer-setup) .connection-panel-setup .code-frame code,
body:not([data-home-page]) .code-frame code { color: var(--code-ink); }
body:not([data-home-page]) .code-frame .copy-button,
.surface-dialog .code-frame .copy-button { min-height: 36px; border-color: var(--surface-rule-strong); background: var(--surface); color: var(--code-ink); font-weight: 600; box-shadow: none; }
body:not([data-home-page]) .code-frame .copy-button:hover,
.surface-dialog .code-frame .copy-button:hover { background: #e6decf; }
.code-scroll:focus-visible { outline-offset: -3px; }
:is(body:not([data-home-page]), .surface-dialog) :is(.code-frame) :is(.token.comment, .syntax-comment) { color: #6f6559; font-style: italic; }
:is(body:not([data-home-page]), .surface-dialog) :is(.code-frame) :is(.token.keyword, .syntax-keyword) { color: #954821; }
:is(body:not([data-home-page]), .surface-dialog) :is(.code-frame) :is(.token.string, .syntax-string) { color: #39604a; }
:is(body:not([data-home-page]), .surface-dialog) :is(.code-frame) :is(.token.number, .syntax-number, .token.boolean, .syntax-boolean) { color: #855627; }
:is(body:not([data-home-page]), .surface-dialog) :is(.code-frame) :is(.token.function, .syntax-function) { color: #6f4e77; }
:is(body:not([data-home-page]), .surface-dialog) :is(.code-frame) :is(.token.property, .syntax-property, .token.attr-name, .syntax-key) { color: #345e62; }
:is(body:not([data-home-page]), .surface-dialog) :is(.code-frame) :is(.token.operator, .token.punctuation, .syntax-operator, .syntax-punctuation) { color: #726151; }

/* Legal pages read as a document, without a separate card for every paragraph. */
.legal-page { max-width: 1000px; }
.legal-page .page-hero { max-width: 760px; margin-inline: auto; }
.legal-page .page-hero h1 { font-size: clamp(2.6rem, 5vw, 4.25rem); line-height: 1.04; letter-spacing: -.025em; }
.legal-page .doc-stack { max-width: 760px; margin-inline: auto; gap: 0; }
.legal-page .doc-section { padding: 30px 0; border: 0; border-top: 1px solid var(--surface-rule); border-radius: 0; background: transparent; }
.legal-page .doc-section h2 { margin: 0 0 14px; font-size: 1.6rem; font-weight: 600; line-height: 1.2; }
.legal-page .doc-section :is(p, li) { color: var(--surface-quiet); font-size: 1rem; line-height: 1.8; }
.legal-page .doc-section p:last-child { margin-bottom: 0; }
.legal-page .doc-section a { color: var(--ink); text-decoration: underline; text-decoration-color: var(--surface-rule-strong); text-underline-offset: 3px; }
.legal-page .doc-section a:hover { color: var(--signal-strong); text-decoration-color: currentColor; }

@media (max-width: 760px) {
  body .site-header { min-height: 64px; }
  body[data-converter-page] .section-band { width: calc(100% - 36px); padding-block: 36px; }
  body[data-converter-page] .section-heading { grid-template-columns: 1fr; gap: 12px; }
  body[data-converter-page] .section-heading h2 { max-width: 26ch; margin-bottom: 0; }
  body[data-converter-page] .section-heading > p { font-size: .94rem; }
  .app-page .account-overview { padding: 22px 18px; }
  .app-page :is(.account-overview-head, .account-head-actions) { flex-wrap: wrap; }
  .app-page :is(.account-settings-grid, .account-setting-panel, .account-primary-metrics) { grid-template-columns: minmax(0, 1fr); }
  .app-page .account-access-details summary { gap: 12px; flex-wrap: wrap; }
  .app-page .account-section-nav { width: 100%; }
  .app-page .account-section-nav a { padding-inline: 12px; font-size: .82rem; }
  .auth-card { padding: 28px 22px; }
  .auth-gate-card { padding-top: 50px; }
  :is(.app-page, .auth-card) :is(input, select, textarea),
  #feedback-form :is(input, textarea) { font-size: 16px; }
  .feedback-panel { padding: 22px 18px; max-height: calc(100dvh - 96px); }
  .task-inbox-item { grid-template-columns: auto minmax(0, 1fr); }
  .task-inbox-actions { grid-column: 2; flex-wrap: wrap; }
  .legal-page .doc-section { padding-block: 26px; }
  .legal-page .doc-section h2 { font-size: 1.45rem; }
}

/* Task inbox rows: the filename slot can never collapse behind the action row —
   copy and dismiss sit on row one, actions and the delete-confirm bar on row two. */
.task-inbox-item {
  grid-template-columns: auto minmax(0, 1fr) auto;
  grid-template-areas:
    "marker copy dismiss"
    "marker actions actions"
    "marker confirm confirm";
  align-items: start;
}
.task-status-marker { grid-area: marker; margin-top: 6px; }
.task-inbox-copy { grid-area: copy; }
.task-inbox-actions {
  grid-area: actions;
  justify-self: end;
  flex-wrap: wrap;
}
.task-inbox-actions:empty { display: none; }
.task-inbox-dismiss {
  grid-area: dismiss;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  min-width: 28px;
  padding: 4px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.task-inbox-dismiss svg { display: block; }
.task-inbox-dismiss:hover,
.task-inbox-dismiss:focus-visible {
  background: color-mix(in srgb, var(--coral-soft) 70%, transparent);
  color: var(--signal-strong);
  outline: none;
}
.task-inbox-confirm {
  grid-area: confirm;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  padding-top: 2px;
}
.task-inbox-confirm[hidden] { display: none; }
.task-inbox-confirm span {
  color: var(--ink);
  font-size: 0.78rem;
}
.task-inbox-confirm button {
  min-height: 34px;
  padding: 6px 12px;
  border: 1px solid var(--ink);
  border-radius: 8px;
  background: var(--ink);
  color: var(--surface);
  cursor: pointer;
  font: 700 0.74rem/1.2 var(--sans);
}
.task-inbox-confirm button.secondary {
  border-color: var(--line-strong);
  background: var(--surface);
  color: var(--ink);
}
.task-inbox-item[data-confirming="true"] .task-status-marker { margin-top: 4px; }

/* Two-option billing choices read faster as a left/right segment than a dropdown. */
.billing-segmented {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
  justify-self: start;
  max-width: 100%;
  padding: 4px;
  border: 1px solid color-mix(in srgb, var(--signal) 22%, var(--line-strong));
  border-radius: 999px;
  background: color-mix(in srgb, var(--blue-soft) 54%, var(--surface));
}
/* The plan step carries 2–3 longer labels; a rounded row reads better than a
   pill cluster when the options wrap. */
.billing-segmented-plans {
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
  justify-self: stretch;
  width: 100%;
  border-radius: 14px;
}
.billing-segmented-plans .billing-segmented-option {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  text-align: left;
  border-radius: 10px;
  white-space: normal;
  line-height: 1.25;
}
.billing-segmented-plans .billing-segmented-option[aria-checked="true"]::after {
  margin-left: auto;
}
/* display rules above must not resurrect [hidden] options or the dismiss
   control while its confirm bar is open. */
.billing-segmented .billing-segmented-option[hidden],
.task-inbox-dismiss[hidden] { display: none !important; }
/* The picked segment points at the review panel so the left→right link is
   visible even before the summary pulse fires. */
.billing-segmented .billing-segmented-option[aria-checked="true"]::after {
  content: "→";
  margin-left: 7px;
  opacity: 0.7;
}
/* Scope to the group so the unselected option stays transparent — the broad
   .app-card button rule in styles.css would otherwise paint every segment ink. */
.billing-segmented .billing-segmented-option {
  min-height: 40px;
  padding: 9px 16px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font: 780 0.84rem/1 var(--sans);
  white-space: nowrap;
  transition: background 160ms ease, color 160ms ease, box-shadow 160ms ease;
}
.billing-segmented .billing-segmented-option:hover { color: var(--ink); }
.billing-segmented .billing-segmented-option[aria-checked="true"] {
  background: var(--ink);
  color: #fffdf8;
  box-shadow: 0 6px 16px rgba(27, 26, 23, 0.22);
}
.billing-segmented .billing-segmented-option:focus-visible {
  outline: 2px solid var(--signal);
  outline-offset: 2px;
}
.billing-segmented .billing-segmented-option:disabled { opacity: 0.5; cursor: default; }

/* brand.css re-inks .app-page small at 14px with higher specificity than the
   parity layer's font-size:0 trick, which made "Secure checkout" render twice
   (element text + ::after). Restore the pseudo-element-only rendering. */
body#brand-site[data-brand-ui] .app-page .billing-checkout-summary small {
  font-size: 0;
}

/* Changing a left-side choice visibly pulses the review panel so the link
   between selection and summary is impossible to miss. */
.billing-checkout-summary { transition: border-color 200ms ease, background 200ms ease; }
.billing-checkout-summary.is-updated {
  animation: billing-summary-pulse 1100ms ease;
}
.billing-checkout-summary.is-updated .billing-summary-mark {
  animation: billing-mark-slide 1100ms ease;
}
@keyframes billing-summary-pulse {
  0% {
    border-color: var(--signal);
    background: color-mix(in srgb, var(--amber-soft) 72%, var(--surface));
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--signal) 24%, transparent);
  }
  100% {
    border-color: rgba(40, 113, 83, 0.22);
    background: rgba(232, 247, 239, 0.58);
    box-shadow: 0 0 0 0 transparent;
  }
}
@keyframes billing-mark-slide {
  0% { transform: translateX(-6px); color: var(--signal); }
  60% { transform: translateX(2px); color: var(--signal); }
  100% { transform: translateX(0); }
}

/* API key rows and the connect-for-agent strip share the key motif. */
.api-key-row-main {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-width: 0;
}
.api-key-row-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--surface);
  color: var(--signal-strong);
}
.api-key-row-copy { display: grid; gap: 3px; min-width: 0; }
.api-key-row-copy strong,
.api-key-row-copy small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
/* The create flow belongs in the card body as a full-width disclosure: the
   summary is a secondary expander (bordered, not a dark CTA), and the real
   submit inside stays the single primary action. The old parity layout parked
   a dark same-labelled button in the hero corner, which read as two competing
   "Create API key" CTAs. */
.api-key-create-flow { width: 100%; margin-top: 4px; }
.api-key-create-flow > summary {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  width: fit-content;
  margin-left: 0;
  padding: 9px 15px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: var(--surface);
  color: var(--ink);
  font-weight: 700;
  font-size: 0.84rem;
  list-style: none;
  transition: border-color 150ms ease, background 150ms ease;
}
.api-key-create-flow > summary::-webkit-details-marker { display: none; }
.api-key-create-flow > summary::after {
  content: "▾";
  color: var(--muted);
  font-size: 0.8em;
  transition: transform 160ms ease;
}
.api-key-create-flow[open] > summary {
  border-radius: 10px 10px 0 0;
  border-bottom-color: transparent;
}
.api-key-create-flow[open] > summary::after { transform: rotate(180deg); }
.api-key-create-flow > summary:hover { border-color: var(--signal); }
.api-key-create-flow summary .api-key-icon { color: var(--signal-strong); }
.api-key-create-context {
  border-radius: 0 10px 10px 10px;
  justify-items: start;
}
.api-key-create-context button {
  width: auto;
  min-width: 200px;
}
/* Secret reveal: the copy control sits inline with the secret value it
   copies (token-field pattern) instead of floating in the box header, and
   uses ghost-action so the card keeps a single dark primary. */
.secret-value-row {
  display: flex;
  align-items: stretch;
  gap: 8px;
}
.secret-value-row code {
  flex: 1 1 auto;
  min-width: 0;
}
.secret-box #copy-api-key.ghost-action {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
@media (max-width: 640px) {
  .secret-value-row { flex-direction: column; }
  .secret-box #copy-api-key.ghost-action {
    width: 100%;
    min-height: 46px;
    justify-content: center;
  }
}
.api-key-agent-strip { margin-top: 14px; }
.api-key-agent-strip:empty { display: none; }
/* Inside the card the strip reads as a full-width row aligned with the key
   list, not a floating centered pill. The mount carries both classes. */
.api-key-agent-strip.agent-install {
  justify-content: flex-start;
  width: 100%;
  max-width: none;
  margin: 0;
  border-radius: 12px;
  text-align: left;
}
.api-key-agent-strip.agent-install .agent-install-text {
  flex: 1 1 auto;
  white-space: normal;
}
/* Inside the account card the strip's copy action is supporting, not a
   second primary — bordered ghost style keeps Create API key as the only
   dark CTA. Scoped to this mount so docs strips keep the ink button. */
.api-key-agent-strip.agent-install .agent-install-button {
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: var(--surface);
  color: var(--ink);
}
.api-key-agent-strip.agent-install .agent-install-button:hover {
  opacity: 1;
  border-color: var(--signal);
}

@media (prefers-reduced-motion: reduce) {
  :is(.surface-dialog, .auth-gate-dialog)[open], .surface-dialog::backdrop { animation: none; }
  :is(.site-header, .app-page, .auth-card, .feedback-panel, .result-panel) :is(a, button, input, textarea) { transition: none; }
  .billing-checkout-summary.is-updated { animation: none; }
}

/* R24 · Plan options read as comparable cards (name / price / quota / real
   capacity) instead of bare text rows — the Stripe/Linear picker pattern in
   our tokens. Cards keep .billing-segmented-option for radio semantics; the
   rules below only reshape layout + the selected treatment. */
.billing-plan-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
  width: 100%;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}
.billing-plan-cards .billing-segmented-option.billing-plan-card {
  position: relative;
  display: grid;
  grid-template-rows: auto auto auto 1fr;
  gap: 5px;
  align-items: stretch;
  min-height: 0;
  padding: 13px 15px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  background: var(--surface);
  color: var(--ink);
  text-align: left;
  white-space: normal;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}
.billing-plan-cards .billing-plan-card:hover {
  border-color: var(--ink);
  transform: translateY(-1px);
}
.billing-plan-cards .billing-segmented-option[aria-checked="true"] {
  background: var(--surface);
  border-color: var(--ink);
  box-shadow: 0 0 0 1px var(--ink), 0 10px 24px rgba(27, 26, 23, 0.1);
  color: var(--ink);
}
/* Selected card still points at the review panel — the left→right cue lives
   in the card corner instead of trailing the row text. */
.billing-plan-cards .billing-segmented-option[aria-checked="true"]::after {
  position: absolute;
  top: 10px;
  right: 12px;
  margin: 0;
  opacity: 0.55;
}
/* ── R25 · 选套餐单列纵贯：上方直选卡片、下方下单条（Stripe/Linear/Notion
   billing 的主流模式），不再左侧选右侧结账。 */
.billing-workspace {
  grid-template-columns: minmax(0, 1fr);
}

/* 卡片栏放宽：单列空间下订阅 2 卡、充值 3 卡都能完整并排 */
.billing-plan-cards {
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}
.billing-plan-cards .billing-segmented-option.billing-plan-card {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

/* R25 · 呼吸感：reader 大纲不再贴死 header（tab 条已在 R27 改静态）。 */
body[data-brand-page="markdown-reader"] .reader-outline-inner {
  top: calc(96px + var(--preview-bar-height, 0px));
  max-height: calc(100vh - 114px - var(--preview-bar-height, 0px));
}

/* R25 · Job 行动作分层：Open in Reader 是唯一深色主动作；Download 降为
   轻量描边次级 + 下载图标，不再一排大黑块。 */
.app-page .job-history-actions .job-secondary-action {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 40px;
  padding: 9px 13px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: var(--surface);
  color: var(--ink);
  font-weight: 700;
  font-size: 0.84rem;
  text-decoration: none;
}
.app-page .job-history-actions .job-secondary-action:hover {
  border-color: var(--ink);
}

/* R25 · AI agent 条从 key 列表附属升级为独立板块——上下留白 + 小标题 +
   独立边框，与 key 区和连接设置区明显区隔。 */
.api-key-agent-strip.agent-install {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 8px 12px;
  align-items: center;
  margin-top: 22px;
  padding: 15px 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: color-mix(in srgb, var(--blue-soft) 30%, var(--surface));
}
.api-key-agent-strip.agent-install::before {
  content: "Connect an AI agent";
  grid-column: 1 / -1;
  font: 700 0.68rem/1 var(--sans);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}
.api-key-agent-strip.agent-install .agent-install-status {
  grid-column: 1 / -1;
}

/* ── R26 · 轻强调统一：选中分段不再实心黑，黑只留给 checkout 大 CTA。 */

/* Toggles 挪到卡片上方一行，主要区域全部留给 plan 卡。 */
.billing-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 26px;
  align-items: flex-end;
  margin-bottom: 4px;
}
.billing-toolbar .select-row { min-width: 0; }

/* Billing 区内选中态 = 轻强调（ink 描边 + 柔底），不再实心黑块。 */
.billing-builder .billing-segmented .billing-segmented-option[aria-checked="true"] {
  background: var(--surface);
  color: var(--ink);
  box-shadow: inset 0 0 0 1.5px var(--ink);
}
.billing-builder .billing-segmented-plans .billing-segmented-option[aria-checked="true"] {
  background: color-mix(in srgb, var(--blue-soft) 40%, var(--surface));
}

/* 下单条：checkout 按钮变大，summary 安静，管理行降级为脚注。 */
.billing-order > #checkout-button {
  min-width: 300px;
  min-height: 54px;
  padding: 15px 30px;
  font-size: 1.02rem;
  font-weight: 800;
}
.billing-order .billing-checkout-summary {
  padding: 13px 16px;
}
.billing-order .billing-management-row {
  margin-top: 2px;
  padding-top: 12px;
  border-top: 1px dashed var(--line);
}
.billing-order .billing-management-row strong {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--muted);
}
.billing-order .billing-management-row span {
  font-size: 0.76rem;
  color: var(--muted);
}

/* Plan 卡可读性：名称/价格加大，辅助行分层更清楚。 */
.billing-plan-cards .billing-segmented-option.billing-plan-card {
  gap: 7px;
  padding: 15px 17px;
}

/* 轻强调范式：job 行三个动作、View plans、Create/Delete API key 统一为
   描边轻按钮——页面只有一个深色主动作（checkout）。 */
.app-page .job-history-actions .job-primary-action {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 40px;
  padding: 9px 13px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: var(--surface);
  color: var(--ink);
  font-weight: 700;
  font-size: 0.84rem;
  text-decoration: none;
}
.app-page .job-history-actions .job-primary-action:hover {
  border-color: var(--ink);
}
.app-page .account-plan-action {
  display: inline-flex;
  width: fit-content;
  margin-top: 5px;
  padding: 8px 11px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: var(--surface);
  color: var(--ink);
  font-weight: 700;
  font-size: 0.84rem;
  text-decoration: none;
}
.app-page .account-plan-action:hover {
  border-color: var(--ink);
}
.app-page .account-overview-usage .doc-link {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 8px 13px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: var(--surface);
  color: var(--ink);
  font-weight: 700;
  font-size: 0.84rem;
  text-decoration: none;
}
.app-page .account-overview-usage .doc-link:hover {
  border-color: var(--ink);
}
.app-card button#create-api-key,
.app-card button#confirm-api-key-remove {
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink);
  font-weight: 700;
}
.app-card button#create-api-key:hover,
.app-card button#confirm-api-key-remove:hover {
  border-color: var(--ink);
}

/* 轻强调范式统一：所有 ghost-action 与 job 次级按钮同一边框深度，避免
   API keys / Sign out / Manage billing 各自深浅不一。 */
.app-page .ghost-action {
  border-color: var(--line-strong);
  background: var(--surface);
}
.app-page .ghost-action:not(:disabled):hover {
  border-color: var(--ink);
}

/* ── R27 · 平面化 + 静态导航 + checkout 并入选套餐块 + Plans 减枝 ── */

/* 按钮全平面：job 行、ghost、分段选中态全部去阴影，与 More 同平面。 */
.app-page .job-history-actions .job-primary-action,
.app-page .job-history-actions .job-secondary-action,
.app-page .ghost-action,
.app-page .account-plan-action,
.app-page .account-overview-usage .doc-link,
.billing-builder .billing-segmented .billing-segmented-option[aria-checked="true"],
.billing-plan-cards .billing-segmented-option {
  box-shadow: none;
}

/* 四 tab 固定在页面顶部（不跟随滚动），上下等间距——margin-bottom
   对齐页面自带 padding-top，视觉上下对称。 */
.app-page .account-section-nav {
  position: static;
  top: auto;
  margin: 0 auto 46px;
}

/* checkout 行并入 builder 卡：上边框分隔 = 选完即下单，同一视觉单元。 */
.billing-checkout-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px 22px;
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--line-strong);
}
.billing-checkout-row #billing-action-status {
  grid-column: 1 / -1;
  margin: 0;
}
.billing-checkout-row #checkout-button {
  min-width: 300px;
  min-height: 54px;
  padding: 15px 30px;
  font-size: 1.02rem;
  font-weight: 800;
}
@media (max-width: 640px) {
  .billing-checkout-row { grid-template-columns: minmax(0, 1fr); }
  .billing-checkout-row #checkout-button { width: 100%; }
}

/* 下半区降级：management / current plan 是独立安静块，不再是下单卡片。 */
.app-page .billing-order {
  display: block;
  padding: 4px 6px 0;
  border: 0;
  background: transparent;
}
.app-page .billing-order .billing-management-row {
  border-top: 1px dashed var(--line);
  padding-top: 14px;
}
.billing-order .billing-management-row strong {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--muted);
}
.billing-order .billing-management-row span {
  font-size: 0.76rem;
  color: var(--muted);
}

/* Plans 减枝：选中项不再带 → 尾巴；摘要脉冲动效（红→绿）关闭；
   摘要条去绿色调、去圆形箭头图标，回到安静的中性 surface；
   toggle 标签降级为小字。 */
.billing-segmented .billing-segmented-option[aria-checked="true"]::after { content: none; }
.billing-checkout-row .billing-checkout-summary {
  margin-top: 0;
  border-color: var(--line-strong);
  background: var(--surface-warm, rgba(255, 253, 248, 0.82));
}
.billing-checkout-row .billing-summary-mark { display: none; }
.billing-checkout-summary.is-updated,
.billing-checkout-summary.is-updated .billing-summary-mark {
  animation: none;
}
.billing-builder .billing-step-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
}
.billing-builder .billing-step-label em {
  font-style: normal;
  text-transform: none;
  letter-spacing: 0;
  font-weight: 500;
}

/* Connect an AI Agent 独立板块：与上下卡片等距、自有边框标题。 */
.api-key-agent-block {
  padding: 16px 20px;
}
.api-key-agent-block .api-key-agent-strip.agent-install {
  margin-top: 0;
  padding: 0;
  border: 0;
  background: transparent;
}

/* Current plan 卡：renews 信息与 View plans 同一行，日期细微强调。 */
.plan-summary-card .plan-renew-row {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  margin-top: 8px;
}
.plan-summary-card .plan-renew-row small {
  margin: 0;
  font-weight: 700;
  color: var(--signal-strong);
  letter-spacing: 0.02em;
}
.plan-summary-card .account-plan-action {
  margin-top: 0;
}

/* ── R28 · 细节质感：hidden 兜底 / 触控优化 / 数字等宽 ── */

/* 红线 #8 页面级兜底：任何 display 规则都不许复活 hidden 元素。 */
.app-page [hidden] {
  display: none !important;
}

/* 触控质量：双击不触发缩放延迟，点按无默认高亮。 */
.app-page .account-section-nav a,
.app-page .ghost-action,
.app-page .account-plan-action,
.app-page .doc-link,
.billing-builder .billing-segmented-option,
.billing-checkout-row #checkout-button,
.app-page .job-history-actions
  :is(.job-primary-action, .job-secondary-action, .job-more-actions > summary) {
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

/* 数字排版：价格/容量/额度数字列等宽，月年切换不抖动。 */
.credit-balance-card strong,
.plan-summary-card .plan-renew-row small,
.billing-plan-card .plan-amount,
.billing-plan-card .plan-credits-hero,
.billing-checkout-summary strong {
  font-variant-numeric: tabular-nums;
}

/* ── R29 · 结算 CTA 独立样式 + job 行对齐/状态图标 + plan 卡布局 ── */

/* 专用结算按钮：terracotta 实心（品牌 accent），不是黑色也不是浅色描边——
   账户 checkout 与 pricing 页 plan-action 共用同一范式。
   需 #brand-site ID 前缀压过 brand.css 的墨色 plan-action 规则；
   .secondary（Contact us 等）保持安静描边，不吃实心色。 */
body#brand-site #checkout-button,
body#brand-site[data-brand-ui][data-pricing-page] .pricing-column .plan-action:not(.secondary),
body#brand-site[data-brand-ui][data-pricing-page] .pack-card .plan-action:not(.secondary) {
  border: 1px solid color-mix(in srgb, var(--accent) 80%, #000 20%);
  border-radius: 10px;
  background: var(--accent);
  color: #fffdf8;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.16),
    0 10px 22px -12px color-mix(in srgb, var(--accent) 70%, transparent);
  transition:
    background-color 160ms ease,
    border-color 160ms ease,
    transform 160ms ease,
    box-shadow 160ms ease;
}
body#brand-site #checkout-button:hover,
body#brand-site[data-brand-ui][data-pricing-page] .pricing-column .plan-action:not(.secondary):hover,
body#brand-site[data-brand-ui][data-pricing-page] .pack-card .plan-action:not(.secondary):hover {
  border-color: color-mix(in srgb, var(--accent) 68%, #000 32%);
  background: color-mix(in srgb, var(--accent) 88%, #000 12%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.16),
    0 14px 26px -12px color-mix(in srgb, var(--accent) 78%, transparent);
  transform: translateY(-1px);
}
body#brand-site #checkout-button:active,
body#brand-site[data-brand-ui][data-pricing-page] .pricing-column .plan-action:not(.secondary):active,
body#brand-site[data-brand-ui][data-pricing-page] .pack-card .plan-action:not(.secondary):active {
  transform: translateY(0);
}
/* 次级购买入口（Contact us）：accent 描边安静变体，与实心 CTA 同族不同权重。 */
body#brand-site[data-brand-ui][data-pricing-page] .pack-card .plan-action.secondary {
  border: 1px solid color-mix(in srgb, var(--accent) 42%, var(--line));
  border-radius: 10px;
  background: var(--surface);
  color: var(--accent);
  box-shadow: none;
}
body#brand-site[data-brand-ui][data-pricing-page] .pack-card .plan-action.secondary:hover {
  border-color: var(--accent);
}

/* checkout 行：删摘要重复信息后回到一整条横条，去掉与选卡区之间的分隔线。 */
.billing-checkout-row {
  grid-template-columns: minmax(0, 1fr);
  margin-top: 16px;
  padding-top: 0;
  border-top: 0;
}
.billing-checkout-row #checkout-button {
  width: 100%;
  min-width: 0;
  min-height: 54px;
  font-size: 1.02rem;
  font-weight: 800;
}
.billing-checkout-row #billing-action-status {
  margin: 0;
}

/* Current plan 卡：左侧信息列、View plans 右侧垂直居中（稍大按钮）。 */
.plan-summary-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  column-gap: 18px;
  align-items: start;
}
.plan-summary-card > span,
.plan-summary-card > .plan-title-row,
.plan-summary-card > .plan-renew-row {
  grid-column: 1;
}
.plan-summary-card > .account-plan-action {
  grid-column: 2;
  grid-row: 1 / -1;
  align-self: center;
  margin-top: 0;
  padding: 10px 16px;
  font-size: 0.86rem;
  font-weight: 700;
  white-space: nowrap;
}

/* Account 头部 API keys：升级为带 key 图标的轻按钮（图标用品牌成功色点题）。 */
.app-page .account-api-keys-link {
  display: inline-flex;
  gap: 7px;
  align-items: center;
}
.app-page .account-api-keys-link svg {
  flex: none;
  color: var(--green);
}

/* Job 行三按钮严格同高同基线：More(summary) 与两个按钮同一几何。 */
.app-page .job-history-actions {
  align-items: stretch;
}
.app-page .job-history-actions .job-primary-action,
.app-page .job-history-actions .job-secondary-action,
.app-page .job-history-actions .job-more-actions > summary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 40px;
  padding: 9px 13px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: var(--surface);
  color: var(--ink);
  font: 700 0.84rem/1 var(--sans);
  cursor: pointer;
}
.app-page .job-history-actions .job-more-actions > summary {
  list-style: none;
}
.app-page .job-history-actions .job-more-actions > summary::-webkit-details-marker {
  display: none;
}

/* Job 状态改图标优先：✓ 完成、转圈=进行中、✕ 失败、⊘ 已删、! 需注意。 */
.app-page .job-history-list .pill,
.app-page .activity-list .pill,
.app-page .table-list .pill {
  display: inline-flex;
  gap: 6px;
  align-items: center;
}
.app-page .job-history-list .pill[data-status]::before,
.app-page .activity-list .pill[data-status]::before,
.app-page .table-list .pill[data-status]::before {
  flex: none;
  display: inline-block;
  width: 12px;
  height: 12px;
  content: "";
}
.app-page .pill[data-status="succeeded"]::before {
  content: "✓";
  width: auto;
  height: auto;
  color: var(--green);
  font-weight: 900;
  font-size: 0.85em;
  line-height: 1;
}
.app-page .pill[data-status="running"]::before,
.app-page .pill[data-status="queued"]::before {
  border: 2px solid color-mix(in srgb, currentColor 30%, transparent);
  border-top-color: currentColor;
  border-radius: 50%;
  animation: job-status-spin 0.9s linear infinite;
}
.app-page .pill[data-status="failed"]::before,
.app-page .pill[data-status="attention"]::before {
  content: "!";
  width: auto;
  height: auto;
  font-weight: 900;
  font-size: 0.85em;
  line-height: 1;
}
.app-page .pill[data-status="cancelled"]::before,
.app-page .pill[data-status="canceled"]::before,
.app-page .pill[data-status="removed"]::before {
  content: "⊘";
  width: auto;
  height: auto;
  font-weight: 800;
  font-size: 0.8em;
  line-height: 1;
}
@keyframes job-status-spin {
  to { transform: rotate(360deg); }
}
@media (prefers-reduced-motion: reduce) {
  .app-page .pill[data-status="running"]::before,
  .app-page .pill[data-status="queued"]::before {
    animation: none;
  }
}

/* ── R30 · pricing v3 卡片样式共享化 + 头部按钮统一 + job 行对齐 + icon-only 状态 ── */

/* pricing v3 卡片：demo 与正牌 pricing 页共用（.pricing-page 作用域）。
   tagline 入名下方、Credits 大数字 hero、SVG 容量行、量化升级徽标。 */
.pricing-page .plan-name { margin-bottom: 2px; }
.pricing-page .plan-tagline {
  margin: 0 0 14px;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--muted, #6b635a);
}
.pricing-page .plan-tagline span { font-weight: 700; color: var(--ink-soft); }
.pricing-page .plan-price { margin-bottom: 12px; }
.pricing-page .plan-credits-hero {
  display: flex;
  gap: 8px;
  align-items: baseline;
  margin: 0 0 12px;
  padding: 10px 12px;
  border: 1px solid var(--line, #e4dfd2);
  border-radius: 8px;
  background: rgba(255, 253, 248, 0.7);
}
.pricing-page .plan-credits-hero strong {
  font-family: var(--font-display, var(--sans, sans-serif));
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--ink);
  letter-spacing: -0.02em;
}
.pricing-page .plan-credits-hero span {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--muted, #6b635a);
}
.pricing-page .plan-capacity-icons {
  display: grid;
  gap: 6px;
  margin: 0 0 14px;
  padding: 0 0 14px;
  border-bottom: 1px solid var(--line, #e4dfd2);
  list-style: none;
}
.pricing-page .plan-capacity-icons li {
  display: flex;
  gap: 8px;
  align-items: center;
  color: var(--muted, #6b635a);
}
.pricing-page .plan-capacity-icons li svg { flex: none; opacity: 0.75; }
.pricing-page .plan-capacity-icons li span { font-size: 0.78rem; }
.pricing-page .plan-capacity-icons li b { font-weight: 800; color: var(--ink); }
.pricing-page .plan-features strong.up { color: var(--signal-strong, #155f4e); }
.pricing-page .plan-features strong.up::before { content: "↑ "; font-weight: 800; }
.pricing-page .up-mult {
  display: inline-block;
  margin-left: 6px;
  padding: 2px 6px;
  border: 1px solid color-mix(in srgb, var(--accent) 42%, var(--line));
  border-radius: 999px;
  background: color-mix(in srgb, var(--amber-soft, #ffefd6) 60%, var(--surface));
  color: var(--accent);
  font: 800 0.62rem/1.3 var(--sans, sans-serif);
  font-style: normal;
  letter-spacing: 0.02em;
  vertical-align: 1px;
  white-space: nowrap;
}
.pricing-page .plan-credits-hero .up-mult {
  margin-left: auto;
  align-self: center;
  font-size: 0.66rem;
}
.pricing-page .plan-amount,
.pricing-page .plan-credits-hero strong,
.pricing-page .plan-capacity-icons b {
  font-variant-numeric: tabular-nums;
}

/* page-polish 给首行加过 lead 盒式样式（border-block+大 padding），
   v3 卡片首行是普通特性行——提权清除，恢复行间距。 */
body[data-pricing-page] .pricing-page .pricing-column .monthly-plan-grid .plan-features li:first-child {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  margin: 0;
  padding: 8px 0;
  border: 0;
  border-bottom: 1px solid color-mix(in srgb, var(--line) 65%, transparent);
  border-radius: 0;
  background: none;
}
body[data-pricing-page] .pricing-page .pricing-column .monthly-plan-grid .plan-features li:first-child span {
  color: var(--ink-soft);
  font: inherit;
  letter-spacing: 0;
  text-transform: none;
}
body[data-pricing-page] .pricing-page .pricing-column .monthly-plan-grid .plan-features li:first-child strong {
  font-family: inherit;
  font-size: inherit;
  font-weight: 760;
  text-align: right;
  color: var(--ink);
}

/* interval toggle：Annual · 2 months free 不换行、白丸不错位。 */
body[data-pricing-page] .billing-interval-toggle { min-width: 0; align-items: center; }
body[data-pricing-page] .billing-interval-toggle::before { display: none; }
body[data-pricing-page] .billing-interval-toggle button {
  width: auto;
  flex: 1 1 auto;
  min-width: 0;
  padding: 8px 13px;
  white-space: nowrap;
  font-size: 0.78rem;
  border-radius: 999px;
}
body[data-pricing-page] .billing-interval-toggle button[aria-pressed="true"] {
  width: auto;
  flex: 1 1 auto;
  background: var(--surface);
  box-shadow: 0 1px 4px rgba(30, 26, 18, 0.12);
  color: var(--ink);
}
.pricing-page .billing-interval-toggle button,
.pricing-page .plan-action {
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

/* 头部动作与 View plans 统一：同字号同字重同高，不再一个 16px 一个 14px。 */
.app-page .account-head-actions .ghost-action,
.app-page .account-plan-action,
.app-page .account-overview-usage .doc-link {
  min-height: 40px;
  padding: 9px 14px;
  font-size: 0.875rem;
  font-weight: 700;
  line-height: 1;
}
.app-page .account-head-actions .ghost-action {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

/* Job 行：三按钮不换行、严格同高同基线（details 容器对齐到行高）。 */
.app-page .job-history-actions {
  flex-wrap: nowrap;
  align-items: center;
}
.app-page .job-history-actions .job-more-actions {
  display: flex;
  align-items: stretch;
  margin: 0;
  min-height: 40px;
}
.app-page .job-history-actions .job-more-actions > summary {
  height: 100%;
  box-sizing: border-box;
}
.app-page .job-history-list .table-row > .api-key-row-main,
.app-page .job-history-list .table-row > div:first-child {
  min-width: 0;
}

/* 状态 pill 图标化：只显示图标，文字走 aria-label。 */
.app-page .job-history-list .pill[data-status],
.app-page .activity-list .pill[data-status],
.app-page .table-list .pill[data-status] {
  gap: 0;
  min-width: 26px;
  min-height: 26px;
  padding: 4px;
  justify-content: center;
  border-radius: 999px;
}
.app-page .pill[data-status="succeeded"]::before,
.app-page .pill[data-status="failed"]::before,
.app-page .pill[data-status="attention"]::before,
.app-page .pill[data-status="cancelled"]::before,
.app-page .pill[data-status="canceled"]::before,
.app-page .pill[data-status="removed"]::before {
  font-size: 12px;
}

/* API key 命名输入：与创建流同排，样式贴近其他表单项。 */
.app-page .api-key-name-field {
  display: flex;
  gap: 8px;
  align-items: center;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--ink-soft);
}
.app-page .api-key-name-field input {
  flex: 1;
  min-width: 0;
  padding: 8px 10px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  font: 500 0.82rem/1.3 var(--sans);
}
.app-page .api-key-name-field input:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

/* pricing 页 [hidden] 兜底（plan-save 的 data-annual-only 切换依赖）；
   rate-callout 原 demo 样式并入共享（正牌页同构）。 */
body[data-pricing-page] [hidden] { display: none !important; }
.pricing-page .rate-callout {
  margin-top: 14px;
  padding: 12px 16px;
  border-radius: 12px;
  border: 1px dashed var(--line-strong, #d8cbb8);
  font-size: 0.82rem;
  color: var(--muted, #6b635a);
}

/* job 行链接带 .doc-link 的 margin-top:8px——flex 居中时被推低 4px，清零。 */
.app-page .job-history-actions .job-primary-action,
.app-page .job-history-actions .job-secondary-action {
  margin-top: 0;
}

/* ── R31 · 跨页一致性审计收口 ─────────────────────────────────────────────
   hidden 语义全局兜底 + 头部控件同高 + job summary 字号对齐按钮。 */
body[data-brand-ui] [hidden] { display: none !important; }
body#brand-site[data-brand-ui] .site-header .header-actions > :is(a, button, details) {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}
body#brand-site[data-brand-ui] .site-header .header-actions > details > summary {
  min-height: 44px;
  padding-block: 4px;
  display: inline-flex;
  align-items: center;
  box-sizing: border-box;
}
body#brand-site[data-brand-ui] .app-page .job-history-actions .job-more-actions > summary {
  font-size: 0.84rem;
}

/* ── R32 · pricing 压缩 + 状态圆点 + key 弹窗 + plans 卡继承 ────────────────
   用户反馈收口：一屏完成下单、状态图标化、Plans 继承 pricing 卡视觉。 */

/* pricing 纵向压缩：一屏看完三张卡并完成下单。 */
.pricing-page .plan-tagline { margin-bottom: 8px; }
.pricing-page .plan-price { margin-bottom: 8px; }
body[data-pricing-page] .pricing-page .pricing-column .plan-price-meta {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  flex-wrap: nowrap;
  flex-basis: auto;
  margin: 0 0 8px 0;
  white-space: normal;
}
.pricing-page .plan-price-meta .plan-credit-rate { flex: 1; min-width: 0; }
.pricing-page .plan-price-meta .plan-save { margin-top: 1px; }
.pricing-page .plan-credits-hero { padding: 7px 11px; margin-bottom: 9px; }
.pricing-page .plan-capacity-icons { gap: 4px; margin-bottom: 9px; padding-bottom: 9px; }
.pricing-page .plan-features li { padding-block: 4px; }
body[data-pricing-page] .pricing-page .pricing-column .monthly-plan-grid .plan-features li:first-child { padding-block: 4px; }
body[data-pricing-page] .pricing-page .plans-heading-box { padding-bottom: 10px; }
body[data-pricing-page] .pricing-page .monthly-plan-grid { margin-top: 10px; }
body#brand-site[data-brand-ui][data-pricing-page] .pricing-page .pricing-column .monthly-plan-grid .price-card { padding: 18px; }
.pricing-page .plan-action { margin-top: 8px; }

/* plan-save 徽标与 rate 文案同一行：与 meta 同排展示。 */
.pricing-page .plan-save {
  flex: none;
  padding: 2px 7px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--green, #68785c) 14%, var(--surface));
  color: var(--green, #4f6248);
  font: 800 0.64rem/1.4 var(--sans, sans-serif);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
}
.pricing-page .plan-badge-early {
  margin-left: 4px;
  background: color-mix(in srgb, var(--accent) 12%, var(--surface));
  color: var(--accent);
}

/* Plans 页卡继承 pricing 视觉：白卡+圆角+阴影+terracotta 选中。 */
.app-page .billing-plan-cards .billing-segmented-option.billing-plan-card {
  padding: 16px 18px;
  border: 1px solid var(--line-strong, #d8d2c4);
  border-radius: 14px;
  background: var(--surface, #fffdf8);
  box-shadow: 0 1px 3px rgba(30, 26, 18, 0.05);
  text-align: left;
}
.app-page .billing-plan-cards .billing-segmented-option.billing-plan-card:hover {
  border-color: var(--accent);
}
.app-page .billing-plan-cards .billing-segmented-option.billing-plan-card[aria-checked="true"] {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent), 0 4px 14px color-mix(in srgb, var(--accent) 16%, transparent);
}
/* 状态圆点范式：Active 等非列表状态用绿点，不走文字 pill。 */
.app-page .pill[data-status="active"] {
  gap: 0;
  min-width: 26px;
  min-height: 26px;
  padding: 4px;
  justify-content: center;
  border-radius: 999px;
}
.app-page .pill[data-status="active"]::before {
  flex: none;
  width: 10px;
  height: 10px;
  content: "";
  border-radius: 50%;
  background: var(--green, #4f6248);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--green, #68785c) 22%, transparent);
}

/* API key 行：压缩上下间距（原来留白过大）。 */
.app-page .table-list .api-key-row { padding-block: 10px; }
.app-page .secret-box { padding: 14px 16px; }
.app-page .api-key-create-trigger {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 40px;
  padding: 9px 14px;
  border: 1px solid var(--line-strong, #d8d2c4);
  border-radius: 10px;
  background: var(--surface, #fffdf8);
  color: var(--ink);
  font: 700 0.875rem/1 var(--sans, sans-serif);
  cursor: pointer;
}
.app-page .api-key-create-trigger:hover:not(:disabled) { border-color: var(--accent); }
.app-page .api-key-create-trigger:disabled { opacity: 0.55; cursor: not-allowed; }

/* key 命名弹窗：与 remove-dialog 同范式。 */
.app-page #api-key-create-dialog .api-key-name-field {
  display: grid;
  gap: 6px;
  margin: 12px 0 4px;
  font: 700 0.8rem/1.3 var(--sans, sans-serif);
  color: var(--ink-soft);
}
.app-page #api-key-create-dialog .api-key-name-field input {
  padding: 10px 12px;
  border: 1px solid var(--line-strong, #d8d2c4);
  border-radius: 9px;
  background: var(--surface, #fffdf8);
  color: var(--ink);
  font: 500 0.9rem/1.3 var(--sans, sans-serif);
}
.app-page #api-key-create-dialog .api-key-name-field input:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

/* R32b · 再压缩：容量行横向、特性行收紧，CTA 进一屏。 */
.pricing-page .plan-capacity-icons li { gap: 6px; }
.pricing-page .plan-features li { padding-block: 3px; }
body[data-pricing-page] .pricing-page .pricing-column .monthly-plan-grid .plan-features li:first-child { padding-block: 3px; }
.pricing-page .plan-tagline { margin-bottom: 6px; }
.pricing-page .plan-price { margin-bottom: 6px; }
.pricing-page .plan-credits-hero { margin-bottom: 8px; }
.pricing-page .plan-capacity-icons { margin-bottom: 8px; padding-bottom: 8px; }
.pricing-page .rate-callout { margin-top: 12px; }

/* R32c · features 列表 gap 与巨号价格是压缩大头。 */
body[data-pricing-page] .pricing-page .plan-features { gap: 0; margin-bottom: 10px; }
body#brand-site[data-brand-ui][data-pricing-page] .pricing-page .plan-amount { font-size: 52px; line-height: 1; }

/* R32d · .table-list 作用域补齐后，符号 content 需同级提权回来。 */
.app-page .table-list .pill[data-status="succeeded"]::before { content: "✓"; width: auto; height: auto; }
.app-page .table-list .pill[data-status="failed"]::before,
.app-page .table-list .pill[data-status="attention"]::before { content: "!"; width: auto; height: auto; }
.app-page .table-list .pill[data-status="cancelled"]::before,
.app-page .table-list .pill[data-status="canceled"]::before,
.app-page .table-list .pill[data-status="removed"]::before { content: "⊘"; width: auto; height: auto; }

/* ── R33 · 徽标缩小 + 价格块收正 + nav 压缩 + 状态着色 + Plans 复用 pricing 卡 ── */

/* 徽标：brand.css 把 .plan-badge 顶成 14px/31px——压回小尺寸。 */
body#brand-site[data-brand-ui] .plan-badge,
body#brand-site[data-brand-ui] .pricing-page .plan-badge,
body#brand-site[data-brand-ui] .billing-plan-card .plan-badge {
  padding: 3px 7px;
  font-size: 0.58rem;
  line-height: 1.2;
}
.pricing-page .plan-badge-early {
  margin-left: 2px;
  padding: 3px 7px;
  font-size: 0.58rem;
}

/* 价格块收正：<p> 自带 44.84px 字号撑高，强制单行基线。 */
.pricing-page .plan-price {
  font-size: 1rem;
  line-height: 1;
  flex-wrap: nowrap;
  align-items: baseline;
}
.pricing-page .plan-price .plan-period { font-size: 0.9rem; }

/* account 四 tab：下方 46px 空隙压缩。 */
.app-page .account-section-nav { margin-bottom: 18px; }

/* 状态图形直出：去圆底，只留状态图标本身（✓/转圈/⊘），背景透明。 */
.app-page .table-list .pill[data-status] {
  min-width: 24px;
  min-height: 24px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
.app-page .table-list .pill[data-status="succeeded"] { color: var(--green, #4f6248); }
.app-page .table-list .pill[data-status="running"],
.app-page .table-list .pill[data-status="queued"] { color: var(--accent); }
.app-page .table-list .pill[data-status="failed"],
.app-page .table-list .pill[data-status="attention"] { color: #a2452c; }
.app-page .table-list .pill[data-status="cancelled"],
.app-page .table-list .pill[data-status="canceled"],
.app-page .table-list .pill[data-status="removed"] { color: var(--muted, #6b635a); }
.app-page .table-list .pill[data-status]::before { width: 16px; height: 16px; }
.app-page .table-list .pill[data-status="succeeded"]::before,
.app-page .table-list .pill[data-status="failed"]::before,
.app-page .table-list .pill[data-status="attention"]::before,
.app-page .table-list .pill[data-status="cancelled"]::before,
.app-page .table-list .pill[data-status="canceled"]::before,
.app-page .table-list .pill[data-status="removed"]::before {
  font-size: 16px;
  line-height: 16px;
}
.app-page .pill[data-status="running"]::before,
.app-page .pill[data-status="queued"]::before {
  border-width: 2.5px;
  border-color: color-mix(in srgb, currentColor 30%, transparent);
  border-top-color: currentColor;
  border-right-color: currentColor;
}

/* Plans 卡直接复用 pricing 卡视觉（同名类结构，单一视觉源）。 */
.app-page .billing-plan-cards .billing-segmented-option.billing-plan-card {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 18px;
  border: 1px solid var(--line-strong, #d8d2c4);
  border-radius: 16px;
  background: #fffcf6;
  box-shadow: 0 1px 3px rgba(30, 26, 18, 0.05);
  text-align: left;
}
.app-page .billing-plan-card .plan-name {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 2px;
  font: 800 0.95rem/1.2 var(--sans, sans-serif);
  color: var(--ink);
}
.app-page .billing-plan-card .plan-price {
  display: flex;
  align-items: baseline;
  gap: 3px;
  margin: 0 0 10px;
  line-height: 1;
}
.app-page .billing-plan-card .plan-currency { font: 600 0.95rem/1 var(--sans, sans-serif); color: var(--ink); }
.app-page .billing-plan-card .plan-amount {
  font: 650 2.4rem/1 var(--font-display, var(--sans, sans-serif));
  letter-spacing: -0.03em;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.app-page .billing-plan-card .plan-period { font: 600 0.78rem/1 var(--sans, sans-serif); color: var(--muted, #6b635a); }
.app-page .billing-plan-card .plan-credits-hero {
  display: flex;
  gap: 8px;
  align-items: baseline;
  margin: 0 0 10px;
  padding: 8px 11px;
  border: 1px solid var(--line, #e4dfd2);
  border-radius: 8px;
  background: rgba(255, 253, 248, 0.7);
}
.app-page .billing-plan-card .plan-credits-hero strong {
  font: 800 1.3rem/1 var(--font-display, var(--sans, sans-serif));
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.app-page .billing-plan-card .plan-credits-hero span { font: 600 0.75rem/1.35 var(--sans, sans-serif); color: var(--muted, #6b635a); }
.app-page .billing-plan-card .plan-capacity-line {
  display: block;
  margin-bottom: 8px;
  font: 500 0.75rem/1.4 var(--sans, sans-serif);
  color: var(--muted, #6b635a);
}
.app-page .billing-plan-card .plan-features-lite {
  display: block;
  font: 500 0.75rem/1.45 var(--sans, sans-serif);
  color: var(--ink-soft);
}
.app-page .billing-plan-card .plan-badge {
  flex: none;
  padding: 3px 7px;
  border-radius: 4px;
  background: var(--signal-strong, #155f4e);
  color: #fffdf8;
  font: 800 0.58rem/1.2 var(--sans, sans-serif);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.app-page .billing-plan-card .plan-badge[hidden] { display: none; }

/* R36 · Plans 详情跳转升级为描边 pill——文本链接在卡片行里存在感太弱，
   用户需要一眼看到"可以去 pricing 看详情"的入口。 */
.app-page .billing-step-label .billing-details-link {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 13px;
  border: 1px solid color-mix(in srgb, var(--accent) 45%, transparent);
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 7%, var(--surface, #fff));
  font: 600 0.8rem/1 var(--sans, sans-serif);
  color: var(--accent);
  text-decoration: none;
  white-space: nowrap;
  transition: background 140ms ease, border-color 140ms ease;
}
.app-page .billing-step-label .billing-details-link:hover {
  background: color-mix(in srgb, var(--accent) 13%, var(--surface, #fff));
  border-color: var(--accent);
}
.app-page .billing-step-label .billing-details-link:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* R36 · 选择态/估算态的退出 affordance——操作面板不能只给前向动作。 */
.dropzone { position: relative; }
.dropzone-clear {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 1px solid color-mix(in srgb, var(--ink, #2b2418) 18%, transparent);
  border-radius: 50%;
  background: var(--surface, #fff);
  color: var(--muted, #6b6353);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(43, 36, 24, 0.08);
}
.dropzone-clear:hover { color: var(--ink, #2b2418); border-color: color-mix(in srgb, var(--ink, #2b2418) 45%, transparent); }
.dropzone-clear[hidden] { display: none; }

.url-estimate { position: relative; }
.estimate-dismiss {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 26px;
  height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--muted, #6b6353);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
}
.estimate-dismiss:hover { background: color-mix(in srgb, currentColor 10%, transparent); color: inherit; }

/* R37 · pricing 底部费率表——把密不透风的长段说明换成可扫读的三列表，
   结构沿用 demo 已验证的 rate-table（正牌页转正）。 */
.pricing-page .rate-table {
  width: 100%;
  text-align: left;
  border-collapse: collapse;
  margin: 0 0 14px;
  font-size: 0.88rem;
  background: var(--surface, #fffdf8);
  border: 1px solid var(--line-strong, #d8cbb8);
  border-radius: 12px;
  overflow: hidden;
}
.pricing-page .rate-table th {
  font: 700 0.68rem/1 var(--sans, sans-serif);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted, #6b635a);
  text-align: left;
  padding: 11px 14px;
  border-bottom: 1px solid var(--line, #e4dfd2);
}
.pricing-page .rate-table td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--line, #e4dfd2);
  vertical-align: top;
}
.pricing-page .rate-table tbody tr:last-child td { border-bottom: 0; }
.pricing-page .rate-table td b { color: var(--ink); }
.pricing-page .rate-table td:last-child { color: var(--muted, #6b635a); font-size: 0.82rem; }
