:root {
  color-scheme: light;
  --background: #f7f0e8;
  --ink: #1f1b18;
  --muted: #71675e;
  --card: #fffaf3;
  --line: #e6d8c8;
  --accent: #9a3412;
  --accent-dark: #7c2d12;
  --soft: #efe1d0;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--background);
  color: var(--ink);
  font-family: ui-serif, Georgia, Cambria, "Times New Roman", Times, serif;
}

button,
a,
input {
  font: inherit;
}

.shell {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 18px 0 40px;
}

.hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 12px 14px;
  background: rgba(255, 250, 243, 0.72);
}

.eyebrow {
  margin: 0 0 2px;
  color: var(--accent);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: clamp(1.35rem, 3vw, 1.8rem);
  line-height: 1;
  letter-spacing: -0.035em;
}

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

button,
.actions a,
.download {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  border: 1px solid var(--accent);
  border-radius: 999px;
  padding: 0 14px;
  background: var(--accent);
  color: white;
  cursor: pointer;
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 0.92rem;
  font-weight: 760;
  text-decoration: none;
}

button:hover,
.actions a:hover,
.download:hover {
  background: var(--accent-dark);
}

button:disabled {
  cursor: wait;
  opacity: 0.65;
}

.actions a,
.download {
  background: transparent;
  color: var(--accent);
}

.actions a:hover,
.download:hover {
  color: white;
}

button.danger {
  border-color: #991b1b;
  background: transparent;
  color: #991b1b;
}

button.danger:hover {
  background: #991b1b;
  color: white;
}

.status-card {
  margin: 14px 0;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 16px 18px;
  background: rgba(255, 250, 243, 0.68);
  color: var(--muted);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.auth-dialog {
  width: min(420px, calc(100% - 32px));
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 24px;
  background: var(--card);
  color: var(--ink);
  box-shadow: 0 24px 80px rgba(31, 27, 24, 0.24);
}

.auth-dialog::backdrop {
  background: rgba(31, 27, 24, 0.58);
  backdrop-filter: blur(5px);
}

.auth-dialog h2 {
  margin: 4px 0 8px;
  font-size: 1.8rem;
}

.auth-dialog p {
  color: var(--muted);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.auth-dialog label {
  display: block;
  margin: 18px 0 7px;
  color: var(--muted);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 0.88rem;
  font-weight: 760;
}

.auth-dialog input {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0 13px;
  background: white;
  color: var(--ink);
  outline-color: var(--accent);
}

.auth-dialog button {
  width: 100%;
  margin-top: 12px;
}

.auth-dialog .message {
  min-height: 1.2em;
  margin-bottom: 0;
  color: #991b1b;
}

.channel-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 14px 0;
}

.channel-tab {
  background: transparent;
  color: var(--accent);
}

.channel-tab:hover,
.channel-tab[aria-selected="true"] {
  background: var(--accent);
  color: white;
}

.one-off-panel {
  margin: 0 0 14px;
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 14px;
  background: rgba(255, 250, 243, 0.82);
}

.one-off-form label {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 0.88rem;
  font-weight: 760;
}

.one-off-controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

.one-off-controls input {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 15px;
  background: white;
  color: var(--ink);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  outline-color: var(--accent);
}

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

.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 22px;
  color: var(--muted);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.pagination span {
  min-width: 120px;
  text-align: center;
}

.video-card {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 18px;
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 16px;
  background: rgba(255, 250, 243, 0.86);
}

.thumb {
  width: 120px;
  aspect-ratio: 16 / 10;
  border-radius: 16px;
  background: var(--soft);
  object-fit: cover;
}

.video-title {
  margin: 2px 0 8px;
  font-size: clamp(1.25rem, 2vw, 1.7rem);
  line-height: 1.1;
  letter-spacing: -0.025em;
}

.meta {
  margin: 0;
  color: var(--muted);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 0.9rem;
}

.row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

audio {
  width: 100%;
  margin-top: 14px;
}

.message {
  margin-top: 10px;
  color: var(--muted);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 0.9rem;
}

@media (max-width: 680px) {
  .shell {
    width: min(100% - 20px, 1120px);
    padding: 10px 0 24px;
  }

  .hero {
    align-items: flex-start;
    border-radius: 22px;
    flex-direction: column;
  }

  .video-card {
    grid-template-columns: 1fr;
  }

  .thumb {
    width: 100%;
  }

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

  .one-off-controls {
    grid-template-columns: 1fr;
  }

  .pagination span {
    min-width: 0;
  }
}
