:root {
  color-scheme: dark;
  --bg: #0d1017;
  --panel: #171d29;
  --panel-strong: #202838;
  --text: #f6f8fb;
  --muted: #9da8b8;
  --line: #30394a;
  --green: #41d38b;
  --cyan: #6cc7ff;
  --amber: #ffcc66;
  --red: #ff6b6b;
  --focus: #9ddcff;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(108, 199, 255, 0.16), transparent 34rem),
    linear-gradient(135deg, #0d1017 0%, #15151e 52%, #111b18 100%);
  color: var(--text);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body[data-theme="juice"] {
  --bg: #100b15;
  --panel: #1a1122;
  --panel-strong: #241532;
  --text: #fff9fb;
  --muted: #cbbbd8;
  --line: #55325f;
  --green: #ffe45e;
  --cyan: #65f4ff;
  --amber: #ff9f45;
  --red: #ff4f8b;
  --focus: #ffb7ef;
  background:
    linear-gradient(135deg, rgba(255, 79, 139, 0.16), transparent 34%),
    linear-gradient(225deg, rgba(101, 244, 255, 0.12), transparent 42%),
    linear-gradient(145deg, #100b15 0%, #1b1024 48%, #091d24 100%);
}

body[data-theme="nf"] {
  --bg: #050505;
  --panel: #111111;
  --panel-strong: #1c1c1c;
  --text: #f7f7f7;
  --muted: #b5b5b5;
  --line: #3a3a3a;
  --green: #f2f2f2;
  --cyan: #d8d8d8;
  --amber: #cfcfcf;
  --red: #d83b3b;
  --focus: #ffffff;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(180deg, #050505 0%, #111111 44%, #070707 100%);
  background-size: 56px 56px, auto;
}

body[data-theme="billie"] {
  --bg: #030704;
  --panel: #07110a;
  --panel-strong: #0c1c10;
  --text: #f2fff5;
  --muted: #a6b8ad;
  --line: #1f5b2c;
  --green: #9dff2f;
  --cyan: #69e6ff;
  --amber: #d9ff7a;
  --red: #ff5d7a;
  --focus: #b6ff42;
  background:
    linear-gradient(120deg, rgba(157, 255, 47, 0.16), transparent 36%),
    linear-gradient(240deg, rgba(105, 230, 255, 0.11), transparent 38%),
    linear-gradient(180deg, #020403 0%, #07140a 50%, #030704 100%);
}

body[data-theme="x"] {
  --bg: #07090d;
  --panel: #10131a;
  --panel-strong: #171b24;
  --text: #fffdf4;
  --muted: #c8ced8;
  --line: #30445f;
  --green: #f4d13d;
  --cyan: #4da5ff;
  --amber: #ffdd55;
  --red: #ff4f4f;
  --focus: #f4d13d;
  background:
    linear-gradient(135deg, rgba(77, 165, 255, 0.18), transparent 34%),
    linear-gradient(315deg, rgba(244, 209, 61, 0.15), transparent 40%),
    linear-gradient(180deg, #07090d 0%, #10131a 48%, #060708 100%);
}

button,
input,
select {
  font: inherit;
}

.theme-picker {
  position: fixed;
  top: 14px;
  left: 14px;
  z-index: 20;
  display: grid;
  grid-template-columns: auto minmax(132px, 1fr);
  gap: 8px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(13, 16, 23, 0.92);
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.28);
  padding: 8px;
}

.theme-picker label {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.theme-picker select {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-strong);
  color: var(--text);
  padding: 0 10px;
}

.topic-sidebar {
  position: fixed;
  top: 116px;
  left: 14px;
  z-index: 19;
  display: grid;
  gap: 10px;
  width: 238px;
  max-height: calc(100vh - 132px);
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(13, 16, 23, 0.92);
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.28);
  padding: 10px;
}

.topic-sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.topic-sidebar-header h2 {
  margin-bottom: 0;
  font-size: 1rem;
}

.topic-sidebar-header span {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 8px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.topic-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.topic-form input {
  min-width: 0;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-strong);
  color: var(--text);
  padding: 0 10px;
}

.topic-form button,
.topic-page,
.remove-topic {
  min-height: 36px;
  padding: 0 10px;
  font-size: 0.86rem;
}

.topic-list {
  display: grid;
  gap: 8px;
}

.topic-page-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px;
}

.topic-page {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  border: 1px solid var(--line);
  background: rgba(32, 40, 56, 0.72);
  color: var(--text);
  text-align: left;
}

.topic-page.active {
  border-color: rgba(65, 211, 139, 0.52);
  background: rgba(65, 211, 139, 0.14);
  color: var(--green);
}

.topic-page span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topic-page strong {
  color: var(--muted);
  font-size: 0.78rem;
}

.remove-topic {
  border: 1px solid rgba(255, 107, 107, 0.42);
  background: rgba(255, 107, 107, 0.1);
  color: #ffd6d6;
}

.right-rail {
  position: fixed;
  top: 116px;
  right: 14px;
  z-index: 19;
  display: grid;
  gap: 16px;
  width: 340px;
  max-height: calc(100vh - 132px);
  overflow: auto;
}

.rail-card {
  display: grid;
  gap: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(13, 16, 23, 0.92);
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.28);
  padding: 16px;
}

.rail-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.rail-card-header h2 {
  margin-bottom: 0;
  font-size: 1.18rem;
}

.rail-card-header span {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 10px;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 800;
}

.rail-stats,
.rail-recent-list {
  display: grid;
  gap: 10px;
}

.rail-stats div,
.rail-video {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(32, 40, 56, 0.68);
  padding: 14px;
}

.rail-stats span,
.rail-video span,
.rail-empty {
  color: var(--muted);
  font-size: 0.92rem;
}

.rail-stats strong,
.rail-video strong {
  display: block;
  min-width: 0;
  overflow: hidden;
  color: var(--text);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rail-video {
  display: grid;
  gap: 10px;
}

.rail-cover {
  width: 100%;
  border-radius: 8px;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.rail-video-copy {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
}

.rail-video-copy button {
  min-height: 40px;
  padding: 0 14px;
  font-size: 0.9rem;
}

.rail-empty {
  margin-bottom: 0;
}

.shell {
  position: relative;
  z-index: 2;
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 128px 0 56px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 24px;
  align-items: end;
  margin-bottom: 28px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--green);
  font-size: 0.83rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

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

h1 {
  max-width: 760px;
  margin-bottom: 12px;
  font-size: clamp(2.2rem, 5vw, 4.6rem);
  line-height: 0.96;
  letter-spacing: 0;
}

.lede {
  max-width: 680px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 1.08rem;
  line-height: 1.6;
}

.limits {
  display: grid;
  gap: 8px;
  min-width: 220px;
}

.limits span {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(23, 29, 41, 0.74);
  padding: 10px 12px;
  color: var(--muted);
  font-size: 0.92rem;
}

.limits a {
  border: 1px solid rgba(65, 211, 139, 0.42);
  border-radius: 8px;
  background: rgba(65, 211, 139, 0.12);
  padding: 10px 12px;
  color: var(--green);
  font-size: 0.92rem;
  font-weight: 800;
  text-decoration: none;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(340px, 0.75fr);
  gap: 18px;
  align-items: start;
}

.panel,
.status-panel,
.compatibility {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(23, 29, 41, 0.92);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.24);
}

.panel {
  display: grid;
  gap: 18px;
  padding: 18px;
}

.setup-warning {
  border: 1px solid rgba(255, 204, 102, 0.46);
  border-radius: 8px;
  background: rgba(255, 204, 102, 0.11);
  color: #ffe4a8;
  padding: 12px;
  line-height: 1.45;
}

.auth-panel {
  display: grid;
  gap: 12px;
  border: 1px solid rgba(121, 242, 192, 0.32);
  border-radius: 8px;
  background: rgba(65, 211, 139, 0.08);
  padding: 14px;
}

.auth-panel strong,
.auth-panel small {
  display: block;
}

.auth-panel small {
  color: var(--muted);
  line-height: 1.45;
}

.auth-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 8px;
}

.auth-actions input {
  min-width: 0;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0a0d13;
  color: var(--text);
  padding: 0 12px;
}

.drop-zone.locked {
  opacity: 0.68;
}

.drop-zone.locked input {
  cursor: not-allowed;
}

.drop-zone {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 240px;
  border: 2px dashed #47546a;
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(108, 199, 255, 0.09), rgba(65, 211, 139, 0.08));
  text-align: center;
  transition:
    border-color 150ms ease,
    background-color 150ms ease;
}

