/* ==========================================================================
   SkipBoard v2 — Me hub
   Also owns the shared chrome for the Me sub-pages: Settings and Account &
   backup both render inside .screen-me, so .sub-head / .group-label live here.
   ========================================================================== */

/* ------------------------- Me sub-page chrome --------------------------- */
/* Back arrow + title row used by Settings and Account & backup. */
.screen-me .sub-head {
  align-items: center;
  gap: var(--s-1);
  padding: var(--s-3) var(--gutter) var(--s-2);
}
.screen-me .sub-head .page-head-text {
  flex: 1;
  min-width: 0;
  padding-left: var(--s-1);
}
.screen-me .sub-head h1 {
  font-size: clamp(24px, 5.4vw, 30px);
  overflow-wrap: anywhere;
}
.screen-me .sub-head .subhead {
  font-size: var(--t-13);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: color var(--dur-1) var(--ease);
}
.screen-me .sub-head .subhead[data-kind='saved'] { color: var(--accent); font-weight: 600; }
.screen-me .sub-head .subhead[data-kind='error'] { color: var(--danger); font-weight: 600; }

/* Small uppercase label above a group of rows/sections. */
.screen-me .group-label {
  margin: 0 2px var(--s-2);
  font-size: var(--t-11);
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--faint);
}

/* -------------------------------- Hub ----------------------------------- */
.me-head h1 { overflow-wrap: anywhere; }

.me-page { gap: var(--s-4); }
.me-col { display: flex; flex-direction: column; gap: var(--s-4); }
.me-col:empty { display: none; }

/* Identity card ---------------------------------------------------------- */
.me-id { padding: var(--s-5); position: relative; }
.me-edit { position: absolute; top: 8px; right: 8px; z-index: 2; }
.me-id-row {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  padding-right: 40px;
}
.me-avatar {
  width: 64px;
  height: 64px;
  font-size: var(--t-24);
  border: 1px solid var(--accent-line);
  box-shadow: inset 0 0 0 3px var(--surface);
}
.me-id-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.me-id-text h2 {
  font-family: var(--font-display);
  font-size: var(--t-24);
  font-weight: 650;
  letter-spacing: -0.02em;
  line-height: 1.12;
  overflow-wrap: anywhere;
}
.me-id-text p {
  font-size: var(--t-15);
  color: var(--muted);
  overflow-wrap: anywhere;
}

/* Activity stats — thin dividers, tabular numbers. */
.me-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--s-2);
  margin-top: var(--s-5);
  padding-top: var(--s-4);
  border-top: 1px solid var(--line-soft);
}
.me-stat { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.me-stat + .me-stat { padding-left: var(--s-3); border-left: 1px solid var(--line-soft); }
.me-stat-value {
  font-family: var(--font-display);
  font-size: var(--t-24);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}
.me-stat-label {
  font-size: var(--t-11);
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--faint);
}

/* Current job site strip inside the card. */
.me-site {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  min-height: 52px;
  margin-top: var(--s-3);
  padding: 8px 12px;
  border-radius: var(--r-sm);
  background: var(--surface-2);
  color: var(--muted);
  text-decoration: none;
}
.me-site > svg:first-child { color: var(--accent); flex-shrink: 0; }
.me-site-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.me-site-text small {
  font-size: var(--t-11);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--faint);
}
.me-site-text strong {
  font-size: var(--t-15);
  font-weight: 600;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.me-site:hover { background: var(--surface-3); }

/* Appearance ------------------------------------------------------------- */
.me-appearance { padding: var(--s-5); }
.me-appearance .card-head { align-items: baseline; }
.me-appearance .card-head h2 {
  font-family: var(--font-display);
  font-size: var(--t-20);
  font-weight: 650;
  letter-spacing: -0.02em;
}
.me-page .theme-seg {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 4px;
  margin: var(--s-3) 0 var(--s-2);
  padding: 4px;
  border-radius: var(--r-pill);
  background: var(--surface-2);
}
.me-page .theme-seg button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 48px;
  padding: 0 6px;
  border: 0;
  border-radius: var(--r-pill);
  background: transparent;
  color: var(--muted);
  font-size: var(--t-13);
  font-weight: 600;
}
.me-page .theme-seg button:hover { color: var(--text); }
.me-page .theme-seg button[aria-checked='true'] {
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--e-1);
}
.me-page .theme-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
  border: 1px solid var(--line);
}
/* The only fixed colours outside paper artefacts: each dot must show the
   theme it selects, including the two themes that are not active right now. */
.me-page .theme-dot[data-dot='paper'] { background: #fbfaf5; }
.me-page .theme-dot[data-dot='forest'] { background: #0e1513; border-color: #2a3833; }
.me-page .theme-dot[data-dot='sunlight'] { background: #ffffff; border-color: #7c877f; }
.me-page .theme-dot[data-dot='auto'] { background: linear-gradient(135deg, #fbfaf5 0 50%, #0e1513 50% 100%); border-color: #7c877f; }

/* Footer ----------------------------------------------------------------- */
.me-foot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: var(--s-4) 0 var(--s-6);
}
.me-foot-links { display: flex; align-items: center; gap: var(--s-2); }
.me-foot .link-btn { font-size: var(--t-13); }
.me-foot .hint { font-size: var(--t-11); color: var(--faint); }

/* ------------------------------ Desktop --------------------------------- */
@media (min-width: 900px) {
  .me-page {
    display: grid;
    grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
    gap: var(--s-6);
    align-items: start;
  }
  .me-col-main { position: sticky; top: var(--s-4); }
  .me-id { padding: var(--s-6); }
  .me-foot { align-items: flex-start; padding-bottom: var(--s-4); }
}
