@import url('https://cdn.jsdelivr.net/gh/orioncactus/pretendard@v1.3.9/dist/web/variable/pretendardvariable-dynamic-subset.min.css');

/* 정보 종류마다 색을 나눈다: 깡통이 말=하늘, 학생 말=노랑, 배움=민트, 주의=살구 */
:root {
  color-scheme: light;
  --paper: #f7f3ea;
  --paper-2: #fffdf8;
  --card: #ffffff;
  --ink: #1e2a32;
  --ink-2: #4a5a66;
  --ink-3: #7b8a95;
  --line: #e6dfcf;

  --bot-bg: #e4f0fa;
  --bot-line: #9cc3e3;
  --bot-ink: #1d4f7a;
  --me-bg: #fff3c9;
  --me-line: #e8c766;
  --me-ink: #6b4e00;
  --learn-bg: #ddf4e8;
  --learn-line: #8fd4b0;
  --learn-ink: #1c7a50;
  --warn-bg: #ffe6d6;
  --warn-line: #f2b08f;
  --warn-ink: #c4552b;

  --heart: #ff6f7d;
  --tin: #9fb3c0;
  --tin-dark: #6e8594;
  --tin-light: #d5e0e7;
  --screen: #1e2a32;
  --glow: #9ff0d0;

  --radius: 18px;
  --shadow: 0 1px 0 rgba(30, 42, 50, 0.04), 0 8px 24px -12px rgba(30, 42, 50, 0.18);
  --font: 'Pretendard Variable', Pretendard, -apple-system, 'Apple SD Gothic Neo', 'Malgun Gothic', sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.55;
  word-break: keep-all;
  overflow-wrap: break-word;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
h1, h2, h3, p { margin: 0; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 10px 20px;
  border: 2px solid var(--ink); border-radius: 14px;
  background: var(--ink); color: #fff; font-weight: 700;
  transition: transform 0.12s ease, background 0.2s ease, opacity 0.2s;
}
.btn:active { transform: translateY(1px) scale(0.99); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn.soft { background: var(--paper-2); color: var(--ink); border-color: var(--line); }
.btn.mint { background: var(--learn-ink); border-color: var(--learn-ink); }
.btn.big { min-height: 60px; font-size: 20px; border-radius: 18px; padding: 12px 28px; }
.btn.small { min-height: 38px; padding: 6px 14px; font-size: 15px; border-radius: 11px; }

.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 20px;
}

.field { display: grid; gap: 6px; }
.field label { font-size: 14px; font-weight: 700; color: var(--ink-2); }
.input {
  width: 100%; min-height: 52px; padding: 10px 14px;
  border: 2px solid var(--line); border-radius: 14px; background: #fff; outline: none;
}
.input:focus { border-color: var(--bot-line); box-shadow: 0 0 0 4px rgba(156, 195, 227, 0.35); }

.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 12px; border-radius: 999px; font-size: 14px; font-weight: 700;
  background: var(--paper-2); border: 1px solid var(--line); color: var(--ink-2);
}
.chip.bot { background: var(--bot-bg); border-color: var(--bot-line); color: var(--bot-ink); }
.chip.learn { background: var(--learn-bg); border-color: var(--learn-line); color: var(--learn-ink); }
.chip.warn { background: var(--warn-bg); border-color: var(--warn-line); color: var(--warn-ink); }
.chip.me { background: var(--me-bg); border-color: var(--me-line); color: var(--me-ink); }

.bubble {
  position: relative; max-width: 86%; padding: 12px 16px; border-radius: 18px;
  border: 2px solid; line-height: 1.5;
}
.bubble.bot { background: var(--bot-bg); border-color: var(--bot-line); color: var(--ink); border-top-left-radius: 6px; }
.bubble.me { background: var(--me-bg); border-color: var(--me-line); color: var(--ink); border-top-right-radius: 6px; margin-left: auto; }

.learned-card {
  background: var(--learn-bg); border: 2px solid var(--learn-line); color: var(--ink);
  border-radius: 16px; padding: 12px 16px;
}
.learned-card .tag { color: var(--learn-ink); font-weight: 800; font-size: 13px; letter-spacing: 0.02em; }
.learned-card.me { background: var(--me-bg); border-color: var(--me-line); }
.learned-card.me .tag { color: var(--me-ink); }

.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px);
  background: var(--ink); color: #fff; padding: 12px 20px; border-radius: 14px;
  font-weight: 600; opacity: 0; pointer-events: none; transition: 0.25s ease; z-index: 100;
  max-width: calc(100vw - 32px); text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.warn { background: var(--warn-ink); }

.muted { color: var(--ink-3); }
.center { text-align: center; }

