:root {
  --bg: #08090d;
  --bg-2: #0d0f15;
  --surface: #12141b;
  --surface-2: #181b24;
  --surface-3: #1f2330;
  --line: rgba(255, 255, 255, 0.07);
  --line-2: rgba(255, 255, 255, 0.13);
  --text: #eceef4;
  --text-2: #b4bac7;
  --text-dim: #7d8494;
  --accent: #8b5cf6;
  --accent-2: #ec4899;
  --accent-soft: rgba(139, 92, 246, 0.16);
  --grad: linear-gradient(135deg, #8b5cf6 0%, #d946ef 55%, #ec4899 100%);
  --ok: #34d399;
  --ok-soft: rgba(52, 211, 153, 0.14);
  --err: #f87171;
  --err-soft: rgba(248, 113, 113, 0.13);
  --warn: #fbbf24;
  --warn-soft: rgba(251, 191, 36, 0.13);
  --run: #a78bfa;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 24px 60px -24px rgba(0, 0, 0, 0.7);
  --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --display: "Plus Jakarta Sans", var(--font);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { background: var(--bg); overflow-x: hidden; }
body { margin: 0; font-family: var(--font); color: var(--text); background: var(--bg); font-size: 14px; line-height: 1.45; -webkit-font-smoothing: antialiased; min-height: 100vh; }
body::before {
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: -1;
  background:
    radial-gradient(900px 500px at 15% -10%, rgba(139, 92, 246, 0.18), transparent 60%),
    radial-gradient(700px 420px at 95% 0%, rgba(236, 72, 153, 0.12), transparent 60%);
}
h1, h2, h3 { font-family: var(--display); letter-spacing: -0.02em; margin: 0; }
button { font: inherit; color: inherit; }
a { color: inherit; }
.ico { width: 20px; height: 20px; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.ico-sm { width: 16px; height: 16px; }
::selection { background: rgba(139, 92, 246, 0.4); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 38px; padding: 0 14px; border-radius: var(--radius-sm); border: 1px solid var(--line-2);
  background: var(--surface-2); color: var(--text); font-weight: 600; font-size: 13.5px; cursor: pointer;
  text-decoration: none; white-space: nowrap; transition: background 0.15s, border-color 0.15s, transform 0.1s, opacity 0.15s;
}
.btn:hover { background: var(--surface-3); border-color: rgba(255, 255, 255, 0.2); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.55; cursor: progress; }
.btn-primary { background: var(--grad); border-color: transparent; color: #fff; box-shadow: 0 8px 24px -10px rgba(217, 70, 239, 0.7); }
.btn-primary:hover { background: var(--grad); filter: brightness(1.1); border-color: transparent; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }
.btn-danger { color: var(--err); }
.btn-danger:hover { background: var(--err-soft); border-color: rgba(248, 113, 113, 0.35); }
.btn-lg { height: 48px; padding: 0 22px; font-size: 15px; border-radius: 12px; }
.icon-btn { width: 36px; height: 36px; border-radius: 10px; border: 1px solid transparent; background: transparent; color: var(--text-2); display: inline-grid; place-items: center; cursor: pointer; }
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- inputs ---------- */
input, textarea, select {
  font: inherit; font-size: 14px; color: var(--text); background: var(--bg-2); border: 1px solid var(--line-2);
  border-radius: var(--radius-sm); padding: 10px 12px; width: 100%; transition: border-color 0.15s, box-shadow 0.15s;
}
input::placeholder, textarea::placeholder { color: var(--text-dim); }
input:focus, textarea:focus, select:focus { outline: none; border-color: rgba(139, 92, 246, 0.7); box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.18); }
textarea { resize: vertical; min-height: 44px; }
.field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 600; color: var(--text-2); margin-bottom: 14px; }
.field-label { display: block; font-size: 13px; font-weight: 600; color: var(--text-2); margin-bottom: 6px; }
.field em, .field-label em { font-style: normal; font-weight: 400; color: var(--text-dim); margin-left: 4px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid3 { display: grid; grid-template-columns: 1fr 1fr 1.3fr; gap: 12px; }
.form-error { color: #fecaca; background: var(--err-soft); border: 1px solid rgba(248, 113, 113, 0.3); padding: 10px 12px; border-radius: var(--radius-sm); font-size: 13px; margin: 12px 0 0; white-space: pre-wrap; }

/* ---------- top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20; height: 64px; display: flex; align-items: center; justify-content: space-between;
  padding: 0 28px; background: rgba(8, 9, 13, 0.72); backdrop-filter: blur(14px); border-bottom: 1px solid var(--line);
}
/* brand: camera viewfinder mark + a recording dot, calm white wordmark */
.brand { display: flex; align-items: center; gap: 11px; font-family: var(--display); font-size: 17px; text-decoration: none; letter-spacing: -0.02em; color: var(--text); }
.brand-mark { width: 32px; height: 32px; flex-shrink: 0; display: grid; place-items: center; border-radius: 9px; background: var(--surface-2); border: 1px solid var(--line-2); }
.brand-mark svg { width: 26px; height: 26px; overflow: visible; }
.brand-mark .vf { fill: none; stroke: #fff; stroke-width: 2.4; stroke-linecap: round; transform-origin: 16px 16px; animation: vf-focus 0.9s cubic-bezier(0.16, 1, 0.3, 1) both; transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1); }
.brand-mark .rec { fill: #ff4d4f; transform-origin: 16px 16px; animation: rec-in 0.5s 0.55s cubic-bezier(0.34, 1.56, 0.64, 1) both, rec-pulse 2.6s 1.2s ease-in-out infinite; }
.brand:hover .vf { transform: scale(0.86); }
.brand-word { display: flex; align-items: baseline; gap: 6px; white-space: nowrap; }
.brand-company { font-weight: 600; color: var(--text-2); }
.brand-product { font-weight: 800; color: #a78bfa; animation: word-in 0.7s 0.25s cubic-bezier(0.16, 1, 0.3, 1) both; }
@keyframes vf-focus { from { transform: scale(1.45); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes rec-in { from { transform: scale(0); } to { transform: scale(1); } }
@keyframes rec-pulse { 0%, 100% { opacity: 1; filter: drop-shadow(0 0 3px rgba(255, 77, 79, 0.7)); } 50% { opacity: 0.4; filter: none; } }
@keyframes word-in { from { opacity: 0; transform: translateX(-6px); letter-spacing: 0.08em; } to { opacity: 1; transform: none; letter-spacing: -0.02em; } }
@media (prefers-reduced-motion: reduce) { .brand-mark .vf, .brand-mark .rec, .brand-product { animation: none; } }
.topbar-right { display: flex; align-items: center; gap: 10px; }
.user-btn { display: flex; align-items: center; gap: 9px; height: 40px; padding: 0 10px 0 5px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--surface); cursor: pointer; }
.user-btn:hover { background: var(--surface-2); }
.avatar { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 13px; background: var(--grad); color: #fff; text-transform: uppercase; }
.user-name { font-weight: 600; font-size: 13.5px; }
.menu, .usage-wrap { position: relative; }
.popover { position: absolute; right: 0; top: calc(100% + 8px); background: var(--surface); border: 1px solid var(--line-2); border-radius: 14px; box-shadow: var(--shadow); padding: 6px; z-index: 30; }
.popover[hidden] { display: none; }
.menu-pop { min-width: 210px; display: flex; flex-direction: column; }
.menu-pop button { text-align: left; background: none; border: 0; padding: 9px 12px; border-radius: 8px; cursor: pointer; font-size: 14px; color: var(--text-2); }
.menu-pop button:hover { background: var(--surface-2); color: var(--text); }
.menu-pop hr { border: 0; border-top: 1px solid var(--line); margin: 6px 0; }
.menu-head { padding: 8px 12px 10px; display: flex; flex-direction: column; border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.menu-head span { color: var(--text-dim); font-size: 12px; }

/* usage pill + popover */
.usage-pill { display: flex; align-items: center; gap: 10px; height: 40px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--surface); cursor: pointer; font-size: 13px; font-weight: 600; color: var(--text-2); }
.usage-pill:hover { background: var(--surface-2); }
.usage-pill .meter { width: 54px; height: 6px; border-radius: 9px; background: rgba(255, 255, 255, 0.1); overflow: hidden; }
.usage-pill .meter i { display: block; height: 100%; border-radius: 9px; background: var(--ok); }
.usage-pill.warn { color: var(--warn); border-color: rgba(251, 191, 36, 0.35); }
.usage-pill.warn .meter i { background: var(--warn); }
.usage-pill.full { color: #fecaca; border-color: rgba(248, 113, 113, 0.45); background: var(--err-soft); }
.usage-pill.full .meter i { background: var(--err); }
.usage-pop { width: 320px; padding: 16px; }
.usage-pop h4 { margin: 0 0 12px; font-size: 14px; font-family: var(--display); }
.uwin { margin-bottom: 14px; }
.uwin-top { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 6px; }
.uwin-top strong { font-variant-numeric: tabular-nums; }
.uwin .bar { height: 8px; border-radius: 9px; background: rgba(255, 255, 255, 0.08); overflow: hidden; }
.uwin .bar i { display: block; height: 100%; border-radius: 9px; background: var(--ok); transition: width 0.4s; }
.uwin.warn .bar i { background: var(--warn); }
.uwin.full .bar i { background: var(--err); }
.uwin small { color: var(--text-dim); font-size: 12px; display: block; margin-top: 5px; }
.usage-pop .est { background: var(--surface-2); border-radius: 10px; padding: 10px 12px; font-size: 13px; color: var(--text-2); margin-bottom: 12px; }
.usage-pop .foot { display: flex; justify-content: space-between; align-items: center; font-size: 12px; color: var(--text-dim); }

.limit-banner { display: flex; align-items: center; gap: 12px; justify-content: center; padding: 12px 24px; background: linear-gradient(90deg, rgba(248, 113, 113, 0.16), rgba(251, 191, 36, 0.12)); border-bottom: 1px solid rgba(248, 113, 113, 0.3); color: #fde2e2; font-size: 14px; font-weight: 500; text-align: center; }
.limit-banner[hidden] { display: none; }
.limit-banner strong { color: #fff; }

/* ---------- page ---------- */
.page { max-width: 1320px; margin: 0 auto; padding: 36px 28px 80px; }

/* ---------- create ---------- */
.create { position: relative; background: linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.015)); border: 1px solid var(--line); border-radius: 24px; padding: 34px 34px 26px; box-shadow: var(--shadow); overflow: hidden; }
.create::before { content: ""; position: absolute; inset: -1px; border-radius: 24px; padding: 1px; background: linear-gradient(135deg, rgba(139, 92, 246, 0.5), transparent 35%, transparent 65%, rgba(236, 72, 153, 0.4)); -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; pointer-events: none; }
.create-head { margin-bottom: 22px; }
.create h1 { font-size: 34px; font-weight: 800; }
.lede { margin: 8px 0 0; color: var(--text-2); font-size: 15px; max-width: 760px; }
.purpose { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; }
.purpose label { position: relative; }
.purpose input { position: absolute; opacity: 0; pointer-events: none; }
.purpose span { display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 12px; align-items: center; padding: 12px 16px; border-radius: 14px; border: 1px solid var(--line-2); background: var(--bg-2); cursor: pointer; transition: border-color 0.15s, background 0.15s, box-shadow 0.15s; }
.purpose span .ico { grid-row: 1 / 3; width: 22px; height: 22px; color: var(--text-dim); }
.purpose span b { font-size: 14.5px; font-weight: 650; }
.purpose span small { color: var(--text-dim); font-size: 12.5px; }
.purpose span:hover { border-color: rgba(255, 255, 255, 0.22); }
.purpose input:checked + span { border-color: rgba(139, 92, 246, 0.75); background: linear-gradient(135deg, rgba(139, 92, 246, 0.14), rgba(236, 72, 153, 0.08)); box-shadow: 0 8px 24px -14px rgba(139, 92, 246, 0.8); }
.purpose input:checked + span .ico { color: #c4b5fd; }
.purpose input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.topic-bar { display: flex; align-items: center; gap: 10px; margin-top: 10px; background: var(--bg-2); border: 1px solid rgba(139, 92, 246, 0.45); border-radius: 14px; padding: 4px 4px 4px 18px; }
.topic-bar[hidden] { display: none; }
.topic-bar > .ico { color: #c4b5fd; }
.topic-bar input { border: 0; background: transparent; padding: 11px 4px; font-size: 15px; box-shadow: none !important; }
.attach { margin-top: 10px; }
.attach-btn { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border: 1.5px dashed var(--line-2); border-radius: 14px; cursor: pointer; color: var(--text-2); transition: border-color 0.15s, background 0.15s; }
.attach-btn:hover, .attach-btn.over { border-color: rgba(139, 92, 246, 0.7); background: var(--accent-soft); }
.attach-btn > .ico { color: #c4b5fd; }
.attach-btn b { font-size: 14px; font-weight: 600; display: block; color: var(--text); }
.attach-btn small { font-size: 12.5px; color: var(--text-dim); }
.thumb.pdf { width: auto; max-width: 220px; padding: 0 30px 0 10px; display: flex; align-items: center; gap: 8px; background: var(--surface-2); }
.thumb.pdf .ico { color: #fca5a5; width: 22px; height: 22px; }
.thumb.pdf span { font-size: 12px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.spec-files { display: flex; flex-direction: column; gap: 6px; }
.spec-files a { display: inline-flex; align-items: center; gap: 6px; color: #c4b5fd; text-decoration: none; font-size: 13px; }
.spec-files a:hover { text-decoration: underline; }
.url-bar { display: flex; align-items: center; gap: 10px; background: var(--bg-2); border: 1px solid var(--line-2); border-radius: 16px; padding: 7px 7px 7px 18px; transition: border-color 0.15s, box-shadow 0.15s; }
.url-bar:focus-within { border-color: rgba(139, 92, 246, 0.7); box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.15); }
.url-bar > .ico { color: var(--text-dim); }
.url-bar input { border: 0; background: transparent; padding: 10px 4px; font-size: 16px; box-shadow: none !important; }
.opt-row { display: flex; flex-wrap: wrap; gap: 18px 22px; margin-top: 20px; }
.opt { display: flex; flex-direction: column; gap: 7px; }
.opt-label { font-size: 12px; font-weight: 600; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.06em; }
.seg { display: inline-flex; background: var(--bg-2); border: 1px solid var(--line-2); border-radius: 12px; padding: 3px; gap: 2px; }
.seg label { position: relative; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span { display: inline-flex; align-items: center; gap: 7px; height: 34px; padding: 0 12px; border-radius: 9px; font-size: 13.5px; font-weight: 600; color: var(--text-2); cursor: pointer; white-space: nowrap; transition: background 0.15s, color 0.15s; }
.seg span:hover { color: var(--text); }
.seg input:checked + span { background: var(--surface-3); color: #fff; box-shadow: inset 0 0 0 1px rgba(139, 92, 246, 0.55), 0 4px 14px -6px rgba(139, 92, 246, 0.6); }
.seg input:focus-visible + span { outline: 2px solid var(--accent); }
.ratio { display: inline-block; border: 1.8px solid currentColor; border-radius: 3px; }
.r916 { width: 9px; height: 15px; }
.r169 { width: 17px; height: 10px; }
.r11 { width: 12px; height: 12px; }
.select-wrap { position: relative; }
.select-wrap select { appearance: none; height: 42px; padding: 0 36px 0 12px; min-width: 190px; border-radius: 12px; cursor: pointer; }
.select-wrap .ico { position: absolute; right: 12px; top: 13px; pointer-events: none; color: var(--text-dim); }
.type-hint { margin: 16px 0 0; color: var(--text-dim); font-size: 13px; display: flex; gap: 8px; align-items: flex-start; }
.type-hint b { color: var(--text-2); font-weight: 600; }
.more { margin-top: 18px; border: 1px solid var(--line); border-radius: 16px; background: rgba(255, 255, 255, 0.015); }
.more summary { list-style: none; display: flex; align-items: center; gap: 12px; padding: 14px 16px; cursor: pointer; border-radius: 16px; }
.more summary::-webkit-details-marker { display: none; }
.more summary:hover { background: rgba(255, 255, 255, 0.02); }
.more summary small { display: block; color: var(--text-dim); font-size: 12.5px; font-weight: 400; }
.more summary strong { font-weight: 600; font-size: 14px; }
.more-ico { width: 30px; height: 30px; border-radius: 9px; background: var(--surface-2); display: grid; place-items: center; transition: transform 0.2s; color: var(--text-2); }
.more[open] .more-ico { transform: rotate(45deg); }
.more-count { margin-left: auto; background: var(--accent-soft); color: #c4b5fd; font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 999px; }
.more-count[hidden] { display: none; }
.more-body { display: grid; grid-template-columns: 1.3fr 1fr; gap: 22px; padding: 6px 16px 4px; }
.drop { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; border: 1.5px dashed var(--line-2); border-radius: 14px; padding: 20px; color: var(--text-dim); cursor: pointer; text-align: center; transition: border-color 0.15s, background 0.15s; min-height: 108px; }
.drop:hover, .drop.over { border-color: rgba(139, 92, 246, 0.7); background: var(--accent-soft); color: var(--text-2); }
.drop u { color: #c4b5fd; text-decoration: none; }
.thumbs { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.thumb { position: relative; width: 66px; height: 66px; border-radius: 10px; overflow: hidden; border: 1px solid var(--line-2); }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb button { position: absolute; top: 3px; right: 3px; width: 20px; height: 20px; border-radius: 50%; border: 0; background: rgba(0, 0, 0, 0.7); color: #fff; cursor: pointer; display: grid; place-items: center; }
.thumb button .ico { width: 12px; height: 12px; stroke-width: 2.4; }

/* ---------- library ---------- */
.library { margin-top: 44px; }
.lib-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.lib-head h2 { font-size: 22px; font-weight: 800; display: flex; align-items: center; gap: 10px; }
.count { font-family: var(--font); font-size: 13px; font-weight: 600; color: var(--text-dim); background: var(--surface-2); padding: 3px 9px; border-radius: 999px; }
.lib-tools { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.filters { display: inline-flex; background: var(--surface); border: 1px solid var(--line); border-radius: 11px; padding: 3px; }
.filters button { border: 0; background: none; height: 30px; padding: 0 12px; border-radius: 8px; font-size: 13px; font-weight: 600; color: var(--text-dim); cursor: pointer; }
.filters button:hover { color: var(--text); }
.filters button.active { background: var(--surface-3); color: #fff; }
.switch { position: relative; display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-2); cursor: pointer; user-select: none; }
.switch input { position: absolute; left: 0; top: 0; width: 1px; height: 1px; margin: 0; opacity: 0; }
.switch .track { width: 34px; height: 20px; border-radius: 999px; background: var(--surface-3); position: relative; transition: background 0.2s; }
.switch .track::after { content: ""; position: absolute; left: 3px; top: 3px; width: 14px; height: 14px; border-radius: 50%; background: #fff; transition: transform 0.2s; }
.switch input:checked + .track { background: var(--accent); }
.switch input:checked + .track::after { transform: translateX(14px); }
.switch input:focus-visible + .track { outline: 2px solid var(--accent); outline-offset: 2px; }
.search { position: relative; }
.search .ico { position: absolute; left: 11px; top: 11px; color: var(--text-dim); }
.search input { height: 38px; padding-left: 34px; width: 200px; background: var(--surface); border-color: var(--line); }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 18px; }
.empty { grid-column: 1 / -1; text-align: center; padding: 70px 20px; border: 1px dashed var(--line-2); border-radius: 20px; color: var(--text-dim); }
.empty strong { display: block; color: var(--text); font-family: var(--display); font-size: 18px; margin-bottom: 6px; }

.card { all: unset; box-sizing: border-box; cursor: pointer; display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; overflow: hidden; transition: transform 0.18s ease, border-color 0.18s, box-shadow 0.18s; }
.card:hover { transform: translateY(-3px); border-color: var(--line-2); box-shadow: 0 22px 44px -22px rgba(0, 0, 0, 0.8); }
.card:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.thumb-box { position: relative; aspect-ratio: 4 / 3; background: #050608; overflow: hidden; }
.thumb-box .bg { position: absolute; inset: -20px; width: calc(100% + 40px); height: calc(100% + 40px); object-fit: cover; filter: blur(22px) saturate(1.2) brightness(0.55); }
.thumb-box .fg, .thumb-box video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.thumb-box video { background: #050608; }
.thumb-ph { position: absolute; inset: 0; display: grid; place-items: center; background: radial-gradient(circle at 30% 20%, rgba(139, 92, 246, 0.35), transparent 55%), radial-gradient(circle at 80% 90%, rgba(236, 72, 153, 0.28), transparent 55%), #0b0c12; }
.thumb-ph span { font-family: var(--display); font-weight: 800; font-size: 15px; color: rgba(255, 255, 255, 0.85); padding: 0 18px; text-align: center; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.thumb-ph.shimmer::after { content: ""; position: absolute; inset: 0; background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, 0.08) 50%, transparent 70%); background-size: 220% 100%; animation: shimmer 1.8s linear infinite; }
@keyframes shimmer { from { background-position: 120% 0; } to { background-position: -120% 0; } }
.badges { position: absolute; left: 10px; top: 10px; display: flex; gap: 6px; z-index: 2; }
.badge { font-size: 11px; font-weight: 700; padding: 4px 8px; border-radius: 7px; background: rgba(0, 0, 0, 0.55); backdrop-filter: blur(8px); color: #fff; letter-spacing: 0.02em; border: 1px solid rgba(255, 255, 255, 0.12); }
.play-hint { position: absolute; inset: 0; display: grid; place-items: center; opacity: 0; transition: opacity 0.2s; z-index: 2; }
.play-hint span { width: 52px; height: 52px; border-radius: 50%; background: rgba(255, 255, 255, 0.92); color: #111; display: grid; place-items: center; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5); }
.play-hint .ico { width: 22px; height: 22px; margin-left: 3px; }
.card:hover .play-hint { opacity: 1; }
.card.previewing .play-hint { opacity: 0; }
.progress-ov { position: absolute; left: 0; right: 0; bottom: 0; padding: 30px 12px 12px; background: linear-gradient(transparent, rgba(0, 0, 0, 0.85)); z-index: 2; }
.progress-ov .phase { font-size: 12.5px; font-weight: 600; color: #fff; margin-bottom: 8px; display: flex; justify-content: space-between; gap: 8px; }
.progress-ov .phase span:last-child { color: rgba(255, 255, 255, 0.65); font-variant-numeric: tabular-nums; }
.segbar { display: flex; gap: 3px; }
.segbar i { flex: 1; height: 4px; border-radius: 3px; background: rgba(255, 255, 255, 0.18); }
.segbar i.done { background: var(--run); }
.segbar i.now { background: linear-gradient(90deg, var(--run), rgba(255, 255, 255, 0.25)); background-size: 200% 100%; animation: shimmer 1.4s linear infinite; }
.card-body { padding: 13px 15px 15px; display: flex; flex-direction: column; gap: 6px; }
.card-title { font-weight: 650; font-size: 14.5px; line-height: 1.3; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; min-height: 2.6em; }
.card-sub { color: var(--text-dim); font-size: 12.5px; display: flex; justify-content: space-between; gap: 8px; }
.status { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; }
.status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.st-done { color: var(--ok); }
.st-running { color: var(--run); }
.st-running::before { animation: pulse 1.2s ease-in-out infinite; }
.st-queued { color: var(--warn); }
.st-failed { color: var(--err); }
.st-canceled { color: var(--text-dim); }
@keyframes pulse { 50% { opacity: 0.3; } }

/* ---------- detail sheet ---------- */
dialog { color: var(--text); }
dialog::backdrop { background: rgba(3, 4, 7, 0.72); backdrop-filter: blur(4px); }
.sheet { border: 1px solid var(--line-2); background: var(--surface); border-radius: 22px; padding: 0; width: min(1180px, calc(100vw - 32px)); max-height: calc(100vh - 40px); overflow: hidden; box-shadow: 0 40px 120px -30px rgba(0, 0, 0, 0.9); }
.sheet-inner { display: grid; grid-template-columns: minmax(300px, 1fr) minmax(380px, 1.05fr); grid-template-rows: minmax(0, 1fr); height: min(900px, calc(100vh - 42px)); }
.sheet-media { background: #050608; display: flex; align-items: center; justify-content: center; padding: 22px; min-height: 0; position: relative; overflow: hidden; }
.sheet-media video { display: block; width: auto; height: auto; max-width: 100%; max-height: 100%; border-radius: 12px; background: #000; box-shadow: 0 20px 60px -20px rgba(0, 0, 0, 0.9); }
.media-ph { width: 100%; max-height: calc(100vh - 90px); border-radius: 14px; position: relative; overflow: hidden; display: grid; place-items: center; background: radial-gradient(circle at 30% 20%, rgba(139, 92, 246, 0.35), transparent 55%), radial-gradient(circle at 80% 90%, rgba(236, 72, 153, 0.28), transparent 55%), #0b0c12; }
.media-ph.fmt-9x16 { aspect-ratio: 9 / 16; width: auto; height: min(100%, 640px); }
.media-ph.fmt-16x9 { aspect-ratio: 16 / 9; }
.media-ph.fmt-1x1 { aspect-ratio: 1; max-width: 520px; }
.media-ph .inner { text-align: center; padding: 20px; z-index: 1; }
.media-ph strong { display: block; font-family: var(--display); font-size: 20px; margin-bottom: 6px; }
.media-ph span { color: var(--text-2); font-size: 14px; }
.media-ph.shimmer::after { content: ""; position: absolute; inset: 0; background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, 0.07) 50%, transparent 70%); background-size: 220% 100%; animation: shimmer 2s linear infinite; }
.sheet-side { padding: 22px 24px; overflow: auto; min-height: 0; display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.sheet-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.sheet-title { min-width: 0; }
.eyebrow { font-size: 12px; font-weight: 600; color: var(--text-dim); display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 6px; }
.eyebrow .badge { position: static; background: var(--surface-3); }
.sheet-title h3 { font-size: 22px; font-weight: 800; line-height: 1.2; word-break: break-word; }
.sheet-link { display: inline-block; margin-top: 6px; color: var(--text-dim); font-size: 12.5px; text-decoration: none; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sheet-link:hover { color: #c4b5fd; }
.notice { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; font-size: 13.5px; }
.notice .ico { margin-top: 1px; }
.notice.err { background: var(--err-soft); color: #fecaca; border: 1px solid rgba(248, 113, 113, 0.28); }
.notice.warn { background: var(--warn-soft); color: #fde68a; border: 1px solid rgba(251, 191, 36, 0.28); }
.notice.ok { background: var(--ok-soft); color: #a7f3d0; border: 1px solid rgba(52, 211, 153, 0.25); }
.statline { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; color: var(--text-dim); font-size: 12.5px; }
.statline .status { font-size: 13.5px; }
.statline span.sep { display: inline-flex; align-items: center; gap: 5px; }
.statline .ico { width: 14px; height: 14px; }

.stepper { list-style: none; margin: 0; padding: 14px 16px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px 8px; background: var(--bg-2); border: 1px solid var(--line); border-radius: 14px; }
.stepper li { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--text-dim); font-weight: 500; min-width: 0; }
.stepper li .dot { width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid var(--line-2); display: grid; place-items: center; flex-shrink: 0; font-size: 11px; font-weight: 700; }
.stepper li .dot .ico { width: 13px; height: 13px; stroke-width: 2.6; }
.stepper li.done { color: var(--text-2); }
.stepper li.done .dot { background: var(--accent-soft); border-color: transparent; color: #c4b5fd; }
.stepper li.now { color: #fff; font-weight: 600; }
.stepper li.now .dot { border-color: var(--run); color: var(--run); box-shadow: 0 0 0 4px rgba(167, 139, 250, 0.15); animation: ring 1.6s ease-in-out infinite; }
@keyframes ring { 50% { box-shadow: 0 0 0 7px rgba(167, 139, 250, 0.05); } }
.stepper li span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stepper.complete li .dot { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.stepper.complete li { color: var(--text-2); }

.actions { display: flex; flex-wrap: wrap; gap: 8px; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); }
.tab { background: none; border: 0; padding: 9px 12px; cursor: pointer; color: var(--text-dim); font-weight: 600; font-size: 13.5px; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tab:hover { color: var(--text); }
.tab.active { color: #fff; border-bottom-color: var(--accent); }
.tab-panel { font-size: 13.5px; color: var(--text-2); min-height: 120px; }
.tab-panel[hidden] { display: none; }
.md h4, .md h5, .md h6 { font-family: var(--display); color: var(--text); font-size: 14.5px; margin: 16px 0 6px; }
.md h3 { font-family: var(--display); color: var(--text); font-size: 16px; margin: 4px 0 8px; }
.md p { margin: 6px 0; line-height: 1.55; }
.md ul { margin: 6px 0; padding-left: 18px; line-height: 1.55; }
.md li::marker { color: var(--accent); }
.md strong { color: var(--text); }
.spec { display: grid; grid-template-columns: 110px 1fr; gap: 10px 14px; margin: 4px 0; }
.spec dt { color: var(--text-dim); font-weight: 600; }
.spec dd { margin: 0; white-space: pre-wrap; word-break: break-word; color: var(--text); }
.spec-imgs { display: flex; gap: 8px; flex-wrap: wrap; }
.spec-imgs img { width: 64px; height: 64px; object-fit: cover; border-radius: 9px; border: 1px solid var(--line-2); }
.log { max-height: 360px; overflow: auto; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; background: var(--bg-2); border: 1px solid var(--line); border-radius: 12px; padding: 8px 12px; }
.ev { display: flex; gap: 10px; padding: 4px 0; border-bottom: 1px solid rgba(255, 255, 255, 0.04); line-height: 1.5; }
.ev time { color: var(--text-dim); flex-shrink: 0; }
.ev span { white-space: pre-wrap; word-break: break-word; }
.ev-text span { color: var(--text); font-family: var(--font); font-size: 12.5px; }
.ev-tool span { color: var(--text-dim); }
.ev-info span { color: #c4b5fd; font-weight: 600; }

/* ---------- small dialogs ---------- */
.dialog { border: 1px solid var(--line-2); background: var(--surface); border-radius: 18px; padding: 0; width: min(520px, calc(100vw - 32px)); box-shadow: var(--shadow); }
.dialog-head { display: flex; justify-content: space-between; align-items: center; padding: 18px 20px 6px; }
.dialog-head h3 { font-size: 18px; }
.dialog-body { padding: 14px 20px 18px; }
.dialog-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 0 20px 20px; }
.user-list { display: flex; flex-direction: column; margin-bottom: 16px; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.user-row { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.user-row:last-child { border-bottom: 0; }
.user-row .avatar { width: 28px; height: 28px; font-size: 12px; }
.user-row .who { flex: 1; min-width: 0; }
.user-row .who small { display: block; color: var(--text-dim); font-size: 12px; }
.user-form { display: grid; grid-template-columns: 1fr 1fr auto auto; gap: 8px; align-items: center; }
.check { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-2); white-space: nowrap; }
.check input { width: auto; }

/* ---------- toasts ---------- */
.toasts { position: fixed; right: 20px; bottom: 20px; display: flex; flex-direction: column; gap: 10px; z-index: 100; }
.toast { background: var(--surface-2); border: 1px solid var(--line-2); border-radius: 12px; padding: 12px 16px; box-shadow: var(--shadow); font-size: 13.5px; max-width: 380px; animation: toastIn 0.25s ease; display: flex; gap: 10px; align-items: flex-start; }
.toast.err { border-color: rgba(248, 113, 113, 0.4); }
.toast.warn { border-color: rgba(251, 191, 36, 0.4); }
.toast .ico { width: 18px; height: 18px; margin-top: 1px; }
.toast.ok .ico { color: var(--ok); }
.toast.err .ico { color: var(--err); }
.toast.warn .ico { color: var(--warn); }
@keyframes toastIn { from { opacity: 0; transform: translateY(8px); } }

/* ---------- login ---------- */
.login-body { display: grid; place-items: center; padding: 20px; }
.login-card { width: min(400px, 100%); background: var(--surface); border: 1px solid var(--line-2); border-radius: 22px; padding: 34px; box-shadow: var(--shadow); }
.login-card .brand { margin-bottom: 22px; font-size: 19px; }
.login-card h1 { font-size: 26px; font-weight: 800; }
.login-card p { color: var(--text-2); margin: 8px 0 24px; }
.btn-block { width: 100%; height: 46px; font-size: 15px; margin-top: 6px; }

/* ---------- responsive ---------- */
@media (max-width: 980px) {
  .sheet-inner { grid-template-columns: 1fr; grid-template-rows: auto; height: auto; max-height: calc(100vh - 42px); overflow: auto; }
  .sheet-side { overflow: visible; }
  .sheet-media video { max-height: 62vh; }
  .sheet-head .icon-btn { position: absolute; top: 12px; right: 12px; z-index: 5; background: rgba(0, 0, 0, 0.6); color: #fff; }
  .sheet-media { min-height: 0; }
  .media-ph.fmt-9x16 { height: 52vh; }
  .more-body { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .topbar { padding: 0 16px; }
  .user-name { display: none; }
  .usage-pill .label { display: none; }
  .page { padding: 20px 16px 60px; }
  .create { padding: 22px 18px 18px; border-radius: 20px; }
  .create h1 { font-size: 26px; }
  .url-bar { flex-wrap: wrap; padding: 6px; }
  .url-bar > .ico { display: none; }
  .url-bar input { padding: 10px 8px; }
  .url-bar .btn { width: 100%; }
  .purpose { grid-template-columns: 1fr; }
  .opt-row { gap: 14px; }
  .opt { width: 100%; }
  .seg { display: flex; width: 100%; }
  .seg label { flex: 1; min-width: 0; }
  .seg span { width: 100%; justify-content: center; padding: 0 6px; font-size: 13px; }
  .seg span .ico { display: none; }
  .select-wrap select { width: 100%; }
  .filters { width: 100%; }
  .filters button { flex: 1; padding: 0 6px; }
  .grid2, .grid3 { grid-template-columns: 1fr; }
  .stepper { grid-template-columns: repeat(2, 1fr); }
  .lib-tools { width: 100%; }
  .search input { width: 100%; }
  .search { flex: 1; }
  .user-form { grid-template-columns: 1fr; }
  .toasts { left: 16px; right: 16px; }
}
