:root {
  --bg: #f4efe7;
  --panel: #fffaf2;
  --panel-strong: #fffdf8;
  --ink: #1d1f1a;
  --muted: #6d6f66;
  --line: #ddd2bf;
  --accent: #046a38;
  --accent-soft: #dceedd;
  --danger: #9f2d2d;
  --shadow: 0 18px 50px rgba(70, 52, 18, 0.08);
  --gold: #c9942d;
  --sidebar: #092d23;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Avenir Next", "Helvetica Neue", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top right, rgba(194, 170, 120, 0.16), transparent 28%),
    linear-gradient(180deg, #f7f0e2 0%, var(--bg) 100%);
}

a {
  color: var(--accent);
  text-decoration: none;
}

img {
  max-width: 100%;
  display: block;
}

.shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 280px 1fr;
}

.sidebar {
  padding: 32px 24px;
  background: radial-gradient(circle at 80% 0%, rgba(201, 148, 45, 0.12), transparent 28%), linear-gradient(180deg, var(--sidebar) 0%, #123c2e 100%);
  color: #f9f4ea;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.brandmark {
  color: inherit;
}

.brandmark__symbol {
  display: block;
  width: fit-content;
  margin-bottom: 10px;
  color: #f4db9a;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 2.25rem;
  line-height: .8;
  letter-spacing: -.16em;
}

.brandmark__title {
  display: block;
  font-size: 1.35rem;
  letter-spacing: .12em;
  font-weight: 700;
}

.brandmark__subtitle,
.muted {
  color: var(--muted);
}

.sidebar .muted,
.brandmark__subtitle {
  color: rgba(249, 244, 234, 0.72);
}

.nav {
  display: grid;
  gap: 12px;
}

.nav a {
  color: inherit;
  padding: 10px 12px;
  border: 1px solid rgba(249, 244, 234, 0.12);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  display: flex;
  align-items: center;
  gap: 10px;
  transition: background 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.nav a:hover,
.nav a.is-active {
  border-color: rgba(201, 148, 45, .7);
  background: rgba(201, 148, 45, .14);
  transform: translateX(2px);
}

.nav a span {
  width: 20px;
  color: #f4db9a;
  text-align: center;
}

.sidebar__meta {
  margin-top: auto;
  padding-top: 18px;
  border-top: 1px solid rgba(249, 244, 234, 0.14);
}

.content {
  width: min(100%, 1440px);
  padding: 42px clamp(22px, 4vw, 64px);
}

.mobile-brand {
  display: none;
}

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

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.hero h1,
.login-card h1 {
  margin: 0 0 8px;
  font-size: clamp(2rem, 3vw, 3.3rem);
  line-height: 0.98;
}

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

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 24px;
  box-shadow: var(--shadow);
}

.panel--form {
  max-width: 920px;
}

.panel--inner {
  padding: 18px;
}

.grid-two {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 22px;
  margin-bottom: 22px;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
}

.brand-card {
  display: grid;
  gap: 6px;
  background: var(--panel-strong);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 18px;
}

.metric-list {
  display: grid;
  gap: 14px;
}

.metric {
  padding: 14px 16px;
  border-radius: 18px;
  background: var(--panel-strong);
  border: 1px solid var(--line);
}

.metric__value {
  display: block;
  font-size: 1.5rem;
  font-weight: 700;
}

.metric__label {
  color: var(--muted);
}

.table {
  width: 100%;
  border-collapse: collapse;
}

.table th,
.table td {
  padding: 12px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.badge {
  display: inline-block;
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.85rem;
}

.stack {
  display: grid;
  gap: 16px;
}

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

.controls-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}

.color-options {
  display: grid;
  gap: 8px;
}

.color-option {
  grid-template-columns: auto auto 1fr;
  align-items: center;
  gap: 10px;
  font-weight: 500;
}

.color-option input {
  width: auto;
}

.color-chip {
  width: 20px;
  height: 20px;
  border-radius: 999px;
  border: 1px solid rgba(0, 0, 0, 0.12);
  background: var(--chip);
}

.highlight-preview {
  margin-top: 6px;
}

.highlight-preview__bar {
  display: block;
  width: 100%;
  height: 14px;
  border-radius: 999px;
  background: #ffffff;
  border: 1px solid var(--line);
  transition: background 160ms ease;
}

.live-caption-preview {
  display: grid;
  gap: 10px;
}

.live-caption-preview__stage {
  position: relative;
  overflow: hidden;
  min-height: 420px;
  border-radius: 24px;
  border: 1px solid var(--line);
  background: #edf2ec;
  display: grid;
  place-items: center;
}

.live-caption-preview__image {
  width: 100%;
  height: auto;
  display: none;
}

.live-caption-preview__empty {
  min-height: 420px;
  width: 100%;
  padding: 28px;
  display: grid;
  place-items: center;
  text-align: center;
  color: var(--muted);
}

.choice-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.choice-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fffdfa;
  font-weight: 500;
}

