/* "Customize presentation": the intro / contact additions on the slides
   and the panel itself (Intro / Slides / Share). Loaded last. The panel is presenter UI (not projected content), so it uses
   ordinary UI sizes; the slides themselves keep the 24px floor. */

/* ---- dock: nothing here shows the audience that a custom presentation is running (no chip, no dot, no coloured gear) ---- */
.deck-stack { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; }

/* ---- additions on the slides (only exist when the presenter filled them in) ---- */
.end-contact { align-self: flex-start; display: inline-flex; align-items: center; gap: 18px; margin-top: 8px; padding: 22px 44px; border-radius: 999px;
  background: #fff; color: var(--brand); font-size: 34px; font-weight: 700; text-decoration: none; box-shadow: 0 24px 50px -22px rgba(0, 20, 70, .6); }
.end-contact::after { content: ""; width: 30px; height: 30px; background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 15 15 5M7 5h8v8'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 15 15 5M7 5h8v8'/%3E%3C/svg%3E") center / contain no-repeat; }
span.end-contact::after { display: none; }

/* ---- the panel ----
   Visual weight, from loud to quiet:  one primary button (Apply & present)  >  the tabs, the preset menu and the Select | Order switch
   >  everything else is text-like (Cancel, Restore order, ghost icon buttons) or appears only when needed (arrows on hover, help behind "?"). */
.studio { position: fixed; inset: 0; z-index: 100; display: none; align-items: center; justify-content: center; padding: 2vh 2vw; box-sizing: border-box;
  background: rgba(7, 20, 58, .62); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  font-family: "Neue Haas Unica Pro", Arial, Helvetica, sans-serif; color: var(--fg); }
.studio.open { display: flex; }
.studio *, .studio *::before, .studio *::after { box-sizing: border-box; }
.studio button, .studio input { font-family: inherit; }
.studio [hidden] { display: none !important; }
.studio :focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.st-dialog:focus { outline: none; }
.st-dialog { width: min(1640px, 100%); height: 100%; max-height: 1000px; display: flex; flex-direction: column; border-radius: 24px; background: var(--bg); overflow: hidden;
  box-shadow: 0 40px 100px -30px rgba(0, 10, 40, .8); }

/* header, tabs, footer */
.st-head { flex: none; display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 24px 36px 0; background: #fff; }
.st-eyebrow { font-size: 12px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: #55648A; }
.st-title { margin: 6px 0 0; font-size: 28px; line-height: 1.1; font-weight: 700; letter-spacing: -.01em; color: var(--brand); }
.st-x { width: 42px; height: 42px; padding: 0; border: 0; border-radius: 50%; background: transparent; color: #55648A; display: grid; place-items: center; cursor: pointer; }
.st-x:hover { background: var(--tint-2); }
.st-x svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; }
.st-tabs { flex: none; display: flex; gap: 34px; padding: 16px 36px 0; background: #fff; border-bottom: 1px solid #E1E8F5; }
.st-tab { padding: 0 2px 13px; border: 0; border-bottom: 3px solid transparent; background: transparent; color: #55648A; font-size: 17px; font-weight: 600; cursor: pointer; margin-bottom: -1px; }
.st-tab:hover { color: var(--brand); }
.st-tab[aria-selected="true"] { color: var(--brand); font-weight: 700; border-bottom-color: var(--accent); }
.st-body { flex: 1 1 auto; min-height: 0; overflow: auto; padding: 24px 36px 30px; }
.st-foot { flex: none; display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 16px 36px; background: #fff; border-top: 1px solid #E1E8F5; }
.st-summary { display: flex; align-items: baseline; flex-wrap: wrap; gap: 6px 10px; }
.st-summary b { font-size: 28px; font-weight: 700; color: var(--brand); letter-spacing: -.01em; }
.st-summary span { font-size: 17px; color: var(--muted); }
.st-summary small { margin-left: 6px; font-size: 14px; color: #7584A8; }
.st-btns { display: flex; align-items: center; gap: 12px; }
.st-btn { display: inline-flex; align-items: center; gap: 10px; padding: 12px 20px; border-radius: 12px; border: 1px solid #B8C6E4; background: #fff; color: var(--brand); font-size: 16px; font-weight: 700; cursor: pointer; white-space: nowrap; }
.st-btn:hover { background: var(--tint-1); }
.st-btn.primary { padding: 13px 26px; background: var(--brand); border-color: var(--brand); color: #fff; font-size: 17px; }
.st-btn.primary:hover { background: #0A3CA0; }
.st-btn.text { border-color: transparent; background: transparent; color: var(--muted); font-weight: 600; }
.st-btn.text:hover { background: var(--tint-2); }
.st-btn.link { padding: 9px 14px; border-color: transparent; background: transparent; color: var(--accent); font-size: 15px; font-weight: 600; }
.st-btn.link:hover { background: var(--tint-2); }
.st-btn:disabled { opacity: .45; cursor: default; }
.st-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }

/* shared bits */
.st-lead { margin: 0 0 20px; max-width: 900px; font-size: 16px; line-height: 1.5; color: #55648A; }
.st-card { background: #fff; border: 1px solid #E8EDF7; border-radius: 18px; }
.st-label { display: block; margin-bottom: 8px; font-size: 15px; font-weight: 700; color: var(--brand); }
.st-hint { margin: 8px 0 0; font-size: 14px; line-height: 1.45; color: #7584A8; }
.st-input { width: 100%; padding: 13px 15px; border-radius: 12px; border: 1px solid #B8C6E4; background: #fff; color: var(--fg); font: inherit; font-size: 16px; }
.st-input::placeholder { color: #8795B5; }
.st-input.bad { border-color: #D2541F; }
.st-mono { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 14px; }
.st-pill { display: inline-block; padding: 5px 12px; border-radius: 999px; font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; background: #E3EAF8; color: var(--brand); }
.st-pill.warn { background: #FFF6D6; color: #4A3A00; }
.st-pill.ok { background: #E3F4E9; color: #14532D; }
.st-msg { margin: 8px 0 0; font-size: 14px; font-weight: 600; line-height: 1.4; }
.st-msg.bad { color: #9A3412; } .st-msg.good { color: #14532D; } .st-msg.muted { color: #7584A8; font-weight: 400; }

/* tab: Intro */
.st-intro { display: flex; gap: 32px; align-items: flex-start; }
.st-form { flex: none; width: 520px; max-width: 100%; display: flex; flex-direction: column; gap: 22px; padding: 26px; }
.st-row2 { display: flex; gap: 12px; }
.st-previews { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 14px; }
/* tighter form when the window is low (see fitIntro in studio-ui.js): hints go first, then the lead sentence */
.st-introwrap.compact .st-form .st-hint { display: none; }
.st-introwrap.compact .st-form { gap: 14px; padding: 20px 24px; }
.st-introwrap.compact .st-label { margin-bottom: 6px; }
.st-introwrap.compact .st-input { padding: 10px 14px; font-size: 15px; }
.st-introwrap.tight .st-lead { display: none; }
.st-introwrap.tight .st-form { gap: 10px; padding: 14px 20px; }
.st-introwrap.tight .st-input { padding: 8px 12px; }
.st-introwrap.tight .st-label { margin-bottom: 4px; font-size: 14px; }
.st-pv-label { margin-bottom: 8px; font-size: 12px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: #7584A8; }
.st-pv { position: relative; width: 100%; aspect-ratio: 16 / 9; border-radius: 16px; overflow: hidden; background: var(--shade-letterbox); box-shadow: 0 16px 40px -22px rgba(0, 20, 70, .6); }
.st-pv .reveal { position: absolute; left: 0; top: 0; width: 1920px; height: 1080px; transform-origin: 0 0; overflow: hidden; }
.st-pv .reveal .slides { position: absolute; inset: 0; width: 1920px; height: 1080px; transform: none !important; }
.st-pv .reveal .slides > section { display: flex; position: absolute; left: 0; top: 0; width: 1920px; height: 1080px; }

/* tab: Slides - toolbar */
.st-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px 28px; margin-bottom: 14px; }
.st-bar-l, .st-bar-r { display: flex; align-items: center; gap: 12px; }
.st-cap { font-size: 14px; color: #55648A; }
.st-menuwrap { position: relative; }
.st-select { display: inline-flex; align-items: center; gap: 10px; padding: 10px 14px 10px 18px; border-radius: 12px; border: 1px solid #B8C6E4; background: #fff; color: var(--brand); font-size: 16px; font-weight: 600; cursor: pointer; }
.st-select:hover { border-color: #8FA6D6; }
.st-select b { font-size: 14px; font-weight: 700; color: #55648A; }
.st-select svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.st-menu { position: absolute; left: 0; top: calc(100% + 8px); z-index: 6; width: 340px; padding: 8px; border-radius: 14px; background: #fff; border: 1px solid #D9E1F2; box-shadow: 0 24px 48px -20px rgba(0, 30, 90, .35); }
.st-opt-item { width: 100%; display: flex; align-items: center; gap: 12px; padding: 11px 12px; border: 0; border-radius: 10px; background: transparent; color: var(--fg); font-size: 16px; font-weight: 500; text-align: left; cursor: pointer; }
.st-opt-item:hover { background: var(--bg); }
.st-opt-item[aria-checked="true"] { font-weight: 700; }
.st-opt-item .tick { width: 18px; color: var(--accent); }
.st-opt-item .tick svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.st-opt-item .grow { flex: 1 1 auto; }
.st-opt-item small { font-size: 14px; color: #55648A; }
.st-modehint { margin: 0; max-width: 760px; text-align: right; font-size: 15px; line-height: 1.5; color: #55648A; }
.st-note { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; padding: 11px 16px; border-radius: 12px; background: #FFF6D6; color: #5A4500; font-size: 15px; }
.st-note svg { flex: none; width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }

/* tab: Slides - chapters and tiles */
.st-check { flex: none; width: 26px; height: 26px; padding: 0; display: grid; place-items: center; border-radius: 7px; border: 2px solid #9FB0D3; background: #fff; color: #fff; cursor: pointer; }
.st-check svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 3.4; stroke-linecap: round; stroke-linejoin: round; }
.st-check[data-state="all"], .st-check[data-state="some"] { background: var(--accent); border-color: var(--accent); }
.st-check[data-state="none"] svg { display: none; }
.st-ghost { width: 32px; height: 32px; padding: 0; display: grid; place-items: center; border: 0; border-radius: 8px; background: transparent; color: var(--brand); cursor: pointer; }
.st-ghost:hover { background: var(--tint-2); }
.st-ghost:disabled { opacity: .3; cursor: default; background: transparent; }
.st-ghost svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.st-tile { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.st-tw { position: relative; }
.st-tilebtn { display: block; width: 100%; margin: 0; padding: 0; border: 0; background: transparent; cursor: pointer; color: inherit; }
.st-thumb { position: relative; width: 100%; aspect-ratio: 16 / 9; border-radius: 10px; overflow: hidden; border: 2px solid var(--accent); background: var(--tint-2); transition: opacity .15s ease, filter .15s ease; }
.st-thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
.st-tile.off .st-thumb { opacity: .42; filter: grayscale(.7); border-color: var(--card-line); }
.st-tile.off .st-ttl { color: #55648A; }
.st-dot { position: absolute; right: 7px; top: 7px; width: 22px; height: 22px; display: grid; place-items: center; border-radius: 50%; border: 2px solid var(--accent); background: var(--accent); color: #fff; pointer-events: none; }
.st-dot svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 3.6; stroke-linecap: round; stroke-linejoin: round; }
.st-tile.off .st-dot { background: #fff; border-color: #9FB0D3; }
.st-tile.off .st-dot svg { display: none; }
.st-ttl { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; font-size: 13px; line-height: 1.3; font-weight: 600; }
.st-ttl b { margin-right: 6px; font-weight: 700; color: var(--accent); font-variant-numeric: tabular-nums; }

/* tab: Share */
.st-sharetop { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 12px 24px; margin-bottom: 20px; }
.st-sharetop .st-lead { margin: 0; }
.st-sum { display: flex; flex-wrap: wrap; gap: 8px; }
.st-sum .chip { padding: 6px 13px; border-radius: 999px; background: #E3EAF8; color: var(--brand); font-size: 14px; font-weight: 600; }
.st-choices { display: flex; gap: 20px; flex-wrap: wrap; margin-bottom: 20px; }
.st-choice { flex: 1 1 420px; display: flex; flex-direction: column; gap: 8px; padding: 20px 24px; border-radius: 16px; border: 2px solid #D9E1F2; background: #fff; color: inherit; text-align: left; cursor: pointer; }
.st-choice:hover { border-color: #8FA6D6; }
.st-choice[aria-checked="true"] { border-color: var(--accent); }
.st-choice-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.st-choice-head strong { font-size: 22px; font-weight: 700; color: var(--brand); }
.st-choice p { margin: 0; font-size: 16px; line-height: 1.5; color: var(--muted); }
.st-opt { padding: 26px 28px; display: flex; flex-direction: column; gap: 18px; }
.st-opt-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.st-opt h3 { margin: 0; font-size: 20px; font-weight: 700; color: var(--brand); }
.st-url { padding: 14px 16px; border-radius: 12px; background: #0C1F4C; color: #fff; word-break: break-all; line-height: 1.55; max-height: 190px; overflow: auto; }
.st-row { display: flex; align-items: center; flex-wrap: wrap; gap: 16px; }
.st-fine { margin: 0; font-size: 14px; color: #7584A8; line-height: 1.45; }
.st-two { display: flex; gap: 24px; align-items: flex-start; flex-wrap: wrap; }
.st-two > div { flex: 1 1 300px; min-width: 0; }
.st-two > div:first-child { flex-grow: 1.3; }
.st-prefix { display: flex; align-items: stretch; border: 1px solid #B8C6E4; border-radius: 12px; background: #fff; overflow: hidden; }
.st-prefix.bad { border-color: #D2541F; } .st-prefix.good { border-color: #2F8F57; }
.st-prefix span { display: flex; align-items: center; padding: 0 12px; background: var(--bg); color: #55648A; white-space: nowrap; max-width: 55%; overflow: hidden; text-overflow: ellipsis; }
.st-prefix input { flex: 1 1 0; min-width: 0; padding: 13px 15px; border: 0; outline: 0; background: transparent; font: inherit; font-size: 16px; color: var(--fg); }
.st-done { padding: 18px 20px; border-radius: 14px; background: #E8F5EC; display: flex; flex-direction: column; gap: 12px; color: #14532D; }
.st-done .st-url { background: #fff; color: var(--fg); }

.st-toast { position: fixed; left: 50%; bottom: 36px; transform: translateX(-50%); z-index: 120; display: none; align-items: center; gap: 12px; padding: 15px 26px; border-radius: 999px; background: var(--brand); color: #fff;
  font-family: "Neue Haas Unica Pro", Arial, Helvetica, sans-serif; font-size: 18px; font-weight: 500; box-shadow: 0 18px 40px -14px rgba(0, 30, 90, .6); }
.st-toast.show { display: inline-flex; }
.st-toast::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--hl); }

@media (prefers-reduced-motion: reduce) { .deck-chip, .st-thumb, .st-mv { transition: none; } }
@media print { .studio, .deck-chip, .st-toast { display: none !important; } }

/* views and the drag-and-drop grid */
.st-head-r { display: flex; align-items: center; gap: 12px; }
.st-viewbar { display: flex; align-items: center; gap: 10px; }
.st-select-cap { font-size: 13px; font-weight: 600; color: #7584A8; }
.st-select-val { max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.st-menu.right { left: auto; right: 0; }
.st-menu.save { width: 390px; display: flex; flex-direction: column; gap: 10px; padding: 16px; }
.st-menu.save .st-label { margin: 0; }
.st-vrow { display: flex; align-items: center; }
.st-vrow .st-opt-item { flex: 1 1 auto; min-width: 0; }
.st-vrow .st-ghost { width: 30px; height: 30px; opacity: .5; }
.st-vrow:hover .st-ghost, .st-vrow .st-ghost:focus-visible { opacity: 1; }
.st-opt-item .eb { color: #7584A8; font-weight: 600; }
.st-opt-item .st-check { width: 22px; height: 22px; border-radius: 6px; flex: none; cursor: inherit; }
.st-opt-item .st-check svg { width: 13px; height: 13px; }
.st-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(176px, 1fr)); gap: 22px 16px; }
.st-tile { position: relative; cursor: grab; }
.st-tile.dragging { opacity: .35; }
.st-tile.drop-before::before, .st-tile.drop-after::after { content: ""; position: absolute; top: 0; bottom: 0; width: 4px; border-radius: 2px; background: var(--accent); z-index: 2; }
.st-tile.drop-before::before { left: -10px; }
.st-tile.drop-after::after { right: -10px; }

/* QR code on the last slide (made by js/studio-core.js from the contact link or the chosen link) */
.end-qr { position: absolute; right: var(--px); top: 50%; transform: translateY(-50%); width: 420px; box-sizing: border-box; padding: 28px 28px 24px; border-radius: 32px; background: #fff; box-shadow: 0 40px 80px -30px rgba(3, 12, 40, .7); display: flex; flex-direction: column; align-items: center; gap: 14px; }
.end-qr svg { display: block; width: 364px; height: 364px; }
.end-qr span { font-size: 24px; line-height: 1.2; font-weight: 700; color: #003087; text-align: center; overflow-wrap: anywhere; }

/* Intro: QR select; Share: how a short link opens */
.studio select.st-select { appearance: auto; padding-right: 8px; }
.studio .st-seg { display: inline-flex; align-self: flex-start; padding: 4px; border-radius: 999px; background: #E6EDFA; }
.studio .st-seg button { min-height: 40px; padding: 0 20px; border: 0; border-radius: 999px; background: transparent; color: #394B75; font: 700 14px/1 inherit; font-family: inherit; cursor: pointer; }
.studio .st-seg button[aria-pressed="true"] { background: #003087; color: #fff; }

/* ---- 2026-11-27: the Share tab is one button: Create link -> the short link is copied to the clipboard and shown ---- */
.studio .st-share { display: flex; flex-direction: column; align-items: center; gap: 22px; padding: 56px 28px 40px; max-width: 760px; margin: 0 auto; }
.studio .st-make { display: inline-flex; align-items: center; justify-content: center; gap: 14px; min-width: 340px; min-height: 76px; padding: 0 44px; border-radius: 38px; font-size: 26px; }
.studio .st-make svg { width: 30px; height: 30px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.studio .st-make.busy { opacity: .6; cursor: progress; }
.studio .st-keyin { width: 340px; max-width: 100%; text-align: center; }
.studio .st-share .st-msg { margin: 0; text-align: center; }
.studio .st-result { width: 100%; display: flex; flex-direction: column; align-items: center; gap: 14px; }
.studio .st-copied { display: inline-flex; align-items: center; gap: 8px; font-size: 18px; font-weight: 700; color: #14532D; }
.studio .st-copied svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.studio .st-urlrow { width: 100%; display: flex; align-items: center; gap: 10px; }
.studio .st-urlbox { flex: 1 1 auto; min-width: 0; padding: 16px 18px; border: 1px solid #B8C6E4; border-radius: 14px; background: #fff; color: #0C1F4C; font: 600 22px/1.2 ui-monospace, Consolas, monospace; outline: none; }
.studio .st-urlbox:focus { border-color: #003087; box-shadow: 0 0 0 3px rgba(0, 48, 135, .18); }
.studio .st-urlrow .st-btn { display: inline-flex; align-items: center; gap: 8px; flex: none; }
.studio .st-urlrow .st-btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
