@layer surfaces {

/* ============================================================================
   The project dashboard (projects#show): the project's home when no document is
   selected. Shares the library's page shell (.documents-page, .documents-header,
   .back-link — 030) and speaks the same quiet language: serif titles, sans meta,
   hairline borders. Design decision 2026-07-23: rows over cards, collections in
   binder order, aggregates whispered — facts ambient, nothing pushed. */

/* The dashboard reads wider than the library list — collections carry meta columns the
   42-44rem library measure would crowd. Centered in the space after the drawer (the
   content box already excludes it), same as every hero surface. */
.project-dashboard {
  --hero-w: 50rem;
}

.project-dashboard-title {
  font-family: var(--font-prose);
  font-optical-sizing: auto;
}

/* "Continue writing" — the just-start-writing affordance: one click back into the
   last-edited document. A quiet filled strip, not a call to action. */
.project-dashboard-continue {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin: 1.25rem 0 1.5rem;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  background: var(--c-gray-50);
  color: inherit;
  text-decoration: none;
  transition: background-color var(--t-fast);
}

.project-dashboard-continue:hover {
  background: var(--c-gray-100);
}

.project-dashboard-continue-kicker {
  display: block;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: var(--ls-kicker);
  text-transform: uppercase;
  color: var(--c-gray-500);
  margin-bottom: 0.125rem;
}

.project-dashboard-continue-title {
  font-family: var(--font-prose);
  font-size: 1rem;
  font-weight: 500;
}

.project-dashboard-continue-meta {
  margin-left: 0.5rem;
  font-size: 0.8125rem;
  color: var(--c-gray-500);
}

.project-dashboard-continue-arrow {
  color: var(--c-gray-500);
  font-size: 1.125rem;
  transition: transform var(--t-fast);
}

.project-dashboard-continue:hover .project-dashboard-continue-arrow {
  transform: translateX(2px);
}

/* The aggregate strip: three quiet tiles. dl/dt/dd for AT; visually just numbers. */
.project-dashboard-stats {
  display: flex;
  gap: 2.5rem;
  margin: 0 0 1.75rem;
  padding: 0;
}

.project-dashboard-stat dt {
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: var(--ls-kicker);
  text-transform: uppercase;
  color: var(--c-gray-500);
}

.project-dashboard-stat dd {
  margin: 0.125rem 0 0;
  font-size: 1.0625rem;
  font-weight: 500;
  color: var(--c-gray-900);
  font-variant-numeric: tabular-nums;
}

/* Collections: binder order, one bordered section each — dense lists, not cards. */
.project-dashboard-collection {
  margin-bottom: 1.5rem;
}

.project-dashboard-collection-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding-bottom: 0.375rem;
  border-bottom: 1px solid var(--c-gray-300);
}

.project-dashboard-collection-label {
  margin: 0;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: var(--ls-kicker);
  text-transform: uppercase;
  color: var(--c-gray-600);
}

.project-dashboard-collection-meta {
  font-size: 0.75rem;
  color: var(--c-gray-500);
  font-variant-numeric: tabular-nums;
}

/* Each collection row wraps the doc link plus its quiet trash affordance (doc-level
   trash entry point, ADR 0011): the button exists only on hover, and never inside the
   link — a mis-click near the title must open, not trash. */
.project-dashboard-doc-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  border-bottom: 1px solid var(--c-gray-200);
}

.project-dashboard-doc {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.625rem 0.25rem;
  color: inherit;
  text-decoration: none;
  transition: background-color var(--t-fast);
}

.project-dashboard-doc-trash,
.document-binder-item-trash {
  border: 1px solid var(--c-gray-300);
  border-radius: 4px;
  background: var(--c-white);
  color: var(--c-gray-500);
  cursor: pointer;
  font-size: 0.71875rem;
  padding: 0.125rem 0.375rem;
  opacity: 0;
  flex-shrink: 0;
  transition: color var(--t-fast), opacity var(--t-fast);
}

.project-dashboard-doc-row:hover .project-dashboard-doc-trash,
.project-dashboard-doc-trash:focus-visible,
.document-binder-item:hover .document-binder-item-trash,
.document-binder-item-trash:focus-visible {
  opacity: 1;
}

.project-dashboard-doc-trash:hover,
.document-binder-item-trash:hover {
  color: var(--c-danger-700);
  border-color: var(--c-danger-200);
}

.project-dashboard-doc:hover {
  background: var(--c-gray-50);
}

