/* ============================================
   공부친구 — Design System (공댕이 친구 테마)
   Canvas: 말랑한 하늘빛, 둥근 버튼, 캐릭터 말풍선
============================================ */

@font-face {
  font-family: 'Cafe24Ssurround';
  src: url('/static/fonts/Cafe24Ssurround-v2_0.otf') format('opentype');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+KR:wght@400;500;600&display=swap');

/* ── Design Tokens ──────────────────────────── */
:root {
  /* Core palette */
  --primary:      #2F62B0;   /* 공댕이 귀 파랑 — CTAs, 강조 */
  --canvas:       #EEF4FC;   /* 하늘빛 배경 */
  --lifted:       #F7FAFE;   /* 살짝 떠 있는 섹션 */
  --white:        #FFFFFF;   /* Pure white — cards, modals, nav pill */
  --surface-dark: #1F3D6E;   /* Sidebar & footer surface */

  /* Accent */
  --signal:       #E9779A;   /* 공댕이 볼 핑크 — accent */
  --signal-light: #F5A8BF;   /* 연한 핑크 — decorative */

  /* Text */
  --ink:          #1E2F4A;
  --ink-soft:     #4A5D78;
  --muted:        #6B7C93;
  --inverse-ink:  #FFFFFF;   /* text on dark bg */
  --on-inverse-soft: rgba(255,255,255,0.72);

  /* Borders */
  --hairline:        rgba(47,98,176,0.16);
  --hairline-active: rgba(47,98,176,0.45);
  --hairline-strong: rgba(47,98,176,0.30);
  --hairline-soft:   rgba(47,98,176,0.08);

  /* ── Colorful blocks for card distinction ── */
  --block-lime:   #D8F3DC;   /* Easy / 정답 — fresh green */
  --block-mint:   #C9EFE8;   /* Practice / 복습 — teal */
  --block-sky:    #D3E8F8;   /* Medium — calm blue */
  --block-cream:  #FCFBFA;   /* Neutral lifted */
  --block-coral:  #FAD8C8;   /* Hard / 오답 — warm coral */
  --block-lilac:  #EAD8F5;   /* Image problem — soft purple */
  --block-pink:   #FAD8E8;   /* Extra accent */
  --block-navy:   #1F3D6E;   /* Dark surface */

  /* Semantic — mapped to block colors */
  --success:         #22c55e;
  --success-bg:      #D8F3DC;
  --success-border:  #9EE3AB;
  --success-text:    #166534;
  --error-bg:        #FAD8C8;
  --error-border:    #F0A882;
  --error-text:      #9A3A0A;

  /* ── Radius — Mastercard scale ── */
  --r-xs:   4px;
  --r-sm:   20px;     /* signature button radius */
  --r-md:   20px;
  --r-lg:   24px;     /* cards, sheets */
  --r-xl:   40px;     /* hero / stadium / large cards */
  --r-2xl:  40px;
  --r-pill: 999px;    /* full pill — nav, chips, selects */
  --r-full: 999px;

  /* Spacing (8px base) */
  --sp-xxs:     4px;
  --sp-xs:      8px;
  --sp-sm:      12px;
  --sp-md:      16px;
  --sp-lg:      24px;
  --sp-xl:      32px;
  --sp-xxl:     48px;
  --sp-section: 80px;

  /* Fonts */
  --font-display: 'Cafe24Ssurround', 'Noto Sans KR', ui-sans-serif, sans-serif;
  --font-body:    ui-sans-serif, system-ui, -apple-system, 'Noto Sans KR', sans-serif;
  --font-mono:    ui-monospace, 'SFMono-Regular', Menlo, monospace;
  --font-title:   'Cafe24Ssurround', 'Noto Sans KR', ui-sans-serif, sans-serif;

  /* Shadows — atmospheric, Mastercard style */
  --shadow-nav:  rgba(0,0,0,0.06) 0px 4px 24px 0px;
  --shadow-card: rgba(0,0,0,0.08) 0px 16px 40px 0px;
  --shadow-lift: rgba(0,0,0,0.05) 0px 8px 24px 0px;
  --shadow-inset-btn: none;
  --shadow-focus: 0 0 0 3px rgba(233,119,154,0.30);

  /* 공댕이 캐릭터 색 */
  --buddy-aqua:  #A9CDF2;
  --buddy-pink:  #F2A5B8;
  --buddy-navy:  #22457F;
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; }
body {
  font-family: var(--font-body);
  font-size: 16px; font-weight: 400; line-height: 1.5;
  color: var(--ink);
  background-color: var(--canvas);
  background-image:
    radial-gradient(rgba(169,205,242,0.40) 1.5px, transparent 1.5px);
  background-size: 24px 24px;
  min-height: 100vh;
}

/* ── Typography ── */
.t-display-xl { font-family: var(--font-title); font-size: clamp(22px,5vw,36px); font-weight: normal; line-height: 1.1; letter-spacing: -0.02em; }
.t-display-lg { font-family: var(--font-title); font-size: clamp(20px,4vw,28px); font-weight: normal; line-height: 1.15; letter-spacing: -0.02em; }
.t-headline    { font-family: var(--font-title); font-size: 22px; font-weight: normal; line-height: 1.3; }
.t-subhead     { font-size: 18px; font-weight: 500; line-height: 1.5; }
.t-body        { font-size: 16px; font-weight: 400; line-height: 1.4; }
.t-body-sm     { font-size: 14px; font-weight: 400; line-height: 1.43; }
.t-button      { font-size: 15px; font-weight: 500; line-height: 1; letter-spacing: -0.02em; }
.t-eyebrow     { font-family: var(--font-mono); font-size: 11px; font-weight: 700; line-height: 1.2; letter-spacing: 0.05em; text-transform: uppercase; }
.t-caption     { font-family: var(--font-mono); font-size: 11px; font-weight: 400; line-height: 1.2; letter-spacing: 0.04em; }

/* ── Buttons — Mastercard 20px radius ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  font-family: var(--font-body); font-size: 15px; font-weight: 500;
  letter-spacing: -0.02em; line-height: 1;
  border: 1.5px solid transparent; cursor: pointer; text-decoration: none;
  transition: opacity 0.15s, background 0.15s, transform 0.1s;
  white-space: nowrap; flex-shrink: 0;
  border-radius: var(--r-sm);
}
.btn:active { transform: scale(0.98); opacity: 0.85; }
.btn:focus-visible { outline: 2px solid var(--signal); outline-offset: 2px; }

/* Primary — Ink Black */
.btn-primary {
  background: var(--primary); color: var(--inverse-ink);
  border-color: var(--primary); padding: 10px 24px; min-height: 40px;
}
.btn-primary:hover { opacity: 0.88; }
.btn-primary:disabled {
  background: rgba(47,98,176,0.2); border-color: transparent;
  color: var(--muted); cursor: not-allowed; transform: none; opacity: 1;
  animation: none;
}

/* AI CTA pulse animation */
@keyframes ai-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(47,98,176,0.35); }
  60%  { box-shadow: 0 0 0 10px rgba(47,98,176,0); }
  100% { box-shadow: 0 0 0 0 rgba(47,98,176,0); }
}
.btn-ai-cta {
  animation: ai-pulse 2.4s ease-out infinite;
}

