/* Trial chat page. Colours, type and radii follow the johabon.com homepage (홈페이지/tokens.css, 2026-10-31)
   so a visitor from the landing page sees the same service. Light only, like the homepage. */
@font-face { font-family: "Pretendard"; font-weight: 400; font-display: swap; src: url("/fonts/Pretendard-Regular.subset.woff2") format("woff2"); }
@font-face { font-family: "Pretendard"; font-weight: 600; font-display: swap; src: url("/fonts/Pretendard-SemiBold.subset.woff2") format("woff2"); }
@font-face { font-family: "Pretendard"; font-weight: 700; font-display: swap; src: url("/fonts/Pretendard-Bold.subset.woff2") format("woff2"); }

:root {
  color-scheme: light;
  --paper: oklch(99.6% 0.002 250);
  --paper-2: oklch(97.6% 0.004 250);
  --paper-3: oklch(95.2% 0.007 250);
  --ink: oklch(23.7% 0.020 258);
  --ink-2: oklch(35.7% 0.028 257);
  --muted: oklch(50% 0.025 254);
  --rule: oklch(91.5% 0.006 250);
  --rule-2: oklch(86% 0.009 250);
  --accent: oklch(56.5% 0.168 252);
  --accent-2: oklch(50% 0.16 253);
  --accent-ink: oklch(99.6% 0.002 250);
  --accent-soft: oklch(95.9% 0.020 250);
  --focus: oklch(55% 0.2 252);
  --error: oklch(48% 0.17 25);
  --error-soft: oklch(96% 0.03 25);
  --radius-card: 12px;
  --radius-input: 8px;
  --font: "Pretendard", "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", system-ui, sans-serif;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--paper);
  color: var(--ink);
  font: 16px/1.65 var(--font);
  -webkit-font-smoothing: antialiased;
  word-break: keep-all;
  overflow-wrap: anywhere;
}
body.fair { font-size: 17px; }
button { font: inherit; cursor: pointer; }
button:disabled { cursor: default; opacity: .55; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

/* Buttons: the homepage .btn / .btn--quiet / .btn--s */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 20px;
  border: 1px solid var(--accent); border-radius: var(--radius-input);
  background: var(--accent); color: var(--accent-ink);
  font-weight: 600; line-height: 1; white-space: nowrap; text-decoration: none;
  transition: background-color .22s var(--ease-out), border-color .22s var(--ease-out);
}
.btn:hover:not(:disabled) { background: var(--accent-2); border-color: var(--accent-2); }
.btn--quiet { background: var(--paper); color: var(--ink); border-color: var(--rule-2); }
.btn--quiet:hover:not(:disabled) { background: var(--paper-2); border-color: var(--rule-2); }
.btn--s { min-height: 40px; padding: 0 14px; font-size: 14px; }

.top {
  position: sticky; top: 0; z-index: 2;
  background: oklch(99.6% 0.002 250 / 0.92);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--rule);
}
.top__row {
  max-width: 780px; margin: 0 auto; padding: 10px 16px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; min-width: 0; }
.brand img { display: block; height: 24px; width: auto; }
.brand__kind { color: var(--ink-2); font-size: 15px; font-weight: 600; white-space: nowrap; }
.top__actions { display: flex; gap: 8px; flex-shrink: 0; }
@media (max-width: 400px) {
  .brand__kind { display: none; }
}

main {
  max-width: 780px; margin: 0 auto; padding: 24px 16px 200px;
  display: flex; flex-direction: column; gap: 14px;
}

.intro {
  margin: -24px -16px 4px; padding: 32px 16px 8px;
  background: linear-gradient(180deg, var(--accent-soft), var(--paper) 85%);
  border-radius: 0 0 var(--radius-card) var(--radius-card);
}
.intro__kind { color: var(--accent); font-size: 14px; font-weight: 600; margin: 0 0 6px; }
.intro h1 { font-size: 26px; line-height: 1.35; font-weight: 700; letter-spacing: -0.02em; margin: 0 0 10px; }
.intro__lead { color: var(--ink-2); margin: 0 0 22px; }
.intro__label { color: var(--muted); font-size: 14px; font-weight: 600; margin: 0 0 8px; }
.examples { display: grid; gap: 8px; }
.examples button {
  text-align: left; background: var(--paper); color: var(--ink);
  border: 1px solid var(--rule); border-radius: var(--radius-card); padding: 13px 16px;
  box-shadow: 0 1px 2px oklch(20% 0.01 252 / 0.06);
  transition: border-color .22s var(--ease-out);
}
.examples button:hover:not(:disabled) { border-color: var(--accent); }
@media (min-width: 640px) {
  .examples { grid-template-columns: 1fr 1fr; }
  .intro h1 { font-size: 30px; }
}

.msg { border-radius: var(--radius-card); padding: 14px 18px; max-width: 100%; }
.msg p { margin: 0 0 10px; white-space: pre-wrap; }
.msg p:last-child { margin-bottom: 0; }
.user { align-self: flex-end; background: var(--accent-soft); max-width: 85%; white-space: pre-wrap; }
.bot { align-self: stretch; background: var(--paper); border: 1px solid var(--rule); box-shadow: 0 1px 2px oklch(20% 0.01 252 / 0.06); }
.lead { font-weight: 600; }
.error { color: var(--error); background: var(--error-soft); border-color: transparent; box-shadow: none; }

