/* 8e8 Video Desk: 8e8.in's light look, copied from the approved mockup. */
:root {
  --bg: #F7F6F3; --panel: #FFFFFF; --ink: #16171B; --muted: #5D5F66; --dim: #8E9097;
  --rule: rgba(22,23,27,.09); --rule-2: rgba(22,23,27,.2); --chip: #F1F0EC;
  --indigo: #4350D8; --indigo-ink: #2F3AB0; --indigo-2: #5562E8; --indigo-soft: #ECEEFD; --indigo-row: #FAFAFE;
  --amber: #E08A2E; --amber-ink: #7A4512; --amber-soft: #FDF0E3; --gold: #FFD08A; --bad: #B42318;
  --sans: 'Geist', system-ui, -apple-system, sans-serif; --mono: 'Geist Mono', ui-monospace, monospace; --serif: 'Instrument Serif', Georgia, serif;
}
* { box-sizing: border-box }
html, body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--sans); -webkit-text-size-adjust: 100% }
a { color: var(--indigo) } a:hover { color: var(--indigo-ink) }
button { font: inherit; cursor: pointer }
[hidden] { display: none !important }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap }
.page { min-height: 100vh; display: flex; flex-direction: column }
.wrap { width: 100%; max-width: 1080px; margin: 0 auto; padding: 0 32px }

/* header + footer */
.top { border-bottom: 1px solid var(--rule) }
.top .wrap { height: 72px; display: flex; align-items: center; justify-content: space-between; gap: 16px }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink) }
.brand b { font-size: 21px; font-weight: 600; letter-spacing: -.03em }
.brand i { width: 1px; height: 20px; background: var(--rule-2) }
.brand span { font-size: 15px; color: var(--muted) }
.who { display: flex; align-items: center; gap: 20px; font-size: 14px; min-width: 0 }
.who span { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap }
.btn-line { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 16px; border: 1px solid var(--rule-2); border-radius: 10px; background: transparent; color: var(--ink); text-decoration: none; font-size: 14px; white-space: nowrap }
.foot { border-top: 1px solid var(--rule); margin-top: auto }
.foot .wrap { padding-top: 22px; padding-bottom: 22px; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; font-size: 13px; color: var(--muted) }

