/* Light and bright: white page, dark gray text, photos shown large. */
:root {
  --bg: #ffffff;
  --text: #3d3d3d;
  --text-soft: #6b6560;
  --line: #e6e1da;
  --tint: #f7f4f0;
  --accent: #8f6131;
  --accent-dark: #74501f;
  --focus: #dcc7aa;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  font-size: 18px;
  line-height: 1.65;
}

.coach {
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  max-width: 760px;
  margin: 0 auto;
}

/* Header */
.coach-header {
  padding: 24px 20px 18px;
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}
.eyebrow {
  font-size: 14px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-soft);
}
.coach-header h1 {
  font-family: Georgia, 'Times New Roman', serif;
  font-weight: normal;
  font-size: 32px;
  line-height: 1.2;
  margin-top: 2px;
}
.subtitle {
  color: var(--text-soft);
  margin-top: 6px;
  font-size: 17px;
}

/* Conversation */
.chat {
  flex: 1;
  overflow-y: auto;
  padding: 24px 20px;
  display: flex;
  flex-direction: column;
  gap: 22px;
}
.msg { max-width: 100%; }
.msg p + p { margin-top: 0.8em; }
.msg.coach-msg { padding-right: 8%; }
.msg.student {
  align-self: flex-end;
  max-width: 85%;
  background: var(--tint);
  border-radius: 14px;
  padding: 12px 16px;
}
.msg.student img {
  display: block;
  width: 100%;
  max-width: 520px;
  height: auto;
  border-radius: 8px;
}
.msg.student img + p { margin-top: 10px; }
.thinking { color: var(--text-soft); font-style: italic; }
.problem { color: #8a3b2e; }

/* Writing area */
.composer {
  border-top: 1px solid var(--line);
  padding: 14px 20px 18px;
  flex-shrink: 0;
  background: var(--bg);
}
.composer textarea {
  width: 100%;
  font: inherit;
  color: var(--text);
  border: 1.5px solid var(--line);
  border-radius: 10px;
  padding: 12px 14px;
  resize: none;
  max-height: 200px;
}
.composer textarea:focus { outline: none; border-color: var(--accent); }
.actions {
  display: flex;
  gap: 12px;
  justify-content: space-between;
  margin-top: 12px;
}
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font: inherit;
  font-weight: 600;
  min-height: 52px;
  padding: 0 22px;
  border-radius: 10px;
  cursor: pointer;
  border: 1.5px solid transparent;
}
.btn-primary { background: var(--accent); color: #fff; min-width: 120px; justify-content: center; }
.btn-primary:hover { background: var(--accent-dark); }
.btn-primary:disabled { opacity: 0.5; cursor: default; }
.btn-secondary { background: var(--bg); color: var(--accent); border-color: var(--accent); }
.btn-secondary:hover { background: var(--tint); }
.btn:focus-visible, .link-btn:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }

.photo-ready {
  display: flex;
  gap: 14px;
  align-items: center;
  margin-bottom: 12px;
}
.photo-ready[hidden] { display: none; }
.photo-ready img { width: 96px; height: 96px; object-fit: cover; border-radius: 8px; }
.photo-ready p { font-size: 16px; }
.link-btn {
  font: inherit;
  font-size: 16px;
  background: none;
  border: none;
  color: var(--accent);
  text-decoration: underline;
  cursor: pointer;
  padding: 4px 0;
}

/* Header buttons */
.top-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  margin-top: 14px;
}
.top-actions[hidden] { display: none; }
.btn-small {
  min-height: 44px;
  padding: 0 16px;
  font-size: 16px;
  background: var(--bg);
  color: var(--accent);
  border-color: var(--accent);
}
.btn-small:hover { background: var(--tint); }

/* Sign-in and My Conversations */
.coach-view { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.coach-view[hidden], .panel[hidden] { display: none; }
.panel {
  flex: 1;
  overflow-y: auto;
  padding: 28px 20px;
}
.panel h2 {
  font-family: Georgia, 'Times New Roman', serif;
  font-weight: normal;
  font-size: 26px;
  margin-bottom: 10px;
}
.soft { color: var(--text-soft); }
.sign-in-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 20px;
  max-width: 460px;
}
.sign-in-form label { font-weight: 600; }
.sign-in-form input {
  font: inherit;
  color: var(--text);
  border: 1.5px solid var(--line);
  border-radius: 10px;
  padding: 12px 14px;
}
.sign-in-form input:focus { outline: none; border-color: var(--accent); }
.sign-in-form .btn { align-self: flex-start; margin-top: 6px; }
.sign-in-form[hidden] { display: none; }
.code-input { max-width: 220px; font-size: 26px !important; letter-spacing: 0.25em; }
.small { font-size: 16px; margin-top: 8px; }
.notice {
  margin-top: 20px;
  max-width: 560px;
  background: var(--tint);
  border-radius: 10px;
  padding: 14px 16px;
}

.convo-list {
  list-style: none;
  margin: 18px 0 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.convo-item {
  width: 100%;
  text-align: left;
  font: inherit;
  color: var(--text);
  background: var(--bg);
  border: 1.5px solid var(--line);
  border-radius: 10px;
  padding: 14px 16px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.convo-item:hover { border-color: var(--accent); background: var(--tint); }
.convo-title { font-weight: 600; }
.convo-date { color: var(--text-soft); font-size: 16px; }

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

@media (max-width: 480px) {
  html, body { font-size: 17px; }
  .coach-header h1 { font-size: 27px; }
  .btn { padding: 0 16px; }
}
