:root{color-scheme:dark;--bg:#07101f;--panel:#0d192a;--panel2:#101f34;--line:#293f5d;--text:#edf4ff;--muted:#8ea2bc;--accent:#6f9cff;--good:#6ddaa2;--warn:#d6b36c}
*{box-sizing:border-box}html,body{margin:0;min-height:100%;background:var(--bg);color:var(--text);font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",system-ui,sans-serif}body{min-height:100vh}
.wrap{width:min(1180px,calc(100% - 28px));margin:0 auto;padding:18px 0 60px}.top{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:14px}.brand{display:flex;align-items:center;gap:9px;color:#c9d6e8;font-size:11px;font-weight:950;letter-spacing:.09em}.mark{width:32px;height:32px;border-radius:9px;background:#234879;display:grid;place-items:center;color:white}.readonly{padding:6px 9px;border:1px solid #36506f;border-radius:999px;color:#91a8c7;font-size:9px;font-weight:900}
.hero,.card{border:1px solid var(--line);border-radius:16px;background:var(--panel)}.hero{padding:22px}.eyebrow{font-size:10px;font-weight:950;color:var(--good);letter-spacing:.08em;margin-bottom:8px}h1{margin:0;font-size:clamp(26px,5vw,42px);line-height:1.12}.desc{margin-top:10px;color:var(--muted);line-height:1.65;white-space:pre-wrap}.meta{display:flex;gap:7px;flex-wrap:wrap;margin-top:15px}.pill{padding:6px 9px;border:1px solid #304967;border-radius:999px;background:#0a1627;color:#afc0d7;font-size:10px;font-weight:800}
.primaryActions{display:flex;gap:8px;flex-wrap:wrap;margin-top:16px}.actionBtn{min-height:42px;padding:0 15px;border-radius:10px;border:1px solid #3d6090;background:#17345c;color:#c6dbf8;font-weight:950;cursor:pointer}.actionBtn.primary{background:linear-gradient(180deg,#315fbb,#244990);border-color:#5d87d4;color:white}.actionBtn.remix{background:linear-gradient(180deg,#7454b6,#55378f);border-color:#8d6bd0}.actionBtn:disabled{opacity:.45;cursor:not-allowed}
.grid{display:grid;grid-template-columns:minmax(0,1fr) 300px;gap:14px;margin-top:14px}.card{padding:15px;min-width:0}.card h2{margin:0 0 11px;font-size:14px}.sectionHead{display:flex;align-items:flex-end;justify-content:space-between;gap:10px;margin-bottom:12px}.sectionHead h2{margin:0}.sectionSub{color:var(--muted);font-size:10px}
.tableWrap{overflow:auto;border:1px solid #263c58;border-radius:11px}table{width:100%;border-collapse:separate;border-spacing:0;min-width:620px;background:#091525}th,td{padding:9px 10px;border-right:1px solid #213652;border-bottom:1px solid #213652;font-size:11px;text-align:center}th{position:sticky;top:0;background:#12243b;color:#aec0d8;font-weight:900}th:first-child,td:first-child{position:sticky;left:0;text-align:left;background:#0e1c30;font-weight:900;z-index:1}th:first-child{z-index:2}td:last-child,th:last-child{border-right:0}tr:last-child td{border-bottom:0}.score{font-variant-numeric:tabular-nums;font-weight:850}.na{color:#50647f}.avg{color:#8fb2ff;font-weight:950}.diffPlus{color:#6edda4;font-weight:900}.diffMinus{color:#ff9898;font-weight:900}
.ranking{display:grid;gap:7px}.rankRow{display:grid;grid-template-columns:28px minmax(0,1fr) auto;align-items:center;gap:8px;padding:9px;border:1px solid #273c58;border-radius:10px;background:#0a1627}.rankNo{width:26px;height:26px;border-radius:7px;background:#1a2d48;display:grid;place-items:center;color:#9fb6d6;font-size:10px;font-weight:950}.rankName{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:11px;font-weight:850}.rankValue{font-size:12px;font-weight:950;color:#90b1ff}.criteria{display:flex;flex-wrap:wrap;gap:6px}.criteria span{padding:6px 8px;border-radius:8px;background:#13263e;border:1px solid #2c4667;color:#bdcbe0;font-size:9px;font-weight:800}
.notice{margin-top:14px;padding:11px 12px;border:1px solid #514729;border-radius:10px;background:#17150e;color:#c8b887;font-size:10px;line-height:1.6}.communityBlock{margin-top:14px}.communityHero{display:grid;grid-template-columns:140px minmax(0,1fr);gap:14px;align-items:center}.participantBox{display:grid;place-items:center;min-height:108px;border-radius:13px;background:#0a1728;border:1px solid #2d4869}.participantNumber{font-size:34px;font-weight:1000;line-height:1}.participantLabel{margin-top:5px;color:#8fa3bf;font-size:9px;font-weight:900}.privacyNote{color:#91a4bf;font-size:10px;line-height:1.55}.communityGrid{display:grid;grid-template-columns:300px minmax(0,1fr);gap:14px;margin-top:14px}.emptyCommunity{padding:24px;text-align:center;color:#7e92ad;font-size:11px;line-height:1.7}.status{padding:44px 14px;text-align:center;color:#91a3bb;white-space:pre-wrap}.hidden{display:none!important}.toast{position:fixed;left:50%;bottom:24px;transform:translateX(-50%);z-index:40;padding:10px 14px;border-radius:10px;background:#13243b;border:1px solid #3d5d83;color:#dbe8fb;font-size:11px;font-weight:850;box-shadow:0 16px 50px rgba(0,0,0,.35)}
@media(max-width:860px){.grid,.communityGrid{grid-template-columns:1fr}.wrap{width:min(100% - 18px,900px)}.communityHero{grid-template-columns:110px minmax(0,1fr)}}
@media(max-width:520px){.communityHero{grid-template-columns:1fr}.participantBox{min-height:90px}.primaryActions .actionBtn{flex:1 1 140px}}

/* ===== R19 P1 public-page polish ===== */
a{color:inherit}
.brand{text-decoration:none}
.top{position:sticky;top:0;z-index:20;padding:10px 0;background:linear-gradient(180deg,rgba(7,16,31,.98),rgba(7,16,31,.88) 78%,rgba(7,16,31,0));backdrop-filter:blur(10px)}
.hero{position:relative;overflow:hidden;padding:clamp(20px,4vw,34px);background:
  radial-gradient(circle at 88% 8%,rgba(111,156,255,.18),transparent 36%),
  linear-gradient(145deg,#101f34,#0b1728 72%)}
.hero:before{content:"";position:absolute;inset:0;pointer-events:none;background:linear-gradient(120deg,rgba(255,255,255,.025),transparent 38%)}
.hero>*{position:relative}
.heroTopline{display:flex;align-items:center;justify-content:space-between;gap:10px;flex-wrap:wrap;margin-bottom:10px}
.visibilityBadge{display:inline-flex;align-items:center;gap:7px;padding:7px 10px;border-radius:999px;border:1px solid #365577;background:#0b192a;color:#bed0e8;font-size:9px;font-weight:950;letter-spacing:.05em}
.visibilityBadge:before{content:"";width:7px;height:7px;border-radius:50%;background:var(--good);box-shadow:0 0 0 4px rgba(109,218,162,.09)}
.visibilityBadge.unlisted:before{background:var(--warn);box-shadow:0 0 0 4px rgba(214,179,108,.09)}
.visibilityBadge.private:before{background:#8290a5;box-shadow:0 0 0 4px rgba(130,144,165,.09)}
.updatedAt{color:#7187a5;font-size:9px;font-weight:800}
.hero h1{max-width:900px}
.heroScope{margin-top:12px;padding:9px 11px;border-left:3px solid #496f9f;background:rgba(6,14,25,.36);border-radius:0 9px 9px 0;color:#91a6c3;font-size:10px;line-height:1.55}
.summaryStrip{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:9px;margin-top:18px}
.summaryStat{min-width:0;padding:12px;border:1px solid #2b4564;border-radius:12px;background:rgba(8,19,33,.68)}
.summaryLabel{color:#7990af;font-size:8px;font-weight:950;letter-spacing:.08em;text-transform:uppercase}
.summaryValue{margin-top:6px;color:#f2f7ff;font-size:clamp(18px,3vw,26px);font-weight:1000;line-height:1.05;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.summaryValue.accent{color:#8fb2ff}
.summarySub{margin-top:4px;color:#7f95b2;font-size:8px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.primaryActions{margin-top:18px}
.actionBtn{display:inline-flex;align-items:center;justify-content:center;gap:7px;text-decoration:none;transition:transform .15s ease,border-color .15s ease,background .15s ease}
.actionBtn:active{transform:scale(.98)}
.actionBtn.owner{background:#122b47;border-color:#3d6d9f;color:#cde1f8}
.actionBtn.ghost{background:#0b1728;border-color:#304a69}
.card{box-shadow:0 14px 38px rgba(0,0,0,.12)}
.cardTitleRow{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-bottom:11px}
.cardTitleRow h2{margin:0}
.smallBadge{padding:5px 7px;border:1px solid #2f496a;border-radius:999px;color:#8299b7;font-size:8px;font-weight:900}
.rankRow:first-child{border-color:#705f2c;background:linear-gradient(90deg,rgba(180,145,52,.12),#0a1627)}
.rankRow:nth-child(2){border-color:#4a5668}
.rankRow:nth-child(3){border-color:#694d3d}
.criteria span.weightedMetric{display:inline-flex;gap:5px;align-items:center}
.criteria small{color:#7290b5;font-size:8px}
.tableWrap{scrollbar-width:thin;scrollbar-color:#294667 #091525}
.communityBlock{background:linear-gradient(180deg,#0f1e32,#0c1829)}
.ownerHint{margin-top:10px;color:#7088a8;font-size:9px}
.publicFooter{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-top:18px;padding:14px 2px;color:#657b97;font-size:9px}
.publicFooter a{color:#8faee2;font-weight:900;text-decoration:none}

@media(max-width:760px){
  .summaryStrip{grid-template-columns:1fr 1fr}
  .hero{padding:20px 16px}
  .top{padding-top:8px}
}
@media(max-width:520px){
  .wrap{width:calc(100% - 14px)}
  .summaryStrip{gap:7px}
  .summaryStat{padding:10px}
  .primaryActions{display:grid;grid-template-columns:1fr 1fr}
  .primaryActions .actionBtn{min-width:0;width:100%}
  .primaryActions .actionBtn.remix{grid-column:span 2}
  .primaryActions .actionBtn.owner{grid-column:span 2}
  .publicFooter{flex-direction:column;align-items:flex-start}
}

/* ===== R20 Community core ===== */
.privacyNote{display:flex;flex-direction:column;gap:6px}
.privacyNote b{color:#d6e3f5;font-size:11px}
.privacyNote span{color:#91a4bf;font-size:10px;line-height:1.6}
.rankName small{display:block;margin-top:3px;color:#6f86a5;font-size:8px;font-weight:800}
.metricSummaryGrid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
.metricSummaryCard{position:relative;padding:11px;border:1px solid #2b4564;border-radius:11px;background:#0a1728;min-width:0}
.metricSummaryName{color:#91a6c3;font-size:9px;font-weight:900;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.metricSummaryValue{margin-top:5px;color:#91b5ff;font-size:22px;font-weight:1000;line-height:1}
.metricSummaryScale{position:absolute;right:9px;bottom:9px;color:#617a9a;font-size:8px;font-weight:850}
.privacyLock{min-height:124px;display:grid;place-content:center;gap:7px;text-align:center;padding:16px;border:1px dashed #36506f;border-radius:12px;background:#091625}
.privacyLock b{color:#bed0e8;font-size:12px}
.privacyLock span{max-width:320px;color:#7188a7;font-size:9px;line-height:1.6}
.privacyLock.compact{min-height:124px}
.communityMatrix{margin-top:14px;padding-top:14px;border-top:1px solid #263d59}
.compareCommunityCard{margin-top:14px;background:#0c192a}
.communityGrid>section{min-width:0}
@media(max-width:520px){
  .metricSummaryGrid{grid-template-columns:1fr 1fr}
  .metricSummaryValue{font-size:19px}
}

/* ===== R21 P1 Remix lineage ===== */
.lineageBar{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-top:10px;padding:10px 11px;border:1px solid #493d68;border-radius:10px;background:rgba(31,24,51,.58)}
.lineageMain{min-width:0;display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.lineageLabel{color:#9d8fc7;font-size:8px;font-weight:950;letter-spacing:.09em;text-transform:uppercase}
.lineageSource{min-width:0;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:#d9cff1;font-size:10px;font-weight:950;text-decoration:none}
.lineageSource:hover{text-decoration:underline}
.lineageSource.unavailable{color:#766f89;font-weight:800}
.lineageBadge{flex:none;padding:5px 7px;border:1px solid #654f91;border-radius:999px;color:#bca8e7;font-size:8px;font-weight:950}
.actionCount{display:inline-grid;place-items:center;min-width:22px;height:20px;padding:0 6px;border-radius:999px;background:rgba(255,255,255,.12);font-size:8px;font-weight:950}
.remixNotice{display:flex;flex-direction:column;gap:4px;border-color:#4b3e68;background:#151124;color:#ad9fc8}
.remixNotice b{color:#e2d8f5;font-size:10px}
.remixNotice span{font-size:9px;line-height:1.55}
@media(max-width:520px){
  .lineageBar{align-items:flex-start}
  .lineageMain{display:grid;gap:4px}
}

/* ===== R22 P1 Discover navigation ===== */
.topRight{display:flex;align-items:center;gap:7px}
.discoverLink{display:inline-flex;align-items:center;justify-content:center;min-height:30px;padding:0 9px;border:1px solid #345577;border-radius:999px;background:#0b192a;color:#9fb9dc;font-size:8px;font-weight:950;letter-spacing:.08em;text-decoration:none}
.discoverLink:hover{border-color:#5278a8;color:#d7e6fb}
.footerLinks{display:flex;align-items:center;gap:12px}
@media(max-width:520px){
  .topRight{gap:5px}
  .discoverLink{padding:0 7px}
  .footerLinks{width:100%;justify-content:space-between}
}

/* ===== R23 P1 Social sharing ===== */
.actionBtn.shareImage{
  background:linear-gradient(180deg,#2d5da3,#21477f);
  border-color:#527fbd;
  color:#eef5ff;
}
.actionBtn.shareImage:disabled{opacity:.65;cursor:wait}
@media(max-width:520px){
  .primaryActions{grid-template-columns:1fr 1fr}
  .primaryActions .actionBtn.remix{grid-column:span 2}
  .primaryActions .actionBtn.owner{grid-column:span 2}
}

/* ===== R23 P2 Share image chooser ===== */
.shareImageBackdrop{
  position:fixed;
  inset:0;
  z-index:120;
  display:grid;
  place-items:center;
  padding:16px;
  background:rgba(2,8,18,.76);
  backdrop-filter:blur(7px);
}
.shareImageDialog{
  width:min(620px,100%);
  max-height:min(88dvh,760px);
  overflow:auto;
  padding:16px;
  border:1px solid #38577b;
  border-radius:18px;
  background:linear-gradient(180deg,#101f34,#0a1627);
  box-shadow:0 28px 80px rgba(0,0,0,.5);
}
.shareImageHead{display:flex;align-items:flex-start;justify-content:space-between;gap:12px}
.shareImageHead h2{margin:0;font-size:18px}
.shareImageClose{
  width:38px;height:38px;flex:none;border:1px solid #34506f;border-radius:10px;
  background:#102039;color:#e8f0fb;font-size:20px;cursor:pointer
}
.shareOptionGroup{margin-top:16px}
.shareOptionLabel{margin-bottom:7px;color:#8096b4;font-size:9px;font-weight:950;letter-spacing:.08em;text-transform:uppercase}
.shareOptionGrid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:7px}
.shareChoice{
  min-height:72px;padding:10px;border:1px solid #2d4766;border-radius:11px;
  background:#0b1829;color:#98abc3;text-align:left;cursor:pointer
}
.shareChoice b{display:block;color:#dce8f7;font-size:11px}
.shareChoice span{display:block;margin-top:4px;color:#7289a7;font-size:8px;line-height:1.4}
.shareChoice.active{border-color:#6a92cb;background:#18375e;box-shadow:inset 0 0 0 1px rgba(111,156,255,.14)}
.shareChoice.active b{color:#fff}
.shareChoice:disabled{opacity:.38;cursor:not-allowed}
.shareImageSelectionNote{margin-top:12px;padding:9px 10px;border:1px solid #29445f;border-radius:9px;background:#091524;color:#7f96b4;font-size:9px;font-weight:850}
.shareImageCreateBtn{width:100%;min-height:44px;margin-top:12px}
@media(max-width:520px){
  .shareImageBackdrop{align-items:end;padding:0}
  .shareImageDialog{width:100%;max-height:86dvh;border-radius:20px 20px 0 0;padding:14px 12px calc(18px + env(safe-area-inset-bottom))}
  .shareOptionGrid{grid-template-columns:1fr}
  .shareAspectGrid{grid-template-columns:repeat(3,minmax(0,1fr))}
  .shareAspectGrid .shareChoice{min-height:60px;padding:9px}
}


/* R27: Community participation opens the shared Home scoring workspace. */
.actionBtn.communityRate{background:linear-gradient(180deg,#286aa9,#174d83);border-color:#5f9ed9;color:#fff}
@media(max-width:600px){.primaryActions .actionBtn.communityRate{grid-column:span 2}}
