/* Общие стили */
body {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  background: #f5f7fa;
  color: #16213e;
  margin: 0;
  padding: 0;
}

header {
  background: #3949ab;
  color: white;
  padding: 1rem 1.5rem;
  text-align: center;
  box-shadow: 0 3px 8px rgba(0,0,0,0.15);
}

.subtitle {
  font-weight: 400;
  font-size: 1rem;
  margin-top: 0.25rem;
  opacity: 0.85;
}

.current-task {
  font-weight: 700;
  font-style: italic;
}

/* ===== Layout с sidebar слева ===== */
.tabs {
  max-width: 1200px;
  margin: 1.5rem auto;
  padding: 0 1rem;
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 1rem;
  min-height: 80vh;
}

/* Скрываем radio */
.tabs input[type="radio"] {
  display: none;
}

/* Sidebar */
.sidebar {
  position: sticky;
  top: 1rem;
  max-height: calc(100vh - 2rem);
  overflow-y: auto;
  background: white;
  border-radius: 12px;
  box-shadow: 0 3px 10px rgba(0,0,0,0.1);
  padding: 0.5rem 0;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

/* Лейблы в sidebar */
.sidebar label {
  display: block;
  padding: 0.65rem 1rem;
  font-weight: 600;
  font-size: 0.9rem;
  color: #16213e;
  cursor: pointer;
  border-radius: 10px;
  border: 2px solid transparent;
  transition: background-color 0.25s ease, border-color 0.25s ease;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  box-shadow: 0 2px 5px rgba(0,0,0,0.06);
}

.sidebar label:hover {
  background: #e8eaf6;
  border-color: #5c6bc0;
}

/* Активный таб */
#tab1:checked ~ .sidebar label[for="tab1"],
#tab2:checked ~ .sidebar label[for="tab2"],
#tab3:checked ~ .sidebar label[for="tab3"],
#tab4:checked ~ .sidebar label[for="tab4"],
#tab5:checked ~ .sidebar label[for="tab5"],
#tab6:checked ~ .sidebar label[for="tab6"],
#tab7:checked ~ .sidebar label[for="tab7"],
#tab8:checked ~ .sidebar label[for="tab8"],
#tab9:checked ~ .sidebar label[for="tab9"],
#tab10:checked ~ .sidebar label[for="tab10"],
#tab11:checked ~ .sidebar label[for="tab11"],
#tab12:checked ~ .sidebar label[for="tab12"],
#tab13:checked ~ .sidebar label[for="tab13"],
#tab14:checked ~ .sidebar label[for="tab14"],
#tab15:checked ~ .sidebar label[for="tab15"],
#tab16:checked ~ .sidebar label[for="tab16"],
#tab17:checked ~ .sidebar label[for="tab17"],
#tab18:checked ~ .sidebar label[for="tab18"],
#tab19:checked ~ .sidebar label[for="tab19"],
#tab20:checked ~ .sidebar label[for="tab20"] {
  background: linear-gradient(135deg, #3949ab, #5c6bc0);
  color: white;
  border-color: #3949ab;
  box-shadow: 0 4px 12px rgba(57,73,171,0.4);
}

/* Заглушки — приглушены и с замком */
.sidebar label.stub {
  opacity: 0.5;
  font-style: italic;
  position: relative;
}

.sidebar label.stub::after {
  content: ' 🔒';
  position: absolute;
  right: 1rem;
  font-size: 0.85rem;
  top: 50%;
  transform: translateY(-50%);
}

/* Основное содержимое */
.content {
  background: white;
  border-radius: 12px;
  padding: 1.5rem 2rem;
  box-shadow: 0 3px 10px rgba(0,0,0,0.1);
  overflow-y: auto;
  max-height: 80vh;
}

/* Панели с задачами — скрыты по умолчанию */
.panel {
  display: none;
}

/* Показываем активную панель */
#tab1:checked ~ .content #panel1,
#tab2:checked ~ .content #panel2,
#tab3:checked ~ .content #panel3,
#tab4:checked ~ .content #panel4,
#tab5:checked ~ .content #panel5,
#tab6:checked ~ .content #panel6,
#tab7:checked ~ .content #panel7,
#tab8:checked ~ .content #panel8,
#tab9:checked ~ .content #panel9,
#tab10:checked ~ .content #panel10,
#tab11:checked ~ .content #panel11,
#tab12:checked ~ .content #panel12,
#tab13:checked ~ .content #panel13,
#tab14:checked ~ .content #panel14,
#tab15:checked ~ .content #panel15,
#tab16:checked ~ .content #panel16,
#tab17:checked ~ .content #panel17,
#tab18:checked ~ .content #panel18,
#tab19:checked ~ .content #panel19,
#tab20:checked ~ .content #panel20 {
  display: block;
}

/* Заголовки */
h2 {
  margin-top: 0;
  color: #3949ab;
}

/* Условие */
.condition {
  background: #e8eaf6;
  border-radius: 8px;
  padding: 1rem 1.25rem;
  margin-bottom: 1rem;
  border: 1px solid #c5cae9;
}

/* Подсказки */
details {
  margin-bottom: 0.8rem;
  border-radius: 6px;
  border: 1px solid #c5cae9;
  background: #f9fafe;
  padding: 0.5rem 1rem;
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.05);
}

details summary {
  cursor: pointer;
  font-weight: 600;
  color: #3949ab;
  outline-offset: 4px;
}

.hint-content {
  margin-top: 0.5rem;
  font-size: 0.9rem;
  line-height: 1.4;
}

/* Навигация по задачам */
.panel-nav {
  margin-top: 1.5rem;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
}

.nav-btn {
  background: #3949ab;
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 10px;
  font-weight: 600;
  cursor: pointer;
  user-select: none;
  transition: background-color 0.25s ease;
  text-align: center;
  flex: 1;
}

.nav-btn:hover {
  background: #5c6bc0;
}

/* Адаптивность */
@media (max-width: 768px) {
  .tabs {
    grid-template-columns: 1fr;
  }
  .sidebar {
    position: relative;
    max-height: none;
    overflow-y: visible;
    margin-bottom: 1rem;
  }
  .content {
    max-height: none;
  }
  .panel-nav {
    flex-direction: column;
  }
  .nav-btn {
    flex: none;
    width: 100%;
  }
}
