/* Worship Studio — worship.trubible.com ("Daylight", TINL-1312 second pass; first built in TINL-1307).
   Plain on purpose: white paper, ink type, hairlines, no gradients. The slides are the colour.
   Light by day, dark by choice; the presenter and the output screen are always dark, because
   that is where the room's eyes are.

   Colours come from /css/tokens.css (loaded first). The --wp-* names below map the studio's
   own vocabulary onto those tokens, so every rule here follows the theme. They are declared on
   [data-theme] containers too: the presenter carries data-theme="dark" inside a light page.

   Sections: tokens · base · buttons · top bar · landing · home · editor · look panel · modals ·
   presenter · slide renderer (wpr-*, never restyled: slides are people's own content) ·
   responsive · reduced motion. */

:root, [data-theme="light"], [data-theme="dark"] {
  --wp-bg: var(--bg-page);
  --wp-bg-2: var(--bg-subtle);
  --wp-panel: var(--bg-card);          /* cards and buttons */
  --wp-panel-2: var(--bg-hover);       /* hover, pressed */
  --wp-float: var(--bg-elevated);      /* menus, dialogs, toasts */
  --wp-field: var(--bg-card);          /* inputs */
  --wp-well: var(--bg-hover);          /* sunken areas: segmented controls, drop zones */
  --wp-side: var(--bg-subtle);         /* the editor's side columns */
  --wp-glass: var(--glass);
  --wp-line: var(--border);
  --wp-line-2: var(--border-strong);
  --wp-text: var(--text);
  --wp-muted: var(--text-muted);
  --wp-faint: var(--text-light);
  --wp-accent: var(--primary);
  --wp-accent-rgb: var(--primary-rgb);
  --wp-gold: var(--dawn);
  --wp-gold-ink: var(--dawn-ink);
  --wp-grad: var(--grad-brand);
  --wp-grad-soft: var(--grad-brand-soft);
  --wp-danger: var(--danger);
  --wp-ok: var(--success);
  --wp-radius: 16px;
  --wp-ease: cubic-bezier(.2, .8, .2, 1);
  --wp-shadow: var(--shadow-lg);
  --wp-display: var(--font-body);
}
/* Night keeps the glass of a dark booth */
[data-theme="dark"] {
  --wp-panel: rgba(255, 255, 255, 0.05);
  --wp-panel-2: rgba(255, 255, 255, 0.09);
  --wp-field: rgba(0, 0, 0, 0.28);
  --wp-well: rgba(0, 0, 0, 0.3);
  --wp-side: rgba(0, 0, 0, 0.2);
}

/* ---------- Base ---------- */
* { box-sizing: border-box; }
html, body { height: 100%; }
body.wp {
  margin: 0; min-height: 100%; color: var(--wp-text);
  background: var(--wp-bg);
  font: 400 15px/1.5 Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}
.wp h1, .wp h2 { font-family: var(--wp-display); font-weight: 700; letter-spacing: -0.035em; margin: 0; }
.wp h3 { font-family: Inter, system-ui, sans-serif; font-weight: 650; letter-spacing: -0.015em; margin: 0; }
:lang(ko) .wp :is(h1, h2), :lang(zh) .wp :is(h1, h2) { font-weight: 700; }
/* Korean breaks lines between words, never inside one. Studio chrome only: slides are people's own content and
   must wrap exactly as they always did on every screen, so the renderer's box is set back to the defaults
   (measured with untracked/redesign/slide-diff.js ko). */
:lang(ko) .wp { word-break: keep-all; overflow-wrap: break-word; }
:lang(ko) .wp .wpr-box { word-break: normal; overflow-wrap: normal; }
.wp a { color: inherit; }
.wp [hidden] { display: none !important; }
.wp-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.wp :focus-visible { outline: 3px solid rgba(var(--wp-accent-rgb), 0.85); outline-offset: 2px; border-radius: 10px; }
.wp-skip { position: absolute; left: 12px; top: -60px; z-index: 100; padding: 10px 14px; border-radius: 10px; background: #fff; color: #111; font-weight: 700; }
.wp-skip:focus { top: 12px; }

/* The theme switch opens the new theme in a circle from the button (theme.js) */
html.tb-theme-switching::view-transition-old(root) { animation: none; z-index: 1; }
html.tb-theme-switching::view-transition-new(root) { animation: wp-theme-open 640ms var(--wp-ease) both; z-index: 2; }
@keyframes wp-theme-open {
  from { clip-path: circle(0 at var(--tb-vt-x, 100%) var(--tb-vt-y, 0)); }
  to   { clip-path: circle(var(--tb-vt-r, 150vmax) at var(--tb-vt-x, 100%) var(--tb-vt-y, 0)); }
}

/* ---------- Buttons & inputs ---------- */
.wp-btn {
  position: relative; overflow: hidden;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; padding: 0 18px;
  border-radius: 999px; border: 1px solid var(--wp-line-2); background: var(--wp-panel); color: var(--wp-text);
  font: 600 0.92rem/1 Inter, system-ui, sans-serif; cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: transform 160ms var(--wp-ease), background 160ms ease, border-color 160ms ease, box-shadow 220ms ease;
}
.wp-btn:hover { background: var(--wp-panel-2); border-color: var(--wp-line-2); }
.wp-btn:active { transform: translateY(0) scale(0.97); }
.wp-btn svg { width: 18px; height: 18px; flex: none; }
/* The one action that matters on a screen: solid ink (white in the dark booth) */
.wp-btn-primary { border-color: transparent; background: var(--brand); color: var(--on-brand); }
.wp-btn-primary:hover { background: var(--brand-hover); border-color: transparent; }
.wp-btn-ghost { border-color: transparent; background: transparent; }
.wp-btn-danger { color: var(--wp-danger); }
.wp-btn-lg { min-height: 50px; padding: 0 24px; font-size: 1rem; }
.wp-btn-icon { width: 42px; padding: 0; }
.wp-btn[disabled] { opacity: 0.5; cursor: default; transform: none; }

.wp-input, .wp-select, .wp-textarea {
  width: 100%; min-height: 42px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--wp-line-2);
  background: var(--wp-field); color: var(--wp-text); font: 500 0.95rem/1.4 Inter, system-ui, sans-serif;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}
.wp-input::placeholder, .wp-textarea::placeholder { color: var(--wp-faint); }
.wp-select { padding-right: 30px; }
.wp-select option, .wp-select optgroup { background: var(--wp-float); color: var(--wp-text); }
.wp-input:focus, .wp-select:focus, .wp-textarea:focus { outline: none; border-color: var(--wp-accent); box-shadow: 0 0 0 4px rgba(var(--wp-accent-rgb), 0.2); }
.wp-textarea { min-height: 220px; resize: vertical; font: 400 0.98rem/1.6 Inter, system-ui, sans-serif; }
.wp h2.wp-label, .wp h3.wp-label { font: 600 0.75rem/1.2 Inter, sans-serif; letter-spacing: 0.08em; }
.wp-label { display: block; margin: 0 0 6px; font: 600 0.75rem/1.2 Inter, sans-serif; letter-spacing: 0.08em; text-transform: uppercase; color: var(--wp-faint); }
.wp-field { margin-bottom: 14px; }
.wp-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.wp-seg { display: inline-flex; padding: 3px; border-radius: 12px; background: var(--wp-well); border: 1px solid var(--wp-line); }
.wp-seg button { min-height: 34px; padding: 0 12px; border: 0; border-radius: 9px; background: transparent; color: var(--wp-muted); font: 600 0.85rem/1 Inter, sans-serif; cursor: pointer; transition: background 150ms ease, color 150ms ease, box-shadow 150ms ease; }
.wp-seg button[aria-pressed="true"] { background: var(--wp-float); color: var(--wp-text); box-shadow: var(--shadow-xs); }

