/* ── Write page base ── */
.write-page {
  background: var(--bg);
  overflow: hidden;
  height: 100vh;
}

/* ── Write nav ── */
.write-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 40px;
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 10;
  transition: opacity 2.5s ease;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  backdrop-filter: blur(12px);
}

.write-nav-right {
  display: flex;
  align-items: center;
  gap: 20px;
}

#focus-timer {
  font-size: 12px;
  color: var(--muted);
  font-family: sans-serif;
  letter-spacing: 0.04em;
}

#btn-preflight {
  background: var(--accent);
  color: var(--bg);
  border: none;
  padding: 8px 20px;
  border-radius: 99px;
  font-size: 13px;
  font-family: sans-serif;
  cursor: pointer;
  transition: opacity 0.2s;
}

#btn-preflight:hover { opacity: 0.8; }

#btn-signout-write {
  background: none;
  border: 1px solid var(--muted);
  color: var(--muted);
  padding: 7px 16px;
  border-radius: 99px;
  font-size: 12px;
  font-family: sans-serif;
  cursor: pointer;
}

/* ── Word count bar ── */
#word-bar {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 24px;
  font-size: 12px;
  color: var(--muted);
  font-family: sans-serif;
  letter-spacing: 0.06em;
  z-index: 10;
  transition: opacity 2.5s ease;
  background: rgba(10,10,15,0.6);
  backdrop-filter: blur(8px);
  padding: 8px 20px;
  border-radius: 99px;
  border: 1px solid rgba(255,255,255,0.05);
}

/* ── UI fade when typing ── */
.typing #navbar,
.typing #word-bar {
  opacity: 0;
  pointer-events: none;
}

/* ── Editor shell ── */
#editor-shell {
  position: relative;
  z-index: 5;
  height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 120px 24px 80px;
  overflow-y: auto;
}

/* ── Title input ── */
#article-title {
  width: 100%;
  max-width: 680px;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text);
  font-family: var(--font);
  font-size: clamp(26px, 4vw, 42px);
  font-weight: 400;
  letter-spacing: -0.01em;
  margin-bottom: 24px;
  text-align: center;
  caret-color: var(--accent);
}

#article-title::placeholder { color: rgba(255,255,255,0.12); }

/* ── Body editor ── */
#editor {
  width: 100%;
  max-width: 680px;
  min-height: 60vh;
  background: transparent;
  outline: none;
  color: var(--text);
  font-family: var(--font);
  font-size: clamp(17px, 2vw, 20px);
  line-height: 1.85;
  letter-spacing: 0.01em;
  caret-color: var(--accent);
}

#editor:empty::before {
  content: attr(data-placeholder);
  color: rgba(255,255,255,0.1);
  pointer-events: none;
  font-style: italic;
}

/* ── Pre-flight panel ── */
#preflight-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.75);
  backdrop-filter: blur(10px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
}

#preflight-panel {
  background: var(--surface);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 16px;
  padding: 48px 44px;
  max-width: 520px;
  width: 100%;
}

#preflight-panel h2 {
  font-size: 22px;
  font-weight: 400;
  color: var(--text);
  margin-bottom: 8px;
}

#preflight-panel > p {
  font-size: 13px;
  color: var(--muted);
  font-style: italic;
  margin-bottom: 28px;
}

#preflight-panel label {
  display: block;
  font-size: 11px;
  font-family: sans-serif;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 8px;
}

#preflight-panel label span {
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
  color: rgba(107,106,114,0.6);
}

#preflight-panel select,
#preflight-panel textarea {
  width: 100%;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px;
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  padding: 12px 16px;
  margin-bottom: 20px;
  outline: none;
  transition: border-color 0.2s;
  resize: none;
}

#preflight-panel select:focus,
#preflight-panel textarea:focus {
  border-color: var(--accent);
}

#preflight-panel select option {
  background: var(--surface);
}

.preflight-actions {
  display: flex;
  gap: 12px;
  margin-top: 8px;
}

#btn-submit-article {
  flex: 1;
  background: var(--accent);
  color: var(--bg);
  border: none;
  padding: 13px 20px;
  border-radius: 8px;
  font-size: 14px;
  font-family: sans-serif;
  cursor: pointer;
  transition: opacity 0.2s;
}

#btn-submit-article:hover { opacity: 0.85; }
#btn-submit-article:disabled { opacity: 0.4; cursor: not-allowed; }

#btn-preflight-close {
  background: none;
  border: 1px solid rgba(255,255,255,0.1);
  color: var(--muted);
  padding: 13px 20px;
  border-radius: 8px;
  font-size: 14px;
  font-family: sans-serif;
  cursor: pointer;
}

#submit-message {
  margin-top: 16px;
  font-size: 13px;
  font-family: sans-serif;
  text-align: center;
  color: var(--accent);
}
