/* ═══════════════════════════════════════════════════════════
   앱 셸 — 데스크톱 좌측 사이드바(240px) + 태블릿·모바일 상단바 + 하단 탭바.
   체험 띠와 상단바는 하나의 sticky 영역(.apphead)이라 서로 겹칠 수 없다.
   토큰(tokens.css)의 의미 토큰만 쓴다.
   ═══════════════════════════════════════════════════════════ */

html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--head-h, 0px) + var(--s-12)); }
body { margin: 0; background: var(--bg); color: var(--text-primary); font-family: var(--font);
  font-size: var(--text-body-size); line-height: var(--text-body-lh); -webkit-font-smoothing: antialiased;
  word-break: keep-all; overflow-wrap: anywhere; }
/* 앵커 이동 시 가려지지 않게: 머리 영역 높이 = (체험 띠) + (모바일 상단바) */
body { --head-h: var(--topbar-h); }
body.has-demo { --head-h: calc(var(--demobar-h) + var(--topbar-h)); }

.skip-link { position: absolute; left: 8px; top: -56px; z-index: 100; padding: var(--s-12) var(--s-16);
  background: var(--brand); color: var(--text-on-brand); border-radius: var(--radius-md); font-weight: 600; }
.skip-link:focus { top: 8px; }
.inline-form { display: inline; margin: 0; }

/* ── 머리 영역: 체험 띠 + 모바일 상단바를 한 덩어리로 ── */
.apphead { position: sticky; top: 0; z-index: 40; background: var(--bg); }

/* 체험 띠 — 데스크톱 한 줄(40px), 모바일 한 줄(48px). 색은 --brand-subtle-bg/-fg */
.demobar { display: flex; align-items: center; gap: var(--s-12); height: var(--demobar-h); padding: 0 var(--page-x);
  background: var(--brand-subtle-bg); color: var(--brand-subtle-fg); border-bottom: 1px solid var(--border);
  font-size: var(--text-small-size); line-height: var(--text-small-lh); white-space: nowrap; }
.demobar__text { margin: 0; font-weight: 600; overflow: hidden; text-overflow: ellipsis; min-width: 0; flex: 0 1 auto; }
.demobar__badge { display: none; align-items: center; height: 24px; padding: 0 var(--s-8); border-radius: var(--radius-sm);
  background: var(--brand); color: var(--text-on-brand); font-size: var(--text-caption-size); font-weight: 700; cursor: help; flex: none; }
/* 맨 위 띠라 말풍선은 아래로 */
.demobar .c-tip__bubble { top: calc(100% + var(--s-8)); bottom: auto; left: 0; transform: none; }
.demobar__actions { display: flex; align-items: center; gap: var(--s-8); margin-left: auto; flex: none; }
.demobar__go-short { display: none; }
.demomore { display: none; position: relative; }
.demomore > summary { list-style: none; }
.demomore > summary::-webkit-details-marker { display: none; }
.demomore__menu { position: absolute; right: 0; top: calc(100% + var(--s-4)); z-index: 60; min-width: 160px; padding: var(--s-4);
  background: var(--surface-raised); border: 1px solid var(--border); border-radius: var(--radius-md); box-shadow: var(--shadow-3); }
.demomore__item { display: block; width: 100%; min-height: 44px; padding: 0 var(--s-12); border: 0; border-radius: var(--radius-sm);
  background: none; color: var(--text-primary); font: inherit; font-size: var(--text-label-size); text-align: left; cursor: pointer; }
.demomore__item:hover { background: var(--surface-hover); }
/* 체험 코스: 띠 안의 알약 하나 → 누르면 6단계 목록. 지나간 단계는 체크, 다음 단계는 강조 */
.democourse { position: relative; flex: none; }
.democourse > summary { list-style: none; }
.democourse > summary::-webkit-details-marker { display: none; }
.democourse__chip { display: inline-flex; align-items: center; gap: var(--s-4); height: 28px; padding: 0 var(--s-12); border: 1px solid var(--brand);
  border-radius: var(--radius-full); color: var(--brand-subtle-fg); font-weight: 600; cursor: pointer; }
