:root {
  --tl-midnight: #071523;
  --tl-midnight-soft: #102a42;
  --tl-copper: #c98645;
  --tl-copper-light: #efc184;
  --tl-paper: #fff7e7;
  --tl-ink: #49382f;
  --tl-line: rgba(144, 96, 59, .24);
}

.timelapse-admin-main {
  max-width: 1500px;
}

.timelapse-admin-header .admin-nav {
  flex-wrap: wrap;
}

.tl-alert {
  margin: 1rem 0;
  padding: .85rem 1rem;
  border: 1px solid var(--tl-line);
  border-radius: 16px;
  background: rgba(255,255,255,.74);
}

.tl-alert.success { color: #39633c; }
.tl-alert.danger { color: #8a2f2f; border-color: rgba(138,47,47,.3); }

.tl-page-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 1rem;
}

.tl-stats .stat strong {
  font-size: clamp(1.25rem, 2.3vw, 2.15rem);
}

.tl-project-form,
.tl-settings-form {
  display: grid;
  gap: 1rem;
}

.tl-project-form label,
.tl-settings-form label {
  display: grid;
  gap: .38rem;
  color: var(--tl-ink);
  font-weight: 750;
}

.tl-project-form small,
.tl-settings-form small {
  color: var(--muted);
  font-weight: 500;
}

.tl-option-groups {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.tl-option-groups fieldset {
  min-width: 0;
  padding: 1rem;
  border: 1px solid var(--tl-line);
  border-radius: 18px;
  background: rgba(255,255,255,.54);
}

.tl-option-groups legend {
  padding: 0 .45rem;
  color: var(--tl-copper);
  font-weight: 850;
}

.tl-option-groups .check {
  display: flex;
  grid-template-columns: auto 1fr;
  align-items: flex-start;
  gap: .55rem;
  margin: .55rem 0;
}

.tl-option-groups .check input {
  width: auto;
  margin-top: .2rem;
}

.tl-actions form { display: inline-flex; }

.tl-output-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.tl-output-card {
  padding: 1rem;
  border: 1px solid var(--tl-line);
  border-radius: 20px;
  background: rgba(255,255,255,.56);
}

.tl-output-card h3 { margin-top: 0; color: var(--tl-copper); }
.tl-output-card video,
.tl-output-card img {
  display: block;
  width: 100%;
  max-height: 560px;
  margin: .8rem 0;
  border-radius: 14px;
  background: var(--tl-midnight);
  object-fit: contain;
}

.tl-storyboard {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: .7rem;
}

.tl-frame {
  overflow: hidden;
  border: 1px solid var(--tl-line);
  border-radius: 14px;
  background: rgba(255,255,255,.62);
}

.tl-frame.is-excluded { opacity: .42; filter: grayscale(.75); }
.tl-frame img { display: block; width: 100%; aspect-ratio: 16/9; object-fit: cover; }
.tl-frame > div { display: grid; padding: .45rem .55rem; font-size: .76rem; }
.tl-frame form { padding: 0 .5rem .55rem; }
.tl-frame .button { width: 100%; padding: .38rem .5rem; font-size: .72rem; }
.tl-pagination { align-items: center; justify-content: center; margin-top: 1rem; }
.tl-hardware p { margin-bottom: .25rem; }

/* Public timelapse pages */
.tl-public-page {
  --paper: #fffaf2;
}

.tl-public-hero {
  background:
    radial-gradient(circle at 15% 0%, rgba(201,134,69,.2), transparent 32%),
    radial-gradient(circle at 90% 10%, rgba(116,87,163,.17), transparent 36%);
}

.tl-public-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.4rem;
}

.tl-public-card {
  overflow: hidden;
  border: 1px solid rgba(201,134,69,.24);
  border-radius: 26px;
  background: rgba(255,255,255,.72);
  box-shadow: 0 22px 60px rgba(30,24,44,.08);
}

.tl-public-poster {
  position: relative;
  display: block;
  aspect-ratio: 16/9;
  overflow: hidden;
  background: var(--tl-midnight);
}

.tl-public-poster img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .5s ease;
}

.tl-public-poster:hover img { transform: scale(1.025); }

.tl-play {
  position: absolute;
  inset: 50% auto auto 50%;
  transform: translate(-50%, -50%);
  display: grid;
  place-items: center;
  min-width: 78px;
  min-height: 78px;
  border: 1px solid rgba(255,255,255,.65);
  border-radius: 999px;
  color: white;
  background: rgba(7,21,35,.72);
  backdrop-filter: blur(10px);
  font-weight: 800;
}

.tl-public-copy { padding: 1.15rem 1.25rem 1.35rem; }
.tl-public-copy h2 { margin: .2rem 0 .55rem; }
.tl-public-copy h2 a { color: var(--tl-ink); text-decoration: none; }
.tl-public-meta { color: var(--tl-copper); font-size: .85rem; line-height: 1.5; }

.tl-video-shell {
  overflow: hidden;
  border: 1px solid rgba(201,134,69,.25);
  border-radius: 28px;
  background: var(--tl-midnight);
  box-shadow: 0 28px 80px rgba(7,21,35,.16);
}

.tl-video-shell video {
  display: block;
  width: 100%;
  max-height: 78vh;
  background: #000;
}

.tl-video-copy {
  padding: 1rem 1.25rem 1.2rem;
  color: var(--tl-paper);
}

.tl-video-copy strong { color: var(--tl-copper-light); }
.tl-video-copy p { margin-bottom: 0; color: rgba(255,247,231,.8); }

.coast-tab-link { text-decoration: none; }

@media (max-width: 1180px) {
  .tl-storyboard { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
  .tl-option-groups,
  .tl-output-grid,
  .tl-public-grid { grid-template-columns: 1fr; }
  .tl-storyboard { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 680px) {
  .tl-page-head { align-items: stretch; flex-direction: column; }
  .tl-storyboard { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tl-play { min-width: 64px; min-height: 64px; }
}
