/* Plugbook Edit: "Signal" visual identity. Near-black surfaces, hairline borders, neon green used
   sparingly (primary actions, playhead, active states, focus). Manrope for UI, Spline Sans Mono for numbers. */
@font-face {
  font-family: 'Manrope';
  src: url('/fonts/manrope-latin.woff2') format('woff2');
  font-weight: 400 800;
  font-display: swap;
}
@font-face {
  font-family: 'Spline Sans Mono';
  src: url('/fonts/spline-sans-mono-latin.woff2') format('woff2');
  font-weight: 400 600;
  font-display: swap;
}

:root {
  --bg: #0b0d0c;
  --panel: #131615;
  --panel-2: #1a1e1c;
  --panel-3: #212623;
  --line: #262b28;
  --line-2: #323834;
  --text: #edefec;
  --text-2: #c4c9c5;
  --muted: #8a918c;
  --faint: #5c625e;
  --accent: #5eff29;
  --accent-ink: #0b1406;
  --accent-soft: rgba(94, 255, 41, 0.12);
  --accent-line: rgba(94, 255, 41, 0.45);
  --danger: #ff5a4f;
  --danger-soft: rgba(255, 90, 79, 0.12);
  --warn: #f2c14e;
  --warn-soft: rgba(242, 193, 78, 0.12);
  --t-text: #b9a7ff;
  --t-text-bg: #241f36;
  --t-cap: #9fe08a;
  --t-cap-bg: #18241a;
  --t-ov: #7fb8ff;
  --t-ov-bg: #172334;
  --t-au: #f0b45e;
  --t-au-bg: #2a2114;
  --r: 8px;
  --r-sm: 6px;
  --font: 'Manrope', -apple-system, BlinkMacSystemFont, 'Helvetica Neue', Arial, sans-serif;
  --mono: 'Spline Sans Mono', ui-monospace, 'SF Mono', Menlo, monospace;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); }
body {
  font-family: var(--font);
  font-size: 13px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}