.democourse__chip:hover, .democourse[open] .democourse__chip { background: var(--surface); }
.democourse__chip { position: relative; }
.democourse__chip::after { content: ""; position: absolute; left: 0; right: 0; top: -8px; bottom: -8px; }   /* 누르는 영역은 44px */
.democourse__chip:focus-visible { outline: 3px solid var(--focus-ring); outline-offset: 2px; }
.democourse__count { color: var(--text-secondary); font-weight: 500; }
.democourse__count b { color: var(--brand-subtle-fg); }
.democourse.is-complete .democourse__chip { background: var(--brand); color: var(--text-on-brand); }
.democourse.is-complete .democourse__count, .democourse.is-complete .democourse__count b { color: inherit; }
.democourse__panel { position: absolute; left: 0; top: calc(100% + var(--s-8)); z-index: 60; width: min(360px, calc(100vw - 2 * var(--page-x)));
  padding: var(--s-12); background: var(--surface-raised); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-3);
  white-space: normal; color: var(--text-primary); }
.democourse__head { margin: 0 0 var(--s-8); padding: 0 var(--s-4); font-size: var(--text-caption-size); color: var(--text-secondary); }
.democourse__list { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.democourse__go { display: grid; grid-template-columns: 24px minmax(0, 1fr) 16px; align-items: center; gap: var(--s-12); width: 100%; min-height: 48px;
  padding: var(--s-8); border: 0; border-radius: var(--radius-md); background: none; color: inherit; font: inherit; text-align: left; text-decoration: none; cursor: pointer; }
.democourse__go:hover { background: var(--surface-hover); }
.democourse__go:focus-visible { outline: 3px solid var(--focus-ring); outline-offset: -3px; }
.democourse__no { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: var(--radius-full);
  border: 1px solid var(--border-strong); font-size: var(--text-caption-size); font-weight: 700; color: var(--text-secondary); }
.democourse__text { display: grid; gap: 2px; min-width: 0; }
.democourse__text b { font-size: var(--text-label-size); font-weight: 600; }
.democourse__text small { font-size: var(--text-caption-size); line-height: 1.4; color: var(--text-secondary); }
.democourse__done { visibility: hidden; color: var(--brand); }
.democourse__step.is-done .democourse__done { visibility: visible; }
.democourse__step.is-done .democourse__no { background: var(--brand-subtle-bg); border-color: var(--brand); color: var(--brand-subtle-fg); }
.democourse__step.is-next .democourse__go { background: var(--brand-subtle-bg); }
.democourse__step.is-next .democourse__no { background: var(--brand); border-color: var(--brand); color: var(--text-on-brand); }
.democourse__step.is-here .democourse__text b::after { content: " · 지금 화면"; font-weight: 500; color: var(--brand-subtle-fg); }
/* 붙어 있는 2칸 전환(현재 시점만 채움) */
.demotoggle { display: inline-flex; flex: none; border: 1px solid var(--brand); border-radius: var(--radius-md); overflow: hidden; background: var(--surface); }
.demotoggle .inline-form { display: inline-flex; }
.demotoggle__btn { height: 28px; padding: 0 var(--s-12); border: 0; background: transparent; color: var(--brand-subtle-fg);
  font: inherit; font-weight: 600; font-size: var(--text-caption-size); cursor: pointer; display: inline-flex; align-items: center; white-space: nowrap; }
.demotoggle .inline-form + .inline-form .demotoggle__btn { border-left: 1px solid var(--brand); }
.demotoggle__btn:hover { background: var(--brand-subtle-bg); }
.demotoggle__btn.is-current { background: var(--brand); color: var(--text-on-brand); cursor: default; }
.demotoggle__btn:focus-visible { outline: 3px solid var(--focus-ring); outline-offset: -3px; }

/* 모바일 상단바 */
.topbar { display: flex; align-items: center; gap: var(--s-12); height: var(--topbar-h); padding: 0 var(--page-x);
  background: var(--bg); border-bottom: 1px solid var(--border); }
.topbar__brand { display: inline-flex; align-items: center; gap: var(--s-8); min-width: 0; text-decoration: none; color: var(--text-primary); }
.topbar__brand .logo { color: var(--brand); flex: none; }
.topbar__brand-name { font-size: var(--text-body-size); font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.topbar__actions { display: flex; align-items: center; gap: var(--s-4); margin-left: auto; flex: none; }

/* ── 앱 틀: 사이드바 + 본문 ── */
.app { min-height: 100vh; }
/* 그리드 칸이 안쪽 가로 스크롤(진열대·탭·표) 때문에 넓어지지 않게 */
.app__main, .page { min-width: 0; }
.page { overflow-x: clip; }   /* 안쪽 가로 스크롤 영역(진열대 등)이 문서 폭을 늘리지 않게 — sticky는 유지된다 */

/* 사이드바 (데스크톱) */
.sidebar { display: none; }
.sidebar__brand { display: flex; align-items: center; gap: var(--s-8); padding: var(--s-20) var(--s-20) var(--s-16); text-decoration: none; color: var(--text-primary); }
.sidebar__brand .logo { color: var(--brand); }
.sidebar__names { display: grid; }
.sidebar__title { font-size: var(--text-label-size); line-height: var(--text-label-lh); font-weight: 700; }
.sidebar__space { font-size: var(--text-caption-size); line-height: var(--text-caption-lh); color: var(--text-tertiary); }

.sidebar__add { display: flex; justify-content: center; gap: var(--s-8); margin: 0 var(--s-16) var(--s-12); width: calc(100% - var(--s-16)*2); }   /* 학생의 가장 잦은 일: 사이드바 맨 위에서 바로 */
.sidebar__search { margin: 0 var(--s-16) var(--s-12); width: calc(100% - var(--s-16)*2); height: 36px;
  display: flex; align-items: center; gap: var(--s-8); padding: 0 var(--s-12);
  border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface-sunken);
  color: var(--text-tertiary); font: inherit; font-size: var(--text-small-size); cursor: pointer; transition: border-color var(--dur-fast) var(--ease-standard); }
.sidebar__search:hover { border-color: var(--border-strong); }
.sidebar__search .ic { color: var(--text-tertiary); }
.sidebar__search kbd { margin-left: auto; padding: 1px var(--s-8); border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  font-family: var(--font); font-size: var(--text-caption-size); color: var(--text-tertiary); }

.sidebar__nav { display: grid; gap: var(--s-2); padding: 0 var(--s-12); align-content: start; }
.navitem { display: flex; align-items: center; gap: var(--s-12); height: 40px; padding: 0 var(--s-12);
  border-radius: var(--radius-md); color: var(--text-secondary); text-decoration: none; font-size: var(--text-label-size); font-weight: 500;
  transition: background var(--dur-fast) var(--ease-standard), color var(--dur-fast) var(--ease-standard); }
.navitem .ic { color: var(--text-tertiary); flex: none; }
.navitem:hover { background: var(--surface-sunken); color: var(--text-primary); text-decoration: none; }
.navitem:hover .ic { color: var(--text-secondary); }
.navitem.is-active { background: var(--surface-hover); color: var(--text-primary); font-weight: 600; }
.navitem.is-active .ic { color: var(--brand); }
/* 포커스 링은 키보드로 이동할 때만. 마우스 클릭·현재 메뉴는 배경색으로만 구분. */
.navitem:focus, .bottombar__item:focus { outline: none; }
.navitem:focus-visible, .bottombar__item:focus-visible { outline: 2px solid var(--brand); outline-offset: -2px; border-radius: var(--radius-md); }
.navitem__label { flex: 1 1 auto; }
.navitem__badge { min-width: 18px; height: 18px; padding: 0 var(--s-4); border-radius: var(--radius-full); background: var(--brand); color: var(--text-on-brand);
  font-size: var(--text-caption-size); font-weight: 700; display: inline-flex; align-items: center; justify-content: center; font-variant-numeric: tabular-nums; }

.sidebar__foot { margin-top: auto; padding: var(--s-12); border-top: 1px solid var(--border); display: grid; gap: var(--s-4); }
.sidebar__me { display: flex; align-items: center; gap: var(--s-12); padding: var(--s-8) var(--s-8); }
.sidebar__me-names { display: grid; min-width: 0; }
.sidebar__me-nick { font-size: var(--text-label-size); line-height: var(--text-label-lh); font-weight: 600; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar__me-sub { font-size: var(--text-caption-size); line-height: var(--text-caption-lh); color: var(--text-tertiary); }
.sidebar__footrow { display: flex; align-items: center; gap: var(--s-8); }

/* 테마 전환 버튼 */
.theme-toggle { flex: 1 1 auto; display: inline-flex; align-items: center; gap: var(--s-8); height: 36px; padding: 0 var(--s-12);
  border: 1px solid var(--border); border-radius: var(--radius-md); background: transparent; color: var(--text-secondary);
  font: inherit; font-size: var(--text-small-size); cursor: pointer; transition: border-color var(--dur-fast) var(--ease-standard), color var(--dur-fast) var(--ease-standard); }
.theme-toggle:hover { border-color: var(--border-strong); color: var(--text-primary); }
.theme-toggle .ic { color: var(--text-tertiary); }
.logout-btn { height: 36px; padding: 0 var(--s-12); border: 1px solid var(--border); border-radius: var(--radius-md);
  background: transparent; color: var(--text-secondary); font: inherit; font-size: var(--text-small-size); cursor: pointer; }
.logout-btn:hover { border-color: var(--border-strong); color: var(--text-primary); }
.inline-form { display: inline; margin: 0; }

/* 하단 탭바 (모바일): 아이콘 24, 라벨 caption, 터치 48px 이상, 선택은 색+굵기 두 가지로 */
.bottombar { display: none; }
.bottombar__item { flex: 1 1 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--s-2);
  min-height: 56px; padding: var(--s-4) var(--s-2); position: relative;
  color: var(--text-tertiary); text-decoration: none; font-size: var(--text-caption-size); line-height: var(--text-caption-lh); font-weight: 500; }
.bottombar__item .icon { width: 24px; height: 24px; }
.bottombar__label { white-space: nowrap; }
.bottombar__item.is-active { color: var(--brand); font-weight: 700; }
.bottombar__item.is-active::before { content: ""; position: absolute; top: 0; left: 30%; right: 30%; height: 2px; border-radius: var(--radius-full); background: var(--brand); }
.bottombar__item .navitem__badge { position: absolute; top: 4px; left: 50%; margin-left: var(--s-8); }

/* 본문 컨테이너: 최대 1120px, 좌우 여백 40/24/16, 섹션 간격 40/28 */
.page { max-width: var(--content-max); margin: 0 auto; padding: var(--s-32) var(--page-x) var(--s-64); }
.page:focus { outline: none; }
.page > * + .section, .page > .section + * { margin-top: var(--section-gap); }

/* ── 페이지 머리(모든 화면 공통): eyebrow → 제목 → 한 줄 설명 → 오른쪽 주요 행동 ── */
.phead { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: var(--s-12) var(--s-24); margin-bottom: var(--s-24); }
.phead__main { min-width: 0; flex: 1 1 320px; }
.phead__crumb, .phead__eyebrow { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-4) var(--s-8); margin: 0 0 var(--s-8);
  font-size: var(--text-caption-size); line-height: var(--text-caption-lh); font-weight: var(--text-caption-weight); color: var(--text-tertiary); }