/* Theme switch (Dawn / Night): the sun sets and the moon rises in the same round button */
.wp-theme-btn {
  position: relative; flex: none; width: 40px; height: 40px; display: inline-grid; place-items: center;
  border: 1px solid var(--wp-line-2); border-radius: 50%; background: transparent; color: var(--wp-text);
  cursor: pointer; overflow: hidden; transition: border-color 200ms ease, box-shadow 200ms ease, transform 140ms var(--wp-ease);
}
.wp-theme-btn:hover { background: var(--wp-panel-2); }
.wp-theme-btn:active { transform: scale(0.94); }
.wp-theme-btn svg { grid-area: 1 / 1; width: 18px; height: 18px; transition: transform 460ms cubic-bezier(0.34, 1.56, 0.64, 1), opacity 240ms ease; }
.wp-theme-btn .moon { opacity: 0; transform: translateY(120%) rotate(-60deg); }
[data-theme="dark"] .wp-theme-btn .sun { opacity: 0; transform: translateY(-120%) rotate(60deg); }
[data-theme="dark"] .wp-theme-btn .moon { opacity: 1; transform: none; }

/* ---------- Top bar: plain, with a hairline ---------- */
.wp-top {
  position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 14px; height: 64px; padding: 0 20px;
  background: var(--wp-glass); -webkit-backdrop-filter: saturate(160%) blur(16px); backdrop-filter: saturate(160%) blur(16px);
  border-bottom: 1px solid var(--wp-line);
}
.wp-brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font: 700 1.05rem/1 var(--font-brand); letter-spacing: -0.03em; white-space: nowrap; }
.wp-brand-mark { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; background: var(--solid); transition: transform 460ms cubic-bezier(0.34, 1.56, 0.64, 1); }
.wp-brand:hover .wp-brand-mark { transform: rotate(-8deg) scale(1.06); }
.wp-brand-mark svg { width: 17px; height: 17px; color: var(--on-solid); }
.wp-brand small { font: 600 0.72rem/1 Inter, sans-serif; color: var(--wp-muted); letter-spacing: 0.04em; }
.wp-top-title { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; }
.wp-title-input { max-width: 420px; background: transparent; border-color: transparent; font: 650 1.05rem/1.2 var(--wp-display); letter-spacing: -0.02em; padding: 8px 10px; }
.wp-title-input:hover { border-color: var(--wp-line); }
.wp-save { font: 500 0.8rem/1 Inter, sans-serif; color: var(--wp-faint); white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; }
.wp-save::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--wp-ok); }
.wp-save.saving::before { background: #c8c8c8; animation: wp-blink 1s ease infinite; }
.wp-save.error::before { background: var(--wp-danger); }
@keyframes wp-blink { 50% { opacity: 0.3; } }
.wp-top-actions { display: flex; align-items: center; gap: 8px; }
.wp-avatar { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--wp-panel-2); border: 1px solid var(--wp-line); color: var(--wp-text); font: 700 0.82rem/1 Inter, sans-serif; cursor: pointer; transition: transform 160ms var(--wp-ease); }
.wp-avatar:hover { transform: scale(1.06); }

.wp-sky { display: none; }

/* ---------- Landing ---------- */
.wp-landing { min-height: 100vh; display: flex; flex-direction: column; }
.wp-hero { position: relative; isolation: isolate; display: flex; flex-direction: column; overflow: hidden; }
.wp-landing-nav { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px clamp(16px, 4vw, 48px); max-width: 1320px; width: 100%; margin: 0 auto; }
.wp-hero-grid {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: clamp(28px, 4vw, 64px); align-items: center;
  max-width: 1320px; width: 100%; margin: 0 auto; padding: clamp(36px, 6vw, 84px) clamp(16px, 4vw, 48px) clamp(64px, 8vw, 112px);
}
.wp-hero-copy { min-width: 0; }
.wp-eyebrow { display: inline-flex; align-items: center; gap: 8px; padding: 6px 13px; border-radius: 999px; background: var(--wp-well); border: 1px solid var(--wp-line); color: var(--wp-muted); font: 500 0.84rem/1 Inter, sans-serif; }
.wp-eyebrow i { width: 7px; height: 7px; border-radius: 50%; background: var(--wp-text); }
.wp-hero h1 { margin: 20px 0 16px; font-size: clamp(2.5rem, 1.2rem + 3.8vw, 4.2rem); line-height: 1.02; letter-spacing: -0.045em; text-wrap: balance; }
/* "not hours." — the one phrase set in the italic serif, same ink */
.wp-grad-text { font-family: var(--font-accent); font-style: italic; font-weight: 500; letter-spacing: -0.03em; }
:lang(ko) .wp-grad-text, :lang(zh) .wp-grad-text { font-style: normal; font-weight: 700; }
.wp-hero p.lead { max-width: 560px; margin: 0 0 28px; font-size: clamp(1.02rem, 0.9rem + 0.5vw, 1.22rem); line-height: 1.55; color: var(--wp-muted); }
.wp-hero-cta { display: flex; gap: 12px; flex-wrap: wrap; }
.wp-rise { opacity: 0; transform: translateY(18px); animation: wp-rise 800ms var(--wp-ease) forwards; }
.wp-rise.d1 { animation-delay: 120ms; } .wp-rise.d2 { animation-delay: 240ms; } .wp-rise.d3 { animation-delay: 360ms; } .wp-rise.d4 { animation-delay: 480ms; }
@keyframes wp-rise { to { opacity: 1; transform: none; } }

/* The screen: the real slide renderer, playing, in a frame that hangs at a slight angle */
.wp-hero-stage { position: relative; min-width: 0; perspective: 1600px; }
.wp-screen {
  position: relative; padding: 10px; border-radius: 28px;
  background: var(--wp-well); border: 1px solid var(--wp-line);
  box-shadow: var(--shadow-xl);
  transform: rotateY(-8deg) rotateX(3deg);
  animation: wp-hang 8s ease-in-out infinite alternate;
}
@keyframes wp-hang { from { transform: rotateY(-8deg) rotateX(3deg) translateY(0); } to { transform: rotateY(-5deg) rotateX(1.5deg) translateY(-10px); } }
.wp-showcase-stage { aspect-ratio: 16 / 9; border-radius: 20px; overflow: hidden; }

.wp-features { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; padding: 0 clamp(16px, 4vw, 48px); margin: 8px auto 0; max-width: 1320px; width: 100%; position: relative; }
.wp-feature { position: relative; padding: 26px; border-radius: 28px; background: var(--wp-well); border: 1px solid var(--border-light); overflow: hidden; transition: transform 320ms var(--wp-ease), background 250ms ease; }
.wp-feature:hover { transform: translateY(-4px); background: var(--wp-panel-2); }
.wp-feature-icon { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; background: var(--solid); margin-bottom: 16px; transition: transform 460ms cubic-bezier(0.34, 1.56, 0.64, 1); }
.wp-feature:hover .wp-feature-icon { transform: rotate(-6deg) scale(1.08); }
.wp-feature-icon svg { color: var(--on-solid); width: 21px; height: 21px; }
.wp-feature h3 { font-size: 1.14rem; margin-bottom: 6px; }
.wp-feature p { margin: 0; color: var(--wp-muted); font-size: 0.96rem; }

