* { box-sizing: border-box; }
body {
  font-family: "Segoe UI", system-ui, sans-serif;
  margin: 0;
  background: #f5f6f8;
  color: #1a1a1a;
}
header {
  background: #003876;
  color: #fff;
  padding: 16px 24px;
}
header h1 { margin: 0; font-size: 1.15rem; font-weight: 600; }
header p { margin: 6px 0 0; font-size: 0.85rem; opacity: 0.9; }
.header-row { display: flex; align-items: flex-start; justify-content: space-between; }
.header-parent { margin: 0 0 4px; font-size: 0.78rem; opacity: 0.85; }
.header-parent a { color: #adf; text-decoration: none; font-weight: 600; }
.header-parent a:hover { text-decoration: underline; }
.header-host { opacity: 0.75; }
.layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 0;
  min-height: calc(100vh - 72px);
}
nav.questions {
  background: #fff;
  border-right: 1px solid #ddd;
  padding: 12px 0;
  overflow-y: auto;
}
nav.questions a {
  display: block;
  padding: 10px 16px;
  color: #333;
  text-decoration: none;
  font-size: 0.9rem;
  border-left: 3px solid transparent;
}
nav.questions a.active { background: #eef4fc; border-left-color: #003876; font-weight: 600; }
nav.questions a.done { color: #2a7; }
nav.questions a.done::before { content: "✓ "; }
.nav-glossary { padding: 4px 0 8px; }
.nav-tabs {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 4px 8px 8px;
}
.nav-tab {
  display: block;
  padding: 10px 12px;
  color: #333;
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 600;
  border-radius: 6px;
  border-left: 3px solid transparent;
}
.nav-tab:hover { background: #f0f4fa; }
.nav-tab.active {
  background: #eef4fc;
  border-left-color: #003876;
  color: #003876;
}
.nav-tab.hidden { display: none; }
#nav-tab-questions::before { content: "☑ "; }
#nav-tab-glossary::before { content: "📖 "; }
#nav-tab-deal::before { content: "📝 "; }
.view-toolbar {
  margin: 0 0 12px;
}
.btn-back {
  font-size: 0.92rem;
}
.nav-glossary-link {
  display: block;
  padding: 10px 16px;
  color: #003876;
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 600;
  border-left: 3px solid transparent;
}
.nav-glossary-link.active { background: #eef4fc; border-left-color: #003876; }
.nav-glossary-link::before { content: "📖 "; }
.nav-divider {
  height: 1px;
  background: #e0e0e0;
  margin: 4px 12px 8px;
}
.nav-phase-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #666;
  margin: 12px 16px 6px;
}
.status-notarial {
  display: block;
  margin-top: 8px;
  font-size: 0.88rem;
  font-weight: 600;
  line-height: 1.4;
}
.status-notarial-required { color: #b71c1c; }
.status-notarial-recommended { color: #e65100; }
.axis-help { color: #666; font-size: 0.9rem; margin: 0 0 12px; }
.panel.hidden { display: none; }

.phase1-demo {
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid #e2e8f0;
}
.phase1-note {
  font-size: 0.92rem;
  color: #444;
  margin-bottom: 0.75rem;
}
#results-demo a,
#results a {
  display: block;
  margin: 0.35rem 0;
}
.glossary-intro {
  color: #555;
  font-size: 0.9rem;
  line-height: 1.45;
  margin: 0 0 16px;
  white-space: pre-line;
}
.glossary-section { margin-bottom: 20px; }
.glossary-section h3 {
  margin: 0 0 8px;
  font-size: 0.95rem;
  color: #003876;
}
.glossary-entry {
  margin: 0 0 10px;
  padding: 10px 12px;
  background: #f8fbff;
  border: 1px solid #e3ecf5;
  border-radius: 6px;
  font-size: 0.9rem;
  line-height: 1.4;
}
.glossary-entry dt { font-weight: 600; margin: 0 0 4px; }
.glossary-entry dd { margin: 0; color: #444; }
.glossary-entry .refs { font-size: 0.8rem; color: #666; margin-top: 4px; }
.glossary-toc {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}
.glossary-toc a {
  font-size: 0.85rem;
  color: #003876;
  text-decoration: none;
  padding: 4px 10px;
  border: 1px solid #b8d4f0;
  border-radius: 4px;
  background: #fff;
}
.glossary-toc a:hover { background: #eef4fc; }
main { padding: 20px 24px; overflow-y: auto; }
.panel {
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 16px;
}
.panel h2 { margin: 0 0 12px; font-size: 1rem; }
.status-bar {
  background: #eef4fc;
  border: 1px solid #b8d4f0;
  border-radius: 6px;
  padding: 12px 16px;
  margin-bottom: 16px;
  font-size: 0.95rem;
}
.status-bar.error { background: #fdecea; border-color: #f5c6cb; }
.answer {
  display: block;
  width: 100%;
  text-align: left;
  margin: 8px 0;
  padding: 12px 14px;
  border: 1px solid #ccc;
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
  font-size: 0.95rem;
  line-height: 1.35;
}
.answer:hover:not(:disabled) { border-color: #003876; background: #f8fbff; }
.answer.selected { border-color: #003876; background: #ddeaf8; font-weight: 600; }
.answer:disabled { opacity: 0.45; cursor: not-allowed; }
.answer .hint { display: block; font-size: 0.8rem; color: #c00; margin-top: 4px; font-weight: normal; }
.answer-group { margin-bottom: 20px; padding-bottom: 8px; border-bottom: 1px solid #eee; }
.answer-group:last-child { border-bottom: none; }
.answer-group-title { margin: 0 0 6px; font-size: 0.95rem; color: #003876; }
.answer-group-preamble { margin: 0 0 10px; font-size: 0.85rem; color: #555; }
.deal-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 20px;
}
.deal-field label { display: block; font-weight: 600; font-size: 0.85rem; margin-bottom: 4px; }
.deal-field .field-hint { display: block; font-size: 0.78rem; color: #555; margin-bottom: 4px; line-height: 1.35; }
.deal-field input {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 0.95rem;
}
.deal-field.full { grid-column: 1 / -1; }
.actions { margin-top: 20px; }
.btn {
  padding: 12px 24px;
  font-size: 1rem;
  border: none;
  border-radius: 6px;
  cursor: pointer;
}
.btn-primary { background: #003876; color: #fff; }
.btn-primary:disabled { background: #999; cursor: not-allowed; }
.btn-secondary { background: #eee; color: #333; margin-left: 8px; }
#results a {
  display: inline-block;
  margin: 6px 12px 6px 0;
  padding: 8px 14px;
  background: #e8f5e9;
  border: 1px solid #a5d6a7;
  border-radius: 4px;
  color: #1b5e20;
  text-decoration: none;
  font-size: 0.9rem;
}
#results a:hover { background: #c8e6c9; }
.spinner { display: none; color: #666; margin-top: 12px; }
.spinner.visible { display: block; }

.beta-banner {
  background: #fff3cd;
  color: #664d03;
  padding: 10px 24px;
  font-size: 0.85rem;
  border-bottom: 1px solid #ffecb5;
}
.beta-banner a { color: #003876; font-weight: 600; }

.deal-privacy-note {
  font-size: 0.85rem;
  color: #555;
  background: #f0f4fa;
  padding: 10px 12px;
  border-radius: 4px;
  margin: 0 0 12px;
  line-height: 1.45;
}

.party-sample-box {
  font-size: 0.85rem;
  color: #333;
  background: #e8eef6;
  border: 1px solid #c5d4e8;
  padding: 10px 12px;
  border-radius: 4px;
  margin: 0 0 12px;
  line-height: 1.45;
}
.party-sample-box p { margin: 0; }

.site-footer {
  background: #fff;
  border-top: 1px solid #ddd;
  padding: 16px 24px;
  font-size: 0.85rem;
  color: #555;
}
.site-footer nav { margin-bottom: 8px; }
.site-footer nav a {
  margin-right: 14px;
  color: #003876;
  text-decoration: none;
}
.site-footer nav a:hover { text-decoration: underline; }
.site-footer p { margin: 0; }
.site-footer a { color: #003876; }

.legal-page header h1 { font-size: 1.25rem; }
.legal-main {
  max-width: 820px;
  margin: 0 auto;
  padding: 24px;
  background: #fff;
  min-height: 50vh;
}
.legal-main section { margin-bottom: 24px; }
.legal-main h2 { font-size: 1.05rem; color: #003876; margin: 0 0 8px; }
.legal-main p, .legal-main li { line-height: 1.55; font-size: 0.95rem; }
.legal-meta { color: #666; font-size: 0.9rem; }
.legal-draft { color: #c62828; font-weight: 600; }
.legal-back { margin-top: 32px; }
.legal-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.legal-table th, .legal-table td {
  border: 1px solid #ddd;
  padding: 8px 10px;
  vertical-align: top;
}
.legal-table th { background: #eef4fc; text-align: left; }

.feedback-form label {
  display: block;
  margin-bottom: 14px;
  font-size: 0.9rem;
}
.feedback-form input, .feedback-form select, .feedback-form textarea {
  display: block;
  width: 100%;
  max-width: 560px;
  margin-top: 4px;
  padding: 8px;
  font: inherit;
}
.checkbox-label { display: flex; gap: 8px; align-items: flex-start; max-width: 560px; }
.checkbox-label input { width: auto; margin-top: 4px; }
.feedback-status { color: #2a7; font-weight: 600; }
.review-card, .news-card {
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  padding: 12px 14px;
  margin-bottom: 12px;
  background: #fafafa;
}
.review-card p, .news-card p { margin: 8px 0 0; }
.news-card time { color: #888; font-size: 0.85rem; }
.muted { color: #888; }

@media (max-width: 800px) {
  .layout { grid-template-columns: 1fr; }
  nav.questions { border-right: none; border-bottom: 1px solid #ddd; }
  .deal-grid { grid-template-columns: 1fr; }
}