.drop-zone.dragging {
  border-color: var(--green);
  background-color: rgba(65, 211, 139, 0.1);
}

.drop-zone input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.drop-zone strong {
  display: block;
  margin-bottom: 8px;
  font-size: 1.25rem;
}

.drop-zone span {
  color: var(--muted);
}

.topic-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(180px, 0.55fr);
  gap: 16px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: rgba(32, 40, 56, 0.72);
}

.topic-row strong,
.topic-row small {
  display: block;
}

.topic-row small {
  color: var(--muted);
}

.topic-row select,
.card-topic select {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0a0d13;
  color: var(--text);
  padding: 0 10px;
}

button,
.open-saved,
.download-saved {
  border: 0;
  border-radius: 8px;
  background: var(--green);
  color: #06120c;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 18px;
  font-weight: 800;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

button:focus-visible,
.open-saved:focus-visible,
.download-saved:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

.status-panel {
  display: grid;
  gap: 18px;
  padding: 18px;
}

.status-header {
  display: flex;
  gap: 10px;
  align-items: center;
  min-width: 0;
}

.badge {
  flex: 0 0 auto;
  border-radius: 999px;
  padding: 7px 10px;
  background: #2a3447;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.badge.busy {
  background: rgba(108, 199, 255, 0.15);
  color: var(--cyan);
}

.badge.done {
  background: rgba(65, 211, 139, 0.15);
  color: var(--green);
}

.badge.error {
  background: rgba(255, 107, 107, 0.15);
  color: var(--red);
}

.file-name {
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.meter-group {
  display: grid;
  gap: 8px;
}

.meter-row {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 0.92rem;
}

.meter-row strong {
  color: var(--text);
}

.meter {
  overflow: hidden;
  height: 10px;
  border-radius: 999px;
  background: #0a0d13;
}

.meter span {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--cyan), var(--green));
  transition: width 180ms ease;
}