/* Secondary — White outlined */
.btn-secondary {
  background: var(--white); color: var(--ink);
  border-color: var(--primary); padding: 10px 24px; min-height: 40px;
}
.btn-secondary:hover { background: var(--lifted); }

/* Ghost */
.btn-ghost {
  background: rgba(255,255,255,0.85); color: var(--ink);
  border-color: rgba(47,98,176,0.3); padding: 10px 24px; min-height: 40px;
}

/* Inverse */
.btn-inverse {
  background: var(--white); color: var(--ink);
  border-color: var(--white); padding: 10px 24px; min-height: 40px;
}

/* Danger */
.btn-danger {
  background: var(--white); color: var(--error-text);
  border-color: var(--error-border); padding: 8px 16px; min-height: 36px; font-size: 13px;
}
.btn-danger:hover { background: var(--error-bg); }

.btn-sm   { font-size: 13px; padding: 7px 16px; min-height: 34px; }
.btn-full { width: 100%; }

/* ── Inputs ── */
.input {
  display: block; width: 100%;
  background: var(--white); color: var(--ink);
  border: 1.5px solid var(--hairline-strong); border-radius: var(--r-sm);
  padding: 10px 16px; font-family: var(--font-body); font-size: 15px;
  outline: none; transition: border-color 0.15s;
  min-height: 42px;
}
.input:focus { border-color: var(--primary); }
.input::placeholder { color: var(--muted); }

