/* The document is the primary workspace; optional tools stay beside it. */
.workspace-shell .essay-coach-page .essay-workspace-grid {
  display:grid; grid-template-columns:minmax(0, 3fr) minmax(320px, 1fr); gap:20px; align-items:start;
}
.workspace-shell .essay-coach-page .essay-workspace-main { padding:0 0 28px; }
.workspace-shell .essay-coach-page .feedback-panel { padding-top:0; gap:12px; }
.workspace-shell .essay-coach-page .writing-workspace { margin-top:0; }
.workspace-shell .essay-coach-page .writing-boundary-summary { margin:0; font-size:0.8rem; color:#38586a; }
.workspace-shell .essay-coach-page .writing-side-tool {
  border:1.5px solid #82a9b5; border-radius:12px; background:#fff; padding:0; margin:0;
  color:#173f6b; min-width:0; overflow-wrap:anywhere;
}
.workspace-shell .essay-coach-page .writing-side-tool > summary {
  cursor:pointer; padding:12px 14px; font-size:0.9rem; font-weight:500;
}
.workspace-shell .essay-coach-page .writing-side-tool[open] > summary { border-bottom:1px solid #d5e3e7; margin-bottom:12px; }
.workspace-shell .essay-coach-page .writing-side-tool > :not(summary) { margin-left:12px; margin-right:12px; }
.workspace-shell .essay-coach-page .writing-side-tool .writing-mechanics { border:0; margin:0; padding:0 12px 12px; background:transparent; }
.workspace-shell .essay-coach-page .writing-side-tool p { font-size:0.85rem; line-height:1.5; }
.workspace-shell .essay-coach-page .writing-organizer { margin:0; padding:14px; }
.workspace-shell .essay-coach-page .wo-heading { flex-wrap:wrap; gap:8px; }
.workspace-shell .essay-coach-page .wo-heading h2 { font-size:1rem; }
.workspace-shell .essay-coach-page .wo-description,
.workspace-shell .essay-coach-page .wo-step,
.workspace-shell .essay-coach-page .wo-heading p { font-size:0.85rem; }
.workspace-shell .essay-coach-page .rich-writing-toolbar {
  padding:5px 8px; gap:4px; min-height:42px; border-color:#82a9b5;
}
.workspace-shell .essay-coach-page .rich-writing-toolbar button {
  width:30px; height:30px; min-width:30px; min-height:30px; padding:5px;
  font-size:14px; line-height:1; border:1px solid transparent; border-radius:4px; background:transparent;
}
.workspace-shell .essay-coach-page .rich-writing-toolbar button svg { width:18px; height:18px; }
.workspace-shell .essay-coach-page .rich-writing-toolbar button:hover,
.workspace-shell .essay-coach-page .rich-writing-toolbar button.ql-active { background:#dceeea; border-color:#82a9b5; }
.workspace-shell .essay-coach-page .rich-writing-editor .ql-editor { min-height:55vh; }
.workspace-shell .essay-coach-page .rich-writing-editor--part .ql-editor { min-height:10rem; }
.workspace-shell .essay-coach-page #assignmentReference .essay-prompt-sticky { display:none !important; }
@media (max-width: 960px) {
  .workspace-shell .essay-coach-page .essay-workspace-grid { grid-template-columns:minmax(0,1fr); gap:16px; }
  .workspace-shell .essay-coach-page .essay-coach-action-column { width:100%; }
}
@media (pointer:coarse) {
  .workspace-shell .essay-coach-page .rich-writing-toolbar button { width:40px; height:40px; min-width:40px; min-height:40px; }
}
.workspace-shell .essay-coach-page .feedback-panel-empty-wrap { min-height:0; padding:0; }
.workspace-shell .essay-coach-page .feedback-panel-empty-icon { display:none; }
.workspace-shell .essay-coach-page .feedback-panel-empty-card { padding:10px; }
.workspace-shell .essay-coach-page .feedback-panel-body { padding:12px; }
.workspace-shell .essay-document-bar { align-items:flex-start; }
.workspace-shell .essay-document-context { min-width:0; }
.workspace-shell .writing-prompt-disclosure { margin-top:12px; }
.workspace-shell .writing-prompt-disclosure > summary {
  display:list-item; width:fit-content; cursor:pointer; padding:10px 16px;
  background:#e6f2ef; color:#173f6b; border:1.5px solid #0f766e;
  border-radius:8px; font-size:1rem; font-weight:600;
}
.workspace-shell .writing-prompt-disclosure[open] { width:100%; }
.workspace-shell .writing-prompt-disclosure .essay-prompt-card { margin:12px 0 0; }
.workspace-shell .writing-prompt-disclosure .essay-assignment-instructions { max-height:none; }
/* Founder paper-and-actions refinement: September 12. */
.workspace-shell .essay-coach-page .essay-document-bar {
  border:2.5px solid #0f766e; border-radius:14px;
  box-shadow:0 3px 12px rgba(23,63,107,.06);
}
.workspace-shell .essay-coach-page .essay-document-leave {
  display:inline-flex; align-items:center; justify-content:center;
  padding:10px 18px; min-height:42px; border:1.5px solid #0f766e;
  border-radius:9px; background:#e6f2ef; color:#173f6b;
  font-size:.9rem; font-weight:600; text-decoration:none;
}
.workspace-shell .essay-coach-page .essay-document-leave:hover { background:#d5ebe5; }
.workspace-shell .essay-coach-page .writing-workspace { container-type:inline-size; }
.workspace-shell .essay-coach-page .writing-canvas {
  min-height:calc(100cqw * 22 / 17); display:flex; flex-direction:column;
}
.workspace-shell .essay-coach-page .writing-canvas > .rich-writing-editor {
  flex:1; display:flex; flex-direction:column;
}
.workspace-shell .essay-coach-page .writing-canvas > .rich-writing-editor[hidden] { display:none; }
.workspace-shell .essay-coach-page .writing-canvas .ql-editor,
.workspace-shell .essay-coach-page .writing-canvas #essayTextarea { flex:1; }
.workspace-shell .essay-coach-page .writing-turnin-actions { display:flex; flex-direction:column; gap:10px; padding:0; border:0; background:none; }
.workspace-shell .essay-coach-page #essaySubmitBtn {
  width:100%; min-height:52px; padding:12px 20px; border:0; border-radius:11px;
  background:#173f6b; color:#fff; font-size:1.05rem; font-weight:600; opacity:1;
}
.workspace-shell .essay-coach-page #essaySubmitBtn:hover { background:#102f52; }
.workspace-shell .essay-coach-page .writing-turnin-error {
  padding:10px 12px; border-left:4px solid #d3a123; border-radius:5px;
  background:#fff6d9; color:#173f6b; font-size:.85rem;
}
/* A consistent quiet hierarchy for the tools beside the paper. */
.workspace-shell .essay-coach-page .feedback-panel { gap:14px; }
.workspace-shell .essay-coach-page .feedback-panel > .coach-workflow-card,
.workspace-shell .essay-coach-page .feedback-panel > .writing-side-tool,
.workspace-shell .essay-coach-page .feedback-panel > .writing-organizer {
  border:1.5px solid #82a9b5; border-radius:13px; background:#fff;
  box-shadow:0 3px 10px rgba(23,63,107,.045);
}
.workspace-shell .essay-coach-page .feedback-panel > details.coach-workflow-card { padding:0; margin:0; }
.workspace-shell .essay-coach-page .feedback-panel > details.coach-workflow-card > summary,
.workspace-shell .essay-coach-page .writing-side-tool > summary {
  padding:14px 16px; color:#173f6b; font-size:.92rem !important;
  font-weight:600 !important; border-radius:11px; line-height:1.45;
}
.workspace-shell .essay-coach-page .feedback-panel > details.coach-workflow-card > div { padding:0 16px 14px; }
.workspace-shell .essay-coach-page .feedback-panel > details[open] > summary {
  background:#edf6f3; border-radius:11px 11px 0 0;
  border-bottom:1px solid #d6e6e1; box-shadow:inset 4px 0 #d3a123;
}
.workspace-shell .essay-coach-page .feedback-panel > details > summary:hover { background:#f0f7f5; }
.workspace-shell .essay-coach-page .writing-boundary-summary { font-size:.78rem; line-height:1.5; padding:0 2px; }
.workspace-shell .essay-coach-page .writing-organizer { border-top:3px solid #0f766e !important; background:#f5faf8 !important; padding:16px; }
.workspace-shell .essay-coach-page .wo-heading h2 { color:#173f6b; font-weight:500; }
.workspace-shell .essay-coach-page .wo-heading > div { min-width:0; }
.workspace-shell .essay-coach-page #organizerToggle { border-radius:8px; font-size:.82rem; padding:8px 12px; background:#fff; }
.workspace-shell .essay-coach-page .wo-status-row { margin-top:10px; font-size:.75rem; }
.workspace-shell .essay-coach-page .coach-card-outer { border-radius:13px; overflow:hidden; }
.workspace-shell .essay-coach-page .coach-card-header { padding:16px; }
.workspace-shell .essay-coach-page .coach-card-title { font-size:1.1rem; }
.workspace-shell .essay-coach-page .coach-card-action { margin-top:10px; }
.workspace-shell .essay-coach-page .coach-card-action .small { margin-top:8px; font-size:.8rem; line-height:1.5; }
.workspace-shell .essay-coach-page .coach-refresh-btn { width:100%; border-radius:8px; }
.workspace-shell .essay-coach-page .writing-side-tool .btn,
.workspace-shell .essay-coach-page .writing-side-tool .essay-tool-btn { border-radius:8px; font-size:.85rem; }

/* Match the document-header actions and give saved status room to breathe. */
.workspace-shell .essay-coach-page .essay-document-leave,
.workspace-shell .essay-coach-page .writing-prompt-disclosure > summary {
  box-sizing:border-box; min-height:46px; padding:10px 16px;
  border:1.5px solid #0f766e; border-radius:8px; background:#e6f2ef;
  color:#173f6b; font-size:1rem; font-weight:600; line-height:1.45;
}
.workspace-shell .essay-coach-page .essay-document-controls { gap:18px; }
.workspace-shell .essay-coach-page .essay-document-status { gap:10px; padding-top:4px; font-size:.9rem; line-height:1.6; }
.workspace-shell .essay-coach-page .essay-document-status #writingWordCount,
.workspace-shell .essay-coach-page .essay-document-status #draftSaveStatus { font-size:.9rem; line-height:1.6; }
.workspace-shell .essay-coach-page .essay-document-leave,
.workspace-shell .essay-coach-page .writing-prompt-disclosure > summary { width:252px; max-width:100%; }
.workspace-shell .essay-coach-page .essay-document-leave { color:#173f6b !important; }
/* Assignment expectations in the header; coaching and tools beside the paper. */
.workspace-shell .assignment-header-references { display:flex; flex-wrap:wrap; align-items:flex-start; gap:10px; }
.workspace-shell .assignment-header-references > details { margin-top:12px; min-width:0; }
.workspace-shell .assignment-header-references > details[open] { flex-basis:100%; }
.workspace-shell .assignment-header-references #writingReferenceTools { max-width:100%; }
.workspace-shell .assignment-header-references #writingReferenceTools > :not(summary) { margin-top:12px; }
.workspace-shell .essay-coach-page .writing-tool-collection {
  border:2px solid #82a9b5; border-radius:14px; background:#f2f7f6;
  padding:14px; display:flex; flex-direction:column; gap:12px;
}
.workspace-shell .essay-coach-page .writing-tool-collection > h2 { margin:0 0 2px; font-size:1.05rem; color:#173f6b; font-weight:400; }
.workspace-shell .essay-coach-page .writing-tool-collection .writing-organizer { padding:0; overflow:hidden; border:1.5px solid #82a9b5 !important; }
.workspace-shell .essay-coach-page .writing-tool-collection .wo-heading { margin:0; display:block; }
.workspace-shell .essay-coach-page .writing-tool-collection #organizerToggle {
  display:block; width:100%; text-align:left; margin:0; padding:14px;
  border:0; border-radius:11px; background:#edf6f3; font-size:.92rem; font-weight:600; color:#173f6b;
}
.workspace-shell .essay-coach-page #organizerToggle::before { content:'▸'; display:inline-block; margin-right:8px; }
.workspace-shell .essay-coach-page #organizerToggle[aria-expanded='true']::before { content:'▾'; }
.workspace-shell .essay-coach-page .writing-tool-collection #organizerBody { padding:12px; }
.workspace-shell .essay-coach-page .writing-tool-collection .wo-status-row { padding:0 12px 12px; margin:0; }
.workspace-shell .essay-coach-page #writingOrganizer:has(#organizerToggle[aria-expanded='false']) .wo-status-row:has(#organizerRetry[hidden]) { display:none; }
.workspace-shell .essay-coach-page .writing-tool-collection .writing-side-tool > summary { background:#edf6f3; }
.workspace-shell .essay-coach-page .coach-goal-label { display:block; font-size:.85rem; margin-bottom:6px; color:#173f6b; }
.workspace-shell .writing-reflection-notice { flex-basis:100%; font-size:.8rem; color:#38586a; }
#writingTurnInDialog { color:#173f6b; width:440px; max-height:90vh; overflow:auto; }
#writingTurnInDialog::backdrop { background:rgba(20,32,51,.4); }
#writingTurnInDialog label { display:block; font-size:.9rem; margin:12px 0 5px; }
#writingTurnInDialog .turn-in-note { margin-top:14px; }
#writingTurnInDialog .turn-in-note summary { cursor:pointer; font-size:.9rem; }
#turnInReflectionError { color:#713f12; background:#fff6d9; padding:10px; border-radius:8px; }
@media(min-width:961px) {
  .workspace-shell .essay-coach-page .assignment-header-references > details > summary { width:auto; min-width:252px; }
}

.essay-coach-page #coachGoal {
  background: #fff;
  color: #173f6b;
  border: 1px solid #7ba4b1;
}
.essay-coach-page #coachGoal::placeholder {
  color: #526777;
  opacity: 1;
}

#writingTurnInDialog textarea.form-control {
  color: #173f6b;
  background: #fff;
  border: 1px solid #7ba4b1;
  border-radius: 8px;
}
#writingTurnInDialog .btn-outline-secondary {
  color: #173f6b !important;
  background: #edf7f6 !important;
  border: 1px solid #167d78 !important;
}
#writingTurnInDialog .btn-outline-secondary:hover {
  background: #dcefed !important;
}

/* September 12: a quieter, student-facing coaching invitation. */
.workspace-shell .essay-coach-page .essay-document-leave {
  background:#0f766e; border-color:#0f766e; color:#fff !important;
}
.workspace-shell .essay-coach-page .essay-document-leave:hover { background:#095e59; }
.workspace-shell .essay-coach-page .essay-document-status,
.workspace-shell .essay-coach-page .essay-document-status #writingWordCount,
.workspace-shell .essay-coach-page .essay-document-status #draftSaveStatus { font-size:1rem; line-height:1.65; }
.workspace-shell .essay-coach-page .essay-document-status { gap:12px; padding-top:8px; }
.workspace-shell .essay-coach-page .writing-tool-collection > h2,
.workspace-shell .essay-coach-page .coach-card-title { font-size:1.1rem; font-weight:650; line-height:1.4; }
.workspace-shell .essay-coach-page .writing-tool-collection > h2::before {
  content:''; display:inline-block; width:20px; height:4px; margin-right:9px;
  background:#d3a123; border-radius:3px; vertical-align:middle;
}
.workspace-shell .essay-coach-page .writing-side-tool > summary { list-style:none; }
.workspace-shell .essay-coach-page .writing-side-tool > summary::-webkit-details-marker { display:none; }
.workspace-shell .essay-coach-page .writing-side-tool > summary::before,
.workspace-shell .essay-coach-page #organizerToggle::before {
  content:''; display:inline-block; width:0; height:0; margin-right:10px;
  border-top:5px solid transparent; border-bottom:5px solid transparent;
  border-left:7px solid #173f6b; vertical-align:middle;
}
.workspace-shell .essay-coach-page .writing-side-tool[open] > summary::before,
.workspace-shell .essay-coach-page #organizerToggle[aria-expanded='true']::before {
  content:''; transform:rotate(90deg);
}
.workspace-shell .essay-coach-page .coach-invitation { font-size:.95rem; line-height:1.55; color:#38586a; margin:0 0 16px; }
.workspace-shell .essay-coach-page .coach-goal-label { font-size:.9rem; font-weight:600; }
.workspace-shell .essay-coach-page #coachGoal { border-radius:8px; min-height:44px; font-size:.9rem; }
.workspace-shell .essay-coach-page .coach-refresh-btn { background:#0f766e; color:#fff; border-color:#0f766e; padding:11px 14px; font-weight:600; }
.workspace-shell .essay-coach-page .coach-refresh-btn:hover { background:#095e59; }
.workspace-shell .essay-coach-page .coach-scaffold-btn:disabled { display:none; }
.workspace-shell .essay-coach-page .coach-scaffold-actions:not(:has(.coach-scaffold-btn:not(:disabled))) { display:none; }
.workspace-shell .essay-coach-page .coach-card-outer[hidden],
.workspace-shell .essay-coach-page .essay-mobile-coach-bar[hidden],
.workspace-shell .essay-coach-page .feedback-panel-empty-wrap[hidden] { display:none !important; }
.workspace-shell .essay-coach-page .feedback-panel-body:not(:has(#rubricEvaluationResults > :not([hidden]))):has(#coachNudgeBox[style*="display: none"]) { padding-top:0; padding-bottom:0; border-top:0; }
.workspace-shell .essay-coach-page .writing-tool-collection > h2 { font-size:1.1rem !important; font-weight:650 !important; }
.workspace-shell .essay-coach-page .coach-refresh-btn { background:#0f766e !important; color:#fff !important; border-color:#0f766e !important; }
.workspace-shell .essay-coach-page .coach-refresh-btn:hover { background:#095e59 !important; }
.workspace-shell .essay-coach-page .writing-rubric-feedback { border:1.5px solid #82a9b5; border-radius:10px; background:#fff; color:#173f6b; overflow:hidden; }
.workspace-shell .essay-coach-page .writing-rubric-feedback > summary { cursor:pointer; padding:13px 15px; background:#edf6f3; font-weight:600; font-size:.95rem; }
.workspace-shell .essay-coach-page .writing-rubric-feedback[open] > summary { border-bottom:1px solid #c9dddd; box-shadow:inset 4px 0 #d3a123; }
.workspace-shell .essay-coach-page .writing-rubric-feedback .ec-score-hero { margin:0; border:0; box-shadow:none; }
.workspace-shell .essay-coach-page .ec-progress-bar { background:#0f766e !important; }
.workspace-shell .essay-coach-page .ec-tf-label { color:#173f6b !important; font-weight:650; }
.workspace-shell .essay-coach-page .ec-tf-action { border-left-color:#d3a123; }

/* Fill the reserved tools column even when every disclosure is closed. */
.workspace-shell .essay-coach-page .essay-coach-action-column,
.workspace-shell .essay-coach-page .essay-coach-action-column > .feedback-panel {
  width:100%; min-width:0; align-self:stretch;
}
.workspace-shell .essay-coach-page .feedback-panel > .writing-turnin-actions,
.workspace-shell .essay-coach-page .feedback-panel > .coach-card-outer,
.workspace-shell .essay-coach-page .feedback-panel > .writing-tool-collection {
  width:100%; box-sizing:border-box;
}
.workspace-shell .essay-coach-page #mechanicsCheck {
  background:#0f766e !important; color:#fff !important; border:1px solid #0f766e !important;
  padding:10px 16px; min-height:44px; border-radius:8px; font-size:.95rem; font-weight:600;
}
.workspace-shell .essay-coach-page #mechanicsCheck:hover { background:#095e59 !important; }
.workspace-shell .essay-coach-page #mechanicsCheck:disabled { opacity:.65; cursor:wait; }
.workspace-shell .essay-coach-page #mechanicsScope { color:#38586a; margin:12px 0 10px; font-size:.9rem; }
.workspace-shell .essay-coach-page .grammar-about { font-size:.8rem; color:#38586a; margin:0 0 10px; }
.workspace-shell .essay-coach-page .grammar-about > summary { cursor:pointer; color:#173f6b; font-weight:500; }
.workspace-shell .essay-coach-page .grammar-about p { margin:8px 0 0; }
.writing-control-tip {
  border:1px solid #0f766e; border-top:3px solid #d3a123;
  color:#fff !important; background:#173f6b !important; font-size:.85rem;
  max-height:calc(100vh - 24px); overflow-y:auto;
}
.writing-control-tip[hidden] { display:none !important; }

/* Keep the primary Coach action readable while hovered or keyboard-focused. */
.workspace-shell .essay-coach-page #coachRefreshBtn,
.workspace-shell .essay-coach-page #coachRefreshBtn:hover,
.workspace-shell .essay-coach-page #coachRefreshBtn:focus-visible { color:#fff !important; background:#0f766e !important; border-color:#0f766e !important; }

/* Compact assignment header: title, reference controls and document actions. */
.workspace-shell .essay-coach-page .essay-document-bar {
  display:grid; grid-template-columns:minmax(0,1fr) auto; align-items:center;
  gap:12px 20px; padding:14px 18px; background:#edf4fb;
  border-color:#83a6bb;
}
.workspace-shell .essay-coach-page .essay-document-context {
  border-left:4px solid #d3a123; padding-left:12px;
}
.workspace-shell .essay-coach-page .essay-document-controls {
  grid-column:2; grid-row:1; gap:12px; margin:0;
}
.workspace-shell .essay-coach-page .assignment-header-references {
  grid-column:1 / -1; grid-row:2; justify-content:center; gap:10px;
}
.workspace-shell .essay-coach-page .assignment-header-references > details { margin:0; }
.workspace-shell .essay-coach-page .assignment-header-references > details > summary {
  min-width:0; width:auto; padding:10px 14px; font-size:.95rem;
}
.workspace-shell .essay-coach-page .essay-document-leave {
  min-width:0; width:auto; padding:10px 18px; min-height:44px;
}
.workspace-shell .essay-coach-page .essay-document-status {
  margin:0; padding:0; gap:8px; font-size:.95rem;
}
@media(min-width:1400px) {
  .workspace-shell .essay-coach-page .essay-document-bar {
    grid-template-columns:minmax(180px,1fr) minmax(0,1.8fr) auto;
  }
  .workspace-shell .essay-coach-page .assignment-header-references {
    grid-column:2; grid-row:1; align-items:center;
  }
  .workspace-shell .essay-coach-page .essay-document-controls { grid-column:3; }
  .workspace-shell .essay-coach-page .essay-document-bar:has(.writing-prompt-disclosure[open]) .assignment-header-references {
    grid-column:1 / -1; grid-row:2; justify-content:flex-start;
  }
}
@media(max-width:650px) {
  .workspace-shell .essay-coach-page .essay-document-bar { grid-template-columns:minmax(0,1fr); padding:12px; }
  .workspace-shell .essay-coach-page .essay-document-controls {
    grid-column:1; grid-row:3; align-items:stretch; text-align:left;
  }
  .workspace-shell .essay-coach-page .essay-document-status { justify-content:flex-start; }
  .workspace-shell .essay-coach-page .assignment-header-references { justify-content:flex-start; }
  .workspace-shell .essay-coach-page .assignment-header-references > details { width:100%; }
  .workspace-shell .essay-coach-page .assignment-header-references > details > summary { width:100%; }
}
