/* FreeFrame client portal. Same palette and type as freeframe.studio. */
:root {
  --bg: #080807;
  --bg-2: #0c0c0b;
  --panel: #111110;
  --panel-2: #161614;
  --panel-3: #1d1d1b;
  --line: #232321;
  --line-2: #31312d;
  --text: #eeebe4;
  --text-2: #c9c5bc;
  --muted: #8a8780;
  --dim: #5f5d59;
  --amber: #e8931a;
  --amber-2: #f5a832;
  --amber-soft: rgba(232, 147, 26, 0.12);
  --amber-line: rgba(232, 147, 26, 0.35);
  --ink: #080807;
  --green: #6cc08b;
  --green-soft: rgba(108, 192, 139, 0.12);
  --red: #ec7a63;
  --red-soft: rgba(236, 122, 99, 0.12);
  --blue: #7fb2e5;
  --blue-soft: rgba(127, 178, 229, 0.12);
  --font: "Barlow", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-d: "Bebas Neue", "Barlow", sans-serif;
  --r: 10px;
  --r-sm: 6px;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
  --side: 252px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text); font-family: var(--font); font-size: 15px; line-height: 1.55;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; min-height: 100vh;
}
body::after {
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 9999; opacity: 0.32;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.04'/%3E%3C/svg%3E");
}
::selection { background: var(--amber); color: var(--ink); }
a { color: var(--amber); text-decoration: none; transition: color 0.2s var(--ease); }
a:hover { color: var(--amber-2); }
img { max-width: 100%; display: block; }
button { font: inherit; color: inherit; }
h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -0.01em; line-height: 1.2; }
p { margin: 0; }
.tnum { font-variant-numeric: tabular-nums; }
.hidden { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; border-radius: 4px; }

/* ---------- wordmark ---------- */
.mark { font-family: var(--font-d); font-size: 1.6rem; letter-spacing: 0.06em; color: var(--text); line-height: 1; display: inline-block; }
.mark span { color: var(--amber); }
.mark small { display: block; font-family: var(--font); font-size: 0.56rem; font-weight: 600; letter-spacing: 0.32em; text-transform: uppercase; color: var(--muted); margin-top: 0.35rem; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem; height: 40px; padding: 0 1.1rem;
  border-radius: var(--r-sm); border: 1px solid transparent; cursor: pointer; white-space: nowrap; user-select: none;
  font-size: 0.78rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; line-height: 1;
  transition: background 0.2s var(--ease), border-color 0.2s var(--ease), color 0.2s var(--ease), transform 0.2s var(--ease), box-shadow 0.2s var(--ease);
  background: var(--panel-3); color: var(--text); text-decoration: none;
}
.btn svg { width: 16px; height: 16px; flex: none; }
.btn:hover { background: #262624; color: var(--text); }
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: 0.45; pointer-events: none; }
.btn-primary { background: var(--amber); color: var(--ink); }
.btn-primary:hover { background: var(--amber-2); color: var(--ink); box-shadow: 0 8px 26px rgba(232, 147, 26, 0.28); }
.btn-ghost { background: transparent; border-color: var(--line-2); }
.btn-ghost:hover { border-color: var(--amber); color: var(--amber); background: transparent; }
.btn-quiet { background: transparent; color: var(--text-2); padding: 0 0.7rem; }
.btn-quiet:hover { background: var(--panel-3); color: var(--text); }
.btn-danger { background: transparent; border-color: rgba(236, 122, 99, 0.4); color: var(--red); }
.btn-danger:hover { background: var(--red-soft); color: var(--red); }
.btn-green { background: var(--green); color: var(--ink); }
.btn-green:hover { background: #82d3a0; color: var(--ink); }
.btn-sm { height: 32px; padding: 0 0.8rem; font-size: 0.7rem; }
.btn-lg { height: 50px; padding: 0 1.6rem; font-size: 0.85rem; }
.btn-block { width: 100%; }
.icon-btn {
  width: 34px; height: 34px; display: inline-grid; place-items: center; border-radius: 8px; border: 0; background: transparent;
  color: var(--text-2); cursor: pointer; transition: background 0.2s var(--ease), color 0.2s var(--ease);
}
.icon-btn:hover { background: var(--panel-3); color: var(--text); }
.icon-btn svg { width: 18px; height: 18px; }
.icon-btn.on { color: var(--amber); background: var(--amber-soft); }

/* ---------- forms ---------- */
.field { display: grid; gap: 0.4rem; margin-bottom: 1rem; }
.field > span, .label { font-size: 0.72rem; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.field .hint { font-size: 0.82rem; color: var(--dim); letter-spacing: 0; text-transform: none; font-weight: 400; }
.input, .select, .textarea {
  width: 100%; background: #0b0b0a; border: 1px solid var(--line-2); border-radius: 8px; color: var(--text);
  font: inherit; font-size: 0.95rem; padding: 0.7rem 0.85rem; outline: none;
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.textarea { resize: vertical; min-height: 96px; line-height: 1.5; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--amber); box-shadow: 0 0 0 3px rgba(232, 147, 26, 0.15); }
.input::placeholder, .textarea::placeholder { color: var(--dim); }
.select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 2.2rem; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1rem; }
.row3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 1rem; }
.check { display: flex; align-items: center; gap: 0.6rem; color: var(--text-2); font-size: 0.92rem; cursor: pointer; margin-bottom: 1rem; }
.check input { accent-color: var(--amber); width: 16px; height: 16px; }
.form-error { color: var(--red); font-size: 0.9rem; margin: -0.3rem 0 0.9rem; min-height: 0; }
.form-actions { display: flex; gap: 0.6rem; justify-content: flex-end; margin-top: 0.5rem; flex-wrap: wrap; }
input[type="color"].input { padding: 0.2rem; height: 44px; }