.textarea {
  display: block; width: 100%;
  background: #FFFFFF; color: var(--ink);
  border: 1.5px solid rgba(180,170,160,0.35); border-radius: var(--r-lg);
  padding: 12px 16px; font-family: var(--font-body); font-size: 15px;
  outline: none; resize: none; transition: border-color 0.15s; line-height: 1.6;
}
.textarea:focus { border-color: var(--primary); }
.textarea::placeholder { color: var(--muted); }

/* ── Color-Block Sections (Mastercard editorial blocks) ── */
.block { border-radius: var(--r-xl); padding: var(--sp-xl); }
.block-lime   { background: var(--block-lime); }
.block-lilac  { background: var(--block-lilac); }
.block-cream  { background: var(--lifted); }
.block-mint   { background: var(--block-mint); }
.block-pink   { background: var(--block-pink); }
.block-coral  { background: var(--block-coral); }
.block-sky    { background: var(--block-sky); }
.block-navy   { background: var(--surface-dark); color: var(--inverse-ink); }
.block-card   { border-radius: var(--r-xl); padding: var(--sp-lg) var(--sp-xl); }

/* ── Cards — stadium 40px, soft shadow ── */
.card {
  background: var(--white);
  border-radius: var(--r-xl);
  padding: var(--sp-xl);
}

/* ── Alerts ── */
.alert {
  padding: 12px 16px; border-radius: var(--r-lg);
  font-size: 14px; line-height: 1.5; margin-bottom: var(--sp-md);
  border: 1.5px solid var(--hairline);
  background: var(--lifted); color: var(--ink-soft);
}
.alert-error   { background: var(--error-bg);   border-color: var(--error-border);   color: var(--error-text); }
.alert-success { background: var(--success-bg); border-color: var(--success-border); color: var(--success-text); }

/* ── Nav (floating pill) ── */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  background: var(--canvas); border-bottom: 1px solid var(--hairline);
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
  height: 56px; display: flex; align-items: center;
}
.nav-inner {
  display: flex; align-items: center; justify-content: space-between;
  width: 100%; max-width: 1200px; margin: 0 auto;
  padding: 0 24px; gap: var(--sp-xl);
}
.nav-logo {
  font-family: var(--font-title); font-size: 22px; font-weight: normal;
  letter-spacing: -0.02em; color: var(--ink); text-decoration: none;
  display: flex; align-items: center; gap: 8px; white-space: nowrap;
}
.nav-link {
  font-size: 14px; font-weight: 500; color: var(--ink);
  text-decoration: none; cursor: pointer; background: none; border: none;
  font-family: var(--font-body); transition: opacity 0.15s; letter-spacing: -0.01em;
}
.nav-link:hover { opacity: 0.5; }
.nav-actions { display: flex; align-items: center; gap: var(--sp-xs); }