.phead__crumb a { color: var(--text-tertiary); text-decoration: none; } .phead__crumb a:hover { color: var(--text-secondary); text-decoration: underline; }
.phead__crumb .sep { color: var(--border-strong); }
.phead__title { margin: 0; font-size: var(--text-heading-size); line-height: var(--text-heading-lh); font-weight: var(--text-heading-weight);
  letter-spacing: var(--text-heading-tracking); color: var(--text-primary); }
.phead__desc { margin: var(--s-8) 0 0; max-width: 64ch; font-size: var(--text-body-size); line-height: var(--text-body-lh); color: var(--text-secondary); }
.phead__desc a { color: var(--brand-subtle-fg); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; } .phead__desc a:hover { text-decoration-thickness: 2px; }   /* 색만으로 링크를 구분하지 않게 밑줄 */
.phead__actions { display: flex; align-items: center; gap: var(--s-8); flex-wrap: wrap; flex: none; }

/* ── 데스크톱: 사이드바 켜기 ── */
@media (min-width: 1024px) {
  body { --head-h: 0px; }
  body.has-demo { --head-h: var(--demobar-h); }
  .topbar, .bottombar { display: none !important; }
  .app { display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); }
  .sidebar { display: flex; flex-direction: column; position: sticky; top: 0; align-self: start;
    height: 100vh; border-right: 1px solid var(--border); background: var(--bg); overflow: hidden; }
  /* 체험 띠는 .apphead에 붙어 있으므로, 사이드바는 그 아래에서 멈추고 높이도 그만큼 줄인다 */
  .has-demo .sidebar { height: calc(100vh - var(--demobar-h)); top: var(--demobar-h); }
  .sidebar__nav { flex: 1 1 auto; overflow-y: auto; min-height: 0; }   /* 메뉴 영역만 스크롤 */
  .sidebar__foot { flex: none; }                                        /* 아바타·테마·로그아웃은 바닥에 고정 */
}

