body {
  margin: 0;
  font-family: "Inter", "Segoe UI", Tahoma, sans-serif;
  background: #f8fafc;
  color: #0f172a;
}

.page {
  max-width: 980px;
  margin: 0 auto;
  padding: 32px 20px 48px;
  display: grid;
  gap: 20px;
}

.page-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
}

.page-header h1 {
  margin: 0 0 4px;
  font-size: 1.6rem;
}

.section-title {
  font-weight: 700;
}

.page-header p {
  margin: 0;
  color: #64748b;
}

.card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 16px;
  display: grid;
  gap: 12px;
}

.accordion {
  display: grid;
  gap: 12px;
}

.accordion-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
  list-style: none;
}

.accordion-summary::-webkit-details-marker {
  display: none;
}

.accordion-meta {
  font-size: 1.1rem;
  color: #64748b;
  font-weight: 500;
}

.accordion-body {
  padding-top: 4px;
}

.row {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  align-items: start;
}

.column {
  display: grid;
  gap: 8px;
}

.column.actions {
  align-items: start;
  gap: 10px;
}

.label {
  font-size: 0.85rem;
  color: #475569;
}

.strong-label {
  font-weight: 700;
  color: #0f172a;
}

.input {
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 0.95rem;
}

.btn {
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  padding: 10px 14px;
  background: #ffffff;
  cursor: pointer;
  font-weight: 600;
}

.btn.primary {
  background: #0f172a;
  color: #ffffff;
  border-color: #0f172a;
}

.btn.danger {
  border-color: #ef4444;
  color: #b91c1c;
  background: #fee2e2;
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.status {
  font-size: 0.9rem;
  color: #475569;
  min-height: 20px;
}

.helper {
  font-size: 0.8rem;
  color: #64748b;
}

.progress-wrap {
  display: none;
  align-items: center;
  gap: 12px;
}

.progress {
  flex: 1;
  height: 8px;
  border-radius: 999px;
  background: #e2e8f0;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  width: 0%;
  background: #0f172a;
  transition: width 0.2s ease;
}

.progress-value {
  font-size: 0.8rem;
  color: #475569;
  min-width: 40px;
  text-align: right;
}

.library {
  display: grid;
  gap: 10px;
  max-height: 320px;
  overflow-y: auto;
}

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

.metric {
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 12px;
  background: #f8fafc;
}

.metric-label {
  font-size: 0.8rem;
  color: #64748b;
}

.metric-value {
  font-size: 1.3rem;
  font-weight: 700;
  color: #0f172a;
  margin-top: 6px;
}

.top-questions {
  border-top: 1px solid #e2e8f0;
  padding-top: 12px;
}

.top-questions h3 {
  margin: 0 0 8px;
  font-size: 1rem;
}

.top-list {
  display: grid;
  gap: 8px;
  font-size: 0.9rem;
  color: #334155;
}

.top-item {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 6px;
  border-bottom: 1px solid #e2e8f0;
}

.top-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.top-count {
  color: #64748b;
  font-weight: 600;
}

.library-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 10px 12px;
  background: #f8fafc;
}

.library-title {
  display: grid;
  gap: 4px;
  font-weight: 600;
}

.library-meta {
  font-size: 0.8rem;
  color: #64748b;
  font-weight: 400;
}

.link {
  color: #0f172a;
  text-decoration: none;
  font-weight: 600;
}

.link:hover {
  text-decoration: underline;
}

@media (max-width: 720px) {
  .page-header {
    flex-direction: column;
    align-items: flex-start;
  }
}
