* {
  box-sizing: border-box;
}

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  margin: 0;
  background: #0d1117;
  color: #e6edf3;
}

main {
  max-width: 960px;
  margin: 0 auto;
  padding: 1.5rem;
}

.auth-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.auth-card {
  width: min(420px, 100%);
  border: 1px solid #30363d;
  border-radius: 12px;
  background: #111827;
  padding: 1rem;
}

.auth-card h1 {
  margin-top: 0;
}

.auth-card input {
  width: 100%;
  background: #0d1117;
  border: 1px solid #30363d;
  color: #e6edf3;
  padding: 0.6rem;
  border-radius: 6px;
}

.auth-actions {
  margin-top: 0.8rem;
}

.auth-status {
  margin-top: 0.6rem;
  color: #8b949e;
  font-size: 0.9rem;
}

header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.header-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  align-items: center;
}

button {
  background: #1f6feb;
  color: white;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 4px;
  cursor: pointer;
}

button.danger {
  background: #b62324;
}

section {
  margin-bottom: 1.5rem;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 0.5rem;
}

th,
td {
  border: 1px solid #30363d;
  padding: 0.5rem;
}

table input.table-input {
  width: 100%;
  background: #0d1117;
  border: 1px solid #30363d;
  color: #e6edf3;
  padding: 0.25rem;
}

.actions-cell {
  display: flex;
  gap: 0.4rem;
}

.upload-form {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.upload-form input[type="file"] {
  color: #e6edf3;
}

th {
  background: #161b22;
  text-align: left;
}

tr:nth-child(even) td {
  background: #151a21;
}

.hidden {
  display: none;
}

button.secondary {
  background: transparent;
  color: #58a6ff;
  border: 1px solid #58a6ff;
  margin-bottom: 1rem;
}

.table-link {
  background: none;
  border: none;
  color: #58a6ff;
  text-decoration: underline;
  cursor: pointer;
  padding: 0;
  font: inherit;
}

.table-link:hover,
.table-link:focus {
  color: #79c0ff;
}

.view-switch {
  display: inline-flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.view-switch button {
  background: #161b22;
  border: 1px solid #30363d;
}

.view-switch button.active {
  background: #1f6feb;
  border-color: #1f6feb;
}

.course-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 0.5rem;
}

.course-actions span {
  color: #8b949e;
}

.course-actions button {
  white-space: nowrap;
}

#course-meta h2 {
  margin-bottom: 0.25rem;
}

#course-meta p {
  margin: 0.1rem 0 0.4rem;
  color: #8b949e;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.4rem;
  margin-bottom: 1.5rem;
}

.weekday-row div {
  text-align: center;
  font-size: 0.85rem;
  color: #8b949e;
  border: none;
  background: transparent;
}

.calendar-cell {
  border: 1px solid #30363d;
  min-height: 80px;
  padding: 0.3rem;
  background: #151a21;
}

.calendar-cell.empty {
  background: transparent;
  border: none;
}

.day-number {
  font-size: 0.85rem;
  color: #8b949e;
}

.lesson-chip {
  background: #1f6feb;
  color: white;
  border-radius: 4px;
  padding: 0.15rem 0.35rem;
  display: inline-block;
  margin-top: 0.25rem;
  font-size: 0.75rem;
}

#status {
  margin-top: 1rem;
  font-size: 0.9rem;
  color: #58a6ff;
}

#lesson-detail-page {
  max-width: 960px;
  margin: 0 auto;
  padding: 1.5rem;
}

.lesson-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1rem;
}

.lesson-header-main {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.lesson-nav {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.lesson-nav button {
  white-space: nowrap;
}

.image-nav {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.lesson-image-figure {
  margin: 0;
  border: 1px solid #30363d;
  border-radius: 8px;
  padding: 0.5rem;
  background: #0d1117;
}

.lesson-image-viewer {
  width: 100%;
  max-height: 72vh;
  object-fit: contain;
  border-radius: 6px;
  cursor: zoom-in;
  display: block;
  background: #0b0f14;
}

.lesson-image-caption {
  margin: 0.5rem 0 0;
  color: #8b949e;
  font-size: 0.9rem;
}

.image-dots {
  display: flex;
  gap: 0.45rem;
  align-items: center;
  justify-content: center;
  margin: 0.35rem 0 0.65rem;
}

.image-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  border: 1px solid #4b5563;
  background: #1f2937;
  padding: 0;
}

.image-dot.active {
  background: #58a6ff;
  border-color: #58a6ff;
}

#lesson-player {
  background: #0d1117;
  border: 1px solid #30363d;
  border-radius: 8px;
  padding: 0.5rem;
  min-height: 320px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.video-frame {
  width: 100%;
  min-height: 320px;
  background: #000;
  border: none;
  border-radius: 6px;
}

.video-frame:focus {
  outline: 2px solid #1f6feb;
}

#lesson-playlist {
  list-style: none;
  padding: 0;
  margin: 0.5rem 0;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

#lesson-playlist li {
  border: 1px solid #30363d;
  border-radius: 6px;
  padding: 0.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

#lesson-playlist li.active {
  border-color: #1f6feb;
  background: rgba(31, 111, 235, 0.1);
}

#lesson-playlist li.empty {
  border-style: dashed;
  justify-content: center;
}

.playlist-button {
  background: transparent;
  border: none;
  color: #e6edf3;
  cursor: pointer;
  font-size: 1rem;
  padding: 0;
  text-align: left;
  flex: 1;
}

.playlist-button:hover,
.playlist-button:focus {
  color: #58a6ff;
}

.playlist-link {
  color: #58a6ff;
  text-decoration: underline;
}

.pill {
  background: #161b22;
  border: 1px solid #30363d;
  border-radius: 999px;
  padding: 0.1rem 0.6rem;
  font-size: 0.8rem;
}

.player-placeholder {
  text-align: center;
  color: #8b949e;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
}

.section-hint {
  margin: 0.25rem 0 0.75rem;
  color: #8b949e;
  font-size: 0.9rem;
}

.form-hint {
  margin: 0;
  color: #8b949e;
  font-size: 0.85rem;
}

#jumpmark-list {
  list-style: none;
  padding: 0;
  margin: 0 0 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.jumpmark-item {
  border: 1px solid #30363d;
  border-radius: 6px;
  padding: 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.jumpmark-headline {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  align-items: center;
}

.jumpmark-jump {
  background: transparent;
  border: none;
  color: #e6edf3;
  font-size: 1rem;
  padding: 0;
  cursor: pointer;
  text-align: left;
}

.jumpmark-jump:hover,
.jumpmark-jump:focus {
  color: #58a6ff;
}

.jumpmark-time {
  font-size: 0.85rem;
  color: #8b949e;
}

.jumpmark-description {
  margin: 0;
  color: #c9d1d9;
  font-size: 0.9rem;
}

.jumpmark-actions {
  display: flex;
  gap: 0.5rem;
}

.jumpmark-delete {
  background: transparent;
  border: 1px solid #f85149;
  color: #f85149;
}

#jumpmark-form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  border: 1px solid #30363d;
  padding: 0.75rem;
  border-radius: 6px;
}

#jumpmark-form input,
#jumpmark-form textarea {
  width: 100%;
  background: #0d1117;
  border: 1px solid #30363d;
  color: #e6edf3;
  padding: 0.4rem;
  border-radius: 4px;
}

.form-field label {
  display: block;
  margin-bottom: 0.3rem;
  font-size: 0.9rem;
  color: #8b949e;
}

#lesson-status {
  margin: 1.5rem auto;
  max-width: 960px;
  font-size: 0.9rem;
  color: #58a6ff;
}