/* ── 태블릿·모바일: 체험 띠를 압축(배지 + 시점 토글 + 내 계정으로 + 더보기) ── */
@media (max-width: 1023px) {
  .sidebar { display: none !important; }
  .demobar__text, .demobar__exit-form { display: none; }
  .demobar__badge, .demomore { display: inline-flex; }
  .bottombar.has-items { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
    background: var(--bg); border-top: 1px solid var(--border); padding-bottom: env(safe-area-inset-bottom); }
  .has-nav .page { padding-bottom: calc(var(--bottombar-h) + var(--s-32) + env(safe-area-inset-bottom)); }
  .page { padding-top: var(--s-24); }
}
@media (max-width: 640px) {
  .demobar { gap: var(--s-8); }
  .democourse__label { display: none; }            /* 좁은 화면: 고리 아이콘 + 2/6만 */
  .demobar__badge { display: none; }               /* 좁은 화면: 시점 전환·체험 코스가 체험 중임을 알려 주므로 배지는 뺀다 */
  .democourse__chip { padding: 0 var(--s-8); }
  .democourse__panel { position: fixed; left: var(--page-x); right: var(--page-x); top: calc(var(--demobar-h) + var(--s-4)); width: auto; }
  .demobar__go-long { display: none; }
  .demobar__go-short { display: inline; }
  .demotoggle__btn { padding: 0 var(--s-8); }
  .phead { align-items: stretch; }
  .phead__actions { width: 100%; }
}
@media (max-width: 359px) {
  .topbar__brand-name { display: none; }          /* 폭이 모자라면 로고만 (aria-label은 유지) */
  .demotoggle__btn { padding: 0 var(--s-4); font-size: var(--text-caption-size); }
}

