/* =========================================================
   Weaver — css/views.css
   Step 6: launch dashboard styles (wizard styles append in Step 7).
   ========================================================= */

/* ---------- Dashboard shell ---------- */
.launch-wrap {
  width: 100%;
  height: 100%;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 36px;
  padding: 48px 24px;
  background:
    radial-gradient(1200px 600px at 50% -10%, rgba(224, 168, 60, .06), transparent 60%),
    var(--bg);
}

.launch-header {
  display: flex;
  align-items: center;
  gap: 16px;
  width: min(960px, 100%);
}
.launch-logo { width: 52px; height: 52px; color: var(--accent); flex: none; }
.launch-logo svg { width: 100%; height: 100%; display: block; }
.launch-title { font-size: 1.9rem; font-weight: 650; letter-spacing: .03em; }
.launch-tag {
  margin-top: 4px;
  color: var(--muted);
  font-size: .7rem;
  letter-spacing: .22em;
  text-transform: uppercase;
}
.launch-spacer { flex: 1; }

/* ---------- Project cards ---------- */
.launch-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 14px;
  width: min(960px, 100%);
}

.project-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  cursor: pointer;
  text-align: left;
  transition: border-color .15s ease, transform .12s ease, box-shadow .15s ease;
}
.project-card:hover {
  border-color: var(--border-strong);
  transform: translateY(-2px);
  box-shadow: var(--shadow-1);
}
.project-card.is-active { border-color: rgba(224, 168, 60, .5); }

.project-name {
  font-size: 1rem;
  font-weight: 600;
  padding-right: 30px; /* keep clear of delete button */
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.project-meta { display: flex; gap: 6px; flex-wrap: wrap; }
.project-updated {
  color: var(--faint);
  font-family: var(--font-mono);
  font-size: .68rem;
}
.project-delete {
  position: absolute;
  top: 10px;
  right: 10px;
  opacity: 0;
  transition: opacity .15s ease;
}
.project-card:hover .project-delete,
.project-card:focus-within .project-delete { opacity: 1; }

/* ---------- Empty state ---------- */
.launch-empty {
  width: min(960px, 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 60px 24px;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-lg);
  color: var(--muted);
}
.launch-empty .icon { width: 30px; height: 30px; color: var(--faint); }
.launch-empty-hint {
  font-size: .8rem;
  color: var(--faint);
  max-width: 340px;
  text-align: center;
  line-height: 1.5;
}
.launch-empty .btn { margin-top: 8px; }
/* =========================================================
   Step 7: New Project wizard
   ========================================================= */
.wizard-seg { display: flex; gap: 8px; flex-wrap: wrap; }
.wizard-seg .btn { flex: 1; justify-content: flex-start; }
.wizard-seg .btn.is-selected {
  border-color: rgba(224, 168, 60, .55);
  background: var(--accent-soft);
  color: var(--accent);
}
.wizard-upload {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 22px 16px;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-md);
  color: var(--muted);
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease;
}
.wizard-upload:hover, .wizard-upload.is-drag {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.wizard-upload.is-loaded {
  border-style: solid;
  border-color: rgba(127, 176, 105, .5);
  color: var(--success);
}
.wizard-upload .icon { color: var(--faint); }
.wizard-upload-hint { font-size: .8rem; text-align: center; }
/* =========================================================
   Step 11: Manuscript editor
   ========================================================= */
.ms-scroll {
  padding: 18px 20px 45vh; /* bottom padding = comfortable scroll runway */
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-height: 100%;
}
.ms-block {
  padding: 3px 8px;
  border-radius: 4px;
  line-height: 1.7;
  font-family: var(--font-prose);
  font-size: calc(0.98rem * var(--font-scale, 1));
  color: var(--text);
  white-space: pre-wrap;
  overflow-wrap: break-word;
  outline: none;
  min-height: 1.7em;
}
.ms-block:focus {
  background: var(--surface);
  box-shadow: inset 2px 0 0 var(--accent);
}
.ms-block:empty::before { content: 'Type here…'; color: var(--faint); }
.ms-h1 {
  font-family: var(--font-ui);
  font-size: 1.45rem;
  font-weight: 700;
  color: var(--accent);
  margin-top: 16px;
}
.ms-h2 {
  font-family: var(--font-ui);
  font-size: 1.18rem;
  font-weight: 600;
  margin-top: 12px;
}
.ms-h3 {
  font-family: var(--font-ui);
  font-size: 1.02rem;
  font-weight: 600;
  color: var(--muted);
  margin-top: 8px;
}
.ms-toolbar { display: flex; gap: 2px; margin-right: 8px; }
.ms-tb-btn { min-width: 30px; padding: 5px 7px; font-size: .72rem; font-weight: 700; }
.ms-tb-btn.is-selected { background: var(--accent-soft); color: var(--accent); }
/* =========================================================
   Step 12: Paging engine spacers
   ========================================================= */
.ms-spacer {
  flex: none;
  width: 100%;
  height: 0;
  pointer-events: none;
}
/* =========================================================
   Step 13: Main Novel panel
   ========================================================= */
.mn-scroll {
  padding: 18px 20px 45vh;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 100%;
  font-family: var(--font-prose);
  font-size: calc(0.98rem * var(--font-scale, 1));
  line-height: 1.7;
  color: var(--text);
  user-select: text; /* Crucial: allows highlighting text for Recheck */
}
.mn-block {
  white-space: pre-wrap;
  overflow-wrap: break-word;
}
.mn-h1 { font-family: var(--font-ui); font-size: 1.45rem; font-weight: 700; color: var(--accent); margin-top: 16px; }
.mn-h2 { font-family: var(--font-ui); font-size: 1.18rem; font-weight: 600; margin-top: 12px; }
.mn-h3 { font-family: var(--font-ui); font-size: 1.02rem; font-weight: 600; color: var(--muted); margin-top: 8px; }
.mn-word-count { margin-right: 12px; }
/* =========================================================
   Step 26: slim mobile panel footers
   ========================================================= */
@media (max-width: 860px) {
  .panel-footer { padding: 4px 6px; gap: 4px; }
  .panel-footer .btn { padding: 6px 8px; font-size: .72rem; }
}
@media (max-width: 640px) {
  .panel-footer .btn-label { display: none; }
  .panel-footer .btn { padding: 6px 12px; }
}
/* =========================================================
   Step 28.6: centered Library hero
   ========================================================= */
.launch-header,
.launch-grid,
.launch-empty{
  max-width:1100px;
  margin-left:auto;
  margin-right:auto;
  width:100%;
}
.launch-empty{
  min-height:calc(100vh - 240px);
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
}
/* ---------- Stage 6.4: Library action buttons ---------- */
.launch-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto; /* push actions to the right edge of the header */
}