main.wrap { flex-grow: 1; padding-top: 64px; padding-bottom: 48px; display: flex; flex-direction: column; gap: 40px }
.eyebrow { font-family: var(--mono); font-size: 12px; letter-spacing: .14em; color: var(--muted); text-transform: uppercase }
.hero { display: flex; flex-direction: column; gap: 14px }
h1 { margin: 0; font-size: 46px; line-height: 1.08; font-weight: 500; letter-spacing: -.025em }
h1 em { font-family: var(--serif); font-style: italic; font-weight: 400; font-size: 1.13em }
.lede { margin: 0; font-size: 17px; line-height: 1.55; color: var(--muted); max-width: 600px }
h2 { margin: 0; font-size: 20px; font-weight: 500; letter-spacing: -.01em }
h2 small { color: var(--muted); font-weight: 400; font-size: inherit }
.sec { display: flex; flex-direction: column; gap: 14px }
.sec-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap }
.note { font-size: 13px; color: var(--muted) }
.back { align-self: flex-start; display: inline-flex; align-items: center; gap: 8px; font-size: 14px; color: var(--muted); text-decoration: none; background: none; border: 0; padding: 0; min-height: 44px }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 48px; padding: 0 22px; border-radius: 12px; border: 0; background: var(--ink); color: #fff; font-size: 15px; font-weight: 500; text-decoration: none }
.btn:hover { color: #fff; background: #2a2c33 }
.btn:disabled { opacity: .45; cursor: default }
.btn.ghost { background: transparent; color: var(--ink); border: 1px solid var(--rule-2) }
.btn.indigo { background: var(--indigo) } .btn.indigo:hover { background: var(--indigo-ink) }
.btn.small { height: 44px; padding: 0 16px; font-size: 14px }
.row-btns { display: flex; flex-wrap: wrap; gap: 12px }

/* monthly tiles */
.tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px }
.tile { background: var(--panel); border: 1px solid var(--rule); border-radius: 18px; padding: 20px 22px; display: flex; flex-direction: column; gap: 10px; min-width: 0 }
.tile .k { font-family: var(--mono); font-size: 11.5px; letter-spacing: .1em; color: var(--muted) }
.tile .v { font-size: 40px; font-weight: 500; letter-spacing: -.03em; line-height: 1 }
.tile .v small { font-size: 16px; font-weight: 400; color: var(--muted); letter-spacing: 0 }
.tile .s { font-size: 13px; color: var(--muted) }
.tile.dark { background: var(--ink); color: #fff; border-color: var(--ink) }
.tile.dark .k, .tile.dark .v small { color: #B7BCC8 }
.bar { height: 6px; border-radius: 999px; background: var(--indigo-soft); overflow: hidden }
.bar > i { display: block; height: 100%; width: 0; border-radius: 999px; background: var(--indigo); transition: width .3s }
.tile.dark .bar { background: rgba(255,255,255,.16) } .tile.dark .bar > i { background: var(--gold) }
.tile .v.accent { color: var(--indigo-ink) }
.linkish { background: none; border: 0; padding: 0; color: var(--indigo); font-size: 13px; text-align: left; text-decoration: none; min-height: 24px }

/* drop zone + limit panel */
.drop { display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 44px 24px; background: var(--panel); border: 1.5px dashed rgba(22,23,27,.22); border-radius: 20px; text-align: center; transition: border-color .2s, background .2s }
.drop.over { border-color: var(--indigo); background: var(--indigo-row) }
.drop .ic { width: 52px; height: 52px; border-radius: 999px; background: var(--indigo-soft); display: flex; align-items: center; justify-content: center }
.drop .t { font-size: 19px; font-weight: 500; letter-spacing: -.01em }
.drop .s { font-size: 14px; color: var(--muted); margin-top: -6px }
.limit { display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 32px 24px; background: var(--panel); border: 1.5px solid rgba(22,23,27,.12); border-radius: 20px; text-align: center }
.limit .ic { width: 52px; height: 52px; border-radius: 999px; background: var(--amber-soft); display: flex; align-items: center; justify-content: center }
.limit h2 { font-size: 20px }
.limit p { margin: 0; color: var(--muted); font-size: 15px; line-height: 1.5; max-width: 460px }

/* video list */
.list { background: var(--panel); border: 1px solid var(--rule); border-radius: 18px; overflow: hidden }
.vrow { display: grid; grid-template-columns: minmax(0,1fr) 130px 80px 130px 150px; gap: 16px; align-items: center; padding: 18px 24px; border-bottom: 1px solid rgba(22,23,27,.07) }
.vrow:last-child { border-bottom: 0 }
.vrow.head { padding: 14px 24px; font-family: var(--mono); font-size: 11.5px; letter-spacing: .1em; color: var(--muted); border-bottom: 1px solid var(--rule) }
.vrow.is-ready { background: var(--indigo-row) }
.vname { display: flex; align-items: center; gap: 14px; min-width: 0 }
.vname .ic { flex-shrink: 0; width: 44px; height: 44px; border-radius: 10px; background: var(--chip); display: flex; align-items: center; justify-content: center }
.is-editing .vname .ic { background: var(--amber-soft) } .is-ready .vname .ic { background: var(--indigo-soft) }
.vname div { min-width: 0; display: flex; flex-direction: column; gap: 3px }
.vname b { font-size: 15px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis }
.vname small { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis }
.is-ready .vname small { color: var(--indigo) }
.cell { font-size: 14px; color: var(--muted) }
.badge { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 999px; background: var(--chip); font-size: 13px; font-weight: 500 }
.badge::before { content: ""; width: 7px; height: 7px; border-radius: 999px; background: var(--dim) }
.badge.editing { background: var(--amber-soft); color: var(--amber-ink) } .badge.editing::before { background: var(--amber) }
.badge.ready { background: var(--indigo-soft); color: var(--indigo-ink) } .badge.ready::before { background: var(--indigo) }
.act { text-align: right; font-size: 13px; color: var(--muted) }
.dl { display: inline-flex; align-items: center; gap: 8px; padding: 10px 16px; min-height: 44px; background: var(--indigo); color: #fff; border-radius: 12px; font-size: 14px; font-weight: 500; text-decoration: none }
.dl:hover { color: #fff; background: var(--indigo-ink) }
.empty { padding: 40px 24px; text-align: center; color: var(--muted); font-size: 15px }
.mobile-meta, .m-only { display: none }
.act { display: flex; flex-direction: column; align-items: flex-end; gap: 8px }

/* template picker */
.tgrid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 16px }
.tcard { position: relative; background: var(--panel); border: 1px solid rgba(22,23,27,.12); border-radius: 18px; overflow: hidden; display: flex; flex-direction: column; text-align: left; padding: 0; color: inherit }
.tcard.on { border: 2px solid var(--indigo); margin: -1px }
.tcard .pick { all: unset; position: absolute; inset: 0; cursor: pointer; border-radius: 18px; z-index: 1 }
.tcard .pick:focus-visible { outline: 3px solid var(--indigo-2); outline-offset: 2px }
.tcard .pv { position: relative; height: 150px; background: #EFEDE7; display: flex; align-items: center; justify-content: center }
.tcard .pv img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover }
.tcard.on .pv { background: #121925 }
.frame { width: 52px; height: 92px; border-radius: 8px; border: 1.5px solid rgba(22,23,27,.3) }
.frame.wide { width: 128px; height: 72px }
.tcard.on .frame { border-color: rgba(255,255,255,.5) }
.chip-on { position: absolute; top: 10px; left: 10px; padding: 4px 9px; border-radius: 999px; background: var(--indigo); color: #fff; font-size: 12px; font-weight: 500; display: none; align-items: center; gap: 5px }
.tcard.on .chip-on { display: inline-flex }
.chip-last { position: absolute; top: 10px; right: 10px; padding: 4px 9px; border-radius: 999px; background: rgba(255,255,255,.85); color: var(--ink); font-size: 12px }
.tcard .body { padding: 16px; display: flex; flex-direction: column; gap: 8px; flex-grow: 1 }
.tcard .nm { font-size: 16px; font-weight: 500 }
.tcard .ln { font-size: 13px; line-height: 1.45; color: var(--muted); flex-grow: 1 }
.tcard .ft { display: flex; align-items: center; justify-content: space-between; gap: 8px }
.tcard .shape { font-family: var(--mono); font-size: 11.5px; color: var(--muted); white-space: nowrap }
.tcard .ft { flex-wrap: wrap }
.tcard .watch { position: relative; z-index: 2; background: none; border: 0; padding: 0; color: var(--indigo); font-size: 13px; font-weight: 500; min-height: 44px; display: inline-flex; align-items: center; gap: 6px }
.tcard .soon { font-size: 13px; color: var(--muted); min-height: 44px; display: inline-flex; align-items: center }
.prow { display: grid; grid-template-columns: minmax(0,1fr) 260px; gap: 16px; align-items: center; padding: 16px 22px; border-bottom: 1px solid rgba(22,23,27,.07) }
.prow:last-child { border-bottom: 0 }
.prow label { font-size: 12px; color: var(--muted) }
.prow.changed label { color: var(--amber-ink) }
.prow select { width: 100%; height: 44px; padding: 0 12px; border: 1px solid var(--rule-2); border-radius: 10px; background: #fff; font: inherit; font-size: 14px; color: var(--ink) }
.prow.changed select { border-color: var(--amber) }
.prow .err { color: var(--bad); font-size: 13px }
.go-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; padding: 20px 22px; background: var(--panel); border: 1px solid var(--rule); border-radius: 18px }
.go-bar span { font-size: 14px; color: var(--muted) } .go-bar b { color: var(--ink); font-weight: 600 }
.msg { margin: 0; font-size: 14px; color: var(--muted) } .msg.bad { color: var(--bad) }

/* uploading */
.info { display: flex; align-items: flex-start; gap: 12px; padding: 16px 18px; background: var(--panel); border: 1px solid var(--rule); border-radius: 14px; font-size: 14px; line-height: 1.5 }
.ucard { background: var(--panel); border: 1px solid var(--rule); border-radius: 16px; padding: 20px 22px; display: flex; flex-direction: column; gap: 14px }
.ucard .top-line { display: flex; align-items: center; justify-content: space-between; gap: 16px }
.ucard b { font-size: 15px; font-weight: 500; overflow-wrap: anywhere }
.ucard small { display: block; font-size: 13px; color: var(--muted); margin-top: 3px }
.ucard .pct { font-family: var(--mono); font-size: 14px; flex-shrink: 0 }
.ucard.done .pct { color: var(--indigo-ink); font-family: var(--sans); font-weight: 500; display: inline-flex; align-items: center; gap: 6px }
.ucard.paused small, .ucard.paused .pct { color: var(--amber-ink) }
.ucard.paused .bar { background: var(--amber-soft) } .ucard.paused .bar > i { background: var(--amber) }
.ucard.failed small, .ucard.failed .pct { color: var(--bad) }
.ucard .bar > i { background: var(--indigo-2) } .ucard.done .bar > i { background: var(--indigo) }
.uploads { display: flex; flex-direction: column; gap: 12px }

dialog.sample { border: 0; border-radius: 18px; padding: 0; background: #000; max-width: min(92vw, 900px); max-height: 92vh }
dialog.sample::backdrop { background: rgba(10,11,14,.72) }
dialog.sample video { display: block; max-width: min(92vw, 900px); max-height: 82vh; background: #000 }
dialog.sample .bar2 { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 14px; background: #fff; font-size: 14px }

@media (max-width: 900px) {
  .tgrid { grid-template-columns: repeat(2, minmax(0,1fr)) }
  .prow { grid-template-columns: minmax(0,1fr) }
}
@media (max-width: 760px) {
  .wrap { padding: 0 16px }
  main.wrap { padding-top: 32px; gap: 28px }
  h1 { font-size: 34px }
  .top .wrap { height: 64px }
  .who > span { display: none }
  .tiles { grid-template-columns: repeat(2, minmax(0,1fr)); gap: 10px }
  .tile { padding: 16px; border-radius: 16px }
  .tile .v { font-size: 32px }
  .drop { padding: 28px 16px }
  .drop .hint-desk { display: none }
  .vrow { grid-template-columns: minmax(0,1fr) auto; padding: 16px }
  .vrow.head { display: none }
  .vrow .cell, .vrow .badge-cell { display: none }
  .vname small.mobile-meta { display: block } .vname small.desk-meta { display: none }
  .m-only { display: inline-flex }
  .vname .ic { display: none }
  .tgrid { gap: 10px }
  .tcard .pv { height: 120px }
  .go-bar .row-btns { width: 100% } .go-bar .btn { flex: 1 }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important } }
