.detail-etf-menu{width:min(620px,calc(100vw - 32px));max-height:72vh;overflow:auto}
@media(max-width:720px){.detail-etf-menu{width:auto;max-width:calc(100vw - 28px)}}

/* Shared primary header: high-frequency ETFs stay visible, the rest live in one menu. */
.header-etf-all,.account-menu{position:relative}
.header-etf-all summary,.account-menu summary{list-style:none;cursor:pointer;white-space:nowrap}
.header-etf-all summary::-webkit-details-marker,.account-menu summary::-webkit-details-marker{display:none}
.header-etf-all summary{font-size:.82rem;font-weight:680;color:#415047}
.header-etf-all summary::after{content:"⌄";margin-left:5px;color:#76827b}
.header-etf-all[open] summary{color:var(--green)}
.header-etf-menu{position:absolute;z-index:80;top:calc(100% + 21px);right:0;width:min(670px,calc(100vw - 32px));max-height:72vh;overflow:auto;display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:18px;padding:20px;background:#fff;border:1px solid var(--line);border-radius:17px;box-shadow:0 24px 65px rgba(7,34,22,.18)}
.header-etf-all:not([open]) .header-etf-menu{display:none}
.header-etf-group{display:flex;flex-direction:column;gap:4px}
.header-etf-group b{margin-bottom:4px;color:var(--muted);font-size:.67rem;letter-spacing:.08em;text-transform:uppercase}
.header-etf-group a{padding:7px 9px!important;border-radius:8px;font-weight:780!important;color:#173c2d!important}
.header-etf-group a:hover,.header-etf-group a.active{background:#e7f1eb;color:var(--green)!important}
.account-menu summary{display:flex;align-items:center;gap:7px;font-size:.82rem;font-weight:740;color:#33443b}
.account-avatar{width:28px;height:28px;border-radius:50%;display:grid;place-items:center;background:#173c2d;color:#fff;font-size:.72rem;font-weight:850;text-transform:uppercase}
.account-popover{position:absolute;z-index:90;top:calc(100% + 14px);right:0;width:245px;padding:15px;background:#fff;border:1px solid var(--line);border-radius:14px;box-shadow:0 20px 55px rgba(7,34,22,.18)}
.account-menu:not([open]) .account-popover{display:none}
.account-popover strong,.account-popover small{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.account-popover strong{font-size:.8rem}.account-popover small{margin:3px 0 11px;color:var(--muted);font-size:.7rem}
.account-popover button{display:block;width:100%;padding:9px 7px;border:0;border-top:1px solid var(--line);background:none;text-align:left;color:#33443b;font-size:.78rem;cursor:pointer}
.account-popover button:hover{color:var(--green)}
@media(max-width:980px){.header-etf-menu{position:static;width:100%;max-height:55vh;margin-top:10px;grid-template-columns:repeat(2,minmax(0,1fr));box-shadow:none}.header-etf-all summary{padding:6px 0}.site-header nav{max-height:calc(100vh - 76px);overflow:auto}.account-menu summary>span:last-child{display:none}}
@media(max-width:520px){.header-etf-menu{grid-template-columns:1fr}.language-select select{max-width:105px}.account-popover{right:-6px}}

/* Mobile: keep the four primary ETFs visible instead of replacing them with Menu. */
@media(max-width:700px){
  .site-header{height:auto!important;min-height:104px;display:grid!important;grid-template-columns:minmax(0,1fr) auto;grid-template-rows:52px 44px;gap:0 9px!important;padding:4px 10px!important}
  .site-header .brand{grid-column:1;grid-row:1;min-width:0}
  .site-header .brand span{display:block}
  .site-header .brand small{display:none}
  .site-header .brand-mark{width:32px;height:32px}
  .site-header .menu-toggle{display:none!important}
  .site-header #nav{grid-column:1/-1;grid-row:2;display:flex!important;position:static!important;width:100%;min-width:0;max-height:none!important;margin:0!important;padding:0!important;border:0!important;background:transparent!important;flex-direction:row!important;align-items:center;justify-content:flex-start;gap:7px!important;overflow-x:auto!important;overflow-y:visible!important;scrollbar-width:none}
  .site-header #nav::-webkit-scrollbar{display:none}
  .site-header #nav>a:first-child{display:none}
  .site-header #nav>a{flex:none;padding:7px 6px;font-size:.75rem}
  .site-header .header-etf-all{flex:none}
  .site-header .header-etf-all summary{padding:7px 6px;font-size:.75rem}
  .site-header .header-actions{grid-column:2;grid-row:1;display:flex!important;flex:none;justify-self:end}
  .site-header .header-actions .account-menu summary>span:last-child{display:none}
  .site-header .header-actions .language-select select{max-width:108px;padding-left:7px;padding-right:22px}
  .header-etf-menu{position:fixed!important;top:108px!important;left:10px!important;right:10px!important;width:auto!important;max-width:none!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;margin:0!important;padding:14px!important;box-shadow:0 20px 55px rgba(7,34,22,.22)!important}
}
@media(max-width:520px){
  .site-header .brand strong{font-size:.74rem}
  .site-header .header-actions{display:flex!important}
  .site-header .header-actions .language-select select{width:94px;max-width:94px;font-size:.72rem}
  .site-header #accountButton{padding:6px 3px;font-size:.74rem}
}
@media(max-width:700px){.site-header .brand{min-width:0;gap:6px}.site-header .brand span{display:block!important}.site-header .brand strong{font-size:12px;letter-spacing:0}.site-header .brand-mark{width:28px!important;height:28px!important}.site-header .brand small{display:none}.site-header .header-actions{gap:4px}.site-header .header-actions .language-select select{width:82px;max-width:82px}.site-header nav{max-width:100%;min-width:0}.header-etf-menu{max-height:calc(100dvh - 125px);overflow-y:auto}}@media(min-width:431px) and (max-width:700px){.site-header .brand small{display:block;font-size:9px}}
@media(max-width:700px){main,.view,.section,.panel{min-width:0}.site-header .brand{max-width:145px}.site-header .header-actions{min-width:0}dialog{max-width:calc(100vw - 24px);max-height:calc(100dvh - 24px);overflow-y:auto}dialog input{min-width:0;max-width:100%;font-size:16px}dialog button{white-space:normal;overflow-wrap:anywhere}.stock-scroll,.guide-table-scroll{max-width:100%;overscroll-behavior-x:contain}}