.result-box {
  display: grid;
  gap: 10px;
}

.result-box label {
  color: var(--muted);
  font-size: 0.9rem;
}

.copy-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.copy-row input {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0a0d13;
  color: var(--text);
  padding: 0 12px;
}

video {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #05070a;
  aspect-ratio: 16 / 9;
}

.message {
  min-height: 1.5rem;
  margin-bottom: 0;
  color: var(--muted);
}

.hidden {
  display: none;
}

.compatibility,
.library {
  display: grid;
  grid-template-columns: minmax(240px, 0.8fr) minmax(0, 1.2fr);
  gap: 18px;
  margin-top: 18px;
  padding: 18px;
}

.compatibility h2 {
  margin-bottom: 8px;
  font-size: 1.2rem;
}

.compatibility p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.55;
}

.check-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.check-list li {
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr);
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: rgba(32, 40, 56, 0.6);
}

.check-state {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 900;
  text-transform: uppercase;
}

.check-state.pass {
  color: var(--green);
}

.check-state.warn {
  color: var(--amber);
}

.check-state.fail {
  color: var(--red);
}

.check-list strong,
.check-list span {
  display: block;
}

.check-list span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.4;
}

.latest-url {
  overflow-wrap: anywhere;
  margin-bottom: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0a0d13;
  color: var(--muted);
  padding: 12px;
  font-size: 0.88rem;
  line-height: 1.45;
}

.library {
  display: block;
  border-color: rgba(65, 211, 139, 0.34);
  padding-bottom: 22px;
}

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

.library-header h2 {
  margin-bottom: 8px;
  font-size: 1.2rem;
}

.library-header p,
.empty-library {
  margin-bottom: 0;
  color: var(--muted);
}

.library-header span {
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 10px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.library-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
}

.video-card {
  display: grid;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(32, 40, 56, 0.62);
  padding: 12px;
}

.video-card-body {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.video-card-body strong,
.video-card-body span,
.video-card-body code {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.video-card-body span,
.video-card-body code {
  color: var(--muted);
  font-size: 0.86rem;
}

.video-card-body code {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0a0d13;
  padding: 8px;
}

.card-topic {
  display: grid;
  gap: 6px;
}

.card-topic span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.video-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(142px, 1fr));
  gap: 8px;
}

.video-actions button,
.video-actions a {
  min-width: 0;
  width: 100%;
  padding-right: 12px;
  padding-left: 12px;
  white-space: normal;
}

.open-saved {
  display: inline-grid;
  place-items: center;
  text-align: center;
}

.delete-saved {
  border: 1px solid rgba(255, 107, 107, 0.42);
  background: rgba(255, 107, 107, 0.1);
  color: #ffd6d6;
}

