/* AP Micro learning layer — roadmap, lesson template, lab, glossary */

.aml-hub,
.aml-page {
  padding-bottom: 48px;
}

.aml-hero {
  padding: 8px 0 18px;
}

.aml-kicker {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
  color: var(--primary);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.aml-progress {
  margin: 16px 0 8px;
}

.aml-progress-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
  color: var(--text-muted);
  font-size: 0.875rem;
}

.aml-progress-bar {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--blue-50);
  border: 1px solid var(--border);
}

.aml-progress-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #2563eb, #f472b6);
}

.aml-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 16px 0 8px;
}

.aml-tool {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 650;
}

.aml-tool:hover {
  border-color: rgba(37, 99, 235, 0.35);
  background: var(--blue-50);
}

.aml-tool--lab {
  background: #eff6ff;
  color: #1d4ed8;
}

.aml-roadmap {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 18px;
}

.aml-topic {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 14px 16px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-card);
  text-decoration: none;
  color: inherit;
  box-shadow: var(--shadow);
}

.aml-topic:hover {
  border-color: rgba(37, 99, 235, 0.28);
}

.aml-dot {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid #cbd5e1;
  background: #fff;
}

.aml-dot[data-status="active"] {
  border-color: #f59e0b;
  background: #fde68a;
}

.aml-dot[data-status="done"] {
  border-color: #16a34a;
  background: #86efac;
}

.aml-topic-title {
  margin: 0;
  font-size: 1.02rem;
  font-weight: 750;
}

.aml-topic-sub {
  margin: 2px 0 0;
  color: var(--text-muted);
  font-size: 0.84rem;
}

.aml-topic-status {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  white-space: nowrap;
}

.aml-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}

.aml-badge {
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--pink-50);
  color: #9d174d;
  border: 1px solid var(--border-pink);
  font-size: 0.78rem;
  font-weight: 700;
}

.aml-badge.is-off {
  background: #f8fafc;
  color: #94a3b8;
  border-color: var(--border);
}

.aml-section {
  margin: 10px 0;
  padding: 12px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: #fff;
}

.aml-section h2 {
  display: flex;
  gap: 8px;
  align-items: baseline;
  margin: 0 0 6px;
  font-size: 1.02rem;
}

.aml-story {
  background: linear-gradient(135deg, #fff7ed 0%, #fdf2f8 100%);
  border-color: rgba(244, 114, 182, 0.18);
}

.aml-oneliner {
  background: linear-gradient(135deg, #eff6ff 0%, #f8fafc 100%);
}

.aml-oneliner p {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 750;
  line-height: 1.45;
}

.aml-zh {
  margin-top: 4px;
  color: var(--text-muted);
  font-size: 0.92rem;
  line-height: 1.45;
}

.aml-oneliner .aml-zh {
  font-weight: 600;
}

.aml-traps li {
  margin: 0 0 4px 18px;
  line-height: 1.45;
}

.aml-terms {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.aml-terms th,
.aml-terms td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}

.aml-terms th {
  color: var(--primary);
  font-size: 0.75rem;
  letter-spacing: 0.03em;
}

.aml-term-link {
  color: var(--primary);
  font-weight: 700;
  text-decoration: none;
}

.aml-complete {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-top: 8px;
}

.aml-why {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  background: #f8fafc;
}

.aml-why h4 {
  margin: 0 0 6px;
  font-size: 0.82rem;
}

.aml-why li {
  margin: 0 0 6px 16px;
  color: var(--text-muted);
  font-size: 0.875rem;
}

.aml-lab-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.aml-lab-btn {
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #fff;
  cursor: pointer;
  font: inherit;
  font-size: 0.85rem;
  font-weight: 650;
}

.aml-lab-btn.is-on,
.aml-lab-btn:hover {
  background: var(--blue-50);
  border-color: #93c5fd;
  color: #1d4ed8;
}

.aml-lab-readout {
  margin-top: 10px;
  padding: 12px 14px;
  border-radius: 12px;
  background: #eff6ff;
  color: #1e3a8a;
  font-weight: 650;
  line-height: 1.55;
}

.aml-lab-svg {
  width: 100%;
  max-width: 560px;
}

.aml-lab-svg svg {
  width: 100%;
  height: auto;
  display: block;
}

.aml-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.aml-card {
  display: block;
  padding: 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: #fff;
  text-decoration: none;
  color: inherit;
}

.aml-card:hover {
  border-color: rgba(244, 114, 182, 0.4);
}

.aml-warn {
  margin: 10px 0;
  padding: 10px 12px;
  border-radius: 10px;
  background: #fffbeb;
  color: #92400e;
  font-size: 0.84rem;
}

.aml-note-input {
  width: 100%;
  min-height: 64px;
  margin-top: 8px;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  font: inherit;
}

.aml-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.aml-garden-opt {
  margin-top: 22px;
  padding: 12px 14px;
  border-radius: 12px;
  background: #f8fafc;
  color: var(--text-muted);
  font-size: 0.875rem;
}

.aml-units-mini {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.aml-next {
  display: block;
  margin: 8px 0 16px;
  padding: 16px 18px;
  border-radius: var(--radius);
  border: 1px solid rgba(37, 99, 235, 0.28);
  background: linear-gradient(135deg, #eff6ff 0%, #fdf2f8 100%);
  text-decoration: none;
  color: inherit;
}

.aml-next:hover {
  border-color: rgba(37, 99, 235, 0.5);
}

.aml-flash {
  margin: 8px 0 14px;
  padding: 10px 12px;
  border-radius: 10px;
  background: #ecfdf5;
  color: #166534;
  font-size: 0.9rem;
  font-weight: 650;
}

.aml-path-note {
  margin: 14px 0 8px;
  color: var(--text-muted);
  font-size: 0.86rem;
  line-height: 1.55;
}

.aml-topic.is-next {
  border-color: rgba(37, 99, 235, 0.4);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.08);
}

.aml-caption {
  margin-top: 10px;
  font-size: 0.92rem;
  line-height: 1.55;
}

.aml-filter {
  width: 100%;
  max-width: 420px;
  margin: 8px 0 14px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  font: inherit;
}

.aml-terms-wrap {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.aml-related {
  white-space: nowrap;
  font-size: 0.82rem;
}

.aml-subhead {
  margin: 22px 0 10px;
  font-size: 1.05rem;
}

.aml-plan-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.aml-plan-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #fff;
}

.aml-plan-add {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-top: 12px;
}

.aml-plan-add .aml-filter {
  margin: 0;
  flex: 1 1 220px;
}

@media (max-width: 720px) {
  .aml-topic {
    grid-template-columns: auto 1fr;
  }
  .aml-topic-status {
    grid-column: 2;
  }
  .aml-progress-meta {
    flex-direction: column;
    gap: 4px;
  }
  .aml-complete .btn,
  .aml-complete a.btn {
    width: 100%;
    justify-content: center;
  }
  .aml-terms {
    font-size: 0.82rem;
  }
  .aml-lab-btn {
    font-size: 0.8rem;
  }
  .aml-hero .page-title {
    font-size: 1.45rem;
  }
}
