:root {
  color-scheme: light;
  --bg: #eef3f8;
  --surface: rgba(255, 255, 255, .82);
  --surface-strong: #ffffff;
  --text: #0d1726;
  --muted: #667085;
  --line: rgba(102, 112, 133, .18);
  --brand: #246bfe;
  --brand-dark: #174ed3;
  --brand-soft: #e8efff;
  --green: #12b76a;
  --amber: #f79009;
  --red: #f04438;
  --shadow: 0 24px 80px rgba(16, 24, 40, .10);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  background:
    radial-gradient(circle at 20% 0%, rgba(36, 107, 254, .16), transparent 32%),
    radial-gradient(circle at 90% 20%, rgba(34, 197, 94, .10), transparent 30%),
    var(--bg);
  color: var(--text);
  margin: 0;
}

.hidden {
  display: none !important;
}

button,
input,
select,
textarea {
  font: inherit;
}

button,
.file-button {
  align-items: center;
  background: rgba(255, 255, 255, .78);
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text);
  cursor: pointer;
  display: inline-flex;
  font-weight: 700;
  justify-content: center;
  min-height: 40px;
  padding: 10px 16px;
  transition: .18s ease;
}

button:hover,
.file-button:hover {
  border-color: rgba(36, 107, 254, .36);
  box-shadow: 0 10px 26px rgba(36, 107, 254, .10);
  transform: translateY(-1px);
}

button:disabled {
  cursor: not-allowed;
  opacity: .48;
  transform: none;
}

