:root {
  --bg: #f2f4f9;
  --card-bg: #ffffff;
  --text: #1f2430;
  --muted: #666f80;
  --primary: #2f6fed;
  --primary-dark: #1f52b8;
  --danger: #d9534f;
  --success: #1f9d55;
  --border: #e2e5ec;
  --radius: 12px;
  --shadow: 0 4px 16px rgba(20, 25, 40, 0.08);
  font-size: 16px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Segoe UI", Roboto, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
  background: var(--card-bg);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
}

.brand {
  font-weight: 700;
  text-decoration: none;
  color: var(--text);
  font-size: 1.05rem;
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  color: var(--text);
}

.brand-logo {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
}

.brand-tagline {
  font-weight: 600;
  font-style: italic;
  font-size: 0.95rem;
  color: var(--muted);
  white-space: nowrap;
}

.topnav a {
  margin-left: 1.25rem;
  text-decoration: none;
  color: var(--primary);
  font-weight: 600;
}

@media (max-width: 720px) {
  .topbar {
    flex-wrap: wrap;
    row-gap: 0.5rem;
  }

  .brand-lockup {
    order: 3;
    width: 100%;
    justify-content: center;
  }
}

.container {
  max-width: 880px;
  margin: 0 auto;
  padding: 1.5rem 1rem 3rem;
}

.card {
  background: var(--card-bg);
  padding: 1.75rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 1.25rem;
}

.intro-card h1 {
  margin-top: 0;
}

label {
  display: block;
  font-weight: 600;
  margin-top: 1rem;
  margin-bottom: 0.35rem;
}

textarea,
input[type="text"],
input:not([type]) {
  width: 100%;
  padding: 0.7rem 0.8rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  font-size: 0.98rem;
  font-family: inherit;
  background: #fbfcfe;
}

textarea:focus,
input:focus {
  outline: 2px solid var(--primary);
  outline-offset: 1px;
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 400;
  color: var(--muted);
}

.checkbox-row input {
  width: auto;
}

button {
  background: var(--primary);
  color: white;
  border: 0;
  padding: 0.75rem 1.25rem;
  border-radius: 8px;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 600;
  margin-top: 1.25rem;
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  transition: background 0.15s ease;
}

button:hover {
  background: var(--primary-dark);
}

button:disabled {
  opacity: 0.7;
  cursor: progress;
}

.btn-spinner {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-top-color: white;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.muted {
  color: var(--muted);
  font-size: 0.92rem;
}

.section-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
}

.section-heading a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
}

.badge {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.badge-llm {
  background: #e6f4ea;
  color: var(--success);
}

.badge-heuristic {
  background: #eef1fb;
  color: var(--primary-dark);
}

.party-list,
.session-list {
  list-style: none;
  padding: 0;
  margin: 0.5rem 0;
}

.party-list li {
  padding: 0.5rem 0;
  border-bottom: 1px dashed var(--border);
}

.party-list li:last-child {
  border-bottom: none;
}

.synthesis-text {
  white-space: pre-line;
  background: #f7f9fd;
  border-left: 3px solid var(--primary);
  padding: 0.9rem 1rem;
  border-radius: 0 8px 8px 0;
}

.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

@media (max-width: 640px) {
  .two-col {
    grid-template-columns: 1fr;
  }
}

details {
  margin-top: 1rem;
  border-top: 1px solid var(--border);
  padding-top: 0.75rem;
}

details summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--muted);
}

.session-item {
  padding: 0.9rem 0;
  border-bottom: 1px solid var(--border);
}

.session-item:last-child {
  border-bottom: none;
}

.session-link {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.75rem;
  text-decoration: none;
  color: var(--text);
}

.session-preview {
  margin: 0.35rem 0 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.inline-form {
  display: inline;
}

.link-button {
  background: none;
  border: none;
  padding: 0;
  margin: 0.3rem 0 0;
  color: var(--danger);
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: underline;
  cursor: pointer;
}

.link-button:hover {
  background: none;
  color: #a83431;
}

.pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 1rem;
  font-size: 0.9rem;
}

.pagination a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
}

.pagination .disabled {
  color: #b7bccb;
}

.flash-stack {
  margin-bottom: 1rem;
}

.flash {
  padding: 0.75rem 1rem;
  border-radius: 8px;
  margin-bottom: 0.5rem;
  font-weight: 600;
}

.flash-success {
  background: #e6f4ea;
  color: var(--success);
}

.flash-error {
  background: #fbeaea;
  color: var(--danger);
}

.back-link {
  display: inline-block;
  margin-bottom: 1rem;
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
}

.site-footer {
  text-align: center;
  color: var(--muted);
  font-size: 0.85rem;
  padding: 1.5rem 0 2.5rem;
}

.result-area[hidden] {
  display: none;
}

.charts-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-top: 0.75rem;
}

.resource-block {
  background: #f7f9fd;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.9rem 1rem;
  margin-bottom: 0.75rem;
}

.resource-block h4 {
  margin: 0 0 0.4rem;
}

.resource-block ul {
  margin: 0;
  padding-left: 1.1rem;
}

.resource-block a {
  color: var(--primary);
  font-weight: 600;
}

.chart-card {
  background: #f7f9fd;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.9rem;
}

.chart-card h4 {
  margin: 0 0 0.5rem;
  font-size: 0.85rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.chart-card canvas {
  max-height: 220px;
}

@media (max-width: 800px) {
  .charts-grid {
    grid-template-columns: 1fr;
  }
}
