/* 소누니혼고 · 토스 앱 느낌의 담백한 화이트
   모바일: 위 헤더 + 아래 탭 / PC(900px 이상): 왼쪽 사이드바
   - 글꼴: 한글·숫자는 Pretendard, 일본어(lang="ja")는 Noto Sans JP
   - 카드는 테두리 없이 회색 바탕 위 흰 면, 모서리는 크게
   - 누르면 살짝 줄어드는 반응, 페이지는 가볍게 페이드 */

:root {
  /* 회색 단계 (어두운 → 밝은) */
  --grey-900: #111418;
  --grey-800: #1F2937;
  --grey-700: #374151;
  --grey-600: #6B7280;
  --grey-500: #8A929C;
  --grey-400: #9CA3AF;
  --grey-300: #C9CED6;
  --grey-200: #E8EBEF;
  --grey-100: #F1F2F4;
  --grey-50: #F7F8FA;

  --bg: #F4F5F7;
  --surface: #FFFFFF;
  --ink: var(--grey-900);
  --ink-2: var(--grey-700);
  --muted: var(--grey-600);
  --line: var(--grey-200);
  --line-strong: var(--grey-300);
  --hover: rgba(2, 32, 71, 0.05);
  --press: rgba(2, 32, 71, 0.09);

  --accent: #3182F6;
  --accent-ink: #1B64DA;
  --accent-soft: #E8F3FF;
  --good: #027A4B;
  --good-soft: #E5F7EF;
  --danger: #E42939;
  --danger-soft: #FFEEEE;
  --warn: #A64D00;
  --warn-soft: #FFF3E0;

  /* 다하다 로고·앱 색 (새 색 코드는 여기에만 둔다) */
  --logo-yellow: #FFD84D;
  --logo-dot: #F5A800;
  --logo-ink: #111418;
  --app-japanese: #3182F6;
  --app-fitness: #22A55B;
  --app-meal: #F08C00;
  --app-media: #E5484D;
  --app-devlog: #6E56CF;
  --app-ledger: #0F9D8A;
  --app-books: #D6457A;
  --glass: rgba(255, 255, 255, 0.72);
  --glass-line: rgba(255, 255, 255, 0.9);
  --glass-shadow: 0 8px 28px rgba(17, 20, 24, 0.12);
  --shadow-card: 0 1px 2px rgba(17, 20, 24, 0.04);

  --radius-sm: 12px;
  --radius: 18px;
  --radius-lg: 22px;
  --radius-xl: 24px;
  --nav-h: 64px;
  --dock-gap: 0px;
  --side-w: 264px;
  --shadow-float: 0 8px 28px rgba(0, 27, 55, 0.14);
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);

  --font-ko: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, system-ui, "Apple SD Gothic Neo", "Noto Sans KR", sans-serif;
  --font-ja: "Noto Sans JP", "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Pretendard Variable", sans-serif;

  font-family: var(--font-ko);
  color: var(--ink);
  background: var(--bg);
  letter-spacing: -0.01em;
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
}