@media (prefers-reduced-motion: reduce) {
  .navitem, .theme-toggle, .sidebar__search, .logout-btn { transition: none; }
}

/* ── 명령 팔레트 ── */
.palette { position: fixed; inset: 0; z-index: 95; display: grid; justify-items: center; align-items: start;
  padding: 10vh var(--s-16) var(--s-16); background: var(--overlay); }
.palette[hidden] { display: none; }
.palette__panel { width: 100%; max-width: 560px; background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius-xl); box-shadow: var(--shadow-3); overflow: hidden;
  animation: c-toast-in var(--dur-base) var(--ease-standard); }
.palette__head { display: flex; align-items: center; gap: var(--s-12); padding: var(--s-12) var(--s-16); border-bottom: 1px solid var(--border); }
.palette__head .icon { color: var(--text-tertiary); flex: none; }
.palette__input { flex: 1 1 auto; border: 0; background: none; color: var(--text-primary); font: inherit; font-size: var(--text-body-size); outline: none; }
.palette__input::placeholder { color: var(--text-tertiary); }
.palette__esc { padding: var(--s-2) var(--s-8); border: 1px solid var(--border-strong); border-radius: var(--radius-sm); font-family: var(--font); font-size: var(--text-caption-size); color: var(--text-tertiary); }
.palette__list { list-style: none; margin: 0; padding: var(--s-8); max-height: 56vh; overflow-y: auto; }
.palette__item { display: flex; align-items: center; gap: var(--s-12); padding: var(--s-8) var(--s-12); border-radius: var(--radius-md); cursor: pointer; color: var(--text-primary); }
.palette__item .icon { color: var(--text-tertiary); flex: none; }
.palette__item.is-active { background: var(--surface-hover); }
.palette__item.is-active .icon { color: var(--brand); }
.palette__label { flex: 1 1 auto; font-size: var(--text-label-size); font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.palette__hint { font-size: var(--text-caption-size); color: var(--text-tertiary); flex: none; }
.palette__empty { padding: var(--s-20); text-align: center; color: var(--text-tertiary); font-size: var(--text-label-size); }
@media (prefers-reduced-motion: reduce) { .palette__panel { animation: none; } }

/* ── 오른쪽 위 알림 종 + 프로필 메뉴 ── */
.userbar { display: none; }
@media (min-width: 1024px) {
  /* 알림·내 메뉴 알약: 페이지 맨 위 오른쪽에 두고 함께 스크롤한다(따라다니면 카드의 찜 버튼 등을 가렸다) */
  .userbar { display: flex; justify-content: flex-end; position: relative; z-index: 35; height: 0; padding: 0 var(--page-x); max-width: var(--content-max); margin: 0 auto; }
  .userbar .userbar__tools { margin-top: var(--s-12); }
}
.userbar__tools { display: inline-flex; align-items: center; gap: var(--s-4); }
.userbell { position: relative; }
.userbell__badge { position: absolute; top: 4px; right: 2px; }
.usermenu { position: relative; }
.usermenu > summary { list-style: none; cursor: pointer; }
.usermenu > summary::-webkit-details-marker { display: none; }
.usermenu__btn { display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; }
.usermenu__btn:focus-visible { outline: 3px solid var(--focus-ring); outline-offset: 2px; }
.usermenu__btn .c-avatar { width: 32px; height: 32px; }
.usermenu__panel { position: absolute; right: 0; top: calc(100% + var(--s-4)); z-index: 70; min-width: 200px; padding: var(--s-8);
  background: var(--surface-raised); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-3); }
