/* 학원모아 App Shell v1: global mobile header, bottom navigation, and page rhythm */
:root {
  --hm-bg: #eef5f8;
  --hm-surface: #ffffff;
  --hm-text: #111827;
  --hm-muted: #64748b;
  --hm-border: #dbe6ee;
  --hm-primary: #0c7754;
  --hm-primary-dark: #032923;
  --hm-shadow: 0 10px 26px rgba(15, 23, 42, .06);
  --hm-header-height: 64px;
  --hm-tabbar-height: 72px;
}

body.hm-mobile-shell,
.hm-mobile-shell main {
  background: var(--hm-bg) !important;
}

.hm-mobile-shell .navbar {
  display: none !important;
}

.hm-mobile-shell main {
  padding: 0 !important;
  min-height: 100dvh;
}

.hm-page {
  width: min(430px, 100%);
  margin: 0 auto;
  padding: 0 16px calc(96px + env(safe-area-inset-bottom));
  box-sizing: border-box;
}

.hm-sticky-header,
.gpage-sticky {
  position: sticky;
  position: -webkit-sticky;
  top: 0;
  z-index: 50;
  width: min(430px, 100%);
  margin: 0 auto 14px !important;
  padding: calc(8px + env(safe-area-inset-top)) 16px 8px !important;
  background: var(--hm-bg) !important;
  box-sizing: border-box;
}

.hm-header,
.gpage-header-inner,
.top {
  min-height: var(--hm-header-height);
  display: grid !important;
  grid-template-columns: 44px minmax(0, 1fr) 44px !important;
  align-items: center !important;
  gap: 8px !important;
  margin: 0 !important;
}

.hm-header__title,
.gpage-title,
.top h1 {
  min-width: 0;
  margin: 0 !important;
  color: var(--hm-text) !important;
  font-size: 22px !important;
  font-weight: 900 !important;
  line-height: 1.15 !important;
  letter-spacing: -0.045em !important;
  text-align: center !important;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hm-header__button,
.gpage-back,
.gpage-home,
.gpage-notify,
.top .round,
.icon-btn,
.round {
  width: 44px !important;
  height: 44px !important;
  min-width: 44px !important;
  min-height: 44px !important;
  border: 1px solid rgba(219, 230, 238, .95) !important;
  border-radius: 999px !important;
  background: #fff !important;
  color: var(--hm-text) !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 0 !important;
  text-decoration: none !important;
  box-shadow: 0 8px 22px rgba(15, 23, 42, .055) !important;
  cursor: pointer;
}

.hm-header__placeholder,
.gpage-spacer,
.top > div:empty {
  width: 44px !important;
  height: 44px !important;
}

.gpage-actions {
  display: flex !important;
  align-items: center !important;
  justify-content: flex-end !important;
  gap: 0 !important;
}
.gpage-actions .gpage-home { display: none !important; }
.gpage-notify .bell-dot {
  position: absolute;
  top: 9px;
  right: 9px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #ef4444;
  border: 1.5px solid #fff;
}

.hm-section-card,
.section-card,
.card {
  border-radius: 22px !important;
  border: 1px solid rgba(219, 230, 238, .9) !important;
  background: #fff !important;
  box-shadow: var(--hm-shadow) !important;
}

.hm-page-title-sub,
.section-sub,
.hint {
  color: var(--hm-muted) !important;
}

.hm-tabbar-base,
.tabbar-base,
#globalTabbarBase {
  position: fixed !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  height: max(env(safe-area-inset-bottom), 18px) !important;
  background: #fff !important;
  z-index: 9996 !important;
  pointer-events: none !important;
}

.hm-tabbar,
.tabbar,
#globalTabbar.global-tabbar-fixed,
.landing-tabbar {
  position: fixed !important;
  left: 50% !important;
  bottom: 0 !important;
  transform: translateX(-50%) !important;
  width: min(430px, 100%) !important;
  height: var(--hm-tabbar-height) !important;
  padding: 4px 0 calc(6px + env(safe-area-inset-bottom)) !important;
  border: 1px solid #e2e8f0 !important;
  border-bottom: 0 !important;
  border-radius: 24px 24px 0 0 !important;
  background: #fff !important;
  box-shadow: 0 -8px 24px rgba(15,23,42,.045) !important;
  display: grid !important;
  grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
  z-index: 9998 !important;
  box-sizing: border-box !important;
}

