/* API documentation — deliberately utilitarian: readable first, decorative last. */
#apiNav .nav-icon svg {
  fill: none;
  stroke: currentColor;
  stroke-width: 18;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.api-docs-shell {
  position: fixed;
  inset: var(--topbar-h) 0 0 var(--sidebar-w);
  z-index: 38;
  display: block;
  overflow: hidden;
  color: #202124;
  background: #fff;
}
.api-docs-shell[hidden] { display: none; }
body[data-workspace-mode="api"] .topbar { left: var(--sidebar-w); }
body[data-workspace-mode="api"] .template-dock,
body[data-workspace-mode="api"] .workspace-main,
body[data-workspace-mode="api"] .toolbox-shell,
body[data-workspace-mode="api"] .matrix-shell,
body[data-workspace-mode="api"] .release-shell,
body[data-workspace-mode="api"] .hot-topic-shell { display: none; }
body[data-workspace-mode="api"] .api-docs-shell { display: block; }
.api-docs-topbar {
  height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 0 30px 0 36px;
  border-bottom: 1px solid #e7e7e5;
  background: rgba(255,255,255,.98);
}
.api-docs-tabs {
  min-width: 0;
  height: 100%;
  display: flex;
  align-items: stretch;
  gap: 30px;
  overflow-x: auto;
  scrollbar-width: none;
}
.api-docs-tabs::-webkit-scrollbar { display: none; }
.api-docs-tabs a {
  position: relative;
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  color: #55575b;
  text-decoration: none;
  font-size: 13px;
  font-weight: 720;
  white-space: nowrap;
}
.api-docs-tabs a:hover,
.api-docs-tabs a:focus-visible { color: #141516; outline: 0; }
.api-docs-tabs a.active { color: var(--accent); }
.api-docs-tabs a.active::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 2px;
  background: var(--accent);
}
.api-key-button,
.api-docs-footer button {
  flex: 0 0 auto;
  min-height: 36px;
  padding: 0 15px;
  border: 1px solid var(--accent);
  border-radius: 8px;
  color: #fff;
  background: var(--accent);
  cursor: pointer;
  font: 760 12px/1 inherit;
  transition: background .16s ease,border-color .16s ease,transform .16s ease;
}
.api-key-button:hover,
.api-key-button:focus-visible,
.api-docs-footer button:hover,
.api-docs-footer button:focus-visible {
  outline: 0;
  transform: translateY(-1px);
  background: #e83b29;
  border-color: #e83b29;
}
.api-docs-scroll {
  height: 100%;
  overflow: auto;
  scroll-behavior: smooth;
  scroll-padding-top: 28px;
}
.api-docs-layout {
  width: min(1180px,100%);
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0,850px) 190px;
  gap: 70px;
  padding: 34px 42px 90px;
}
.api-docs-main { min-width: 0; }
.api-docs-hero {
  padding: 4px 0 36px;
  border-bottom: 1px solid #e8e8e6;
  scroll-margin-top: 24px;
}
.api-release-label {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 8px;
  margin-bottom: 10px;
  border: 1px solid #dddeda;
  border-radius: 5px;
  color: #6f7175;
  background: #fafafa;
  font: 760 10px/1 ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;
  letter-spacing: .09em;
}
.api-docs-hero h1 {
  margin: 0;
  color: #141516;
  font-size: clamp(34px,3vw,46px);
  font-weight: 860;
  line-height: 1.08;
  letter-spacing: -.045em;
}
.api-docs-hero > p {
  margin: 13px 0 22px;
  color: #686a6e;
  font-size: 15px;
  line-height: 1.7;
}
.api-account-console {
  margin-top: 28px;
  padding: 22px;
  border: 1px solid #d9dad7;
  border-radius: 10px;
  background: #fafafa;
  scroll-margin-top: 24px;
}
.api-console-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
}
.api-console-heading > div > span {
  color: #8a8c90;
  font: 740 9px/1 ui-monospace,SFMono-Regular,Menlo,monospace;
  letter-spacing: .1em;
}
.api-console-heading h2 {
  margin: 8px 0 0;
  color: #1d1f21;
  font-size: 19px;
  font-weight: 830;
  letter-spacing: -.025em;
}
.api-console-heading p {
  margin: 6px 0 0;
  color: #717377;
  font-size: 11px;
  line-height: 1.6;
}
.api-console-heading button,
.api-secret-actions button,
.api-key-row button {
  min-height: 34px;
  padding: 0 13px;
  border: 1px solid #cfd0cd;
  border-radius: 7px;
  color: #343639;
  background: #fff;
  cursor: pointer;
  font: 750 11px/1 inherit;
}
.api-console-heading button {
  flex: 0 0 auto;
  color: #fff;
  border-color: #24272b;
  background: #24272b;
}
.api-console-heading button:hover,
.api-console-heading button:focus-visible {
  outline: 0;
  border-color: #000;
  background: #000;
}
.api-console-heading button:disabled {
  cursor: wait;
  opacity: .5;
}
.api-console-metrics {
  display: grid;
  grid-template-columns: .8fr .8fr 1.4fr;
  margin-top: 20px;
  overflow: hidden;
  border: 1px solid #dedfdd;
  border-radius: 8px;
  background: #fff;
}
.api-console-metrics article {
  min-width: 0;
  display: grid;
  align-content: start;
  gap: 6px;
  padding: 15px;
}
.api-console-metrics article + article { border-left: 1px solid #e4e5e2; }
.api-console-metrics span {
  color: #8a8c90;
  font-size: 9px;
  font-weight: 760;
}
.api-console-metrics strong {
  overflow: hidden;
  color: #202225;
  font: 780 21px/1.25 ui-monospace,SFMono-Regular,Menlo,monospace;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.api-console-metrics article:last-child strong { font-size: 11px; line-height: 26px; }
.api-console-metrics small {
  color: #888a8e;
  font-size: 9px;
  line-height: 1.5;
}
.api-secret-panel {
  display: grid;
  grid-template-columns: minmax(180px,.75fr) minmax(260px,1.4fr) auto;
  gap: 16px;
  align-items: center;
  margin-top: 14px;
  padding: 14px;
  border: 1px solid #e5b9b1;
  border-left: 3px solid var(--accent);
  border-radius: 7px;
  background: #fff7f4;
}
.api-secret-panel[hidden] { display: none; }
.api-secret-panel strong { display: block; color: #312c2a; font-size: 11px; }
.api-secret-panel p { margin: 4px 0 0; color: #7f6f6b; font-size: 9px; line-height: 1.55; }
.api-secret-panel code {
  min-width: 0;
  overflow: auto;
  padding: 9px 10px;
  border: 1px solid #ead8d3;
  border-radius: 6px;
  color: #2c2e31;
  background: #fff;
  font-size: 10px;
  white-space: nowrap;
}
.api-secret-actions { display: flex; gap: 7px; }
.api-secret-actions button:first-child { color: #fff; border-color: var(--accent); background: var(--accent); }
.api-secret-actions button:hover,.api-secret-actions button:focus-visible,
.api-key-row button:hover,.api-key-row button:focus-visible { outline: 0; border-color: #8d8f92; }
.api-key-list {
  display: grid;
  gap: 0;
  margin-top: 14px;
  border-top: 1px solid #dedfdd;
}
.api-key-empty {
  margin: 0;
  padding: 15px 2px 0;
  color: #7a7c80;
  font-size: 10px;
  line-height: 1.6;
}
.api-key-row {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(160px,1.2fr) minmax(180px,1fr) minmax(120px,.7fr) auto;
  gap: 14px;
  align-items: center;
  padding: 13px 2px;
  border-bottom: 1px solid #e5e6e3;
}
.api-key-row > div { min-width: 0; display: grid; gap: 4px; }
.api-key-row strong { overflow: hidden; color: #2e3033; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.api-key-row code { overflow: hidden; color: #55585c; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.api-key-row span { color: #888a8e; font-size: 9px; }
.api-key-row .is-active { color: #21734a; font-weight: 760; }
.api-key-row .is-revoked { color: #999b9f; }
.api-key-row button { min-height: 29px; padding-inline: 10px; color: #a53228; }
.api-base-url {
  width: max-content;
  max-width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 10px 9px 12px;
  border: 1px solid #dedfdd;
  border-radius: 8px;
  background: #fafafa;
}
.api-base-url span { color: #77797d; font-size: 11px; font-weight: 760; }
.api-base-url code,
.api-endpoint code,
.api-docs-main code {
  font-family: ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono",monospace;
}
.api-base-url code { overflow: hidden; color: #232528; font-size: 12px; text-overflow: ellipsis; }
.api-base-url button,
.api-code-head button {
  min-height: 28px;
  padding: 0 9px;
  border: 1px solid #d8d9d7;
  border-radius: 6px;
  color: #55575b;
  background: #fff;
  cursor: pointer;
  font: 720 11px/1 inherit;
}
.api-base-url button:hover,
.api-base-url button:focus-visible,
.api-code-head button:hover,
.api-code-head button:focus-visible { color: #171819; border-color: #aeb0ad; outline: 0; }
.api-doc-section {
  padding: 38px 0 42px;
  border-bottom: 1px solid #e8e8e6;
  scroll-margin-top: 24px;
}
.api-section-heading {
  display: grid;
  grid-template-columns: 34px minmax(0,1fr);
  gap: 12px;
  align-items: start;
  margin-bottom: 22px;
}
.api-section-heading > span {
  padding-top: 5px;
  color: var(--accent);
  font: 720 11px/1 ui-monospace,SFMono-Regular,Menlo,monospace;
}
.api-section-heading h2 { margin: 0; color: #171819; font-size: 23px; font-weight: 820; line-height: 1.3; letter-spacing: -.025em; }
.api-section-heading p { margin: 5px 0 0; color: #74767a; font-size: 13px; line-height: 1.6; }
.api-steps {
  display: grid;
  grid-template-columns: repeat(3,minmax(0,1fr));
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
  border: 1px solid #dedfdd;
  border-radius: 10px;
  overflow: hidden;
}
.api-steps li { min-width: 0; display: flex; align-items: flex-start; gap: 11px; padding: 17px 15px; background: #fff; }
.api-steps li + li { border-left: 1px solid #dedfdd; }
.api-steps li > span {
  width: 26px;
  height: 26px;
  flex: 0 0 26px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--accent);
  background: #fff0eb;
  font: 760 10px/1 ui-monospace,SFMono-Regular,Menlo,monospace;
}
.api-steps strong { display: block; color: #252629; font-size: 12px; font-weight: 800; line-height: 1.45; }
.api-steps p { margin: 5px 0 0; color: #77797c; font-size: 10px; line-height: 1.55; }
.api-steps code { color: #35373a; font-size: .95em; }
.api-endpoint {
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 15px;
  margin-bottom: 9px;
  border: 1px solid #dfe0de;
  border-radius: 8px;
  background: #fff;
}
.api-endpoint strong { color: var(--accent); font: 780 12px/1 ui-monospace,SFMono-Regular,Menlo,monospace; }
.api-endpoint code { overflow: hidden; color: #292b2e; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.api-code-block {
  overflow: hidden;
  border: 1px solid #25282d;
  border-radius: 9px;
  color: #eef0f3;
  background: #1e2126;
  box-shadow: 0 7px 20px rgba(20,22,25,.08);
}
.api-code-head {
  min-height: 38px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 0 11px 0 15px;
  border-bottom: 1px solid rgba(255,255,255,.09);
}
.api-code-head span { color: #aeb4bd; font: 700 10px/1 ui-monospace,SFMono-Regular,Menlo,monospace; text-transform: uppercase; letter-spacing: .07em; }
.api-code-head button { color: #cfd3d9; background: #292d33; border-color: #41464e; }
.api-code-head button:hover,.api-code-head button:focus-visible { color: #fff; border-color: #6b717b; }
.api-code-block pre { margin: 0; padding: 18px 20px 20px; overflow: auto; }
.api-code-block pre code { color: inherit; font-size: 11.5px; line-height: 1.75; tab-size: 2; }
.api-code-block.compact pre { padding-block: 16px; }
.api-subheading { margin: 30px 0 12px; color: #26272a; font-size: 15px; font-weight: 820; }
.api-table-wrap { overflow-x: auto; border: 1px solid #dedfdd; border-radius: 8px; }
.api-parameter-table { width: 100%; border-collapse: collapse; min-width: 650px; color: #414347; font-size: 11px; line-height: 1.5; }
.api-parameter-table th { padding: 10px 12px; color: #737579; background: #f7f7f6; border-bottom: 1px solid #dedfdd; text-align: left; font-size: 10px; font-weight: 800; }
.api-parameter-table td { padding: 11px 12px; border-bottom: 1px solid #ececea; vertical-align: top; }
.api-parameter-table tbody tr:last-child td { border-bottom: 0; }
.api-parameter-table td:first-child { width: 120px; color: #242629; }
.api-parameter-table td:nth-child(2) { width: 86px; color: #75777b; }
.api-parameter-table td:nth-child(3) { width: 70px; color: #75777b; }
.api-parameter-table b { color: var(--accent); font-weight: 780; }
.api-body-copy { margin: -2px 0 12px; color: #6e7074; font-size: 12px; line-height: 1.75; }
.api-body-copy code { color: #313337; }
.api-output-note {
  display: flex;
  gap: 14px;
  align-items: center;
  margin-top: 10px;
  padding: 12px 14px;
  border: 1px solid #e1e2df;
  border-left: 3px solid #81858b;
  border-radius: 6px;
  background: #fafafa;
}
.api-output-note strong { flex: 0 0 auto; color: #37393c; font-size: 11px; }
.api-output-note span { color: #707276; font-size: 11px; line-height: 1.6; }
.api-billing-rule {
  min-height: 68px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  border: 1px solid #dfe0de;
  border-radius: 8px;
  background: #fafafa;
}
.api-billing-rule strong { color: var(--accent); font-size: 20px; font-weight: 840; }
.api-billing-rule span { color: #a1a3a6; font-size: 18px; }
.api-billing-rule b { color: #27292c; font-size: 15px; font-weight: 800; }
.api-check-list { display: grid; gap: 10px; margin: 18px 0 0; padding: 0; list-style: none; }
.api-check-list li { position: relative; padding-left: 24px; color: #5f6165; font-size: 12px; line-height: 1.65; }
.api-check-list li::before { content: "✓"; position: absolute; left: 1px; top: 0; color: #257a50; font-weight: 900; }
.api-error-list { border-top: 1px solid #dedfdd; }
.api-error-list > div {
  min-height: 57px;
  display: grid;
  grid-template-columns: 54px 200px minmax(0,1fr);
  gap: 14px;
  align-items: center;
  border-bottom: 1px solid #e7e8e5;
}
.api-error-list code { color: var(--accent); font-size: 11px; font-weight: 780; }
.api-error-list strong { color: #303235; font-size: 11px; font-weight: 800; }
.api-error-list span { color: #707276; font-size: 11px; line-height: 1.55; }
.api-ai-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 12px; }
.api-ai-grid article {
  min-height: 174px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 17px;
  border: 1px solid #dedfdd;
  border-radius: 8px;
  background: #fff;
}
.api-ai-grid article > span { color: #999b9f; font: 740 9px/1 ui-monospace,SFMono-Regular,Menlo,monospace; letter-spacing: .1em; }
.api-ai-grid article > strong { margin-top: 13px; color: #292b2e; font-size: 12px; font-weight: 800; word-break: break-all; }
.api-ai-grid article p { margin: 9px 0 14px; color: #76787c; font-size: 10px; line-height: 1.65; }
.api-ai-actions { width: 100%; display: flex; align-items: center; gap: 16px; margin-top: auto; }
.api-ai-actions button,.api-ai-actions a { margin-top: 0!important; }
.api-ai-grid article button,
.api-ai-grid article a {
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  padding: 0;
  margin-top: auto;
  border: 0;
  color: var(--accent);
  background: transparent;
  cursor: pointer;
  text-decoration: none;
  font: 760 10px/1 inherit;
}
.api-ai-grid article button:hover,.api-ai-grid article button:focus-visible,.api-ai-grid article a:hover,.api-ai-grid article a:focus-visible { color: #c92e1f; outline: 0; text-decoration: underline; text-underline-offset: 3px; }
.api-docs-footer {
  display: grid;
  grid-template-columns: auto minmax(0,1fr) auto;
  gap: 16px;
  align-items: center;
  padding: 28px 0 0;
}
.api-docs-footer strong { color: #282a2d; font-size: 14px; }
.api-docs-footer span { color: #74767a; font-size: 11px; line-height: 1.55; }
.api-docs-toc {
  position: sticky;
  top: 28px;
  align-self: start;
  display: grid;
  gap: 12px;
  padding-left: 20px;
  border-left: 1px solid #e0e1de;
}
.api-docs-toc strong { margin-bottom: 5px; color: #343639; font-size: 11px; font-weight: 820; }
.api-docs-toc a { color: #77797d; text-decoration: none; font-size: 10.5px; line-height: 1.45; }
.api-docs-toc a:hover,.api-docs-toc a:focus-visible { color: var(--accent); outline: 0; }
.api-docs-toc > span {
  margin-top: 7px;
  padding-top: 14px;
  border-top: 1px solid #e0e1de;
  color: #96989c;
  font-size: 9px;
  line-height: 1.55;
}

/* Three-path AI handoff. The page reads like a technical runbook, not a developer portal. */
.api-path-card {
  display: grid;
  grid-template-columns: 72px minmax(0,1fr);
  margin-top: 22px;
  overflow: hidden;
  border: 1px solid #d9dad7;
  border-radius: 10px;
  background: #fff;
  scroll-margin-top: 22px;
}
.api-path-card.is-primary { border-color: #c9cac7; box-shadow: 0 12px 34px rgba(30,32,35,.055); }
.api-path-index {
  display: flex;
  align-items: center;
  flex-direction: column;
  gap: 10px;
  padding: 24px 10px;
  border-right: 1px solid #e0e1de;
  background: #f6f6f4;
}
.api-path-index span {
  color: #242629;
  font: 780 18px/1 ui-monospace,SFMono-Regular,Menlo,monospace;
  letter-spacing: -.04em;
}
.api-path-index b {
  padding: 4px 6px;
  border: 1px solid #d8d9d6;
  border-radius: 4px;
  color: #898b8f;
  background: #fff;
  font: 740 8px/1 ui-monospace,SFMono-Regular,Menlo,monospace;
  letter-spacing: .06em;
}
.api-path-card.is-primary .api-path-index { background: #fff5f1; }
.api-path-card.is-primary .api-path-index span { color: var(--accent); }
.api-path-card.is-primary .api-path-index b { color: #c73c2c; border-color: #f0c4ba; }
.api-path-content { min-width: 0; padding: 25px 27px 27px; }
.api-path-content > header > p,
.api-console-heading > div > p {
  margin: 0 0 8px;
  color: #929499;
  font: 740 9px/1 ui-monospace,SFMono-Regular,Menlo,monospace;
  letter-spacing: .11em;
}
.api-path-content > header h2,
.api-console-heading h2 {
  margin: 0;
  color: #1b1d20;
  font-size: 22px;
  font-weight: 840;
  line-height: 1.28;
  letter-spacing: -.03em;
}
.api-path-content > header > span,
.api-console-heading > div > span {
  display: block;
  margin-top: 7px;
  color: #73757a;
  font-size: 12px;
  line-height: 1.65;
}
.api-instruction-line {
  display: grid;
  grid-template-columns: 100px minmax(0,1fr);
  gap: 15px;
  margin-top: 20px;
  padding: 12px 14px;
  border: 1px solid #e0e1de;
  border-left: 3px solid var(--accent);
  background: #fafaf9;
}
.api-instruction-line strong { color: #313337; font-size: 11px; }
.api-instruction-line span { color: #717378; font-size: 11px; line-height: 1.55; }
.api-ai-prompt {
  margin-top: 13px;
  overflow: hidden;
  border: 1px solid #25282d;
  border-radius: 8px;
  color: #eef0f3;
  background: #1e2126;
}
.api-ai-prompt pre {
  max-height: 330px;
  margin: 0;
  padding: 17px 19px 20px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
}
.api-ai-prompt pre code {
  color: #f2f3f5;
  font: 500 11px/1.78 ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;
}
.api-path-actions,
.api-path-footnote {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-top: 16px;
}
.api-path-actions a {
  color: var(--accent);
  text-decoration: none;
  font-size: 10.5px;
  font-weight: 780;
}
.api-path-actions a:hover,.api-path-actions a:focus-visible { outline: 0; text-decoration: underline; text-underline-offset: 3px; }
.api-path-actions .api-solid-link {
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  padding: 0 12px;
  border-radius: 6px;
  color: #fff;
  background: #25272b;
}
.api-path-actions .api-solid-link:hover,.api-path-actions .api-solid-link:focus-visible { color: #fff; background: #050505; text-decoration: none; }
.api-path-footnote {
  justify-content: flex-start;
  padding-top: 15px;
  border-top: 1px solid #e6e7e4;
}
.api-path-footnote > span { color: #707277; font: 560 10px/1.5 ui-monospace,SFMono-Regular,Menlo,monospace; }
.api-path-footnote b { color: var(--accent); }
.api-account-console.api-path-card { padding: 0; background: #fff; }
.api-account-console.api-path-card .api-console-heading { margin: 0; }
.api-account-console.api-path-card .api-console-heading > div { min-width: 0; }
.api-account-console.api-path-card .api-console-heading button { margin-top: 1px; }
.api-key-guidance {
  display: grid;
  grid-template-columns: 130px minmax(0,1fr);
  gap: 16px;
  margin-top: 20px;
  padding: 13px 14px;
  border: 1px solid #efcdc5;
  background: #fff8f5;
}
.api-key-guidance strong { color: #7d3026; font-size: 11px; }
.api-key-guidance span { color: #7c6b67; font-size: 10.5px; line-height: 1.6; }
.api-key-guidance code { color: #3d3f42; font-size: .96em; }
.api-key-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-top: 17px;
  padding-top: 17px;
  border-top: 1px solid #e4e5e2;
}
.api-key-footer span { max-width: 540px; color: #74767a; font-size: 10px; line-height: 1.6; }
.api-key-footer b { color: #343639; }
.api-key-footer button {
  min-height: 32px;
  flex: 0 0 auto;
  padding: 0 12px;
  border: 1px solid #cacbc8;
  border-radius: 6px;
  color: #343639;
  background: #fff;
  cursor: pointer;
  font: 750 10px/1 inherit;
}
.api-key-footer button:hover,.api-key-footer button:focus-visible { outline: 0; border-color: #91938f; }

/* API workbench — mirrors the quiet controls and panel rhythm of the card editor. */
.api-docs-topbar {
  height: 50px;
  padding: 0 28px 0 34px;
  border-color: var(--ui-hairline);
  background: #fff;
}
.api-docs-tabs { gap: 4px; }
.api-docs-tabs a {
  min-width: 92px;
  justify-content: center;
  padding: 0 14px;
  color: #716b65;
  font-size: 12px;
  font-weight: 700;
}
.api-docs-tabs a:hover,
.api-docs-tabs a:focus-visible { color: #25211e; background: #faf7f4; }
.api-docs-tabs a.active { color: var(--accent); }
.api-docs-tabs a.active::after { right: 14px; left: 14px; height: 2px; }
.api-docs-scroll {
  height: 100%;
  scroll-padding-top: 18px;
  background: #fff;
}
.api-docs-layout {
  width: min(1040px,100%);
  grid-template-columns: minmax(0,780px) 164px;
  gap: 48px;
  padding: 30px 34px 72px;
}
.api-docs-hero {
  padding: 2px 0 28px;
  border-color: var(--ui-hairline);
}
.api-release-label {
  height: 20px;
  margin-bottom: 9px;
  padding-inline: 7px;
  border-color: #e4dfda;
  border-radius: 6px;
  color: #8c847d;
  background: #faf8f6;
  font-size: 9px;
}
.api-docs-hero h1 {
  color: var(--ui-ink);
  font-size: clamp(26px,2.35vw,34px);
  font-weight: 750;
  line-height: 1.2;
  letter-spacing: -.035em;
}
.api-docs-hero > p {
  margin: 9px 0 17px;
  color: #77716a;
  font-size: 13px;
  line-height: 1.7;
}
.api-base-url {
  min-height: 38px;
  gap: 10px;
  padding: 5px 6px 5px 11px;
  border-color: #e9e4df;
  border-radius: 10px;
  background: #fbfaf8;
}
.api-base-url span { color: #938b84; font-size: 10px; }
.api-base-url code { color: #3e3935; font-size: 11px; }
.api-base-url button {
  min-height: 26px;
  border-color: #e3ddd7;
  border-radius: 7px;
  color: #5d5650;
  font-size: 10px;
}
.api-path-card {
  display: block;
  margin-top: 16px;
  overflow: hidden;
  border-color: var(--ui-hairline);
  border-radius: 15px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(28,42,34,.025);
}
.api-path-card.is-primary {
  border-color: var(--ui-hairline);
  box-shadow: 0 1px 2px rgba(28,42,34,.025);
}
.api-path-index,
.api-path-card.is-primary .api-path-index {
  min-height: 50px;
  display: flex;
  align-items: center;
  flex-direction: row;
  gap: 9px;
  padding: 0 18px;
  border-right: 0;
  border-bottom: 1px solid var(--ui-hairline);
  background: #fff;
}
.api-path-index span,
.api-path-card.is-primary .api-path-index span {
  color: #948c85;
  font: 760 10px/1 ui-monospace,SFMono-Regular,Menlo,monospace;
  letter-spacing: .02em;
}
.api-path-index b,
.api-path-card.is-primary .api-path-index b {
  order: 3;
  margin-left: auto;
  padding: 4px 7px;
  border: 0;
  border-radius: 6px;
  color: #9a6c5d;
  background: #fff4ef;
  font: 700 9px/1 inherit;
  letter-spacing: 0;
}
.api-path-index strong {
  color: #282421;
  font-size: 13px;
  font-weight: 700;
}
.api-path-content { padding: 21px 22px 22px; }
.api-path-content > header h2,
.api-console-heading h2 {
  color: #211e1b;
  font-size: 16px;
  font-weight: 750;
  line-height: 1.45;
  letter-spacing: -.02em;
}
.api-path-content > header > span,
.api-console-heading > div > span {
  margin-top: 5px;
  color: #847d76;
  font-size: 11px;
  line-height: 1.65;
}
.api-instruction-line {
  display: flex;
  gap: 9px;
  margin-top: 15px;
  padding: 0;
  border: 0;
  background: transparent;
}
.api-instruction-line strong { color: #4b4540; font-size: 10.5px; }
.api-instruction-line span { color: #8c847d; font-size: 10.5px; }
.api-ai-prompt {
  margin-top: 11px;
  border-color: #e7e1dc;
  border-radius: 11px;
  color: #34302c;
  background: #faf8f6;
}
.api-code-head {
  min-height: 38px;
  padding: 0 8px 0 14px;
  border-color: #ebe5df;
}
.api-code-head span {
  color: #8e867f;
  font-family: inherit;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: none;
}
.api-code-head button {
  min-height: 27px;
  border-color: #e2dbd5;
  border-radius: 7px;
  color: #4f4944;
  background: #fff;
}
.api-code-head button:hover,
.api-code-head button:focus-visible { color: #211e1b; border-color: #cfc5bd; background: #fff; }
.api-ai-prompt pre {
  max-height: 285px;
  padding: 15px 16px 17px;
  border-top: 0;
}
.api-ai-prompt pre code {
  color: #393531;
  font-size: 11px;
  font-weight: 450;
  line-height: 1.75;
}
.api-path-actions,
.api-path-footnote { margin-top: 13px; }
.api-path-actions a { color: #7b554a; font-size: 10.5px; font-weight: 700; }
.api-path-actions .api-solid-link {
  min-height: 32px;
  padding: 0 13px;
  border-radius: 9px;
  color: #fff;
  background: var(--accent);
}
.api-path-actions .api-solid-link:hover,
.api-path-actions .api-solid-link:focus-visible { background: #e94330; }
.api-path-footnote {
  padding-top: 13px;
  border-color: var(--ui-hairline);
}
.api-path-footnote > span { color: #8a837c; font-size: 9.5px; }
.api-account-console.api-path-card { background: #fff; }
.api-console-heading {
  align-items: center;
  gap: 18px;
}
.api-console-heading button {
  min-height: 32px;
  padding: 0 13px;
  border: 0;
  border-radius: 9px;
  background: #282421;
  font-size: 10.5px;
}
.api-key-summary {
  min-height: 70px;
  display: grid;
  grid-template-columns: 112px minmax(0,1fr);
  gap: 18px;
  align-items: center;
  margin-top: 16px;
  padding: 12px 15px;
  border: 1px solid #ebe5df;
  border-radius: 11px;
  background: #faf8f6;
}
.api-key-balance {
  display: flex;
  align-items: baseline;
  gap: 6px;
  padding-right: 18px;
  border-right: 1px solid #e5ded8;
}
.api-key-balance strong {
  color: #241f1c;
  font: 760 25px/1 ui-monospace,SFMono-Regular,Menlo,monospace;
}
.api-key-balance span { color: #827a73; font-size: 10px; font-weight: 700; }
.api-key-summary p {
  margin: 0;
  color: #716a64;
  font-size: 10.5px;
  line-height: 1.7;
}
.api-key-summary b { color: #3c3632; }
.api-secret-panel {
  grid-template-columns: minmax(150px,.7fr) minmax(240px,1.3fr) auto;
  margin-top: 12px;
  padding: 12px;
  border: 1px solid #f1c9c0;
  border-left-width: 1px;
  border-radius: 11px;
  background: #fff7f4;
}
.api-secret-panel code { border-radius: 8px; font-size: 10px; }
.api-secret-actions button { border-radius: 8px; font-size: 10px; }
.api-key-list-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-top: 14px;
  padding: 0 2px 9px;
  border-bottom: 1px solid var(--ui-hairline);
}
.api-key-list-heading strong {
  color: #4a433d;
  font-size: 10.5px;
}
.api-key-list-heading span {
  color: #948b83;
  font-size: 9px;
  line-height: 1.5;
  text-align: right;
}
.api-key-list {
  margin-top: 0;
  border-top: 0;
}
.api-key-row {
  grid-template-columns: minmax(150px,1.2fr) minmax(120px,.8fr) minmax(90px,.55fr) auto;
  padding: 12px 2px;
  border-color: var(--ui-hairline);
}
.api-key-row strong { color: #3f3934; font-size: 10.5px; }
.api-key-row code { color: #7c746d; font-size: 9.5px; }
.api-key-row span { color: #9a928b; font-size: 9px; }
.api-key-row button { min-height: 27px; border-radius: 8px; font-size: 9.5px; }
.api-key-footer {
  margin-top: 10px;
  padding-top: 12px;
  border-color: var(--ui-hairline);
}
.api-key-footer span {
  max-width: none;
  color: #8c847d;
  font-size: 9.5px;
}
.api-key-footer code { color: #5c554f; }
.api-docs-toc {
  top: 22px;
  gap: 10px;
  padding-left: 17px;
  border-color: var(--ui-hairline);
}
.api-docs-toc strong { color: #4b4540; font-size: 10px; }
.api-docs-toc a { color: #89817a; font-size: 10px; }
.api-docs-toc > span {
  color: #a19992;
  border-color: var(--ui-hairline);
  font-size: 9px;
}

@media (max-width: 1100px) {
  .api-docs-layout { grid-template-columns: minmax(0,1fr) 160px; gap: 36px; padding-inline: 32px; }
  .api-steps { grid-template-columns: 1fr; }
  .api-steps li + li { border-left: 0; border-top: 1px solid #dedfdd; }
  .api-ai-grid { grid-template-columns: 1fr; }
  .api-ai-grid article { min-height: 140px; }
  .api-secret-panel { grid-template-columns: 1fr; }
  .api-secret-actions { justify-self: start; }
  .api-path-card { display: block; }
  .api-path-content { padding-inline: 22px; }
}
@media (max-width: 820px) {
  .api-docs-layout { display: block; padding-inline: 26px; }
  .api-docs-toc { display: none; }
  .api-error-list > div { grid-template-columns: 46px minmax(130px,.65fr) minmax(0,1fr); }
}
@media (max-width: 760px) {
  body[data-workspace-mode="api"] .mobile-template-toggle { visibility: hidden; pointer-events: none; }
  body[data-workspace-mode="api"] .mobile-workspace-tabs { display: none; }
  .api-docs-shell { inset: var(--topbar-h) 0 0 0; }
  .api-docs-topbar { height: 52px; gap: 14px; padding: 0 14px; }
  .api-docs-tabs { gap: 22px; }
  .api-docs-tabs a { font-size: 12px; }
  .api-key-button { min-height: 32px; padding-inline: 11px; font-size: 10px; }
  .api-docs-scroll { height: 100%; }
  .api-docs-layout { padding: 26px 18px 70px; }
  .api-docs-hero { padding-bottom: 30px; }
  .api-docs-hero h1 { font-size: 34px; }
  .api-account-console { padding: 17px; }
  .api-console-heading { align-items: stretch; flex-direction: column; gap: 15px; }
  .api-console-heading button { align-self: flex-start; }
  .api-console-metrics { grid-template-columns: 1fr; }
  .api-console-metrics article + article { border-top: 1px solid #e4e5e2; border-left: 0; }
  .api-key-row { grid-template-columns: 1fr auto; }
  .api-key-row > div:nth-child(2),.api-key-row > div:nth-child(3) { grid-column: 1; }
  .api-key-row button { grid-column: 2; grid-row: 1; }
  .api-key-list-heading { align-items: flex-start; flex-direction: column; gap: 4px; }
  .api-key-list-heading span { text-align: left; }
  .api-base-url { width: 100%; }
  .api-base-url code { flex: 1; }
  .api-doc-section { padding-block: 32px 36px; }
  .api-section-heading { grid-template-columns: 28px minmax(0,1fr); }
  .api-section-heading h2 { font-size: 21px; }
  .api-code-block pre { padding: 15px; }
  .api-code-block pre code { font-size: 10.5px; }
  .api-billing-rule { align-items: flex-start; flex-direction: column; gap: 4px; padding: 16px; }
  .api-billing-rule span { display: none; }
  .api-error-list > div { grid-template-columns: 42px minmax(0,1fr); gap: 8px; padding: 12px 0; }
  .api-error-list span { grid-column: 2; }
  .api-docs-footer { grid-template-columns: 1fr; }
  .api-docs-footer button { justify-self: start; }
  .api-path-card { grid-template-columns: 1fr; }
  .api-path-index {
    align-items: center;
    flex-direction: row;
    justify-content: space-between;
    padding: 12px 16px;
    border-right: 0;
    border-bottom: 1px solid #e0e1de;
  }
  .api-path-content { padding: 20px 17px 22px; }
  .api-instruction-line,.api-key-guidance { grid-template-columns: 1fr; gap: 5px; }
  .api-path-actions,.api-path-footnote,.api-key-footer { align-items: flex-start; flex-direction: column; }
}
:root {
  color: #171716;
  background: #fff;
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", system-ui, sans-serif;
  font-synthesis: weight;
  --sidebar-w: 156px;
  --template-w: 116px;
  --topbar-h: 48px;
  --panel-gap: 16px;
  --accent: #ff4a35;
  --ui-pine: #ff4a35;
  --ui-pine-soft: #fff1ea;
  --ui-ink: #171716;
  --ui-muted: #77716a;
  --ui-hairline: #eee9e3;
  --line: #e8e4df;
  --muted: #77716a;
  --preview-width: 387px;
}
html,body { overscroll-behavior-x: none; }

* { box-sizing: border-box; }
[hidden] { display: none !important; }
button, textarea { font: inherit; }
button { -webkit-tap-highlight-color: transparent; }

body {
  margin: 0;
  width: 100vw;
  height: 100vh;
  min-width: 980px;
  min-height: 620px;
  overflow: hidden;
  color: #171716;
  background: #fff;
}

.topbar {
  position: fixed;
  top: 0;
  right: 0;
  left: calc(var(--sidebar-w) + var(--template-w));
  z-index: 40;
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  padding: 0 18px;
  background: rgba(255,255,255,.96);
  border-bottom: 1px solid #ece8e3;
  backdrop-filter: blur(14px);
}
.topbar strong { color: var(--ui-ink); font-size: 13px; font-weight: 700; letter-spacing: -.01em; }
.account-state {
  position: relative;
  width: 100%;
  min-width: 0;
  margin: 0;
  color: #24211e;
}
.account-toggle {
  width: 100%;
  min-height: 44px;
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) 18px;
  align-items: center;
  column-gap: 8px;
  padding: 5px 2px;
  color: #201e1b;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 9px;
  box-shadow: none;
  cursor: pointer;
  text-align: left;
  transition: background .16s ease, color .16s ease;
}
.account-toggle:hover,
.account-toggle[aria-expanded="true"] {
  background: #f8f5f1;
  border-color: #f0ebe5;
  box-shadow: none;
}
.account-toggle:focus-visible { outline: 3px solid rgba(255,74,53,.18); outline-offset: 2px; }
.account-toggle:disabled { cursor: wait; opacity: .74; }
.account-toggle-copy { min-width: 0; display: block; }
#accountLabel {
  min-width: 0;
  overflow: hidden;
  display: block;
  color: #34312d;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
  font-weight: 750;
  line-height: 1.2;
  letter-spacing: -.02em;
}
#accountSubLabel { display: none; }
.account-avatar {
  position: relative;
  display: inline-grid;
  place-items: center;
  overflow: hidden;
  color: #fff;
  background: hsl(var(--account-hue, 12) var(--account-saturation, 54%) var(--account-lightness, 55%));
  border: 0;
  border-radius: 50%;
  box-shadow: none;
  font-weight: 800;
  letter-spacing: -.04em;
}
.account-dock-avatar { width: 32px; height: 32px; font-size: 9px; }
.account-popover-avatar { width: 39px; height: 39px; flex: 0 0 39px; font-size: 12px; }
.account-avatar.is-guest { color: #5d5750; background: #eee9e3; box-shadow: none; }
.account-avatar.is-guest .account-avatar-initials { display: block; }
.account-avatar.is-guest .account-guest-icon,
.account-avatar:not(.is-guest) .account-guest-icon { display: none; }
.account-guest-icon { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.55; }
.account-avatar-initials { position: relative; z-index: 1; transform: translateY(-.03em); }
.account-toggle-menu,
.account-popover-switch svg,
.account-logout svg {
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}
.account-toggle-menu {
  width: 18px;
  height: 18px;
  color: #292622;
  stroke-width: 2.05;
}
.account-popover {
  position: absolute;
  bottom: calc(100% + 10px);
  left: 0;
  z-index: 85;
  width: 276px;
  max-width: calc(100vw - 28px);
  max-height: min(288px, calc(100vh - 78px));
  overflow: auto;
  padding: 12px;
  background: #fff;
  border: 1px solid #e8e1d9;
  border-radius: 12px;
  box-shadow: 0 14px 32px rgba(37,30,23,.13), 0 1px 3px rgba(37,30,23,.05);
  scrollbar-width: thin;
}
.account-popover::after {
  content: "";
  position: absolute;
  bottom: -6px;
  left: 23px;
  width: 11px;
  height: 11px;
  background: #fff;
  border-right: 1px solid #e5ddd4;
  border-bottom: 1px solid #e5ddd4;
  transform: rotate(45deg);
}
.account-popover-profile { position: relative; z-index: 1; display: flex; align-items: center; gap: 10px; min-width: 0; }
.account-popover-copy { min-width: 0; display: grid; gap: 3px; }
.account-popover-copy strong { min-width: 0; overflow: hidden; color: #211f1c; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; font-weight: 900; line-height: 1.15; letter-spacing: -.02em; }
.account-popover-copy span { min-width: 0; overflow: hidden; color: #918981; text-overflow: ellipsis; white-space: nowrap; font-size: 9px; font-weight: 650; line-height: 1.25; }
.account-popover-copy .account-popover-name-row { display: flex; align-items: center; gap: 3px; overflow: visible; }
.account-name-edit {
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
  display: grid;
  place-items: center;
  padding: 0;
  color: #918981;
  background: transparent;
  border: 0;
  border-radius: 6px;
  cursor: pointer;
}
.account-name-edit svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.account-name-edit:hover,.account-name-edit:focus-visible { color: #211f1c; background: #f3eee9; outline: 0; }
.account-name-editor { position: relative; z-index: 1; display: grid; gap: 5px; margin-top: 10px; padding: 9px; background: #faf7f3; border: 1px solid #ece3da; border-radius: 9px; }
.account-name-editor[hidden] { display: none; }
.account-name-editor label { color: #5d554e; font-size: 9px; font-weight: 850; }
.account-name-editor > div { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 6px; }
.account-name-editor input { min-width: 0; height: 31px; padding: 0 8px; color: #28231f; background: #fff; border: 1px solid #ddd4cb; border-radius: 7px; outline: 0; font-family: inherit; font-size: 10px; font-weight: 750; }
.account-name-editor input:focus { border-color: #2b2723; box-shadow: 0 0 0 2px rgba(43,39,35,.08); }
.account-name-editor button { height: 31px; padding: 0 10px; color: #fff; background: #24211e; border: 0; border-radius: 7px; cursor: pointer; font-size: 9px; font-weight: 850; }
.account-name-editor button:disabled { cursor: wait; opacity: .55; }
.account-name-editor p { min-height: 12px; margin: 0; color: #b34334; font-size: 8px; font-weight: 700; }
.account-popover-switch {
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  margin-left: auto;
  padding: 0 7px;
  color: #625a52;
  background: #fff;
  border: 1px solid #e8e0d7;
  border-radius: 8px;
  cursor: pointer;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: -.01em;
  white-space: nowrap;
}
.account-popover-switch svg { width: 14px; height: 14px; stroke-width: 1.7; }
.account-popover-switch:hover { color: #2e2924; background: #faf6f1; border-color: #ded2c7; }
.account-popover-switch:focus-visible { outline: 3px solid rgba(255,74,53,.18); outline-offset: 2px; }
.account-membership { position: relative; z-index: 1; display: grid; gap: 6px; margin-top: 12px; padding: 10px 11px; background: linear-gradient(118deg, #fbf7f2, #fffdfb); border: 1px solid #eee5dc; border-radius: 11px; }
.account-membership-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.account-membership-row strong { color: #39342f; font-size: 10px; font-weight: 900; letter-spacing: -.01em; }
#accountPlanMark { flex: 0 0 auto; color: #a1774b; font-size: 8px; font-weight: 850; letter-spacing: .025em; }
.account-membership-expiry { margin: 0; color: #a1774b; font-size: 9px; font-weight: 750; line-height: 1.45; }
#accountMembershipText { margin: 0; color: #817870; font-size: 9px; font-weight: 600; line-height: 1.55; }
.account-popover-actions { position: relative; z-index: 1; display: grid; gap: 7px; margin-top: 10px; }
.account-popover-actions a,
.account-popover-actions button {
  width: 100%;
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 10px;
  border-radius: 9px;
  cursor: pointer;
  font-size: 10px;
  font-weight: 850;
  text-decoration: none;
  transition: color .16s ease, background .16s ease, border-color .16s ease, transform .16s ease;
}
.account-popover-actions a:active,
.account-popover-actions button:active { transform: translateY(1px); }
.account-popover-actions a:focus-visible,
.account-popover-actions button:focus-visible { outline: 3px solid rgba(255,74,53,.2); outline-offset: 2px; }
#accountLogin,
.account-upgrade { color: #fff; background: #24221f; border: 1px solid #24221f; box-shadow: 0 7px 15px rgba(33,27,21,.11); }
#accountLogin:hover,
.account-upgrade:hover { color: #fff; background: #ff4a35; border-color: #ff4a35; }
.account-signup { color: #514b45; background: #fff; border: 1px solid #e3dcd4; }
.account-signup:hover { color: #241f1b; background: #faf6f2; border-color: #d9cec3; }
.account-popover-footer { position: relative; z-index: 1; margin-top: 9px; padding-top: 8px; border-top: 1px solid #eee7df; }
.account-logout {
  width: 100%;
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 7px;
  padding: 0 4px;
  color: #70665d;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 7px;
  cursor: pointer;
  font-size: 10px;
  font-weight: 800;
}
.account-logout svg { width: 16px; height: 16px; stroke-width: 1.65; }
.account-logout:hover { color: #312c27; background: #f8f4ef; border-color: #eee6de; }
.account-logout:focus-visible { outline: 3px solid rgba(255,74,53,.18); outline-offset: 2px; }
.account-consent a { color: #5d5650; font-weight: 850; text-underline-offset: 2px; }
.account-consent a:hover,.account-consent a:focus-visible { color: #ff4a35; }

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 50;
  width: var(--sidebar-w);
  display: flex;
  flex-direction: column;
  padding: 22px 10px 18px;
  background: #fff;
  border-right: 1px solid #eee9e3;
  font-synthesis: none;
}
.studio-brand {
  min-height: 30px;
  display: flex;
  align-items: center;
  margin: 0 6px 26px;
  color: #111;
  text-decoration: none;
  white-space: nowrap;
  font-size: 16px;
  font-weight: 900;
  letter-spacing: -.02em;
}
.studio-brand img { width: 110px; max-width: 100%; height: auto; max-height: 30px; object-fit: contain; flex: 0 0 auto; }
.workspace-nav { min-height: 0; display: grid; align-content: start; gap: 6px; overflow-x: visible; overflow-y: auto; scrollbar-width: none; }
.workspace-nav::-webkit-scrollbar { display: none; }
.nav-item {
  width: 100%;
  height: 46px;
  display: flex;
  align-items: center;
  padding: 0 14px;
  color: #292d2b;
  background: transparent;
  border: 0;
  border-radius: 14px;
  text-decoration: none;
  cursor: pointer;
  font-size: 13px;
  text-align: left;
  transition: color .16s ease, background .16s ease, transform .16s ease;
}
.nav-item strong { font-weight: 700; letter-spacing: -.012em; white-space: nowrap; }
.nav-icon {
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
  display: grid;
  place-items: center;
  margin-right: 11px;
  color: #535b57;
  font-size: 15px;
  line-height: 1;
}
.nav-icon svg {
  width: 19px;
  height: 19px;
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.65;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}
#apiNav .nav-icon svg { stroke-width: 1.65; }
.nav-item:hover { color: #282828; background: rgba(255,241,234,.72); }
.nav-item:active { transform: scale(.985); }
.nav-item.active { color: var(--ui-pine); background: var(--ui-pine-soft); }
.nav-item.active .nav-icon { color: var(--ui-pine); }
.nav-secondary-start { margin-top: 0; }
.nav-favorite { margin-top: auto; }
.toolbox-subnav { display: grid; gap: 2px; margin: -4px 0 2px 32px; padding: 4px 0 4px 10px; overflow: visible; border-left: 1px solid #e7e1da; }
.toolbox-subnav[hidden] { display: none; }
.toolbox-subnav button { position: relative; width: max-content; min-width: 0; min-height: 32px; padding: 0; overflow: visible; color: #5f5a55; background: transparent; border: 0; border-radius: 0; outline: 0; box-shadow: none; cursor: pointer; text-align: left; white-space: nowrap; font-size: 11px; font-weight: 720; line-height: 1; }
.toolbox-subnav button span { display: block; white-space: nowrap; }
.toolbox-subnav button::before { content: ""; position: absolute; left: -12px; top: 7px; width: 2px; height: 18px; background: transparent; border-radius: 2px; }
.toolbox-subnav button:hover { color: #1f1d1a; }
.toolbox-subnav button:focus-visible { color: #1f1d1a; outline: 0; text-decoration: underline; text-decoration-color: rgba(255,74,53,.45); text-underline-offset: 4px; }
.toolbox-subnav button.active { color: var(--accent); font-weight: 850; }
.toolbox-subnav button.active::before { background: var(--accent); }
.sidebar-footer {
  min-width: 0;
  flex: 0 0 auto;
  margin-top: auto;
  padding: 10px 2px 0;
}

.template-dock {
  position: fixed;
  inset: 0 auto 0 var(--sidebar-w);
  z-index: 46;
  width: var(--template-w);
  background: #fff;
  border-right: 1px solid #eee9e3;
  overflow: hidden;
  font-synthesis: none;
}
.template-dock > header {
  position: absolute;
  top: 30px;
  left: 12px;
  right: 12px;
  z-index: 2;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 13px;
  background: #fff;
}
.template-dock > header strong { color: var(--ui-ink); font-size: 14px; font-weight: 700; letter-spacing: -.01em; }
.template-dock > header button {
  width: 21px;
  height: 21px;
  display: none;
  padding: 0 0 2px;
  color: #302f2d;
  background: transparent;
  border: 0;
  cursor: pointer;
  font-size: 24px;
  line-height: 1;
}
.template-dock > header button:hover { color: var(--accent); }
.template-strip {
  position: absolute;
  inset: 64px 0 18px;
  padding: 0 8px 8px;
  overflow-x: hidden;
  overflow-y: auto;
  scroll-snap-type: y proximity;
}
.template-group { position: relative; width: 100%; display: grid; justify-items: center; gap: 7px; }
.template-group.is-favorites { display: contents; }
.template-group + .template-group { margin-top: 8px; }
.template-group-heading {
  position: sticky;
  top: 0;
  z-index: 4;
  width: 100%;
  min-height: 28px;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 3px;
  color: #363b38;
  background: rgba(255,255,255,.96);
  backdrop-filter: blur(8px);
}
.template-group.is-favorites .template-group-heading { top: 0; z-index: 6; }
.template-group:not(.is-favorites) .template-group-heading { top: 28px; z-index: 5; }
.template-group-heading strong { font-size: 10.5px; font-weight: 700; letter-spacing: -.012em; }
.template-group-heading span { min-width: 18px; height: 16px; display: inline-grid; place-items: center; padding: 0 5px; color: #8a918d; background: #f0f3f1; border-radius: 999px; font-size: 8px; font-weight: 700; }
.template-group-list { width: 100%; display: grid; justify-items: center; gap: 10px; }
.template-group.is-favorites .template-group-list { margin-top: 7px; }
.template-group-empty { width: 100%; margin: 0; padding: 10px 5px; color: #9a9189; background: #faf8f5; border: 1px dashed #e7dfd7; border-radius: 9px; font-size: 8px; font-weight: 650; line-height: 1.55; text-align: center; }
.template-card-shell {
  position: relative;
  width: 86px;
  height: 112px;
  display: grid;
  place-items: center;
  isolation: isolate;
}
.template-card {
  position: relative;
  width: 86px;
  height: 112px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  padding: 0;
  isolation: isolate;
  background: transparent;
  border: 0;
  border-radius: 15px;
  cursor: pointer;
  scroll-snap-align: start;
  transition: transform .16s ease, background .16s ease, box-shadow .16s ease;
}
.template-group.is-favorites .template-card { scroll-margin-top: 28px; }
.template-group:not(.is-favorites) .template-card { scroll-margin-top: 56px; }
.template-card img {
  display: block;
  width: 78px;
  height: 100px;
  object-fit: contain;
  border: 1px solid #eee7df;
  border-radius: 9px;
  background: #fff;
  box-shadow: 0 8px 18px rgba(32,27,20,.055);
  transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease;
}
.template-card:not(.active):hover { transform: translateY(-1px); background: rgba(255,248,244,.68); }
.template-card:not(.active):hover img { transform: scale(1.012); border-color: #f0cbbd; box-shadow: 0 14px 28px rgba(48,36,28,.095); }
.template-card.active { background: rgba(255,249,246,.54); box-shadow: inset 0 0 0 1px rgba(255,91,66,.06); }
.template-card.active::before {
  content: "";
  position: absolute;
  top: 6px;
  right: 4px;
  z-index: 4;
  width: 28px;
  height: 28px;
  border-radius: 0 8px 0 10px;
  background: linear-gradient(135deg,#ff765f 0%,#ff4f3a 58%,#ed3a2e 100%);
  clip-path: polygon(100% 0,100% 100%,0 0);
}
.template-card.active::after {
  content: "✓";
  position: absolute;
  top: 8px;
  right: 7px;
  z-index: 5;
  width: 12px;
  height: 12px;
  color: #fff;
  font-size: 9px;
  font-weight: 950;
  line-height: 12px;
  text-align: center;
}
.template-card.active img { border-color: #f0e4dc; box-shadow: inset -2px 0 0 rgba(255,77,56,.78),inset 0 2px 0 rgba(255,77,56,.7),0 10px 22px rgba(48,36,28,.09); }
.template-detail-handle {
  position: absolute;
  top: 50%;
  left: calc(100% - 3px);
  z-index: 8;
  width: 15px;
  height: 46px;
  display: grid;
  place-items: center;
  padding: 0;
  color: #e54d39;
  background: rgba(255,248,244,.96);
  border: 1px solid #f0c7bc;
  border-left-color: #f6ddd6;
  border-radius: 0 8px 8px 0;
  box-shadow: 5px 7px 14px rgba(58,39,29,.065);
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transform: translate(-3px,-50%) scaleX(.82);
  transform-origin: left center;
  transition: opacity .14s ease,transform .18s cubic-bezier(.2,.8,.3,1),color .14s ease,background .14s ease,border-color .14s ease,box-shadow .14s ease;
}
.template-detail-handle svg { width: 8px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; transition: transform .18s ease; }
.template-card-shell:hover .template-detail-handle,
.template-card-shell:focus-within .template-detail-handle,
.template-detail-handle[aria-expanded="true"] { opacity: 1; pointer-events: auto; transform: translate(0,-50%) scaleX(1); }
.template-card-shell:hover .template-card:not(.active) img,
.template-card-shell:focus-within .template-card:not(.active) img { border-color: #f0cbbd; }
.template-detail-handle:hover,
.template-detail-handle:focus-visible,
.template-detail-handle[aria-expanded="true"] { color: #fff; background: #ff5642; border-color: #ff5642; box-shadow: 6px 9px 18px rgba(224,66,45,.17); outline: 0; }
.template-detail-handle:focus-visible { outline: 3px solid rgba(255,86,66,.18); outline-offset: 2px; }
.template-detail-handle[aria-expanded="true"] svg { transform: rotate(180deg); }
.template-tier {
  position: absolute;
  top: 7px;
  left: 7px;
  z-index: 6;
  min-width: 28px;
  height: 17px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
  border-radius: 999px;
  box-shadow: 0 3px 9px rgba(28,25,22,.12);
  font-size: 8px;
  font-weight: 900;
  line-height: 17px;
  letter-spacing: .02em;
  pointer-events: none;
}
.template-tier.free {
  color: #236b4a;
  background: rgba(238,251,244,.96);
  border: 1px solid rgba(53,145,99,.28);
}
.template-tier.premium {
  color: #fff;
  background: rgba(35,33,30,.92);
  border: 1px solid rgba(255,255,255,.26);
}

.template-peek {
  position: fixed;
  z-index: 74;
  width: 312px;
  max-height: calc(100vh - 24px);
  display: flex;
  flex-direction: column;
  overflow: visible;
  color: #211e1b;
  background: rgba(255,253,250,.985);
  border: 1px solid #e9e1d9;
  border-radius: 18px;
  box-shadow: 0 24px 64px rgba(42,31,22,.19),0 4px 14px rgba(42,31,22,.07);
  transform-origin: left center;
  animation: template-peek-in .18s cubic-bezier(.22,.82,.32,1) both;
}
.template-peek[hidden] { display: none; }
.template-peek-close {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 6;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  padding: 0 0 2px;
  color: #5f5750;
  background: rgba(255,255,255,.9);
  border: 1px solid rgba(226,216,207,.92);
  border-radius: 50%;
  box-shadow: 0 5px 14px rgba(47,35,27,.08);
  cursor: pointer;
  font-size: 19px;
  line-height: 1;
  backdrop-filter: blur(8px);
}
.template-peek-close:hover,.template-peek-close:focus-visible { color: #fff; background: #2c2825; border-color: #2c2825; outline: 0; }
.template-peek-visual {
  position: relative;
  min-height: 260px;
  display: grid;
  place-items: center;
  padding: 14px 14px 36px;
  overflow: hidden;
  background:
    radial-gradient(circle at 15% 16%,rgba(133,105,204,.12),transparent 32%),
    linear-gradient(145deg,#f6f1fb 0%,#f5f0ea 100%);
  border: 0;
  border-radius: 17px 17px 0 0;
  cursor: zoom-in;
}
.template-peek-visual::after { content: ""; position: absolute; inset: auto 0 0; height: 72px; background: linear-gradient(180deg,transparent,rgba(27,23,20,.62)); pointer-events: none; }
.template-peek-visual img { width: 164px; height: 218px; object-fit: contain; border: 1px solid rgba(255,255,255,.8); border-radius: 10px; background: #fff; box-shadow: 0 16px 34px rgba(46,34,24,.17); transition: transform .2s ease,box-shadow .2s ease; }
.template-peek-visual:hover img,.template-peek-visual:focus-visible img { transform: translateY(-2px) scale(1.012); box-shadow: 0 20px 40px rgba(46,34,24,.22); }
.template-peek-visual > span { position: absolute; left: 50%; bottom: 10px; z-index: 2; display: inline-flex; align-items: center; gap: 6px; color: #fff; transform: translateX(-50%); font-size: 11px; font-weight: 800; white-space: nowrap; }
.template-peek-visual svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.template-peek-copy { padding: 15px 17px 10px; }
.template-peek-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.template-peek-heading > div { min-width: 0; display: grid; gap: 5px; }
.template-peek-heading > div > span { width: max-content; min-height: 18px; display: inline-flex; align-items: center; padding: 0 7px; color: #2d7452; background: #edf8f1; border: 1px solid #cfe8d8; border-radius: 999px; font-size: 9px; font-weight: 850; }
.template-peek[data-tier="premium"] .template-peek-heading > div > span { color: #fff; background: #282522; border-color: #282522; }
.template-peek-heading strong { overflow: hidden; color: #201d1a; font-size: 17px; font-weight: 920; line-height: 1.25; letter-spacing: -.025em; text-overflow: ellipsis; white-space: nowrap; }
.template-peek-favorite {
  position: relative;
  flex: 0 0 auto;
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 0 8px;
  color: #6f675f;
  background: #fff;
  border: 1px solid #e8e0d8;
  border-radius: 9px;
  cursor: pointer;
  font-size: 9px;
  font-weight: 820;
}
.template-peek-favorite svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linejoin: round; }
.template-peek-favorite:hover,
.template-peek-favorite:focus-visible { color: #e44935; background: #fff2ed; border-color: #f0bcae; outline: 0; }
.template-peek-favorite.is-favorite { color: #e54834; background: #fff0eb; border-color: #f1b6a8; }
.template-peek-favorite.is-favorite svg { fill: currentColor; }
.template-peek-favorite::after {
  content: attr(data-tooltip);
  position: absolute;
  right: 0;
  bottom: calc(100% + 7px);
  z-index: 3;
  width: max-content;
  max-width: 130px;
  padding: 5px 7px;
  color: #fff;
  background: rgba(37,33,30,.94);
  border-radius: 6px;
  box-shadow: 0 6px 16px rgba(30,24,20,.15);
  font-size: 8px;
  font-weight: 700;
  line-height: 1.35;
  opacity: 0;
  pointer-events: none;
  transform: translateY(3px);
  transition: opacity .14s ease,transform .14s ease;
}
.template-peek-favorite:hover::after,
.template-peek-favorite:focus-visible::after { opacity: 1; transform: translateY(0); }
.template-peek-copy p { margin: 10px 0 0; color: #6c635c; font-size: 11px; font-weight: 620; line-height: 1.6; }
.template-peek-copy ul { display: grid; gap: 5px; margin: 10px 0 0; padding: 9px 10px; color: #4c4540; background: #f8f5f1; border-radius: 10px; list-style: none; font-size: 10px; font-weight: 650; line-height: 1.5; }
.template-peek-copy li { position: relative; padding-left: 11px; }
.template-peek-copy li::before { content: ""; position: absolute; left: 0; top: .58em; width: 4px; height: 4px; background: #ff5a43; border-radius: 50%; }
.template-peek-actions { display: grid; gap: 8px; padding: 0 14px 14px; }
.template-peek-case { min-height: 34px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; color: #e44b37; background: transparent; border: 0; border-radius: 9px; cursor: pointer; font-size: 11px; font-weight: 850; }
.template-peek-case:hover,.template-peek-case:focus-visible { background: #fff0eb; outline: 0; }
.template-peek-case svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.template-peek-use,.template-lightbox-card footer button,.template-case-card footer button { min-height: 42px; padding: 0 15px; color: #fff; background: linear-gradient(135deg,#ff6049,#ed412f); border: 0; border-radius: 10px; box-shadow: 0 9px 20px rgba(231,67,45,.2); cursor: pointer; font-size: 12px; font-weight: 900; }
.template-peek-use { display: flex; align-items: center; justify-content: space-between; }
.template-peek-use:hover,.template-peek-use:focus-visible,.template-lightbox-card footer button:hover,.template-lightbox-card footer button:focus-visible,.template-case-card footer button:hover,.template-case-card footer button:focus-visible { background: linear-gradient(135deg,#f34f3b,#da3224); outline: 3px solid rgba(255,82,57,.15); }
.template-peek-use span,.template-lightbox-card footer button span,.template-case-card footer button span { font-size: 17px; font-weight: 500; }

.template-lightbox,.template-case-dialog { padding: 0; color: #26211e; background: transparent; border: 0; overflow: visible; }
.template-lightbox { width: min(900px,calc(100vw - 40px)); max-height: calc(100vh - 36px); }
.template-case-dialog { width: min(820px,calc(100vw - 40px)); }
.template-lightbox::backdrop,.template-case-dialog::backdrop { background: rgba(27,23,20,.64); backdrop-filter: blur(7px); }
.template-lightbox-card,.template-case-card { overflow: hidden; background: #fffdfa; border: 1px solid rgba(255,255,255,.7); border-radius: 22px; box-shadow: 0 34px 100px rgba(18,14,11,.34); }
.template-lightbox-card > header,.template-case-card > header { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; padding: 18px 20px; border-bottom: 1px solid #eee7df; }
.template-lightbox-card > header > div { display: grid; gap: 4px; }
.template-lightbox-card > header span,.template-case-card > header span { color: #9a8f86; font-size: 9px; font-weight: 850; letter-spacing: .1em; }
.template-lightbox-card > header strong { font-size: 18px; font-weight: 920; }
.template-lightbox-card > header button,.template-case-card > header button { width: 32px; height: 32px; padding: 0 0 2px; color: #776f68; background: #f2eee9; border: 0; border-radius: 50%; cursor: pointer; font-size: 22px; line-height: 1; }
.template-lightbox-card > header button:hover,.template-lightbox-card > header button:focus-visible,.template-case-card > header button:hover,.template-case-card > header button:focus-visible { color: #fff; background: #2c2825; outline: 0; }
.template-lightbox-stage { height: min(68vh,680px); min-height: 0; display: grid; place-items: center; padding: 22px; overflow: hidden; background: radial-gradient(circle at 50% 20%,#f9f6f1,#eee8e1); }
.template-lightbox-stage img { width: auto; height: 100%; min-width: 0; min-height: 0; max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 12px; box-shadow: 0 22px 52px rgba(46,35,25,.19); }
.template-lightbox-card > footer { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 14px 20px; }
.template-lightbox-card > footer p { margin: 0; color: #756c64; font-size: 11px; line-height: 1.5; }
.template-lightbox-card > footer button { min-width: 156px; display: inline-flex; align-items: center; justify-content: space-between; gap: 14px; }

.template-case-card > header { padding: 24px 26px 20px; }
.template-case-card > header > div { min-width: 0; }
.template-case-card h2 { margin: 7px 0 6px; font-size: 25px; font-weight: 930; letter-spacing: -.035em; }
.template-case-card header p { max-width: 620px; margin: 0; color: #746b64; font-size: 12px; line-height: 1.55; }
.template-case-body { display: grid; grid-template-columns: .86fr 1.14fr; gap: 18px; padding: 20px 26px 24px; }
.template-case-guidance,.template-case-example { min-width: 0; }
.template-case-guidance > span,.template-case-example > div > span { color: #e34b38; font-size: 10px; font-weight: 900; letter-spacing: .08em; }
.template-case-guidance ul { display: grid; gap: 11px; margin: 14px 0 0; padding: 0; list-style: none; counter-reset: guide-note; }
.template-case-guidance li { counter-increment: guide-note; position: relative; padding: 13px 13px 13px 42px; color: #514943; background: #f7f3ee; border: 1px solid #eee6dd; border-radius: 11px; font-size: 11px; font-weight: 650; line-height: 1.6; }
.template-case-guidance li::before { content: counter(guide-note); position: absolute; left: 13px; top: 13px; width: 20px; height: 20px; display: grid; place-items: center; color: #fff; background: #2c2825; border-radius: 50%; font-size: 9px; font-weight: 900; }
.template-case-example { overflow: hidden; background: #22201e; border-radius: 13px; box-shadow: inset 0 1px 0 rgba(255,255,255,.06); }
.template-case-example > div { display: flex; align-items: center; justify-content: space-between; padding: 12px 15px; border-bottom: 1px solid rgba(255,255,255,.08); }
.template-case-example > div > span { color: #ff8977; }
.template-case-example small { color: #7f7770; font-size: 8px; font-weight: 850; letter-spacing: .12em; }
.template-case-example pre { min-height: 246px; max-height: 42vh; margin: 0; padding: 16px; overflow: auto; color: #f0e9e2; font: 500 11px/1.75 ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace; white-space: pre-wrap; word-break: break-word; }
.template-case-card > footer { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 14px 26px 18px; border-top: 1px solid #eee7df; }
.template-case-card > footer > span { color: #978e86; font-size: 10px; font-weight: 650; }
.template-case-card > footer button { min-width: 170px; display: inline-flex; align-items: center; justify-content: space-between; gap: 14px; }
@keyframes template-peek-in { from { opacity: 0; transform: translateX(-6px) scale(.975); } to { opacity: 1; transform: translateX(0) scale(1); } }

.workspace-main {
  width: 100vw;
  height: 100vh;
  display: grid;
  grid-template-columns: minmax(390px,520px) minmax(560px,1fr);
  grid-template-rows: minmax(0,1fr);
  gap: var(--panel-gap);
  padding: calc(var(--topbar-h) + 14px) 20px 20px calc(var(--sidebar-w) + var(--template-w) + 16px);
  overflow: hidden;
  background: #fff;
}
.editor-panel, .preview-panel {
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 15px;
  box-shadow: 0 1px 2px rgba(28,42,34,.025);
  font-synthesis: none;
}
.editor-panel { position: relative; display: grid; grid-template-rows: 50px minmax(0,1fr) repeat(5,auto); }
.editor-panel.is-image-over::after {
  content: "松开即可上传并插入图片或视频";
  position: absolute;
  z-index: 20;
  inset: 62px 14px 14px;
  display: grid;
  place-items: center;
  color: #25211e;
  background: rgba(255,248,238,.94);
  border: 2px dashed #ff684f;
  border-radius: 12px;
  pointer-events: none;
  font-size: 14px;
  font-weight: 900;
  backdrop-filter: blur(6px);
}
.editor-toolbar {
  min-width: 0;
  height: 50px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 20px;
  background: #fff;
  border-bottom: 1px solid #eee9e3;
  overflow: hidden;
}
.editor-toolbar > strong { flex: 0 0 auto; margin-right: 8px; color: var(--ui-ink); font-size: 13px; font-weight: 700; letter-spacing: -.01em; white-space: nowrap; }
.formatbar {
  min-width: 0;
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  gap: 2px;
  overflow-x: auto;
  scrollbar-width: none;
}
.formatbar::-webkit-scrollbar { display: none; }
.formatbar button {
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  padding: 0;
  color: #6f6962;
  background: transparent;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
}
.formatbar button:hover, .formatbar button:focus-visible { outline: 0; color: #1d1d1f; background: #f5f1ec; }
.formatbar .bold-tool { font-family: inherit; font-size: 13px; }
.formatbar > i { width: 1px; height: 18px; flex: 0 0 1px; margin: 0 4px; background: #ece6df; }
.formatbar svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
#inlineVideoButton { position: relative; }
#inlineVideoButton[aria-busy="true"] {
  color: #cf4939;
  background: #fff2ed;
  cursor: progress;
}
#inlineVideoButton[aria-busy="true"]:hover,
#inlineVideoButton[aria-busy="true"]:focus-visible {
  color: #cf4939;
  background: #fff2ed;
}
#inlineVideoButton[aria-busy="true"] svg { opacity: .18; }
#inlineVideoButton[aria-busy="true"]::after {
  content: "";
  position: absolute;
  width: 12px;
  height: 12px;
  border: 1.5px solid rgba(207,73,57,.24);
  border-top-color: currentColor;
  border-radius: 50%;
  animation: spin .8s linear infinite;
}

#markdown {
  display: block;
  width: 100%;
  min-height: 0;
  padding: 22px 26px;
  resize: none;
  color: #171716;
  background: #fff;
  border: 0;
  outline: 0;
  font: 400 14px/1.86 "PingFang SC","Hiragino Sans GB","Microsoft YaHei","Noto Sans CJK SC",sans-serif;
  letter-spacing: .005em;
  caret-color: var(--accent);
}

.video-shelf {
  display: grid;
  gap: 10px;
  padding: 12px 20px 14px;
  background: #fff;
  border-top: 1px solid #eee9e3;
}
.video-shelf-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}
.video-shelf-head strong {
  color: #27231f;
  font-size: 11px;
  font-weight: 850;
  letter-spacing: -.01em;
}
.video-shelf-head span {
  overflow: hidden;
  color: #999088;
  font-size: 9px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.video-shelf-list {
  display: flex;
  gap: 9px;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: thin;
  scrollbar-color: #ddd5ce transparent;
}
.video-shelf-item {
  position: relative;
  width: 154px;
  height: 86px;
  flex: 0 0 154px;
  overflow: hidden;
  background: #171513;
  border: 1px solid #e7dfd8;
  border-radius: 11px;
  box-shadow: 0 5px 16px rgba(43,34,27,.09);
}
.video-shelf-item > img,
.video-shelf-item > video {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}
.video-shelf-play {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  padding: 0;
  color: #fff;
  background: rgba(24,21,19,.72);
  border: 1px solid rgba(255,255,255,.74);
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 7px 20px rgba(0,0,0,.24);
  backdrop-filter: blur(8px);
  transform: translate(-50%,-50%);
  transition: background .16s ease,transform .16s ease;
}
.video-shelf-play::after {
  content: "";
  width: 0;
  height: 0;
  margin-left: 2px;
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
  border-left: 8px solid currentColor;
}
.video-shelf-play:hover,
.video-shelf-play:focus-visible {
  outline: 0;
  background: #ff4b3b;
  transform: translate(-50%,-50%) scale(1.06);
}
.video-shelf-meta {
  position: absolute;
  right: 7px;
  bottom: 6px;
  padding: 3px 6px;
  color: #fff;
  background: rgba(15,13,12,.68);
  border-radius: 5px;
  font-size: 8px;
  font-weight: 800;
  line-height: 1;
  backdrop-filter: blur(5px);
}
.video-shelf-remove {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  padding: 0 0 2px;
  color: #fff;
  background: rgba(23,20,18,.64);
  border: 1px solid rgba(255,255,255,.3);
  border-radius: 50%;
  cursor: pointer;
  font-size: 15px;
  line-height: 1;
  backdrop-filter: blur(6px);
}
.video-shelf-remove:hover,
.video-shelf-remove:focus-visible { outline: 0; background: #d94837; }

.cover-settings {
  display: grid;
  gap: 10px;
  padding: 14px 20px 16px;
  background: #fff;
  border-top: 1px solid #eee9e3;
}
.cover-settings-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}
.cover-settings-head strong { color: #2a2927; font-size: 13px; font-weight: 900; }
.cover-settings-head span { color: #938d86; font-size: 10px; font-weight: 700; }
.cover-drop-zone {
  min-width: 0;
  min-height: 58px;
  display: grid;
  grid-template-columns: 46px minmax(0,1fr) auto;
  align-items: center;
  gap: 11px;
  padding: 8px 11px;
  background: #fafbfe;
  border: 1px solid #dedfe4;
  border-radius: 13px;
  cursor: pointer;
  transition: border-color .16s ease,background .16s ease,box-shadow .16s ease;
}
.cover-drop-zone:hover,
.cover-drop-zone:focus-visible,
.cover-drop-zone.is-over {
  outline: 0;
  background: #fff9f6;
  border-color: #f1a38f;
  box-shadow: 0 0 0 3px rgba(255,74,53,.08);
}
.cover-thumb {
  width: 46px;
  height: 34px;
  background-color: #ece9e5;
  background-image: url('/assets/default-cover.svg?v=af9aa0cec71ff6fc');
  background-position: center;
  background-size: cover;
  border: 1px solid rgba(40,36,31,.08);
  border-radius: 8px;
  box-shadow: 0 4px 10px rgba(32,27,20,.08);
}
.cover-thumb.is-empty { background-image: none !important; box-shadow: none; }
.cover-drop-copy { min-width: 0; display: grid; gap: 2px; }
.cover-drop-copy strong,
.cover-drop-copy span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cover-drop-copy strong { color: #55514d; font-size: 11px; font-weight: 850; }
.cover-drop-copy span { color: #918a83; font-size: 10px; font-weight: 650; }
.cover-remove {
  min-width: 66px;
  padding: 7px 8px;
  color: #a25445;
  background: transparent;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  font-size: 11px;
  font-weight: 850;
  white-space: nowrap;
}
.cover-remove:hover { background: #fff0eb; }
.poster-footer-settings,
.source-lead-settings {
  min-height: 72px;
  display: grid;
  grid-template-columns: minmax(0,1fr) minmax(180px,1.15fr);
  align-items: center;
  gap: 18px;
  padding: 11px 20px;
  background: #fff;
  border-top: 1px solid #eee9e3;
}
.poster-footer-settings label,
.source-lead-settings label { min-width: 0; display: grid; gap: 3px; }
.poster-footer-settings label strong,
.source-lead-settings label strong { color: #2a2927; font-size: 13px; font-weight: 900; }
.poster-footer-settings label span,
.source-lead-settings label span {
  overflow: hidden;
  color: #918a83;
  font-size: 10px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.poster-footer-settings input,
.source-lead-settings input {
  min-width: 0;
  height: 38px;
  padding: 0 11px;
  color: #35322f;
  background: #faf9f7;
  border: 1px solid #ddd8d2;
  border-radius: 10px;
  font: 750 12px/1 inherit;
  transition: border-color .16s ease,background .16s ease,box-shadow .16s ease;
}
.poster-footer-settings input:hover,
.source-lead-settings input:hover { background: #fff; border-color: #cfc7bf; }
.poster-footer-settings input:focus,
.source-lead-settings input:focus {
  outline: 0;
  background: #fff;
  border-color: #f19a83;
  box-shadow: 0 0 0 3px rgba(255,74,53,.08);
}
.layout-settings,
.card-theme-settings,
.paper-style-settings {
  min-height: 62px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 11px 20px;
  background: #fff;
  border-top: 1px solid #eee9e3;
}
.layout-settings-copy,
.card-theme-settings-copy,
.paper-style-settings-copy { min-width: 0; display: grid; gap: 3px; }
.layout-settings-copy strong,
.card-theme-settings-copy strong,
.paper-style-settings-copy strong { color: #2a2927; font-size: 13px; font-weight: 900; }
.layout-settings-copy span,
.card-theme-settings-copy span,
.paper-style-settings-copy span {
  overflow: hidden;
  color: #918a83;
  font-size: 10px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.layout-segment,
.card-theme-segment,
.paper-style-segment {
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: repeat(2,52px);
  gap: 3px;
  padding: 3px;
  background: #f3f1ee;
  border: 1px solid #ebe7e2;
  border-radius: 11px;
}
.layout-segment button,
.card-theme-segment button,
.paper-style-segment button {
  height: 31px;
  padding: 0 10px;
  color: #89837c;
  background: transparent;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 900;
  transition: color .15s ease,background .15s ease,box-shadow .15s ease,transform .15s ease;
}
.layout-segment button:hover,
.card-theme-segment button:hover,
.paper-style-segment button:hover { color: #3b3834; }
.layout-segment button:focus-visible,
.card-theme-segment button:focus-visible,
.paper-style-segment button:focus-visible { outline: 2px solid rgba(255,74,53,.34); outline-offset: 1px; }
.layout-segment button.active,
.card-theme-segment button.active,
.paper-style-segment button.active {
  color: #fff;
  background: #262522;
  box-shadow: 0 5px 12px rgba(31,29,26,.18);
}
.layout-segment button.active:active,
.card-theme-segment button.active:active,
.paper-style-segment button.active:active { transform: translateY(1px); }

.identity-zone {
  position: relative;
  min-height: 81px;
  display: grid;
  grid-template-columns: 36px minmax(0,1fr) 108px 40px;
  align-items: center;
  gap: 12px;
  margin: 0;
  padding: 21px 32px;
  background: #fff;
  border-top: 1px solid #eee9e3;
}
.identity-zone::before {
  content: "";
  position: absolute;
  inset: 12px 20px;
  border: 1px solid #e8e4df;
  border-radius: 12px;
  pointer-events: none;
}
.identity-avatar {
  position: relative;
  z-index: 1;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: 1px solid #ece6df;
  border-radius: 50%;
  background: #fffdf9;
  overflow: hidden;
}
.identity-avatar-quick { padding: 0; cursor: pointer; transition: border-color .16s ease,box-shadow .16s ease,transform .16s ease; }
.identity-avatar-quick:hover,.identity-avatar-quick:focus-visible { outline: 0; border-color: #ff7a65; box-shadow: 0 0 0 3px rgba(255,74,53,.11); transform: translateY(-1px); }
.identity-avatar-quick::after { content: "↻"; position: absolute; right: -1px; bottom: -1px; width: 14px; height: 14px; display: grid; place-items: center; color: #fff; background: #282522; border: 2px solid #fff; border-radius: 50%; font-size: 8px; font-weight: 900; line-height: 1; opacity: 0; transform: scale(.72); transition: opacity .16s ease,transform .16s ease; }
.identity-avatar-quick:hover::after,.identity-avatar-quick:focus-visible::after { opacity: 1; transform: scale(1); }
.identity-zone.is-guest .identity-avatar {
  color: #8b837b;
  background: #faf7f3;
  border-color: #d9d1c8;
  border-style: dashed;
}
.identity-zone.is-guest .identity-avatar::before {
  content: "+";
  display: grid;
  place-items: center;
  color: currentColor;
  font-size: 22px;
  font-weight: 450;
  line-height: 1;
}
.identity-zone.is-guest .identity-avatar-quick::after { display: none; }
.identity-zone.is-guest .identity-copy strong { color: #625c56; font-weight: 800; }
.identity-avatar svg { width: 30px; height: 30px; fill: #fff; stroke: #242321; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.identity-avatar svg circle { fill: #242321; stroke: none; }
.identity-copy { z-index: 1; display: grid; gap: 3px; min-width: 0; }
.identity-copy strong { overflow: hidden; color: #242321; font-size: 13px; font-weight: 900; text-overflow: ellipsis; white-space: nowrap; }
.identity-copy span { color: #8a8580; font-size: 11px; font-weight: 700; }
.identity-copy .identity-name-row { min-width: 0; display: flex; align-items: center; gap: 3px; overflow: visible; }
.identity-name-row strong { min-width: 0; }
.identity-name-quick-edit { width: 22px; height: 22px; flex: 0 0 22px; display: grid; place-items: center; padding: 0; color: #948d86; background: transparent; border: 0; border-radius: 6px; cursor: pointer; }
.identity-name-quick-edit:hover,.identity-name-quick-edit:focus-visible { color: #24211e; background: #f2ede8; outline: 0; }
.identity-name-quick-edit svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.identity-name-quick-form { min-width: 0; display: grid; grid-template-columns: minmax(0,1fr) 25px; gap: 4px; }
.identity-name-quick-form[hidden] { display: none; }
.identity-name-quick-form input { min-width: 0; height: 25px; padding: 0 7px; color: #24211e; background: #fff; border: 1px solid #dcd4cc; border-radius: 7px; outline: 0; font-family: inherit; font-size: 11px; font-weight: 850; }
.identity-name-quick-form input:focus { border-color: #2d2925; box-shadow: 0 0 0 2px rgba(45,41,37,.08); }
.identity-name-quick-form button { width: 25px; height: 25px; padding: 0; color: #fff; background: #292622; border: 0; border-radius: 7px; cursor: pointer; font-size: 11px; font-weight: 900; }
.identity-switch {
  z-index: 1;
  width: 108px;
  min-width: 108px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 13px;
  color: #272521;
  background: #fff;
  border: 1px solid #e7e1da;
  border-radius: 11px;
  cursor: pointer;
  box-shadow: 0 6px 15px rgba(30,26,20,.04);
  font-size: 13px;
  font-weight: 850;
}
.identity-switch svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.identity-switch span { white-space: nowrap; }
.identity-edit {
  z-index: 1;
  width: 40px;
  height: 36px;
  display: grid;
  place-items: center;
  padding: 0;
  color: #302e2a;
  background: #fff;
  border: 1px solid #e7e1da;
  border-radius: 11px;
  cursor: pointer;
}
.identity-edit svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.identity-avatar.has-image,
.identity-option-avatar.has-image,
.identity-avatar-preview.has-image {
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
}
.identity-popover {
  position: absolute;
  right: 20px;
  bottom: calc(100% - 14px);
  z-index: 35;
  width: min(320px, calc(100vw - 52px));
  padding: 12px;
  background: #fff;
  border: 1px solid #e6e0d9;
  border-radius: 15px;
  box-shadow: 0 18px 44px rgba(39,31,23,.16);
}
.identity-popover[hidden] { display: none; }
.identity-popover-head { display: grid; gap: 3px; padding: 3px 4px 9px; }
.identity-popover-head strong { color: #292622; font-size: 12px; font-weight: 950; }
.identity-popover-head span { color: #938c84; font-size: 10px; font-weight: 700; }
.identity-list { display: grid; gap: 3px; max-height: 230px; overflow: auto; padding: 2px; }
.identity-option {
  width: 100%;
  min-height: 52px;
  display: grid;
  grid-template-columns: 34px minmax(0,1fr) 18px;
  align-items: center;
  gap: 9px;
  padding: 8px;
  color: #282522;
  background: transparent;
  border: 0;
  border-radius: 10px;
  cursor: pointer;
  font-family: inherit;
  text-align: left;
}
.identity-option:hover,.identity-option:focus-visible,.identity-option.active { outline: 0; background: #fff5ef; }
.identity-option-avatar { width: 34px; height: 34px; border: 1px solid #e8e1da; border-radius: 50%; background-color: #f4efe9; }
.identity-option-copy { min-width: 0; display: grid; gap: 3px; }
.identity-option-copy b,.identity-option-copy small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.identity-option-copy b { font-size: 12px; font-weight: 900; }
.identity-option-copy small { color: #887f77; font-size: 10px; font-weight: 700; }
.identity-option-mark { color: var(--accent); font-size: 14px; font-weight: 950; text-align: center; }
.identity-add {
  width: 100%;
  min-height: 34px;
  margin-top: 8px;
  color: #3c3732;
  background: #fff;
  border: 1px dashed #d9d1c9;
  border-radius: 9px;
  cursor: pointer;
  font-family: inherit;
  font-size: 11px;
  font-weight: 850;
}
.identity-add:hover,.identity-add:focus-visible { color: #fff; background: #ff4a35; border-color: #ff4a35; outline: 0; }
.identity-dialog {
  width: min(680px, calc(100vw - 32px));
  max-height: min(850px, calc(100vh - 32px));
  overflow: auto;
  padding: 0;
  color: #24211e;
  background: transparent;
  border: 0;
  border-radius: 18px;
  box-shadow: 0 26px 80px rgba(23,18,13,.28);
}
.identity-dialog::backdrop { background: rgba(24,21,18,.48); backdrop-filter: blur(4px); }
.identity-dialog-card { display: grid; gap: 15px; padding: 24px; background: #fffdfa; border-radius: 18px; }
.identity-dialog-card > header { display: flex; justify-content: space-between; gap: 18px; }
.identity-dialog-card header > div { display: grid; gap: 4px; }
.identity-dialog-card header span { color: #948c84; font-size: 10px; font-weight: 850; letter-spacing: .08em; }
.identity-dialog-card header strong { font-size: 20px; font-weight: 950; letter-spacing: -.025em; }
.identity-dialog-card header p { margin: 0; color: #867e76; font-size: 11px; font-weight: 650; line-height: 1.55; }
.identity-dialog-close { width: 34px; height: 34px; padding: 0 0 2px; color: #6d655e; background: #f2eee9; border: 0; border-radius: 50%; cursor: pointer; font-size: 22px; }
.identity-dialog-close:hover,.identity-dialog-close:focus-visible { color: #fff; background: #292622; outline: 0; }
.identity-avatar-field { min-height: 74px; display: flex; align-items: center; gap: 13px; padding: 10px 12px; background: #faf7f2; border: 1px dashed #d7cec5; border-radius: 12px; cursor: pointer; }
.identity-avatar-preview { width: 52px; height: 52px; flex: 0 0 auto; border: 1px solid #e3dad2; border-radius: 50%; background-color: #f0ebe5; }
.identity-avatar-field > span:nth-child(2) { display: grid; gap: 4px; }
.identity-avatar-field b { font-size: 12px; font-weight: 900; }
.identity-avatar-field small { color: #8f877f; font-size: 10px; font-weight: 700; }
.identity-field { display: grid; gap: 7px; }
.identity-field > span { color: #514b45; font-size: 10px; font-weight: 850; }
.identity-field input { width: 100%; height: 42px; padding: 0 12px; color: #27231f; background: #fff; border: 1px solid #ded6cf; border-radius: 10px; outline: 0; font: 700 13px/1 inherit; }
.identity-field select { width: 100%; height: 42px; padding: 0 34px 0 12px; color: #27231f; background: #fff; border: 1px solid #ded6cf; border-radius: 10px; outline: 0; font: 700 13px/1 inherit; appearance: none; background-image: linear-gradient(45deg,transparent 50%,#817970 50%),linear-gradient(135deg,#817970 50%,transparent 50%); background-position: calc(100% - 17px) 18px,calc(100% - 12px) 18px; background-size: 5px 5px,5px 5px; background-repeat: no-repeat; }
.identity-field input:focus,.identity-field select:focus { border-color: #282521; box-shadow: 0 0 0 3px rgba(40,37,33,.08); }
.identity-form-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
.identity-form-error { min-height: 15px; margin: -4px 0 0; color: #c34231; font-size: 10px; font-weight: 750; }
.identity-dialog-card > footer { display: grid; grid-template-columns: auto 1fr auto auto; gap: 8px; align-items: center; padding-top: 3px; }
.identity-dialog-card > footer button { min-height: 36px; padding: 0 12px; border-radius: 9px; cursor: pointer; font: 850 11px/1 inherit; }

/* Account matrix — a calm, manual-first creator operations board. */
.matrix-shell {
  position: fixed;
  inset: var(--topbar-h) 0 0 var(--sidebar-w);
  z-index: 36;
  overflow: auto;
  background: #fdfcfb;
}
body[data-workspace-mode="matrix"] .topbar { left: var(--sidebar-w); }
body[data-workspace-mode="matrix"] .template-dock,
body[data-workspace-mode="matrix"] .workspace-main,
body[data-workspace-mode="matrix"] .toolbox-shell { display: none; }
body[data-workspace-mode="matrix"] .matrix-shell { display: block; }
.matrix-page {
  width: min(1380px,100%);
  min-height: 100%;
  margin: 0 auto;
  padding: 26px 28px 38px;
}
.matrix-page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; }
.matrix-page-head h1 { margin: 0; color: #171716; font-size: 26px; font-weight: 950; line-height: 1.25; letter-spacing: -.045em; }
.matrix-page-head p { margin: 7px 0 0; color: #807972; font-size: 13px; font-weight: 600; }
.matrix-add-primary {
  min-width: 124px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 17px;
  color: #fff;
  background: linear-gradient(135deg,#ff624d,#f04431);
  border: 0;
  border-radius: 10px;
  box-shadow: 0 8px 18px rgba(240,68,49,.16);
  cursor: pointer;
  font-size: 13px;
  font-weight: 850;
  transition: transform .16s ease,box-shadow .16s ease;
}
.matrix-add-primary span { font-size: 20px; font-weight: 400; line-height: 1; }
.matrix-add-primary:hover,.matrix-add-primary:focus-visible { outline: 0; transform: translateY(-1px); box-shadow: 0 12px 24px rgba(240,68,49,.22); }
.matrix-summary { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 16px; margin-top: 22px; }
.matrix-summary article { min-width: 0; min-height: 100px; display: flex; align-items: center; gap: 17px; padding: 18px 19px; background: #fff; border: 1px solid #e7e3df; border-radius: 14px; box-shadow: 0 1px 1px rgba(31,26,22,.015); }
.matrix-summary-icon { width: 49px; height: 49px; flex: 0 0 49px; display: grid; place-items: center; overflow: hidden; border-radius: 50%; font-size: 18px; font-weight: 900; letter-spacing: -7px; text-indent: -6px; }
.matrix-summary-icon.people { color: #ef543f; background: #fff0eb; }
.matrix-summary-icon.heart { color: #8651d6; background: #f4effd; font-size: 22px; letter-spacing: 0; text-indent: 0; }
.matrix-summary-icon.like { color: #ed8b1d; background: #fff5e7; letter-spacing: 0; text-indent: 0; }
.matrix-summary-icon.active { color: #3d9b5e; background: #edf8f0; letter-spacing: 0; text-indent: 0; }
.matrix-summary article div { min-width: 0; display: grid; gap: 6px; }
.matrix-summary small { color: #817a73; font-size: 11px; font-weight: 650; white-space: nowrap; }
.matrix-summary strong { overflow: hidden; color: #151515; text-overflow: ellipsis; font-size: 24px; font-weight: 900; line-height: 1; letter-spacing: -.035em; }
.matrix-toolbar { display: flex; align-items: center; gap: 18px; margin-top: 20px; }
.matrix-search { width: min(280px,30vw); height: 40px; display: flex; align-items: center; gap: 9px; padding: 0 13px; background: #fff; border: 1px solid #e4dfda; border-radius: 10px; }
.matrix-search:focus-within { border-color: #c8c0b8; box-shadow: 0 0 0 3px rgba(42,37,32,.05); }
.matrix-search svg { width: 17px; height: 17px; flex: 0 0 auto; fill: none; stroke: #77716b; stroke-width: 1.6; stroke-linecap: round; }
.matrix-search input { min-width: 0; width: 100%; height: 100%; padding: 0; color: #26231f; background: transparent; border: 0; outline: 0; font: 650 12px/1 inherit; }
.matrix-search input::placeholder { color: #aaa39c; }
.matrix-filters { display: flex; align-items: center; gap: 9px; }
.matrix-filters button { height: 38px; padding: 0 17px; color: #4c4742; background: #fff; border: 1px solid #e4dfda; border-radius: 999px; cursor: pointer; font-size: 11px; font-weight: 750; }
.matrix-filters button:hover,.matrix-filters button:focus-visible { outline: 0; border-color: #cfc6be; }
.matrix-filters button.active { color: #25211e; background: #f7f4f1; border-color: #d8d0c9; box-shadow: inset 0 0 0 1px rgba(46,40,35,.02); }
.matrix-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 16px; margin-top: 16px; padding-bottom: 4px; }
.matrix-account-card {
  position: relative;
  min-width: 0;
  min-height: 208px;
  display: grid;
  grid-template-columns: minmax(210px,.92fr) minmax(260px,1.08fr);
  grid-template-rows: 1fr auto;
  column-gap: 20px;
  padding: 18px 20px 14px;
  background: #fff;
  border: 1px solid #e4dfda;
  border-radius: 13px;
  transition: border-color .16s ease,box-shadow .16s ease,transform .16s ease;
}
.matrix-account-card:hover { border-color: #d9cfc7; box-shadow: 0 12px 30px rgba(49,39,30,.055); transform: translateY(-1px); }
.matrix-account-card.is-current { border-color: #ff9f72; background: linear-gradient(118deg,#fffaf7 0%,#fff 70%); box-shadow: inset 0 0 0 1px rgba(255,122,80,.035); }
.matrix-account-card.is-paused { border-color: #e6d5cf; }
.matrix-card-left { min-width: 0; display: grid; align-content: start; }
.matrix-card-profile { min-width: 0; display: grid; grid-template-columns: 64px minmax(0,1fr); gap: 14px; align-items: center; }
.matrix-card-avatar { width: 64px; height: 64px; display: grid; place-items: center; overflow: hidden; color: #fff; background: linear-gradient(135deg,hsl(var(--avatar-hue) 72% 58%),hsl(calc(var(--avatar-hue) + 34) 67% 46%)); background-position: center; background-size: cover; border: 1px solid rgba(44,36,29,.08); border-radius: 50%; font-size: 19px; font-weight: 900; letter-spacing: -.08em; }
.matrix-card-copy { min-width: 0; display: grid; gap: 4px; }
.matrix-card-copy strong { overflow: hidden; color: #1e1b18; text-overflow: ellipsis; white-space: nowrap; font-size: 16px; font-weight: 900; letter-spacing: -.025em; }
.matrix-card-copy span { overflow: hidden; color: #7f7872; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; font-weight: 650; }
.matrix-card-copy small { overflow: hidden; color: #5e5852; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; font-weight: 700; }
.matrix-profile-link { width: max-content; max-width: 100%; display: inline-flex; align-items: center; gap: 5px; margin-top: 18px; overflow: hidden; color: #f04b35; text-overflow: ellipsis; white-space: nowrap; text-decoration: none; font-size: 11px; font-weight: 800; }
.matrix-profile-link:hover,.matrix-profile-link:focus-visible { outline: 0; color: #cf3524; text-decoration: underline; text-underline-offset: 3px; }
.matrix-profile-link.is-disabled { color: #aaa29a; cursor: default; pointer-events: none; }
.matrix-card-data { min-width: 0; display: grid; grid-template-rows: auto 1fr; align-content: start; padding-top: 33px; }
.matrix-metrics { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); }
.matrix-metrics div { min-width: 0; display: grid; gap: 6px; padding: 0 16px; border-left: 1px solid #eeeae6; }
.matrix-metrics small,.matrix-pricing > span,.matrix-price small { color: #817a73; font-size: 10px; font-weight: 650; }
.matrix-metrics strong { overflow: hidden; color: #1c1916; text-overflow: ellipsis; white-space: nowrap; font-size: 15px; font-weight: 900; }
.matrix-pricing { display: grid; gap: 7px; margin: 13px 0 0 16px; }
.matrix-pricing-box { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); min-height: 58px; border: 1px solid #ece7e2; border-radius: 9px; background: rgba(255,255,255,.78); }
.matrix-price { min-width: 0; display: grid; align-content: center; gap: 4px; padding: 8px 13px; }
.matrix-price + .matrix-price { border-left: 1px solid #eee9e4; }
.matrix-price strong { overflow: hidden; color: #1a1714; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; font-weight: 900; }
.matrix-card-foot { grid-column: 1/-1; display: flex; align-items: center; justify-content: space-between; min-width: 0; margin-top: 12px; padding-top: 11px; color: #8a837c; border-top: 1px solid #f0ece8; font-size: 9px; font-weight: 650; }
.matrix-card-status { position: absolute; top: 14px; right: 72px; height: 25px; display: inline-flex; align-items: center; padding: 0 9px; color: #328052; background: #edf8f0; border: 1px solid #d5ebdc; border-radius: 6px; font-size: 9px; font-weight: 850; }
.matrix-card-status.paused { color: #e45743; background: #fff0ed; border-color: #f4d8d2; }
.matrix-card-actions { position: absolute; top: 12px; right: 12px; display: flex; gap: 2px; }
.matrix-card-actions button { width: 28px; height: 28px; display: grid; place-items: center; padding: 0; color: #27231f; background: transparent; border: 0; border-radius: 7px; cursor: pointer; }
.matrix-card-actions button:hover,.matrix-card-actions button:focus-visible { outline: 0; background: #f4f0ec; }
.matrix-card-actions svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.65; stroke-linecap: round; stroke-linejoin: round; }
.matrix-empty-slot { min-height: 208px; display: grid; place-items: center; padding: 20px; color: #5e5750; background: rgba(255,255,255,.5); border: 1px dashed #d9aaa0; border-radius: 13px; cursor: pointer; }
.matrix-empty-slot > span { display: grid; justify-items: center; gap: 10px; font-size: 14px; font-weight: 750; }
.matrix-empty-slot i { width: 50px; height: 50px; display: grid; place-items: center; color: #ff5039; background: #fff1ed; border-radius: 50%; font-size: 28px; font-style: normal; font-weight: 350; }
.matrix-empty-slot:hover,.matrix-empty-slot:focus-visible { outline: 0; color: #24201d; background: #fffaf7; border-color: #ff826a; }
.matrix-no-results { grid-column: 1/-1; min-height: 220px; display: grid; place-items: center; color: #817a73; background: #fff; border: 1px dashed #ddd5ce; border-radius: 13px; font-size: 12px; font-weight: 700; }

@media (max-width: 1220px) {
  .matrix-summary { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .matrix-grid { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .identity-form-grid { grid-template-columns: 1fr; }
}
.billing-dialog {
  width: min(470px, calc(100vw - 32px));
  margin: auto;
  padding: 0;
  border: 0;
  border-radius: 24px;
  color: #24201e;
  background: transparent;
  box-shadow: 0 26px 80px rgba(25,19,15,.28);
}
.billing-dialog::backdrop { background: rgba(22,18,15,.58); backdrop-filter: blur(8px); }
.billing-dialog-card { padding: 29px; border: 1px solid #e9e0d8; border-radius: 24px; background: #fffdfa; }
.billing-dialog-card header { display: flex; justify-content: space-between; align-items: center; color: #a0958b; font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.billing-dialog-card header button { display: grid; width: 34px; height: 34px; place-items: center; padding: 0 0 2px; color: #746c65; border: 0; border-radius: 50%; background: #f5f1ed; cursor: pointer; font-size: 25px; line-height: 1; }
.billing-dialog-card h2 { margin: 21px 0 9px; color: #171311; font-family: Georgia,"Noto Serif SC",serif; font-size: 32px; letter-spacing: -.055em; }
.billing-dialog-card > p { margin: 0; color: #746b64; font-size: 14px; line-height: 1.7; }
.billing-products { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 9px; margin-top: 20px; }
.billing-products > span { grid-column: 1/-1; padding: 16px; color: #8d847c; text-align: center; font-size: 12px; }
.billing-product { position: relative; min-width: 0; padding: 14px 10px 12px; color: #38322d; text-align: left; border: 1px solid #e3dad1; border-radius: 14px; background: #fff; cursor: pointer; transition: border-color .15s,transform .15s,box-shadow .15s; }
.billing-product:hover,.billing-product:focus-visible { border-color: #ff624d; box-shadow: 0 8px 24px rgba(61,42,31,.09); outline: 0; transform: translateY(-1px); }
.billing-product[data-recommended="true"] { background: #fff8f5; }
.billing-product[aria-pressed="true"] { border-color: #ff5b46; box-shadow: inset 0 0 0 1px #ff5b46,0 10px 28px rgba(255,91,70,.12); transform: translateY(-1px); }
.billing-product em { position: absolute; top: -8px; right: 8px; padding: 3px 6px; color: #fff; border-radius: 999px; background: #ff543e; font-size: 8px; font-style: normal; font-weight: 850; }
.billing-product b,.billing-product strong,.billing-product small { display: block; }
.billing-product b { font-size: 12px; }
.billing-product strong { margin-top: 8px; color: #191512; font: 800 21px/1 Georgia,serif; }
.billing-product strong i { font: 750 10px/1 system-ui,sans-serif; }
.billing-product small { margin-top: 6px; color: #948a82; font-size: 9px; }
.billing-product:disabled { cursor: wait; opacity: .55; transform: none; }
.billing-pay { width: 100%; min-height: 52px; display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 14px; padding: 0 18px 0 20px; color: #fff; background: #24201e; border: 0; border-radius: 13px; cursor: pointer; box-shadow: 0 12px 26px rgba(36,32,30,.14); font-size: 13px; font-weight: 900; transition: background .16s ease,transform .16s ease,box-shadow .16s ease; }
.billing-pay:hover,.billing-pay:focus-visible { outline: 0; background: #ff503b; box-shadow: 0 14px 30px rgba(255,80,59,.2); transform: translateY(-1px); }
.billing-pay:disabled { color: #aaa29b; background: #eee9e4; box-shadow: none; cursor: not-allowed; transform: none; }
.billing-pay i { font-size: 19px; font-style: normal; }
.billing-divider { display: flex; align-items: center; gap: 10px; margin-top: 21px; color: #aaa097; font-size: 10px; }
.billing-divider::before,.billing-divider::after { content: ""; flex: 1; height: 1px; background: #ebe4dd; }
.invite-redeem-form { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 10px; margin-top: 22px; }
.invite-redeem-form label { min-width: 0; display: grid; gap: 7px; }
.invite-redeem-form label span { color: #514c47; font-size: 11px; font-weight: 850; }
.invite-redeem-form input { width: 100%; height: 48px; padding: 0 14px; color: #1f1d1a; background: #fbfaf8; border: 1px solid #ded8d1; border-radius: 11px; outline: 0; font: 800 13px/1 ui-monospace,SFMono-Regular,Menlo,monospace; letter-spacing: .04em; }
.invite-redeem-form input:focus { background: #fff; border-color: #292622; box-shadow: 0 0 0 3px rgba(41,38,34,.08); }
.invite-redeem-form input[aria-invalid="true"] { border-color: #e45743; box-shadow: 0 0 0 3px rgba(228,87,67,.09); }
.invite-redeem-form button { align-self: end; min-width: 112px; height: 48px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 14px; color: #fff; background: #24201e; border: 0; border-radius: 11px; cursor: pointer; font-weight: 850; }
.invite-redeem-form button:hover,.invite-redeem-form button:focus-visible { background: #ff4d37; outline: 0; }
.invite-redeem-form button:disabled { cursor: wait; opacity: .6; }
.invite-redeem-form button i { font-size: 17px; font-style: normal; }
.billing-order-state { margin: 20px 0 0; padding: 13px 14px; color: #2c704f; border: 1px solid #b8dfc9; border-radius: 12px; background: #f0fbf4; font-size: 13px; font-weight: 700; line-height: 1.55; }
.billing-order-state.is-error { color: #a43e31; border-color: #efc5bb; background: #fff4f1; }
.billing-dialog-card small { display: block; margin-top: 12px; color: #a0958b; font-size: 11px; line-height: 1.5; }
@media (max-width: 560px) { .billing-products { grid-template-columns: 1fr; } .billing-product { display: grid; grid-template-columns: 1fr auto; align-items: center; } .billing-product strong { margin-top: 0; } .billing-product small { grid-column: 1/-1; } .invite-redeem-form { grid-template-columns: 1fr; } .invite-redeem-form button { width: 100%; } }
.identity-delete { color: #c54233; background: transparent; border: 1px solid transparent; }
.identity-delete:hover,.identity-delete:focus-visible { background: #fff1ed; outline: 0; }
.identity-cancel { color: #5d5650; background: #fff; border: 1px solid #ded6cf; }
.identity-save { color: #fff; background: #24211e; border: 1px solid #24211e; }
.identity-save:hover,.identity-save:focus-visible { background: #ff4a35; border-color: #ff4a35; outline: 0; }

.preview-panel { display: grid; grid-template-rows: 50px minmax(0,1fr) 48px; }
.preview-head {
  height: 50px;
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 0 18px 0 20px;
  background: rgba(255,255,255,.96);
  border-bottom: 1px solid #e9e5df;
}
.preview-head > strong { overflow: hidden; color: #24211f; font-size: 13px; font-weight: 760; letter-spacing: -.018em; text-overflow: ellipsis; white-space: nowrap; }
.preview-actions {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0;
  margin-left: auto;
}
.preview-enhance {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}
.preview-enhance-meta {
  min-width: 58px;
  overflow: hidden;
  color: #8e877f;
  font-size: 9px;
  font-weight: 800;
  line-height: 1;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.preview-enhance.is-busy .preview-enhance-meta { color: #d56b4c; }
.preview-enhance.has-error .preview-enhance-meta { color: #aa5144; }
.preview-enhance-segment {
  display: grid;
  grid-template-columns: repeat(2,38px);
  gap: 2px;
  padding: 2px;
  background: #f3f1ee;
  border: 1px solid #ebe7e2;
  border-radius: 9px;
}
.preview-enhance-segment button {
  height: 24px;
  padding: 0;
  color: #8a847d;
  background: transparent;
  border: 0;
  border-radius: 7px;
  cursor: pointer;
  font-size: 10px;
  font-weight: 700;
  transition: color .15s ease,background .15s ease,box-shadow .15s ease;
}
.preview-enhance-segment button:hover { color: #35322f; }
.preview-enhance-segment button:focus-visible { outline: 2px solid rgba(255,74,53,.32); outline-offset: 1px; }
.preview-enhance-segment button.active {
  color: #fff;
  background: #302e2b;
  box-shadow: 0 3px 8px rgba(31,29,26,.16);
}
.preview-enhance-segment button:disabled { opacity: .52; cursor: wait; }
.premium-export-state {
  min-width: 0;
  height: 30px;
  display: inline-flex;
  align-items: center;
  margin-right: 13px;
  padding: 0 14px 0 0;
  border: 0;
  border-right: 1px solid #e3ded8;
  border-radius: 0;
  color: #79726b;
  background: transparent;
  font-size: 10px;
  font-weight: 650;
  letter-spacing: -.005em;
  white-space: nowrap;
}
.premium-export-state.is-pro {
  color: #337655;
  background: transparent;
  border-color: #e3ded8;
}
.premium-export-state.is-trial {
  color: #8b682b;
  background: transparent;
  border-color: #e3ded8;
  box-shadow: none;
}
.premium-export-state.is-stale {
  color: #a34e3b;
  background: transparent;
  border-color: #e3ded8;
}
.saved-state {
  height: 30px;
  display: flex;
  align-items: center;
  gap: 6px;
  margin-right: 14px;
  color: #4d8a68;
  font-size: 10.5px;
  font-weight: 680;
  letter-spacing: -.01em;
  white-space: nowrap;
}
.saved-state i {
  position: relative;
  width: 13px;
  height: 13px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(64,137,96,.34);
  border-radius: 50%;
  background: rgba(83,157,113,.09);
}
.saved-state i::after { content: "✓"; color: #428b61; font: 800 8px/1 system-ui,sans-serif; transform: translateY(-.2px); }
.saved-state.dirty { color: #8c867f; }
.saved-state.dirty i { border-color: #cac5bf; background: transparent; }
.saved-state.dirty i::after { content: ""; width: 3px; height: 3px; border-radius: 50%; background: #aaa49e; }
.saved-state.rendering { color: #c86144; }
.saved-state.rendering i { border-color: rgba(224,106,69,.35); background: rgba(240,122,82,.08); animation: status-pulse 1s ease-in-out infinite; }
.saved-state.rendering i::after { content: ""; width: 3px; height: 3px; border-radius: 50%; background: #e27452; }
@keyframes status-pulse { 50% { opacity: .35; } }
.export-button {
  min-width: 104px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 15px;
  color: #fff;
  background: #ff4b3b;
  border: 1px solid rgba(200,43,29,.12);
  border-radius: 9px;
  cursor: pointer;
  box-shadow: 0 1px 1px rgba(103,29,20,.08),0 4px 10px rgba(255,75,59,.12);
  font-size: 12px;
  font-weight: 720;
  letter-spacing: -.012em;
  white-space: nowrap;
  transition: background .16s ease,box-shadow .16s ease,transform .16s ease;
}
.export-icon { width: 16px; height: 16px; flex: 0 0 16px; display: grid; place-items: center; }
.export-icon svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.export-label { line-height: 1; }
.export-button:hover { background: #f43f30; box-shadow: 0 1px 1px rgba(103,29,20,.08),0 6px 14px rgba(255,75,59,.16); transform: translateY(-1px); }
.export-button:active { background: #e9382a; box-shadow: 0 1px 2px rgba(103,29,20,.12); transform: translateY(0); }
.export-button:focus-visible { outline: 3px solid rgba(255,75,59,.18); outline-offset: 2px; }
.export-button:disabled { opacity: .55; cursor: wait; transform: none; }

.preview-viewport {
  position: relative;
  min-width: 0;
  min-height: 0;
  overflow: auto;
  padding: 20px;
  background: #fff;
  scroll-behavior: smooth;
  overscroll-behavior: contain;
}
.preview-pages {
  min-width: max-content;
  min-height: 100%;
  display: flex;
  align-items: flex-start;
  gap: 20px;
}
.preview-page {
  position: relative;
  width: var(--preview-width);
  flex: 0 0 var(--preview-width);
  margin: 0;
  background: #fff;
  box-shadow: 0 18px 44px rgba(37,31,23,.11);
}
.preview-page img { display: block; width: 100%; height: auto; background: #fff; }
.preview-page figcaption { display: none; }
.preview-page-download {
  position: absolute;
  top: auto;
  right: 12px;
  bottom: 12px;
  z-index: 8;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  padding: 0;
  color: #fff;
  border: 1px solid rgba(255,255,255,.5);
  border-radius: 11px;
  background: rgba(31,29,27,.84);
  box-shadow: 0 8px 22px rgba(31,24,18,.2);
  backdrop-filter: blur(10px);
  opacity: 0;
  transform: translateY(5px) scale(.94);
  pointer-events: none;
  cursor: pointer;
  transition: opacity .16s ease,transform .16s ease,background .16s ease,box-shadow .16s ease;
}
.preview-page-download::after {
  content: attr(data-tooltip);
  position: absolute;
  top: 50%;
  right: calc(100% + 9px);
  padding: 7px 10px;
  color: #fff;
  border-radius: 8px;
  background: rgba(31,29,27,.94);
  box-shadow: 0 7px 18px rgba(31,24,18,.18);
  font-size: 12px;
  font-weight: 650;
  line-height: 1;
  white-space: nowrap;
  opacity: 0;
  transform: translate(5px,-50%);
  pointer-events: none;
  transition: opacity .14s ease,transform .14s ease;
}
.preview-page-download svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.preview-page:hover > .preview-page-download,
.preview-page:focus-within > .preview-page-download,
.preview-page-download:focus-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}
.preview-page-download:hover { background: #f04a35; box-shadow: 0 9px 24px rgba(240,74,53,.28); }
.preview-page-download:hover::after,
.preview-page-download:focus-visible::after {
  opacity: 1;
  transform: translate(0,-50%);
}
.preview-page-download:focus-visible { outline: 3px solid rgba(240,74,53,.28); outline-offset: 2px; }
.preview-page-download:disabled { cursor: wait; }
.preview-page-download.is-exporting { opacity: .72; }
@media (hover:none) {
  .preview-page-download {
    top: auto;
    right: 9px;
    bottom: 9px;
    width: 44px;
    height: 44px;
    opacity: .94;
    transform: none;
    pointer-events: auto;
  }
  .preview-page-download::after { display: none; }
}
.server-inline-video {
  position: absolute;
  z-index: 3;
  display: grid;
  place-items: center;
  overflow: hidden;
  isolation: isolate;
}
.server-inline-video-play {
  width: clamp(34px, 14%, 54px);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  padding: 0;
  color: #fff;
  background: rgba(19,18,17,.76);
  border: 1px solid rgba(255,255,255,.58);
  border-radius: 50%;
  box-shadow: 0 8px 22px rgba(0,0,0,.24);
  cursor: pointer;
  backdrop-filter: blur(8px);
  transition: transform .16s ease,background .16s ease;
}
.server-inline-video-play::before {
  content: "";
  width: 0;
  height: 0;
  margin-left: 3px;
  border-top: 6px solid transparent;
  border-bottom: 6px solid transparent;
  border-left: 10px solid currentColor;
}
.server-inline-video-play:hover,
.server-inline-video-play:focus-visible {
  background: rgba(0,0,0,.9);
  outline: 0;
  transform: scale(1.06);
}
.server-inline-video-player {
  position: absolute;
  inset: 0;
  z-index: 2;
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  background: #111;
}
.placeholder-page { opacity: .24; filter: grayscale(.25); }
.render-status {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 12px;
  color: #67615a;
  background: rgba(250,249,247,.78);
  backdrop-filter: blur(3px);
  font-size: 12px;
}
.render-status span { width: 30px; height: 30px; border: 2px solid #d8d2cb; border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; }
.render-status button { min-width: 102px; min-height: 34px; padding: 0 13px; color: #fff; background: #25221f; border: 0; border-radius: 9px; cursor: pointer; font-size: 11px; font-weight: 850; }
.render-status button:hover,.render-status button:focus-visible { background: #ff4d37; outline: 0; }
.render-status.is-error span { width: 28px; height: 28px; display: grid; place-items: center; color: #fff; background: #d95745; border: 0; animation: none; }
.render-status.is-error span::after { content: '!'; font-weight: 950; }
.render-status.is-error strong { color: #8d3c31; }
@keyframes spin { to { transform: rotate(360deg); } }

.preview-footer {
  position: relative;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-top: 1px solid #eee9e3;
  background: #fff;
  color: #8f8983;
}
.page-nav, .zoom-nav { display: flex; align-items: center; gap: 13px; }
.page-nav button, .zoom-nav button {
  width: 24px;
  height: 28px;
  display: grid;
  place-items: center;
  padding: 0;
  color: #948e87;
  background: transparent;
  border: 0;
  cursor: pointer;
  font-size: 18px;
}
.page-nav strong, .zoom-nav strong { min-width: 38px; text-align: center; font-size: 13px; font-weight: 800; }
.zoom-nav { position: absolute; right: 24px; gap: 9px; }
.zoom-nav button { font-size: 16px; }

.login-dialog {
  width: min(480px, calc(100vw - 32px));
  max-width: none;
  height: auto;
  max-height: min(660px, calc(100vh - 32px));
  padding: 0;
  overflow: hidden;
  color: #171716;
  background: #fff;
  border: 0;
  border-radius: 18px;
  box-shadow: 0 30px 90px rgba(28,24,20,.24), 0 2px 10px rgba(28,24,20,.08);
}
.login-dialog::backdrop {
  background: rgba(22,20,18,.54);
  backdrop-filter: blur(8px);
}
.login-shell {
  width: 100%;
  height: auto;
  display: block;
}
.login-story {
  position: relative;
  min-width: 0;
  display: flex;
  flex-direction: column;
  padding: 42px 38px 36px;
  color: #f8f4ef;
  background:
    radial-gradient(circle at 22% 78%, rgba(255,82,57,.3), transparent 31%),
    linear-gradient(148deg,#171614 0%,#25211d 58%,#33231d 100%);
  overflow: hidden;
}
.login-story::after {
  content: "";
  position: absolute;
  right: -80px;
  bottom: -100px;
  width: 280px;
  height: 280px;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 50%;
  box-shadow: 0 0 0 42px rgba(255,255,255,.025),0 0 0 84px rgba(255,255,255,.018);
  pointer-events: none;
}
.login-brand { position: relative; z-index: 1; width: 132px; display: block; }
.login-brand img { width: 100%; height: auto; filter: brightness(0) invert(1); }
.login-story-copy { position: relative; z-index: 1; margin-top: auto; }
.login-kicker {
  display: block;
  margin-bottom: 14px;
  color: #ff806f;
  font: 850 10px/1 "SFMono-Regular","SF Mono",Menlo,monospace;
  letter-spacing: .18em;
}
.login-story h2 {
  max-width: 330px;
  margin: 0;
  color: #fff;
  font-size: clamp(31px,3.2vw,46px);
  font-weight: 950;
  line-height: 1.08;
  letter-spacing: -.055em;
}
.login-story-copy p {
  max-width: 310px;
  margin: 20px 0 0;
  color: rgba(255,255,255,.7);
  font-size: 13px;
  font-weight: 620;
  line-height: 1.75;
}
.login-benefits {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 0;
  margin: 34px 0 24px;
  padding: 0;
  list-style: none;
  border-top: 1px solid rgba(255,255,255,.12);
}
.login-benefits li {
  min-height: 43px;
  display: grid;
  grid-template-columns: 28px 78px minmax(0,1fr);
  align-items: center;
  gap: 7px;
  border-bottom: 1px solid rgba(255,255,255,.1);
}
.login-benefits b { color: #ff806f; font: 800 9px/1 "SFMono-Regular","SF Mono",Menlo,monospace; }
.login-benefits span { color: rgba(255,255,255,.52); font-size: 10px; font-weight: 700; }
.login-benefits strong { color: rgba(255,255,255,.92); font-size: 11px; font-weight: 850; }
.login-story > small { position: relative; z-index: 1; color: rgba(255,255,255,.42); font-size: 9px; line-height: 1.6; }

.login-auth {
  position: relative;
  min-width: 0;
  display: flex;
  flex-direction: column;
  max-height: min(660px, calc(100vh - 32px));
  padding: 28px 30px 22px;
  background: #fff;
  overflow: auto;
}
.login-auth-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.login-auth-head > div { display: grid; gap: 4px; }
.login-auth-head span { color: #928b83; font-size: 10px; font-weight: 750; }
.login-auth-head strong { color: #171716; font-size: 20px; font-weight: 950; letter-spacing: -.025em; }
.login-close {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  padding: 0 0 2px;
  color: #69635d;
  background: #f4f1ed;
  border: 0;
  border-radius: 50%;
  cursor: pointer;
  font-size: 22px;
  line-height: 1;
}
.login-close:hover,.login-close:focus-visible { outline: 0; color: #fff; background: #252320; }
.login-reason {
  margin: 15px 0 20px;
  padding: 10px 12px;
  color: #6d554d;
  background: #fff6f2;
  border-left: 3px solid var(--accent);
  border-radius: 0 9px 9px 0;
  font-size: 11px;
  font-weight: 750;
  line-height: 1.55;
}
.auth-scene-tabs {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  margin: 0 0 22px;
  padding: 4px;
  background: #f4f1ed;
  border-radius: 12px;
}
.auth-scene-tabs button {
  min-height: 38px;
  padding: 0 16px;
  color: #8b847d;
  background: transparent;
  border: 0;
  border-radius: 9px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 850;
  transition: color .18s ease,background .18s ease,box-shadow .18s ease;
}
.auth-scene-tabs button.active {
  color: #201e1b;
  background: #fff;
  box-shadow: 0 2px 8px rgba(34,30,26,.08);
}
.account-form { display: grid; gap: 15px; }
.account-field { display: grid; gap: 7px; }
.account-field > span:first-child {
  color: #514c47;
  font-size: 10px;
  font-weight: 850;
}
.account-field input {
  width: 100%;
  height: 46px;
  padding: 0 14px;
  color: #1f1d1a;
  background: #fbfaf8;
  border: 1px solid #ded8d1;
  border-radius: 10px;
  outline: 0;
  font-size: 13px;
  font-family: inherit;
  font-weight: 700;
  transition: border-color .18s ease,box-shadow .18s ease,background .18s ease;
}
.account-field input::placeholder { color: #aca59e; font-weight: 620; }
.account-field input:focus {
  background: #fff;
  border-color: #292622;
  box-shadow: 0 0 0 3px rgba(41,38,34,.08);
}
.account-field input[aria-invalid="true"] { border-color: #e45743; box-shadow: 0 0 0 3px rgba(228,87,67,.09); }
.password-input { position: relative; display: block; }
.password-input input { padding-right: 58px; }
.password-input button {
  position: absolute;
  top: 50%;
  right: 8px;
  transform: translateY(-50%);
  height: 30px;
  padding: 0 8px;
  color: #79726b;
  background: transparent;
  border: 0;
  border-radius: 7px;
  cursor: pointer;
  font-size: 10px;
  font-weight: 800;
}
.password-input button:hover,.password-input button:focus-visible { color: #1f1d1a; background: #f0ece7; outline: 0; }
.account-consent {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  color: #817a73;
  font-size: 9px;
  font-weight: 650;
  line-height: 1.55;
}
.account-consent input { width: 14px; height: 14px; margin: 0; accent-color: #22201d; }
.account-form-status {
  min-height: 16px;
  margin: -2px 0 -3px;
  color: #b14434;
  font-size: 10px;
  font-weight: 750;
  line-height: 1.55;
}
.account-form-status.is-success { color: #2d7856; }
.account-submit {
  min-height: 46px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px 0 18px;
  color: #fff;
  background: #23211e;
  border: 0;
  border-radius: 11px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 900;
  box-shadow: 0 10px 22px rgba(35,33,30,.13);
}
.account-submit:hover,.account-submit:focus-visible { background: #ff513a; outline: 0; }
.account-submit:disabled { cursor: wait; opacity: .58; }
.account-submit i { font-size: 16px; font-style: normal; }
.signup-success {
  min-height: 300px;
  place-content: center;
  justify-items: center;
  gap: 10px;
  padding: 28px;
  text-align: center;
}
.signup-success:not([hidden]) { display: grid; }
.signup-success-mark {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  color: #fff;
  background: #2d7856;
  border-radius: 50%;
  font-size: 22px;
  font-weight: 900;
}
.signup-success strong { margin-top: 4px; font-size: 18px; font-weight: 950; }
.signup-success p { max-width: 330px; margin: 0; color: #817a73; font-size: 11px; line-height: 1.7; }
.signup-success b { color: #24211e; word-break: break-all; }
.signup-success button {
  min-width: 160px;
  min-height: 38px;
  margin-top: 8px;
  color: #fff;
  background: #24211e;
  border: 0;
  border-radius: 9px;
  cursor: pointer;
  font-size: 11px;
  font-weight: 850;
}
.login-fallback {
  min-height: 300px;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 10px;
  padding: 30px;
  text-align: center;
}
.login-fallback strong { font-size: 15px; font-weight: 900; }
.login-fallback span { max-width: 320px; color: #817a73; font-size: 11px; line-height: 1.65; }
.login-fallback button,.login-fallback a {
  min-width: 140px;
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 15px;
  border-radius: 9px;
  cursor: pointer;
  text-decoration: none;
  font-size: 11px;
  font-weight: 850;
}
.login-fallback button { margin-top: 8px; color: #fff; background: #252320; border: 0; }
.login-fallback a { color: #6d625a; background: #fff; border: 1px solid #ded8d1; }
.login-privacy { margin: auto 0 0; padding-top: 12px; color: #aaa39c; font-size: 9px; line-height: 1.55; text-align: center; }

/* Creator toolbox — compact, local-first and deliberately integrated with the primary sidebar. */
.toolbox-shell { position: fixed; inset: var(--topbar-h) 0 0 var(--sidebar-w); z-index: 35; display: block; overflow: hidden; background: #fbfaf8; }
body[data-workspace-mode="tools"] .topbar { left: var(--sidebar-w); }
body[data-workspace-mode="tools"] .template-dock,
body[data-workspace-mode="tools"] .workspace-main { display: none; }
body[data-workspace-mode="tools"] .toolbox-shell { display: block; }
.toolbox-workspace { width: 100%; height: 100%; min-width: 0; min-height: 0; overflow: hidden; }
.tool-panel { height: 100%; display: grid; grid-template-rows: auto minmax(0,1fr); overflow: hidden; background: #fbfaf8; }
.tool-panel.active { animation: tool-panel-in .2s ease both; }
@keyframes tool-panel-in { from { opacity: 0; } to { opacity: 1; } }
.tool-panel-head { min-height: 88px; display: flex; align-items: center; justify-content: space-between; gap: 28px; padding: 17px 34px 16px; background: #fff; border-bottom: 1px solid #e9e4de; }
.tool-panel-head > div:first-child { min-width: 0; max-width: 720px; }
.tool-panel-head h2 { margin: 0 0 7px; color: #171614; font-size: 20px; line-height: 1.15; letter-spacing: -.035em; }
.tool-panel-head p { margin: 0; color: #8b857f; font-size: 10px; line-height: 1.55; }
.tool-panel-actions { flex: 0 0 auto; display: flex; align-items: center; gap: 8px; }
.whiteboard-panel { display: block; background: #f7f5f0; }
.whiteboard-stage { position: relative; width: 100%; height: 100%; overflow: hidden; background: #f7f5f0; }
.whiteboard-stage iframe { width: 100%; height: 100%; display: block; opacity: 0; background: #f7f5f0; border: 0; transition: opacity .22s ease; }
.whiteboard-stage iframe.ready { opacity: 1; }
.whiteboard-loading { position: absolute; inset: 0; z-index: 1; display: grid; place-content: center; justify-items: center; gap: 9px; color: #716b65; background: linear-gradient(rgba(74,68,62,.045) 1px,transparent 1px),linear-gradient(90deg,rgba(74,68,62,.045) 1px,transparent 1px),#f7f5f0; background-size: 28px 28px; text-align: center; }
.whiteboard-loading[hidden] { display: none; }
.whiteboard-loading span { width: 28px; height: 28px; margin-bottom: 4px; border: 2px solid #ddd8d0; border-top-color: var(--accent); border-radius: 50%; animation: whiteboard-loading-spin .8s linear infinite; }
.whiteboard-loading strong { color: #413d39; font-size: 12px; font-weight: 850; }
.whiteboard-loading small { color: #a29b94; font-size: 9px; }
@keyframes whiteboard-loading-spin { to { transform: rotate(360deg); } }
.tool-action { min-height: 38px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 0 16px; color: #5e5954; background: #fff; border: 1px solid #ded8d2; border-radius: 8px; cursor: pointer; font-size: 10px; font-weight: 820; transition: color .15s ease,background .15s ease,border-color .15s ease,transform .15s ease; }
.tool-action svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.7; }
.tool-action.primary { color: #fff; background: #1c1b19; border-color: #1c1b19; box-shadow: 0 7px 16px rgba(20,19,18,.12); }
.tool-action.subtle { color: #8f8881; background: #fbfaf8; border-color: #ebe6e0; }
.tool-action:disabled { opacity: .45; cursor: default; transform: none; }
.tool-action:hover { transform: translateY(-1px); }
.tool-action.primary:hover { background: #070707; }
.tool-empty-state { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; text-align: center; pointer-events: none; }
.tool-empty-state strong { margin-top: 17px; color: #4b4640; font-size: 13px; font-weight: 900; }
.tool-empty-state p { margin: 6px 0 0; color: #aaa29a; font-size: 10px; }
.empty-art { position: relative; width: 84px; height: 64px; display: block; }
.color-empty-art i { position: absolute; width: 38px; height: 38px; border-radius: 50%; opacity: .85; mix-blend-mode: multiply; }
.color-empty-art i:nth-child(1) { left: 8px; top: 8px; background: #ef7b63; }
.color-empty-art i:nth-child(2) { right: 7px; top: 8px; background: #78bea5; }
.color-empty-art i:nth-child(3) { left: 24px; bottom: 0; background: #ebc45f; }

.color-lab-grid { min-height: 0; display: grid; grid-template-columns: minmax(520px,1fr) 282px; gap: 22px; padding: 24px 34px 30px; overflow: hidden; }
.color-canvas-shell { --picked:#d85a42; position: relative; min-height: 430px; display: grid; place-items: center; overflow: hidden; padding: 28px; background: #f0ece7; border: 1px solid #ded8d1; border-radius: 9px; outline: 0; cursor: pointer; transition: background .18s ease,border-color .18s ease; }
.color-canvas-shell:focus-visible { box-shadow: 0 0 0 3px rgba(255,75,54,.16); }
.color-canvas-shell.drag-over { border-color: var(--accent); background: #fff0e9; }
.color-canvas-shell.has-image { background: var(--picked); cursor: default; }
.color-canvas-shell.has-image .tool-empty-state { display: none; }
.color-canvas-shell canvas { max-width: 100%; max-height: 100%; display: block; border-radius: 3px; box-shadow: 0 12px 30px rgba(28,25,21,.18); cursor: crosshair; }
.color-cursor { position: absolute; width: 28px; height: 28px; display: none; transform: translate(-50%,-50%); border: 3px solid #fff; border-radius: 50%; background: var(--picked); box-shadow: 0 0 0 1px rgba(0,0,0,.42),0 4px 12px rgba(0,0,0,.2); pointer-events: none; }
.color-cursor.visible { display: block; }
.color-result { --picked:#d85a42; --picked-text:#fff; min-width: 0; display: flex; flex-direction: column; padding: 7px 0 0 22px; background: transparent; border-left: 1px solid #e7e2dc; }
.color-result h3 { margin: 0 0 13px; color: #4c4843; font-size: 11px; font-weight: 850; }
.color-swatch { min-height: 142px; display: flex; align-items: flex-end; padding: 14px; color: var(--picked-text); background: var(--picked); border: 1px solid rgba(0,0,0,.07); border-radius: 8px; transition: background .18s ease,color .18s ease; }
.color-swatch strong { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 15px; letter-spacing: -.02em; }
.color-value-list { margin-top: 14px; border-top: 1px solid #e7e2dc; }
.color-value-list button { width: 100%; min-height: 52px; display: grid; grid-template-columns: 37px minmax(0,1fr) 18px; align-items: center; gap: 8px; padding: 0; color: #4a4540; background: transparent; border: 0; border-bottom: 1px solid #e7e2dc; cursor: pointer; text-align: left; }
.color-value-list button:disabled { cursor: default; opacity: .45; }
.color-value-list button span { color: #9b948d; font-size: 9px; font-weight: 800; letter-spacing: .04em; }
.color-value-list button strong { overflow: hidden; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 10px; font-weight: 750; text-overflow: ellipsis; white-space: nowrap; }
.color-value-list button svg { width: 15px; height: 15px; fill: none; stroke: #817a73; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.5; }
.color-value-list button:not(:disabled):hover svg { stroke: var(--accent); }
.color-recent { margin-top: 20px; }
.color-recent > span { display: block; margin-bottom: 11px; color: #59544f; font-size: 10px; font-weight: 850; }
.color-recent > div { display: flex; flex-wrap: wrap; gap: 8px; }
.color-recent button { width: 31px; height: 31px; padding: 0; background: var(--recent); border: 3px solid #fff; border-radius: 6px; box-shadow: 0 0 0 1px #d9d3cc; cursor: pointer; }
.color-status { margin: auto 0 0; padding-top: 18px; color: #99928a; border-top: 1px solid #e7e2dc; font-size: 9px; line-height: 1.55; }

.ratio-lab-grid { height: 100%; min-height: 0; display: grid; grid-template-columns: 310px minmax(520px,1fr); gap: 18px; padding: 24px 34px 30px; overflow: hidden; }
.ratio-controls { padding: 2px 18px 8px; overflow: auto; background: #fff; border: 1px solid #e2dcd5; border-radius: 9px; }
.ratio-controls section { display: grid; gap: 10px; padding: 16px 0; border-bottom: 1px solid #ece7e1; }
.ratio-controls section:last-child { border-bottom: 0; }
.ratio-controls section > span,.ratio-controls label { display: flex; align-items: center; justify-content: space-between; color: #635e58; font-size: 9px; font-weight: 850; letter-spacing: .03em; }
.ratio-controls output { color: var(--accent); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.ratio-presets { display: grid; grid-template-columns: repeat(3,1fr); gap: 7px; }
.ratio-presets button { min-height: 50px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: #4c4741; background: #fff; border: 1px solid #e3ddd7; border-radius: 8px; cursor: pointer; font-size: 11px; font-weight: 900; }
.ratio-presets button.active { color: #fff; background: #22211f; border-color: #22211f; box-shadow: inset 0 -2px 0 var(--accent); }
.ratio-presets small { color: #a59d95; font-size: 7px; font-weight: 700; }
.ratio-presets button.active small { color: rgba(255,255,255,.58); }
.ratio-controls select { width: 100%; height: 38px; padding: 0 10px; color: #3e3934; background: #fbfaf8; border: 1px solid #e3ddd7; border-radius: 7px; outline: 0; font-size: 10px; }
.ratio-controls select:focus-visible,.ratio-controls input:focus-visible { border-color: var(--accent); outline: 2px solid rgba(255,75,54,.14); outline-offset: 1px; }
.ratio-controls input[type="range"] { width: 100%; accent-color: #24211f; }
.ratio-controls input[type="color"] { width: 100%; height: 38px; padding: 3px; background: #fff; border: 1px solid #ddd5cd; border-radius: 7px; }
.ratio-controls input[type="number"] { width: 100%; height: 34px; padding: 0 9px; color: #3e3934; background: #fbfaf8; border: 1px solid #e3ddd7; border-radius: 7px; font: inherit; }
.ratio-quick { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.ratio-quick button { min-height: 34px; color: #625c56; background: #fbfaf8; border: 1px solid #e3ddd7; border-radius: 7px; cursor: pointer; font-size: 9px; font-weight: 850; }
.ratio-quick button.active { color: #fff; background: #22211f; border-color: #22211f; box-shadow: inset 0 -2px 0 var(--accent); }
.ratio-custom { display: grid; grid-template-columns: 1fr 14px 1fr; align-items: end; gap: 7px; }
.ratio-custom[hidden],#ratioLongEdgeBox[hidden],#ratioSolidColorBox[hidden] { display: none; }
.ratio-custom label,#ratioLongEdgeBox label,#ratioSolidColorBox label { display: grid; justify-content: stretch; gap: 6px; }
.ratio-custom b { padding-bottom: 9px; color: #918980; text-align: center; }
.ratio-privacy { grid-template-columns: 10px 1fr !important; align-items: start; }
.ratio-privacy i { width: 8px; height: 8px; margin-top: 3px; background: #5aaf83; border-radius: 50%; box-shadow: 0 0 0 4px rgba(90,175,131,.12); }
.ratio-privacy p { margin: 0; color: #999188; font-size: 9px; line-height: 1.55; }
.ratio-privacy b { color: #575149; font-size: 9px; }
.ratio-stage-wrap { width: 100%; height: 100%; min-width: 0; min-height: 0; display: grid; grid-template-rows: 52px minmax(0,1fr); overflow: hidden; background: #fff; border: 1px solid #e2dcd5; border-radius: 9px; }
.ratio-meta { min-width: 0; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 12px 0 16px; border-bottom: 1px solid #e7e2dc; }
.ratio-meta > span { overflow: hidden; color: #89827b; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.ratio-meta > div { display: flex; align-items: center; gap: 7px; }
.ratio-meta button { min-height: 32px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 0 11px; color: #4e4944; background: #fff; border: 1px solid #ddd7d1; border-radius: 7px; cursor: pointer; font-size: 9px; font-weight: 850; }
.ratio-meta button svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.6; }
.ratio-meta button.ratio-copy { color: #fff; background: #1c1b19; border-color: #1c1b19; }
.ratio-meta button:disabled { color: #aaa29a; background: #eeeae5; border-color: #eeeae5; cursor: default; }
.ratio-stage { position: relative; width: 100%; height: 100%; min-width: 0; min-height: 0; display: grid; place-items: center; overflow: hidden; padding: 22px; background-color: #e9e6e1; background-image: linear-gradient(45deg,rgba(255,255,255,.35) 25%,transparent 25%),linear-gradient(-45deg,rgba(255,255,255,.35) 25%,transparent 25%),linear-gradient(45deg,transparent 75%,rgba(255,255,255,.35) 75%),linear-gradient(-45deg,transparent 75%,rgba(255,255,255,.35) 75%); background-position: 0 0,0 10px,10px -10px,-10px 0; background-size: 20px 20px; outline: 0; cursor: pointer; }
.ratio-stage:focus-visible { box-shadow: inset 0 0 0 3px rgba(255,75,54,.22); }
.ratio-stage:has(.ratio-output-canvas:not([hidden])) { cursor: default; }
.ratio-stage.drag-over,
.ratio-stage.dragging { box-shadow: inset 0 0 0 2px var(--accent); background: #fff2ec; }
.ratio-output-canvas { width: auto; height: auto; max-width: 100%; max-height: 100%; display: block; object-fit: contain; box-shadow: 0 15px 38px rgba(32,27,22,.14); }
.ratio-stop { color: #a83f31 !important; border-color: #e7b7ae !important; }
.ratio-empty-art i { position: absolute; border: 2px solid #393530; border-radius: 5px; }
.ratio-empty-art i:first-child { inset: 10px 24px 15px 10px; transform: rotate(-5deg); }
.ratio-empty-art i:last-child { inset: 15px 10px 10px 24px; transform: rotate(6deg); border-color: var(--accent); background: #f7cc68; opacity: .76; }

.toast {
  position: fixed;
  left: 50%;
  bottom: 34px;
  z-index: 90;
  transform: translateX(-50%);
  padding: 10px 15px;
  color: #fff;
  background: rgba(23,23,22,.92);
  border-radius: 10px;
  box-shadow: 0 12px 32px rgba(0,0,0,.16);
  font-size: 12px;
  font-weight: 750;
}

::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-thumb { background: rgba(128,128,128,.15); border-radius: 3px; }

@media (max-width: 1500px) {
  .editor-toolbar { gap: 8px; }
}

@media (max-height: 860px) {
  :root { --sidebar-w: 144px; --template-w: 104px; --topbar-h: 44px; }
  .sidebar { padding-top: 20px; }
  .studio-brand { margin-bottom: 20px; font-size: 15px; }
  .template-dock > header { top: 24px; height: 24px; }
  .template-strip { inset: 56px 0 14px; padding: 0 7px 4px; }
  .template-card-shell,
  .template-card { width: 76px; height: 98px; }
  .template-card img { width: 70px; height: 90px; }
  .template-detail-handle { left: calc(100% - 2px); width: 14px; height: 42px; }
  .template-peek { width: 292px; }
  .template-peek-visual { min-height: 222px; padding-top: 11px; }
  .template-peek-visual img { width: 138px; height: 184px; }
  .template-peek-copy { padding: 12px 14px 8px; }
  .template-peek-copy ul { margin-top: 7px; }
  .template-peek-actions { gap: 5px; padding: 0 12px 12px; }
  .workspace-main { grid-template-columns: minmax(360px,480px) minmax(560px,1fr); padding-top: calc(var(--topbar-h) + 12px); }
  .cover-settings { gap: 7px; padding: 10px 16px 11px; }
  .poster-footer-settings,
  .source-lead-settings { min-height: 62px; padding: 8px 16px; }
  .cover-drop-zone { min-height: 50px; padding-block: 6px; }
  .layout-settings,
  .card-theme-settings,
  .paper-style-settings { min-height: 56px; padding: 8px 16px; }
  .sidebar-footer { padding-top: 8px; }
  .account-toggle { min-height: 42px; }
  .account-popover { max-height: min(236px, calc(100vh - 102px)); padding: 11px; }
  .account-membership { margin-top: 9px; padding: 8px 9px; }
  .account-popover-actions { gap: 5px; margin-top: 8px; }
  .account-popover-actions a,
  .account-popover-actions button { min-height: 30px; }
}

@media (max-width: 1180px) {
  :root { --sidebar-w: 132px; --template-w: 98px; }
  body { min-width: 760px; overflow: auto; }
  .workspace-main { height: auto; min-height: 100vh; grid-template-columns: 1fr; grid-template-rows: minmax(540px,55vh) minmax(600px,1fr); padding-left: calc(var(--sidebar-w) + var(--template-w) + 14px); overflow: auto; }
  .preview-panel { grid-column: 1; grid-row: 2; min-height: 600px; }
  .tool-panel-head { padding-inline: 18px; }
  .ratio-lab-grid { grid-template-columns: 260px minmax(420px,1fr); gap: 12px; padding: 16px 18px 22px; }
  .ratio-controls { padding-inline: 13px; }
}

@media (max-width: 820px) {
  .login-dialog { width: min(480px, calc(100vw - 24px)); max-height: calc(100vh - 24px); }
  .login-auth { max-height: calc(100vh - 24px); padding: 24px 24px 20px; }
  .template-case-body { grid-template-columns: 1fr; max-height: calc(100vh - 220px); overflow: auto; }
  .template-case-example pre { min-height: 190px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; transition-duration: .01ms !important; }
}

/* Matrix visual refinement — quiet editorial luxury, anchored to CardKar. */
.matrix-shell {
  background: #fff;
}
.matrix-page { width: min(1460px,100%); padding: 34px 36px 54px; }
.matrix-page-head { position: relative; align-items: center; padding: 2px 2px 4px; }
.matrix-page-head::after { content: ""; position: absolute; right: 168px; top: 50%; width: min(24vw,330px); height: 1px; background: linear-gradient(90deg,transparent,#d9d3cc 55%,transparent); }
.matrix-eyebrow { display: block; margin-bottom: 7px; color: #a79d93; font: 800 8px/1.1 ui-monospace,SFMono-Regular,Menlo,monospace; letter-spacing: .22em; }
.matrix-page-head h1 { font-size: 31px; font-weight: 900; letter-spacing: -.055em; }
.matrix-page-head p { margin-top: 8px; color: #736b63; font-size: 12px; letter-spacing: .01em; }
.matrix-add-primary { min-width: 132px; height: 46px; border-radius: 12px; background: #201e1b; box-shadow: 0 10px 24px rgba(28,24,20,.13); }
.matrix-add-primary:hover,.matrix-add-primary:focus-visible { background: #f0523b; box-shadow: 0 13px 28px rgba(240,82,59,.21); }
.matrix-summary { gap: 12px; margin-top: 28px; }
.matrix-summary article { position: relative; min-height: 118px; gap: 14px; padding: 21px 19px; overflow: hidden; background: rgba(255,255,255,.82); border-color: rgba(213,207,199,.78); border-radius: 17px; box-shadow: 0 12px 35px rgba(43,35,28,.035); backdrop-filter: blur(12px); }
.matrix-summary article:first-child { color: #fff; background: #24221f; border-color: #24221f; box-shadow: 0 18px 38px rgba(31,27,23,.14); }
.matrix-summary article:first-child::after { content: ""; position: absolute; right: -24px; bottom: -35px; width: 112px; height: 112px; border: 1px solid rgba(255,255,255,.13); border-radius: 50%; box-shadow: 0 0 0 18px rgba(255,255,255,.025),0 0 0 38px rgba(255,255,255,.018); }
.matrix-summary-icon { width: 42px; height: 42px; flex-basis: 42px; color: #56504a !important; background: #f3f0ec !important; border: 1px solid #e5dfd8; letter-spacing: 0; text-indent: 0; }
.matrix-summary-icon svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.55; stroke-linecap: round; stroke-linejoin: round; }
.matrix-summary article:first-child .matrix-summary-icon { color: #fff !important; background: rgba(255,255,255,.09) !important; border-color: rgba(255,255,255,.13); }
.matrix-summary article div { gap: 8px; }
.matrix-summary small { color: #8b837b; font-size: 10px; letter-spacing: .03em; }
.matrix-summary strong { font-size: 27px; letter-spacing: -.045em; }
.matrix-summary article:first-child small { color: rgba(255,255,255,.56); }
.matrix-summary article:first-child strong { color: #fff; }
.matrix-summary article em { position: absolute; right: 15px; bottom: 13px; color: #b9b0a8; font: 700 7px/1 ui-monospace,SFMono-Regular,Menlo,monospace; font-style: normal; letter-spacing: .13em; }
.matrix-summary article:first-child em { color: rgba(255,255,255,.3); }
.matrix-section-title { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-top: 33px; padding: 0 2px 14px; border-bottom: 1px solid rgba(202,195,187,.7); }
.matrix-section-title > div { display: flex; align-items: baseline; gap: 10px; }
.matrix-section-title span { color: #27231f; font-size: 15px; font-weight: 900; letter-spacing: -.02em; }
.matrix-section-title small { color: #aba29a; font: 750 7px/1 ui-monospace,SFMono-Regular,Menlo,monospace; letter-spacing: .14em; }
.matrix-section-title p { display: flex; align-items: center; gap: 7px; margin: 0; color: #7f776f; font-size: 9px; font-weight: 700; }
.matrix-section-title p i { width: 6px; height: 6px; background: #4b9b66; border-radius: 50%; box-shadow: 0 0 0 4px rgba(75,155,102,.08); }
.matrix-toolbar { justify-content: space-between; margin-top: 14px; }
.matrix-search { width: min(300px,34vw); height: 42px; background: rgba(255,255,255,.72); border-color: #ddd7d0; border-radius: 11px; }
.matrix-filters { padding: 3px; background: rgba(229,225,219,.72); border-radius: 12px; }
.matrix-filters button { height: 34px; padding-inline: 16px; background: transparent; border: 0; border-radius: 9px; }
.matrix-filters button.active { background: #fff; border-color: transparent; box-shadow: 0 4px 13px rgba(45,37,30,.075); }
.matrix-grid { gap: 14px; margin-top: 14px; }
.matrix-account-card { min-height: 222px; column-gap: 24px; padding: 21px 22px 15px; overflow: hidden; background: rgba(255,255,255,.9); border-color: rgba(216,209,202,.9); border-radius: 18px; box-shadow: 0 12px 32px rgba(44,35,27,.035); animation: matrix-card-in .38s both cubic-bezier(.2,.72,.25,1); }
.matrix-account-card::before { content: ""; position: absolute; top: 0; bottom: 0; left: 0; width: 3px; background: transparent; }
.matrix-account-card:hover { border-color: #cfc6bd; box-shadow: 0 19px 43px rgba(44,35,27,.075); transform: translateY(-2px); }
.matrix-account-card.is-current { border-color: #d9d0c8; background: linear-gradient(112deg,#fff9f5 0%,rgba(255,255,255,.96) 43%,#fff 100%); }
.matrix-account-card.is-current::before { background: #f0523b; }
.matrix-card-profile { grid-template-columns: 68px minmax(0,1fr); gap: 15px; }
.matrix-card-avatar { width: 68px; height: 68px; border: 3px solid #fff; box-shadow: 0 0 0 1px #ded7d0,0 8px 18px rgba(42,33,25,.1); }
.matrix-card-copy { gap: 5px; }
.matrix-card-copy strong { font-size: 16px; letter-spacing: -.035em; }
.matrix-card-copy span { color: #8a8178; font-size: 10px; }
.matrix-card-copy .matrix-card-category { width: max-content; max-width: 100%; margin-top: 1px; padding: 3px 7px; color: #645d56; background: #f4f1ed; border: 1px solid #e9e3dd; border-radius: 999px; font-size: 8px; font-weight: 750; }
.matrix-profile-link { margin-top: 19px; color: #e64c37; font-size: 10px; letter-spacing: .015em; }
.matrix-card-data { padding-top: 35px; }
.matrix-metrics div { gap: 7px; padding-inline: 17px; border-color: #ebe6e0; }
.matrix-metrics small,.matrix-pricing > span,.matrix-price small { color: #999087; font-size: 8px; letter-spacing: .04em; }
.matrix-metrics strong { font-size: 16px; letter-spacing: -.025em; }
.matrix-pricing { gap: 7px; margin-top: 13px; }
.matrix-pricing-box { min-height: 63px; background: #f8f6f3; border-color: #ebe5df; border-radius: 11px; }
.matrix-price { gap: 6px; padding-inline: 14px; }
.matrix-price strong { font-size: 14px; letter-spacing: -.02em; }
.matrix-card-status { top: 16px; right: 77px; height: 24px; color: #397451; background: #edf6ef; border: 0; border-radius: 999px; }
.matrix-card-status::before { content: ""; width: 5px; height: 5px; margin-right: 5px; background: currentColor; border-radius: 50%; }
.matrix-card-status.paused { color: #b35c4e; background: #fff0ed; }
.matrix-card-actions { top: 14px; right: 15px; }
.matrix-card-actions button { color: #6b635b; border-radius: 8px; }
.matrix-card-actions button:hover,.matrix-card-actions button:focus-visible { color: #201d1a; background: #f0ece7; }
.matrix-card-foot { margin-top: 13px; padding-top: 12px; color: #9c938b; border-color: #eee9e4; }
.matrix-completeness { padding: 3px 7px; color: #9a6a45; background: #fff5e9; border-radius: 999px; font-size: 8px; font-weight: 750; }
.matrix-completeness.complete { color: #3e7855; background: #edf7f0; }
.matrix-empty-slot { min-height: 222px; background: rgba(255,255,255,.38); border-color: #cfc6bd; border-radius: 18px; }
.matrix-empty-slot i { color: #3e3934; background: #fff; border: 1px solid #e1dad3; box-shadow: 0 9px 22px rgba(43,35,28,.07); }
.matrix-empty-slot:hover,.matrix-empty-slot:focus-visible { background: rgba(255,255,255,.8); border-color: #f0715d; }
@keyframes matrix-card-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

.identity-dialog[data-detail-mode="identity"] { width: min(470px,calc(100vw - 32px)); }
.identity-popover-head { position: relative; padding-right: 82px; }
.identity-popover-head button { position: absolute; top: 1px; right: 0; padding: 3px 0; color: #e34c37; background: transparent; border: 0; cursor: pointer; font-size: 8px; font-weight: 800; }
.identity-popover-head button:hover,.identity-popover-head button:focus-visible { outline: 0; color: #b92e1f; text-decoration: underline; text-underline-offset: 3px; }
.identity-dialog-card { gap: 14px; background: #fbfaf8; }
.identity-matrix-details { display: grid; gap: 12px; margin: 2px -4px 0; padding: 15px; background: #f3f0ec; border: 1px solid #e6dfd8; border-radius: 14px; }
.identity-details-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-bottom: 11px; border-bottom: 1px solid #ded7cf; }
.identity-details-head > div { display: grid; gap: 3px; }
.identity-details-head strong { color: #302b27; font-size: 11px; font-weight: 900; }
.identity-details-head span { color: #938a82; font-size: 9px; font-weight: 650; }
.identity-details-head i { padding: 4px 6px; color: #9d7460; background: #fff8f4; border: 1px solid #ead7ce; border-radius: 5px; font: 800 7px/1 ui-monospace,SFMono-Regular,Menlo,monospace; font-style: normal; letter-spacing: .08em; }

@media (max-width: 1220px) {
  .matrix-page { padding-inline: 24px; }
  .matrix-page-head::after { display: none; }
  .matrix-summary { grid-template-columns: repeat(2,minmax(0,1fr)); }
}

/* Compact matrix density: operational dashboard, not a marketing hero. */
.matrix-page { padding: 20px 30px 42px; }
.matrix-page-head { min-height: 52px; padding: 0 2px; }
.matrix-page-head::after { display: none; }
.matrix-eyebrow { margin-bottom: 5px; font-size: 7px; }
.matrix-page-head h1 { font-size: 25px; line-height: 1.12; }
.matrix-page-head p { margin-top: 5px; font-size: 10px; }
.matrix-add-primary { min-width: 116px; height: 38px; padding-inline: 14px; border-radius: 10px; font-size: 11px; }
.matrix-add-primary span { font-size: 17px; }
.matrix-summary {
  gap: 0;
  margin-top: 15px;
  overflow: hidden;
  background: rgba(255,255,255,.86);
  border: 1px solid #ddd7d0;
  border-radius: 14px;
  box-shadow: 0 10px 28px rgba(43,35,28,.035);
}
.matrix-summary article,
.matrix-summary article:first-child {
  min-height: 76px;
  gap: 11px;
  padding: 13px 16px;
  color: #201d1a;
  background: transparent;
  border: 0;
  border-right: 1px solid #ebe6e1;
  border-radius: 0;
  box-shadow: none;
  backdrop-filter: none;
}
.matrix-summary article:last-child { border-right: 0; }
.matrix-summary article:first-child::after { display: none; }
.matrix-summary-icon,
.matrix-summary article:first-child .matrix-summary-icon {
  width: 34px;
  height: 34px;
  flex-basis: 34px;
  color: #625b54 !important;
  background: #f5f2ee !important;
  border-color: #e4ddd6;
}
.matrix-summary-icon svg { width: 16px; height: 16px; }
.matrix-summary article div { gap: 5px; }
.matrix-summary small,
.matrix-summary article:first-child small { color: #948b83; font-size: 8px; }
.matrix-summary strong,
.matrix-summary article:first-child strong { color: #191613; font-size: 21px; }
.matrix-summary article em { display: none; }
.matrix-section-title { margin-top: 23px; padding-bottom: 10px; }
.matrix-toolbar { margin-top: 16px; }
.matrix-search { height: 38px; }
.matrix-filters button { height: 31px; }

@media (max-width: 1220px) {
  .matrix-summary { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .matrix-summary article { padding-inline: 12px; }
}

.matrix-summary { grid-template-columns: repeat(3,minmax(0,1fr)); }
.matrix-toolbar { justify-content: flex-start; }
.matrix-account-card {
  min-height: 190px;
  grid-template-rows: auto auto;
  padding-top: 18px;
  padding-bottom: 11px;
}
.matrix-card-profile { grid-template-columns: 62px minmax(0,1fr); }
.matrix-card-avatar { width: 62px; height: 62px; }
.matrix-profile-link {
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  margin-top: 13px;
  padding: 0 10px;
  color: #e34832;
  background: #fff5f1;
  border: 1px solid #f1d8d0;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 850;
}
.matrix-profile-link:hover,.matrix-profile-link:focus-visible { color: #c83020; background: #ffede7; border-color: #ebb9ad; text-decoration: none; }
.matrix-profile-link.is-disabled { min-height: auto; padding: 0; background: transparent; border: 0; font-size: 10px; }
.matrix-card-data { padding-top: 30px; }
.matrix-pricing-box { min-height: 54px; }
.matrix-card-actions { top: 12px; right: 13px; }
.matrix-card-actions .matrix-card-delete { color: #a49b92; }
.matrix-card-actions .matrix-card-delete:hover,.matrix-card-actions .matrix-card-delete:focus-visible { color: #c84231; background: #fff0ed; }
.matrix-card-foot { margin-top: 9px; padding-top: 9px; }
.matrix-empty-slot { min-height: 190px; }
.identity-form-grid > .identity-field:only-child { grid-column: 1/-1; }

/* Matrix owns its page heading; the shared workbench title bar would repeat it. */
body[data-workspace-mode="matrix"] .topbar { display: none; }
body[data-workspace-mode="matrix"] .matrix-shell { inset: 0 0 0 var(--sidebar-w); }
body[data-workspace-mode="matrix"] .matrix-page { padding-top: 30px; }
body[data-workspace-mode="matrix"] .matrix-page-head { min-height: 54px; }
body[data-workspace-mode="matrix"] .matrix-page-head h1 { font-size: 27px; }
body[data-workspace-mode="matrix"] .matrix-page-head p { margin-top: 7px; color: #777069; font-size: 11px; }
.identity-avatar-preview:not(.has-image) { position: relative; background: #eee9e3; }
.identity-avatar-preview:not(.has-image)::after { content: "+"; position: absolute; inset: 0; display: grid; place-items: center; color: #8f877f; font-size: 22px; font-weight: 400; }
.matrix-card-avatar.is-placeholder { color: #817970; background: #eee9e3; box-shadow: 0 0 0 1px #ded7d0; font-size: 18px; font-weight: 850; }
.identity-option-name-row { min-width: 0; display: flex; align-items: center; gap: 6px; }
.identity-option-name-row b { min-width: 0; }
.identity-option-name-row em { flex: 0 0 auto; padding: 2px 5px; color: #a25f40; background: #fff0e8; border-radius: 999px; font-size: 7px; font-style: normal; font-weight: 850; }
.matrix-card-name-line { min-width: 0; display: flex !important; align-items: center; gap: 7px; overflow: visible !important; }
.matrix-card-name-line strong { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.matrix-default-badge { flex: 0 0 auto; padding: 3px 7px; color: #9a5638; background: #fff0e8; border: 1px solid #f0d5c7; border-radius: 999px; font-size: 7px; font-style: normal; font-weight: 850; letter-spacing: .02em; }
.matrix-card-actions .matrix-card-default svg { fill: none; }
.matrix-card-actions .matrix-card-default:hover,.matrix-card-actions .matrix-card-default:focus-visible { color: #b7792f; background: #fff5df; }
.matrix-card-actions .matrix-card-default.active { color: #c18031; background: #fff4dd; cursor: default; }
.matrix-card-actions .matrix-card-default.active svg { fill: currentColor; }
.matrix-card-actions .matrix-card-default { position: relative; }
.matrix-card-actions .matrix-card-default::before,
.matrix-card-actions .matrix-card-default::after {
  position: absolute;
  z-index: 8;
  opacity: 0;
  pointer-events: none;
  transition: opacity .14s ease,transform .14s ease;
}
.matrix-card-actions .matrix-card-default::before {
  content: "";
  top: calc(100% + 4px);
  left: 50%;
  border: 4px solid transparent;
  border-bottom-color: #292521;
  transform: translate(-50%,-3px);
}
.matrix-card-actions .matrix-card-default::after {
  content: attr(data-tooltip);
  top: calc(100% + 12px);
  right: -5px;
  width: max-content;
  max-width: 120px;
  padding: 7px 9px;
  color: #fffdf9;
  background: #292521;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 7px;
  box-shadow: 0 8px 20px rgba(32,26,21,.18);
  font-size: 9px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: .01em;
  white-space: nowrap;
  transform: translateY(-3px);
}
.matrix-card-actions .matrix-card-default:hover::before,
.matrix-card-actions .matrix-card-default:hover::after,
.matrix-card-actions .matrix-card-default:focus-visible::before,
.matrix-card-actions .matrix-card-default:focus-visible::after {
  opacity: 1;
  transform: translate(-50%,0);
}
.matrix-card-actions .matrix-card-default:hover::after,
.matrix-card-actions .matrix-card-default:focus-visible::after { transform: translateY(0); }

.account-delete-dialog { width: min(430px,calc(100vw - 32px)); padding: 0; color: #292522; background: transparent; border: 0; border-radius: 20px; box-shadow: 0 28px 80px rgba(25,19,15,.28); }
.account-delete-dialog::backdrop { background: rgba(29,25,22,.52); backdrop-filter: blur(7px); }
.account-delete-card { padding: 24px; background: #fffdfa; border: 1px solid #eadfd7; border-radius: 20px; }
.account-delete-card > header { display: flex; align-items: center; gap: 13px; }
.account-delete-icon { width: 42px; height: 42px; flex: 0 0 42px; display: grid; place-items: center; color: #c94735; background: #fff0ec; border-radius: 12px; }
.account-delete-icon svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.65; stroke-linecap: round; stroke-linejoin: round; }
.account-delete-card header div { display: grid; gap: 4px; }
.account-delete-card header small { color: #ae9e93; font: 800 7px/1 ui-monospace,SFMono-Regular,Menlo,monospace; letter-spacing: .15em; }
.account-delete-card h2 { margin: 0; color: #211d1a; font-size: 19px; font-weight: 900; letter-spacing: -.035em; }
.account-delete-profile { display: flex; align-items: center; gap: 11px; margin-top: 20px; padding: 12px; background: #f6f3ef; border: 1px solid #e8e1da; border-radius: 13px; }
.account-delete-avatar { width: 42px; height: 42px; flex: 0 0 42px; display: grid; place-items: center; color: #817970; background-color: #eae4de; background-position: center; background-size: cover; border: 1px solid #ddd5cd; border-radius: 50%; font-size: 13px; font-weight: 850; }
.account-delete-profile > span:last-child { min-width: 0; display: grid; gap: 3px; }
.account-delete-profile strong,.account-delete-profile small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-delete-profile strong { color: #2c2723; font-size: 12px; font-weight: 900; }
.account-delete-profile small { color: #90877f; font-size: 9px; font-weight: 650; }
.account-delete-card > p { margin: 15px 1px 0; color: #766d65; font-size: 11px; font-weight: 650; line-height: 1.65; }
.account-delete-card > footer { display: grid; grid-template-columns: 1fr 1.25fr; gap: 9px; margin-top: 21px; }
.account-delete-card footer button { height: 42px; border-radius: 11px; cursor: pointer; font-size: 11px; font-weight: 850; }
.account-delete-cancel { color: #5f5750; background: #f3efeb; border: 1px solid #e6ded7; }
.account-delete-cancel:hover,.account-delete-cancel:focus-visible { outline: 0; color: #292521; background: #ebe5df; }
.account-delete-confirm { display: flex; align-items: center; justify-content: center; gap: 14px; color: #fff; background: #c94735; border: 1px solid #c94735; box-shadow: 0 8px 18px rgba(201,71,53,.18); }
.account-delete-confirm svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.account-delete-confirm:hover,.account-delete-confirm:focus-visible { outline: 0; background: #ad3626; border-color: #ad3626; }

/* Toolbox — restrained desktop utility aesthetic, inspired by macOS. */
body[data-workspace-mode="tools"] #toolboxNav {
  color: #1d1d1f;
  background: #f2f2f4;
}
body[data-workspace-mode="tools"] #toolboxNav .nav-icon { color: #3a3a3c; }
.toolbox-subnav {
  gap: 3px;
  margin: -2px 2px 0 10px;
  padding: 4px 0 4px 9px;
  border-left-color: #e1e1e5;
}
.toolbox-subnav button {
  width: 100%;
  min-height: 34px;
  padding: 0 10px 0 13px;
  color: #6e6e73;
  border: 1px solid transparent;
  border-radius: 7px;
  font-size: 10px;
  font-weight: 700;
  transition: color .16s ease,background .16s ease,border-color .16s ease,box-shadow .16s ease;
}
.toolbox-subnav button::before {
  left: 4px;
  top: 8px;
  width: 3px;
  height: 18px;
  border-radius: 999px;
}
.toolbox-subnav button:hover { color: #1d1d1f; background: #f5f5f6; }
.toolbox-subnav button:focus-visible { text-decoration: none; box-shadow: 0 0 0 3px rgba(0,0,0,.07); }
.toolbox-subnav button.active {
  color: #1d1d1f;
  background: #fff2ee;
  border-color: #ffd8cf;
  box-shadow: 0 2px 6px rgba(255,74,53,.08);
  font-weight: 850;
}
.toolbox-subnav button.active::before { background: #ff4a35; }

.toolbox-shell,
.tool-panel { background: #f5f5f7; }
.tool-panel-head {
  min-height: 88px;
  padding: 18px 32px;
  background: rgba(255,255,255,.92);
  border-bottom-color: rgba(60,60,67,.12);
  backdrop-filter: saturate(180%) blur(18px);
}
.tool-panel-head h2 {
  margin-bottom: 6px;
  color: #1d1d1f;
  font-size: 22px;
  font-weight: 850;
  letter-spacing: -.04em;
}
.tool-panel-head p { color: #86868b; font-size: 10px; font-weight: 600; }
.tool-panel-actions { gap: 9px; }
.tool-action {
  min-height: 38px;
  padding-inline: 15px;
  color: #3a3a3c;
  background: #fff;
  border-color: rgba(60,60,67,.15);
  border-radius: 11px;
  box-shadow: 0 1px 2px rgba(0,0,0,.025);
  font-weight: 780;
}
.tool-action.subtle { color: #6e6e73; background: #f5f5f7; border-color: transparent; }
.tool-action.primary { color: #fff; background: #1d1d1f; border-color: #1d1d1f; border-radius: 11px; box-shadow: 0 5px 12px rgba(0,0,0,.12); }
.tool-action:not(:disabled):hover { transform: translateY(-1px); box-shadow: 0 5px 14px rgba(0,0,0,.08); }
.tool-action.primary:not(:disabled):hover { background: #000; box-shadow: 0 7px 16px rgba(0,0,0,.16); }

.color-lab-grid {
  grid-template-columns: minmax(520px,1fr) 300px;
  gap: 18px;
  padding: 22px 28px 28px;
}
.color-canvas-shell {
  background: #fff;
  border-color: rgba(60,60,67,.12);
  border-radius: 18px;
  box-shadow: 0 2px 10px rgba(0,0,0,.035);
}
.color-canvas-shell:focus-visible { box-shadow: 0 0 0 4px rgba(255,74,53,.12),0 2px 10px rgba(0,0,0,.035); }
.color-canvas-shell.drag-over { background: #fff8f6; border-color: rgba(255,74,53,.55); }
.color-result {
  padding: 19px;
  background: #fff;
  border: 1px solid rgba(60,60,67,.12);
  border-radius: 18px;
  box-shadow: 0 2px 10px rgba(0,0,0,.035);
}
.color-result h3 { margin-bottom: 14px; color: #1d1d1f; font-size: 11px; }
.color-swatch { min-height: 148px; border-color: rgba(0,0,0,.08); border-radius: 14px; box-shadow: inset 0 0 0 1px rgba(255,255,255,.12); }
.color-value-list { margin-top: 12px; padding-top: 5px; border-top-color: rgba(60,60,67,.1); }
.color-value-list button {
  min-height: 48px;
  grid-template-columns: 37px minmax(0,1fr) 18px;
  padding: 0 9px;
  border-bottom-color: rgba(60,60,67,.09);
  border-radius: 9px;
}
.color-value-list button:not(:disabled):hover { background: #f5f5f7; }
.color-value-list button:not(:disabled):hover svg { stroke: #1d1d1f; }
.color-recent { margin-top: 17px; }
.color-recent button { border-radius: 8px; box-shadow: 0 0 0 1px rgba(60,60,67,.18); transition: transform .15s ease,box-shadow .15s ease; }
.color-recent button:hover { transform: scale(1.08); box-shadow: 0 0 0 1px rgba(60,60,67,.28),0 4px 10px rgba(0,0,0,.1); }
.color-status { color: #8e8e93; border-top-color: rgba(60,60,67,.1); }

.ratio-lab-grid {
  grid-template-columns: 322px minmax(520px,1fr);
  gap: 18px;
  padding: 22px 28px 28px;
}
.ratio-controls {
  padding: 3px 18px 10px;
  background: #fff;
  border-color: rgba(60,60,67,.12);
  border-radius: 18px;
  box-shadow: 0 2px 10px rgba(0,0,0,.035);
}
.ratio-controls section { gap: 11px; padding: 17px 1px; border-bottom-color: rgba(60,60,67,.1); }
.ratio-controls section > span,.ratio-controls label { color: #6e6e73; font-size: 9px; font-weight: 760; letter-spacing: .02em; }
.ratio-controls output { color: #1d1d1f; font-weight: 750; }
.ratio-quick {
  gap: 4px;
  padding: 4px;
  background: #f0f0f2;
  border-radius: 11px;
}
.ratio-quick button {
  min-height: 31px;
  color: #6e6e73;
  background: transparent;
  border: 0;
  border-radius: 8px;
  transition: color .15s ease,background .15s ease,box-shadow .15s ease;
}
.ratio-quick button:hover { color: #1d1d1f; }
.ratio-quick button.active {
  color: #1d1d1f;
  background: #fff;
  border: 0;
  box-shadow: 0 1px 4px rgba(0,0,0,.12);
}
.ratio-controls select,
.ratio-controls input[type="number"] {
  color: #1d1d1f;
  background-color: #f5f5f7;
  border-color: transparent;
  border-radius: 10px;
}
.ratio-controls select { height: 40px; padding-inline: 11px; }
.ratio-controls input[type="number"] { height: 36px; }
.ratio-controls select:hover,.ratio-controls input[type="number"]:hover { background-color: #efeff1; }
.ratio-controls select:focus-visible,.ratio-controls input:focus-visible { border-color: rgba(255,74,53,.5); outline: 3px solid rgba(255,74,53,.1); }
.ratio-controls input[type="range"] { accent-color: #1d1d1f; }
.ratio-controls input[type="color"] { height: 38px; border-color: rgba(60,60,67,.12); border-radius: 10px; }
.ratio-privacy i { background: #34c759; box-shadow: 0 0 0 4px rgba(52,199,89,.1); }
.ratio-stage-wrap {
  grid-template-rows: 54px minmax(0,1fr);
  border-color: rgba(60,60,67,.12);
  border-radius: 18px;
  box-shadow: 0 2px 10px rgba(0,0,0,.035);
}
.ratio-meta { padding-inline: 17px 12px; border-bottom-color: rgba(60,60,67,.1); }
.ratio-meta > span { color: #8e8e93; }
.ratio-meta button { min-height: 32px; color: #3a3a3c; background: #f5f5f7; border-color: transparent; border-radius: 9px; }
.ratio-meta button:not(:disabled):hover { color: #1d1d1f; background: #ebebed; }
.ratio-meta button.ratio-copy { color: #fff; background: #1d1d1f; border-color: #1d1d1f; }
.ratio-meta button:disabled { color: #aeaeb2; background: #f2f2f4; border-color: transparent; }
.ratio-stage {
  background-color: #f0f0f2;
  background-image: linear-gradient(45deg,rgba(255,255,255,.72) 25%,transparent 25%),linear-gradient(-45deg,rgba(255,255,255,.72) 25%,transparent 25%),linear-gradient(45deg,transparent 75%,rgba(255,255,255,.72) 75%),linear-gradient(-45deg,transparent 75%,rgba(255,255,255,.72) 75%);
  background-size: 22px 22px;
  background-position: 0 0,0 11px,11px -11px,-11px 0;
}
.ratio-stage:focus-visible { box-shadow: inset 0 0 0 3px rgba(255,74,53,.18); }
.tool-empty-state strong { color: #3a3a3c; font-weight: 820; }
.tool-empty-state p { color: #8e8e93; }

/* Mobile workbench: the editor is a native-width app, while the desktop rails
   become drawers. Keeping edit and preview as explicit tabs avoids squeezing
   three desktop columns into a phone viewport. */
.mobile-topbar-button,
.mobile-workspace-tabs,
.mobile-drawer-backdrop { display: none; }

@media (max-width: 760px) {
  :root {
    --sidebar-w: 0px;
    --template-w: 0px;
    --topbar-h: calc(56px + env(safe-area-inset-top));
    --panel-gap: 0px;
    --preview-width: min(387px, calc(100vw - 34px));
  }

  html, body { width: 100%; min-width: 0; height: 100%; min-height: 0; overflow: hidden; }
  body { position: fixed; inset: 0; }

  .topbar,
  body[data-workspace-mode="matrix"] .topbar {
    left: 0;
    height: var(--topbar-h);
    display: grid;
    grid-template-columns: 44px minmax(0,1fr) 44px;
    align-items: end;
    padding: env(safe-area-inset-top) 8px 6px;
    border-bottom-color: #eee9e3;
  }
  .topbar > strong {
    align-self: center;
    overflow: hidden;
    text-align: center;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 15px;
  }
  .mobile-topbar-button {
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    padding: 0;
    color: #2d2925;
    background: transparent;
    border: 0;
    border-radius: 12px;
  }
  .mobile-topbar-button:active { background: #f5f1ed; }
  .mobile-topbar-button svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
  body:not([data-workspace-mode="cards"]) .mobile-template-toggle { visibility: hidden; pointer-events: none; }

  .mobile-workspace-tabs {
    position: fixed;
    top: var(--topbar-h);
    right: 0;
    left: 0;
    z-index: 44;
    height: 46px;
    grid-template-columns: repeat(2,minmax(0,1fr));
    gap: 3px;
    padding: 6px 10px;
    background: rgba(255,255,255,.96);
    border-bottom: 1px solid #eee9e3;
    backdrop-filter: blur(14px);
  }
  body[data-workspace-mode="cards"] .mobile-workspace-tabs { display: grid; }
  .mobile-workspace-tabs button {
    min-width: 0;
    color: #77716a;
    background: transparent;
    border: 0;
    border-radius: 9px;
    font-size: 12px;
    font-weight: 850;
  }
  .mobile-workspace-tabs button.active { color: #e94331; background: #fff0eb; }

  .mobile-drawer-backdrop {
    position: fixed;
    inset: 0;
    z-index: 84;
    width: 100%;
    height: 100%;
    padding: 0;
    opacity: 0;
    visibility: hidden;
    display: block;
    background: rgba(27,23,20,.42);
    border: 0;
    backdrop-filter: blur(2px);
    transition: opacity .2s ease, visibility .2s ease;
  }
  body[data-mobile-drawer] .mobile-drawer-backdrop { opacity: 1; visibility: visible; }

  .sidebar {
    z-index: 90;
    width: min(82vw,300px);
    padding: calc(20px + env(safe-area-inset-top)) 14px calc(16px + env(safe-area-inset-bottom));
    border-right: 0;
    box-shadow: 24px 0 70px rgba(29,23,18,.18);
    transform: translateX(-105%);
    transition: transform .24s cubic-bezier(.2,.75,.25,1);
  }
  body[data-mobile-drawer="nav"] .sidebar { transform: translateX(0); }
  .studio-brand { margin-bottom: 24px; }
  .studio-brand img { width: 122px; max-height: 34px; }
  .nav-item { height: 48px; font-size: 14px; }
  .sidebar-footer { padding-bottom: 2px; }

  .template-dock {
    inset: 0 0 0 auto;
    z-index: 90;
    width: min(86vw,340px);
    overflow: hidden;
    border-right: 0;
    border-left: 1px solid #eee9e3;
    box-shadow: -24px 0 70px rgba(29,23,18,.18);
    transform: translateX(105%);
    transition: transform .24s cubic-bezier(.2,.75,.25,1);
  }
  body[data-mobile-drawer="templates"] .template-dock { transform: translateX(0); }
  .template-dock > header { top: calc(12px + env(safe-area-inset-top)); left: 18px; right: 10px; height: 44px; }
  .template-dock > header strong { font-size: 17px; }
  .template-dock > header button { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 12px; }
  .template-dock > header button:active { color: #fff; background: #292622; }
  .template-strip {
    inset: calc(66px + env(safe-area-inset-top)) 0 env(safe-area-inset-bottom);
    padding: 0 14px 18px;
  }
  .template-group-list { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 13px 10px; }
  .template-card-shell,
  .template-card { width: 126px; height: 164px; }
  .template-card img { width: 114px; height: 152px; }
  .template-tier { top: 9px; left: 9px; height: 20px; font-size: 9px; line-height: 20px; }
  .template-detail-handle { display: none; }
  .template-peek { width: min(92vw,340px); }

  .workspace-main {
    width: 100%;
    height: 100dvh;
    min-height: 0;
    grid-template-columns: minmax(0,1fr);
    grid-template-rows: minmax(0,1fr);
    gap: 0;
    padding: calc(var(--topbar-h) + 54px) 8px calc(8px + env(safe-area-inset-bottom));
    overflow: hidden;
  }
  .editor-panel,
  .preview-panel {
    width: 100%;
    height: 100%;
    min-height: 0;
    grid-column: 1;
    grid-row: 1;
    border-radius: 13px;
  }
  body:not([data-mobile-panel="preview"]) .workspace-main > .preview-panel,
  body[data-mobile-panel="preview"] .workspace-main > .editor-panel { display: none; }
  body[data-mobile-panel="preview"] .workspace-main > .preview-panel { display: grid; }
  .editor-panel { grid-template-rows: 50px minmax(0,1fr) auto auto auto; }
  .editor-toolbar { height: 50px; gap: 6px; padding: 0 12px; }
  .editor-toolbar > strong { margin-right: 2px; font-size: 13px; }
  .formatbar { gap: 0; }
  .formatbar button { width: 40px; height: 40px; }
  #markdown { padding: 17px 16px; font-size: 16px; line-height: 1.75; }
  .cover-settings { padding-inline: 13px; }
  .poster-footer-settings,
  .source-lead-settings {
    grid-template-columns: 1fr;
    gap: 7px;
    padding: 10px 13px 12px;
  }
  .layout-settings,
  .card-theme-settings,
  .paper-style-settings { padding-inline: 13px; }
  .identity-zone {
    min-height: 74px;
    grid-template-columns: 34px minmax(0,1fr) 88px;
    gap: 8px;
    padding: 14px 16px;
  }
  .identity-zone::before { inset: 8px 10px; }
  .identity-avatar { width: 34px; height: 34px; }
  .identity-switch { width: 88px; min-width: 88px; height: 40px; padding: 0 9px; gap: 5px; font-size: 11px; }
  .identity-edit { display: none; }
  .identity-popover { right: 8px; width: calc(100vw - 36px); }

  .preview-panel { grid-template-rows: 54px minmax(0,1fr) 48px; }
  .preview-head { height: 54px; gap: 8px; padding: 0 10px 0 13px; }
  .preview-head > strong { font-size: 12px; }
  .saved-state { display: none; }
  .preview-actions { gap: 7px; }
  .premium-export-state { max-width: 98px; height: 28px; margin-right: 2px; padding-right: 9px; overflow: hidden; text-overflow: ellipsis; }
  .export-button { min-width: 76px; height: 36px; gap: 6px; padding: 0 11px; border-radius: 8px; font-size: 11px; }
  .export-label { font-size: 0; line-height: 1; }
  .export-label::after { content: "导出"; font-size: 11px; }
  .preview-viewport { padding: 12px 8px 18px; }
  .preview-pages { min-width: 100%; justify-content: flex-start; gap: 12px; }
  .preview-page { margin-inline: auto; }
  .preview-footer { height: 48px; justify-content: flex-start; padding-left: 10px; }
  .page-nav, .zoom-nav { gap: 5px; }
  .page-nav button, .zoom-nav button { width: 40px; height: 40px; }
  .zoom-nav { right: 13px; }

  .matrix-shell,
  body[data-workspace-mode="matrix"] .matrix-shell,
  .toolbox-shell { inset: var(--topbar-h) 0 0; }
  .matrix-page { padding: 18px 14px 42px; }
  .matrix-page-head { align-items: flex-start; }
  .matrix-page-head h1 { font-size: 22px; }
  .matrix-page-head p { font-size: 10px; }
  .matrix-add-primary { min-width: 96px; height: 36px; padding-inline: 10px; }
  .matrix-search { width: 100%; }
  .matrix-account-card { grid-template-columns: 1fr; }
  .matrix-card-data { padding-top: 12px; }
  .toolbox-shell { overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; }
  .toolbox-workspace { height: auto; min-height: 100%; overflow: visible; }
  .tool-panel { height: auto; min-height: 100%; grid-template-rows: auto auto; overflow: visible; }
  .tool-panel.whiteboard-panel { height: calc(100dvh - var(--topbar-h)); min-height: 620px; overflow: hidden; }
  .whiteboard-stage { height: 100%; min-height: 620px; }
  .tool-panel-head { position: relative; z-index: 2; align-items: flex-start; gap: 12px; padding: 14px; }
  .tool-panel-head h2 { font-size: 19px; }
  .tool-panel-head p { max-width: 190px; }
  .tool-panel-actions { gap: 7px; }
  .tool-action { min-height: 44px; padding-inline: 13px; }
  .color-lab-grid,
  .ratio-lab-grid { height: auto; min-height: 0; grid-template-columns: minmax(0,1fr); gap: 14px; padding: 14px 14px calc(24px + env(safe-area-inset-bottom)); overflow: visible; }
  .color-canvas-shell { min-height: 360px; aspect-ratio: 1 / 1; }
  .color-result { min-height: 0; padding: 18px 0 0; border-top: 1px solid #e7e2dc; border-left: 0; }
  .color-swatch { min-height: 150px; }
  .color-value-list button { min-height: 54px; padding-inline: 2px; }
  .color-status { margin-top: 20px; }
  .ratio-controls { padding-inline: 13px; overflow: visible; }
  .ratio-stage-wrap { height: auto; min-height: 430px; grid-template-rows: auto minmax(360px,62vh); }
  .ratio-meta { min-height: 58px; flex-wrap: wrap; padding-block: 8px; }
  .ratio-meta > span { flex: 1 1 160px; }
  .ratio-meta > div { margin-left: auto; }
  .ratio-meta button { min-height: 40px; }
}

@media (max-width: 360px) {
  .template-group-list { grid-template-columns: 1fr; }
  .template-card-shell,
  .template-card { width: 150px; height: 190px; }
  .template-card img { width: 138px; height: 178px; }
  .identity-copy #profileHandle { display: none; }
  .sticker-grid { grid-template-columns: repeat(7,minmax(0,1fr)); }
  .tool-panel-head { display: grid; grid-template-columns: 1fr; }
  .tool-panel-head p { max-width: none; }
  .tool-panel-actions { width: 100%; }
  .tool-panel-actions .tool-action { flex: 1 1 0; }
}

/* Keep the API actions reachable on narrow screens after the workspace's
   general mobile rules have been applied. */
.api-base-url code { min-width: 0; }
.api-base-url button { flex: 0 0 auto; }
@media (max-width: 760px) {
  .api-docs-topbar {
    display: grid;
    grid-template-columns: minmax(0,1fr) auto;
  }
  .api-docs-tabs { width: 100%; }
}