/* ── Desktop Sidebar ── */
.sidebar {
  width: 230px; background: var(--surface-dark);
  position: fixed; top: 0; left: 0; bottom: 0;
  display: flex; flex-direction: column; z-index: 100;
}
.sb-logo-area { padding: 22px 20px 18px; border-bottom: 1px solid rgba(255,255,255,0.08); }
.sb-logo-text { font-family: var(--font-title); font-size: 20px; font-weight: normal; color: var(--inverse-ink); letter-spacing: -0.01em; }
.sb-logo-sub  { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.05em; text-transform: uppercase; color: var(--on-inverse-soft); margin-top: 3px; }
.sb-nav { flex: 1; padding: 14px 0; overflow-y: auto; }
.sb-item {
  display: flex; align-items: center; gap: 12px; padding: 12px 22px;
  color: var(--on-inverse-soft); font-size: 14px; font-weight: 400;
  cursor: pointer; border: none; background: none; width: 100%;
  font-family: var(--font-body); text-align: left;
  transition: all 0.15s; border-left: 2px solid transparent;
}
.sb-item:hover { color: var(--inverse-ink); background: rgba(255,255,255,0.06); }
.sb-item.active { color: var(--inverse-ink); background: rgba(255,255,255,0.12); border-left-color: var(--signal-light); }
.sb-divider { height: 1px; background: rgba(255,255,255,0.08); margin: 8px 0; }
.sb-footer { padding: 16px 20px; border-top: 1px solid rgba(255,255,255,0.08); }
.sb-user-name { font-size: 14px; font-weight: 500; color: var(--inverse-ink); }
.sb-user-role { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.05em; text-transform: uppercase; color: var(--on-inverse-soft); margin-top: 2px; }
.sb-btn {
  background: rgba(255,255,255,0.10); border: none; border-radius: var(--r-pill);
  padding: 7px 14px; font-size: 13px; color: var(--on-inverse-soft);
  cursor: pointer; font-family: var(--font-body); margin-top: var(--sp-xs);
  transition: background 0.15s;
}
.sb-btn:hover { background: rgba(255,255,255,0.20); color: var(--inverse-ink); }

/* ── Bottom nav (mobile) ── */
.bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 100;
  background: var(--white); border-top: 1px solid var(--hairline);
  display: flex; padding-bottom: env(safe-area-inset-bottom);
}
.bn-item {
  flex: 1; display: flex; flex-direction: column; align-items: center;
  padding: 14px 0 12px; cursor: pointer; border: none; background: none;
  color: var(--muted); font-size: 11px; font-weight: 400;
  gap: 6px; font-family: var(--font-body); transition: color 0.15s;
}
.bn-item.active { color: var(--primary); }
.bn-item .bn-icon { width: 26px; height: 26px; }
.bn-item .bn-icon svg { width: 100%; height: 100%; }

/* ── Tables ── */
.tbl-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th {
  background: var(--lifted); padding: 12px 14px; text-align: left;
  font-family: var(--font-mono); font-size: 10px; font-weight: 700;
  color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em;
  border-bottom: 1.5px solid var(--hairline);
}
td {
  padding: 13px 14px; border-bottom: 1px solid var(--hairline-soft);
  font-size: 14px; vertical-align: middle;
}
tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--lifted); }