.bottom-copy-bar {
  position: sticky;
  bottom: 12px;
  z-index: 10;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  margin-top: 18px;
  border: 1px solid rgba(65, 211, 139, 0.38);
  border-radius: 8px;
  background: rgba(13, 16, 23, 0.96);
  box-shadow: 0 16px 52px rgba(0, 0, 0, 0.38);
  padding: 12px;
}

.bottom-copy-bar span {
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bottom-copy-bar.hidden {
  display: none;
}

body[data-theme="juice"] .theme-picker,
body[data-theme="juice"] .topic-sidebar,
body[data-theme="juice"] .rail-card {
  border-color: rgba(255, 228, 94, 0.45);
  background: rgba(18, 10, 25, 0.94);
}

body[data-theme="juice"] .eyebrow {
  color: var(--green);
}

body[data-theme="juice"] .eyebrow::after {
  content: " / 999 mode";
  color: var(--cyan);
}

body[data-theme="juice"] h1 {
  text-shadow:
    0 0 18px rgba(255, 79, 139, 0.22),
    0 0 34px rgba(101, 244, 255, 0.12);
}

body[data-theme="juice"] .panel,
body[data-theme="juice"] .status-panel,
body[data-theme="juice"] .compatibility,
body[data-theme="juice"] .library {
  border-color: rgba(255, 228, 94, 0.3);
  background: rgba(26, 17, 34, 0.93);
}

body[data-theme="juice"] .drop-zone {
  border-color: rgba(255, 228, 94, 0.46);
  background: linear-gradient(135deg, rgba(255, 79, 139, 0.13), rgba(101, 244, 255, 0.09), rgba(255, 228, 94, 0.08));
}

body[data-theme="juice"] .drop-zone.dragging {
  border-color: var(--cyan);
  background-color: rgba(101, 244, 255, 0.1);
}

body[data-theme="juice"] button,
body[data-theme="juice"] .open-saved,
body[data-theme="juice"] .download-saved {
  background: var(--green);
  color: #191006;
}

body[data-theme="juice"] .delete-saved {
  background: rgba(255, 79, 139, 0.14);
  color: #ffd6e5;
}

body[data-theme="juice"] .meter span {
  background: linear-gradient(90deg, var(--red), var(--green), var(--cyan));
}

body[data-theme="juice"] .limits a,
body[data-theme="juice"] .library {
  border-color: rgba(255, 228, 94, 0.46);
}

body[data-theme="juice"] .bottom-copy-bar {
  border-color: rgba(255, 228, 94, 0.46);
  background: rgba(16, 11, 21, 0.96);
}

body[data-theme="nf"] .theme-picker,
body[data-theme="nf"] .topic-sidebar,
body[data-theme="nf"] .rail-card {
  border-color: #f2f2f2;
  background: rgba(5, 5, 5, 0.94);
}

body[data-theme="nf"] .eyebrow {
  color: var(--text);
}

body[data-theme="nf"] .eyebrow::after {
  content: " / perception mode";
  color: var(--red);
}

body[data-theme="nf"] h1 {
  color: #ffffff;
  text-shadow: 0 2px 0 rgba(216, 59, 59, 0.28);
  text-transform: uppercase;
}

body[data-theme="nf"] .lede {
  color: #c9c9c9;
}

body[data-theme="nf"] .panel,
body[data-theme="nf"] .status-panel,
body[data-theme="nf"] .compatibility,
body[data-theme="nf"] .library {
  border-color: #454545;
  background: rgba(12, 12, 12, 0.96);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.42);
}

body[data-theme="nf"] .drop-zone {
  border-color: #f2f2f2;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.08), rgba(216, 59, 59, 0.08)),
    #0c0c0c;
}

body[data-theme="nf"] .drop-zone.dragging {
  border-color: var(--red);
  background-color: rgba(216, 59, 59, 0.12);
}

body[data-theme="nf"] button,
body[data-theme="nf"] .open-saved,
body[data-theme="nf"] .download-saved {
  background: #f2f2f2;
  color: #050505;
}

body[data-theme="nf"] .delete-saved {
  border-color: rgba(216, 59, 59, 0.58);
  background: rgba(216, 59, 59, 0.13);
  color: #ffd7d7;
}

