/* ── Subject card ── */
.subject-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  padding: 24px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  touch-action: manipulation;
  transition: all var(--transition);
  text-align: center;
  min-height: var(--tap-size);
}
.subject-card:active { transform: scale(0.96); opacity: 0.7; }
.subject-card .icon { font-size: 2rem; color: var(--accent); }
.subject-card .name { font-size: 1.1rem; font-weight: 700; color: var(--text); }
.subject-card .meta { font-size: 0.75rem; color: var(--text-muted); }

/* ── Chapter card (stacked layout) ── */
.ch-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  cursor: pointer;
  touch-action: manipulation;
  transition: border-color var(--transition), box-shadow var(--transition);
  margin-bottom: 12px;
}
.ch-card:active { opacity: 0.7; }

.ch-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
}
.ch-card-icon {
  font-size: 1.6rem;
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  text-align: center;
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
}
.ch-card-icon svg {
  width: 100%;
  height: 100%;
}
.ch-card-info {
  flex: 1;
  min-width: 0;
}
.ch-card-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.35;
}
.ch-card-meta {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 4px;
}

.ch-card-actions {
  display: flex;
  gap: 8px;
}
.ch-action-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 0;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  touch-action: manipulation;
  white-space: nowrap;
  transition: opacity var(--transition), filter var(--transition), transform var(--transition);
  min-height: var(--tap-size);
}
.ch-action-btn:active { opacity: 0.7; }
.ch-revise {
  background: var(--accent);
  color: var(--on-accent);
}
.ch-glossary {
  background: var(--surface2);
  color: var(--accent);
  border: 1px solid var(--border);
}

/* ── Progress bar ── */
.progress-bar {
  height: 6px;
  background: var(--surface2);
  border-radius: 999px;
  overflow: hidden;
  margin-top: 8px;
}
.progress-bar .fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  border-radius: 999px;
  transition: width 0.4s ease;
}

/* ── Dashboard card ── */
.dashboard-card {
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.dashboard-card .title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
}
.dashboard-card .value {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text);
  margin-top: 4px;
}

/* ── Toggle switch ── */
.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
  min-height: var(--tap-size);
}
.section-title + .toggle-row,
.section-title + .settings-btn-group {
  padding-top: 0;
}
.toggle-row .label { font-size: 0.9rem; color: var(--text); }
.toggle-row .sublabel { font-size: 0.78rem; color: var(--text-muted); margin-top: 2px; }

.toggle {
  position: relative;
  width: 50px;
  height: 28px;
  flex-shrink: 0;
}
.toggle input { opacity: 0; width: 0; height: 0; position: absolute; }
.toggle .slider {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: var(--surface2);
  border-radius: 999px;
  cursor: pointer;
  transition: all var(--transition);
  touch-action: manipulation;
}
.toggle .slider::before {
  content: '';
  position: absolute;
  width: 22px;
  height: 22px;
  left: 3px;
  bottom: 3px;
  background: white;
  border-radius: 50%;
  transition: all var(--transition);
}
.toggle input:checked + .slider { background: var(--accent); }
.toggle input:checked + .slider::before { transform: translateX(22px); }

/* ── Font size control ── */
.font-size-control {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.font-size-control button {
  width: 40px;
  height: 40px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  touch-action: manipulation;
}
.font-size-control button:active { opacity: 0.7; }
.font-size-control .value {
  font-size: 0.8rem;
  color: var(--text-secondary);
  min-width: 48px;
  text-align: center;
}

/* ── Placeholder ── */
.placeholder {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}
.placeholder .icon { font-size: 2.5rem; margin-bottom: 12px; }
.placeholder p { font-size: 0.9rem; line-height: 1.6; }