.wp-showcase { max-width: 1320px; width: 100%; margin: clamp(48px, 7vw, 88px) auto 0; padding: 0 clamp(16px, 4vw, 48px) clamp(56px, 7vw, 88px); display: grid; grid-template-columns: 1.15fr 1fr; gap: clamp(28px, 4vw, 56px); align-items: center; }
.wp-showcase-photo { position: relative; aspect-ratio: 16 / 10; border-radius: 30px; overflow: hidden; background: #0d0d0d url("/worship/img/hero.webp") center / cover no-repeat; }
.wp-showcase-photo::after { content: none; }
.wp-showcase h2 { font-size: clamp(1.8rem, 1.2rem + 2vw, 2.8rem); line-height: 1.08; margin-bottom: 12px; text-wrap: balance; }
.wp-steps { list-style: none; padding: 0; margin: 22px 0 0; display: grid; gap: 14px; }
.wp-steps li { display: flex; gap: 14px; align-items: flex-start; color: var(--wp-muted); font-size: 1.02rem; }
.wp-steps b { flex: none; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--solid); color: var(--on-solid); font: 700 0.9rem/1 Inter, sans-serif; }
.wp-landing-foot { margin-top: auto; padding: 24px clamp(16px, 4vw, 48px); border-top: 1px solid var(--wp-line); color: var(--wp-faint); font-size: 0.85rem; display: flex; gap: 16px; flex-wrap: wrap; justify-content: space-between; }

