/* Frosted glass over a canyon at dusk: glass panels, a floating rail, soft-square controls and colour
   tiles, with the editor's own pieces (preview, timeline, panels, chat) drawn in that language.
   Sizes are rem on a fluid root, so 1rem is 16px at 1920 wide and the whole page scales with the window. */
:root {
  color-scheme: dark;
  --night: #2a1d1c;
  /* The theme (js/themes.js): the photo, the glass tints that suit it, and the accent. These are the canyon's;
     the server writes the buyer's choice over them in <style id="theme">. */
  --tone: 36 22 21;
  --glass-rgb: 44 34 35;
  --panel: 36 27 26;
  --glow-a: 170 98 80;
  --glow-b: 190 128 86;
  --low: 70 44 38;
  --avatar-a: #ffc08a;
  --avatar-b: #f2785c;
  --bg-image: url("/app/bg.jpg");
  --bg-pos: 58% 38%;
  --accent: 138 162 255;
  --accent-hi: 167 185 255;
  --accent-lo: 111 127 240;
  --accent-text: 195 205 255;
  --ink: #fbf8f6;
  --muted: rgba(251, 248, 246, .64);
  --faint: rgba(251, 248, 246, .44);
  --glass: rgb(var(--glass-rgb) / .17);
  --line: rgba(255, 255, 255, .13);
  --white: #ffffff;
  --coal: #1c1917;
  --alert: #f2605a;
  --online: #3fd69a;
  --blue: 138 162 255;
  --green: 96 214 170;
  --amber: 255 184 108;
  --violet: 200 152 246;
  --red: 255 128 112;
  --orange: 255 107 31;
  --font: "Poppins", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

html { font-size: clamp(11.5px, calc(100vw / 120), 17px); -webkit-text-size-adjust: 100%; }
*, *::before, *::after { box-sizing: border-box; }
body {
  margin: 0; background: var(--night); color: var(--ink);
  font-family: var(--font); font-size: 1rem; line-height: 1.4;
  -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4, p { margin: 0; }
a { color: inherit; }
:focus-visible { outline: 2px solid rgba(255, 255, 255, .9); outline-offset: 3px; }
[hidden] { display: none !important; }
::selection { background: rgb(var(--accent) / .35); }
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .16); border-radius: 9px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-track { background: transparent; }
.ic { width: 1.2rem; height: 1.2rem; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.tnum { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.hint { font-size: .74rem; color: var(--muted); line-height: 1.5; }
.row { display: flex; align-items: center; gap: .5rem; }
.spacer { flex: 1; }

/* The room behind the glass */
.scene { position: fixed; inset: 0; z-index: 0; background: var(--night) var(--bg-image) var(--bg-pos) / cover no-repeat; transition: background-image .4s; }
.scene::after {
  content: ""; position: absolute; inset: 0;
  background:
    linear-gradient(180deg, rgb(var(--tone) / .94) 0, rgb(var(--tone) / .78) 3.2rem, rgb(var(--tone) / .22) 6.6rem, rgb(var(--tone) / 0) 9rem),
    radial-gradient(55% 45% at 0% 100%, rgb(var(--glow-a) / .42), rgb(var(--glow-a) / 0) 70%),
    radial-gradient(40% 55% at 100% 78%, rgb(var(--glow-b) / .36), rgb(var(--glow-b) / 0) 70%),
    linear-gradient(0deg, rgb(var(--low) / .55) 0, rgb(var(--low) / 0) 50%);
}
.app {
  position: relative; z-index: 1;
  padding-block: 1.7rem 3rem;
  padding-left: max(6.3rem, env(safe-area-inset-left, 0px));
  padding-right: max(7.2rem, env(safe-area-inset-right, 0px));
}

/* Glass */
.glass {
  background:
    linear-gradient(168deg, rgba(255, 255, 255, .14) 0%, rgba(255, 255, 255, .05) 38%, rgba(255, 255, 255, .02) 100%),
    var(--glass);
  -webkit-backdrop-filter: blur(26px) saturate(125%);
  backdrop-filter: blur(26px) saturate(125%);
  border: 1px solid var(--line);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .14), inset 1px 0 0 rgba(255, 255, 255, .05), 0 1.4rem 3rem -1.6rem rgba(12, 8, 8, .55);
}
.card { position: relative; border-radius: 1.3rem; }

/* Top bar */
.topbar { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; min-height: 3.3rem; gap: 1rem; }
.tb-left, .tb-right { display: flex; align-items: center; gap: .65rem; }
.tb-right { justify-self: end; position: relative; }
.tb-center { display: flex; gap: .72rem; }
.ib {
  position: relative; flex: none; width: 3.25rem; height: 3.25rem; border-radius: 1.05rem;
  display: grid; place-items: center; color: rgba(255, 255, 255, .9); text-decoration: none;
  background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .14);
  -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px);
  transition: background .2s ease, transform .2s ease, opacity .2s;
}
.ib:hover { background: rgba(255, 255, 255, .18); }
.ib:active { transform: scale(.96); }
.ib:disabled { opacity: .35; cursor: default; transform: none; }
.ib.on { background: #f4f2f1; color: var(--coal); border-color: transparent; }
.ib .tip, .tipped .tip {
  position: absolute; top: calc(100% + .55rem); left: 50%; transform: translate(-50%, -.25rem);
  padding: .32rem .65rem; border-radius: .55rem; white-space: nowrap; pointer-events: none; opacity: 0; z-index: 30;
  font-size: .72rem; font-weight: 500; color: var(--white); background: rgba(22, 18, 18, .82);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); transition: opacity .15s ease, transform .15s ease;
}
.ib:hover .tip, .tipped:hover .tip { opacity: 1; transform: translate(-50%, 0); }
.pill {
  height: 2.95rem; padding: 0 1.35rem; display: inline-flex; align-items: center; gap: .6rem; text-decoration: none;
  border-radius: 1rem; font-size: 1rem; font-weight: 500; white-space: nowrap; color: rgba(255, 255, 255, .9);
  background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .14);
  -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px); transition: background .2s ease;
}
.pill .ic { width: 1.1rem; height: 1.1rem; }
.pill:hover { background: rgba(255, 255, 255, .17); }
.pill[aria-current="page"] { background: rgba(18, 12, 12, .8); border-color: rgba(255, 255, 255, .06); color: var(--white); }
.pill .count { min-width: 1.15rem; height: 1.15rem; padding: 0 .3rem; border-radius: 999px; display: grid; place-items: center; background: var(--alert); color: var(--white); font-size: .62rem; font-weight: 700; }
.dot-red { position: absolute; top: .78rem; right: .74rem; width: .5rem; height: .5rem; border-radius: 50%; background: var(--alert); box-shadow: 0 0 0 2px rgb(var(--panel) / .9); }
.badge {
  position: absolute; top: -.22rem; right: -.18rem; min-width: 1.15rem; height: 1.15rem; padding: 0 .25rem;
  border-radius: 999px; display: grid; place-items: center; background: var(--alert); color: var(--white);
  font-size: .62rem; font-weight: 700; border: 2px solid rgb(var(--panel) / .95);
}
.avatar {
  position: relative; flex: none; width: 3.4rem; height: 3.4rem; border-radius: 50%;
  display: grid; place-items: center; font-size: 1rem; font-weight: 600; color: var(--white); cursor: default;
  background: linear-gradient(140deg, var(--avatar-a), var(--avatar-b)); box-shadow: 0 .4rem 1.2rem -.3rem color-mix(in srgb, var(--avatar-b) 60%, transparent);
}
.avatar i { position: absolute; right: .02rem; bottom: .02rem; width: .8rem; height: .8rem; border-radius: 50%; background: rgba(160, 150, 145, .9); border: .17rem solid rgb(var(--panel) / .95); }
.avatar.live i { background: var(--online); }