.choice-pill input {
  width: auto;
}

.checkbox-item {
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 10px;
  font-weight: 500;
}

.checkbox-item input {
  width: auto;
}

.user-row {
  display: grid;
  gap: 4px;
}

.inline-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
}

label {
  display: grid;
  gap: 8px;
  font-weight: 600;
}

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

input,
textarea,
select {
  width: 100%;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: #fffdfa;
}

button,
.button-link {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  padding: 14px 20px;
  border-radius: 14px;
  border: none;
  background: var(--accent);
  color: white;
  font-weight: 700;
  cursor: pointer;
  transition: filter 160ms ease, transform 160ms ease;
}

button:hover,
.button-link:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
}

button:disabled {
  opacity: .65;
  cursor: wait;
  transform: none;
}

.form-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

.asset-preview {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 10px;
  min-height: 72px;
  padding: 12px;
  border: 1px dashed var(--line);
  border-radius: 16px;
}

.asset-preview__item {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel-strong);
  cursor: grab;
}

.asset-preview__item img,
.asset-preview__video {
  width: 42px;
  height: 52px;
  flex: 0 0 42px;
  display: grid;
  place-items: center;
  object-fit: cover;
  border-radius: 8px;
  background: var(--sidebar);
  color: #f4db9a;
}

.asset-preview__item span:last-child {
  overflow: hidden;
  font-size: .82rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.notice {
  margin-bottom: 20px;
  padding: 16px 18px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: #fff6df;
}

.notice--error {
  border-color: rgba(159, 45, 45, 0.25);
  background: #fff0f0;
  color: var(--danger);
}

.detail-list {
  display: grid;
  gap: 12px;
}

.detail-list div {
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.detail-list dt {
  font-weight: 700;
  margin-bottom: 4px;
}

.detail-list dd {
  margin: 0;
  color: var(--muted);
}

.preview-image {
  width: 100%;
  border-radius: 18px;
  border: 1px solid var(--line);
}

.preview-video {
  width: min(100%, 420px);
  aspect-ratio: 9 / 16;
  object-fit: cover;
  border-radius: 28px;
  border: 1px solid var(--line);
  background: #0f120f;
  box-shadow: 0 24px 40px rgba(10, 10, 10, 0.18);
}

.rendering-state {
  min-height: 240px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 10px;
  border-radius: 24px;
  background: linear-gradient(145deg, #092d23, #1d4938);
  color: #f9f4ea;
  text-align: center;
}

.rendering-state .muted {
  color: rgba(249, 244, 234, .72);
}

.loader {
  width: 34px;
  height: 34px;
  border: 3px solid rgba(255, 255, 255, .25);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 800ms linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.grid-two--reel {
  grid-template-columns: 0.85fr 1.15fr;
}

.script-block {
  margin: 0 0 20px;
  padding: 18px;
  white-space: pre-wrap;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: #fffdf8;
  color: var(--muted);
  font-family: inherit;
}

small.muted {
  display: block;
}

.source-block {
  display: grid;
  gap: 14px;
  padding: 18px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: #fffdf8;
}

.source-block__header {
  display: grid;
  gap: 4px;
}

.source-block__search {
  display: flex;
  justify-content: flex-end;
}

.button-link--secondary {
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--line);
}

.pexels-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
}

.pexels-card {
  display: grid;
  gap: 10px;
  align-content: start;
  padding: 12px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: var(--panel-strong);
}

.pexels-card input[type="radio"] {
  width: auto;
}

.pexels-card img {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  border-radius: 12px;
}

.pexels-note {
  margin: 0;
}

.table-wrap {
  overflow-x: auto;
}

.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-card {
  width: min(100%, 540px);
  padding: 34px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 30px;
  box-shadow: var(--shadow);
}

.login-card::before {
  content: "RD";
  display: block;
  color: var(--gold);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 2.6rem;
  letter-spacing: -.16em;
}

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

  .sidebar {
    display: none;
  }

  .content {
    padding: 22px;
  }

  .hero,
  .grid-two {
    grid-template-columns: 1fr;
    display: grid;
    align-items: start;
  }

  .mobile-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 28px;
    color: var(--accent);
    letter-spacing: .12em;
  }

  .mobile-brand .brandmark__symbol {
    display: inline;
    margin: 0;
    font-size: 1.65rem;
  }

  .table {
    min-width: 680px;
  }

  .form-footer {
    align-items: stretch;
    flex-direction: column;
  }
}