.usermenu__who { margin: var(--s-4) var(--s-8) var(--s-8); font-size: var(--text-label-size); color: var(--text-primary); }
.usermenu__item { display: flex; align-items: center; gap: var(--s-8); width: 100%; min-height: 44px; padding: 0 var(--s-12); border: 0; border-radius: var(--radius-md);
  background: none; color: var(--text-primary); font: inherit; font-size: var(--text-label-size); text-decoration: none; text-align: left; cursor: pointer; }
.usermenu__item:hover, .usermenu__item:focus-visible { background: var(--surface-hover); outline: none; }
.usermenu__item--out { color: var(--text-secondary); border-top: 1px solid var(--border); border-radius: 0 0 var(--radius-md) var(--radius-md); margin-top: var(--s-4); }
.usermenu__form { margin: 0; }

/* ── 모바일 하단 탭 가운데 [+ 내놓기] ── */
.bottombar__add { display: none; }
@media (max-width: 1023px) {
  .bottombar__add { flex: 1 1 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; position: relative;
    min-height: 48px; color: var(--text-on-brand); text-decoration: none; font-size: var(--text-caption-size); font-weight: 700; }
  .bottombar__add .icon { width: 44px; height: 44px; padding: 10px; margin-top: -18px; border-radius: 50%; background: var(--brand); box-shadow: var(--shadow-2);
    border: 3px solid var(--bg); box-sizing: border-box; }
  .bottombar__add .bottombar__label { color: var(--brand-subtle-fg); }
  .bottombar__add:focus-visible .icon { outline: 3px solid var(--focus-ring); outline-offset: 2px; }
}

/* ── Aurora 셸(어두운 테마): 사이드바 --glass-1 + 오른쪽 1px, 현재 메뉴는 청자 빛 막대 + 옅은 청자 바탕,
      상단바·하단 탭·체험 띠는 --glass-2(휴대폰은 토큰이 불투명 배경으로 바뀐다) ── */
:root[data-theme="dark"] .sidebar { background-color: var(--glass-1); border-right: 1px solid var(--glass-1-border); }
:root[data-theme="dark"] .navitem { position: relative; }
:root[data-theme="dark"] .navitem.is-active { background-color: var(--brand-subtle-bg); color: var(--text-primary); }
:root[data-theme="dark"] .navitem.is-active::before { content: ""; position: absolute; left: 0; top: 8px; bottom: 8px; width: 2px; border-radius: var(--radius-full);
  background: var(--brand); box-shadow: var(--au-btn-glow); }
:root[data-theme="dark"] :is(.apphead, .bottombar, .demobar) { background: var(--glass-2); border-color: var(--glass-1-border);
  -webkit-backdrop-filter: var(--glass-2-backdrop); backdrop-filter: var(--glass-2-backdrop); }
:root[data-theme="dark"] .demobar { color: var(--text-primary); }
:root[data-theme="dark"] .bottombar__item.is-active .icon { fill: var(--brand-subtle-bg); }

