/* The Profile reads as a document: section titles and bulleted sentences,
 * nothing boxed. A bullet's evidence dates are one quiet line of small grey
 * text under it, each date a whole token (never broken at its hyphen) and a
 * link to its Day. The only control on a bullet is its ellipsis, and on a
 * pointer that can hover it shows only when the bullet is under it or holds
 * focus; everything else — Corrections, Add a correction, Earlier versions —
 * sits quietly at the foot.
 */

/* An empty status line (the latest version says nothing) is no gap above the
 * document; it stays rendered, so its live region still announces. */
#profile-status:empty {
  min-height: 0;
  margin: 0;
}

.profile-content {
  display: grid;
  gap: 1.75rem;
  max-width: 46rem;
}

.profile-section-title {
  margin: 0 0 0.5rem;
  color: var(--ink);
  font-size: 1.05rem;
  font-weight: 650;
  letter-spacing: -0.01em;
}

.profile-bullets {
  display: grid;
  gap: 0.7rem;
  margin: 0;
  padding: 0 0 0 1.2rem;
  list-style: disc;
}

.profile-bullet::marker {
  color: var(--ink-ghost);
}

/* Room at the end of the line for the ellipsis, which sits there out of flow. */
.profile-bullet-actionable {
  position: relative;
  padding-right: 2rem;
}

.profile-text {
  margin: 0;
  color: var(--ink);
  font-size: 0.95rem;
  line-height: 1.7;
  overflow-wrap: anywhere;
}

.profile-text strong {
  font-weight: 650;
}

.profile-text code {
  padding: 0.1em 0.35em;
  border-radius: 0.35rem;
  background: var(--chip);
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace;
  font-size: 0.9em;
}

/* Flex items, so the line breaks only between dates. */
.profile-evidence {
  display: flex;
  flex-wrap: wrap;
  column-gap: 0.55rem;
  margin: 0.1rem 0 0;
  color: var(--ink-muted);
  font-size: 0.75rem;
  font-variant-numeric: tabular-nums;
  line-height: 1.5;
}

.profile-evidence-day {
  color: inherit;
  white-space: nowrap;
}

a.profile-evidence-day:hover {
  color: var(--ink);
}

.profile-evidence-day-unlinked {
  color: var(--ink-ghost);
}

/* A bullet's or a Correction's ellipsis: borderless, at the end of its first line. */
.profile-menu-toggle {
  position: absolute;
  top: 0;
  right: 0;
  width: 1.75rem;
  height: 1.75rem;
  border-color: transparent;
  background: transparent;
}

@media (hover: hover) {
  .profile-bullet .profile-menu-toggle {
    opacity: 0;
  }

  .profile-bullet:hover .profile-menu-toggle,
  .profile-bullet .profile-menu-toggle:focus-visible,
  .profile-bullet:has(:popover-open) .profile-menu-toggle {
    opacity: 1;
  }
}

/* ---------------------------------------------------------------- the gate */

.profile-gate-lead,
.profile-gate-hint {
  margin: 0 0 0.8rem;
  color: var(--ink-muted);
  font-size: 0.88rem;
  line-height: 1.6;
}

.profile-gate {
  display: grid;
  gap: 0.4rem;
  margin: 0 0 1rem;
  padding: 0;
  list-style: none;
}

.profile-gate-input {
  padding: 0.75rem 1rem;
  border: 1px solid var(--border);
  border-radius: 0.8rem;
  background: var(--paper);
  color: var(--ink);
  font-size: 0.9rem;
}

.profile-gate-short {
  border-color: var(--border-firm);
  font-weight: 600;
}

/* ---------------------------------------------------------------- the foot */

/* Your corrections (N), Add a correction, Earlier versions: one quiet line
 * each, under the document. */
.profile-foot {
  display: grid;
  gap: 0.25rem;
  max-width: 46rem;
  margin-top: 2.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.profile-foot .status:empty {
  display: none;
}

.profile-foot .status {
  margin: 0;
}

.profile-foot-action {
  justify-self: start;
  padding-left: 0;
}

.profile-fold > summary {
  width: max-content;
  max-width: 100%;
  padding: 0.4rem 0;
  color: var(--ink-muted);
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
}

.profile-fold > summary:hover {
  color: var(--ink);
}

.profile-fold > summary:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--signal) 25%, transparent);
  outline-offset: 2px;
}

.profile-versions {
  max-width: 46rem;
  margin-top: 0.25rem;
}

.profile-versions[open] {
  display: grid;
  justify-items: start;
  gap: 0.35rem;
}

.profile-versions select {
  max-width: 100%;
}

/* Corrections: one form at a time, under the bullet it quotes or at the foot. */

.profile-correction-slot:empty {
  display: none;
}

/* Under a bullet the form takes back the ellipsis's room. */
.profile-bullet-actionable > .profile-correction-slot {
  margin-right: -2rem;
}

.profile-correction-form {
  display: grid;
  gap: 0.6rem;
  margin-top: 0.6rem;
  padding: 0.9rem 1rem;
  border: 1px solid var(--border-firm);
  border-radius: 0.9rem;
  background: var(--paper);
}

.profile-correction-lead,
.profile-correction-meta {
  margin: 0;
  color: var(--ink-muted);
  font-size: 0.78rem;
  font-weight: 600;
}

.profile-correction-quote {
  margin: 0;
  padding-left: 0.75rem;
  border-left: 3px solid var(--border-firm);
  color: var(--ink-soft);
  font-size: 0.88rem;
  line-height: 1.6;
  overflow-wrap: anywhere;
}

.profile-correction-quote p {
  margin: 0;
}

.profile-correction-label {
  display: grid;
  gap: 0.35rem;
  color: var(--ink);
  font-size: 0.82rem;
  font-weight: 600;
}

.profile-correction-input {
  width: 100%;
  min-height: 4.5rem;
  padding: 0.6rem 0.8rem;
  border: 1px solid var(--border-firm);
  border-radius: 0.7rem;
  color: inherit;
  background: var(--paper);
  font: inherit;
  font-size: 0.9rem;
  font-weight: 400;
  line-height: 1.5;
  resize: vertical;
}

.profile-correction-input:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--signal) 25%, transparent);
  outline-offset: 2px;
}

.profile-correction-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.profile-correction-form .error:empty {
  display: none;
}

.profile-corrections-lead {
  margin: 0.2rem 0 0.6rem;
  color: var(--ink-muted);
  font-size: 0.8rem;
  line-height: 1.6;
}

.profile-corrections-list {
  display: grid;
  gap: 0.9rem;
  margin: 0 0 0.6rem;
  padding: 0;
  list-style: none;
}

.profile-correction {
  position: relative;
  display: grid;
  gap: 0.3rem;
  padding-right: 2rem;
}

.profile-correction-text {
  margin: 0;
  color: var(--ink);
  font-size: 0.9rem;
  line-height: 1.6;
  overflow-wrap: anywhere;
  white-space: pre-line;
}

.profile-correction-bare {
  color: var(--ink-muted);
}