.hm-tabbar__item,
.tabbar .tab,
.landing-tab {
  min-width: 0 !important;
  border: 0 !important;
  background: transparent !important;
  color: #94a3b8 !important;
  text-decoration: none !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 3px !important;
  font-size: 11px !important;
  font-weight: 800 !important;
  line-height: 1 !important;
  cursor: pointer !important;
  -webkit-tap-highlight-color: transparent;
}

.hm-tabbar__item i,
.landing-tab i {
  font-size: 22px !important;
  line-height: 1 !important;
}

.tabbar .tab .tab-icon {
  width: 28px !important;
  height: 28px !important;
  object-fit: contain !important;
}

.hm-tabbar__item span,
.tabbar .tab span,
.landing-tab span {
  white-space: nowrap !important;
  font-size: 11px !important;
  font-weight: 800 !important;
}

.hm-tabbar__item.is-active,
.hm-tabbar__item.active,
.tabbar .tab.active,
.landing-tab.active {
  color: var(--hm-primary-dark) !important;
}

.hm-tabbar__item.is-active span,
.hm-tabbar__item.active span,
.tabbar .tab.active span,
.landing-tab.active span {
  font-weight: 900 !important;
}


/* App Shell v2: detail/write/search/category consistency */
.detail-shell{
  background:#eef5f8!important;
  padding-top:0!important;
}
.detail-topbar{
  position:sticky!important;
  top:0!important;
  z-index:60!important;
  min-height:64px!important;
  margin:0 -18px 14px!important;
  padding:calc(8px + env(safe-area-inset-top)) 18px 8px!important;
  background:#eef5f8!important;
  display:grid!important;
  grid-template-columns:44px 1fr 88px!important;
  align-items:center!important;
  gap:8px!important;
}
.detail-icon-btn{
  width:44px!important;
  height:44px!important;
  border:1px solid rgba(219,230,238,.95)!important;
  border-radius:999px!important;
  background:#fff!important;
  color:#111827!important;
  box-shadow:0 8px 22px rgba(15,23,42,.055)!important;
}
.detail-actions{justify-content:flex-end!important;gap:6px!important}
.detail-card,.detail-comments{
  border-color:#dbe6ee!important;
  box-shadow:0 10px 26px rgba(15,23,42,.06)!important;
}
.hm-tabbar + .detail-composer,
.detail-composer{
  bottom:var(--hm-tabbar-height,72px)!important;
  border:1px solid #e2e8f0!important;
  border-bottom:0!important;
  border-radius:22px 22px 0 0!important;
  box-shadow:0 -8px 24px rgba(15,23,42,.045)!important;
}
@media (max-width: 430px){
  .detail-topbar{margin-left:-18px!important;margin-right:-18px!important;}
}


/* App Shell hotfix: global tabbar must stay above page-level floating UI */
#globalTabbarBase.hm-tabbar-base,
.hm-tabbar-base,
.tabbar-base {
  z-index: 2147482999 !important;
}
#globalTabbar.hm-tabbar,
#globalTabbar.global-tabbar-fixed,
.hm-tabbar.global-tabbar-fixed,
.hm-tabbar,
.tabbar.global-tabbar-fixed {
  z-index: 2147483000 !important;
}

/* Talktalk is a local board: prioritize readability over promotional emphasis */
.talk .post-title {
  font-size: 15px !important;
  font-weight: 800 !important;
  line-height: 1.35 !important;
  letter-spacing: -0.025em !important;
}
.talk .body {
  font-size: 13px !important;
  line-height: 1.45 !important;
}
.talk .meta,
.talk .stats {
  font-size: 12px !important;
}

/* App Shell critical hotfix: the global tabbar is a viewport-fixed overlay.
   It must not participate in page flow and page content may scroll underneath it. */
