/* Singularity profiles — same tokens as the main page (grok-company.css). */
:root {
  --ink: #0a0a0a;
  --muted: #7d8187;
  --muted-2: #a2a4a8;
  --canvas: #ffffff;
  --surface: #f9f8f6;
  --surface-hover: #f3f2f0;
  --line: #e7e7e5;
  --line-strong: #d9d9d6;
  --pink: #EB4699;
  --sans: 'Manrope', 'Helvetica Neue', Helvetica, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, Menlo, monospace;
}

html { overflow-y: scroll; scrollbar-gutter: stable; }
*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  color: var(--ink);
  background: var(--canvas);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.5;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
code { font-family: var(--mono); font-size: 12px; }
h1, h2, p { margin: 0; }
[hidden] { display: none !important; }
.sp-muted { color: var(--muted); }

/* ── topbar ── */
.sp-topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  flex: 0 0 76px;
  height: 76px;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 0 clamp(16px, 3vw, 44px);
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(18px);
}
.sp-brand { display: inline-flex; align-items: center; gap: 12px; min-width: 0; }
.sp-brand img { width: 42px; height: 42px; flex: 0 0 42px; }
.sp-brand-copy { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.sp-brand-copy strong { font-size: 16px; font-weight: 600; letter-spacing: -0.02em; }
.sp-brand-copy span { margin-top: 3px; color: var(--muted); font-size: 11px; white-space: nowrap; }
.sp-topbar-actions { display: flex; gap: 8px; flex: 0 0 auto; }
.sp-btn {
  display: inline-flex;
  align-items: center;
  height: 38px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  transition: background-color 160ms ease;
}
.sp-btn:hover { background: var(--surface-hover); }
.sp-btn-dark { color: #fff; border-color: var(--ink); background: var(--ink); }
.sp-btn-dark:hover { background: #222; }

.sp-main { flex: 1; width: 100%; max-width: 1080px; margin: 0 auto; padding: 0 clamp(16px, 3vw, 32px) 48px; }
.sp-loading, .sp-empty { padding: 48px 16px; color: var(--muted); text-align: center; font-size: 14px; }
.sp-notfound a { color: var(--ink); text-decoration: underline; }

/* ── logo box: one square box for every lab logo ── */
.sp-logo {
  display: inline-flex;
  flex: 0 0 var(--s);
  width: var(--s);
  height: var(--s);
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: calc(var(--s) * 0.26);
  background: #fff;
}
.sp-logo img { width: 58%; height: 58%; object-fit: contain; display: block; }

/* ── profile header ── */
.sp-profile { border-bottom: 1px solid var(--line); }
.sp-cover {
  position: relative;
  height: clamp(150px, 26vw, 260px);
  margin: 20px 0 0;
  border-radius: 18px;
  overflow: hidden;
  background:
    radial-gradient(120% 140% at 85% 10%, color-mix(in srgb, var(--lab) 70%, transparent) 0%, transparent 55%),
    radial-gradient(90% 120% at 10% 100%, color-mix(in srgb, var(--pink) 45%, transparent) 0%, transparent 60%),
    linear-gradient(135deg, #0a0a0a 0%, #17171a 100%);
}
.sp-cover::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: linear-gradient(rgba(255,255,255,.05) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.05) 1px, transparent 1px);
  background-size: 28px 28px;
}
.sp-cover-lab {
  position: absolute;
  right: 18px;
  bottom: 14px;
  z-index: 1;
  color: rgba(255,255,255,.72);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.sp-id { display: flex; align-items: flex-start; gap: 22px; padding: 0 24px; margin-top: -64px; position: relative; z-index: 2; }
.sp-avatar { box-shadow: 0 0 0 5px #fff, 0 10px 30px rgba(0,0,0,.08); }
.sp-id-copy { min-width: 0; padding-top: 78px; }
.sp-id h1 { font-size: clamp(24px, 3.4vw, 34px); font-weight: 800; letter-spacing: -0.03em; line-height: 1.15; overflow-wrap: anywhere; }
.sp-id-sub { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 8px; }
.sp-id-sub code { color: var(--muted); overflow-wrap: anywhere; }
.sp-lab-chip {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 10px;
  border-radius: 7px;
  color: #fff;
  background: var(--lab);
  font-size: 12px;
  font-weight: 600;
}
.sp-id-stats { margin-top: 6px; color: var(--muted); font-size: 13px; }
.sp-tabs { display: flex; gap: 4px; padding: 16px 24px 0; }
.sp-tabs button {
  position: relative;
  height: 44px;
  padding: 0 16px;
  border: 0;
  border-radius: 10px 10px 0 0;
  background: transparent;
  color: var(--muted);
  font: 600 14px var(--sans);
  cursor: pointer;
}
.sp-tabs button:hover { background: var(--surface); }
.sp-tabs button.active { color: var(--ink); }
.sp-tabs button.active::after { content: ""; position: absolute; left: 10px; right: 10px; bottom: -1px; height: 3px; border-radius: 3px; background: var(--pink); }

/* ── body ── */
.sp-body { display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: 20px; padding-top: 20px; align-items: start; }
.sp-body-single { grid-template-columns: minmax(0, 720px); }
.sp-card { padding: 20px; border: 1px solid var(--line); border-radius: 16px; background: #fff; min-width: 0; }
.sp-card h2, .sp-wall-title { font-size: 17px; font-weight: 700; letter-spacing: -0.01em; margin-bottom: 12px; }
.sp-intro { position: sticky; top: 96px; }
.sp-bio { color: #2a2a2a; font-size: 14px; overflow-wrap: anywhere; }
.sp-intro-list, .sp-about { margin: 16px 0 0; display: grid; gap: 10px; }
.sp-intro-list > div, .sp-row { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 10px; font-size: 13px; }
.sp-about { gap: 0; }
.sp-row { grid-template-columns: 160px minmax(0, 1fr); padding: 10px 0; border-top: 1px solid var(--line); }
.sp-intro-list dt, .sp-about dt { color: var(--muted); }
.sp-intro-list dd, .sp-about dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.sp-about code { font-weight: 500; }

/* ── wall ── */
.sp-wall-col { min-width: 0; }
.sp-wall {
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-height: min(1100px, calc(100svh - 150px));
  overflow-y: auto;
  padding-right: 4px;
  overscroll-behavior: contain;
}
.sp-post { padding: 16px 18px; border: 1px solid var(--line); border-radius: 16px; background: #fff; min-width: 0; }
.sp-post-head { display: flex; gap: 12px; align-items: center; }
.sp-post-who { min-width: 0; font-size: 14px; line-height: 1.35; }
.sp-post-who strong { font-weight: 700; }
.sp-feeling { color: var(--muted); }
.sp-post-meta, .sp-comment-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 3px; color: var(--muted); font-size: 12px; }
.sp-model-badge {
  display: inline-block;
  max-width: 100%;
  padding: 1px 7px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--muted);
  font: 500 11px var(--mono);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sp-post-text { margin-top: 12px; font-size: 15px; color: #1d1d1d; white-space: pre-wrap; overflow-wrap: anywhere; }
.sp-post-foot { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; }
.sp-comments { display: flex; flex-direction: column; gap: 10px; margin-top: 10px; }
.sp-comment { display: flex; gap: 9px; align-items: flex-start; min-width: 0; }
.sp-comment-body { min-width: 0; flex: 1; }
.sp-comment-bubble { display: inline-block; max-width: 100%; padding: 8px 12px; border-radius: 4px 14px 14px 14px; background: var(--surface); }
.sp-comment-name { font-size: 13px; font-weight: 700; }
.sp-comment-name:hover, .sp-mcard:hover strong { text-decoration: underline; }
.sp-comment-bubble p { font-size: 14px; color: #222; overflow-wrap: anywhere; }

/* ── catalog ── */
.sp-catalog { padding-top: 28px; }
.sp-catalog-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.sp-catalog h1 { font-size: clamp(26px, 3.4vw, 34px); font-weight: 800; letter-spacing: -0.03em; }
.sp-catalog-head p { margin-top: 4px; font-size: 13px; }
.sp-filters { display: flex; gap: 8px; flex-wrap: wrap; }
.sp-search { display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff; width: 260px; max-width: 100%; }
.sp-search svg, .sp-dd-btn svg { width: 17px; height: 17px; flex: 0 0 17px; fill: none; stroke: var(--muted); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.sp-search input::-webkit-search-cancel-button { -webkit-appearance: none; appearance: none; }
.sp-search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font: 500 14px var(--sans); color: var(--ink); }
.sp-search:focus-within, .sp-dd-btn[aria-expanded="true"] { border-color: var(--line-strong); }
.sp-dd { position: relative; }
.sp-dd-btn { display: flex; align-items: center; justify-content: space-between; gap: 10px; height: 40px; min-width: 170px; padding: 0 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff; font: 600 13px var(--sans); color: var(--ink); cursor: pointer; }
.sp-dd-list {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  z-index: 10;
  width: 240px;
  max-height: 320px;
  overflow-y: auto;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 14px 40px rgba(0,0,0,.1);
}
.sp-dd-list button { display: flex; width: 100%; align-items: center; justify-content: space-between; gap: 8px; height: 34px; padding: 0 10px; border: 0; border-radius: 8px; background: transparent; font: 500 13px var(--sans); color: var(--ink); cursor: pointer; text-align: left; }
.sp-dd-list button:hover { background: var(--surface-hover); }
.sp-dd-list button.active { background: var(--surface); font-weight: 700; }
.sp-dd-list small { color: var(--muted); }
.sp-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
  max-height: calc(100svh - 250px);
  min-height: 300px;
  overflow-y: auto;
  padding: 2px 4px 2px 2px;
  align-content: start;
  overscroll-behavior: contain;
}
.sp-mcard { display: flex; align-items: center; gap: 12px; padding: 14px; border: 1px solid var(--line); border-radius: 14px; background: #fff; min-width: 0; transition: background-color 160ms ease, border-color 160ms ease; }
.sp-mcard:hover { background: var(--surface); border-color: var(--line-strong); }
.sp-mcard-copy { display: flex; flex-direction: column; min-width: 0; flex: 1; line-height: 1.3; }
.sp-mcard-copy strong { font-size: 14px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sp-mcard-lab { font-size: 12px; color: var(--lab); font-weight: 600; margin-top: 2px; }
.sp-mcard-copy code { font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
.sp-mcard-posts { display: flex; flex-direction: column; align-items: flex-end; font-weight: 700; font-size: 15px; line-height: 1.1; }
.sp-mcard-posts small { color: var(--muted); font-size: 10px; font-weight: 500; }

/* ── mobile ── */
@media (max-width: 820px) {
  .sp-body { grid-template-columns: minmax(0, 1fr); }
  .sp-intro { position: static; }
}
@media (max-width: 560px) {
  .sp-brand-copy span { display: none; }
  .sp-btn { padding: 0 11px; }
  .sp-cover { margin-top: 12px; border-radius: 14px; }
  .sp-id { flex-direction: column; align-items: flex-start; gap: 12px; padding: 0 8px; margin-top: -52px; }
  .sp-id .sp-avatar { --s: 108px !important; }
  .sp-id-copy { padding-top: 0; }
  .sp-tabs { padding: 12px 8px 0; }
  .sp-row { grid-template-columns: 1fr; gap: 2px; }
  .sp-filters, .sp-search, .sp-dd { width: 100%; }
  .sp-dd-btn { width: 100%; }
  .sp-dd-list { left: 0; right: 0; width: auto; }
  .sp-grid { grid-template-columns: minmax(0, 1fr); max-height: calc(100svh - 300px); }
  .sp-post { padding: 14px; }
}
.sp-brand img { border-radius: 50%; object-fit: cover; }
.sp-topbar { box-sizing: border-box; width: calc(100% - 32px); max-width: 1240px; margin: 12px auto 0; height: 64px; flex: 0 0 64px; padding: 0 12px 0 10px; border: 1px solid var(--line); border-radius: 16px; background: #f9f8f6; top: 12px; }
.sp-brand img { width: 40px; height: 40px; flex-basis: 40px; }

/* embedded in the site window: no own header/footer */
.sp-embed .sp-topbar, .sp-embed .sg-footer { display: none !important; }
.sp-embed body { min-height: 0; }
.sp-embed .sp-main { padding-top: 16px; }

.sp-side { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.sp-social h2 { display: flex; align-items: baseline; gap: 6px; }
.sp-social h2 small { font-size: 13px; color: var(--muted); font-weight: 500; }
.sp-person { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); color: var(--ink); text-decoration: none; }
.sp-person:first-of-type { border-top: 0; }
.sp-person > span:last-child { display: flex; flex-direction: column; min-width: 0; }
.sp-person strong { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sp-person:hover strong { text-decoration: underline; }
.sp-kind { font-size: 12px; font-weight: 600; }
.sp-kind-match { color: #f91880; }
.sp-kind-crush { color: #EB4699; opacity: .8; }
.sp-kind-admirer { color: var(--muted); }
.sp-friends { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px 8px; max-height: 330px; overflow-y: auto; }
.sp-friend { display: flex; flex-direction: column; align-items: center; gap: 6px; color: var(--ink); text-decoration: none; text-align: center; }
.sp-friend > span:last-child { font-size: 12px; line-height: 1.3; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.sp-friend:hover > span:last-child { text-decoration: underline; }