/* =========================================================
   Stage 6.9 — Library hero: centered emblem, wordmark, tagline
   and a prominent CTA. Compacts to a masthead once projects exist.
   ========================================================= */

.launch-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 16px;
  min-height: 56vh;
  padding: 48px 20px 36px;
}

.launch-hero-logo {
  width: 84px;
  height: 84px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--accent);
  background: radial-gradient(circle at 32% 28%, rgba(224,168,60,.22), rgba(224,168,60,.05) 70%);
  border: 1px solid rgba(224,168,60,.38);
  box-shadow: 0 0 0 10px rgba(224,168,60,.04), var(--shadow-2);
}
.launch-hero-logo .icon { width: 40px; height: 40px; }

.launch-hero-title {
  font-family: var(--font-ui);
  font-size: clamp(2.6rem, 8vw, 4rem);
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
  line-height: 1;
  text-indent: .16em; /* optically re-center the letter-spacing */
  background: linear-gradient(180deg, #f6dda6 0%, var(--accent) 55%, #b9822a 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.launch-hero-tag {
  max-width: 36ch;
  color: var(--muted);
  font-size: .95rem;
  line-height: 1.65;
}

.launch-hero-actions {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

/* The call to action — the loudest thing on the screen. */
.launch-cta {
  min-width: 280px;
  padding: 15px 32px;
  font-size: 1.02rem;
  font-weight: 650;
  letter-spacing: .05em;
  border-radius: 999px;
  justify-content: center;
  box-shadow: 0 8px 26px rgba(224,168,60,.26);
  transition: transform .15s ease, box-shadow .15s ease, filter .15s ease;
}
.launch-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(224,168,60,.34);
  filter: brightness(1.06);
}
.launch-cta:active { transform: translateY(0); }
.launch-cta .icon { width: 18px; height: 18px; }

.launch-hero-sub { display: flex; align-items: center; gap: 10px; }

.launch-hero-hint {
  max-width: 44ch;
  color: var(--faint);
  font-size: .8rem;
  line-height: 1.6;
  margin-top: 4px;
}

/* ---------- Library bar (shown once projects exist) ---------- */
.launch-lib-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 24px 14px;
  border-top: 1px solid var(--border);
  margin-top: 4px;
  padding-top: 18px;
}
.launch-lib-count {
  font-family: var(--font-mono);
  font-size: .7rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--faint);
}

/* ---------- Compact hero: masthead above the grid ---------- */
.launch-hero.is-compact {
  min-height: 0;
  gap: 8px;
  padding: 26px 20px 18px;
}
.launch-hero.is-compact .launch-hero-logo {
  width: 44px;
  height: 44px;
  box-shadow: none;
}
.launch-hero.is-compact .launch-hero-logo .icon { width: 22px; height: 22px; }
.launch-hero.is-compact .launch-hero-title {
  font-size: 1.5rem;
  letter-spacing: .14em;
  text-indent: .14em;
}
.launch-hero.is-compact .launch-hero-tag { font-size: .8rem; max-width: 46ch; }
.launch-hero.is-compact .launch-hero-actions {
  flex-direction: row;
  align-items: center;
  gap: 12px;
  margin-top: 10px;
}
.launch-hero.is-compact .launch-cta {
  min-width: 0;
  padding: 10px 22px;
  font-size: .88rem;
  box-shadow: 0 4px 16px rgba(224,168,60,.22);
}
.launch-hero.is-compact .launch-hero-sub { gap: 8px; }

/* ---------- Mobile ---------- */
@media (max-width: 640px) {
  .launch-hero { min-height: 62vh; padding: 44px 18px 30px; gap: 14px; }
  .launch-hero-logo { width: 72px; height: 72px; box-shadow: 0 0 0 8px rgba(224,168,60,.04); }
  .launch-hero-logo .icon { width: 34px; height: 34px; }
  .launch-hero-tag { font-size: .88rem; max-width: 30ch; }
  .launch-hero-actions { width: 100%; gap: 14px; }
  .launch-cta { width: 100%; max-width: 360px; min-width: 0; padding: 16px 24px; }
  .launch-hero-sub { width: 100%; justify-content: center; }
  .launch-lib-bar { padding: 16px 16px 12px; }
  .launch-hero.is-compact { padding: 20px 16px 14px; }
  .launch-hero.is-compact .launch-hero-actions { width: auto; }
  .launch-hero.is-compact .launch-cta { width: auto; }
}

/* ---------- Stage 6.10: hero logo — drop the circle ---------- */
.launch-hero-logo {
  width: auto;
  height: auto;
  background: none;
  border: none;
  border-radius: 0;
  box-shadow: none;
}
.launch-hero.is-compact .launch-hero-logo {
  width: auto;
  height: auto;
  box-shadow: none;
}