/* ── 마무리(2026-10-21): 오른쪽 위 알림 종·프로필 ──
   높이 0인 막대 안에서 세로로 늘어나 버튼이 화면 위로 잘려 보이고(아바타 윗부분), 본문 맨 위 요소와 겹쳤다.
   → 위쪽 정렬 + 떠 있는 작은 유리 알약으로 묶고, 데스크톱 본문은 그만큼 아래에서 시작한다. */
.userbar { align-items: flex-start; }
@media (min-width: 1024px) {
  .userbar .userbar__tools { margin-top: var(--s-12); padding: var(--s-2); border: 1px solid var(--border); border-radius: var(--radius-full); background: var(--surface); box-shadow: var(--depth-shadow-1); }
  .userbar .usermenu__btn { width: 40px; height: 40px; }
  .userbar .c-icon-btn { border-radius: var(--radius-full); }
  .userbar + .page { padding-top: calc(var(--s-12) + 48px + var(--s-8)); }   /* 로그인 화면처럼 알림 종이 없는 곳은 그대로 */
}
:root[data-theme="dark"] .userbar .userbar__tools { background: var(--glass-2); border-color: var(--glass-1-border);
  -webkit-backdrop-filter: var(--glass-2-backdrop); backdrop-filter: var(--glass-2-backdrop); }
:root[data-theme="dark"] .userbell__badge { box-shadow: 0 0 0 2px var(--bg); }

/* ══════════════ 휴대폰·태블릿 터치 영역 (2026-10-22) ══════════════
   shell.css가 마지막에 읽히므로 화면별 CSS(app.css)의 작은 크기보다 이 규칙이 우선한다. tools/respcheck.py 점검 결과: 가로 스크롤·화면 밖 요소는 0건. 대신 손가락으로 누르기엔 작은 곳이 있었다.
   보이는 크기는 거의 그대로 두고 누르는 영역만 넓힌다(위아래 여백을 넓히고 같은 만큼 바깥 여백을 줄여 줄 간격은 그대로). */
@media (max-width: 1023px) {
  .topbar__brand { min-height: 44px; }
  .rprog__now { padding-block: 11px; margin-block: -11px; }
  .link__route a, .ringcard__title { display: inline-flex; align-items: center; min-height: 44px; margin-block: -9px; }
  .row__main { min-height: 44px; }
  .phead__crumb a { display: inline-flex; align-items: center; min-height: 44px; min-width: 44px; margin-block: -12px; }
  .sort { min-height: 44px; }
  .mtab { min-width: 44px; justify-content: center; }
  :is(.c-table, .table) td > a:only-child { display: inline-flex; align-items: center; min-height: 44px; margin-block: -10px; }
}
/* 체험 띠 시점 전환: 760px 이하에만 있던 '누르는 영역 넓히기'를 태블릿까지 */
@media (min-width: 761px) and (max-width: 1023px) {
  .demotoggle { overflow: visible; }
  .demotoggle__btn, .demobar .c-btn--sm { position: relative; }
  .demotoggle__btn::after { content: ""; position: absolute; left: 0; right: 0; top: -8px; bottom: -8px; }
  .demobar .c-btn--sm::after { content: ""; position: absolute; left: 0; right: 0; top: -6px; bottom: -6px; }
}
/* 태블릿(761~1023px)도 휴대폰과 같은 터치 크기 — 원래 규칙은 760px 이하에만 있었다 */
@media (min-width: 761px) and (max-width: 1023px) {
  .c-input, .c-select { min-height: 44px; }
  .c-btn--sm { height: auto; min-height: 44px; }
  .c-icon-btn--sm { width: 44px; height: 44px; }
  .pill, .button--small, .select--small, .c-select.select--small { min-height: 44px; }
  .tag__x { min-width: 44px; min-height: 44px; }
  .nextstep__all > summary { min-height: 44px; }
}

/* 로그인·바로 시작하기: 로그인 전에는 빈 사이드바 없이 가운데 두 칸(소개 + 카드) */
@media (min-width: 1024px) {
  .app--bare { grid-template-columns: minmax(0, 1fr); }
  .app--bare .sidebar { display: none; }
  .app--bare .page { display: grid; align-content: center; min-height: 100vh; }
}
