/* NC.EL.45 — Writing Studio UI */
:root {
  --nc-ws-bg: #f6f8fb;
  --nc-ws-card: #fff;
  --nc-ws-text: #1a2332;
  --nc-ws-muted: #5c6b7a;
  --nc-ws-accent: #8b1a1a;
  --nc-ws-border: #d8e0ea;
}

* { box-sizing: border-box; }

body.nc-el-writing-page,
body.nc-el-writing-editor {
  margin: 0;
  font-family: "Segoe UI", system-ui, sans-serif;
  color: var(--nc-ws-text);
  background: var(--nc-ws-bg);
  line-height: 1.55;
}

.nc-el-writing-header {
  background: #fff;
  border-bottom: 1px solid var(--nc-ws-border);
  padding: 0.75rem 1.25rem;
}

.nc-el-writing-header-inner {
  max-width: 960px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.nc-el-writing-brand {
  margin: 0;
  font-weight: 600;
  color: var(--nc-ws-accent);
}

.nc-el-writing-main {
  max-width: 960px;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 3rem;
}

.nc-el-writing-editor-main h1 {
  margin-top: 0;
}

.nc-el-writing-editor-main h1 {
  margin-top: 0;
}

.nc-el-writing-editor-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  margin-top: 1rem;
}

@media (min-width: 960px) {
  .nc-el-writing-editor-grid {
    grid-template-columns: minmax(0, 1.4fr) minmax(280px, 0.9fr);
    align-items: start;
  }
}

.nc-el-writing-compose-main {
  margin-top: 0;
}

.nc-el-writing-coach {
  background: var(--nc-ws-card);
  border: 1px solid var(--nc-ws-border);
  border-radius: 10px;
  padding: 1.25rem;
  position: sticky;
  top: 1rem;
}

.nc-el-writing-coach h2 {
  margin: 0 0 0.5rem;
  font-size: 1.05rem;
}

.nc-el-writing-coach-status {
  margin: 0.75rem 0 0;
  font-size: 0.92rem;
  color: var(--nc-ws-muted);
}

.nc-el-writing-coach-stats {
  margin: 0.75rem 0;
  padding: 0.75rem;
  background: #f8fafc;
  border-radius: 8px;
  border: 1px solid var(--nc-ws-border);
  font-size: 0.9rem;
}

.nc-el-coach-stats-line {
  margin: 0 0 0.5rem;
}

.nc-el-coach-history {
  margin: 0;
  padding-left: 1.1rem;
  color: var(--nc-ws-muted);
  font-size: 0.85rem;
}

.nc-el-coach-repeat {
  display: inline-block;
  margin-left: 0.25rem;
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
  background: #fef3c7;
  color: #92400e;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.nc-el-coach-score {
  margin: 0 0 0.5rem;
}

.nc-el-coach-summary {
  margin: 0 0 1rem;
  font-size: 0.95rem;
}

.nc-el-coach-issues {
  list-style: none;
  margin: 0;
  padding: 0;
}

.nc-el-coach-issue {
  border-left: 3px solid var(--nc-ws-border);
  padding: 0.65rem 0 0.65rem 0.75rem;
  margin-bottom: 0.65rem;
  font-size: 0.92rem;
}

.nc-el-coach-issue q {
  display: block;
  margin: 0.25rem 0;
  color: var(--nc-ws-muted);
  font-style: italic;
}

.nc-el-coach-issue p {
  margin: 0.35rem 0 0;
}

.nc-el-coach-cat {
  display: inline-block;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--nc-ws-muted);
}

.nc-el-coach-sev-high { border-left-color: #b42318; }
.nc-el-coach-sev-medium { border-left-color: #d97706; }
.nc-el-coach-sev-low { border-left-color: #6b7280; }

.nc-el-writing-meta,
.muted {
  color: var(--nc-ws-muted);
  font-size: 0.95rem;
}

.nc-el-writing-prompt,
.nc-el-writing-compose {
  background: var(--nc-ws-card);
  border: 1px solid var(--nc-ws-border);
  border-radius: 10px;
  padding: 1.25rem;
  margin-top: 1rem;
}

.nc-el-writing-prompt h2 {
  margin: 0 0 0.5rem;
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--nc-ws-muted);
}

#nc-el-writing-body {
  width: 100%;
  min-height: 420px;
  margin-top: 0.5rem;
  padding: 1rem;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.05rem;
  line-height: 1.65;
  border: 1px solid var(--nc-ws-border);
  border-radius: 8px;
  resize: vertical;
}

.nc-el-writing-stats {
  margin: 0.75rem 0 0;
}

.nc-el-writing-draft-status {
  margin-left: 0.75rem;
  color: var(--nc-ws-muted);
  font-size: 0.9rem;
}

.nc-el-writing-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1rem;
}

