:root{
  --bg-color: #fcf9f2;
  --text-color: #2b2621;
  --accent-color: #a43029;
  --accent-hover: #7b201a;
  --border-color: #d1c8b8;
  --panel-bg: #fffdf9;
  --grid-line: rgba(43, 38, 33, 0.1);
}

* { box-sizing: border-box; }

body {
  font-family: system-ui, -apple-system, sans-serif;
  background-color: var(--bg-color);
  color: var(--text-color);
  line-height: 1.6;
  margin: 0;
  padding: 0;
}

.container {
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 1rem;
}

h1, h2, h3, h4 {
  font-weight: 700;
  line-height: 1.2;
}

.site-header {
  background-color: var(--text-color);
  color: #fff;
  padding: 1.5rem 0;
  border-bottom: 4px solid var(--accent-color);
}

.site-header h1 {
  margin: 0;
  font-size: 1.8rem;
}

.site-header .subtitle {
  margin: 0.25rem 0 0.5rem;
  font-size: 0.95rem;
  opacity: 0.8;
}

.site-header nav a {
  color: #fff;
  text-decoration: none;
  margin-right: 1.5rem;
  font-size: 0.9rem;
  font-weight: 600;
}

.site-header nav a:hover { text-decoration: underline; }

.app-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  margin: 2rem 0;
  align-items: start;
}

@media (max-width: 768px) {
  .app-layout { grid-template-columns: 1fr; }
}

.quiz-panel, .result-panel {
  background: var(--panel-bg);
  border: 1px solid var(--border-color);
  padding: 2rem;
  border-radius: 8px;
  box-shadow: 0 4px 6px rgba(0,0,0,0.02);
}

.slider-group {
  margin-bottom: 1.5rem;
}

.slider-group label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.slider-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  color: #555;
  margin-bottom: 0.25rem;
}

input[type='range'] {
  width: 100%;
  cursor: pointer;
  accent-color: var(--accent-color);
}

.action-buttons {
  display: flex;
  gap: 1rem;
  margin-top: 2rem;
}

button {
  padding: 0.75rem 1rem;
  border: none;
  border-radius: 4px;
  font-weight: 600;
  cursor: pointer;
  transition: 0.2s;
  font-size: 1rem;
}

.btn-primary {
  background: var(--accent-color);
  color: white;
}

.btn-primary:hover { background: var(--accent-hover); }

.btn-secondary {
  background: #e2dcd0;
  color: var(--text-color);
}

.btn-secondary:hover { background: #d1c8b8; }

.matrix-container {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  background: white;
  border: 2px solid var(--text-color);
  margin-bottom: 2rem;
}

.matrix-overlay {
  position: absolute;
  top: 10%; left: 10%; right: 10%; bottom: 10%;
}

.x-axis, .y-axis {
  position: absolute;
  background: var(--grid-line);
}

.x-axis {
  top: 50%; left: 0; right: 0;
  height: 2px;
  transform: translateY(-50%);
}

.y-axis {
  left: 50%; top: 0; bottom: 0;
  width: 2px;
  transform: translateX(-50%);
}

.label-top { position: absolute; top: -25px; left: 50%; transform: translateX(-50%); font-size: 0.8rem; font-weight:bold; }
.label-bottom { position: absolute; bottom: -25px; left: 50%; transform: translateX(-50%); font-size: 0.8rem; font-weight:bold; }
.label-left { position: absolute; left: -45px; top: 50%; transform: translateY(-50%); font-size: 0.8rem; font-weight:bold; }
.label-right { position: absolute; right: -40px; top: 50%; transform: translateY(-50%); font-size: 0.8rem; font-weight:bold; }

.dot {
  position: absolute;
  width: 16px;
  height: 16px;
  background: var(--accent-color);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: all 0.3s ease;
  border: 2px solid white;
  box-shadow: 0 0 5px rgba(0,0,0,0.5);
}

.hidden { display: none !important; }

.guide-section, .safety-section {
  margin: 3rem 0;
  padding-top: 2rem;
  border-top: 1px solid var(--border-color);
}

.archetype-list li {
  margin-bottom: 0.75rem;
}

.safety-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

@media (max-width: 600px) {
  .safety-grid { grid-template-columns: 1fr; }
}

.safety-card {
  background: var(--panel-bg);
  padding: 1.5rem;
  border-left: 4px solid var(--text-color);
}

.safety-card h4 { margin-top: 0; margin-bottom: 0.5rem; }
.assumption-note { font-size: 0.9rem; margin-top: 1.5rem; opacity: 0.8; }

.site-footer {
  background: var(--text-color);
  color: #fff;
  text-align: center;
  padding: 2rem 0;
  font-size: 0.9rem;
  margin-top: 4rem;
}

.site-footer a {
  color: #fff;
  margin: 0 0.5rem;
}



/* Factory-injected deployment helpers. The AI owns the site design above this block. */
.ad-unit {
  width: min(100%, 720px);
  min-height: 120px;
  margin: 24px auto;
  display: block;
}

.legal-page {
  width: min(900px, calc(100% - 32px));
  margin: 40px auto;
}

.factory-fallback-nav {
  width: min(900px, calc(100% - 32px));
  margin: 24px auto 0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  align-items: center;
  font-size: 0.95rem;
}

.factory-fallback-nav a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid currentColor;
}