/* 일본어는 일본 글꼴로 (한국식 한자 모양이 섞이지 않게) */
:lang(ja) { font-family: var(--font-ja); letter-spacing: 0; }

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
/* 두 번 눌러 확대하는 동작을 끄면 브라우저가 첫 터치를 기다리지 않고 바로 반응해요 */
a, button, input, select, textarea, label, summary, [role="button"] { touch-action: manipulation; }
body { margin: 0; line-height: 1.55; font-size: 16px; }
h1, h2, h3 { margin: 0; line-height: 1.35; letter-spacing: -0.02em; }
h1 { font-size: 26px; font-weight: 700; }
h2 { font-size: 18px; font-weight: 700; }
p { margin: 0; }
a { color: var(--accent); text-underline-offset: 3px; }
a:hover { color: var(--accent-ink); }
button, input, select, textarea { font: inherit; color: inherit; letter-spacing: inherit; }
button { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
::selection { background: rgba(49, 130, 246, 0.2); }
.muted { color: var(--muted); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.icon { flex: none; }
[hidden] { display: none !important; }

/* ---------- 누르는 느낌 (공통) ---------- */
.btn, .chip, .icon-btn, .say-btn, .star-btn, .choice-btn, .day-row, .post-row, .link-card, .tab, .segment span, .sheet-option, .picker-cell, .select-btn, .stepper-btn, .back-link, .dict-fab, .row-link {
  transition: transform 0.18s var(--ease), background-color 0.18s var(--ease), color 0.18s var(--ease),
    border-color 0.18s var(--ease), box-shadow 0.18s var(--ease), opacity 0.18s var(--ease);
}
.btn:active, .chip:active, .icon-btn:active, .say-btn:active, .star-btn:active, .choice-btn:active, .link-card:active, .select-btn:active, .stepper-btn:active, .dict-fab:active, .picker-cell:active { transform: scale(0.96); }
.day-row:active, .post-row:active, .sheet-option:active { transform: scale(0.98); }

/* ---------- 공통 요소 ---------- */
.page-head { display: flex; flex-direction: column; gap: 6px; margin: 12px 0 24px; }
.page-head-row { flex-direction: row; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 14px; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.panel { background: var(--surface); border-radius: var(--radius-lg); padding: 24px 20px; }
.panel > h2:first-child { margin-bottom: 2px; }
.actions { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
.form-narrow { max-width: none; }
.row-2 { display: grid; gap: 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 520px) { .row-2 { grid-template-columns: minmax(0, 1fr); } }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 48px; padding: 0 20px; border-radius: var(--radius); border: 0;
  font-size: 16px; font-weight: 600; text-decoration: none; cursor: pointer; white-space: nowrap;
  -webkit-user-select: none; user-select: none;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-ink); color: #fff; }
.btn-dark { background: var(--grey-800); color: #fff; }
.btn-dark:hover { background: var(--grey-900); color: #fff; }
.btn-danger { background: var(--danger-soft); color: var(--danger); }
.btn-danger:hover { background: #FFDCDC; color: var(--danger); }
.btn-ghost { background: var(--grey-100); color: var(--grey-700); }
.btn-ghost:hover { background: var(--grey-200); color: var(--grey-800); }
.panel .btn-ghost, .card .btn-ghost { background: var(--grey-100); }
.btn-sm { min-height: 38px; padding: 0 14px; font-size: 14px; border-radius: 10px; }
.btn-block { width: 100%; min-height: 56px; font-size: 17px; border-radius: 16px; }
.btn:disabled, .btn[aria-disabled="true"] { background: var(--grey-200); color: var(--grey-400); cursor: default; transform: none; }

.field { display: flex; flex-direction: column; gap: 8px; }
.field-label { font-size: 14px; font-weight: 500; color: var(--grey-600); }
.field input, .field select, .field textarea, .search input {
  width: 100%; min-height: 52px; padding: 0 16px;
  border: 0; border-radius: var(--radius); background: var(--grey-100); font-size: 16px; color: var(--ink);
  box-shadow: inset 0 0 0 1px transparent;
  transition: box-shadow 0.18s var(--ease), background-color 0.18s var(--ease);
  -webkit-appearance: none; appearance: none;
}
.field input::placeholder, .field textarea::placeholder, .search input::placeholder { color: var(--grey-400); }
.panel .field input, .panel .field select, .panel .field textarea { background: var(--grey-50); box-shadow: inset 0 0 0 1px var(--grey-200); }
.field input:hover, .field textarea:hover { box-shadow: inset 0 0 0 1px var(--grey-300); }
.field input:focus, .field select:focus, .field textarea:focus, .search input:focus {
  outline: none; background: var(--surface); box-shadow: inset 0 0 0 2px var(--accent);
}
.field select {
  padding-right: 44px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%238B95A1' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center;
}
.field-help { font-size: 13px; color: var(--muted); line-height: 1.6; }
.field-error { font-size: 13px; color: var(--danger); font-weight: 500; }
.has-error input, .has-error select, .has-error textarea, .has-error .select-btn { box-shadow: inset 0 0 0 2px var(--danger) !important; }

.alert { background: var(--danger-soft); color: var(--danger); border-radius: var(--radius); padding: 14px 16px; font-size: 15px; font-weight: 500; }

/* 알림: 아래(PC 는 위)에서 떠올랐다 사라지는 토스트 */
.messages {
  position: fixed; left: 50%; bottom: calc(var(--nav-h) + var(--dock-gap) + 16px + env(safe-area-inset-bottom)); z-index: 70;
  transform: translateX(-50%); width: min(440px, calc(100% - 32px));
  display: flex; flex-direction: column; gap: 8px; pointer-events: none;
}
.message {
  pointer-events: auto; padding: 14px 18px; border-radius: 16px; font-size: 15px; font-weight: 500;
  background: rgba(51, 61, 75, 0.96); color: #fff; box-shadow: var(--shadow-float);
  display: flex; align-items: center; gap: 10px;
  animation: toast-in 0.42s var(--ease-out) both;
}
.message::before { content: ""; flex: none; width: 20px; height: 20px; border-radius: 10px; background: var(--accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 8v5M12 16.5v.5'/%3E%3C/svg%3E") center no-repeat; }
.message-success::before { background: #19C47A url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 12 5 5 9-10'/%3E%3C/svg%3E") center no-repeat; }
.message-error::before { background-color: #F04452; }
.message.is-leaving { animation: toast-out 0.3s var(--ease) both; }
@keyframes toast-in { from { opacity: 0; transform: translateY(16px) scale(0.96); } }
@keyframes toast-out { to { opacity: 0; transform: translateY(12px) scale(0.96); } }
@media (min-width: 1024px) {
  .messages { bottom: auto; top: 24px; left: calc(50% + var(--side-w) / 2); }
  @keyframes toast-in { from { opacity: 0; transform: translateY(-16px) scale(0.96); } }
  @keyframes toast-out { to { opacity: 0; transform: translateY(-12px) scale(0.96); } }
}

.badge { display: inline-flex; align-items: center; font-size: 12px; font-weight: 600; padding: 3px 8px; border-radius: 6px; background: var(--grey-100); color: var(--grey-700); }
.badge-good { background: var(--good-soft); color: var(--good); }

.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  display: inline-flex; align-items: center; min-height: 38px; padding: 0 16px; border-radius: 19px;
  border: 0; background: var(--surface); color: var(--grey-700); font-size: 14px; font-weight: 500; text-decoration: none;
  box-shadow: inset 0 0 0 1px var(--grey-200); cursor: pointer;
}
.panel .chip, .card .chip { background: var(--grey-100); box-shadow: none; }
.chip:hover { color: var(--ink); background: var(--grey-50); }
.panel .chip:hover { background: var(--grey-200); }
.chip.is-active, .panel .chip.is-active { background: var(--grey-800); color: #fff; font-weight: 600; box-shadow: none; }

.back-link { display: inline-flex; align-items: center; gap: 2px; min-height: 44px; padding-right: 10px; color: var(--grey-600); text-decoration: none; font-size: 15px; font-weight: 500; margin: 0 0 4px -8px; border-radius: 10px; }
.back-link:hover { color: var(--ink); }
.back-link:active { transform: translateX(-2px); }

/* ---------- 홈 ---------- */

.card {
  display: flex; flex-direction: column; gap: 10px; padding: 24px 22px; border-radius: 24px;
  background: var(--surface); color: var(--ink); text-decoration: none;
}

.card-head { display: flex; align-items: center; gap: 12px; color: var(--ink); text-decoration: none; }

.card-status { font-size: 15px; font-weight: 600; color: var(--accent); margin-top: 2px; }
.card-status::after { content: " ›"; }
div.card .card-status::after { content: none; }

/* 페이지 제목: 아이콘 + 제목 + 한 줄 설명 */
.title-row { display: flex; flex-direction: column; gap: 4px; min-width: 0; }

.page-sub { font-size: 15px; color: var(--muted); margin-top: 2px; }

/* ---------- 학생 관리 ---------- */
.toolbar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 16px; }
.search { position: relative; display: flex; align-items: center; width: 280px; max-width: 100%; color: var(--grey-500); }
.search .icon { position: absolute; left: 14px; width: 20px; height: 20px; pointer-events: none; }
.search input { padding-left: 44px; min-height: 46px; font-size: 16px; background: var(--surface); }
.search input::-webkit-search-cancel-button { -webkit-appearance: none; }
@media (max-width: 599px) { .search { width: 100%; } }

.table-box { background: var(--surface); border-radius: var(--radius-lg); overflow-x: auto; padding: 4px 8px; }
.table { width: 100%; border-collapse: collapse; font-size: 15px; min-width: 560px; }
.table th { text-align: left; font-size: 13px; font-weight: 500; color: var(--grey-500); padding: 14px 14px 10px; }
.table td { padding: 14px; border-top: 1px solid var(--grey-100); }
.table tbody tr { transition: background-color 0.15s; }
.table tbody tr:hover { background: var(--grey-50); }
.row-link { color: var(--ink); font-weight: 600; text-decoration: none; }
.row-link:hover { color: var(--accent); }
.empty { padding: 48px 20px; text-align: center; color: var(--muted); background: var(--surface); border-radius: var(--radius-lg); font-size: 15px; line-height: 1.7; }

.profile { display: flex; align-items: center; gap: 16px; margin-bottom: 24px; }
.profile > div { flex: 1; min-width: 0; }
.avatar {
  flex: none; width: 56px; height: 56px; border-radius: 28px; background: var(--accent-soft); color: var(--accent);
  display: flex; align-items: center; justify-content: center; font-size: 22px; font-weight: 700;
}
.detail-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); align-items: start; }

/* ---------- 로그인 ---------- */
.page-login { background: var(--surface); }
.login { min-height: 100vh; min-height: 100dvh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.login-card { width: 100%; max-width: 400px; background: var(--surface); padding: 32px 4px; display: flex; flex-direction: column; gap: 28px; }
@media (min-width: 600px) {
  .page-login { background: var(--bg); }
  .login-card { border-radius: 28px; padding: 44px 32px; box-shadow: 0 12px 40px rgba(0, 27, 55, 0.06); }
}
.login-head { display: flex; flex-direction: column; gap: 8px; }
.login-head h1 { font-size: 28px; margin-top: 12px; }
.login-note { font-size: 14px; text-align: center; line-height: 1.6; }
.login-card .btn-primary { min-height: 56px; font-size: 17px; border-radius: 16px; }

/* ---------- 공통 추가 ---------- */
.badge-accent { background: var(--accent-soft); color: var(--accent-ink); }
.tag { display: inline-block; font-size: 12px; font-weight: 600; padding: 2px 7px; border-radius: 6px; background: var(--grey-100); color: var(--grey-600); vertical-align: middle; }
.section-title { margin: 32px 0 12px; font-size: 18px; }
.chip-lg { min-height: 44px; min-width: 56px; justify-content: center; font-weight: 600; font-size: 15px; border-radius: 14px; }
.field-inline select { min-height: 44px; font-size: 15px; padding: 0 40px 0 14px; }
.actions-split { justify-content: space-between; margin-top: 24px; }
.pager { display: flex; justify-content: space-between; margin-top: 24px; }
code { font-size: 0.9em; background: var(--grey-100); padding: 2px 6px; border-radius: 6px; }

progress.bar { -webkit-appearance: none; appearance: none; display: block; width: 100%; height: 6px; border: 0; border-radius: 3px; background: var(--grey-100); overflow: hidden; }
progress.bar::-webkit-progress-bar { background: var(--grey-100); border-radius: 3px; }
progress.bar::-webkit-progress-value { background: var(--accent); border-radius: 3px; transition: width 0.6s var(--ease-out); }
progress.bar::-moz-progress-bar { background: var(--accent); border-radius: 3px; }

/* ---------- 탭 (페이지 이동형) ---------- */
.tabs { display: flex; gap: 24px; margin: 8px 0 20px; box-shadow: inset 0 -1px 0 var(--grey-200); overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab {
  position: relative; display: inline-flex; align-items: center; gap: 4px; min-height: 48px; flex: none;
  color: var(--grey-500); text-decoration: none; font-size: 17px; font-weight: 600;
  background: none; border: 0; padding: 0; font-family: inherit; cursor: pointer; /* <button class="tab"> 용 */
}
.tab::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2px; border-radius: 1px;
  background: var(--grey-900); transform: scaleX(0); transition: transform 0.28s var(--ease-out);
}
.tab:hover { color: var(--grey-700); }
.tab.is-active { color: var(--grey-900); font-weight: 700; }
.tab.is-active::after { transform: scaleX(1); }
.tab small { font-size: 14px; color: var(--grey-400); font-weight: 500; }

/* ---------- 단어장 ---------- */
.day-list, .post-list { list-style: none; margin: 0; padding: 6px 0; background: var(--surface); border-radius: var(--radius-lg); }
.day-row { display: flex; align-items: center; gap: 14px; padding: 12px 20px; color: var(--ink); text-decoration: none; }
.day-row:hover { background: var(--grey-50); color: var(--ink); }
.day-badge { flex: none; width: 44px; height: 44px; border-radius: 14px; background: var(--grey-100); color: var(--grey-600); display: flex; align-items: center; justify-content: center; font-weight: 700; font-variant-numeric: tabular-nums; }
.day-badge.is-done { background: var(--accent-soft); color: var(--accent); }
.day-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.day-title { font-weight: 600; font-size: 16px; }
.day-title small { font-weight: 500; margin-left: 4px; }
.day-score { font-size: 14px; font-weight: 600; min-width: 64px; text-align: right; font-variant-numeric: tabular-nums; }

.word-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.word-card { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; padding: 18px 16px 18px 20px; background: var(--surface); border-radius: var(--radius-lg); }
.word-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.word-expr { font-family: var(--font-ja); font-size: 24px; font-weight: 700; line-height: 1.3; letter-spacing: 0; }
.word-reading { font-family: var(--font-ja); font-size: 14px; color: var(--muted); letter-spacing: 0; }
.word-meaning { font-size: 15px; margin-top: 6px; color: var(--grey-700); }
.word-actions { display: flex; align-items: center; gap: 2px; flex: none; }
.bookmark-form { display: inline; }
.star-btn { width: 44px; height: 44px; border: 0; border-radius: 22px; background: none; color: var(--grey-300); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.star-btn:hover { background: var(--grey-100); color: var(--grey-400); }
.star-btn.is-on { color: #FFB800; }
.star-btn.is-on svg { fill: currentColor; animation: pop 0.36s var(--ease-out); }
@keyframes pop { 40% { transform: scale(1.3); } }
.quiz-start { margin-bottom: 16px; }

.quiz { display: flex; flex-direction: column; gap: 16px; max-width: 640px; }
.quiz-head { display: flex; justify-content: space-between; align-items: center; }
.quiz-head h1 { font-size: 20px; }
.quiz-card { position: relative; min-height: 220px; padding: 32px 20px; background: var(--surface); border-radius: 28px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; text-align: center; }
.quiz-star { position: absolute; top: 8px; right: 8px; }
.quiz-word { font-family: var(--font-ja); font-size: 48px; font-weight: 700; line-height: 1.2; letter-spacing: 0; }
.choices { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.choice { min-height: 60px; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 20px; border-radius: 18px; border: 0; background: var(--surface); font-size: 17px; font-weight: 500; text-align: left; }
.choice-btn { width: 100%; cursor: pointer; }
.choice-btn:hover { background: var(--grey-50); box-shadow: inset 0 0 0 1px var(--grey-200); }
.choice.is-answer { box-shadow: inset 0 0 0 2px #19C47A; background: var(--good-soft); color: var(--good); font-weight: 700; animation: pop-soft 0.4s var(--ease-out); }
.choice.is-wrong { box-shadow: inset 0 0 0 2px #F04452; background: var(--danger-soft); color: var(--danger); animation: shake 0.4s var(--ease); }
@keyframes pop-soft { 40% { transform: scale(1.02); } }
@keyframes shake { 20%, 60% { transform: translateX(-4px); } 40%, 80% { transform: translateX(4px); } }
.choice-mark { font-size: 13px; font-weight: 700; flex: none; }
.quiz-feedback { padding: 16px 18px; border-radius: 16px; font-weight: 700; animation: rise 0.3s var(--ease-out); }
.quiz-feedback.is-good { background: var(--good-soft); color: var(--good); }
.quiz-feedback.is-bad { background: var(--danger-soft); color: var(--danger); }
.quiz-feedback .muted { font-weight: 500; }
.result-card { padding: 36px 24px; text-align: center; background: var(--surface); border-radius: 28px; display: flex; flex-direction: column; gap: 8px; }
.result-score { font-size: 56px; font-weight: 800; line-height: 1.1; letter-spacing: -0.04em; color: var(--accent); font-variant-numeric: tabular-nums; }
.result-score small { font-size: 24px; color: var(--grey-400); font-weight: 600; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }

/* ---------- 일기장 ---------- */
.cal { max-width: none; padding: 20px 16px 24px; }

.reading { display: flex; flex-direction: column; gap: 8px; }

.reading-list { list-style: none; margin: 0; padding: 0; }
.reading-row { display: flex; align-items: flex-start; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--grey-100); }
.reading-row:last-child { border-bottom: 0; }
.say-btn { flex: none; width: 44px; height: 44px; border: 0; border-radius: 22px; background: var(--accent-soft); color: var(--accent); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.say-btn:hover { background: #D6E9FF; }
.say-btn.is-playing { background: var(--accent); color: #fff; animation: pulse 1.2s var(--ease) infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(49, 130, 246, 0.4); } 100% { box-shadow: 0 0 0 12px rgba(49, 130, 246, 0); } }
.say-btn:disabled { opacity: 0.4; cursor: default; animation: none; }
.reading-text { font-family: var(--font-ja); font-size: 20px; line-height: 2.1; margin: 0; padding-top: 2px; letter-spacing: 0; }
.reading-text rt { font-size: 0.5em; color: var(--muted); }

.field textarea { min-height: 140px; padding: 14px 16px; line-height: 1.75; resize: vertical; }
.field textarea[lang="ja"] { font-family: var(--font-ja); letter-spacing: 0; }
.preview-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px; }

/* ---------- 상단 바 ---------- */

/* ---------- 수업자료 ---------- */

.post-row { position: relative; display: flex; flex-direction: column; gap: 4px; padding: 16px 44px 16px 20px; color: var(--ink); text-decoration: none; }
.post-row::after, .day-row::after {
  content: ""; position: absolute; right: 22px; top: 50%; width: 8px; height: 8px; margin-top: -4px;
  border-right: 2px solid var(--grey-300); border-top: 2px solid var(--grey-300); transform: rotate(45deg);
}
.day-row { position: relative; padding-right: 44px; }
.post-row:hover { background: var(--grey-50); color: var(--ink); }
.post-row-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.post-title { font-weight: 600; font-size: 17px; }
.post-excerpt { font-size: 15px; color: var(--grey-600); }
.post-meta { font-size: 13px; color: var(--grey-500); }

.post { max-width: none; }

.post-body { font-size: 17px; line-height: 1.85; color: var(--grey-800); overflow-wrap: anywhere; }
.post-body > * + * { margin-top: 16px; }
.post-body h2 { font-size: 21px; margin-top: 32px; color: var(--ink); }
.post-body h3 { font-size: 18px; margin-top: 24px; color: var(--ink); }
.post-body > :first-child { margin-top: 0; }
.post-body h2:first-child, .post-body h3:first-child { line-height: 1.4; }
.post-body ul, .post-body ol { padding-left: 22px; margin-bottom: 0; }
.post-body li + li { margin-top: 6px; }
.post-body blockquote { margin: 16px 0 0; padding: 14px 18px; background: var(--grey-50); border-left: 3px solid var(--accent); border-radius: 0 12px 12px 0; font-family: var(--font-ja); letter-spacing: 0; }
.post-body hr { border: 0; border-top: 1px solid var(--grey-200); margin: 28px 0; }
.post-body rt { font-size: 0.55em; color: var(--muted); }

.link-card { display: flex; flex-direction: column; gap: 2px; padding: 16px 18px; border-radius: 16px; background: var(--grey-50); color: var(--ink); text-decoration: none; box-shadow: inset 0 0 0 1px var(--grey-200); }
.link-card:hover { background: var(--accent-soft); box-shadow: none; color: var(--ink); }
.link-card-site { font-size: 13px; font-weight: 700; color: var(--accent); }
.link-card-url { font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.editor { display: flex; flex-direction: column; gap: 20px; }

/* 세그먼트: 고른 칸 아래로 흰 판이 미끄러져 간다 (두 칸 기준) */

.segment { position: relative; display: flex; }
.segment input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.segment span { flex: 1; justify-content: center; min-height: 40px; padding: 0 22px; display: inline-flex; align-items: center; border-radius: 10px; font-size: 15px; font-weight: 600; color: var(--grey-500); }
.segment input:checked + span { color: var(--ink); }
.segment input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 0; }

/* 체크박스 하나짜리 설정은 토글 스위치로 */
.check { display: inline-flex; align-items: center; gap: 12px; min-height: 48px; font-size: 16px; font-weight: 500; cursor: pointer; }
.check input {
  -webkit-appearance: none; appearance: none; flex: none; position: relative; margin: 0; cursor: pointer;
  width: 50px; height: 30px; border-radius: 15px; background: var(--grey-300);
  transition: background-color 0.25s var(--ease);
}
.check input::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 12px; background: #fff;
  box-shadow: 0 2px 4px rgba(0, 27, 55, 0.2); transition: transform 0.3s var(--ease-out);
}
.check input:checked { background: var(--accent); }
.check input:checked::after { transform: translateX(20px); }
.check:active input::after { width: 28px; }
.check input:checked:active::after { transform: translateX(16px); }

.field textarea#id_body { min-height: 360px; }
.field input[type="file"] { padding: 14px 16px; min-height: 0; }
.field input[type="file"]::file-selector-button { border: 0; border-radius: 10px; padding: 8px 14px; margin-right: 12px; background: var(--grey-200); color: var(--grey-800); font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; }

.thumb { display: flex; flex-direction: column; gap: 6px; font-size: 13px; cursor: pointer; }
.thumb img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 12px; }

/* ---------- 사전 패널 ---------- */
.dict-panel {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 40;
  width: min(420px, 100%); display: flex; flex-direction: column;
  background: var(--surface);
  box-shadow: -8px 0 32px rgba(0, 27, 55, 0.08);
  padding-bottom: env(safe-area-inset-bottom);
}
.dict-grip { display: none; }
.dict-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 10px 0 22px; min-height: 60px; }
.dict-head h2 { font-size: 20px; }
.dict-form { padding: 12px 20px 14px; }
.dict-form .search { width: 100%; }
.dict-form .search input { background: var(--grey-100); }
.dict-results { flex: 1; overflow-y: auto; padding: 4px 20px 28px; display: flex; flex-direction: column; gap: 12px; overscroll-behavior: contain; }
.dict-results .word-list { grid-template-columns: minmax(0, 1fr); }
.dict-results .word-card { background: var(--grey-50); }
.dict-lemma, .dict-empty { font-size: 15px; line-height: 1.7; }
.dict-words .word-expr { font-size: 22px; }

.dict-pane { flex: 1; min-height: 0; display: flex; flex-direction: column; animation: fade-in 0.25s var(--ease); }
@keyframes fade-in { from { opacity: 0; } }
.say-sm { width: 38px; height: 38px; border-radius: 19px; }
.say-sm .icon { width: 18px; height: 18px; }

/* 사전 열기·닫기 버튼: PC 는 오른쪽 아래 떠 있는 버튼, 모바일은 위쪽 바의 아이콘 */
.dict-fab {
  position: fixed; right: 28px; bottom: 28px; z-index: 45; display: none; align-items: center; gap: 8px;
  height: 56px; padding: 0 22px 0 18px; border: 0; border-radius: 28px; cursor: pointer;
  background: var(--accent); color: #fff; font-size: 16px; font-weight: 700; box-shadow: 0 8px 24px rgba(49, 130, 246, 0.35);
}
.dict-fab:hover { background: var(--accent-ink); }
.dict-fab[aria-expanded="true"] { background: var(--grey-800); box-shadow: 0 8px 24px rgba(0, 27, 55, 0.25); }
.icon-btn[data-dict-open][aria-expanded="true"] { background: var(--accent-soft); color: var(--accent); }
@media (min-width: 1024px) { .dict-fab { display: inline-flex; } }

.w { cursor: pointer; border-radius: 4px; transition: background-color 0.15s; }
.w:hover { background: var(--accent-soft); }
.w.is-picked { background: var(--accent-soft); box-shadow: 0 2px 0 var(--accent); }

/* 모바일: 사전은 아래에서 올라오는 시트. 위쪽 글(누른 단어)이 계속 보이게 한다. */
@media (max-width: 1023px) {
  .dict-panel {
    top: auto; height: 60vh; height: 60dvh; width: 100%; z-index: 50;
    border-radius: 24px 24px 0 0;
    box-shadow: 0 -8px 40px rgba(0, 27, 55, 0.16);
    animation: sheet-up 0.38s var(--ease-out);
  }
  /* 키보드가 올라오면 시트를 키보드 바로 위로(--kb, dict.js). 높이도 보이는 화면에 맞춰 줄여요. */
  .dict-panel { bottom: var(--kb, 0px); max-height: calc(var(--vvh, 100dvh) - 12px); overscroll-behavior: contain; }
  .dict-panel.has-keyboard { padding-bottom: 0; height: min(60dvh, calc(var(--vvh, 100dvh) - 56px)); }
  .dict-panel.is-full { height: calc(var(--vvh, 100dvh) - env(safe-area-inset-top) - 8px); border-radius: 20px 20px 0 0; }
  .dict-panel:not(.is-dragging) { transition: height 0.28s var(--ease-out), bottom 0.2s var(--ease-out); }
  .dict-panel.is-flinging { transition: transform 0.2s var(--ease); }
  .dict-grip { position: absolute; top: 0; left: 0; right: 0; height: 28px; display: flex; justify-content: center; padding-top: 8px; touch-action: none; cursor: grab; z-index: 1; }
  .dict-grip span { width: 40px; height: 4px; border-radius: 2px; background: var(--grey-300); }
  .dict-head { touch-action: none; cursor: grab; }
  .is-dragging .dict-grip, .is-dragging .dict-head { cursor: grabbing; }
  .dict-panel.is-closing { animation: sheet-down 0.25s var(--ease) both; }
  .dict-head { min-height: 52px; padding-top: 16px; }
  .dict-is-open .main { padding-bottom: 64vh; }
  /* 서버가 PC 용으로 '열림'을 그린 화면: 모바일에서는 JS 가 닫기 전에도 시트를 보이지 않는다 */
  .dict-auto .dict-panel { display: none !important; }
  .dict-auto.dict-is-open .main { padding-bottom: calc(var(--nav-h) + 40px); }
  .w { scroll-margin-top: 80px; }
}
@keyframes sheet-up { from { transform: translateY(100%); } }
@keyframes sheet-down { to { transform: translateY(100%); } }

/* PC: 사전은 오른쪽에 붙어 있는 칸. 켜 두면 내용은 6~7할 폭으로 줄고, 끄면 다시 꽉 찬다. */
@media (min-width: 1024px) {
  .dict-is-open .app {
    grid-template-columns: var(--side-w) minmax(0, 65fr) minmax(340px, 35fr);
  }
  .dict-panel {
    position: sticky; top: 0; z-index: auto; align-self: start;
    width: auto; height: 100vh; padding-bottom: 0;
    box-shadow: -1px 0 0 var(--grey-200);
  }
  .dict-panel.is-opening { animation: slide-in 0.32s var(--ease-out); }
}
@keyframes slide-in { from { opacity: 0; transform: translateX(24px); } }

.usage { margin-top: 32px; max-width: 420px; }
.usage .field-help { margin-bottom: 8px; }

/* 일기장: 연·월 고르기. 제목을 누르면 아래에서 시트가 올라온다 (JS 가 없으면 기기 기본 선택 화면) */

.month-label {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 14px;
  border-radius: 12px; font-size: 19px; font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums;
  transition: background-color 0.18s var(--ease), transform 0.18s var(--ease);
}
.month-label::after { content: ""; width: 7px; height: 7px; border-right: 2px solid var(--grey-500); border-bottom: 2px solid var(--grey-500); transform: rotate(45deg) translateY(-2px); }

/* 태그 */

.tag-check { cursor: pointer; position: relative; }
.tag-check input { position: absolute; opacity: 0; width: 0; height: 0; }
.tag-check:has(input:checked) { background: var(--grey-800); color: #fff; box-shadow: none; }
.tag-check:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.tag-add { justify-content: flex-start; flex-wrap: nowrap; }

fieldset.field { border: 0; padding: 0; margin: 0; min-width: 0; }
fieldset.field > legend { padding: 0; margin-bottom: 8px; }

/* 수업노트 필터 */

.toolbar .chip { min-height: 46px; }

/* 선생님 일기장: 학생 목록 */

/* ---------- 바텀시트 (고르기 · 연월 · 날짜) ---------- */
.select-native { position: absolute !important; opacity: 0; pointer-events: none; width: 1px !important; height: 1px !important; min-height: 0 !important; padding: 0 !important; }
.select-btn {
  display: inline-flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%;
  min-height: 52px; padding: 0 14px 0 16px; border: 0; border-radius: var(--radius); background: var(--grey-100);
  font-size: 16px; font-weight: 500; color: var(--ink); text-align: left; cursor: pointer;
}
.panel .select-btn { background: var(--grey-50); box-shadow: inset 0 0 0 1px var(--grey-200); }
.select-btn:hover { background: var(--grey-200); }
.panel .select-btn:hover { box-shadow: inset 0 0 0 1px var(--grey-300); background: var(--grey-50); }
.select-btn::after {
  content: ""; flex: none; width: 8px; height: 8px; margin: -4px 4px 0;
  border-right: 2px solid var(--grey-500); border-bottom: 2px solid var(--grey-500); transform: rotate(45deg);
}
.select-btn .select-value { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.select-btn.is-placeholder .select-value { color: var(--grey-400); }
.field-inline .select-btn, .toolbar .select-btn { width: auto; min-height: 46px; padding: 0 12px 0 16px; font-size: 15px; font-weight: 600; background: var(--surface); }
.toolbar .select-btn:hover { background: var(--grey-50); }
.date-btn::after { content: none; }
.date-btn .icon { color: var(--grey-500); }

.sheet-backdrop {
  position: fixed; inset: 0; z-index: 80; background: rgba(0, 12, 30, 0.5);
  animation: fade-in 0.25s var(--ease);
}
.sheet-backdrop.is-closing { animation: fade-out 0.22s var(--ease) both; }
@keyframes fade-out { to { opacity: 0; } }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 81;
  max-height: 80vh; max-height: 80dvh; display: flex; flex-direction: column;
  background: var(--surface); border-radius: 28px 28px 0 0;
  padding: 10px 0 calc(16px + env(safe-area-inset-bottom));
  animation: sheet-up 0.42s var(--ease-out);
  box-shadow: 0 -8px 40px rgba(0, 27, 55, 0.16);
  touch-action: pan-y;
}
.sheet::before { content: ""; flex: none; align-self: center; width: 40px; height: 4px; border-radius: 2px; background: var(--grey-300); margin-bottom: 8px; }
.sheet.is-closing { animation: sheet-down 0.26s var(--ease) both; }
.sheet-title { padding: 14px 24px 12px; font-size: 21px; font-weight: 700; letter-spacing: -0.02em; }
.sheet-body { overflow-y: auto; overscroll-behavior: contain; padding: 0 12px; }
.sheet-options { list-style: none; margin: 0; padding: 0 0 4px; }
.sheet-option {
  width: 100%; min-height: 56px; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 0 14px; border: 0; border-radius: 14px; background: none; font-size: 17px; font-weight: 500; color: var(--grey-800);
  text-align: left; cursor: pointer;
}
.sheet-option:hover, .sheet-option:focus-visible { background: var(--grey-50); outline: none; }
.sheet-option[aria-selected="true"] { color: var(--accent); font-weight: 700; }
.sheet-option[aria-selected="true"]::after {
  content: ""; flex: none; width: 18px; height: 10px; margin: -4px 4px 0 0;
  border-left: 2.5px solid var(--accent); border-bottom: 2.5px solid var(--accent); transform: rotate(-45deg);
}
.sheet-option:disabled { color: var(--grey-300); cursor: default; }
.sheet-foot { display: flex; gap: 8px; padding: 12px 20px 0; }
.sheet-foot .btn { flex: 1; min-height: 56px; border-radius: 16px; font-size: 17px; }

@media (min-width: 1024px) {
  .sheet {
    left: 50%; right: auto; bottom: auto; top: 50%; width: 420px; max-height: 72vh;
    transform: translate(-50%, -50%); border-radius: 28px; padding: 16px 0 20px;
    animation: pop-in 0.3s var(--ease-out);
  }
  .sheet::before { display: none; }
  .sheet.is-closing { animation: pop-out 0.2s var(--ease) both; }
  @keyframes pop-in { from { opacity: 0; transform: translate(-50%, -46%) scale(0.96); } }
  @keyframes pop-out { to { opacity: 0; transform: translate(-50%, -48%) scale(0.97); } }
}

/* 연·월, 날짜 고르기 */
.picker-head { display: flex; align-items: center; justify-content: space-between; padding: 0 12px 8px; }
.picker-head strong { font-size: 18px; font-variant-numeric: tabular-nums; }
.picker-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; padding: 4px 12px 8px; }
.picker-grid.is-days { grid-template-columns: repeat(7, 1fr); gap: 2px; }
.picker-wd { text-align: center; font-size: 13px; color: var(--grey-500); padding: 4px 0 8px; }
.picker-wd:first-child { color: #F04452; }
.picker-wd:last-child { color: var(--accent); }
.picker-cell {
  min-height: 52px; border: 0; border-radius: 14px; background: var(--grey-50); cursor: pointer;
  font-size: 16px; font-weight: 600; color: var(--grey-800); font-variant-numeric: tabular-nums;
}
.is-days .picker-cell { min-height: 44px; background: none; border-radius: 22px; font-weight: 500; }
.picker-cell:hover { background: var(--grey-100); }
.picker-cell.is-today { color: var(--accent); }
.picker-cell[aria-pressed="true"] { background: var(--accent); color: #fff; font-weight: 700; }
.picker-cell:disabled { color: var(--grey-300); background: none; cursor: default; transform: none; }
.picker-slide { animation: slide-x 0.28s var(--ease-out); }
.picker-slide.is-back { animation-name: slide-x-back; }
@keyframes slide-x { from { opacity: 0; transform: translateX(16px); } }
@keyframes slide-x-back { from { opacity: 0; transform: translateX(-16px); } }

/* 숫자: −  8  + */
.stepper { display: inline-flex; align-items: center; gap: 2px; padding: 4px; border-radius: 14px; background: var(--grey-100); }
.panel .stepper { background: var(--grey-50); box-shadow: inset 0 0 0 1px var(--grey-200); }
.stepper input { width: 52px !important; min-height: 40px !important; padding: 0 !important; text-align: center; background: none !important; box-shadow: none !important; font-size: 17px !important; font-weight: 700; font-variant-numeric: tabular-nums; -moz-appearance: textfield; }
.stepper input::-webkit-inner-spin-button, .stepper input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.stepper-btn { width: 40px; height: 40px; border: 0; border-radius: 10px; background: var(--surface); color: var(--grey-700); font-size: 22px; font-weight: 500; line-height: 1; cursor: pointer; box-shadow: 0 1px 3px rgba(0, 27, 55, 0.08); }
.stepper-btn:hover { color: var(--accent); }
.stepper-btn:disabled { color: var(--grey-300); box-shadow: none; background: transparent; cursor: default; transform: none; }
.stepper input.is-bump { animation: bump 0.25s var(--ease-out); }
@keyframes bump { 40% { transform: scale(1.15); } }

/* ---------- 페이지 이동: 전환 효과 없이 바로 바꾸고, 누른 즉시 위에 가는 줄로 알려요 ---------- */
/* (화면 전환 효과(View Transition)는 새 화면을 0.3초 늦게 보여 줘서 뺐어요) */
.nav-progress {
  position: fixed; top: 0; left: 0; right: 0; z-index: 1000; height: 3px; pointer-events: none;
  background: var(--app, var(--accent)); transform-origin: left; transform: scaleX(0); opacity: 0;
}
body.is-navigating .nav-progress { opacity: 1; animation: nav-progress 8s cubic-bezier(0.1, 0.7, 0.2, 1) forwards; }
@keyframes nav-progress { from { transform: scaleX(0.08); } to { transform: scaleX(0.92); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-delay: 0s !important; transition-duration: 0.01ms !important; }
  html { scroll-behavior: auto; }
}

/* ---------- 문법 ---------- */
.stack-tight { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.rule-callout {
  margin: -8px 0 20px; padding: 18px 20px; border-radius: var(--radius-lg);
  background: var(--accent-soft); color: var(--accent-ink); font-size: 18px; font-weight: 700; line-height: 1.5;
}
.practice-row { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); margin-bottom: 12px; }
.practice-card { display: flex; flex-direction: column; gap: 8px; padding: 22px 20px; border-radius: 24px; background: var(--surface); color: var(--ink); text-decoration: none; margin: 0; }
.practice-link:hover { color: var(--ink); box-shadow: 0 6px 20px rgba(0, 27, 55, 0.06); }
.practice-link:active { transform: scale(0.98); }
.practice-link { transition: transform 0.18s var(--ease), box-shadow 0.18s var(--ease); }
.practice-title { font-size: 19px; font-weight: 700; }
.practice-hint { font-size: 15px; color: var(--muted); line-height: 1.55; }
.practice-actions { display: flex; gap: 8px; align-items: center; margin-top: 6px; }
.practice-actions .field-inline { flex: 1; }
.practice-actions .select-btn { width: 100%; background: var(--grey-100); }
.practice-actions .btn { flex: none; min-width: 96px; }

.conj-scroll { overflow-x: auto; margin: 0 -4px; padding: 0 4px; }
.conj-table { width: 100%; border-collapse: collapse; font-size: 15px; min-width: 420px; }
.conj-table + .conj-table, .conj-scroll + .conj-scroll { margin-top: 16px; }
.conj-table th, .conj-table td { padding: 12px 10px; text-align: left; border-top: 1px solid var(--grey-100); vertical-align: top; }
.conj-table thead th { border-top: 0; font-size: 13px; font-weight: 600; color: var(--grey-500); white-space: nowrap; }
.conj-table tbody th { font-weight: 400; white-space: nowrap; }
.conj-form { display: block; font-size: 16px; font-weight: 600; white-space: nowrap; }

.example-text { flex: 1; min-width: 0; padding-top: 2px; }
.example-text .reading-text { font-size: 19px; line-height: 2; }
.example-ko { font-size: 15px; color: var(--grey-600); margin-top: 2px; }

.drill-target { margin-top: 8px; padding: 6px 14px; border-radius: 12px; background: var(--accent-soft); color: var(--accent-ink); font-size: 16px; font-weight: 700; }
.drill-input { min-height: 60px !important; font-size: 22px !important; font-weight: 600; text-align: center; border-radius: 18px !important; background: var(--surface) !important; }
.drill-answer { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin-top: 6px; font-size: 18px; }
.quiz-feedback { display: flex; flex-direction: column; gap: 4px; }
.quiz-feedback > .muted { font-size: 14px; }
.drill-exclude { display: flex; justify-content: center; }
.drill-wrong-answer { font-size: 18px; }

.deck-tip { font-size: 14px; }
.flash-list { display: flex; flex-direction: column; gap: 10px; }
.flash { background: var(--surface); border-radius: 24px; overflow: hidden; }
.flash-front { list-style: none; cursor: pointer; display: flex; flex-direction: column; gap: 6px; padding: 22px 22px; }
.flash-front::-webkit-details-marker { display: none; }
.flash-ko { font-size: 18px; font-weight: 600; line-height: 1.5; }
.flash-hint { font-size: 13px; color: var(--grey-400); }
.flash[open] .flash-hint { display: none; }
.flash-back { display: flex; align-items: center; gap: 12px; padding: 0 22px 22px; border-top: 1px solid var(--grey-100); padding-top: 16px; animation: rise 0.3s var(--ease-out); }
.flash-back .reading-text { flex: 1; }
.deck-controls { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.deck-controls .btn { min-height: 56px; font-size: 17px; border-radius: 16px; }
.is-deck .flash { min-height: 220px; display: flex; flex-direction: column; justify-content: center; }
.is-deck .flash-front { align-items: center; text-align: center; padding: 36px 24px; }
.is-deck .flash-ko { font-size: 22px; }
.is-deck .flash.is-in { animation: card-in 0.35s var(--ease-out); }
@keyframes card-in { from { opacity: 0; transform: translateX(24px) scale(0.98); } }
.deck-controls .btn-ghost, .drill-exclude .btn-ghost { background: var(--surface); color: var(--grey-700); }
.deck-controls .btn:disabled { background: var(--grey-200); color: var(--grey-400); }
.page-head .btn-ghost { background: var(--surface); }
.page-head .btn-ghost:hover { background: var(--grey-50); }
.conj-block + .conj-block { margin-top: 12px; padding-top: 16px; border-top: 1px solid var(--grey-100); }
.conj-kind-title { font-size: 16px; font-weight: 700; color: var(--accent-ink); margin-bottom: 4px; }
.conj-table thead th:first-child, .conj-table tbody th { font-size: 14px; font-weight: 600; color: var(--grey-800); white-space: nowrap; }
.conj-rule { font-size: 13px; color: var(--grey-600); min-width: 120px; }
.conj-ko { font-size: 13px; color: var(--accent-ink); white-space: nowrap; }
.drill-rule { margin-top: 4px; font-size: 14px; font-weight: 500; color: var(--grey-700); }
.drill-hint { background: var(--surface); border-radius: var(--radius); padding: 0 18px; }
.drill-hint summary { min-height: 48px; display: flex; align-items: center; cursor: pointer; font-size: 15px; font-weight: 600; color: var(--grey-600); list-style: none; }
.drill-hint summary::-webkit-details-marker { display: none; }
.drill-hint p { padding-bottom: 12px; font-size: 16px; }
.drill-hint p + p { margin-top: -8px; font-size: 14px; }

/* ---------------------------------------------------------------- 수업료 (가려 두고 누르면 보이기) */
.head-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.secret { display: inline-block; }
.fee-box { display: block; }
.secret summary, .fee-box summary {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 12px;
  border-radius: var(--radius-sm); background: var(--grey-100); color: var(--grey-700);
  font-size: 14px; font-weight: 600; white-space: nowrap; cursor: pointer; list-style: none; user-select: none;
  transition: transform 0.1s, background-color 0.15s;
}
.secret summary::-webkit-details-marker, .fee-box summary::-webkit-details-marker { display: none; }
.secret summary:hover, .fee-box summary:hover { background: var(--grey-200); }
.secret summary:active, .fee-box summary:active { transform: scale(0.97); }
.secret-mask { letter-spacing: 2px; color: var(--grey-400); }
.secret-show { color: var(--accent-ink); }
.secret-hide { display: none; color: var(--grey-600); }
.secret[open] .secret-mask, .fee-box[open] .secret-mask, .secret[open] .secret-show, .fee-box[open] .secret-show { display: none; }
.secret[open] .secret-hide, .fee-box[open] .secret-hide { display: inline; }
.secret-value { display: none; font-size: 16px; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }
.secret[open] .secret-value { display: inline; }
.secret[open] summary { background: var(--grey-50); box-shadow: inset 0 0 0 1px var(--grey-200); }
.fee-box { width: 100%; }

.month-nav { display: flex; align-items: center; justify-content: center; gap: 16px; margin-bottom: 16px; font-size: 17px; }
.month-nav .btn { min-width: 44px; min-height: 44px; font-size: 20px; }

@media (prefers-reduced-motion: reduce) {
  .secret summary, .fee-box summary { transition: none; }
  .secret summary:active, .fee-box summary:active { transform: none; }
}

/* ---------------------------------------------------------------- 문법: 한 눈에 보기 · 기초 문법 단계 */
.overview-sheet { position: relative; display: block; max-width: 760px; margin: 0 auto; border-radius: var(--radius); overflow: hidden; background: var(--surface); transition: transform 0.15s; }
.overview-sheet img { display: block; width: 100%; height: auto; }
.overview-sheet:active { transform: scale(0.99); }
.overview-hint { position: absolute; right: 12px; bottom: 12px; display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 14px; border-radius: 999px; background: var(--grey-900); color: var(--surface); font-size: 14px; font-weight: 600; }
.overview-hint svg { width: 16px; height: 16px; }
.grammar-group { padding: 20px; }
.grammar-group-title { margin: 0 0 8px; font-size: 15px; color: var(--grey-600); font-weight: 700; }
.step-list { list-style: none; margin: 0; padding: 0; }
.step-row { display: flex; align-items: center; gap: 14px; min-height: 56px; padding: 10px 8px; margin: 0 -8px; border-radius: var(--radius-sm); color: inherit; text-decoration: none; transition: background-color 0.15s, transform 0.1s; }
.step-row:hover { background: var(--grey-50); }
.step-row:active { transform: scale(0.98); }
.step-no { flex: none; display: flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 50%; background: var(--accent-soft); color: var(--accent-ink); font-weight: 700; font-size: 15px; }
.step-body { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.step-title { font-size: 17px; font-weight: 600; color: var(--grey-900); }
.step-rule { font-size: 14px; color: var(--grey-600); }

/* 크게 보기 (static/js/zoom.js) */
html.zoom-open { overflow: hidden; }
.zoom { width: 100vw; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; background: var(--grey-900); color: var(--surface); }
.zoom::backdrop { background: var(--grey-900); }
.zoom[open] { display: flex; flex-direction: column; }
.zoom-bar { flex: none; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: max(8px, env(safe-area-inset-top)) 12px 8px 16px; }
.zoom-tip { font-size: 14px; color: var(--grey-300); }
.zoom-close { min-height: 44px; min-width: 64px; padding: 0 16px; border: 0; border-radius: 999px; background: var(--grey-700); color: var(--surface); font: inherit; font-size: 15px; font-weight: 600; cursor: pointer; }
.zoom-stage { flex: 1; overflow: auto; display: flex; align-items: flex-start; justify-content: center; padding: 0 8px max(8px, env(safe-area-inset-bottom)); -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
.zoom-stage img { display: block; max-width: 100%; max-height: 100%; width: auto; height: auto; margin: auto; cursor: zoom-in; background: var(--surface); border-radius: var(--radius-sm); }
.zoom-stage.is-big { display: block; }
.zoom-stage.is-big img { max-width: none; max-height: none; width: max(200%, 1400px); cursor: zoom-out; }
@media (min-width: 1024px) { .zoom-stage.is-big img { width: 1800px; } }
@media (prefers-reduced-motion: reduce) {
  .dict-panel:not(.is-dragging), .dict-panel.is-flinging { transition: none; }
  .overview-sheet, .step-row { transition: none; }
  .overview-sheet:active, .step-row:active { transform: none; }
}

/* 문법 상세: 설명 · 변형표 · 예문 · 연습 사이 간격(연습 카드끼리와 같은 12px) */
.detail-stack { display: flex; flex-direction: column; gap: 12px; }
.detail-stack .practice-row { margin-bottom: 0; }

/* 글 서식 표 (core/markup.py: | 칸 | 칸 |, 칸 안 '일본어 // 뜻') */
.md-table-wrap { overflow-x: auto; margin: 12px -4px; -webkit-overflow-scrolling: touch; }
.md-table { width: 100%; min-width: 0; border-collapse: collapse; font-size: 15px; }
.md-table th, .md-table td { padding: 12px 10px; text-align: left; border-top: 1px solid var(--grey-100); vertical-align: top; }
.md-table thead th { border-top: 0; font-size: 13px; font-weight: 600; color: var(--grey-500); white-space: nowrap; }
.md-table thead th:first-child { width: 22%; }
@media (max-width: 599px) {
  .md-table { font-size: 14px; }
  .md-table th, .md-table td { padding: 10px 6px; }
  .md-table thead th:first-child { width: 19%; }
  .md-ko { font-size: 13px; }
}
.md-table tbody th { color: var(--grey-700); font-weight: 600; font-size: 14px; }
.md-ja { display: block; color: var(--grey-900); }
.md-ko { display: block; margin-top: 2px; color: var(--accent-ink); font-size: 14px; }

/* 문법 공식 상자 (templates/grammar/_formula.html) */
.formula { margin: -8px 0 20px; padding: 18px 20px; border-radius: var(--radius-lg); background: var(--surface); display: flex; flex-direction: column; gap: 10px; }
.formula-line { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin: 0; font-size: 18px; }
.formula-chip { display: inline-flex; align-items: center; min-height: 40px; padding: 0 12px; border-radius: var(--radius-sm); font-weight: 700; }
.formula-stem { background: var(--grey-100); color: var(--grey-900); }
.formula-drop { color: var(--grey-400); text-decoration-thickness: 2px; margin-left: 1px; }
.formula-end { background: var(--accent-soft); color: var(--accent-ink); }
.formula-op { color: var(--grey-500); font-weight: 700; padding: 0 2px; }
.formula-note { margin: 2px 0 0; font-size: 15px; color: var(--grey-700); }
.formula-ja { color: var(--accent-ink); font-weight: 700; }
.formula-rule { margin: 2px 0 0; padding-top: 10px; border-top: 1px solid var(--grey-100); font-size: 14px; color: var(--grey-600); line-height: 1.6; }
@media (max-width: 599px) {
  .formula-line { font-size: 16px; }
  .formula-chip { min-height: 36px; padding: 0 10px; }
}

/* 히라가나·가타카나 글자표·암기법·쓰기 연습 */
.kana-tip { margin: 0; }
.kana-table { width: 100%; border-collapse: separate; border-spacing: 4px; table-layout: fixed; }
.kana-table th { font-size: 13px; font-weight: 600; color: var(--grey-500); text-align: center; padding: 2px; }
.kana-table td { padding: 0; }
.kana-cell {
  width: 100%; min-height: 56px; border: 0; border-radius: var(--radius-sm); background: var(--grey-100);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0; cursor: pointer;
  transition: transform 0.15s var(--ease), background 0.15s var(--ease); font: inherit; color: inherit;
}
.kana-cell:active { transform: scale(0.96); }
.kana-cell.is-playing { background: var(--accent-soft); }
.kana-char { font-size: 22px; line-height: 1.2; font-weight: 500; }
.kana-ko { font-size: 12px; color: var(--grey-500); }
.kana-notes { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.kana-notes li { display: flex; align-items: center; gap: 12px; padding: 10px 0; }
.kana-notes li + li { border-top: 1px solid var(--grey-100); }
.kana-note-char {
  flex: none; width: 64px; min-height: 56px; border: 0; border-radius: var(--radius-sm); background: var(--grey-100);
  display: flex; flex-direction: column; align-items: center; justify-content: center; cursor: pointer; font: inherit; color: inherit;
}
.kana-note-char span { font-size: 24px; line-height: 1.2; }
.kana-note-char small { font-size: 12px; color: var(--grey-500); }
.kana-note-char.is-playing { background: var(--accent-soft); }
.kana-note-text { flex: 1; min-width: 0; }
.kana-quiz { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.kana-prompt { display: flex; align-items: center; gap: 12px; margin: 0; }
.kana-prompt-ko { font-size: 32px; font-weight: 700; }
.kana-pad-wrap { position: relative; width: 100%; max-width: 320px; aspect-ratio: 1; background: #fff; border-radius: var(--radius); box-shadow: inset 0 0 0 1px var(--grey-200); }
.kana-pad { display: block; width: 100%; height: 100%; touch-action: none; cursor: crosshair; }
.kana-answer {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; pointer-events: none;
  font-size: 230px; line-height: 1; color: var(--grey-900); opacity: 0.28;
}
.kana-answer[hidden] { display: none; }

/* 글자 북마크 · 쓰기 연습 (새 화면) */
.kana-cell.is-marked { background: var(--accent-soft); box-shadow: inset 0 0 0 2px var(--accent); }
.kana-cell.is-marked .kana-ko { color: var(--accent); font-weight: 600; }
.kana-cell-static { cursor: default; }

.kana-start { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.kana-start-card { display: flex; flex-direction: column; gap: 8px; padding: 16px; border-radius: var(--radius); background: var(--grey-100); }
.kana-progress { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-weight: 600; color: var(--grey-600); }
.kana-answer.is-help { opacity: 0.12; }
.kana-verdict { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; }
.kana-verdict[hidden] { display: none; }
.kana-verdict strong { font-size: 20px; }
.kana-verdict .btn.is-chosen { background: var(--grey-800); color: #fff; }
.kana-score { font-size: 20px; margin: 0; }
.kana-score span { font-weight: 700; color: var(--accent); }
.kana-note-static { cursor: default; }

/* 쓰기 연습: 화면 한 장에 들어오게 — 안내·버튼은 아래에 붙여 둬요(스크롤 필요 없음) */
.kana-mode { color: var(--grey-900); margin-right: 6px; }
.kana-quiz { gap: 8px; }
.kana-prompt-ko { font-size: 28px; line-height: 1.2; }
.kana-pad-wrap { width: min(100%, 320px, calc(100vh - 500px)); width: min(100%, 320px, calc(100dvh - 500px)); min-width: 170px; }
@media (max-height: 760px) { .kana-dock .kana-verdict .muted { display: none; } .kana-pad-wrap { width: min(100%, 320px, calc(100vh - 450px)); width: min(100%, 320px, calc(100dvh - 450px)); } }
.kana-dock {
  position: sticky; bottom: calc(var(--nav-h) + env(safe-area-inset-bottom) + 8px); z-index: 5;
  width: 100%; display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 10px 0 4px; background: linear-gradient(to bottom, rgba(255, 255, 255, 0), #fff 14px);
}
.kana-dock .kana-verdict { gap: 2px; }
.kana-dock .kana-verdict strong { font-size: 18px; }
.kana-dock .kana-verdict .muted { font-size: 14px; line-height: 1.4; }
.kana-dock .kana-verdict .actions { margin-top: 4px; }
@media (min-width: 1024px) { .kana-dock { bottom: 8px; } .kana-pad-wrap { width: min(100%, 320px, calc(100dvh - 420px)); } }

.kana-sec-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.kana-sec-head h2 { margin: 0; }
.kana-bulk { margin-left: auto; gap: 8px; cursor: pointer; }
.kana-box { width: 20px; height: 20px; border-radius: 6px; box-shadow: inset 0 0 0 2px var(--grey-300); background: #fff; display: inline-block; position: relative; }
.kana-bulk.is-on .kana-box { background: var(--accent); box-shadow: none; }
.kana-bulk.is-on .kana-box::after { content: ""; position: absolute; left: 6px; top: 2px; width: 5px; height: 10px; border: solid #fff; border-width: 0 2.5px 2.5px 0; transform: rotate(45deg); }

/* 학생 홈: 메뉴 4개를 2×2 카드로 — 한 화면에 다 보이게 작게 */

/* 선생님 홈 맨 위: 학생 관리 한 줄 카드 + 아래 2×2 메뉴 */

/* 수업노트·학습자료 상세: 지우기·고치기는 맨 위에 (글이 길어도 안 내려가도 되게) */

/* 학생 홈 맨 위: 오늘의 단어 — 누르면 예문을 읽어 줘요 */

/* 수업노트 '수업 완료' 줄 (선생님만) */

/* 선생님 홈: 다음 과외 결제 안내 */

[data-lesson-slot] .stepper { width: fit-content; }

/* 체크 목록(앱 on/off, 광장 설정) */
.check-list { display: flex; flex-direction: column; gap: 2px; }
.check-row { display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 4px 2px; font-size: 16px; color: var(--ink); cursor: pointer; }
.check-row input[type="checkbox"] { width: 22px; height: 22px; accent-color: var(--accent); flex: none; }
.check-row small { color: var(--muted); }

/* 방·광장 */
.list-rows { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.row-card { background: var(--surface); border-radius: var(--radius); padding: 16px; display: flex; flex-direction: column; gap: 6px; }
.row-card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.row-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.inline-form { display: inline-flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* 입력창 (홈 맨 위) */
.ask-box { max-width: 640px; margin-bottom: 16px; display: flex; flex-direction: column; gap: 10px; }
.ask-form { background: var(--surface); border-radius: var(--radius-lg); padding: 14px 14px 10px; display: flex; flex-direction: column; gap: 8px; }
.ask-form textarea { width: 100%; border: 0; resize: none; font-size: 16px; background: transparent; outline: none; min-height: 48px; }
.ask-form textarea::placeholder { color: var(--grey-400); }
.ask-tools { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.ask-photo { display: inline-flex; align-items: center; min-height: 44px; padding: 0 14px; border-radius: 10px; background: var(--grey-100); color: var(--grey-700); font-size: 14px; font-weight: 600; cursor: pointer; }
.ask-photo:focus-within { box-shadow: 0 0 0 2px var(--accent); }
.ask-photo.is-disabled, .ask-form [disabled] { opacity: 0.5; cursor: default; }

/* 운동·식단 */
.day-nav { display: flex; align-items: center; justify-content: space-between; gap: 12px; max-width: 640px; margin: -8px 0 16px; background: var(--surface); border-radius: var(--radius); padding: 4px; }
.fit-grid { display: grid; gap: 16px; grid-template-columns: 1fr; }
.fit-group { display: flex; flex-direction: column; gap: 4px; }
.fit-sets { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.fit-sets li { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 44px; }

.fit-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.fit-form .stepper, .confirm-form .stepper { width: fit-content; }
.fit-form { border-top: 1px solid var(--line); padding-top: 16px; }

.fit-photo { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.fit-weights { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.fit-weights li { background: var(--grey-100); border-radius: 8px; padding: 6px 10px; font-size: 14px; }

/* =====================================================================
   다하다 디자인 (목업 "다하다 시안" 기준)
   - 바탕 #F4F5F7 위 흰 면(모서리 22·24), 테두리 없음, 그림자는 아주 옅게
   - 모바일: 아래에 떠 있는 유리 탭(dock). PC(1024px~): 왼쪽에 떠 있는 유리 사이드바
   - 앱 안(2단): 위에 "‹ 😊 다하다." 알약, 제목은 "라운지." 처럼 앱 색 점
   ===================================================================== */

/* ---------- 앱 색 ---------- */
body[data-app="japanese"], [data-app="japanese"] { --app: var(--app-japanese); --app-soft: #E8F1FE; --app-ink: #1B5FCC; }
body[data-app="fitness"], [data-app="fitness"] { --app: var(--app-fitness); --app-soft: #EAF7EE; --app-ink: #17703A; }
[data-app="meal"] { --app: var(--app-meal); --app-soft: #FFF3E3; --app-ink: #9A4A00; }
body[data-app="media"], [data-app="media"] { --app: var(--app-media); --app-soft: #FDECEC; --app-ink: #B3262C; }
body[data-app="devlog"], [data-app="devlog"] { --app: var(--app-devlog); --app-soft: #EFEBFC; --app-ink: #4E3BB0; }
body[data-app="ledger"], [data-app="ledger"] { --app: var(--app-ledger); --app-soft: #E6F7F4; --app-ink: #0B6B5E; }
body[data-app="books"], [data-app="books"] { --app: var(--app-books); --app-soft: #FCE8F0; --app-ink: #A3285A; }
body { --app: var(--ink); --app-soft: var(--grey-100); --app-ink: var(--ink); }
body[data-app]:not([data-app=""]) { --accent: var(--app); --accent-ink: var(--app-ink); --accent-soft: var(--app-soft); }
body[data-app="fitness"] { --bg: #F3F6F4; }

/* ---------- 어두운 화면(미디어): 변수만 덮어쓴다 ---------- */
body[data-theme="dark"] {
  --grey-900: #F2F4F6; --grey-800: #DCE1E6; --grey-700: #C3CAD1; --grey-600: #A5AFB9;
  --grey-500: #8A95A0; --grey-400: #6B7782; --grey-300: #3B454E; --grey-200: #2F373F;
  --grey-100: #262D34; --grey-50: #1A2025;
  --bg: #14181C; --surface: #1E2429; --ink: #F2F4F6; --ink-2: #C3CAD1; --muted: #A5AFB9;
  --line: #2F373F; --line-strong: #3B454E;
  --hover: rgba(255, 255, 255, 0.06); --press: rgba(255, 255, 255, 0.1);
  --glass: rgba(30, 36, 41, 0.72); --glass-line: rgba(255, 255, 255, 0.08);
  --glass-shadow: 0 8px 28px rgba(0, 0, 0, 0.4);
  --app-soft: rgba(229, 72, 77, 0.18);
  --logo-dot: var(--logo-yellow); --logo-ink: #111418;
  color-scheme: dark;
}
body { background: var(--bg); color: var(--ink); }

/* ---------- 로고 ---------- */
.logo { display: inline-flex; align-items: center; gap: 8px; color: var(--ink); }
.logo-mark { width: 32px; height: 32px; flex: none; }
.logo-word { height: 21px; width: auto; flex: none; }
.logo-face { fill: var(--logo-yellow); }
.logo-eyes, .logo-smile { fill: none; stroke: var(--logo-ink); stroke-width: 9; stroke-linecap: round; }
.logo-ink { fill: currentColor; }
.logo-dot { fill: var(--logo-dot); }

/* ---------- 큰 틀 ---------- */
.app { min-height: 100vh; min-height: 100dvh; }
.main {
  max-width: 560px; margin: 0 auto;
  padding: calc(20px + env(safe-area-inset-top)) 20px calc(var(--nav-h) + var(--dock-gap) + 40px + env(safe-area-inset-bottom));
  display: flex; flex-direction: column; gap: 14px;
}
.main > * { margin-top: 0; margin-bottom: 0; }
.icon-btn {
  width: 44px; height: 44px; border: 0; background: none; border-radius: 14px;
  display: inline-flex; align-items: center; justify-content: center; color: var(--grey-600); cursor: pointer;
}
.icon-btn:hover { background: var(--hover); color: var(--ink); }

/* 1단 머리: 로고 또는 큰 제목 */
.pagebar { display: flex; align-items: center; justify-content: space-between; min-height: 44px; }
.pagebar-title { font-size: 22px; font-weight: 800; letter-spacing: -0.04em; }
.pagebar-mark { width: 32px; height: 32px; }
.pagebar-logo { color: var(--ink); text-decoration: none; }
.round-btn {
  position: relative; width: 44px; height: 44px; border-radius: 14px; background: var(--surface);
  display: inline-flex; align-items: center; justify-content: center; color: var(--grey-700);
}
.round-btn .icon { width: 20px; height: 20px; }
.round-btn.has-badge::after { content: ""; position: absolute; top: 10px; right: 10px; width: 8px; height: 8px; border-radius: 4px; background: var(--danger); }

/* 2단 머리: 돌아가기 알약 + 오른쪽 동작 */
.appbar { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 44px; }
.back-pill {
  display: inline-flex; align-items: center; gap: 4px; height: 36px; padding: 0 12px 0 6px;
  border-radius: 12px; background: var(--surface); color: var(--ink); text-decoration: none; box-shadow: var(--shadow-card);
}
.back-pill:hover { color: var(--ink); }
.back-pill > .icon { width: 16px; height: 16px; stroke-width: 2.4; color: var(--grey-600); }
.back-pill .logo { gap: 5px; }
.back-pill .logo-mark { width: 20px; height: 20px; }
.back-pill .logo-word { height: 13px; }
.appbar-actions { display: flex; align-items: center; gap: 6px; }
.pill-btn {
  display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 12px; border-radius: 12px;
  background: var(--surface); color: var(--ink); font-size: 13px; font-weight: 700; text-decoration: none;
}
.pill-btn .icon { width: 18px; height: 18px; }
.text-link { display: inline-flex; align-items: center; min-height: 36px; font-size: 13px; color: var(--grey-600); text-decoration: none; }
.text-link:hover { color: var(--ink); }
.text-btn { border: 0; background: none; padding: 6px 4px; font-size: 13px; font-weight: 600; color: var(--grey-600); cursor: pointer; }
.text-btn:hover { color: var(--ink); }

/* 페이지 제목: "라운지." */
.page-head { margin: 4px 0 6px; }
.page-title { font-size: 26px; font-weight: 800; letter-spacing: -0.04em; line-height: 1.25; }
.title-dot { color: var(--app); }
body:not([data-app]) .title-dot, body[data-app=""] .title-dot { color: var(--logo-dot); }
.page-sub { font-size: 14px; color: var(--muted); }

/* ---------- 아래 탭 (모바일): 화면 맨 아래에 붙은 바(footer) ---------- */
.dock {
  position: fixed; z-index: 40; left: 0; right: 0; bottom: 0;
  height: calc(var(--nav-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: center;
  background: var(--glass); border-top: 1px solid var(--glass-line);
  -webkit-backdrop-filter: blur(20px) saturate(180%); backdrop-filter: blur(20px) saturate(180%);
}
.dock[data-count="2"] { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.dock[data-count="4"] { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.dock[data-count="5"] { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.dock[data-count="6"] { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.dock-item {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  height: 100%; min-height: 44px; font-size: 11px; font-weight: 500; color: var(--grey-500); text-decoration: none;
  transition: color 0.18s var(--ease), transform 0.18s var(--ease);
}
.dock-item .icon { width: 22px; height: 22px; stroke-width: 1.9; }
.dock-item:hover { color: var(--grey-700); }
.dock-item.is-active { color: var(--app-ink); font-weight: 700; }
.dock-item:active { transform: scale(0.94); }
body[data-theme="dark"] .dock-item.is-active { color: var(--app); }

/* ---------- PC: 떠 있는 유리 사이드바 + 앱 탭 줄 ---------- */
.side, .apptabs { display: none; }
@media (min-width: 1024px) {
  .dock { display: none; }
  .app { display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); }
  .side {
    position: sticky; top: 20px; height: calc(100vh - 40px); height: calc(100dvh - 40px); margin: 20px 0 20px 20px;
    display: flex; flex-direction: column; gap: 4px; padding: 24px 14px 18px; border-radius: 28px;
    background: var(--glass); border: 1px solid var(--glass-line); box-shadow: var(--glass-shadow);
    -webkit-backdrop-filter: blur(20px) saturate(180%); backdrop-filter: blur(20px) saturate(180%);
    overflow-y: auto;
  }
  .side-brand { padding: 0 10px 22px; color: var(--ink); text-decoration: none; }
  .side-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
  .side-item {
    display: flex; align-items: center; gap: 12px; height: 46px; padding: 0 12px; border-radius: 14px;
    font-size: 15px; font-weight: 600; color: var(--grey-600); text-decoration: none;
  }
  .side-item .icon { width: 22px; height: 22px; }
  .side-item:hover { background: var(--hover); color: var(--ink); }
  .side-item.is-active { background: var(--surface); color: var(--ink); font-weight: 700; box-shadow: var(--shadow-card); }
  .side-section { margin: 18px 12px 6px; font-size: 12px; font-weight: 700; color: var(--grey-500); }
  .side-foot { margin-top: auto; padding: 14px 12px 0; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
  .side-user { font-size: 14px; font-weight: 700; }
  .main { max-width: 1040px; width: 100%; padding: 40px 48px 64px; }
  .apptabs {
    display: flex; gap: 4px; width: fit-content; max-width: 100%; padding: 4px; border-radius: 18px; overflow-x: auto;
    background: var(--glass); border: 1px solid var(--glass-line); box-shadow: var(--glass-shadow);
    -webkit-backdrop-filter: blur(20px) saturate(180%); backdrop-filter: blur(20px) saturate(180%);
  }
  .apptab {
    display: inline-flex; align-items: center; gap: 8px; height: 42px; padding: 0 16px; border-radius: 14px;
    font-size: 14px; font-weight: 600; color: var(--grey-600); text-decoration: none; white-space: nowrap;
  }
  .apptab .icon { width: 19px; height: 19px; }
  .apptab:hover { color: var(--ink); }
  .apptab.is-active { background: var(--surface); color: var(--app-ink); font-weight: 700; box-shadow: var(--shadow-card); }
  .messages { left: calc(50% + var(--side-w) / 2); }
}

/* ---------- 앱 아이콘 ---------- */
.app-icon {
  width: 44px; height: 44px; border-radius: 14px; flex: none; background: var(--app); color: #FFFFFF;
  display: inline-flex; align-items: center; justify-content: center;
}
.app-icon .icon { width: 24px; height: 24px; stroke-width: 2; }
.app-icon-kana { font-size: 20px; font-weight: 700; line-height: 1; }
.app-icon-sm { width: 26px; height: 26px; border-radius: 8px; }
.app-icon-sm .icon { width: 15px; height: 15px; }
.app-icon-sm .app-icon-kana { font-size: 13px; }

/* ---------- 공통 조각: 섹션, 목록 카드, 아바타, 묶음 목록 ---------- */
.section { display: flex; flex-direction: column; gap: 8px; margin-top: 6px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.section .section-title, .section-head .section-title { margin: 0; font-size: 15px; font-weight: 700; }
.section + .section { margin-top: 20px; }
.section-note { font-size: 12px; color: var(--muted); }
.list-card {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 18px;
  background: var(--surface); color: var(--ink); text-decoration: none; min-height: 60px;
  transition: transform 0.18s var(--ease);
}
.list-card:hover { color: var(--ink); }
.list-card:active { transform: scale(0.98); }
.list-card > .icon { margin-left: auto; width: 18px; height: 18px; color: var(--grey-400); }
.list-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.list-text strong { font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-text span { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.avatar {
  width: 36px; height: 36px; border-radius: 18px; flex: none; display: inline-flex; align-items: center; justify-content: center;
  background: var(--grey-100); color: var(--grey-700); font-size: 14px; font-weight: 700;
}
.avatar-app { background: var(--app-soft); color: var(--app-ink); }
.avatar-square { width: 40px; height: 40px; border-radius: 13px; background: var(--app-soft); }
.empty-line { font-size: 14px; color: var(--muted); padding: 6px 2px; }
.group { background: var(--surface); border-radius: var(--radius-lg); padding: 2px 16px; display: flex; flex-direction: column; }
.group-row {
  display: flex; align-items: center; gap: 10px; min-height: 52px; color: var(--ink); text-decoration: none;
  border-bottom: 1px solid var(--grey-100);
}
.group > .group-row:last-child { border-bottom: 0; }
.group-row strong { flex: 1; font-size: 14px; font-weight: 600; }
.group-row > .icon, .group-more summary > .icon { width: 18px; height: 18px; color: var(--grey-400); }
.group-meta { font-size: 13px; color: var(--muted); }
.group-meta.is-on { color: var(--accent); }
.group-more { display: block; }
.group-more summary { display: flex; align-items: center; gap: 10px; min-height: 52px; list-style: none; cursor: pointer; }
.group-more summary::-webkit-details-marker { display: none; }
.group-more[open] summary > .icon { transform: rotate(90deg); }
.group-help { padding: 0 0 14px; font-size: 13px; line-height: 1.6; color: var(--muted); }

.chip-btn { display: inline-flex; align-items: center; height: 36px; padding: 0 12px; border-radius: 12px; background: var(--grey-100); font-size: 13px; font-weight: 700; }

/* ---------- 대시보드 ---------- */
.greet { display: flex; flex-direction: column; gap: 2px; margin-top: 4px; }
.greet-date { font-size: 14px; color: var(--muted); }
.greet-title { font-size: 26px; font-weight: 700; letter-spacing: -0.03em; line-height: 1.3; }

.ask-card { display: flex; flex-direction: column; gap: 10px; background: var(--surface); border-radius: var(--radius-lg); padding: 16px; box-shadow: var(--shadow-card); }
.ask-card form { margin: 0; }
.ask-card textarea {
  display: block; width: 100%; border: 0; outline: none; resize: none; background: transparent; padding: 0;
  font-size: 16px; line-height: 1.5; min-height: 24px; color: var(--ink);
}
.ask-card textarea::placeholder { color: var(--grey-400); }
.ask-card textarea:disabled { cursor: not-allowed; }
.ask-title { margin: 0; font-size: 16px; font-weight: 700; }
.ask-hint { margin: 0; font-size: 13px; color: var(--muted); }
.ask-row { display: flex; align-items: flex-end; gap: 8px; }
.ask-chips { display: flex; flex-wrap: wrap; gap: 6px; flex: 1; min-width: 0; }
.ask-tools { display: flex; align-items: center; gap: 6px; flex: none; }
.ask-chip {
  display: inline-flex; align-items: center; height: 30px; padding: 0 10px; border-radius: 999px;
  font-size: 13px; font-weight: 600; text-decoration: none; background: var(--grey-100); color: var(--grey-700);
}
.ask-chip[data-action^="fitness."] { background: #EAF7EE; color: #17703A; }
.ask-chip[data-action="fitness.log_meal"] { background: #FFF3E3; color: #9A4A00; }
.ask-chip[data-action^="ledger."] { background: #E6F7F4; color: #0B6B5E; }
.ask-chip[data-action^="media."] { background: #FDECEC; color: #B3262C; }
.ask-chip[data-action^="devlog."] { background: #EFEBFC; color: #4E3BB0; }
.ask-chip[data-action^="books."] { background: #FCE8F0; color: #A3285A; }
.ask-photo {
  width: 36px; height: 36px; border-radius: 12px; background: var(--grey-100); color: var(--grey-600);
  display: inline-flex; align-items: center; justify-content: center; cursor: pointer;
}
.ask-photo .icon { width: 19px; height: 19px; }
.ask-photo.is-on { background: var(--ink); color: #FFFFFF; }
.ask-photo.is-disabled { opacity: 0.4; cursor: not-allowed; }
.ask-photo:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.ask-send {
  width: 36px; height: 36px; border: 0; border-radius: 12px; background: var(--logo-ink); color: #FFFFFF;
  display: inline-flex; align-items: center; justify-content: center; cursor: pointer;
}
.ask-send .icon { width: 18px; height: 18px; stroke-width: 2.2; }
.ask-send:disabled { background: var(--grey-200); color: var(--grey-400); cursor: not-allowed; }
.ask-send.is-busy { animation: pulse 1s var(--ease) infinite alternate; }
@keyframes pulse { to { opacity: 0.5; } }

.bento-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.bento {
  display: flex; flex-direction: column; gap: 6px; padding: 16px; border-radius: var(--radius-lg);
  background: var(--surface); color: var(--ink); text-decoration: none; min-width: 0;
  transition: transform 0.18s var(--ease), box-shadow 0.18s var(--ease);
}
.bento:hover { color: var(--ink); box-shadow: 0 6px 20px rgba(17, 20, 24, 0.06); }
.bento:active { transform: scale(0.98); }
.bento-tall { grid-row: span 2; gap: 10px; }

.bento-label { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700; color: var(--app-ink); }
.bento-dot { width: 8px; height: 8px; border-radius: 4px; background: var(--app); }
.bento-sub { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bento-tall .bento-sub { font-size: 13px; }
.bento-big { font-size: 40px; font-weight: 800; letter-spacing: -0.04em; line-height: 1; }
.bento-big small, .bento-mid small { font-size: 16px; font-weight: 700; color: var(--grey-400); margin-left: 2px; }
.bento-mid { font-size: 24px; font-weight: 800; letter-spacing: -0.03em; }
.bento-word { font-size: 24px; font-weight: 700; line-height: 1.4; }
.bento-meaning { font-size: 14px; font-weight: 600; color: var(--grey-700); }
.bento-word rt { font-size: 10px; color: var(--muted); font-weight: 500; }
.bento-foot { margin-top: auto; font-size: 13px; color: var(--grey-700); }
.week-bars, .week-days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.week-bars { margin-top: 4px; }
.week-bar { height: 30px; border-radius: 8px; background: var(--bg); }
.week-bar.is-past { background: var(--grey-200); }
.week-bar.is-done { background: var(--app); }
.week-bar.is-today { border: 1.5px dashed var(--grey-300); }
.week-days { font-size: 11px; color: var(--muted); text-align: center; }
.meter { height: 6px; border-radius: 3px; background: var(--grey-100); overflow: hidden; }
.meter-fill { display: block; height: 100%; width: 0; background: var(--app); border-radius: 3px; }
.meter-fill.w-10 { width: 10%; } .meter-fill.w-20 { width: 20%; } .meter-fill.w-30 { width: 30%; }
.meter-fill.w-40 { width: 40%; } .meter-fill.w-50 { width: 50%; } .meter-fill.w-60 { width: 60%; }
.meter-fill.w-70 { width: 70%; } .meter-fill.w-80 { width: 80%; } .meter-fill.w-90 { width: 90%; }
.meter-fill.w-100 { width: 100%; }

/* ---------- 앱 목록 ---------- */
.app-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.app-tile {
  display: flex; flex-direction: column; gap: 14px; min-height: 132px; padding: 16px; border-radius: var(--radius-lg);
  background: var(--surface); color: var(--ink); text-decoration: none; transition: transform 0.18s var(--ease);
}
.app-tile:hover { color: var(--ink); }
.app-tile:active { transform: scale(0.97); }
.app-tile-text { display: flex; flex-direction: column; gap: 2px; margin-top: auto; }
.app-tile-text strong { font-size: 16px; font-weight: 700; }
.app-tile-text span { font-size: 12px; color: var(--muted); }
.app-tile.is-off { opacity: 0.5; }
.app-tile.is-off .app-icon { background: var(--grey-300); }
.app-tile-note {
  justify-content: center; align-items: center; text-align: center; background: transparent;
  border: 1.5px dashed var(--grey-300); font-size: 13px; line-height: 1.5; color: var(--muted);
}

/* ---------- 내 정보 ---------- */
.profile-card { background: var(--surface); border-radius: var(--radius-xl); padding: 18px 20px; }
.profile-card summary { display: flex; align-items: center; gap: 14px; list-style: none; cursor: pointer; }
.profile-card summary::-webkit-details-marker { display: none; }
.profile-face { width: 56px; height: 56px; flex: none; }
.profile-name { font-size: 18px !important; font-weight: 800 !important; letter-spacing: -0.03em; }
.profile-form { display: flex; flex-direction: column; gap: 12px; margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--grey-100); }
.logout-btn {
  width: 100%; height: 52px; border: 0; border-radius: 16px; background: var(--surface); color: var(--app-media);
  font-size: 14px; font-weight: 700; cursor: pointer; margin-top: 8px;
}
.credits { display: flex; flex-direction: column; gap: 6px; padding: 4px 4px 0; }
.credits h2 { font-size: 12px; font-weight: 700; color: var(--muted); }
.credits p { font-size: 11px; line-height: 1.6; color: var(--grey-500); }

/* ---------- 라운지 ---------- */
.rings { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 2px; }
.ring-card { flex: 1 0 96px; max-width: 160px; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 14px 8px; border-radius: 20px; background: var(--surface); }
.ring-card strong { font-size: 13px; font-weight: 600; }
.ring-goal { font-size: 11px; color: var(--muted); }
.ring-card.is-done .ring-goal { color: var(--app-ink); font-weight: 700; }
.ring-card.is-done { background: var(--app-soft); }
.ring { width: 52px; height: 52px; }
.ring circle { fill: none; stroke-width: 6; }
.ring-track { stroke: var(--app-soft); }
.ring-fill { stroke: var(--app); stroke-linecap: round; }
.ring text { font-size: 15px; font-weight: 800; fill: var(--ink); font-family: inherit; }
.caption { font-size: 12px; color: var(--muted); margin-top: -6px; }
.people { display: flex; flex-direction: column; gap: 8px; }
.person { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 12px 14px; border-radius: 18px; background: var(--surface); }
.person strong { font-size: 14px; flex: 1; }
.person-value { font-size: 13px; color: var(--muted); }
.person-value b { color: var(--ink); }
.feed { display: flex; flex-direction: column; gap: 12px; }
.feed-card { display: flex; flex-direction: column; gap: 12px; padding: 16px; border-radius: var(--radius-xl); background: var(--surface); }
.feed-head { display: flex; align-items: center; gap: 10px; }
.feed-head .avatar { width: 38px; height: 38px; border-radius: 19px; }
.feed-menu { margin: 0 0 0 auto; }
.feed-title { font-size: 15px; font-weight: 700; }
.feed-text { font-size: 13px; line-height: 1.6; color: var(--grey-700); }
.stat-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(80px, 1fr)); gap: 8px; text-align: center; }
.stat-tile { display: flex; flex-direction: column; padding: 10px 4px; border-radius: 14px; background: var(--bg); }
.stat-tile b { font-size: 18px; }
.stat-tile span { font-size: 11px; color: var(--muted); }
.feed-card form { margin: 0; }
.cheer-btn {
  width: 100%; height: 44px; border: 0; border-radius: 14px; background: var(--bg); color: var(--app-ink);
  font-size: 14px; font-weight: 700; cursor: pointer; transition: transform 0.18s var(--ease), background-color 0.18s;
}
.cheer-btn:active { transform: scale(0.98); }
.cheer-btn.is-on { background: var(--app); color: #FFFFFF; }
.cheer-mine { font-size: 13px; color: var(--muted); text-align: center; }
.empty-card { padding: 28px 20px; border-radius: var(--radius-xl); background: var(--surface); text-align: center; font-size: 14px; line-height: 1.6; color: var(--muted); }
.lounge-settings { background: var(--surface); border-radius: var(--radius-xl); padding: 4px 16px; scroll-margin-top: 20px; }
.lounge-settings summary { min-height: 52px; display: flex; align-items: center; font-size: 14px; font-weight: 700; list-style: none; cursor: pointer; }
.lounge-settings summary::-webkit-details-marker { display: none; }
.settings-form { display: flex; flex-direction: column; gap: 16px; padding: 4px 0 16px; }
.settings-form fieldset { border: 0; margin: 0; padding: 0; display: flex; flex-direction: column; }
.settings-form legend { font-size: 12px; font-weight: 700; color: var(--muted); padding: 0 0 4px; }
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 48px; font-size: 14px; font-weight: 600; border-bottom: 1px solid var(--grey-100); cursor: pointer; }
.switch {
  appearance: none; -webkit-appearance: none; position: relative; flex: none; width: 44px; height: 26px; margin: 0;
  border-radius: 13px; background: var(--grey-200); cursor: pointer; transition: background-color 0.2s var(--ease);
}
.switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 22px; height: 22px; border-radius: 11px; background: #FFFFFF; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2); transition: transform 0.2s var(--ease); }
.switch:checked { background: var(--accent); }
.switch:checked::after { transform: translateX(18px); }

/* ---------- 로그인·오프라인 ---------- */
.login-logo { display: inline-flex; margin-bottom: 8px; }
.login-logo .logo-mark { width: 56px; height: 56px; }
.login-logo .logo-word { height: 36px; }

/* ---------- PC 에서 1단 화면 넓게 ---------- */
@media (min-width: 1024px) {
  .bento-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .app-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .greet-title { font-size: 30px; }
  .week-card, .month-card, .kcal-card, .macros, .meals, .meal-add, .week-strip, .fit-grid, .day-nav, .section-head,
  .appbar, .ask-card, .section, .profile-card, .group, .feed, .people, .rings, .lounge-settings, .logout-btn, .credits { max-width: 720px; }
  .pagebar .pagebar-logo { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .dock-item, .list-card, .bento, .app-tile, .cheer-btn, .switch, .switch::after { transition: none; }
  .ask-send.is-busy { animation: none; }
}

/* ---------- 일본어 홈(오늘의 학습) ---------- */
body[data-app="japanese"] { --bg: #F2F6FC; }
.streak-pill {
  display: inline-flex; align-items: center; gap: 4px; height: 36px; padding: 0 12px; border-radius: 12px;
  background: #FFF3E3; color: #9A4A00; font-size: 13px; font-weight: 700;
}
.streak-pill .icon { width: 16px; height: 16px; color: var(--app-meal); }
.study-word {
  display: flex; flex-direction: column; gap: 8px; width: 100%; padding: 20px; border: 0; border-radius: var(--radius-xl);
  background: var(--app); color: #FFFFFF; text-align: left; font: inherit; cursor: pointer;
  transition: transform 0.18s var(--ease);
}
.study-word:active { transform: scale(0.985); }
.study-word-top { display: flex; justify-content: space-between; font-size: 12px; opacity: 0.85; }
.study-word-main { font-size: 40px; font-weight: 700; line-height: 1.3; }
.study-word-main rt { font-size: 12px; font-weight: 500; }
.study-word-meaning { font-size: 16px; font-weight: 600; }
.study-word-example { font-size: 14px; opacity: 0.9; }
.study-word-example rt { font-size: 9px; }
.study-word-ko { font-size: 13px; opacity: 0.8; }
.chip-btn { border: 0; font-family: inherit; cursor: pointer; }
.chip-btn.is-done { background: var(--app-soft); color: var(--app-ink); }
.group-row form { margin: 0; }
@media (min-width: 1024px) { .study-word { max-width: 720px; } }

/* ---------- 운동·식단 (홈·식단) ---------- */
[data-app="meal"] { --accent: var(--app); --accent-ink: var(--app-ink); --accent-soft: var(--app-soft); }
.appbar-date { font-size: 13px; color: var(--muted); padding-right: 4px; }
.ring-track, .ring-fill { fill: none; }
.ring-big { width: 112px; height: 112px; flex: none; }
.ring-big circle { stroke-width: 14; }
.ring .ring-num { font-size: 30px; font-weight: 800; fill: var(--ink); font-family: inherit; }
.ring .ring-unit { font-size: 12px; fill: var(--muted); font-family: inherit; }
.week-card { display: flex; align-items: center; gap: 20px; padding: 20px; border-radius: var(--radius-xl); background: var(--surface); }
.week-stats { display: flex; flex-direction: column; gap: 12px; flex: 1; min-width: 0; }
.week-stats > div { display: flex; flex-direction: column; }
.stat-label { font-size: 12px; color: var(--muted); }
.stat-value { font-size: 22px; font-weight: 800; letter-spacing: -0.03em; }
.stat-value small { font-size: 13px; font-weight: 500; color: var(--grey-400); }
.month-card { display: flex; flex-direction: column; gap: 10px; padding: 18px 20px; border-radius: var(--radius-xl); background: var(--surface); }
.month-head { display: flex; justify-content: space-between; align-items: baseline; }
.month-head strong { font-size: 15px; }
.month-head span { font-size: 12px; color: var(--muted); }
.month-days, .month-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 5px; }
.month-days { font-size: 11px; color: var(--muted); text-align: center; }
.mcell { height: 26px; border-radius: 7px; background: var(--grey-100); }
.mcell.is-blank { background: transparent; }
.mcell.is-light { background: color-mix(in srgb, var(--app) 45%, #FFFFFF); }
.mcell.is-full { background: var(--app); }
.mcell.is-future { background: var(--surface); border: 1.5px dashed var(--grey-200); box-sizing: border-box; }
.mcell.is-today { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--app); }
.group-value { font-size: 14px; color: var(--grey-700); }
.group-value-meal { color: var(--app-ink); }
body[data-app="fitness"] .group-value-meal { color: #9A4A00; }
.group-row .group-meta:only-child { flex: 1; }
.fab, .fab-form .fab {
  position: fixed; right: 20px; z-index: 35; height: 52px; padding: 0 20px; border-radius: 26px; border: 0;
  bottom: calc(var(--nav-h) + var(--dock-gap) + 18px + env(safe-area-inset-bottom));
  display: inline-flex; align-items: center; gap: 6px; background: var(--app); color: #FFFFFF;
  font: inherit; font-size: 15px; font-weight: 700; text-decoration: none; cursor: pointer;
  box-shadow: 0 8px 20px color-mix(in srgb, var(--app) 35%, transparent);
}
.fab:hover { color: #FFFFFF; }
.fab .icon { width: 18px; height: 18px; stroke-width: 2.4; }
.fab-form { margin: 0; }
@media (min-width: 1024px) { .fab, .fab-form .fab { bottom: 32px; right: 40px; } }

.week-strip { display: flex; align-items: center; gap: 4px; }
.week-strip .icon-btn { width: 32px; flex: none; }
.wday {
  flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 8px 0;
  border-radius: 14px; text-decoration: none; color: var(--ink);
}
.wday span { font-size: 11px; opacity: 0.7; }
.wday b { font-size: 15px; font-weight: 700; }
.wday.is-selected { background: var(--logo-ink); color: #FFFFFF; }
.wdot { width: 5px; height: 5px; border-radius: 3px; background: transparent; }
.wdot.is-logged { background: var(--app); }
.wdot.is-today { background: var(--logo-yellow); }
.kcal-card { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 20px; border-radius: var(--radius-xl); background: var(--surface); }
.kcal-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.kcal-big { font-size: 40px; font-weight: 800; letter-spacing: -0.04em; line-height: 1.1; }
.kcal-label { font-size: 14px; color: var(--muted); }
.ring-kcal { width: 84px; height: 84px; flex: none; }
.ring-kcal circle { stroke-width: 14; }
.ring-track { stroke: var(--app-soft); }
.ring-fill { stroke: var(--app); stroke-linecap: round; }
.macros { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.macro-card { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 14px 8px; border-radius: var(--radius-xl); background: var(--surface); text-align: center; }
.macro-card b { font-size: 17px; font-weight: 800; letter-spacing: -0.03em; }
.macro-card span { font-size: 12px; color: var(--muted); }
.ring-macro { width: 56px; height: 56px; }
.ring-macro circle { stroke-width: 7; }
.ring-macro.ring-carbs .ring-fill { stroke: #FFC266; }
.ring-macro.ring-fat .ring-fill { stroke: #9A4A00; }
.ring-macro .ring-track { stroke: #F5EFE7; }
.meals { display: flex; flex-direction: column; gap: 8px; }
.meal-item { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: var(--radius-xl); background: var(--surface); }
.meal-thumb { width: 64px; height: 64px; border-radius: 16px; flex: none; background: #FFE3C2; color: #9A4A00; display: inline-flex; align-items: center; justify-content: center; font-size: 22px; font-weight: 700; }
.meal-body { display: flex; flex-direction: column; gap: 3px; flex: 1; min-width: 0; }
.meal-top { display: flex; justify-content: space-between; gap: 8px; }
.meal-top strong { font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.meal-top span { font-size: 12px; color: var(--muted); flex: none; }
.meal-kcal { font-size: 14px; font-weight: 700; }
.meal-macros { font-size: 12px; color: var(--muted); }
.meal-item form { margin: 0; }
.meal-add { background: var(--surface); border-radius: var(--radius-xl); padding: 4px 16px; }
.meal-add summary { min-height: 52px; display: flex; align-items: center; font-size: 14px; font-weight: 700; list-style: none; cursor: pointer; }
.meal-add summary::-webkit-details-marker { display: none; }
.meal-add .fit-form, .meal-add .fit-photo { padding-bottom: 16px; }
.fit-photo { display: flex; gap: 8px; align-items: center; margin-bottom: 12px; }
.field-inline { flex: 1; }
.field-inline input { width: 100%; min-height: 44px; border: 0; border-radius: 12px; background: var(--grey-100); padding: 0 12px; font-size: 16px; }
.feed-badge { position: absolute; top: 20px; right: 16px; font-size: 11px; font-weight: 700; color: var(--app-ink); background: var(--app-soft); padding: 4px 8px; border-radius: 8px; }
.feed-card { position: relative; }

/* 식단 화면: 블록 사이 간격 */
.meal-screen { display: flex; flex-direction: column; gap: 16px; }
.meal-screen .section-head { margin-top: 8px; }

/* ---------- 미디어(어두운 앱) ---------- */
.media-chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; margin-bottom: 4px; }
.media-chips::-webkit-scrollbar { display: none; }
.media-chip { flex: none; min-height: 40px; padding: 0 16px; display: inline-flex; align-items: center; border-radius: 999px; background: var(--surface); color: var(--ink-2); font-size: 13px; font-weight: 700; text-decoration: none; }
.media-chip.is-active { background: var(--app); color: #fff; }
.stat-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.stat-card { background: var(--surface); border-radius: var(--radius-lg); padding: 14px; display: flex; flex-direction: column; gap: 2px; }
.stat-card .stat-label { font-size: 12px; color: var(--muted); }
.stat-card .stat-value { font-size: 24px; font-weight: 800; letter-spacing: -0.03em; }
.stat-card .stat-value small { font-size: 13px; color: var(--muted); font-weight: 700; margin-left: 2px; }
.poster-row { display: flex; gap: 10px; overflow-x: auto; margin: 0 -20px; padding: 0 20px 4px; scrollbar-width: none; }
.poster-row::-webkit-scrollbar { display: none; }
.poster-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 14px 10px; }
.poster-item { position: relative; display: flex; flex-direction: column; gap: 4px; width: 92px; flex: none; color: var(--ink); text-decoration: none; }
.poster-grid .poster-item { width: auto; }
.poster { position: relative; display: block; width: 100%; aspect-ratio: 92 / 136; border-radius: 12px; overflow: hidden; background: #3F3A63; color: #fff; }
.poster img { width: 100%; height: 100%; object-fit: cover; display: block; }
.poster-name { position: absolute; inset: 0; display: flex; align-items: flex-end; padding: 8px; font-size: 12px; font-weight: 700; line-height: 1.3; word-break: keep-all; }
.poster-c0 { background: #6B3A3A; } .poster-c1 { background: #2F4F5F; } .poster-c2 { background: #5B4A2B; }
.poster-c3 { background: #3F3A63; } .poster-c4 { background: #2F5B45; } .poster-c5 { background: #5B2F4F; }
.poster-sm { width: 44px; aspect-ratio: 44 / 64; border-radius: 8px; flex: none; }
.poster-sm .poster-name { font-size: 10px; padding: 4px; }
.poster-md { width: 72px; aspect-ratio: 72 / 106; flex: none; }
.poster-lg { width: 120px; aspect-ratio: 120 / 176; flex: none; border-radius: 16px; }
.poster-save { position: absolute; top: 6px; right: 6px; margin: 0; }
.poster-btn { width: 28px; height: 28px; min-height: 0; padding: 0; border: 0; border-radius: 9px; background: rgba(20, 24, 28, 0.62); color: #fff; display: flex; align-items: center; justify-content: center; cursor: pointer; }
.poster-btn .icon { width: 16px; height: 16px; }
.poster-btn.is-on { background: var(--app); }
.poster-title { font-size: 12px; font-weight: 700; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; word-break: keep-all; }
.poster-sub { font-size: 11px; color: var(--muted); }
.stars { color: #F5B73B; letter-spacing: 0.02em; font-size: 12px; }
.stars small { color: var(--muted); font-size: 11px; }
.stars-lg { font-size: 18px; }
.row-title { font-size: 13px; font-weight: 700; color: var(--ink-2); margin: 8px 0 0; }
.media-tags { display: flex; gap: 8px; flex-wrap: wrap; }
.media-tag { padding: 0 12px; min-height: 32px; display: inline-flex; align-items: center; border-radius: 999px; background: var(--app-soft); color: var(--ink); font-size: 12px; font-weight: 700; text-decoration: none; }
.media-tag-add, .media-tag-dim { background: var(--surface); color: var(--muted); }
.dist-card { background: var(--surface); border-radius: var(--radius-lg); padding: 16px; display: flex; flex-direction: column; gap: 10px; margin-top: 8px; }
.dist-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.dist-head h2 { font-size: 14px; margin: 0; }
.dist-head span { font-size: 12px; color: var(--muted); }
.dist-head b { color: var(--ink); }
.dist-svg { width: 100%; height: auto; }
.dist-bar { fill: var(--grey-300); }
.dist-bar.is-peak { fill: var(--app); }
.dist-label { fill: var(--muted); font-size: 8px; }
.media-list { display: flex; flex-direction: column; }
.media-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; color: var(--ink); text-decoration: none; }
.media-row + .media-row { border-top: 1px solid var(--line); }
.media-row-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; color: var(--ink); text-decoration: none; }
.media-row-text strong { font-size: 15px; }
.media-row-text > span { font-size: 12px; color: var(--muted); }
.media-note { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.search-bar { display: flex; gap: 8px; }
.search-bar input { flex: 1; min-width: 0; height: 48px; padding: 0 16px; border: 0; border-radius: 14px; background: var(--surface); color: var(--ink); font-size: 16px; }
.notice { background: var(--app-soft); border-radius: 14px; padding: 12px 14px; font-size: 13px; }
.genre-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.genre-pick { position: relative; }
.genre-pick input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.genre-pick span { min-height: 44px; padding: 0 18px; display: inline-flex; align-items: center; border-radius: 999px; background: var(--grey-100); color: var(--ink-2); font-size: 14px; font-weight: 700; }
.genre-pick input:checked + span { background: var(--app); color: #fff; }
.genre-pick input:focus-visible + span { outline: 2px solid var(--app); outline-offset: 2px; }
.detail-hero { display: flex; gap: 16px; align-items: flex-end; margin-top: 8px; }
.detail-head { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.detail-title { font-size: 22px; line-height: 1.25; margin: 0; word-break: keep-all; }
.detail-orig, .detail-meta { font-size: 12px; color: var(--muted); }
.detail-overview { font-size: 14px; line-height: 1.7; color: var(--ink-2); margin: 0; }
.credit { font-size: 11px; color: var(--muted); margin: 0; }
.media-card { display: flex; gap: 12px; color: var(--ink); text-decoration: none; }
.media-card-text { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.media-card-text strong { font-size: 15px; }
.media-card-meta { font-size: 12px; color: var(--muted); }
body[data-app="media"] .bento-dot { background: var(--app-media); }
@media (min-width: 1024px) {
  .media-chips, .stat-row, .poster-grid, .dist-card, .search-bar, .notice, .media-list, .detail-hero { max-width: 720px; }
  .poster-row { margin: 0; padding: 0 0 4px; max-width: 720px; }
}

/* 책·만화(밝은 앱) — 표지는 포스터 카드를 그대로 쓴다 */
.shelf-row { display: flex; align-items: center; gap: 12px; padding: 12px 0; }
.shelf-row + .shelf-row { border-top: 1px solid var(--line); }
.shelf-cover { flex: none; }
.shelf-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.shelf-title { font-size: 15px; font-weight: 700; color: var(--ink); text-decoration: none; }
.shelf-meta { font-size: 12px; color: var(--muted); }
.shelf-row .page-form { display: flex; align-items: center; gap: 6px; }
.shelf-row .page-form input[type="number"] { width: 72px; min-height: 44px; font-size: 16px; text-align: center; border: 0; border-radius: 12px; background: var(--grey-100); color: var(--ink); }
.shelf-row progress.bar::-webkit-progress-value { background: var(--app); }
.shelf-row progress.bar::-moz-progress-bar { background: var(--app); }
.source-note { font-size: 11px; color: var(--muted); margin: 8px 0 0; }
body[data-app="books"] .bento-dot { background: var(--app-books); }
@media (min-width: 1024px) {
  .shelf-row, .source-note { max-width: 720px; }
}

/* 개발 기록(밝은 앱, 보라) — 잔디·프로젝트 카드·할 일 줄 */
.grass-card { background: var(--card, #fff); border-radius: var(--radius-lg); padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.grass-scroll { overflow-x: auto; scrollbar-width: none; }
.grass-svg { display: block; min-width: 330px; width: 100%; height: auto; }
.grass-cell { fill: #ECEEF2; background: #ECEEF2; }
.grass-cell.g1 { fill: #D9D2F6; background: #D9D2F6; } .grass-cell.g2 { fill: #B3A5EE; background: #B3A5EE; }
.grass-cell.g3 { fill: #8C77E2; background: #8C77E2; } .grass-cell.g4 { fill: #6E56CF; background: #6E56CF; }
.grass-legend { display: flex; align-items: center; gap: 4px; justify-content: flex-end; font-size: 11px; color: var(--muted); }
.grass-legend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; }
.proj-card { display: flex; flex-direction: column; gap: 8px; background: var(--card, #fff); border-radius: var(--radius-lg); padding: 16px; margin-bottom: 10px; color: var(--ink); text-decoration: none; }
.proj-top { display: flex; align-items: center; gap: 6px; justify-content: space-between; }
.proj-top strong { font-size: 15px; margin-right: auto; }
.proj-meta { font-size: 12px; color: var(--muted); }
.proj-card progress.bar::-webkit-progress-value { background: var(--app); }
.proj-card progress.bar::-moz-progress-bar { background: var(--app); }
.task-row { display: flex; align-items: center; gap: 10px; padding: 12px 0; flex-wrap: wrap; }
.task-row + .task-row { border-top: 1px solid var(--line); }
.task-text { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.task-key { font-size: 12px; font-weight: 700; color: var(--app-ink); background: var(--app-soft); border-radius: 8px; padding: 2px 8px; }
.task-actions { display: flex; gap: 6px; }
.log-row { display: flex; align-items: flex-start; gap: 10px; padding: 10px 0; font-size: 14px; line-height: 1.5; }
.log-row + .log-row { border-top: 1px solid var(--line); }
.log-text { flex: 1; min-width: 0; }
.log-card strong { font-size: 14px; }
body[data-app="devlog"] .bento-dot { background: var(--app-devlog); }
@media (min-width: 1024px) {
  .grass-card, .proj-card, .task-row, .log-row { max-width: 720px; }
}

/* 가계부(밝은 앱, 청록) — 들어올 때 비밀번호를 다시 확인하므로 앱 안에서는 금액을 그대로 보여 줘요.
   내역은 토스·은행 앱 거래 내역처럼: 날짜 머리(그날 합계) + 아이콘·메모·분류 + 오른쪽 금액, 누르면 상세. */
body[data-app="ledger"] {
  --cat-0: #0F9D8A; --cat-1: #5BC4B4; --cat-2: #3B82F6; --cat-3: #F5B73B; --cat-4: #9AA3AF;
}
.ledger-room { font-size: 13px; color: var(--muted); margin: -4px 0 12px; }
.ledger-total { background: var(--card, #fff); border-radius: var(--radius-lg); padding: 18px 16px; display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.ledger-money { font-size: 28px; font-weight: 800; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.ledger-count { font-size: 13px; color: var(--muted); }
.ledger-pace { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.ledger-sentence { font-size: 13px; color: var(--ink-2); margin: 0; }
.ledger-pace progress.bar::-webkit-progress-value { background: var(--app); }
.ledger-pace progress.bar::-moz-progress-bar { background: var(--app); }
.ledger-pace progress.bar-fast::-webkit-progress-value { background: #E5484D; }
.ledger-pace progress.bar-fast::-moz-progress-bar { background: #E5484D; }
.donut-row { display: flex; align-items: center; gap: 20px; }
.donut { width: 120px; height: 120px; flex: none; }
.donut-bg { stroke: #ECEEF2; }
.donut-seg.d0, .dot.d0 { stroke: var(--cat-0); background: var(--cat-0); } .donut-seg.d1, .dot.d1 { stroke: var(--cat-1); background: var(--cat-1); }
.donut-seg.d2, .dot.d2 { stroke: var(--cat-2); background: var(--cat-2); } .donut-seg.d3, .dot.d3 { stroke: var(--cat-3); background: var(--cat-3); }
.donut-seg.d4, .dot.d4 { stroke: var(--cat-4); background: var(--cat-4); }
.donut-legend { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; font-size: 13px; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 4px; margin-right: 6px; }
.exp-day { display: flex; flex-direction: column; gap: 6px; }
.exp-day-head { display: flex; align-items: baseline; justify-content: space-between; padding: 6px 4px 0; }
.exp-day-head h2 { margin: 0; font-size: 14px; font-weight: 700; color: var(--ink-2); }
.exp-day-head span { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.exp-row {
  display: flex; align-items: center; gap: 12px; min-height: 64px; padding: 10px 4px;
  color: inherit; text-decoration: none; border-radius: var(--radius-sm); transition: background-color 0.15s var(--ease), transform 0.15s var(--ease);
}
.exp-row + .exp-row { border-top: 1px solid var(--line); border-top-left-radius: 0; border-top-right-radius: 0; }
a.exp-row:hover { background: var(--hover); color: inherit; }
a.exp-row:active { transform: scale(0.985); }
.exp-icon {
  flex: none; width: 40px; height: 40px; border-radius: 20px; display: flex; align-items: center; justify-content: center;
  background: color-mix(in srgb, var(--cat-4) 16%, #FFFFFF); color: var(--cat-4);
}
.exp-icon .icon { width: 20px; height: 20px; stroke-width: 2; }
.exp-icon.c0 { background: color-mix(in srgb, var(--cat-0) 14%, #FFFFFF); color: var(--cat-0); }
.exp-icon.c1 { background: color-mix(in srgb, var(--cat-1) 18%, #FFFFFF); color: #2E9284; }
.exp-icon.c2 { background: color-mix(in srgb, var(--cat-2) 14%, #FFFFFF); color: var(--cat-2); }
.exp-icon.c3 { background: color-mix(in srgb, var(--cat-3) 20%, #FFFFFF); color: #B37A0B; }
.exp-icon.c4 { background: var(--grey-100); color: var(--grey-600); }
.exp-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.exp-text strong { font-size: 16px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.exp-text span { font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.exp-amount { flex: none; font-size: 16px; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.exp-hero { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 0 4px; text-align: center; }
.exp-icon-lg { width: 56px; height: 56px; border-radius: 28px; }
.exp-icon-lg .icon { width: 26px; height: 26px; }
.exp-hero-title { margin: 6px 0 0; font-size: 16px; color: var(--ink-2); font-weight: 600; }
.exp-hero-amount { margin: 0; font-size: 32px; font-weight: 800; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.exp-info { margin: 0; }
.exp-info div { display: flex; justify-content: space-between; gap: 16px; padding: 14px 4px; }
.exp-info div + div { border-top: 1px solid var(--line); }
.exp-info dt { color: var(--muted); font-size: 15px; }
.exp-info dd { margin: 0; font-size: 15px; font-weight: 600; text-align: right; }
.exp-edit summary { display: flex; align-items: center; justify-content: space-between; min-height: 44px; cursor: pointer; list-style: none; }
.exp-edit summary::-webkit-details-marker { display: none; }
.exp-edit[open] summary .icon { transform: rotate(90deg); }
.exp-edit form { margin-top: 12px; }
.exp-note { text-align: center; font-size: 14px; }
.month-nav { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
body[data-app="ledger"] .bento-dot { background: var(--app-ledger); }
@media (min-width: 1024px) {
  .ledger-total, .donut-row, .exp-row, .month-nav, .exp-day, .exp-hero, .exp-info, .exp-edit { max-width: 720px; }
}

/* 알림 설정(내 정보) */
.panel fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.panel fieldset legend { padding: 0; margin-bottom: 6px; }

/* ---------- 되돌리기 토스트 (Gmail·토스의 실행 취소) ---------- */
.message .message-text { flex: 1; min-width: 0; }
.message-undo-form { margin: 0; flex: none; }
.message-undo-btn {
  min-height: 44px; margin: -12px -10px -12px 0; padding: 0 12px; border: 0; border-radius: 12px; background: none;
  color: var(--logo-yellow); font: inherit; font-size: 15px; font-weight: 700; cursor: pointer;
}
.message-undo-btn:hover, .message-undo-btn:focus-visible { background: rgba(255, 255, 255, 0.12); }

/* ---------- 라운지에도 올리기: 설명 + 토글 한 줄 ---------- */
.share-toggle {
  display: flex; align-items: center; justify-content: space-between; gap: 14px; min-height: 56px;
  padding: 10px 14px; border-radius: var(--radius-sm); background: var(--grey-50); cursor: pointer;
}
.share-toggle-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.share-toggle-text strong { font-size: 15px; font-weight: 600; color: var(--ink); }
.share-toggle-text small { font-size: 13px; color: var(--muted); line-height: 1.4; }
.share-toggle .switch:checked { background: var(--app, var(--accent)); }
.share-toggle .switch:focus-visible { outline: 2px solid var(--app, var(--accent)); outline-offset: 2px; }

/* ---------- 운동: 지난 값·최근 종목 ---------- */
.fit-step { margin: 4px 0 0; font-size: 13px; font-weight: 700; color: var(--grey-700); }
.fit-step .muted { font-weight: 500; }
.fit-pick { gap: 10px; }
.fit-picked { margin: 0; font-size: 16px; }
.fit-chip-add summary { font-size: 14px; font-weight: 600; color: var(--grey-700); min-height: 44px; display: flex; align-items: center; cursor: pointer; }
.fit-chip-form { display: flex; gap: 8px; margin: 4px 0 8px; }
.fit-chip-form input { flex: 1; min-width: 0; font-size: 16px; }
.fit-chip-del { display: inline-block; margin: 0 6px 6px 0; }
.fit-weight { display: grid; gap: 6px; }
.weight-pad { display: grid; grid-template-columns: repeat(3, 1fr) minmax(76px, 1.5fr) repeat(3, 1fr); gap: 4px; align-items: center; }
.weight-pad input { min-width: 0; width: 100%; min-height: 44px; border-radius: 12px; border: 0; background: var(--grey-50); box-shadow: inset 0 0 0 1px var(--grey-200); text-align: center; font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; -moz-appearance: textfield; }
.weight-pad input::-webkit-inner-spin-button, .weight-pad input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.weight-pad input.is-bump { animation: bump 0.25s var(--ease-out); }
.step-btn { min-height: 44px; min-width: 0; padding: 0; border: 0; border-radius: 12px; background: var(--grey-100); color: var(--grey-800); font: inherit; font-size: 14px; font-weight: 700; cursor: pointer; }
.step-btn:active { transform: scale(0.94); }
.fit-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.fit-last { margin: -4px 0 0; font-size: 13px; color: var(--muted); }
.fit-last strong { color: var(--app-ink, var(--ink)); font-weight: 700; }
.fit-recent { gap: 6px; }
.fit-recent .chip { min-height: 44px; padding: 0 14px; font-weight: 600; color: var(--ink); }
.chip-sub { margin-left: 6px; font-size: 12px; font-weight: 500; color: var(--muted); }

/* ---------- 떠 있는 버튼(FAB)이 맨 아래 내용을 가리지 않게 ----------
   Material 디자인 권장처럼 목록 끝에 버튼 높이만큼 여백을 두고, 아래로 내릴 땐 아이콘만 남겨요(Gmail 작성 버튼). */
.main:has(.fab) { padding-bottom: calc(var(--nav-h) + var(--dock-gap) + 18px + 52px + 28px + env(safe-area-inset-bottom)); }
.fab span { transition: max-width 0.25s var(--ease), opacity 0.2s var(--ease); max-width: 120px; overflow: hidden; white-space: nowrap; }
.fab.is-compact { padding: 0 17px; gap: 0; }
.fab.is-compact span { max-width: 0; opacity: 0; }
@media (min-width: 1024px) { .main:has(.fab) { padding-bottom: 128px; } }
@media (prefers-reduced-motion: reduce) { .fab span { transition: none; } }

/* ---------- 모임 나가기 확인(Splitwise 처럼 무엇이 남는지 먼저 알려 줌) ---------- */
.leave-list { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 10px; font-size: 15px; line-height: 1.55; color: var(--ink-2); }
.leave-counts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.leave-tip { margin: 0; font-size: 13px; }
.room-manage { margin-top: 6px; }
.room-manage summary { display: inline-flex; align-items: center; min-height: 44px; font-size: 14px; font-weight: 600; color: var(--grey-600); cursor: pointer; }
.room-manage[open] summary { color: var(--ink); }
.room-rename { margin: 4px 0 8px; gap: 8px; }
.room-rename .btn { align-self: flex-start; }
.room-manage-note { margin: 6px 0 0; font-size: 12px; }

/* 저장 중 / 라운지 설정 안내 */
.btn.is-sending { opacity: .7; pointer-events: none; }
.switch-hint { display: block; margin-top: 2px; font-size: 12px; font-weight: 500; color: var(--grey-500); }

/* 패스키: 로그인 화면의 버튼, 첫 로그인 제안, 내 정보 */
.passkey-login { display: flex; flex-direction: column; gap: 12px; margin-top: -8px; }
.passkey-login .btn, .passkey-offer .btn { gap: 8px; }
.passkey-or { display: flex; align-items: center; gap: 12px; margin: 0; font-size: 13px; color: var(--grey-500); }
.passkey-or::before, .passkey-or::after { content: ""; flex: 1; height: 1px; background: var(--grey-200); }
.passkey-badge { width: 56px; height: 56px; border-radius: 18px; background: var(--accent-soft, var(--grey-100)); color: var(--accent); display: flex; align-items: center; justify-content: center; }
.passkey-badge .icon { width: 28px; height: 28px; }
.passkey-title { font-size: 24px; margin: 12px 0 0; letter-spacing: -0.03em; }
.passkey-points { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.passkey-points li { display: flex; flex-direction: column; gap: 2px; padding: 14px 16px; border-radius: var(--radius); background: var(--grey-100); }
.passkey-points strong { font-size: 15px; }
.passkey-points span { font-size: 13px; color: var(--grey-600); line-height: 1.5; }

/* 비어 있는 대시보드 카드: 숫자 0 대신 첫 행동 */
.bento-cta { display: inline-flex; align-items: center; align-self: flex-start; min-height: 44px; margin-top: auto; padding: 0 14px; border-radius: 14px; background: var(--app-soft, var(--grey-100)); color: var(--app-ink, var(--accent)); font-size: 14px; font-weight: 700; }

/* 접히는 입력 상자(개발 기록 홈): 떠 있는 '+ 기록' 버튼이 연다 */
.fold { background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--shadow-card); overflow: hidden; }
.fold summary { min-height: 52px; display: flex; align-items: center; padding: 0 16px; font-size: 15px; font-weight: 600; color: var(--grey-700); cursor: pointer; list-style: none; }
.fold summary::-webkit-details-marker { display: none; }
.fold .panel { box-shadow: none; border-radius: 0; }

/* 식단: 최근 식사 칩, 어제와 같게 */
.recent-meals { display: flex; flex-direction: column; gap: 8px; }
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; }
.chip-row form { margin: 0; }
.chip-row .chip-btn { min-height: 44px; padding: 0 14px; border-radius: 22px; background: var(--surface); box-shadow: var(--shadow-card); }
.meal-copy { margin: 0; }
.meal-copy .btn { width: 100%; }

/* ---------- 일본어 홈: 다음 할 것 + 4단계 목록 ---------- */
.study-next { display: flex; flex-direction: column; gap: 6px; padding: 20px; border-radius: var(--radius-lg); background: var(--surface); box-shadow: var(--shadow-card); }
.study-next-label { font-size: 13px; font-weight: 600; color: var(--app-ink, var(--accent)); }
.study-next-title { margin: 0; font-size: 22px; letter-spacing: -0.02em; }
.study-next-sub { margin: 0 0 8px; font-size: 14px; color: var(--muted); }
.study-next .btn { align-self: stretch; }

.chip-quiet { background: transparent; color: var(--grey-500); font-weight: 600; }
.study-help { margin: 8px 4px 0; font-size: 13px; color: var(--muted); }

/* ---------- 가계부 입력 ---------- */
.field input.money-input { font-size: 28px; font-weight: 700; letter-spacing: -0.02em; min-height: 60px; }
.quick-amounts, .memo-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.quick-amounts[hidden], .memo-chips[hidden] { display: none; }
.cat-pick { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.cat-chip { position: relative; display: block; }
.cat-chip input { position: absolute; opacity: 0; inset: 0; }
.cat-chip > span { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px 2px; min-height: 76px; border-radius: 16px; background: var(--grey-100); }
.cat-name { font-size: 13px; font-weight: 600; color: var(--grey-700); }
.cat-chip input:checked + span { background: var(--app, var(--accent)); }
.cat-chip input:checked + span .cat-name { color: #FFFFFF; }
.cat-chip input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- 별 누르기·알약 고르기 ---------- */
.star-input { display: flex; gap: 2px; }
.star-cell { position: relative; width: 48px; height: 48px; display: inline-block; }
.star-glyph { display: block; font-size: 40px; line-height: 48px; text-align: center; color: var(--grey-200); }
.star-cell.is-full .star-glyph { color: #F5B73B; }
.star-cell.is-half .star-glyph {
  background: linear-gradient(90deg, #F5B73B 50%, var(--grey-200) 50%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.star-half { position: absolute; top: 0; bottom: 0; width: 50%; padding: 0; border: 0; background: transparent; cursor: pointer; }
.star-left { left: 0; }
.star-right { right: 0; }
.star-half:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; border-radius: 8px; }
.seg { display: flex; gap: 6px; flex-wrap: wrap; }
.seg-item { position: relative; flex: 1; min-width: 0; }
.seg-item input { position: absolute; opacity: 0; inset: 0; }
.seg-item span {
  display: flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 12px; border-radius: 14px;
  background: var(--grey-100); color: var(--grey-700); font-size: 15px; font-weight: 600; text-align: center;
}
.seg-item input:checked + span { background: var(--app, var(--accent)); color: #FFFFFF; }
.seg-item input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.more { display: flex; flex-direction: column; gap: 12px; }
.more > summary { cursor: pointer; font-size: 14px; font-weight: 600; color: var(--grey-600); min-height: 44px; display: flex; align-items: center; }
.more > summary::after { content: "▾"; margin-left: 6px; font-size: 12px; }
.more[open] > summary::after { content: "▴"; }
.more[open] > summary { margin-bottom: 4px; }
form[data-when-form] [data-when]:not(.is-on) { display: none; }
@media (prefers-reduced-motion: no-preference) { .star-cell:active .star-glyph { transform: scale(0.92); } }

/* Day 화면: 뜻 가리기 */
.hide-switch { padding: 0 4px; margin-bottom: 8px; }
.hide-switch small { display: block; font-size: 12px; font-weight: 500; color: var(--grey-500); }
.word-list.is-hiding .word-meaning:not(.is-shown) { color: transparent; background: var(--grey-100); border-radius: 8px; cursor: pointer; user-select: none; min-height: 24px; }
.word-list.is-hiding .word-meaning:not(.is-shown) .tag { visibility: hidden; }
.word-list.is-hiding .word-meaning { cursor: pointer; }

/* 개발 기록 할 일: 체크 원 + 상태 칩 */
.task-check { margin: 0; }
.check-circle { position: relative; width: 44px; height: 44px; border: 0; background: none; padding: 0; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.check-circle::before { content: ""; width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--grey-300, #C5CBD3); box-sizing: border-box; }
.check-circle .icon { position: absolute; width: 16px; height: 16px; color: #FFFFFF; opacity: 0; stroke-width: 3; }
.check-circle.is-on::before { background: var(--app, var(--accent)); border-color: var(--app, var(--accent)); }
.check-circle.is-on .icon { opacity: 1; }
.task-row.is-done .task-text strong { color: var(--grey-400); text-decoration: line-through; }
.state-chip { min-height: 44px; }
.state-chip.is-doing { background: var(--app-soft, var(--grey-100)); color: var(--app-ink, var(--accent)); }
.state-chip.is-done { background: var(--grey-100); color: var(--grey-500); }

/* 운동 기록: 쉬는 시간 타이머 */
.rest-timer { display: flex; align-items: center; gap: 12px; padding: 12px 16px; margin-bottom: 12px; border-radius: var(--radius-lg); background: var(--app-soft, var(--grey-100)); color: var(--app-ink, var(--accent)); }
.rest-timer[hidden] { display: none; }
.rest-label { font-size: 13px; font-weight: 600; }
.rest-time { flex: 1; font-size: 24px; font-weight: 800; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.rest-timer.is-done { background: var(--app, var(--accent)); color: #FFFFFF; }

/* 개발 기록: 한 줄 빠른 추가, 줄을 눌러 고치기 */
.quick-add { display: flex; gap: 8px; margin-bottom: 8px; }
.quick-add input { flex: 1; min-height: 48px; font-size: 16px; padding: 0 14px; border: 0; border-radius: var(--radius-md, 16px); background: var(--surface); box-shadow: var(--shadow-card); }
.task-title, a.log-text { color: inherit; text-decoration: none; }
a.log-text { flex: 1; min-width: 0; }

/* 모임 화면: 멤버 한 줄씩 + … 메뉴, 초대는 접힌 버튼, 나가기는 맨 아래 */
.member-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.member-row { display: flex; align-items: center; justify-content: space-between; min-height: 48px; border-top: 1px solid var(--grey-100); }
.member-row:first-child { border-top: 0; }
.member-name { font-size: 15px; font-weight: 600; }
.member-name small { color: var(--grey-500); font-weight: 500; }
.more-menu { position: relative; }
.more-menu summary { width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center; font-size: 20px; color: var(--grey-600); cursor: pointer; list-style: none; border-radius: 12px; }
.more-menu summary::-webkit-details-marker { display: none; }
.more-menu[open] summary { background: var(--grey-100); }
.more-menu form { position: absolute; right: 0; top: 46px; z-index: 5; margin: 0; padding: 6px; background: var(--surface); border-radius: 14px; box-shadow: 0 8px 24px rgba(15, 23, 42, 0.14); white-space: nowrap; }
.room-invite { margin-top: 8px; }
.leave-link { display: inline-flex; align-items: center; min-height: 44px; margin-top: 8px; font-size: 14px; font-weight: 600; color: var(--grey-500); text-decoration: none; }

/* 소식 화면: 앱 고르기 칩은 한 줄로 옆으로 밀어 봐요 */
.feed-chips { flex-wrap: nowrap; overflow-x: auto; margin: 0 0 16px; padding-bottom: 4px; scrollbar-width: none; }
.feed-chips::-webkit-scrollbar { display: none; }
.feed-chips .chip { flex: none; }

/* 아래 탭 가운데 '+ 기록' 과 기록하기 목록(시트·화면 공통) */
.record-list { display: grid; gap: 4px; padding-bottom: 12px; }
.record-group { display: grid; gap: 2px; }
.record-app { margin: 10px 8px 2px; font-size: 13px; font-weight: 700; color: var(--grey-500); }
.record-row {
  display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 6px 12px;
  border-radius: var(--radius-lg); background: var(--surface); color: var(--grey-900); text-decoration: none;
}
.record-row > strong { flex: 1; font-size: 16px; font-weight: 600; }
.record-row > .icon { width: 18px; height: 18px; color: var(--grey-400); }
.sheet .record-row { background: transparent; }
.sheet .record-row:hover, .sheet .record-row:focus-visible { background: var(--grey-50); outline: none; }
.record-row.is-current { background: var(--app-soft); }
.sheet .record-row.is-current { background: var(--app-soft); }
.record-now { font-size: 13px; font-weight: 700; color: var(--app-ink); }
.record-dot { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 12px; background: var(--app-soft); color: var(--app-ink); }
.record-dot .icon { width: 20px; height: 20px; }

/* 일본어 홈 '오늘의 학습': 지그재그 길이 곧 목록 */
.study-path { position: relative; height: 236px; max-width: 350px; }
.path-line { position: absolute; inset: 0; width: 100%; height: 100%; }
.path-line path { fill: none; stroke: color-mix(in srgb, var(--app) 22%, #FFFFFF); stroke-width: 10; stroke-linecap: round; }
.path-node { position: absolute; display: flex; align-items: center; gap: 4px; margin: 0; text-decoration: none; color: var(--ink); min-height: 44px; }
.path-node-1 { right: 50.3%; top: 2px; }
.path-node-2 { left: 55.4%; top: 62px; }
.path-node-3 { right: 50.3%; top: 116px; }
.path-node-4 { left: 58.9%; top: 184px; }
.path-node-1, .path-node-3, .path-node-1 .node-btn, .path-node-3 .node-btn { flex-direction: row-reverse; }
.path-node-1 .node-text, .path-node-3 .node-text { align-items: flex-end; text-align: right; }
.path-node-1 .node-text span, .path-node-3 .node-text span { max-width: 104px; white-space: normal; }
.node-btn { display: flex; align-items: center; gap: 4px; border: 0; background: none; padding: 0; font: inherit; color: inherit; cursor: pointer; text-align: left; }
.node-btn:disabled { cursor: not-allowed; opacity: 0.5; }
.node-dot { width: 56px; height: 56px; border-radius: 50%; flex: none; display: inline-flex; align-items: center; justify-content: center; background: var(--app); color: #FFFFFF; font-size: 15px; font-weight: 800; box-sizing: border-box; margin: 6px; }
.node-dot .icon { width: 24px; height: 24px; stroke-width: 2.6; }
.is-current .node-dot { margin: 0; width: 68px; height: 68px; background: #FFFFFF; border: 5px solid var(--app); color: var(--app-ink); box-shadow: 0 6px 16px rgba(49, 130, 246, 0.28); }
.is-todo .node-dot { margin: 10px; width: 48px; height: 48px; background: #E3EAF3; color: #8A97A8; }
.node-text { display: flex; flex-direction: column; min-width: 0; }
.node-text strong { font-size: 13px; font-weight: 600; }
.is-current .node-text strong { font-size: 14px; font-weight: 700; }
.node-text span { font-size: 12px; color: var(--muted); max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.is-todo .node-text strong { color: var(--muted); font-weight: 500; }

.kana-twin { margin: 0 0 8px; text-align: center; font-size: 13px; }
.study-rules { margin: 12px 4px 0; padding: 0; list-style: none; display: grid; gap: 6px; font-size: 13px; color: var(--muted); }
.study-rules strong { color: var(--ink); font-weight: 600; margin-right: 4px; }
.day-done { margin: 20px 0 8px; display: grid; gap: 6px; text-align: center; }
.day-done .muted { font-size: 13px; margin: 0; }

/* 일본어 레벨 고르기 */
.level-ask { margin: 0 4px 12px; font-size: 14px; color: var(--muted); }
.level-list { display: flex; flex-direction: column; gap: 10px; max-width: 480px; }
.level-form { margin: 0; }
.level-card { width: 100%; display: flex; flex-direction: column; gap: 4px; text-align: left; padding: 16px 18px; min-height: 44px; border: 2px solid transparent; border-radius: var(--radius-lg); background: var(--surface); font: inherit; color: var(--ink); cursor: pointer; }
.level-card:active { transform: scale(0.985); }
.level-card.is-current { border-color: var(--app, var(--accent)); }
.level-name { display: flex; align-items: center; gap: 8px; font-size: 18px; font-weight: 800; }
.level-now { font-size: 12px; font-weight: 700; color: var(--app-ink, var(--accent)); background: var(--app-soft, var(--grey-100)); padding: 2px 8px; border-radius: 999px; }
.level-desc { font-size: 14px; }
.level-meta { font-size: 12px; color: var(--muted); }
.level-help { text-decoration: none; display: inline-flex; align-items: center; min-height: 44px; margin: 8px 4px; font-size: 14px; font-weight: 600; color: var(--app-ink, var(--accent)); }
.quiz-q { display: flex; flex-direction: column; gap: 8px; border: 0; margin: 0; }
.quiz-text { margin: 0; font-size: 15px; font-weight: 600; }
.quiz-ja { margin: 0; font-size: 28px; font-weight: 700; }
.quiz-options { display: flex; flex-direction: column; gap: 6px; }
.quiz-option { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 12px; border-radius: 12px; background: var(--grey-100); font-size: 15px; }
.quiz-option input { width: 20px; height: 20px; accent-color: var(--app, var(--accent)); }

/* ---------- 내 정보: 패스키·알림 ---------- */
.chip-btn.chip-primary { background: var(--accent); color: #FFFFFF; }
.group-row .switch { margin-left: 8px; }
label.group-row { cursor: pointer; }
.group-alert { margin: 8px 0 0; padding: 10px 12px; border-radius: var(--radius); background: var(--danger-soft); color: var(--danger); font-size: 13px; line-height: 1.5; }
.group-label { padding: 14px 0 4px; font-size: 12px; font-weight: 700; color: var(--muted); }
.group-save { padding: 12px 0 14px; }
.section-help { padding: 10px 4px 0; font-size: 13px; line-height: 1.6; color: var(--muted); }
.time-input { flex: none; width: 112px; height: 40px; padding: 0 10px; border: 0; border-radius: 12px; background: var(--grey-100); font: inherit; font-size: 16px; font-weight: 600; color: var(--ink); text-align: center; }
.group-row .list-text span { white-space: normal; }
label.group-row, .group-row:has(.list-text) { padding-top: 8px; padding-bottom: 8px; }

/* ---------- 홈 화면에 추가 안내 시트 ---------- */
.install { padding: 0 12px 4px; }
.install-why { padding: 0 0 14px; font-size: 14px; line-height: 1.6; color: var(--muted); }
.install-steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.install-steps li { display: flex; align-items: flex-start; gap: 12px; padding: 12px 14px; border-radius: var(--radius); background: var(--grey-50); }
.install-num { flex: none; width: 24px; height: 24px; border-radius: 12px; background: var(--accent); color: #FFFFFF; font-size: 13px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }
.install-text { font-size: 15px; line-height: 1.6; color: var(--ink); }
.install-text b { font-weight: 700; }
.install-ico { display: inline-block; vertical-align: -5px; margin: 0 2px; color: var(--accent); }
.install-plain { padding: 12px 14px; border-radius: var(--radius); background: var(--grey-50); }
.install-note { padding: 12px 2px 0; font-size: 13px; color: var(--muted); }
.install .sheet-foot { padding: 14px 0 0; }
.install [hidden] { display: none !important; }

/* ---------- 스위치 줄 모음(계정의 쓸 수 있는 앱, 편집 모드) ---------- */
.switch-list { display: flex; flex-direction: column; }
.switch-list > .group-row:last-child { border-bottom: 0; }
.switch-label { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; min-height: 52px; cursor: pointer; }
.group-row [hidden] { display: none !important; }
/* ---------- 홈 화면에 추가: 기기 탭(내 정보에서 열었을 때) ---------- */
.install-tabs { display: flex; gap: 4px; padding: 4px; margin: 0 0 12px; border-radius: var(--radius); background: var(--grey-100); }
.install-tabs[hidden] { display: none !important; }
.install-tabs button { flex: 1; min-height: 44px; border: 0; border-radius: 12px; background: transparent; color: var(--muted); font: inherit; font-size: 15px; font-weight: 600; cursor: pointer; }
.install-tabs button.is-on { background: #FFFFFF; color: var(--ink); box-shadow: 0 1px 3px rgba(17, 20, 24, 0.12); }

/* ---------- 단어 퀴즈: 한 화면에 다음 버튼까지 보이게(보기 2×2, 문제 카드 줄임) ---------- */
.quiz-card { min-height: 148px; padding: 20px 16px; }
.quiz-word { font-size: 44px; }
.choices { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.choice { position: relative; min-height: 76px; padding: 22px 12px 10px; justify-content: center; text-align: center; font-size: 16px; line-height: 1.35; overflow-wrap: anywhere; }
.choice-mark { position: absolute; top: 7px; right: 12px; font-size: 11px; line-height: 1.2; }
.quiz-feedback { padding: 12px 16px; }
@media (max-width: 599px) {
  .quiz { gap: 12px; }
}
