/* Nygui profile R2. One direct renderer + one stylesheet; no DOM observer. */
/* Page navigation: keep its rail available through the full page scroll. */
@media (min-width:801px) {
  .app-shell>.sidebar { position:sticky; top:0; flex:0 0 252px; height:100dvh; max-height:100dvh; overflow:auto; align-self:flex-start; }
}
/* Homepage: actual card, buttons and shortcut classes, not incidental wrappers. */
#main .cc-quick-grid {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:22px;margin:22px 0 28px;}
#main .cc-quick-grid>.cc-quick {display:flex;align-items:flex-start;justify-content:center;gap:10px;min-height:125px;padding:21px 24px;border-radius:18px;}
#main .cc-community-note .nygui-rewind-buttons {display:grid;grid-template-columns:minmax(0,1fr);gap:19px;margin-top:22px;}
#main .cc-community-note .nygui-rewind-buttons>button {width:100%;min-width:0;min-height:52px;margin:0;padding:12px 18px;border-radius:14px;}
#v17QuickNav .v17-quick-grid {display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:20px;margin:22px 0;}
#v17QuickNav .v17-quick-link {min-height:98px;min-width:0;padding:18px;border-radius:16px;}
#v17QuickNav>.button-row {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:18px;margin-top:20px;}
#v17QuickNav>.button-row>button {width:100%;min-height:46px;margin:0;}

