:root{
  --bg:#f6f7fb;
  --card:#ffffff;

  --text:#1f2328;
  --muted:#5b636e;

  --border:#d0d7de;

  /* Core brand colors */
  --primary:#1f3b6d;          /* deep navy */
  --primaryText:#ffffff;

  --secondary:#eef2f6;

  /* Accent / pill */
  --accent:#c9a227;           /* accessible gold */
  --accentDark:#7a5c00;

  /* Chat bubbles */
  --socratesBg:#f0f6ff;
  --socratesBorder:#cfe3ff;
  --studentBg:#f6f8fa;

  /* Focus */
  --focus:#ffbf47;

  --radius:14px;
  --shadow:0 1px 10px rgba(0,0,0,.08);
}

*{ box-sizing:border-box; }

body{
  margin:0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background:var(--bg);
  color:var(--text);
}

.wrap{
  max-width:960px;
  margin:24px auto;
  padding:0 16px;
}

.card{
  background:var(--card);
  border:1px solid var(--border);
  border-radius:var(--radius);
  padding:18px;
  margin-top:16px;
  box-shadow:0 1px 8px rgba(0,0,0,.04);
}

.hidden{ display:none; }

.grid{
  display:grid;
  grid-template-columns:repeat(3,1fr);
  gap:12px;
}
@media (max-width:800px){
  .grid{ grid-template-columns:1fr; }
}

label{
  display:flex;
  flex-direction:column;
  gap:6px;
  font-size:14px;
}

/* KEY FIX #1: inputs and textareas should fill their container */
input, textarea{
  width:100%;
  border:1px solid var(--border);
  border-radius:10px;
  padding:10px 12px;
  font-size:14px;
  background:#fff;
  color:var(--text);
}

textarea{ resize:vertical; }

.block{ margin-top:14px; }

.row{
  display:flex;
  gap:12px;
  align-items:center;
  margin-top:14px;
  flex-wrap:wrap;
}

.inline{
  flex-direction:row;
  align-items:center;
  gap:10px;
}
.inline input{ width:90px; }

button{
  border:1px solid var(--border);
  border-radius:12px;
  padding:10px 14px;
  font-size:14px;
  cursor:pointer;
  background:#fff;
  color:var(--text);
}

button.primary{
  background:var(--primary);
  color:var(--primaryText);
  border-color:transparent;
}

button.secondary{ background:var(--secondary); }

button:disabled{
  opacity:.5;
  cursor:not-allowed;
}

/* Turn pill */
.pill{
  font-size:12px;
  padding:6px 10px;
  background:var(--secondary);
  border:1px solid var(--border);
  border-radius:999px;
}

.note{
  color:var(--muted);
  font-size:13px;
  margin-top:12px;
}

.error{
  color:#b42318;
  font-size:13px;
  margin-top:10px;
}

/* ACCESSIBILITY: visible focus */
input:focus-visible,
textarea:focus-visible,
button:focus-visible{
  outline:3px solid var(--focus);
  outline-offset:2px;
}

/* Chat layout */
.chatHeader{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:12px;
}

.chatLog{
  border:1px solid var(--border);
  border-radius:12px;
  padding:12px;
  margin-top:12px;
  min-height:240px;
  background:#fff;
  overflow:auto;
}

.msg{
  padding:10px 12px;
  border-radius:12px;
  margin:10px 0;
  max-width:85%;
}

.msg.socrates{
  background:var(--socratesBg);
  border:1px solid var(--socratesBorder);
}

.msg.student{
  background:var(--studentBg);
  border:1px solid var(--border);
  margin-left:auto;
}

.msg .who{
  font-size:12px;
  color:var(--muted);
  margin-bottom:6px;
}

.composer{ margin-top:12px; }

/* KEY FIX #2: textarea should expand; button stays fixed; no wasted right-side space */
.composerRow{
  display:flex;
  gap:10px;
  margin-top:10px;
  flex-wrap:nowrap;         /* prevents weird wrapping + blank space */
  align-items:stretch;
}

.composerRow textarea{
  flex:1 1 auto;            /* this is the main fix */
  min-width:260px;
}

.composerRow button{
  flex:0 0 auto;
  white-space:nowrap;
}

/* Reflection question styling */
.q{
  font-weight:600;
  margin:14px 0 8px;
}

/* KEY FIX #3: reflection answer boxes fill the full card width */
#ra1, #ra2{
  width:100%;
}

#exportBox{ width:100%; }
