@font-face { font-family: "Title"; src: url("/site/fonts/AlternateGotNo3D.woff2") format("woff2"); font-display: swap; }

:root {
  --bg: #000; --panel: #0a0a0a; --line: rgba(255,255,255,.08); --line2: rgba(255,255,255,.16);
  --t1: #fff; --t2: #8f8f8f; --t3: #5a5a5a; --well: rgba(255,255,255,.05); --glass: rgba(28,28,28,.72);
  --red: #ff453a; --green: #30d158;
  --title: "Title", "Arial Narrow", sans-serif;
  --ui: -apple-system, BlinkMacSystemFont, "Helvetica Neue", Helvetica, Arial, sans-serif;
  --spring: cubic-bezier(.2,.9,.25,1.15); --ease: cubic-bezier(.2,.8,.2,1);
  color-scheme: dark;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body { background: var(--bg); color: var(--t1); font: 13px/1.45 var(--ui); -webkit-font-smoothing: antialiased; }
button, input, textarea, select { font: inherit; color: inherit; }
button { background: none; border: 0; cursor: pointer; }
a { color: inherit; text-decoration: none; }
[hidden] { display: none !important; }
::selection { background: rgba(255,255,255,.25); }

/* ---------- sign-in ---------- */
.signin { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.signin form { width: min(360px, 100%); display: grid; gap: 14px; }
.signin h1 { font: 40px/1 var(--title); margin-bottom: 4px; }
.signin p { color: var(--t2); }
.field { width: 100%; background: var(--well); border: 1px solid var(--line2); border-radius: 12px; padding: 12px 14px; outline: none; transition: border-color .2s; }
.field:focus { border-color: rgba(255,255,255,.5); }
.code-field { font-size: 22px; letter-spacing: .35em; text-align: center; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 34px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--line2); color: var(--t1); transition: transform .35s var(--spring), background .2s, border-color .2s; white-space: nowrap; }
.btn:hover { border-color: rgba(255,255,255,.4); }
.btn:active { transform: scale(.96); }
.btn.primary { background: #fff; color: #000; border-color: #fff; font-weight: 600; }
.btn.primary:hover { transform: scale(1.03); }
.btn.danger { color: var(--red); border-color: rgba(255,69,58,.35); }
.btn.small { height: 28px; padding: 0 12px; font-size: 12px; }
.err { color: var(--red); font-size: 12px; min-height: 16px; }

/* ---------- app frame ---------- */
.app { display: grid; grid-template-columns: 248px minmax(0,1fr) 300px; grid-template-rows: 56px minmax(0,1fr); height: 100vh; }
.app.no-insp { grid-template-columns: 248px minmax(0,1fr) 0; }
.top { grid-column: 1/-1; display: flex; align-items: center; justify-content: space-between; padding: 0 18px; border-bottom: 1px solid var(--line); gap: 16px; }
.brand { display: flex; align-items: baseline; gap: 10px; }
.brand b { font: 24px/1 var(--title); letter-spacing: .01em; }
.brand span { color: var(--t2); font-size: 12px; }
.top-actions { display: flex; align-items: center; gap: 14px; }
.saved { color: var(--t3); font-size: 12px; transition: color .3s; }
.saved.busy { color: var(--t2); }
.link { color: var(--t2); transition: color .2s; cursor: pointer; }
.link:hover { color: var(--t1); }
.publish i { width: 6px; height: 6px; border-radius: 50%; background: var(--red); display: inline-block; }
.publish.clean i { display: none; }

.side { border-right: 1px solid var(--line); overflow: auto; padding: 16px 10px 16px 12px; display: flex; flex-direction: column; gap: 4px; }
.cap { font-size: 10.5px; letter-spacing: .08em; color: var(--t3); text-transform: uppercase; padding: 10px 10px 6px; display: flex; justify-content: space-between; align-items: center; }
.cap button { color: var(--t3); font-size: 16px; line-height: 1; width: 20px; height: 20px; border-radius: 6px; }
.cap button:hover { color: var(--t1); background: var(--well); }
.nav-item { display: flex; align-items: center; gap: 10px; padding: 6px 10px; border-radius: 10px; color: var(--t2); cursor: pointer; transition: background .2s, color .2s; user-select: none; }
.nav-item:hover { background: rgba(255,255,255,.04); color: #d5d5d5; }
.nav-item.on { background: rgba(255,255,255,.08); color: var(--t1); }
.nav-item.off { opacity: .45; }
.nav-item.drag { opacity: .3; }
.nav-item .thumb { width: 32px; height: 32px; border-radius: 6px; object-fit: cover; flex: none; background: var(--well); }
.nav-item .n { font: 17px/1.1 var(--title); letter-spacing: .01em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-item .sub { font-size: 11px; color: var(--t3); }
.side-foot { margin-top: auto; padding-top: 12px; border-top: 1px solid var(--line); }

.main { overflow: auto; min-width: 0; position: relative; }
.head { padding: 26px 32px 0; display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; flex-wrap: wrap; }
.title-input { font: 38px/1 var(--title); background: none; border: 0; outline: none; width: 100%; min-width: 200px; letter-spacing: .005em; padding: 2px 0; border-bottom: 1px solid transparent; }
.title-input:focus { border-bottom-color: var(--line2); }
.meta { color: var(--t2); margin-top: 6px; display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.meta input { background: none; border: 0; border-bottom: 1px solid var(--line2); color: var(--t2); outline: none; width: 180px; padding: 1px 0; }
.seg { display: inline-flex; padding: 3px; border-radius: 11px; background: var(--well); border: 1px solid var(--line); position: relative; }
.seg button { position: relative; z-index: 1; padding: 6px 12px 5px; border-radius: 8px; color: var(--t2); font-size: 12px; transition: color .25s; white-space: nowrap; flex: 1; }
.seg button:hover { color: #ddd; }
.seg button.on { color: #000; font-weight: 600; }
.seg .pill { position: absolute; top: 3px; bottom: 3px; border-radius: 8px; background: #fff; transition: left .45s var(--spring), width .45s var(--spring); }
.seg.full { display: flex; width: 100%; }

.body { padding: 22px 32px 60px; }
.panel { border: 1px solid var(--line); border-radius: 16px; background: #050505; padding: 18px; margin-bottom: 18px; }
.panel.active { border-color: rgba(255,255,255,.28); }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; color: var(--t2); }
.panel-head b { color: var(--t1); font-weight: 600; }
textarea.field { resize: vertical; min-height: 80px; line-height: 1.55; }
.hint { color: var(--t3); font-size: 11.5px; }

/* media grid in the editor */
.mgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 10px; min-height: 60px; }
.mtile { position: relative; aspect-ratio: 1; border-radius: 8px; overflow: hidden; background: var(--well); cursor: grab; transition: transform .5s var(--spring), opacity .2s; }
.mtile img, .mtile video { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .45s var(--spring); pointer-events: none; }
.mtile:hover img { transform: scale(1.04); }
.mtile.hidden-item img, .mtile.hidden-item video { opacity: .3; }
.mtile.drag { opacity: .25; }
.mtile .badge { position: absolute; left: 6px; top: 6px; font-size: 9.5px; letter-spacing: .06em; padding: 2px 6px 1px; border-radius: 999px; background: rgba(20,20,20,.6); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border: 1px solid rgba(255,255,255,.14); color: #ddd; pointer-events: none; }
.mtile .tools { position: absolute; right: 6px; top: 6px; display: flex; gap: 4px; opacity: 0; transform: translateY(-3px); transition: opacity .2s, transform .35s var(--spring); }
.mtile:hover .tools, .mtile:focus-within .tools { opacity: 1; transform: none; }
.mtile .tools button { width: 26px; height: 26px; border-radius: 50%; background: rgba(20,20,20,.6); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border: 1px solid rgba(255,255,255,.14); display: grid; place-items: center; }
.mtile .tools button.on { background: #fff; }
.mtile .tools button.on svg { stroke: #000; }
.mtile .tools svg { width: 13px; height: 13px; stroke: #fff; fill: none; stroke-width: 1.8; }
.mtile .cap-line { position: absolute; inset: auto 0 0 0; padding: 14px 7px 5px; font-size: 10.5px; color: #eee; background: linear-gradient(transparent, rgba(0,0,0,.75)); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; pointer-events: none; }
.mtile .prog { position: absolute; inset: auto 8px 8px 8px; height: 3px; border-radius: 3px; background: rgba(255,255,255,.2); overflow: hidden; }
.mtile .prog i { display: block; height: 100%; width: 0; background: #fff; transition: width .2s; }
.mtile.uploading { cursor: default; }
.add-tile { aspect-ratio: 1; border-radius: 8px; border: 1px dashed var(--line2); display: grid; place-items: center; color: var(--t3); text-align: center; font-size: 11.5px; line-height: 1.5; transition: color .2s, border-color .2s; cursor: pointer; }
.add-tile:hover { color: var(--t1); border-color: rgba(255,255,255,.45); }
.mgrid.dropping { outline: 1px dashed rgba(255,255,255,.5); outline-offset: 6px; border-radius: 8px; }

.preview-frame { width: 100%; height: calc(100vh - 210px); min-height: 420px; border: 1px solid var(--line); border-radius: 16px; background: #000; display: block; }

/* inspector */
.insp { border-left: 1px solid var(--line); overflow: auto; padding: 18px 16px 30px; }
.insp h3 { font-size: 10.5px; letter-spacing: .08em; color: var(--t3); text-transform: uppercase; font-weight: 400; margin: 20px 0 8px; }
.insp h3:first-child { margin-top: 0; }
.insp .which { color: var(--t2); font-size: 12px; margin-bottom: 14px; }
.vars { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 10px; }
.vars button { aspect-ratio: 1.3; border-radius: 10px; background: var(--well); border: 1px solid var(--line); display: grid; place-items: center; color: #6a6a6a; transition: transform .35s var(--spring), color .2s, border-color .2s, background .2s; }
.vars button:hover { color: #bbb; transform: scale(1.04); }
.vars button.on { color: #fff; border-color: rgba(255,255,255,.85); background: rgba(255,255,255,.08); }
.vars svg { width: 60%; height: 60%; }
.vars svg * { fill: currentColor; }
.vname { font-size: 11px; color: var(--t2); margin-top: 8px; }
.tog { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); color: #d0d0d0; cursor: pointer; user-select: none; }
.tog:last-child { border-bottom: 0; }
.tog small { display: block; color: var(--t3); font-size: 11px; margin-top: 1px; }
.sw { width: 34px; height: 20px; border-radius: 999px; background: rgba(255,255,255,.14); position: relative; transition: background .3s; flex: none; }
.sw::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .4s var(--spring); }
.tog.on .sw { background: var(--green); }
.tog.on .sw::after { transform: translateX(14px); }
.range { display: flex; align-items: center; gap: 10px; color: var(--t2); }
.range input { flex: 1; accent-color: #fff; }

/* settings */
.form-grid { display: grid; gap: 16px; max-width: 640px; }
.form-grid label { display: grid; gap: 6px; color: var(--t2); }
.social-row { display: grid; grid-template-columns: 120px 1fr auto; gap: 8px; align-items: center; }
select.field { appearance: none; padding-right: 30px; }
.home-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; max-height: 360px; overflow: auto; padding: 2px; }
.home-pick button { position: relative; aspect-ratio: 1; border-radius: 8px; overflow: hidden; border: 2px solid transparent; transition: border-color .2s, transform .35s var(--spring); }
.home-pick button:hover { transform: scale(1.03); }
.home-pick button.on { border-color: #fff; }
.home-pick img, .home-pick video { width: 100%; height: 100%; object-fit: cover; display: block; pointer-events: none; }

/* overlays */
.drop { position: fixed; inset: 0; background: rgba(0,0,0,.72); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); display: grid; place-items: center; opacity: 0; pointer-events: none; transition: opacity .2s; z-index: 50; }
.drop.on { opacity: 1; }
.drop div { border: 1px dashed rgba(255,255,255,.4); border-radius: 22px; padding: 56px 84px; text-align: center; }
.drop b { display: block; font: 30px/1 var(--title); margin-bottom: 8px; }
.drop span { color: var(--t2); }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); opacity: 0; background: var(--glass); border: 1px solid var(--line2); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); padding: 10px 18px; border-radius: 999px; transition: all .45s var(--spring); color: #e5e5e5; z-index: 60; pointer-events: none; max-width: 90vw; }
.toast.on { opacity: 1; transform: translate(-50%, 0); }
.toast.bad { border-color: rgba(255,69,58,.5); }
.modal { position: fixed; inset: 0; z-index: 55; background: rgba(0,0,0,.6); display: grid; place-items: center; padding: 20px; }
.modal-card { width: min(440px, 100%); background: #111; border: 1px solid var(--line2); border-radius: 18px; padding: 22px; display: grid; gap: 14px; animation: pop .35s var(--spring); }
.modal-card h2 { font: 26px/1 var(--title); font-weight: 400; }
.modal-card .row-btns { display: flex; justify-content: flex-end; gap: 8px; }
@keyframes pop { from { transform: scale(.96); opacity: 0; } }
.empty { color: var(--t2); padding: 60px 20px; text-align: center; }

@media (max-width: 1100px) {
  .app { grid-template-columns: 210px minmax(0,1fr) 260px; }
  .head, .body { padding-left: 22px; padding-right: 22px; }
}
@media (max-width: 820px) {
  .app { grid-template-columns: 1fr; grid-template-rows: 56px auto auto auto; height: auto; }
  .side { border-right: 0; border-bottom: 1px solid var(--line); max-height: 260px; }
  .insp { border-left: 0; border-top: 1px solid var(--line); }
}

/* ===================== v2: live canvas + filmstrip + tabbed panel ===================== */
.app { grid-template-columns: 232px minmax(0,1fr) 340px; }
.app.no-insp { grid-template-columns: 232px minmax(0,1fr) 0; }

.side .new-btn { display: block; width: 100%; text-align: left; padding: 7px 10px; margin: 2px 0 10px; border-radius: 10px; color: var(--t2); font-size: 12.5px; transition: background .2s, color .2s; }
.side .new-btn:hover { background: rgba(255,255,255,.05); color: var(--t1); }
.nav-item .dot { width: 6px; height: 6px; border-radius: 50%; background: #ffd60a; margin-left: auto; flex: none; }

.stage { display: flex; flex-direction: column; height: calc(100vh - 56px); min-width: 0; }
.stage-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 14px 20px 10px; }
.stage-head h1 { font: 30px/1 var(--title); font-weight: 400; letter-spacing: .005em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.status { font-size: 12px; color: var(--t2); display: inline-flex; align-items: center; gap: 6px; margin-left: 12px; white-space: nowrap; }
.status i { width: 6px; height: 6px; border-radius: 50%; background: var(--green); }
.status.pending i { background: #ffd60a; }
.status.hidden i { background: var(--t3); }
.stage-tools { display: flex; align-items: center; gap: 12px; flex: none; }

.canvas { flex: 1; min-height: 0; position: relative; margin: 0 20px; border-radius: 14px; background: #050505; border: 1px solid var(--line); overflow: hidden; }
.canvas iframe { position: absolute; left: 0; top: 0; border: 0; transform-origin: 0 0; background: #000; transition: opacity .25s; }
.canvas.phone { background: #0b0b0b; }
.canvas.phone iframe { border-radius: 34px; box-shadow: 0 0 0 10px #1a1a1a, 0 30px 80px rgba(0,0,0,.6); }
.canvas .empty-drop { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; color: var(--t2); cursor: pointer; }
.canvas .empty-drop b { display: block; font: 30px/1.1 var(--title); font-weight: 400; color: var(--t1); margin-bottom: 8px; }

.film { flex: none; height: 178px; display: flex; gap: 18px; overflow-x: auto; overflow-y: hidden; padding: 12px 20px 14px; scrollbar-width: thin; scrollbar-color: #333 transparent; }
.film-group { flex: none; display: flex; flex-direction: column; gap: 7px; padding: 6px 8px 8px; border-radius: 12px; border: 1px solid transparent; transition: border-color .2s, background .2s; }
.film-group.active { border-color: rgba(255,255,255,.22); background: rgba(255,255,255,.025); }
.film-label { font-size: 11px; color: var(--t2); white-space: nowrap; display: flex; gap: 10px; align-items: center; }
.film-label b { color: var(--t1); font-weight: 600; }
.film-label button { color: var(--t3); font-size: 11px; }
.film-label button:hover { color: var(--red); }
.film-row { display: flex; gap: 8px; height: 112px; align-items: stretch; }
.film-row .mtile { aspect-ratio: auto; height: 112px; width: calc(112px * var(--ar, 1)); flex: none; border-radius: 6px; }
.film-row .add-tile { aspect-ratio: auto; height: 112px; width: 96px; flex: none; }
.film-row.dropping { outline: 1px dashed rgba(255,255,255,.5); outline-offset: 4px; border-radius: 8px; }
.film-new { flex: none; align-self: center; height: 112px; margin-top: 18px; width: 92px; border-radius: 10px; border: 1px dashed var(--line2); color: var(--t3); font-size: 11.5px; line-height: 1.5; transition: color .2s, border-color .2s; }
.film-new:hover { color: var(--t1); border-color: rgba(255,255,255,.45); }

.tabs { display: flex; gap: 4px; padding: 14px 16px 0; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--bg); z-index: 2; }
.tabs button { padding: 8px 12px 10px; color: var(--t2); border-bottom: 2px solid transparent; margin-bottom: -1px; font-weight: 600; font-size: 12.5px; transition: color .2s, border-color .2s; }
.tabs button.on { color: var(--t1); border-bottom-color: #fff; }
.insp { padding: 0; }
.insp .pane { padding: 16px 16px 40px; }
.insp label.f { display: grid; gap: 6px; color: var(--t2); margin-bottom: 16px; font-size: 12px; }
.insp .field { padding: 10px 12px; border-radius: 10px; }
.insp textarea.field { min-height: 120px; font-size: 13px; }
.insp .addr { display: flex; align-items: center; gap: 0; }
.insp .addr span { color: var(--t3); padding: 10px 0 10px 12px; background: var(--well); border: 1px solid var(--line2); border-right: 0; border-radius: 10px 0 0 10px; white-space: nowrap; }
.insp .addr input { border-radius: 0 10px 10px 0; min-width: 0; }
.insp .help { color: var(--t3); font-size: 11px; line-height: 1.45; margin-top: -2px; }
.insp .danger-zone { margin-top: 28px; padding-top: 16px; border-top: 1px solid var(--line); }

.toast.action { pointer-events: auto; display: flex; gap: 14px; align-items: center; }
.toast.action button { color: #fff; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }

.site-page { padding: 22px 28px 60px; max-width: 980px; }
.site-page h1 { font: 34px/1 var(--title); font-weight: 400; margin-bottom: 6px; }
.site-page .lead { color: var(--t2); margin-bottom: 22px; }
.film.slim { height: auto; padding: 10px 20px 16px; }
.film-add { width: 100%; padding: 12px; border-radius: 12px; border: 1px dashed var(--line2); color: var(--t2); transition: color .2s, border-color .2s; }
.film-add:hover { color: var(--t1); border-color: rgba(255,255,255,.45); }
.styles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.styles button { display: grid; gap: 7px; justify-items: center; padding: 10px 6px 9px; border-radius: 12px; background: var(--well); border: 1px solid var(--line); color: #6d6d6d; font-size: 11px; line-height: 1.25; text-align: center; transition: transform .35s var(--spring), color .2s, border-color .2s, background .2s; }
.styles button span { color: var(--t2); }
.styles button:hover { color: #bbb; transform: scale(1.03); }
.styles button.on { color: #fff; border-color: rgba(255,255,255,.85); background: rgba(255,255,255,.08); }
.styles button.on span { color: var(--t1); }
.styles svg { width: 46px; height: 32px; }
.styles svg * { fill: currentColor; }
/* items: books, links, sections */
.items-head { display: flex; justify-content: space-between; align-items: center; margin-top: 22px; }
.items-head h3 { margin: 0 !important; }
.name-pick { background: var(--well); border: 1px solid var(--line); border-radius: 8px; color: var(--t2); font-size: 11.5px; padding: 3px 6px; }
.items { display: grid; gap: 10px; margin: 10px 0 12px; }
.item { border: 1px solid var(--line); border-radius: 12px; padding: 10px; background: #070707; transition: border-color .2s, opacity .2s, transform .5s var(--spring); }
.item:focus-within { border-color: rgba(255,255,255,.28); }
.item.drag { opacity: .3; }
.item-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; min-width: 0; }
.item-head b { font-size: 12px; white-space: nowrap; }
.item-sub { color: var(--t3); font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1; min-width: 0; }
.grip { cursor: grab; color: var(--t3); letter-spacing: -2px; padding: 2px 4px; border-radius: 6px; user-select: none; }
.grip:hover { color: var(--t1); background: var(--well); }
.item-rm { font-size: 11.5px; }
.item-rm:hover { color: var(--red); }
.insp .item textarea.field { min-height: 90px; }
.item-media { display: flex; align-items: center; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.item-media img { width: 34px; height: 34px; object-fit: cover; border-radius: 5px; }
.item-media .more { font-size: 11px; color: var(--t2); }
.item-media .link { font-size: 12px; margin-left: 4px; }
.add-item { width: 100%; }
.insp .items.text-only textarea.field { min-height: 240px; }

/* ---------- editor ---------- */
.rte { border: 1px solid var(--line2); border-radius: 10px; background: var(--well); overflow: hidden; }
.rte:focus-within { border-color: rgba(255,255,255,.45); }
.rte-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 2px; padding: 5px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.03); }
.rte-bar button { width: 28px; height: 26px; border-radius: 6px; display: grid; place-items: center; color: var(--t2); font: 600 13px/1 Georgia, serif; transition: background .15s, color .15s; }
.rte-bar button:hover { background: rgba(255,255,255,.08); color: var(--t1); }
.rte-bar button.on { background: #fff; color: #000; }
.rte-bar svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.rte-bar svg circle { fill: currentColor; stroke: none; }
.rte-bar select { height: 26px; background: transparent; border: 1px solid transparent; border-radius: 6px; color: var(--t2); font-size: 11.5px; padding: 0 4px; max-width: 108px; }
.rte-bar select:hover { border-color: var(--line2); color: var(--t1); }
.rte-bar select option, .rte-bar select optgroup { background: #111; color: #eee; }
.rte-sep { width: 1px; height: 18px; background: var(--line2); margin: 0 3px; }
.rte-body { padding: 10px 12px; outline: none; font: calc(14px * var(--body-scale, 1))/1.55 var(--body, Helvetica, sans-serif); color: #eee; max-height: 520px; overflow: auto; }
.rte-body.is-empty::before { content: attr(data-placeholder); color: var(--t3); pointer-events: none; position: absolute; }
.rte-body p, .rte-body ul, .rte-body ol, .rte-body blockquote { margin: 0 0 .7em; }
.rte-body ul, .rte-body ol { padding-left: 1.3em; }
.rte-body h2 { font: calc(26px * var(--title-scale, 1))/1.1 var(--title); font-weight: 400; margin: .2em 0 .45em; }
.rte-body h3 { font: 600 1em/1.3 var(--body); margin: .8em 0 .3em; }
.rte-body blockquote { padding-left: .9em; border-left: 2px solid var(--t3); }
.rte-body a { color: #fff; text-decoration: underline; text-underline-offset: 2px; }
.rte-body [data-font="title"] { font-family: var(--title); }
.rte-body [data-font="body"] { font-family: var(--body); }
.rte-body [data-font="serif"] { font-family: var(--serif); }
.rte-body [data-font="mono"] { font-family: var(--mono); }
.rte-body [data-size="xs"] { font-size: .75em; } .rte-body [data-size="s"] { font-size: .875em; }
.rte-body [data-size="l"] { font-size: 1.35em; } .rte-body [data-size="xl"] { font-size: 2em; line-height: 1.15; }
.rte-body [data-align="center"] { text-align: center; } .rte-body [data-align="right"] { text-align: right; }
.item .rte { background: rgba(255,255,255,.03); }

/* ---------- fonts panel ---------- */
.font-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 12px; }
.font-grid label { display: grid; gap: 6px; color: var(--t2); font-size: 12px; }
.font-grid select.field { padding: 9px 10px; }
.font-sample { border: 1px solid var(--line); border-radius: 12px; background: #000; padding: 16px 18px 18px; margin-bottom: 14px; }
.fs-bar { display: flex; justify-content: space-between; font: calc(26px * var(--title-scale))/1 var(--title); margin-bottom: 18px; }
.fs-body { font: calc(15px * var(--body-scale))/1.55 var(--body); color: #ddd; max-width: 560px; }
.more-fonts summary { cursor: pointer; color: var(--t2); font-size: 12px; margin: 4px 0; }
.custom-fonts { margin-top: 12px; display: grid; gap: 6px; }
.cf { display: flex; align-items: center; gap: 12px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; }
.cf span:first-child { font-size: 18px; flex: 1; }
.rte-body { position: relative; }

/* ---------- freeform arranging ---------- */
.arranger { position: absolute; inset: 0; display: flex; flex-direction: column; }
.arr-bar { display: flex; justify-content: space-between; gap: 12px; padding: 10px 14px; font-size: 11.5px; color: var(--t2); border-bottom: 1px solid var(--line); }
.arr-scroll { flex: 1; overflow: auto; padding: 24px; }
.arr-page { position: relative; margin: 0 auto; background: #000; outline: 1px dashed rgba(255,255,255,.12); outline-offset: 0; min-height: 200px; touch-action: none; user-select: none; }
.arr-item { position: absolute; cursor: grab; border-radius: 2px; transition: box-shadow .2s; }
.arr-item:active { cursor: grabbing; }
.arr-item img { width: 100%; height: 100%; object-fit: cover; display: block; pointer-events: none; border-radius: 2px; }
.arr-item.sel, .arr-item:focus-visible { box-shadow: 0 0 0 2px #fff; outline: none; }
.arr-handle { position: absolute; right: -6px; bottom: -6px; width: 14px; height: 14px; border-radius: 50%; background: #fff; border: 2px solid #000; cursor: nwse-resize; opacity: 0; transition: opacity .15s; }
.arr-item:hover .arr-handle, .arr-item.sel .arr-handle { opacity: 1; }
.arr-guide { position: absolute; display: none; pointer-events: none; z-index: 99999; }
.arr-guide.v { top: 0; bottom: 0; width: 0; border-left: 1px solid #ff375f; }
.arr-guide.h { left: 0; right: 0; height: 0; border-top: 1px solid #ff375f; }

/* ---------- email ---------- */
.mail-list { display: grid; gap: 8px; }
.mail-row { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr) auto auto; gap: 12px; align-items: center; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; }
.mail-row.off { opacity: .55; }
.mail-row .tog { border: 0; padding: 0; }
.mail-addr { display: grid; min-width: 0; }
.mail-addr b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
.mail-addr .hint { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mail-row select.field, .mail-new select.field { padding: 7px 9px; font-size: 12px; }
.mail-new { display: flex; align-items: center; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.mail-new input { width: 130px; padding: 8px 10px; }
.mail-new .at { color: var(--t2); }
.mail-new select { flex: 1; min-width: 180px; }
.mail-dests { display: grid; gap: 6px; }
.mail-dest { display: flex; justify-content: space-between; gap: 10px; font-size: 12.5px; }
.badge-s { font-size: 11px; padding: 2px 8px; border-radius: 999px; }
.badge-s.ok { color: var(--green); background: rgba(48,209,88,.1); }
.badge-s.wait { color: #ffd60a; background: rgba(255,214,10,.1); }

/* ===================== typography: one clear scale ===================== */
:root {
  --ui: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", "Helvetica Neue", Arial, sans-serif;
  --t1: #f5f5f5; --t2: #a3a3a3; --t3: #7c7c7c;
  --fs: 14px; --fs-sm: 12.5px; --fs-label: 12px;
}
body { font: var(--fs)/1.5 var(--ui); letter-spacing: -0.006em; }

/* labels: sentence case, readable */
.cap, .insp h3, .lbl, .more-fonts summary {
  font: 600 var(--fs-label)/1.3 var(--ui); letter-spacing: 0; text-transform: none; color: var(--t2);
}
.cap { padding: 14px 10px 6px; }
.insp h3 { margin: 22px 0 9px; }

/* sidebar */
.nav-item { padding: 7px 10px; gap: 11px; }
.nav-item .n { font: 500 var(--fs)/1.3 var(--ui); letter-spacing: -0.01em; }
.nav-item .sub { font-size: 12px; color: var(--t3); }
.side .new-btn { font-size: 13px; }
.brand b { font-size: 25px; }
.brand span { font-size: 13px; }

/* titles */
.stage-head h1, .site-page h1 { font: 600 22px/1.2 var(--ui); letter-spacing: -0.02em; }
.status { font-size: 12.5px; }
.site-page .lead { font-size: var(--fs); }
.panel-head { font-size: var(--fs); }
.panel-head b { font-weight: 600; }

/* controls */
.btn { font-size: 13.5px; height: 36px; padding: 0 18px; }
.btn.small { font-size: 13px; height: 32px; padding: 0 14px; }
.seg button { font-size: 13px; padding: 7px 12px 6px; }
.field { font-size: var(--fs); }
.tog { font-size: var(--fs); padding: 11px 0; }
.tog small, .help, .hint, .vname, .insp .help { font-size: var(--fs-sm); color: var(--t3); line-height: 1.45; }
.tabs button { font-size: 13.5px; }
.vars button { aspect-ratio: 1.25; }
.styles button { font-size: 12px; }
.film-label { font-size: var(--fs-sm); }
.item-head b { font-size: 13px; }
.item-sub { font-size: 12.5px; }
.rte-bar select { font-size: 12.5px; }
.rte-body { font-size: calc(14.5px * var(--body-scale, 1)); }
.mail-addr b { font-size: var(--fs); }
.saved { font-size: 12.5px; }
.link { font-size: inherit; }
.toast { font-size: 13.5px; }
.modal-card h2 { font: 600 20px/1.25 var(--ui); letter-spacing: -0.015em; }
.signin h1 { font: 600 30px/1.15 var(--ui); letter-spacing: -0.025em; }

/* ===================== smoother ===================== */
.top { view-transition-name: topbar; }
.side { view-transition-name: sidebar; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .18s; animation-timing-function: cubic-bezier(.2,.8,.2,1); }
.pane, .site-page, .stage-head, .film { animation: appear .22s cubic-bezier(.2,.8,.2,1); }
@keyframes appear { from { opacity: 0; transform: translateY(3px); } }
.nav-item, .btn, .seg button, .tabs button, .vars button, .styles button { -webkit-tap-highlight-color: transparent; }
.nav-item:active { transform: scale(.985); transition: transform .1s; }
.canvas iframe { transition: opacity .3s cubic-bezier(.2,.8,.2,1); }
@media (prefers-reduced-motion: reduce) { .pane, .site-page, .stage-head, .film { animation: none; } }

/* ---------- collectives: lists, credits, people, theme ---------- */
.cap-link { cursor: pointer; border-radius: 8px; transition: color .2s, background .2s; }
.cap-link:hover, .cap-link.on { color: var(--t1); background: var(--well); }
.cap-more { font-size: 11px; letter-spacing: 0; text-transform: none; color: var(--t3); }
.cap-link:hover .cap-more, .cap-link.on .cap-more { color: var(--t2); }
.side-empty { color: var(--t3); font-size: 12px; padding: 4px 10px 8px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { padding: 5px 11px; border-radius: 999px; border: 1px solid var(--line2); color: var(--t2); font-size: 12px; transition: transform .35s var(--spring), color .2s, background .2s, border-color .2s; }
.chip:hover { color: var(--t1); transform: scale(1.03); }
.chip.on { background: #fff; color: #000; border-color: #fff; }
.form-grid.two { grid-template-columns: 1fr 1fr; gap: 10px; }
.insp .f input[type=date] { color-scheme: dark; }
.insp select.field { padding: 9px 11px; }
.themes { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.themes button { display: grid; gap: 4px; justify-items: start; text-align: left; padding: 14px; border-radius: 14px; background: var(--well); border: 1px solid var(--line); color: #6d6d6d; transition: transform .35s var(--spring), border-color .2s, background .2s, color .2s; }
.themes button svg { width: 100%; height: 70px; margin-bottom: 8px; }
.themes button svg * { fill: currentColor; }
.themes button b { color: var(--t1); font-weight: 600; }
.themes button span { color: var(--t3); font-size: 12px; }
.themes button:hover { transform: scale(1.015); color: #aaa; }
.themes button.on { border-color: rgba(255,255,255,.85); background: rgba(255,255,255,.08); color: #fff; }
.brand-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.brand-logo { width: 46px; height: 36px; background: #fff; -webkit-mask: var(--logo) center / contain no-repeat; mask: var(--logo) center / contain no-repeat; }
.menu-edit { display: grid; gap: 6px; max-width: 520px; }
.menu-row { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; padding: 6px 10px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); }
.menu-row.off input { opacity: .45; }
.menu-row .field { padding: 7px 10px; }
.menu-row .tog { border: 0; padding: 0; }
.menu-row.drag { opacity: .3; }
.grip { color: var(--t3); cursor: grab; letter-spacing: -2px; user-select: none; }
.people { display: grid; gap: 8px; }
.person { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) 100px auto auto; gap: 10px; align-items: center; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; }
.p-who { display: grid; gap: 3px; min-width: 0; }
.p-who .hint { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.person .field, .person-new .field { padding: 7px 10px; font-size: 12.5px; }
.p-name { background: none; border-color: transparent; padding-left: 0 !important; font-weight: 600; }
.p-name:hover, .p-name:focus { border-color: var(--line2); padding-left: 10px !important; }
.p-acts { display: flex; gap: 12px; white-space: nowrap; }
.person-new { display: grid; grid-template-columns: 1fr 1.3fr 1fr 100px auto; gap: 8px; align-items: center; }
@media (max-width: 1100px) { .person, .person-new { grid-template-columns: 1fr 1fr; } }
.mtile.is-embed .embed-ph { position: absolute; inset: 0; display: grid; place-items: center; color: var(--t2); font-size: 20px; }
.add-tile.link-tile { font-size: 11.5px; }

/* sign-in: logo above "<Name> Studio", centred */
.signin { grid-template-rows: auto auto; align-content: center; justify-items: center; gap: 30px; text-align: center; }
.signin form { justify-items: stretch; }
.signin-mark { display: grid; justify-items: center; gap: 14px; min-height: 92px; }
.signin-logo { display: block; width: 58px; aspect-ratio: 400 / 309; background: #fff; -webkit-mask: var(--logo) center / contain no-repeat; mask: var(--logo) center / contain no-repeat; }
.signin-mark h1 { font: 600 22px/1.1 var(--ui); letter-spacing: -.01em; margin: 0; }
.signin .sent b { color: var(--t1); font-weight: 600; font-size: 15px; }
.signin-step:not([hidden]) { animation: stepIn .35s var(--ease) both; }
@keyframes stepIn { from { opacity: 0; transform: translateY(6px); } }
.signin .btn.primary:disabled { opacity: .7; cursor: default; }
.signin .welcome { color: var(--t2); margin: 0; }

/* sign-in, code step: greeting, then where the code went, then the box; small print last */
.signin { gap: 36px; }
.signin form { width: min(340px, 100%); gap: 12px; }
.signin form > p { color: var(--t2); font-size: 14px; line-height: 1.5; }
.signin .sent { display: grid; gap: 4px; margin-bottom: 10px; }
.signin .sent h2 { font: 600 20px/1.2 var(--ui); color: var(--t1); margin: 0 0 6px; letter-spacing: -.01em; }
.signin .sent p { color: var(--t2); font-size: 14px; line-height: 1.45; margin: 0; }
.signin .sent .to { color: var(--t1); font-weight: 500; overflow-wrap: anywhere; }
.signin .code-field { height: 52px; }
.signin .err:empty { display: none; }
.signin .code-hint { color: var(--t3); font-size: 12px; line-height: 1.5; margin: 2px 0 0; }
.signin #back { color: var(--t2); font-size: 13px; margin-top: 2px; }
.signin #back:hover { color: var(--t1); }
.signin .intro { margin-bottom: 14px; line-height: 1.6; text-wrap: balance; }
.signin .intro br + * , .signin .intro { color: var(--t2); }
.signin form { width: min(400px, 100%); }
.signin .intro { text-wrap: wrap; white-space: normal; }
@media (min-width: 440px) { .signin .intro { white-space: nowrap; } }

/* text items in the photo strip */
.mtile.is-text { background: #161616; border: 1px solid var(--line2); }
.mtile.is-text .text-snip { position: absolute; inset: 10px 9px 22px; overflow: hidden; font-size: 10.5px; line-height: 1.4; color: #cfcfcf;
  display: -webkit-box; -webkit-line-clamp: 7; -webkit-box-orient: vertical; }
.mtile.is-text .text-snip i { color: var(--t3); }
.mtile.is-text.hidden-item .text-snip { opacity: .35; }
.modal-card.wide { width: min(620px, 100%); }
.modal-card .rte-mount { min-height: 200px; }

/* Studio top bar with a logo: logo + "<Name> Studio" in Studio's own type, like the sign-in screen */
.brand.with-logo { display: flex; align-items: center; gap: 10px; }
.brand.with-logo .brand-mark { width: 30px; height: 23px; background: #fff; -webkit-mask: var(--logo) center / contain no-repeat; mask: var(--logo) center / contain no-repeat; flex: none; }
.brand.with-logo b { font: 600 15px/1 var(--ui); letter-spacing: -.01em; }
.brand.with-logo span:not(.brand-mark) { color: var(--t2); font-size: 13px; }

/* collectives: Studio's headings in Studio's own type */
.studio-plain .stage-head h1 { font: 600 21px/1.15 var(--ui); letter-spacing: -.01em; }
.studio-plain .site-page h1 { font: 600 26px/1.15 var(--ui); letter-spacing: -.015em; }
.studio-plain .modal-card h2 { font: 600 18px/1.2 var(--ui); }
.studio-plain .drop b, .studio-plain .canvas .empty-drop b { font: 600 20px/1.2 var(--ui); letter-spacing: -.01em; }
.studio-plain .nav-item .n { font: 500 13.5px/1.2 var(--ui); letter-spacing: 0; }
.studio-plain .title-input { font: 600 26px/1.1 var(--ui); }
