/* AVOON 웹 셸(modules/app-shell.js). body[data-shell] = guardian | partner | admin | minihome | auth | focus.
   머리글·하단 탭·바닥글만 다룬다. 본문 화면 규칙은 각 화면 CSS에 둔다. */

/* ── 머리글 ─────────────────────────────────────────── */
#site-header{position:sticky;top:0;z-index:30;background:var(--bg);border-bottom:1px solid var(--line)}
#site-header .top-inner{display:flex;align-items:center;gap:var(--s2);max-width:calc(var(--w-page) + 48px);height:var(--h-header);margin:0 auto;padding:0 24px}
#site-header a{color:var(--text);text-decoration:none}
body[data-shell=admin] #site-header .top-inner{max-width:none;padding:0 22px}
#site-header .shell-brand{order:0;display:flex;align-items:center;flex:none;width:96px;height:40px;overflow:hidden;margin-right:var(--s4)}
#site-header .shell-brand img{display:block;width:96px;height:96px;object-fit:contain}
#site-header .gnav{order:1;display:flex;align-items:center;gap:var(--s1);min-width:0}
#site-header .gnav-link{display:inline-flex;align-items:center;min-height:var(--tap);padding:0 12px;border-radius:var(--r-ctl);font-size:16px;font-weight:700;white-space:nowrap;color:var(--text-2)}
#site-header .gnav-link:hover{color:var(--text);background:var(--bg-section)}
#site-header .gnav-link[aria-current=page]{color:var(--text);box-shadow:inset 0 -2px 0 var(--brand);border-radius:0}
#site-header .shell-search{order:2;position:relative;display:flex;align-items:center;flex:1 1 260px;max-width:340px;margin-left:auto}
#site-header .shell-search input{min-height:40px;height:40px;padding:0 44px 0 14px;border:1px solid var(--line);border-radius:var(--r-ctl);background:var(--bg-section);font-size:15px}
#site-header .shell-search input:focus{background:var(--bg);outline:2px solid var(--focus);outline-offset:0}
#site-header .shell-search-submit{position:absolute;right:2px;top:50%;transform:translateY(-50%);display:inline-flex;align-items:center;justify-content:center;width:40px;height:40px;border:0;border-radius:8px;background:none;color:var(--text-2);cursor:pointer}
#site-header .shell-icon{order:4;position:relative;display:inline-flex;align-items:center;justify-content:center;flex:none;width:var(--tap);height:var(--tap);border-radius:var(--r-ctl);color:var(--text)}
#site-header .shell-icon:hover{background:var(--bg-section)}
#site-header .search-link{order:3;display:none}
#site-header .shell-chat{order:5}
body #site-header .top-inner .ntf-bell{order:4;margin-left:0;width:var(--tap);height:var(--tap);color:var(--text);border-radius:var(--r-ctl)}
body #site-header .top-inner .ntf-bell:hover{background:var(--bg-section);color:var(--text)}
body:not([data-shell=guardian]) #site-header .ntf-bell{display:none!important}
#site-header .shell-login{order:6;display:inline-flex;align-items:center;min-height:40px;padding:0 14px;border-radius:var(--r-ctl);background:var(--btn);color:#fff;font-size:15px;font-weight:700;white-space:nowrap}
#site-header .shell-login:hover{background:var(--btn-hover)}
#site-header .shell-account{order:6;position:relative;flex:none}
#site-header .shell-account-toggle{display:inline-flex;align-items:center;gap:6px;min-height:var(--tap);padding:0 10px;border-radius:var(--r-ctl);font-size:15px;font-weight:600;cursor:pointer;list-style:none;white-space:nowrap}
#site-header .shell-account-toggle::-webkit-details-marker{display:none}
#site-header .shell-account-toggle:hover,#site-header .shell-account[open] .shell-account-toggle{background:var(--bg-section)}
#site-header .shell-account-menu{position:absolute;right:0;top:calc(100% + 6px);z-index:40;display:grid;min-width:200px;padding:6px;background:var(--bg);border:1px solid var(--line);border-radius:var(--r-ctl);box-shadow:0 8px 24px rgba(32,33,42,.12)}
#site-header .shell-account-link{display:flex;align-items:center;min-height:44px;padding:0 12px;border-radius:8px;font-size:15px;white-space:nowrap}
#site-header .shell-account-link:hover,#site-header .shell-account-link:focus-visible{background:var(--bg-section)}
#site-header .shell-menu-button{order:7;display:inline-flex;align-items:center;gap:6px;flex:none;min-height:var(--tap);padding:0 10px;border:0;border-radius:var(--r-ctl);background:none;color:var(--text);font:inherit;font-size:15px;font-weight:600;cursor:pointer}
#site-header .shell-menu-button:hover{background:var(--bg-section)}
#site-header .shell-context{order:1;min-width:0;font-size:16px;font-weight:700;color:var(--text);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
#site-header .shell-spacer{order:2;flex:1}
#site-header .shell-text-link{order:3;display:inline-flex;align-items:center;min-height:var(--tap);padding:0 10px;border-radius:var(--r-ctl);font-size:14px;font-weight:600;color:var(--text-2);white-space:nowrap}
#site-header .shell-text-link:hover{background:var(--bg-section);color:var(--text)}
#site-header .shell-back{display:inline-flex;align-items:center;justify-content:center;flex:none;width:var(--tap);height:var(--tap);margin-left:-12px;border:0;border-radius:var(--r-ctl);background:none;color:var(--text);cursor:pointer}
#site-header .shell-back:hover{background:var(--bg-section)}
#site-header .shell-focus-title{flex:1;min-width:0;margin:0;font-size:17px;line-height:1.35;font-weight:700;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
#site-header .shell-focus-actions{display:flex;align-items:center;flex:none;gap:2px;margin-right:-8px}

