/* PROFILE R01A FIX1: keep the desktop header in one row. */
.yp-profile-link[aria-current=page]{border-color:rgba(255,255,255,.25);background:rgba(255,255,255,.09)}
@media (min-width:901px){
  .site-header:has(.yp-profile-link){flex-wrap:nowrap;gap:8px;padding:0 18px}
  .site-header:has(.yp-profile-link) .brand{flex:1 1 auto;min-width:0;flex-wrap:nowrap}
  .site-header:has(.yp-profile-link) .brand-logo,
  .site-header:has(.yp-profile-link) .brand-ru{flex:none}
  .site-header:has(.yp-profile-link) .brand-title{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;margin-left:18px;font-size:19px}
  .site-header:has(.yp-profile-link) .top-nav{flex:none;flex-wrap:nowrap;gap:2px;width:auto;margin-left:auto}
  .site-header:has(.yp-profile-link) .top-nav a{padding-left:5px;padding-right:5px;white-space:nowrap}
  .site-header:has(.yp-profile-link) #theme-toggle{flex:none}
  .site-header:has(.yp-profile-link) #theme-toggle .theme-choice{padding-left:5px;padding-right:5px}
  .site-header:has(.yp-profile-link) .header-indicator{flex:none;margin-left:0;white-space:nowrap}
}
@media (min-width:901px) and (max-width:1120px){
  .site-header:has(.yp-profile-link){padding-inline:12px;gap:6px}
  .site-header:has(.yp-profile-link) .brand-logo,
  .site-header:has(.yp-profile-link) .brand-ru,
  .site-header:has(.yp-profile-link) .brand-ru img{height:44px!important}
  .site-header:has(.yp-profile-link) .brand-ru{width:50px!important;min-width:50px!important}
  .site-header:has(.yp-profile-link) .brand-title{font-size:15px;margin-left:8px}
}
@media (min-width:901px) and (max-width:1030px){
  .site-header:has(.yp-profile-link) #theme-toggle .theme-choice span:last-child{display:none}
  .site-header:has(.yp-profile-link) .brand-logo,
  .site-header:has(.yp-profile-link) .brand-ru,
  .site-header:has(.yp-profile-link) .brand-ru img{height:34px!important}
  .site-header:has(.yp-profile-link) .brand-ru{width:44px!important;min-width:44px!important}
  .site-header:has(.yp-profile-link) .brand-title{font-size:14px}
}
@media (max-width:900px){
  .site-header:has(.yp-profile-link){display:grid;grid-template-columns:minmax(0,1fr) auto;gap:8px;padding:10px 12px}
  .site-header:has(.yp-profile-link) .brand{grid-column:1/-1;min-width:0;flex-wrap:wrap;row-gap:4px}
  .site-header:has(.yp-profile-link) .brand-logo{max-width:calc(100% - 60px)!important;object-fit:contain;flex:0 1 auto}
  .site-header:has(.yp-profile-link) .brand-title{white-space:normal;margin-left:10px;overflow-wrap:anywhere}
  .site-header:has(.yp-profile-link) .top-nav{grid-column:1/-1;order:3;flex-wrap:wrap;gap:2px;width:100%;margin:0}
  .site-header:has(.yp-profile-link) .top-nav a{padding-left:7px;padding-right:7px}
  .site-header:has(.yp-profile-link) #theme-toggle{justify-self:start;margin:0}
  .site-header:has(.yp-profile-link) .header-indicator{justify-self:end;margin:0;white-space:nowrap}
}
@media (min-width:600px) and (max-width:900px){
  .site-header:has(.yp-profile-link){grid-template-areas:"brand brand status" "nav theme theme";grid-template-columns:minmax(0,1fr) auto auto}
  .site-header:has(.yp-profile-link) .brand{grid-area:brand}
  .site-header:has(.yp-profile-link) .top-nav{grid-area:nav}
  .site-header:has(.yp-profile-link) #theme-toggle{grid-area:theme;justify-self:end}
  .site-header:has(.yp-profile-link) .header-indicator{grid-area:status}
}
.yp-profile-page [hidden]{display:none!important}.yp-profile-content{padding:18px;min-height:180px}.yp-profile-content h2{margin:0 0 12px;font-size:17px}.yp-auth-columns{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}.yp-auth-columns form,.yp-id{border:1px solid var(--border-hi);background:var(--panel-soft);border-radius:5px;padding:16px;min-width:0}.yp-auth-columns label{display:block;color:var(--text-soft);margin:10px 0}.yp-auth-columns input{display:block;width:100%;min-width:0;padding:9px;margin-top:5px;color:var(--text);background:var(--page-bg);border:1px solid var(--border-hi);border-radius:3px;font-size:13px}.yp-button{background:var(--panel-raised);color:var(--text);border:1px solid var(--border-hi);border-radius:4px;padding:8px 12px;margin:6px 6px 4px 0;font-weight:bold}.yp-button:hover:not(:disabled){border-color:var(--link)}.yp-button:disabled{opacity:.55}.yp-profile-page :is(a,button,input):focus-visible{outline:2px solid var(--link);outline-offset:2px}.yp-muted,.yp-note{color:var(--text-soft);line-height:1.55}.yp-id{display:flex;align-items:center;gap:16px;overflow-wrap:anywhere}.yp-avatar{display:grid;place-items:center;flex:none;width:68px;height:68px;background:var(--panel-raised);border:1px solid var(--border-hi);border-radius:5px;font-size:32px;color:var(--link)}.yp-id p{margin:5px 0}#yp-status{padding:8px 10px;border-left:3px solid var(--link);background:var(--panel-soft);overflow-wrap:anywhere}#yp-status[data-error=true]{border-color:var(--red)}.yp-links{display:flex;flex-wrap:wrap;gap:8px;padding:14px 16px 0}.yp-note{padding:0 16px 12px}.yp-profile-page .retro-section{margin-bottom:14px}@media(max-width:640px){.yp-auth-columns{grid-template-columns:1fr}.yp-profile-content{padding:12px}}

