/*
 * THE CLOUD SKIN.
 *
 * styles.css is the desk: it was drawn for a 1280px window, a mouse and a
 * sidebar, and it has not one media query in it. This file changes none of that
 * — it sits on top and answers two questions the desk never had to:
 *
 *   • where does the sidebar's job go, when there is no sidebar? (the cloud bar)
 *   • what does the desk look like on a phone held in one hand?
 *
 * The phone layout does NOT hide anything. Everything the desktop shows is
 * still on the page, in the order a thumb wants it: the picture, the tools that
 * act on it, the timeline, then the settings column. A control that has been
 * "tidied away for mobile" is a control somebody cannot reach at half past ten
 * on a Saturday night, and the whole point of this was that nothing is missing.
 */

/* ------------------------------------------------------------- the frame */

body.mw-cloud { overflow: hidden; }

body.mw-cloud #app {
  display: block;
  height: 100vh;
  height: 100dvh;                 /* a phone's address bar is not a wall */
  padding-top: 46px;              /* the cloud bar */
}
/* A home-screen app has no address bar, and iOS can report 100dvh short for a
   moment after launch; 100vh is the one that is right from the first frame. */
@media (display-mode: standalone) {
  body.mw-cloud #app { height: 100vh; }
}
body.mw-cloud .content {
  height: 100%;
  padding: 16px 18px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
body.mw-cloud .view { height: 100%; }

/* ----------------------------------------------------------- the cloud bar */

.cloud-bar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 46px;
  z-index: 240;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0 12px;
  padding-top: env(safe-area-inset-top);
  height: calc(46px + env(safe-area-inset-top));
  background: rgba(12, 15, 22, .92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
body.mw-cloud #app { padding-top: calc(46px + env(safe-area-inset-top)); }

.cloud-brand { display: flex; align-items: center; gap: 8px; min-width: 0; }
.cloud-logo {
  width: 26px; height: 26px; flex: none;
  display: grid; place-items: center;
  border-radius: 8px;
  background: linear-gradient(180deg, #5658d6, #4648be);   /* the app icon's indigo */
  color: #fff;
  font-size: 14px;
}
.cloud-name { font-weight: 700; font-size: 14px; white-space: nowrap; }
.cloud-where {
  font-size: 11.5px; color: var(--muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.cloud-bar-actions { display: flex; align-items: center; gap: 8px; }

.cloud-chip {
  position: relative;
  background: var(--bg-3);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 7px 10px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}
.cloud-chip:hover { border-color: var(--primary); }
.cloud-badge {
  display: inline-grid; place-items: center;
  min-width: 17px; height: 17px; padding: 0 4px; margin-left: 4px;
  border-radius: 9px; background: var(--good); color: #06240f;
  font-size: 10.5px; font-weight: 800;
}
.cloud-badge.hidden { display: none; }
.cloud-link { font-size: 11px; color: var(--good); transition: color .2s; }
.cloud-link.bad { color: var(--danger); }

/* ------------------------------------------------------------ the sign-in */

.cloud-gate {
  position: fixed; inset: 0; z-index: 400;
  display: grid; place-items: center;
  padding: 22px;
  background: radial-gradient(900px 500px at 50% -10%, rgba(79,124,255,.16), transparent 60%), var(--bg);
}
.cloud-gate.gone { display: none; }
.cloud-gate-box {
  width: 360px; max-width: 100%;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 26px 22px 20px;
  text-align: center;
}
.cloud-gate-logo {
  width: 52px; height: 52px; margin: 0 auto 12px;
  display: grid; place-items: center;
  border-radius: 15px;
  background: linear-gradient(180deg, #5658d6, #4648be);   /* the app icon's indigo */
  color: #fff;
  font-size: 26px;
}
.cloud-gate-box h1 { margin: 0 0 4px; font-size: 21px; }
.cloud-gate-sub { margin: 0 0 20px; color: var(--muted); font-size: 13px; }
.cloud-gate-label {
  display: block; text-align: left;
  font-size: 12px; font-weight: 700; color: var(--muted);
  text-transform: uppercase; letter-spacing: .6px; margin-bottom: 6px;
}
#cloudPass {
  width: 100%;
  background: var(--bg-3); color: var(--text);
  border: 1px solid var(--border); border-radius: 11px;
  padding: 13px 14px;
  font-size: 16px;                 /* 16px or iOS zooms the page on focus */
  letter-spacing: .4px;
  text-align: center;
}
#cloudPass:focus { outline: none; border-color: var(--primary); }
/*
 * "Stay signed in" is a settings row with a switch, as on an iPhone. It was a
 * bare checkbox, and the desk's rule for inputs (full width, padding, border)
 * stretched it across the row on a phone, crushing the words into a column one
 * word wide. The switch is drawn here from nothing (appearance: none) and
 * undoes every part of that rule, so no browser's own checkbox is left to fight.
 */
.cloud-gate-remember {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin: 12px 0 16px; padding: 10px 12px 10px 14px;
  background: var(--bg-3); border: 1px solid var(--border); border-radius: 11px;
  text-align: left; cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.cgr-text { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.cgr-text b { font-size: 14px; font-weight: 600; color: var(--text); line-height: 1.25; }
.cgr-text small { font-size: 12px; color: var(--muted); line-height: 1.3; }
.cloud-gate-remember input.cgr-switch {
  -webkit-appearance: none; appearance: none;
  position: relative; flex: none;
  width: 46px; height: 28px; margin: 0; padding: 0;
  border: 0; border-radius: 14px;
  background: #3a3c47;
  box-shadow: none;
  cursor: pointer;
  transition: background .2s ease;
}
.cloud-gate-remember input.cgr-switch::after {
  content: ''; position: absolute; top: 3px; left: 3px;
  width: 22px; height: 22px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .35);
  transition: transform .2s ease;
}
.cloud-gate-remember input.cgr-switch:checked { background: #8b5cf6; }
.cloud-gate-remember input.cgr-switch:checked::after { transform: translateX(18px); }
.cloud-gate-remember input.cgr-switch:focus { box-shadow: none; outline: none; }
.cloud-gate-remember input.cgr-switch:focus-visible { outline: 2px solid #a78bfa; outline-offset: 2px; }
.cloud-gate-go { width: 100%; padding: 13px; font-size: 15px; border-radius: 11px; }
.cloud-gate-msg { min-height: 18px; margin-top: 12px; font-size: 12.5px; color: var(--muted); }
.cloud-gate-msg.bad { color: var(--danger); }
.cloud-gate-foot { margin-top: 14px; font-size: 11px; color: var(--muted); opacity: .7; }

/* ------------------------------------------------------------ file lists */

.cloud-files-box { width: 560px; }

/*
 * YOUR FILES and FINISHED IN THIS SESSION, as sheets in the studio's own
 * style: a picture for every video, its size and when it was made, Save and
 * Delete on its row, Select for many at once, and how much room is left.
 */
body.mw-cloud .cloud-sheet-modal .cloud-files-box {
  display: flex; flex-direction: column; overflow: hidden;
  width: min(580px, calc(100vw - 32px)); max-height: min(84vh, 820px);
  padding: 0;
  background: #141519; color: #f5f6f8;
  border: 1px solid rgba(255,255,255,.07); border-radius: 22px;
  box-shadow: 0 30px 80px rgba(0,0,0,.6);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Roboto, "Segoe UI", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}
.cloud-sheet-modal button { font-family: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.cloud-files-top { position: relative; flex: none; display: flex; align-items: center; gap: 10px; padding: 18px 14px 8px 20px; }
.cloud-files-title { flex: 1; min-width: 0; font-size: 20px; font-weight: 800; letter-spacing: -.3px; }
.cloud-files-pill {
  flex: none; height: 32px; padding: 0 14px; border: 0; border-radius: 999px;
  background: #2a2b31; color: #ececf1; font-size: 13.5px; font-weight: 700;
}
.cloud-files-pill.hidden { display: none; }
.cf-selecting .cloud-files-pill#cloudFilesSelect { background: #f5f6f8; color: #000; }
.cloud-files-x {
  flex: none; width: 32px; height: 32px; padding: 0; border: 0; border-radius: 50%;
  display: grid; place-items: center; background: #2a2b31; color: #c9cad1;
}
.cloud-files-x svg { width: 15px; height: 15px; }
.cloud-files-bar { flex: none; display: flex; gap: 8px; padding: 6px 16px 10px; }
.cloud-files-up {
  flex: 1; min-width: 0; height: 46px; padding: 0 14px; border-radius: 14px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-size: 15px; font-weight: 750; white-space: nowrap;
}
.cloud-files-up .mi, .cloud-files-icon .mi { width: 19px; height: 19px; margin: 0; }
.cloud-files-icon {
  flex: none; width: 46px; height: 46px; padding: 0; border: 0; border-radius: 14px;
  display: grid; place-items: center; background: #23242b; color: #e8e8ee;
}
.cloud-files-disk { flex: none; display: flex; flex-direction: column; gap: 6px; margin: 0 18px 8px; font-size: 12.5px; color: #9b9ea8; }
.cloud-files-disk.hidden { display: none; }
.cloud-files-disk b { color: #e6e7ec; font-weight: 700; }
.cf-disk-bar { height: 5px; border-radius: 3px; background: rgba(255,255,255,.08); overflow: hidden; }
.cf-disk-bar i { display: block; height: 100%; border-radius: 3px; background: linear-gradient(90deg, #7c3aed, #a855f7); }
.cloud-files-disk.low .cf-disk-bar i { background: linear-gradient(90deg, #f97316, #ef4444); }
.cloud-files-disk.low b { color: #ff8a80; }
.cloud-files-list {
  flex: 1; min-height: 140px; overflow-y: auto; overflow-x: hidden;
  padding: 2px 12px 16px;
  -webkit-overflow-scrolling: touch; overscroll-behavior: contain;
}
.cloud-files-group { margin-top: 8px; }
.cloud-files-head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 10px;
  margin: 8px 6px 8px; font-size: 12px; font-weight: 800; letter-spacing: .7px; text-transform: uppercase; color: #8a8d97;
}
.cloud-files-head small { font-size: 12px; font-weight: 600; letter-spacing: .2px; text-transform: none; color: #6b6e78; }
.cf-row {
  position: relative; overflow: hidden;
  display: flex; align-items: center; gap: 2px;
  max-height: 120px; margin-bottom: 8px; padding: 6px;
  border-radius: 16px; background: #1c1d23;
  transition: opacity .25s ease, transform .25s ease, max-height .32s ease, margin .32s ease, padding .32s ease, background .15s;
}
.cf-main {
  flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px;
  padding: 0; border: 0; background: none; color: inherit; text-align: left;
}
.cf-pic {
  flex: none; width: 54px; height: 54px; border-radius: 11px;
  background: linear-gradient(150deg, #2c2d35, #1f2026) center / cover no-repeat;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.06);
}
.cf-tx { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.cf-tx b { font-size: 14.5px; font-weight: 650; letter-spacing: -.1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cf-tx small { font-size: 12.5px; color: #8a8d97; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cf-btn {
  flex: none; width: 42px; height: 42px; padding: 0; border: 0; border-radius: 12px;
  display: grid; place-items: center; background: transparent; color: #d8d9df;
}
.cf-btn:active { background: rgba(255,255,255,.07); }
.cf-btn .mi { width: 20px; height: 20px; margin: 0; }
.cf-bin { color: #ff7166; }
.cf-open {
  flex: none; height: 36px; padding: 0 16px; margin-right: 2px; border: 0; border-radius: 999px;
  background: linear-gradient(135deg, #a855f7, #7c3aed); color: #fff; font-size: 14px; font-weight: 750;
}
.cf-sure {
  position: absolute; inset: 0;
  display: flex; align-items: center; gap: 8px; padding: 0 8px 0 16px;
  background: linear-gradient(90deg, #2b1517, #3b161a);
  transform: translateX(102%);
  transition: transform .3s cubic-bezier(.2,.9,.25,1);
}
.cf-sure span { flex: 1; min-width: 0; font-size: 14px; font-weight: 700; color: #ffd8d4; }
.cf-no, .cf-yes { flex: none; height: 40px; padding: 0 14px; border: 0; border-radius: 12px; font-size: 14px; font-weight: 750; }
.cf-no { background: rgba(255,255,255,.1); color: #fff; }
.cf-yes { background: #ff453a; color: #fff; }
.cf-row.sure .cf-sure { transform: none; }
.cf-row.busy { opacity: .5; pointer-events: none; }
.cf-row.gone { opacity: 0; transform: translateX(-40px); max-height: 0; margin-bottom: 0; padding-top: 0; padding-bottom: 0; }
.cf-check {
  display: none; flex: none; width: 24px; height: 24px; margin-left: 4px; border-radius: 50%;
  place-items: center; color: transparent; box-shadow: inset 0 0 0 2px #4a4b53;
}
.cf-check svg { width: 14px; height: 14px; }
.cf-selecting .cf-row.can-del .cf-check { display: grid; }
.cf-selecting .cf-row.chosen { background: rgba(139,92,246,.17); box-shadow: inset 0 0 0 1.5px rgba(167,139,250,.6); }
.cf-selecting .cf-row.chosen .cf-check { background: #8b5cf6; color: #fff; box-shadow: none; }
.cf-selecting .cf-row:not(.can-del) { opacity: .38; }
.cf-selecting .cf-btn, .cf-selecting .cf-sure { display: none; }
.cloud-files-selbar {
  flex: none; display: flex; align-items: center; gap: 10px;
  padding: 10px 16px 12px; border-top: 1px solid #23242b; background: #141519;
}
.cloud-files-selbar.hidden { display: none; }
.cloud-files-selinfo { flex: 1; min-width: 0; font-size: 14px; font-weight: 700; color: #d8d9df; }
.cloud-files-del {
  flex: none; height: 44px; padding: 0 18px; border: 0; border-radius: 14px;
  display: inline-flex; align-items: center; gap: 7px;
  background: #ff453a; color: #fff; font-size: 15px; font-weight: 800;
}
.cloud-files-del .mi { width: 18px; height: 18px; margin: 0; }
.cloud-files-del:disabled { opacity: .35; cursor: default; }
.cloud-files-save { background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%); padding: 0 14px; }
.cloud-files-del.sure { background: #d70015; box-shadow: 0 0 0 3px rgba(255,69,58,.3); }
.cloud-files-empty { padding: 34px 16px; text-align: center; color: #9b9ea8; }
.cloud-files-empty b { display: block; margin-bottom: 6px; font-size: 17px; color: #f5f6f8; }
.cloud-files-empty p { max-width: 300px; margin: 0 auto; font-size: 13.5px; line-height: 1.45; }
.cf-empty-art {
  width: 62px; height: 62px; margin: 0 auto 14px; border-radius: 20px;
  display: grid; place-items: center; color: #dccfff;
  background: linear-gradient(135deg, rgba(168,85,247,.28), rgba(99,102,241,.18));
}
.cf-empty-art .mi { width: 28px; height: 28px; margin: 0; }
.cf-loading { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 34px 10px; color: #9b9ea8; font-size: 14px; }
.cf-spin { width: 18px; height: 18px; border-radius: 50%; border: 2.5px solid rgba(196,181,253,.3); border-top-color: #c4b5fd; animation: cfSpin .8s linear infinite; }
@keyframes cfSpin { to { transform: rotate(360deg); } }

.cloud-upload-bar { display: flex; align-items: center; gap: 10px; padding: 8px 14px; border-bottom: 1px solid var(--border-soft); }
.cloud-upload-bar.hidden { display: none; }
.cloud-upload-name { flex: none; max-width: 40%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.cloud-upload-bar .progress { flex: 1; height: 6px; background: var(--bg-3); border-radius: 4px; overflow: hidden; }
.cloud-upload-bar .progress-bar { height: 100%; background: var(--primary); transition: width .2s; }
.cloud-sheet-modal .cloud-upload-bar { flex: none; margin: 0 16px 8px; padding: 10px 10px 10px 14px; border: 0; border-radius: 14px; background: #1c1d23; }
.cloud-sheet-modal .cloud-upload-name { font-size: 13px; font-weight: 650; color: #e6e7ec; }
.cloud-sheet-modal .cloud-upload-bar .progress { background: rgba(255,255,255,.08); }
.cloud-sheet-modal .cloud-upload-bar .progress-bar { background: linear-gradient(90deg, #7c3aed, #a855f7); }

.cloud-help-box { width: 520px; }
.cloud-help-body { padding: 8px 18px 18px; overflow-y: auto; font-size: 13.5px; line-height: 1.55; }
.cloud-help-body p { margin: 0 0 12px; }

/* ------------------------------------------------------------- touch bar */

.cloud-touchbar {
  position: fixed;
  left: 50%; transform: translateX(-50%);
  bottom: calc(10px + env(safe-area-inset-bottom));
  z-index: 230;
  display: flex; gap: 4px;
  padding: 5px;
  border-radius: 14px;
  background: rgba(20, 24, 34, .95);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  backdrop-filter: blur(8px);
}
.cloud-touchbar.hidden { display: none; }
.cloud-touchbar button {
  min-width: 42px; height: 40px;
  background: transparent; color: var(--text);
  border: 0; border-radius: 10px;
  font-size: 17px; cursor: pointer;
}
.cloud-touchbar button:active { background: var(--bg-3); }
.cloud-ct-play { color: var(--primary) !important; font-size: 19px !important; }

/* ------------------------------------------------------------ the purple */

/*
 * The Cloud Studio is purple — the ✝ mark's colour — where the desk is blue.
 * The desk's accents are variables, so they are re-pointed here rather than
 * restyled one by one: every primary button, slider, tick box, selected tab
 * and highlight follows. The desktop app (which never loads this file) keeps
 * its own blue.
 */
body.mw-cloud { --primary: #8b5cf6; --primary-2: #a78bfa; }
body.mw-cloud #view-video.ve-pro, body.mw-cloud #capModal {
  --acc: #8b5cf6; --acc2: #a78bfa;
  --acc-soft: rgba(139, 92, 246, .16); --acc-line: rgba(167, 139, 250, .6);
}
body.mw-cloud #view-video.ve-pro .primary-btn, body.mw-cloud #capModal .primary-btn, body.mw-cloud #capModal .cap-generate,
body.mw-cloud .cloud-gate-go, body.mw-cloud .cloud-files-bar .primary-btn {
  background: linear-gradient(135deg, #a855f7 0%, #7c3aed 100%); border-color: transparent; color: #fff;
  box-shadow: 0 1px 0 rgba(255,255,255,.18) inset, 0 6px 18px rgba(124, 58, 237, .32);
}
body.mw-cloud #view-video.ve-pro .primary-btn:hover:not(:disabled), body.mw-cloud #capModal .primary-btn:hover { filter: brightness(1.08); }
body.mw-cloud #view-video.ve-pro .ve-play { box-shadow: 0 6px 18px rgba(124, 58, 237, .35); }
body.mw-cloud input[type="range"], body.mw-cloud input[type="checkbox"], body.mw-cloud input[type="radio"] { accent-color: #8b5cf6; }
body.mw-cloud .cloud-gate { background: radial-gradient(900px 500px at 50% -10%, rgba(139, 92, 246, .22), transparent 60%), var(--bg); }
body.mw-cloud #cloudPass:focus { border-color: #8b5cf6; box-shadow: 0 0 0 3px rgba(139, 92, 246, .25); }

/* ===================================================================== */
/*  THE PHONE — an editor laid out like the apps people already know     */
/* ===================================================================== */

/*
 * The phone used to get the desk, stacked into one long page: picture,
 * toolbar, timeline, settings, scrolled past with a thumb. It worked, and it
 * read like a website. This is laid out the way CapCut, VN and InShot are —
 * because that is what everyone who makes shorts on a phone already knows:
 *
 *   ┌ top bar ── files · saved ············· quality · EXPORT ┐
 *   │                    the picture, as big as it can be      │
 *   │ 0:07 / 1:24 ·········· ▶ ·············· CC ↶ ↷ ⛶       │
 *   │ the timeline — film, text, captions, sound, music        │
 *   └ the tool dock — AI Shorts · Captions · Edit · Text … ────┘
 *
 * Nothing is taken away. The desk's buttons are all still on the page (the
 * studio's own code drives them, and its tests look for them); the dock and
 * the sheets press those very buttons, and the settings column and the shorts
 * list come up as sheets over the timeline instead of sitting under it, so the
 * picture stays on screen while you work. See installPhoneEditor in
 * cloud-boot.js for the other half.
 */

.cloud-dock, .cloud-sheet-head, .cloud-export-sheet,
.cloud-q, .cloud-export, .cloud-tr-extra { display: none; }

@media (max-width: 900px) {
  body.mw-cloud {
    --ph-bg: #000;
    --ph-panel: #141519;
    --ph-panel-2: #1d1e24;
    --ph-line: #2a2b32;
    --ph-text: #f5f6f8;
    --ph-muted: #9b9ea8;
    /* the studio's purple: a fill for buttons and badges, a lighter one for
       icons and text lit on black, and the AI gradient */
    --ph-accent: #8b5cf6;
    --ph-accent-fill: linear-gradient(135deg, #a855f7 0%, #7c3aed 100%);
    --ph-accent-glow: 0 4px 18px rgba(139, 92, 246, .45);
    --ph-accent-text: #b79cff;
    --ph-accent-ink: #fff;
    --ph-ai: linear-gradient(135deg, #e879f9 0%, #8b5cf6 55%, #6366f1 100%);
    --ph-top: calc(52px + env(safe-area-inset-top));
    --ph-tr: 42px;
    --ph-tl: clamp(140px, 26dvh, 232px);
    /* The tools stand on the home bar's clearance, as CapCut's do: on an
       iPhone that is 34pt, and CapCut's labels end just above it. */
    --ph-safe-b: max(4px, env(safe-area-inset-bottom));
    --ph-dock: calc(58px + var(--ph-safe-b));
    --ph-sheet: calc(var(--ph-tl) + var(--ph-dock));
    background: var(--ph-bg);
    /* Apple's own face on an iPhone (what CapCut uses there), Roboto on Android. */
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Roboto, "Segoe UI", system-ui, sans-serif;
    -webkit-font-smoothing: antialiased;
    -webkit-tap-highlight-color: transparent;
    -webkit-user-select: none;
    user-select: none;
  }
  body.mw-cloud button, body.mw-cloud select, body.mw-cloud input, body.mw-cloud textarea { font-family: inherit; }
  body.mw-cloud.mw-sheet-tall { --ph-sheet: min(78dvh, calc(100dvh - var(--ph-top) - 120px)); }
  /* A home-screen install made before the status bar went opaque: iOS gives it
     a window that stops a status bar short of the screen, with the home bar
     down in the dead strip below (vpFix in cloud-boot.js). The dock keeps
     tight to the bottom it was given rather than leaving more air above it. */
  html.mw-vpshort body.mw-cloud { --ph-safe-b: 2px; }
  body.mw-cloud input, body.mw-cloud textarea, body.mw-cloud [contenteditable] { -webkit-user-select: text; user-select: text; }

  /* ---------------------------------------------------------- the frame */

  body.mw-cloud #app { padding-top: var(--ph-top); }
  body.mw-cloud .content { padding: 0; overflow: hidden; background: var(--ph-bg); }
  body.mw-cloud #view-video.ve-pro {
    display: flex; flex-direction: column;
    height: 100%; min-height: 0;
    /* never a scroll box on a phone: anything that scrolled it (a lane brought
       into view) slid the preview up under the top bar, cutting off its top */
    overflow: hidden;
    padding-bottom: var(--ph-dock);
    background: var(--ph-bg);
  }
  body.mw-cloud #view-video.ve-pro .ve-main,
  body.mw-cloud #view-video.ve-pro .ve-monitors,
  body.mw-cloud #view-video.ve-pro .ve-left { display: contents; }
  body.mw-cloud #view-video.ve-pro .ve-source,
  body.mw-cloud #view-video.ve-pro .ve-mon-head,
  body.mw-cloud #view-video.ve-pro .ve-tl-split,
  body.mw-cloud #view-video.ve-pro .ve-topbar,
  body.mw-cloud #view-video.ve-pro .ve-tl-bar,
  body.mw-cloud #view-video.ve-pro .ve-tl-labels { display: none; }
  body.mw-cloud .cloud-touchbar { display: none !important; }

  /* ------------------------------------------------------------ top bar */

  body.mw-cloud .cloud-bar {
    height: var(--ph-top);
    padding: env(safe-area-inset-top) 10px 0;
    gap: 6px;
    background: var(--ph-bg);
    border-bottom: 0;
    backdrop-filter: none;
  }
  body.mw-cloud .cloud-brand { display: none; }
  body.mw-cloud .cloud-bar-actions { display: contents; }
  body.mw-cloud #cloudFiles { order: 1; }
  body.mw-cloud #cloudDownloads { order: 2; }
  body.mw-cloud #cloudLink { order: 3; margin-right: auto; font-size: 9px; }
  body.mw-cloud #cloudHelp { display: none; }
  body.mw-cloud #cloudJobsChip { order: 9; }
  body.mw-cloud .cloud-q { order: 10; }
  body.mw-cloud .cloud-export { order: 11; }

  body.mw-cloud .cloud-chip {
    width: 40px; height: 40px; padding: 0;
    display: grid; place-items: center;
    background: transparent; border: 0; border-radius: 12px;
    color: var(--ph-text); font-size: 0;
  }
  body.mw-cloud .cloud-chip:active { background: var(--ph-panel-2); }
  body.mw-cloud .cloud-chip .mi { width: 22px; height: 22px; margin: 0; }
  body.mw-cloud .cloud-chip .cloud-chip-tx { display: none; }
  body.mw-cloud .cloud-badge {
    position: absolute; top: 3px; right: 1px; margin: 0;
    min-width: 16px; height: 16px; font-size: 10px;
    background: var(--ph-accent); color: var(--ph-accent-ink);
  }

  /* The quality pill and Export are a pair: one height, one corner, one type
     size, centred on the same line. (The pill is a <label>, and the desk gives
     every label a 12px bottom margin — which lifted it 6px above Export.) */
  body.mw-cloud .cloud-q {
    display: flex; align-items: center; position: relative;
    height: 34px; margin: 0; padding: 0 26px 0 12px;
    background: var(--ph-panel-2); border-radius: 10px;
    color: var(--ph-text); font-size: 14px; font-weight: 700; line-height: 1;
  }
  body.mw-cloud .cloud-q::after {
    content: ''; position: absolute; right: 11px; top: 50%; margin-top: -2px;
    border: 4px solid transparent; border-top-color: currentColor;
  }
  body.mw-cloud .cloud-q select {
    position: absolute; inset: 0; width: 100%; height: 100%;
    opacity: 0; font-size: 16px; cursor: pointer;
  }
  body.mw-cloud .cloud-export {
    display: flex; align-items: center; justify-content: center;
    height: 34px; margin: 0 0 0 2px; padding: 0 16px;
    background: var(--ph-accent-fill); color: var(--ph-accent-ink);
    box-shadow: 0 2px 12px rgba(139, 92, 246, .38);
    border: 0; border-radius: 10px;
    font-size: 14px; font-weight: 700; line-height: 1; letter-spacing: .1px;
    cursor: pointer;
  }
  body.mw-cloud .cloud-export:active { filter: brightness(.88); }

  /* ------------------------------------------------------------ picture */

  body.mw-cloud #view-video.ve-pro .ve-preview {
    order: 3;
    position: relative;
    flex: 1 1 auto;
    min-height: 140px;
    height: auto;
    margin: 0;
    border: 0;
    border-radius: 0;
    background: var(--ph-bg);
  }
  /* The text style bar: a strip along the bottom of the picture, scrolled
     sideways, instead of a centred box wider than the phone. */
  body.mw-cloud #view-video.ve-pro .ve-text-tools {
    top: auto; bottom: 0; left: 0; right: 0; transform: none;
    display: flex; flex-wrap: nowrap; align-items: center; gap: 8px;
    max-width: none; border-radius: 0;
    padding: 8px 10px;
    overflow-x: auto; scrollbar-width: none;
    background: rgba(12,13,16,.94);
    border: 0; border-top: 1px solid var(--ph-line);
  }
  body.mw-cloud #view-video.ve-pro .ve-text-tools::-webkit-scrollbar { display: none; }
  body.mw-cloud #view-video.ve-pro .ve-text-tools > * { flex: none; }
  body.mw-cloud #view-video.ve-pro .ve-text-tools.hidden { display: none; }
  body.mw-cloud #view-video.ve-pro .ve-text-tools select,
  body.mw-cloud #view-video.ve-pro .ve-text-tools input[type=number] { font-size: 16px; height: 36px; }
  body.mw-cloud #view-video.ve-pro .ve-text-tools button { height: 36px; min-width: 40px; }
  body.mw-cloud #view-video.ve-pro #veResume {
    position: fixed; z-index: 60;
    top: calc(var(--ph-top) + 8px); left: 10px; right: 10px;
    border-radius: 12px;
  }
  body.mw-cloud #view-video.ve-pro .ve-novid { color: var(--ph-muted); }

  /* ---------------------------------------------------------- transport */

  /* CapCut's row: full screen on the left, play in the middle, captions,
     undo and redo on the right — and the time on its own small line above
     the timeline it belongs to. The desk's two wrappers step aside
     (display: contents) so each control can take its own place on the grid. */
  body.mw-cloud #view-video.ve-pro .ve-transport {
    order: 4;
    flex: 0 0 auto;
    display: grid;
    /* three slots each side of play, so play sits at the true centre */
    grid-template-columns: repeat(3, 40px) 1fr 52px 1fr repeat(3, 40px);
    grid-template-rows: var(--ph-tr) 18px;
    grid-template-areas:
      "full . . . play . cc undo redo"
      "time time time time time time time time time";
    align-items: center;
    column-gap: 2px;
    margin: 0;
    padding: 0 6px;
    background: var(--ph-bg);
    border: 0;
    border-radius: 0;
    overflow: visible;
  }
  body.mw-cloud #view-video.ve-pro .ve-transport-center,
  body.mw-cloud #view-video.ve-pro .ve-transport-right,
  body.mw-cloud #view-video.ve-pro .cloud-tr-extra { display: contents; }
  body.mw-cloud #view-video.ve-pro #veBack5,
  body.mw-cloud #view-video.ve-pro #veFwd5,
  body.mw-cloud #view-video.ve-pro #veBigger,
  body.mw-cloud #view-video.ve-pro .ve-transport label.ve-loop:has(#veLoopSel) { display: none; }

  body.mw-cloud #view-video.ve-pro #veFull { grid-area: full; }
  body.mw-cloud #view-video.ve-pro #vePlay { grid-area: play; }
  body.mw-cloud #view-video.ve-pro .ve-transport label.ve-loop:has(#veCapShow) { grid-area: cc; }
  body.mw-cloud #view-video.ve-pro .cloud-tr-extra [data-press="#veUndo"] { grid-area: undo; }
  body.mw-cloud #view-video.ve-pro .cloud-tr-extra [data-press="#veRedo"] { grid-area: redo; }

  body.mw-cloud #view-video.ve-pro .ve-transport .ve-time {
    grid-area: time;
    align-self: end;
    min-width: 0;
    padding: 0 8px 2px;
    font-family: inherit;
    font-size: 11px; font-weight: 600;
    color: #c4c6cc;
    font-variant-numeric: tabular-nums;
    letter-spacing: .2px;
    white-space: nowrap;
  }
  body.mw-cloud #view-video.ve-pro #vePlay {
    justify-self: center;
    width: 48px; height: 44px;
    background: transparent; border: 0; border-radius: 12px; box-shadow: none;
    color: var(--ph-text); font-size: 22px;
  }
  body.mw-cloud #view-video.ve-pro #vePlay:active { background: var(--ph-panel-2); }
  body.mw-cloud #view-video.ve-pro #vePlay .mi { width: 25px; height: 25px; margin: 0; }
  body.mw-cloud #view-video.ve-pro #veFull,
  body.mw-cloud #view-video.ve-pro .cloud-tr-extra button {
    width: 38px; height: 38px; padding: 0;
    display: grid; place-items: center;
    background: transparent; border: 0; border-radius: 10px;
    color: var(--ph-text); font-size: 17px;
  }
  body.mw-cloud #view-video.ve-pro .cloud-tr-extra button:disabled { color: #4a4c55; }
  body.mw-cloud #view-video.ve-pro .cloud-tr-extra .mi,
  body.mw-cloud #view-video.ve-pro #veFull .mi { width: 20px; height: 20px; margin: 0; }
  /* Captions on/off: a small "CC" badge, lit when they show on the picture. */
  body.mw-cloud #view-video.ve-pro .ve-transport label.ve-loop:has(#veCapShow) {
    position: relative;
    justify-self: center;
    height: 22px; margin: 0; padding: 0 5px;
    display: inline-flex; align-items: center;
    border-radius: 5px;
    border: 1.6px solid #5a5c64;
    color: #5a5c64;
    font-size: 10px; font-weight: 900; letter-spacing: .4px;
  }
  body.mw-cloud #view-video.ve-pro .ve-transport label.ve-loop input { position: absolute; opacity: 0; pointer-events: none; }
  body.mw-cloud #view-video.ve-pro .ve-transport label.ve-loop:has(input:checked) { color: var(--ph-text); border-color: var(--ph-text); }

  /* ----------------------------------------------------------- timeline */

  body.mw-cloud #view-video.ve-pro .ve-timeline {
    order: 6;
    flex: 0 0 var(--ph-tl);
    height: auto; min-height: 0;
    margin: 0;
    border: 0; border-top: 1px solid var(--ph-line); border-radius: 0;
    background: #0a0a0c;
    overflow-x: hidden; overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
  }
  /*
   * ►► SIDEWAYS ONLY, SO UP-AND-DOWN REACHES THE TIMELINE. ◄◄
   * `overflow-y: visible` beside `overflow-x: auto` is computed as AUTO, so this
   * row was a vertical scroller too — with nothing to scroll. iOS hands a swipe
   * to the innermost scroller and keeps it there: the finger bounced this row
   * and the timeline behind it, the one with the music lane below the fold,
   * never moved. Hidden makes it a sideways-only scroller (a carousel), and
   * vertical swipes go up to .ve-timeline, which is the one that scrolls.
   */
  body.mw-cloud #view-video.ve-pro .ve-tl-scroll {
    padding: 2px 10px 18px;
    overflow-y: hidden;
    min-height: 0; height: auto;
    touch-action: pan-x pan-y;
    scrollbar-width: none;
  }
  /* more lanes below the fold: a soft edge says so */
  body.mw-cloud #view-video.ve-pro .ve-timeline.cloud-tl-more {
    -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 22px), rgba(0,0,0,.35));
    mask-image: linear-gradient(to bottom, #000 calc(100% - 22px), rgba(0,0,0,.35));
  }
  body.mw-cloud #view-video.ve-pro .ve-tl-scroll::-webkit-scrollbar { display: none; }
  body.mw-cloud #view-video.ve-pro .ve-ruler { height: 22px; border-bottom-color: transparent; }
  body.mw-cloud #view-video.ve-pro .ve-tick { border-left-color: #2b2c33; }
  body.mw-cloud #view-video.ve-pro .ve-tick span { top: 4px; font-size: 9.5px; color: #8b8e98; }
  body.mw-cloud #view-video.ve-pro .ve-track { background: #121317; border-radius: 6px; }
  body.mw-cloud #view-video.ve-pro .ve-seg { border-width: 2px; border-radius: 6px; }
  body.mw-cloud #view-video.ve-pro .ve-seg.sel { border-color: #fff !important; box-shadow: 0 0 0 1px #fff inset; }
  body.mw-cloud #view-video.ve-pro .ve-seg-label { font-size: 10.5px; top: 4px; left: 5px; }
  body.mw-cloud #view-video.ve-pro .ve-seg-h { width: 18px; }
  body.mw-cloud #view-video.ve-pro .ve-seg-h.l::after, body.mw-cloud #view-video.ve-pro .ve-seg-h.r::after { left: 6px; height: 22px; background: #fff; }
  body.mw-cloud #view-video.ve-pro .ve-text-track { height: 26px; margin-top: 5px; background: #121317; }
  body.mw-cloud #view-video.ve-pro .ve-cap-track { height: 32px; margin-top: 5px; background: #121317; }
  body.mw-cloud #view-video.ve-pro .ve-cap-clip, body.mw-cloud #view-video.ve-pro .ve-cap-run { top: 2px; height: 28px; border-radius: 5px; }
  body.mw-cloud #view-video.ve-pro .ve-cap-edge { width: 14px; }
  body.mw-cloud #view-video.ve-pro .ve-audio-track { height: 36px; margin-top: 5px; background: #121317; }
  body.mw-cloud #view-video.ve-pro .ve-music-track { height: 28px; margin-top: 5px; background: #121317; }
  /*
   * Only the rows with something in them, as CapCut shows it. The overlay
   * row is folded away until a clip is on it (the studio always keeps one
   * empty overlay row to drop onto — on a phone "To overlay" in the Overlay
   * tools does that job); text, captions and music appear once they exist.
   */
  body.mw-cloud #view-video.ve-pro .ve-track:not(:has(.ve-seg-ov)) {
    margin-top: -39px;                       /* 4px gap − the 43px empty row */
    clip-path: inset(43px 0 0 0);
  }
  body.mw-cloud #view-video.ve-pro .ve-lane-hint { display: none; }
  body.mw-cloud #view-video.ve-pro .ve-text-track:empty,
  body.mw-cloud #view-video.ve-pro .ve-cap-track:not(:has(.ve-cap-clip, .ve-cap-run)),
  body.mw-cloud #view-video.ve-pro .ve-music-track:not(:has(.ve-music-seg)),
  body.mw-cloud #view-video.ve-pro .ve-sfx-track:not(.has) { display: none; }
  body.mw-cloud #view-video.ve-pro .ve-sfx-track { height: 28px; margin-top: 5px; background: #121317; }
  body.mw-cloud .ve-sfx-grid { grid-template-columns: repeat(3, 1fr); }
  body.mw-cloud #view-video.ve-pro .ve-seg-label { background: rgba(0,0,0,.45); font-weight: 700; }

  /* CapCut's white ＋, at the END of the video row (placed by cloud-boot.js) */
  .cloud-tl-add { display: none; }
  body.mw-cloud #view-video.ve-pro .cloud-tl-add {
    display: grid; place-items: center;
    position: absolute; z-index: 6; left: 0; top: 0;
    width: 34px; height: 34px; padding: 0; margin: 0;
    background: #fff; color: #000;
    border: 0; border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,.6);
  }
  body.mw-cloud #view-video.ve-pro .cloud-tl-add .mi { width: 20px; height: 20px; margin: 0; }
  /* the room past the last clip is .cloud-tl-tail, a block cloud-boot.js sizes
     (iOS will not scroll into padding); it also leaves air under the last lane */
  .cloud-tl-tail { display: none; }
  body.mw-cloud #view-video.ve-pro .cloud-tl-tail { display: block; height: 10px; pointer-events: none; }

  body.mw-cloud #view-video.ve-pro .ve-playhead { width: 2px; background: #fff; box-shadow: 0 0 6px rgba(0,0,0,.7); }
  body.mw-cloud #view-video.ve-pro .ve-playhead::before { left: -5px; border-width: 6px; border-top-color: #fff; }

  /* --------------------------------------------------------------- dock */

  body.mw-cloud .cloud-dock {
    display: block;
    position: fixed; left: 0; right: 0; bottom: 0;
    z-index: 200;
    height: var(--ph-dock);
    padding-bottom: var(--ph-safe-b);
    background: var(--ph-bg);
    border-top: 1px solid var(--ph-line);
  }
  .cloud-dock-row {
    display: none;
    height: 58px;
    align-items: center;
    overflow-x: auto; overflow-y: hidden;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    padding: 0 4px;
  }
  .cloud-dock-row::-webkit-scrollbar { display: none; }
  .cloud-dock-row.on { display: flex; }
  .cloud-tool {
    position: relative;
    flex: 0 0 auto;
    min-width: 64px; height: 54px;
    padding: 4px 6px 0;
    display: flex; flex-direction: column; align-items: center; gap: 5px;
    background: transparent; border: 0; border-radius: 12px;
    color: #e4e5e9;
    font-weight: 500; font-size: 11.5px; line-height: 1.15; font-family: inherit;
    letter-spacing: .1px;
    white-space: nowrap;
    cursor: pointer;
  }
  .cloud-tool .mi { width: 24px; height: 24px; margin: 0; }
  .cloud-tool:active { background: var(--ph-panel-2); }
  .cloud-tool:disabled { color: #4a4c55; }
  .cloud-tool.on { color: var(--ph-accent-text); }
  .cloud-tool.cloud-tool-hidden { display: none; }
  .cloud-tool-ai {
    position: absolute; top: 1px; left: calc(50% + 4px);
    padding: 1px 5px; border-radius: 6px;
    background: var(--ph-ai); color: #fff;
    font-size: 8.5px; font-weight: 900; letter-spacing: .3px;
  }
  .cloud-tool-count {
    position: absolute; top: 1px; left: calc(50% + 6px);
    min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px;
    display: grid; place-items: center;
    background: var(--ph-accent); color: var(--ph-accent-ink);
    font-size: 10px; font-weight: 900;
  }
  .cloud-tool-back {
    min-width: 46px; margin-right: 4px;
    border-right: 1px solid var(--ph-line); border-radius: 0;
  }
  .cloud-tool-back .mi { width: 26px; height: 26px; }
  .cloud-tool-ratio b { font-size: 13px; font-weight: 800; height: 24px; display: grid; place-items: center; }

  /* ------------------------------------------------------------- sheets */

  /* A sheet takes the timeline and the dock's place and leaves the picture
     and the play button where they are — tap a short, watch it, tap another. */
  body.mw-cloud #view-video.ve-pro .ve-bin,
  body.mw-cloud #view-video.ve-pro .ve-side { display: none; }

  body.mw-cloud.mw-sheet-shorts #view-video .ve-bin,
  body.mw-cloud.mw-sheet-insp #view-video .ve-side,
  body.mw-cloud.mw-sheet-export .cloud-export-sheet {
    display: block;
    position: fixed; left: 0; right: 0; bottom: 0;
    z-index: 210;
    height: var(--ph-sheet);
    width: auto; max-width: none; min-width: 0;
    margin: 0;
    padding: 50px 12px calc(14px + env(safe-area-inset-bottom));
    overflow-y: auto; overflow-x: hidden;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    background: var(--ph-panel);
    border: 0; border-radius: 18px 18px 0 0;
    box-shadow: 0 -12px 40px rgba(0,0,0,.6);
    animation: cloudSheetUp .2s ease-out;
  }
  @keyframes cloudSheetUp { from { transform: translateY(24px); opacity: .4; } to { transform: none; opacity: 1; } }

  body.mw-cloud.mw-sheet .cloud-sheet-head {
    display: flex; align-items: center; gap: 8px;
    position: fixed; left: 0; right: 0; z-index: 215;
    bottom: calc(var(--ph-sheet) - 48px);
    height: 48px;
    padding: 0 8px 0 16px;
    background: var(--ph-panel);
    border-radius: 18px 18px 0 0;
    animation: cloudSheetUp .2s ease-out;
  }
  .cloud-sheet-head::before {
    content: ''; position: absolute; top: 6px; left: 50%; margin-left: -18px;
    width: 36px; height: 4px; border-radius: 2px; background: #3a3b43;
  }
  .cloud-sheet-title { flex: 1; font-size: 15px; font-weight: 800; color: var(--ph-text); }
  .cloud-sheet-head button {
    width: 38px; height: 38px; padding: 0;
    display: grid; place-items: center;
    background: transparent; border: 0; border-radius: 10px;
    color: var(--ph-text);
  }
  .cloud-sheet-head button .mi { width: 22px; height: 22px; margin: 0; }
  .cloud-sheet-head .cloud-sheet-done { background: var(--ph-panel-2); }

  /* The shorts list, in the sheet. Once the AI has made shorts they come
     first — the reason for opening the sheet — with "caption them all" over
     them and the AI's own button, to look again, after them. */
  body.mw-cloud.mw-sheet-shorts #view-video.ve-pro .ve-bin { display: flex; flex-direction: column; gap: 10px; }
  body.mw-cloud #view-video.ve-pro .ve-bin:has(#veClipList .ve-clip) #veCapShorts { order: -2; }
  body.mw-cloud #view-video.ve-pro .ve-bin:has(#veClipList .ve-clip) #veClipList { order: -1; }
  body.mw-cloud #view-video.ve-pro .ve-bin:has(#veClipList .ve-clip) .ve-find { order: 2; }
  body.mw-cloud #view-video.ve-pro .ve-bin:has(#veClipList .ve-clip) #veBulkBox { order: -3; }
  /* "Export all" sits in the sheet's own header, by its title (a button
     there presses the desk's one, which is folded away with its heading). */
  body.mw-cloud #view-video.ve-pro .ve-bin .ve-side-head { display: none; }
  /* (named with its parent: ".cloud-sheet-head button" would otherwise show it
     in every sheet, unstyled) */
  .cloud-sheet-head .cloud-sheet-act { display: none; }
  body.mw-cloud.mw-sheet-shorts .cloud-sheet-head .cloud-sheet-act {
    display: inline-flex; align-items: center; gap: 6px;
    width: auto; height: 34px; padding: 0 12px;
    background: var(--ph-accent-fill); color: var(--ph-accent-ink);
    font-size: 13px; font-weight: 800;
  }
  body.mw-cloud.mw-sheet-shorts .cloud-sheet-head .cloud-sheet-act .mi { width: 17px; height: 17px; }
  body.mw-cloud.mw-sheet-shorts .cloud-sheet-head .cloud-sheet-act:disabled,
  body.mw-cloud.mw-sheet-shorts .cloud-sheet-head .cloud-sheet-act.cloud-tool-hidden { display: none; }
  body.mw-cloud #view-video.ve-pro .ve-bin .ve-side-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 0 0 10px; }
  body.mw-cloud #view-video.ve-pro .ve-bin .ve-side-head h3 { display: none; }
  body.mw-cloud #view-video.ve-pro .ve-bin .ve-side-head #veExportAll { margin-left: auto; }
  body.mw-cloud #view-video.ve-pro .ve-find { gap: 10px; }
  body.mw-cloud #view-video.ve-pro #veFindHighlights {
    width: 100%; min-height: 48px; border-radius: 14px;
    background: var(--ph-ai); border: 0; color: #fff;
    font-size: 15px; font-weight: 800;
  }
  body.mw-cloud #view-video.ve-pro #veFindHighlights:disabled { opacity: .45; }
  body.mw-cloud #view-video.ve-pro #veCapShorts { width: 100%; min-height: 44px; border-radius: 12px; font-weight: 800; }
  body.mw-cloud #view-video.ve-pro #veCapShorts {
    background: rgba(139, 92, 246, .12); border: 1.5px solid rgba(167, 139, 250, .5); color: #dccdff;
  }
  body.mw-cloud #view-video.ve-pro #veCapShorts:disabled { opacity: .45; }
  body.mw-cloud #view-video.ve-pro .ve-cliplist { max-height: none; overflow: visible; gap: 10px; }
  body.mw-cloud #view-video.ve-pro .ve-clip {
    background: var(--ph-panel-2); border: 1.5px solid transparent; border-radius: 14px;
    padding: 10px 10px 8px;
  }
  body.mw-cloud #view-video.ve-pro .ve-clip:hover { transform: none; }
  body.mw-cloud #view-video.ve-pro .ve-clip.sel { border-color: var(--ph-accent); box-shadow: none; }
  body.mw-cloud #view-video.ve-pro .ve-clip-thumb { width: 44px; height: 78px; border-radius: 8px; }
  body.mw-cloud #view-video.ve-pro .ve-clip-name { font-size: 14.5px; font-weight: 800; }
  body.mw-cloud #view-video.ve-pro .ve-clip-btns { gap: 6px; }
  body.mw-cloud #view-video.ve-pro .ve-clip-btns .icon-btn { height: 40px; border-radius: 10px; background: #26272e; border: 0; color: var(--ph-text); }

  /* The settings column, in the sheet: its tabs become a segmented control. */
  body.mw-cloud #view-video.ve-pro .ve-side .ve-insp-tabs {
    position: sticky; top: -50px; z-index: 3;
    display: flex; gap: 4px;
    margin: -50px -12px 12px; padding: 50px 12px 8px;
    background: var(--ph-panel);
    border: 0;
    overflow-x: auto; scrollbar-width: none;
  }
  body.mw-cloud #view-video.ve-pro .ve-side .ve-insp-tabs::-webkit-scrollbar { display: none; }
  body.mw-cloud #view-video.ve-pro .ve-side .ve-insp-tabs button {
    flex: 1 0 auto;
    display: flex; flex-direction: row; align-items: center; justify-content: center; gap: 6px;
    height: 36px; padding: 0 12px;
    border-radius: 10px; border: 0;
    background: var(--ph-panel-2); color: var(--ph-muted);
    font-size: 12.5px; font-weight: 700;
  }
  body.mw-cloud #view-video.ve-pro .ve-side .ve-insp-tabs button.on { background: var(--ph-text); color: #000; }
  body.mw-cloud #view-video.ve-pro .ve-side .ve-insp-tabs button::after { display: none; }
  body.mw-cloud #view-video.ve-pro .ve-side .ve-insp-body { overflow: visible; padding: 0; }
  body.mw-cloud #view-video.ve-pro .ve-side .primary-btn.ve-insp-wide,
  body.mw-cloud #view-video.ve-pro #veAutoCaptions { min-height: 48px; border-radius: 14px; font-size: 15px; font-weight: 800; }

  /* The export sheet. */
  .cloud-export-sheet { color: var(--ph-text); }
  .cloud-xp-main {
    width: 100%; min-height: 56px; margin: 0 0 10px;
    display: flex; align-items: center; gap: 12px; padding: 0 16px;
    border: 0; border-radius: 14px;
    background: var(--ph-accent-fill); color: var(--ph-accent-ink);
    box-shadow: var(--ph-accent-glow);
    font-size: 15.5px; font-weight: 800; text-align: left;
    cursor: pointer;
  }
  .cloud-xp-main.alt { background: var(--ph-panel-2); color: var(--ph-text); box-shadow: none; }
  .cloud-xp-main .mi { width: 22px; height: 22px; margin: 0; }
  .cloud-xp-main small { display: block; font-size: 11.5px; font-weight: 600; opacity: .75; margin-top: 2px; }
  .cloud-xp-main:disabled { opacity: .4; }
  .cloud-xp-row {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    min-height: 50px; padding: 0 4px;
    border-bottom: 1px solid var(--ph-line);
    font-size: 14px; font-weight: 600;
  }
  .cloud-xp-row select {
    background: var(--ph-panel-2); color: var(--ph-text);
    border: 0; border-radius: 10px; padding: 8px 10px; font-size: 16px;
  }
  .cloud-xp-row input[type="checkbox"] { width: 22px; height: 22px; accent-color: var(--ph-accent); }
  /* CapCut's "Ending": the outro on the end of every short */
  .cloud-xp-ending {
    display: flex; align-items: center; gap: 12px;
    margin: 4px 0 6px; padding: 10px; border-radius: 16px;
    background: var(--ph-panel-2); border: 1px solid var(--ph-line);
  }
  .cloud-xp-ending.on { border-color: rgba(167,139,250,.45); background: linear-gradient(180deg, rgba(139,92,246,.14), rgba(139,92,246,.05)), var(--ph-panel-2); }
  .cloud-xp-end-thumb {
    flex: none; width: 64px; height: 40px; padding: 0; border: 0; border-radius: 10px; overflow: hidden;
    background: linear-gradient(135deg, #3b2a63, #1a1424); box-shadow: inset 0 0 0 1px rgba(255,255,255,.08);
  }
  .cloud-xp-end-thumb i { display: grid; place-items: center; width: 100%; height: 100%; background-size: cover; background-position: center; }
  .cloud-xp-ending:not(.has) .cloud-xp-end-thumb i::before { content: '+'; font-style: normal; font-size: 22px; font-weight: 400; color: #c4b5fd; }
  .cloud-xp-cover { margin-top: 8px; }
  .cloud-xp-chev { flex: none; display: grid; place-items: center; width: 28px; color: var(--ph-muted); }
  .cloud-xp-chev svg { width: 18px; height: 18px; }
  .cloud-xp-cover:not(.has) .cloud-xp-end-thumb i::before { content: ''; width: 22px; height: 22px; background: currentColor;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='16' rx='3'/%3E%3Ccircle cx='9' cy='10' r='2'/%3E%3Cpath d='M21 16l-5.5-5.5L7 19'/%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 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='16' rx='3'/%3E%3Ccircle cx='9' cy='10' r='2'/%3E%3Cpath d='M21 16l-5.5-5.5L7 19'/%3E%3C/svg%3E") center / contain no-repeat; color: #c4b5fd; }
  .cloud-xp-end-text { flex: 1; min-width: 0; padding: 0; border: 0; background: none; color: var(--ph-text); text-align: left; }
  .cloud-xp-end-text b { display: block; font-size: 15px; font-weight: 750; }
  .cloud-xp-end-text small { display: block; margin-top: 2px; font-size: 12.5px; color: var(--ph-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .cloud-switch { position: relative; flex: none; width: 50px; height: 30px; }
  .cloud-switch input { position: absolute; inset: 0; opacity: 0; margin: 0; width: 100%; height: 100%; cursor: pointer; z-index: 1; }
  .cloud-switch span { position: absolute; inset: 0; border-radius: 999px; background: #3a3842; transition: background .2s; }
  .cloud-switch span::after { content: ''; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(0,0,0,.35); transition: transform .22s cubic-bezier(.3,1.3,.5,1); }
  .cloud-switch input:checked + span { background: var(--ph-accent); }
  .cloud-switch input:checked + span::after { transform: translateX(20px); }
  .cloud-xp-link {
    display: block; width: 100%; margin-top: 12px; padding: 12px;
    background: transparent; border: 0; color: var(--ph-accent-text);
    font-size: 14px; font-weight: 700; text-align: center;
  }

  /* a control the dock just opened the effects panel at */
  body.mw-cloud .cloud-flash { animation: cloudFlash 1.4s ease-out; border-radius: 10px; }
  @keyframes cloudFlash { 0%, 40% { box-shadow: 0 0 0 2px var(--ph-accent); background: rgba(139,92,246,.16); } 100% { box-shadow: 0 0 0 2px transparent; background: transparent; } }
  body.mw-cloud .fx-side { z-index: 300; }

  /* --------------------------------------------- the studio's own modals */

  body.mw-cloud .cap-modal { place-items: end center; z-index: 300; }
  /* A sheet's top — its ✕ and Select — stays below the island: the progress
     pill of an export floats over everything, and a sheet tall enough to reach
     under it had a ✕ that could not be tapped ("I can't come out of this
     screen"). The island ends ~92px below the notch, more with a second line. */
  body.mw-cloud { --sheet-max: min(88vh, calc(100dvh - env(safe-area-inset-top) - 120px)); }
  body.mw-cloud .cap-box,
  body.mw-cloud .lib-box,
  body.mw-cloud .cut-box {
    width: 100%;
    max-width: 100%;
    max-height: var(--sheet-max);
    border-radius: 18px 18px 0 0;
    padding-bottom: env(safe-area-inset-bottom);
  }
  body.mw-cloud .cut-box { height: var(--sheet-max); }

  /* ------------------------------------------- the captions window, on a phone
   *
   * The desk lays this window out for a laptop: settings in a capped box that
   * scrolls on its own, then the looks, the fixing tools, the player, the
   * lines and the Save row. Squeezed to a phone it lost things: the Hearing
   * picker and the looks ran off the right edge, the tool rows touched the
   * sides, and the window was taller than the screen with nothing to scroll
   * it — so Cancel, Preview and "Save this short with captions" could not be
   * reached at all.
   *
   * Here it is a sheet pinned between the top bar and the bottom of the
   * screen (and the top of the keyboard, while a line is being typed), in
   * sections that each fit the width. A phone cannot show the settings, the
   * looks, the tools, the player and the lines at once without squeezing
   * every one of them, so "Style & settings" switches the sheet between two
   * views of the same window:
   *
   *   WORDS (folded)  the fixing tools, one row that slides sideways · the
   *                   player · THE LINES, which get every point left over
   *   STYLE (open)    the looks · the settings, as a grid of labelled fields
   *                   (and the lines too while there are none, because that
   *                   is where "Generate captions" is)
   *
   * Both keep the title, what it is set to, and Cancel / Preview / Save.
   *
   * Only placement changes. Every control is the same element with the same
   * id doing the same thing; the list is still the box that scrolls, so the
   * line being spoken is still followed as it plays.
   */
  body.mw-cloud #capModal .cap-box {
    position: fixed; left: 0; right: 0;
    top: calc(var(--ph-top) + 6px); bottom: var(--kb, 0px);
    width: auto; height: auto; max-height: none;
    padding-bottom: 0;
    background: var(--ph-panel);
    border: 0; border-top: 1px solid var(--ph-line);
    border-radius: 18px 18px 0 0;
  }
  body.mw-cloud #capModal .cap-head { flex: none; height: 52px; padding: 0 6px 0 16px; gap: 8px; }
  body.mw-cloud #capModal .cap-head h2 {
    display: block; flex: 1 1 auto; min-width: 0;
    font-size: 16px; font-weight: 700;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
  body.mw-cloud #capModal .cap-head h2 .mi { width: 19px; height: 19px; margin: 0 8px 0 0; vertical-align: -4px; }
  body.mw-cloud #capModal .cap-head .icon-btn { flex: none; width: 40px; height: 40px; padding: 0; border-radius: 12px; }

  /* what it is set to: one line that slides, and the switch for the settings */
  body.mw-cloud #capModal .cap-sum-row { flex: none; flex-wrap: nowrap; gap: 8px; padding: 8px 12px 8px 16px; border-bottom: 1px solid var(--ph-line); }
  body.mw-cloud #capModal .cap-sum-chips {
    flex: 1 1 auto; min-width: 0; display: flex; gap: 6px;
    overflow-x: auto; overflow-y: hidden; scrollbar-width: none;
    padding-right: 18px;
    -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 22px), transparent);
            mask-image: linear-gradient(90deg, #000 calc(100% - 22px), transparent);
  }
  body.mw-cloud #capModal .cap-sum-chips::-webkit-scrollbar { display: none; }
  body.mw-cloud #capModal .cap-sum-chip { flex: none; padding: 6px 10px; font-size: 12px; border-radius: 999px; }
  body.mw-cloud #capModal .cap-sum-toggle {
    flex: none; margin: 0; height: 34px; padding: 0 12px;
    font-size: 13px; font-weight: 600; white-space: nowrap; border-radius: 10px;
  }
  /* lit while the sheet is showing the style, so it reads as the way back */
  body.mw-cloud #capModal .cap-sum-toggle[aria-expanded="true"] {
    border-color: var(--ph-accent); background: rgba(139, 92, 246, .16); color: var(--ph-accent-text);
  }

  /* the two views */
  body.mw-cloud #capModal .cap-box.folded :is(.cap-controls, .cap-strip-row) { display: none; }
  body.mw-cloud #capModal .cap-box:not(.folded) :is(.cap-fix-row, .cap-player) { display: none; }
  body.mw-cloud #capModal .cap-box:not(.folded):has(#capList .cap-row) .cap-list { display: none; }
  body.mw-cloud #capModal .cap-box:not(.folded) .cap-strip-row { order: 1; }
  body.mw-cloud #capModal .cap-box:not(.folded) .cap-controls { order: 2; }
  body.mw-cloud #capModal .cap-box:not(.folded) .cap-list { order: 3; }
  body.mw-cloud #capModal .cap-box:not(.folded) .cap-foot { order: 4; }

  /* the settings: a grid of labelled fields, six columns so pairs sit side by side */
  body.mw-cloud #capModal .cap-controls {
    flex: 1 1 auto; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr));
    grid-auto-rows: min-content; align-content: start;
    gap: 14px 10px; align-items: end;
    max-height: none; min-height: 0;
    padding: 14px 16px 16px; overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain;
    border-bottom: 1px solid var(--ph-line);
  }
  body.mw-cloud #capModal .cap-controls > label {
    grid-column: span 3; min-width: 0; margin: 0;
    display: flex; flex-direction: column; align-items: stretch; gap: 6px;
    font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ph-muted);
  }
  body.mw-cloud #capModal .cap-controls > label select {
    width: 100%; height: 42px; margin: 0; padding: 0 30px 0 12px;
    font-size: 16px; font-weight: 500; letter-spacing: 0; text-transform: none;
    border-radius: 10px;
  }
  /* Pairs that belong together: the full-width Width slider goes after Colour,
     so Position is not left on a row by itself. */
  body.mw-cloud #capModal .cap-controls > label:has(#capFont) { order: 1; }
  body.mw-cloud #capModal .cap-controls > label:has(#capSize) { order: 2; }
  body.mw-cloud #capModal .cap-controls > label:has(#capWords) { order: 3; }
  body.mw-cloud #capModal .cap-controls > label:has(#capCase) { order: 4; }
  body.mw-cloud #capModal .cap-controls > label:has(#capPos) { order: 5; }
  body.mw-cloud #capModal .cap-controls > label:has(#capColor) { order: 6; }
  body.mw-cloud #capModal .cap-controls > label:has(#capWidth) { order: 7; }
  body.mw-cloud #capModal .cap-controls > label:has(#capTrans) { order: 8; }
  body.mw-cloud #capModal .cap-controls > label:has(#capStyleSel) { order: 9; }
  body.mw-cloud #capModal .cap-controls > label:has(#capModelSel) { order: 10; }
  /* the last row: how many lines, the look's sample (it opens every look), and the fine type */
  body.mw-cloud #capModal #capCount { order: 11; }
  body.mw-cloud #capModal #capStyleSample { order: 12; }
  body.mw-cloud #capModal #capFine { order: 13; }
  body.mw-cloud #capModal #capFineWrap { order: 14; }
  /* no lines yet: the settings share the sheet with "Generate captions" */
  body.mw-cloud #capModal .cap-box:not(:has(#capList .cap-row)) .cap-controls { flex: 0 1 auto; max-height: 32%; }
  body.mw-cloud #capModal .cap-controls > label:has(#capWidth) {
    grid-column: 1 / -1; flex-direction: row; flex-wrap: wrap; align-items: center; row-gap: 4px;
  }
  body.mw-cloud #capModal #capWidthV { order: 1; margin-left: auto; font-size: 13px; font-weight: 600; letter-spacing: 0; text-transform: none; color: var(--ph-text); }
  body.mw-cloud #capModal #capWidth { order: 2; flex: 1 1 100%; width: 100%; height: 28px; margin: 0; padding: 0; }
  body.mw-cloud #capModal #capColor { width: 100%; height: 42px; margin: 0; padding: 5px; border-radius: 10px; cursor: pointer; }
  body.mw-cloud #capModal input[type=color]::-webkit-color-swatch-wrapper { padding: 0; }
  body.mw-cloud #capModal input[type=color]::-webkit-color-swatch { border: 0; border-radius: 6px; }
  body.mw-cloud #capModal #capStyleSample { grid-column: span 1; width: 100%; min-width: 0; height: 42px; margin: 0; padding: 0; border-radius: 10px; font-size: 17px; }
  body.mw-cloud #capModal .cap-controls > label:has(#capModelSel) { grid-column: 1 / -1; }
  body.mw-cloud #capModal #capCount { grid-column: span 4; align-self: center; font-size: 13px; line-height: 1.3; color: var(--ph-muted); }
  body.mw-cloud #capModal #capFine { grid-column: span 1; width: 100%; height: 42px; margin: 0; padding: 0; border-radius: 10px; font-size: 16px; }
  body.mw-cloud #capModal #capFineWrap { grid-column: 1 / -1; flex-wrap: wrap; gap: 10px 18px; }
  body.mw-cloud #capModal #capFineWrap label { gap: 8px; font-size: 13px; color: var(--ph-muted); }
  body.mw-cloud #capModal #capFineWrap input { height: 38px; margin: 0; font-size: 16px; }

  /* the looks: the strip across the full width, the look's own options under it */
  body.mw-cloud #capModal .cap-strip-row {
    flex: none; flex-wrap: wrap; align-items: center; gap: 10px 14px;
    margin: 0; padding: 12px 16px; border-bottom: 1px solid var(--ph-line);
  }
  body.mw-cloud #capModal .cap-strip-label { flex: 1 1 100%; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ph-muted); }
  body.mw-cloud #capModal .cap-strip-row { border-bottom: 1px solid var(--ph-line); }
  body.mw-cloud #capModal .cap-style-strip {
    flex: 1 1 100%; min-width: 0; gap: 8px; padding: 2px 1px;
    overflow-x: auto; scrollbar-width: none; overscroll-behavior-x: contain;
  }
  body.mw-cloud #capModal .cap-style-strip::-webkit-scrollbar { display: none; }
  body.mw-cloud #capModal .cap-style-chip { min-width: 66px; padding: 8px 10px; gap: 4px; border-radius: 12px; background: var(--ph-panel-2); }
  body.mw-cloud #capModal .cap-style-chip.sel { border-color: var(--ph-accent); background: rgba(139, 92, 246, .14); }
  body.mw-cloud #capModal .cap-style-chip .cs-sample { font-size: 17px; }
  body.mw-cloud #capModal .cap-style-chip .cs-name { font-size: 11px; }
  body.mw-cloud #capModal .cap-strip-opt { font-size: 14px; gap: 8px; color: var(--ph-text); }
  body.mw-cloud #capModal .cap-strip-opt input[type=color] { width: 40px; height: 32px; border-radius: 8px; }
  body.mw-cloud #capModal .cap-strip-more { margin-left: auto; height: 36px; padding: 0 14px; font-size: 13.5px; font-weight: 600; border-radius: 10px; }

  /* the fixing tools: one row that slides sideways, clear of both edges */
  body.mw-cloud #capModal .cap-fix-row {
    flex: none; flex-wrap: nowrap; align-items: center; gap: 8px;
    margin: 0; padding: 10px 40px 10px 16px;
    overflow-x: auto; overflow-y: hidden; scrollbar-width: none; overscroll-behavior-x: contain;
    border-bottom: 1px solid var(--ph-line);
    -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 28px), transparent);
            mask-image: linear-gradient(90deg, #000 calc(100% - 28px), transparent);
  }
  body.mw-cloud #capModal .cap-fix-row::-webkit-scrollbar { display: none; }
  body.mw-cloud #capModal .cap-wb-btn { flex: none; height: 36px; padding: 0 13px; font-size: 13.5px; font-weight: 600; white-space: nowrap; border-radius: 18px; }
  body.mw-cloud #capModal .cap-fix-sep { flex: none; align-self: center; width: 1px; height: 22px; margin: 0 2px; }
  body.mw-cloud #capModal .cap-g-autolab { flex: none; gap: 6px; font-size: 13.5px; color: var(--ph-text); }
  body.mw-cloud #capModal .cap-g-mode { flex: none; height: 36px; padding: 0 28px 0 10px; font-size: 16px; border-radius: 10px; }

  /* the player */
  body.mw-cloud #capModal .cap-player { flex: none; gap: 8px 10px; margin: 0; padding: 10px 16px; border-width: 0 0 1px; border-radius: 0; }
  body.mw-cloud #capModal .cap-pl-btn { height: 36px; padding: 0 10px; font-size: 14px; }
  body.mw-cloud #capModal .cap-pl-play { width: 44px; height: 44px; }
  body.mw-cloud #capModal .cap-pl-time { min-width: 0; font-size: 12.5px; }
  body.mw-cloud #capModal .cap-pl-scrub { flex: 1 1 90px; min-width: 80px; }
  body.mw-cloud #capModal .cap-pl-rate { height: 36px; padding: 0 26px 0 10px; font-size: 16px; border-radius: 10px; }
  body.mw-cloud #capModal .cap-pl-opt { gap: 7px; font-size: 13.5px; color: var(--ph-text); }
  /* the box and the words say it; the little picture beside them only cost the room
     that kept both options on one line */
  body.mw-cloud #capModal .cap-pl-opt .mi { display: none; }

  /* every tick box in the window: a box, not the desk's full-width field */
  body.mw-cloud #capModal input[type=checkbox] {
    flex: none; width: 20px; height: 20px; margin: 0; padding: 0; border-radius: 5px;
    accent-color: var(--ph-accent);
  }

  /* the lines: everything left over goes to them */
  body.mw-cloud #capModal .cap-list { flex: 1 1 auto; min-height: 120px; padding: 10px 12px 14px; gap: 8px; overscroll-behavior: contain; }
  body.mw-cloud #capModal .cap-row { gap: 8px; padding: 2px; border-radius: 12px; }
  body.mw-cloud #capModal .cap-row-play { width: 34px; height: 34px; }
  body.mw-cloud #capModal .cap-row-play .mi { width: 13px; height: 13px; }
  body.mw-cloud #capModal .cap-time { flex: 0 0 38px; font-size: 12.5px; }
  body.mw-cloud #capModal .cap-text { height: 44px; padding: 0 12px; font-size: 16px; border-radius: 10px; }
  body.mw-cloud #capModal .cap-ai-line { width: 32px; height: 32px; opacity: .65; }
  body.mw-cloud #capModal .cap-sugg { width: calc(100% - 42px); margin: 0 0 4px 42px; }
  body.mw-cloud #capModal .cap-was { margin: 0 0 4px 42px; font-size: 13px; }
  /* the Word Book's footer: the count on its own line, the buttons sharing the width */
  body.mw-cloud #capModal .cap-wb-foot { flex-wrap: wrap; gap: 8px; padding: 10px 16px; }
  body.mw-cloud #capModal .cap-wb-foot #capWbCount { flex: 1 1 100%; font-size: 12.5px; line-height: 1.4; }
  body.mw-cloud #capModal .cap-wb-foot button { flex: 1 1 auto; min-width: 0; height: 40px; margin: 0; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  body.mw-cloud #capModal .cap-wb-io { padding-bottom: calc(10px + env(safe-area-inset-bottom)); }
  body.mw-cloud #capModal .cap-was-back { height: 32px; padding: 0 12px; font-size: 13px; }
  body.mw-cloud #capModal .cap-head .cap-undo { flex: none; width: 40px; height: 40px; padding: 0; border-radius: 12px; font-size: 20px; }
  /* no lines yet: "Generate captions" is the thing to press, so it is in view
     and as wide as the sheet, not under a paragraph and a big picture */
  body.mw-cloud #capModal .cap-empty-state { flex: none; min-height: 0; justify-content: flex-start; gap: 8px; padding: 6px 4px 4px; }
  body.mw-cloud #capModal .cap-empty-state > * { flex: none; }
  body.mw-cloud #capModal .cap-empty-ic { display: none; }
  body.mw-cloud #capModal .cap-empty-title { font-size: 15.5px; }
  body.mw-cloud #capModal .cap-empty-sub { font-size: 13px; line-height: 1.45; }
  body.mw-cloud #capModal .cap-generate {
    order: -1; align-self: stretch; height: 48px; margin: 0 0 4px; padding: 0 16px;
    font-size: 15.5px; border-radius: 12px;
    background: var(--ph-accent-fill); box-shadow: var(--ph-accent-glow);
  }

  /* Cancel and Preview side by side, Save across the full width under them */
  body.mw-cloud #capModal .cap-foot {
    flex: none; flex-direction: column; align-items: stretch; gap: 8px;
    padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
  }
  body.mw-cloud #capModal .cap-foot-hint { display: none; }
  body.mw-cloud #capModal .cap-foot-msg:not(:has(.cap-fix-note:not(:empty))) { display: none; }
  body.mw-cloud #capModal .cap-foot-msg .cap-fix-note { font-size: 12.5px; -webkit-line-clamp: 2; }
  body.mw-cloud #capModal .cap-foot-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  body.mw-cloud #capModal .cap-foot-btns button {
    min-width: 0; height: 44px; margin: 0; padding: 0 12px;
    font-size: 14.5px; font-weight: 600;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    border-radius: 12px;
  }
  body.mw-cloud #capModal #capBurn { grid-column: 1 / -1; height: 48px; font-size: 15.5px; font-weight: 700; }

  /* A short phone (an iPhone SE): the Save row is one line, so the lines keep
     their room. ✕ at the top does exactly what Cancel does (both close the
     window), and Preview keeps its eye and its tooltip. */
  @media (max-height: 760px) {
    body.mw-cloud #capModal .cap-foot-btns { grid-template-columns: 48px 1fr; }
    body.mw-cloud #capModal #capCancel { display: none; }
    body.mw-cloud #capModal #capPreview { width: 48px; height: 48px; padding: 0; font-size: 0; }
    body.mw-cloud #capModal #capPreview .mi { width: 21px; height: 21px; margin: 0; }
    body.mw-cloud #capModal #capBurn { grid-column: auto; padding: 0 8px; font-size: 14px; }
    body.mw-cloud #capModal .cap-box:not(:has(#capList .cap-row)) .cap-controls { max-height: 26%; }
  }

  /* Typing in a line with the keyboard up: the words and the player keep the
     room; the rows about the look and the Save row come back when it goes. */
  html.mw-kb body.mw-cloud #capModal:has(#capList .cap-text:focus) :is(.cap-sum-row, .cap-controls, .cap-strip-row, .cap-fix-row, .cap-foot) { display: none; }

  /* the gallery and the Word Book cover the sheet, as they cover the desk's window */
  body.mw-cloud #capModal .cap-style-picker, body.mw-cloud #capModal .cap-wb-panel { border-radius: 18px 18px 0 0; }
  body.mw-cloud .fx-side { left: 0; align-items: flex-end; }
  body.mw-cloud .fx-side .cap-box { width: 100%; height: auto; max-height: var(--sheet-max); border-radius: 18px 18px 0 0; }
  /* 🖼️ Thumbnail: a sheet from the bottom, the picture as big as fits */
  body.mw-cloud .thq-modal { place-items: end center; }
  body.mw-cloud .cap-box.thq { width: 100%; max-width: 100%; max-height: var(--sheet-max); border: 0 !important; border-top: 1px solid rgba(255,255,255,.07) !important;
    border-radius: 22px 22px 0 0 !important; padding-bottom: env(safe-area-inset-bottom) !important; animation: cloudSheetUp .25s ease-out; }
  body.mw-cloud .thq-head { padding-top: 22px; }
  body.mw-cloud .thq-grab { display: block; position: absolute; top: 7px; left: 50%; width: 38px; height: 5px; margin-left: -19px; border-radius: 3px; background: #3a3b43; }
  body.mw-cloud .thq-frame { height: min(40vh, 360px); }
  /* 🎛️ Video quality: a SHORT sheet, so the picture above it stays in view
     while a slider is dragged — the whole point of a live preview. */
  body.mw-cloud .fx-side .cap-box.fxq {
    max-height: min(var(--sheet-max), 58vh); border: 0; border-top: 1px solid rgba(255,255,255,.07); border-radius: 22px 22px 0 0;
    padding-bottom: env(safe-area-inset-bottom); box-shadow: 0 -20px 60px rgba(0,0,0,.55); animation: cloudSheetUp .25s ease-out;
  }
  body.mw-cloud .fxq-head { padding-top: 20px; }
  body.mw-cloud .fxq-grab { display: block; position: absolute; top: 7px; left: 50%; width: 38px; height: 5px; margin-left: -19px; border-radius: 3px; background: #3a3b43; }
  body.mw-cloud .fxq-pane { padding-bottom: 14px; }

  /* 16px stops iOS zooming the whole page when a field takes focus. */
  body.mw-cloud input[type="text"],
  body.mw-cloud input[type="number"],
  body.mw-cloud input[type="search"],
  body.mw-cloud textarea,
  body.mw-cloud select { font-size: 16px; }

  body.mw-cloud .overlay-box { width: 84vw; }
  /* Messages float over the bottom of the PICTURE, as CapCut's do — never over
     the timeline — and a finger goes straight through them: one sitting on a
     clip's edge for four seconds was a clip that could not be trimmed. */
  body.mw-cloud .toast {
    left: 14px; right: 14px; margin: 0 auto; width: fit-content; max-width: calc(100% - 28px);
    z-index: 400;
    pointer-events: none;
    bottom: calc(var(--ph-dock) + var(--ph-tl) + var(--ph-tr) + 30px);
    padding: 9px 15px 9px 9px;
    border-radius: 18px;
    font-size: 14px; line-height: 1.36;
  }
  body.mw-cloud.mw-sheet .toast { bottom: calc(var(--ph-sheet) + var(--ph-tr) + 30px); }
  /* a panel is up from the bottom: messages go to the top, off its controls */
  body.mw-cloud:has(.cap-modal:not(.hidden)) .toast { top: calc(var(--ph-top) + 8px); bottom: auto; }

  .cloud-files-box, .cloud-help-box { width: 100%; }
  body.mw-cloud .cloud-sheet-modal .cloud-files-box {
    width: 100%; max-width: 100%; max-height: var(--sheet-max);
    border: 0; border-top: 1px solid rgba(255,255,255,.07); border-radius: 22px 22px 0 0;
    padding-bottom: env(safe-area-inset-bottom);
    animation: cloudSheetUp .25s ease-out;
  }
  .cloud-files-top { padding-top: 22px; }
  .cloud-files-top::before {
    content: ''; position: absolute; top: 7px; left: 50%; width: 38px; height: 5px; margin-left: -19px;
    border-radius: 3px; background: #3a3b43;
  }
}

/* A phone on its side: less timeline, so the picture keeps some height. */
@media (max-width: 900px) and (orientation: landscape) {
  body.mw-cloud { --ph-tl: 34dvh; --ph-tr: 40px; --ph-dock: calc(54px + var(--ph-safe-b)); }
  .cloud-dock-row { height: 54px; }
  .cloud-tool { height: 54px; gap: 3px; }
}

/* ------------------------------------------------------- installed as an app */

@media (display-mode: standalone) {
  /* No address bar to lose the connection dot behind. */
  .cloud-bar { padding-top: max(env(safe-area-inset-top), 8px); }
}

/* ---- phone: the Continue-editing card and the empty studio ---- */
@media (max-width: 900px) {
  body.mw-cloud #view-video.ve-pro .ve-monitors > .ve-resume { top: 10px; left: 10px; right: 10px; width: auto; transform: none; padding: 12px; gap: 12px; border-radius: 18px; }
  body.mw-cloud #view-video.ve-pro .ve-resume-card { flex: 1 1 100%; }
  body.mw-cloud #view-video.ve-pro .ve-resume-thumb { width: 96px; height: 56px; }
  body.mw-cloud #view-video.ve-pro .ve-resume-btns { flex: 1 1 100%; }
  body.mw-cloud #view-video.ve-pro .ve-resume-btns button { flex: 1; height: 44px; border-radius: 13px; font-size: 15px; }
  body.mw-cloud #view-video.ve-pro .ve-novid { gap: 8px; padding: 0 24px; }
  body.mw-cloud #view-video.ve-pro .ve-novid .nv-desk { display: none; }
  body.mw-cloud #view-video.ve-pro .ve-novid .nv-phone { display: inline; }
  body.mw-cloud #view-video.ve-pro .ve-novid #veOpen2 { min-width: 160px; height: 44px; border-radius: 13px; margin-top: 6px; }
  body.mw-cloud #view-video.ve-pro .ve-novid.with-resume #veOpen2 { margin-top: 0; background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.12); color: #e9e6f0; box-shadow: none; }
}

/* ===================================================================== */
/*  THE ISLAND — every message, out of one black capsule at the top      */
/* ===================================================================== */

/*
 * It drops in from under the top bar and SPRINGS to the size of what it has
 * to say (cloud-boot.js measures the words and animates the width and height
 * to them); a new message while one is showing morphs the capsule rather than
 * stacking a second box. It is only ever at the top, so it never sits over a
 * clip's trim handle the way a box along the bottom did.
 */
body.mw-cloud #toast { display: none !important; }
.cloud-island {
  /* above everything, the full-screen viewer included (z-index 2000) */
  position: fixed; z-index: 2100;
  left: 50%; top: calc(46px + env(safe-area-inset-top) + 10px);
  width: 120px; height: 36px;
  transform: translate(-50%, -18px) scale(.8);
  opacity: 0; pointer-events: none;
  background: #050506; color: #f5f5f7;
  border-radius: 24px;
  box-shadow: 0 18px 50px rgba(0,0,0,.55), 0 2px 10px rgba(0,0,0,.45), inset 0 0 0 1px rgba(255,255,255,.08);
  overflow: hidden;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Roboto, "Segoe UI", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  transition: width .55s cubic-bezier(.3,1.22,.4,1), height .55s cubic-bezier(.3,1.22,.4,1),
              transform .5s cubic-bezier(.3,1.32,.4,1), opacity .2s ease;
}
.cloud-island.on { transform: translate(-50%, 0) scale(1); opacity: 1; pointer-events: auto; }
.cloud-island:not(.on) {
  transition: transform .3s cubic-bezier(.55,0,.75,.2), opacity .24s ease .04s, width .3s ease, height .3s ease;
}
.cloud-island.ci-tappable { cursor: pointer; }
.ci-body {
  position: absolute; left: 0; top: 0;
  display: flex; align-items: center; gap: 11px;
  box-sizing: border-box;
  width: max-content; max-width: min(calc(100vw - 24px), 440px);
  min-height: 36px;
  padding: 9px 16px 9px 9px;
  transition: opacity .16s ease, filter .16s ease, transform .22s ease;
}
.ci-body.swap { opacity: 0; filter: blur(6px); transform: scale(.96); }
.ci-body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Roboto, "Segoe UI", system-ui, sans-serif;
  color: #f5f5f7; -webkit-font-smoothing: antialiased;
}
.ci-probe { position: fixed; left: 0; top: 0; z-index: -1; visibility: hidden; pointer-events: none; transition: none; }
.ci-ic { flex: none; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; }
.ci-ic svg { width: 17px; height: 17px; }
.ci-ic.ci-good { background: rgba(48,209,88,.18); color: #4ade80; }
.ci-ic.ci-error { background: rgba(255,69,58,.2); color: #ff6b61; }
.ci-ic.ci-warn { background: rgba(255,179,64,.18); color: #ffbe55; }
.ci-ic.ci-info { background: rgba(167,139,250,.22); color: #cbbcff; }
.ci-tx { min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.ci-title { font-size: 14.5px; font-weight: 650; letter-spacing: -.1px; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ci-sub {
  font-size: 12.5px; line-height: 1.33; color: rgba(235,235,245,.62);
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.ci-act {
  flex: none; margin-left: 2px; height: 32px; padding: 0 15px;
  border: 0; border-radius: 16px;
  background: linear-gradient(135deg, #a855f7 0%, #7c3aed 100%); color: #fff;
  box-shadow: 0 4px 14px rgba(124,58,237,.45);
  font: inherit; font-size: 13.5px; font-weight: 700; letter-spacing: .1px;
  cursor: pointer;
}
.ci-act:active { filter: brightness(.88); }
.ci-chev { flex: none; width: 8px; height: 8px; margin: 0 2px 0 -2px; border: solid rgba(235,235,245,.45); border-width: 2px 2px 0 0; transform: rotate(45deg); }
.ci-spin { width: 16px; height: 16px; border-radius: 50%; border: 2px solid rgba(203,188,255,.3); border-top-color: #cbbcff; animation: ciSpin .8s linear infinite; }
@keyframes ciSpin { to { transform: rotate(360deg); } }

@media (max-width: 900px) {
  .cloud-island { top: calc(var(--ph-top) + 8px); }
  /* a panel or a studio modal is up: the island goes up over the dimmed bar */
  body.mw-cloud:has(.cap-modal:not(.hidden)) .cloud-island,
  body.mw-cloud.mw-panel .cloud-island { top: calc(env(safe-area-inset-top) + 6px); }
}

/* ===================================================================== */
/*  BACKGROUND JOBS — the chip, the line under the bar, the sheet        */
/* ===================================================================== */

/* On a phone the desk's corner box was behind the dock and the sheets. The
   chip and the jobs sheet are its replacement there; on a wide screen the
   corner box stays where it always was. */
@media (max-width: 900px) { body.mw-cloud #bgDock { display: none !important; } }

.cloud-jobchip {
  position: relative;
  display: inline-flex; align-items: center; gap: 6px;
  height: 32px; margin: 0; padding: 0 11px 0 7px;
  border: 1px solid rgba(167,139,250,.55); border-radius: 999px;
  background: linear-gradient(180deg, rgba(139,92,246,.34), rgba(139,92,246,.17));
  color: #f1ebff;
  font: inherit; font-size: 13px; font-weight: 750; line-height: 1; letter-spacing: .1px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap; cursor: pointer;
  animation: cjGlow 2.4s ease-in-out infinite;
  -webkit-tap-highlight-color: transparent;
}
.cloud-jobchip.hidden { display: none; }
.cloud-jobchip:active { transform: scale(.96); }
.cloud-jobchip .cj-ic { position: relative; width: 20px; height: 20px; display: grid; place-items: center; flex: none; }
.cj-ring { width: 20px; height: 20px; transform: rotate(-90deg); }
.cj-ring .rt { fill: none; stroke: rgba(255,255,255,.2); stroke-width: 2.8; }
.cj-ring .rf { fill: none; stroke: #fff; stroke-width: 2.8; stroke-linecap: round; transition: stroke-dasharray .45s ease; }
.cloud-jobchip .cj-tick, .cloud-jobchip .cj-bang { position: absolute; inset: 1px; width: 18px; height: 18px; display: none; }
.cj-n {
  display: grid; place-items: center;
  min-width: 17px; height: 17px; padding: 0 4px; margin-right: -4px;
  border-radius: 9px; background: #fff; color: #5b21b6;
  font-size: 10.5px; font-weight: 900;
}
.cj-n:empty { display: none; }
.cloud-jobchip[data-state="done"] {
  border-color: rgba(74,222,128,.55); color: #dcfce7; animation: none;
  background: linear-gradient(180deg, rgba(48,209,88,.28), rgba(48,209,88,.14));
}
.cloud-jobchip[data-state="fail"] {
  border-color: rgba(255,107,97,.6); color: #ffe1de; animation: none;
  background: linear-gradient(180deg, rgba(255,69,58,.3), rgba(255,69,58,.15));
}
.cloud-jobchip[data-state="done"] .cj-ring, .cloud-jobchip[data-state="fail"] .cj-ring { display: none; }
.cloud-jobchip[data-state="done"] .cj-tick { display: block; color: #4ade80; }
.cloud-jobchip[data-state="fail"] .cj-bang { display: block; color: #ff8a80; }
.cloud-jobchip.cj-pop { animation: cjPop .55s cubic-bezier(.3,1.6,.5,1), cjGlow 2.4s ease-in-out .55s infinite; }
.cloud-jobchip[data-state="done"].cj-pop, .cloud-jobchip[data-state="fail"].cj-pop { animation: cjPop .55s cubic-bezier(.3,1.6,.5,1); }
@keyframes cjPop { 0% { transform: scale(.6); opacity: .3; } 100% { transform: scale(1); opacity: 1; } }
@keyframes cjGlow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(139,92,246,0), 0 4px 14px rgba(124,58,237,.28); }
  50% { box-shadow: 0 0 0 4px rgba(139,92,246,.18), 0 4px 20px rgba(124,58,237,.5); }
}
.cloud-bar .cloud-jobchip { margin-right: 4px; }

/* the same number, as a line along the bottom of the top bar */
.cloud-bar-progress {
  position: absolute; left: 0; right: 0; bottom: -1px; height: 2px;
  transform-origin: left center; transform: scaleX(0);
  background: linear-gradient(90deg, #7c3aed, #a855f7 60%, #e879f9);
  box-shadow: 0 0 10px rgba(168,85,247,.8);
  opacity: 0; pointer-events: none;
  transition: transform .5s ease, opacity .3s ease;
}
.cloud-bar-progress.on { opacity: 1; }

/* ---------------------------------------------------------------- panels */

.cp-scrim {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.52);
  -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px);
  opacity: 0; transition: opacity .28s ease;
}
.cp-scrim.on { opacity: 1; }
.cp-panel {
  position: fixed; left: 0; right: 0; bottom: var(--kb, 0px);
  /* (its ✕ below the island, as the sheets above) */
  max-height: calc(100dvh - var(--kb, 0px) - env(safe-area-inset-top) - 120px);
  display: flex; flex-direction: column;
  background: #141519; color: #f5f6f8;
  border-radius: 22px 22px 0 0;
  box-shadow: 0 -20px 60px rgba(0,0,0,.6), inset 0 1px 0 rgba(255,255,255,.06);
  padding-bottom: env(safe-area-inset-bottom);
  transform: translateY(105%);
  transition: transform .4s cubic-bezier(.2,.95,.25,1);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Roboto, "Segoe UI", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}
.cp-panel.on { transform: none; }
.cp-panel button, .cp-panel input, .cp-panel textarea, .cp-panel select { font-family: inherit; }
.cp-head { position: relative; flex: none; display: flex; align-items: center; gap: 10px; padding: 20px 12px 10px 20px; touch-action: none; }
.cp-grab { position: absolute; top: 7px; left: 50%; width: 38px; height: 5px; margin-left: -19px; border-radius: 3px; background: #3a3b43; }
.cp-title { flex: 1; min-width: 0; margin: 0; font-size: 20px; font-weight: 800; letter-spacing: -.3px; color: #f5f6f8; }
.cp-x {
  flex: none; width: 32px; height: 32px; padding: 0;
  display: grid; place-items: center;
  border: 0; border-radius: 50%; background: #2a2b31; color: #c9cad1; cursor: pointer;
}
.cp-x svg { width: 15px; height: 15px; }
.cp-body {
  flex: 1 1 auto; min-height: 0;
  overflow-y: auto; overflow-x: hidden; -webkit-overflow-scrolling: touch; overscroll-behavior: contain;
  padding: 4px 16px 16px;
}
.cp-foot { flex: none; padding: 6px 16px 10px; }
.cp-foot:empty { display: none; }
.cp-link {
  width: 100%; height: 44px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 0; background: transparent; color: #b79cff;
  font-size: 14px; font-weight: 700; cursor: pointer;
}
.cp-link .mi { width: 17px; height: 17px; margin: 0; }
@media (min-width: 901px) {
  .cp-panel {
    left: 50%; right: auto; top: 50%; bottom: auto;
    width: min(560px, calc(100vw - 40px)); max-height: min(82vh, 780px);
    border-radius: 22px;
    transform: translate(-50%, -46%) scale(.97); opacity: 0;
    transition: transform .28s cubic-bezier(.2,.9,.3,1), opacity .2s ease;
  }
  .cp-panel.on { transform: translate(-50%, -50%); opacity: 1; }
  .cp-grab { display: none; }
}

/* ------------------------------------------------------------- jobs sheet */

.cj-card {
  margin-bottom: 10px; padding: 14px;
  background: #1d1e24; border: 1px solid #2a2b32; border-radius: 18px;
}
.cj-card.run {
  border-color: rgba(167,139,250,.38);
  background: linear-gradient(180deg, rgba(139,92,246,.14), rgba(139,92,246,.03) 70%), #1d1e24;
}
.cj-row { display: flex; align-items: center; gap: 12px; }
.cj-big { position: relative; flex: none; width: 50px; height: 50px; display: grid; place-items: center; }
.cj-ring-lg { position: absolute; inset: 0; width: 50px; height: 50px; transform: rotate(-90deg); }
.cj-ring-lg .rt { fill: none; stroke: rgba(255,255,255,.1); stroke-width: 4; }
.cj-ring-lg .rf { fill: none; stroke: #a78bfa; stroke-width: 4; stroke-linecap: round; transition: stroke-dasharray .5s ease; filter: drop-shadow(0 0 4px rgba(167,139,250,.6)); }
.cj-pc { position: relative; font-size: 12.5px; font-weight: 800; font-variant-numeric: tabular-nums; }
.cj-main { flex: 1; min-width: 0; }
.cj-title { font-size: 15.5px; font-weight: 750; line-height: 1.25; letter-spacing: -.1px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cj-step {
  margin-top: 3px; font-size: 13px; line-height: 1.38; color: #9b9ea8;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.cj-bar { margin-top: 13px; height: 6px; border-radius: 3px; background: rgba(255,255,255,.08); overflow: hidden; }
.cj-bar i {
  display: block; height: 100%; width: 2%; border-radius: 3px;
  background: linear-gradient(90deg, #7c3aed, #a855f7, #e879f9, #a855f7, #7c3aed); background-size: 200% 100%;
  animation: cjFlow 2.2s linear infinite;
  transition: width .5s ease;
}
@keyframes cjFlow { to { background-position: -200% 0; } }
.cj-meta {
  display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap;
  margin-top: 9px; font-size: 12px; color: #8a8d97; font-variant-numeric: tabular-nums;
}
.cj-btns { display: flex; gap: 8px; margin-top: 12px; }
.cj-btn {
  flex: 1; height: 42px;
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  border: 0; border-radius: 13px; background: #2a2b31; color: #f1f1f4;
  font-size: 14px; font-weight: 700; cursor: pointer;
}
.cj-btn .mi { width: 17px; height: 17px; margin: 0; }
.cj-btn.danger { background: rgba(255,69,58,.13); color: #ff7b71; }
.cj-btn.accent { background: linear-gradient(135deg, #a855f7 0%, #7c3aed 100%); color: #fff; box-shadow: 0 4px 16px rgba(124,58,237,.35); }
.cj-btn:disabled { opacity: .55; }
.cj-badge { flex: none; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; }
.cj-badge svg { width: 20px; height: 20px; }
.cj-card.done .cj-badge { background: rgba(48,209,88,.16); color: #4ade80; }
.cj-card.fail .cj-badge { background: rgba(255,69,58,.16); color: #ff6b61; }
.cj-card.stopped .cj-badge { background: rgba(255,255,255,.08); color: #b5b7bf; }
.cj-x { flex: none; width: 30px; height: 30px; padding: 0; border: 0; border-radius: 50%; background: transparent; color: #8a8d97; display: grid; place-items: center; cursor: pointer; }
.cj-x svg { width: 14px; height: 14px; }
.cj-files { list-style: none; margin: 12px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.cj-files li { display: flex; align-items: center; gap: 6px; padding: 7px 7px 7px 10px; background: rgba(255,255,255,.045); border-radius: 12px; }
.cj-fname { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; }
.cj-fname span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cj-fname .mi { flex: none; width: 16px; height: 16px; margin: 0; opacity: .55; }
.cj-mini {
  flex: none; height: 32px; padding: 0 11px;
  display: inline-flex; align-items: center; gap: 5px;
  border: 0; border-radius: 10px; background: #2c2d34; color: #ececf1;
  font-size: 12.5px; font-weight: 700; cursor: pointer;
}
.cj-mini.accent { background: rgba(139,92,246,.24); color: #e2d8ff; }
.cj-mini .mi { width: 14px; height: 14px; margin: 0; }
.cj-empty { text-align: center; padding: 22px 14px 26px; color: #9b9ea8; }
.cj-empty-art {
  width: 64px; height: 64px; margin: 0 auto 14px; border-radius: 20px;
  display: grid; place-items: center;
  background: linear-gradient(135deg, rgba(168,85,247,.28), rgba(99,102,241,.18)); color: #dccfff;
}
.cj-empty-art .mi { width: 30px; height: 30px; margin: 0; }
.cj-empty b { display: block; margin-bottom: 6px; font-size: 17px; color: #f5f6f8; }
.cj-empty p { max-width: 300px; margin: 0 auto; font-size: 13.5px; line-height: 1.45; }

/* ===================================================================== */
/*  HOME — the two rooms                                                 */
/* ===================================================================== */

.cloud-home, .cloud-sched, .cloud-proj { display: none; }
body.mw-cloud.mw-home .cloud-home,
body.mw-cloud.mw-sched .cloud-sched,
body.mw-cloud.mw-projects .cloud-proj {
  display: flex; flex-direction: column;
  position: fixed; inset: 0; z-index: 250;
  background: radial-gradient(1100px 520px at 85% -12%, rgba(139,92,246,.20), transparent 60%), #000;
  color: #f5f6f8;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Roboto, "Segoe UI", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  -webkit-user-select: none; user-select: none;
  animation: chIn .28s ease-out;
}
@keyframes chIn { from { opacity: .4; transform: scale(.985); } to { opacity: 1; transform: none; } }
.cloud-home button, .cloud-sched button, .cloud-proj button { font-family: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.cloud-home .hidden, .cloud-sched .hidden, .cloud-proj .hidden { display: none !important; }

.ch-top, .cs-top {
  flex: none; display: flex; align-items: center; gap: 10px;
  height: calc(54px + env(safe-area-inset-top));
  padding: env(safe-area-inset-top) 14px 0 16px;
  box-sizing: border-box;
}
.ch-top { justify-content: space-between; }
.ch-brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.ch-logo {
  flex: none; width: 34px; height: 34px; border-radius: 11px;
  display: grid; place-items: center;
  background: linear-gradient(135deg, #a855f7, #6366f1); color: #fff; font-size: 17px;
  box-shadow: 0 6px 18px rgba(139,92,246,.45), inset 0 1px 0 rgba(255,255,255,.3);
}
.ch-name { font-size: 15.5px; font-weight: 750; letter-spacing: -.15px; white-space: nowrap; }
.ch-acts { display: flex; align-items: center; gap: 8px; }
.ch-round {
  width: 38px; height: 38px; padding: 0; border: 0; border-radius: 50%;
  display: grid; place-items: center; background: #1a1b21; color: #e8e8ee;
}
.ch-round .mi { width: 19px; height: 19px; margin: 0; }
.ch-scroll, .cs-scroll {
  flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden;
  -webkit-overflow-scrolling: touch; overscroll-behavior: contain;
  width: 100%; max-width: 760px; margin: 0 auto; box-sizing: border-box;
  padding: 4px 16px calc(30px + env(safe-area-inset-bottom));
}
.ch-hello h1 {
  margin: 12px 2px 3px; font-size: 31px; font-weight: 800; letter-spacing: -.7px; line-height: 1.12;
  background: linear-gradient(92deg, #fff 30%, #d8c8ff); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.ch-hello p { margin: 0 2px 18px; color: #9b9ea8; font-size: 15.5px; }

.ch-card {
  position: relative; isolation: isolate; overflow: hidden;
  display: grid; grid-template-columns: auto 1fr; grid-template-areas: "art copy" "foot foot";
  gap: 16px 14px; align-items: center;
  width: 100%; min-height: 176px; margin: 0 0 14px; padding: 18px;
  border: 0; border-radius: 28px;
  color: #fff; text-align: left;
  transition: transform .18s ease;
}
.ch-card:active { transform: scale(.985); }
.ch-studio {
  background: linear-gradient(140deg, #9b6bff 0%, #7c3aed 42%, #4338ca 100%);
  box-shadow: 0 22px 44px rgba(109,40,217,.38), inset 0 1px 0 rgba(255,255,255,.25);
}
.ch-social {
  background: linear-gradient(140deg, #2a1640 0%, #3a1838 52%, #4a1b2e 100%);
  box-shadow: 0 22px 44px rgba(0,0,0,.45), inset 0 0 0 1px rgba(255,255,255,.08);
}
.ch-glow { position: absolute; z-index: -1; width: 300px; height: 300px; right: -110px; top: -120px; border-radius: 50%; pointer-events: none; }
.ch-studio .ch-glow { background: radial-gradient(circle, rgba(240,171,252,.6), transparent 64%); }
.ch-social .ch-glow { background: radial-gradient(circle, rgba(251,113,133,.5), rgba(168,85,247,.18) 45%, transparent 66%); }
.ch-card::after {
  content: ''; position: absolute; z-index: -1; inset: auto -40px -70px auto; width: 210px; height: 210px; border-radius: 50%;
  border: 1.5px solid rgba(255,255,255,.12); box-shadow: 0 0 0 26px rgba(255,255,255,.035), 0 0 0 54px rgba(255,255,255,.02);
}
.ch-art {
  grid-area: art; width: 56px; height: 56px; border-radius: 18px;
  display: grid; place-items: center;
  background: rgba(255,255,255,.18); box-shadow: inset 0 0 0 1px rgba(255,255,255,.25), 0 8px 18px rgba(0,0,0,.18);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
.ch-art .mi { width: 28px; height: 28px; margin: 0; }
.ch-social .ch-art { background: linear-gradient(135deg, rgba(251,113,133,.42), rgba(168,85,247,.42)); }
.ch-copy { grid-area: copy; min-width: 0; }
.ch-copy b { display: block; font-size: 22px; font-weight: 800; letter-spacing: -.4px; }
.ch-copy small { display: block; margin-top: 4px; font-size: 13.5px; line-height: 1.4; color: rgba(255,255,255,.8); }
.ch-foot {
  grid-area: foot; display: flex; align-items: center; gap: 10px;
  padding: 10px 10px 10px 14px; border-radius: 17px;
  background: rgba(0,0,0,.24); box-shadow: inset 0 0 0 1px rgba(255,255,255,.08);
  font-size: 14px; font-weight: 650;
}
.ch-foot-tx { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ch-marks, .cs-marks { display: flex; gap: 4px; flex: none; }
.ch-arrow { flex: none; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: rgba(255,255,255,.2); }
.ch-arrow .mi { width: 17px; height: 17px; margin: 0; }

.ch-sec { margin-top: 24px; }
.ch-sec h2 {
  display: flex; align-items: center; justify-content: space-between;
  margin: 0 2px 11px; font-size: 18px; font-weight: 800; letter-spacing: -.25px;
}
.ch-link { padding: 0; border: 0; background: none; color: #b79cff; font-size: 14px; font-weight: 700; }
.ch-job {
  display: flex; align-items: center; gap: 12px;
  width: 100%; margin-bottom: 8px; padding: 12px;
  border: 1px solid rgba(167,139,250,.32); border-radius: 20px;
  background: linear-gradient(180deg, rgba(139,92,246,.16), rgba(139,92,246,.04)), #121317;
  color: #fff; text-align: left;
}
.ch-job-ring {
  --p: 0; flex: none; width: 46px; height: 46px; border-radius: 50%;
  display: grid; place-items: center;
  background: conic-gradient(#a78bfa calc(var(--p) * 1%), rgba(255,255,255,.1) 0);
  transition: --p .4s;
}
.ch-job-ring i { width: 37px; height: 37px; border-radius: 50%; display: grid; place-items: center; background: #15161b; font-style: normal; font-size: 11.5px; font-weight: 800; font-variant-numeric: tabular-nums; }
.ch-job-tx { flex: 1; min-width: 0; }
.ch-job-tx b { display: block; font-size: 15px; font-weight: 750; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ch-job-tx small { display: block; margin-top: 2px; font-size: 12.5px; color: #9b9ea8; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ch-job .ch-arrow { background: rgba(255,255,255,.08); }

.ch-reel {
  display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory;
  margin: 0 -16px; padding: 2px 16px 6px; scrollbar-width: none;
}
.ch-reel::-webkit-scrollbar { display: none; }
.ch-tile { flex: none; width: 130px; scroll-snap-align: start; }
.ch-tile-pic {
  display: block; width: 130px; height: 206px; border-radius: 18px;
  background: linear-gradient(160deg, #23242b, #15161b) center / cover no-repeat;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.07), 0 10px 24px rgba(0,0,0,.4);
}
.ch-tile-name { display: block; margin: 9px 2px 7px; font-size: 13px; font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ch-tile-go {
  width: 100%; height: 34px; border: 0; border-radius: 12px;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  background: rgba(139,92,246,.22); color: #e6dcff; font-size: 13px; font-weight: 750;
}
.ch-tile-go .mi { width: 15px; height: 15px; margin: 0; }
/* Projects: every video being edited, to pick up again (home + the Projects sheet) */
.ch-projsec { margin: 16px 0 22px; }
.pj-list { display: flex; flex-direction: column; gap: 8px; }
.pj-row { display: flex; align-items: center; gap: 6px; border-radius: 18px; background: #15161b; box-shadow: inset 0 0 0 1px rgba(255,255,255,.07); }
.pj-row.now { box-shadow: inset 0 0 0 1.5px rgba(167,139,250,.7); }
.pj-row.missing { opacity: .5; }
.pj-main { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; padding: 10px; border: 0; background: none; color: #fff; text-align: left; font: inherit; }
.pj-pic { flex: none; width: 52px; height: 52px; border-radius: 12px; display: grid; place-items: center;
  background: linear-gradient(160deg, #2a2340, #17151f) center / cover no-repeat; color: #a78bfa; }
.pj-pic[style*="background-image"] .mi { display: none; }
.pj-pic .mi { width: 22px; height: 22px; margin: 0; }
.pj-tx { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.pj-tx b { font-size: 15px; font-weight: 750; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pj-tx small { font-size: 12.5px; color: #9b9ea8; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pj-now { font-style: normal; color: #c4b5fd; font-weight: 700; }
.pj-go { flex: none; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: rgba(255,255,255,.08); }
.pj-go .mi { width: 16px; height: 16px; margin: 0; }
.pj-more { flex: none; width: 40px; height: 40px; border: 0; border-radius: 12px; display: grid; place-items: center; background: rgba(255,255,255,.06); color: #d8d9df; }
.pj-more:last-child { margin-right: 8px; }
.pj-more .mi { width: 18px; height: 18px; margin: 0; }
.pj-del { color: #ff8a80; }
.pj-hint { margin: 0 2px 12px; font-size: 13px; color: #9b9ea8; }
.pj-empty { padding: 30px 12px; text-align: center; color: #9b9ea8; }
.pj-empty b { display: block; margin: 10px 0 6px; font-size: 17px; color: #f5f6f8; }
.pj-empty-art { display: inline-grid; place-items: center; width: 56px; height: 56px; border-radius: 18px; background: rgba(139,92,246,.18); color: #c4b5fd; }
.pj-empty-art .mi { width: 26px; height: 26px; margin: 0; }
.pj-new { width: 100%; min-height: 52px; border: 0; border-radius: 16px; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: linear-gradient(135deg, #a855f7 0%, #7c3aed 100%); color: #fff; font: inherit; font-size: 15px; font-weight: 800; box-shadow: 0 4px 18px rgba(139, 92, 246, .4); }
.pj-new .mi { width: 18px; height: 18px; margin: 0; }
/* the Projects screen (Video Studio's front door) */
.pv-scroll { padding-bottom: calc(28px + env(safe-area-inset-bottom)); }
.pv-new { width: 100%; display: flex; align-items: center; gap: 14px; margin: 6px 0 14px; padding: 16px; border: 0; border-radius: 22px; text-align: left; color: #fff;
  background: linear-gradient(135deg, #a855f7 0%, #7c3aed 60%, #5b21b6 100%); box-shadow: 0 10px 30px rgba(124,58,237,.42); }
.pv-new-art { flex: none; width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; background: rgba(255,255,255,.2); }
.pv-new-art .mi { width: 26px; height: 26px; margin: 0; }
.pv-new-tx { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.pv-new-tx b { font-size: 18px; font-weight: 800; }
.pv-new-tx small { font-size: 13px; opacity: .85; }
.pv-cur { margin-bottom: 6px; }
.pv-cont { width: 100%; display: grid; grid-template-columns: 1fr auto; grid-template-rows: auto auto; column-gap: 10px; padding: 14px 16px; border: 0; border-radius: 18px; text-align: left; color: #fff;
  background: #15161b; box-shadow: inset 0 0 0 1.5px rgba(167,139,250,.7); }
.pv-cont-k { grid-column: 1; font-size: 12px; font-weight: 700; color: #c4b5fd; text-transform: uppercase; letter-spacing: .4px; }
.pv-cont b { grid-column: 1; font-size: 16px; font-weight: 750; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pv-cont-go { grid-column: 2; grid-row: 1 / 3; align-self: center; display: inline-flex; align-items: center; gap: 4px; padding: 8px 12px; border-radius: 12px; background: rgba(139,92,246,.3); font-size: 14px; font-weight: 750; }
.pv-cont-go .mi { width: 15px; height: 15px; margin: 0; }
.pv-h { display: flex; align-items: baseline; gap: 8px; margin: 18px 2px 10px; font-size: 18px; font-weight: 800; }
.pv-h small { font-size: 14px; color: #9b9ea8; font-weight: 700; }
.pv-none { margin: 4px 2px; font-size: 13px; color: #9b9ea8; }
.cloud-proj .pj-row { background: #121317; }
.ch-foot-note { margin: 26px 0 0; text-align: center; font-size: 12px; color: #5f626c; }

/* the studio's way home, where Files used to sit on a phone */
.cloud-home-btn .mi { margin-right: 6px; }
@media (max-width: 900px) {
  body.mw-cloud #cloudFiles { display: none; }
  body.mw-cloud #cloudHomeBtn, body.mw-cloud #cloudProjBtn { order: 1; }
  body.mw-cloud .cloud-bar .cloud-chip, body.mw-cloud .cloud-bar .cloud-jobchip,
  body.mw-cloud .cloud-q, body.mw-cloud .cloud-export { flex: none; }
}
/* a narrow phone with a job running: Saved steps aside for the chip (it is in
   the jobs sheet and the Project row as well), so Export never leaves the screen */
@media (max-width: 380px) {
  body.mw-cloud .cloud-bar:has(#cloudJobsChip:not(.hidden)) #cloudDownloads { display: none; }
  body.mw-cloud .cloud-q { padding: 0 22px 0 10px; }
  body.mw-cloud .cloud-q::after { right: 8px; }
  body.mw-cloud .cloud-export { padding: 0 13px; }
}
@media (max-width: 340px) {
  body.mw-cloud .cloud-bar:has(#cloudJobsChip:not(.hidden)) #cloudLink { display: none; }
}

/* ===================================================================== */
/*  THE SCHEDULER                                                        */
/* ===================================================================== */

.cs-top { padding-left: 6px; }
.cs-top h1 { flex: 1; min-width: 0; margin: 0; font-size: 21px; font-weight: 800; letter-spacing: -.35px; }
.cs-back { width: 42px; height: 42px; padding: 0; border: 0; border-radius: 12px; background: none; color: #fff; display: grid; place-items: center; }
.cs-back .mi { width: 26px; height: 26px; margin: 0; }
.cs-new {
  flex: none; height: 36px; padding: 0 14px 0 11px; border: 0; border-radius: 12px;
  display: inline-flex; align-items: center; gap: 6px;
  background: linear-gradient(135deg, #a855f7, #7c3aed); color: #fff;
  font-size: 14px; font-weight: 750;
  box-shadow: 0 4px 16px rgba(124,58,237,.42);
}
.cs-new .mi { width: 17px; height: 17px; margin: 0; }

.cs-accts {
  display: flex; gap: 14px; overflow-x: auto; scrollbar-width: none;
  margin: 2px -16px 12px; padding: 6px 16px 4px;
}
.cs-accts::-webkit-scrollbar { display: none; }
.cs-acct {
  flex: none; width: 66px; padding: 0; border: 0; background: none; color: #d8d9df;
  display: flex; flex-direction: column; align-items: center; gap: 7px;
}
.cs-ava {
  position: relative; width: 56px; height: 56px; border-radius: 50%;
  display: grid; place-items: center; background: #23242b;
  box-shadow: 0 0 0 2px #000, 0 0 0 3.5px rgba(167,139,250,.65);
}
.cs-ava img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.cs-ava b { font-size: 21px; font-weight: 800; }
.cs-ava > .mi { width: 22px; height: 22px; margin: 0; }
.cs-acct-name { max-width: 66px; font-size: 11.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cs-acct-add .cs-ava { background: transparent; box-shadow: inset 0 0 0 1.5px #3c3d45; color: #b9bac2; }
.cs-mark { display: inline-block; flex: none; width: 22px; height: 22px; }
.cs-mark svg { display: block; width: 100%; height: 100%; border-radius: 30%; }
.cs-mark.sm { width: 18px; height: 18px; }
.cs-mark.lg { width: 42px; height: 42px; }
.cs-mark.badge { position: absolute; right: -4px; bottom: -4px; width: 22px; height: 22px; border-radius: 7px; box-shadow: 0 0 0 2.5px #000; }

.cs-tabs {
  position: sticky; top: -4px; z-index: 2;
  display: flex; gap: 6px; padding: 6px 0 10px; background: #000;
}
.cs-tabs button {
  flex: 1; height: 38px; padding: 0 6px; border: 0; border-radius: 12px;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  background: #16171c; color: #9b9ea8; font-size: 13.5px; font-weight: 700; white-space: nowrap;
}
.cs-tabs button.on { background: #f5f6f8; color: #000; }
.cs-tabs button i {
  min-width: 20px; height: 20px; padding: 0 6px; box-sizing: border-box; border-radius: 10px;
  display: grid; place-items: center;
  background: rgba(139,92,246,.26); color: #dccfff; font-style: normal; font-size: 11.5px; font-weight: 800;
}
.cs-tabs button.on i { background: #7c3aed; color: #fff; }
.cs-tabs button.alert i { background: #ff453a; color: #fff; }
.cs-day { margin: 18px 2px 9px; font-size: 12.5px; font-weight: 800; letter-spacing: .7px; text-transform: uppercase; color: #8a8d97; }
.cs-list > .cs-day:first-child { margin-top: 6px; }
.cs-post {
  display: flex; gap: 12px; width: 100%; margin-bottom: 10px; padding: 10px;
  border: 0; border-radius: 20px; background: #121317; color: #fff; text-align: left;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.055);
}
.cs-post:active { background: #18191e; }
.cs-pic {
  flex: none; width: 68px; height: 106px; border-radius: 13px;
  display: grid; place-items: center; color: #6b6e78;
  background: linear-gradient(160deg, #23242b, #17181d) center / cover no-repeat;
}
.cs-pic .mi { width: 22px; height: 22px; margin: 0; }
.cs-post-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; padding: 2px 2px 0 0; }
.cs-post-when { display: flex; align-items: baseline; gap: 8px; font-size: 13.5px; font-weight: 800; color: #c9b8ff; }
.cs-post-when i { font-style: normal; font-size: 12px; font-weight: 600; color: #8a8d97; }
.cs-post-title { font-size: 15.5px; font-weight: 750; line-height: 1.3; letter-spacing: -.1px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.cs-post-cap { font-size: 13px; color: #9b9ea8; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cs-post-foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding-top: 4px; }
.cs-state { flex: none; padding: 4px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 800; letter-spacing: .2px; }
.cs-state.booked, .cs-state.posted { background: rgba(48,209,88,.16); color: #4ade80; }
.cs-state.planned { background: rgba(139,92,246,.2); color: #cbbcff; }
.cs-state.posting { background: rgba(10,132,255,.2); color: #6cb8ff; }
.cs-state.failed { background: rgba(255,69,58,.17); color: #ff7166; }
.cs-state.retry { background: rgba(255,179,64,.17); color: #ffbe55; }
.cs-empty { padding: 34px 16px; text-align: center; color: #9b9ea8; }
.cs-empty-art { display: inline-flex; gap: 8px; margin-bottom: 16px; }
.cs-empty-art .cs-mark { width: 46px; height: 46px; filter: drop-shadow(0 8px 16px rgba(0,0,0,.5)); }
.cs-empty-art.solo {
  width: 70px; height: 70px; border-radius: 23px; display: inline-grid; place-items: center;
  background: linear-gradient(135deg, rgba(168,85,247,.3), rgba(99,102,241,.2)); color: #dccfff;
}
.cs-empty-art.solo .mi { width: 32px; height: 32px; margin: 0; }
.cs-empty b { display: block; margin-bottom: 6px; font-size: 19px; color: #fff; letter-spacing: -.25px; }
.cs-empty p { max-width: 330px; margin: 0 auto 18px; font-size: 14px; line-height: 1.5; }
.cs-cta {
  height: 48px; padding: 0 22px; border: 0; border-radius: 15px;
  display: inline-flex; align-items: center; gap: 8px;
  background: linear-gradient(135deg, #a855f7, #7c3aed); color: #fff;
  font-size: 15.5px; font-weight: 800; box-shadow: 0 8px 24px rgba(124,58,237,.45);
}
.cs-cta .mi { width: 18px; height: 18px; margin: 0; }

/* ---------------------------------------------- composer, accounts, post */

.cp-panel .cs-form { display: flex; flex-direction: column; }
.cs-sec { padding: 12px 0 14px; border-bottom: 1px solid #22232a; }
.cs-sec:last-child { border-bottom: 0; }
.cs-sec h4, .cs-h4 { margin: 0 0 11px; font-size: 12px; font-weight: 800; letter-spacing: .8px; text-transform: uppercase; color: #8a8d97; }
.cs-h4 { margin-top: 22px; }
.cs-h4.first { margin-top: 4px; }
.cs-pick { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.cs-pick-btn {
  display: flex; flex-direction: column; align-items: flex-start; gap: 6px;
  padding: 15px 14px; border: 0; border-radius: 18px; background: #1c1d23; color: #fff; text-align: left;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.06); cursor: pointer;
}
.cs-pick-btn .mi { width: 26px; height: 26px; margin: 0 0 4px; color: #b79cff; }
.cs-pick-btn b { font-size: 15px; font-weight: 750; }
.cs-pick-btn small { font-size: 12px; line-height: 1.35; color: #9b9ea8; }
.cs-media { display: flex; gap: 10px; overflow-x: auto; scrollbar-width: none; padding: 2px; }
.cs-media::-webkit-scrollbar { display: none; }
.cs-m { position: relative; flex: none; }
.cs-m-pic {
  display: grid; place-items: center; width: 98px; height: 154px; border-radius: 15px;
  background: linear-gradient(160deg, #23242b, #17181d) center / cover no-repeat;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.07);
}
.cs-media.many .cs-m-pic { width: 74px; height: 116px; }
.cs-m-play { width: 30px; height: 30px; border-radius: 50%; background: rgba(0,0,0,.5); position: relative; }
.cs-m-play::after { content: ''; position: absolute; left: 11px; top: 8px; border: 7px solid transparent; border-left: 11px solid #fff; border-right: 0; }
.cs-m-x {
  position: absolute; top: 5px; right: 5px; width: 24px; height: 24px; padding: 0;
  border: 0; border-radius: 50%; background: rgba(0,0,0,.7); color: #fff; font-size: 17px; line-height: 1; cursor: pointer;
}
.cs-m-add {
  flex: none; width: 74px; border: 1.5px dashed #3c3d45; border-radius: 15px; background: none; color: #b9bac2;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  font-size: 12px; font-weight: 700; cursor: pointer;
}
.cs-m-add .mi { width: 20px; height: 20px; margin: 0; }
.cs-label { display: block; margin: 6px 2px 7px; font-size: 13px; font-weight: 700; color: #dcdde3; }
.cs-label small { font-weight: 500; color: #8a8d97; }
.cs-input {
  display: block; width: 100%; box-sizing: border-box; margin: 0;
  padding: 12px 14px; border: 1px solid #2c2d34; border-radius: 14px;
  background: #1c1d23; color: #f5f6f8;
  font-size: 16px; line-height: 1.42; outline: none;
  -webkit-user-select: text; user-select: text;
}
.cs-input:focus { border-color: #8b5cf6; box-shadow: 0 0 0 3px rgba(139,92,246,.25); }
.cs-input::placeholder { color: #6b6e78; }
textarea.cs-cap { min-height: 118px; resize: vertical; }
.cs-sec .cs-input + .cs-label { margin-top: 14px; }
.cs-cap-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 9px; }
.cs-ai {
  height: 38px; padding: 0 14px; border: 0; border-radius: 12px;
  display: inline-flex; align-items: center; gap: 7px;
  background: linear-gradient(135deg, rgba(232,121,249,.22), rgba(99,102,241,.22)); color: #eedfff;
  box-shadow: inset 0 0 0 1px rgba(232,121,249,.38);
  font-size: 13.5px; font-weight: 750; cursor: pointer;
}
.cs-ai .mi { width: 16px; height: 16px; margin: 0; }
.cs-ai:disabled { opacity: .6; cursor: default; }
.cs-sec > .cs-ai { margin-top: 10px; }
.cs-count { font-size: 12px; color: #6b6e78; font-variant-numeric: tabular-nums; }
.cs-opts { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; margin-top: 11px; }
.cs-opts::-webkit-scrollbar { display: none; }
.cs-opt {
  flex: none; width: 196px; padding: 10px 12px; border: 0; border-radius: 15px;
  background: #1c1d23; color: #fff; text-align: left; cursor: pointer;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.07);
}
.cs-opt b { display: block; margin-bottom: 3px; font-size: 11.5px; color: #cbbcff; letter-spacing: .2px; }
.cs-opt span { font-size: 13px; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.cs-who { display: flex; gap: 14px; overflow-x: auto; scrollbar-width: none; padding: 5px 2px 2px; }
.cs-who::-webkit-scrollbar { display: none; }
.cs-who-a {
  flex: none; width: 64px; padding: 0; border: 0; background: none; color: #8a8d97;
  display: flex; flex-direction: column; align-items: center; gap: 7px;
  font-size: 11.5px; font-weight: 650; cursor: pointer;
}
.cs-who-a > span:last-child { max-width: 64px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cs-who-a .cs-ava { box-shadow: 0 0 0 2px #141519, 0 0 0 3.5px #3a3b43; opacity: .5; transition: opacity .15s, box-shadow .15s; }
.cs-who-a.on { color: #fff; }
.cs-who-a.on .cs-ava { opacity: 1; box-shadow: 0 0 0 2px #141519, 0 0 0 4px #8b5cf6; }
.cs-who-a.add .cs-ava { opacity: 1; background: transparent; box-shadow: inset 0 0 0 1.5px #3c3d45; color: #b9bac2; }
.cs-tick {
  position: absolute; left: -3px; top: -3px; width: 20px; height: 20px; border-radius: 50%;
  display: none; place-items: center; background: #8b5cf6; color: #fff; box-shadow: 0 0 0 2px #141519;
}
.cs-tick .mi { width: 12px; height: 12px; margin: 0; }
.cs-who-a.on .cs-tick { display: grid; }
.cs-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.cs-chip {
  height: 36px; padding: 0 14px; border: 0; border-radius: 999px;
  background: #1c1d23; color: #d8d9df; font-size: 13.5px; font-weight: 700; cursor: pointer;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.07);
}
.cs-chip.on { background: #f5f6f8; color: #000; box-shadow: none; }
.cs-dt { margin-top: 10px; }
.cs-when-is {
  display: flex; align-items: center; gap: 9px; margin-top: 12px; padding: 12px 14px; border-radius: 15px;
  background: rgba(139,92,246,.13); color: #e6dcff; font-size: 14px; font-weight: 700;
}
.cs-when-is .mi { width: 18px; height: 18px; margin: 0; flex: none; }
.cs-plan { list-style: none; margin: 12px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.cs-plan li { display: flex; align-items: center; gap: 11px; }
.cs-plan-pic { flex: none; width: 34px; height: 54px; border-radius: 8px; background: #23242b center / cover no-repeat; }
.cs-plan b { display: block; font-size: 14px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cs-plan small { font-size: 12.5px; font-weight: 650; color: #cbbcff; }
.cs-plan li > span:last-child { min-width: 0; }
.cs-btn {
  height: 52px; padding: 0 18px; border: 0; border-radius: 17px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-size: 16px; font-weight: 800; letter-spacing: -.1px; cursor: pointer;
}
.cs-btn .mi { width: 19px; height: 19px; margin: 0; }
.cs-btn.primary { background: linear-gradient(135deg, #a855f7, #7c3aed); color: #fff; box-shadow: 0 8px 24px rgba(124,58,237,.45); }
.cs-btn.primary:disabled { opacity: .42; box-shadow: none; cursor: default; }
.cs-btn.ghost { background: #23242b; color: #fff; }
.cs-btn.danger { background: transparent; color: #ff6b61; height: 46px; font-size: 15px; }
.cs-btn.wide { width: 100%; }
.cs-actions { display: flex; gap: 10px; margin-bottom: 4px; }
.cs-actions .cs-btn { flex: 1; }
.cs-hint { margin: 8px 0 0; text-align: center; font-size: 12.5px; color: #8a8d97; }
.cs-connect-cta {
  width: 100%; display: flex; align-items: center; gap: 10px; padding: 13px 14px;
  border: 0; border-radius: 17px; background: #1c1d23; color: #fff; text-align: left; cursor: pointer;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.07);
}
.cs-connect-cta > span:not(.cs-mark) { flex: 1; min-width: 0; }
.cs-connect-cta b { display: block; font-size: 15px; }
.cs-connect-cta small { font-size: 12.5px; color: #9b9ea8; }
.cs-connect-cta > .mi { width: 18px; height: 18px; margin: 0; color: #8a8d97; }

.cs-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; }
.cs-g { position: relative; padding: 0; border: 0; background: none; color: #fff; text-align: left; cursor: pointer; }
.cs-g-pic { display: block; aspect-ratio: 9 / 14; border-radius: 13px; background: linear-gradient(160deg, #23242b, #17181d) center / cover no-repeat; transition: box-shadow .15s; }
.cs-g-name { display: block; margin-top: 5px; font-size: 11.5px; font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cs-g .cs-tick { left: auto; right: 6px; top: 6px; box-shadow: 0 0 0 2px rgba(0,0,0,.45); }
.cs-g.on .cs-g-pic { box-shadow: 0 0 0 3px #8b5cf6; }
.cs-g.on .cs-tick { display: grid; }

.cs-plats { display: flex; flex-direction: column; gap: 8px; }
.cs-plat { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 17px; background: #1c1d23; }
.cs-plat-tx { flex: 1; min-width: 0; }
.cs-plat-tx b { display: block; font-size: 15px; }
.cs-plat-tx small { display: block; font-size: 12.5px; color: #9b9ea8; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cs-plat.linked .cs-plat-tx small { color: #4ade80; }
.cs-mini {
  flex: none; height: 34px; padding: 0 14px; border: 0; border-radius: 11px;
  display: inline-flex; align-items: center; gap: 6px;
  background: #2c2d34; color: #ececf1; font-size: 13.5px; font-weight: 750; text-decoration: none; cursor: pointer;
}
.cs-mini .mi { width: 15px; height: 15px; margin: 0; }
.cs-mini.accent { background: linear-gradient(135deg, #a855f7, #7c3aed); color: #fff; }
.cs-mini:disabled { opacity: .38; cursor: default; }
.cs-key { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 10px; padding: 13px; border-radius: 17px; background: #1c1d23; }
.cs-key-tx { flex: 1; min-width: 170px; }
.cs-key-tx b { display: block; font-size: 14.5px; }
.cs-key-tx small { display: block; margin-top: 2px; font-size: 12.5px; line-height: 1.38; color: #9b9ea8; }
.cs-key.set .cs-key-tx small { color: #4ade80; }
.cs-key-in { flex-basis: 100%; display: flex; gap: 8px; }
.cs-key-in .cs-input { flex: 1; min-width: 0; }
.cs-key-in .cs-btn { height: 48px; font-size: 15px; }
.cs-steps { margin: 0 0 8px; padding-left: 22px; color: #c9cad1; font-size: 13.5px; line-height: 1.6; }
.cs-steps a, .cs-note a { color: #cbbcff; }
.cs-note { margin: 0 0 12px; padding: 11px 13px; border-radius: 13px; background: rgba(139,92,246,.13); color: #e6dcff; font-size: 13.5px; line-height: 1.45; }
.cs-note.good { background: rgba(48,209,88,.13); color: #c3f7d3; }
.cs-note.bad { background: rgba(255,69,58,.13); color: #ffcbc6; }
.cs-note.warn { background: rgba(255,179,64,.13); color: #ffe3b3; }
.cs-spin { flex: none; width: 22px; height: 22px; border-radius: 50%; border: 2.5px solid rgba(196,181,253,.3); border-top-color: #c4b5fd; animation: ciSpin .8s linear infinite; }

.cs-detail .cs-video { display: block; width: 100%; max-height: 44vh; border-radius: 17px; background: #000; object-fit: contain; }
.cs-d-when { display: flex; align-items: center; gap: 8px; margin-top: 14px; font-size: 14px; font-weight: 700; color: #e6dcff; }
.cs-d-when .mi { width: 17px; height: 17px; margin: 0; }
.cs-d-when .cs-state { margin-left: auto; }
.cs-d-title { margin: 10px 0 6px; font-size: 19px; font-weight: 800; letter-spacing: -.25px; }
.cs-d-cap { margin: 0; white-space: pre-wrap; font-size: 14px; line-height: 1.52; color: #c9cad1; -webkit-user-select: text; user-select: text; }
.cs-d-accts { list-style: none; margin: 14px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.cs-d-accts li { display: flex; align-items: center; gap: 11px; padding: 11px 12px; border-radius: 15px; background: #1c1d23; }
.cs-d-accts li .cs-mark { width: 30px; height: 30px; }
.cs-d-accts li > span:last-child { min-width: 0; }
.cs-d-accts b { display: block; font-size: 14px; }
.cs-d-accts small { display: block; font-size: 12.5px; line-height: 1.35; color: #9b9ea8; }
.cs-d-accts small .mi { width: 13px; height: 13px; margin: 0 0 0 3px; }
.cs-d-accts li.ok small { color: #4ade80; }
.cs-d-accts li.bad small { color: #ff8a80; }
.cs-d-accts li.warn small { color: #ffbe55; }
.cs-d-accts a { color: inherit; text-decoration: none; }
.cs-d-err { margin: 12px 0 0; padding: 11px 13px; border-radius: 13px; background: rgba(255,69,58,.11); color: #ffcbc6; font-size: 13px; line-height: 1.45; }

/* a wide screen: the same rooms, in a comfortable column */
@media (min-width: 901px) {
  body.mw-cloud.mw-home .cloud-home, body.mw-cloud.mw-sched .cloud-sched, body.mw-cloud.mw-projects .cloud-proj { background: radial-gradient(1200px 600px at 80% -20%, rgba(139,92,246,.18), transparent 60%), #08090c; }
  .ch-top, .cs-top { max-width: 792px; width: 100%; margin: 0 auto; }
  .ch-cards-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
  .cs-tabs { background: #08090c; }
}

/* ------------------------------------------------ watching a file, in the app */
.cloud-viewer {
  position: fixed; inset: 0; z-index: 2000;
  display: flex; flex-direction: column;
  background: #000; color: #fff;
  opacity: 0; transition: opacity .2s ease;
}
.cloud-viewer.on { opacity: 1; }
.cv-top {
  flex: none; display: flex; align-items: center; gap: 10px;
  padding: calc(env(safe-area-inset-top) + 8px) 14px 8px 8px;
}
.cv-btn { flex: none; width: 44px; height: 44px; display: grid; place-items: center; padding: 0; margin: 0;
  background: rgba(255,255,255,.12); color: #fff; border: 0; border-radius: 50%; cursor: pointer; }
.cv-btn .mi { width: 22px; height: 22px; margin: 0; }
.cv-name { flex: 1 1 auto; min-width: 0; font-size: 15px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cv-stage { flex: 1 1 auto; min-height: 0; display: grid; place-items: center; padding: 0 8px; }
.cv-media { max-width: 100%; max-height: 100%; width: auto; height: auto; border-radius: 12px; background: #111; }
.cv-acts {
  flex: none; display: flex; gap: 10px; justify-content: center;
  padding: 12px 16px calc(env(safe-area-inset-bottom) + 12px);
}
.cv-act {
  flex: 1 1 0; min-width: 0; max-width: 180px; height: 52px; margin: 0; padding: 0 8px;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  background: #1d1e24; color: #fff; border: 1px solid #2a2b32; border-radius: 14px;
  font: 600 14px/1.1 -apple-system, BlinkMacSystemFont, "SF Pro Text", Roboto, sans-serif; cursor: pointer; white-space: nowrap;
}
.cv-act .mi { width: 20px; height: 20px; margin: 0; flex: none; }
.cv-act.cv-primary { background: linear-gradient(135deg, #a855f7 0%, #7c3aed 100%); border-color: transparent; box-shadow: 0 4px 18px rgba(139, 92, 246, .45); }
.cv-act:active { filter: brightness(.88); }
/* Save shows every step on the button itself */
.cv-save { position: relative; overflow: hidden; transition: flex-grow .25s ease, background-color .2s; }
.cv-save > * { position: relative; z-index: 1; }
.cv-save .cv-fill { position: absolute; z-index: 0; left: 0; top: 0; bottom: 0; width: 0; background: rgba(139, 92, 246, .55); transition: width .3s ease; pointer-events: none; }
.cv-save:not(.cv-loading):not(.cv-sharing) .cv-fill { display: none; }
.cv-save.cv-loading, .cv-save.cv-sharing, .cv-save.cv-ready, .cv-save.cv-fail { flex-grow: 2; max-width: none; }
.cv-save.cv-loading { font-variant-numeric: tabular-nums; }
.cv-save.cv-ready { background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%); border-color: transparent; box-shadow: 0 4px 18px rgba(34, 197, 94, .45); animation: cv-pulse 1.4s ease-in-out infinite; }
.cv-save.cv-done { border-color: rgba(34, 197, 94, .6); color: #86efac; }
.cv-save.cv-fail { border-color: rgba(245, 158, 11, .7); color: #fcd34d; }
@keyframes cv-pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.03); } }
.cp-saveall .sa-list { display: flex; flex-direction: column; gap: 8px; padding: 4px 0 8px; }
.sa-row { display: flex; align-items: center; gap: 12px; padding: 8px 10px; border-radius: 14px; background: rgba(255,255,255,.05); }
.sa-pic { flex: none; width: 40px; height: 56px; border-radius: 8px; background: rgba(255,255,255,.08) center/cover no-repeat; }
.sa-tx { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.sa-tx b { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sa-tx small { font-size: 12px; opacity: .7; font-variant-numeric: tabular-nums; }
.sa-st { flex: none; width: 10px; height: 10px; border-radius: 50%; background: rgba(255,255,255,.18); }
.sa-row[data-st="loading"] .sa-st { background: #a78bfa; animation: cv-pulse 1s ease-in-out infinite; }
.sa-row[data-st="ready"] .sa-st { background: #a78bfa; }
.sa-row[data-st="done"] .sa-st { background: #22c55e; }
.sa-row[data-st="done"] small { color: #86efac; opacity: 1; }
.sa-row[data-st="fail"] .sa-st { background: #f59e0b; }
.cp-saveall .sa-go, .sa-all { width: 100%; max-width: none; min-height: 52px; justify-content: center; }
.sa-all { margin: 0 0 12px; }
.cv-q { flex: none; display: flex; gap: 10px; margin: 8px 16px 0; animation: cv-q-in .2s ease; }
.cv-q-b { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 12px 8px; border-radius: 14px;
  border: 1px solid rgba(255,255,255,.18); background: rgba(255,255,255,.08); color: #fff; font: inherit; cursor: pointer; }
.cv-q-b b { font-size: 15px; font-weight: 700; }
.cv-q-b small { font-size: 12px; opacity: .75; }
.cv-q-b.cv-q-hd { background: linear-gradient(135deg, #8b5cf6 0%, #6d28d9 100%); border-color: transparent; box-shadow: 0 4px 16px rgba(139, 92, 246, .4); }
.cv-q-b:active { transform: scale(.97); }
@keyframes cv-q-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.cv-save-note { flex: none; margin: 0 16px; padding: 10px 12px; border-radius: 12px; background: rgba(255,255,255,.08);
  font: 500 13.5px/1.4 -apple-system, BlinkMacSystemFont, "SF Pro Text", Roboto, sans-serif; color: #e5e7eb; text-align: center; }
.cv-save-note.hidden { display: none; }

/* ------------------------------------------------ your own space: signing in */
.cg-tabs { display: flex; gap: 4px; padding: 4px; margin: 0 0 14px; background: var(--bg-3); border: 1px solid var(--border); border-radius: 12px; }
.cg-tabs.hidden { display: none; }
.cg-tab { flex: 1 1 0; height: 38px; margin: 0; padding: 0; border: 0; border-radius: 9px; background: transparent; color: var(--muted);
  font: 600 14px/1 inherit; cursor: pointer; }
.cg-tab.on { background: #2a2c38; color: var(--text); box-shadow: 0 1px 4px rgba(0,0,0,.35); }
.cg-note { margin: -4px 0 12px; font-size: 12.5px; line-height: 1.45; color: #c4b5fd; text-align: left; }
.cloud-gate-box #cloudName, .cloud-gate-box #cloudPw, .cloud-gate-box #cloudPass {
  width: 100%; margin: 0 0 12px; background: var(--bg-3); color: var(--text);
  border: 1px solid var(--border); border-radius: 11px; padding: 13px 14px; font-size: 16px; text-align: left;
}
.cloud-gate-box #cloudName:focus, .cloud-gate-box #cloudPw:focus, .cloud-gate-box #cloudPass:focus { outline: none; border-color: var(--primary); }
.cg-create { display: none; }
.cloud-gate-box.mode-create .cg-create { display: block; }

/* ------------------------------------------------ your own space: the menu */
.ch-me b { font-size: 16px; font-weight: 800; line-height: 1; color: #fff; }
.ch-round.ch-me { background: linear-gradient(180deg, #5658d6, #4648be); }
.pf-me { display: flex; align-items: center; gap: 12px; padding: 4px 2px 14px; }
.pf-ava { flex: none; width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center;
  background: linear-gradient(180deg, #5658d6, #4648be); color: #fff; font-weight: 800; font-size: 20px; }
.pf-ava.sm { width: 34px; height: 34px; font-size: 15px; }
.pf-tx { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.pf-tx b { font-size: 17px; }
.pf-tx small { color: var(--ph-muted, #9b9ea8); font-size: 12.5px; line-height: 1.35; }
.pf-sec { display: flex; flex-direction: column; gap: 8px; padding: 14px 0; border-top: 1px solid var(--ph-line, #2a2b32); }
.pf-sec > b { font-size: 13px; letter-spacing: .04em; text-transform: uppercase; color: var(--ph-muted, #9b9ea8); }
.pf-in { width: 100%; margin: 0; height: 44px; padding: 0 12px; font-size: 16px; border-radius: 10px;
  background: var(--ph-panel-2, #1d1e24); color: var(--ph-text, #fff); border: 1px solid var(--ph-line, #2a2b32); }
.pf-btn { height: 44px; margin: 0; border: 0; border-radius: 12px; font: 700 14.5px/1 inherit; color: #fff;
  background: linear-gradient(135deg, #a855f7 0%, #7c3aed 100%); cursor: pointer; }
.pf-person { display: flex; align-items: center; gap: 10px; padding: 6px 0; }
.pf-pname { flex: 1 1 auto; min-width: 0; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pf-mini { flex: none; height: 34px; margin: 0; padding: 0 12px; border-radius: 10px; font: 600 13px/1 inherit; cursor: pointer;
  background: var(--ph-panel-2, #1d1e24); color: var(--ph-text, #fff); border: 1px solid var(--ph-line, #2a2b32); }
.pf-mini.danger { color: #ff8a8a; border-color: rgba(255, 99, 99, .4); }
.pf-empty { color: var(--ph-muted, #9b9ea8); font-size: 13px; line-height: 1.45; }
.pf-out { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; height: 48px; margin: 10px 0 4px;
  border-radius: 12px; font: 700 15px/1 inherit; cursor: pointer; background: transparent; color: #ff8a8a; border: 1px solid rgba(255, 99, 99, .4); }
.pf-out .mi { width: 18px; height: 18px; margin: 0; }

/* ============================== AI Montage ============================== */
.ch-montage {
  background: linear-gradient(140deg, #ec4899 0%, #a855f7 45%, #6d28d9 100%);
  box-shadow: 0 22px 44px rgba(168,85,247,.36), inset 0 1px 0 rgba(255,255,255,.25);
}
.ch-montage .ch-glow { background: radial-gradient(circle, rgba(253,224,71,.42), rgba(244,114,182,.2) 45%, transparent 66%); }
.cp-montage .cp-body { padding-bottom: 8px; }
.mt-lead { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin: 2px 0 6px; font-size: 13.5px; line-height: 1.45;
  color: var(--ph-text, #fff); }
.mt-lead small { color: var(--ph-muted, #9b9ea8); }
.mt-lead .mi { width: 18px; height: 18px; margin: 0; color: #e9b8ff; }
.mt-sec { padding: 12px 0; border-top: 1px solid var(--ph-line, #2a2b32); }
.mt-sec h3 { display: flex; align-items: baseline; justify-content: space-between; margin: 0 0 9px; font-size: 13px;
  letter-spacing: .04em; text-transform: uppercase; color: var(--ph-muted, #9b9ea8); }
.mt-sec h3 small { text-transform: none; letter-spacing: 0; font-weight: 500; }
.mt-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.mt-tile, .mt-add { position: relative; aspect-ratio: 9 / 14; border-radius: 12px; overflow: hidden;
  background: var(--ph-panel-2, #1d1e24); border: 1px solid var(--ph-line, #2a2b32); }
.mt-tile img, .mt-tile video { width: 100%; height: 100%; object-fit: cover; display: block; pointer-events: none; }
/* hold and drag to reorder */
.mt-tile { -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; transition: transform .12s ease, outline-color .12s; }
.mt-tile.mt-lift { z-index: 5; transition: none; pointer-events: none; box-shadow: 0 12px 30px rgba(0,0,0,.55), 0 0 0 2px var(--ph-accent, #8b5cf6); opacity: .95; }
.mt-tile.mt-target { outline: 2px dashed var(--ph-accent-text, #b79cff); outline-offset: 2px; }
.mt-num { position: absolute; left: 6px; top: 6px; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px;
  font: 800 12px/22px inherit; text-align: center; color: #fff; background: var(--ph-accent-fill, #8b5cf6); box-shadow: 0 1px 4px rgba(0,0,0,.5); }
.mt-load { position: absolute; inset: 0; background: linear-gradient(110deg, #1d1e24 30%, #2a2b33 50%, #1d1e24 70%); background-size: 200% 100%; animation: mt-shine 1.2s linear infinite; }
@keyframes mt-shine { to { background-position: -200% 0; } }
.mt-custom { display: flex; gap: 10px; margin-top: 10px; }
.mt-custom label { display: flex; align-items: center; gap: 8px; height: 46px; padding: 0 14px; border-radius: 12px;
  background: var(--ph-panel-2, #1d1e24); border: 1px solid var(--ph-line, #2a2b32); color: var(--ph-muted, #9b9ea8); font-size: 14px; }
.mt-custom input { width: 54px; margin: 0; padding: 0; border: 0; background: transparent; color: var(--ph-text, #fff);
  font: 700 20px/1 inherit; text-align: right; -webkit-user-select: text; user-select: text; }
.mt-custom input:focus { outline: none; }
.mt-hint { display: block; margin-top: 9px; font-size: 12.5px; line-height: 1.45; color: var(--ph-muted, #9b9ea8); }
.mt-dur { position: absolute; left: 6px; bottom: 5px; font-size: 11px; font-weight: 700; color: #fff; text-shadow: 0 1px 3px #000; }
.mt-x { position: absolute; top: 4px; right: 4px; width: 26px; height: 26px; margin: 0; padding: 0; border: 0; border-radius: 50%;
  font: 700 12px/26px inherit; color: #fff; background: rgba(0,0,0,.62); cursor: pointer; }
.mt-add { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; margin: 0; cursor: pointer;
  color: #e9b8ff; font: 600 12.5px/1 inherit; border-style: dashed; border-color: rgba(192,132,252,.55); }
.mt-add .mi { width: 26px; height: 26px; margin: 0; }
.mt-row, .mt-songs { display: flex; flex-wrap: wrap; gap: 8px; }
.mt-chip { height: 36px; margin: 0; padding: 0 14px; border-radius: 999px; font: 600 13.5px/1 inherit; cursor: pointer;
  color: var(--ph-text, #fff); background: var(--ph-panel-2, #1d1e24); border: 1px solid var(--ph-line, #2a2b32);
  max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mt-chip.on { border-color: transparent; background: linear-gradient(135deg, #a855f7 0%, #7c3aed 100%); color: #fff;
  box-shadow: 0 6px 16px rgba(124,58,237,.35); }
.mt-toggle { display: flex; align-items: center; gap: 10px; margin-top: 12px; font-size: 14px; color: var(--ph-text, #fff); }
.mt-toggle input { width: 20px; height: 20px; margin: 0; accent-color: #a855f7; }
.mt-brief { width: 100%; box-sizing: border-box; margin: 0; padding: 10px 12px; font: 16px/1.4 inherit; border-radius: 12px; resize: none;
  background: var(--ph-panel-2, #1d1e24); color: var(--ph-text, #fff); border: 1px solid var(--ph-line, #2a2b32); }
.mt-sec .mt-chip[data-mt-copy] { margin-top: 10px; }
.mt-go { width: 100%; height: 52px; margin: 0; border: 0; border-radius: 16px; cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 8px; font: 800 16px/1 inherit; color: #fff;
  background: linear-gradient(135deg, #ec4899 0%, #a855f7 50%, #6d28d9 100%); box-shadow: 0 12px 28px rgba(168,85,247,.42); }
.mt-go .mi { width: 20px; height: 20px; margin: 0; }
.mt-go:disabled { opacity: .45; box-shadow: none; }
.mt-run { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 14px; padding: 34px 6px 26px; }
.mt-orb { width: 84px; height: 84px; border-radius: 50%; display: grid; place-items: center; color: #fff; font: 800 34px/1 inherit;
  background: conic-gradient(from 0deg, #ec4899, #a855f7, #6d28d9, #ec4899); animation: mt-spin 2.4s linear infinite;
  box-shadow: 0 0 40px rgba(168,85,247,.5); }
.mt-orb .mi { width: 36px; height: 36px; margin: 0; animation: mt-spin 2.4s linear infinite reverse; }
.mt-orb.bad { animation: none; background: linear-gradient(135deg, #f87171, #b91c1c); box-shadow: none; }
@keyframes mt-spin { to { transform: rotate(360deg); } }
.mt-stage { font-size: 17px; line-height: 1.35; color: var(--ph-text, #fff); }
.mt-bar { width: 100%; height: 8px; border-radius: 999px; overflow: hidden; background: var(--ph-panel-2, #1d1e24); }
.mt-bar i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #ec4899, #a855f7); transition: width .4s ease; }
.mt-note { color: var(--ph-muted, #9b9ea8); font-size: 13px; line-height: 1.45; max-width: 320px; }
.mt-concept { margin: 6px 0; font-size: 15px; line-height: 1.45; color: var(--ph-text, #fff); }
.mt-tip { margin: 8px 0 4px; font-size: 13.5px; line-height: 1.5; color: var(--ph-muted, #9b9ea8); }
@media (prefers-reduced-motion: reduce) { .mt-orb, .mt-orb .mi { animation: none; } }

.cj-server { display: block; margin-top: 10px; text-align: center; font-size: 12px; line-height: 1.45; color: var(--ph-muted, #9b9ea8); }

/* ------------------------------------------------ editing a made montage */
.me-lead { margin: 0 0 12px; }
.me-list { display: flex; flex-direction: column; gap: 10px; }
.me-shot { border: 1px solid var(--ph-line, #2a2b32); border-radius: 14px; background: var(--ph-panel-2, #1d1e24); padding: 10px; }
.me-shot.sel { border-color: var(--ph-accent, #8b5cf6); box-shadow: 0 0 0 1px var(--ph-accent, #8b5cf6) inset; }
.me-row { display: flex; align-items: center; gap: 10px; }
.me-n { flex: none; width: 24px; height: 24px; border-radius: 12px; display: grid; place-items: center; font: 800 12px/1 inherit; color: #fff; background: var(--ph-accent-fill, #8b5cf6); }
.me-th { flex: none; width: 48px; height: 72px; border-radius: 8px; overflow: hidden; background: #111; }
.me-th img, .me-ov img { width: 100%; height: 100%; object-fit: cover; display: block; }
.me-nothumb { display: block; width: 100%; height: 100%; background: #222; }
.me-info { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.me-info b { font-size: 14px; color: var(--ph-text, #fff); }
.me-info small { font-size: 12px; color: var(--ph-muted, #9b9ea8); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me-btns { flex: none; display: flex; gap: 6px; }
.me-btns button { width: 38px; height: 38px; margin: 0; padding: 0; border-radius: 10px; border: 1px solid var(--ph-line, #2a2b32); background: #26272e; color: #fff; font-size: 14px; cursor: pointer; }
.me-btns button:disabled { opacity: .3; }
.me-ovs, .me-tray { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.me-ov { position: relative; width: 54px; height: 72px; margin: 0; padding: 0; border-radius: 8px; overflow: hidden; border: 2px solid transparent; background: #111; cursor: pointer; }
.me-ov.on { border-color: var(--ph-accent-text, #b79cff); }
.me-ov span { position: absolute; left: 0; right: 0; bottom: 0; padding: 2px 0; font: 700 10px/1.2 inherit; color: #fff; background: rgba(0,0,0,.6); text-align: center; }
.me-none { color: var(--ph-muted, #9b9ea8); font-size: 12px; }
.me-ovtools { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.me-ovtools button { flex: 1 1 auto; height: 38px; margin: 0; padding: 0 10px; border-radius: 10px; border: 1px solid var(--ph-line, #2a2b32); background: #26272e; color: #fff; font: 600 12.5px/1 inherit; cursor: pointer; }
.me-ovtools button:disabled { opacity: .35; }
.me-banner { display: flex; align-items: center; gap: 10px; width: 100%; margin: 0 0 12px; padding: 12px 14px; border-radius: 14px; border: 1px solid var(--ph-accent, #8b5cf6);
  background: rgba(139, 92, 246, .14); color: #fff; text-align: left; font-size: 18px; cursor: pointer; }
.me-banner span { display: flex; flex-direction: column; gap: 2px; }
.me-banner b { font-size: 14px; } .me-banner small { font-size: 12px; color: var(--ph-muted, #9b9ea8); }
.mt-foot2 { display: flex; flex-direction: column; gap: 8px; width: 100%; }
.mt-edit { width: 100%; height: 46px; margin: 0; border-radius: 14px; border: 1px solid var(--ph-accent, #8b5cf6); background: rgba(139, 92, 246, .14);
  color: #fff; font: 700 15px/1 inherit; cursor: pointer; }
