@import url('https://fonts.googleapis.com/css2?family=Lora:wght@500&family=DM+Sans&display=swap');

:root {
  --bg: #f5f7fb;
  --surface: #ffffff;
  --surface-strong: #edf2f8;
  --text: #1f2937;
  --text-muted: #556376;
  --accent: #3b82f6;
  --accent-strong: #2563eb;
  --supportive: #22c55e;
  --neutral: #64748b;
  --pressuring: #ef4444;
  --border: rgba(15, 23, 42, 0.08);
  --shadow: 0 22px 80px rgba(15, 23, 42, 0.08);
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, system-ui, sans-serif;
}

body {
  line-height: 1.5;
}

a {
  color: inherit;
  text-decoration: none;
}

button, input, select, textarea {
  font: inherit;
}

button {
  border: none;
  background: none;
  cursor: pointer;
}

.page-shell {
  max-width: 1040px;
  margin: 0 auto;
  padding: 32px 24px 48px;
}

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;
  margin-bottom: 28px;
}

.page-title {
  font-size: clamp(2rem, 3vw, 3rem);
  line-height: 1.05;
  margin: 0;
}

.page-subtitle {
  margin-top: 10px;
  color: var(--text-muted);
  max-width: 720px;
}

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

.top-actions a,
.button,
.button-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 18px;
  border-radius: 999px;
  text-transform: none;
  font-weight: 600;
  transition: background 0.15s ease, transform 0.15s ease;
}

.button,
.button-link {
  background: var(--accent);
  color: #ffffff;
}

.button:hover,
.button-link:hover {
  background: var(--accent-strong);
  transform: translateY(-1px);
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 18px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 24px;
  box-shadow: var(--shadow);
}

.card h3 {
  margin-top: 0;
  margin-bottom: 12px;
  font-size: 1.1rem;
}

.card p {
  margin: 0;
  color: var(--text);
  line-height: 1.6;
  font-size: 0.95rem;
}

.grid-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 180px;
}

#scenario-list .grid-card {
  position: relative;
  overflow: hidden;
  min-height: 220px;
  color: #ffffff;
  background-image:
    linear-gradient(135deg, rgba(20, 28, 38, 0.5), rgba(20, 28, 38, 0.28)),
    url("./assets/scenario-background.jpg");
  background-size: cover;
  background-position: center;
  border: 1px solid rgba(255, 255, 255, 0.22);
}

#scenario-list .grid-card > * {
  position: relative;
  z-index: 1;
}

#scenario-list .grid-card h3,
#scenario-list .grid-card p,
#scenario-list .grid-card .progress-label {
  color: #ffffff;
}

#scenario-list .grid-card .badge {
  color: rgba(255, 255, 255, 0.95);
  background: rgba(255, 255, 255, 0.2);
}

#scenario-list .grid-card:hover {
  transform: translateY(-2px);
  filter: saturate(1.05);
}

.card-small {
  padding: 20px;
}

.badge {
  display: inline-flex;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
  background: rgba(59, 130, 246, 0.08);
}

.section-title {
  margin: 0 0 18px;
  font-size: 1.15rem;
}

.state-bar {
  background: var(--surface-strong);
  border-radius: 18px;
  padding: 18px;
  display: grid;
  gap: 16px;
  margin-top: 24px;
}

.state-row {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 12px;
}

.state-name {
  color: var(--text-muted);
  font-size: 0.82rem;
}

.state-val {
  font-weight: 700;
}

.state-track {
  width: 100%;
  height: 10px;
  background: rgba(15, 23, 42, 0.08);
  border-radius: 999px;
  overflow: hidden;
}

.state-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 0.45s ease;
}

.fill-tension { background: var(--pressuring); }
.fill-openness { background: var(--accent); }
.fill-trust { background: var(--supportive); }

.hidden { display: none !important; }

.response-panel {
  margin-top: 24px;
  padding: 22px;
  border-radius: 24px;
  background: var(--surface);
  border: 1px solid var(--border);
}

.response-panel p {
  margin: 0;
  color: var(--text);
}

.response-placeholder {
  color: var(--text-muted);
}

.scenario-context {
  margin-top: 8px;
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.6;
}

#scenario-intro {
  margin-top: 10px;
  color: var(--text);
  font-size: 0.98rem;
  line-height: 1.6;
}

.previous-response-panel {
  opacity: 0.62;
}

