* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: system-ui, sans-serif;
  color: #222;
}

.layout {
  display: flex;
  height: 100vh;
}

#sidebar {
  width: 280px;
  flex-shrink: 0;
  overflow-y: auto;
  background: #f4f5f7;
  border-right: 1px solid #ddd;
  padding: 12px 0;
}

.nav-group-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  padding: 2px 12px 2px 0;
  user-select: none;
}

.nav-group-header:hover {
  background: #e8eaf0;
}

.nav-group-title-link {
  flex: 1;
  padding: 8px 8px 8px 16px !important;
  font-weight: 600;
  color: #1a4fd6;
  text-decoration: none;
}

.nav-group-title-text {
  flex: 1;
  padding: 8px 8px 8px 16px;
  font-weight: 600;
  color: #333;
}

.nav-group-arrow {
  font-size: 0.6em;
  color: #888;
  padding: 4px 6px;
  transition: transform 0.2s ease;
  transform: rotate(180deg); /* ▼ по умолчанию (закрыто) */
  display: inline-block;
}

.nav-group.open .nav-group-arrow {
  transform: rotate(0deg); /* ▲ когда открыто */
}

.nav-sub {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  max-height: 0;
  transition: max-height 0.25s ease;
}

.nav-group.open .nav-sub {
  max-height: 600px;
}

.nav-sub .nav-link {
  padding-left: 28px;
  font-size: 0.95em;
}

.nav-link {
  display: block;
  padding: 8px 16px;
  color: #1a4fd6;
  text-decoration: none;
}

.nav-link:hover {
  background: #e8eaf0;
}

.nav-link.active {
  background: #dbe3ff;
  font-weight: 600;
}

#content {
  flex: 1;
  overflow-y: auto;
  padding: 32px 48px;
}

#content h1 {
  margin-top: 0;
}

#content .subtitle {
  color: #666;
  margin-top: -8px;
}

#content .btn {
  display: inline-block;
  background: #1a4fd6;
  color: #fff;
  text-decoration: none;
  padding: 10px 20px;
  border-radius: 4px;
}

#content .btn:hover {
  background: #143eb0;
}

#content .phrase {
  border: 1px solid #e2e2e2;
  border-radius: 6px;
  padding: 16px 20px;
  margin-bottom: 16px;
}

#content .phrase-num {
  font-weight: 700;
  color: #1a4fd6;
  margin-bottom: 6px;
}

#content .fi-prompt,
#content .ru-prompt {
  font-weight: 600;
  margin: 4px 0;
}

#content .fi-answer,
#content .ru-answer {
  margin: 4px 0;
}

#content .ru-prompt,
#content .ru-answer {
  color: #555;
}

#content .phrase audio {
  width: 100%;
  margin-top: 10px;
}

#content .dialogue-card {
  border: 1px solid #e2e2e2;
  border-radius: 6px;
  padding: 16px 20px;
  margin-bottom: 20px;
}

#content .dialogue-card h3 {
  margin: 4px 0 10px;
}

#content .dialogue-task {
  color: #555;
  font-style: italic;
  margin-bottom: 14px;
}

#content .dialogue-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 24px;
  margin-bottom: 12px;
}

#content .dialogue-columns p {
  margin: 4px 0;
}

#content .dialogue-ru {
  color: #555;
}

#content .dialogue-card audio {
  width: 100%;
  margin: 10px 0;
}

#content .exam-blank {
  background: #f7f8fa;
  border-radius: 4px;
  padding: 12px 16px;
  margin-top: 12px;
}

#content .exam-blank p {
  margin: 4px 0;
}

#content .exam-blank-title {
  font-weight: 600;
  color: #444;
  margin-bottom: 8px !important;
}

@media (max-width: 700px) {
  #content .dialogue-columns {
    grid-template-columns: 1fr;
  }
}

#content .divider {
  width: 70%;
  height: 1px;
  border-bottom: 1px solid #ccc;
  margin: 0 auto 16px auto;
  padding-top: 16px;
}

#content .box {
  background: #f7f8fa;
  border-radius: 6px;
  padding: 16px 24px;
  margin-bottom: 20px;
}

#content .box-title {
  font-weight: 600;
  color: #444;
  margin: 0 0 8px !important;
}

#content .box ol,
#content .box ul {
  margin: 0;
  padding-left: 20px;
}

#content .box p:last-child {
  margin-bottom: 0;
}

#content blockquote {
  border-left: 3px solid #1a4fd6;
  margin: 0 0 16px;
  padding: 2px 16px;
  color: #444;
  font-style: italic;
}

#content .table-wrap {
  overflow-x: auto;
  margin-bottom: 20px;
}

#content table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92em;
}

#content th,
#content td {
  border: 1px solid #e2e2e2;
  padding: 10px 12px;
  text-align: left;
  vertical-align: top;
}

#content th {
  background: #f4f5f7;
  font-weight: 600;
}

#content .faq-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

#content .faq-list li {
  position: relative;
  padding: 4px 0 14px 28px;
}

#content .faq-list li::before {
  content: '\2713';
  position: absolute;
  left: 0;
  color: #1a4fd6;
  font-weight: 700;
}

#content .intro-video {
  display: block;
  width: 100%;
  max-width: 560px;
  margin: 0 auto 20px;
  border-radius: 6px;
}