#app { height: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; }
.mono { font-family: var(--mono); font-feature-settings: 'tnum' 1; letter-spacing: -0.01em; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.grow { flex: 1 1 auto; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wrap { word-break: break-all; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
/* text fields show focus with their own border; the generic ring doubled up inside the composer */
input[type=text]:focus-visible, input[type=password]:focus-visible, input[type=number]:focus-visible, textarea:focus-visible, select:focus-visible { outline: none; }
::selection { background: rgba(94, 255, 41, 0.28); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #2b302d; border-radius: 10px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background-color: #3a403c; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-corner { background: transparent; }

/* ---------- boot / messages ---------- */
.boot, .center-msg {
  height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; color: var(--muted);
}
.boot span { font-weight: 700; color: var(--text); letter-spacing: -0.01em; }
.center-msg p { max-width: 420px; text-align: center; color: var(--text-2); }

/* ---------- logo ---------- */
.logo { display: inline-flex; align-items: center; gap: 10px; }
.wordmark { font-weight: 600; font-size: 15px; letter-spacing: -0.02em; color: var(--text); }
.wordmark b { font-weight: 800; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 32px; padding: 0 13px; border-radius: var(--r-sm);
  border: 1px solid var(--line-2); background: var(--panel-2); color: var(--text);
  font-weight: 600; font-size: 13px; white-space: nowrap; transition: background .12s, border-color .12s, color .12s;
}
.btn:hover:not(:disabled) { background: var(--panel-3); border-color: #3d443f; }
.btn:disabled { opacity: .45; }
.btn-sm { height: 28px; padding: 0 10px; font-size: 12.5px; }
.btn-xs { height: 22px; padding: 0 8px; font-size: 11.5px; gap: 5px; border-radius: 5px; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn-primary:hover:not(:disabled) { background: #7bff52; border-color: #7bff52; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn-ghost:hover:not(:disabled) { background: var(--panel-2); border-color: var(--line); color: var(--text); }
.btn-ghost.is-on { color: var(--accent); }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #1a0504; }
.btn-danger:hover:not(:disabled) { background: #ff7268; border-color: #ff7268; }
.btn-danger-ghost { background: transparent; border-color: rgba(255, 90, 79, .35); color: var(--danger); }
.btn-danger-ghost:hover:not(:disabled) { background: var(--danger-soft); }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px;
  border-radius: var(--r-sm); border: 1px solid transparent; background: transparent; color: var(--text-2);
}
.icon-btn:hover:not(:disabled) { background: var(--panel-2); color: var(--text); border-color: var(--line); }
.icon-btn:disabled { opacity: .35; }
.icon-btn.sm { width: 26px; height: 26px; }
.icon-btn.xs { width: 18px; height: 18px; border-radius: 4px; }
.icon { flex: none; display: block; }

.spinner {
  display: inline-block; flex: none; border-radius: 50%;
  border: 2px solid rgba(237, 239, 236, .18); border-top-color: var(--accent); animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.pill {
  display: inline-flex; align-items: center; gap: 4px; height: 20px; padding: 0 7px; border-radius: 10px;
  font-size: 11px; font-weight: 600; border: 1px solid var(--line-2); background: transparent; color: var(--muted); white-space: nowrap;
}
.pill-ok { color: var(--accent); border-color: var(--accent-line); background: var(--accent-soft); }
.pill-muted { color: var(--muted); }
.pill-run { color: var(--text-2); }
.pill-bad { color: var(--danger); border-color: rgba(255, 90, 79, .4); }
.pill-action { color: var(--text-2); }
.pill-action:hover { color: var(--text); border-color: #444b46; background: var(--panel-3); }
.pill-run { max-width: 150px; min-width: 0; flex: 0 1 auto; }
.pill-text { overflow: hidden; text-overflow: ellipsis; min-width: 0; }

.notice { display: flex; align-items: center; gap: 8px; padding: 9px 11px; border-radius: var(--r-sm); border: 1px solid var(--line); background: var(--panel-2); color: var(--text-2); margin: 8px 0; }
.notice-error { border-color: rgba(255, 90, 79, .35); background: var(--danger-soft); color: #ffb3ad; }
.notice.small { align-items: flex-start; font-size: 12px; }
.notice.small > .icon { margin-top: 2px; flex: none; }
.notice-btn { display: flex; margin-top: 8px; color: var(--text); }
.notice-warn { border-color: rgba(242, 193, 78, .3); background: var(--warn-soft); color: #f3d68f; }
.loading-row { display: flex; align-items: center; gap: 10px; color: var(--muted); padding: 14px 2px; }

kbd { font-family: var(--mono); font-size: 10px; color: var(--muted); border: 1px solid var(--line-2); border-radius: 4px; padding: 0 4px; line-height: 15px; }

/* ---------- fields ---------- */
input[type=text], input[type=password], input[type=number], textarea, select {
  background: var(--bg); border: 1px solid var(--line-2); border-radius: var(--r-sm); color: var(--text);
  padding: 7px 10px; outline: none; transition: border-color .12s, box-shadow .12s;
}
input:focus, textarea:focus, select:focus { border-color: var(--accent-line); box-shadow: 0 0 0 3px rgba(94, 255, 41, .08); }
textarea { resize: none; line-height: 1.5; }
select { appearance: none; padding-right: 26px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%238a918c' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 9px center; }
.field { display: flex; flex-direction: column; gap: 7px; margin: 0 0 18px; }
.field > span:first-child { font-size: 12px; font-weight: 600; color: var(--text-2); }
.field input { height: 40px; font-size: 14px; }
.field.inline { flex-direction: row; align-items: center; gap: 12px; }
.field.inline > span:first-child { width: 80px; }
.field.inline input { height: 34px; flex: 1; }

/* ---------- toasts ---------- */
.toasts { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; z-index: 100; pointer-events: none; align-items: center; }
.toast { pointer-events: auto; max-width: 560px; padding: 10px 14px; border-radius: var(--r); background: #202522; border: 1px solid var(--line-2); color: var(--text); box-shadow: 0 10px 30px rgba(0, 0, 0, .45); font-weight: 500; animation: toast-in .18s ease-out; }
.toast-ok { border-color: var(--accent-line); }
.toast-error { border-color: rgba(255, 90, 79, .5); background: #2a1615; color: #ffcdc9; }
@keyframes toast-in { from { opacity: 0; transform: translateY(6px); } }

/* ---------- modals and drawers ---------- */
.modal-scrim, .drawer-scrim { position: fixed; inset: 0; background: rgba(4, 6, 5, .62); backdrop-filter: blur(3px); z-index: 50; display: flex; align-items: center; justify-content: center; animation: fade-in .14s ease-out; }
.drawer-scrim { justify-content: flex-end; align-items: stretch; background: rgba(4, 6, 5, .35); backdrop-filter: none; }
@keyframes fade-in { from { opacity: 0; } }
.modal { width: 520px; max-width: calc(100vw - 32px); max-height: calc(100vh - 48px); display: flex; flex-direction: column; background: var(--panel); border: 1px solid var(--line-2); border-radius: 12px; box-shadow: 0 30px 80px rgba(0, 0, 0, .55); }
.modal-wide { width: 760px; }
.modal-export { width: 600px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px 12px; }
.modal-head h2 { margin: 0; font-size: 16px; font-weight: 700; letter-spacing: -0.01em; display: flex; align-items: center; gap: 8px; }
.modal-body { padding: 4px 18px 8px; overflow: auto; }
.modal-foot { display: flex; align-items: center; gap: 8px; padding: 12px 18px 16px; border-top: 1px solid var(--line); }
.drawer { width: 420px; max-width: 92vw; background: var(--panel); border-left: 1px solid var(--line-2); display: flex; flex-direction: column; box-shadow: -20px 0 60px rgba(0, 0, 0, .4); animation: slide-in .18s ease-out; }
@keyframes slide-in { from { transform: translateX(24px); opacity: .4; } }
.drawer-note { margin: 0 18px 10px; color: var(--muted); font-size: 12px; }
.menu { position: absolute; z-index: 30; min-width: 170px; padding: 5px; background: #1c201e; border: 1px solid var(--line-2); border-radius: var(--r); box-shadow: 0 14px 40px rgba(0, 0, 0, .5); }
.menu button { display: flex; align-items: center; gap: 9px; width: 100%; height: 32px; padding: 0 10px; border: 0; background: transparent; border-radius: 5px; color: var(--text-2); text-align: left; font-weight: 500; }
.menu button:hover { background: var(--panel-3); color: var(--text); }
.menu button.danger { color: var(--danger); }
.menu button.is-on { color: var(--accent); }
.menu button .icon:last-child:not(:first-child) { margin-left: auto; }

/* segmented */
.seg { display: inline-flex; padding: 2px; border: 1px solid var(--line); border-radius: 7px; background: var(--bg); }
.seg button { height: 24px; padding: 0 11px; border: 0; border-radius: 5px; background: transparent; color: var(--muted); font-weight: 600; font-size: 12px; text-transform: capitalize; }
.seg button.is-on { background: var(--panel-3); color: var(--text); box-shadow: inset 0 0 0 1px var(--line-2); }
.seg button:disabled { opacity: .4; }
.seg-wide { display: flex; }
.seg-wide button { flex: 1; height: 32px; }

/* ---------- onboarding ---------- */
.onboard { height: 100%; overflow: auto; display: flex; padding: 32px 16px;
  background: radial-gradient(1000px 520px at 50% -10%, rgba(94, 255, 41, .07), transparent 60%), var(--bg); }
.onboard-card { width: 680px; max-width: 100%; margin: auto; background: var(--panel); border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 40px 100px rgba(0, 0, 0, .5); display: flex; flex-direction: column; min-height: 520px; }
.onboard-top { display: flex; align-items: center; justify-content: space-between; padding: 20px 26px; border-bottom: 1px solid var(--line); gap: 16px; }
.steps { display: flex; gap: 6px; list-style: none; margin: 0; padding: 0; }
.steps li { display: flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 600; color: var(--faint); padding: 4px 9px 4px 4px; border-radius: 14px; }
.steps li.is-current { color: var(--text); background: var(--panel-2); }
.steps li.is-done { color: var(--muted); }
.step-num { width: 20px; height: 20px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-family: var(--mono); font-size: 11px; border: 1px solid var(--line-2); }
.steps li.is-current .step-num { border-color: var(--accent); color: var(--accent); }
.steps li.is-done .step-num { background: var(--accent-soft); border-color: var(--accent-line); color: var(--accent); }
.onboard-body { padding: 30px 34px 10px; flex: 1; }
.onboard-body h1 { font-size: 30px; line-height: 1.12; letter-spacing: -0.035em; margin: 6px 0 12px; font-weight: 800; }
.onboard-body h2 { font-size: 21px; letter-spacing: -0.02em; margin: 4px 0 8px; font-weight: 750; }
.lede { color: var(--text-2); font-size: 14px; margin: 0 0 24px; max-width: 540px; }
.feature-list { list-style: none; padding: 0; margin: 8px 0 0; display: grid; gap: 12px; }
.feature-list li { display: flex; gap: 12px; align-items: flex-start; color: var(--text-2); }
.feature-list .icon { color: var(--accent); margin-top: 2px; }
.onboard-foot { display: flex; justify-content: space-between; padding: 16px 26px 22px; }
.onboard-ready { text-align: left; }
.ready-mark { width: 52px; height: 52px; border-radius: 14px; display: flex; align-items: center; justify-content: center; background: var(--accent-soft); color: var(--accent); border: 1px solid var(--accent-line); margin-bottom: 16px; }
.summary { display: grid; grid-template-columns: 90px 1fr; gap: 8px 12px; margin: 14px 0; font-size: 12.5px; }
.summary dt { color: var(--muted); }
.summary dd { margin: 0; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; }

.provider-list { display: grid; gap: 8px; }
.provider { border: 1px solid var(--line); border-radius: 10px; background: var(--panel-2); transition: border-color .12s; }
.provider.is-selected { border-color: var(--accent-line); box-shadow: inset 0 0 0 1px rgba(94, 255, 41, .15); }
.provider-main { width: 100%; display: flex; align-items: center; gap: 12px; padding: 12px 14px; background: transparent; border: 0; text-align: left; }
.radio-dot { width: 15px; height: 15px; flex: none; border-radius: 50%; border: 1.5px solid var(--line-2); position: relative; }
.provider.is-selected .radio-dot { border-color: var(--accent); }
.provider.is-selected .radio-dot::after { content: ''; position: absolute; inset: 3px; border-radius: 50%; background: var(--accent); }
.provider-icon { width: 30px; height: 30px; flex: none; border-radius: 8px; background: var(--bg); border: 1px solid var(--line); display: flex; align-items: center; justify-content: center; color: var(--text-2); }
.provider-text { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.provider-label { font-weight: 700; }
.provider-hint { font-size: 12px; color: var(--muted); }
.provider-model { font-size: 11px; color: var(--muted); }
.provider-sub { display: flex; align-items: center; gap: 10px; margin: -6px 14px 10px 85px; min-height: 22px; font-size: 11.5px; }
.provider-reason { flex: 1; min-width: 0; color: var(--faint); }
.provider-key { display: flex; gap: 8px; align-items: center; margin: 0 14px 12px 85px; }
.provider-key input { flex: 1; height: 30px; font-size: 12.5px; }
.provider-key input:not(:placeholder-shown) { font-family: var(--mono); }
.key-icon { color: var(--muted); }
.test-ok { color: var(--accent); display: inline-flex; gap: 5px; align-items: center; }
.test-bad { color: #ff9a92; display: inline-flex; gap: 5px; align-items: center; }

.tools { display: grid; gap: 2px; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.tool-row { display: grid; grid-template-columns: 14px 104px 1fr auto; align-items: center; gap: 4px 12px; padding: 11px 14px; background: var(--panel-2); }
.tool-row + .tool-row { border-top: 1px solid var(--line); }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--faint); }
.status-dot.ok { background: var(--accent); box-shadow: 0 0 8px rgba(94, 255, 41, .55); }
.status-dot.bad { background: var(--danger); }
.status-dot.warn { background: var(--warn); }
.tool-row .tool-name { font-weight: 600; }
.tool-purpose { color: var(--muted); font-size: 12px; }
.tool-version { font-size: 12px; color: var(--text-2); }
.toolchk-detail { grid-column: 2 / -1; font-size: 11.5px; color: var(--muted); }
.toolchk-detail.warn { color: var(--warn); }
.tool-fix { grid-column: 2 / -1; font-family: var(--mono); font-size: 11.5px; color: var(--text-2); background: var(--bg); border: 1px solid var(--line); padding: 5px 8px; border-radius: 5px; white-space: pre-wrap; word-break: break-all; }
.tools-foot { display: flex; align-items: center; gap: 12px; padding: 9px 10px; background: var(--panel); border-top: 1px solid var(--line); min-width: 0; }
.tools-foot .muted { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.settings-body section { margin-bottom: 22px; }
.engine-list { display: grid; gap: 6px; }
.engine { display: flex; gap: 10px; align-items: flex-start; padding: 9px 11px; border: 1px solid var(--line); border-radius: var(--r); background: var(--panel); cursor: pointer; }
.engine.is-selected { border-color: var(--accent-line); background: var(--accent-soft); }
.engine input { margin-top: 3px; accent-color: var(--accent); }
.engine-text { display: flex; flex-direction: column; gap: 1px; }
.engine-label { font-weight: 650; }
.engine-hint { font-size: 12px; color: var(--muted); }
.settings-body h3 { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 6px 0 12px; }
.toggle-row { display: flex; align-items: center; gap: 10px; color: var(--text-2); margin-top: 6px; }
.toggle-row input { accent-color: var(--accent); }

/* ---------- dashboard ---------- */
.dashboard { height: 100%; display: flex; flex-direction: column; }
.dash-top { display: flex; align-items: center; gap: 8px; height: 60px; padding: 0 28px; border-bottom: 1px solid var(--line); flex: none; }
.dash-main { flex: 1; overflow: auto; padding: 34px 28px 60px; }
.quickstart { max-width: 1120px; margin: 0 auto 38px; }
.qs-head h1 { margin: 0 0 6px; font-size: 28px; font-weight: 800; letter-spacing: -0.035em; }
.qs-head p { margin: 0 0 18px; color: var(--muted); font-size: 14px; }
.qs-box { border: 1px solid var(--line-2); border-radius: 14px; background: var(--panel); padding: 6px 6px 8px; transition: border-color .15s, box-shadow .15s; }
.qs-box:focus-within { border-color: #3b423d; box-shadow: 0 0 0 4px rgba(94, 255, 41, .05); }
.quickstart.is-drag .qs-box { border-color: var(--accent); border-style: dashed; background: #121a10; }
.qs-box textarea { width: 100%; border: 0; background: transparent; font-size: 15px; padding: 12px 12px 6px; box-shadow: none; min-height: 76px; }
.qs-files { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 10px 8px; }
.file-chip { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 4px 0 9px; border-radius: 13px; background: var(--panel-2); border: 1px solid var(--line-2); font-size: 12px; color: var(--text-2); }
.file-chip button { width: 18px; height: 18px; border-radius: 50%; border: 0; background: transparent; color: var(--muted); display: inline-flex; align-items: center; justify-content: center; }
.file-chip button:hover { background: var(--panel-3); color: var(--text); }
.qs-bar { display: flex; align-items: center; gap: 8px; padding: 4px 6px 0; }
.qs-drop-hint { color: var(--faint); font-size: 12px; margin-right: 4px; }
.qs-status { padding: 8px 12px 2px; color: var(--muted); font-size: 12px; }
.aspect-picker { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.aspect-picker.compact { display: inline-flex; gap: 4px; }
.aspect-card { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 16px 8px 13px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel-2); color: var(--text-2); }
.aspect-card:hover { border-color: var(--line-2); color: var(--text); }
.aspect-card.is-selected { border-color: var(--accent-line); background: #141c12; color: var(--text); }
.aspect-picker.compact .aspect-card { flex-direction: row; padding: 0 9px; height: 30px; gap: 7px; border-radius: 7px; background: transparent; border-color: transparent; }
.aspect-picker.compact .aspect-card:hover { background: var(--panel-2); }
.aspect-picker.compact .aspect-card.is-selected { background: var(--panel-2); border-color: var(--line-2); }
.aspect-shape-wrap { display: inline-flex; align-items: center; justify-content: center; }
.aspect-shape { border: 1.5px solid currentColor; border-radius: 3px; opacity: .8; }
.aspect-card.is-selected .aspect-shape { border-color: var(--accent); opacity: 1; }
.aspect-id { font-size: 12px; font-weight: 600; }
.aspect-label { font-weight: 700; color: var(--text); font-size: 13px; }
.aspect-hint { font-size: 11px; color: var(--muted); }

.projects { max-width: 1120px; margin: 0 auto; }
.section-head { display: flex; align-items: center; margin-bottom: 14px; }
.section-head h2 { margin: 0; font-size: 15px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.count { font-size: 11px; color: var(--muted); background: var(--panel-2); border: 1px solid var(--line); padding: 0 6px; border-radius: 9px; line-height: 17px; font-weight: 500; }
.project-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(214px, 1fr)); gap: 16px; }
.project-card { position: relative; display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); overflow: visible; transition: border-color .15s, transform .15s; }
.project-card:hover { border-color: var(--line-2); }
.project-poster { position: relative; height: 168px; display: flex; align-items: center; justify-content: center; border: 0; padding: 12px; background: #0e100f; border-radius: 12px 12px 0 0; overflow: hidden; border-bottom: 1px solid var(--line); }
.poster-blur { position: absolute; inset: -20px; background-size: cover; background-position: center; filter: blur(22px) saturate(.8) brightness(.35); transform: scale(1.1); pointer-events: none; }
.poster-frame { position: relative; display: block; max-width: 100%; max-height: 100%; border-radius: 5px; overflow: hidden; background: #161a18; box-shadow: 0 6px 18px rgba(0, 0, 0, .4); }
.poster-frame img { width: 100%; height: 100%; object-fit: cover; display: block; }
.poster-empty { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; color: var(--faint); min-width: 60px; min-height: 60px; }
.poster-badge { position: absolute; top: 9px; left: 9px; font-size: 10.5px; padding: 1px 6px; border-radius: 4px; background: rgba(11, 13, 12, .8); border: 1px solid var(--line-2); color: var(--text-2); }
.project-meta { position: relative; padding: 11px 40px 13px 13px; }
.project-name { display: block; width: 100%; text-align: left; border: 0; background: transparent; padding: 0; font-weight: 700; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.project-name:hover { color: var(--accent); }
.rename-input { width: 100%; height: 26px; padding: 2px 6px; font-weight: 700; }
.project-sub { display: flex; align-items: center; gap: 6px; margin-top: 4px; color: var(--muted); font-size: 11.5px; white-space: nowrap; overflow: hidden; }
.dot-sep { width: 3px; height: 3px; border-radius: 50%; background: var(--faint); flex: none; }
.project-menu-btn { position: absolute; right: 6px; top: 9px; width: 28px; height: 28px; }
.project-meta .menu { right: 6px; top: 40px; }
.new-card { align-items: center; justify-content: center; gap: 10px; min-height: 224px; border-style: dashed; background: transparent; color: var(--muted); font-weight: 600; }
.new-card:hover { color: var(--text); border-color: var(--accent-line); }
.new-plus { width: 44px; height: 44px; border-radius: 12px; display: flex; align-items: center; justify-content: center; border: 1px solid var(--line-2); }
.new-card:hover .new-plus { color: var(--accent); border-color: var(--accent-line); }
.card-confirm { position: absolute; inset: 0; z-index: 5; border-radius: 12px; background: rgba(19, 22, 21, .96); border: 1px solid rgba(255, 90, 79, .35); padding: 18px; display: flex; flex-direction: column; justify-content: center; gap: 4px; }
.card-confirm p { margin: 0; }
.card-confirm .row { display: flex; gap: 8px; margin-top: 12px; }
.empty-projects { border: 1px dashed var(--line-2); border-radius: 12px; padding: 40px; display: flex; flex-direction: column; align-items: center; gap: 10px; color: var(--muted); text-align: center; }

/* ---------- editor layout ---------- */
.editor {
  height: 100%; display: grid;
  grid-template-columns: 300px minmax(380px, 1fr) 372px;
  grid-template-rows: 52px minmax(260px, 1fr) 286px;
  grid-template-areas: 'top top top' 'left center agent' 'bottom bottom agent';
}
.topbar { grid-area: top; display: flex; align-items: center; gap: 6px; padding: 0 12px 0 8px; border-bottom: 1px solid var(--line); background: var(--bg); min-width: 0; }
.topbar-mark { margin: 0 2px 0 4px; }
.project-title { min-width: 120px; max-width: min(420px, 32vw); text-overflow: ellipsis; height: 30px; border: 1px solid transparent; background: transparent; font-weight: 700; font-size: 14px; padding: 4px 8px; border-radius: 6px; }
.project-title:hover { border-color: var(--line); }
.project-title:focus { background: var(--bg); }
.aspect-menu { position: relative; }
.aspect-menu .menu { top: 34px; left: 0; min-width: 120px; }
.topbar-sep { width: 1px; height: 20px; background: var(--line); margin: 0 4px; }
.rev-tag { font-size: 11px; color: var(--faint); margin-left: 2px; }
.offline-chip { display: inline-flex; align-items: center; gap: 7px; height: 26px; padding: 0 10px; border-radius: 13px; font-size: 11.5px; font-weight: 600; color: #f3d68f; background: var(--warn-soft); border: 1px solid rgba(242, 193, 78, .4); margin-right: 6px; }
.lint-chip { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 9px; border-radius: 13px; font-size: 11.5px; font-weight: 600; background: transparent; border: 1px solid var(--line-2); margin-right: 4px; }
.lint-chip.has-warnings { color: var(--warn); border-color: rgba(242, 193, 78, .35); }
.lint-chip.has-errors { color: var(--danger); border-color: rgba(255, 90, 79, .4); }

.left { grid-area: left; display: flex; flex-direction: column; border-right: 1px solid var(--line); background: var(--panel); min-height: 0; }
.tabs { display: flex; gap: 2px; padding: 8px 8px 0; border-bottom: 1px solid var(--line); flex: none; }
.tabs button { height: 32px; padding: 0 12px; border: 0; background: transparent; color: var(--muted); font-weight: 650; font-size: 12.5px; border-bottom: 2px solid transparent; margin-bottom: -1px; display: inline-flex; align-items: center; gap: 7px; }
.tabs button:hover { color: var(--text-2); }
.tabs button.is-on { color: var(--text); border-bottom-color: var(--accent); }
.left-body { flex: 1; min-height: 0; overflow: auto; }

.center { grid-area: center; min-width: 0; min-height: 0; display: flex; background: var(--bg); }
.agent { grid-area: agent; display: flex; flex-direction: column; border-left: 1px solid var(--line); background: var(--panel); min-height: 0; }
.bottom { grid-area: bottom; min-width: 0; min-height: 0; border-top: 1px solid var(--line); background: var(--panel); }

/* ---------- media bin ---------- */
.bin { position: relative; min-height: 100%; padding: 10px; }
.bin.is-drag { background: #111710; }
.bin-actions { display: flex; gap: 6px; margin-bottom: 10px; }
.grow-btn { flex: 1; }
.bin-empty { border: 1px dashed var(--line-2); border-radius: 10px; padding: 26px 16px; text-align: center; color: var(--muted); display: flex; flex-direction: column; align-items: center; gap: 4px; }
.bin-empty p { margin: 4px 0 0; }
.bin-empty p:first-of-type { color: var(--text-2); font-weight: 600; }
.asset-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; }
.asset { display: flex; gap: 10px; padding: 7px; border-radius: 9px; border: 1px solid transparent; cursor: pointer; transition: background .1s; }
.asset:hover { background: var(--panel-2); }
.asset.is-selected { background: var(--panel-2); border-color: var(--accent-line); }
.asset-thumb { position: relative; width: 74px; height: 74px; flex: none; border-radius: 6px; background: #0d0f0e; border: 1px solid var(--line); overflow: hidden; display: flex; align-items: center; justify-content: center; color: var(--faint); }
.asset-thumb img { width: 100%; height: 100%; object-fit: cover; }
.asset-wave { position: absolute; inset: 14px 4px; background-size: 100% 100%; opacity: .9; }
.thumb-dur { position: absolute; right: 3px; bottom: 3px; font-size: 10px; padding: 0 4px; border-radius: 3px; background: rgba(11, 13, 12, .85); color: var(--text); }
.thumb-busy { position: absolute; top: 4px; right: 4px; }
.asset-body { display: flex; flex-direction: column; min-width: 0; flex: 1; gap: 3px; padding-top: 1px; }
.asset-name { font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.asset-meta { display: flex; gap: 7px; color: var(--muted); font-size: 11.5px; flex-wrap: wrap; }
.in-use { color: var(--accent); }
.asset-minwave { display: block; height: 12px; border-radius: 2px; background-size: 100% 100%; background-repeat: no-repeat; opacity: .5; filter: grayscale(1) brightness(1.15); }
.asset.is-selected .asset-minwave, .asset:hover .asset-minwave { opacity: .7; }
.missing-tag { display: inline-flex; align-items: center; gap: 3px; color: var(--danger); font-weight: 650; }
.asset.is-missing .asset-thumb { border-color: rgba(255, 90, 79, .5); }
.asset.is-missing .asset-thumb img { opacity: .35; filter: grayscale(1); }
.asset-row { display: flex; align-items: center; gap: 6px; margin-top: auto; }
.upload-row { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text-2); margin-bottom: 8px; }
.upload-row .ellipsis { flex: 1; }
.bar { display: block; flex: 1; height: 4px; border-radius: 2px; background: var(--line); overflow: hidden; }
.bar > span { display: block; height: 100%; background: var(--accent); transition: width .2s; }
.drop-overlay { position: absolute; inset: 6px; border: 1.5px dashed var(--accent); border-radius: 10px; background: rgba(11, 20, 8, .82); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; color: var(--accent); font-weight: 700; pointer-events: none; }

/* ---------- viewer ---------- */
.viewer { flex: 1; display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.viewer-head { display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 12px; flex: none; }
.viewer-meta { font-size: 11px; color: var(--faint); }
.program, .source-view { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.stage { position: relative; flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; padding: 6px 16px 10px; }
.frame { position: relative; max-width: 100%; max-height: 100%; border-radius: 4px; overflow: hidden; box-shadow: 0 0 0 1px var(--line), 0 18px 50px rgba(0, 0, 0, .5); background: #000; }
.frame video, .frame-img { width: 100%; height: 100%; display: block; object-fit: contain; background: #000; }
.frame-empty { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: #070808; }
.frame-poster { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .32; filter: saturate(.7); }
.frame-cta { position: relative; display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; padding: 16px; max-width: 260px; }
.frame-cta p { margin: 0; font-weight: 700; }
.audio-stage { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: #0a0c0b; color: var(--faint); }
.audio-wave { position: absolute; inset: 30% 6%; background-size: 100% 100%; }
.stale-badge { position: absolute; top: 14px; left: 50%; transform: translateX(-50%); display: inline-flex; align-items: center; gap: 8px; height: 28px; padding: 0 5px 0 11px; border-radius: 14px; border: 1px solid rgba(242, 193, 78, .4); background: rgba(30, 26, 14, .92); color: #f3d68f; font-size: 12px; font-weight: 600; z-index: 3; }
.stale-badge .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--warn); }
.stale-act { background: var(--warn); color: #1d1604; border-radius: 10px; padding: 1px 9px; font-weight: 700; }
.fresh-badge { position: absolute; top: 14px; right: 22px; font-size: 10.5px; color: var(--muted); background: rgba(11, 13, 12, .8); border: 1px solid var(--line); padding: 1px 6px; border-radius: 4px; }
.render-progress { position: absolute; left: 50%; bottom: 18px; transform: translateX(-50%); display: flex; align-items: center; gap: 9px; padding: 8px 12px; border-radius: 10px; background: rgba(19, 22, 21, .94); border: 1px solid var(--line-2); font-size: 12px; font-weight: 600; min-width: 280px; }
.render-progress .bar { min-width: 90px; }
.render-error { position: absolute; left: 50%; bottom: 18px; transform: translateX(-50%); padding: 8px 8px 8px 12px; border-radius: 10px; background: #2a1615; border: 1px solid rgba(255, 90, 79, .45); color: #ffc0bb; font-size: 12px; display: flex; gap: 8px; align-items: flex-start; max-width: 80%; z-index: 4; }
.render-error > .icon { margin-top: 2px; flex: none; }
.render-error .icon-btn { flex: none; color: #ffc0bb; }
.source-tag { position: absolute; top: 12px; left: 22px; display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--text-2); background: rgba(11, 13, 12, .85); border: 1px solid var(--line-2); border-radius: 12px; padding: 2px 4px 2px 9px; max-width: 70%; white-space: nowrap; overflow: hidden; }
.transport { display: flex; align-items: center; gap: 12px; height: 46px; padding: 0 16px; flex: none; border-top: 1px solid var(--line); }
.play-btn { width: 32px; height: 32px; border-radius: 50%; border: 1px solid var(--line-2); background: var(--panel-2); color: var(--text); display: inline-flex; align-items: center; justify-content: center; flex: none; }
.play-btn:hover { border-color: var(--accent-line); color: var(--accent); }
.tc { font-size: 12px; color: var(--muted); white-space: nowrap; }
.tc b { color: var(--text); font-weight: 500; }
.tc-sep { margin: 0 5px; color: var(--faint); }
.scrub { position: relative; flex: 1; height: 22px; cursor: pointer; touch-action: none; }
.scrub::before { content: ''; position: absolute; left: 0; right: 0; top: 10px; height: 3px; border-radius: 2px; background: var(--line-2); }
.scrub-fill { position: absolute; left: 0; top: 10px; height: 3px; border-radius: 2px; background: var(--accent); }
.scrub-knob { position: absolute; top: 5px; width: 12px; height: 12px; margin-left: -6px; border-radius: 50%; background: var(--text); box-shadow: 0 0 0 3px rgba(94, 255, 41, .25); }
.marks { display: flex; align-items: center; gap: 4px; }
.mark-range { font-size: 11px; color: var(--accent); margin-right: 4px; }

/* ---------- agent panel ---------- */
.panel-head { display: flex; align-items: center; gap: 8px; height: 41px; padding: 0 14px; border-bottom: 1px solid var(--line); flex: none; }
.panel-title { display: inline-flex; align-items: center; gap: 7px; font-weight: 700; }
.panel-title .icon { color: var(--accent); }
.model-chip { font-size: 10.5px; color: var(--muted); border: 1px solid var(--line); border-radius: 10px; padding: 1px 8px; white-space: nowrap; max-width: 210px; overflow: hidden; text-overflow: ellipsis; }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 0 rgba(94, 255, 41, .6); animation: pulse 1.4s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 7px rgba(94, 255, 41, 0); } 100% { box-shadow: 0 0 0 0 rgba(94, 255, 41, 0); } }
.agent-list { flex: 1; overflow: auto; padding: 14px 14px 8px; display: flex; flex-direction: column; gap: 18px; min-height: 0; }
.agent-intro { margin: auto 6px; text-align: left; color: var(--text-2); }
.agent-intro h3 { margin: 12px 0 6px; font-size: 16px; color: var(--text); letter-spacing: -0.01em; }
.agent-intro p { margin: 0 0 8px; font-size: 12.5px; color: var(--muted); }
.turn.is-undone { opacity: .55; }
.msg-user { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; margin-bottom: 10px; }
.bubble { max-width: 88%; padding: 9px 12px; border-radius: 12px 12px 3px 12px; background: var(--panel-3); border: 1px solid var(--line-2); white-space: pre-wrap; word-wrap: break-word; }
.msg-time { font-size: 10.5px; color: var(--faint); }
.msg-agent { display: flex; gap: 9px; }
.agent-avatar { width: 24px; height: 24px; flex: none; border-radius: 7px; border: 1px solid var(--line-2); background: var(--bg); display: flex; align-items: center; justify-content: center; }
.agent-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.rich p { margin: 0 0 6px; color: var(--text); }
.rich ul { margin: 0 0 6px; padding-left: 18px; }
.rich li { margin: 2px 0; }
.rich code, .rich b { font-weight: 700; }
.rich code { font-family: var(--mono); font-size: 12px; background: var(--bg); border: 1px solid var(--line); border-radius: 4px; padding: 0 4px; font-weight: 400; }
.plan { border: 1px solid var(--line-2); border-radius: 9px; background: var(--bg); padding: 9px 11px; }
.plan-head { display: flex; align-items: baseline; gap: 8px; margin-bottom: 6px; }
.plan-goal { font-weight: 700; flex: 1; font-size: 12.5px; }
.plan-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 5px; }
.plan-steps li { display: flex; gap: 8px; align-items: flex-start; font-size: 12.5px; color: var(--text-2); }
.step-box { width: 15px; height: 15px; flex: none; margin-top: 1px; border-radius: 4px; border: 1.5px solid var(--line-2); display: inline-flex; align-items: center; justify-content: center; }
.step-done { color: var(--muted) !important; }
.step-done span:last-child { text-decoration: line-through; text-decoration-color: var(--faint); }
.step-done .step-box { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.step-in_progress .step-box { border-color: var(--accent); }
.step-in_progress { color: var(--text) !important; }
.step-pulse { width: 5px; height: 5px; border-radius: 50%; background: var(--accent); animation: pulse 1.4s infinite; }
.step-skipped { opacity: .5; }
.tool-call { border: 1px solid var(--line); border-radius: 7px; background: var(--panel-2); overflow: hidden; }
.tool-call.is-bad { border-color: rgba(255, 90, 79, .35); }
.tool-call-head { width: 100%; display: flex; align-items: center; gap: 8px; height: 30px; padding: 0 9px; border: 0; background: transparent; text-align: left; font-size: 12px; }
.tool-call-head:hover { background: var(--panel-3); }
.tool-status { width: 16px; height: 16px; flex: none; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; }
.is-ok .tool-status { color: var(--accent); }
.is-unknown .tool-status { color: var(--muted); }
.is-bad .tool-status { color: var(--danger); }
.tool-name { font-weight: 650; white-space: nowrap; }
.tool-args { flex: 1; min-width: 0; color: var(--muted); font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tool-ms { font-size: 10.5px; color: var(--faint); }
.tool-caret { color: var(--faint); }
.tool-error { padding: 0 10px 7px 33px; color: #ff9a92; font-size: 11.5px; }
.tool-detail { border-top: 1px solid var(--line); padding: 8px 10px; background: var(--bg); }
.tool-detail pre { margin: 3px 0 8px; font-size: 11px; white-space: pre-wrap; word-break: break-word; color: var(--text-2); max-height: 220px; overflow: auto; }
.tool-detail pre.bad { color: #ff9a92; }
.detail-label { font-size: 10.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--faint); }
.detail-label.bad { color: var(--danger); }
.edit-row { display: flex; gap: 8px; align-items: baseline; font-size: 12px; color: var(--text-2); padding-left: 2px; }
.rev-chip { font-size: 10.5px; color: var(--accent); border: 1px solid var(--accent-line); border-radius: 4px; padding: 0 4px; flex: none; }
.warn-row { display: flex; gap: 7px; align-items: flex-start; font-size: 12px; color: #f3d68f; }
.error-row { display: flex; gap: 7px; align-items: flex-start; font-size: 12px; color: #ffb3ad; background: var(--danger-soft); border: 1px solid rgba(255, 90, 79, .35); border-radius: 7px; padding: 7px 9px; }
.warn-row .icon, .error-row .icon { margin-top: 2px; }
.note-row { font-size: 11.5px; color: var(--faint); font-style: italic; }
.stopped-row { display: flex; gap: 7px; align-items: center; font-size: 12px; color: var(--text-2); background: var(--panel-2); border: 1px solid var(--line-2); border-radius: 7px; padding: 6px 9px; }
.stopped-row .icon { color: var(--muted); flex: none; }
.thinking { display: flex; gap: 8px; align-items: center; color: var(--muted); font-size: 12px; }
.turn-foot { display: flex; align-items: center; gap: 8px; font-size: 11px; padding-top: 2px; }
.undone-tag { font-size: 11px; color: var(--muted); }
.composer { flex: none; padding: 8px 12px 10px; border-top: 1px solid var(--line); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.chip { height: 26px; padding: 0 10px; border-radius: 13px; border: 1px solid var(--line-2); background: transparent; color: var(--text-2); font-size: 11.5px; font-weight: 600; }
.chip:hover { border-color: var(--accent-line); color: var(--text); background: var(--accent-soft); }
.composer-box { position: relative; display: flex; align-items: flex-end; gap: 8px; border: 1px solid var(--line-2); border-radius: 11px; background: var(--bg); padding: 6px 6px 6px 4px; }
.composer-box:focus-within { border-color: var(--accent-line); }
.composer-box textarea { flex: 1; border: 0; background: transparent; padding: 4px 8px; box-shadow: none; max-height: 140px; }
.composer-btn { flex: none; }
.composer-hint { font-size: 10.5px; color: var(--faint); margin-top: 5px; padding-left: 3px; }

/* ---------- timeline ---------- */
.timeline { height: 100%; display: flex; flex-direction: column; }
.tl-toolbar { display: flex; align-items: center; gap: 10px; height: 38px; padding: 0 10px; border-bottom: 1px solid var(--line); flex: none; }
.tl-tools { display: flex; gap: 2px; }
.tool-btn { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 9px; border: 1px solid transparent; border-radius: 6px; background: transparent; color: var(--text-2); font-size: 12px; font-weight: 600; }
.tool-btn:hover:not(:disabled) { background: var(--panel-2); border-color: var(--line); color: var(--text); }
.tool-btn:disabled { opacity: .35; }
.tl-time { flex: 1; text-align: center; font-size: 12px; color: var(--muted); }
.tc-now { color: var(--accent); }
.tl-zoom { display: flex; align-items: center; gap: 4px; }
.tl-zoom input[type=range] { width: 110px; }
.tl-scroll { flex: 1; overflow: auto; position: relative; min-height: 0; }
.tl-content { position: relative; display: flex; }
.tl-heads { position: sticky; left: 0; z-index: 6; width: 96px; flex: none; background: var(--panel); border-right: 1px solid var(--line); }
.tl-head-ruler { border-bottom: 1px solid var(--line); background: var(--panel); position: sticky; top: 0; }
.tl-head { display: flex; align-items: center; gap: 7px; padding: 0 12px; color: var(--muted); font-size: 11.5px; font-weight: 650; border-bottom: 1px solid var(--line); }
.head-text .icon { color: var(--t-text); }
.head-captions .icon { color: var(--t-cap); }
.head-overlay .icon { color: var(--t-ov); }
.head-main .icon { color: var(--text-2); }
.head-audio .icon { color: var(--t-au); }
.tl-body { position: relative; flex: none; }
.ruler { position: relative; overflow: hidden; border-bottom: 1px solid var(--line); background: var(--panel); cursor: ew-resize; touch-action: none; user-select: none; }
.tick { position: absolute; bottom: 0; width: 1px; height: 5px; background: var(--line-2); }
.tick.major { height: 10px; background: #4a514c; }
.tick-label { position: absolute; bottom: 11px; left: 4px; font-size: 10px; color: var(--muted); white-space: nowrap; }
.tick:first-child .tick-label { left: 9px; }
.lane { position: relative; border-bottom: 1px solid var(--line); background: #101312; }
.lane-main { background: #0e1110; }
.clip { position: absolute; top: 3px; bottom: 3px; border-radius: 5px; overflow: hidden; cursor: grab; user-select: none; touch-action: none; border: 1px solid transparent; }
.clip:active { cursor: grabbing; }
.clip.is-selected { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent), 0 0 14px rgba(94, 255, 41, .25); z-index: 3; }
.clip.is-ghost { opacity: .75; z-index: 4; box-shadow: 0 10px 24px rgba(0, 0, 0, .6); }
.clip-label { position: absolute; left: 6px; right: 6px; top: 50%; transform: translateY(-50%); display: flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 650; white-space: nowrap; overflow: hidden; pointer-events: none; }
.clip-name { overflow: hidden; text-overflow: ellipsis; min-width: 28px; flex: 0 1 auto; }
.clip-dur { font-size: 10px; font-weight: 400; opacity: .75; flex: none; }
.clip-flag { font-size: 9.5px; font-weight: 700; padding: 0 4px; border-radius: 3px; background: rgba(0, 0, 0, .35); flex: none; text-transform: uppercase; letter-spacing: .04em; }
.clip-main .clip-flag { background: rgba(10, 12, 11, .72); }
.clip-missing { color: #ffb1aa; background: rgba(120, 20, 14, .85) !important; }
.clip-main.is-missing .clip-strip { opacity: .3; filter: grayscale(1); }
.clip-main.is-missing { border-color: rgba(255, 90, 79, .6); background: repeating-linear-gradient(135deg, #2a1513 0 6px, #1d1110 6px 12px); }
.clip-main { background: #1d2320; border-color: #2d3430; }
.clip-main .clip-strip { position: absolute; left: 0; right: 0; top: 0; height: 44px; overflow: hidden; background: #151917; }
.clip-main .tiles { position: absolute; inset: 0; }
.clip-main .tile { position: absolute; top: 0; height: 100%; background-repeat: no-repeat; border-right: 1px solid rgba(0, 0, 0, .35); }
.clip-main .clip-fill { position: absolute; inset: 0; background-size: cover; background-position: center; opacity: .85; }
.clip-main .clip-wave { position: absolute; left: 0; right: 0; bottom: 0; height: 15px; background: #121614; border-top: 1px solid rgba(0, 0, 0, .4); }
.clip-main .wave { position: absolute; inset: 1px 0; opacity: .55; filter: grayscale(1) brightness(1.1); }
.clip-main.is-selected .wave { opacity: .8; }
.clip-main .clip-label { top: 4px; transform: none; right: 6px; }
.clip-main .clip-label > * { text-shadow: 0 1px 2px rgba(0, 0, 0, .9); }
.clip-main .clip-name { background: rgba(10, 12, 11, .72); padding: 1px 5px; border-radius: 3px; }
.clip-main .clip-dur { background: rgba(10, 12, 11, .72); padding: 1px 4px; border-radius: 3px; opacity: 1; }
.clip-main.is-muted .clip-wave { opacity: .3; }
.tr-badge { color: var(--accent); font-size: 9px; flex: none; text-shadow: none !important; }
.clip-overlap { position: absolute; left: 0; top: 0; bottom: 0; background: repeating-linear-gradient(135deg, rgba(94, 255, 41, .25) 0 4px, transparent 4px 8px); pointer-events: none; }
.clip-text { background: var(--t-text-bg); border-color: #3a3157; color: #ddd4ff; }
.clip-overlay { background: var(--t-ov-bg); border-color: #2a3d57; color: #d2e5ff; }
.clip-overlay .clip-fill { position: absolute; inset: 0; background-size: auto 100%; background-repeat: repeat-x; opacity: .35; }
.clip-audio { background: var(--t-au-bg); border-color: #4a3a20; color: #f7dcb0; }
.clip-audio .clip-name, .clip-overlay .clip-name { background: rgba(14, 12, 9, .78); padding: 1px 5px; border-radius: 3px; }
.clip-overlay .clip-name { background: rgba(9, 14, 22, .78); }
.clip.is-narrow .clip-flag, .clip.is-narrow .clip-dur, .clip.is-narrow .tr-badge { display: none; }
.clip-audio .wave-audio { position: absolute; inset: 3px 0; opacity: .55; filter: sepia(1) saturate(2.5) hue-rotate(-10deg) brightness(1.1); }
.cue { position: absolute; top: 4px; bottom: 4px; border-radius: 4px; background: var(--t-cap-bg); border: 1px solid #2c4429; color: #cbeec0; font-size: 10.5px; font-weight: 600; padding: 0 5px; line-height: 20px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; }
.cue.is-selected { border-color: var(--accent-line); }
.lane-hint { position: absolute; left: 8px; top: 4px; bottom: 4px; display: inline-flex; align-items: center; gap: 5px; padding: 0 9px; border-radius: 5px; border: 1px dashed var(--line-2); background: transparent; color: var(--muted); font-size: 11px; font-weight: 600; }
.lane-hint:hover { color: var(--text); border-color: var(--accent-line); }
.lane-note { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); font-size: 11px; color: var(--faint); white-space: nowrap; cursor: pointer; }
.main-empty { cursor: default; }
.edge { position: absolute; top: 0; bottom: 0; width: 7px; cursor: ew-resize; z-index: 2; }
.edge-l { left: 0; }
.edge-r { right: 0; }
.clip:hover .edge::after, .clip.is-selected .edge::after { content: ''; position: absolute; top: 25%; bottom: 25%; width: 3px; border-radius: 2px; background: rgba(237, 239, 236, .7); }
.edge-l::after { left: 2px; }
.edge-r::after { right: 2px; }
.drag-tip { position: absolute; right: 4px; bottom: 3px; font-size: 10px; background: rgba(0, 0, 0, .8); color: var(--accent); padding: 0 4px; border-radius: 3px; pointer-events: none; z-index: 5; }
.insert-marker { position: absolute; top: -2px; bottom: -2px; width: 2px; margin-left: -1px; background: var(--accent); box-shadow: 0 0 8px var(--accent); z-index: 5; }
.tl-end { position: absolute; top: 0; width: 1px; background: rgba(237, 239, 236, .12); pointer-events: none; }
.playhead { position: absolute; top: 0; width: 1px; margin-left: -0.5px; background: var(--accent); z-index: 8; pointer-events: none; box-shadow: 0 0 6px rgba(94, 255, 41, .6); }
.playhead-knob { position: absolute; top: 2px; left: -6px; width: 13px; height: 16px; background: var(--accent); clip-path: polygon(0 0, 100% 0, 100% 60%, 50% 100%, 0 60%); pointer-events: auto; cursor: ew-resize; }

/* ---------- inspector ---------- */
.inspector { padding: 12px 12px 30px; }
.insp-title { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 13.5px; margin: 2px 0 2px; }
.insp-title span:nth-child(2) { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.insp-title .mono { font-size: 11px; font-weight: 400; }
.insp-sub { font-size: 11px; color: var(--muted); margin-bottom: 4px; padding-left: 24px; }
.insp-section { border-top: 1px solid var(--line); padding: 10px 0 8px; margin-top: 10px; }
.insp-section-head { display: flex; align-items: center; margin-bottom: 6px; }
.insp-section-head h4 { margin: 0; font-size: 10.5px; text-transform: uppercase; letter-spacing: .09em; color: var(--muted); font-weight: 700; }
.insp-row { display: grid; grid-template-columns: 78px 1fr; align-items: center; gap: 8px; min-height: 32px; }
.insp-label { color: var(--text-2); font-size: 12px; }
.insp-ctl { min-width: 0; display: flex; align-items: center; }
.insp-ctl select, .insp-ctl input[type=text] { width: 100%; height: 28px; padding-top: 3px; padding-bottom: 3px; font-size: 12px; }
.insp-hint { grid-column: 2; font-size: 11px; color: var(--muted); }
.insp-note { color: var(--muted); font-size: 12px; margin: 4px 0; }
.insp-note.ok { color: var(--accent); display: flex; gap: 6px; align-items: center; }
.inspector textarea { width: 100%; font-size: 13px; margin-bottom: 4px; }
.insp-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; }
.insp-actions.left { justify-content: flex-start; flex-wrap: wrap; }
.num-field { display: inline-flex; align-items: center; width: 100%; border: 1px solid var(--line-2); border-radius: 6px; background: var(--bg); height: 28px; }
.num-field:focus-within { border-color: var(--accent-line); }
.num-field input { flex: 1; min-width: 0; border: 0; background: transparent; height: 26px; padding: 0 8px; font-size: 12px; box-shadow: none !important; }
.num-field input::-webkit-inner-spin-button { opacity: .4; }
.suffix { font-size: 11px; color: var(--faint); padding-right: 8px; }
.slider { display: flex; align-items: center; gap: 8px; width: 100%; }
.slider input { flex: 1; min-width: 0; }
.slider-val { font-size: 11px; color: var(--text-2); width: 40px; text-align: right; }
input[type=range] { -webkit-appearance: none; appearance: none; height: 18px; background: transparent; }
input[type=range]::-webkit-slider-runnable-track { height: 3px; border-radius: 2px; background: var(--line-2); }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 13px; height: 13px; margin-top: -5px; border-radius: 50%; background: var(--text); border: 0; box-shadow: 0 0 0 3px rgba(94, 255, 41, .18); }
input[type=range]:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 3px var(--accent); }
.switch { position: relative; display: inline-flex; align-items: center; gap: 8px; border: 0; background: transparent; padding: 0; }
.switch .knob { position: relative; width: 30px; height: 17px; border-radius: 9px; background: var(--line-2); transition: background .15s; flex: none; }
.switch .knob::after { content: ''; position: absolute; left: 2px; top: 2px; width: 13px; height: 13px; border-radius: 50%; background: #c9cec9; transition: transform .15s, background .15s; }
.switch.on .knob { background: var(--accent); }
.switch.on .knob::after { transform: translateX(13px); background: var(--accent-ink); }
.switch-label { font-size: 12px; color: var(--muted); }
.color-field { display: inline-flex; align-items: center; gap: 8px; }
.color-field input[type=color] { width: 26px; height: 22px; border: 1px solid var(--line-2); border-radius: 5px; background: transparent; padding: 0; cursor: pointer; }
.color-field input[type=color]::-webkit-color-swatch-wrapper { padding: 2px; }
.color-field input[type=color]::-webkit-color-swatch { border: 0; border-radius: 3px; }
.color-field .mono { font-size: 11px; color: var(--muted); }
.row-inline { display: inline-flex; align-items: center; gap: 10px; }
.effects { display: grid; gap: 4px; }
.effect { border: 1px solid transparent; border-radius: 7px; padding: 3px 6px; }
.effect.on { border-color: var(--line); background: var(--panel-2); padding-bottom: 6px; }
.effect-head { display: flex; align-items: center; gap: 9px; min-height: 26px; }
.effect-name { font-size: 12px; color: var(--text-2); }
.effect.on .effect-name { color: var(--text); font-weight: 600; }
.effect-params { padding-left: 4px; }
.corrections { display: grid; gap: 4px; }
.corr-row { display: flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--text-2); }
.corr-add { display: grid; grid-template-columns: 1fr 1fr auto; gap: 5px; margin-top: 4px; }
.corr-add input { height: 28px; font-size: 12px; min-width: 0; }
.asset-facts { display: grid; grid-template-columns: 64px 1fr; gap: 5px 10px; margin: 12px 0; font-size: 12px; }
.asset-facts dt { color: var(--muted); }
.asset-facts dd { margin: 0; color: var(--text-2); min-width: 0; }
.transcript-text { font-size: 12px; color: var(--text-2); line-height: 1.6; max-height: 260px; overflow: auto; margin: 0; }
.lint-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 7px; }
.lint-list li { display: grid; grid-template-columns: 14px 1fr auto; gap: 8px; align-items: flex-start; font-size: 12px; }
.lint-list .icon { margin-top: 2px; }
.lint-error .icon { color: var(--danger); }
.lint-warning .icon { color: var(--warn); }
.lint-msg { display: block; color: var(--text-2); }
.lint-fix { display: block; color: var(--muted); font-size: 11px; }

/* ---------- export ---------- */
.choice-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.choice { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 11px 12px; border-radius: 9px; border: 1px solid var(--line); background: var(--panel-2); text-align: left; }
.choice:hover { border-color: var(--line-2); }
.choice.is-selected { border-color: var(--accent-line); background: #141c12; }
.choice-title { font-weight: 750; font-size: 14px; }
.choice-sub { font-size: 11px; color: var(--text-2); }
.choice-hint { font-size: 11px; color: var(--muted); }
.export-progress { padding: 22px 18px 18px; }
.big-progress { height: 8px; border-radius: 4px; background: var(--line); overflow: hidden; }
.big-progress span { display: block; height: 100%; background: var(--accent); box-shadow: 0 0 12px rgba(94, 255, 41, .5); transition: width .25s; }
.progress-line { display: flex; align-items: center; gap: 9px; margin-top: 12px; font-weight: 600; }
.row-end { display: flex; justify-content: flex-end; margin-top: 16px; }
.export-done { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.export-player { width: 100%; max-height: 360px; background: #000; border-radius: 8px; border: 1px solid var(--line); }
.file-name { font-size: 12.5px; color: var(--text); word-break: break-all; margin-bottom: 4px; }
.verify { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 12px; font-size: 12px; font-weight: 600; }
.verify.ok { color: var(--accent); }
.verify.bad { color: var(--warn); }
.export-facts { display: grid; grid-template-columns: 70px 1fr; gap: 5px 10px; margin: 12px 0 0; font-size: 12px; }
.export-facts dt { color: var(--muted); }
.export-facts dd { margin: 0; color: var(--text-2); min-width: 0; overflow-wrap: anywhere; }
.verify-issues { margin: 8px 0 0; padding-left: 18px; color: var(--muted); font-size: 12px; }

/* ---------- history ---------- */
.history-list { flex: 1; overflow: auto; padding: 0 10px 20px; }
.history-item { display: grid; grid-template-columns: 38px 54px 1fr auto auto; gap: 8px; align-items: center; padding: 9px 8px; border-radius: 7px; font-size: 12px; }
.history-item:hover { background: var(--panel-2); }
.history-item.is-current { background: #141c12; box-shadow: inset 2px 0 0 var(--accent); }
.history-item .rev { color: var(--muted); font-size: 11px; }
.actor { font-size: 10.5px; font-weight: 700; padding: 1px 6px; border-radius: 4px; text-align: center; border: 1px solid var(--line-2); color: var(--text-2); }
.actor-agent { color: var(--accent); border-color: var(--accent-line); }
.actor-undo, .actor-redo { color: var(--muted); }
.history-summary { color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.history-time { font-size: 10.5px; color: var(--text-2); text-align: right; line-height: 1.3; }
.current-tag { font-size: 10.5px; color: var(--accent); font-weight: 700; }

/* ---------- small screens ---------- */
@media (max-width: 1180px) {
  .editor { grid-template-columns: 260px minmax(320px, 1fr) 320px; }
  /* keep the timeline toolbar on one line next to a 320 px agent panel */
  .tl-toolbar { gap: 6px; }
  .tool-btn kbd { display: none; }
  .tool-btn { padding: 0 7px; }
  .tl-zoom input[type=range] { width: 72px; }
}
@media (max-width: 900px) {
  body { overflow: auto; }
  .editor { height: auto; grid-template-columns: 1fr; grid-template-rows: 52px auto 380px 320px auto; grid-template-areas: 'top' 'center' 'left' 'bottom' 'agent'; }
  .agent { min-height: 480px; }
  .aspect-picker { grid-template-columns: repeat(2, 1fr); }
  .dash-main { padding: 24px 16px 40px; }
  .dash-top { padding: 0 16px; }
  .qs-bar { flex-wrap: wrap; }
  .export-done { grid-template-columns: 1fr; }
}

/* ---------- round 2: replies, undo conflicts, overlay framing, cards ---------- */
.rich ol { margin: 0 0 6px; padding-left: 20px; }
.rich strong { font-weight: 700; color: var(--text); }

.undo-conflict { margin-top: 8px; padding: 9px 10px; border: 1px solid rgba(242, 193, 78, .35); background: var(--warn-soft); border-radius: 8px; font-size: 12px; color: #f3d68f; }
.undo-conflict-msg { display: flex; gap: 7px; align-items: flex-start; }
.undo-conflict-msg .icon { flex: none; margin-top: 2px; }
.undo-conflict-msg b { color: #ffe3a3; }
.undo-conflict-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 6px; margin-top: 8px; }

.insp-reset { margin-left: auto; }
.framing { position: relative; max-width: 100%; margin: 2px auto 8px; border-radius: 6px; overflow: hidden; background: var(--bg); border: 1px solid var(--line-2); user-select: none; touch-action: none; }
.framing > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: fill; filter: saturate(.8); }
.framing-none { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: var(--faint); }
.framing-win { position: absolute; box-shadow: 0 0 0 999px rgba(6, 8, 7, .66); outline: 1.5px solid var(--accent); outline-offset: -1px; border-radius: 2px; }
.framing-win.can-pan { cursor: grab; }
.framing-win.is-drag { cursor: grabbing; }

.modal-card { width: 720px; }
.card-body { display: grid; grid-template-columns: 1fr 210px; gap: 22px; align-items: start; padding-top: 6px; }
.card-form .field { margin-bottom: 15px; }
.modal-card .seg button { text-transform: none; }
.card-form .field input[type=text] { height: 36px; font-size: 13px; }
.card-form .num-field { height: 32px; width: 96px; }
.card-form .num-field input { height: 30px; font-size: 13px; }
.field-row { display: flex; gap: 14px; align-items: flex-start; }
.field-row .field.grow { flex: 1; min-width: 0; }
.field-hint { font-size: 11.5px; color: var(--muted); }
.swatches { display: flex; gap: 8px; align-items: center; }
.swatch { position: relative; width: 34px; height: 34px; padding: 3px; border-radius: 9px; border: 1px solid var(--line-2); background: transparent; display: inline-flex; cursor: pointer; }
.swatch > span { flex: 1; border-radius: 6px; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .12); }
.swatch.is-on { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.swatch-custom input[type=color] { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; cursor: pointer; border: 0; padding: 0; }
.swatch-custom::after { content: '+'; position: absolute; right: -4px; bottom: -5px; width: 14px; height: 14px; border-radius: 7px; background: var(--panel-3); border: 1px solid var(--line-2); color: var(--text-2); font-size: 11px; line-height: 12px; text-align: center; pointer-events: none; }
.card-preview-wrap { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.card-preview { max-width: 100%; border-radius: 8px; border: 1px solid var(--line-2); display: flex; align-items: center; justify-content: center; padding: 10%; overflow: hidden; }
.card-preview-text { font-weight: 800; font-size: 19px; line-height: 1.12; text-align: center; letter-spacing: -0.01em; overflow-wrap: anywhere; }
@media (max-width: 760px) { .card-body { grid-template-columns: 1fr; } }

/* ---------- recipes: shared top bar ---------- */
.logo-link { display: inline-flex; color: inherit; text-decoration: none; border-radius: 6px; }
.dash-nav { display: inline-flex; gap: 2px; margin-left: 22px; padding: 3px; border: 1px solid var(--line); border-radius: 9px; background: var(--panel); }
.dash-nav a { display: inline-flex; align-items: center; gap: 7px; height: 28px; padding: 0 12px; border-radius: 6px; color: var(--muted); text-decoration: none; font-weight: 650; font-size: 12.5px; }
.dash-nav a:hover { color: var(--text); }
.dash-nav a.is-on { background: var(--panel-3); color: var(--text); box-shadow: inset 0 0 0 1px var(--line-2); }
.dash-nav a.is-on .icon { color: var(--accent); }

/* ---------- recipes: category chips ---------- */
.rchips { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 22px; }
.rchip { --h: 96; display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 11px; border-radius: 15px; border: 1px solid var(--line-2); background: var(--panel); color: var(--text-2); font-weight: 600; font-size: 12.5px; text-decoration: none; white-space: nowrap; transition: background .12s, border-color .12s, color .12s; }
.rchip .icon { color: hsl(var(--h) 50% 68%); }
.rchip:hover { border-color: #3d443f; color: var(--text); background: var(--panel-2); }
.rchip.is-on { background: var(--accent-soft); border-color: var(--accent-line); color: var(--text); }
.rchip.is-on .icon { color: var(--accent); }
.rchip-count { font-size: 10.5px; color: var(--muted); }
.rchips-sm { margin-bottom: 14px; }
.rchips-sm .rchip { height: 26px; padding: 0 9px; font-size: 12px; }

/* ---------- recipes: cards and posters ---------- */
.recipe-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(196px, 1fr)); gap: 16px; }
.recipe-card { display: flex; flex-direction: column; min-width: 0; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); color: inherit; text-decoration: none; overflow: hidden; transition: border-color .15s, transform .15s, box-shadow .15s; }
.recipe-card:hover { border-color: var(--line-2); transform: translateY(-2px); box-shadow: 0 14px 34px rgba(0, 0, 0, .38); }
.recipe-card:hover .recipe-name { color: var(--accent); }
.recipe-card:focus-visible { outline-offset: 3px; border-radius: 12px; }
.recipe-poster { position: relative; height: 204px; display: block; background: #0e100f; border-bottom: 1px solid var(--line); overflow: hidden; }
.recipe-card.is-compact .recipe-poster { height: 176px; }
.rposter { --h: 96; position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; padding: 14px; }
.rposter .poster-frame video { width: 100%; height: 100%; object-fit: cover; display: block; background: #000; }
.ph-frame { position: relative; container-type: size; --gx: 100%; --gy: 0%;
  background:
    radial-gradient(130% 85% at var(--gx) var(--gy), hsl(var(--h) 55% 32% / .55), transparent 62%),
    linear-gradient(168deg, hsl(var(--h) 22% 15%), hsl(var(--h) 14% 8%) 78%);
  box-shadow: inset 0 0 0 1px hsl(var(--h) 35% 45% / .28), 0 6px 18px rgba(0, 0, 0, .4); }
.ph-frame[data-corner="1"] { --gx: 0%; --gy: 0%; }
.ph-frame[data-corner="2"] { --gx: 100%; --gy: 100%; }
.ph-frame[data-corner="3"] { --gx: 0%; --gy: 100%; }
.ph-glow { position: absolute; left: -30%; right: -30%; bottom: -55%; height: 80%; background: radial-gradient(closest-side, hsl(var(--h) 60% 45% / .18), transparent); pointer-events: none; }
.ph-dots { position: absolute; inset: 0; background-image: radial-gradient(hsl(var(--h) 40% 85% / .11) 1px, transparent 1.3px); background-size: 9px 9px;
  -webkit-mask-image: linear-gradient(180deg, #000 0%, transparent 80%); mask-image: linear-gradient(180deg, #000 0%, transparent 80%); pointer-events: none; }
.ph-icon { position: absolute; left: 9%; top: 7%; width: 26px; height: 26px; border-radius: 7px; display: flex; align-items: center; justify-content: center; color: hsl(var(--h) 70% 76%); background: hsl(var(--h) 40% 50% / .15); border: 1px solid hsl(var(--h) 50% 62% / .28); }
.ph-aspect { position: absolute; right: 9%; top: 9%; font-size: 9.5px; color: hsl(var(--h) 25% 72% / .75); }
.ph-name { position: absolute; left: 9%; right: 9%; bottom: 8%; font-weight: 800; letter-spacing: -0.03em; line-height: 1.04; color: #f3f5f2; font-size: clamp(10.5px, min(14cqw, 15cqh), 34px); hyphens: auto; -webkit-hyphens: auto; overflow-wrap: break-word; text-wrap: balance; text-shadow: 0 1px 12px rgba(0, 0, 0, .35);
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; padding-bottom: .04em; }
.rposter.is-big .ph-icon { width: 40px; height: 40px; border-radius: 11px; }
.rposter.is-big .ph-aspect { font-size: 12px; }
.gen-badge { position: absolute; top: 9px; right: 9px; z-index: 1; display: inline-flex; align-items: center; gap: 3px; height: 19px; padding: 0 6px; border-radius: 5px; font-size: 10px; font-weight: 700; letter-spacing: .04em; color: var(--accent); background: rgba(11, 13, 12, .84); border: 1px solid var(--accent-line); }
.ok-badge { position: absolute; bottom: 9px; right: 9px; z-index: 1; width: 19px; height: 19px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: var(--accent); color: var(--accent-ink); }
.recipe-meta { display: flex; flex-direction: column; gap: 5px; padding: 11px 13px 13px; min-width: 0; }
.recipe-name { font-weight: 700; font-size: 13.5px; letter-spacing: -0.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: color .12s; }
.recipe-sub { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 11.5px; white-space: nowrap; overflow: hidden; }
.cat-tag { --h: 96; display: inline-flex; align-items: center; gap: 5px; color: hsl(var(--h) 45% 72%); font-weight: 650; font-size: 11.5px; white-space: nowrap; }
.recipe-summary { color: var(--muted); font-size: 12px; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* ---------- recipes: gallery page ---------- */
.recipes-page { max-width: 1180px; margin: 0 auto; }
.rp-head { display: flex; align-items: flex-end; gap: 24px; margin-bottom: 18px; flex-wrap: wrap; }
.rp-title { flex: 1 1 420px; }
.rp-title h1 { margin: 0 0 6px; font-size: 28px; font-weight: 800; letter-spacing: -0.035em; }
.rp-title p { margin: 0; color: var(--muted); font-size: 14px; max-width: 580px; }
.search-box { display: flex; align-items: center; gap: 8px; width: 320px; max-width: 100%; height: 38px; padding: 0 9px 0 12px; border: 1px solid var(--line-2); border-radius: 10px; background: var(--panel); color: var(--muted); cursor: text; transition: border-color .12s, box-shadow .12s; }
.search-box:focus-within { border-color: var(--accent-line); box-shadow: 0 0 0 3px rgba(94, 255, 41, .08); }
.search-box input[type=text] { flex: 1; min-width: 0; height: 100%; border: 0; background: transparent; padding: 0; font-size: 13.5px; box-shadow: none; }
.rcat { margin: 4px 0 34px; }
.rcat-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.rcat-head h2 { margin: 0; font-size: 16px; font-weight: 750; letter-spacing: -0.02em; }
.rcat-icon { --h: 96; width: 28px; height: 28px; border-radius: 8px; display: flex; align-items: center; justify-content: center; color: hsl(var(--h) 60% 74%); background: hsl(var(--h) 40% 50% / .12); border: 1px solid hsl(var(--h) 45% 55% / .24); }
.rcat-blurb { color: var(--muted); font-size: 12.5px; margin-left: 4px; }

/* ---------- recipes: dashboard strip ---------- */
.recipe-strip { max-width: 1120px; margin: 0 auto 40px; }
.recipe-strip .section-head h2 .icon { color: var(--accent); }
.strip-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); }
@media (max-width: 1100px) { .strip-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } .strip-grid > :nth-child(n+5) { display: none; } }
@media (max-width: 700px) { .strip-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .strip-grid > :nth-child(n+3) { display: none; } }
.recipe-badge { --h: 96; position: absolute; left: 9px; bottom: 9px; max-width: calc(100% - 18px); display: inline-flex; align-items: center; gap: 5px; height: 20px; padding: 0 7px; border-radius: 5px; font-size: 10.5px; font-weight: 650; color: hsl(var(--h) 50% 80%); background: rgba(11, 13, 12, .86); border: 1px solid hsl(var(--h) 40% 50% / .4); }

/* ---------- recipes: a recipe and its form ---------- */
.recipe-page { max-width: 1180px; margin: 0 auto; }
.back-link { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); text-decoration: none; font-weight: 600; font-size: 12.5px; margin-bottom: 18px; }
.back-link:hover { color: var(--text); }
.rpage { display: grid; grid-template-columns: minmax(280px, 420px) minmax(0, 1fr); gap: 44px; align-items: start; }
.rpage-media { position: sticky; top: 0; }
.rpage-poster { position: relative; height: min(66vh, 620px); min-height: 360px; border-radius: 14px; border: 1px solid var(--line); background: #0e100f; overflow: hidden; }
.rpage-poster .rposter { padding: 24px; }
.rpage-media > p { margin: 10px 2px 0; }
.rpage-body { min-width: 0; max-width: 720px; }
.rpage-body h1 { margin: 12px 0 8px; font-size: 32px; font-weight: 800; letter-spacing: -0.04em; line-height: 1.08; }
.rpage-body .lede { margin: 0 0 18px; color: var(--text-2); font-size: 15px; line-height: 1.55; }
.rfacts { margin: 0 0 16px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); }
.rfacts > div { display: grid; grid-template-columns: 160px minmax(0, 1fr); gap: 12px; padding: 9px 14px; border-top: 1px solid var(--line); }
.rfacts > div:first-child { border-top: 0; }
.rfacts dt { color: var(--muted); font-size: 12px; font-weight: 600; }
.rfacts dd { margin: 0; color: var(--text-2); font-size: 12.5px; }
.gen-inline { display: inline-flex; align-items: center; gap: 5px; color: var(--text); }
.gen-inline .icon { color: var(--accent); }
.form-title { margin: 30px 0 14px; font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 700; }
.rform { display: flex; flex-direction: column; gap: 18px; }
.rfield { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.rfield-head { display: flex; align-items: baseline; gap: 8px; }
.rfield-label { font-weight: 700; font-size: 13.5px; color: var(--text); }
.opt { font-size: 11px; color: var(--faint); font-weight: 600; }
.need { font-size: 11.5px; color: var(--muted); white-space: nowrap; font-feature-settings: 'tnum' 1; }
.need.is-met { color: var(--accent); }
.need.is-over { color: var(--warn); }
.rfield-hint { margin: 0 0 2px; color: var(--muted); font-size: 12px; line-height: 1.45; }
.rfield input[type=text], .rfield textarea { width: 100%; font-size: 14px; }
.rfield input[type=text] { height: 40px; }
.rfield textarea { min-height: 96px; resize: vertical; }
.rfield.has-error input[type=text], .rfield.has-error textarea, .rfield.has-error .dropzone { border-color: rgba(255, 90, 79, .55); }
.rfield-error { margin: 2px 0 0; color: #ff9b94; font-size: 12px; display: flex; align-items: center; gap: 6px; }
.rfield-control { display: flex; gap: 8px; align-items: stretch; }
.rswatch-input { width: 42px; height: 40px; padding: 3px; border: 1px solid var(--line-2); border-radius: var(--r-sm); background: var(--bg); flex: none; cursor: pointer; }
.rswatches { display: flex; gap: 6px; }
.rswatch { width: 18px; height: 18px; border-radius: 5px; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .16); }
.dropzone { border: 1px dashed var(--line-2); border-radius: 10px; background: var(--panel); padding: 8px; transition: border-color .12s, background .12s; }
.dropzone.is-drag { border-color: var(--accent); border-style: dashed; background: #121a10; }
.dz-row { position: relative; display: flex; align-items: center; gap: 10px; min-height: 42px; padding: 2px 4px; color: var(--muted); font-size: 12.5px; }
.dz-icon { width: 32px; height: 32px; border-radius: 8px; display: flex; align-items: center; justify-content: center; background: var(--panel-2); border: 1px solid var(--line); color: var(--text-2); flex: none; }
.dz-input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; left: 0; top: 0; }
.rfiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 6px; }
.dropzone.has-files .rfiles { margin-bottom: 6px; }
.rfile { display: flex; align-items: center; gap: 9px; padding: 5px; border: 1px solid var(--line-2); border-radius: 8px; background: var(--panel-2); min-width: 0; }
.rfile.is-error { border-color: rgba(255, 90, 79, .45); background: var(--danger-soft); }
.rfile-thumb { width: 38px; height: 38px; border-radius: 6px; flex: none; overflow: hidden; display: flex; align-items: center; justify-content: center; background: #0e100f; color: var(--muted); }
.rfile-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.rfile-body { display: flex; flex-direction: column; gap: 3px; min-width: 0; flex: 1; }
.rfile-name { font-size: 12.5px; font-weight: 600; }
.rfile-meta { font-size: 10.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rfile.is-error .rfile-meta { color: #ffb3ad; white-space: normal; }
.rfile .bar { flex: none; height: 3px; }
.start-bar { display: flex; align-items: center; gap: 16px; margin-top: 4px; padding-top: 18px; border-top: 1px solid var(--line); }
.btn-lg { height: 42px; padding: 0 22px; font-size: 14.5px; border-radius: 9px; flex: none; }
.start-note { color: var(--muted); font-size: 12px; line-height: 1.5; }
.disclose { display: inline-flex; align-items: center; gap: 6px; margin-top: 26px; padding: 0; border: 0; background: transparent; color: var(--text-2); font-weight: 650; font-size: 12.5px; }
.disclose:hover { color: var(--text); }
.brief { margin-top: 10px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); color: var(--text-2); font-size: 12.5px; line-height: 1.6; }
.brief p { margin: 0 0 10px; }
.brief ol { margin: 0 0 10px; padding-left: 20px; }
.brief li { margin-bottom: 6px; }
.brief > :last-child { margin-bottom: 0; }
@media (max-width: 900px) {
  .rpage { grid-template-columns: 1fr; gap: 24px; }
  .rpage-media { position: static; }
  .rpage-poster { height: 420px; }
  .rfacts > div { grid-template-columns: 1fr; gap: 2px; }
  .rpage-body { max-width: none; }
}

/* ---------- recipes: the editor's Recipe panel ---------- */
.recipe-chip { --h: 96; display: inline-flex; align-items: center; gap: 6px; height: 26px; max-width: 240px; padding: 0 10px; margin-left: 8px; border-radius: 13px; border: 1px solid hsl(var(--h) 35% 45% / .45); background: hsl(var(--h) 40% 40% / .1); color: hsl(var(--h) 45% 82%); font-size: 11.5px; font-weight: 650; }
.recipe-chip:hover, .recipe-chip.is-on { background: hsl(var(--h) 40% 40% / .22); }
.rpanel { padding: 14px 14px 26px; display: flex; flex-direction: column; gap: 14px; }
.rpanel-head h3 { margin: 8px 0 4px; font-size: 16px; font-weight: 800; letter-spacing: -0.02em; line-height: 1.2; }
.rpanel-head p { margin: 0 0 10px; line-height: 1.45; }
.rstatus { display: flex; align-items: center; gap: 8px; padding: 9px 10px; border-radius: 8px; border: 1px solid var(--line-2); background: var(--panel-2); font-size: 12px; color: var(--text-2); }
.rstatus.is-done { border-color: var(--accent-line); background: var(--accent-soft); }
.rstatus.is-done .icon { color: var(--accent); }
.rstatus.is-error { border-color: rgba(255, 90, 79, .4); background: var(--danger-soft); color: #ffcdc9; }
.rstatus.is-error .icon { color: var(--danger); }
.rstatus.is-cancelled .icon { color: var(--muted); }
.rsec { border-top: 1px solid var(--line); padding-top: 12px; }
.rsec h4 { margin: 0 0 9px; font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 700; }
.rsec-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.rsec-head h4 { margin: 0; }
.rinputs, .rkv { margin: 0; display: flex; flex-direction: column; gap: 9px; }
.rinputs dt { font-size: 11.5px; color: var(--muted); font-weight: 600; margin-bottom: 3px; }
.rinputs dd { margin: 0; font-size: 12.5px; color: var(--text); }
.rin-text { white-space: pre-wrap; word-break: break-word; }
.rin-files { display: flex; flex-wrap: wrap; gap: 5px; }
.rin-file { display: inline-flex; align-items: center; gap: 5px; max-width: 100%; height: 24px; padding: 0 8px; border-radius: 6px; border: 1px solid var(--line-2); background: var(--panel-2); color: var(--text-2); font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
button.rin-file:hover { color: var(--text); border-color: #3d443f; }
.rchecks { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 1px; }
.rchecks li { display: flex; gap: 9px; align-items: flex-start; padding: 5px 2px; font-size: 12.5px; color: var(--text-2); }
.rcheck-mark { width: 18px; height: 18px; border-radius: 50%; flex: none; display: flex; align-items: center; justify-content: center; border: 1px solid var(--line-2); color: var(--muted); }
.rchecks li.is-pass .rcheck-mark { background: var(--accent-soft); border-color: var(--accent-line); color: var(--accent); }
.rchecks li.is-fail .rcheck-mark { background: var(--danger-soft); border-color: rgba(255, 90, 79, .45); color: var(--danger); }
.rchecks li.is-fail { color: var(--text); }
.rchecks li.is-explained .rcheck-mark { color: var(--warn); border-color: rgba(242, 193, 78, .4); }
.rchecks .dot { width: 5px; height: 5px; border-radius: 50%; background: var(--faint); }
.rcheck-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; padding-top: 1px; }
.rcheck-detail { font-size: 11.5px; color: var(--muted); }
.rrender { display: flex; align-items: center; gap: 8px; padding: 8px 6px 8px 10px; border: 1px solid var(--line-2); border-radius: 8px; background: var(--panel-2); color: var(--text-2); }
.rrender-body { display: flex; flex-direction: column; min-width: 0; flex: 1; font-size: 12.5px; color: var(--text); }
.rissues { margin: 6px 0 0; padding-left: 18px; color: #f3d68f; font-size: 11.5px; }
.rkv > div { display: flex; justify-content: space-between; gap: 10px; font-size: 12px; }
.rkv dt { color: var(--muted); }
.rkv dd { margin: 0; color: var(--text-2); text-align: right; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.rpanel .disclose { margin-top: 0; }
.rfiles-links { color: var(--faint); margin: 0; }
.rfiles-links a { color: var(--muted); }
.rfiles-links a:hover { color: var(--text); }
a.btn { text-decoration: none; }
.tnum { font-feature-settings: 'tnum' 1; }
.rstatus.is-warn { border-color: rgba(242, 193, 78, .35); background: var(--warn-soft); color: #f3d68f; }
.rstatus.is-warn .icon { color: var(--warn); }
.rstatus.is-running { border-color: var(--line-2); }
.rchecks li.is-waiting .rcheck-mark { color: var(--muted); }
.rexport { margin-top: -4px; align-items: flex-start; font-size: 12.5px; }
.rexport input { margin-top: 3px; }
.rstatus { align-items: flex-start; }
.rstatus > .icon, .rstatus > .spinner { margin-top: 2px; }
.rstatus .btn { margin-top: -2px; }
.rstatus-text { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.rstatus-text > span { font-size: 11.5px; opacity: .85; }
.rrender { flex-direction: column; align-items: stretch; gap: 8px; padding: 9px 10px; }
.rrender-body { gap: 3px; }
.rrender-name { display: flex; align-items: center; gap: 7px; min-width: 0; }
.rrender-name .icon { color: var(--muted); }
.rrender-actions { display: flex; gap: 6px; }
.rpanel > .notice { margin: 0; }

/* ask_user question card (round 5) */
.question-card { margin: 8px 0; padding: 10px 12px; border-radius: 10px; background: var(--panel-2, rgba(94,255,41,0.08)); border: 1px solid rgba(94,255,41,0.35); }
.question-text { font-weight: 600; margin-bottom: 8px; }
.question-options { display: flex; flex-wrap: wrap; gap: 6px; }

/* ---------- Phase 6: 1-to-1 Cardboard Layout & UI ---------- */
.cb-shell {
  height: 100%;
  display: grid;
  grid-template-columns: 224px minmax(0, 1fr);
  background: #08080a;
  color: #f2f2f5;
}

.cb-sidebar {
  display: flex;
  flex-direction: column;
  padding: 10px 10px 12px;
  background: #08080a;
  user-select: none;
}

.sb-mac-spacer { height: 6px; flex: none; }

.sb-brand {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 10px 14px;
  color: #f4f4f6;
  text-decoration: none;
}
.sb-brand-name {
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 18px;
  font-weight: 500;
  letter-spacing: -0.02em;
}

.sb-search {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 33px;
  padding: 0 9px 0 11px;
  margin: 0 2px 12px;
  border-radius: 8px;
  background: #161619;
  border: 1px solid rgba(255, 255, 255, 0.05);
  color: #8a8a93;
  cursor: text;
}
.sb-search:focus-within {
  border-color: rgba(255, 255, 255, 0.16);
  color: #e4e4e9;
}
.sb-search input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  padding: 0;
  font-size: 12.5px;
  color: #f2f2f5;
  box-shadow: none !important;
}
.sb-search kbd {
  background: #232328;
  border-color: rgba(255, 255, 255, 0.08);
  color: #9898a2;
  font-size: 10px;
  padding: 1px 5px;
}

.sb-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.sb-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  height: 33px;
  padding: 0 11px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #9e9ea8;
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  text-align: left;
  transition: background 0.12s, color 0.12s;
}
.sb-item:hover {
  background: rgba(255, 255, 255, 0.04);
  color: #f2f2f5;
}
.sb-item.is-active {
  background: #1d1d21;
  color: #f5f5f7;
  font-weight: 600;
}
.sb-divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.06);
  margin: 8px 6px;
}

.sb-foot {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-top: 8px;
}
.sb-user {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  height: 36px;
  padding: 0 9px;
  margin-top: 4px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #d4d4dc;
  font-size: 12.5px;
  font-weight: 500;
  text-align: left;
}
.sb-user:hover { background: rgba(255, 255, 255, 0.05); color: #fff; }
.sb-avatar {
  width: 21px;
  height: 21px;
  border-radius: 50%;
  background: #232329;
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #d8d8e0;
  font-size: 10.5px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
}

.sb-wn-card {
  margin: 0 2px 8px;
  padding: 10px;
  border-radius: 10px;
  background: #141417;
  border: 1px solid rgba(255, 255, 255, 0.07);
  cursor: pointer;
}
.sb-wn-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11.5px;
  color: #9e9ea8;
  margin-bottom: 7px;
}
.sb-wn-thumb {
  height: 82px;
  border-radius: 7px;
  background: linear-gradient(135deg, #222620, #16181d);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 7px;
  border: 1px solid rgba(255, 255, 255, 0.06);
}
.sb-wn-play {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
}
.sb-wn-caption { font-size: 11.5px; color: #d4d4dc; font-weight: 500; }

/* Settings sidebar mode */
.sb-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 10px;
  margin-bottom: 16px;
  border: 0;
  background: transparent;
  color: #9e9ea8;
  font-size: 13px;
  font-weight: 500;
}
.sb-back:hover { color: #f4f4f6; }
.sb-version {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 10px 2px;
  font-size: 11.5px;
  color: #6e6e77;
}

/* Main rounded viewport */
.cb-viewport {
  margin: 8px 8px 8px 0;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  background:
    radial-gradient(900px 420px at 50% 0%, rgba(255, 255, 255, 0.035), transparent 65%),
    #111113;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
}

/* Dashboard Hero & Prompt Box */
.cb-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 68px 24px 52px;
}
.cb-hero-head {
  text-align: center;
  margin-bottom: 28px;
}
.cb-hero-head h1 {
  margin: 0 0 8px;
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 33px;
  font-weight: 400;
  letter-spacing: -0.02em;
  color: #f4f4f6;
}
.cb-hero-head p {
  margin: 0;
  font-size: 13.5px;
  color: #8a8a93;
}

.cb-prompt-wrap {
  position: relative;
  width: 636px;
  max-width: 100%;
  margin-bottom: 14px;
}
.cb-drop-badge {
  position: absolute;
  top: -21px;
  left: 12px;
  z-index: 2;
  width: 52px;
  height: 44px;
  border-radius: 10px;
  border: 1px dashed rgba(255, 255, 255, 0.2);
  background: #19191d;
  color: #c8c8d0;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35);
  transition: border-color 0.15s, color 0.15s, transform 0.15s;
}
.cb-drop-badge:hover {
  border-color: rgba(255, 255, 255, 0.38);
  color: #fff;
  transform: translateY(-1px);
}

.cb-prompt-box {
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  background: #161619;
  padding: 26px 12px 10px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
}
.cb-hero.is-drag .cb-prompt-box {
  border-color: var(--accent);
  border-style: dashed;
}
.cb-prompt-box textarea {
  width: 100%;
  border: 0;
  background: transparent;
  padding: 6px 6px 8px;
  font-size: 14px;
  color: #f2f2f5;
  min-height: 54px;
  box-shadow: none !important;
}
.cb-prompt-box textarea::placeholder { color: #7e7e88; }

.cb-prompt-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 4px 0;
}
.cb-assist-btn, .cb-ring-btn, .cb-send-btn {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: #212126;
  color: #b8b8c2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.12s, color 0.12s;
}
.cb-assist-btn:hover, .cb-ring-btn:hover, .cb-send-btn:hover:not(:disabled) {
  background: #2b2b31;
  color: #fff;
}
.cb-ring-btn { border-color: transparent; background: transparent; }

.cb-model-pick { position: relative; }
.cb-model-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 28px;
  padding: 0 9px;
  border-radius: 7px;
  border: 0;
  background: transparent;
  color: #b4b4be;
  font-size: 12.5px;
  font-weight: 500;
}
.cb-model-btn:hover { background: rgba(255, 255, 255, 0.05); color: #f2f2f5; }
.cb-model-menu { right: 0; bottom: 34px; min-width: 195px; }

.cb-hero-chips {
  display: flex;
  flex-wrap: nowrap;
  justify-content: center;
  gap: 8px;
  max-width: 660px;
  overflow-x: auto;
  scrollbar-width: none;
}
.cb-hero-chips::-webkit-scrollbar { display: none; }
.cb-hero-chip {
  flex: none;
  height: 30px;
  padding: 0 13px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  background: #17171a;
  color: #c2c2cc;
  font-size: 12.5px;
  font-weight: 500;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
}
.cb-hero-chip:hover {
  background: #222227;
  color: #fff;
  border-color: rgba(255, 255, 255, 0.14);
}

/* Lower Panel (Recipes | Your projects) */
.cb-lower-panel {
  margin: 0 18px 28px;
  padding: 22px 24px 32px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  background: #131316;
}
.cb-recipes-only-wrap .cb-lower-panel {
  margin-top: 18px;
}

.cb-lower-tabs {
  display: inline-flex;
  padding: 3px;
  border-radius: 10px;
  background: #1c1c20;
  border: 1px solid rgba(255, 255, 255, 0.05);
  margin-bottom: 24px;
}
.cb-tab-pill {
  height: 29px;
  padding: 0 14px;
  border-radius: 7px;
  border: 0;
  background: transparent;
  color: #9c9ca6;
  font-size: 12.5px;
  font-weight: 600;
}
.cb-tab-pill:hover { color: #f2f2f5; }
.cb-tab-pill.is-on {
  background: #f4f4f6;
  color: #111113;
}

.cb-row-head {
  display: flex;
  align-items: center;
  margin-bottom: 14px;
}
.cb-row-head h2 {
  margin: 0;
  font-size: 15.5px;
  font-weight: 600;
  color: #f2f2f5;
  letter-spacing: -0.01em;
}
.cb-row-head h3 {
  margin: 0;
  font-size: 13.5px;
  font-weight: 600;
  color: #d8d8e0;
}
.cb-scroll-btns {
  display: inline-flex;
  gap: 6px;
}
.cb-scroll-btn {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: #1c1c20;
  color: #9e9ea8;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.cb-scroll-btn:hover { background: #26262c; color: #fff; }

.cb-trending-rail, .cb-cat-rail {
  display: flex;
  align-items: center;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: none;
}
.cb-trending-rail::-webkit-scrollbar, .cb-cat-rail::-webkit-scrollbar { display: none; }

.cb-upload-ref-tile {
  width: 168px;
  height: 230px;
  flex: none;
  border-radius: 12px;
  border: 1px dashed rgba(255, 255, 255, 0.18);
  background: #17171b;
  color: #d2d2dc;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  transition: border-color 0.15s, background 0.15s;
}
.cb-upload-ref-tile:hover {
  border-color: rgba(255, 255, 255, 0.36);
  background: #1d1d22;
  color: #fff;
}
.cb-urf-graphic {
  position: relative;
  width: 112px;
  height: 54px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.cb-urf-bg-l, .cb-urf-bg-r {
  position: absolute;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(255, 255, 255, 0.02);
}
.cb-urf-bg-l { left: 4px; width: 32px; height: 46px; }
.cb-urf-bg-r { right: 4px; width: 38px; height: 28px; }
.cb-urf-box {
  position: relative;
  z-index: 1;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: #222228;
  display: flex;
  align-items: center;
  justify-content: center;
}
.cb-urf-label { font-size: 12.5px; font-weight: 500; }

.cb-recipe-tile {
  position: relative;
  flex: none;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  background: #0d0d0f;
  padding: 0;
  overflow: hidden;
  transition: transform 0.15s, border-color 0.15s, box-shadow 0.15s;
}
.cb-recipe-tile:hover {
  border-color: rgba(255, 255, 255, 0.24);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.45);
}
.cb-tile-poster-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.cb-recipe-tile video {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  background: transparent;
}
.cb-tile-shade {
  z-index: 2;
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 55%, rgba(0, 0, 0, 0.78) 100%);
  opacity: 0;
  transition: opacity 0.16s;
  pointer-events: none;
}
.cb-tile-title {
  position: absolute;
  z-index: 3;
  left: 12px;
  right: 12px;
  bottom: 10px;
  text-align: left;
  font-size: 12.5px;
  font-weight: 600;
  color: #fff;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.85);
  opacity: 0;
  transform: translateY(3px);
  transition: opacity 0.16s, transform 0.16s;
  pointer-events: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cb-recipe-tile:hover .cb-tile-shade,
.cb-recipe-tile:hover .cb-tile-title {
  opacity: 1;
  transform: translateY(0);
}

.cb-panel-divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.06);
  margin: 26px 0 22px;
}

.cb-pick-title {
  margin: 0 0 14px;
  font-size: 15.5px;
  font-weight: 600;
  color: #f2f2f5;
}
.cb-filter-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 22px;
  flex-wrap: wrap;
}
.cb-recipe-search {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 224px;
  height: 32px;
  padding: 0 10px;
  border-radius: 8px;
  background: #1b1b1f;
  border: 1px solid rgba(255, 255, 255, 0.06);
  color: #8a8a93;
}
.cb-recipe-search input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  padding: 0;
  font-size: 12.5px;
  color: #f2f2f5;
  box-shadow: none !important;
}

.cb-len-seg {
  display: inline-flex;
  padding: 2px;
  border-radius: 8px;
  background: #1b1b1f;
  border: 1px solid rgba(255, 255, 255, 0.06);
}
.cb-len-seg button {
  height: 26px;
  padding: 0 11px;
  border-radius: 6px;
  border: 0;
  background: transparent;
  color: #8e8e98;
  font-size: 12px;
  font-weight: 500;
}
.cb-len-seg button.is-on {
  background: #2b2b31;
  color: #f4f4f6;
}

.cb-select-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  padding: 0 4px 0 10px;
  border-radius: 8px;
  background: #1b1b1f;
  border: 1px solid rgba(255, 255, 255, 0.06);
  color: #c8c8d2;
}
.cb-select-pill select {
  border: 0;
  background-color: transparent;
  padding: 0 22px 0 2px;
  font-size: 12px;
  color: #e2e2ea;
  height: 28px;
  box-shadow: none !important;
}

.cb-cat-section { margin-bottom: 26px; }
.cb-bottom-pair {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 3fr);
  gap: 24px;
}
@media (max-width: 1100px) {
  .cb-bottom-pair { grid-template-columns: 1fr; }
}

.cb-projects-page { padding: 28px; }

/* 2-Column Recipe Remix Modal & Stage 2 Reference Modal */
.rm-modal {
  width: 860px;
  max-width: calc(100vw - 32px);
  height: 560px;
  max-height: calc(100vh - 40px);
  display: grid;
  grid-template-columns: 420px minmax(0, 1fr);
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  background: #141417;
  box-shadow: 0 36px 90px rgba(0, 0, 0, 0.68);
  overflow: hidden;
}
.rm-left {
  background: #19191d;
  border-right: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  min-height: 0;
}
.rm-cat-top {
  font-size: 12px;
  color: #8e8e98;
  font-weight: 500;
}
.rm-stage {
  flex: 1;
  width: 100%;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px 0;
}
.rm-player-wrap {
  position: relative;
  max-width: 100%;
  max-height: 430px;
  border-radius: 10px;
  overflow: hidden;
  background: #000;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5);
}
.rm-player-wrap.is-tall { height: 420px; }
.rm-player-wrap.is-wide { width: 100%; }
.rm-player-wrap video, .rm-poster-fallback {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  background: transparent;
}
.rm-poster-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.rm-remove-ref {
  z-index: 2;
  position: absolute;
  top: 10px;
  right: 10px;
  width: 28px;
  height: 28px;
  border-radius: 7px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(16, 16, 19, 0.78);
  color: #e4e4ec;
  display: flex;
  align-items: center;
  justify-content: center;
}
.rm-remove-ref:hover { background: rgba(255, 90, 79, 0.85); color: #fff; }
.rm-controls {
  position: absolute;
  z-index: 2;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 16px 10px 8px;
  background: linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.82));
}
.rm-ctl-btn {
  width: 20px;
  height: 20px;
  flex: none;
  border: 0;
  background: transparent;
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}
.rm-seek { flex: 1; min-width: 0; height: 14px; }
.rm-time { font-size: 11px; color: #e2e2ea; flex: none; }

.rm-left-foot {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11.5px;
  color: #8e8e98;
}
.rm-platforms { letter-spacing: 0.2em; font-size: 11px; color: #a4a4b0; }

.rm-right {
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: #141417;
}
.rm-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px 10px;
}
.rm-head h2 {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  color: #f4f4f6;
}
.rm-head-btns { display: flex; gap: 4px; }

.rm-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 4px 20px 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.rm-summary {
  margin: 0;
  font-size: 12.5px;
  color: #9e9ea8;
  line-height: 1.5;
}
.rm-label {
  font-size: 12px;
  font-weight: 600;
  color: #d8d8e0;
  margin-bottom: 6px;
}
.rm-opt { color: #787882; font-weight: 400; }
.rm-best-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 26px;
  padding: 0 10px;
  border-radius: 7px;
  background: #202026;
  border: 1px solid rgba(255, 255, 255, 0.07);
  font-size: 12px;
  color: #d4d4dc;
}
.rm-best-pill span { color: #8e8e98; }

.rm-inputs { display: flex; flex-direction: column; gap: 14px; }
.rm-dropzone {
  height: 120px;
  border-radius: 10px;
  border: 1px dashed rgba(255, 255, 255, 0.16);
  background: #19191e;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  cursor: pointer;
  transition: border-color 0.14s, background 0.14s;
}
.rm-dropzone:hover, .rm-dropzone.is-drag {
  border-color: rgba(255, 255, 255, 0.32);
  background: #1f1f25;
}
.rm-dz-plus { color: #a4a4b0; margin-bottom: 2px; }
.rm-dz-title { font-size: 12.5px; color: #d4d4dc; font-weight: 500; }
.rm-dz-sub { font-size: 11.5px; color: #787882; }
.rm-hint { margin: 5px 0 0; font-size: 11.5px; color: #7e7e88; line-height: 1.4; }

.rm-thumbs-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.rm-thumb-tile {
  position: relative;
  width: 68px;
  height: 68px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: #1c1c22;
  display: flex;
  align-items: center;
  justify-content: center;
}
.rm-thumb-tile img, .rm-thumb-tile video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.rm-thumb-name {
  position: absolute;
  left: 3px;
  right: 3px;
  bottom: 2px;
  font-size: 9.5px;
  color: #fff;
  background: rgba(0, 0, 0, 0.7);
  padding: 0 3px;
  border-radius: 3px;
}
.rm-thumb-del {
  position: absolute;
  top: 3px;
  right: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 0;
  background: rgba(0, 0, 0, 0.75);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
}
.rm-thumb-add {
  width: 68px;
  height: 68px;
  border-radius: 8px;
  border: 1px dashed rgba(255, 255, 255, 0.18);
  background: transparent;
  color: #9e9ea8;
  display: flex;
  align-items: center;
  justify-content: center;
}

.rm-text-box {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 0 11px;
  border-radius: 8px;
  background: #1c1c21;
  border: 1px solid rgba(255, 255, 255, 0.07);
}
.rm-t-prefix {
  font-family: Georgia, serif;
  font-size: 12px;
  color: #787882;
  flex: none;
}
.rm-text-box input, .rm-text-box textarea {
  flex: 1;
  border: 0;
  background: transparent;
  padding: 6px 0;
  font-size: 12.5px;
  color: #f2f2f5;
  box-shadow: none !important;
}

.rm-gen-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 13px;
  border-radius: 10px;
  background: #1b1b20;
  border: 1px solid rgba(255, 255, 255, 0.07);
}
.rm-gen-icon {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: #25252c;
  color: #d4d4dc;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
}
.rm-gen-title { font-size: 12.5px; font-weight: 600; color: #f2f2f5; }
.rm-gen-sub { font-size: 11.5px; color: #8e8e98; }

.rm-foot {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 20px 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}
.rm-aspect-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: #8e8e98;
}
.rm-aspect-select {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: #9e9ea8;
}
.rm-aspect-select select {
  border: 0;
  background-color: transparent;
  padding: 2px 18px 2px 2px;
  font-size: 12px;
  color: #d4d4dc;
}
.rm-submit-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 36px;
  padding: 0 18px;
  border-radius: 9px;
  border: 0;
  background: #f4f4f6;
  color: #111113;
  font-size: 13px;
  font-weight: 600;
}
.rm-submit-btn:hover:not(:disabled) { background: #ffffff; }
.rm-submit-btn:disabled { opacity: 0.45; }

/* Stage 1 & Stage 2 Reference Remix Modal */
.ref-stage1-modal {
  position: relative;
  width: 440px;
  max-width: calc(100vw - 32px);
  padding: 36px 32px 28px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  background: #141417;
  box-shadow: 0 36px 90px rgba(0, 0, 0, 0.68);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}
.ref-s1-close {
  position: absolute;
  top: 14px;
  right: 14px;
}
.ref-s1-title {
  margin: 0 0 6px;
  font-size: 16px;
  font-weight: 600;
  color: #f4f4f6;
}
.ref-s1-sub {
  margin: 0 0 22px;
  font-size: 12.5px;
  color: #8e8e98;
}
.ref-s1-drop {
  width: 100%;
  height: 186px;
  border-radius: 12px;
  border: 1px dashed rgba(255, 255, 255, 0.18);
  background: #18181c;
  color: #d4d4dc;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-bottom: 12px;
}
.ref-s1-drop:hover, .ref-s1-drop.is-drag {
  border-color: rgba(255, 255, 255, 0.34);
  background: #1e1e23;
}
.ref-s1-cards {
  display: flex;
  align-items: center;
  gap: 12px;
}
.ref-card-left {
  width: 58px;
  height: 76px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: linear-gradient(160deg, rgba(255,255,255,0.05), rgba(255,255,255,0.01));
}
.ref-card-mid {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: #222228;
  display: flex;
  align-items: center;
  justify-content: center;
}
.ref-card-right {
  width: 54px;
  height: 42px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: linear-gradient(160deg, rgba(255,255,255,0.05), rgba(255,255,255,0.01));
}
.ref-s1-drop-label { font-size: 12.5px; color: #b8b8c2; }
.ref-s1-link {
  width: 100%;
  height: 36px;
  border-radius: 9px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  background: #18181c;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  color: #8e8e98;
  margin-bottom: 18px;
}
.ref-s1-link input {
  flex: 1;
  border: 0;
  background: transparent;
  padding: 0;
  font-size: 12.5px;
  color: #f2f2f5;
  box-shadow: none !important;
}
.ref-s1-continue {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 32px;
  padding: 0 16px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: #232329;
  color: #d4d4dc;
  font-size: 12.5px;
  font-weight: 500;
}
.ref-s1-continue:hover:not(:disabled) { background: #2d2d35; color: #fff; }

.ref-s2-bullets {
  margin: 0;
  padding-left: 18px;
  color: #9e9ea8;
  font-size: 12.5px;
  line-height: 1.55;
}
.ref-s2-bullets li { margin-bottom: 4px; }
.ref-add-media-btn {
  width: 100%;
  height: 40px;
  padding: 0 13px;
  border-radius: 9px;
  border: 1px dashed rgba(255, 255, 255, 0.18);
  background: #19191e;
  color: #d4d4dc;
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 12.5px;
  font-weight: 500;
}
.ref-add-media-btn:hover { border-color: rgba(255, 255, 255, 0.32); background: #202026; }
.ref-media-icons { display: inline-flex; gap: 6px; color: #7e7e88; }
.ref-changes-box {
  width: 100%;
  border-radius: 9px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  background: #1c1c21;
  padding: 10px 12px;
  font-size: 12.5px;
  color: #f2f2f5;
  min-height: 70px;
}

/* Settings Sub-Screens (t27.jpg - t43.jpg) */
.st-viewport { padding: 36px 42px 60px; }
.st-page { max-width: 680px; }
.st-title {
  margin: 0 0 6px;
  font-size: 20px;
  font-weight: 600;
  color: #f4f4f6;
  letter-spacing: -0.015em;
}
.st-sub {
  margin: 0 0 22px;
  font-size: 13px;
  color: #8e8e98;
}
.st-sec-label {
  font-size: 11.5px;
  color: #8e8e98;
  margin: 22px 0 8px;
}
.st-card {
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: #17171a;
  margin-bottom: 12px;
}
.st-row-card, .st-plan-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 18px;
}
.st-row-title { font-size: 13px; font-weight: 600; color: #f2f2f5; }
.st-row-sub { font-size: 12px; color: #8a8a93; margin-top: 2px; }
.st-kicker { font-size: 11.5px; color: #8a8a93; }
.st-desc { font-size: 12.5px; color: #9a9aa4; line-height: 1.5; margin: 8px 0 14px; }
.st-pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  padding: 0 12px;
  border-radius: 7px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: #232328;
  color: #e4e4ec;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
}
.st-pill-btn:hover { background: #2c2c33; color: #fff; }
.st-white-btn {
  height: 32px;
  padding: 0 14px;
  border-radius: 8px;
  border: 0;
  background: #f4f4f6;
  color: #111113;
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
}
.st-link-btn {
  border: 0;
  background: transparent;
  color: #9e9ea8;
  font-size: 12px;
  padding: 4px 6px;
}
.st-link-btn:hover { color: #fff; }
.st-btn-row { display: flex; gap: 8px; flex-wrap: wrap; }

/* Account Collectible Card */
.st-account-card {
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
  gap: 24px;
  padding: 20px;
}
.st-collectible {
  border-radius: 11px;
  background: #f2f1ed;
  color: #1c1b18;
  padding: 12px 12px 14px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.45);
}
.st-col-frame {
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid rgba(0, 0, 0, 0.12);
}
.st-horse-svg { width: 100%; height: auto; display: block; }
.st-col-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 10.5px;
  color: #6b6860;
  margin: 8px 2px 12px;
}
.st-col-tag { color: #2b6cb0; font-weight: 600; }
.st-col-name {
  text-align: center;
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 20px;
  color: #1c1b18;
  margin-bottom: 2px;
}
.st-col-since {
  text-align: center;
  font-size: 10.5px;
  color: #7c7970;
  margin-bottom: 14px;
}
.st-col-rule {
  width: 24px;
  height: 1px;
  background: rgba(0, 0, 0, 0.16);
  margin: 0 auto 10px;
}
.st-col-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  font-family: Georgia, serif;
  font-size: 11px;
  color: #5c5952;
}
.st-account-right {
  display: flex;
  flex-direction: column;
  padding-top: 6px;
}
.st-serif-h2 {
  margin: 4px 0 6px;
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 24px;
  font-weight: 400;
  color: #f4f4f6;
}
.st-sign-row { display: flex; gap: 8px; margin-top: 10px; }
.st-sign-row input { flex: 1; height: 30px; font-size: 12.5px; }
.st-grow-sep { flex: 1; min-height: 18px; border-bottom: 1px solid rgba(255, 255, 255, 0.06); margin-bottom: 14px; }
.st-signed-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.st-signed-val { font-size: 12.5px; color: #e4e4ec; margin-top: 2px; }
.st-plan-title { font-size: 17px; font-weight: 600; color: #f4f4f6; margin: 2px 0; }

/* Library settings */
.st-lib-card { padding: 16px 18px; }
.st-lib-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.st-lib-mid { padding-top: 14px; }
.st-lib-counts {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12.5px;
  margin-bottom: 8px;
}
.st-storage-bar {
  height: 12px;
  border-radius: 6px;
  background: #232328;
  overflow: hidden;
  display: flex;
  margin-bottom: 10px;
}
.st-bar-proj { background: #e4e4ec; height: 100%; }
.st-bar-temp { background: #6e6e78; height: 100%; }
.st-storage-legend {
  display: flex;
  gap: 16px;
  font-size: 11.5px;
  color: #9e9ea8;
}
.st-storage-legend i {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  margin-right: 5px;
}
.dot-proj { background: #e4e4ec; }
.dot-temp { background: #6e6e78; }
.dot-free { background: #34343c; }

.st-list-card { overflow: hidden; }
.st-proj-row, .st-agent-row, .st-sc-row, .st-priv-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}
.st-list-card > :first-child { border-top: 0; }
.st-proj-main {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  border: 0;
  background: transparent;
  padding: 0;
  text-align: left;
  color: #e4e4ec;
}
.st-proj-thumb {
  width: 50px;
  height: 30px;
  border-radius: 5px;
  overflow: hidden;
  background: #232328;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
}
.st-proj-thumb img { width: 100%; height: 100%; object-fit: cover; }
.st-proj-name { font-size: 12.5px; font-weight: 500; }
.st-proj-size { font-size: 12px; color: #8e8e98; }

/* Agents settings */
.st-agent-badge {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  flex: none;
}
.st-agent-badge.is-anthropic { background: #d96548; }
.st-agent-badge.is-openai { background: #5848d9; }
.st-agent-badge.is-vertex { background: #266b44; }
.st-agent-text { flex: 1; min-width: 0; }
.st-agent-foot {
  padding: 9px 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}
.st-caption {
  margin: -4px 0 16px;
  font-size: 11.5px;
  color: #787882;
}

/* Usage settings */
.st-usage-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
}
.st-usage-col {
  padding: 18px 20px;
}
.st-usage-col + .st-usage-col {
  border-left: 1px solid rgba(255, 255, 255, 0.06);
}
.st-usage-single { padding: 18px 20px; }
.st-usage-big {
  font-size: 13px;
  color: #8e8e98;
  margin: 6px 0 10px;
}
.st-usage-big b {
  font-size: 24px;
  font-weight: 600;
  color: #f4f4f6;
  margin-right: 4px;
}
.st-usage-bar {
  height: 5px;
  border-radius: 3px;
  background: #28282e;
  overflow: hidden;
  margin-bottom: 10px;
}
.st-usage-bar > span {
  display: block;
  height: 100%;
  background: #d8d8e0;
}
.st-usage-history { display: grid; gap: 10px; padding-left: 2px; }

/* Shortcuts settings */
.st-sc-row { justify-content: space-between; font-size: 12.5px; color: #d8d8e0; }
.st-sc-keys { display: inline-flex; gap: 4px; }
.st-sc-keys kbd {
  background: #232329;
  border-color: rgba(255, 255, 255, 0.08);
  color: #b4b4be;
  padding: 1px 6px;
  font-size: 11px;
}

/* Privacy settings */
.st-priv-row { display: grid; grid-template-columns: 120px 1fr; font-size: 12.5px; }
.st-priv-k { font-weight: 600; color: #e4e4ec; }
.st-priv-v { color: #8e8e98; }
.st-policy-link { color: #9e9ea8; font-size: 12px; text-decoration: underline; }

/* Editor enhancements (cb_screenshot_project.png, remix-4s-s.png) */
.cb-left-split {
  display: flex;
  height: 100%;
  min-height: 0;
}
.cb-tool-rail {
  width: 42px;
  flex: none;
  border-right: 1px solid var(--line);
  background: #0c0d0e;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 8px 0;
  gap: 6px;
}
.cb-rail-btn {
  width: 30px;
  height: 30px;
  border-radius: 7px;
  border: 0;
  background: transparent;
  color: #8a8a93;
  display: flex;
  align-items: center;
  justify-content: center;
}
.cb-rail-btn:hover { background: rgba(255, 255, 255, 0.06); color: #f2f2f5; }
.cb-rail-btn.is-on { background: #1f2220; color: #f4f4f6; }
.cb-left-drawer {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.cb-bin-searchbar {
  display: flex;
  align-items: center;
  gap: 6px;
}
.cb-bin-search {
  flex: 1;
  min-width: 0;
  height: 28px;
  border-radius: 6px;
  background: #171918;
  border: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 8px;
  color: var(--muted);
}
.cb-bin-search input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  padding: 0;
  font-size: 12px;
  box-shadow: none !important;
}
.thumb-added {
  position: absolute;
  left: 3px;
  bottom: 3px;
  font-size: 9.5px;
  padding: 0 4px;
  border-radius: 3px;
  background: rgba(11, 13, 12, 0.85);
  color: var(--accent);
  font-weight: 600;
}

.director-cut-cta {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.director-dots {
  display: inline-flex;
  gap: 5px;
  margin-bottom: 4px;
}
.director-dots span {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #a4a4b0;
  animation: pulse 1.4s infinite;
}

.cb-agent-head {
  padding: 0 10px;
}
.cb-chat-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 26px;
  padding: 0 10px;
  border-radius: 7px;
  background: #1c1e1d;
  border: 1px solid var(--line);
  font-size: 12px;
  font-weight: 600;
  max-width: 220px;
}
.cb-agent-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 8px;
  color: #7e7e88;
}
.cb-recipe-msg-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 8px;
  border-radius: 5px;
  background: rgba(130, 100, 255, 0.18);
  color: #cbbdff;
  font-size: 11px;
  margin-bottom: 6px;
}
.cb-worked-toggle {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 0;
  background: transparent;
  color: #8e8e98;
  font-size: 11.5px;
  padding: 0;
}
.cb-worked-toggle:hover { color: #d8d8e0; }
.cb-composer-box {
  border-radius: 11px;
  border: 1px solid var(--line-2);
  background: #171918;
  padding: 8px 8px 6px;
}
.cb-composer-box textarea {
  width: 100%;
  border: 0;
  background: transparent;
  padding: 2px 4px 6px;
  font-size: 12.5px;
  box-shadow: none !important;
}
.cb-composer-bar {
  display: flex;
  align-items: center;
  gap: 4px;
}
.cb-send-circle, .cb-stop-circle {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 0;
  background: #2b2f2d;
  color: #f4f4f6;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.cb-send-circle:hover:not(:disabled) { background: var(--accent); color: var(--accent-ink); }
.cb-stop-circle { background: #f4f4f6; color: #111; }

