:root {
  color-scheme: dark;
  --bg: #10151d;
  --panel: #171f2a;
  --panel-2: #1d2734;
  --line: #293645;
  --text: #edf2f8;
  --muted: #91a0b2;
  --accent: #55d5bd;
  --accent-2: #9cf2dc;
  --red: #f07d83;
  --yellow: #f4c870;
  --shadow: 0 16px 42px #05090f55;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: radial-gradient(ellipse at 60% -15%, #1f3842 0, transparent 48%), var(--bg); color: var(--text); min-height: 100vh; }
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; }
button, a.button { cursor: pointer; }
.topbar { height: 72px; display: flex; align-items: center; gap: 44px; padding: 0 max(28px, calc((100vw - 1280px) / 2)); border-bottom: 1px solid #ffffff12; background: #10151de8; position: sticky; top: 0; z-index: 5; backdrop-filter: blur(18px); }
.brand { display: inline-flex; align-items: center; gap: 11px; font-size: 18px; font-weight: 750; letter-spacing: -.5px; white-space: nowrap; }
.brand-mark { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; background: var(--accent); color: #0e2625; font-size: 20px; font-weight: 900; }
nav { display: flex; align-items: center; gap: 28px; flex: 1; }
nav a { color: var(--muted); font-size: 13px; transition: color .15s; }
nav a:hover, nav a:focus { color: var(--accent-2); }
.page-shell { max-width: 1280px; padding: 38px 28px 70px; margin: 0 auto; }
.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin: 8px 0 30px; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 8px; font-size: clamp(30px, 4vw, 43px); letter-spacing: -1.5px; line-height: 1.06; }
h2 { margin-bottom: 0; font-size: 20px; letter-spacing: -.45px; }
h3 { margin-bottom: 5px; font-size: 15px; }
.eyebrow { margin-bottom: 8px; font-size: 10px; font-weight: 800; letter-spacing: 1.6px; color: #7f95a9; }
.muted { color: var(--muted); font-size: 13px; }
.page-heading .muted { margin-bottom: 0; font-size: 14px; }
.panel { background: linear-gradient(145deg, #1a2430, #151d27); border: 1px solid var(--line); border-radius: 16px; padding: 24px; margin-bottom: 20px; box-shadow: var(--shadow); }
.section-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 21px; }
.button { border: 1px solid #405064; background: #202c39; color: var(--text); display: inline-flex; align-items: center; justify-content: center; gap: 8px; border-radius: 9px; padding: 10px 15px; font-size: 12px; font-weight: 700; transition: .15s ease; }
.button:hover { border-color: #8da1b5; background: #283747; transform: translateY(-1px); }
.button-primary { color: #09201d; background: var(--accent); border-color: var(--accent); }
.button-primary:hover { background: var(--accent-2); border-color: var(--accent-2); }
.button-quiet { border-color: transparent; background: transparent; color: var(--muted); padding: 8px; }
.button-small { padding: 7px 10px; border-radius: 7px; font-size: 11px; }
.button-full { width: 100%; margin-top: 7px; padding: 12px; }
.button-danger-quiet { color: #e99a9d; border-color: #653c44; background: #35232b; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 5px 9px; border-radius: 999px; background: #263442; color: #bbc9d6; font-size: 10px; font-weight: 750; white-space: nowrap; }
.pill-green { color: #9aefd8; background: #1d403c; }
.pill-red { color: #ffa8a8; background: #482c34; }
.pill-muted { color: #9aa9b8; background: #28313c; }
.notice { border: 1px solid; border-radius: 10px; padding: 12px 15px; margin-bottom: 16px; font-size: 13px; }
.notice-success { color: #a1efd9; border-color: #2e6258; background: #18352f; }
.notice-error { color: #ffc3c0; border-color: #704049; background: #38232b; }
.notice-warn { color: #f6d993; border-color: #665438; background: #332d21; font-size: 11px; margin: 15px 0; }
.form-grid { display: grid; grid-template-columns: minmax(220px, 2fr) minmax(150px, 1fr) 130px auto; align-items: end; gap: 12px; }
.field, .stack label { display: flex; flex-direction: column; gap: 7px; color: #b3c0ce; font-size: 11px; font-weight: 700; }
input, textarea, select { width: 100%; min-width: 0; border: 1px solid #334253; border-radius: 8px; background: #101720; color: var(--text); outline: none; padding: 10px 12px; font-size: 12px; }
input:focus, textarea:focus, select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px #55d5bd1f; }
input::placeholder, textarea::placeholder { color: #617184; }
.form-action { height: 37px; }
.channel-list { display: flex; flex-direction: column; }
.channel-row { display: flex; align-items: center; gap: 14px; padding: 15px 0; border-top: 1px solid #ffffff0c; }
.channel-row:first-child { border-top: 0; }
.channel-avatar { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 12px; background: linear-gradient(140deg, #315459, #293746); color: var(--accent-2); font-weight: 800; }
.channel-info { flex: 1; min-width: 150px; }
.channel-info .muted { margin: 0; font-size: 11px; }
.queued-count { color: #93a2b3; font-size: 11px; white-space: nowrap; }
.row-actions { display: flex; gap: 6px; }
.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; text-align: left; }
th { color: #8293a7; letter-spacing: .8px; font-size: 9px; text-transform: uppercase; font-weight: 800; padding: 11px; }
td { padding: 13px 11px; border-top: 1px solid #ffffff0c; color: #dce3eb; font-size: 12px; vertical-align: middle; }
td small { display: block; color: #718195; font-size: 10px; margin-top: 3px; }
.video-title { font-weight: 650; }
.video-title:hover, .small-link:hover { color: var(--accent-2); }
.error-cell { max-width: 260px; color: #e8a0a3; font-size: 10px; overflow-wrap: anywhere; }
.status { display: inline-flex; border-radius: 6px; padding: 4px 7px; background: #263340; color: #afbdca; font-size: 9px; font-weight: 800; text-transform: uppercase; letter-spacing: .4px; white-space: nowrap; }
.status-done, .status-posted { color: #9de9d4; background: #1c403b; }
.status-failed { color: #ffaaaa; background: #492b33; }
.status-new, .status-rendered, .status-scheduled { color: #f2d58b; background: #453a28; }
.status-downloading, .status-transcribing, .status-selecting, .status-rendering { color: #abd8f5; background: #243b50; }
.empty-state { min-height: 165px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; color: var(--muted); padding: 26px; }
.empty-state strong { color: var(--text); margin: 9px 0 5px; font-size: 14px; }
.empty-state p { margin-bottom: 0; font-size: 12px; }
.empty-icon { color: var(--accent); font-size: 25px; }
.process-panel { display: grid; grid-template-columns: .9fr 1.1fr; align-items: center; gap: 30px; background: linear-gradient(120deg, #1b2e35, #17202b 70%); }
.process-panel h2 { margin-bottom: 7px; }
.process-panel p { margin-bottom: 0; }
.process-form { display: flex; gap: 10px; }
.process-form input { flex: 1; }
.footer { text-align: center; padding: 0 20px 28px; color: #596879; font-size: 10px; letter-spacing: .3px; }
.clip-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 18px; align-items: start; }
.clip-card { overflow: hidden; background: var(--panel); border: 1px solid var(--line); border-radius: 15px; box-shadow: var(--shadow); }
.clip-player { width: 100%; aspect-ratio: 9 / 16; max-height: 550px; position: relative; display: flex; justify-content: center; background: #080c11; overflow: hidden; }
.clip-player video { height: 100%; max-width: 100%; object-fit: contain; }
.score-badge { position: absolute; top: 12px; left: 12px; border-radius: 7px; background: #0d161dcf; border: 1px solid #ffffff22; padding: 6px 8px; font-size: 9px; color: var(--accent-2); font-weight: 800; letter-spacing: .7px; }
.clip-content { padding: 18px; }
.clip-title-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.clip-title-row h2 { font-size: 16px; line-height: 1.35; }
.clip-title-row .eyebrow { margin-bottom: 5px; }
.clip-meta { color: #8798aa; font-size: 10px; margin: 8px 0 0; }
.reason { color: #aab8c5; font-size: 11px; line-height: 1.5; margin: 12px 0; }
.stack { display: flex; flex-direction: column; gap: 11px; }
.clip-edit { padding: 13px; background: #111923; border: 1px solid #263442; border-radius: 10px; }
.clip-edit textarea { resize: vertical; min-height: 64px; line-height: 1.45; }
.clip-review-actions { display: flex; gap: 8px; padding: 13px 0 17px; border-bottom: 1px solid #ffffff12; }
.post-statuses { padding-top: 15px; }
.post-statuses > .eyebrow { margin-bottom: 11px; }
.post-row { min-height: 38px; display: grid; grid-template-columns: 8px 65px auto 1fr auto; align-items: center; gap: 8px; border-top: 1px solid #ffffff0b; font-size: 10px; }
.post-row strong { font-size: 10px; }
.post-row small { grid-column: 2 / -1; padding-bottom: 6px; }
.platform-dot { width: 7px; height: 7px; border-radius: 50%; background: #acbdcc; }
.platform-youtube { background: #ff646b; }
.platform-tiktok { background: #80e4dc; }
.platform-instagram { background: #e49cbe; }
.text-button, .small-link { color: var(--accent); font-size: 10px; font-weight: 750; background: none; border: 0; padding: 3px; white-space: nowrap; }
.account-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 18px; align-items: stretch; }
.account-card { margin: 0; display: flex; flex-direction: column; }
.account-heading { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; }
.account-heading h2 { font-size: 18px; }
.account-heading .eyebrow { margin-bottom: 4px; }
.account-heading .pill { margin-left: auto; }
.platform-icon { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 12px; background: #263443; color: var(--accent-2); font-size: 16px; font-weight: 800; }
.platform-icon.platform-youtube { color: #ff7378; background: #42272e; }
.platform-icon.platform-tiktok { color: #82e4dd; background: #203b3d; }
.platform-icon.platform-instagram { color: #e6a4c2; background: #422c3b; }
.connected-account, .disconnected-account { display: flex; flex-direction: column; gap: 5px; font-size: 13px; min-height: 65px; }
.connected-account .muted { font-size: 10px; }
.token-state { display: flex; align-items: center; gap: 6px; color: #8cdbc7; font-size: 10px; margin-top: 4px; }
.token-state i { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.redirect-box { border: 1px solid #2b3948; border-radius: 9px; padding: 11px; margin: 15px 0 2px; display: flex; flex-direction: column; gap: 7px; background: #111923; }
.redirect-box code { color: #cde9e3; font-size: 10px; overflow-wrap: anywhere; }
.redirect-box small, .platform-note { color: #8392a3; font-size: 10px; }
.account-actions { display: flex; gap: 8px; margin-top: auto; padding-top: 14px; }
.settings-form { max-width: 860px; }
.settings-section .section-heading { margin-bottom: 16px; }
.settings-section .section-heading .muted { margin-bottom: 0; }
.toggle-row { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 14px 0; border-top: 1px solid #ffffff0d; }
.toggle-row span { display: flex; flex-direction: column; gap: 4px; }
.toggle-row strong { font-size: 12px; }
.toggle-row small { color: var(--muted); font-size: 10px; }
.toggle-row input { width: 38px; height: 21px; appearance: none; border-radius: 99px; padding: 2px; background: #344252; border: 0; transition: .18s ease; cursor: pointer; }
.toggle-row input::before { content: ""; display: block; width: 17px; height: 17px; border-radius: 50%; background: #c7d0d8; transition: .18s ease; }
.toggle-row input:checked { background: #288d7c; }
.toggle-row input:checked::before { transform: translateX(17px); background: white; }
.compact-field { max-width: 220px; margin: 12px 0 0; }
.number-input { width: 115px; }
.platform-name { font-weight: 700; }
.privacy-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.privacy-grid small { color: var(--muted); font-size: 10px; font-weight: 400; }
.safe-mode { border-color: #386259; background: linear-gradient(135deg, #1a302f, #17232b); }
.key-state { display: flex; align-items: center; gap: 8px; font-size: 12px; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; }
.dot-green { background: var(--accent); }
.dot-muted { background: #67778a; }
.save-bar { position: sticky; bottom: 0; padding: 16px 0 0; display: flex; justify-content: flex-end; background: linear-gradient(0deg, var(--bg) 70%, transparent); }
.login-page { display: grid; place-items: center; padding: 25px; }
.login-card { width: min(100%, 390px); padding: 35px; border: 1px solid var(--line); background: #18222e; border-radius: 19px; box-shadow: 0 30px 90px #0008; }
.login-brand { margin-bottom: 35px; }
.login-card h1 { font-size: 34px; }
.login-card .muted { line-height: 1.6; margin-bottom: 25px; }
.login-card .eyebrow { color: var(--accent); }
.login-card label { font-size: 11px; }
.login-card .fine-print { margin: 22px 0 0; color: #718093; font-size: 10px; text-align: center; }
.login-card code { color: #b6d3ce; }
.public-page { background: radial-gradient(ellipse at 50% -20%, #1f3842 0, transparent 48%), var(--bg); }
.public-header, .public-footer { width: min(100% - 40px, 920px); margin: 0 auto; }
.public-header { padding: 28px 0; border-bottom: 1px solid #ffffff12; }
.public-brand { color: var(--text) !important; font-size: 16px; font-weight: 800; letter-spacing: -.3px; text-decoration: none !important; }
.public-main { width: min(100% - 40px, 760px); min-height: calc(100vh - 155px); margin: 0 auto; padding: 68px 0 76px; }
.public-main h1 { margin-bottom: 20px; }
.public-description { max-width: 690px; color: #c7d2de; font-size: clamp(17px, 2.4vw, 21px); line-height: 1.7; }
.legal-copy { color: #c0cbd7; font-size: 14px; line-height: 1.75; }
.legal-copy h2 { margin: 28px 0 8px; color: var(--text); font-size: 17px; }
.legal-copy p { margin-bottom: 13px; }
.legal-copy a, .public-footer a { color: var(--accent-2); text-decoration: underline; text-underline-offset: 3px; }
.public-footer { display: flex; gap: 20px; padding: 20px 0 30px; border-top: 1px solid #ffffff12; color: var(--muted); font-size: 12px; }
@media (max-width: 900px) {
  .topbar { padding: 0 18px; gap: 20px; }
  nav { gap: 14px; }
  .page-shell { padding: 28px 18px 55px; }
  .form-grid { grid-template-columns: 1fr 1fr; }
  .field-wide { grid-column: span 2; }
  .row-actions { flex-wrap: wrap; justify-content: flex-end; }
  .queued-count { display: none; }
}
@media (max-width: 620px) {
  .public-header, .public-footer { width: min(100% - 30px, 920px); }
  .public-main { width: min(100% - 30px, 760px); min-height: calc(100vh - 145px); padding: 48px 0 56px; }
  .public-footer { flex-wrap: wrap; }
  .topbar { height: auto; min-height: 64px; flex-wrap: wrap; padding: 13px 15px; gap: 11px; }
  nav { order: 3; flex-basis: 100%; justify-content: space-between; padding-top: 5px; }
  nav a { font-size: 11px; }
  .topbar > form { margin-left: auto; }
  .page-heading { align-items: flex-start; flex-direction: column; margin-bottom: 22px; }
  .panel { padding: 17px; }
  .form-grid { grid-template-columns: 1fr; }
  .field-wide { grid-column: auto; }
  .channel-row { flex-wrap: wrap; }
  .channel-info { min-width: calc(100% - 60px); }
  .row-actions { width: 100%; justify-content: flex-start; margin-left: 50px; }
  .process-panel { grid-template-columns: 1fr; }
  .process-form { flex-direction: column; }
  .process-form .button { width: 100%; }
  .clip-grid { grid-template-columns: minmax(0, 1fr); }
  .clip-player { max-height: 480px; }
  .privacy-grid { grid-template-columns: 1fr; }
  .account-grid { grid-template-columns: 1fr; }
}
