:root {
  color-scheme: dark;
  --bg: #11120f;
  --bg-soft: rgba(25, 27, 22, 0.9);
  --panel: rgba(22, 24, 20, 0.86);
  --panel-strong: rgba(28, 31, 25, 0.96);
  --border: rgba(241, 203, 121, 0.14);
  --text: #f5f0e2;
  --text-soft: #d0c6af;
  --accent: #f26f4d;
  --accent-soft: #f1cb79;
  --accent-cool: #7ddfb2;
  --danger: #f47a6a;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.28);
  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 16px;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  font-family: "IBM Plex Sans", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(242, 111, 77, 0.18), transparent 34%),
    radial-gradient(circle at top right, rgba(125, 223, 178, 0.14), transparent 26%),
    linear-gradient(180deg, #181914 0%, #11120f 55%, #0d0e0b 100%);
  color: var(--text);
}

.ambient {
  position: fixed;
  width: 42vw;
  height: 42vw;
  border-radius: 999px;
  filter: blur(70px);
  pointer-events: none;
  opacity: 0.44;
}

.ambient-left {
  top: -10vw;
  left: -10vw;
  background: rgba(242, 111, 77, 0.18);
}

.ambient-right {
  top: 26vh;
  right: -14vw;
  background: rgba(125, 223, 178, 0.14);
}

.page-shell {
  position: relative;
  z-index: 1;
  width: min(100%, 860px);
  margin: 0 auto;
  padding: 20px 16px calc(36px + env(safe-area-inset-bottom));
}

.hero-card,
.toolbar-card,
.feedback-card,
.video-card {
  border: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(33, 35, 29, 0.96), rgba(17, 18, 15, 0.96));
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.hero-card {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 22px;
  border-radius: var(--radius-xl);
}

.eyebrow {
  margin: 0 0 10px;
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent-soft);
}

h1,
h2,
h3 {
  font-family: "Space Grotesk", sans-serif;
}

h1 {
  margin: 0;
  font-size: clamp(1.8rem, 4vw, 2.65rem);
  line-height: 1;
}

.hero-text {
  margin: 12px 0 0;
  max-width: 32rem;
  line-height: 1.55;
  color: var(--text-soft);
}

.ghost-button,
.chip-button,
.primary-button,
.secondary-button,
.status-button {
  appearance: none;
  border: 0;
  border-radius: 999px;
  padding: 0.85rem 1rem;
  font: inherit;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  transition:
    transform 160ms ease,
    background 160ms ease,
    opacity 160ms ease;
}

.ghost-button {
  white-space: nowrap;
  background: rgba(255, 255, 255, 0.06);
}

.ghost-button:hover,
.chip-button:hover,
.primary-button:hover,
.secondary-button:hover,
.status-button:hover {
  transform: translateY(-1px);
}

.workflow-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 14px 0 16px;
}

.workflow-strip span {
  padding: 12px;
  border-radius: 18px;
  text-align: center;
  font-size: 0.92rem;
  color: var(--text-soft);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.04);
}

.toolbar-card,
.feedback-card {
  border-radius: var(--radius-lg);
  padding: 16px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.stat-tile {
  padding: 14px;
  border-radius: 18px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.02)),
    rgba(255, 255, 255, 0.02);
}

.stat-label {
  display: block;
  font-size: 0.82rem;
  color: var(--text-soft);
}

.stat-value {
  display: block;
  margin-top: 6px;
  font-family: "Space Grotesk", sans-serif;
  font-size: 1.55rem;
}

.toolbar-row {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 14px;
}

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

.chip-button {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-soft);
}

.chip-button.active {
  background: linear-gradient(135deg, var(--accent), #d55334);
  color: #fff6ef;
}

.account-picker {
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: var(--text-soft);
  font-size: 0.92rem;
}

.account-picker select {
  min-height: 48px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  padding: 0 14px;
  font: inherit;
}

.feedback-card {
  margin-top: 16px;
  color: var(--text-soft);
}

.feedback-card.error {
  border-color: rgba(244, 122, 106, 0.34);
  color: #ffd7d1;
}

.video-list {
  display: grid;
  gap: 16px;
  margin-top: 16px;
}

.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
  margin-top: 18px;
}

.section-head h2 {
  margin: 0;
  font-size: 1.1rem;
}

.section-head p {
  margin: 0;
  color: var(--text-soft);
  font-size: 0.92rem;
}

.video-card {
  overflow: hidden;
  border-radius: var(--radius-xl);
}

.video-frame {
  display: block;
  width: 100%;
  max-height: 58vh;
  background: #060606;
  aspect-ratio: 9 / 16;
}

.video-card-body {
  padding: 16px;
}

.card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

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

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  font-size: 0.86rem;
  font-weight: 600;
}

.pill.account {
  background: rgba(125, 223, 178, 0.12);
  color: #b7f6d9;
}

.pill.status-ready {
  background: rgba(125, 223, 178, 0.14);
  color: #b7f6d9;
}

.pill.status-posted {
  background: rgba(241, 203, 121, 0.14);
  color: #f7ddb0;
}

.pill.status-other {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-soft);
}

.card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin-top: 12px;
  color: var(--text-soft);
  font-size: 0.92rem;
}

.caption-card {
  margin-top: 14px;
  padding: 14px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.04);
}

.caption-label {
  display: block;
  margin-bottom: 8px;
  color: var(--accent-soft);
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.caption-text {
  margin: 0;
  color: var(--text);
  white-space: pre-wrap;
  word-break: break-word;
}

.action-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-top: 16px;
}

.primary-button {
  background: linear-gradient(135deg, var(--accent), #d55334);
  color: #fff6ef;
}

.secondary-button {
  background: rgba(255, 255, 255, 0.07);
}

.status-button {
  background: rgba(125, 223, 178, 0.12);
  color: #b7f6d9;
}

.status-button.alt {
  background: rgba(255, 255, 255, 0.07);
  color: var(--text-soft);
}

button:disabled,
a.button-link.disabled {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
}

.button-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.link-row {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 14px;
}

.link-row a {
  color: var(--accent-soft);
  text-decoration: none;
}

.empty-state {
  padding: 22px;
  border-radius: var(--radius-xl);
  text-align: center;
  color: var(--text-soft);
  background: rgba(255, 255, 255, 0.04);
  border: 1px dashed rgba(255, 255, 255, 0.08);
}

.archive-card {
  margin-top: 18px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(24, 26, 21, 0.92), rgba(15, 16, 13, 0.96));
  box-shadow: var(--shadow);
  overflow: hidden;
}

.archive-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.archive-toggle:disabled {
  opacity: 0.55;
  cursor: default;
}

.archive-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2rem;
  height: 2rem;
  padding: 0 0.75rem;
  border-radius: 999px;
  background: rgba(241, 203, 121, 0.14);
  color: #f7ddb0;
}

.archive-body {
  padding: 0 16px 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.archive-note {
  margin: 14px 0 0;
  color: var(--text-soft);
}

.archive-list {
  margin-top: 14px;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(20px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  max-width: min(92vw, 440px);
  padding: 12px 16px;
  border-radius: 14px;
  background: rgba(16, 17, 13, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text);
  box-shadow: var(--shadow);
}

@media (max-width: 760px) {
  .hero-card {
    flex-direction: column;
  }

  .section-head {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 640px) {
  .page-shell {
    padding-left: 12px;
    padding-right: 12px;
  }

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

  .stat-tile {
    padding: 12px;
  }

  .stat-value {
    font-size: 1.3rem;
  }

  .action-grid,
  .workflow-strip {
    grid-template-columns: 1fr;
  }
}