/* R01A FIX2: profile light surfaces use a scoped palette. */
html[data-theme="light"] .yp-profile-page .yp-profile-content,
html[data-theme="light"] .yp-profile-page .yp-note {
  --page-bg:#ffffff;
  --panel-soft:#e9eef4;
  --panel-raised:#dce5ef;
  --border-hi:#a7b8cb;
  --text:#273747;
  --text-soft:#4d6074;
  --link:#245b91;
  --red:#a12c3c;
  color:var(--text);
}
html[data-theme="light"] .yp-profile-page .yp-note{color:var(--text-soft)}
.yp-profile-page .yp-button{display:inline-block}
/* Compact native theme selector. Original buttons stay available to theme engine. */
.site-header #theme-toggle.theme-switch.yp-theme-menu {
  padding:0!important; gap:0; border:0!important; background:none!important;
  box-shadow:none; width:auto; min-width:0; height:auto;
}
.site-header #theme-toggle.yp-theme-menu .theme-choice{display:none!important}
.site-header .yp-theme-select {
  appearance:auto; box-sizing:border-box; width:90px; height:30px;
  padding:0 5px; font:700 10px Tahoma,Verdana,sans-serif; cursor:pointer;
  border:1px solid #7691b4; border-radius:4px; background:#253e5a; color:#f1f5fa;
  color-scheme:dark;
}
html[data-theme="light"] .site-header .yp-theme-select {
  border-color:#aab8ca; background:#e9eff6; color:#233b55; color-scheme:light;
}
.site-header .yp-theme-select:focus-visible {outline:2px solid #d5e5ff;outline-offset:2px}
/* Backend state is text + LED, not a clickable control. */
.site-header:has(.yp-profile-link) .header-indicator {
  min-width:0; width:auto; height:auto; padding:0; gap:5px;
  background:none!important; border:0!important; border-radius:0;
  box-shadow:none!important; color:#f2f5fa; font-size:10px;
  text-shadow:0 1px 2px #243854;
}
.site-header:has(.yp-profile-link) .header-indicator .status-led {width:7px;height:7px;flex:none}
