/* Ghost Biographer — Tone & Style page styles
   Page-specific layout and overrides only.
   Shared tokens and components live in design.css. */

/* ── Body / shell layout ─────────────────────────── */
body {
  display: flex;
  flex-direction: column;
  height: 100dvh;
  overflow: hidden;
}

/* ── Status bar ─────────────────────────────────── */
#status-bar {
  font-size: 13px;
  color: var(--ink-3);
  padding: 4px var(--shell-pad);
  background: var(--paper);
  border-bottom: 1px solid var(--hairline);
  min-height: 30px;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
#status-bar.error { color: var(--rose); }
#status-bar.ok    { color: var(--sage); }

/* ── Workspace — scrollable sliders area ─────────── */
#workspace {
  flex: 1;
  overflow-y: auto;
  padding: 24px var(--shell-pad) 80px;
  min-height: 0;
}
#workspace-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
}
@media (max-width: 720px) {
  #workspace-inner { grid-template-columns: 1fr; }
}

.workspace-top {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}
.workspace-top h2 {
  font-size: 17px;
  font-weight: 600;
  color: var(--ink);
}
.workspace-top-btns { display: flex; gap: 8px; }

/* ── Guidepost dial card ─────────────────────────── */
.guidepost-card {
  background: var(--paper);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 18px 20px;
  transition: border-color 200ms, box-shadow 200ms;
}
.guidepost-card.ai-active {
  border-color: var(--plum);
  box-shadow: 0 0 0 2px oklch(0.5 0.17 295 / 0.15), var(--shadow);
}
.gp-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}
.gp-label {
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
  flex: 1;
  cursor: default;
}

/* Per-card mic button */
.gp-slider-mic {
  width: 44px;
  height: 36px;
  border-radius: 99px;
  background: var(--paper-2);
  border: 1px solid var(--hairline);
  color: var(--ink-3);
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 150ms, border-color 150ms, color 150ms;
  flex-shrink: 0;
  position: relative;
}
.gp-slider-mic:hover {
  background: oklch(0.95 0.04 295);
  border-color: var(--plum-3);
  color: var(--plum);
}
.gp-slider-mic.recording {
  background: oklch(0.95 0.05 25);
  border-color: var(--rose);
  color: var(--rose);
  animation: mic-pulse 1s infinite;
}
.gp-slider-mic.discussed {
  border-color: var(--sage);
  color: var(--sage);
  background: var(--sage-bg);
}
.gp-slider-mic.discussed:hover {
  background: oklch(0.93 0.06 155);
}
.gp-slider-mic.discussed::after {
  content: "✓";
  position: absolute;
  top: -5px; right: -6px;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--sage);
  color: #fff;
  font-size: 9px;
  font-weight: 900;
  line-height: 14px;
  text-align: center;
  pointer-events: none;
}

/* Hint line */
.gp-hint-line {
  font-size: 13px;
  color: var(--ink-3);
  line-height: 1.5;
  margin-bottom: 8px;
}

/* ── Dial SVG ─────────────────────────────────────── */
.gp-dial-wrap { display: flex; justify-content: center; }
.gp-dial {
  display: block;
  width: 100%;
  max-width: 230px;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
}
.dial-track {
  fill: none;
  stroke: var(--hairline);
  stroke-width: 11;
  stroke-linecap: round;
}
.dial-fill {
  fill: none;
  stroke: var(--plum);
  stroke-width: 11;
  stroke-linecap: round;
}
.dial-tick  { stroke: var(--ink-4); stroke-width: 1.5; }
.dial-num   { fill: var(--ink-3); font-size: 11px; font-weight: 600; }
.dial-num-active { fill: var(--plum); font-size: 13px; font-weight: 800; }
.dial-needle { stroke: var(--ink-2); stroke-width: 2.5; stroke-linecap: round; }
.dial-hub    { fill: var(--plum); stroke: var(--paper); stroke-width: 1.5; }
.dial-val    { fill: var(--plum); font-size: 18px; font-weight: 700; }

/* Edge labels below dial */
.gp-dial-labels {
  display: flex;
  justify-content: space-between;
  margin-top: 5px;
  padding: 0 4px;
}
.gp-dial-lv1,
.gp-dial-lv7 {
  font-size: 12px;
  color: var(--ink-4);
  max-width: 46%;
  line-height: 1.3;
}
.gp-dial-lv7 { text-align: right; }

/* ── What's Next modal ───────────────────────────── */
#wn-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .45);
  z-index: 60;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