/* ---------- Home (signed in) ---------- */
.wp-home { max-width: 1280px; margin: 0 auto; padding: 36px clamp(16px, 3vw, 32px) 80px; }
/* The greeting: plain and large, with the four quick actions under it */
.wp-home-hero { margin-bottom: 36px; color: var(--wp-text); }
.wp-greet { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: clamp(18px, 3vw, 28px); }
.wp-greet h1 { font-size: clamp(2.1rem, 1.3rem + 3vw, 3.5rem); line-height: 1.02; letter-spacing: -0.045em; }
.wp-greet p { margin: 8px 0 0; color: var(--wp-muted); font-size: 1.08rem; }
.wp-quick { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.wp-quick-card {
  position: relative; display: flex; flex-direction: column; gap: 10px; min-height: 132px; padding: 18px; border-radius: 22px; cursor: pointer;
  border: 1px solid var(--border-light); background: var(--wp-well);
  color: var(--wp-text); text-align: left; overflow: hidden; font: inherit;
  transition: transform 320ms var(--wp-ease), background 220ms ease;
}
.wp-quick-card:hover { transform: translateY(-3px); background: var(--wp-panel-2); }
.wp-quick-card .ic { width: 42px; height: 42px; border-radius: 13px; display: grid; place-items: center; background: var(--wp-panel); border: 1px solid var(--wp-line); color: var(--wp-text); transition: transform 460ms cubic-bezier(0.34, 1.56, 0.64, 1); }
.wp-quick-card:hover .ic { transform: rotate(-6deg) scale(1.08); }
.wp-quick-card .ic svg { width: 20px; height: 20px; }
/* New service: the main action, solid ink */
.wp-quick-card.primary { background: var(--brand); border-color: transparent; color: var(--on-brand); }
.wp-quick-card.primary:hover { background: var(--brand-hover); }
.wp-quick-card.primary .ic { background: color-mix(in srgb, var(--on-brand) 16%, transparent); border-color: transparent; color: var(--on-brand); }
.wp-quick-card b { font: 650 1.04rem/1.2 Inter, sans-serif; letter-spacing: -0.01em; }
.wp-quick-card span { color: var(--wp-muted); font-size: 0.87rem; }
.wp-quick-card.primary span { color: color-mix(in srgb, var(--on-brand) 90%, transparent); }   /* 90%: 5.2:1 on the accent (78% was 4.3:1) */
.wp-section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 0 14px; }
.wp-section-head h2 { font-size: 1.35rem; letter-spacing: -0.03em; }
.wp-services { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; margin-bottom: 40px; }
.wp-service-card { border-radius: 22px; overflow: hidden; border: 1px solid var(--wp-line); background: var(--wp-panel); box-shadow: var(--shadow-sm); cursor: pointer; transition: transform 320ms var(--wp-ease), border-color 220ms ease, box-shadow 320ms var(--wp-ease); text-align: left; color: inherit; padding: 0; font: inherit; }
.wp-service-card:hover { transform: translateY(-5px); border-color: rgba(var(--wp-accent-rgb), 0.5); box-shadow: var(--wp-shadow); }
.wp-service-cover { aspect-ratio: 16 / 9; background: var(--wp-grad-soft) center / cover no-repeat; position: relative; }
.wp-service-cover::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 40%, rgba(0, 0, 0, 0.55)); }
.wp-service-meta { padding: 12px 14px 14px; }
.wp-service-meta b { display: block; font: 650 1rem/1.3 Inter, sans-serif; letter-spacing: -0.01em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wp-service-meta span { color: var(--wp-faint); font-size: 0.83rem; }
.wp-empty { padding: 34px 20px; border-radius: 22px; border: 1px dashed var(--wp-line-2); text-align: center; color: var(--wp-muted); }
.wp-list { display: grid; gap: 8px; }
.wp-list-row { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 14px; border: 1px solid var(--wp-line); background: var(--wp-panel); }
.wp-list-row b { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wp-list-row small { color: var(--wp-faint); }
.wp-two { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; }

/* ---------- Editor ---------- */
.wp-editor { display: grid; grid-template-columns: 290px minmax(0, 1fr) 320px; height: calc(100vh - 64px); }
.wp-col { min-height: 0; overflow-y: auto; }
.wp-order { border-right: 1px solid var(--wp-line); padding: 16px 12px; background: var(--wp-side); }
.wp-order-list { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 6px; }
.wp-order-item {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px; border-radius: 12px; cursor: pointer; border: 1px solid transparent;
  background: transparent; color: var(--wp-text); text-align: left; font: inherit; transition: background 150ms ease, border-color 150ms ease, transform 150ms ease;
}
.wp-order-item:hover { background: var(--wp-panel); }
.wp-order-item[aria-current="true"] { background: var(--wp-panel-2); border-color: rgba(var(--wp-accent-rgb), 0.55); }
.wp-order-item.dragging { opacity: 0.4; }
.wp-order-item.drop-before { box-shadow: 0 -2px 0 var(--wp-accent); }
.wp-order-item .kind { width: 32px; height: 32px; flex: none; border-radius: 10px; display: grid; place-items: center; background: var(--wp-panel-2); }
.wp-order-item .kind svg { width: 16px; height: 16px; }
.wp-order-item .t { flex: 1; min-width: 0; }
.wp-order-item .t b { display: block; font-size: 0.92rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wp-order-item .t small { color: var(--wp-faint); font-size: 0.78rem; }
.wp-order-item .grip { color: var(--wp-faint); cursor: grab; }
.wp-add-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.wp-add-btn { flex-direction: column; gap: 6px; min-height: 70px; padding: 10px 6px; font-size: 0.82rem; border-style: dashed; }

.wp-work { padding: 20px clamp(14px, 2vw, 26px) 60px; }
.wp-item-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.wp-item-head h2 { font-size: 1.5rem; flex: 1; min-width: 0; }
.wp-item-editor { padding: 16px; border-radius: 22px; box-shadow: var(--shadow-sm); border: 1px solid var(--wp-line); background: var(--wp-panel); margin-bottom: 20px; }
.wp-slides { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.wp-thumb {
  position: relative; border-radius: 14px; overflow: hidden; cursor: pointer; border: 2px solid transparent; background: #000; padding: 0; color: inherit;
  transition: transform 200ms var(--wp-ease), border-color 200ms ease, box-shadow 200ms ease;
  animation: wp-pop 380ms var(--wp-ease) both; animation-delay: calc(var(--i, 0) * 30ms);
}
@keyframes wp-pop { from { opacity: 0; transform: translateY(8px) scale(0.97); } to { opacity: 1; transform: none; } }
.wp-thumb:hover { transform: translateY(-3px); box-shadow: var(--wp-shadow); }
.wp-thumb[aria-current="true"] { border-color: var(--wp-accent); box-shadow: 0 0 0 4px rgba(var(--wp-accent-rgb), 0.25); }
.wp-thumb .wpr-box { aspect-ratio: 16 / 9; width: 100%; }
.wp-thumb-cap { display: flex; justify-content: space-between; gap: 8px; padding: 6px 9px; background: var(--wp-float); font: 600 0.74rem/1.3 Inter, sans-serif; color: var(--wp-muted); text-align: left; }
.wp-thumb-cap span:first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wp-thumb-cap.first span:first-child { color: var(--wp-text); }
.wp-thumb[aria-current="true"] .wp-thumb-cap { color: var(--wp-text); }

/* ---------- Look panel ---------- */
.wp-look { border-left: 1px solid var(--wp-line); padding: 16px; background: var(--wp-side); }
.wp-look h3 { font-size: 1rem; margin: 0 0 12px; }
.wp-look-scope { margin-bottom: 14px; }
.wp-bgs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-bottom: 10px; }
.wp-bg-pick { position: relative; aspect-ratio: 16 / 9; border-radius: 10px; border: 2px solid transparent; background: #000 center / cover no-repeat; cursor: pointer; padding: 0; transition: transform 150ms ease, border-color 150ms ease; }
.wp-bg-pick:hover { transform: scale(1.04); }
.wp-bg-pick[aria-pressed="true"] { border-color: var(--wp-accent); box-shadow: 0 0 0 3px rgba(var(--wp-accent-rgb), 0.5); }
.wp-bg-pick .ai { position: absolute; right: 4px; bottom: 4px; padding: 1px 5px; border-radius: 5px; background: rgba(0, 0, 0, 0.6); font: 700 0.6rem/1.3 Inter, sans-serif; color: #fff; }
.wp-colors { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.wp-swatch { width: 30px; height: 30px; border-radius: 50%; border: 2px solid var(--wp-line-2); cursor: pointer; padding: 0; transition: transform 150ms ease; }
.wp-swatch:hover { transform: scale(1.12); }
.wp-swatch[aria-pressed="true"] { border-color: var(--wp-text); box-shadow: 0 0 0 3px rgba(var(--wp-accent-rgb), 0.55); }
.wp-range { width: 100%; accent-color: var(--wp-accent); }
.wp-look-sep { height: 1px; background: var(--wp-line); margin: 16px 0; }

/* ---------- Modal ---------- */
.wp-modal-back { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 16px; background: rgba(3, 6, 15, 0.7); backdrop-filter: blur(8px); opacity: 0; transition: opacity 200ms ease; }
.wp-modal-back.in { opacity: 1; }
.wp-modal { width: min(720px, 100%); max-height: calc(100vh - 32px); overflow: auto; border-radius: 28px; background: var(--wp-float); border: 1px solid var(--wp-line-2); box-shadow: 0 40px 100px -30px rgba(0, 0, 0, 0.9); transform: translateY(14px) scale(0.98); transition: transform 280ms var(--wp-ease); }
.wp-modal-back.in .wp-modal { transform: none; }
.wp-modal-head { display: flex; align-items: center; gap: 12px; padding: 18px 20px 6px; }
.wp-modal-head h2 { flex: 1; font-size: 1.5rem; }
.wp-modal-body { padding: 10px 20px 20px; }
.wp-modal-foot { display: flex; gap: 10px; justify-content: flex-end; padding: 0 20px 20px; flex-wrap: wrap; }
.wp-drop { display: grid; place-items: center; gap: 10px; padding: 34px 16px; border-radius: 18px; border: 2px dashed var(--wp-line-2); background: var(--wp-well); text-align: center; color: var(--wp-muted); cursor: pointer; transition: border-color 150ms ease, background 150ms ease; }
.wp-drop.over, .wp-drop:hover { border-color: var(--wp-accent); background: rgba(var(--wp-accent-rgb), 0.08); }
.wp-drop svg { width: 36px; height: 36px; color: var(--wp-accent); }
.wp-progress { height: 8px; border-radius: 99px; background: var(--wp-panel-2); overflow: hidden; margin: 14px 0 6px; }
.wp-progress > i { display: block; height: 100%; width: 0; background: var(--wp-grad); transition: width 300ms ease; }
.wp-ai-result { aspect-ratio: 16 / 9; border-radius: 16px; overflow: hidden; background: var(--wp-well) center / cover no-repeat; display: grid; place-items: center; color: var(--wp-muted); margin-top: 14px; position: relative; }
.wp-ai-result.painting::after { content: ""; position: absolute; inset: 0; background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, 0.12) 50%, transparent 70%); background-size: 200% 100%; animation: wp-shimmer 1.4s linear infinite; }
@keyframes wp-shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.wp-chips { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.wp-chip { min-height: 32px; padding: 0 12px; border-radius: 99px; border: 1px solid var(--wp-line-2); background: var(--wp-panel); color: var(--wp-muted); font: 500 0.82rem/1 Inter, sans-serif; cursor: pointer; transition: color 150ms ease, border-color 150ms ease; }
.wp-chip:hover { color: var(--wp-text); border-color: var(--wp-accent); }
.wp-pages { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; margin-top: 12px; }
.wp-pages img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 8px; animation: wp-pop 300ms var(--wp-ease) both; }
.wp-code { color: var(--wp-text); font: 700 clamp(2.4rem, 8vw, 3.6rem)/1 "Space Grotesk", monospace; letter-spacing: 0.18em; text-align: center; padding: 18px; border-radius: 18px; background: var(--wp-well); border: 1px solid var(--wp-line-2); }

/* ---------- Presenter: always the dark booth (#wp-present carries data-theme="dark") ---------- */
.wp-present { position: fixed; inset: 0; z-index: 50; display: grid; grid-template-rows: auto 1fr auto; background: #04060d; color: var(--wp-text); }
.wp-pres-top { display: flex; align-items: center; gap: 12px; padding: 10px 16px; border-bottom: 1px solid var(--wp-line); }
.wp-pres-top .clock { margin-left: auto; font: 700 1.1rem/1 "Space Grotesk", monospace; color: var(--wp-muted); }
.wp-live-dot { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 99px; background: rgba(251, 113, 133, 0.15); color: #d9d9d9; font: 700 0.78rem/1 Inter, sans-serif; letter-spacing: 0.06em; }
.wp-live-dot::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #fb7185; animation: wp-blink 1.2s ease infinite; }
/* The booth: order of service | what the room sees (with how far along we are) | next + the controls */
.wp-pres-main { min-height: 0; display: grid; grid-template-columns: 250px minmax(0, 1fr) 330px; gap: 16px; padding: 16px; }
.wp-pres-order { min-height: 0; overflow-y: auto; border-radius: 20px; border: 1px solid var(--wp-line); padding: 8px; background: var(--wp-side); display: grid; gap: 4px; align-content: start; }
.wp-pres-current { min-height: 0; display: flex; flex-direction: column; gap: 12px; }
.wp-pres-current .wpr-box { flex: 1; min-height: 0; border-radius: 20px; box-shadow: 0 0 0 2px rgba(251, 113, 133, 0.6), 0 30px 80px -40px rgba(0, 0, 0, 0.9), 0 60px 120px -60px rgba(var(--dawn-rgb), 0.35); }
/* How far along the service is */
.wp-pres-meter { display: flex; align-items: center; gap: 12px; min-height: 22px; font: 600 0.86rem/1.2 Inter, sans-serif; color: var(--wp-muted); }
.wp-pres-meter .part { min-width: 0; max-width: 40%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--wp-text); }
.wp-pres-meter .bar { flex: 1; height: 6px; border-radius: 99px; background: var(--wp-panel-2); overflow: hidden; }
.wp-pres-meter .bar i { display: block; height: 100%; border-radius: inherit; background: var(--grad-gold); transform-origin: left center; transform: scaleX(0); transition: transform 500ms var(--wp-ease); }
.wp-pres-meter .count { font-variant-numeric: tabular-nums; white-space: nowrap; }
.wp-pres-side { min-height: 0; display: flex; flex-direction: column; gap: 14px; }
.wp-pres-next .wpr-box { aspect-ratio: 16 / 9; border-radius: 16px; opacity: 0.9; box-shadow: 0 0 0 1px var(--wp-line-2); }
/* The controls sit under the hand: one big Next, then Back, Black and Hide text */
.wp-pres-controls { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.wp-pres-controls .wp-btn { padding: 0 8px; gap: 6px; font-size: 0.9rem; min-width: 0; }
.wp-pres-controls .wp-kbd { display: none; }   /* the keys are named in the line under the controls */
.wp-pres-controls .wp-pres-go { grid-column: 1 / -1; min-height: 88px; font-size: 1.4rem; border-radius: 24px; }
.wp-pres-controls .wp-btn[aria-pressed="true"] { background: #fff; color: #000; }
.wp-pres-strip { display: flex; gap: 10px; padding: 12px 16px 16px; overflow-x: auto; border-top: 1px solid var(--wp-line); scroll-behavior: smooth; }
.wp-pres-strip .wp-thumb { flex: 0 0 180px; animation: none; }
.wp-kbd { display: inline-block; min-width: 22px; padding: 2px 6px; border-radius: 6px; border: 1px solid var(--wp-line-2); font: 600 0.72rem/1.2 Inter, monospace; color: var(--wp-muted); text-align: center; }

/* ---------- Slide renderer (wp-render.js) ---------- */
.wpr-box { position: relative; overflow: hidden; background: #000; }
.wpr-stage { position: absolute; left: 0; top: 0; transform-origin: 0 0; overflow: hidden; }
.wpr-frame { position: absolute; inset: 0; overflow: hidden; }
.wpr-bg { position: absolute; inset: 0; background-size: cover; background-position: center; }
.wpr-overlay { position: absolute; inset: 0; background: #000; }
.wpr-picture { position: absolute; inset: 0; background: #000 center / contain no-repeat; }
.wpr-black { background: #000; }
.wpr-textbox { position: absolute; left: 7%; right: 7%; top: 9%; bottom: 13%; display: flex; align-items: center; }
.wpr-align-center { justify-content: center; text-align: center; }
.wpr-align-left { justify-content: flex-start; text-align: left; }
.wpr-text { max-width: 100%; max-height: 100%; white-space: pre-line; overflow-wrap: anywhere; line-height: 1.28; font-weight: 700; letter-spacing: -0.005em; }
.wpr-title { font-size: 1.15em; line-height: 1.1; margin-bottom: 0.35em; }
.wpr-shadow { text-shadow: 0 4px 24px rgba(0, 0, 0, 0.65), 0 2px 4px rgba(0, 0, 0, 0.5); }
.wpr-ref { position: absolute; right: 7%; bottom: 6%; font-size: 40px; font-weight: 600; opacity: 0.85; text-shadow: 0 2px 10px rgba(0, 0, 0, 0.6); }
.wpr-logo { position: absolute; left: 50%; top: 50%; max-width: 40%; max-height: 40%; transform: translate(-50%, -50%); }
.wpr-in-fade { opacity: 0; transition: opacity 600ms ease; }
.wpr-in-slide { opacity: 0; transform: translateX(6%); transition: opacity 500ms ease, transform 600ms var(--wp-ease); }
.wpr-in-zoom { opacity: 0; transform: scale(1.06); transition: opacity 600ms ease, transform 900ms var(--wp-ease); }
.wpr-in { opacity: 1; transform: none; }
/* Renderer additions (TINL-1436). New classes only: the rules above are never changed. */
.wpr-pos-top { align-items: flex-start; top: 7%; bottom: 38%; }
.wpr-pos-lower { align-items: center; top: 67%; bottom: 6%; }
.wpr-l3 { position: absolute; left: 0; right: 0; top: 63%; bottom: 0; background: rgba(0, 0, 0, 0.58); }
.wpr-upper { text-transform: uppercase; }
.wpr-tr { font-size: 0.62em; font-style: italic; font-weight: 500; opacity: 0.9; margin-top: 0.45em; line-height: 1.25; }
.wpr-credit { position: absolute; left: 7%; right: 34%; bottom: 3.2%; font-size: 24px; font-weight: 500; opacity: 0.8; text-shadow: 0 2px 8px rgba(0, 0, 0, 0.6); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wpr-bg-video { background: #05070f; }
.wpr-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.wpr-motion { background-size: 320% 320%; animation: wpr-drift 26s ease-in-out infinite alternate; }
.wpr-motion-aurora { background-image: linear-gradient(125deg, #04201f 0%, #0b1530 30%, #123a6b 55%, #0f5f5a 80%, #071a2c 100%); }
.wpr-motion-dawn { background-image: linear-gradient(160deg, #1b1033 0%, #4a1d4f 35%, #9a3d3d 65%, #e0954a 100%); }
.wpr-motion-waves { background-image: linear-gradient(100deg, #021b2b 0%, #06415a 30%, #0b6f86 55%, #054258 80%, #021b2b 100%); animation-duration: 18s; }
.wpr-motion-embers { background-image: linear-gradient(140deg, #120502 0%, #3d1105 35%, #7a2a08 60%, #2a0b03 100%); animation-duration: 30s; }
.wpr-motion-starfield { background-image: radial-gradient(2px 2px at 20% 30%, #fff 50%, transparent 51%), radial-gradient(1.5px 1.5px at 70% 20%, #dbeafe 50%, transparent 51%), radial-gradient(2px 2px at 40% 80%, #fff 50%, transparent 51%), radial-gradient(1px 1px at 85% 65%, #fff 50%, transparent 51%), linear-gradient(180deg, #02030c 0%, #0b1030 100%); background-size: 600px 600px, 800px 800px, 700px 700px, 500px 500px, 100% 100%; animation: wpr-stars 90s linear infinite; }
.wpr-motion-drift { background-image: linear-gradient(135deg, #16111d 0%, #2c2140 40%, #1d2f45 70%, #141a26 100%); animation-duration: 34s; }
@keyframes wpr-drift { 0% { background-position: 0% 40%; } 100% { background-position: 100% 60%; } }
@keyframes wpr-stars { 0% { background-position: 0 0, 0 0, 0 0, 0 0, 0 0; } 100% { background-position: 600px 300px, -800px 400px, 700px -350px, -500px 250px, 0 0; } }

/* ---------- Toast ---------- */
.wp-toasts { position: fixed; right: 16px; bottom: 16px; z-index: 90; display: grid; gap: 8px; }
.wp-toast { padding: 12px 16px; border-radius: 16px; color: var(--wp-text); background: var(--wp-float); border: 1px solid var(--wp-line-2); box-shadow: var(--wp-shadow); font-weight: 500; animation: wp-rise 300ms var(--wp-ease) both; max-width: 360px; }
.wp-toast.err { border-color: rgba(251, 113, 133, 0.6); }

/* ---------- Responsive: tablet (re-designed, not just shrunk) ---------- */
.wp-btn.wp-look-toggle { display: none; }
/* Laptops and smaller: the Look panel is a drawer behind the "Look" button, so the stage and the words
   have room (a 1366-wide booth laptop gets a 590px preview instead of 384px). */
@media (max-width: 1500px) {
  .wp-editor { grid-template-columns: 270px minmax(0, 1fr); }
  .wp-look { position: fixed; right: 0; top: 64px; bottom: 0; width: min(360px, 92vw); z-index: 40; background: var(--wp-float); box-shadow: -30px 0 60px -30px rgba(0, 0, 0, 0.9); transform: translateX(105%); transition: transform 320ms var(--wp-ease); border-left: 1px solid var(--wp-line-2); }
  .wp-look.open { transform: none; }
  .wp-btn.wp-look-toggle { display: inline-flex; }
}
@media (max-width: 1180px) {
  .wp-editor { grid-template-columns: 250px minmax(0, 1fr); }
  .wp-quick { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
/* Tablets and phones: the words first, the screen under them, both centred */
@media (max-width: 960px) {
  .wp-hero-grid { grid-template-columns: minmax(0, 1fr); text-align: center; padding-top: 28px; }
  .wp-hero-copy { max-width: 680px; margin: 0 auto; }
  .wp-hero p.lead { margin-left: auto; margin-right: auto; }
  .wp-hero-cta { justify-content: center; }
  .wp-hero-stage { max-width: 640px; width: 100%; margin: 0 auto; }
  .wp-screen { transform: none; animation: none; }
  .wp-two { grid-template-columns: 1fr; }
}

/* ---------- Responsive: phone ---------- */
@media (max-width: 760px) {
  .wp-features { grid-template-columns: 1fr; margin-top: 0; }
  .wp-showcase { grid-template-columns: 1fr; margin-top: 36px; }
  .wp-hero-cta .wp-btn-lg { flex: 1 1 100%; }
  .wp-two { grid-template-columns: 1fr; }
  .wp-quick { grid-template-columns: 1fr 1fr; gap: 10px; }
  .wp-quick-card { min-height: 112px; padding: 14px; }
  .wp-top { gap: 8px; padding: 0 12px; }
  .wp-brand small, .wp-save-text { display: none; }
  .wp-title-input { font-size: 0.95rem; }
  .wp-editor { grid-template-columns: 1fr; height: auto; }
  .wp-order { border-right: 0; border-bottom: 1px solid var(--wp-line); max-height: none; }
  .wp-order-list { display: flex; overflow-x: auto; gap: 8px; padding-bottom: 4px; }
  .wp-order-list .wp-order-item { flex: 0 0 auto; max-width: 220px; }
  .wp-order-list .wp-order-item .grip { display: none; }
  .wp-add-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .wp-add-btn { min-height: 58px; font-size: 0.72rem; }
  .wp-slides { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .wp-pres-strip .wp-thumb { flex-basis: 140px; }
  .wp-toasts { left: 12px; right: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  .wp-screen, .wp-rise, .wp-thumb, .wp-pages img, .wp-toast { animation: none !important; opacity: 1 !important; transform: none !important; }
  .wpr-in-fade, .wpr-in-slide, .wpr-in-zoom { transition: none; opacity: 1; transform: none; }
}

/* ---------- Utilities + pieces used by the studio scripts (wp-*.js) ---------- */
.wp-muted { color: var(--wp-muted); }
.wp-m0 { margin: 0; }
.wp-mt { margin-top: 22px; }
.wp-mt-sm { margin-top: 14px; }
.wp-mb { margin-bottom: 14px; }
.wp-between { justify-content: space-between; }
.wp-center { justify-content: center; }
.wp-grow { flex: 1; }
.wp-span-all { grid-column: 1 / -1; }
.wp-hint { margin: 6px 0 0; font-size: 0.82rem; color: var(--wp-faint); }
.wp-check { display: inline-flex; align-items: center; gap: 8px; font-weight: 500; cursor: pointer; min-height: 42px; }
.wp-check input { width: 18px; height: 18px; accent-color: var(--wp-accent); }
.wp-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.wp-grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.wp-textarea-sm { min-height: 90px; }
.wp-search-sm { max-width: 220px; }
.wp-add-wide { grid-column: 1 / -1; flex-direction: row; min-height: 48px; }
.wp-badge:not(:empty) { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 99px; background: #34d399; color: #052e1c; font: 700 0.72rem/20px Inter, sans-serif; }
.wp-tabs { margin-bottom: 16px; }
.wp-modal-wide { width: min(900px, 100%); }
.wp-list-btn { width: 100%; color: inherit; font: inherit; text-align: left; cursor: pointer; transition: background 150ms ease, border-color 150ms ease; }
.wp-list-btn:hover { background: var(--wp-panel-2); border-color: rgba(var(--wp-accent-rgb), 0.45); }
.wp-list-btn svg { width: 18px; height: 18px; color: var(--wp-accent); flex: none; }
.wp-list-scroll { max-height: 46vh; overflow-y: auto; margin-top: 12px; }
.wp-passage { max-height: 34vh; overflow-y: auto; padding: 14px 16px; border-radius: 14px; background: var(--wp-well); border: 1px solid var(--wp-line); font: 400 1.05rem/1.65 var(--wp-display); }
.wp-passage p { margin: 0 0 8px; }
.wp-passage sup { color: var(--wp-accent); font: 700 0.7rem Inter, sans-serif; margin-right: 2px; }
.wp-mini-slides { margin-top: 14px; }
.wp-mini-strip { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; }
.wp-mini { flex: 0 0 150px; aspect-ratio: 16 / 9; border-radius: 9px; animation: wp-pop 300ms var(--wp-ease) both; }
.wp-bgs-lg { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); margin-top: 14px; max-height: 50vh; overflow-y: auto; }
.wp-bgs-home { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
.wp-screens { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.wp-screen-opt { display: grid; gap: 10px; align-content: start; padding: 18px; border-radius: 18px; border: 1px solid var(--wp-line); background: var(--wp-panel); }
.wp-screen-opt h3 { font-size: 1.05rem; }
.wp-screen-opt p { margin: 0; font-size: 0.92rem; }
.wp-screen-opt .wp-feature-icon { margin: 0; }

/* Look panel */
.wp-look h3 { display: flex; align-items: center; gap: 8px; }
.wp-look h3 svg { width: 18px; height: 18px; color: var(--wp-accent); }
.wp-look-close { display: none; }
.wp-look-actions { margin-bottom: 4px; }
.wp-look-actions .wp-btn { flex: 1; }
.wp-look .wp-seg { display: flex; }
.wp-look .wp-seg button { flex: 1; }
.wp-look .wp-seg svg { width: 16px; height: 16px; }

/* Editor middle column */
.wp-order-empty { padding: 14px 10px; color: var(--wp-faint); font-size: 0.9rem; }
.wp-kind-chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 99px; background: var(--wp-grad-soft); border: 1px solid var(--wp-line-2); font: 600 0.78rem/1 Inter, sans-serif; }
.wp-kind-chip svg { width: 14px; height: 14px; }
.wp-item-tools { gap: 4px; }
/* The studio: the stage (the slide on screen, then every slide of this item) on the left, the words on
   the right. The words stay in view while the slides re-cut themselves beside them. One column when the
   work area is narrow: slide, words, then the slides. */
.wp-work { container-type: inline-size; }
.wp-studio { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(300px, 0.8fr); gap: 20px; align-items: start; margin-bottom: 8px; }
.wp-stage-col { min-width: 0; }
.wp-words-col { min-width: 0; position: sticky; top: 12px; }
.wp-words-col .wp-item-editor { margin: 0; }
.wp-words-col .wp-textarea { min-height: min(46vh, 420px); }
.wp-words-col .wp-grid2 { grid-template-columns: 1fr; gap: 0; }
.wp-preview-wrap { position: relative; display: grid; gap: 12px; }
.wp-preview { aspect-ratio: 16 / 9; border-radius: 22px; overflow: hidden; box-shadow: 0 30px 70px -34px rgba(var(--wp-accent-rgb), 0.7), 0 50px 100px -50px rgba(var(--dawn-rgb), 0.55), 0 0 0 1px var(--wp-line-2); }
.wp-stage-col .wp-slides { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
@container (max-width: 700px) {
  .wp-studio { display: flex; flex-direction: column; align-items: stretch; gap: 18px; }
  .wp-stage-col { display: contents; }
  .wp-preview-wrap { order: 1; }
  .wp-words-col { order: 2; position: static; }
  .wp-studio .wp-section-head { order: 3; margin-top: 4px; }
  .wp-studio .wp-slides { order: 4; }
  .wp-words-col .wp-textarea { min-height: 220px; }
  .wp-words-col .wp-grid2 { grid-template-columns: 1fr 1fr; gap: 12px; }
}
.wp-scripture-ref { display: flex; align-items: center; gap: 8px; margin: 0 0 6px; font-size: 1.1rem; }
.wp-scripture-ref svg { width: 20px; height: 20px; color: var(--wp-accent); }
.wp-thumb-wrap { position: relative; }
.wp-thumb { display: block; width: 100%; }
.wp-thumb-x { position: absolute; top: 6px; right: 6px; z-index: 3; width: 30px; height: 30px; border-radius: 50%; border: 0; display: grid; place-items: center; background: rgba(0, 0, 0, 0.65); color: #fff; cursor: pointer; opacity: 0; transition: opacity 150ms ease, background 150ms ease; }
.wp-thumb-x svg { width: 16px; height: 16px; }
.wp-thumb-wrap:hover .wp-thumb-x, .wp-thumb-x:focus-visible { opacity: 1; }
.wp-thumb-x:hover { background: var(--wp-danger); }
@media (hover: none) { .wp-thumb-x { opacity: 1; } }

/* Empty service */
.wp-start { max-width: 760px; margin: 4vh auto 0; text-align: center; }
.wp-start h2 { font-size: clamp(1.7rem, 3vw, 2.3rem); margin: 18px 0 8px; }
.wp-start > p { margin: 0 auto 24px; max-width: 520px; }
.wp-start-art { display: flex; justify-content: center; gap: 12px; }
.wp-start-art span { width: 64px; height: 64px; border-radius: 20px; display: grid; place-items: center; background: var(--wp-grad); box-shadow: 0 18px 40px -18px rgba(var(--wp-accent-rgb), 0.9); animation: wp-float 4s ease-in-out infinite; }
.wp-start-art span:nth-child(2) { animation-delay: -1.3s; transform: translateY(-8px); }
.wp-start-art span:nth-child(3) { animation-delay: -2.6s; }
.wp-start-art svg { width: 28px; height: 28px; color: #fff; }
@keyframes wp-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
.wp-start-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; text-align: left; }

/* Home cards */
.wp-service-wrap { position: relative; animation: wp-pop 380ms var(--wp-ease) both; animation-delay: calc(var(--i, 0) * 40ms); }
.wp-service-card { display: block; width: 100%; }
.wp-service-cover { display: block; }
.wp-service-meta { display: block; }
.wp-card-x { position: absolute; top: 8px; right: 8px; z-index: 2; width: 34px; height: 34px; border-radius: 10px; border: 0; display: grid; place-items: center; background: rgba(0, 0, 0, 0.55); color: #fff; cursor: pointer; opacity: 0; transition: opacity 150ms ease, background 150ms ease; backdrop-filter: blur(6px); }
.wp-card-x svg { width: 16px; height: 16px; }
.wp-service-wrap:hover .wp-card-x, .wp-bg-tile:hover .wp-card-x, .wp-card-x:focus-visible { opacity: 1; }
.wp-card-x:hover { background: var(--wp-danger); }
@media (hover: none) { .wp-card-x { opacity: 1; } }
.wp-bg-tile { position: relative; }
.wp-bg-tile .wp-bg-pick { display: block; cursor: default; }
.wp-bg-tile .wp-bg-pick:hover { transform: none; }
.wp-bg-tile .wp-card-x { width: 28px; height: 28px; top: 4px; right: 4px; }
.wp-skeleton { min-height: 210px; background: linear-gradient(100deg, var(--wp-panel) 30%, var(--wp-panel-2) 50%, var(--wp-panel) 70%); background-size: 200% 100%; animation: wp-shimmer 1.4s linear infinite; cursor: default; }
.wp-empty > svg { width: 32px; height: 32px; color: var(--wp-accent); }
.wp-empty p { margin: 8px 0 14px; }

/* Account menu */
.wp-menu-wrap { position: relative; }
.wp-menu { position: absolute; right: 0; top: calc(100% + 8px); z-index: 50; min-width: 240px; padding: 8px; border-radius: 16px; background: var(--wp-float); border: 1px solid var(--wp-line-2); box-shadow: var(--wp-shadow); animation: wp-rise 180ms var(--wp-ease) both; }
.wp-menu-who { padding: 8px 10px 10px; border-bottom: 1px solid var(--wp-line); margin-bottom: 6px; display: grid; }
.wp-menu-who small { color: var(--wp-faint); overflow: hidden; text-overflow: ellipsis; }
.wp-menu a, .wp-menu button { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 42px; padding: 0 10px; border: 0; border-radius: 10px; background: transparent; color: var(--wp-text); font: 500 0.92rem Inter, sans-serif; text-decoration: none; cursor: pointer; }
.wp-menu a:hover, .wp-menu button:hover, .wp-menu a:focus-visible, .wp-menu button:focus-visible { background: var(--wp-panel-2); }
.wp-menu svg { width: 18px; height: 18px; color: var(--wp-muted); }

/* Presenter extras */
.wp-pres-title { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
body.wp-presenting { overflow: hidden; }
.wp-pres-order .wp-order-item { width: 100%; }
.wp-pres-order .wp-order-item[aria-current="true"] { border-color: rgba(251, 113, 133, 0.6); background: rgba(251, 113, 133, 0.1); }
.wp-pres-strip .wp-thumb[aria-current="true"] { border-color: #fb7185; box-shadow: 0 0 0 4px rgba(251, 113, 133, 0.25); }

/* Responsive for the pieces above */
@media (max-width: 1500px) {
  .wp-look-close { display: inline-flex; }
}
@media (max-width: 760px) {
  .wp-grid2, .wp-grid3, .wp-screens { grid-template-columns: 1fr; }
  .wp-start-grid { grid-template-columns: 1fr; }
  .wp-hide-sm { display: none; }
  .wp-brand-text { display: none; }
  .wp-search-sm { max-width: 150px; }
  .wp-section-head { flex-wrap: wrap; }
  .wp-pres-top { flex-wrap: wrap; gap: 8px; padding: 8px 10px; }
  .wp-pres-top .clock { display: none; }
  .wp-modal-body { padding: 8px 16px 16px; }
  /* Dialogs rise from the bottom edge on phones, under the thumb */
  .wp-modal-back { place-items: end center; padding: 0; }
  .wp-modal, .wp-modal-wide { width: 100%; max-height: 92dvh; border-radius: 28px 28px 0 0; border-bottom: 0; transform: translateY(100%); padding-bottom: env(safe-area-inset-bottom, 0px); transition: transform 380ms var(--wp-ease); }
  .wp-modal::before { content: ""; display: block; width: 44px; height: 5px; margin: 10px auto 0; border-radius: 99px; background: var(--wp-line-2); }
}

/* Presenter + editor top bar on tablets and phones (re-designed: one column, nothing cut off) */
@media (max-width: 1180px) {
  .wp-present { grid-template-columns: minmax(0, 1fr); }
  .wp-pres-top { min-width: 0; }
  .wp-pres-top .clock { display: none; }
  /* One column: the slide, the controls right under it, then what is next and the order of service */
  .wp-pres-main { grid-template-columns: minmax(0, 1fr); overflow-y: auto; align-content: start; }
  .wp-pres-current { order: 1; min-height: auto; }   /* its row must not shrink under the slide */
  .wp-pres-side .wp-hint { order: 5; margin: 0; }
  .wp-pres-current .wpr-box { flex: none; width: 100%; aspect-ratio: 16 / 9; max-height: 56vh; }
  .wp-pres-side { display: contents; }
  .wp-pres-controls { order: 2; grid-template-columns: 64px minmax(0, 1fr) 64px 64px; }
  .wp-pres-controls .wp-pres-go { grid-column: 2; grid-row: 1; min-height: 60px; font-size: 1.15rem; border-radius: 999px; }
  .wp-pres-controls [data-p="prev"] { grid-column: 1; grid-row: 1; }
  .wp-pres-controls .wp-btn { min-height: 60px; padding: 0; }
  .wp-pres-controls .wp-btn span { display: none; }
  .wp-pres-next { order: 3; max-width: 420px; }
  .wp-pres-order { order: 4; max-height: 280px; }
  body[data-view="editor"] .wp-brand-text { display: none; }
}
@media (max-width: 760px) {
  .wp-pres-top [data-p="output"] { display: none; }
  .wp-pres-top .wp-pres-title { flex: 1; }
  .wp-pres-strip { padding: 10px 12px 12px; }
  body[data-view="editor"] .wp-brand, body[data-view="editor"] .wp-top [data-act="screens"] { display: none; }
  /* The service's name needs the room on a phone: the theme switch stays on the home screen */
  body[data-view="editor"] .wp-top .wp-theme-btn { display: none; }
  .wp-item-head h2 { font-size: 1.25rem; }
  .wp-order-item .t small { white-space: nowrap; }
}

/* Phone landing + home polish */
@media (max-width: 760px) {
  .wp-landing-nav .wp-row { flex-wrap: nowrap; gap: 6px; }
  .wp-services { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .wp-service-meta { padding: 10px; }
  .wp-service-meta b { font-size: 0.92rem; }
  .wp-service-meta span { font-size: 0.75rem; }
}

/* Touch screens: the brand link is a full finger tall (see style.css, "Touch screens"). */
@media (pointer: coarse) { .wp .wp-brand { min-height: 44px; display: inline-flex; align-items: center; } }

/* The landing's top bar on a narrow phone (360 px, found on a Galaxy S25): "Sign in" was cut off at the right
   edge. The small "by TruBible" gives way and the gaps tighten. */
@media (max-width: 440px) {
  .wp-landing-nav { padding-inline: 12px; gap: 6px; }
  .wp-landing-nav .wp-brand small { display: none; }
  .wp-landing-nav .wp-row { gap: 4px; flex: none; }
  .wp-landing-nav .wp-brand { min-width: 0; }
}

/* The app's own icon, in its colours, as the brand mark (TINL-1380; drawn by store/build-icons.cjs). */
.wp-brand .wp-brand-mark:not(.wpd-mark) { background: url("/os/img/app-worship.svg?v=2") center / cover; }
.wp-brand .wp-brand-mark:not(.wpd-mark) svg { display: none; }

/* the hidden frame that holds a printed service (wp-plus.js printService, TINL-1419) */
.wp-print-frame { position: fixed; right: 0; bottom: 0; width: 0; height: 0; border: 0; opacity: 0; pointer-events: none; }

/* ---------- Slide layouts (TINL-1442, wp-render.js slide.layout) — new classes only; the default layout adds none ---------- */
.wpr-layout-title .wpr-title { font-size: 1.45em; margin-bottom: 0.25em; }
.wpr-layout-title .wpr-body { font-size: 0.55em; font-weight: 500; opacity: 0.92; }
.wpr-layout-title-body .wpr-textbox { align-items: flex-start; }
.wpr-layout-title-body .wpr-title { font-size: 1.05em; padding-bottom: 0.3em; margin-bottom: 0.5em; border-bottom: 0.06em solid currentColor; }
.wpr-layout-title-body .wpr-body { font-size: 0.8em; font-weight: 500; }
.wpr-layout-scripture .wpr-ref { border-top: 3px solid currentColor; padding-top: 12px; }
.wpr-layout-countdown .wpr-body { font-size: 1.8em; font-variant-numeric: tabular-nums; letter-spacing: 0.02em; }
.wpr-layout-countdown .wpr-title { font-size: 0.6em; opacity: 0.9; }
