/* Tokens: docs/design/handoff.md §1 (brand-spec.md). No other colors; mixing and transparency only. */
:root {
  --bg-top: #daeaf9;
  --bg: #f5f6ec;
  --bg-bottom: #fdf8e1;
  --surface: #ffffff;
  --surface-2: #eaf0f5;
  --fg: #0d0d0d;
  --muted: #696969;
  --accent: #6a73fd;   /* progress and focus only */
  --accent-2: #d2a4f1; /* progress gradient end only */
  --rose: #d69b8b;
  --danger: #d23934;   /* ending the call only */
  --on-fg: var(--surface);
  --glass: color-mix(in srgb, var(--surface) 62%, transparent);
  --font-display: "Wanted Sans Variable", "Wanted Sans", "Pretendard Variable", sans-serif;
  --font: "Pretendard Variable", Pretendard, -apple-system, system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  min-height: 100dvh;
  background: linear-gradient(180deg, var(--bg-top) 0%, var(--bg) 52%, var(--bg-bottom) 100%) fixed;
  color: var(--fg);
  font: 400 15px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
h1, p { margin: 0; word-break: keep-all; }
:focus-visible { outline: 2.5px solid var(--accent); outline-offset: 2px; border-radius: 12px; }

main { max-width: 440px; margin: 0 auto; min-height: 100dvh; display: flex; }
.screen { flex: 1; display: flex; flex-direction: column; min-height: 100dvh; }
.screen[hidden] { display: none; }
.content { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 12px; padding: 40px 16px 16px; }
.content.center { justify-content: center; }
.foot { flex: none; padding: 10px 16px 28px; }

.h1 { font-family: var(--font-display); font-size: 32px; font-weight: 520; line-height: 1.18; letter-spacing: -0.03em; }
.lead { color: var(--muted); margin-bottom: 8px; }
.error { color: var(--danger); font-size: 14px; }
.account { display: flex; justify-content: center; align-items: center; gap: 10px; padding-top: 10px;
  font-size: 13px; color: var(--muted); }
.link { text-decoration: underline; text-underline-offset: 3px; color: var(--fg); padding: 6px 4px; }

/* cards and controls */
.box { background: var(--surface); border-radius: 22px; padding: 16px; display: flex; flex-direction: column; gap: 8px; }
.lbl { font-size: 13px; font-weight: 600; margin-top: 4px; }
.form .lbl { margin-top: 6px; }
.form .lbl:first-child { margin-top: 0; }
.inp {
  width: 100%; min-height: 50px; border: 0; border-radius: 16px; padding: 0 16px; background: var(--surface-2);
}
select.inp {
  appearance: none; -webkit-appearance: none; padding-right: 40px; text-overflow: ellipsis;
  background: var(--surface-2) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M7 10l5 5 5-5' fill='none' stroke='%230d0d0d' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 14px center / 18px;
}
.btn {
  width: 100%; min-height: 58px; border-radius: 999px; background: var(--fg); color: var(--on-fg);
  font-weight: 600; font-size: 15.5px; transition: background-color .2s;
}
.btn:hover { background: color-mix(in srgb, var(--fg) 86%, var(--surface)); }
.btn:disabled { background: color-mix(in srgb, var(--fg) 12%, var(--surface)); color: var(--muted); cursor: not-allowed; }
.btn.danger { background: var(--danger); }
.btn.danger:hover { background: color-mix(in srgb, var(--danger) 88%, var(--fg)); }

/* the tutor: a white orb with the initial (the design's signature circle) */
.orb {
  width: 44px; height: 44px; border-radius: 50%; background: var(--surface); flex: none;
  display: grid; place-items: center; font-family: var(--font-display); font-weight: 560; font-size: 18px;
  box-shadow: 0 0 0 calc(var(--lvl, 0) * 12px) var(--glass); transition: box-shadow .15s;
}
.orb.big { width: 56px; height: 56px; font-size: 22px; }
.m { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.m b { font-family: var(--font-display); font-weight: 560; font-size: 16px; letter-spacing: -0.02em; }
.m span { font-size: 12.5px; color: var(--muted); }

/* in call (prototype "통화 중"): the screen is exactly the viewport; only the captions scroll, so the end-call
   button stays on screen however long the conversation gets */
#incall { height: 100dvh; min-height: 0; }
#incall .content { padding-top: 24px; overflow: hidden; }
.call-top { display: flex; align-items: center; gap: 12px; }
.timer { font-family: var(--font-display); font-size: 28px; font-weight: 520; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
/* the remaining part is a plain white track: hatched in rose, the whole bar at the start of a call, it looked like
   an overflow warning */
.bar { height: 8px; border-radius: 999px; overflow: hidden; background: var(--glass); }
.bar span { display: block; height: 100%; width: 0; min-width: 8px; border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2)); transition: width .3s; }
.status { font-size: 13px; color: var(--muted); min-height: 1.5em; }
.chat { list-style: none; margin: 0; padding: 4px 0; flex: 1; min-height: 0; overflow-y: auto;
  display: flex; flex-direction: column; gap: 8px; }
.chat::before { content: ""; flex: 1; }  /* newest lines sit at the bottom, near the controls */
.bub { max-width: 84%; padding: 10px 13px; border-radius: 18px; font-size: 15px; line-height: 1.45; }
.bub.ai { background: var(--surface); border-bottom-left-radius: 6px; align-self: flex-start; }
.bub.me { background: var(--fg); color: var(--on-fg); border-bottom-right-radius: 6px; align-self: flex-end; }
.bub.me.interim { opacity: .55; }  /* still being said */
.bub .line { display: block; }
/* a bubble is reportable: tap or click it (app.js openReport) */
.bub:not(.interim, .reported) { cursor: pointer; -webkit-tap-highlight-color: transparent; transition: transform .1s; }
.bub:not(.interim, .reported):active { transform: scale(.98); }
@media (hover: hover) {  /* a mouse; on a touch screen a hover state stays on after the tap */
  .bub.ai:not(.interim, .reported):hover { background: color-mix(in srgb, var(--surface) 88%, var(--surface-2)); }
  .bub.me:not(.interim, .reported):hover { background: color-mix(in srgb, var(--fg) 86%, var(--surface)); }
}
.bub.reported::after { content: "신고함"; display: block; margin-top: 4px; font-size: 11.5px; font-weight: 600;
  color: var(--danger); }
.bub.me.reported::after { color: var(--rose); }
.hint { font-size: 12px; color: var(--muted); text-align: center; }
.bub .ko { display: block; margin-top: 4px; font-size: 13px; line-height: 1.45; color: var(--muted); }
.bub .ko:empty { display: none; }
.chat.no-ko .ko { display: none; }  /* the Korean captions turned off during the call */
.tools { display: flex; justify-content: center; padding-top: 4px; }
.tool { display: flex; flex-direction: column; align-items: center; gap: 5px; min-width: 72px; }
.tool span { width: 46px; height: 46px; border-radius: 50%; background: var(--surface); display: grid; place-items: center; }
.tool svg { width: 22px; height: 22px; fill: currentColor; }
.tool em { font-style: normal; font-size: 11.5px; font-weight: 500; }
.tool b { font-size: 18px; font-weight: 600; line-height: 1; }
.tool:hover span { background: var(--surface-2); }
.tool[aria-pressed="true"] span { background: var(--fg); color: var(--on-fg); }

/* ended */
.summary { gap: 0; padding: 4px 16px; }
.summary .row { display: flex; justify-content: space-between; gap: 12px; padding: 12px 0; font-size: 14px; }
.summary .row + .row { border-top: 1px solid color-mix(in srgb, var(--fg) 8%, transparent); }
.summary .row span { color: var(--muted); }
.summary .row b { font-weight: 600; text-align: right; }

/* the report sheet: a bottom sheet on a phone, the column's width on a wider screen */
.sheet { border: 0; padding: 0; margin: auto auto 0; width: 100%; max-width: 440px; background: transparent;
  color: var(--fg); }
.sheet::backdrop { background: color-mix(in srgb, var(--fg) 38%, transparent); }
.sheet form { display: flex; flex-direction: column; gap: 10px; background: var(--surface);
  border-radius: 24px 24px 0 0; padding: 22px 16px 28px; }
.h2 { margin: 0; font-family: var(--font-display); font-size: 20px; font-weight: 560; letter-spacing: -0.02em; }
.quote { margin: 0; padding: 10px 13px; border-radius: 14px; background: var(--surface-2); font-size: 14.5px;
  max-height: 30dvh; overflow-y: auto; }
textarea.inp { min-height: 0; padding: 12px 16px; resize: none; line-height: 1.45; }
.pair { display: flex; gap: 8px; margin-top: 4px; }
.btn.ghost { background: var(--surface-2); color: var(--fg); }
.btn.ghost:hover { background: color-mix(in srgb, var(--surface-2) 85%, var(--fg)); }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
  .orb { box-shadow: none !important; }
}
