
/* 4) Day/night themed discover subcategory chips (were unstyled → night black/gold) */
html[data-hhv-appearance] body.home .hh-discover-child{
  background:var(--h3s2,var(--hhsw-theme-surface-soft,#f5eee2))!important;
  border:1px solid var(--h3b,var(--hhsw-theme-border,rgba(176,124,40,.22)))!important;
  color:var(--h3m,var(--hhsw-theme-muted,#6f6250))!important;
  border-radius:999px!important;
  box-shadow:none!important;
}
html[data-hhv-appearance] body.home .hh-discover-child:hover{
  color:var(--h3t,var(--hhsw-theme-text,#2a2116))!important;
  border-color:var(--h3g,var(--hhsw-theme-accent,#b07c28))!important;
}
html[data-hhv-appearance] body.home .hh-discover-child:is(.is-active,.active,[aria-pressed="true"],[aria-selected="true"]){
  background:linear-gradient(135deg,var(--h3g2,#d49a3c),var(--h3g,#b07c28))!important;
  color:#1a1206!important;-webkit-text-fill-color:#1a1206!important;
  border-color:transparent!important;
}
/* Fallback when appearance attr missing: day-safe soft chips */
html:not([data-hhv-appearance]) body.home .hh-discover-child{
  background:#f5eee2!important;border:1px solid rgba(176,124,40,.22)!important;color:#6f6250!important;
}

/* 5) Rail labels: no mid-word break; ellipsis / keep-all */
:is(.hhsw-rail,.hh-rail,#c729-rail,.h3d-rail,.site-rail) :is(.hhsw-rail-nav,.hh-rail-nav,nav) :is(a,button,span) :is(b,strong,small,.hhsw-rail-label,.hh-rail-label){
  overflow-wrap:normal!important;word-break:keep-all!important;line-break:strict!important;
  white-space:normal!important;hyphens:manual!important;
  display:-webkit-box!important;-webkit-box-orient:vertical!important;-webkit-line-clamp:2!important;
  overflow:hidden!important;max-width:62px!important;text-align:center!important;
}
html[lang="en"] :is(.hhsw-rail,.hh-rail) :is(.hhsw-rail-nav,.hh-rail-nav) a b,
html[lang="ru"] :is(.hhsw-rail,.hh-rail) :is(.hhsw-rail-nav,.hh-rail-nav) a b,
html[lang="ja"] :is(.hhsw-rail,.hh-rail) :is(.hhsw-rail-nav,.hh-rail-nav) a b{
  font-size:9px!important;letter-spacing:0!important;
}
/* Conversation / session list titles */
:is(.hhsw-session-list,.hhsw-conv-list,[data-hhsw-sessions],.hhsw-sidebar) :is(.hhsw-session-title,.hhsw-conv-title,[data-session-title],.hhsw-thread-title,li button span,li a span){
  overflow:hidden!important;text-overflow:ellipsis!important;white-space:nowrap!important;
  overflow-wrap:normal!important;word-break:keep-all!important;max-width:100%!important;
}

/* 6) RU concurrency numbers: keep on one line */
#hhswApp .hhsw-membership .hhpf-concurrency>div>span{
  overflow-wrap:normal!important;word-break:keep-all!important;white-space:nowrap!important;
  font-size:11px!important;min-width:0!important;
}
#hhswApp .hhsw-membership .hhpf-concurrency>div{
  grid-template-columns:repeat(3,minmax(0,1fr))!important;gap:2px 6px!important;
}
html[lang="ru"] #hhswApp .hhsw-membership .hhpf-concurrency>div>span{font-size:10px!important;letter-spacing:-.01em!important}

/* Language dialog: only active option shows Текущий/Current */
.hhv-language-option:not(.is-active) .hhv-language-option__state{
  opacity:0!important;visibility:hidden!important;pointer-events:none!important;
}
.hhv-language-option.is-active .hhv-language-option__state{
  opacity:1!important;visibility:visible!important;
}

/* Duplicate language buttons in rail bottom + account/membership topbar */
:is(.hhsw-rail-bottom,.hh-rail-bottom,.h3d-account-cluster,.site-rail-bottom,.hh7-bottom,.h3d-topbar,.hh-account-topbar,.hhsw-topbar,.hh-account-header,.hhsw-account-top,.hh-membership-top) .hhv-language-trigger ~ .hhv-language-trigger,
:is(.hhsw-rail-bottom,.hh-rail-bottom,.hh7-bottom,.h3d-topbar,.hh-account-topbar,.hhsw-topbar) .hhv-language-switcher ~ .hhv-language-switcher,
:is(.hhsw-rail-bottom,.hh-rail-bottom,.hh7-bottom,.h3d-topbar,.hh-account-topbar,.hhsw-topbar) .hhv-language-trigger ~ .hhv-language-switcher,
:is(.hhsw-rail-bottom,.hh-rail-bottom,.hh7-bottom,.h3d-topbar,.hh-account-topbar,.hhsw-topbar) .hhv-language-switcher ~ .hhv-language-trigger,
:is(.hhsw-rail-bottom,.hh-rail-bottom,.hh7-bottom,.h3d-topbar,.hh-account-topbar,.hhsw-topbar) [data-hh-i18n3-dup="1"]{
  display:none!important;
}
/* Hidden English "Language" control that survives refresh beside 简中 (rail + topbar) */
html:not([lang="en"]):not([data-hhv-lang="en"]) :is(.hhsw-rail-bottom,.hh-rail-bottom,.hh7-bottom,.h3d-topbar,.hh-account-topbar,.hhsw-topbar,.hh-account-header,.h3d-account-cluster) :is(button,a)[aria-label="Language"],
html:not([lang="en"]):not([data-hhv-lang="en"]) :is(.hhsw-rail-bottom,.hh-rail-bottom,.hh7-bottom,.h3d-topbar,.hh-account-topbar,.hhsw-topbar,.hh-account-header,.h3d-account-cluster) :is(button,a)[title="Language"]{
  display:none!important;
}
/* Orphan Language/简中 FAB outside any rail (membership rapid-tab glitch). Never target rail/sidebar primary. */
:is(body, #hhswApp, .hhsw-app, .hh-app-shell) > :is(button.hh4-lang, button.hhv-language-trigger, button[aria-label="Language"])[data-hh-i18n3-dup="1"],
:is(.hh-floating-lang, .hhv-language-floating) :is(button.hh4-lang, button.hhv-language-trigger)[data-hh-i18n3-dup="1"]{
  display:none!important;visibility:hidden!important;pointer-events:none!important;
}
/* Canvas project view only — duplicates inside view-bar (sidebar primary never marked) */
body.hanhai-canvas-standalone .c5-view-bar :is(.hhv-language-trigger, button.hh4-lang, button[aria-label="Language"], button[aria-label="語言"])[data-hh-i18n3-dup="1"],
[data-hanhai-canvas-host] .c5-view-bar :is(.hhv-language-trigger, button.hh4-lang)[data-hh-i18n3-dup="1"]{
  display:none!important;visibility:hidden!important;pointer-events:none!important;
}
/* Account page: identity rows that look like buttons but do nothing */
.hh-account :is(button,a,div,span)[data-hh-account-noop],
.hh-account-v61 :is(.hh-account-identity-row,.hh-profile-row) :is(button.hh-secondary,a.hh-secondary):not([href]):not([data-open-modal]){
  cursor:default!important;pointer-events:none!important;
  background:transparent!important;border-color:transparent!important;
  box-shadow:none!important;text-decoration:none!important;
}
/* Day: points recharge modal should not stay night-dark */
html[data-hhv-appearance="day"] :is(.hhsw-points-modal,.hh-points-modal,[data-modal="points"],dialog#hh-points-modal,.hhsw-recharge-modal){
  background:var(--hhsw-theme-surface,#fff)!important;
  color:var(--hhsw-theme-text,#2a2116)!important;
}
html[data-hhv-appearance="day"] :is(.hhsw-points-modal,.hh-points-modal,[data-modal="points"],dialog#hh-points-modal,.hhsw-recharge-modal) :is(h1,h2,h3,b,strong,label,p,span,small,div){
  color:inherit;
}
/* ===== v2.2 tester-A 6-lang ===== */
html[lang="ko"] :is(#hhswApp,.hhsw-app) :is(.hhsw-composer,.hhsw-composer-bar,.hhsw-input-dock,[data-hhsw-composer],.hhsw-bottom-composer){
  padding-bottom:max(16px,env(safe-area-inset-bottom,0px))!important;
  box-sizing:border-box!important;
}
html[lang="ko"] :is(#hhswApp,.hhsw-app) :is(.hhsw-composer,.hhsw-composer-bar,[data-hhsw-composer],.hhsw-bottom-composer) :is(button,a,span,label,[role="button"],.hhsw-chip,.hhsw-param,.hhsw-param-btn,.hhsw-ref-slot,[data-frame],[data-param]){
  white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important;
  word-break:keep-all!important;overflow-wrap:normal!important;
}
html[lang="ko"] :is(#hhswApp,.hhsw-app) :is(.hhsw-ref-slot,[data-frame="start"],[data-frame="end"],.hhsw-frame-slot,.hhsw-first-frame,.hhsw-last-frame){
  font-size:10px!important;letter-spacing:-.02em!important;line-height:1.15!important;
  min-width:0!important;max-width:72px!important;
}
html[lang="ko"] :is(#hhswApp,.hhsw-app) :is(.hhsw-composer,.hhsw-composer-bar,[data-hhsw-composer]) :is(.hhsw-param-row,.hhsw-toolbar,.hhsw-composer-tools){
  flex-wrap:nowrap!important;overflow-x:auto!important;overflow-y:visible!important;
  -webkit-overflow-scrolling:touch;scrollbar-width:thin;font-size:11px!important;
}
html[lang="ja"] :is(.hhsw-rail,.hh-rail,#c729-rail,.h3d-rail,.site-rail) :is(.hhsw-rail-nav,.hh-rail-nav,nav) :is(a,button) :is(b,strong,small,.hhsw-rail-label,.hh-rail-label),
html[lang="ru"] :is(.hhsw-rail,.hh-rail,#c729-rail,.h3d-rail,.site-rail) :is(.hhsw-rail-nav,.hh-rail-nav,nav) :is(a,button) :is(b,strong,small,.hhsw-rail-label,.hh-rail-label){
  display:block!important;-webkit-box-orient:unset!important;-webkit-line-clamp:unset!important;
  white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important;
  max-width:62px!important;font-size:9px!important;line-height:1.2!important;
}
.hh-i18n3-sr-only,[data-hh-i18n3-sr="1"]{
  position:absolute!important;width:1px!important;height:1px!important;
  padding:0!important;margin:-1px!important;overflow:hidden!important;
  clip:rect(0,0,0,0)!important;clip-path:inset(50%)!important;
  white-space:nowrap!important;border:0!important;
}
