/* Layout of the demos around the app's own styles (app-ui.css). */

/* ---- the app's window, as on macOS: rounded, with the drag tab hanging out of it */
.sc.win, .sc .win { position: relative; border-radius: var(--win-radius); background: var(--window); box-shadow: var(--win-shadow, 0 34px 80px rgba(0, 0, 0, .34), 0 0 0 1px rgba(0, 0, 0, .28)); container-type: inline-size; outline: none; }
.sc .topbar { border-radius: var(--win-radius) var(--win-radius) 0 0; }
.sc .statusbar { border-radius: 0 0 var(--win-radius) var(--win-radius); }
.sc .drag-tab { height: 52px; bottom: -22px; }
.sc .drag-tab:hover, .sc .drag-tab:hover:not(:disabled) { background: none; }
.sc .lights { position: absolute; left: 14px; top: 19px; display: flex; gap: 8px; }
.sc .lights i { width: 12px; height: 12px; border-radius: 50%; background: #ff5f57; box-shadow: inset 0 0 0 .5px rgba(0, 0, 0, .2); }
.sc .lights i:nth-child(2) { background: #febc2e; } .sc .lights i:nth-child(3) { background: #28c840; }
.sc .doc-name { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; }
.sc .sb-btn { display: inline-flex; align-items: center; gap: 6px; }
.sc .sb-page-input { display: inline-block; min-width: 18px; }
.sc .adv-only { display: none; gap: 2px; }
.sc.is-advanced .adv-only { display: contents; }
.sc [hidden] { display: none !important; }
.sc svg { flex: none; }
.sc .swatch { flex: none; }
.sc .workspace { min-height: 0; flex: none; position: relative; }
.sc .ctx-dock.empty .ctxbar { visibility: hidden; }

/* ---- main demo: the picture fits the stage; the window's height never changes */
.demo .workspace { height: calc((100cqw - 64px) * .567 + 38px); }
.demo .stage { display: grid; place-items: center; overflow: hidden; }
.demo.is-advanced .stage { padding-top: 42px; }
.demo .paper { position: relative; aspect-ratio: 2400 / 1520; max-width: 100%; max-height: 100%; width: calc((100cqw - 64px) * .895); line-height: 0; user-select: none; -webkit-user-select: none; container-type: normal; }
.demo.is-advanced .paper { width: calc((100cqw - 64px) * .7); }
.demo .paper-img { width: 100%; height: 100%; pointer-events: none; }
.demo .paper-ink { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; overflow: hidden; }
.demo .tool-keys { z-index: 0; max-width: 118px; top: 52px; display: none; }
.demo.is-advanced:not(.has-panel) .tool-keys { display: block; }
@container (max-width: 1000px) { .demo .tool-keys, .demo.is-advanced:not(.has-panel) .tool-keys { display: none; } .sc .stage-band .ctx-btn .lbl { display: none; } }
.ink-pop { animation: ink-pop .24s cubic-bezier(.2, .7, .2, 1) both; transform-box: fill-box; transform-origin: center; }
@keyframes ink-pop { from { opacity: 0; } }
.sc .text-input { position: absolute; z-index: 3; transform: none; line-height: 1.1; border-radius: 3px; outline: none; user-select: text; -webkit-user-select: text; }
.sc .panel-wrap { height: 100%; }
.sc .panel-shell { min-height: 0; }
.sc .panel { flex: 1; min-height: 0; }
.sc .side-list { min-height: 0; }
/* the share sheet opens inside the window */
.sc .sheet-slot { position: absolute; inset: 0; z-index: 30; display: grid; place-items: center; padding: 16px; border-radius: inherit; background: var(--scrim); }
.sc .sheet-slot .sheet { width: min(540px, 100%); max-height: 100%; margin: 0; outline: none; }

/* ---- narrow windows: the tool strip moves under the picture */
@container (max-width: 760px) {
  .sc .lbl { display: none; }
  .sc .topbar { gap: 4px; }
  .sc .sb-dims, .sc .sb-icon { display: none; }
}
@container (max-width: 620px) {
  .sc .topbar .doc-name { display: none; }
  .sc .workspace { height: auto; flex-direction: column; }
  .sc .palette { order: 2; width: 100%; flex-direction: row; justify-content: space-between; gap: 0; padding: 4px 4px 12px; border-right: 0; border-top: 1px solid var(--strip-edge); background: linear-gradient(var(--palette), var(--palette)); position: relative; z-index: 6; }
  .sc .palette .tools { flex-direction: row; gap: 0; }
  .sc .palette .divider { display: none; }
  .sc .palette .tool { width: calc((100cqw - 10px) / 9); max-width: 48px; }
  .sc .palette .tool-wrap { position: static; }
  .sc .palette .pop.flyout { left: 6px; right: auto; top: auto; bottom: calc(100% + 6px); border-radius: 12px; max-width: calc(100% - 12px); padding: 4px 6px; }
  .sc .stage-col { width: 100%; }
  .demo .stage { height: calc(100cqw * .6334 + 8px); padding: 0; }
  .demo.is-advanced .stage { padding-top: 42px; height: calc(100cqw * .6334 + 50px); }
  .demo .paper, .demo.is-advanced .paper { width: 100%; }
  .sc .panel-wrap { position: absolute; right: 0; top: 0; bottom: 0; height: auto; box-shadow: var(--shadow); z-index: 8; }
  .sc .stage-band .band-end span:not(.adv-knob) { display: none; }
  .sc .sb-name { display: none; }
}
@container (max-width: 345px) {
  .sc .lights { display: none; }
  .sc .topbar.traffic-inset { padding-left: 8px; padding-right: 6px; }
}

/* ---- PDF */
.sc.pdfwin { background: var(--canvas); }
.sc .pdf-stage { position: relative; background: var(--canvas); padding: 58px clamp(14px, 4cqw, 30px) 40px; }
.sc .pdf-find { top: 12px; right: 12px; }
.sc .pdf-find input { user-select: text; -webkit-user-select: text; }
.pdf-page {
  position: relative; max-width: 560px; margin: 0 auto; padding: clamp(22px, 5vw, 44px) clamp(18px, 5vw, 46px) 54px;
  background: #fff; color: #1f2430; box-shadow: 0 6px 22px rgba(0, 0, 0, .28); user-select: text; -webkit-user-select: text;
  font: 400 clamp(13px, 1.6vw, 15px)/1.75 Georgia, "Times New Roman", serif;
}
.sc .pdf-page .sheet-title { font: 700 1.6em/1.2 Georgia, "Times New Roman", serif; }
.sheet-meta { font-style: italic; color: #5d6373; margin-bottom: 1.2em; }
.pdf-p { margin-top: .9em; }
.pdf-line { display: block; margin: 0 -4px; padding: 0 4px; border-radius: 3px; cursor: text; }
.pdf-line:hover { background: rgba(240, 50, 110, .09); }
.pdf-line[contenteditable] { background: #fff5f9; outline: 2px solid #f0326e; cursor: text; }
.pdf-line mark { background: #ffe14d; color: inherit; border-radius: 2px; }
@media (max-width: 620px) { .pdf-line { display: inline; margin: 0; padding: 0; } }
.sheet-page { position: absolute; right: 20px; bottom: 16px; font: 400 11px/1 var(--body); color: #757a87; }
.pdf-status { margin-top: 36px; min-height: 1.5em; font-weight: 600; }

/* ---- recording */
.studio { container-type: inline-size; }
.st-desk { position: relative; padding-bottom: 26px; }
.st-screen { position: relative; aspect-ratio: 1200 / 720; border-radius: 14px; overflow: hidden; box-shadow: 0 24px 60px rgba(0, 0, 0, .28), 0 0 0 1px rgba(0, 0, 0, .25); background: #88a; }
.st-scene, .st-ink { position: absolute; inset: 0; width: 100%; height: 100%; }
.st-ink { z-index: 1; touch-action: none; }
.st-desk .st-ink[style*="auto"] { touch-action: none; }
.studio .st-cam { z-index: 2; inset: auto; border-radius: 50%; overflow: hidden; cursor: grab; touch-action: none; display: block; }
.studio .st-cam:active { cursor: grabbing; }
.studio .st-cam.cam-full { z-index: 0; border-radius: 0; }
.st-cam svg { display: block; width: 100%; height: 100%; pointer-events: none; }
.studio .live-frame { z-index: 3; border-radius: 14px; }
.st-barwrap { position: relative; z-index: 4; display: flex; justify-content: center; margin-top: -62px; pointer-events: none; }
.studio .rec-bar { position: static; pointer-events: auto; max-width: 100%; box-shadow: inset 0 0 0 1px var(--pop-border), 0 14px 36px rgba(0, 0, 0, .32); background: var(--pop); }
.studio .rec-bar .rec-tool, .studio .rec-bar .rec-icon { color: var(--text); }
.studio .rec-bar .rec-tool[aria-pressed="true"], .studio .rec-bar .rec-icon[aria-pressed="true"] { color: var(--accent-text); }
.pr-head { animation: pr-nod 4.2s ease-in-out infinite; transform-origin: 50px 72px; }
.pr-mouth { animation: pr-talk .52s ease-in-out infinite alternate; transform-origin: 50px 62px; }
.pr-eyes { animation: pr-blink 4.6s infinite; transform-origin: 50px 48px; }
@keyframes pr-nod { 0%, 100% { transform: rotate(-1.6deg); } 50% { transform: rotate(2deg) translateY(.6px); } }
@keyframes pr-talk { from { transform: scaleY(.35); } to { transform: scaleY(1.25); } }
@keyframes pr-blink { 0%, 96%, 100% { transform: none; } 98% { transform: scaleY(.1); } }
/* the recorded screen follows the theme */
.studio { --sn-wall: #7fa3d9; --sn-hill: #6a8fca; --sn-hill2: #587db8; --sn-win: #fff; --sn-bar: #eceef2; --sn-side: #161b2b; --sn-st: #cdd4e6; --sn-pick: #272f47; --sn-card: #f5f7fb; --sn-t1: #1b2133; --sn-t2: #687086; --sn-menu: #fff; --sn-hover: #e6ebff; --sn-track: #e3e6ee; }
:root[data-theme="dark"] .studio { --sn-wall: #1d2a45; --sn-hill: #24345a; --sn-hill2: #172340; --sn-win: #20232c; --sn-bar: #2a2e39; --sn-side: #14161d; --sn-card: #2a2e39; --sn-t1: #eef1f8; --sn-t2: #9aa3b8; --sn-menu: #333846; --sn-hover: #444c66; --sn-track: #4a5062; }
.sn-wall { fill: var(--sn-wall); } .sn-hill { fill: var(--sn-hill); } .sn-hill2 { fill: var(--sn-hill2); }
.sn-win { fill: var(--sn-win); filter: drop-shadow(0 14px 30px rgba(0, 0, 0, .35)); } .sn-bar { fill: var(--sn-bar); } .sn-url { fill: var(--sn-win); }
.sn-side { fill: var(--sn-side); } .sn-st { fill: var(--sn-st); } .sn-dot { fill: #5b6784; } .sn-pick { fill: var(--sn-pick); }
.sn-card { fill: var(--sn-card); } .sn-t1 { fill: var(--sn-t1); } .sn-t2 { fill: var(--sn-t2); } .sn-track { fill: var(--sn-track); } .sn-pick2 { fill: var(--sn-hover); }
.sn-menu { fill: var(--sn-menu); stroke: rgba(0, 0, 0, .14); filter: drop-shadow(0 6px 14px rgba(0, 0, 0, .25)); }
.st-scene text { font-family: var(--font); }
/* playback, in the app's window */
.st-win .st-stage { display: grid; place-items: center; padding: 0 0 34px; }
.st-win .st-screen { width: 88%; border-radius: 0; box-shadow: 0 4px 18px rgba(0, 0, 0, .35); }
.st-win .workspace { min-height: 0; }
.st-win .media-controls { z-index: 8; bottom: 10px; }
.st-win .mc-seek { min-width: 0; }
@container (max-width: 760px) {
  .st-barwrap { margin-top: 12px; }
  .st-desk { padding-bottom: 0; }
  .studio .rec-row { flex-wrap: wrap; justify-content: center; height: auto; min-height: 44px; padding: 7px 10px; gap: 8px; }
  .studio .rec-toggle span { display: none; }
  .studio .rec-sep { display: none; }
  .studio .rec-tools { gap: 4px; }
  .st-win .st-screen { width: 100%; }
  .st-win .st-stage { padding: 0 0 52px; }
}
@media (prefers-reduced-motion: reduce) { .pr-head, .pr-mouth, .pr-eyes, .ink-pop, .sc .record-dot { animation: none; } }

/* ---- drag-out */
.dragdemo { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px; align-items: stretch; }
.slice-wrap { position: relative; align-self: end; padding-bottom: 22px; }
.sc.slice { background: var(--canvas); overflow: hidden; isolation: isolate; }
.slice-stage { padding: 14px 14px 0; }
.slice-stage img { width: 100%; aspect-ratio: 1.2; object-fit: cover; object-position: 100% 0; border-radius: 2px 2px 0 0; }
.slice .sb-dims, .slice .sb-name { display: none; }
.tab-holder { position: absolute; left: 0; right: 0; bottom: 22px; height: 0; z-index: 2; }
.tab-holder .drag-tab { bottom: -22px; touch-action: none; animation: tug 3.4s ease-in-out infinite; }
.tab-holder .drag-tab:hover, .tab-holder .drag-tab:active { animation: none; }
@keyframes tug { 0%, 70%, 100% { translate: 0 0; } 80% { translate: 0 5px; } 90% { translate: 0 -1px; } }
.chat { position: relative; display: flex; flex-direction: column; min-height: 340px; padding: 16px; border-radius: 16px; background: var(--card); color: var(--fg); box-shadow: 0 18px 46px rgba(0, 0, 0, .24); }
.chat-head { font: 700 1rem/1.2 var(--display); padding-bottom: 12px; border-bottom: 1px solid var(--rule); }
.chat ul { list-style: none; padding: 14px 0; display: grid; gap: 10px; align-content: start; flex: 1; }
.msg { justify-self: start; max-width: 88%; padding: 10px 13px; border-radius: 16px 16px 16px 4px; background: var(--chrome); font-size: .95rem; line-height: 1.4; }
.msg.mine { justify-self: end; padding: 4px; border-radius: 16px 16px 4px; background: #d11f5a; }
.msg.mine img { width: 100%; border-radius: 12px; }
.chat-drop { display: grid; place-items: center; min-height: 64px; border: 2px dashed var(--line); border-radius: 12px; font-weight: 600; color: var(--fg-2); transition: background .15s, border-color .15s; }
.chat.over .chat-drop { border-color: #f0326e; background: rgba(240, 50, 110, .14); color: var(--fg); }
.drag-file { position: fixed; left: 0; top: 0; z-index: 30; width: 132px; padding: 5px; border-radius: 8px; background: #fff; color: #1d1d1f; box-shadow: 0 16px 34px rgba(0, 0, 0, .4); pointer-events: none; font: 600 12px/1.3 var(--body); text-align: center; }
.drag-file img { width: 100%; border-radius: 5px; margin-bottom: 4px; }
@media (max-width: 520px) { .dragdemo { grid-template-columns: 1fr; } .slice-wrap { order: 0; } }
@media (prefers-reduced-motion: reduce) { .tab-holder .drag-tab { animation: none; } }
