/* Adaptive preview: media is the interface. Nothing is painted above it. */
.adaptive-preview {
  --ap-media-height: calc(100dvh - 224px);
  display:flex; flex-direction:column; align-items:stretch; justify-content:center; gap:18px;
  width:100%; min-width:0; min-height:min(660px,calc(100dvh - 180px));
  padding:10px clamp(5px,2vw,30px) 28px;
  background:#000; color:#e6e9ec;
}
.adaptive-preview[hidden] { display:none!important; }
.adaptive-preview[data-mode='gallery'],.adaptive-preview[data-mode='film'] { --ap-media-height:calc(100dvh - 368px); }
.ap-heading { display:flex; align-items:center; gap:16px; min-height:45px; padding:1px 0 10px; }
.ap-heading-copy { min-width:0; }
.ap-eyebrow { display:block; margin-bottom:6px; font-size:8px; letter-spacing:1.7px; line-height:1.3; color:#6f7d87; }
.ap-heading-title { margin:0; font-size:clamp(18px,1.75vw,25px); font-weight:400; line-height:1.25; letter-spacing:-.7px; max-width:540px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.ap-heading-count { align-self:flex-end; margin-bottom:3px; font-size:10px; color:#66747e; white-space:nowrap; }
.ap-mode { margin-left:auto; flex:0 0 auto; padding:8px 0 8px 12px; font-size:10px; color:#8c9da8; }
.ap-mode:hover { color:#ecf4f9; }
.ap-stage { display:flex; align-items:center; justify-content:center; min-width:0; min-height:0; width:100%; }
.ap-content { display:flex; justify-content:center; align-items:center; width:100%; min-width:0; }
.ap-media {
  position:relative; display:flex; align-items:center; justify-content:center;
  margin:0; min-width:0; max-width:100%; width:max-content;
  border:0; box-shadow:none; background:transparent;
}
.ap-media-element {
  display:block; width:auto; height:auto; max-width:100%;
  max-height:max(250px,var(--ap-media-height)); min-width:0;
  object-fit:contain; border-radius:24px; border:0;
  opacity:1; transition:opacity 300ms ease-out;
}
/* Radius is on the rendered image itself, never on an oversized letterbox. */
.ap-media-image > img { border-radius:24px; overflow:clip; }
.ap-media-video > video { border-radius:24px; overflow:hidden; background:#07090b; }
.ap-media.is-loading { min-height:min(400px,max(240px,var(--ap-media-height))); width:min(100%,720px); }
.ap-media.is-loading > .ap-media-element { opacity:0; }
.ap-media.is-loading::before {
  content:''; position:absolute; inset:0; border-radius:24px;
  background:linear-gradient(110deg,#090d1066 20%,#19222a55 45%,#090d1066 70%);
  background-size:250% 100%; animation:ap-load-light 2.4s ease-in-out infinite;
}
.ap-media.has-error { min-height:220px; width:min(100%,520px); }
.ap-media.has-error > .ap-media-element { display:none; }
.ap-media-fallback { text-align:center; padding:44px 28px; color:#7d8c97; font-size:12px; }
.ap-media-fallback p { margin:0 0 15px; line-height:1.6; }
.ap-retry { border:1px solid #c4d8e526; border-radius:999px; padding:8px 14px; color:#becdd7; font-size:11px; background:#d3e7f105; }
.ap-retry:hover { border-color:#c4d8e54d; color:#fff; }
.ap-actions { display:flex; align-items:center; justify-content:center; gap:8px; flex:0 0 auto; min-height:36px; margin-top:-3px; }
.ap-download { display:inline-flex; align-items:center; justify-content:center; gap:7px; padding:8px 14px; min-height:35px; border:1px solid #bcced31d; background:#c4d9e505; border-radius:999px; color:#a4b2bc; font-size:11px; line-height:1; transition:color 150ms,border-color 150ms; }
.ap-download:hover { color:#e9f0f5; border-color:#c4d6de45; }
.ap-download .icon { width:13px; height:13px; }
.ap-more-wrap { position:relative; }
.ap-more { width:34px; height:34px; display:grid; place-items:center; padding:0; border:1px solid transparent; border-radius:50%; color:#657580; background:transparent; }
.ap-more:hover,.ap-more[aria-expanded='true'] { background:#c5dbe509; color:#c8d9e2; border-color:#c5dbe518; }
.ap-dots { font-size:12px; letter-spacing:2px; line-height:1; transform:translateX(1px); }
.ap-more:disabled { opacity:.45; cursor:wait; }
.ap-menu { position:absolute; z-index:12; right:0; bottom:calc(100% + 6px); width:194px; padding:5px; border:1px solid #cbdee123; border-radius:13px; background:#101518; box-shadow:0 15px 40px #000b; }
.ap-menu-item { display:block; text-align:left; width:100%; padding:11px 12px; border:0; border-radius:8px; background:none; color:#adbdc9; font-size:11px; line-height:1.4; }
.ap-menu-item:hover,.ap-menu-item:focus-visible { background:#d0e3ee0c; color:#f1f7fa; }
.ap-rail { display:flex; align-items:center; justify-content:center; gap:14px; width:100%; padding:0; min-height:28px; }
.ap-carousel-arrow { display:grid; place-items:center; width:31px; height:31px; padding:0; border:1px solid #bbced91d; border-radius:50%; color:#8596a3; background:#bbcddb03; }
.ap-carousel-arrow:hover:not(:disabled) { color:#e3eff6; border-color:#c8dce849; }
.ap-carousel-arrow:disabled { color:#34414b; border-color:#91aab710; cursor:default; }
.ap-carousel-arrow .icon { width:13px; height:13px; }
.ap-carousel-position { font-size:10px; letter-spacing:1.1px; color:#617783; font-variant-numeric:tabular-nums; }
.ap-collection-footer { display:flex; justify-content:center; padding-top:0; }
.ap-batch-approve { border:1px solid #d6e5ed25; background:linear-gradient(135deg,#c8dce80b,#a7c0ce04); color:#adbfcc; border-radius:999px; padding:9px 16px; min-height:35px; font-size:10px; }
.ap-batch-approve:hover { color:#e4edf3; border-color:#c8dce84d; }
.ap-batch-approve:disabled { opacity:.45; cursor:wait; }
.ap-document { width:100%; max-width:730px; padding:clamp(22px,4vw,52px) clamp(12px,3vw,46px) 34px; color:#b7c2ca; outline:none; }
.ap-document-title { margin:0 0 28px; color:#e4ebf0; font-size:clamp(27px,3vw,42px); line-height:1.15; font-weight:400; letter-spacing:-1.3px; }
.ap-document-body { font-size:14px; line-height:1.85; overflow-wrap:anywhere; }
.ap-document-body p { margin:0 0 1.4em; }
.ap-document-body h1,.ap-document-body h2,.ap-document-body h3,.ap-document-body h4 { color:#d7e2e9; font-weight:400; line-height:1.35; letter-spacing:-.4px; margin:1.8em 0 .75em; }
.ap-document-body h2 { font-size:23px; }.ap-document-body h3 { font-size:19px; }.ap-document-body h4 { font-size:16px; }
.ap-document-body ul,.ap-document-body ol { padding-left:22px; margin:1em 0 1.4em; }
.ap-document-body li { padding-left:5px; margin:.5em 0; }
.ap-document-body blockquote { border-left:1px solid #9ebaca50; padding-left:21px; margin:25px 0; color:#9cb0be; }
.ap-document-body pre { white-space:pre-wrap; font:12px/1.8 var(--font,Arial,sans-serif); padding:18px; border:1px solid #c0d7e115; border-radius:12px; background:#060a0d; color:#9dafbc; }
.ap-document-body .markdown-table { overflow:auto; }.ap-document-body table { border-collapse:collapse; width:100%; font-size:12px; }.ap-document-body th,.ap-document-body td { border-bottom:1px solid #b8cbd620; padding:12px; text-align:left; }.ap-document-body th { font-weight:400; color:#e1ebf2; }
.ap-document-pending { color:#6a7b87; }
.ap-media-audio { flex-direction:column; gap:26px; width:min(100%,540px); padding:50px 0 20px; }
.ap-media-audio .ap-media-element { width:100%; max-height:none; border-radius:999px; }
.ap-audio-art { display:flex; align-items:center; justify-content:center; height:110px; gap:8px; }
.ap-audio-art i { display:block; width:3px; height:30px; border-radius:8px; background:linear-gradient(#c4ddea,#718492); }
.ap-audio-art i:nth-child(2n) { height:49px; }.ap-audio-art i:nth-child(3n) { height:74px; }.ap-audio-art i:nth-child(5n) { height:100px; }
.ap-empty,.ap-working { display:flex; flex-direction:column; align-items:center; justify-content:center; text-align:center; min-height:min(610px,calc(100dvh - 200px)); padding:48px 22px; }
.ap-empty-mark { font-size:29px; color:#687986; line-height:1; margin-bottom:26px; }
.ap-empty h2,.ap-working h2 { margin:0; font-size:clamp(20px,2.15vw,29px); line-height:1.35; font-weight:400; letter-spacing:-.8px; color:#a2b0bb; }
.ap-empty p,.ap-working p { max-width:320px; font-size:12px; line-height:1.7; color:#526573; margin:13px 0 0; }
.ap-working-light { width:min(180px,55%); height:1px; margin-bottom:36px; overflow:hidden; position:relative; background:#31465145; }
.ap-working-light::after { content:''; position:absolute; inset:0; width:70%; background:linear-gradient(90deg,transparent,#acc7d9,transparent); transform:translateX(-120%); animation:ap-working-light 2.4s ease-in-out infinite; }
@keyframes ap-load-light { 0%,100% { background-position:100% 0; } 50% { background-position:0 0; } }
@keyframes ap-working-light { 0% { transform:translateX(-120%); opacity:0; } 20% { opacity:.65; } 75% { opacity:.65; } 100% { transform:translateX(170%); opacity:0; } }
@media(max-width:1100px) { .adaptive-preview { padding-left:2px; padding-right:2px; }.ap-heading-count { display:none; }.ap-document { padding-left:16px; padding-right:16px; }.ap-document-body { font-size:13px; } }
@media(max-width:600px) {
  .adaptive-preview { --ap-media-height:calc(100dvh - 230px); min-height:calc(100dvh - 200px); gap:15px; padding:4px 1px 24px; }
  .adaptive-preview[data-mode='gallery'],.adaptive-preview[data-mode='film'] { --ap-media-height:calc(100dvh - 365px); }
  .ap-media-element,.ap-media-image>img,.ap-media-video>video { border-radius:20px; }
  .ap-media.is-loading::before { border-radius:20px; }
  .ap-heading { padding:0 3px 7px; gap:10px; }.ap-heading-title { font-size:20px; letter-spacing:-.5px; }.ap-mode { font-size:9px; }
  .ap-rail { justify-content:flex-start; gap:8px; padding-left:4px; padding-right:4px; }
  .ap-thumbnail { flex-basis:65px; width:65px; }.ap-thumbnail-picture { width:65px; height:49px; }
  .adaptive-preview[data-mode='film'] .ap-thumbnail { flex-basis:92px; width:92px; }.adaptive-preview[data-mode='film'] .ap-thumbnail-picture { width:92px; height:59px; }
  .ap-document { padding:23px 12px; }.ap-document-title { font-size:30px; }.ap-document-body { font-size:14px; line-height:1.8; }
  .ap-empty,.ap-working { min-height:calc(100dvh - 235px); }.ap-empty h2,.ap-working h2 { font-size:25px; }.ap-empty p,.ap-working p { max-width:260px; }
}
@media(prefers-reduced-motion:reduce) { .ap-media-element,.ap-thumbnail-picture { transition:none; }.ap-media.is-loading::before,.ap-working-light::after { animation:none; }.ap-working-light::after { opacity:.6; transform:translateX(20%); } }

/* Vertical topic ruler and horizontal deliverable carousel. */
.adaptive-preview { position:relative; --ap-peek:64px; --ap-direction:1; outline:none; }
.adaptive-preview.has-topics { padding-left:116px; }
.ap-topics { position:absolute; left:1px; top:55px; bottom:80px; width:101px; display:flex; flex-direction:column; justify-content:center; gap:9px; z-index:4; }
.ap-topics::before { content:''; width:1px; position:absolute; left:0; top:20px; bottom:20px; background:linear-gradient(transparent,#c3d7e41a 24%,#c3d7e41a 76%,transparent); pointer-events:none; }
.ap-topic { position:relative; display:flex; align-items:center; gap:10px; padding:8px 0; width:100%; background:none; border:0; text-align:left; color:#4b606f; transition:color 180ms; }
.ap-topic-notch { display:block; width:10px; height:1px; flex:0 0 auto; background:#738b9b4a; transition:width 220ms,background 220ms; }
.ap-topic-name { font-size:10px; line-height:1.35; letter-spacing:.1px; overflow-wrap:anywhere; }
.ap-topic:hover { color:#b6c8d4; }.ap-topic[aria-selected='true'] { color:#e1edf5; }.ap-topic[aria-selected='true'] .ap-topic-notch { width:21px; background:#c3dfefbd; }
.ap-topic:focus-visible { outline:1px solid #b9d4e164; outline-offset:4px; border-radius:4px; }
.ap-stage { position:relative; align-items:center; overflow:hidden; isolation:isolate; }
.ap-content { flex:0 0 100%; width:100%; position:relative; z-index:2; transform-origin:center; }
.ap-stage.has-next { justify-content:flex-start; }
.ap-stage.has-next .ap-content { flex-basis:calc(100% - var(--ap-peek) - 24px); width:calc(100% - var(--ap-peek) - 24px); }
.ap-peek { position:absolute; left:calc(100% - var(--ap-peek)); top:0; bottom:0; width:calc(100% - var(--ap-peek) - 24px); display:flex; align-items:center; overflow:hidden; opacity:.55; transform:scale(.91); transform-origin:left center; cursor:pointer; z-index:1; transition:opacity 180ms; }
.ap-peek:hover,.ap-peek:focus-visible { opacity:.62; }
.ap-peek:focus-visible { outline:1px solid #bdd8e666; outline-offset:-2px; border-radius:22px; }
.ap-peek-content { width:100%; display:flex; align-items:center; justify-content:flex-start; pointer-events:none; }
.ap-peek-content .ap-document { overflow:hidden; }
.ap-peek-content .ap-document-title { font-size:25px; }
.ap-peek-content .ap-actions,.ap-peek-content .ap-media-fallback { display:none; }
.ap-exit { position:absolute; inset:0; display:flex; justify-content:center; align-items:center; z-index:3; pointer-events:none; transform-origin:center; }
.ap-stage.has-next .ap-exit { right:calc(var(--ap-peek) + 24px); }
.ap-exit.is-leaving { animation:ap-exit-x 250ms cubic-bezier(.2,.65,.25,1) both; }
.ap-content.is-entering { animation:ap-enter-x 340ms cubic-bezier(.18,.7,.22,1) both; }
.adaptive-preview[data-axis='y'] .ap-exit.is-leaving { animation-name:ap-exit-y; }.adaptive-preview[data-axis='y'] .ap-content.is-entering { animation-name:ap-enter-y; }
.ap-document { max-height:max(260px,var(--ap-media-height)); overflow:auto; overscroll-behavior:contain; scrollbar-width:thin; scrollbar-color:#34424c transparent; }
@keyframes ap-enter-x { from { transform:translateX(calc(34px * var(--ap-direction))) scale(.94); opacity:.08; } to { transform:translateX(0) scale(1); opacity:1; } }
@keyframes ap-exit-x { from { transform:translateX(0) scale(1); opacity:.7; } to { transform:translateX(calc(-30px * var(--ap-direction))) scale(.92); opacity:0; } }
@keyframes ap-enter-y { from { transform:translateY(calc(27px * var(--ap-direction))) scale(.96); opacity:.08; } to { transform:translateY(0) scale(1); opacity:1; } }
@keyframes ap-exit-y { from { transform:translateY(0) scale(1); opacity:.7; } to { transform:translateY(calc(-23px * var(--ap-direction))) scale(.94); opacity:0; } }
/* Auto mode removes technical chrome; the real canvas keeps its zoom/tools. */
body.adaptive-preview-active:not(.adaptive-canvas-mode) .preview-controls { display:none; }
body.adaptive-preview-active .stage-scroll { padding:12px 0 18px; }
body.adaptive-canvas-mode .canvas-heading > div:first-child > .eyebrow,
body.adaptive-canvas-mode .canvas-heading > div:first-child > .canvas-eyebrow,
body.adaptive-canvas-mode .canvas-heading > div:first-child > h1 { display:none; }
body.adaptive-canvas-mode .canvas-heading { min-height:28px; padding-top:0; padding-bottom:10px; }
body.adaptive-canvas-mode .canvas-tabs { border-bottom-color:#bed0da14; }
@supports (height:100cqh) {
  body.adaptive-preview-active .stage-scroll { container-type:size; }
  .adaptive-preview { --ap-media-height:calc(100cqh - 107px); min-height:100%; }
  .adaptive-preview[data-mode='gallery'],.adaptive-preview[data-mode='film'] { --ap-media-height:calc(100cqh - 240px); }
  .adaptive-preview:has(.ap-collection-footer:not([hidden])) { --ap-media-height:calc(100cqh - 290px); }
  .ap-empty,.ap-working { min-height:calc(100cqh - 45px); }
}
@container (min-width:700px) { .adaptive-preview { --ap-peek:160px; } }
@media(max-width:600px) {
  .adaptive-preview { --ap-peek:44px; }.adaptive-preview.has-topics { padding-left:69px; }
  .ap-topics { width:61px; gap:7px; top:42px; bottom:55px; }.ap-topic { gap:6px; padding:9px 0; }.ap-topic-name { font-size:8px; line-height:1.4; }.ap-topic-notch { width:6px; }.ap-topic[aria-selected='true'] .ap-topic-notch { width:10px; }
  .ap-stage.has-next .ap-content { flex-basis:calc(100% - var(--ap-peek) - 12px); width:calc(100% - var(--ap-peek) - 12px); }.ap-peek { width:calc(100% - var(--ap-peek) - 12px); }.ap-stage.has-next .ap-exit { right:calc(var(--ap-peek) + 12px); }
  .ap-rail { justify-content:center; padding:0; }.ap-document { min-height:0; max-height:max(220px,var(--ap-media-height)); }.has-topics .ap-document { padding-left:3px; padding-right:7px; }.has-topics .ap-document-title { font-size:24px; }.has-topics .ap-document-body { font-size:12px; }
}
@media(prefers-reduced-motion:reduce) { .ap-content.is-entering,.ap-exit.is-leaving { animation:none; }.ap-exit.is-leaving { opacity:0; }.ap-topic,.ap-topic-notch,.ap-peek { transition:none; } }

/* The work gets the room. Download and navigation share one quiet baseline. */
.ap-bottom-bar { display:flex; align-items:center; justify-content:center; gap:19px; min-height:36px; flex:0 0 auto; }
.ap-bottom-bar .ap-actions { margin:0; }
.ap-bottom-bar .ap-rail { width:auto; min-height:35px; gap:10px; }
.ap-bottom-bar .ap-collection-footer { padding:0; }
.adaptive-preview.has-topics .ap-heading { display:none; }
.ap-topic-name { font-size:11px; }
.ap-topics::after { content:''; position:absolute; left:0; top:20px; bottom:20px; width:5px; background:repeating-linear-gradient(to bottom,#a9c3d321 0,#a9c3d321 1px,transparent 1px,transparent 10px); mask-image:linear-gradient(transparent,#000 18%,#000 82%,transparent); pointer-events:none; }
.ap-topic { z-index:1; }
.preview-layout-menu { position:relative; font-size:11px; color:#8d9eaa; }
.preview-layout-menu > summary { list-style:none; display:flex; align-items:center; justify-content:center; gap:6px; cursor:pointer; padding:8px 12px; border:1px solid #b7cdda25; border-radius:999px; background:#acc8d506; transition:background 150ms,color 150ms,border-color 150ms; }
.preview-layout-menu > summary::-webkit-details-marker { display:none; }
.preview-layout-menu > summary::marker { content:''; }
.preview-layout-menu > summary:hover,.preview-layout-menu[open] > summary { color:#e2edf4; background:#bcd6e10c; border-color:#bdd4df43; }
.preview-layout-menu > summary .icon,.preview-layout-menu > summary [data-icon] { width:13px; height:13px; }
.preview-layout-menu > nav { position:absolute; z-index:24; right:0; top:calc(100% + 7px); min-width:196px; display:flex!important; flex-direction:column; align-items:stretch!important; gap:3px!important; padding:6px; border:1px solid #bdd4de2a; border-radius:14px; background:#0e1418; box-shadow:0 14px 40px #000b; }
.preview-layout-menu > nav > button,.preview-layout-menu > nav > a { display:flex; align-items:center; justify-content:flex-start; width:100%; min-height:34px; height:auto; gap:9px; padding:9px 11px; border:0; border-radius:8px; background:none; color:#a3b7c5; text-align:left; font-size:11px; }
.preview-layout-menu > nav > button:hover,.preview-layout-menu > nav > a:hover { background:#b8d1e00c; color:#eff8ff; }
.preview-layout-menu > nav > button [data-icon],.preview-layout-menu > nav > a [data-icon] { width:14px; height:14px; }
.preview-layout-menu > nav > button[aria-pressed='true'] { color:#d9e9f3; background:#bfd9e512; }
.preview-layout-menu > summary:focus-visible { outline:1px solid #d4e7f1; outline-offset:3px; }
@supports (height:100cqh) {
  .adaptive-preview[data-mode='gallery'],.adaptive-preview[data-mode='film'] { --ap-media-height:calc(100cqh - 166px); }
  .adaptive-preview.has-topics { --ap-media-height:calc(100cqh - 105px); }
}
@media(max-width:600px) {
  .ap-bottom-bar { gap:10px; }.ap-bottom-bar .ap-rail { gap:7px; }.ap-bottom-bar .ap-actions { gap:5px; }.ap-bottom-bar .ap-download { padding:8px 11px; }.ap-carousel-arrow { width:29px; height:29px; }.ap-topic-name { font-size:9px; }
}
@media(prefers-reduced-motion:reduce) { .preview-layout-menu > summary { transition:none; } }
.preview-layout-menu:not([open]) > nav { display:none!important; }

/* Existing canvas retains its pan/zoom engine; only its topic rail moves. */
body.adaptive-canvas-mode .creative-canvas:has(.canvas-tabs > button:nth-child(2)) {
  display:grid; grid-template-columns:112px minmax(0,1fr); grid-template-rows:auto minmax(0,1fr); column-gap:8px;
}
body.adaptive-canvas-mode .creative-canvas:has(.canvas-tabs > button:nth-child(2)) > .canvas-heading { grid-column:2; grid-row:1; min-width:0; }
body.adaptive-canvas-mode .creative-canvas:has(.canvas-tabs > button:nth-child(2)) > .canvas-content { grid-column:2; grid-row:2; min-width:0; }
body.adaptive-canvas-mode .canvas-tabs:has(> button:nth-child(2)) {
  grid-column:1; grid-row:2; position:relative; flex-direction:column; justify-content:center; align-items:stretch;
  gap:10px; padding:26px 0; border:0; overflow-x:hidden; overflow-y:auto; min-height:0;
}
body.adaptive-canvas-mode .canvas-tabs:has(> button:nth-child(2))::before {
  content:''; position:absolute; pointer-events:none; left:0; top:26px; bottom:26px; width:5px;
  background:repeating-linear-gradient(to bottom,#a9c3d321 0,#a9c3d321 1px,transparent 1px,transparent 10px);
  mask-image:linear-gradient(transparent,#000 18%,#000 82%,transparent);
}
body.adaptive-canvas-mode .canvas-tabs:has(> button:nth-child(2)) > button {
  flex:none; min-height:37px; padding:9px 8px 9px 23px; font-size:11px; line-height:1.35;
  white-space:normal; overflow-wrap:anywhere; text-align:left; color:#5a6c78; border-radius:5px;
}
body.adaptive-canvas-mode .canvas-tabs:has(> button:nth-child(2)) > button::after {
  content:''; position:absolute; left:0; right:auto; top:50%; bottom:auto; width:10px; height:1px; background:#738b9b4a;
}
body.adaptive-canvas-mode .canvas-tabs:has(> button:nth-child(2)) > button.is-active { color:#e1edf5; }
body.adaptive-canvas-mode .canvas-tabs:has(> button:nth-child(2)) > button.is-active::after { width:18px; background:#c3dfefbd; }
body.adaptive-canvas-mode .canvas-tabs:has(> button:nth-child(2)) > button:hover { color:#b6c8d4; }
body.adaptive-canvas-mode .canvas-tabs:has(> button:only-child) { border:0; padding:0; }
body.adaptive-canvas-mode .canvas-tabs > button:only-child { font-size:10px; padding:4px 0 9px; color:#70818c; }
body.adaptive-canvas-mode .canvas-tabs > button:only-child::after { display:none; }
@media(max-width:600px) {
  body.adaptive-canvas-mode .creative-canvas:has(.canvas-tabs > button:nth-child(2)) { grid-template-columns:67px minmax(0,1fr); column-gap:4px; }
  body.adaptive-canvas-mode .canvas-tabs:has(> button:nth-child(2)) > button { font-size:9px; padding-left:13px; padding-right:3px; }
  body.adaptive-canvas-mode .canvas-tabs:has(> button:nth-child(2)) > button::after { width:5px; }
  body.adaptive-canvas-mode .canvas-tabs:has(> button:nth-child(2)) > button.is-active::after { width:9px; }
}

/* Shared X8 materials without another canvas or continuous paint loop. */
.supercomputer-page .adaptive-preview {
  --ap-text:#eeeef0; --ap-muted:#92979c; --ap-dim:#646b71; --ap-surface:#0b0c0e;
  font-family:var(--font); color:var(--ap-text);
}
.supercomputer-page :is(.ap-download,.ap-retry,.ap-batch-approve) {
  font-family:var(--font); font-weight:400; color:#c3cbd1;
  border:1px solid transparent;
  background:linear-gradient(#0b0c0e,#0b0c0e) padding-box,linear-gradient(125deg,#bbcada35,#dac4a92b 34%,#d2dee339 65%,#b1a9c32e) border-box;
  box-shadow:inset 0 1px 0 #ffffff09,0 5px 14px #0004;
  transition:color .18s,box-shadow .18s;
}
.supercomputer-page :is(.ap-download,.ap-retry,.ap-batch-approve):hover:not(:disabled) {
  color:#f2f5f7;
  background:linear-gradient(#101315,#0b0c0e) padding-box,linear-gradient(125deg,#bbcada6a,#dac4a954 34%,#d2dee372 65%,#b1a9c35c) border-box;
  box-shadow:inset 0 1px 0 #ffffff13,0 5px 16px #0005;
}
.supercomputer-page :is(.ap-more,.ap-carousel-arrow) {
  color:#9da7af; border-color:#ffffff1c; background:#ffffff03; font-family:var(--font);
  box-shadow:inset 0 1px 0 #ffffff06;
}
.supercomputer-page :is(.ap-more,.ap-carousel-arrow):hover:not(:disabled),
.supercomputer-page .ap-more[aria-expanded='true'] { color:#eeeef0; border-color:#d4dee443; background:#ffffff08; }
.supercomputer-page .ap-carousel-arrow:disabled { color:#454c52; border-color:#ffffff0d; background:transparent; box-shadow:none; }
.supercomputer-page :is(.ap-menu,.preview-layout-menu > nav) {
  color:#bcc6ce; background:linear-gradient(145deg,#171c20,#101315 66%);
  border-color:#ffffff20; box-shadow:inset 0 1px 0 #ffffff0a,0 16px 38px #0009;
}
.supercomputer-page :is(.ap-menu-item,.preview-layout-menu > nav > button,.preview-layout-menu > nav > a) { color:#b1bac2; font-family:var(--font); font-weight:400; }
.supercomputer-page :is(.ap-menu-item,.preview-layout-menu > nav > button,.preview-layout-menu > nav > a):is(:hover,:focus-visible) { color:#eeeef0; background:#ffffff08; }
.supercomputer-page .preview-layout-menu > summary { color:#a1abb3; border-color:#ffffff20; background:#ffffff03; box-shadow:inset 0 1px 0 #ffffff08; }
.supercomputer-page .preview-layout-menu > summary:hover,
.supercomputer-page .preview-layout-menu[open] > summary { color:#eeeef0; border-color:#c6d4de40; background:#ffffff07; }
.supercomputer-page :is(.ap-topic,.ap-carousel-position,.ap-heading-count,.ap-empty p,.ap-working p) { color:#747e87; }
.supercomputer-page .ap-topic:hover { color:#bec8d0; }
.supercomputer-page .ap-topic[aria-selected='true'] { color:#eeeef0; }
.supercomputer-page :is(.ap-topic,.ap-download,.ap-more,.ap-carousel-arrow,.ap-menu-item):focus-visible { outline:1px solid #c0d3de; outline-offset:4px; }
.supercomputer-page .ap-document { color:#b9c2ca; }
.supercomputer-page .ap-document-title { color:#eeeef0; }
@media(prefers-reduced-motion:reduce) {
  .supercomputer-page :is(.ap-download,.ap-retry,.ap-batch-approve) { transition:none; }
}

/* Shared Flow hero: one continuous material through empty -> working -> result. */
.adaptive-preview:has(>.ap-flow:not([hidden])) {padding:0;gap:0;justify-content:stretch;}
.ap-flow {width:100%;flex:1;min-height:0;padding:18px clamp(12px,1.5vw,24px);align-items:stretch;}
.ap-flow[hidden] {display:none!important;}
.ap-flow .flow-hero {width:100%;max-width:none;height:max(360px,calc(100cqh - 52px));flex:1;text-align:center;}
.ap-flow .flow-copy h2 {font-size:clamp(30px,5.6cqw,48px);font-weight:400;letter-spacing:-1.6px;line-height:1.06;color:#f0f3f5;margin:14px 0;}
.ap-flow .flow-copy p {font-size:clamp(12px,1.8cqw,15px);color:#a9b4bc;line-height:1.5;max-width:none;margin:0;}
.ap-flow .flow-kicker {font-size:clamp(7px,1.2cqw,9px);letter-spacing:1.5px;}
.ap-flow .flow-emblem {margin-bottom:22px;}
.ap-flow .flow-activity {position:absolute;bottom:32px;left:18px;right:18px;font-size:11px;line-height:1.6;color:#8899a5;}
.ap-flow .flow-activity[hidden] {display:none;}
.ap-flow .flow-characters {top:24%;}
.ap-flow .flow-script {top:12%;}
.ap-flow .flow-scenes {bottom:5%;}
.ap-flow.is-working .flow-timeline span {animation:flow-production 3.6s ease-in-out infinite;}
@keyframes flow-production {0%,100%{transform:translateX(-20px);opacity:.55}50%{transform:translateX(42px);opacity:1}}
@media(max-width:600px){.ap-flow{padding:12px 0}.ap-flow .flow-hero{height:max(350px,calc(100cqh - 40px))}.ap-flow .flow-copy h2{font-size:clamp(25px,7.5cqw,36px);letter-spacing:-1px}.ap-flow .flow-copy p{font-size:11px}.ap-flow .flow-activity{font-size:10px;bottom:22px}.ap-flow .flow-scenes{bottom:-25px}}
@media(prefers-reduced-motion:reduce){.ap-flow.is-working .flow-timeline span{animation:none}}

/* The stage and its quiet action row sit together in the available room.
   Long documents keep a bounded native scroll area; short content stays centred. */
.adaptive-preview { --ap-pull-offset:0px; --ap-pull-progress:0; }
.ap-stage { flex-shrink:0; }
.ap-stage,.ap-bottom-bar { translate:0 var(--ap-pull-offset); transition:translate 420ms cubic-bezier(.18,.72,.2,1); }
.adaptive-preview.is-pulling .ap-stage,.adaptive-preview.is-pulling .ap-bottom-bar { transition-duration:100ms; }
.ap-pull-hint {
  position:absolute; left:50%; bottom:6px; z-index:5; display:flex; align-items:center;
  gap:9px; max-width:85%; color:#b9c2ca; font-size:11px; line-height:1.4;
  pointer-events:none; opacity:0; translate:-50% 6px;
  transition:opacity 180ms,translate 280ms cubic-bezier(.18,.72,.2,1);
}
.has-topics .ap-pull-hint { margin-left:58px; }
.ap-pull-arrow { display:grid; place-items:center; flex:none; width:26px; height:26px;
  border:1px solid #ffffff25; border-radius:50%; background:#0b0c0e; font-size:15px; }
.adaptive-preview.is-pulling .ap-pull-hint { opacity:calc(.35 + var(--ap-pull-progress)*.65); translate:-50% 0; }
.adaptive-preview[data-pull-direction='up'] .ap-pull-hint { top:5px; bottom:auto; }
@media(max-width:600px){.has-topics .ap-pull-hint{margin-left:34px}.ap-pull-hint{font-size:10px}}
@media(prefers-reduced-motion:reduce){
  .ap-stage,.ap-bottom-bar { translate:none; transition:none; }
  .ap-pull-hint { transition:none; }
}
