:root {
  --bg: #ffffff;
  --surface: #f1f4f6;
  --ink: #17222c;
  --ink-2: #4a5763;
  --line: #d9e0e5;
  --primary: #0b5f6e;
  --primary-ink: #ffffff;
  --primary-soft: #e3f0f2;
  --note: #ffe27a;
  --note-ink: #2a2300;
  --good: #2e7d4f;
  --good-soft: #e5f3ea;
  --warn: #b3261e;
  --warn-soft: #fdecea;
  --radius: 18px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #11181e;
    --surface: #1b252d;
    --ink: #eef2f5;
    --ink-2: #aab6c0;
    --line: #2f3b45;
    --primary: #5cc2d3;
    --primary-ink: #06232a;
    --primary-soft: #18343a;
    --note: #f2d35e;
    --note-ink: #231d00;
    --good: #6fcf97;
    --good-soft: #17301f;
    --warn: #ff8a80;
    --warn-soft: #3a1d1b;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: 'Pretendard Variable', Pretendard, -apple-system, BlinkMacSystemFont, 'Apple SD Gothic Neo', 'Noto Sans KR', sans-serif;
  font-size: 21px;
  line-height: 1.55;
  word-break: keep-all;
  overflow-wrap: anywhere;
}
main {
  max-width: 560px;
  margin: 0 auto;
  padding: 20px 18px calc(40px + env(safe-area-inset-bottom));
}

h1 { font-size: 32px; line-height: 1.3; margin: 8px 0 12px; letter-spacing: -0.02em; }
h2 { font-size: 26px; line-height: 1.35; margin: 28px 0 12px; letter-spacing: -0.01em; }
p { margin: 0 0 14px; }
.muted { color: var(--ink-2); }
.small { font-size: 18px; }

.top { display: flex; align-items: center; justify-content: space-between; min-height: 48px; margin-bottom: 4px; }
.back { font-size: 19px; color: var(--ink-2); text-decoration: none; padding: 10px 4px; }
.brand { font-weight: 700; color: var(--primary); font-size: 19px; }

.btn {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; min-height: 66px; padding: 14px 20px; margin: 0 0 12px;
  border: 0; border-radius: var(--radius);
  font: inherit; font-weight: 700; font-size: 22px; text-decoration: none; text-align: center;
  background: var(--primary); color: var(--primary-ink); cursor: pointer;
}
.btn.secondary { background: var(--surface); color: var(--ink); border: 2px solid var(--line); }
.btn.ghost { background: transparent; color: var(--primary); min-height: 56px; font-size: 20px; }
.btn:disabled { opacity: .5; }
.btn svg { width: 28px; height: 28px; flex: none; }
:focus-visible { outline: 4px solid var(--note); outline-offset: 3px; }

.card { background: var(--surface); border-radius: var(--radius); padding: 22px 20px; margin: 0 0 16px; }
.card.today { background: var(--primary-soft); border: 2px solid var(--primary); }
.card .label { font-size: 18px; font-weight: 700; color: var(--primary); margin-bottom: 6px; }
.card .title { font-size: 27px; font-weight: 800; line-height: 1.3; margin-bottom: 10px; letter-spacing: -0.01em; }

.say { font-size: 20px; color: var(--ink-2); margin: 6px 0 0; }
.say b { color: var(--ink); }

.speak {
  display: inline-flex; align-items: center; gap: 6px;
  background: none; border: 0; padding: 8px 0; color: var(--primary); font: inherit; font-size: 19px; font-weight: 600; cursor: pointer;
}
.speak svg { width: 22px; height: 22px; }

/* Mic */
.mic-wrap { display: flex; flex-direction: column; align-items: center; margin: 26px 0 18px; }
.mic {
  width: 148px; height: 148px; border-radius: 50%; border: 0;
  background: var(--primary); color: var(--primary-ink);
  display: flex; align-items: center; justify-content: center; cursor: pointer;
  box-shadow: 0 0 0 10px var(--primary-soft);
}
.mic svg { width: 64px; height: 64px; }
.mic.on { background: var(--warn); box-shadow: 0 0 0 10px var(--warn-soft); animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 20px var(--warn-soft); } }
@media (prefers-reduced-motion: reduce) { .mic.on { animation: none; } }
.mic-label { margin-top: 18px; font-size: 23px; font-weight: 700; }

.heard { font-size: 25px; font-weight: 700; line-height: 1.45; background: var(--surface); border-radius: var(--radius); padding: 18px 20px; margin: 0 0 16px; min-height: 70px; }
.heard.live { color: var(--ink-2); }

textarea {
  width: 100%; min-height: 130px; padding: 16px; border: 2px solid var(--line); border-radius: var(--radius);
  font: inherit; font-size: 23px; background: var(--bg); color: var(--ink); resize: vertical; margin-bottom: 12px;
}
input[type=text] {
  width: 100%; min-height: 60px; padding: 12px 16px; border: 2px solid var(--line); border-radius: 14px;
  font: inherit; background: var(--bg); color: var(--ink);
}
.kbd-hint { display: flex; gap: 12px; align-items: center; background: var(--surface); border-radius: 14px; padding: 14px 16px; margin: 0 0 14px; font-size: 19px; }
.kbd-hint .key { flex: none; width: 52px; height: 52px; border-radius: 10px; background: var(--bg); border: 2px solid var(--line); display: flex; align-items: center; justify-content: center; color: var(--ink); }
.kbd-hint .key svg { width: 28px; height: 28px; }