body[data-theme="nf"] .meter span {
  background: linear-gradient(90deg, #ffffff, var(--red));
}

body[data-theme="nf"] .limits a,
body[data-theme="nf"] .library {
  border-color: rgba(242, 242, 242, 0.58);
}

body[data-theme="nf"] .limits a {
  background: rgba(242, 242, 242, 0.1);
  color: #ffffff;
}

body[data-theme="nf"] .badge.busy {
  background: rgba(242, 242, 242, 0.12);
  color: #ffffff;
}

body[data-theme="nf"] .badge.done {
  background: rgba(242, 242, 242, 0.14);
  color: #ffffff;
}

body[data-theme="nf"] .bottom-copy-bar {
  border-color: rgba(242, 242, 242, 0.58);
  background: rgba(5, 5, 5, 0.96);
}

body[data-theme="billie"] .theme-picker,
body[data-theme="billie"] .topic-sidebar,
body[data-theme="billie"] .rail-card {
  border-color: rgba(157, 255, 47, 0.48);
  background: rgba(3, 7, 4, 0.94);
}

body[data-theme="billie"] .eyebrow {
  color: var(--green);
}

body[data-theme="billie"] .eyebrow::after {
  content: " / neon mode";
  color: var(--cyan);
}

body[data-theme="billie"] h1 {
  color: #f2fff5;
  text-shadow:
    0 0 22px rgba(157, 255, 47, 0.22),
    0 0 34px rgba(105, 230, 255, 0.12);
}

body[data-theme="billie"] .panel,
body[data-theme="billie"] .status-panel,
body[data-theme="billie"] .compatibility,
body[data-theme="billie"] .library {
  border-color: rgba(157, 255, 47, 0.34);
  background: rgba(7, 17, 10, 0.94);
}

body[data-theme="billie"] .drop-zone {
  border-color: rgba(157, 255, 47, 0.48);
  background:
    linear-gradient(135deg, rgba(157, 255, 47, 0.13), rgba(105, 230, 255, 0.08)),
    #061008;
}

body[data-theme="billie"] .drop-zone.dragging {
  border-color: var(--cyan);
  background-color: rgba(105, 230, 255, 0.12);
}

body[data-theme="billie"] button,
body[data-theme="billie"] .open-saved,
body[data-theme="billie"] .download-saved {
  background: var(--green);
  color: #071006;
}

body[data-theme="billie"] .delete-saved {
  border-color: rgba(255, 93, 122, 0.58);
  background: rgba(255, 93, 122, 0.13);
  color: #ffd6df;
}

body[data-theme="billie"] .meter span {
  background: linear-gradient(90deg, var(--green), var(--cyan), var(--amber));
}

body[data-theme="billie"] .limits a,
body[data-theme="billie"] .library {
  border-color: rgba(157, 255, 47, 0.5);
}

body[data-theme="billie"] .limits a {
  background: rgba(157, 255, 47, 0.1);
  color: var(--green);
}

body[data-theme="billie"] .bottom-copy-bar {
  border-color: rgba(157, 255, 47, 0.5);
  background: rgba(3, 7, 4, 0.96);
}

body[data-theme="x"] .theme-picker,
body[data-theme="x"] .topic-sidebar,
body[data-theme="x"] .rail-card {
  border-color: rgba(244, 209, 61, 0.52);
  background: rgba(7, 9, 13, 0.94);
}

body[data-theme="x"] .eyebrow {
  color: var(--green);
}

body[data-theme="x"] .eyebrow::after {
  content: " / split mode";
  color: var(--cyan);
}

body[data-theme="x"] h1 {
  color: #fffdf4;
  text-shadow:
    3px 3px 0 rgba(77, 165, 255, 0.3),
    -2px -2px 0 rgba(244, 209, 61, 0.2);
}

body[data-theme="x"] .panel,
body[data-theme="x"] .status-panel,
body[data-theme="x"] .compatibility,
body[data-theme="x"] .library {
  border-color: rgba(77, 165, 255, 0.4);
  background: rgba(16, 19, 26, 0.94);
}

body[data-theme="x"] .drop-zone {
  border-color: rgba(244, 209, 61, 0.54);
  background:
    linear-gradient(135deg, rgba(77, 165, 255, 0.14), rgba(244, 209, 61, 0.1)),
    #0b0e13;
}

body[data-theme="x"] .drop-zone.dragging {
  border-color: var(--cyan);
  background-color: rgba(77, 165, 255, 0.12);
}

body[data-theme="x"] button,
body[data-theme="x"] .open-saved,
body[data-theme="x"] .download-saved {
  background: var(--green);
  color: #090806;
}

body[data-theme="x"] .delete-saved {
  border-color: rgba(255, 79, 79, 0.58);
  background: rgba(255, 79, 79, 0.13);
  color: #ffd6d6;
}

body[data-theme="x"] .meter span {
  background: linear-gradient(90deg, var(--cyan), var(--green), var(--red));
}

body[data-theme="x"] .limits a,
body[data-theme="x"] .library {
  border-color: rgba(244, 209, 61, 0.56);
}

body[data-theme="x"] .limits a {
  background: rgba(244, 209, 61, 0.1);
  color: var(--green);
}

body[data-theme="x"] .bottom-copy-bar {
  border-color: rgba(244, 209, 61, 0.56);
  background: rgba(7, 9, 13, 0.96);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0;
  transition: opacity 180ms ease;
}

body[data-holiday="christmas"] {
  --green: #48d76f;
  --cyan: #f7f1df;
  --amber: #ffd45a;
  --red: #ef4f4f;
  --focus: #ffd45a;
}

body[data-holiday="christmas"]::before {
  opacity: 1;
  background:
    radial-gradient(circle at 18% 22%, rgba(255, 255, 255, 0.72) 0 2px, transparent 3px),
    radial-gradient(circle at 78% 18%, rgba(255, 255, 255, 0.58) 0 2px, transparent 3px),
    radial-gradient(circle at 46% 72%, rgba(255, 255, 255, 0.48) 0 2px, transparent 3px),
    linear-gradient(145deg, rgba(239, 79, 79, 0.12), transparent 34%),
    linear-gradient(315deg, rgba(72, 215, 111, 0.14), transparent 36%);
  background-size: 150px 150px, 210px 210px, 180px 180px, auto, auto;
}

body[data-holiday="halloween"] {
  --green: #ff9b28;
  --cyan: #b76dff;
  --amber: #ffd166;
  --red: #79ff6f;
  --focus: #ff9b28;
}

body[data-holiday="halloween"]::before {
  opacity: 1;
  background:
    radial-gradient(circle at 14% 20%, rgba(255, 155, 40, 0.18), transparent 18rem),
    radial-gradient(circle at 88% 18%, rgba(183, 109, 255, 0.16), transparent 16rem),
    linear-gradient(180deg, rgba(0, 0, 0, 0), rgba(255, 155, 40, 0.05));
}

body[data-holiday="valentine"] {
  --green: #ff6f9f;
  --cyan: #ffc7dd;
  --amber: #ffe0eb;
  --red: #ff477e;
  --focus: #ffc7dd;
}

body[data-holiday="valentine"]::before {
  opacity: 1;
  background:
    radial-gradient(circle at 18% 18%, rgba(255, 111, 159, 0.22), transparent 18rem),
    radial-gradient(circle at 84% 78%, rgba(255, 199, 221, 0.16), transparent 19rem);
}

body[data-holiday="newyear"] {
  --green: #ffe082;
  --cyan: #86d9ff;
  --amber: #ffcf4a;
  --red: #ff6b8c;
  --focus: #ffe082;
}

body[data-holiday="newyear"]::before {
  opacity: 1;
  background:
    radial-gradient(circle at 18% 18%, rgba(255, 224, 130, 0.18), transparent 11rem),
    radial-gradient(circle at 72% 22%, rgba(134, 217, 255, 0.16), transparent 12rem),
    radial-gradient(circle at 86% 70%, rgba(255, 107, 140, 0.13), transparent 13rem);
}

body[data-holiday="easter"] {
  --green: #9effb2;
  --cyan: #b9d7ff;
  --amber: #fff2a8;
  --red: #ff9bd2;
  --focus: #fff2a8;
}

body[data-holiday="easter"]::before {
  opacity: 1;
  background:
    radial-gradient(circle at 16% 20%, rgba(185, 215, 255, 0.16), transparent 15rem),
    radial-gradient(circle at 82% 18%, rgba(255, 155, 210, 0.14), transparent 16rem),
    radial-gradient(circle at 52% 86%, rgba(158, 255, 178, 0.13), transparent 16rem);
}

body[data-holiday="july4"] {
  --green: #ffffff;
  --cyan: #62a8ff;
  --amber: #f7f7f7;
  --red: #ff5964;
  --focus: #ffffff;
}

body[data-holiday="july4"]::before {
  opacity: 1;
  background:
    linear-gradient(135deg, rgba(255, 89, 100, 0.16), transparent 34%),
    linear-gradient(315deg, rgba(98, 168, 255, 0.17), transparent 36%),
    radial-gradient(circle at 76% 20%, rgba(255, 255, 255, 0.15), transparent 10rem);
}

body[data-holiday] .panel,
body[data-holiday] .status-panel,
body[data-holiday] .compatibility,
body[data-holiday] .library,
body[data-holiday] .theme-picker,
body[data-holiday] .topic-sidebar,
body[data-holiday] .rail-card {
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.36);
}

