/* Member page: sticky identity column, open ruled sections on the right. See DESIGN.md.
   Meter widths use the .wN classes from stats.css (inline styles are blocked by the CSP). */
.member-page { display: flex; flex-direction: column; gap: 40px; min-width: 0; padding-top: 8px; }
.member-page .swatch { width: 14px; height: 14px; border: 0; border-radius: var(--radius-sm); flex: none; background: var(--cls); }

/* Identity */
.m-side { display: flex; flex-direction: column; gap: 24px; min-width: 0; }
.m-back {
  display: inline-flex; align-items: center; gap: 8px; align-self: flex-start; min-height: 44px;
  font-size: var(--fs-sm); font-weight: 500; color: var(--muted); text-decoration: none; transition: color 0.12s ease;
}
.m-back:hover { color: var(--accent); }
.m-ident { display: flex; flex-direction: column; gap: 6px; }
.m-name {
  display: flex; align-items: center; gap: 12px;
  font: 800 var(--fs-3xl) / 1 var(--font-display); text-transform: uppercase; letter-spacing: 0.02em;
}
.m-line { font-size: var(--fs-sm); color: var(--muted); }
.m-status { display: flex; align-items: center; gap: 8px; font-size: var(--fs-sm); }
.mark { width: 8px; height: 8px; border-radius: var(--radius-sm); background: var(--faint); flex: none; }
.mark.is-active { background: var(--ok); }
.mark.is-quiet { background: var(--warn); }
.mark.is-inactive { background: var(--danger); }

.m-level { display: flex; flex-direction: column; gap: 0; padding-top: 16px; border-top: 1px solid var(--line-strong); }
.m-level-label { font-size: var(--fs-xs); color: var(--muted); }
.m-level-num { font: 800 5rem / 0.9 var(--font-display); letter-spacing: 0.01em; }
.m-gained { display: flex; gap: 32px; margin: 0; }
.m-gained dt, .m-facts dt { font-size: var(--fs-xs); color: var(--muted); }
.m-gain { font: 700 var(--fs-xl) / 1.1 var(--font-display); }
.m-facts { display: flex; flex-direction: column; margin: 0; border-top: 1px solid var(--line); }
.m-facts > div { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.m-facts dd { font-size: var(--fs-sm); font-weight: 500; text-align: right; }

/* Sections: ledger heading with a rule to the right edge */
.m-main { display: flex; flex-direction: column; gap: 56px; min-width: 0; }
.m-section { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.m-title {
  font: 800 var(--fs-xl) / 1 var(--font-display); text-transform: uppercase; letter-spacing: 0.02em;
  display: flex; align-items: center; gap: 16px;
}
.m-title::after { content: ""; flex: 1; height: 1px; background: var(--line-strong); }
.m-sub { margin-top: 12px; font-size: var(--fs-xs); color: var(--muted); }

/* Chart */
.m-chart { width: 100%; height: auto; display: block; }
.member-page .chart-grid { stroke: var(--line); stroke-dasharray: none; }
.member-page .chart-line { stroke: var(--accent); stroke-width: 2; stroke-linejoin: miter; }
.member-page .chart-dot { fill: var(--accent); stroke: none; }
.member-page .chart-text { font-size: 13px; fill: var(--muted); }

/* Meter rows */
.m-rows { display: flex; flex-direction: column; }
.m-row {
  display: grid; grid-template-columns: 1fr auto; column-gap: 16px; row-gap: 6px; align-items: baseline;
  padding: 10px 0 12px; border-bottom: 1px solid var(--line);
}
.m-row:first-child { padding-top: 0; }
.m-row-name { font-size: var(--fs-sm); color: var(--muted); }
.m-row-val { font: 700 var(--fs-lg) / 1 var(--font-display); letter-spacing: 0.02em; }
.m-row.is-main .m-row-name { color: var(--text); font-weight: 600; }
.m-meter { grid-column: 1 / -1; height: 6px; background: var(--surface-3); border-radius: var(--radius-sm); overflow: hidden; }
.m-fill { display: block; height: 100%; background: var(--muted); }
.m-row.is-main .m-fill { background: var(--text); }

/* Statistics grid: figure then guild rank */
.m-stats { display: grid; grid-template-columns: repeat(2, 1fr); margin: 0; border-top: 1px solid var(--line); }
.m-stat { padding: 12px 12px 12px 0; border-bottom: 1px solid var(--line); min-width: 0; }
.m-stat dt { font-size: var(--fs-xs); color: var(--muted); }
.m-stat dd { display: flex; flex-direction: column; gap: 2px; margin-top: 2px; }
.m-figure { font: 800 var(--fs-3xl) / 1 var(--font-display); letter-spacing: 0.02em; }
.m-rank { font-size: var(--fs-xs); color: var(--muted); }

/* Compact tables */
.m-table { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); }
.m-table th, .m-table td { text-align: left; padding: 7px 12px 7px 0; border-bottom: 1px solid var(--line); font-weight: 400; }
.m-table thead th { font-size: var(--fs-xs); color: var(--muted); border-bottom-color: var(--line-strong); }
.m-table tbody th { font-weight: 600; }
.m-table .num { text-align: right; padding-right: 0; padding-left: 12px; }
.m-table td:nth-child(2):not(.num) { color: var(--muted); }

/* States */
.member-page .state { border: 0; border-top: 1px solid var(--line); border-radius: 0; align-items: flex-start; text-align: left; padding: 16px 0; }
.member-page .skeleton { height: 120px; }

@media (max-width: 879px) {
  .member-page .chart-text { font-size: 20px; }
  .m-table { display: block; overflow-x: auto; }
}

@media (min-width: 600px) {
  .m-stats { grid-template-columns: repeat(4, 1fr); }
}

@media (min-width: 880px) {
  .member-page { display: grid; grid-template-columns: 340px minmax(0, 1fr); column-gap: 64px; align-items: start; }
  .m-side { position: sticky; top: 24px; }
  .m-name { font-size: 3rem; }
  .m-level-num { font-size: 6rem; }
  .m-back { min-height: 32px; }
  .member-page > .state { grid-column: 1 / -1; }
}