/* Answer */
.answer { border: 2px solid var(--line); border-radius: var(--radius); padding: 18px 20px; margin: 0 0 16px; }
.answer .who { font-size: 18px; font-weight: 700; color: var(--ink-2); margin-bottom: 6px; }
.answer .body { white-space: pre-wrap; font-size: 22px; }
.answer.final { border-color: var(--good); background: var(--good-soft); }
.answer.first { opacity: .8; }
.answer.first .body { font-size: 19px; }
.q { font-size: 19px; color: var(--ink-2); margin-bottom: 10px; }
.q b { color: var(--ink); }

/* The one memorable thing: the coaching note */
.note {
  position: relative; background: var(--note); color: var(--note-ink);
  border-radius: 6px 6px 6px 22px; padding: 20px 22px 22px; margin: 6px 0 18px;
  box-shadow: 0 2px 0 rgba(0,0,0,.08);
}
.note .label { font-size: 18px; font-weight: 800; margin-bottom: 6px; }
.note .text { font-size: 25px; font-weight: 800; line-height: 1.4; }

.praise { display: flex; gap: 10px; align-items: flex-start; color: var(--good); font-weight: 700; font-size: 22px; margin: 4px 0 16px; }
.praise svg { flex: none; width: 28px; height: 28px; margin-top: 2px; }

.safety { background: var(--warn-soft); border-left: 6px solid var(--warn); border-radius: 10px; padding: 16px 18px; margin: 0 0 16px; }
.safety .label { font-weight: 800; color: var(--warn); font-size: 19px; margin-bottom: 4px; }

.tip { background: var(--primary-soft); border-radius: var(--radius); padding: 18px 20px; margin: 18px 0; }
.tip .label { font-size: 18px; font-weight: 800; color: var(--primary); margin-bottom: 4px; }

.thinking { display: flex; align-items: center; gap: 14px; font-size: 23px; font-weight: 700; padding: 24px 0; }
.dots span { display: inline-block; width: 12px; height: 12px; border-radius: 50%; background: var(--primary); margin-right: 6px; animation: blink 1.2s infinite; }
.dots span:nth-child(2) { animation-delay: .2s; }
.dots span:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 50% { opacity: .2; } }
@media (prefers-reduced-motion: reduce) { .dots span { animation: none; } }

.photo-preview { width: 100%; max-height: 300px; object-fit: contain; border-radius: var(--radius); background: var(--surface); margin-bottom: 12px; }

.list { list-style: none; padding: 0; margin: 0 0 16px; }
.list li { display: flex; align-items: center; gap: 14px; min-height: 64px; padding: 10px 4px; border-bottom: 1px solid var(--line); }
.list a { color: inherit; text-decoration: none; flex: 1; }
.check { flex: none; width: 34px; height: 34px; border-radius: 50%; border: 2px solid var(--line); display: flex; align-items: center; justify-content: center; }
.check.on { background: var(--good); border-color: var(--good); color: #fff; }
.check svg { width: 20px; height: 20px; }

.progress { height: 14px; border-radius: 7px; background: var(--surface); overflow: hidden; margin: 6px 0 18px; }
.progress span { display: block; height: 100%; background: var(--good); }

.chips { display: flex; flex-wrap: wrap; gap: 10px; margin: 0 0 14px; }
.chip {
  min-height: 52px; padding: 10px 18px; border-radius: 26px; border: 2px solid var(--line);
  background: var(--bg); color: var(--ink); font: inherit; font-size: 20px; cursor: pointer;
}
.chip[aria-pressed=true] { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); font-weight: 700; }
.field { margin: 0 0 22px; }
.field > .lbl { display: block; font-weight: 700; margin-bottom: 10px; }
.field > .lbl .opt { font-weight: 400; color: var(--ink-2); font-size: 18px; }

.toggle { display: flex; gap: 14px; align-items: flex-start; padding: 14px 0; font-size: 20px; cursor: pointer; }
.toggle input { width: 30px; height: 30px; flex: none; margin-top: 2px; accent-color: var(--primary); }

.linkbox { white-space: pre-wrap; word-break: break-all; font-size: 18px; background: var(--surface); padding: 12px 14px; border-radius: 12px; margin-bottom: 12px; }
.banner { background: var(--note); color: var(--note-ink); border-radius: 14px; padding: 14px 16px; margin: 0 0 16px; font-size: 19px; }
.banner a { color: inherit; font-weight: 800; }
.err { color: var(--warn); font-weight: 700; margin: 0 0 14px; }
.toast {
  position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); transform: translateX(-50%);
  background: var(--ink); color: var(--bg); padding: 14px 22px; border-radius: 30px; font-size: 19px; z-index: 10;
}
.feed-item { border-bottom: 1px solid var(--line); padding: 16px 0; }
.feed-item .when { font-size: 17px; color: var(--ink-2); }
.feed-item .what { font-weight: 800; font-size: 22px; }
.feed-item .detail { white-space: pre-wrap; font-size: 19px; margin-top: 8px; background: var(--surface); border-radius: 12px; padding: 12px 14px; }