.nc-el-writing-btn {
  display: inline-block;
  padding: 0.65rem 1.1rem;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
  border: 1px solid transparent;
  cursor: pointer;
  font-size: 0.95rem;
}

.nc-el-writing-btn-primary {
  background: var(--nc-ws-accent);
  color: #fff;
}

.nc-el-writing-btn-secondary {
  background: #fff;
  color: var(--nc-ws-text);
  border-color: var(--nc-ws-border);
}

.nc-el-writing-link {
  color: var(--nc-ws-accent);
  text-decoration: none;
  font-size: 0.95rem;
}

.nc-el-writing-alert {
  background: #fdecea;
  color: #8a1c1c;
  border: 1px solid #f5c2c0;
  padding: 1rem;
  border-radius: 8px;
}

.nc-el-writing-ok {
  background: #e8f5e9;
  color: #1b5e20;
  border: 1px solid #c8e6c9;
  padding: 1rem;
  border-radius: 8px;
}

.nc-el-writing-message {
  margin-top: 1rem;
  padding: 0.85rem 1rem;
  border-radius: 8px;
}

.nc-el-writing-message.is-error {
  background: #fdecea;
  color: #8a1c1c;
}

.nc-el-writing-message.is-ok {
  background: #e8f5e9;
  color: #1b5e20;
}

.nc-el-writing-card {
  background: var(--nc-ws-card);
  border: 1px solid var(--nc-ws-border);
  border-radius: 12px;
  padding: 1.5rem 1.35rem;
}

.nc-el-writing-meta {
  color: var(--nc-ws-muted);
  margin-top: -0.25rem;
}

.nc-el-placement-checklist {
  margin: 1rem 0;
  padding-left: 1.25rem;
}

.nc-el-writing-btn {
  display: inline-block;
  margin-top: 0.75rem;
  padding: 0.55rem 1rem;
  background: var(--nc-ws-accent);
  color: #fff;
  text-decoration: none;
  border-radius: 8px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  font-size: 1rem;
}

.nc-el-placement-battery h1 {
  margin-top: 0;
}

.nc-el-placement-steps {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.75rem;
  margin: 1rem 0 0;
  font-size: 0.82rem;
}

.nc-el-placement-step {
  color: var(--nc-ws-muted);
  padding-bottom: 0.15rem;
  border-bottom: 2px solid transparent;
}

.nc-el-placement-step.is-active {
  color: var(--nc-ws-accent);
  font-weight: 600;
  border-bottom-color: var(--nc-ws-accent);
}

.nc-el-placement-step.is-done {
  color: var(--nc-ws-text);
}

.nc-el-reading-form {
  margin-top: 1rem;
}

.nc-el-reading-item {
  border: 1px solid var(--nc-ws-border);
  border-radius: 10px;
  padding: 1rem 1rem 0.75rem;
  margin: 0 0 1rem;
  background: #fff;
}

.nc-el-reading-item legend {
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.nc-el-q-num {
  color: var(--nc-ws-accent);
}

.nc-el-reading-choice {
  display: block;
  margin: 0.35rem 0;
  cursor: pointer;
}

.nc-el-word-count {
  font-size: 0.9rem;
  color: var(--nc-ws-muted);
}

.nc-el-word-count--ok {
  color: #1a6b3a;
  font-weight: 600;
}

#nc-el-placement-essay {
  width: 100%;
  min-height: 320px;
  margin-top: 0.5rem;
  padding: 0.75rem;
  border: 1px solid var(--nc-ws-border);
  border-radius: 8px;
  font: inherit;
  line-height: 1.5;
}

.nc-el-placement-status {
  margin-top: 1rem;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  background: #eef3fa;
}

.nc-el-placement-status--error {
  background: #fdecea;
  color: #8b1a1a;
}

.nc-el-placement-alert {
  padding: 1rem 1.1rem;
  border-radius: 10px;
  margin: 1rem 0;
}

.nc-el-placement-alert--pass {
  background: #e8f5ec;
  border: 1px solid #b8dfc4;
}

.nc-el-placement-alert--fail,
.nc-el-placement-alert--error {
  background: #fdecea;
  border: 1px solid #f0c4c0;
}

.nc-el-placement-score-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
  background: #fff;
  border: 1px solid var(--nc-ws-border);
  border-radius: 10px;
  overflow: hidden;
}

.nc-el-placement-score-table th,
.nc-el-placement-score-table td {
  padding: 0.65rem 0.85rem;
  border-bottom: 1px solid var(--nc-ws-border);
  text-align: left;
}

.nc-el-placement-score-table tr:last-child th,
.nc-el-placement-score-table tr:last-child td {
  border-bottom: none;
}

.nc-el-score-pass {
  color: #1a6b3a;
  font-weight: 600;
}

.nc-el-score-fail {
  color: #8b1a1a;
}

.nc-el-placement-foot {
  margin-top: 1.5rem;
  font-size: 0.95rem;
}