html.hm-tabbar-overlay-ready,
body.hm-tabbar-overlay-ready {
  overflow-x: hidden !important;
}
#globalTabbarBase,
#globalTabbarBase.hm-tabbar-base,
.hm-tabbar-base,
.tabbar-base {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
  min-height: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}
#globalTabbar,
#globalTabbar.hm-tabbar,
#globalTabbar.global-tabbar-fixed,
.hm-tabbar.global-tabbar-fixed,
.tabbar.global-tabbar-fixed {
  position: fixed !important;
  left: 50% !important;
  right: auto !important;
  top: auto !important;
  bottom: 0 !important;
  transform: translate3d(-50%, 0, 0) !important;
  width: min(430px, 100vw) !important;
  height: calc(76px + env(safe-area-inset-bottom, 0px)) !important;
  min-height: calc(76px + env(safe-area-inset-bottom, 0px)) !important;
  max-height: calc(76px + env(safe-area-inset-bottom, 0px)) !important;
  margin: 0 !important;
  padding: 5px 0 calc(7px + env(safe-area-inset-bottom, 0px)) !important;
  border: 1px solid #e2e8f0 !important;
  border-bottom: 0 !important;
  border-radius: 24px 24px 0 0 !important;
  background: #fff !important;
  box-shadow: 0 -10px 28px rgba(15,23,42,.075) !important;
  display: grid !important;
  grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
  align-items: stretch !important;
  overflow: hidden !important;
  pointer-events: auto !important;
  z-index: 2147483600 !important;
  box-sizing: border-box !important;
  will-change: transform !important;
}
#globalTabbar .hm-tabbar__item,
#globalTabbar .tab {
  height: 100% !important;
  min-height: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 4px !important;
  font-size: 11px !important;
  font-weight: 800 !important;
  line-height: 1 !important;
}
#globalTabbar .tab-icon,
#globalTabbar img.tab-icon {
  width: 31px !important;
  height: 31px !important;
  min-width: 31px !important;
  min-height: 31px !important;
  max-width: 31px !important;
  max-height: 31px !important;
  object-fit: contain !important;
  display: block !important;
}
#globalTabbar i,
#globalTabbar .hm-tabbar__item i {
  font-size: 24px !important;
  line-height: 1 !important;
  margin: 0 !important;
}
#globalTabbar span {
  display: block !important;
  font-size: 11px !important;
  font-weight: 800 !important;
  line-height: 1 !important;
  white-space: nowrap !important;
}
/* prevent page-specific bottom spacers from creating a visible blank gap under the fixed tabbar */
.bottom-pad,
.app .bottom-pad {
  height: 78px !important;
  min-height: 78px !important;
}

/* Search page hotfix */
.s-shell {
  padding-bottom: calc(162px + env(safe-area-inset-bottom, 0px)) !important;
}
.search-footer {
  position: fixed !important;
  left: 50% !important;
  right: auto !important;
  bottom: calc(76px + env(safe-area-inset-bottom, 0px)) !important;
  transform: translate3d(-50%, 0, 0) !important;
  width: min(430px, 100vw) !important;
  z-index: 2147482500 !important;
  box-sizing: border-box !important;
}
.step-card.is-open .step-panel {
  max-height: 470px !important;
  overflow-y: auto !important;
  padding-bottom: 24px !important;
  -webkit-overflow-scrolling: touch;
}
.step-card.is-open .option-grid {
  padding-bottom: 24px !important;
}

/* Talktalk top spacing hotfix */
.talk {
  padding-top: 0 !important;
}
.talk > .top {
  display: block !important;
  min-height: auto !important;
  margin: 0 -18px 8px !important;
  padding: calc(6px + env(safe-area-inset-top, 0px)) 18px 6px !important;
  position: sticky !important;
  top: 0 !important;
  z-index: 60 !important;
  background: #eef5f8 !important;
}
.talk > .top .gpage-header-inner,
.talk > .top .hm-header {
  min-height: 56px !important;
}
.talk > .top .gpage-title,
.talk > .top .hm-header__title {
  font-size: 21px !important;
}