/* ---------- shell ---------- */
.shell { display: grid; grid-template-columns: var(--side) 1fr; min-height: 100vh; }
.side {
  position: sticky; top: 0; height: 100vh; overflow-y: auto; background: var(--bg-2); border-right: 1px solid var(--line);
  display: flex; flex-direction: column; padding: 1.4rem 0.9rem 1rem;
}
.side .mark { padding: 0 0.6rem; }
.side-client { margin: 1.4rem 0.2rem 1.1rem; padding: 0.75rem; border: 1px solid var(--line); border-radius: var(--r); display: flex; gap: 0.7rem; align-items: center; background: var(--panel); }
.side-client b { display: block; font-weight: 600; font-size: 0.95rem; line-height: 1.25; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-client small { color: var(--muted); font-size: 0.75rem; }
.nav { display: grid; gap: 2px; margin-top: 0.6rem; }
.nav-label { font-size: 0.66rem; font-weight: 600; letter-spacing: 0.18em; text-transform: uppercase; color: var(--dim); padding: 1rem 0.75rem 0.4rem; }
.nav a {
  display: flex; align-items: center; gap: 0.75rem; padding: 0.6rem 0.75rem; border-radius: 8px; color: var(--text-2);
  font-weight: 500; font-size: 0.93rem; position: relative; transition: background 0.18s var(--ease), color 0.18s var(--ease);
}
.nav a svg { width: 18px; height: 18px; flex: none; opacity: 0.85; }
.nav a:hover { background: var(--panel-2); color: var(--text); }
.nav a.active { background: var(--panel-3); color: var(--text); }
.nav a.active::before { content: ""; position: absolute; left: -0.9rem; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--amber); }
.nav a .count { margin-left: auto; }
.side-foot { margin-top: auto; padding-top: 1rem; display: grid; gap: 0.6rem; }
.me { display: flex; align-items: center; gap: 0.65rem; padding: 0.6rem; border-radius: var(--r); border: 1px solid var(--line); }
.me b { font-size: 0.88rem; font-weight: 600; display: block; line-height: 1.2; }
.me small { color: var(--muted); font-size: 0.74rem; }
.me .icon-btn { margin-left: auto; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { display: none; }
.page { width: 100%; max-width: 1280px; margin: 0 auto; padding: 2.4rem 2.4rem 5rem; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1.2rem; margin-bottom: 2rem; flex-wrap: wrap; }
.page-head h1 { font-size: 2rem; }
.page-head p { color: var(--muted); margin-top: 0.35rem; }
.eyebrow { font-size: 0.7rem; font-weight: 700; letter-spacing: 0.22em; text-transform: uppercase; color: var(--amber); display: flex; align-items: center; gap: 0.7rem; margin-bottom: 0.7rem; }
.eyebrow::before { content: ""; width: 1.8rem; height: 2px; background: var(--amber); }
.crumbs { display: flex; gap: 0.5rem; align-items: center; color: var(--muted); font-size: 0.85rem; margin-bottom: 0.9rem; flex-wrap: wrap; }
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--text); }
.viewing-as { background: var(--amber); color: var(--ink); font-weight: 600; font-size: 0.85rem; padding: 0.55rem 1rem; display: flex; gap: 1rem; align-items: center; justify-content: center; }
.viewing-as a { color: var(--ink); text-decoration: underline; }

/* ---------- surfaces ---------- */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 1.4rem; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1.1rem; }
.card-head h2, .card-head h3 { font-size: 1.05rem; }
.card-head .sub { color: var(--muted); font-size: 0.85rem; }
.grid { display: grid; gap: 1.2rem; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-main { grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); align-items: start; }
.stack { display: grid; gap: 1.2rem; align-content: start; }
.muted { color: var(--muted); }
.dim { color: var(--dim); }
.small { font-size: 0.85rem; }
.divider { height: 1px; background: var(--line); margin: 1.2rem 0; border: 0; }
.spacer { flex: 1; }
.flex { display: flex; gap: 0.6rem; align-items: center; flex-wrap: wrap; }

