#wordCount.word-count--fail { color: #c62828; font-weight: 600; }
#wordCount.word-count--warn { color: #b45309; font-weight: 600; }
#wordCount.word-count--ok   { color: #15803d; font-weight: 600; }
.word-target { color: #6b7280; font-size: 0.9em; margin-left: 4px; }

.timer-warning-text {
  font-size: 0.82em;
  font-weight: 600;
  text-align: center;
  padding: 4px 0 6px 0;
}
.timer-warning-text--warning { color: #b45309; }
.timer-warning-text--urgent   { color: #c62828; }
.timer-warning-text--gentle   { color: var(--ink-muted); }

#essayTextarea.textarea--warning { border-color: #b45309; }
#essayTextarea.textarea--urgent  { border-color: #c62828; }
#essayTextarea { min-height: 500px; }

/* The Frame owns the rail and Task Surface geometry. Written Tasks own the
   stimulus and editor contents inside their top-to-bottom surfaces. */
.written-task-page .essay-topic,
.written-task-page .passage {
  line-height: 1.65;
}

.written-task-page .essay-topic p,
.written-task-page .passage p {
  margin: 0;
  font-size: var(--type-question);
}

/* A passage stored in several paragraphs: 12px between them (STYLE_GUIDE,
   Type and spacing). */
.written-task-page .passage p + p {
  margin-top: 12px;
}

.written-task-page .written-response {
  display: grid;
  gap: 12px;
}

.written-task-page .written-response textarea {
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
}

.summarize-written-text-page #textBox {
  min-height: 220px;
}

@media (max-width: 768px) {
  #essayTextarea { min-height: 400px; }
}

/* ── Typing Mode (ADR-0109) ───────────────────────────────────────────────
   The surface itself is css/essay-typing-surface.css, shared with the
   standalone Essay Typing page. What is Write Essay's own is the box: the
   painted model has to occupy exactly the textarea's, so the wrapper takes
   the height the textarea declares, and the textarea — now the invisible
   input above the prose — has to be let out of the two id-specificity rules
   above that would otherwise stretch it past the wrapper and give it a
   visible edge. */
/* The wrapper took the textarea out of `.written-response`'s grid, and an
   inline-block textarea carries a descender gap under it, so block it here. */
#essayTypingSurface > textarea { display: block; }
#essayTypingSurface.typing-area-wrapper { min-height: 500px; }
#essayTextarea.typing-input { min-height: 0; border-color: transparent; }

@media (max-width: 768px) {
  #essayTypingSurface.typing-area-wrapper { min-height: 400px; }
}

/* Restart, on the toggle's line: a text link rather than a second button, so
   the toolbar keeps one control's worth of weight while the mode is on. */
.typing-mode-restart {
  background: none;
  border: none;
  padding: 0 var(--chrome-gap-sm, 6px);
  font: inherit;
  font-size: 0.85rem;
  color: var(--chrome-ink-soft);
  text-decoration: underline;
  cursor: pointer;
}

.typing-mode-restart:hover,
.typing-mode-restart:focus-visible {
  color: var(--chrome-accent-deep);
}