.primary,
.file-button {
  background: linear-gradient(135deg, var(--brand), #66a3ff);
  border: 0;
  color: #fff;
}

.primary:hover,
.file-button:hover {
  background: linear-gradient(135deg, var(--brand-dark), #3b82ff);
}

.ghost {
  background: rgba(255, 255, 255, .62);
}

.wide {
  width: 100%;
}

.shell {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  backdrop-filter: blur(22px);
  background: rgba(255, 255, 255, .55);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 26px;
  padding: 28px 22px;
  position: sticky;
  top: 0;
  height: 100vh;
}

.brand {
  align-items: center;
  display: flex;
  gap: 12px;
}

.mark {
  align-items: center;
  background: linear-gradient(135deg, #0d1726, #246bfe);
  border-radius: 16px;
  color: #fff;
  display: inline-flex;
  font-size: 22px;
  font-weight: 900;
  height: 48px;
  justify-content: center;
  width: 48px;
}

.brand strong {
  display: block;
  font-size: 18px;
}

.brand span,
.sidebar-foot a {
  color: var(--muted);
  font-size: 13px;
}

nav {
  display: grid;
  gap: 8px;
}

nav a,
.sidebar-foot a {
  border-radius: 14px;
  color: var(--text);
  font-weight: 700;
  padding: 12px 14px;
  text-decoration: none;
}

nav a:hover {
  background: var(--brand-soft);
  color: var(--brand-dark);
}

.sidebar-foot {
  display: grid;
  gap: 10px;
  margin-top: auto;
}

.main {
  margin: 0 auto;
  max-width: 1520px;
  padding: 34px;
  width: 100%;
}

.hero {
  align-items: flex-end;
  display: flex;
  gap: 24px;
  justify-content: space-between;
  margin-bottom: 22px;
}

.hero h1 {
  font-size: clamp(34px, 5vw, 64px);
  letter-spacing: -.055em;
  line-height: .96;
  margin: 0 0 16px;
  max-width: 760px;
}

.hero p {
  max-width: 720px;
}

.hero-actions,
.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.eyebrow {
  color: var(--brand-dark);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .16em;
  margin: 0 0 8px;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h2 {
  font-size: 24px;
  letter-spacing: -.025em;
  margin: 0 0 8px;
}

p {
  color: var(--muted);
  line-height: 1.55;
}

.stats-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 18px;
}

.stat-card,
.panel {
  backdrop-filter: blur(22px);
  background: var(--surface);
  border: 1px solid rgba(255, 255, 255, .72);
  box-shadow: var(--shadow);
}

.stat-card {
  border-radius: 26px;
  padding: 22px;
}

.stat-card span {
  color: var(--muted);
  display: block;
  font-size: 13px;
  font-weight: 800;
  margin-bottom: 8px;
}

.stat-card strong {
  display: block;
  font-size: 34px;
  letter-spacing: -.04em;
}

.content-grid {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(12, minmax(0, 1fr));
}

.panel {
  border-radius: 28px;
  min-width: 0;
  padding: 24px;
}

.span-5 { grid-column: span 5; }
.span-6 { grid-column: span 6; }
.span-7 { grid-column: span 7; }
.span-12 { grid-column: span 12; }

.panel-head {
  align-items: flex-start;
  display: flex;
  gap: 18px;
  justify-content: space-between;
  margin-bottom: 16px;
}

.panel-head.compact {
  margin-bottom: 12px;
}

.toolbar {
  display: grid;
  gap: 12px;
  margin-bottom: 14px;
}

.rendition-picker {
  align-items: center;
  background: rgba(255, 255, 255, .58);
  border: 1px solid var(--line);
  border-radius: 18px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  padding: 10px 12px;
}

.rendition-picker span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.search,
input,
select,
textarea {
  background: rgba(255, 255, 255, .76);
  border: 1px solid var(--line);
  border-radius: 16px;
  color: var(--text);
  outline: none;
  padding: 12px 14px;
}

.search:focus,
input:focus,
select:focus,
textarea:focus {
  border-color: rgba(36, 107, 254, .55);
  box-shadow: 0 0 0 4px rgba(36, 107, 254, .12);
}

.search.slim {
  max-width: 320px;
  width: 100%;
}

label {
  color: var(--muted);
  display: grid;
  gap: 7px;
  font-size: 13px;
  font-weight: 800;
}

textarea {
  min-height: 132px;
  resize: vertical;
}

.crumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.crumbs button {
  font-size: 13px;
  min-height: 34px;
  padding: 7px 12px;
}

.list,
.table-list {
  background: rgba(255, 255, 255, .52);
  border: 1px solid var(--line);
  border-radius: 22px;
  overflow: hidden;
}

.row,
.table-row {
  align-items: center;
  border-bottom: 1px solid var(--line);
  display: grid;
  gap: 14px;
  padding: 14px 16px;
}

.row {
  grid-template-columns: minmax(0, 1fr) auto;
}

.table-row {
  grid-template-columns: minmax(260px, 2fr) 120px 120px minmax(180px, 1.4fr) auto;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.rendition-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

.chip {
  border-radius: 999px;
  font-size: 12px;
  min-height: 28px;
  padding: 5px 9px;
}

.danger {
  color: #b42318;
}

.row:last-child,
.table-row:last-child {
  border-bottom: 0;
}

.row strong,
.table-row strong {
  display: block;
  overflow-wrap: anywhere;
}

.row small,
.table-row small {
  color: var(--muted);
  display: block;
  overflow-wrap: anywhere;
}

.path {
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  font-size: 12px;
}

.badge {
  border-radius: 999px;
  display: inline-flex;
  font-size: 12px;
  font-weight: 900;
  justify-content: center;
  padding: 6px 10px;
  text-transform: capitalize;
}

.badge.complete { background: rgba(18, 183, 106, .12); color: #067647; }
.badge.encoding,
.badge.copying,
.badge.queued { background: rgba(36, 107, 254, .12); color: var(--brand-dark); }
.badge.failed { background: rgba(240, 68, 56, .12); color: #b42318; }

.empty {
  color: var(--muted);
  padding: 22px;
  text-align: center;
}

.pager {
  align-items: center;
  color: var(--muted);
  display: flex;
  font-size: 13px;
  font-weight: 800;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 14px;
}

.preview {
  background: linear-gradient(160deg, #d9e4f2, #97abc4);
  border-radius: 24px;
  height: 278px;
  margin: 12px 0 16px;
  overflow: hidden;
  position: relative;
}

.preview-glow {
  background: radial-gradient(circle at 70% 20%, rgba(255, 255, 255, .55), transparent 30%);
  inset: 0;
  position: absolute;
}

.mountains {
  background:
    linear-gradient(160deg, transparent 44%, rgba(76, 93, 116, .24) 45% 55%, transparent 56%) 0 92px / 180px 120px repeat-x,
    linear-gradient(145deg, transparent 44%, rgba(30, 45, 70, .24) 45% 55%, transparent 56%) 40px 134px / 120px 90px repeat-x;
  inset: 0 0 56px;
  position: absolute;
}

.playerbar {
  align-items: center;
  background: rgba(13, 23, 38, .58);
  bottom: 0;
  color: white;
  display: flex;
  gap: 12px;
  height: 56px;
  left: 0;
  padding: 0 16px;
  position: absolute;
  right: 0;
}

.play {
  border-bottom: 7px solid transparent;
  border-left: 11px solid white;
  border-top: 7px solid transparent;
}

.track,
.mini {
  background: white;
  border-radius: 999px;
  height: 9px;
  opacity: .86;
}

.track {
  max-width: 280px;
  width: 45%;
}

.mini {
  width: 88px;
}

.watermark {
  cursor: grab;
  display: none;
  max-width: 80%;
  position: absolute;
  touch-action: none;
  user-select: none;
}

.watermark:active {
  cursor: grabbing;
}

.file-button input {
  display: none;
}

.form-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 14px;
}

.checkbox {
  align-items: center;
  display: flex;
  flex-direction: row;
  gap: 10px;
}

.status {
  color: var(--muted);
  margin: 12px 0 0;
}

.secret-box {
  background: #0d1726;
  border-radius: 16px;
  color: white;
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  margin: 12px 0;
  overflow-wrap: anywhere;
  padding: 14px;
}

.api-key-form {
  display: grid;
  gap: 10px;
  grid-template-columns: 1fr auto;
  margin-bottom: 14px;
}

.auth-gate {
  align-items: center;
  backdrop-filter: blur(20px);
  background: rgba(238, 243, 248, .86);
  display: flex;
  inset: 0;
  justify-content: center;
  padding: 24px;
  position: fixed;
  z-index: 20;
}

.auth-card {
  background: rgba(255, 255, 255, .88);
  border: 1px solid rgba(255, 255, 255, .78);
  border-radius: 30px;
  box-shadow: var(--shadow);
  display: grid;
  gap: 14px;
  max-width: 480px;
  padding: 32px;
  width: 100%;
}

.auth-card h1 {
  font-size: 40px;
  letter-spacing: -.05em;
  margin: 0;
}

@media (max-width: 1180px) {
  .shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    height: auto;
    position: static;
  }

  nav {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  .sidebar-foot {
    grid-template-columns: 1fr auto;
  }

  .span-5,
  .span-6,
  .span-7,
  .span-12 {
    grid-column: span 12;
  }
}

@media (max-width: 760px) {
  .main {
    padding: 20px;
  }

  .hero,
  .panel-head {
    display: grid;
  }

  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .table-row {
    grid-template-columns: 1fr;
  }

  .form-grid,
  .api-key-form {
    grid-template-columns: 1fr;
  }

  nav {
    grid-template-columns: 1fr 1fr;
  }
}
