/* 투자한판 공통 App Shell 크기 체계 */
:root{
  --hp-root-size:16px;
  --hp-shell-height:4.125rem;
  --hp-sidebar-width:14rem;
  --hp-layout-max:87.5rem;
  font-size:var(--hp-root-size);
}
/* App Shell의 오른쪽 프레임 폭을 기준으로 FHD/4K 스케일을 적용한다. */
@media(min-width:1680px){:root{--hp-root-size:16.5px}}
@media(min-width:2200px){:root{--hp-root-size:18px}}
@media(min-width:2880px){:root{--hp-root-size:20px}}

/* 투자한판 공통 상단 네비게이션 */
body.hanpan-dark [data-hp-legacy-nav="true"]{display:none!important}
.hp-shell{position:sticky;top:0;z-index:1000;background:#07111f;border-bottom:1px solid #203955}
.hp-shell-inner{width:min(var(--hp-layout-max),calc(100% - 2.25rem));height:var(--hp-shell-height);margin:0 auto;display:flex;align-items:center;gap:1.125rem}
.hp-shell-brand{display:inline-flex;align-items:center;gap:.625rem;flex:0 0 auto;color:#f3f8ff!important;font-size:1.25rem;font-weight:950;letter-spacing:-.035em;text-decoration:none}
.hp-shell-brand img{width:1.9375rem;height:1.9375rem;border-radius:.5625rem;display:block}
.hp-shell-pagelabel{display:flex;align-items:center;min-width:0;margin-left:.75rem;padding-left:.75rem;border-left:1px solid #294866;color:#9fb7cc;font-size:.8125rem;font-weight:800;letter-spacing:-.01em;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.hp-shell-pagelabel:empty{display:none}
.hp-personal{display:flex;align-items:center;justify-content:flex-end;flex:0 0 auto;min-width:0;margin-left:auto}
.hp-personal:empty{display:none}
.hp-personal{gap:.375rem}.hp-free-profile,.hp-paid-profile{display:inline-flex;align-items:center;justify-content:center;min-height:2.25rem;max-width:10.625rem;padding:0 .6875rem;border-radius:999px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:.75rem;font-weight:900}
.hp-free-profile{border:1px solid rgba(86,119,147,.5);background:rgba(255,255,255,.035);color:#a8bed2}
button.hp-free-profile{font-family:inherit;cursor:pointer}button.hp-free-profile:hover{border-color:#68bdf4;color:#fff}
.hp-paid-profile{border:1px solid #315979;background:#10243a;color:#e9f4ff!important;text-decoration:none;box-shadow:0 0 0 3px rgba(118,199,255,.055)}
.hp-paid-profile:hover{border-color:#5d94bd;background:#173754;color:#fff!important}
.hp-shell-toggle{display:none;width:2.4375rem;height:2.4375rem;border:1px solid #294866;border-radius:.625rem;background:#10243a;color:#eaf4ff;font-size:1.1875rem;cursor:pointer}
/* "사용법 다시 보기"가 사이드바 맨 아래 묻혀 있어서 처음 안내를 닫고 나면 다시 찾기 어렵다는
   피드백 — 상단바에 항상 보이는 물음표 버튼으로 어디서든 바로 열 수 있게 합니다. */
.hp-shell-guide{margin-left:auto;width:2.4375rem;height:2.4375rem;flex:0 0 auto;border:1px solid #294866;border-radius:.625rem;background:#10243a;color:#a9c6d9;font-size:1rem;font-weight:900;cursor:pointer}
.hp-shell-guide:hover{border-color:#5ba3dd;color:#8ed5ff}
/* 예전 두 번째 상단 네비는 사용하지 않음 */
.hp-flow-subnav{display:none!important}

/* 공통 App Shell */
html:has(body.hp-app-host),body.hp-app-host{height:100%;overflow:hidden}
body.hp-app-host{margin:0;background:#07111f}
body.hp-app-host .hp-shell{position:relative;height:var(--hp-shell-height)}
.hp-app-layout{display:grid;grid-template-columns:var(--hp-sidebar-width) minmax(0,1fr);height:calc(100vh - var(--hp-shell-height));min-height:0}
.hp-app-sidebar{z-index:900;overflow-y:auto;padding:1.25rem .875rem 1.5rem;border-right:1px solid #17283d;background:#080f1a;scrollbar-width:thin}
.hp-side-group{display:grid;gap:.3125rem;margin:0 0 1.375rem}
.hp-side-group[data-hp-group="service"]{margin-top:.125rem;padding-top:1.25rem;border-top:1px solid #1a2a3e}
.hp-side-group[data-hp-group="policy"]{margin-bottom:0;padding-top:.875rem;border-top:1px solid #1a2a3e}
.hp-side-group h2{margin:0 .625rem .5rem;color:#607995;font-size:.6875rem;line-height:1.4;font-weight:750;letter-spacing:.045em;text-transform:none}
.hp-side-group a{display:grid;grid-template-columns:1.5rem minmax(0,1fr) auto;align-items:center;gap:.75rem;min-height:3rem;padding:0 .875rem;border:0;border-radius:.75rem;color:#91add0!important;text-decoration:none;transition:background .16s ease,color .16s ease,transform .16s ease}
.hp-side-group a>.hp-side-icon{display:grid;place-items:center;width:1.5rem;height:1.5rem;background:transparent;color:#6f94c8}
.hp-side-group a>.hp-side-icon svg{display:block;width:1.25rem;height:1.25rem;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.hp-side-group a>strong{font-size:.875rem;line-height:1.4;font-weight:750;white-space:nowrap}
.hp-side-lock{display:none;padding:.125rem .3125rem;border:1px solid rgba(246,200,79,.38);border-radius:999px;color:#e5bd55;font-size:.5625rem;font-weight:900;letter-spacing:.04em}
body.hp-free-access .hp-side-group a[data-hp-premium] .hp-side-lock{display:inline-flex}
body.hp-free-access .hp-side-group a[data-hp-premium]{color:#6f849c!important}
.hp-side-group a:hover{background:#101d30;color:#edf5ff!important;transform:translateX(2px)}
.hp-side-group a.active{background:#2867dc;color:#fff!important;box-shadow:0 .5rem 1.375rem rgba(22,83,190,.2)}
.hp-side-group a.active>.hp-side-icon{color:#fff}
.hp-side-group a[data-hp-route="upgrade"]{color:#f6c84f!important}
.hp-side-group a[data-hp-route="upgrade"]>.hp-side-icon{color:#f6c84f}
.hp-side-group a[data-hp-route="upgrade"].active{color:#fff!important}
.hp-side-group[data-hp-group="policy"] a{min-height:2.5rem;color:#748ba5!important}
.hp-side-group[data-hp-group="policy"] a>strong{font-size:.75rem;font-weight:650}
.hp-side-group[data-hp-group="policy"] a>.hp-side-icon svg{width:1rem;height:1rem}
.hp-app-main{min-width:0;min-height:0;background:#07111f}
.hp-app-main iframe{display:block;width:100%;height:100%;border:0;background:#07111f;overflow:auto}
.hp-app-backdrop{display:none}
.hp-guide-modal[hidden]{display:none!important}
.hp-guide-modal{position:fixed;z-index:200000;inset:0;display:grid;place-items:center;padding:1.25rem;background:rgba(1,7,14,.86)}
.hp-guide-dialog{width:min(52rem,100%);max-height:min(47rem,calc(100vh - 2.5rem));overflow:auto;padding:1.5rem;border:1px solid #294b69;border-radius:1.25rem;background:#0b1929;color:#edf5ff;box-shadow:0 1.5rem 4rem rgba(0,0,0,.48)}
.hp-guide-head{display:flex;align-items:flex-start;justify-content:space-between;gap:1.25rem;padding-bottom:1.125rem;border-bottom:1px solid #1d354d}.hp-guide-head span{display:block;color:#68bdf4;font-size:.6875rem;font-weight:900;letter-spacing:.16em}.hp-guide-head h2{margin:.375rem 0 .25rem;font-size:1.625rem;letter-spacing:-.035em}.hp-guide-head p{margin:0;color:#8da8bf;font-size:.8125rem}.hp-guide-head button{flex:0 0 2.375rem;width:2.375rem;height:2.375rem;border:1px solid #31506b;border-radius:.6875rem;background:#10243a;color:#b8d0e3;font-size:1.5rem;line-height:1;cursor:pointer}.hp-guide-head button:hover{border-color:#65b5e7;color:#fff}
.hp-guide-grid{display:grid;grid-template-columns:1fr 1fr;gap:.625rem;margin-top:1rem}.hp-guide-grid article{display:flex;align-items:flex-start;gap:.75rem;min-width:0;padding:.875rem;border:1px solid #1d3a53;border-radius:.875rem;background:#081726}.hp-guide-grid article>b{display:grid;place-items:center;flex:0 0 1.75rem;width:1.75rem;height:1.75rem;border-radius:.5rem;background:#123d5e;color:#8bd2ff;font-size:.75rem}.hp-guide-grid h3{margin:.0625rem 0 .3125rem;font-size:.875rem}.hp-guide-grid p{margin:0;color:#829fb6;font-size:.71875rem;line-height:1.55}
.hp-guide-note{display:flex;flex-direction:column;gap:.1875rem;margin-top:1rem;padding:.75rem .875rem;border:1px solid #35472f;border-radius:.75rem;background:#141d19}.hp-guide-note strong{color:#e8e0aa;font-size:.75rem}.hp-guide-note span{color:#9eaa9a;font-size:.6875rem;line-height:1.5}
.hp-guide-actions{display:flex;justify-content:flex-end;gap:.5rem;margin-top:1rem}.hp-guide-actions button{min-height:2.5rem;padding:0 1rem;border-radius:.625rem;font-size:.75rem;font-weight:850;cursor:pointer}.hp-guide-dismiss{border:1px solid #2b465e;background:#0a1b2b;color:#89a4ba}.hp-guide-confirm{border:1px solid #3485bb;background:#17659e;color:#fff}.hp-guide-dismiss:hover{color:#d8e9f5}.hp-guide-confirm:hover{background:#1d75b3}
body.hp-guide-open{overflow:hidden}
body.hp-embedded{min-height:100vh}
body.hp-embedded [data-hp-legacy-nav="true"]{display:none!important}
html.hp-frame-document{height:auto!important;min-height:100%!important;overflow-x:hidden!important;overflow-y:auto!important;-webkit-overflow-scrolling:touch}
html.hp-frame-document body.hp-embedded{height:auto!important;min-height:100%!important;overflow-x:hidden!important;overflow-y:visible!important}

@media(max-width:900px){
  :root{--hp-root-size:16px;--hp-shell-height:3.75rem}
  .hp-shell-inner{width:min(100% - 1.5rem,var(--hp-layout-max));height:var(--hp-shell-height);gap:.625rem}
  .hp-shell-brand{font-size:1.125rem}.hp-shell-brand img{width:1.75rem;height:1.75rem}
  .hp-shell-toggle{display:grid;place-items:center;order:4}
  .hp-personal{margin-left:auto;order:3}
  .hp-free-profile,.hp-paid-profile{max-width:8.4375rem;min-height:2.125rem;padding:0 .5625rem}
  /* 모바일 WebView(카카오톡 포함)는 브라우저 상·하단 바 때문에 100vh가 실제
     표시 영역과 달라질 수 있습니다. JS가 visualViewport 높이를 갱신하고,
     App Shell 전체를 그 안에 맞춰 콘텐츠 스크롤 하나만 유지합니다. */
  body.hp-app-host .hp-shell{height:var(--hp-shell-height)}
  html:has(body.hp-app-host),body.hp-app-host{
    height:var(--hp-viewport-height,100dvh);
    min-height:0;
    overflow:hidden;
    overscroll-behavior-y:none;
  }
  .hp-app-layout{
    display:block;
    height:calc(var(--hp-viewport-height,100dvh) - var(--hp-shell-height));
    min-height:0;
  }
  .hp-app-main{
    height:100%;
    min-height:0;
    overflow:hidden;
  }
  .hp-app-main iframe{
    height:100%;
    min-height:0;
    overflow-y:auto;
    -webkit-overflow-scrolling:touch;
  }
  .hp-app-sidebar{position:fixed;top:var(--hp-shell-height);bottom:0;left:0;width:min(78vw,16.125rem);padding:.875rem .625rem 1.625rem;transform:translateX(-105%);transition:transform .22s ease;box-shadow:1.375rem 0 3rem rgba(0,0,0,.38)}
  .hp-app-sidebar.open{transform:translateX(0)}
  .hp-app-backdrop{position:fixed;z-index:850;inset:var(--hp-shell-height) 0 0;display:block;border:0;background:rgba(0,7,15,.62);opacity:0;pointer-events:none;transition:opacity .2s}
  body.hp-menu-open .hp-app-backdrop{opacity:1;pointer-events:auto}
  body.hp-menu-open{overflow:hidden}
}

@media(max-width:900px){
  html.hp-frame-document,
  html.hp-frame-document body.hp-embedded{
    height:auto!important;
    min-height:100%!important;
    overflow-x:hidden!important;
  }
  html.hp-frame-document{
    overflow-y:auto!important;
    overscroll-behavior-y:contain;
    -webkit-overflow-scrolling:touch;
  }
  html.hp-frame-document body.hp-embedded{
    overflow-y:visible!important;
  }
  html.hp-frame-document body.hp-embedded{
    box-sizing:border-box;
    padding-bottom:max(1rem,env(safe-area-inset-bottom));
  }
}

@media(max-width:430px){
  .hp-shell-inner{width:calc(100% - 1.125rem)}
  .hp-shell-brand span{display:none}
  .hp-free-profile,.hp-paid-profile{max-width:6.75rem;font-size:.6875rem}
  .hp-guide-modal{padding:.625rem}.hp-guide-dialog{max-height:calc(100dvh - 1.25rem);padding:1rem}.hp-guide-grid{grid-template-columns:1fr}.hp-guide-head h2{font-size:1.375rem}.hp-guide-actions{display:grid;grid-template-columns:1fr 1fr}.hp-guide-actions button{padding-inline:.5rem}
}


/* 투자 시작 콘텐츠 전용 내부 네비 */
.hp-content-tabs-bar{background:#081523;border-bottom:1px solid #183048}
.hp-content-tabs-inner{width:min(var(--hp-layout-max),calc(100% - 2.25rem));min-height:3.5rem;margin:0 auto;display:flex;align-items:center}
.hp-content-tabs{display:flex;align-items:center;gap:.5rem}
.hp-content-tabs a{display:inline-flex;align-items:center;justify-content:center;min-height:2.25rem;padding:0 .8125rem;border:1px solid transparent;border-radius:.625rem;color:#8fa8bf!important;font-size:.75rem;font-weight:900;text-decoration:none;white-space:nowrap}
.hp-content-tabs a:hover{color:#e9f4ff!important;background:#0d1d30;border-color:#203955}
.hp-content-tabs a.active{color:#fff!important;background:#10243a;border-color:#76c7ff;box-shadow:inset 0 0 0 1px rgba(118,199,255,.08)}
@media(max-width:900px){.hp-content-tabs-inner{width:min(100% - 1.5rem,var(--hp-layout-max));min-height:3.25rem}.hp-content-tabs{gap:.375rem}.hp-content-tabs a{min-height:2.125rem;padding:0 .6875rem;font-size:.6875rem}}
@media(max-width:430px){.hp-content-tabs-inner{width:calc(100% - 1.125rem)}.hp-content-tabs{width:100%}.hp-content-tabs a{flex:1}}

/* 3-step learning nav: 투자 시작 전 / 재테크 / 투자 시작 */
@media(max-width:430px){
  .hp-content-tabs a{padding:0 .4375rem;font-size:.65625rem}
}