/* ── 깡통이 ─────────────────────────────────────────────── */
.kt { width: 100%; height: 100%; overflow: visible; display: block; }
.kt .kt-stroke { stroke: var(--tin-dark); }
.kt .kt-tin { fill: var(--tin); }
.kt .kt-tin-dark { fill: var(--tin-dark); }
.kt .kt-tin-light { fill: var(--tin-light); }
.kt .kt-armline { stroke: var(--tin-dark); }
.kt .kt-bolt { fill: var(--tin-dark); }
.kt .kt-screen { fill: var(--screen); }
.kt .kt-window { fill: #f4f7f9; stroke: var(--tin-dark); stroke-width: 3; }
.kt .kt-heart-line { fill: none; stroke: var(--heart); stroke-width: 3; stroke-linejoin: round; }
.kt .kt-heart-fill { fill: var(--heart); transition: y 1.2s cubic-bezier(.2,.8,.2,1), height 1.2s cubic-bezier(.2,.8,.2,1); }
.kt .kt-face circle, .kt .kt-face path { fill: none; stroke: var(--glow); stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; }
.kt .eyes-idle circle, .kt .eyes-curious circle, .kt .eyes-thinking circle, .kt .eyes-care circle, .kt .mouth-sleep circle { fill: var(--glow); stroke: none; }
.kt .eyes, .kt .mouth { display: none; }
.kt[data-mood='idle'] .eyes-idle, .kt[data-mood='idle'] .mouth-idle,
.kt[data-mood='sleep'] .eyes-sleep, .kt[data-mood='sleep'] .mouth-sleep,
.kt[data-mood='curious'] .eyes-curious, .kt[data-mood='curious'] .mouth-idle,
.kt[data-mood='thinking'] .eyes-thinking,
.kt[data-mood='happy'] .eyes-happy, .kt[data-mood='happy'] .mouth-happy,
.kt[data-mood='learned'] .eyes-happy, .kt[data-mood='learned'] .mouth-happy,
.kt[data-mood='oops'] .eyes-oops, .kt[data-mood='oops'] .mouth-oops,
.kt[data-mood='care'] .eyes-care, .kt[data-mood='care'] .mouth-care { display: inline; }

.kt .kt-body { animation: kt-bob 3.2s ease-in-out infinite; transform-origin: 100px 230px; }
.kt[data-mood='sleep'] .kt-body { animation: kt-breathe 4s ease-in-out infinite; }
.kt .kt-blink { animation: kt-blink 4.5s infinite; transform-origin: 100px 81px; }
.kt .kt-bulb { transition: filter 0.3s; }
.kt[data-mood='sleep'] .kt-bulb { filter: grayscale(1) brightness(0.8); }
.kt[data-mood='thinking'] .kt-bulb { animation: kt-flash 0.9s ease-in-out infinite; }
.kt[data-mood='learned'] .kt-bulb, .kt[data-mood='happy'] .kt-bulb { filter: hue-rotate(-40deg) saturate(1.4); }
.kt .kt-dot { animation: kt-dots 1.2s infinite; }
.kt .kt-dot.d2 { animation-delay: 0.2s; }
.kt .kt-dot.d3 { animation-delay: 0.4s; }
.kt .kt-zzz { display: none; fill: var(--ink-3); font: 700 16px var(--font); }
.kt[data-mood='sleep'] .kt-zzz { display: inline; }
.kt[data-mood='sleep'] .kt-zzz text { animation: kt-z 2.4s ease-in-out infinite; }
.kt[data-mood='sleep'] .kt-zzz text:nth-child(2) { animation-delay: 0.4s; }
.kt[data-mood='sleep'] .kt-zzz text:nth-child(3) { animation-delay: 0.8s; }
.kt[data-mood='learned'] .kt-arm-r { animation: kt-wave 0.7s ease-in-out 3; transform-origin: 146px 152px; }
.kt[data-mood='oops'] .kt-body { animation: kt-shake 0.5s ease-in-out 2; }
.kt.kt-pulse .kt-heart { animation: kt-heart 0.9s ease-out; transform-origin: 100px 176px; }
.kt.kt-full .kt-heart-line { stroke-width: 4; filter: drop-shadow(0 0 6px rgba(255, 111, 125, 0.7)); }

@keyframes kt-bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }
@keyframes kt-breathe { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.015); } }
@keyframes kt-blink { 0%, 92%, 100% { transform: scaleY(1); } 95% { transform: scaleY(0.1); } }
@keyframes kt-flash { 50% { filter: brightness(1.35) saturate(1.5); } }
@keyframes kt-dots { 0%, 100% { opacity: 0.25; } 50% { opacity: 1; } }
@keyframes kt-z { 0% { opacity: 0; transform: translateY(6px); } 40% { opacity: 1; } 100% { opacity: 0; transform: translateY(-10px); } }
@keyframes kt-wave { 50% { transform: rotate(-28deg); } }
@keyframes kt-shake { 25% { transform: translateX(-4px) rotate(-2deg); } 75% { transform: translateX(4px) rotate(2deg); } }
@keyframes kt-heart { 0% { transform: scale(1); } 35% { transform: scale(1.35); } 100% { transform: scale(1); } }

@media (prefers-reduced-motion: reduce) {
  .kt * { animation: none !important; }
}