@media(max-width:1100px){
 #site-header .gnav-link{padding:0 8px;font-size:15px}
 #site-header .shell-search{max-width:240px}
}
@media(max-width:860px){
 #site-header .shell-search{display:none}
 #site-header .search-link{display:inline-flex;margin-left:auto}
 #site-header .shell-menu-label,#site-header .shell-account-label{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
 #site-header .shell-menu-button,#site-header .shell-account-toggle{width:var(--tap);padding:0;justify-content:center}
}
@media(max-width:700px){
 #site-header .top-inner{padding:0 var(--gutter);gap:2px}
 #site-header .shell-brand{width:84px;height:36px;margin-right:auto}
 #site-header .shell-brand img{width:84px;height:84px}
 #site-header .gnav{display:none}
 body[data-shell=guardian] #site-header .shell-account,body[data-shell=guardian] #site-header .shell-login{display:none}
 #site-header .shell-menu-label,#site-header .shell-account-label{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
 #site-header .shell-menu-button,#site-header .shell-account-toggle{width:var(--tap);padding:0;justify-content:center}
 body[data-shell=partner] #site-header .shell-brand{display:none}
 body[data-shell=partner] #site-header .shell-context{font-size:16px}
 body[data-shell=partner] #site-header .shell-preview{padding:0 8px;font-size:13px}
 body[data-shell=admin] #site-header .shell-brand,body[data-shell=auth] #site-header .shell-brand{margin-right:var(--s2)}
}

/* ── 레이아웃별 표시 ─────────────────────────────────── */
body[data-shell=minihome] #site-header{display:none}
body[data-shell=focus] #site-footer,body[data-shell=admin] #site-footer,body[data-shell=partner] #site-footer{display:none}

/* ── 하단 탭(보호자 5탭 / 사업장 업무 탭) ─────────────── */
#tabbar{display:none}
@media(max-width:700px){
 body[data-tabs=on] #tabbar:not([hidden]){display:block;position:fixed;left:0;right:0;bottom:0;z-index:25;background:var(--bg);border-top:1px solid var(--line);padding-bottom:env(safe-area-inset-bottom)}
 body[data-tabs=on]{padding-bottom:calc(var(--h-tabbar) + env(safe-area-inset-bottom))}
 html{scroll-padding-bottom:calc(var(--h-tabbar) + env(safe-area-inset-bottom) + 16px)}
}
#tabbar .gtabs-inner{display:grid;grid-auto-flow:column;grid-auto-columns:minmax(0,1fr);height:var(--h-tabbar)}
#tabbar .gtab{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;min-width:0;min-height:var(--tap);padding:4px 2px;border:0;background:none;color:var(--text-2);font:inherit;font-size:12px;font-weight:600;line-height:1.2;text-decoration:none;cursor:pointer}
#tabbar .gtab[aria-current=page],#tabbar .gtab[aria-pressed=true]{color:var(--btn)}
#tabbar .gtab[aria-current=page] .ui-icon{stroke-width:2.2}
#tabbar .gtab-label{max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;word-break:keep-all}
#tabbar .gtab:focus-visible{outline:2px solid var(--focus);outline-offset:-4px;border-radius:8px}

/* ── 바닥글 ─────────────────────────────────────────── */
#site-footer .shell-footer-links{display:flex;flex-wrap:wrap;gap:4px 16px}
#site-footer .shell-footer-links a{color:var(--text-2)}
#site-footer .shell-footer-links a:hover{color:var(--text)}
body[data-shell=minihome] #site-footer{display:flex;justify-content:center;border-top:1px solid var(--line);padding:16px 0 calc(24px + env(safe-area-inset-bottom))}
#site-footer .shell-avoon-link{display:inline-flex;align-items:center;min-height:var(--tap);padding:0 12px;color:var(--text-2);font-size:13px;font-weight:600}

/* ── 전체 메뉴 시트 ─────────────────────────────────── */
.shell-menu{display:grid;gap:var(--s5)}
.shell-menu-group{min-width:0}
.shell-menu-title{margin:0 0 var(--s1);font-size:13px;font-weight:700;color:var(--text-2)}
.shell-menu-list{margin:0;padding:0;list-style:none;border-top:1px solid var(--line)}
.shell-menu-link{display:flex;align-items:center;min-height:48px;padding:0 4px;border-bottom:1px solid var(--line);color:var(--text);font-size:16px;text-decoration:none;word-break:keep-all}
.shell-menu-link:hover{color:var(--btn)}
.shell-menu-link[aria-current=page]{color:var(--btn);font-weight:700}
@media(min-width:701px){.shell-menu{grid-template-columns:1fr 1fr;gap:var(--s5) var(--s5)}}