.pending .progress { display: flex; align-items: center; gap: 10px; }
.pending .timer { color: var(--muted); font-variant-numeric: tabular-nums; margin-left: auto; }
.pending .hint { color: var(--muted); font-size: 14px; margin-top: 6px; }
.dot {
  width: 10px; height: 10px; border-radius: 50%; background: var(--accent); flex-shrink: 0;
  animation: pulse 1.2s ease-in-out infinite;
}
@keyframes pulse { 50% { opacity: .25; transform: scale(.7); } }
@media (prefers-reduced-motion: reduce) { .dot { animation: none; } }

.follow { margin-top: 12px; padding: 10px 12px; border-left: 3px solid var(--accent); background: var(--paper-2); border-radius: 0 8px 8px 0; }
.follow-title { font-weight: 600; font-size: 14px; color: var(--ink-2); }
.follow ul { margin: 4px 0 0; padding-left: 20px; }

.choices { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.choice {
  background: var(--accent); color: var(--accent-ink);
  border: 1px solid var(--accent); border-radius: 999px; padding: 6px 14px;
}
.choice:hover:not(:disabled) { background: var(--accent-2); border-color: var(--accent-2); }
.choice.ghost { background: var(--paper); color: var(--ink); border-color: var(--rule-2); }

.sources { margin-top: 14px; border-top: 1px solid var(--rule); padding-top: 10px; font-size: 14px; }
.sources summary { color: var(--accent); cursor: pointer; font-weight: 600; }
.sources ol { margin: 8px 0 0; padding-left: 20px; }
.sources li { margin-bottom: 6px; }
.source-title { display: block; }
.source-id { color: var(--muted); font-size: 12px; margin-right: 8px; }
.sources a { color: var(--accent); margin-right: 8px; font-size: 13px; }
.meta { color: var(--muted); font-size: 13px; margin-top: 10px !important; }
.rate { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 8px; font-size: 13px; }
.rate-label { color: var(--muted); }
.rate-btn {
  background: var(--paper); color: var(--ink);
  border: 1px solid var(--rule-2); border-radius: 999px; padding: 3px 10px; font-size: 13px;
}
.rate-btn:hover { border-color: var(--accent); }

/* Once per conversation, after the first answer: where the work itself is done. */
.service {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px;
  padding: 14px 18px; border-radius: var(--radius-card); background: var(--paper-2); border: 1px solid var(--rule);
}
.service__text { flex: 1 1 260px; margin: 0; color: var(--ink-2); font-size: 15px; }
.service__text strong { color: var(--ink); }
.service__actions { display: flex; gap: 8px; flex-wrap: wrap; }

.bottom {
  position: fixed; left: 0; right: 0; bottom: 0;
  background: var(--paper); border-top: 1px solid var(--rule);
  padding: 10px 16px calc(8px + env(safe-area-inset-bottom));
}
#ask { max-width: 780px; margin: 0 auto; display: flex; gap: 8px; }
#question {
  flex: 1; resize: none; font: inherit; color: var(--ink); background: var(--paper-2);
  border: 1px solid var(--rule-2); border-radius: var(--radius-card); padding: 11px 14px; min-height: 52px;
}
#question:focus { outline: 2px solid var(--accent); outline-offset: -1px; background: var(--paper); }
#send { min-height: 52px; border-radius: var(--radius-card); }
.notice { max-width: 780px; margin: 6px auto 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.notice a { color: inherit; }
.notice .policy-link { font-weight: 700; }

/* Fair tablets (?src=fair): after a quiet spell, ask before clearing the conversation for the next visitor. */
.idle {
  position: fixed; inset: 0; z-index: 10;
  display: grid; place-items: center; padding: 16px;
  background: oklch(23.7% 0.02 258 / 0.45);
}
.idle[hidden] { display: none; }
.idle__box {
  width: min(100%, 380px); padding: 24px; text-align: center;
  background: var(--paper); border-radius: var(--radius-card);
  box-shadow: 0 12px 32px oklch(20% 0.01 252 / 0.18);
}
.idle__title { font-size: 18px; font-weight: 700; margin: 0 0 6px; }
.idle__text { color: var(--ink-2); margin: 0 0 18px; }
#idle-count { font-variant-numeric: tabular-nums; font-weight: 700; color: var(--accent); }

/* Privacy policy page */
.policy { display: block; padding-bottom: 48px; }
.policy h1 { font-size: 24px; line-height: 1.4; margin: 12px 0 4px; letter-spacing: -0.01em; }
.policy h2 { font-size: 17px; margin: 28px 0 8px; }
.policy p, .policy li { margin: 0 0 8px; }
.policy ol, .policy ul { padding-left: 22px; margin: 0 0 8px; }
.policy .effective { color: var(--muted); font-size: 14px; }
.policy a { color: var(--accent); }
.table-wrap { overflow-x: auto; margin: 0 0 10px; }
.policy table { border-collapse: collapse; width: 100%; font-size: 14px; background: var(--paper); }
.policy th, .policy td { border: 1px solid var(--rule-2); padding: 8px 10px; text-align: left; vertical-align: top; }
.policy th { white-space: nowrap; background: var(--paper-2); }