.project-dashboard-doc-title {
  font-family: var(--font-prose);
  font-size: 0.9375rem;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.project-dashboard-doc-meta {
  flex-shrink: 0;
  font-size: 0.78125rem;
  color: var(--c-gray-500);
  font-variant-numeric: tabular-nums;
}

/* The add row mirrors the drawer's: quiet text buttons, one per type. */
.project-dashboard-add {
  display: flex;
  gap: 0.75rem;
  margin-top: 0.75rem;
}

.project-dashboard-add-button {
  border: 0;
  background: transparent;
  padding: 0.25rem 0.25rem;
  font-size: 0.8125rem;
  color: var(--c-gray-500);
  cursor: pointer;
  transition: color var(--t-fast);
}

.project-dashboard-add-button:hover,
.project-dashboard-add-button:focus-visible {
  color: var(--c-accent);
}


/* ============================================================================
   The making of, at project scale. Collapsed by default: it is something a
   writer opens between sittings, not a number the dashboard shouts. Shares its
   voice with the editor's panel via core/story_phrases.
   ============================================================================ */

.project-dashboard-story {
  margin: 0 0 1.5rem;
  padding: 0.75rem 0 0;
  border-top: 1px solid var(--c-gray-200);
}

.project-dashboard-story > summary {
  cursor: pointer;
  font-size: 0.875rem;
  color: var(--c-gray-600);
}

.project-dashboard-story[open] > summary {
  margin-bottom: 1rem;
  color: var(--c-gray-800);
}

.project-story-headline {
  margin: 0 0 0.75rem;
  font-family: var(--font-serif, Georgia, serif);
  font-size: 1.0625rem;
  line-height: 1.45;
  color: var(--c-gray-900);
}

.project-story-note {
  margin: 0 0 0.75rem;
  font-size: 0.8125rem;
  color: var(--c-gray-600);
}

.project-story-figures {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr));
  gap: 0.5rem 1.5rem;
  margin: 0 0 1.25rem;
  padding: 0.75rem 0;
  border-top: 1px solid var(--c-gray-200);
  border-bottom: 1px solid var(--c-gray-200);
  font-size: 0.8125rem;
}

.project-story-figure {
  min-width: 0;
}

.project-story-figures dt {
  color: var(--c-gray-600);
}

.project-story-figures dd {
  margin: 0.1rem 0 0;
  font-variant-numeric: tabular-nums;
  font-size: 0.9375rem;
  color: var(--c-gray-900);
}

.project-story-standout {
  margin: 0 0 1.25rem;
  font-family: var(--font-serif, Georgia, serif);
  font-size: 0.9375rem;
  color: var(--c-gray-800);
}

.project-story-sessions {
  margin: 0 0 1.25rem;
  padding: 0;
  list-style: none;
}

/* Three columns here, unlike the editor's two: the dashboard is wide enough to
   name which pieces a sitting touched, which is the detail a novelist
   recognises. The titles truncate before the figure does. */
.project-story-session {
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr);
  align-items: baseline;
  gap: 0 1rem;
  padding: 0.35rem 0;
  font-size: 0.8125rem;
  border-bottom: 1px solid var(--c-gray-200);
}

.project-story-session-when {
  color: var(--c-gray-700);
  white-space: nowrap;
}

.project-story-session-change {
  font-variant-numeric: tabular-nums;
  color: var(--c-gray-900);
  white-space: nowrap;
}

/* Cutting is work, so it is muted rather than alarmed — never danger red. */
.project-story-session-change.is-cut {
  color: var(--c-gray-500);
}

.project-story-session-detail {
  color: var(--c-gray-500);
}

.project-story-session-where {
  color: var(--c-gray-500);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.project-story-documents {
  margin: 0 0 1.25rem;
  padding: 0;
  list-style: none;
}

.project-story-document {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: baseline;
  gap: 0 1rem;
  padding: 0.3rem 0;
  font-size: 0.8125rem;
}

.project-story-document-title {
  color: var(--c-gray-800);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.project-story-document-words {
  font-variant-numeric: tabular-nums;
  color: var(--c-gray-900);
  white-space: nowrap;
}

.project-story-document-sessions {
  color: var(--c-gray-500);
  white-space: nowrap;
}

/* The divider a writer can stop at: mechanics below, story above. */
.project-story-receipts {
  font-size: 0.75rem;
  color: var(--c-gray-600);
}

.project-story-receipts summary {
  cursor: pointer;
  color: var(--c-gray-500);
}

.project-story-receipts p {
  margin: 0.5rem 0 0;
  line-height: 1.5;
  max-width: 62ch;
}

}