#wn-overlay.open { display: flex; }
#wn-modal {
  background: var(--paper);
  border-radius: var(--radius);
  padding: 24px;
  max-width: 540px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
  box-shadow: var(--shadow-lg);
  position: relative;
}
#wn-modal h2 {
  font-size: 18px;
  color: var(--ink);
  font-weight: 600;
}
.wn-guidance {
  font-size: 14px;
  line-height: 1.65;
  color: var(--ink-2);
  background: var(--paper-2);
  border-radius: 8px;
  padding: 12px 16px;
}
.wn-arc-summary { display: flex; flex-wrap: wrap; gap: 6px; }
.wn-arc-chip {
  background: var(--paper-2);
  border: 1px solid var(--hairline);
  border-radius: 99px;
  padding: 3px 12px;
  font-size: 13px;
  color: var(--ink-3);
}
.wn-arc-chip span { color: var(--plum); font-weight: 600; }
.wn-tip {
  font-size: 13px;
  line-height: 1.55;
  color: var(--ink-3);
  border-left: 2px solid var(--hairline);
  padding: 5px 12px;
  font-style: italic;
}
.wn-phases { display: flex; flex-direction: column; gap: 6px; }
.wn-phase {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 13px;
  padding: 6px 8px;
  border-radius: 6px;
}
.wn-phase.complete    { color: var(--sage); }
.wn-phase.in_progress { color: var(--terra); background: oklch(0.97 0.04 60 / 0.5); }
.wn-phase.not_started { color: var(--ink-4); }
.wn-phase.clickable   { cursor: pointer; transition: background 120ms; }
.wn-phase.clickable:hover { background: oklch(0.95 0.04 295); }
.wn-steps { display: flex; flex-direction: column; gap: 6px; }
.wn-step {
  font-size: 13px;
  color: var(--ink);
  display: flex;
  gap: 8px;
  border-radius: 6px;
  padding: 5px 8px;
  transition: background 120ms, color 120ms;
}
.wn-step::before { content: "→"; color: var(--plum); flex-shrink: 0; }
.wn-step.clickable { cursor: pointer; }
.wn-step.clickable:hover { background: var(--paper-2); color: var(--plum); }
#wn-close {
  position: absolute;
  top: 12px; right: 12px;
  background: transparent;
  border: none;
  color: var(--ink-3);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  padding: 2px 5px;
  border-radius: 4px;
}
#wn-close:hover { color: var(--ink); background: var(--paper-2); }
.wn-progress-track {
  width: 100%;
  height: 5px;
  background: var(--hairline);
  border-radius: 99px;
  overflow: hidden;
}
.wn-progress-bar {
  height: 100%;
  width: 30%;
  background: linear-gradient(90deg, var(--plum), oklch(0.6 0.17 295), var(--plum));
  background-size: 200% 100%;
  border-radius: 99px;
  animation: wn-sweep 1.6s ease-in-out infinite;
}

/* ── Auth overlay (session-expiry fallback) ──────── */
#auth-overlay {
  position: fixed;
  inset: 0;
  background: oklch(0.98 0.01 270 / 0.95);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
}
.auth-box {
  background: var(--paper);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 32px;
  width: 360px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.auth-box h2 {
  color: var(--ink);
  font-size: 17px;
  text-align: center;
}
.auth-box label {
  font-size: 13px;
  color: var(--ink-2);
  display: block;
  margin-bottom: 4px;
}
.auth-box input {
  width: 100%;
  background: var(--paper-2);
  border: 1px solid var(--hairline);
  border-radius: 8px;
  color: var(--ink);
  padding: 8px 12px;
  font-size: 15px;
  font-family: var(--font-ui);
}
.auth-box input:focus {
  outline: none;
  border-color: var(--plum);
}
#login-error { font-size: 13px; color: var(--rose); min-height: 18px; }

/* ── Spinner ─────────────────────────────────────── */
.spinner {
  display: inline-block;
  width: 14px; height: 14px;
  border: 2px solid var(--hairline);
  border-top-color: var(--plum);
  border-radius: 50%;
  animation: spin .8s linear infinite;
  vertical-align: middle;
  margin-right: 5px;
}

/* ── Animations ──────────────────────────────────── */
@keyframes mic-pulse {
  0%,100% { box-shadow: 0 0 0 0 oklch(0.5 0.2 25 / 0.4); }
  50%      { box-shadow: 0 0 0 10px oklch(0.5 0.2 25 / 0); }
}
@keyframes wn-sweep {
  0%,100% { background-position: 0% 50%; }
  50%      { background-position: 100% 50%; }
}
@keyframes spin { to { transform: rotate(360deg); } }
