:root {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #172337;
  background: #f5f7fb;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  --accent: #4f46e5;
  --muted: #617087;
  --line: #e2e7ef;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
button, input { font: inherit; }
button, a, input { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button:disabled { cursor: wait; opacity: .58; }
button:focus-visible, a:focus-visible, input:focus-visible, video:focus-visible { outline: 3px solid #a5b4fc; outline-offset: 4px; }
a { color: var(--accent); }
h1, h2, p { margin-top: 0; }
h1 { font-size: clamp(1.9rem, 4vw, 2.6rem); line-height: 1.15; letter-spacing: -.045em; margin-bottom: 10px; }
h2 { font-size: 1.16rem; letter-spacing: -.025em; margin-bottom: 7px; }
p { line-height: 1.65; }
.skip-link { position: absolute; top: -60px; left: 16px; z-index: 5; background: white; padding: 12px; border: 2px solid var(--accent); border-radius: 8px; }
.skip-link:focus { top: 12px; }
.site-header { background: #fff; border-bottom: 1px solid var(--line); }
.header-content { max-width: 1200px; margin: auto; min-height: 80px; padding: 16px 32px; display: flex; justify-content: space-between; align-items: center; gap: 20px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: #172337; text-decoration: none; font-size: 1.08rem; font-weight: 750; letter-spacing: -.025em; white-space: nowrap; }
.brand-icon { display: grid; place-items: center; width: 38px; height: 38px; background: #eef0ff; color: var(--accent); border-radius: 12px; }
.brand-icon svg { width: 25px; height: 25px; }
.account-actions { display: flex; align-items: center; gap: 16px; min-width: 0; }
.session-label { color: var(--muted); font-size: .85rem; overflow-wrap: anywhere; max-width: 330px; }
.page-shell { max-width: 1200px; padding: 32px; margin: auto; }
.button { display: inline-flex; justify-content: center; align-items: center; gap: 10px; padding: 12px 19px; border: 1px solid var(--accent); border-radius: 9px; background: var(--accent); color: white; font-size: .89rem; font-weight: 650; line-height: 1.35; text-decoration: none; white-space: nowrap; transition: background .15s, border-color .15s; }
.button:hover:not(:disabled) { background: #4037ce; border-color: #4037ce; }
.button-secondary { background: white; color: #35445a; border-color: #d5ddea; }
.button-secondary:hover:not(:disabled) { background: #f1f3fa; border-color: #b9c5db; }
.button-small { padding: 9px 14px; font-size: .82rem; }
.notice { border: 1px solid #c8d6f6; background: #edf3ff; color: #263f71; padding: 14px 18px; border-radius: 10px; margin-bottom: 22px; font-size: .91rem; line-height: 1.6; overflow-wrap: anywhere; }
.notice-warning { background: #fff8e8; border-color: #f1dbab; color: #725018; }
.notice.error, .notice-error { background: #fff0f0; border-color: #efc8c8; color: #973a3a; }
.notice.success, .notice-success { background: #edfaf3; border-color: #bce5cf; color: #24694a; }
.muted { color: var(--muted); font-size: .84rem; line-height: 1.6; }
.eyebrow { display: block; color: var(--accent); text-transform: uppercase; letter-spacing: .13em; font-size: .69rem; font-weight: 750; margin-bottom: 14px; }
.welcome-panel { display: grid; grid-template-columns: 1.1fr 1fr; align-items: center; gap: 60px; min-height: 500px; padding: 56px 48px; background: white; border: 1px solid var(--line); border-radius: 20px; }
.welcome-copy h1 { font-size: clamp(2.7rem, 5vw, 3.9rem); }
.welcome-copy p { color: var(--muted); max-width: 430px; margin: 22px 0 26px; }
.welcome-note { display: block; margin-top: 16px; font-size: .77rem; color: var(--muted); }
.welcome-art { padding: 30px 15px; }
.art-video { aspect-ratio: 1.45; padding: 20px; display: flex; flex-direction: column; align-items: center; justify-content: space-between; border-radius: 18px; background: linear-gradient(145deg, #252842, #454683); color: white; transform: rotate(-4deg); box-shadow: 0 25px 45px #2e3a5b25; }
.art-label { align-self: flex-start; font-size: .7rem; letter-spacing: .04em; opacity: .8; }
.art-play { width: 66px; height: 66px; display: grid; place-items: center; padding-left: 4px; background: #ffffff20; border: 1px solid #ffffff50; border-radius: 50%; font-size: 1.4rem; }
.art-timeline { height: 4px; width: 100%; border-radius: 3px; background: #ffffff30; }
.art-timeline span { display: block; height: 4px; width: 60%; background: #c7caff; border-radius: 3px; }
.art-status { position: relative; width: max-content; max-width: 100%; margin: -6px auto 0; padding: 15px 21px; display: flex; align-items: center; gap: 9px; font-size: .77rem; font-weight: 650; border: 1px solid var(--line); background: white; border-radius: 11px; box-shadow: 0 10px 25px #2e3a5b0a; }
.status-dot, .stat-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: #22a16c; flex-shrink: 0; }
.workspace-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin: 10px 0 30px; }
.workspace-heading .eyebrow { margin-bottom: 9px; }
.workspace-heading p { color: var(--muted); margin-bottom: 0; font-size: .91rem; }
.refresh-actions { display: flex; align-items: center; gap: 14px; flex-shrink: 0; }
.refresh-actions .muted { font-size: .75rem; }
.upload-panel { padding: 27px 30px; background: white; border: 1px solid var(--line); border-radius: 14px; }
.upload-heading { display: flex; align-items: center; gap: 13px; margin-bottom: 22px; }
.upload-heading h2 { margin-bottom: 3px; }
.upload-heading p { font-size: .85rem; color: var(--muted); margin: 0; }
.upload-icon { width: 42px; height: 42px; display: grid; place-items: center; flex-shrink: 0; background: #eef0ff; color: var(--accent); border-radius: 12px; font-size: 1.5rem; font-weight: 500; }
.upload-controls { display: flex; align-items: center; gap: 24px; }
.file-field { display: flex; flex-direction: column; gap: 9px; flex: 1; min-width: 0; }
.file-field label { color: #455369; font-size: .75rem; font-weight: 650; }
input[type=file] { width: 100%; background: #f8f9fc; border: 1px dashed #cbd3e3; border-radius: 9px; padding: 11px; color: #53627b; font-size: .83rem; }
input[type=file]::file-selector-button { background: white; color: #35445a; border: 1px solid #d5ddea; border-radius: 6px; padding: 8px 12px; margin-right: 12px; cursor: pointer; font: inherit; }
#selected-file { font-size: .75rem; overflow-wrap: anywhere; }
.upload-status { margin: 12px 0 0; font-size: .84rem; color: var(--muted); overflow-wrap: anywhere; }
.upload-status:empty { margin: 0; }
progress { width: 100%; height: 9px; margin-top: 20px; border: 0; border-radius: 6px; accent-color: var(--accent); }
progress::-webkit-progress-bar { background: #edf0f7; border-radius: 6px; }
progress::-webkit-progress-value { background: var(--accent); border-radius: 6px; }
progress::-moz-progress-bar { background: var(--accent); border-radius: 6px; }
.stats-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin: 22px 0 38px; }
.stat { background: white; border: 1px solid var(--line); border-radius: 12px; padding: 19px 22px; display: flex; justify-content: space-between; align-items: center; gap: 15px; }
.stat-label { display: flex; align-items: center; gap: 9px; color: #607089; font-size: .79rem; }
.stat strong { font-size: 1.5rem; font-weight: 700; letter-spacing: -.05em; }
.dot-amber { background: #d89a24; }
.dot-green { background: #22a16c; }
.dot-indigo { background: #7771e8; }
.library-section { margin-top: 34px; padding-top: 5px; }
.section-heading { display: flex; justify-content: space-between; align-items: center; gap: 18px; margin-bottom: 17px; }
.section-heading p { color: var(--muted); font-size: .83rem; margin-bottom: 0; }
.section-note { white-space: nowrap; color: #77859a; font-size: .72rem; }
.video-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.video-card { min-width: 0; background: white; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.card-thumbnail, .thumbnail-placeholder { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; background: #e9edf6; }
.thumbnail-placeholder { display: grid; place-items: center; color: #7d89a3; font-size: .8rem; }
.card-body { padding: 17px 18px 18px; }
.card-title { margin: 0 0 9px; font-size: .93rem; font-weight: 650; line-height: 1.45; overflow-wrap: anywhere; }
.card-meta { font-size: .74rem; color: var(--muted); line-height: 1.6; margin: 8px 0 0; overflow-wrap: anywhere; }
.status-badge { display: inline-flex; align-items: center; width: max-content; max-width: 100%; border-radius: 5px; padding: 4px 7px; font-size: .64rem; letter-spacing: .035em; font-weight: 700; background: #eff2f7; color: #5d6a80; }
.status-PENDING { color: #96691b; background: #fff5dd; }
.status-PROCESSING { color: #4f46c7; background: #efedff; }
.status-FAILED { color: #af4141; background: #ffeded; }
.status-COMPLETED { color: #237b51; background: #e7f6ee; }
.card-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 17px; }
.card-actions .button { padding: 8px 12px; font-size: .76rem; }
.empty-state { grid-column: 1 / -1; border: 1px dashed #d7dfeb; border-radius: 12px; background: #ffffff70; padding: 30px 24px; margin: 0; text-align: center; color: #738199; font-size: .85rem; }
.load-more { display: flex; justify-content: center; margin-top: 22px; }
#community-status:empty { display: none; }
.site-footer { display: flex; align-items: center; justify-content: center; gap: 9px; padding-top: 42px; padding-bottom: 8px; color: #8993a6; font-size: .72rem; }
dialog { width: min(900px, calc(100% - 32px)); max-height: calc(100vh - 48px); border: 1px solid var(--line); padding: 20px; border-radius: 16px; background: white; color: #172337; box-shadow: 0 25px 80px #00000030; }
dialog::backdrop { background: #101827b3; }
.dialog-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 18px; }
.dialog-heading h2 { font-size: 1rem; margin: 0; overflow-wrap: anywhere; }
#video-player { display: block; width: 100%; max-height: calc(100vh - 170px); background: #111725; border-radius: 8px; }
@media (max-width: 900px) {
  .welcome-panel { gap: 25px; padding: 40px 30px; }
  .video-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .workspace-heading { align-items: flex-start; }
  .refresh-actions { flex-direction: column-reverse; align-items: flex-end; gap: 8px; }
  .stat { padding: 17px; }
}
@media (max-width: 620px) {
  .header-content { min-height: 72px; padding: 15px 18px; gap: 12px; }
  .brand { font-size: .97rem; gap: 8px; }
  .brand-icon { width: 32px; height: 32px; border-radius: 10px; }
  .account-actions { gap: 8px; }
  .session-label { max-width: 105px; font-size: .66rem; }
  .page-shell { padding: 23px 18px; }
  .welcome-panel { grid-template-columns: 1fr; min-height: auto; padding: 32px 25px; gap: 15px; }
  .welcome-copy h1 { font-size: 2.65rem; }
  .welcome-copy p { font-size: .9rem; }
  .welcome-art { max-width: 340px; margin: auto; width: 100%; padding-bottom: 0; }
  .workspace-heading { flex-direction: column; gap: 16px; margin-top: 0; }
  .refresh-actions { flex-direction: row; align-items: center; gap: 12px; }
  .upload-panel { padding: 21px 18px; }
  .upload-controls { flex-direction: column; align-items: stretch; gap: 17px; }
  .upload-heading { align-items: flex-start; }
  .upload-heading p { font-size: .79rem; }
  .stats-grid { gap: 9px; margin-bottom: 29px; }
  .stat { flex-direction: column; align-items: flex-start; padding: 13px 11px; gap: 12px; }
  .stat-label { font-size: .65rem; gap: 5px; line-height: 1.4; }
  .stat-dot { width: 5px; height: 5px; }
  .stat strong { font-size: 1.3rem; }
  .section-heading { flex-direction: column; align-items: flex-start; gap: 9px; }
  .section-heading p { font-size: .79rem; }
  .video-grid { grid-template-columns: 1fr; gap: 14px; }
  .library-section { margin-top: 28px; }
  .empty-state { padding: 25px 18px; font-size: .8rem; }
  dialog { padding: 15px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }
