/* new-screens.css — styles for the screens the overhaul ADDED (student home,
   coach action queue + focused review, plan builder, journey-bar additions),
   written in the original Goldmine visual language: white paper, navy ink
   (--ink/--brand), warm gold (--accent), Ovo display / Lora serif / Almarai
   sans, 8-10px radii, navy-tinted shadows.

   The seven original stylesheets are byte-identical to their pre-overhaul
   versions; everything below is additive and consumes their :root tokens. */

/* ---- Brand button (the header wordmark is clickable → home) ------------- */
#brandBtn {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  font: inherit;
  text-align: left;
}

/* ---- Button kit for the new screens ------------------------------------ */
/* Mirrors the original recipes: primary = .card-cta (navy, gold hover),
   secondary = bordered white, ghost = the old .drafting .ghost. Old sheets'
   more-specific selectors (.chat-tools button, .chat-input button[type=submit])
   still win where they apply, keeping original chrome untouched. */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  font-family: var(--sans);
  font-size: 0.88rem;
  font-weight: 500;
  padding: 0.55rem 1.05rem;
  border: 1px solid transparent;
  border-radius: 8px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.btn:disabled { opacity: 0.55; cursor: default; }
.btn:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--accent-soft); }

.btn-primary {
  background: var(--brand);
  color: #fff;
  border-color: var(--brand);
}
.btn-primary:hover:not(:disabled) { background: var(--accent); border-color: var(--accent); color: var(--brand); }

.btn-secondary {
  background: var(--bg);
  color: var(--ink);
  border-color: var(--line);
}
.btn-secondary:hover:not(:disabled) { border-color: var(--accent); }

.btn-ghost {
  background: transparent;
  color: var(--muted);
  border-color: transparent;
}
.btn-ghost:hover:not(:disabled) { color: var(--ink); background: var(--bg-soft); }

.btn-danger {
  background: var(--bg);
  color: #b3261e;
  border-color: var(--line);
}
.btn-danger:hover:not(:disabled) { border-color: #b3261e; }

.btn-sm { padding: 0.35rem 0.7rem; font-size: 0.82rem; border-radius: 7px; }

.btn svg { width: 14px; height: 14px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.btn svg[fill] { stroke: none; }

/* ---- Status badges ------------------------------------------------------ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-family: var(--sans);
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 0.18rem 0.6rem;
  border-radius: 999px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  color: var(--muted);
  white-space: nowrap;
}
.badge-success { background: rgba(47, 125, 79, 0.10); border-color: rgba(47, 125, 79, 0.35); color: #2f7d4f; }
.badge-warning { background: #fdf1e2; border-color: #ecd9b0; color: #9a6a1f; }
.badge-danger  { background: rgba(179, 38, 30, 0.08); border-color: rgba(179, 38, 30, 0.3); color: #b3261e; }
.badge-info    { background: rgba(110, 140, 185, 0.12); border-color: rgba(110, 140, 185, 0.4); color: #46618f; }
.badge-accent  { background: var(--accent-soft); border-color: var(--accent); color: var(--ink); }

/* ---- Journey-bar additions (statuses the old sheet predates) ------------ */
/* ready: reachable but not yet started (an approved plan awaiting drafting). */
.pp-node.status-ready .pp-dot {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--ink);
}

/* ---- Shared small bits -------------------------------------------------- */
.eyebrow {
  display: inline-block;
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
}
.field-label {
  display: block;
  font-family: var(--sans);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 0.25rem;
}
.chat-input-col { flex: 1; min-width: 0; }
.spinner {
  width: 18px;
  height: 18px;
  border: 2px solid var(--line);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: ns-spin 0.8s linear infinite;
  flex: 0 0 auto;
}
@keyframes ns-spin { to { transform: rotate(360deg); } }

/* ---- Student home ------------------------------------------------------- */
.home { max-width: 760px; margin: 1.5rem auto 0; padding: 0 1.25rem; }
.home-wrap { display: flex; flex-direction: column; gap: 1.25rem; }

.home-hero {
  background: var(--bg);
  border: 1px solid var(--line);
  border-top: 3px solid var(--accent);
  border-radius: 10px;
  padding: calc(1.85rem - 2px) 1.85rem 1.6rem;
}
.home-title {
  font-family: var(--display);
  font-size: 1.65rem;
  font-weight: 400;
  letter-spacing: -0.005em;
  line-height: 1.2;
  color: var(--ink);
  margin: 0.55rem 0 0.65rem;
}
.home-body {
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--body);
  max-width: 60ch;
  margin: 0;
}
.home-cta-row { margin-top: 1.4rem; display: flex; gap: 0.6rem; }

.home-note {
  margin-top: 1.25rem;
  padding: 0.9rem 1.1rem;
  background: var(--accent-soft);
  border-left: 3px solid var(--accent);
  border-radius: 4px 8px 8px 4px;
}
.home-note-label {
  display: block;
  font-family: var(--sans);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink);
  margin-bottom: 0.3rem;
}
.home-note p {
  font-family: var(--serif);
  font-size: 0.97rem;
  line-height: 1.6;
  color: var(--ink);
  margin: 0;
}

.home-comments {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.home-comments h2 { font-family: var(--serif); font-size: 1rem; margin: 0 0 0.15rem; color: var(--ink); }
.home-comments p { font-size: 0.85rem; color: var(--muted); margin: 0; }

.home-plan-head { margin-bottom: 0.4rem; }
.home-plan-head h2 {
  font-family: var(--display);
  font-size: 1.5rem;
  font-weight: 400;
  letter-spacing: -0.005em;
  color: var(--ink);
  margin: 0 0 0.25rem;
}
.home-plan-head .hint { font-size: 0.85rem; color: var(--muted); margin: 0; }

.home-plan-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1rem;
}
.home-unit {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 1.4rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.home-unit:hover { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.home-unit-head { display: flex; align-items: center; justify-content: space-between; }
.home-unit-num {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid var(--line);
  background: var(--bg);
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}
.home-unit-title {
  font-family: var(--display);
  font-size: 1.2rem;
  font-weight: 400;
  letter-spacing: -0.005em;
  color: var(--ink);
  margin: 0;
}
.home-unit-angle {
  font-family: var(--serif);
  font-size: 0.9rem;
  line-height: 1.55;
  color: var(--body);
  margin: 0;
}
.home-unit-cta { margin-top: auto; padding-top: 0.4rem; }

.home-steps { margin-top: 0.75rem; }
.home-steps-title {
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 1rem;
}
.home-steps-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1.25rem;
}
.home-steps-list li { display: flex; gap: 0.7rem; align-items: flex-start; }
.home-step-num {
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid var(--line);
  color: var(--muted);
  background: var(--bg);
  font-size: 0.72rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 1px;
}
.home-steps-list li.current .home-step-num { background: var(--accent); border-color: var(--accent); color: #fff; }
.home-steps-list li.done .home-step-num { background: #2f7d4f; border-color: #2f7d4f; color: #fff; }
.home-steps-list strong { display: block; font-size: 0.85rem; font-weight: 600; color: var(--ink); margin-bottom: 0.1rem; }
.home-steps-list p { font-size: 0.78rem; color: var(--muted); line-height: 1.45; margin: 0; }

/* ---- Coach dashboard shell ---------------------------------------------- */
.coach-shell { max-width: 1100px; margin: 2rem auto; padding: 0 1.5rem; }
.coach-shell .coach-demo-back { display: inline-block; margin-bottom: 1rem; }

.coach-empty { color: var(--muted); font-style: italic; font-size: 0.92rem; padding: 0.5rem 0; }

.coach-page-head { margin-bottom: 1.75rem; }
.coach-page-head h1 {
  font-family: var(--display);
  font-size: 1.65rem;
  font-weight: 400;
  letter-spacing: -0.005em;
  color: var(--ink);
  margin: 0 0 0.25rem;
}
.coach-page-sub { color: var(--muted); font-size: 0.92rem; margin: 0; }

.coach-section-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--sans);
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  margin: 0 0 0.8rem;
}
.coach-count {
  background: var(--accent);
  color: var(--ink);
  border-radius: 999px;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  font-size: 0.72rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Action queue. */
.coach-queue { margin-bottom: 2.25rem; }
.cq-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}
.cq-card {
  font-family: inherit;
  text-align: left;
  background: var(--bg);
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: 10px;
  padding: 1rem 1.2rem;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.cq-card:hover { box-shadow: 0 4px 14px rgba(2, 37, 89, 0.12); }
.cq-card:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--accent-soft); }
.cq-card-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 0.4rem; }
.cq-student {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1rem;
  color: var(--ink);
  text-transform: capitalize;
}
.cq-cta { font-size: 0.82rem; font-weight: 600; color: var(--accent); }
.cq-card:hover .cq-cta { color: var(--ink); }
.cq-title { font-size: 0.9rem; font-weight: 600; color: var(--ink); margin-bottom: 0.2rem; }
.cq-detail { font-size: 0.82rem; color: var(--muted); line-height: 1.45; }

/* Roster table. */
.coach-roster-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
}
.coach-roster-table thead th {
  text-align: left;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  padding: 0.6rem 1rem;
  border-bottom: 1px solid var(--line);
  background: var(--bg-soft);
}
.coach-roster-table td {
  padding: 0.65rem 1rem;
  border-bottom: 1px solid var(--line-2);
  font-size: 0.88rem;
  vertical-align: middle;
}
.coach-roster-table tr:last-child td { border-bottom: none; }
.coach-roster-table tr.openable { cursor: pointer; }
.coach-roster-table tr.openable:hover td { background: var(--bg-soft); }
.coach-roster-table tr.inert td { color: var(--muted); }
.cr-name { font-family: var(--serif); font-weight: 600; color: var(--ink); text-transform: capitalize; }
.cr-email { display: block; font-family: var(--sans); font-weight: 400; color: var(--muted); font-size: 0.75rem; text-transform: none; }
.cr-meta { color: var(--muted); }
.cr-open { text-align: right; color: var(--accent); font-weight: 600; white-space: nowrap; }
.coach-roster-table tr.openable:hover .cr-open { color: var(--ink); }

/* ---- Focused review screen ---------------------------------------------- */
.coach-review-screen { padding-bottom: 96px; /* room for the decision bar */ }
.crs-head {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}
.crs-student { display: flex; align-items: center; gap: 0.7rem; min-width: 0; }
.crs-student h1 {
  font-family: var(--display);
  font-size: 1.4rem;
  font-weight: 400;
  letter-spacing: -0.005em;
  color: var(--ink);
  margin: 0;
  text-transform: capitalize;
}
.crs-email { color: var(--muted); font-size: 0.85rem; }
.crs-pipeline { margin-left: auto; }

.crs-strip {
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.85rem 1rem;
  font-size: 0.88rem;
  color: var(--body);
  line-height: 1.5;
  margin-bottom: 1.2rem;
}
.crs-strip.warn { background: #fdf1e2; border-color: #ecd9b0; }

/* Decision bar, pinned to the bottom of the viewport. */
.crs-decision {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 60;
  background: var(--bg);
  border-top: 1px solid var(--line);
  box-shadow: 0 -4px 14px rgba(2, 37, 89, 0.07);
  padding: 0.75rem 1.5rem;
}
.crs-decision-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.7rem;
}
.crs-decision-note { font-size: 0.85rem; color: var(--muted); margin-right: auto; }
.crs-directive-compose { justify-content: stretch; }
.crs-directive-field { flex: 1; }
.crs-private { font-weight: 400; color: var(--muted); font-size: 0.72rem; }

/* Pre-brainstorm gate composer (decision bar + not-signed-in screen). */
.gate-compose { flex: 1; max-width: 720px; }
.gate-compose .coach-review-error { margin-top: 0.5rem; }
.gate-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: 0.6rem;
}

/* ---- Overlays: send-back panel + plan builder --------------------------- */
.coach-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(2, 37, 89, 0.28);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 6vh 1.5rem;
  overflow-y: auto;
}
.coach-panel {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 8px 28px rgba(2, 37, 89, 0.16);
  padding: 1.6rem 1.75rem;
  width: 100%;
  max-width: 520px;
}
.coach-panel-wide { max-width: 780px; }
.coach-panel-title {
  font-family: var(--display);
  font-size: 1.4rem;
  font-weight: 400;
  letter-spacing: -0.005em;
  color: var(--ink);
  margin: 0 0 0.3rem;
}
.coach-panel-sub { font-size: 0.85rem; color: var(--muted); line-height: 1.5; margin: 0 0 1.2rem; }
.coach-panel-sub strong { color: var(--body); }
.coach-panel-actions { display: flex; justify-content: flex-end; gap: 0.5rem; margin-top: 1.2rem; }
.coach-panel-error { color: #b3261e; font-size: 0.82rem; margin: 0.6rem 0 0; }
.coach-panel-error.hidden { display: none; }
.coach-panel-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.7rem;
  color: var(--muted);
  font-size: 0.92rem;
  padding: 2rem 0;
}
.coach-panel textarea, .coach-panel input[type="text"] {
  display: block;
  width: 100%;
  font-family: inherit;
  font-size: 0.88rem;
  color: var(--body);
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 0.5rem 0.6rem;
  resize: vertical;
  box-sizing: border-box;
  background: var(--bg);
}
.coach-panel textarea:focus, .coach-panel input[type="text"]:focus,
.crs-decision textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.crs-decision textarea {
  display: block;
  width: 100%;
  font-family: inherit;
  font-size: 0.85rem;
  color: var(--body);
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 0.45rem 0.55rem;
  resize: vertical;
  box-sizing: border-box;
}

/* Plan builder. */
.pb-units { display: flex; flex-direction: column; gap: 1rem; margin-bottom: 0.8rem; }
.pb-unit {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 1.2rem 1.3rem;
}
.pb-unit .field-label { margin-top: 0.9rem; }
.pb-unit-head { display: flex; align-items: center; gap: 0.7rem; margin-bottom: 0.4rem; }
.pb-unit-num {
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--ink);
  font-size: 0.72rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.pb-title { flex: 1; font-family: var(--serif) !important; font-weight: 600; }
.pb-description { font-family: var(--serif) !important; }
.pb-unit .pb-guidance { background: var(--bg-soft); }

/* Plan tab (read view) + drafts tab. */
.plan-unit h3 {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  font-family: var(--serif);
  font-size: 1.05rem;
  font-weight: 600;
  text-transform: none;
  letter-spacing: 0;
  color: var(--ink);
  margin: 0 0 0.4rem;
}
.plan-unit p { font-family: var(--serif); font-size: 0.92rem; color: var(--body); margin: 0 0 0.5rem; }
.plan-anchor-why { font-style: normal; color: var(--muted); }
.plan-private {
  font-family: var(--sans);
  font-size: 0.82rem;
  color: var(--muted);
  background: var(--bg-soft);
  border-radius: 8px;
  padding: 0.5rem 0.7rem;
  margin-top: 0.4rem;
}
.plan-private strong { color: var(--body); }

.coach-draft-text p {
  font-family: var(--serif);
  font-size: 1rem;
  line-height: 1.7;
  color: var(--body);
  margin: 0 0 0.8rem;
}

/* Report additions the old sheet predates. */
.report-warn {
  background: #fdf1e2;
  border: 1px solid #ecd9b0;
  color: #9a6a1f;
  font-size: 0.82rem;
  border-radius: 8px;
  padding: 0.5rem 0.7rem;
  margin: 0 0 0.7rem;
}

/* ---- Drafting picker addition (unit cards carry a status badge) --------- */
.draft-thread-top { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; }

/* "Add your own idea" card on the drafting hub. */
.draft-addidea {
  margin: 1.5rem 0 0;
  padding: 1.85rem;
  border: 1px dashed var(--line);
  border-radius: 10px;
  background: var(--bg);
}
.draft-addidea .card-eyebrow { margin-bottom: 0.5rem; }
#draftAddIdeaForm { max-width: 560px; margin-bottom: 0.4rem; }
#draftAddIdeaForm input[type="text"], #draftAddIdeaForm textarea {
  display: block;
  width: 100%;
  font-family: inherit;
  font-size: 0.92rem;
  color: var(--body);
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 0.55rem 0.7rem;
  resize: vertical;
  box-sizing: border-box;
  background: var(--bg);
}
#draftAddIdeaForm input[type="text"]:focus, #draftAddIdeaForm textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
#draftIdeaDesc { font-family: var(--serif); }

.home-plan-add { margin-top: 1rem; }

/* ---- Responsive --------------------------------------------------------- */
@media (max-width: 900px) {
  .crs-pipeline { margin-left: 0; width: 100%; overflow-x: auto; }
}
@media (max-width: 760px) {
  .home-plan-grid { grid-template-columns: 1fr; }
  .coach-shell { padding: 0 1.2rem; }
}