/* ── Badges — pill chips ── */
.badge {
  display: inline-flex; align-items: center;
  font-family: var(--font-mono); font-size: 10px; font-weight: 700;
  letter-spacing: 0.04em; text-transform: uppercase;
  padding: 4px 10px; border-radius: var(--r-pill);
  background: var(--lifted); color: var(--ink-soft);
  white-space: nowrap; border: 1px solid var(--hairline);
}
/* Color-coded badges */
.badge-lime   { background: var(--block-lime);  color: var(--success-text);  border-color: var(--success-border); }
.badge-mint   { background: var(--block-mint);  color: #0d6655;              border-color: #7ed3c3; }
.badge-sky    { background: var(--block-sky);   color: #1a4a7a;              border-color: #8ec8f0; }
.badge-coral  { background: var(--block-coral); color: var(--error-text);    border-color: var(--error-border); }
.badge-lilac  { background: var(--block-lilac); color: #5a2d7a;              border-color: #c89ee8; }
.badge-cream  { background: var(--lifted);      color: var(--ink-soft);      border-color: var(--hairline); }
.badge-dark   { background: var(--primary);     color: var(--inverse-ink);   border-color: transparent; }

/* ── Grade selector ── */
.grade-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 8px; }
.grade-opt {
  background: var(--white); border: 1.5px solid var(--hairline);
  border-radius: var(--r-sm); padding: 10px 8px;
  font-size: 13px; color: var(--muted);
  cursor: pointer; transition: all 0.15s;
  text-align: center; font-family: var(--font-body);
}
.grade-opt:hover { border-color: var(--primary); color: var(--ink); }
.grade-opt.sel {
  background: var(--primary); color: var(--inverse-ink);
  border-color: var(--primary);
}

/* ── Sheet / Modal ── */
.sheet-overlay { display: none; position: fixed; inset: 0; z-index: 200; background: rgba(30,47,74,0.45); align-items: flex-end; justify-content: center; }
.sheet-overlay.open { display: flex; }
.sheet {
  background: var(--white); width: 100%; max-width: 520px;
  border-radius: var(--r-xl) var(--r-xl) 0 0;
  padding: 22px 24px 44px;
  box-shadow: var(--shadow-card);
}
.sheet-handle { width: 44px; height: 4px; background: var(--hairline); border-radius: var(--r-pill); margin: 0 auto 20px; }

.modal-overlay { display: none; position: fixed; inset: 0; z-index: 200; background: rgba(30,47,74,0.45); align-items: center; justify-content: center; padding: 20px; }
.modal-overlay.open { display: flex; }
.modal-box {
  background: var(--white); border-radius: var(--r-xl);
  padding: 28px; width: 100%; max-width: 460px;
  max-height: 90vh; overflow-y: auto;
  box-shadow: var(--shadow-card);
}

/* ── Page/Tab system ── */
.page { display: none; }
.page.active { display: block; }
.tab { display: none; }
.tab.active { display: block; }

/* ── Loading ── */
.loading-dots { display: flex; gap: 8px; justify-content: center; }
.loading-dot {
  width: 8px; height: 8px; border-radius: var(--r-full);
  background: var(--primary); opacity: 0.2;
  animation: ldot 1.4s ease-in-out infinite;
}
.loading-dot:nth-child(2) { animation-delay: 0.2s; }
.loading-dot:nth-child(3) { animation-delay: 0.4s; }
@keyframes ldot { 0%,80%,100% { transform: scale(0.6); opacity: 0.2; } 40% { transform: scale(1.1); opacity: 1; } }

/* ── Toggle ── */
.toggle {
  width: 44px; height: 24px; border-radius: var(--r-full);
  background: var(--hairline); position: relative; cursor: pointer;
  transition: background 0.2s; flex-shrink: 0; border: none;
}
.toggle.on { background: var(--primary); }
.toggle::after {
  content: ""; position: absolute;
  width: 18px; height: 18px; border-radius: var(--r-full);
  background: var(--white); top: 3px; left: 3px;
  transition: transform 0.2s; box-shadow: 0 1px 4px rgba(0,0,0,0.2);
}
.toggle.on::after { transform: translateX(20px); }

/* ── Upload zone ── */
.upload-zone {
  background: #FFFFFF; border: 2px dashed var(--hairline-strong);
  border-radius: var(--r-xl); padding: 36px 24px;
  text-align: center; cursor: pointer; position: relative; transition: all 0.15s;
}
.upload-zone:hover, .upload-zone.drag-over {
  border-color: var(--primary); background: #FFFFFF;
}
.upload-zone input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; z-index: 2; }

/* ── Layout helpers ── */
.container      { max-width: 760px;  margin: 0 auto; padding: 0 24px; }
.container-wide { max-width: 1100px; margin: 0 auto; padding: 0 24px; }
.section-gap { margin-bottom: var(--sp-section); }

/* ── Page header ── */
.page-header { padding: 32px 0 24px; }
.page-header-row { display: flex; align-items: center; justify-content: space-between; }
.page-subtext { font-size: 15px; color: var(--muted); }

/* ── Eyebrow strip (• LABEL style) ── */
.eyebrow-strip {
  font-family: var(--font-mono); font-size: 11px; font-weight: 700;
  letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted);
  margin-bottom: 10px; display: flex; align-items: center; gap: 5px;
}
.eyebrow-strip::before { content: "•"; color: var(--signal-light); font-size: 14px; line-height: 1; }

/* ── Step card ── */
.step-card { border-left: 2px solid var(--hairline-strong); padding: 12px 0 12px 18px; margin-bottom: 14px; transition: border-left-color 0.15s; }
.step-card:hover { border-left-color: var(--signal); }
.step-label { font-family: var(--font-mono); font-size: 10px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 5px; }

