/* 登入後的後台殼（public/shell.js）。沒登入時 <html> 沒有 .has-shell，這整份不作用。
 * .has-shell 掛在 <html>：登入過的瀏覽器在 <head> 就先掛上（見各頁的 clv-shell 那一行），
 * 側欄位置一開始就留好，換頁不會先畫一次沒側欄的版面再跳過去。
 * 寬螢幕：左側固定側欄 232px；窄螢幕（≤860px）：側欄變成頁首下方一條可橫捲的導覽。 */
.shell-side{display:none}
.has-shell .shell-side{display:block;position:fixed;inset:0 auto 0 0;width:232px;overflow-y:auto;
  background:var(--lv-card,#fff);border-right:1px solid var(--lv-line,#e4e4e4);padding:16px 12px 24px;z-index:5}
.has-shell .wrap{margin-left:232px!important;max-width:min(var(--maxw,1080px),calc(100vw - 232px))!important;padding-left:clamp(16px,3vw,40px)!important;padding-right:clamp(16px,3vw,40px)!important}
.has-shell .wrap>header{margin-left:-0px}
/* 側欄頂端的品牌＋方案：高度與位置對齊右邊的浮動膠囊頁首（top 16px、高 62px） */
.shell-brand{display:flex;align-items:center;gap:8px;min-height:62px;padding:0 10px;margin-bottom:8px;border-bottom:1px solid var(--lv-line,#e4e4e4)}
.shell-brand:empty{border-bottom:0}
.shell-brand-name{flex:1;min-width:0;font-size:15px;font-weight:600;color:var(--lv-fg,#222a36);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;text-decoration:none}
.shell-brand-empty{font-weight:500;color:var(--lv-blue-ink,#2456d6)}
.shell-brand-empty:hover{text-decoration:underline}
.shell-brand-plan{flex:none;font-size:12px;padding:1px 8px;border-radius:999px;background:var(--lv-blue-bg2,#eef4ff);color:var(--lv-blue-ink,#2456d6);text-decoration:none}
.shell-group{font-size:12px;color:var(--lv-fg2,#6b7280);margin:18px 10px 6px;letter-spacing:.04em}
.shell-item{display:flex;align-items:center;gap:10px;padding:8px 10px;border-radius:10px;color:var(--lv-fg,#222a36);text-decoration:none;font-size:14.5px}
.shell-item:hover{background:var(--lv-blue-bg2,#eef4ff)}
.shell-item.on{background:var(--lv-blue-bg2,#eef4ff);color:var(--lv-blue-ink,#2456d6);font-weight:500}
.shell-item svg{flex:none;color:currentColor;opacity:.85}
.shell-tag{margin-left:auto;font-size:11.5px;padding:1px 8px;border-radius:999px;background:var(--lv-tint,#f1f4fa);color:var(--lv-fg2,#6b7280)}
.shell-acct{position:relative;margin-left:auto}
.shell-acct summary{list-style:none;cursor:pointer;display:flex;align-items:center;gap:8px;font-size:14px;padding:6px 10px;border-radius:999px;border:1px solid var(--lv-line,#e4e4e4)}
.shell-acct summary::-webkit-details-marker{display:none}
.shell-email{max-width:16em;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.shell-menu{position:absolute;right:0;top:calc(100% + 8px);min-width:220px;background:var(--lv-card,#fff);border:1px solid var(--lv-line,#e4e4e4);border-radius:16px;padding:8px;display:flex;flex-direction:column;gap:4px;box-shadow:0 8px 24px rgba(0,0,0,.08);z-index:20}
.shell-menu>a{padding:8px 10px;border-radius:10px;color:inherit;text-decoration:none;font-size:14px}
.shell-menu>a:hover{background:var(--lv-blue-bg2,#eef4ff)}
.shell-menu button{text-align:left;font-size:14px!important;padding:8px 10px!important}
.shell-menu-brand{display:none;align-items:center;gap:8px;padding:6px 10px}
.shell-menu-brand:empty{display:none!important}
.shell-menu-who{font-size:12.5px;color:var(--lv-fg2,#6b7280);padding:6px 10px;word-break:break-all}
/* 設定頁、通話頁：一次只顯示側欄選到的那一節 */
/* 一次只顯示側欄選到的那一節：<html data-active> 由 shell-boot.js 在首次繪製前就設好，shell.js 換 hash 時更新。
 * 新增一節要把 id 加進這串（也加進 shell.js 的 NAV）。 */
.has-shell [data-sec]{display:none!important}
.has-shell[data-active="identity"] [data-sec~="identity"],
.has-shell[data-active="info"] [data-sec~="info"],
.has-shell[data-active="fields"] [data-sec~="fields"],
.has-shell[data-active="rules"] [data-sec~="rules"],
.has-shell[data-active="widget"] [data-sec~="widget"],
.has-shell[data-active="calllink"] [data-sec~="calllink"],
.has-shell[data-active="plan"] [data-sec~="plan"],
.has-shell[data-active="calls"] [data-sec~="calls"],
.has-shell[data-active="waitlist"] [data-sec~="waitlist"]{display:block!important}
@media (max-width:860px){
  .has-shell .shell-side{position:static;width:auto;border-right:0;border-bottom:1px solid var(--lv-line,#e4e4e4);padding:10px 12px;overflow-x:auto;overflow-y:hidden}
  .has-shell .shell-nav{display:flex;gap:4px;white-space:nowrap}
  .has-shell .shell-group{display:none}
  .has-shell .shell-brand{display:none}
  .shell-menu-brand{display:flex}
  .has-shell .shell-item{flex:none;font-size:14px}
  .has-shell .wrap{margin-left:auto!important;max-width:100%!important;padding-left:16px!important;padding-right:16px!important}
}
.need-login{display:none}
body.signed-out .need-login{display:block}
body.signed-out .app-only{display:none!important}
/* 預先掛了側欄、但登入還沒確認時：設定頁的登入卡片先不露臉，確認沒登入才出現（shell.js 會拿掉 .has-shell） */
.has-shell body.gateonly #gate{visibility:hidden}
/* 確認登入前：舊的頁首導覽先不露臉（shell.js 換成帳號選單），帳號選單填好字才出現 */
.has-shell .wrap>header>nav{visibility:hidden}
.shell-acct:not(.ready){visibility:hidden}
/* 同站換頁時淡入淡出，不是整頁白一下（Chrome 126+；其他瀏覽器照舊直接換） */
@view-transition{navigation:auto}
::view-transition-old(root),::view-transition-new(root){animation-duration:.15s}
/* 有後台殼時，帳號（email、登出）已經在頁首的帳號選單裡：
 * 舊頁面自己的那張「email＋登出」卡（#authbox）與設定頁的三步門檻（#gate）收起來，不重複顯示。
 * 設定進度改看「總覽」。殼載不出來（沒有 .has-shell）時照舊顯示。 */
.has-shell #authbox{display:none!important}
.has-shell body:not(.gateonly) #gate{display:none!important}