.hero {
  position: relative; overflow: hidden; border-radius: 14px; border: 1px solid var(--line); padding: 2.2rem 2.2rem 2rem;
  background: radial-gradient(120% 140% at 0% 0%, rgba(232, 147, 26, 0.16), transparent 55%), linear-gradient(180deg, #131311, #0d0d0c);
  margin-bottom: 1.4rem;
}
.hero h1 { font-size: 2.2rem; max-width: 22ch; }
.hero p { color: var(--text-2); margin-top: 0.6rem; max-width: 60ch; }
.hero .flex { margin-top: 1.4rem; }
.hero-frame { position: absolute; right: -40px; top: -40px; width: 260px; height: 260px; border: 1px solid rgba(232, 147, 26, 0.18); border-radius: 50%; pointer-events: none; }
.hero-frame::after { content: ""; position: absolute; inset: 40px; border: 1px solid rgba(232, 147, 26, 0.1); border-radius: 50%; }

.stat { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 1.1rem 1.2rem; }
.stat b { display: block; font-size: 1.9rem; font-weight: 600; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.stat span { color: var(--muted); font-size: 0.82rem; }
.stat.hot b { color: var(--amber); }
.stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.upload-card {
  position: relative; overflow: hidden; border-radius: 14px; padding: 1.6rem; border: 1px solid var(--amber-line);
  background: linear-gradient(135deg, rgba(232, 147, 26, 0.16), rgba(232, 147, 26, 0.03) 60%), var(--panel);
}
.upload-card h3 { font-size: 1.2rem; margin-bottom: 0.4rem; }
.upload-card p { color: var(--text-2); font-size: 0.92rem; margin-bottom: 1.1rem; }
.upload-card .big-icon { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; background: var(--amber); color: var(--ink); margin-bottom: 1rem; }
.upload-card .big-icon svg { width: 24px; height: 24px; }

/* ---------- pills, badges, avatars ---------- */
.pill { display: inline-flex; align-items: center; gap: 0.35rem; height: 24px; padding: 0 0.6rem; border-radius: 999px; font-size: 0.72rem; font-weight: 600; letter-spacing: 0.04em; white-space: nowrap; border: 1px solid var(--line-2); color: var(--text-2); background: var(--panel-2); }
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: 0.9; }
.pill.plain::before { display: none; }
.pill.review { color: var(--amber); border-color: var(--amber-line); background: var(--amber-soft); }
.pill.changes { color: var(--red); border-color: rgba(236, 122, 99, 0.35); background: var(--red-soft); }
.pill.approved { color: var(--green); border-color: rgba(108, 192, 139, 0.35); background: var(--green-soft); }
.pill.info { color: var(--blue); border-color: rgba(127, 178, 229, 0.35); background: var(--blue-soft); }
.pill.new-tag { color: var(--ink); background: var(--amber); border-color: var(--amber); }
.pill.new-tag::before { display: none; }
.count { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--amber); color: var(--ink); font-size: 0.7rem; font-weight: 700; display: inline-grid; place-items: center; font-variant-numeric: tabular-nums; }
.count.quiet { background: var(--panel-3); color: var(--text-2); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--amber); display: inline-block; flex: none; }
.avatar { width: 34px; height: 34px; border-radius: 50%; display: inline-grid; place-items: center; flex: none; font-size: 0.78rem; font-weight: 700; letter-spacing: 0.02em; background: var(--panel-3); color: var(--text); border: 1px solid var(--line-2); overflow: hidden; }
.avatar.studio { background: var(--amber); color: var(--ink); border-color: var(--amber); }
.avatar.lg { width: 48px; height: 48px; font-size: 1rem; border-radius: 12px; }
.avatar.sm { width: 26px; height: 26px; font-size: 0.66rem; }
.avatar img { width: 100%; height: 100%; object-fit: contain; background: #fff; }

/* ---------- stage tracker ---------- */
.stages { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; margin-top: 0.8rem; }
.stages div { height: 4px; border-radius: 2px; background: var(--panel-3); }
.stages div.done { background: var(--amber); }
.stages div.now { background: linear-gradient(90deg, var(--amber), var(--amber-2)); box-shadow: 0 0 12px rgba(232, 147, 26, 0.5); }
.stage-names { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; margin-top: 0.45rem; font-size: 0.7rem; color: var(--dim); letter-spacing: 0.04em; }
.stage-names span.now { color: var(--amber); font-weight: 600; }
.stage-names span.done { color: var(--text-2); }

/* ---------- lists ---------- */
.list { display: grid; }
.list-item { display: flex; gap: 0.9rem; align-items: center; padding: 0.85rem 0; border-top: 1px solid var(--line); color: var(--text); }
.list-item:first-child { border-top: 0; }
a.list-item:hover { color: var(--text); }
a.list-item:hover .li-title { color: var(--amber); }
.li-main { min-width: 0; flex: 1; }
.li-title { font-weight: 600; font-size: 0.95rem; transition: color 0.2s var(--ease); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.li-sub { color: var(--muted); font-size: 0.82rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.li-icon { width: 38px; height: 38px; border-radius: 10px; background: var(--panel-3); display: grid; place-items: center; color: var(--text-2); flex: none; }
.li-icon svg { width: 18px; height: 18px; }
.li-quote { color: var(--text-2); font-size: 0.86rem; margin-top: 0.2rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

.feed-item { display: flex; gap: 0.8rem; padding: 0.8rem 0; border-top: 1px solid var(--line); }
.feed-item:first-child { border-top: 0; }
.feed-item .avatar { width: 30px; height: 30px; font-size: 0.68rem; }
.feed-item p { font-size: 0.9rem; color: var(--text-2); }
.feed-item p b { color: var(--text); font-weight: 600; }
.feed-item time { color: var(--dim); font-size: 0.76rem; }
.feed-item.fresh p { color: var(--text); }

.table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
.table th { text-align: left; font-size: 0.68rem; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--dim); padding: 0 0.8rem 0.7rem; border-bottom: 1px solid var(--line); }
.table td { padding: 0.85rem 0.8rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tr.click { cursor: pointer; }
.table tr.click:hover td { background: var(--panel-2); }
.table-wrap { overflow-x: auto; }

/* ---------- deliverable tiles ---------- */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1.1rem; }
.tile { display: block; color: var(--text); border-radius: var(--r); overflow: hidden; border: 1px solid var(--line); background: var(--panel); transition: border-color 0.2s var(--ease), transform 0.25s var(--ease), box-shadow 0.25s var(--ease); }
.tile:hover { color: var(--text); border-color: var(--line-2); transform: translateY(-3px); box-shadow: var(--shadow); }
.thumb { position: relative; aspect-ratio: 16 / 10; background: #050505; overflow: hidden; display: grid; place-items: center; }
.thumb::before { content: ""; position: absolute; inset: 0; background: radial-gradient(90% 90% at 30% 20%, var(--tint, rgba(232, 147, 26, 0.22)), transparent 60%), linear-gradient(160deg, #1a1a18, #070707); }
.thumb img, .thumb video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity 0.5s var(--ease); }
.thumb img.ready, .thumb video.ready { opacity: 1; }
.thumb img.ready ~ .kind { display: none; }
.thumb .play { position: relative; z-index: 2; width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; background: rgba(8, 8, 7, 0.55); border: 1px solid rgba(255, 255, 255, 0.18); backdrop-filter: blur(6px); transition: transform 0.25s var(--ease), background 0.25s var(--ease); }
.thumb .play svg { width: 18px; height: 18px; margin-left: 2px; }
.tile:hover .thumb .play { transform: scale(1.08); background: var(--amber); color: var(--ink); }
.thumb .kind { position: relative; z-index: 2; color: var(--text-2); }
.thumb .kind svg { width: 30px; height: 30px; }
.thumb .tl { position: absolute; z-index: 3; left: 10px; top: 10px; display: flex; gap: 6px; }
.thumb .tr { position: absolute; z-index: 3; right: 10px; top: 10px; }
.thumb .ver { background: rgba(8, 8, 7, 0.7); border: 1px solid rgba(255, 255, 255, 0.12); color: var(--text); font-size: 0.7rem; font-weight: 700; padding: 2px 7px; border-radius: 5px; letter-spacing: 0.04em; }
.tile-body { padding: 0.85rem 1rem 1rem; }
.tile-body b { display: block; font-weight: 600; font-size: 0.95rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile-meta { display: flex; align-items: center; gap: 0.5rem; margin-top: 0.5rem; color: var(--muted); font-size: 0.8rem; flex-wrap: wrap; }
.tile-meta svg { width: 14px; height: 14px; }

/* ---------- empty states, skeletons ---------- */
.empty { text-align: center; padding: 2.6rem 1.4rem; color: var(--muted); border: 1px dashed var(--line-2); border-radius: var(--r); }
.empty svg { width: 30px; height: 30px; color: var(--dim); margin-bottom: 0.7rem; }
.empty b { display: block; color: var(--text); font-size: 1rem; margin-bottom: 0.3rem; font-weight: 600; }
.empty p { max-width: 46ch; margin: 0 auto; font-size: 0.9rem; }
.empty .btn { margin-top: 1.1rem; }
.skel { background: linear-gradient(90deg, var(--panel-2), var(--panel-3), var(--panel-2)); background-size: 200% 100%; animation: shimmer 1.4s var(--ease) infinite; border-radius: 8px; }
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: -100% 0; } }
.loading-page { padding: 2.4rem; display: grid; gap: 1rem; max-width: 1280px; margin: 0 auto; width: 100%; }

/* ---------- tabs ---------- */
.tabs { display: flex; gap: 0.3rem; border-bottom: 1px solid var(--line); margin-bottom: 1.6rem; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs a { padding: 0.75rem 0.9rem; color: var(--muted); font-weight: 600; font-size: 0.9rem; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; display: flex; gap: 0.5rem; align-items: center; }
.tabs a:hover { color: var(--text); }
.tabs a.active { color: var(--text); border-bottom-color: var(--amber); }
.seg { display: inline-flex; background: var(--panel-2); border: 1px solid var(--line); border-radius: 8px; padding: 3px; gap: 2px; }
.seg button { border: 0; background: transparent; color: var(--muted); font-size: 0.78rem; font-weight: 600; padding: 0.35rem 0.7rem; border-radius: 6px; cursor: pointer; }
.seg button.on { background: var(--panel-3); color: var(--text); }

/* ---------- modal & toast ---------- */
.modal-back { position: fixed; inset: 0; z-index: 1000; background: rgba(4, 4, 3, 0.72); backdrop-filter: blur(6px); display: grid; place-items: center; padding: 1rem; animation: fade 0.2s var(--ease); }
.modal { width: min(560px, 100%); max-height: calc(100vh - 2rem); overflow-y: auto; background: var(--panel); border: 1px solid var(--line-2); border-radius: 14px; box-shadow: var(--shadow); animation: rise 0.28s var(--ease); }
.modal.wide { width: min(760px, 100%); }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 1.2rem 1.4rem 0; }
.modal-head h2 { font-size: 1.2rem; }
.modal-body { padding: 1.1rem 1.4rem 1.4rem; }
.modal-body > p { color: var(--text-2); margin-bottom: 1rem; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes rise { from { opacity: 0; transform: translateY(12px) scale(0.98); } to { opacity: 1; transform: none; } }
.toasts { position: fixed; z-index: 1100; left: 50%; bottom: 24px; transform: translateX(-50%); display: grid; gap: 0.5rem; pointer-events: none; }
.toast { background: var(--panel-3); border: 1px solid var(--line-2); color: var(--text); padding: 0.75rem 1.1rem; border-radius: 10px; box-shadow: var(--shadow); font-size: 0.92rem; display: flex; gap: 0.6rem; align-items: center; animation: rise 0.25s var(--ease); pointer-events: auto; max-width: 92vw; }
.toast.err { border-color: rgba(236, 122, 99, 0.5); }
.toast svg { width: 16px; height: 16px; color: var(--amber); flex: none; }
.toast.err svg { color: var(--red); }
.copybox { display: flex; gap: 0.5rem; align-items: stretch; }
.copybox .input { font-size: 0.82rem; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.note-box { background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; padding: 1rem; color: var(--text-2); font-size: 0.9rem; white-space: pre-wrap; overflow-wrap: anywhere; }
.modal-body form > p { color: var(--text-2); margin-bottom: 1.1rem; }

/* ---------- messages ---------- */
.thread { display: flex; flex-direction: column; gap: 0.9rem; padding: 0.5rem 0 1rem; }
.msg { display: flex; gap: 0.7rem; max-width: 760px; }
.msg.me { margin-left: auto; flex-direction: row-reverse; }
.msg .bubble { background: var(--panel-2); border: 1px solid var(--line); border-radius: 12px; padding: 0.7rem 0.95rem; white-space: pre-wrap; word-wrap: break-word; color: var(--text); font-size: 0.94rem; }
.msg.me .bubble { background: rgba(232, 147, 26, 0.1); border-color: var(--amber-line); }
.msg .meta { font-size: 0.75rem; color: var(--dim); margin-bottom: 0.3rem; display: flex; gap: 0.5rem; }
.msg.me .meta { justify-content: flex-end; }
.composer-bar { position: sticky; bottom: 0; background: linear-gradient(180deg, transparent, var(--panel) 30%); padding-top: 1.2rem; }
.composer-bar form { display: flex; gap: 0.6rem; align-items: flex-end; background: var(--panel); border: 1px solid var(--line-2); border-radius: 12px; padding: 0.6rem; }
.composer-bar textarea { flex: 1; border: 0; background: transparent; color: var(--text); font: inherit; resize: none; outline: none; min-height: 40px; max-height: 200px; padding: 0.5rem; }
.thread-list a { display: flex; align-items: center; gap: 0.7rem; padding: 0.75rem 0.8rem; border-radius: 8px; color: var(--text-2); }
.thread-list a:hover { background: var(--panel-2); color: var(--text); }
.thread-list a.active { background: var(--panel-3); color: var(--text); }
.thread-list a b { font-weight: 600; font-size: 0.92rem; display: block; }
.thread-list a small { color: var(--dim); font-size: 0.76rem; }

/* ---------- brand kit ---------- */
.swatches { display: flex; gap: 0.4rem; flex-wrap: wrap; margin-top: 0.5rem; }
.swatch { width: 34px; height: 34px; border-radius: 8px; border: 1px solid rgba(255, 255, 255, 0.12); cursor: pointer; }
.asset { display: flex; gap: 0.9rem; align-items: flex-start; }

/* ---------- login ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.auth-art { position: relative; overflow: hidden; padding: 3rem; display: flex; flex-direction: column; justify-content: space-between; border-right: 1px solid var(--line);
  background: radial-gradient(80% 70% at 15% 10%, rgba(232, 147, 26, 0.22), transparent 60%), radial-gradient(70% 60% at 90% 100%, rgba(232, 147, 26, 0.08), transparent 60%), #0a0a09; }
.auth-art .frame-lines { position: absolute; inset: 2.2rem; border: 1px solid rgba(238, 235, 228, 0.07); border-radius: 4px; pointer-events: none; }
.auth-art .frame-lines::before, .auth-art .frame-lines::after { content: ""; position: absolute; width: 26px; height: 26px; border-color: var(--amber); border-style: solid; }
.auth-art .frame-lines::before { left: -1px; top: -1px; border-width: 2px 0 0 2px; }
.auth-art .frame-lines::after { right: -1px; bottom: -1px; border-width: 0 2px 2px 0; }
.auth-art .mark { font-size: 2rem; position: relative; }
.auth-art h1 { font-family: var(--font-d); font-weight: 400; font-size: clamp(3rem, 6vw, 5.4rem); letter-spacing: 0.02em; line-height: 0.92; position: relative; }
.auth-art h1 span { color: var(--amber); }
.auth-art p { color: var(--text-2); max-width: 40ch; margin-top: 1rem; position: relative; font-size: 1.02rem; }
.auth-art .rec { position: relative; display: flex; align-items: center; gap: 0.6rem; color: var(--muted); font-size: 0.78rem; letter-spacing: 0.2em; text-transform: uppercase; }
.auth-art .rec i { width: 8px; height: 8px; border-radius: 50%; background: var(--amber); box-shadow: 0 0 14px var(--amber); animation: pulse 2.4s var(--ease) infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }
.auth-form { display: grid; place-items: center; padding: 3rem 1.5rem; }
.auth-card { width: min(400px, 100%); }
.auth-card h2 { font-size: 1.6rem; margin-bottom: 0.4rem; }
.auth-card > p { color: var(--muted); margin-bottom: 1.8rem; }
.auth-card .btn-primary { width: 100%; height: 50px; margin-top: 0.4rem; }
.auth-foot { margin-top: 1.6rem; color: var(--muted); font-size: 0.88rem; text-align: center; }
.auth-foot button { background: none; border: 0; color: var(--amber); cursor: pointer; padding: 0; font-size: inherit; }
.pw-wrap { position: relative; }
.pw-wrap .icon-btn { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); }
.meter { height: 4px; border-radius: 2px; background: var(--panel-3); overflow: hidden; margin-top: 0.5rem; }
.meter i { display: block; height: 100%; width: 0; background: var(--amber); transition: width 0.3s var(--ease), background 0.3s var(--ease); }

/* ---------- mobile ---------- */
.tabbar { display: none; }
@media (max-width: 1100px) {
  .grid-main { grid-template-columns: 1fr; }
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .side { display: none; }
  .topbar { display: flex; position: sticky; top: 0; z-index: 50; align-items: center; justify-content: space-between; padding: 0.8rem 1rem; background: rgba(8, 8, 7, 0.92); backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); }
  .topbar .mark { font-size: 1.35rem; }
  .page { padding: 1.4rem 1rem 6.5rem; }
  .page-head h1 { font-size: 1.6rem; }
  .hero { padding: 1.5rem; }
  .hero h1 { font-size: 1.6rem; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .row, .row3 { grid-template-columns: 1fr; }
  .tiles { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 0.8rem; }
  .grid.stats { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.6rem; }
  .stats .stat { padding: 0.8rem; }
  .stats .stat b { font-size: 1.5rem; }
  .stats .stat span { font-size: 0.72rem; line-height: 1.3; display: block; }
  .tabbar { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; z-index: 60; left: 0; right: 0; bottom: 0; background: rgba(12, 12, 11, 0.96); backdrop-filter: blur(14px); border-top: 1px solid var(--line); padding: 0.4rem 0.3rem calc(0.4rem + env(safe-area-inset-bottom)); }
  .tabbar a { display: grid; justify-items: center; gap: 2px; color: var(--muted); font-size: 0.66rem; font-weight: 600; padding: 0.3rem 0; position: relative; }
  .tabbar a svg { width: 21px; height: 21px; }
  .tabbar a.active { color: var(--amber); }
  .tabbar a .count { position: absolute; top: 0; left: calc(50% + 6px); min-width: 17px; height: 17px; font-size: 0.6rem; }
  .auth { grid-template-columns: 1fr; }
  .auth-art { min-height: 280px; padding: 2rem 1.5rem; border-right: 0; border-bottom: 1px solid var(--line); }
  .auth-art .frame-lines { inset: 1rem; }
  .auth-art h1 { font-size: 3.2rem; margin-top: 2.2rem; }
  .auth-art .rec { display: none; }
  .table .hide-sm { display: none; }
  .modal-back { align-items: end; padding: 0; }
  .modal { border-radius: 16px 16px 0 0; max-height: 92vh; }
}
.more-menu { display: grid; gap: 2px; }
.more-menu a { display: flex; align-items: center; gap: 0.8rem; padding: 0.85rem 0.6rem; border-radius: 8px; color: var(--text); font-weight: 500; }
.more-menu a:hover { background: var(--panel-2); color: var(--text); }
.more-menu a svg { width: 19px; height: 19px; color: var(--text-2); }

/* ================= review ================= */
.rv { display: flex; flex-direction: column; height: 100vh; min-height: 0; background: var(--bg); }
.rv-top { display: flex; align-items: center; gap: 0.8rem; padding: 0.7rem 1rem; border-bottom: 1px solid var(--line); background: var(--bg-2); min-height: 62px; flex-wrap: wrap; }
.rv-title { min-width: 0; flex: 1; }
.rv-title b { display: block; font-size: 1rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rv-title small { color: var(--muted); font-size: 0.8rem; }
.rv-actions { display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; }
.rv-body { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) 400px; }
.rv-stagecol { min-width: 0; min-height: 0; display: flex; flex-direction: column; background: #030303; }
.rv-stage { position: relative; flex: 1; min-height: 0; display: grid; place-items: center; overflow: hidden; user-select: none; touch-action: manipulation; }
.rv-stage video, .rv-stage img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #030303; }
.rv-stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.rv-stage.drawing canvas { pointer-events: auto; cursor: crosshair; touch-action: none; }
.rv-stage .rv-bigplay { position: relative; z-index: 3; width: 74px; height: 74px; border-radius: 50%; border: 1px solid rgba(255, 255, 255, 0.2); background: rgba(8, 8, 7, 0.55); backdrop-filter: blur(8px); display: grid; place-items: center; cursor: pointer; transition: transform 0.25s var(--ease), background 0.25s var(--ease), opacity 0.3s var(--ease); color: var(--text); }
.rv-stage .rv-bigplay:hover { transform: scale(1.06); background: var(--amber); color: var(--ink); }
.rv-stage .rv-bigplay svg { width: 26px; height: 26px; margin-left: 3px; }
.rv-stage.playing .rv-bigplay, .rv-stage.drawing .rv-bigplay { opacity: 0; pointer-events: none; }
.rv-flash { position: absolute; z-index: 4; left: 50%; top: 14px; transform: translateX(-50%); background: rgba(8, 8, 7, 0.8); border: 1px solid var(--line-2); padding: 0.35rem 0.8rem; border-radius: 999px; font-size: 0.8rem; color: var(--text); pointer-events: none; opacity: 0; transition: opacity 0.25s var(--ease); }
.rv-flash.show { opacity: 1; }
.rv-msg { position: relative; z-index: 2; text-align: center; color: var(--muted); max-width: 44ch; padding: 1rem; }
.rv-msg b { display: block; color: var(--text); margin-bottom: 0.4rem; }
.rv-filecard { position: relative; z-index: 2; text-align: center; padding: 2rem; max-width: 420px; }
.rv-filecard .li-icon { width: 64px; height: 64px; border-radius: 16px; margin: 0 auto 1rem; }
.rv-filecard .li-icon svg { width: 28px; height: 28px; }
.rv-filecard b { display: block; font-size: 1.1rem; margin-bottom: 0.4rem; }
.rv-filecard p { color: var(--muted); margin-bottom: 1.2rem; font-size: 0.92rem; }

.rv-controls { padding: 0.55rem 0.9rem 0.75rem; background: var(--bg-2); border-top: 1px solid var(--line); display: grid; gap: 0.45rem; }
.rv-scrub { position: relative; height: 26px; cursor: pointer; touch-action: none; }
.rv-scrub .track { position: absolute; left: 0; right: 0; top: 50%; height: 4px; margin-top: -2px; border-radius: 2px; background: var(--panel-3); overflow: hidden; }
.rv-scrub .buffered { position: absolute; left: 0; top: 0; bottom: 0; background: #34342f; }
.rv-scrub .progress { position: absolute; left: 0; top: 0; bottom: 0; background: var(--amber); }
.rv-scrub .head { position: absolute; top: 50%; width: 14px; height: 14px; margin: -7px 0 0 -7px; border-radius: 50%; background: var(--text); box-shadow: 0 0 0 3px rgba(232, 147, 26, 0.35); pointer-events: none; }
.rv-scrub .hover-tc { position: absolute; bottom: 100%; transform: translateX(-50%); background: var(--panel-3); border: 1px solid var(--line-2); padding: 2px 7px; border-radius: 5px; font-size: 0.72rem; white-space: nowrap; pointer-events: none; opacity: 0; transition: opacity 0.15s; font-variant-numeric: tabular-nums; }
.rv-scrub:hover .hover-tc { opacity: 1; }
.rv-marker { position: absolute; top: 50%; width: 12px; height: 12px; margin: -6px 0 0 -6px; border-radius: 50%; border: 2px solid #030303; background: var(--text); z-index: 2; cursor: pointer; transition: transform 0.15s var(--ease); }
.rv-marker.studio { background: var(--amber); }
.rv-marker.done { opacity: 0.35; }
.rv-marker:hover, .rv-marker.active { transform: scale(1.35); }
.rv-bar { display: flex; align-items: center; gap: 0.3rem; flex-wrap: wrap; }
.rv-time { font-variant-numeric: tabular-nums; font-size: 0.86rem; color: var(--text-2); padding: 0 0.4rem; white-space: nowrap; }
.rv-time b { color: var(--text); font-weight: 600; }
.rv-speed { background: transparent; border: 1px solid var(--line-2); color: var(--text-2); border-radius: 6px; font-size: 0.75rem; font-weight: 700; padding: 0.25rem 0.5rem; cursor: pointer; }
.rv-speed:hover { color: var(--text); border-color: var(--muted); }
.rv-vol { width: 80px; accent-color: var(--amber); }

.rv-drawbar { display: flex; align-items: center; gap: 0.5rem; padding: 0.45rem 0.9rem; background: rgba(232, 147, 26, 0.08); border-top: 1px solid var(--amber-line); font-size: 0.85rem; color: var(--text-2); flex-wrap: wrap; }
.rv-drawbar .sw { width: 22px; height: 22px; border-radius: 50%; border: 2px solid transparent; cursor: pointer; padding: 0; }
.rv-drawbar .sw.on { border-color: var(--text); }

.rv-side { min-height: 0; display: flex; flex-direction: column; border-left: 1px solid var(--line); background: var(--bg-2); }
.rv-side-head { display: flex; align-items: center; justify-content: space-between; gap: 0.6rem; padding: 0.9rem 1rem; border-bottom: 1px solid var(--line); }
.rv-side-head h3 { font-size: 0.95rem; display: flex; gap: 0.5rem; align-items: center; }
.rv-list { flex: 1; min-height: 0; overflow-y: auto; padding: 0.4rem 0; overscroll-behavior: contain; }
.rv-empty { padding: 2.4rem 1.4rem; text-align: center; color: var(--muted); font-size: 0.9rem; }
.rv-empty svg { width: 28px; height: 28px; color: var(--dim); margin-bottom: 0.6rem; }
.rv-empty b { display: block; color: var(--text); margin-bottom: 0.3rem; }
.cm { padding: 0.85rem 1rem; border-left: 2px solid transparent; transition: background 0.2s var(--ease), border-color 0.2s var(--ease); cursor: pointer; }
.cm:hover { background: rgba(255, 255, 255, 0.02); }
.cm.active { background: rgba(232, 147, 26, 0.06); border-left-color: var(--amber); }
.cm.done .cm-text, .cm.done .cm-name { opacity: 0.55; }
.cm-head { display: flex; align-items: center; gap: 0.55rem; }
.cm-name { font-weight: 600; font-size: 0.88rem; }
.cm-when { color: var(--dim); font-size: 0.74rem; }
.cm-tools { margin-left: auto; display: flex; gap: 2px; opacity: 0; transition: opacity 0.15s; }
.cm:hover .cm-tools, .cm.active .cm-tools, .cm:focus-within .cm-tools { opacity: 1; }
.cm-tools .icon-btn { width: 28px; height: 28px; }
.cm-tools .icon-btn svg { width: 15px; height: 15px; }
.cm-body { margin: 0.45rem 0 0 calc(26px + 0.55rem); }
.cm-text { white-space: pre-wrap; word-wrap: break-word; font-size: 0.92rem; color: var(--text); }
.tc-chip { display: inline-flex; align-items: center; gap: 0.3rem; font-variant-numeric: tabular-nums; font-size: 0.74rem; font-weight: 700; color: var(--amber); background: var(--amber-soft); border: 1px solid var(--amber-line); border-radius: 5px; padding: 1px 6px; margin-right: 0.45rem; cursor: pointer; vertical-align: 1px; }
.tc-chip svg { width: 11px; height: 11px; }
.cm-meta { display: flex; gap: 0.9rem; margin-top: 0.5rem; align-items: center; }
.cm-meta button { background: none; border: 0; padding: 0; color: var(--muted); font-size: 0.78rem; font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; gap: 0.3rem; }
.cm-meta button:hover { color: var(--text); }
.cm-meta button.on { color: var(--green); }
.cm-meta svg { width: 14px; height: 14px; }
.cm-replies { margin-top: 0.6rem; display: grid; gap: 0.6rem; border-left: 1px solid var(--line-2); padding-left: 0.8rem; }
.cm-reply .cm-body { margin-left: calc(22px + 0.5rem); }
.cm-reply .avatar { width: 22px; height: 22px; font-size: 0.58rem; }
.cm-replybox { margin-top: 0.6rem; display: flex; gap: 0.4rem; }
.cm-replybox textarea { flex: 1; min-height: 38px; resize: vertical; background: #0b0b0a; border: 1px solid var(--line-2); border-radius: 8px; color: var(--text); font: inherit; font-size: 0.88rem; padding: 0.5rem 0.65rem; outline: none; }
.cm-replybox textarea:focus { border-color: var(--amber); }
.cm-draw-tag { display: inline-flex; align-items: center; gap: 0.25rem; color: var(--blue); font-size: 0.74rem; font-weight: 600; margin-right: 0.4rem; }
.cm-draw-tag svg { width: 12px; height: 12px; }

.rv-composer { border-top: 1px solid var(--line); padding: 0.8rem; background: var(--bg-2); }
.rv-composer .box { background: #0b0b0a; border: 1px solid var(--line-2); border-radius: 12px; transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease); }
.rv-composer .box:focus-within { border-color: var(--amber); box-shadow: 0 0 0 3px rgba(232, 147, 26, 0.12); }
.rv-composer textarea { width: 100%; border: 0; background: transparent; color: var(--text); font: inherit; font-size: 0.93rem; resize: none; outline: none; min-height: 52px; max-height: 180px; padding: 0.7rem 0.8rem 0.2rem; display: block; }
.rv-composer .tools { display: flex; align-items: center; gap: 0.35rem; padding: 0.4rem 0.45rem 0.45rem; }
.rv-chip { display: inline-flex; align-items: center; gap: 0.35rem; height: 28px; padding: 0 0.6rem; border-radius: 6px; border: 1px solid var(--line-2); background: transparent; color: var(--muted); font-size: 0.76rem; font-weight: 700; cursor: pointer; font-variant-numeric: tabular-nums; }
.rv-chip svg { width: 14px; height: 14px; }
.rv-chip.on { color: var(--amber); border-color: var(--amber-line); background: var(--amber-soft); }
.rv-composer .send { margin-left: auto; height: 32px; }
.rv-hint { color: var(--dim); font-size: 0.72rem; margin-top: 0.45rem; padding: 0 0.2rem; display: flex; justify-content: space-between; gap: 0.5rem; }
.kbd { display: inline-block; border: 1px solid var(--line-2); border-bottom-width: 2px; border-radius: 4px; padding: 0 5px; font-size: 0.7rem; color: var(--text-2); font-family: inherit; }
.rv-decision { display: flex; align-items: center; gap: 0.6rem; padding: 0.7rem 1rem; border-bottom: 1px solid var(--line); font-size: 0.86rem; }
.rv-decision.approved { background: var(--green-soft); color: var(--green); }
.rv-decision.changes { background: var(--red-soft); color: var(--red); }
.rv-decision svg { width: 16px; height: 16px; flex: none; }
.rv-decision span { color: var(--text-2); }
.rv-vnote { padding: 0.75rem 1rem; border-bottom: 1px solid var(--line); font-size: 0.86rem; color: var(--text-2); white-space: pre-wrap; }
.rv-vnote b { color: var(--text); font-weight: 600; }

@media (max-width: 1000px) {
  .rv { height: auto; min-height: 100vh; }
  .rv-body { grid-template-columns: 1fr; }
  .rv-stagecol { position: sticky; top: 0; z-index: 20; }
  .rv-stage { flex: none; height: min(56vh, 62vw + 120px); }
  .rv-side { border-left: 0; }
  .rv-list { overflow: visible; }
  .rv-composer { position: sticky; bottom: 0; z-index: 25; padding-bottom: calc(0.8rem + env(safe-area-inset-bottom)); }
  .rv-vol, .rv-hide-sm { display: none; }
  .cm-tools { opacity: 1; }
  .rv-top .rv-actions .btn span { display: none; }
  .rv-top { padding: 0.55rem 0.7rem; gap: 0.45rem 0.5rem; }
  .rv-title { flex: 1 1 calc(100% - 48px); }
  .rv-title small { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .rv-top > .select { order: 2; }
  .rv-actions { order: 3; margin-left: auto; }
}

svg { flex-shrink: 0; }
@media (hover: none) { .rv-hint > span:first-child { visibility: hidden; } }

/* ---------- posting calendar ---------- */
.cal-accounts { display: flex; gap: 0.5rem; flex-wrap: wrap; margin: 0 0 1.6rem; }
.net { display: inline-flex; align-items: center; gap: 0.35rem; height: 26px; padding: 0 0.6rem; border-radius: 999px; border: 1px solid var(--line-2); background: var(--panel-2); color: var(--text-2); font-size: 0.74rem; font-weight: 600; white-space: nowrap; }
.net svg { width: 13px; height: 13px; }
a .net:hover { border-color: var(--amber); color: var(--text); }
.net.published { border-color: rgba(108, 192, 139, 0.35); color: var(--green); }
.net.failed { border-color: rgba(236, 122, 99, 0.4); color: var(--red); }
.cal-day { margin-bottom: 1.8rem; }
.cal-day-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; padding-bottom: 0.6rem; margin-bottom: 0.8rem; border-bottom: 1px solid var(--line); }
.cal-day-head h3 { font-size: 1rem; }
.cal-list { display: grid; gap: 0.8rem; }
.cal-item { display: grid; grid-template-columns: 74px minmax(0, 1fr); gap: 1rem; padding: 0.8rem; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); }
.cal-thumb { position: relative; width: 74px; aspect-ratio: 9 / 16; border-radius: 8px; overflow: hidden; background: linear-gradient(160deg, #1a1a18, #070707); display: grid; place-items: center; }
.cal-thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.cal-play { position: relative; z-index: 2; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: rgba(8, 8, 7, 0.6); color: var(--text); }
.cal-play svg { width: 11px; height: 11px; margin-left: 1px; }
.cal-main { min-width: 0; display: grid; gap: 0.45rem; align-content: start; }
.cal-top { display: flex; align-items: center; justify-content: space-between; gap: 0.6rem; }
.cal-time { font-weight: 700; font-size: 0.95rem; }
.cal-caption { color: var(--text-2); font-size: 0.9rem; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; white-space: pre-line; }
.cal-nets { display: flex; gap: 0.4rem; flex-wrap: wrap; align-items: center; }
.cal-stats { display: inline-flex; align-items: center; gap: 0.3rem; color: var(--muted); font-size: 0.78rem; margin-left: 0.3rem; }
.cal-stats svg { width: 13px; height: 13px; }
@media (max-width: 900px) {
  .cal-item { grid-template-columns: 60px minmax(0, 1fr); gap: 0.8rem; }
  .cal-thumb { width: 60px; }
}

/* ---------- uploads ---------- */
.upload-hero { padding: 2.2rem; }
.upload-hero h3 { font-size: 1.6rem; }
.upload-hero .btn-primary .icon, .upload-hero .btn svg { width: 18px; height: 18px; }
.upl-tip { margin-top: 1rem; margin-bottom: 0; font-size: 0.82rem; color: var(--muted); }
ol.steps { margin: 0 0 1.2rem; padding-left: 1.2rem; display: grid; gap: 0.7rem; color: var(--text-2); font-size: 0.9rem; }
ol.steps li { padding-left: 0.3rem; }
ol.steps .copybox { margin-top: 0.5rem; }

.upl-panel { position: fixed; z-index: 900; right: 20px; bottom: 20px; width: min(400px, calc(100vw - 32px)); max-height: min(70vh, 560px); display: flex; flex-direction: column; background: var(--panel-2); border: 1px solid var(--line-2); border-radius: 14px; box-shadow: var(--shadow); overflow: hidden; animation: rise 0.25s var(--ease); }
.upl-head-wrap { padding: 0.8rem 0.9rem 0.7rem; border-bottom: 1px solid var(--line); }
.upl-head { display: flex; align-items: center; gap: 0.6rem; }
.upl-icon { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; background: var(--amber); color: var(--ink); flex: none; }
.upl-icon svg { width: 16px; height: 16px; }
.upl-titles { flex: 1; min-width: 0; display: grid; }
.upl-titles b { font-size: 0.92rem; font-weight: 600; }
.upl-titles small { color: var(--muted); font-size: 0.76rem; font-variant-numeric: tabular-nums; }
.upl-bar { height: 4px; border-radius: 2px; background: var(--panel-3); overflow: hidden; margin-top: 0.7rem; }
.upl-bar i { display: block; height: 100%; width: 0; background: var(--amber); transition: width 0.4s var(--ease); }
.upl-list { overflow-y: auto; padding: 0.3rem 0; overscroll-behavior: contain; }
.upl-row { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; gap: 0.6rem; align-items: center; padding: 0.45rem 0.9rem; }
.upl-thumb { width: 34px; height: 34px; border-radius: 6px; overflow: hidden; background: var(--panel-3); display: grid; place-items: center; color: var(--muted); }
.upl-thumb img { width: 100%; height: 100%; object-fit: cover; }
.upl-thumb svg { width: 16px; height: 16px; }
.upl-row-main { min-width: 0; }
.upl-name { font-size: 0.82rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.upl-err { font-size: 0.74rem; color: var(--red); }
.upl-row-bar { height: 3px; border-radius: 2px; background: var(--panel-3); overflow: hidden; margin-top: 0.3rem; }
.upl-row-bar i { display: block; height: 100%; width: 0; background: var(--amber-2); transition: width 0.3s var(--ease); }
.upl-row.done .upl-row-bar i { background: var(--green); }
.upl-state { font-size: 0.72rem; color: var(--muted); font-variant-numeric: tabular-nums; min-width: 2.4rem; text-align: right; }
.upl-row.done .upl-state { color: var(--green); }
.upl-row.failed .upl-state { color: var(--red); }
.upl-state svg { width: 15px; height: 15px; }
.upl-foot { display: flex; align-items: center; justify-content: space-between; gap: 0.6rem; padding: 0.6rem 0.9rem; border-top: 1px solid var(--line); font-size: 0.78rem; color: var(--muted); }

.upl-day { margin-bottom: 1.4rem; }
.upl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 0.7rem; }
.upl-tile { display: grid; gap: 0.25rem; text-align: left; background: transparent; border: 0; padding: 0; cursor: pointer; color: var(--text); }
.upl-tile-thumb { position: relative; aspect-ratio: 1; border-radius: 10px; overflow: hidden; background: var(--panel-3); border: 1px solid var(--line); display: grid; place-items: center; color: var(--muted); transition: border-color 0.2s var(--ease); }
.upl-tile-thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.upl-tile-thumb svg { width: 26px; height: 26px; }
.upl-tile:hover .upl-tile-thumb { border-color: var(--amber); }
.upl-tile-name { font-size: 0.78rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.upl-tile-meta { font-size: 0.7rem; color: var(--dim); }
.upl-view { display: block; width: 100%; max-height: 70vh; object-fit: contain; background: #030303; border-radius: 8px; }
@media (max-width: 900px) {
  .upl-panel { right: 12px; left: 12px; width: auto; bottom: calc(76px + env(safe-area-inset-bottom)); }
  .upload-hero { padding: 1.5rem; }
  .upl-grid { grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); }
}