/* Stable profile frame: toolbar and scrolling content are siblings. */
#nyugiFullProfile.nyugi-profile-overlay {
  position:fixed;inset:0;z-index:135;display:flex;flex-direction:column;
  width:100%;height:100dvh;min-height:0;max-height:100dvh;
  overflow:hidden;overscroll-behavior:contain;
  background-color:var(--bg);
}
#nyugiFullProfile>.nyugi-full-profile-toolbar {
  position:relative;top:auto;flex:0 0 auto;display:grid;
  grid-template-columns:minmax(110px,1fr) minmax(0,2fr) minmax(110px,1fr);
  align-items:center;gap:13px;width:100%;min-height:68px;margin:0;
  padding:10px clamp(14px,3vw,40px);background:color-mix(in srgb,var(--surface) 96%,var(--bg));
  border-bottom:1px solid var(--line);box-shadow:0 4px 20px #00000023;z-index:12;
}
#nyugiFullProfile>.nyugi-full-profile-toolbar>strong {min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;text-align:center;font-size:clamp(.82rem,1.6vw,1rem);}
#nyugiFullProfile>.nyugi-full-profile-toolbar>button:first-child {justify-self:start;}
#nyugiFullProfile>.nyugi-full-profile-toolbar>button:last-child {justify-self:end;}
#nyugiFullProfile>.nyugi-profile-container {
  width:min(1180px,100%);flex:1 1 0;min-height:0;max-height:none;height:auto;
  overflow-y:auto;overflow-x:hidden;overscroll-behavior:contain;
  margin:0 auto;padding:25px clamp(15px,3vw,36px) 92px;
}
#nyugiFullProfile .nyugi-profile-hero{display:grid;gap:15px;}
#nyugiFullProfile .nyugi-profile-hero>.cc-public-card.v27-profile-card {
  position:relative;min-height:0;display:block;margin:0;padding:0 0 19px;
  border:1px solid var(--line);border-radius:22px;overflow:hidden;
  background:color-mix(in srgb,var(--surface) 94%,transparent);
  box-shadow:0 12px 35px #00000018;
}
/* Personal art occupies its own full-width scene, preserving existing decor node contents. */
#nyugiFullProfile .nyugi-profile-art-surface {
  position:relative;isolation:isolate;overflow:hidden;width:100%;height:clamp(180px,23vw,270px);
  border-bottom:1px solid var(--line);background:linear-gradient(145deg,var(--tint),var(--subtle));
}
#nyugiFullProfile .nyugi-profile-art-surface>.cc-banner {
  position:absolute;inset:0;z-index:0;width:100%;height:100%;margin:0;border:0;
  background-position:center;background-size:cover;border-radius:0;
}
#nyugiFullProfile .nyugi-profile-art-surface>.v27-decor-layer {
  position:absolute;inset:0;z-index:1;overflow:hidden;border-radius:0;pointer-events:none;
}
#nyugiFullProfile .nyugi-profile-details {position:relative;z-index:2;padding:0 clamp(18px,3vw,30px) 7px;}
#nyugiFullProfile .nyugi-profile-details .cc-person {align-items:center;gap:16px;margin:-36px 0 16px;min-height:92px;position:relative;z-index:3;}
#nyugiFullProfile .nyugi-profile-details .v27-photo-holder {margin-top:0;width:110px;height:100px;}
#nyugiFullProfile .nyugi-profile-details .cc-person h2 {font-size:clamp(1.45rem,2.7vw,2rem);line-height:1.15;margin:0 0 7px;}
#nyugiFullProfile .nyugi-profile-details>p {margin:10px 0;line-height:1.5;max-width:850px;overflow-wrap:anywhere;}
#nyugiFullProfile .nyugi-profile-details .nyugi-profile-stickers {display:flex;flex-wrap:wrap;align-items:center;gap:11px;margin:15px 0;}
#nyugiFullProfile .nyugi-profile-details .cc-stats {border-top:1px solid var(--line);padding:13px 0 0;margin-top:16px;}
#nyugiFullProfile .nyugi-profile-hero>.nyugi-profile-action-row {display:flex;gap:16px;flex-wrap:wrap;align-items:center;}
#nyugiFullProfile .nyugi-profile-hero>.nyugi-profile-action-row>button {min-height:46px;margin:0;padding:11px 20px;}
/* Personal HTML is a feature, not an 800px design crammed into half a page. */
#nyugiFullProfile .nyugi-profile-layout {display:grid;grid-template-columns:minmax(0,1fr);gap:26px;margin-top:24px;align-items:start;}
#nyugiFullProfile .nyugi-profile-layout>.card {min-width:0;margin:0;padding:clamp(15px,2.8vw,25px);}
#nyugiFullProfile .nyugi-panel-heading {display:flex;align-items:center;justify-content:space-between;gap:18px;flex-wrap:wrap;margin-bottom:16px;}
#nyugiFullProfile .nyugi-panel-heading>h2 {margin:0;font-size:clamp(1.1rem,2vw,1.45rem);}
#nyugiFullProfile #nyugiFullTheme {display:block;width:100%;height:clamp(650px,85vh,1040px);max-width:100%;min-height:650px;box-sizing:border-box;border:1px solid var(--line);border-radius:14px;background:#fff;}
#nyugiFullProfile .nyugi-posts-panel>h2 {margin:0 0 20px;font-size:clamp(1.15rem,2vw,1.5rem);}
#nyugiFullProfile .nyugi-posts-panel #nyugiProfilePosts {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:18px;align-items:start;}
#nyugiFullProfile .nyugi-posts-panel #nyugiProfilePosts>.cc-feed-post {min-width:0;margin:0;}
/* The custom page can be genuinely expanded without scripts inside the untrusted iframe. */
#nyugiFullProfile.nygui-html-expanded>.nyugi-profile-container {width:100%;max-width:none;margin:0;padding:0;}
#nyugiFullProfile.nygui-html-expanded .nyugi-profile-hero,
#nyugiFullProfile.nygui-html-expanded .nyugi-posts-panel {display:none;}
#nyugiFullProfile.nygui-html-expanded .nyugi-profile-layout {margin:0;display:block;height:100%;}
#nyugiFullProfile.nygui-html-expanded .nyugi-theme-panel {height:100%;min-height:0;padding:0;border:0;border-radius:0;display:flex;flex-direction:column;}
#nyugiFullProfile.nygui-html-expanded .nyugi-panel-heading {flex:0 0 auto;margin:0;padding:10px 18px;background:var(--surface);border-bottom:1px solid var(--line);}
#nyugiFullProfile.nygui-html-expanded #nyugiFullTheme {flex:1 1 0;height:auto;min-height:0;border:0;border-radius:0;}
@media(max-width:920px){
  #nyugiFullProfile .nyugi-posts-panel #nyugiProfilePosts {grid-template-columns:minmax(0,1fr);}
  #v17QuickNav .v17-quick-grid {grid-template-columns:repeat(2,minmax(0,1fr));gap:16px;}
}
@media(max-width:620px){
  #nyugiFullProfile>.nyugi-full-profile-toolbar {grid-template-columns:85px minmax(0,1fr) 100px;gap:7px;min-height:60px;padding:7px 10px;}
  #nyugiFullProfile>.nyugi-full-profile-toolbar>button {padding:8px 9px;min-height:41px;font-size:.78rem;}
  #nyugiFullProfile>.nyugi-profile-container {padding:14px 11px 100px;}
  #nyugiFullProfile .nyugi-profile-art-surface {height:185px;}
  #nyugiFullProfile .nyugi-profile-details .cc-person {margin:-24px 0 10px;align-items:center;}
  #nyugiFullProfile .nyugi-profile-details .v27-photo-holder {width:86px;height:90px;}
  #nyugiFullProfile .nyugi-profile-details {padding:0 16px 8px;}
  #nyugiFullProfile .nyugi-profile-layout {gap:18px;}
  #nyugiFullProfile .nyugi-profile-layout>.card {padding:15px;}
  #nyugiFullProfile #nyugiFullTheme {height:760px;min-height:600px;}
  #nyugiFullProfile .nyugi-panel-heading>button {width:auto;}
  #main .cc-quick-grid {grid-template-columns:minmax(0,1fr);gap:16px;}
  #main .cc-quick-grid>.cc-quick {min-height:90px;padding:17px;}
  #v17QuickNav .v17-quick-grid,#v17QuickNav>.button-row {grid-template-columns:minmax(0,1fr);gap:17px;}
}
