/* ==========================================================================
 * Persona Modal — matches docs/persona-switcher.html byte-for-byte.
 *
 * All design tokens come from :root in src/index.css (--cream-1, --ink-1,
 * --red-1, etc.). Avatar shades and dashed-border token (--rule-3,
 * --persona-marco, --persona-anna) were added in Phase 1.
 * ========================================================================== */

.pm-backdrop {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(31, 20, 16, 0.18);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.pm-card {
  width: 100%;
  max-width: 540px;
  background: var(--cream-1);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 30px 80px -20px rgba(31, 20, 16, 0.40), 0 0 0 1px var(--rule-1);
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 32px);
}

/* ---- Head ----------------------------------------------------- */
.pm-head {
  padding: 26px 28px 18px;
  border-bottom: 1px solid var(--rule-1);
  position: relative;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  flex-shrink: 0;
}
.pm-head::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 28px;
  width: 28px;
  height: 1px;
  background: var(--red-1);
}

.pm-eyebrow {
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--red-1);
  margin-bottom: 8px;
  font-weight: 500;
}
.pm-title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 30px;
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin-bottom: 6px;
  color: var(--ink-1);
}
.pm-title em { font-style: normal; }
.pm-sub {
  font-family: var(--sans);
  font-style: normal;
  font-weight: 400;
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink-3);
}
.pm-close {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: transparent;
  border: none;
  color: var(--ink-3);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 150ms;
}
.pm-close:hover {
  background: rgba(31, 20, 16, 0.06);
  color: var(--ink-1);
}

/* ---- List ----------------------------------------------------- */
.pm-list {
  padding: 18px 22px 22px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow-y: auto;
  flex: 1 1 auto;
  min-height: 0;
}

.pm-card-btn {
  background: transparent;
  border: 1px solid var(--rule-2);
  border-radius: 12px;
  padding: 14px 16px;
  cursor: pointer;
  text-align: left;
  width: 100%;
  display: grid;
  grid-template-columns: 44px 1fr auto;
  gap: 14px;
  align-items: center;
  transition: all 180ms ease;
  font-family: inherit;
}
.pm-card-btn:hover {
  border-color: var(--ink-1);
  background: var(--cream-elev);
}
.pm-card-btn:hover .pm-arrow {
  color: var(--red-1);
  transform: translateX(2px);
}
.pm-card-btn.active {
  border-color: var(--red-1);
  background: var(--cream-elev);
  box-shadow: 0 0 0 1px var(--red-1);
}
.pm-card-btn.active .pm-arrow {
  color: var(--red-1);
}
.pm-card-btn:disabled {
  cursor: wait;
  opacity: 0.7;
}

.pm-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--ink-1);
  color: var(--cream-1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  font-size: 20px;
  letter-spacing: -0.01em;
  flex-shrink: 0;
}
.pm-avatar.fresh {
  background: transparent;
  color: var(--ink-3);
  border: 1px dashed var(--rule-3);
}
.pm-avatar.marco { background: var(--persona-marco); }
.pm-avatar.anna { background: var(--persona-anna); }

.pm-content {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.pm-name-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
}
.pm-name {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 18px;
  letter-spacing: -0.005em;
  color: var(--ink-1);
}
.pm-name em { font-style: normal; font-weight: 400; }
.pm-tag {
  font-family: var(--sans);
  font-size: 9.5px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--red-1);
  padding: 2px 7px;
  border: 1px solid rgba(168, 66, 58, 0.4);
  border-radius: 3px;
}
.pm-tag.fresh {
  color: var(--ink-4);
  border-color: var(--rule-2);
}
.pm-blurb {
  font-family: var(--sans);
  font-style: normal;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--ink-3);
  margin-top: 3px;
}

.pm-meta-row {
  display: flex;
  align-items: baseline;
  gap: 14px;
  margin-top: 8px;
}
.pm-meta-item {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.05em;
  color: var(--ink-4);
}
.pm-meta-item .num {
  color: var(--ink-1);
  font-weight: 500;
}

.pm-arrow {
  color: var(--ink-4);
  font-family: var(--mono);
  font-size: 14px;
  flex-shrink: 0;
  transition: all 180ms;
}

/* ---- Sign out row ----------------------------------------------- */
.pm-signout {
  align-self: flex-start;
  font-family: var(--sans);
  font-size: 12px;
  color: var(--ink-4);
  background: transparent;
  border: none;
  cursor: pointer;
  margin-top: 4px;
  padding: 4px 0;
  transition: opacity 150ms;
}
.pm-signout:hover { opacity: 0.7; }

/* ---- Foot ------------------------------------------------------- */
.pm-foot {
  padding: 14px 28px 18px;
  border-top: 1px solid var(--rule-1);
  background: var(--cream-2);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-shrink: 0;
}
.pm-foot-text {
  font-family: var(--sans);
  font-style: normal;
  font-size: 12.5px;
  color: var(--ink-3);
  line-height: 1.5;
}
.pm-foot-text em {
  color: var(--ink-1);
  font-weight: 500;
  font-style: normal;
}
.pm-foot-meta {
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-4);
}
