:root{
  --blue:#2563EB; --blue2:#3B82F6; --blue-soft:#EFF6FF;
  --purple:#8B5CF6; --purple2:#A855F7;
  --ink:#111827; --ink2:#1A1A1A; --gray:#8E97A6; --gray2:#6B7280;
  --line:#EEF1F5; --bg:#F5F7FA;
  --red:#EF4444; --green:#10B981; --amber:#F59E0B;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}
*{box-sizing:border-box; -webkit-tap-highlight-color:transparent;}
html,body{margin:0; padding:0;}
body{
  font-family:-apple-system,BlinkMacSystemFont,"Apple SD Gothic Neo","Pretendard","Malgun Gothic",sans-serif;
  background:var(--bg); color:var(--ink2);
  -webkit-font-smoothing:antialiased;
  overscroll-behavior-y:none;
}
button{font-family:inherit; cursor:pointer; border:none; background:none; color:inherit;}
input,textarea{font-family:inherit;}
a{color:inherit;}

.boot{height:60vh; display:flex; align-items:center; justify-content:center;}
.spin{width:26px;height:26px;border:3px solid var(--line);border-top-color:var(--blue);border-radius:50%;animation:sp .8s linear infinite;}
@keyframes sp{to{transform:rotate(360deg)}}

/* ───── 셸 ───── */
.screen{min-height:100vh; padding-bottom:calc(74px + var(--safe-bottom));}
.hdr{background:#fff; padding:calc(var(--safe-top) + 16px) 20px 0;}
.hdr-row{display:flex; align-items:flex-start;}
.hdr h1{font-size:25px; font-weight:800; margin:0; letter-spacing:-.5px; flex:1;}
.hdr .sub{font-size:13px; color:var(--gray); margin:4px 0 0;}
.bell{position:relative; font-size:22px; padding:2px 4px;}
.bell .dot{position:absolute; top:0; right:2px; width:9px; height:9px; border-radius:50%; background:var(--red); border:2px solid #fff;}
.hdr-links{display:flex; align-items:center; gap:8px; font-size:13px; color:var(--gray); padding:8px 0 4px;}
.hdr-links button{font-size:13px; color:var(--gray);}
.hdr-links button.hl{color:var(--blue); font-weight:700;}
.hdr-links i{font-style:normal; color:#D5DAE1;}

.subtabs{display:flex; background:#fff; border-bottom:1px solid var(--line);}
.subtabs button{flex:1; padding:14px 0 12px; font-size:15px; font-weight:700; color:var(--gray); position:relative;}
.subtabs button.on{color:var(--blue);}
.subtabs button.on:after{content:""; position:absolute; left:0; right:0; bottom:-1px; height:3px; background:var(--blue); border-radius:2px;}

.body{padding:16px 20px 24px;}
.sec-t{font-size:19px; font-weight:800; margin:22px 0 2px;}
.sec-s{font-size:13px; color:var(--gray); margin:0 0 12px;}
.sec-row{display:flex; align-items:center; justify-content:space-between; margin:22px 0 12px;}
.sec-row h2{font-size:19px; font-weight:800; margin:0;}
.sec-row button{font-size:13px; color:var(--blue); font-weight:700;}

/* ───── 탭바 ───── */
.tabbar{
  position:fixed; left:0; right:0; bottom:0; z-index:40;
  background:#fff; border-top:1px solid var(--line);
  display:flex; padding:6px 4px calc(4px + var(--safe-bottom));
}
.tabbar button{flex:1; display:flex; flex-direction:column; align-items:center; gap:2px; padding:6px 0 4px; color:#9AA3B0; font-size:11px; font-weight:600;}
.tabbar .ic{font-size:20px; line-height:1.1; width:56px; text-align:center; padding:3px 0; border-radius:14px;}
.tabbar button.on{color:var(--blue);}
.tabbar button.on .ic{background:var(--blue-soft);}

/* ───── 카드 ───── */
.card{background:#fff; border-radius:16px; padding:18px; margin-bottom:12px; box-shadow:0 1px 3px rgba(16,24,40,.05);}
.card h3{margin:0 0 14px; font-size:16px; font-weight:800;}
.mut{color:var(--gray); font-size:13px;}
.r{display:flex; align-items:center; justify-content:space-between; gap:10px;}
.r + .r{margin-top:13px;}
.r .k{color:var(--gray); font-size:14px;}
.r .v{font-size:14px; font-weight:700;}
.hr{height:1px; background:var(--line); margin:14px 0;}

/* ───── 이용권 카드(캐러셀) ───── */
.pass-scroll{display:flex; gap:12px; overflow-x:auto; padding:4px 20px 6px; margin:0 -20px; scroll-snap-type:x mandatory; -webkit-overflow-scrolling:touch;}
.pass-scroll::-webkit-scrollbar{display:none;}
.pass{
  flex:0 0 84%; scroll-snap-align:center;
  border-radius:20px; padding:20px; color:#fff;
  background:linear-gradient(140deg,#2F7BF5,#4C8FFB);
  box-shadow:0 6px 18px rgba(37,99,235,.22);
}
.pass.pt{background:linear-gradient(140deg,#8B5CF6,#A855F7); box-shadow:0 6px 18px rgba(139,92,246,.22);}
.pass.exp{background:linear-gradient(140deg,#9CA3AF,#B6BCC5); box-shadow:none;}
.pass .badge{display:inline-block; font-size:12px; font-weight:700; padding:6px 12px; border-radius:999px; background:rgba(255,255,255,.24);}
.pass .nm{font-size:23px; font-weight:800; margin:14px 0 6px; letter-spacing:-.5px;}
.pass .exp-t{font-size:13px; opacity:.9;}
.pass .divider{height:1px; background:rgba(255,255,255,.28); margin:16px 0 14px;}
.pass .grid{display:flex; gap:22px;}
.pass .grid > div{flex:1;}
.pass .grid .k{font-size:12px; opacity:.85;}
.pass .grid .v{font-size:17px; font-weight:800; margin-top:3px;}
.pass .more{width:100%; margin-top:16px; padding:12px; border-radius:12px; background:rgba(255,255,255,.22); color:#fff; font-size:14px; font-weight:700;}
.pass-empty{background:#fff; border-radius:16px; padding:34px 18px; text-align:center; color:var(--gray); font-size:14px;}

/* 예약 화면 큰 수강권 카드 */
.pass-big{border-radius:18px; padding:20px; color:#fff; background:linear-gradient(135deg,#8B5CF6,#A855F7); display:flex; align-items:center; margin-bottom:6px;}
.pass-big .l{flex:1; min-width:0;}
.pass-big .badge{display:inline-block; font-size:12px; font-weight:700; padding:6px 12px; border-radius:999px; background:rgba(255,255,255,.24);}
.pass-big .nm{font-size:21px; font-weight:800; margin:12px 0 8px;}
.pass-big .dt{font-size:12.5px; opacity:.92;}
.pass-big .dd{font-size:13.5px; font-weight:700; margin-top:6px;}
.pass-big .r-side{width:40%; text-align:center; border-left:1px solid rgba(255,255,255,.3); padding-left:12px;}
.pass-big .r-side .k{font-size:12.5px; opacity:.9;}
.pass-big .r-side .v{font-size:27px; font-weight:800; margin-top:4px; letter-spacing:-1px;}

/* ───── 주간 캘린더 ───── */
.week{display:flex; justify-content:space-between; gap:2px;}
.week .d{flex:1; text-align:center;}
.week .d .w{font-size:12px; color:var(--gray); margin-bottom:8px;}
.week .d .w.sun{color:var(--red);} .week .d .w.sat{color:var(--blue);}
.week .d .w.tod{color:var(--blue); font-weight:700;}
.week .d .n{
  width:38px; height:38px; margin:0 auto; border-radius:50%;
  display:flex; align-items:center; justify-content:center;
  font-size:14px; font-weight:600; border:1px solid var(--line); background:#fff;
}
.week .d .n.on{background:var(--blue); color:#fff; border-color:var(--blue);}
.week .d .n.off{background:#F3F4F6; color:var(--red); border-color:#F3F4F6;}
.week .d .tag{font-size:10px; color:var(--red); margin-top:4px;}
.week .d .dot{width:5px; height:5px; border-radius:50%; background:var(--blue); margin:4px auto 0;}

/* ───── 날짜 선택(예약) ───── */
.dsel{display:flex; gap:8px; overflow-x:auto; padding:2px 20px 4px; margin:0 -20px; -webkit-overflow-scrolling:touch;}
.dsel::-webkit-scrollbar{display:none;}
.dsel button{
  flex:0 0 auto; width:66px; padding:12px 0 10px; border-radius:14px;
  background:#fff; border:1px solid var(--line); text-align:center;
}
.dsel button.on{background:var(--blue); border-color:var(--blue); color:#fff;}
.dsel button.today{background:var(--blue-soft); border-color:var(--blue-soft);}
.dsel .w{font-size:12px; color:var(--gray);}
.dsel button.on .w{color:rgba(255,255,255,.85);}
.dsel .w.sun{color:var(--red);} .dsel .w.sat{color:var(--blue);}
.dsel .n{font-size:19px; font-weight:800; margin-top:4px;}
.dsel .dot{width:5px;height:5px;border-radius:50%;background:var(--blue);margin:5px auto 0;}
.dsel button.on .dot{background:#fff;}

/* ───── 수업 슬롯 ───── */
.slot{display:flex; align-items:center; gap:12px; background:#fff; border:1px solid var(--line); border-radius:14px; padding:14px; margin-bottom:10px;}
.slot .t{min-width:62px;}
.slot .t .hh{font-size:19px; font-weight:800; letter-spacing:-.5px;}
.slot .t .mm{font-size:12px; color:var(--gray); margin-top:2px;}
.slot .vl{width:1px; align-self:stretch; background:var(--line);}
.slot .i{flex:1; min-width:0;}
.slot .i b{display:block; font-size:15px; font-weight:700;}
.slot .i span{font-size:12.5px; color:var(--gray);}
.slot .i span .left{color:var(--amber); font-weight:700;}
.slot.dim{opacity:.55;}

/* ───── 버튼 ───── */
.btn{width:100%; padding:15px; border-radius:12px; font-size:15px; font-weight:800; background:var(--blue); color:#fff;}
.btn:disabled{background:#CBD5E1;}
.btn.gray{background:#F3F4F6; color:var(--ink2);}
.btn.ghost{background:#fff; color:var(--ink2); border:1px solid var(--line);}
.btn.danger{background:#fff; color:var(--red); border:1px solid #FECACA;}
.btn.sm{width:auto; padding:10px 18px; font-size:13.5px; border-radius:10px; font-weight:700;}
.btn.pill{border-radius:999px;}
.btn2{display:flex; gap:10px;}
.btn2 .btn{flex:1;}

/* ───── 칩 ───── */
.chip{display:inline-block; font-size:11.5px; font-weight:700; padding:4px 9px; border-radius:7px; background:var(--blue-soft); color:var(--blue);}
.chip.g{background:#F1F5F9; color:#64748B;}
.chip.r{background:#FEF2F2; color:var(--red);}
.chip.gr{background:#ECFDF5; color:var(--green);}
.chip.o{background:#FFF7ED; color:var(--amber);}
.chip.pu{background:#F5F3FF; color:var(--purple);}

.filters{display:flex; gap:8px; overflow-x:auto; padding:2px 20px 12px; margin:0 -20px;}
.filters::-webkit-scrollbar{display:none;}
.filters button{flex:0 0 auto; padding:10px 20px; border-radius:999px; background:#fff; border:1px solid var(--line); font-size:14px; font-weight:700; color:var(--gray2);}
.filters button.on{background:var(--blue); border-color:var(--blue); color:#fff;}

/* ───── 통계 2칸 ───── */
.stats{display:flex; gap:12px; margin-bottom:16px;}
.stat{flex:1; background:var(--blue-soft); border-radius:16px; padding:18px; text-align:center;}
.stat.g{background:#ECFDF5;}
.stat .ic{width:42px;height:42px;margin:0 auto 10px;border-radius:12px;background:#fff;display:flex;align-items:center;justify-content:center;font-size:20px;}
.stat .v{font-size:22px; font-weight:800; color:var(--blue);}
.stat.g .v{color:var(--green);}
.stat .k{font-size:12.5px; color:var(--gray2); margin-top:2px;}

/* ───── 리스트 아이템 ───── */
.li{display:flex; align-items:center; gap:12px; background:#fff; border-radius:14px; padding:14px; margin-bottom:8px;}
.li .av{width:44px;height:44px;border-radius:50%;background:var(--blue-soft);display:flex;align-items:center;justify-content:center;font-size:19px;flex:0 0 auto;}
.li .av.g{background:#ECFDF5;}
.li .tx{flex:1; min-width:0;}
.li .tx .d{font-size:12.5px; color:var(--gray);}
.li .tx b{font-size:15px; font-weight:700;}
.li .rt{font-size:13px; color:var(--gray); font-weight:600;}

/* ───── 상품 카드 ───── */
.prod{background:#fff; border-radius:16px; padding:16px; margin-bottom:12px; display:flex; gap:12px;}
.prod .l{flex:1; min-width:0;}
.prod .tags{display:flex; gap:5px; flex-wrap:wrap; margin-bottom:8px;}
.prod .nm{font-size:16px; font-weight:800;}
.prod .ds{font-size:12.5px; color:var(--gray); margin-top:2px;}
.prod .pr{margin-top:8px;}
.prod .pr .old{font-size:13px; color:#B6BCC5; text-decoration:line-through; margin-right:6px;}
.prod .pr .now{font-size:21px; font-weight:800;}
.prod .dc{font-size:13.5px; color:var(--blue); font-weight:700; margin-top:3px;}
.prod .inst{font-size:12.5px; color:var(--gray); margin-top:5px;}
.prod .go{margin-top:10px; display:inline-block; font-size:13px; font-weight:700; color:var(--blue); background:var(--blue-soft); padding:8px 14px; border-radius:9px;}
.prod .thumb{width:88px;height:88px;border-radius:14px;background:var(--blue-soft);display:flex;align-items:center;justify-content:center;font-size:30px;flex:0 0 auto;}

/* ───── 서브 페이지 ───── */
.sub-hdr{position:sticky; top:0; z-index:30; background:#fff; display:flex; align-items:center; gap:10px; padding:calc(var(--safe-top) + 14px) 16px 14px; border-bottom:1px solid var(--line);}
.sub-hdr .bk{font-size:22px; padding:0 6px; line-height:1;}
.sub-hdr h1{font-size:19px; font-weight:800; margin:0;}
.sub-body{padding:16px 20px calc(30px + var(--safe-bottom));}

/* ───── AI 채팅 ───── */
.ai-wrap{display:flex; flex-direction:column; height:100vh;}
.ai-list{flex:1; overflow-y:auto; padding:16px 16px 8px; background:var(--bg);}
.msg{display:flex; gap:9px; margin-bottom:12px;}
.msg .av{width:38px;height:38px;border-radius:50%;background:var(--blue);color:#fff;display:flex;align-items:center;justify-content:center;font-size:13px;font-weight:800;flex:0 0 auto;}
.msg .bub{background:#fff; border-radius:14px; padding:13px 15px; font-size:14.5px; line-height:1.6; max-width:78%; white-space:pre-wrap; word-break:break-word;}
.msg.me{justify-content:flex-end;}
.msg.me .bub{background:var(--blue); color:#fff;}
.ai-in{display:flex; gap:8px; padding:10px 14px calc(10px + var(--safe-bottom)); background:#fff; border-top:1px solid var(--line);}
.ai-in input{flex:1; padding:13px 16px; border:1px solid var(--line); border-radius:999px; font-size:16px; background:#fff;}
.ai-in input:focus{outline:none; border-color:var(--blue);}
.ai-in button{width:48px;height:48px;border-radius:14px;background:#D1D5DB;color:#fff;font-size:18px;flex:0 0 auto;}
.ai-in button.on{background:var(--blue);}

/* ───── FAB ───── */
.fab{
  position:fixed; right:18px; bottom:calc(90px + var(--safe-bottom)); z-index:35;
  background:linear-gradient(135deg,#6D5AE6,#8B5CF6); color:#fff;
  padding:14px 20px; border-radius:999px; font-size:14.5px; font-weight:700;
  box-shadow:0 8px 20px rgba(109,90,230,.35);
  display:flex; align-items:center; gap:8px;
}

/* ───── 로그인 ───── */
.login{min-height:100vh; display:flex; flex-direction:column; justify-content:center; padding:24px 22px calc(24px + var(--safe-bottom)); background:#fff;}
.login .logo{width:76px;height:76px;border-radius:19px;margin:0 auto 18px;display:block;}
.login h1{text-align:center; font-size:23px; font-weight:800; margin:0 0 4px;}
.login .s{text-align:center; color:var(--gray); font-size:13.5px; margin:0 0 30px;}
.field{margin-bottom:12px;}
.field label{display:block; font-size:13px; font-weight:700; margin-bottom:7px;}
.field input{width:100%; padding:16px; border:1px solid #E5E7EB; border-radius:12px; font-size:16px;}
.field input:focus{outline:none; border-color:var(--blue);}
.err{color:var(--red); font-size:13px; margin:10px 0 0; text-align:center;}

.empty{text-align:center; padding:46px 0; color:#A9B0BB; font-size:14px; line-height:1.6;}

.toast{position:fixed; left:50%; bottom:calc(96px + var(--safe-bottom)); transform:translateX(-50%); z-index:100;
  background:rgba(17,24,39,.94); color:#fff; font-size:13.5px; font-weight:600; padding:13px 18px; border-radius:11px; max-width:88%; text-align:center;}

/* ───── 모달 ───── */
.mask{position:fixed; inset:0; background:rgba(17,24,39,.45); z-index:80; display:flex; align-items:flex-end;}
.sheet{width:100%; background:#fff; border-radius:20px 20px 0 0; padding:22px 20px calc(22px + var(--safe-bottom)); max-height:86vh; overflow-y:auto;}
.sheet h3{margin:0 0 16px; font-size:18px; font-weight:800;}

/* ───── iOS 안내 ───── */
.ios-hint{position:fixed; left:12px; right:12px; bottom:calc(86px + var(--safe-bottom)); z-index:200; background:#fff; border-radius:14px; box-shadow:0 8px 28px rgba(16,24,40,.18); border:1px solid var(--line);}
.ios-hint-body{display:flex; align-items:center; gap:12px; padding:12px 14px;}
.ios-hint img{width:38px;height:38px;border-radius:9px;}
.ios-hint b{font-size:14px;}
.ios-hint p{margin:2px 0 0; font-size:12px; color:var(--gray);}
.ios-hint .share{color:var(--blue); font-weight:700;}
.ios-hint button{font-size:16px; color:#9CA3AF; padding:4px 2px; margin-left:auto;}