.holiday-art {
  position: fixed;
  inset: 0;
  z-index: 1;
  overflow: hidden;
  pointer-events: none;
}

.holiday-piece {
  position: fixed;
  display: none;
  pointer-events: none;
  filter: drop-shadow(0 14px 24px rgba(0, 0, 0, 0.3));
}

body[data-holiday="christmas"] .tree,
body[data-holiday="christmas"] .ornament,
body[data-holiday="halloween"] .pumpkin,
body[data-holiday="halloween"] .monster,
body[data-holiday="valentine"] .heart,
body[data-holiday="newyear"] .firework,
body[data-holiday="easter"] .egg,
body[data-holiday="july4"] .star {
  display: block;
}

.tree {
  width: 82px;
  height: 104px;
}

.tree::before {
  content: "";
  position: absolute;
  left: 7px;
  top: 0;
  width: 68px;
  height: 78px;
  background: linear-gradient(180deg, #48d76f, #13773a);
  clip-path: polygon(50% 0, 65% 24%, 58% 24%, 76% 48%, 65% 48%, 92% 78%, 8% 78%, 35% 48%, 24% 48%, 42% 24%, 35% 24%);
}

.tree::after {
  content: "";
  position: absolute;
  left: 34px;
  bottom: 8px;
  width: 14px;
  height: 26px;
  border-radius: 3px;
  background: #7b4a28;
}

.tree-one {
  right: 32px;
  top: 126px;
}

.tree-two {
  left: 26px;
  bottom: 74px;
  transform: scale(0.78);
}

.ornament {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 34% 30%, rgba(255, 255, 255, 0.9) 0 4px, transparent 5px),
    linear-gradient(135deg, #ef4f4f, #b9142d);
}

.ornament::before {
  content: "";
  position: absolute;
  left: 11px;
  top: -7px;
  width: 12px;
  height: 8px;
  border-radius: 3px 3px 0 0;
  background: #ffd45a;
}

.ornament-one {
  right: 120px;
  top: 190px;
}

.ornament-two {
  left: 126px;
  bottom: 142px;
  background:
    radial-gradient(circle at 34% 30%, rgba(255, 255, 255, 0.9) 0 4px, transparent 5px),
    linear-gradient(135deg, #ffd45a, #d88a12);
}

.pumpkin {
  width: 84px;
  height: 64px;
  border-radius: 48% 48% 44% 44%;
  background: #ff9b28;
  box-shadow:
    inset 16px 0 0 rgba(184, 83, 17, 0.28),
    inset -16px 0 0 rgba(184, 83, 17, 0.28);
}

.pumpkin::before {
  content: "";
  position: absolute;
  left: 35px;
  top: -13px;
  width: 14px;
  height: 18px;
  border-radius: 10px 10px 0 0;
  background: #5c8d34;
}

.pumpkin::after {
  content: "";
  position: absolute;
  left: 23px;
  top: 24px;
  width: 10px;
  height: 10px;
  background: #111111;
  clip-path: polygon(50% 0, 0 100%, 100% 100%);
  box-shadow: 30px 0 0 #111111, 15px 20px 0 4px #111111;
}

.pumpkin-one {
  right: 30px;
  top: 130px;
}

.pumpkin-two {
  left: 26px;
  bottom: 78px;
  transform: scale(0.82);
}

.monster {
  width: 76px;
  height: 70px;
  border-radius: 28px 28px 18px 18px;
  background: linear-gradient(180deg, #79ff6f, #23913a);
}

.monster::before {
  content: "";
  position: absolute;
  left: 17px;
  top: 20px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #111111;
  box-shadow: 30px 0 0 #111111;
}

.monster::after {
  content: "";
  position: absolute;
  left: 22px;
  bottom: 18px;
  width: 32px;
  height: 10px;
  border-radius: 0 0 12px 12px;
  background: #111111;
}

.monster-one {
  right: 118px;
  top: 214px;
}

.monster-two {
  left: 118px;
  bottom: 150px;
  transform: scale(0.76);
  background: linear-gradient(180deg, #b76dff, #5725a8);
}

.heart {
  width: 46px;
  height: 46px;
  background: #ff477e;
  transform: rotate(45deg);
}

.heart::before,
.heart::after {
  content: "";
  position: absolute;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: inherit;
}

.heart::before {
  left: -23px;
}

.heart::after {
  top: -23px;
}

.heart-one {
  right: 54px;
  top: 150px;
}

.heart-two {
  left: 48px;
  bottom: 102px;
  transform: rotate(45deg) scale(0.72);
  background: #ffc7dd;
}

.firework {
  width: 86px;
  height: 86px;
  border-radius: 50%;
  background:
    linear-gradient(90deg, transparent 46%, #ffe082 47% 53%, transparent 54%),
    linear-gradient(0deg, transparent 46%, #86d9ff 47% 53%, transparent 54%),
    linear-gradient(45deg, transparent 47%, #ff6b8c 48% 52%, transparent 53%),
    linear-gradient(135deg, transparent 47%, #ffe082 48% 52%, transparent 53%);
}

.firework::before {
  content: "";
  position: absolute;
  inset: 28px;
  border-radius: 50%;
  background: #ffffff;
}

.firework-one {
  right: 38px;
  top: 130px;
}

.firework-two {
  left: 42px;
  bottom: 92px;
  transform: scale(0.82);
}

.egg {
  width: 58px;
  height: 76px;
  border-radius: 50% 50% 46% 46%;
  background:
    linear-gradient(180deg, transparent 0 28%, #ff9bd2 28% 38%, transparent 38% 56%, #fff2a8 56% 66%, transparent 66%),
    #b9d7ff;
}

.egg::before {
  content: "";
  position: absolute;
  left: 12px;
  top: 15px;
  width: 34px;
  height: 8px;
  border-radius: 999px;
  background: #9effb2;
}

.egg-one {
  right: 56px;
  top: 136px;
}

.egg-two {
  left: 56px;
  bottom: 96px;
  transform: rotate(-14deg) scale(0.82);
  background:
    linear-gradient(180deg, transparent 0 28%, #b9d7ff 28% 38%, transparent 38% 56%, #9effb2 56% 66%, transparent 66%),
    #ff9bd2;
}

.star {
  width: 70px;
  height: 70px;
  background: #ffffff;
  clip-path: polygon(50% 0, 61% 34%, 98% 35%, 68% 56%, 79% 91%, 50% 69%, 21% 91%, 32% 56%, 2% 35%, 39% 34%);
}

.star-one {
  right: 48px;
  top: 138px;
}

.star-two {
  left: 50px;
  bottom: 98px;
  transform: scale(0.78);
  background: #ff5964;
}

@media (min-width: 1320px) {
  .shell {
    width: min(900px, calc(100% - 728px));
    margin-left: auto;
    margin-right: auto;
  }
}

@media (min-width: 821px) and (max-width: 1319px) {
  .shell {
    width: calc(100% - 308px);
    margin-left: 284px;
    margin-right: 24px;
  }

  .hero,
  .workspace,
  .compatibility {
    grid-template-columns: 1fr;
  }

  .right-rail {
    display: none;
  }
}

@media (max-width: 820px) {
  .shell {
    width: min(100% - 24px, 1120px);
    padding-top: 308px;
  }

  .theme-picker {
    right: 12px;
    left: 12px;
    grid-template-columns: auto minmax(0, 1fr);
  }

  .topic-sidebar {
    top: 116px;
    right: 12px;
    left: 12px;
    width: auto;
    max-height: 176px;
  }

  .right-rail {
    display: none;
  }

  .hero,
  .workspace,
  .compatibility {
    grid-template-columns: 1fr;
  }

  .limits {
    min-width: 0;
  }

  .topic-row,
  .copy-row {
    grid-template-columns: 1fr;
  }

  .drop-zone {
    min-height: 190px;
  }

  .library-header,
  .bottom-copy-bar,
  .video-actions,
  .auth-actions {
    grid-template-columns: 1fr;
  }

  .library-header {
    display: grid;
  }
}
