:root {
  --bg: #fbfaf7;
  --fg: #1d1d1f;
  --muted: #6e6e73;
  --line: #e5e1d8;
  --card: #ffffff;
  --accent: #2f5bd3;
  --accent-fg: #ffffff;
  --user-bg: #edf1fa;
  --quote: #f3f1ec;
  --err: #b3261e;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #141416;
    --fg: #ececee;
    --muted: #9a9aa1;
    --line: #2b2b30;
    --card: #1c1c1f;
    --accent: #7c9dff;
    --accent-fg: #0f1320;
    --user-bg: #1e2532;
    --quote: #1f1f23;
    --err: #ff8a80;
  }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--fg);
  font-family: -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", sans-serif;
  -webkit-text-size-adjust: 100%;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}
header {
  position: sticky;
  top: 0;
  z-index: 2;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.bar {
  max-width: 720px;
  margin: 0 auto;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
h1 { font-size: 17px; font-weight: 700; margin: 0; letter-spacing: -0.01em; }
.ghost {
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--fg);
  border-radius: 999px;
  padding: 6px 12px;
  font: inherit;
  font-size: 14px;
  cursor: pointer;
}
main {
  flex: 1;
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  padding: 20px 16px 8px;
}
.error-line { color: var(--err); font-size: 14px; margin: 0 4px 8px; }

/* 답 글 */
.answer { font-size: 17px; line-height: 1.8; overflow-wrap: anywhere; }
.answer .p { margin: 0 0 14px; }
.answer .math-block { margin: 6px 0 14px; overflow-x: auto; overflow-y: hidden; padding: 2px 0; }
.answer blockquote { margin: 0 0 14px; padding: 10px 14px; background: var(--quote); border-radius: 10px; }
.answer ul, .answer ol { margin: 0 0 14px; padding-left: 22px; }
.answer .katex { font-size: 1.05em; }
.answer code { font-size: 0.9em; }

/* 입장 코드 */
.gate { flex: 1; display: grid; place-items: center; padding: 24px 16px; }
.gate form { width: 100%; max-width: 320px; display: flex; flex-direction: column; gap: 10px; }
.gate label { font-size: 15px; color: var(--muted); }
.gate input {
  font: inherit;
  font-size: 17px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card);
  color: var(--fg);
}
.gate button {
  font: inherit;
  font-size: 16px;
  padding: 12px;
  border: none;
  border-radius: 12px;
  background: var(--accent);
  color: var(--accent-fg);
  cursor: pointer;
}
.gate .error-line { margin: 0; }

.chip {
  display: inline-block;
  font-size: 12px;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 1px 8px;
}
.meta { color: var(--muted); font-size: 12px; margin-top: 4px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