/* Popovers, toasts and dialogs */
.pop {
  position: absolute; z-index: 40; width: 21rem; max-width: calc(100vw - 32px);
  padding: 1rem; border-radius: 1.2rem;
  background: linear-gradient(155deg, rgba(255, 255, 255, .12), rgba(255, 255, 255, .04)), rgb(var(--panel) / .72);
  -webkit-backdrop-filter: blur(30px) saturate(130%); backdrop-filter: blur(30px) saturate(130%);
  border: 1px solid rgba(255, 255, 255, .14); box-shadow: 0 1.5rem 3rem -1rem rgba(8, 5, 4, .6);
}
.pop-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: .4rem; font-size: .9rem; font-weight: 600; }
.conn {
  position: fixed; z-index: 110; top: calc(1rem + env(safe-area-inset-top, 0px)); left: 50%; transform: translateX(-50%);
  display: flex; align-items: center; gap: .6rem; padding: .6rem 1.05rem; border-radius: 1rem; font-size: .8rem; font-weight: 500;
  background: rgb(var(--panel) / .88); border: 1px solid rgba(255, 255, 255, .16); box-shadow: 0 1rem 2rem -1rem rgba(0, 0, 0, .6);
  -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px); animation: toastIn .2s ease;
}
#toasts { position: fixed; left: 50%; bottom: calc(1.5rem + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); z-index: 100; display: flex; flex-direction: column; align-items: center; gap: .5rem; pointer-events: none; }
.toast {
  max-width: min(36rem, calc(100vw - 32px)); padding: .7rem 1.15rem; border-radius: 999px; font-size: .82rem; font-weight: 500;
  background: rgb(var(--panel) / .84); border: 1px solid rgba(255, 255, 255, .14);
  -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px); transition: opacity .2s ease, transform .2s ease;
  animation: toastIn .2s ease;
}
@keyframes toastIn { from { opacity: 0; transform: translateY(.5rem); } }
.toast.ok { border-color: rgb(var(--green) / .45); }
.toast.error { border-color: rgb(var(--red) / .55); }
.toast.out { opacity: 0; transform: translateY(.5rem); }
.modal-wrap { position: fixed; inset: 0; z-index: 70; display: grid; place-items: center; padding: 16px; background: rgba(14, 9, 9, .45); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.modal {
  width: min(32rem, 100%); max-height: 88vh; overflow: auto; border-radius: 1.3rem;
  background: linear-gradient(155deg, rgba(255, 255, 255, .12), rgba(255, 255, 255, .04)), rgb(var(--panel) / .82);
  -webkit-backdrop-filter: blur(30px) saturate(130%); backdrop-filter: blur(30px) saturate(130%);
  border: 1px solid rgba(255, 255, 255, .14); box-shadow: 0 2rem 4rem -1rem rgba(8, 5, 4, .7);
}
.modal.wide { width: min(52rem, 100%); }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 1.3rem 1.4rem .3rem; }
.modal-head h2 { font-size: 1.15rem; font-weight: 600; letter-spacing: -.005em; }
.modal-body { padding: .5rem 1.4rem 1.2rem; color: var(--muted); font-size: .86rem; }
.modal-body p { margin: .3rem 0; }
.modal-actions { display: flex; justify-content: flex-end; gap: .5rem; padding: 0 1.4rem 1.3rem; }
.icon-btn { width: 2.1rem; height: 2.1rem; display: inline-grid; place-items: center; border-radius: .7rem; color: var(--muted); background: rgba(255, 255, 255, .07); border: 1px solid rgba(255, 255, 255, .1); transition: background .2s, color .2s; flex: none; }
.icon-btn:hover { background: rgba(255, 255, 255, .15); color: var(--white); }
.icon-btn .ic { width: .95rem; height: .95rem; }