.previous-response-panel .response-label {
  margin: 0 0 10px;
  font-size: 0.88rem;
  letter-spacing: 0.02em;
  color: var(--text-muted);
}

.response-text.previous {
  color: var(--text-muted);
}

.choices-list {
  display: grid;
  gap: 12px;
  margin-top: 20px;
}

.choice-button {
  padding: 16px 18px;
  border-radius: 18px;
  border: 1px solid transparent;
  background: #f8fafc;
  color: var(--text);
  text-align: left;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.choice-button:hover {
  background: #eef2ff;
}

.choice-button.selected {
  border-color: var(--accent);
  background: rgba(59, 130, 246, 0.08);
}

.choice-style {
  display: inline-flex;
  margin-top: 10px;
  gap: 8px;
  flex-wrap: wrap;
  color: var(--text-muted);
  font-size: 0.92rem;
}

.choice-style span {
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.choice-style .supportive { background: rgba(34, 197, 94, 0.12); color: #166534; }
.choice-style .neutral { background: rgba(100, 116, 139, 0.12); color: #334155; }
.choice-style .pressuring { background: rgba(239, 68, 68, 0.12); color: #b91c1c; }

.toast {
  margin-top: 18px;
  padding: 14px 18px;
  border-radius: 18px;
  border: 1px solid rgba(59, 130, 246, 0.18);
  background: rgba(59, 130, 246, 0.06);
  color: #0f172a;
}

.stage-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-top: 24px;
  flex-wrap: wrap;
}

.progress-label {
  color: var(--text-muted);
  font-size: 0.95rem;
}

.text-input {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 14px 16px;
  background: var(--surface);
  resize: vertical;
}

.chat-panel {
  display: grid;
  gap: 18px;
}

.chat-log {
  min-height: 320px;
  padding: 20px;
  border-radius: 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  display: grid;
  gap: 14px;
}

.chat-message {
  max-width: 78%;
  padding: 14px 16px;
  border-radius: 20px;
  line-height: 1.5;
}

.chat-message.user {
  justify-self: end;
  background: rgba(59, 130, 246, 0.12);
  color: var(--text);
}

.chat-message.ai {
  justify-self: start;
  background: rgba(15, 23, 42, 0.06);
  color: var(--text);
}

.form-row {
  display: grid;
  gap: 14px;
}

.form-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.oq-wrap {
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--bg);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 48px 16px;
}

.oq-card {
  width: 100%;
  max-width: 560px;
  background: var(--surface);
  border-radius: 24px;
  padding: 36px 32px;
  box-shadow: 0 2px 24px rgba(0, 0, 0, 0.06);
  border: 1px solid var(--border);
}

.oq-fade {
  animation: oqFade 0.35s ease both;
}

@keyframes oqFade {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.oq-label {
  font-size: 11px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 8px;
  font-weight: 500;
}

.oq-heading {
  font-family: 'Lora', serif;
  font-size: 24px;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 20px;
  line-height: 1.35;
}

.oq-sub {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 24px;
  line-height: 1.55;
}

.oq-opts {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 28px;
}

.oq-pill {
  cursor: pointer;
  border: 1.5px solid var(--border);
  background: var(--surface-strong);
  color: var(--text);
  border-radius: 999px;
  padding: 14px 20px;
  font-size: 14px;
  font-weight: 400;
  transition: all .18s ease;
  text-align: left;
  line-height: 1.45;
  width: 100%;
}

.oq-pill:hover {
  background: #f3f5f9;
  border-color: #d6dae3;
}

.oq-pill.sel {
  background: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
  font-weight: 500;
}

.oq-btn,
.oq-ghost {
  border-radius: 999px;
  padding: 13px 32px;
  font-family: 'DM Sans', sans-serif;
  font-size: 15px;
  cursor: pointer;
  transition: all .18s ease;
}

.oq-btn {
  background: var(--accent);
  color: #fff;
  border: none;
}

.oq-btn:hover {
  background: #2563eb;
}

.oq-btn:disabled {
  opacity: .45;
  cursor: default;
}

.oq-ghost {
  background: transparent;
  border: 1.5px solid var(--border);
  color: var(--text-muted);
}

.oq-ghost:hover {
  border-color: #b8b2ab;
  color: var(--text);
}

.oq-prog-track {
  height: 3px;
  background: var(--border);
  border-radius: 99px;
  overflow: hidden;
  margin-bottom: 0;
}

.oq-prog-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 99px;
  transition: width .4s ease;
}

.oq-bullet {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

.oq-bullet:last-child {
  border-bottom: none;
}

.oq-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
  margin-top: 6px;
}

.oq-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.recommendation-card {
  background: var(--surface);
  border-radius: 20px;
  border: 1px solid var(--border);
  padding: 24px;
  margin-bottom: 24px;
}

.recommendation-card h2 {
  margin-top: 0;
  font-size: 18px;
  margin-bottom: 10px;
}

.recommendation-card p {
  margin: 0;
  color: var(--text-muted);
}

.practice-note {
  margin-top: 12px;
  color: var(--text-muted);
  font-size: 0.98rem;
  max-width: 700px;
}

.radio-group {
  display: grid;
  gap: 10px;
}

.radio-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 18px;
  border-radius: 18px;
  background: #ffffff;
  border: 1px solid var(--border);
}

.radio-card input {
  accent-color: var(--accent);
}

.placeholder-box {
  border: 1px dashed var(--border);
  border-radius: 20px;
  background: var(--surface-strong);
  padding: 22px;
  color: var(--text-muted);
}

/* Feedback panel — shown after a choice is made in practice mode */
.feedback-panel {
  margin-top: 16px;
  padding: 18px 22px;
  border-radius: 18px;
  background: rgba(59, 130, 246, 0.06);
  border: 1px solid rgba(59, 130, 246, 0.18);
}

.feedback-label {
  margin: 0 0 6px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
}

.feedback-panel p:last-child {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.55;
}

/* First-run banner on home screen */
.new-user-banner {
  background: rgba(59, 130, 246, 0.07);
  border: 1px solid rgba(59, 130, 246, 0.2);
  border-radius: 16px;
  padding: 20px 24px;
  margin-bottom: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.new-user-banner p {
  margin: 0;
  font-weight: 500;
}

.inline-link {
  color: var(--accent);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* End screen action row */
.end-screen-actions {
  justify-content: center;
  margin-top: 24px;
}

/* Chat context message */
.chat-message.ai-context {
  justify-self: stretch;
  background: rgba(59, 130, 246, 0.06);
  color: var(--text-muted);
  font-size: 0.88rem;
  border-radius: 12px;
  padding: 12px 16px;
  font-style: italic;
  max-width: 100%;
}

/* End screen state bars — remove top margin when inside final-state card */
.final-state .state-bar {
  margin-top: 0;
}

@media (max-width: 720px) {
  .page-header { flex-direction: column; }
  .stage-footer { flex-direction: column; align-items: stretch; }
  .new-user-banner { flex-direction: column; align-items: flex-start; }
}

/* Profile section */
.profile-summary {
  background: var(--surface);
  border-radius: 16px;
  padding: 24px;
  margin-bottom: 32px;
  border: 1px solid var(--border);
}

.profile-summary h2 {
  margin: 0 0 8px 0;
  font-size: 18px;
  font-weight: 600;
}

.profile-summary p {
  margin: 0;
  color: var(--text-muted);
}

/* End screen feedback */
.end-screen-content {
  max-width: 600px;
  margin: 0 auto;
}

.end-screen-content h2 {
  text-align: center;
  margin-bottom: 32px;
  color: var(--text);
}

.feedback-section {
  background: var(--surface-strong);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 16px;
  border: 1px solid var(--border);
}

.feedback-section h3 {
  margin: 0 0 8px 0;
  font-size: 16px;
  font-weight: 600;
  color: var(--accent);
}

.feedback-section p {
  margin: 0;
  line-height: 1.6;
}

.final-state {
  background: var(--surface);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 24px;
  border: 1px solid var(--border);
}

.final-state h3 {
  margin: 0 0 16px 0;
  font-size: 16px;
  font-weight: 600;
}


/* Spiral of Connection diagram (shared with learn.html) */
.spiral-figure {
  margin: 0 0 22px;
  border-radius: 14px;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
}
.spiral-figure img {
  display: block;
  width: 100%;
  height: auto;
}
.spiral-caption {
  font-size: 13px;
  color: var(--text-muted);
  text-align: center;
  padding: 10px 14px 12px;
  font-style: italic;
  font-family: Lora, Georgia, serif;
}