/* ── Answer / Tip ── */
.answer-box {
  background: var(--block-lime);
  border: 1.5px solid var(--success-border);
  border-radius: var(--r-xl); padding: var(--sp-lg) var(--sp-xl); margin-top: 12px;
}
.answer-label { font-family: var(--font-mono); font-size: 10px; font-weight: 700; color: var(--success-text); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 6px; display: block; }
.answer-val { font-family: var(--font-title); font-size: 28px; font-weight: normal; color: var(--primary); }

.tip-box {
  background: var(--block-sky); border-radius: var(--r-xl);
  padding: var(--sp-md) var(--sp-xl); margin-top: 10px;
  font-size: 14px; color: var(--ink-soft); line-height: 1.6;
}
.tip-label { font-family: var(--font-mono); font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: #1a4a7a; display: block; margin-bottom: 4px; }

/* ── Feedback ── */
.feedback { display: none; border-radius: var(--r-xl); padding: 16px 18px; font-size: 14px; line-height: 1.6; margin-top: 12px; }
.feedback.show { display: block; }
.feedback.ok { background: var(--block-lime); color: var(--success-text); border: 1.5px solid var(--success-border); }
.feedback.ng { background: var(--block-coral); color: var(--error-text); border: 1.5px solid var(--error-border); }

/* ── Note card ── */
.note-card {
  background: #FFFFFF; border: 1.5px solid rgba(180,170,160,0.35);
  border-radius: var(--r-xl); padding: var(--sp-lg) var(--sp-xl);
  cursor: pointer; transition: all 0.15s; margin-bottom: 8px;
}
.note-card:hover { border-color: var(--primary); }

/* ── Detail overlay ── */
.detail-overlay { display: none; position: fixed; inset: 0; z-index: 300; background: var(--canvas); overflow-y: auto; }
.detail-overlay.open { display: block; }
.detail-inner { max-width: 760px; margin: 0 auto; padding: 28px 24px 100px; }
.detail-back {
  display: inline-flex; align-items: center; gap: 6px;
  background: none; border: none; font-size: 14px;
  color: var(--muted); cursor: pointer; font-family: var(--font-body);
  padding: 0; margin-bottom: 24px; transition: color 0.15s;
}
.detail-back:hover { color: var(--primary); }

/* ── Settings rows ── */
.set-row { display: flex; align-items: center; gap: 14px; padding: 16px 0; border-bottom: 1px solid var(--hairline-soft); cursor: pointer; }
.set-row:last-child { border-bottom: none; }
.set-icon-wrap {
  width: 38px; height: 38px; border-radius: var(--r-xl);
  background: var(--lifted); border: 1.5px solid var(--hairline);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.set-icon-wrap svg { width: 18px; height: 18px; color: var(--ink-soft); }
.set-label { flex: 1; }
.set-label strong { display: block; font-size: 15px; font-weight: 500; }
.set-label span { font-size: 13px; color: var(--muted); }

/* ── Log ── */
.log-item { display: flex; align-items: flex-start; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--hairline-soft); }
.log-item:last-child { border-bottom: none; }
.log-dot { width: 8px; height: 8px; border-radius: var(--r-full); flex-shrink: 0; margin-top: 5px; }
.log-dot.login { background: var(--success); }
.log-dot.solve { background: var(--signal); }
.log-dot.admin { background: var(--muted); }
.log-text { flex: 1; font-size: 13px; line-height: 1.5; color: var(--ink-soft); }
.log-time { font-size: 11px; color: var(--muted); white-space: nowrap; padding-top: 2px; font-family: var(--font-mono); }

/* ── Admin topbar ── */
.topbar {
  background: var(--white); border-bottom: 1px solid var(--hairline);
  height: 56px; display: flex; align-items: center; justify-content: space-between;
  padding: 0 28px; position: sticky; top: 0; z-index: 50;
  box-shadow: var(--shadow-nav);
}
.topbar-title { font-family: var(--font-title); font-size: 17px; font-weight: normal; }

/* ── Status dot ── */
.status-dot { width: 8px; height: 8px; border-radius: var(--r-full); background: var(--hairline); flex-shrink: 0; }
.status-dot.ok  { background: var(--success); }
.status-dot.err { background: var(--error-text); }

/* ── Avatar ── */
.avatar {
  width: 36px; height: 36px; border-radius: var(--r-full);
  background: var(--block-sky); border: 1.5px solid var(--hairline);
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--font-title); font-size: 14px; color: #1a4a7a; flex-shrink: 0;
}
.avatar-sm { width: 28px; height: 28px; font-size: 11px; }