/* Controls */
.btn {
  height: 2.6rem; padding: 0 1.15rem; display: inline-flex; align-items: center; justify-content: center; gap: .5rem; border-radius: .9rem;
  font-size: .86rem; font-weight: 500; white-space: nowrap; color: var(--ink); text-decoration: none;
  background: rgba(255, 255, 255, .18); border: 1px solid rgba(255, 255, 255, .22);
  -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px); transition: background .2s, opacity .2s, transform .1s;
}
.btn:hover { background: rgba(255, 255, 255, .26); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .4; cursor: default; transform: none; }
.btn .ic { width: 1.05rem; height: 1.05rem; }
.btn.big { height: 3rem; padding: 0 1.35rem; font-size: .92rem; }
.btn.small { height: 2.1rem; padding: 0 .9rem; font-size: .76rem; }
.btn.small .ic { width: .9rem; height: .9rem; }
.btn.primary { background: var(--white); color: var(--coal); border-color: transparent; font-weight: 600; box-shadow: 0 2px 10px rgba(0, 0, 0, .18); }
.btn.primary:hover { background: #f1eeec; }
.btn.approve { background: rgb(var(--green) / .24); border-color: rgb(var(--green) / .45); color: #c4f6e0; font-weight: 600; }
.btn.approve:hover { background: rgb(var(--green) / .34); }
.btn.ghost { background: transparent; border-color: transparent; -webkit-backdrop-filter: none; backdrop-filter: none; color: var(--muted); }
.btn.ghost:hover { background: rgba(255, 255, 255, .1); color: var(--white); }
.btn.danger { color: #ffb3a6; }
.seg {
  display: inline-flex; gap: .15rem; padding: .28rem; border-radius: 1rem; flex-wrap: nowrap;
  background: rgba(255, 255, 255, .2); border: 1px solid rgba(255, 255, 255, .22);
  -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px);
}
.seg button { height: 2.2rem; padding: 0 1.05rem; border-radius: .74rem; font-size: .8rem; font-weight: 500; color: rgba(255, 255, 255, .64); transition: background .2s, color .2s; white-space: nowrap; display: inline-flex; align-items: center; gap: .35rem; }
.seg button:hover { color: var(--white); }
.seg button.on, .seg button[aria-pressed="true"] { background: var(--white); color: var(--coal); font-weight: 600; box-shadow: 0 2px 8px rgba(0, 0, 0, .18); }
.seg.sm { padding: .2rem; }
.seg:empty { display: none; }
.seg.sm button { height: 1.8rem; padding: 0 .8rem; font-size: .74rem; }
.input, select.input, textarea.input {
  width: 100%; min-height: 2.6rem; padding: .55rem 1rem; border-radius: 1rem; font-size: .85rem; color: var(--ink); outline: none;
  background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .16); transition: border-color .2s, background .2s;
}
input.input, select.input { border-radius: .9rem; }
.input::placeholder, textarea::placeholder { color: var(--faint); }
.input:focus { border-color: rgba(255, 255, 255, .42); background: rgba(255, 255, 255, .13); }
select.input { appearance: none; padding-right: 2.2rem; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-opacity='.7' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right .9rem center; background-size: .9rem; }
select.input option { background: var(--night); color: var(--ink); }
.toggle { appearance: none; width: 2.5rem; height: 1.45rem; border-radius: 999px; background: rgba(255, 255, 255, .18); border: 1px solid rgba(255, 255, 255, .2); position: relative; cursor: pointer; transition: background .2s; flex: none; margin: 0; }
.toggle::after { content: ''; position: absolute; top: .15rem; left: .17rem; width: 1.05rem; height: 1.05rem; border-radius: 50%; background: var(--white); transition: transform .2s; box-shadow: 0 1px 4px rgba(0, 0, 0, .3); }
.toggle:checked { background: rgb(var(--accent) / .75); }
.toggle:checked::after { transform: translateX(1.05rem); }
input[type="range"] { -webkit-appearance: none; appearance: none; width: 100%; height: 1.4rem; background: transparent; cursor: pointer; }
input[type="range"]::-webkit-slider-runnable-track { height: .3rem; border-radius: 999px; background: rgba(255, 255, 255, .2); }
input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 1rem; height: 1rem; margin-top: -.35rem; border-radius: 50%; background: var(--white); box-shadow: 0 1px 6px rgba(0, 0, 0, .4); }
input[type="color"] { width: 2.4rem; height: 1.7rem; padding: 0; border: 1px solid rgba(255, 255, 255, .22); border-radius: .6rem; background: none; cursor: pointer; }
input[type="color"]::-webkit-color-swatch-wrapper { padding: 2px; }
input[type="color"]::-webkit-color-swatch { border: 0; border-radius: .45rem; }
.chip {
  display: inline-flex; align-items: center; gap: .4rem; height: 1.85rem; padding: 0 .8rem; border-radius: 999px; font-size: .74rem; font-weight: 500;
  background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .14); color: rgba(255, 255, 255, .86); white-space: nowrap; transition: background .2s;
}
button.chip:hover { background: rgba(255, 255, 255, .18); }
.chip .dot { width: .42rem; height: .42rem; border-radius: 50%; background: currentColor; box-shadow: 0 0 .5rem currentColor; }
.chips { display: flex; flex-wrap: wrap; gap: .4rem; }
.state { display: inline-flex; align-items: center; gap: .35rem; height: 1.5rem; padding: 0 .65rem; border-radius: 999px; font-size: .68rem; font-weight: 600; border: 1px solid; white-space: nowrap; }
.state::before { content: ''; width: .4rem; height: .4rem; border-radius: 50%; background: currentColor; box-shadow: 0 0 .45rem currentColor; }
.state.you { color: #c3cdff; background: rgb(var(--blue) / .16); border-color: rgb(var(--blue) / .34); }
.state.work { color: #ffd3a1; background: rgb(var(--amber) / .16); border-color: rgb(var(--amber) / .34); }
.state.work::before { animation: blink 1.1s infinite; }
.state.done { color: #a3f0d2; background: rgb(var(--green) / .16); border-color: rgb(var(--green) / .32); }
.state.idle { color: var(--muted); background: rgba(255, 255, 255, .08); border-color: rgba(255, 255, 255, .14); }
@keyframes blink { 50% { opacity: .3; } }
.delta {
  display: inline-flex; align-items: center; gap: .3rem; height: 1.4rem; padding: 0 .6rem; border-radius: 999px;
  font-size: .68rem; font-weight: 600; border: 1px solid; white-space: nowrap; font-variant-numeric: tabular-nums;
}
.delta .ic { width: .8rem; height: .8rem; stroke-width: 2.2; }
.delta.up { color: #a3f0d2; background: rgb(var(--green) / .16); border-color: rgb(var(--green) / .32); }
.delta.down { color: #ffb3a6; background: rgb(var(--red) / .18); border-color: rgb(var(--red) / .36); }
.delta.flat { color: rgba(255, 255, 255, .78); background: rgba(255, 255, 255, .08); border-color: rgba(255, 255, 255, .16); }
.progress { height: .4rem; border-radius: 999px; background: rgba(255, 255, 255, .14); overflow: hidden; }
.progress > div { height: 100%; width: 0; border-radius: 999px; background: linear-gradient(90deg, rgb(var(--accent-hi)), rgb(var(--accent-lo))); box-shadow: 0 0 .8rem rgb(var(--accent) / .5); transition: width .3s ease; }
.spin { width: 1rem; height: 1rem; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .2); border-top-color: currentColor; animation: spin .8s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }
.code-block { background: rgba(0, 0, 0, .25); border: 1px solid rgba(255, 255, 255, .12); border-radius: .8rem; padding: .55rem .8rem; font: .76rem ui-monospace, "SF Mono", Menlo, monospace; user-select: all; overflow-x: auto; white-space: pre; color: var(--ink); }
kbd { font: .68rem ui-monospace, monospace; padding: .05rem .35rem; border-radius: .3rem; border: 1px solid rgba(255, 255, 255, .25); color: var(--muted); }
.field { display: grid; gap: .4rem; margin: .8rem 0; }
.field > label { font-size: .76rem; color: var(--muted); }

/* Left rail */
.rail {
  position: fixed; z-index: 20; top: 50%; left: max(1.6rem, env(safe-area-inset-left, 0px)); transform: translateY(-50%);
  display: flex; flex-direction: column; gap: .78rem; padding: .6rem; border-radius: 1.45rem;
  background: rgba(26, 23, 26, .5); border: 1px solid rgba(255, 255, 255, .08);
  -webkit-backdrop-filter: blur(22px) saturate(120%); backdrop-filter: blur(22px) saturate(120%);
  box-shadow: 0 1rem 2.5rem -1rem rgba(0, 0, 0, .5);
}
.rail .ib { width: 3rem; height: 3rem; border-radius: .95rem; color: rgba(255, 255, 255, .78); background: rgba(255, 255, 255, .08); border-color: rgba(255, 255, 255, .06); }
.rail .ib:hover { background: rgba(255, 255, 255, .15); }
.rail .ib.on { background: #f4f2f1; color: var(--coal); border-color: transparent; }
.rail .ib .tip { top: 50%; left: calc(100% + .75rem); transform: translate(-.25rem, -50%); }
.rail .ib:hover .tip { transform: translate(0, -50%); }

/* Page heading */
.main { margin-left: 2.9rem; margin-right: 1.8rem; }
.hello { display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; margin-top: 2.2rem; }
.hello h1 { font-size: 1.95rem; font-weight: 600; line-height: 1.15; letter-spacing: -.012em; text-wrap: balance; }
.hello h1[contenteditable] { outline: none; border-radius: .5rem; padding: 0 .2rem; margin: 0 -.2rem; cursor: text; }
.hello h1[contenteditable]:hover, .hello h1[contenteditable]:focus { background: rgba(255, 255, 255, .08); }
.hello p { margin-top: .3rem; font-size: .8rem; color: var(--muted); display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.hello-actions { display: flex; align-items: center; gap: .55rem; flex-wrap: wrap; justify-content: flex-end; }

/* Panels */
.panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; }
.panel-title { font-size: 1.15rem; font-weight: 600; letter-spacing: -.005em; }
.panel-sub { margin-top: .12rem; font-size: .76rem; color: var(--muted); }
.link { display: inline-flex; align-items: center; gap: .3rem; padding: .3rem 0; font-size: .74rem; font-weight: 600; color: rgba(255, 255, 255, .88); }
.link:hover { color: var(--white); }
.link .ic { width: .85rem; height: .85rem; }
.tile {
  width: 2.75rem; height: 2.75rem; border-radius: .8rem; display: grid; place-items: center; flex: none;
  color: rgb(var(--c)); background: rgb(var(--c) / .24); border: 1px solid rgb(var(--c) / .34);
}
.tile .ic { width: 1.15rem; height: 1.15rem; stroke-width: 2; }
.av {
  width: 2.5rem; height: 2.5rem; border-radius: 50%; flex: none; display: grid; place-items: center; position: relative;
  font-size: .76rem; font-weight: 600; color: var(--white); text-shadow: 0 1px 2px rgba(0, 0, 0, .15);
  background: linear-gradient(135deg, var(--a, #b9c3ff), var(--b, #6f7ff0));
}
.online::after { content: ""; position: absolute; right: -.05rem; bottom: -.05rem; width: .72rem; height: .72rem; border-radius: 50%; background: var(--online); border: .15rem solid rgb(var(--panel) / .95); }
.offline::after { content: ""; position: absolute; right: -.05rem; bottom: -.05rem; width: .72rem; height: .72rem; border-radius: 50%; background: rgba(160, 150, 145, .9); border: .15rem solid rgb(var(--panel) / .95); }

/* ---------- Home ---------- */
.drop {
  margin-top: 1.75rem; padding: 2.6rem 1.5rem; text-align: center; cursor: pointer; border-radius: 1.3rem;
  border: 1.5px dashed rgba(255, 255, 255, .28); transition: border-color .2s, background .2s;
}
.drop:hover, .drop.over { border-color: rgba(255, 255, 255, .6); }
.drop .tile { margin: 0 auto 1rem; width: 3.4rem; height: 3.4rem; border-radius: 1rem; }
.drop h2 { font-size: 1.45rem; font-weight: 600; letter-spacing: -.01em; }
.drop p { margin-top: .35rem; font-size: .84rem; color: var(--muted); }
.drop .progress { max-width: 24rem; margin: 1rem auto 0; }
.inbox-card { display: flex; align-items: center; gap: 1rem; margin-top: 1.45rem; padding: 1.1rem 1.45rem; }
.inbox-card b { font-size: .95rem; font-weight: 600; }
.inbox-card .sub { font-size: .76rem; color: var(--muted); margin-top: .1rem; }
.section-head { display: flex; align-items: flex-end; gap: 1rem; margin: 2.4rem 0 1.1rem; }
.section-head h2 { font-size: 1.15rem; font-weight: 600; letter-spacing: -.005em; }
.section-head .panel-sub { margin: 0 0 .1rem; }
.vgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(13.5rem, 1fr)); gap: 1.45rem; }
.vcard { overflow: hidden; cursor: pointer; transition: transform .25s ease, border-color .25s ease; display: block; text-decoration: none; color: inherit; }
.vcard:hover { transform: translateY(-2px); border-color: rgba(255, 255, 255, .28); }
.vcard .thumb { aspect-ratio: 9 / 12.5; background: rgba(0, 0, 0, .25) center / cover no-repeat; display: grid; place-items: center; color: var(--faint); }
.vcard .thumb .ic { width: 2rem; height: 2rem; }
.vcard .info { padding: .9rem 1.1rem 1.05rem; }
.vcard .name { font-size: .92rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vcard .sub { margin-top: .2rem; font-size: .72rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vcard .foot { display: flex; align-items: center; justify-content: space-between; margin-top: .6rem; }
.vcard .menu { position: absolute; top: .7rem; right: .7rem; opacity: 0; transition: opacity .2s; }
.vcard:hover .menu { opacity: 1; }
.lgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(16.5rem, 1fr)); gap: 1.45rem; }
.look-card .row { flex-wrap: wrap; }
.look-card { padding: 1.4rem 1.45rem; display: flex; flex-direction: column; gap: .6rem; min-height: 11.6rem; }
.look-card .name { font-size: 1rem; font-weight: 600; }
.look-card .sub { font-size: .76rem; color: var(--muted); flex: 1; }
.look-card.on { border-color: rgba(255, 255, 255, .34); }
.lib-list { padding: 1.3rem 1.45rem; display: flex; flex-direction: column; gap: .8rem; }
.lib-row { display: grid; grid-template-columns: 2.5rem minmax(0, 1fr) auto; align-items: center; gap: .85rem; }
.lib-row .th { width: 2.5rem; height: 2.5rem; border-radius: .7rem; background: rgba(255, 255, 255, .1) center / cover; display: grid; place-items: center; color: var(--muted); }
.lib-row .nm { font-size: .85rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lib-row .hint { margin: 0; }
.empty-card { padding: 2rem; text-align: center; color: var(--muted); font-size: .85rem; }

/* ---------- Editor ---------- */
.ed-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1.45rem; margin-top: 1.75rem; }
.preview-card, .side-card { grid-column: span 2; height: max(38rem, calc(100vh - 12.5rem)); display: flex; flex-direction: column; }
.preview-card { padding: 1.5rem 1.45rem 1.2rem; }
.side-card { padding: 1.5rem 0 0; overflow: hidden; }
.side-card > .panel-head { padding: 0 1.45rem; }
.stage { flex: 1; min-height: 0; margin-top: 1.1rem; display: grid; place-items: center; position: relative; }
.screen { position: relative; height: 100%; aspect-ratio: var(--ar, 9 / 16); max-width: 100%; border-radius: 1.2rem; overflow: hidden; background: #000; box-shadow: 0 1.5rem 3rem -1rem rgba(0, 0, 0, .6), 0 0 0 1px rgba(255, 255, 255, .1); }
.screen > canvas, .screen > video { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.screen > video { object-fit: contain; background: #000; }
.screen .overlay { pointer-events: none; }
.screen.rendered { box-shadow: 0 1.5rem 3rem -1rem rgba(0, 0, 0, .6), 0 0 0 2px rgb(var(--green) / .7); }
.screen-badge { position: absolute; top: .8rem; left: 50%; transform: translateX(-50%); padding: .3rem .8rem; border-radius: 999px; background: rgba(20, 13, 13, .62); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); font-size: .7rem; font-weight: 600; white-space: nowrap; pointer-events: none; z-index: 2; }
.screen-hint { position: absolute; bottom: .8rem; left: 50%; transform: translateX(-50%); padding: .3rem .8rem; border-radius: 999px; background: rgba(20, 13, 13, .55); font-size: .68rem; color: rgba(255, 255, 255, .85); pointer-events: none; white-space: nowrap; opacity: 0; transition: opacity .2s; z-index: 2; }
.screen:hover .screen-hint { opacity: 1; }
.stage.playing .screen-hint { opacity: 0; }
.big-play { position: absolute; inset: 0; margin: auto; width: 4.6rem; height: 4.6rem; border-radius: 50%; background: rgba(255, 255, 255, .16); border: 1px solid rgba(255, 255, 255, .3); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); display: grid; place-items: center; z-index: 3; transition: opacity .2s, transform .15s; }
.big-play .ic { width: 1.6rem; height: 1.6rem; fill: currentColor; margin-left: .2rem; }
.big-play:hover { transform: scale(1.05); }
.stage.started .big-play { opacity: 0; pointer-events: none; }
.controls { display: grid; grid-template-columns: auto auto minmax(0, 1fr) auto; align-items: center; gap: .9rem; margin-top: 1rem; }
.controls .ib { width: 2.9rem; height: 2.9rem; }
.controls .ib.play { background: var(--white); color: var(--coal); border-color: transparent; }
.controls .ib.play .ic { fill: currentColor; }
.time { font-size: .78rem; color: var(--muted); min-width: 6.4rem; }
.scrub { position: relative; height: 1.8rem; cursor: pointer; touch-action: none; }
.scrub .track { position: absolute; left: 0; right: 0; top: .78rem; height: .26rem; border-radius: 999px; background: rgba(255, 255, 255, .16); }
.scrub .fill { position: absolute; left: 0; top: .78rem; height: .26rem; border-radius: 999px; background: var(--white); }
.scrub .head { position: absolute; top: .5rem; width: .82rem; height: .82rem; margin-left: -.41rem; border-radius: 50%; background: var(--white); box-shadow: 0 0 0 .25rem rgba(255, 255, 255, .15), 0 2px 8px rgba(0, 0, 0, .4); }
.scrub .mark { position: absolute; top: .18rem; width: .6rem; height: .6rem; margin-left: -.3rem; border-radius: 50%; background: rgb(var(--accent-hi)); box-shadow: 0 0 .5rem rgb(var(--accent) / .8); }
.load-cover { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(0, 0, 0, .45); z-index: 4; color: var(--muted); }
.pins { position: absolute; inset: 0; pointer-events: none; z-index: 2; }
.pin { position: absolute; width: 1.9rem; height: 1.9rem; margin: -.95rem 0 0 -.95rem; border-radius: 50%; background: linear-gradient(180deg, rgb(var(--accent-hi)), rgb(var(--accent-lo))); color: #fff; font-weight: 700; font-size: .78rem; display: grid; place-items: center; border: 2px solid #fff; box-shadow: 0 0 1.2rem rgb(var(--accent) / .65); pointer-events: auto; cursor: pointer; transition: transform .15s; }
.pin:hover { transform: scale(1.12); }
.pin.draft { animation: pinIn .2s ease-out; }
@keyframes pinIn { from { transform: scale(.4); opacity: 0; } }
.note-pop { width: 17rem; z-index: 6; }
.note-pop textarea { min-height: 4.6rem; resize: none; }
.note-pop .row { justify-content: flex-end; margin-top: .6rem; }
.inspector { position: absolute; left: 50%; bottom: 4.2rem; transform: translateX(-50%); width: min(26rem, 92%); z-index: 6; display: grid; gap: .6rem; }
.inspector textarea { font: .72rem ui-monospace, monospace; min-height: 8rem; }
.versions-bar { display: flex; gap: .4rem; flex-wrap: wrap; justify-content: center; margin-top: .9rem; }

/* side card */
.side-body { flex: 1; min-height: 0; overflow-y: auto; padding: 1.1rem 1.45rem 1.4rem; scrollbar-width: thin; }
.side-foot { border-top: 1px solid rgba(255, 255, 255, .1); padding: 1rem 1.45rem 1.2rem; display: grid; gap: .7rem; background: rgba(20, 13, 13, .12); }
.side-foot .summary { font-size: .78rem; color: var(--muted); display: flex; align-items: center; gap: .5rem; min-height: 1.4rem; }
.side-foot .summary b { color: var(--ink); font-weight: 600; }
.side-foot .btns { display: flex; gap: .55rem; }
.side-foot .btns .btn { flex: 1; height: 2.9rem; font-size: .88rem; }
.working { display: flex; align-items: center; gap: .9rem; padding: .85rem 1rem; border-radius: 1rem; background: rgb(var(--amber) / .12); border: 1px solid rgb(var(--amber) / .3); }
.working .t { font-size: .86rem; font-weight: 600; }
.working .s { font-size: .72rem; color: var(--muted); margin-top: .1rem; }
.working .progress { margin-top: .5rem; }
.approved { display: flex; gap: .9rem; align-items: center; padding: .85rem 1rem; border-radius: 1rem; background: rgb(var(--green) / .14); border: 1px solid rgb(var(--green) / .34); }
.approved .tile { --c: var(--green); }
.listen-warn { display: flex; gap: .6rem; align-items: flex-start; padding: .7rem .9rem; border-radius: .9rem; background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .1); font-size: .74rem; color: var(--muted); }

/* transcript */
.tline { display: grid; grid-template-columns: 3.4rem minmax(0, 1fr); align-items: start; padding: .45rem .5rem; margin: 0 -.5rem; border-radius: .9rem; position: relative; }
.tline:hover { background: rgba(255, 255, 255, .05); }
.tline .ts { padding-top: .2rem; font-size: .7rem; color: var(--faint); cursor: pointer; font-variant-numeric: tabular-nums; }
.tline .ts:hover { color: var(--white); }
.tline .txt { font-size: .95rem; line-height: 1.7; user-select: none; }
.tline.has-takes .txt { padding-right: 5.6rem; }
.w { border-radius: .3rem; padding: .05rem 0; cursor: text; transition: background .1s; }
.w:hover { background: rgba(255, 255, 255, .12); }
.w.cut { color: var(--faint); text-decoration: line-through; text-decoration-color: rgba(255, 255, 255, .3); }
.w.mine { color: rgba(255, 255, 255, .55); text-decoration: line-through; text-decoration-color: #ffb3a6; text-decoration-thickness: 2px; }
.w.emph { color: #ffd0c2; font-weight: 600; }
.w.sel { background: rgb(var(--accent) / .4) !important; color: var(--white); }
.w.now { box-shadow: inset 0 -2px 0 rgb(var(--accent-hi)); color: var(--white); }
.takes-btn { position: absolute; right: .5rem; top: .5rem; height: 1.7rem; padding: 0 .7rem; border-radius: 999px; font-size: .68rem; font-weight: 600; color: var(--muted); background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .14); opacity: 0; transition: opacity .15s, background .15s; display: inline-flex; align-items: center; gap: .3rem; }
.takes-btn .ic { width: .8rem; height: .8rem; }
.tline:hover .takes-btn, .takes-btn.open { opacity: 1; }
.takes-btn:hover { background: rgba(255, 255, 255, .16); color: var(--white); }
.cutblock { margin: .1rem 0 .1rem 3.4rem; }
.cutblock > button { display: inline-flex; align-items: center; gap: .3rem; font-size: .72rem; color: var(--faint); padding: .25rem 0; text-align: left; }
.cutblock > button .ic { width: .8rem; height: .8rem; }
.cutblock > button:hover { color: var(--muted); }
.cutblock .tline .txt { font-size: .82rem; }
.takes { margin: .3rem 0 .7rem 3.4rem; padding: .7rem; border-radius: 1rem; background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .1); }
.takes h4 { margin: 0 0 .4rem .3rem; font-size: .72rem; color: var(--muted); font-weight: 600; }
.take { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: .7rem; align-items: start; padding: .55rem .35rem; }
.take + .take { border-top: 1px solid rgba(255, 255, 255, .08); }
.take .lbl { font-size: .68rem; color: var(--faint); padding-top: .15rem; white-space: nowrap; }
.take .tt { font-size: .82rem; color: var(--muted); }
.take.current .tt { color: var(--ink); }
.take .acts { display: flex; gap: .3rem; align-items: center; }
.take .inuse { font-size: .7rem; color: #a3f0d2; font-weight: 600; white-space: nowrap; padding: 0 .3rem; }
.sel-bar { position: fixed; z-index: 50; display: flex; gap: .3rem; padding: .3rem; width: auto; border-radius: 1rem; }
.tools-row { display: flex; align-items: center; gap: .5rem; margin-bottom: .9rem; flex-wrap: wrap; }

/* notes (Today-style rows) */
.ev-row { display: grid; grid-template-columns: 3.4rem minmax(0, 1fr); align-items: start; margin-bottom: .9rem; }
.ev-at { padding-top: .8rem; font-size: .7rem; color: var(--faint); font-variant-numeric: tabular-nums; }
.ev {
  --c: var(--blue);
  padding: .7rem 1rem .7rem; border-radius: .9rem; border-left: 3px solid rgb(var(--c));
  background: linear-gradient(100deg, rgb(var(--c) / .17), rgb(var(--c) / .06) 55%, rgba(255, 255, 255, .035));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06); display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .8rem; cursor: pointer;
}
.ev.general { --c: var(--violet); }
.ev.past { --c: var(--amber); opacity: .75; cursor: default; }
.ev-title { font-size: .86rem; font-weight: 600; line-height: 1.3; white-space: pre-wrap; word-break: break-word; }
.ev-span { margin-top: .2rem; font-size: .72rem; color: var(--muted); }
.ev img { width: 2.8rem; height: 5rem; object-fit: cover; border-radius: .5rem; background: #000; }
.ev .x { align-self: start; }
.add-note { display: flex; gap: .5rem; align-items: flex-end; margin-top: 1rem; }
.add-note textarea { flex: 1; min-height: 2.6rem; height: 2.6rem; resize: vertical; }
.changes { padding: .9rem 1rem; border-radius: 1rem; margin-bottom: 1rem; background: rgb(var(--green) / .12); border: 1px solid rgb(var(--green) / .3); }
.changes h4 { font-size: .72rem; color: #a3f0d2; font-weight: 600; margin-bottom: .25rem; }
.changes p { font-size: .84rem; white-space: pre-wrap; }
.empty-note { text-align: center; padding: 1.6rem .8rem; color: var(--muted); font-size: .8rem; }
.empty-note .tile { margin: 0 auto .8rem; --c: var(--blue); }
.empty-note b { color: var(--ink); }

/* Claude chat */
.messages { display: flex; flex-direction: column; gap: .7rem; }
.msg { max-width: 92%; padding: .7rem .95rem; border-radius: 1.1rem; font-size: .84rem; line-height: 1.5; white-space: pre-wrap; word-break: break-word; }
.msg.user { align-self: flex-end; background: var(--white); color: var(--coal); border-bottom-right-radius: .35rem; }
.msg.claude { align-self: flex-start; background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .14); border-bottom-left-radius: .35rem; }
.msg.claude .who { display: flex; align-items: center; gap: .4rem; font-size: .68rem; color: var(--muted); font-weight: 600; margin-bottom: .25rem; }
.msg.system { align-self: center; background: transparent; color: var(--faint); font-size: .72rem; text-align: center; padding: .2rem; }
.msg .opt { display: flex; align-items: center; gap: .6rem; justify-content: space-between; padding: .3rem 0; }
.msg .ver-link { display: inline-flex; margin-top: .45rem; }
.msg.pending { opacity: .85; }
.empty-chat { text-align: center; padding: 1.2rem .5rem; }
.empty-chat h3 { font-size: 1.05rem; font-weight: 600; margin-bottom: .35rem; }
.empty-chat p { font-size: .8rem; color: var(--muted); }
.starters { display: grid; grid-template-columns: 1fr 1fr; gap: .55rem; margin: 1.1rem 0; text-align: left; }
.starter { display: flex; align-items: center; gap: .6rem; padding: .75rem .85rem; border-radius: 1rem; background: rgba(255, 255, 255, .07); border: 1px solid rgba(255, 255, 255, .1); font-size: .78rem; font-weight: 500; transition: background .2s; }
.starter:hover { background: rgba(255, 255, 255, .14); }
.starter .ic { width: 1.05rem; height: 1.05rem; color: rgba(255, 255, 255, .72); transition: color .2s; }
.starter:hover .ic { color: var(--white); }
.composer { display: grid; gap: .55rem; }
.composer.over .input-wrap { border-color: rgba(255, 255, 255, .5); }
.input-wrap { display: flex; align-items: flex-end; gap: .4rem; padding: .35rem .35rem .35rem 1rem; border-radius: 1.1rem; background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .16); position: relative; }
.chat-input { flex: 1; min-height: 2.4rem; max-height: 12rem; resize: none; border: 0; outline: none; background: transparent; padding: .5rem 0; font-size: .86rem; line-height: 1.45; }
.input-wrap .icon-btn { width: 2.4rem; height: 2.4rem; }
.input-wrap .send { background: var(--white); color: var(--coal); }
.input-wrap .send:hover { background: #f1eeec; color: var(--coal); }
.input-wrap .mic.on { background: rgb(var(--red) / .8); color: #fff; }
.mic-level { position: absolute; left: 1rem; right: 6rem; bottom: .3rem; height: 2px; border-radius: 2px; overflow: hidden; display: none; }
.composer.recording .mic-level { display: block; }
.mic-level > div { height: 100%; background: #ffb3a6; transform-origin: left; transform: scaleX(.04); }
.mic-hint { font-size: .7rem; color: var(--muted); min-height: 0; }
.attach-row { display: flex; flex-wrap: wrap; gap: .35rem; }
.attach-row:empty { display: none; }
.attach { display: inline-flex; align-items: center; gap: .3rem; height: 1.7rem; padding: 0 .3rem 0 .7rem; border-radius: 999px; background: rgba(255, 255, 255, .12); font-size: .72rem; }
.attach > .ic { width: .8rem; height: .8rem; opacity: .7; }
.attach button { width: 1.3rem; height: 1.3rem; border-radius: 50%; color: var(--muted); display: inline-grid; place-items: center; }
.attach button .ic { width: .75rem; height: .75rem; }
.msg-extra { display: flex; flex-wrap: wrap; gap: .25rem .75rem; margin-top: .35rem; font-size: .7rem; opacity: .62; }
.msg-extra span { display: inline-flex; align-items: center; gap: .28rem; }
.msg-extra .ic { width: .75rem; height: .75rem; }
.attach button:hover { color: var(--white); background: rgba(255, 255, 255, .12); }
.composer-tools { display: flex; align-items: center; gap: .3rem; flex-wrap: wrap; }
.prompt-lib h4 { font-size: .72rem; color: var(--muted); font-weight: 600; margin: 1rem 0 .45rem; text-transform: uppercase; letter-spacing: .04em; }
.prompt-item { display: flex; align-items: center; gap: .6rem; width: 100%; text-align: left; padding: .55rem .7rem; border-radius: .9rem; font-size: .8rem; transition: background .15s; }
.prompt-item:hover { background: rgba(255, 255, 255, .1); }
.prompt-item .ic { width: 1rem; height: 1rem; color: rgba(255, 255, 255, .66); }
.prompt-item:hover .ic { color: var(--white); }
.chip.quick .ic { width: .85rem; height: .85rem; opacity: .75; }

/* style panel */
.styles-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(6.4rem, 1fr)); gap: .7rem; margin: .8rem 0 1.2rem; }
.style-tile { border-radius: 1rem; overflow: hidden; background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .12); text-align: left; transition: border-color .2s, transform .2s; }
.style-tile:hover { transform: translateY(-1px); border-color: rgba(255, 255, 255, .3); }
.style-tile.on { border-color: var(--white); box-shadow: 0 0 0 1px var(--white); }
.style-tile .shot { aspect-ratio: 9 / 16; background: rgba(0, 0, 0, .3) center / cover; display: grid; place-items: center; }
.style-tile .lbl { padding: .4rem .55rem; font-size: .7rem; font-weight: 600; display: flex; gap: .3rem; white-space: nowrap; overflow: hidden; }
.knobs h4, .side-body h4 { font-size: .72rem; color: var(--muted); font-weight: 600; margin: 1.3rem 0 .55rem; text-transform: uppercase; letter-spacing: .04em; }
.knob { display: grid; grid-template-columns: 8.4rem minmax(0, 1fr) 2.6rem; align-items: center; gap: .7rem; margin: .45rem 0; font-size: .78rem; }
.knob label { color: var(--muted); }
.knob .val { font-size: .7rem; color: var(--faint); text-align: right; font-variant-numeric: tabular-nums; }
.knob .input { min-height: 2.1rem; padding: .3rem .9rem; font-size: .78rem; }
.style-guide { min-height: 7rem; }

/* effects and media */
.fx-cat { font-size: .72rem; color: var(--muted); font-weight: 600; margin: 1.3rem 0 .55rem; text-transform: uppercase; letter-spacing: .04em; }
.fx-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(12rem, 1fr)); gap: .7rem; }
.fx-item { padding: .9rem 1rem; border-radius: 1.1rem; background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .1); display: grid; gap: .45rem; align-content: start; }
.fx-item .t { font-size: .84rem; font-weight: 600; }
.fx-tag { display: inline-block; margin-left: .45rem; padding: .08rem .45rem; border-radius: 999px; font-size: .6rem; font-weight: 600; letter-spacing: .02em; color: var(--muted); border: 1px solid rgba(255, 255, 255, .16); vertical-align: .1rem; cursor: help; }
.fx-item .d { font-size: .72rem; color: var(--muted); line-height: 1.45; }
.fx-item .chips .chip { height: 1.55rem; font-size: .66rem; padding: 0 .55rem; }
.fx-here { display: grid; gap: .5rem; }
.fx-here-row { padding: .55rem .8rem; border-radius: .9rem; background: rgba(255, 255, 255, .06); font-size: .8rem; }
.fx-here-row > .ic { width: 1rem; height: 1rem; color: var(--muted); }
.asset { display: grid; grid-template-columns: 2.6rem minmax(0, 1fr) auto; gap: .8rem; align-items: center; padding: .55rem 0; }
.asset + .asset { border-top: 1px solid rgba(255, 255, 255, .07); }
.asset .th { width: 2.6rem; height: 2.6rem; border-radius: .7rem; background: rgba(255, 255, 255, .1) center / cover; display: grid; place-items: center; color: var(--muted); }
.asset .th .ic { width: 1.1rem; height: 1.1rem; }
.asset .nm { font-size: .8rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini-drop { padding: 1.3rem 1rem; text-align: center; border-radius: 1.1rem; border: 1.5px dashed rgba(255, 255, 255, .26); cursor: pointer; transition: border-color .2s; }
.mini-drop:hover, .mini-drop.over { border-color: rgba(255, 255, 255, .6); }
.mini-drop b { font-size: .86rem; }
.json-area { width: 100%; min-height: 26rem; font: .74rem/1.5 ui-monospace, "SF Mono", Menlo, monospace; border-radius: 1rem; }

/* timeline */
.tl-card { grid-column: 1 / -1; padding: 1.2rem 1.45rem 1.1rem; }
.tl-head { display: flex; align-items: center; gap: .7rem; margin-bottom: .7rem; flex-wrap: wrap; font-size: .76rem; }
.tl-pauses { display: inline-flex; align-items: center; gap: .45rem; color: var(--muted); }
.tl-pauses .swatch { width: .7rem; height: .7rem; border-radius: .2rem; background: rgb(var(--amber) / .55); }
.sel-info { font-size: .74rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.tl-tip { margin: 0; }
.timeline canvas { width: 100%; height: 9.4rem; display: block; cursor: pointer; }

/* KPI row + lower row (dashboard) */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1.45rem; margin-top: 1.45rem; }
.kpi { height: 11.6rem; padding: 1.4rem 1.45rem; transition: transform .25s ease; }
.kpi:hover { transform: translateY(-2px); }
.kpi-top { display: flex; align-items: center; justify-content: space-between; }
.kpi-top > .ic { width: 1rem; height: 1rem; color: rgba(255, 255, 255, .85); }
.kpi-label { margin-top: 1.05rem; font-size: .8rem; color: rgba(255, 255, 255, .74); }
.kpi-value { margin-top: .1rem; font-size: 1.85rem; font-weight: 600; line-height: 1.2; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.kpi .delta { margin-top: .4rem; }
.spark { position: absolute; right: 1.45rem; bottom: 1.45rem; width: 38%; height: 2.9rem; overflow: visible; }
.low { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1.45rem; margin-top: 1.45rem; }
.recent { grid-column: span 2; }
.recent, .team, .goals { padding: 1.6rem 1.45rem 1.5rem; }
.acts { margin-top: 1.2rem; display: flex; flex-direction: column; gap: 1rem; }
.act { display: grid; grid-template-columns: 2.5rem minmax(0, 1fr) auto; align-items: center; gap: .85rem; }
.act p { font-size: .85rem; color: var(--muted); }
.act b { font-weight: 600; color: var(--ink); }
.act time { font-size: .72rem; color: var(--faint); white-space: nowrap; }
.members { margin-top: 1.1rem; display: flex; flex-direction: column; gap: .85rem; }
.member { display: grid; grid-template-columns: 2.5rem minmax(0, 1fr) auto; align-items: center; gap: .8rem; }
.member b { display: block; font-size: .85rem; font-weight: 600; }
.member .role { display: block; font-size: .7rem; color: var(--faint); }
.goal-list { margin-top: 1.1rem; display: flex; flex-direction: column; gap: .6rem; }
.goal { display: flex; align-items: center; gap: .9rem; padding: .6rem .9rem; border-radius: 1rem; background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .07); }
.ring-wrap { position: relative; flex: none; width: 3.2rem; height: 3.2rem; }
.ring { width: 100%; height: 100%; display: block; }
.ring circle { fill: none; stroke-width: 4.2; }
.ring .track { stroke: rgba(255, 255, 255, .12); }
.ring .val { stroke: rgb(var(--c)); stroke-linecap: round; filter: drop-shadow(0 0 3px rgb(var(--c) / .45)); }
.ring-num { position: absolute; inset: 0; display: grid; place-items: center; font-size: .66rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.goal span { font-size: .85rem; font-weight: 500; }
.goal small { display: block; font-size: .7rem; color: var(--faint); }

/* first run: getting the video ready */
.analysis { position: absolute; inset: 0; display: grid; place-items: center; z-index: 8; background: rgba(20, 13, 13, .35); border-radius: 1.2rem; }
.analysis-box { width: min(22rem, 92%); padding: 1.3rem; border-radius: 1.4rem; display: grid; gap: .7rem; }
.analysis-box b { font-size: 1rem; font-weight: 600; }
.analysis-box .now { font-size: .8rem; color: var(--muted); min-height: 1.2rem; }

/* Tablet */
/* ---------- Post ---------- */
.ic.brand { fill: currentColor; stroke: none; }
.post { display: grid; gap: .9rem; }
.post-h { display: flex; align-items: center; gap: .45rem; margin: .45rem 0 0; font-size: .8rem; font-weight: 600; color: var(--ink); }
.post-h .ic { width: .95rem; height: .95rem; color: var(--muted); }
.post-empty, .connect, .posted { padding: .95rem 1rem; border-radius: 1rem; background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .12); }
.post-empty { display: flex; align-items: center; gap: .8rem; }
.post-empty b, .connect b, .posted b { font-size: .86rem; font-weight: 600; }
.connect { display: grid; gap: .7rem; background: rgb(var(--accent) / .08); border-color: rgb(var(--accent) / .28); }
.connect ol { margin: 0; padding-left: 1.2rem; font-size: .8rem; color: var(--muted); display: grid; gap: .3rem; }
.connect a, .plat a { color: rgb(var(--accent-text)); }
.connect .row .input { flex: 1; }
.posted { background: rgb(var(--blue) / .08); border-color: rgb(var(--blue) / .26); }
.posted.published { background: rgb(var(--green) / .08); border-color: rgb(var(--green) / .26); }
.posted.failed { background: rgb(var(--red) / .1); border-color: rgb(var(--red) / .3); }
.state .ic.brand { width: .72rem; height: .72rem; }
.state.fail { color: #ffb3a6; background: rgb(var(--red) / .16); border-color: rgb(var(--red) / .34); }
a.state { text-decoration: none; }
.plat { border-radius: 1.1rem; background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .12); transition: opacity .2s; }
.plat.off { opacity: .55; }
.plat-head { display: flex; align-items: center; gap: .6rem; padding: .7rem .9rem; }
.plat-head b { font-size: .86rem; font-weight: 600; white-space: nowrap; }
.plat-ic { width: 1.95rem; height: 1.95rem; border-radius: .62rem; display: grid; place-items: center; background: rgba(255, 255, 255, .12); color: var(--white); flex: none; }
.plat-ic .ic { width: 1rem; height: 1rem; }
.plat-body { display: grid; gap: .7rem; padding: .1rem .9rem .95rem; }
.chip.warn { color: #ffd3a1; border-color: rgb(var(--amber) / .4); background: rgb(var(--amber) / .12); }
.input.mini { width: auto; min-height: 2rem; height: 2rem; padding: 0 2rem 0 .8rem; font-size: .76rem; }
.opt { font-size: .78rem; color: var(--muted); gap: .6rem; cursor: pointer; align-items: center; }
.cfield { display: grid; gap: .3rem; }
.cfield-head { display: flex; align-items: baseline; gap: .6rem; font-size: .72rem; color: var(--faint); }
.cfield-head > span:first-child { color: var(--ink); font-weight: 600; }
.cfield-head .count { margin-left: auto; }
.count.near { color: #ffd3a1; }
.count.over { color: #ffb3a6; font-weight: 600; }
.cfield textarea { resize: vertical; min-height: 5.4rem; line-height: 1.45; }
.slots { display: flex; flex-wrap: wrap; gap: .4rem; }
.slot { height: 2.2rem; padding: 0 .85rem; border-radius: .75rem; font-size: .76rem; font-weight: 500; color: rgba(255, 255, 255, .8); background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .14); transition: background .2s; }
.slot:hover { background: rgba(255, 255, 255, .15); }
.slot[aria-pressed="true"] { background: var(--white); color: var(--coal); border-color: transparent; font-weight: 600; }
.side-foot .summary .bad { color: #ffb3a6; }
.choose { display: grid; gap: .75rem; padding: .95rem 1rem; border-radius: 1rem; background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .12); }
.choose > b { font-size: .9rem; font-weight: 600; }
.choose-opts { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; }
.choose-opt { display: grid; gap: .35rem; align-content: start; text-align: left; padding: .85rem .9rem; border-radius: .95rem; background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .12); transition: background .2s, border-color .2s; }
.choose-opt:hover { background: rgba(255, 255, 255, .12); border-color: rgba(255, 255, 255, .3); }
.choose-opt .tile { width: 2.3rem; height: 2.3rem; margin-bottom: .2rem; }
.choose-opt b { font-size: .84rem; font-weight: 600; }
.btn.warn-btn { color: #ffd3a1; background: rgb(var(--amber) / .14); border-color: rgb(var(--amber) / .4); }
.btn.warn-btn:hover { background: rgb(var(--amber) / .24); }
.cfield-head .copy-btn { width: 1.7rem; height: 1.7rem; border-radius: .55rem; }
.cfield-head .copy-btn .ic { width: .8rem; height: .8rem; }
.risk { display: flex; align-items: center; gap: .7rem; margin-top: .6rem; padding: .55rem .7rem; border-radius: .8rem; font-size: .76rem; color: #ffd3a1; background: rgb(var(--amber) / .1); border: 1px solid rgb(var(--amber) / .3); }
.risk span { flex: 1; }
.hint .link { padding: 0; font-size: inherit; }
.connected-page { position: relative; z-index: 1; min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.connected-card { width: min(26rem, 100%); padding: 2rem 1.8rem; text-align: center; display: grid; justify-items: center; gap: .75rem; }
.connected-card h1 { font-size: 1.3rem; font-weight: 600; }
.connected-card p { font-size: .86rem; line-height: 1.5; }
@media (max-width: 640px) { .choose-opts { grid-template-columns: 1fr; } }
.controls .aspects { margin-left: .2rem; }

/* Progress: a video's time from filming to posted, the editor's save state, deleted videos */
.vcard .journey { display: flex; align-items: center; gap: .3rem; margin-top: .3rem; font-size: .68rem; font-weight: 500; color: rgb(var(--accent-text)); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vcard .journey .ic { width: .75rem; height: .75rem; flex: none; }
.save-chip { font-size: .7rem; color: var(--faint); }
.save-chip:empty { display: none; }
.save-chip.saving { color: var(--muted); }
.save-chip.error { color: #ffb3a6; cursor: pointer; text-decoration: underline; }
.trash-list { display: grid; gap: .45rem; }
.trash-row { display: flex; align-items: center; gap: .8rem; padding: .5rem .5rem .5rem .85rem; border-radius: .9rem; background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .1); }
.trash-row > div { flex: 1; }
.trash-row .nm { font-size: .82rem; font-weight: 600; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Settings: Appearance */
.appearance { display: grid; gap: .2rem; }
.bg-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(5.1rem, 1fr)); gap: .6rem; }
.bg-tile { display: grid; gap: .35rem; text-align: left; cursor: pointer; }
.bg-tile .shot { aspect-ratio: 16 / 10; border-radius: .75rem; background: rgba(255, 255, 255, .08) center / cover no-repeat; border: 1px solid rgba(255, 255, 255, .16); display: grid; place-items: center; color: var(--muted); transition: transform .15s, box-shadow .15s; }
.bg-tile .shot.mine { border-style: dashed; }
.bg-tile:hover .shot { transform: translateY(-1px); border-color: rgba(255, 255, 255, .34); }
.bg-tile[aria-pressed="true"] .shot { box-shadow: 0 0 0 2px var(--white); border-color: transparent; }
.bg-tile .lbl { font-size: .72rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bg-tile .lbl a { color: inherit; }
.bg-tile[aria-pressed="true"] .lbl { color: var(--ink); font-weight: 600; }
.swatches { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; }
.swatch { position: relative; width: 2rem; height: 2rem; border-radius: 50%; background: var(--sw, rgba(255, 255, 255, .2)); border: 2px solid rgba(255, 255, 255, .2); cursor: pointer; transition: transform .15s, box-shadow .15s; }
.swatch:hover { transform: scale(1.07); }
.swatch[aria-pressed="true"] { border-color: transparent; box-shadow: 0 0 0 2px rgb(var(--panel)), 0 0 0 4px var(--white); }
/* "Match the photo": the photo's colour with a small spark of white, so it reads as automatic. */
.swatch.match::after { content: ""; position: absolute; right: -.15rem; top: -.15rem; width: .7rem; height: .7rem; border-radius: 50%; background: var(--white); box-shadow: 0 0 0 2px rgb(var(--panel)); }
.swatch.any { background: conic-gradient(#ff8a80, #ffd180, #b9f6ca, #80d8ff, #b388ff, #ff80ab, #ff8a80); }
.swatch.any[aria-pressed="true"] { background: var(--sw); }
.swatch.any input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }

/* Home: the drop zone and the next posts side by side */
.home-top { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1.45rem; margin-top: 1.75rem; align-items: stretch; }
.home-top .drop { grid-column: span 3; margin-top: 0; display: grid; place-content: center; }
.upnext { padding: 1.2rem 1.25rem 1rem; display: flex; flex-direction: column; min-width: 0; }
.upnext .list { margin-top: .8rem; display: grid; gap: .5rem; }
.upnext .ev-row { margin: 0; grid-template-columns: 3rem minmax(0, 1fr); }
.upnext .ev-at { padding-top: .55rem; }
.upnext .ev { padding: .5rem .7rem; grid-template-columns: minmax(0, 1fr); cursor: pointer; text-decoration: none; color: inherit; }
.upnext .ev-title { font-size: .78rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.upnext .plats { display: flex; gap: .35rem; margin-top: .3rem; color: rgba(255, 255, 255, .7); align-items: center; font-size: .66rem; }
.upnext .plats .ic { width: .78rem; height: .78rem; }
.upnext .ev.failed { --c: var(--red); }
.upnext .ev.published { --c: var(--green); }
.upnext .empty { margin-top: .8rem; font-size: .76rem; color: var(--muted); line-height: 1.5; }

@media (max-width: 1100px) {
  html { font-size: 14px; }
  .app {
    padding-left: max(1.5rem, env(safe-area-inset-left, 0px));
    padding-right: max(1.5rem, env(safe-area-inset-right, 0px));
    padding-block: 1.2rem calc(6.5rem + env(safe-area-inset-bottom, 0px));
  }
  .main { margin: 0; }
  .rail { top: auto; bottom: calc(.9rem + env(safe-area-inset-bottom, 0px)); left: 50%; transform: translateX(-50%); flex-direction: row; gap: .5rem; padding: .45rem; }
  .rail .ib { width: 2.75rem; height: 2.75rem; }
  .rail .tip { display: none; }
  #toasts { bottom: calc(5.6rem + env(safe-area-inset-bottom, 0px)); }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .home-top { grid-template-columns: minmax(0, 1fr); }
  .home-top .drop { grid-column: auto; }
  .ed-grid { grid-template-columns: minmax(0, 1fr); }
  .preview-card, .side-card { grid-column: auto; }
  .preview-card { height: 82vh; }
  .side-card { height: 70vh; }
  .low { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .recent { grid-column: 1 / -1; }
}
@media (max-width: 1300px) {
  .topbar { grid-template-columns: auto minmax(0, 1fr); grid-template-areas: "l r" "c c"; row-gap: .9rem; }
  .tb-left { grid-area: l; }
  .tb-right { grid-area: r; }
  .tb-center { grid-area: c; min-width: 0; max-width: 100%; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
  .tb-center::-webkit-scrollbar { display: none; }
}
/* Phone */
@media (max-width: 640px) {
  .app { padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
  .ib { width: 2.6rem; height: 2.6rem; }
  .ib .ic { width: 1.05rem; height: 1.05rem; }
  .avatar { width: 2.7rem; height: 2.7rem; font-size: .85rem; }
  .tb-left, .tb-right { gap: .45rem; }
  .pill { height: 2.6rem; padding: 0 1rem; font-size: .9rem; }
  .hello { flex-direction: column; align-items: stretch; gap: 1rem; margin-top: 1.6rem; }
  .hello h1 { font-size: 1.6rem; }
  .hello-actions { justify-content: space-between; }
  .kpis, .low { grid-template-columns: minmax(0, 1fr); gap: 1rem; }
  .kpi { height: 9.8rem; }
  .card { border-radius: 1.15rem; }
  .knob { grid-template-columns: 6.5rem minmax(0, 1fr) 2.2rem; }
  .starters { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