/* ── Feature bullet ── */
.feature-bullet { display: flex; align-items: flex-start; gap: 10px; font-size: 14px; color: var(--ink-soft); padding: 5px 0; }
.feature-bullet::before { content: "✓"; color: var(--success); font-weight: 700; flex-shrink: 0; margin-top: 1px; }

/* ── Divider ── */
.divider { height: 1px; background: var(--hairline); margin: var(--sp-lg) 0; }

/* ── Sec eyebrow ── */
.sec-eyebrow {
  font-family: var(--font-title); font-size: 15px; font-weight: normal;
  color: var(--ink-soft);
  margin-bottom: 14px; display: flex; align-items: center; gap: 5px;
}
.sec-eyebrow::before { content: "•"; color: var(--signal-light); font-size: 13px; }

/* ── Animations ── */
@keyframes fadeUp { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
.fade-up { animation: fadeUp 0.35s ease both; }

/* ── Responsive ── */
@media (max-width: 768px) {
  :root { --sp-section: 48px; --sp-xxl: 32px; }
  .t-display-xl { font-size: 18px; }
  .t-display-lg { font-size: 18px; }
  .container, .container-wide { padding: 0 16px; }
  .block { padding: var(--sp-lg); border-radius: var(--r-lg); }
  .desktop-only { display: none !important; }
  .topbar { padding: 0 16px; }
}
@media (min-width: 769px) {
  .mobile-only { display: none !important; }
  .bottom-nav { display: none; }
  .sidebar { display: flex; }
}

/* ══════════════════════════════════════
   공댕이 (공부친구 캐릭터) 공통 컴포넌트
══════════════════════════════════════ */
.buddy-img { display: block; user-select: none; -webkit-user-drag: none; pointer-events: none; flex-shrink: 0; }
.buddy-float  { animation: buddyFloat 3s ease-in-out infinite; }
.buddy-wiggle { animation: buddyWiggle 1.6s ease-in-out infinite; }
.buddy-pop    { animation: buddyPop 0.5s cubic-bezier(.34,1.56,.64,1) both; }
@keyframes buddyFloat  { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
@keyframes buddyWiggle { 0%,100% { transform: rotate(-4deg); } 50% { transform: rotate(4deg); } }
@keyframes buddyPop    { 0% { transform: scale(0.4); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }

/* 캐릭터 + 말풍선 한 줄 */
.buddy-say { display: flex; align-items: center; gap: 12px; }
.buddy-say .buddy-img { width: 64px; height: auto; }
.bubble {
  position: relative; background: var(--white);
  border: 2px solid var(--buddy-aqua); border-radius: 20px;
  padding: 10px 16px; font-size: 14px; line-height: 1.55; color: var(--ink);
  font-weight: 500;
}
.bubble::before {
  content: ""; position: absolute; left: -9px; top: 50%; transform: translateY(-50%) rotate(45deg);
  width: 14px; height: 14px; background: var(--white);
  border-left: 2px solid var(--buddy-aqua); border-bottom: 2px solid var(--buddy-aqua);
}
.bubble strong { font-family: var(--font-title); font-weight: normal; color: var(--primary); }
.bubble-up::before { left: 50%; top: -9px; transform: translateX(-50%) rotate(135deg); }

/* 빈 화면 안내 */
.buddy-empty { text-align: center; padding: 28px 16px; }
.buddy-empty .buddy-img { width: 110px; height: auto; margin: 0 auto 12px; }
.buddy-empty-title { font-family: var(--font-title); font-size: 18px; margin-bottom: 6px; color: var(--ink); }
.buddy-empty-sub { font-size: 14px; color: var(--muted); line-height: 1.6; }

@media (prefers-reduced-motion: reduce) {
  .buddy-float, .buddy-wiggle, .buddy-pop { animation: none; }
}
