/* Chat screen — taken from 시안 둥근3 (하린). Colors: data-mode light|dark × data-ac (강조색 목록 아래 한 곳). */

html[data-mode="light"] {
  --bg: #FFFFFF; --bg2: #F3F4F6; --surf: #FFFFFF; --bub: #F2F3F5; --well: #F7F8FA;
  --tx: #191F28; --tx2: #5C6572; --line: #E9EBEF; --line2: #DADEE3;
  --ok: #0A7D3F; --ok-soft: #E7F4EC; --bad: #B4301A; --bad-soft: #FCEEEB;
  --dim: rgba(25, 31, 40, .38); --sheet: #FFFFFF; --tile: #F2F3F5; --tile-tx: #3A424D;
  --warn: #8A5300; --warn-soft: #FDF0D6; --sw-off: #C6CCD4;
  color-scheme: light;
}
html[data-mode="dark"] {
  --bg: #141519; --bg2: #0D0E11; --surf: #1C1E23; --bub: #25282E; --well: #2A2D34;
  --tx: #ECEDEF; --tx2: #A3A9B2; --line: #2C2F36; --line2: #3A3E46;
  --ok: #5BC98A; --ok-soft: #1E3328; --bad: #FF8A80; --bad-soft: #3D2221;
  --dim: rgba(0, 0, 0, .55); --sheet: #1C1E23; --tile: #2A2D34; --tile-tx: #D5D8DD;
  --warn: #F0B54F; --warn-soft: #3A2E17; --sw-off: #4A4E57;
  color-scheme: dark;
}
/* ── 강조색 목록 (이곳 한 군데) ─────────────────────────────────────────────────────────────────────────────
   강조색은 버튼 · 내 말풍선 · 선택 표시 · 링크에만 쓴다. 캐릭터(public/icons/soft-*.png)와 상태 색(대기 · 오류 · 완료)은
   강조색을 따르지 않는다. 색 하나 더하기 = 아래 세 줄(밝게 · 어둡게 · 견본) + public/look.js ACCENTS + 설정 단추 하나.
   흰 글자 대비 4.5 이상(밝게) · 어둡게는 --ac 위 --ac-on 4.5 이상 · --ac-tx 는 바탕 위 7 안팎. */
html[data-mode="light"], html[data-mode="light"][data-ac="bora"] { --ac: #6D2BE0; --ac-on: #FFFFFF; --ac-tx: #5B21C4; --ac-soft: #EBE1FD; --ac-wash: #F6F1FE; }
html[data-mode="dark"], html[data-mode="dark"][data-ac="bora"]   { --ac: #A780EC; --ac-on: #140828; --ac-tx: #B999F0; --ac-soft: #2E214D; --ac-wash: #26203A; }
.sw6.bora { background: #6D2BE0; }
html[data-mode="light"][data-ac="parang"] { --ac: #2058DB; --ac-on: #FFFFFF; --ac-tx: #1D50C8; --ac-soft: #E0E8FA; --ac-wash: #EFF3FC; }
html[data-mode="dark"][data-ac="parang"]  { --ac: #7094E8; --ac-on: #061027; --ac-tx: #8BA8EC; --ac-soft: #1D2B4B; --ac-wash: #1C2539; }
.sw6.parang { background: #2058DB; }
html[data-mode="light"][data-ac="cho"]  { --ac: #0C8642; --ac-on: #FFFFFF; --ac-tx: #0B7A3C; --ac-soft: #DDF2E6; --ac-wash: #EEF8F3; }
html[data-mode="dark"][data-ac="cho"]   { --ac: #26A961; --ac-on: #031D0E; --ac-tx: #56BC84; --ac-soft: #193A2D; --ac-wash: #1A2D28; }
.sw6.cho { background: #0C8642; }
html[data-mode="light"][data-ac="sanho"] { --ac: #DA3656; --ac-on: #FFFFFF; --ac-tx: #C42E4C; --ac-soft: #FCE3E8; --ac-wash: #FDF1F4; }
html[data-mode="dark"][data-ac="sanho"]  { --ac: #EE6982; --ac-on: #2A0A10; --ac-tx: #F28CA0; --ac-soft: #49242F; --ac-wash: #34212A; }
.sw6.sanho { background: #DA3656; }
html[data-mode="light"][data-ac="jj"]   { --ac: #1E3A8A; --ac-on: #FFFFFF; --ac-tx: #1E3A8A; --ac-soft: #E6ECF8; --ac-wash: #F1F4FB; }
html[data-mode="dark"][data-ac="jj"]    { --ac: #8FA8F0; --ac-on: #0B1330; --ac-tx: #A9BCF5; --ac-soft: #26304A; --ac-wash: #1E2433; }
.sw6.jj { background: #1E3A8A; }
html[data-mode="light"][data-ac="meok"] { --ac: #191F28; --ac-on: #FFFFFF; --ac-tx: #191F28; --ac-soft: #ECEEF1; --ac-wash: #F5F6F8; }
html[data-mode="dark"][data-ac="meok"]  { --ac: #E6E8EB; --ac-on: #15171A; --ac-tx: #E6E8EB; --ac-soft: #33373E; --ac-wash: #24272C; }
.sw6.meok { background: #191F28; }
/* ──────────────────────────────────────────────────────────────────────────────────────────────────────────── */
:root {
  --f: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", "맑은 고딕", sans-serif;
  --fs: 16px; --ease: cubic-bezier(.2, .8, .2, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
html { -webkit-text-size-adjust: 100%; }
body { font-family: var(--f); color: var(--tx); background: var(--bg2); font-size: var(--fs); line-height: 1.6; word-break: keep-all; overflow-wrap: anywhere; -webkit-font-smoothing: antialiased; overflow: hidden; }
button, textarea { font: inherit; color: inherit; }
button { background: none; border: 0; cursor: pointer; -webkit-tap-highlight-color: transparent; }
button:disabled { cursor: default; }
ul, ol { list-style: none; }
[hidden] { display: none !important; }
svg.i { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex: none; }
:focus-visible { outline: 2px solid var(--ac); outline-offset: 2px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* frame */
.app { height: 100dvh; max-width: 752px; margin: 0 auto; background: var(--bg); display: flex; flex-direction: column; position: relative; }
.hd { flex: none; }
.hd-in, .ft-in, .banner-in { max-width: 672px; margin: 0 auto; width: 100%; }
.col { max-width: 672px; margin: 0 auto; padding: 0 16px; }
.body { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 4px 0 20px; }

/* header */
.hd-in { display: flex; align-items: flex-start; justify-content: space-between; padding: 10px 12px 6px; gap: 8px; }
.rb { width: 48px; height: 48px; border-radius: calc(50% * var(--rk)); display: grid; place-items: center; background: var(--surf); border: 1px solid var(--line2); flex: none; text-decoration: none; color: var(--tx); }
.rb.txt { width: auto; padding: 0 16px; border-radius: calc(999px * var(--rk)); font-size: 15px; font-weight: 700; display: flex; align-items: center; }
.who { display: flex; flex-direction: column; align-items: center; }
.who b { font-size: 16px; font-weight: 800; line-height: 1.2; background: var(--surf); border: 1px solid var(--line2); border-radius: calc(999px * var(--rk)); padding: 4px 14px; margin-top: 4px; position: relative; }
.who .live, .who .off { display: inline-flex; align-items: center; gap: 7px; min-height: 30px; padding: 0 12px 0 10px; border-radius: calc(999px * var(--rk)); font-size: 14px; font-weight: 700; margin-top: 6px; }
.who .live { background: var(--bub); color: var(--tx); }
.who .live .spin { width: 14px; height: 14px; border-radius: 50%; border: 2px solid color-mix(in srgb, var(--tx) 22%, transparent); border-top-color: var(--tx); animation: spin .9s linear infinite; }
.who .off { background: var(--bad-soft); color: var(--bad); padding: 0 12px; }
.hd.sub .hd-in { align-items: center; justify-content: flex-start; gap: 12px; }
.hd.sub h2 { font-size: 20px; font-weight: 800; letter-spacing: -0.01em; }
@keyframes spin { to { transform: rotate(360deg); } }

/* agent figure — the soft Fig (public/icons/soft-*.png · 대표 12-06 「색감 · 표현이 강하지 않게」) */
.av { display: inline-grid; place-items: center; flex: none; }
.av.hd56 { width: 64px; height: 64px; position: relative; }
.av.m30 { width: 30px; height: 30px; }
.av.big { width: 96px; height: 96px; margin-bottom: 14px; position: relative; }
.sf { --s: 30px; width: var(--s); height: var(--s); display: block; flex: none; position: relative; }
.hd56 .sf { --s: 64px; }
.big .sf { --s: 96px; }
.sf img { width: 100%; height: 100%; display: block; object-fit: contain; }
.sf.close img { border-radius: 50%; object-fit: cover; }
/* the live figure (head · login): the eyeless body + two eyes drawn here (fig-soft-eyes.json · % of the side) */
/* breathing: the body grows upward ~3.5 % with the bottom held (시안/모션/ref/실측.md) */
.sf .fig { position: absolute; inset: 0; transform-origin: 50% 90%; animation: sf-breathe 4s ease-in-out infinite alternate; }
/* the eyes: a box that clips (.eye) holding the dark oval (.eye > i). A blink is an eyelid, transform only — the box
   slides down while the oval slides up by the same amount, so the oval stays put and its top is cut away: the shut
   line sits below the eye's middle and opening shows the lower half first. */
.sf .eyes { position: absolute; inset: 0; }
.sf .eye { position: absolute; width: 5.2%; height: 8.4%; overflow: hidden; translate: 0 0; transition: translate 200ms ease, transform 60ms ease-in; }
.sf .eye > i { position: absolute; inset: 0; border-radius: 50%; background: #23202B; transition: transform 60ms ease-in; }
/* the catch light: a small soft dot up and to the right (stays inside the oval, cut by the lid like the eye) */
.sf .eye > i::after { content: ""; position: absolute; top: 15%; right: 13%; width: 38%; aspect-ratio: 1; border-radius: 50%; background: rgba(255, 255, 255, .82); }
.sf .eye.l { left: calc(44.05% - 2.6%); top: calc(46.72% - 4.2%); }
.sf .eye.r { left: calc(56.39% - 2.6%); top: calc(46.75% - 4.2%); }
.sf.blink .eye { animation: sf-lid 280ms linear; }
.sf.blink .eye > i { animation: sf-lid-in 280ms linear; }
/* 0–70 ms closing · ~100 ms shut · 170–280 ms opening */
@keyframes sf-lid {
  0% { transform: translateY(0); animation-timing-function: cubic-bezier(.55, 0, 1, .7); }
  25% { transform: translateY(84%); }
  61% { transform: translateY(84%); animation-timing-function: cubic-bezier(.1, .4, .45, 1); }
  100% { transform: translateY(0); }
}
@keyframes sf-lid-in {
  0% { transform: translateY(0); animation-timing-function: cubic-bezier(.55, 0, 1, .7); }
  25% { transform: translateY(-84%); }
  61% { transform: translateY(-84%); animation-timing-function: cubic-bezier(.1, .4, .45, 1); }
  100% { transform: translateY(0); }
}
/* where the eyes look (app.js MOTION) — within 15 % of the eye's height · 200 ms */
.sf[data-look="up"] .eye { translate: 0 -15%; }
.sf[data-look="down"] .eye { translate: 0 15%; }
/* at rest the open eyes drift very slowly, about 2 % of the figure (the login figure rests too) — nothing else drifts */
.sf.alive:not([data-state]) .eyes, .sf[data-state="rest"] .eyes { animation: sf-drift 13s ease-in-out infinite; }
@keyframes sf-drift {
  0%, 100% { transform: translate(0, 0); }
  21% { transform: translate(.8%, -.5%); }
  46% { transform: translate(-.3%, .8%); }
  72% { transform: translate(-.9%, -.2%); }
}
.sf.still .fig { animation: none; }
/* the picture did not load: no eyes floating on a broken image — a plain soft body takes its place */
.sf.noimg img { visibility: hidden; }
.sf.alive.noimg .fig::before { content: ""; position: absolute; left: 16%; right: 16%; top: 26%; bottom: 10%; border-radius: 50% 50% 47% 47% / 58% 58% 42% 42%; background: linear-gradient(#D8C2F2, #EBC6E6 70%, #F5CFD8); }
.sf.close.noimg { border-radius: 50%; background: linear-gradient(#D8C2F2, #F5CFD8); }
/* a faint glow behind the head figure — almost nothing on white */
.av.hd56::before, .av.big::before { content: ""; position: absolute; inset: -12%; border-radius: 50%; background: radial-gradient(closest-side, rgba(196, 160, 240, .07) 40%, rgba(196, 160, 240, 0)); pointer-events: none; }
html[data-mode="dark"] .av.hd56::before, html[data-mode="dark"] .av.big::before { background: radial-gradient(closest-side, rgba(196, 160, 240, .10) 40%, rgba(196, 160, 240, 0)); }
/* 서아 응답 없음: dimmed, eyes shut, still */
.st-rest { opacity: .55; filter: saturate(.6); }
.st-rest .fig { animation: none; }
.st-rest .eye { transform: translateY(84%); }
.st-rest .eye > i { transform: translateY(-84%); }
@keyframes sf-breathe { from { transform: scaleY(1); } to { transform: scaleY(1.035); } }

/* messages */
.day { display: flex; justify-content: center; margin: 22px 0 4px; }
.day span { font-size: 14px; color: var(--tx2); }
.m { display: flex; flex-direction: column; margin-top: 16px; }
.m.me { align-items: flex-end; }
.m.sa { align-items: flex-start; padding-left: 38px; position: relative; }
.m.sa > .av.m30 { position: absolute; left: 0; top: 4px; }
.m > .b { font-size: var(--fs); line-height: 1.6; padding: 11px 18px; border-radius: calc(22px * var(--rk)); max-width: 86%; white-space: pre-wrap; }
.m.sa > .b { background: var(--bub); }
.m.me > .b { background: var(--ac-soft); color: var(--tx); }
.ts { display: inline-flex; align-items: center; gap: 4px; font-size: 14px; color: var(--tx2); margin-top: 5px; padding: 0 6px; }
.ts svg.i { width: 14px; height: 14px; }

/* work in progress */
.work { background: var(--bub); border-radius: calc(22px * var(--rk)); padding: 12px 16px 4px; min-width: 80%; max-width: 86%; }
.steps li { display: grid; grid-template-columns: 22px 1fr; column-gap: 10px; padding: 5px 0; }
.steps li > i { width: 22px; height: 22px; display: block; position: relative; margin-top: 1px; }
.steps li > i::before { content: ""; position: absolute; inset: 3px; border-radius: 50%; border: 1.5px solid var(--line2); }
.steps li.now > i::before { border: 2px solid color-mix(in srgb, var(--tx) 22%, transparent); }
.steps li.now > i::after { content: ""; position: absolute; inset: 3px; border-radius: 50%; border: 2px solid transparent; border-top-color: var(--tx); animation: spin .9s linear infinite; }
.steps li > span { font-size: 15px; font-weight: 700; line-height: 1.5; }
.steps li.now > span { color: var(--tx); font-weight: 700; }
.work-f { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.work-f small { font-size: 14px; color: var(--tx2); font-variant-numeric: tabular-nums; }
.m.sa > .work-f { width: 86%; padding: 0 4px; }
.lnk { min-height: 44px; min-width: 56px; padding: 0 4px 0 12px; font-size: 14px; font-weight: 700; color: var(--tx); display: inline-flex; align-items: center; justify-content: center; }

/* failure */
.fail { background: var(--bad-soft); border-radius: calc(22px * var(--rk)); padding: 12px 16px 14px; max-width: 86%; }
.fail-t { display: flex; align-items: center; gap: 8px; font-weight: 800; color: var(--bad); }
.fail-s { font-size: 15px; margin-top: 4px; }
.acts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.btn { min-height: 50px; padding: 0 20px; border-radius: calc(999px * var(--rk)); font-size: 16px; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.btn svg.i { width: 18px; height: 18px; stroke-width: 2; }
.btn.sm { min-height: 44px; font-size: 15px; padding: 0 16px; }
.btn.pri { background: var(--ac); color: var(--ac-on); }
.btn.sec { background: var(--bub); color: var(--tx); }
.fail .btn.sec, .banner .btn.sec { background: var(--surf); }

/* stream lost */
.banner { padding: 0 16px 8px; flex: none; position: relative; z-index: 2; background: var(--bg); border-bottom: 1px solid var(--line); }
.banner-in { display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 8px 8px 8px 16px; background: var(--bad-soft); border-radius: calc(12px * var(--rk)); }
.banner .btn.sm { min-height: 40px; }
.banner-in > svg.i { color: var(--bad); }
.banner-in > div { flex: 1; min-width: 0; }
.banner-in b { display: block; font-size: 15px; color: var(--bad); line-height: 1.4; }
.banner-in small { display: block; font-size: 14px; color: var(--tx); line-height: 1.45; margin-top: 2px; }

/* first screen */
.hello { padding: 96px 4px 4px; }
.hello-t { font-size: 24px; font-weight: 800; line-height: 1.3; letter-spacing: -0.02em; }
.sugs { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; margin-top: 18px; }
.sg { display: inline-flex; align-items: center; gap: 10px; min-height: 52px; padding: 6px 18px 6px 6px; border-radius: calc(999px * var(--rk)); background: var(--bub); font-size: 16px; font-weight: 700; color: var(--tx); }
.tile { width: 40px; height: 40px; border-radius: calc(50% * var(--rk)); display: grid; place-items: center; flex: none; background: var(--surf); color: var(--tile-tx); }

/* composer */
.ft { flex: none; position: relative; padding: 8px 12px calc(16px + env(safe-area-inset-bottom)); }
.ft-in { display: flex; align-items: flex-end; gap: 2px; background: var(--bub); border-radius: calc(26px * var(--rk)); padding: 4px; }
.field { flex: 1; min-width: 0; min-height: 44px; max-height: 168px; resize: none; border: 0; outline: 0; background: transparent; font-size: var(--fs); line-height: 1.5; padding: 10px 4px; color: var(--tx); }
.field::placeholder { color: var(--tx2); opacity: 1; }
.send { width: 48px; height: 48px; border-radius: calc(50% * var(--rk)); display: grid; place-items: center; background: var(--ac); color: var(--ac-on); flex: none; }
.send:disabled { opacity: .45; }
.send svg.i { stroke-width: 2.2; }

/* sheet (menu) */
.sheet-wrap { position: fixed; inset: 0; z-index: 10; display: flex; align-items: flex-end; background: var(--dim); }
.sheet { width: 100%; max-width: 672px; margin: 0 auto; background: var(--sheet); border-radius: calc(28px * var(--rk)) calc(28px * var(--rk)) 0 0; padding: 10px 16px calc(18px + env(safe-area-inset-bottom)); animation: up 320ms var(--ease); max-height: calc(100% - 12px); overflow-y: auto; overscroll-behavior: contain; }
@keyframes up { from { transform: translateY(100%); } }
.grab { width: 40px; height: 5px; border-radius: calc(3px * var(--rk)); background: var(--line2); margin: 0 auto 10px; }
.row { display: flex; align-items: center; gap: 12px; padding: 10px 4px; min-height: 64px; width: 100%; text-align: left; font-size: 16px; font-weight: 700; }
.row > span { flex: 1; }
.row > .tile { flex: none; }

/* screens over the chat (설정 · dev login) */
.screen { position: fixed; inset: 0; z-index: 20; background: var(--bg2); overflow-y: auto; }
.screen > .inner { max-width: 752px; margin: 0 auto; padding-bottom: 32px; }
.look h3 { font-size: 14px; font-weight: 700; color: var(--tx2); margin: 22px 4px 8px; }
.look h3:first-child { margin-top: 8px; }
.panel { background: var(--surf); border-radius: calc(24px * var(--rk)); padding: 6px 16px; }
.acs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; padding: 12px 4px 14px; }
.acs button { display: flex; flex-direction: column; align-items: center; gap: 6px; min-height: 76px; padding: 6px 0; border-radius: calc(18px * var(--rk)); font-size: 14px; font-weight: 600; color: var(--tx2); }
.acs button.on { color: var(--tx); font-weight: 800; }
.acs .sw6 { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; color: #fff; box-shadow: 0 0 0 3px var(--surf), 0 0 0 4px transparent; }
.acs button.on .sw6 { box-shadow: 0 0 0 3px var(--surf), 0 0 0 5px var(--tx); }
.acs .sw6 svg.i { width: 20px; height: 20px; stroke-width: 2.4; opacity: 0; }
.acs button.on .sw6 svg.i { opacity: 1; }
.modes { display: flex; gap: 8px; padding: 14px 0; }
.modes button { flex: 1; min-height: 88px; border-radius: calc(18px * var(--rk)); border: 2px solid var(--line); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; font-size: 15px; font-weight: 700; }
.modes button.on { border-color: var(--ac); }
.modes .mm { width: 56px; height: 34px; border-radius: calc(10px * var(--rk)); border: 1px solid var(--line2); display: flex; align-items: center; gap: 4px; padding: 0 7px; }
.modes .mm.l { background: #FFFFFF; } .modes .mm.d { background: #141519; border-color: #3A3E46; }
.modes .mm span { height: 8px; border-radius: calc(4px * var(--rk)); flex: 1; }
.modes .mm.l span:first-child { background: #F2F3F5; } .modes .mm.d span:first-child { background: #25282E; }
.modes .mm span:last-child { background: var(--ac); }
.prev { background: var(--surf); border-radius: calc(24px * var(--rk)); padding: 6px 16px 16px; }
.prev .m { margin-top: 10px; }
.prev .btn { margin-top: 14px; width: 100%; }
.gate { min-height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: 24px; text-align: center; }
.gate p { color: var(--tx2); font-size: 15px; }
.gate h1 { font-size: 28px; font-weight: 800; letter-spacing: -0.01em; line-height: 1.2; }

/* press feel · reduced motion */
.btn, .rb, .send, .lnk, .sg, .row, .acs button, .modes button { transition: transform 120ms var(--ease), background-color 160ms; }
.btn:active, .rb:active, .send:active:not(:disabled), .lnk:active, .sg:active { transform: scale(.96); }
@media (min-width: 700px) { .m > .b { max-width: 78%; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
/* header: three columns so the agent stays centered with or without the 호야 button */
.hd:not(.sub) .hd-in { display: grid; grid-template-columns: 1fr auto 1fr; align-items: start; }
.hd:not(.sub) .hd-in > :first-child { justify-self: start; }
.hd:not(.sub) .hd-in > .who { grid-column: 2; }
.hd:not(.sub) .hd-in > #hoya { grid-column: 3; justify-self: end; }
/* the keyboard is up (the page gets short — interactive-widget=resizes-content): the big figure folds away and the
   conversation keeps its room; the name stays (real phone 2026-12-06: three lines of the answer were left) */
@media (max-height: 480px) {
  .hd:not(.sub) .who > .av { display: none; }
  .hd:not(.sub) .hd-in { align-items: center; padding-top: 6px; padding-bottom: 4px; }
}
/* 먹 is near the dark panel color: give it an outline so it stays visible */
.acs .sw6.meok { box-shadow: 0 0 0 3px var(--surf), 0 0 0 4px var(--line2); }

/* B2b — attachment menu · tray · photos and files in messages (from 시안 둥근3 「입력칸 · 첨부 메뉴」 · 「사진 · 파일 미리보기」) */
.ib { width: 44px; height: 44px; border-radius: calc(50% * var(--rk)); display: grid; place-items: center; flex: none; color: var(--tx); }
.ib.on { background: var(--surf); }
.picker { display: none; }
.pop { position: absolute; left: 12px; bottom: calc(100% - 4px); z-index: 5; width: 300px; max-width: calc(100% - 24px); background: var(--sheet); border-radius: calc(26px * var(--rk)); padding: 8px; box-shadow: 0 8px 24px rgba(0,0,0,.18); animation: pop-in 220ms var(--ease); transform-origin: 24px 100%; }
.pop[hidden] { display: none; }
@keyframes pop-in { from { opacity: 0; transform: translateY(8px) scale(.96); } to { opacity: 1; transform: none; } }
.pop button { width: 100%; min-height: 56px; display: flex; align-items: center; gap: 14px; padding: 6px 10px; border-radius: calc(18px * var(--rk)); font-size: 17px; font-weight: 600; text-align: left; }
@media (min-width: 700px) { .ft .pop { left: calc(50% - 324px); } }
.tray { max-width: 672px; margin: 0 auto 8px; display: flex; gap: 8px; overflow-x: auto; padding: 2px 16px 2px 2px; }
.tray::after { content: ""; flex: 0 0 8px; }
.tray[hidden] { display: none; }
.chip { flex: none; display: flex; align-items: center; gap: 8px; max-width: 220px; min-height: 52px; padding: 4px 4px 4px 4px; border-radius: calc(16px * var(--rk)); background: var(--bub); }
.chip img, .chip .tile { width: 44px; height: 44px; border-radius: calc(12px * var(--rk)); object-fit: cover; flex: none; }
.chip-t { font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.chip.uploading { opacity: .6; }
.chip.failed { background: var(--bad-soft); color: var(--bad); }
.chip-x { width: 36px; height: 44px; display: grid; place-items: center; flex: none; color: var(--tx2); }
.chip-x svg.i { width: 18px; height: 18px; }
.m > .pics, .m > .fcard { margin-bottom: 4px; }
.pics { display: grid; gap: 4px; border-radius: calc(20px * var(--rk)); overflow: hidden; max-width: 86%; }
.pics.n1 { width: 220px; grid-auto-rows: 220px; }
.pics.n2 { grid-template-columns: 1fr 1fr; grid-auto-rows: 132px; width: 268px; }
.pics.n3 { grid-template-columns: 1.3fr 1fr; grid-template-rows: 92px 92px; width: 264px; }
.pics.n3 .ph:first-child { grid-row: span 2; }
.pics.n4 { grid-template-columns: 1fr 1fr; grid-auto-rows: 118px; width: 272px; }
.ph { position: relative; display: block; background: var(--well); overflow: hidden; }
.ph img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ph .more { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(0,0,0,.45); color: #fff; font-size: 20px; font-weight: 800; }
.fcard { display: flex; gap: 12px; align-items: center; background: var(--surf); border: 1px solid var(--line); border-radius: calc(20px * var(--rk)); padding: 8px 14px 8px 8px; max-width: 86%; min-height: 56px; color: var(--tx); text-decoration: none; }
.fname { font-size: 15px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.m.me > .fail { margin-top: 4px; }

/* 「가리기」 — tap the bubble → a small sheet from the bottom (하린 8) */
.ask-sheet { padding-top: 10px; display: flex; flex-direction: column; gap: 8px; }
.ask-sheet .sheet-t { font-size: 17px; font-weight: 800; padding: 6px 4px 0; }
.sheet-s { font-size: 15px; color: var(--tx2); padding: 0 4px 8px; }
.btn.danger { background: var(--bad); color: #fff; }
.btn.full { width: 100%; }
.lnk.wide { width: 100%; min-height: 48px; font-size: 16px; }
.m > .b.gone { background: transparent; border: 1.5px dashed var(--line2); color: var(--tx2); font-size: 15px; }

/* 메뉴 sheet: rooms (「채팅」) */
.sheet-t { font-size: 18px; font-weight: 800; padding: 4px 4px 2px; }
.grp.in-sheet { margin: 10px 4px 2px; }
.sheet-wrap:focus, .screen:focus { outline: none; }
.rooms { max-height: 46vh; overflow-y: auto; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); margin: 4px 0; }
.row.room { min-height: 56px; font-weight: 600; }
.row.room.on { color: var(--ac-tx); }
.row.room small { flex: none; font-size: 14px; font-weight: 500; color: var(--tx2); }
.room-t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }

/* B4 connection screen (from mockup 둥근3 「7. 연결」) */
.conn .row { min-height: 68px; cursor: default; }
.row-t { flex: 1; min-width: 0; }
.row-t b { display: block; font-size: 16px; font-weight: 700; line-height: 1.4; }
.row-t b.one { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row.top { align-items: flex-start; }
.row.top > .tile { margin-top: 2px; }
.row.top > .pill, .row.top > .onoff { margin-top: 6px; }
.row.top .row-t small { font-size: 14px; }
.row-t small { display: block; font-size: 14px; font-weight: 500; color: var(--tx2); line-height: 1.45; overflow-wrap: anywhere; }
.row-t small.bad { color: var(--bad); font-weight: 700; }
/* status: a small dot + text colour only (mockup 「색 알약을 걷음」) */
.row > .pill { flex: none; }
.pill { display: inline-flex; align-items: center; gap: 5px; padding: 6px 0 6px 2px; font-size: 14px; font-weight: 700; line-height: 1; white-space: nowrap; }
.pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex: none; }
.pill.ok { color: var(--ok); }
.pill.bad { color: var(--bad); }
.pill.mute { color: var(--tx2); }
.pill.mute.hollow::before { background: transparent; border: 1.5px solid currentColor; width: 6px; height: 6px; }
.conn-empty { font-size: 14px; color: var(--tx2); padding: 8px 4px; }

/* ── cards (B5 · 시안 둥근3 §2 · §3 · §8) ── */
.card { margin-top: 16px; background: var(--surf); border: 1px solid var(--line); border-radius: calc(24px * var(--rk)); padding: 16px; }
.screen .card { border-color: transparent; }
.card-h { display: flex; gap: 12px; align-items: flex-start; }
.card-h > div { flex: 1; min-width: 0; }
.card-h b { display: block; font-size: 17px; font-weight: 800; line-height: 1.35; letter-spacing: -0.01em; }
.card-h small { display: block; font-size: 14px; color: var(--tx2); line-height: 1.4; margin-top: 2px; overflow-wrap: anywhere; }
.card-h > .pill { flex: none; }
.card-h > .tile { background: var(--tile); }
.pill.now { color: var(--tx); }
.pill.warn { color: var(--warn); }
.well { background: var(--well); border-radius: calc(16px * var(--rk)); padding: 12px 14px; margin-top: 12px; }
.plan-n li { display: flex; gap: 12px; align-items: flex-start; padding: 6px 0; font-size: 15px; line-height: 1.5; }
.plan-n li em { font-style: normal; flex: none; width: 26px; height: 26px; border-radius: 50%; background: var(--surf); border: 1px solid var(--line2); display: grid; place-items: center; font-size: 14px; font-weight: 800; color: var(--tx); }
.plan-n li > span { flex: 1; min-width: 0; }
.plan-n li.off > span { color: var(--tx2); text-decoration: line-through; }
.plan-n li .lnk { min-height: 44px; margin: -10px -4px -10px 0; }
.lnk.step-x { min-width: 76px; justify-content: flex-end; padding: 0 4px; }
.plan-n h4 { font-size: 15px; font-weight: 800; margin-bottom: 2px; }
.steps li { position: relative; }
.steps li.done > i::before { background: var(--ok); border-color: var(--ok); }
.steps li.done > i::after { content: ""; position: absolute; left: 8.6px; top: 6.4px; width: 4px; height: 7.5px; border: solid var(--bg); border-width: 0 1.8px 1.8px 0; transform: rotate(45deg); }
.steps li.fail > i::before { background: var(--bad); border-color: var(--bad); }
.steps li > small { grid-column: 2; font-size: 14px; color: var(--tx2); line-height: 1.4; }
.steps li.todo > span { color: var(--tx2); font-weight: 500; }
.well .btn.sec { background: var(--surf); }
.btn.ghost { color: var(--tx2); }
.btn.full { flex-basis: 100%; }
.note { font-size: 14px; color: var(--tx2); line-height: 1.45; margin-top: 10px; display: flex; gap: 6px; align-items: flex-start; }
.note svg.i { width: 15px; height: 15px; margin-top: 2px; flex: none; }
.note.bad { color: var(--bad); font-weight: 700; }
.note.until { font-size: 14px; }
.note.until time.soon { color: var(--warn); font-weight: 700; }
.note.plain { font-size: 15px; color: var(--tx); }
.note.warn { color: var(--warn); font-weight: 700; }
.mail-s { font-size: 15px; font-weight: 800; overflow-wrap: anywhere; }
.mail-b p { font-size: 15px; line-height: 1.65; margin-top: 8px; white-space: pre-wrap; overflow-wrap: anywhere; }
.diff { display: grid; grid-template-columns: 64px 1fr; row-gap: 8px; font-size: 15px; line-height: 1.5; }
.diff dt { color: var(--tx2); font-size: 14px; }
.diff dd > span { color: var(--tx2); }
.diff b { color: var(--tx); }
.card-f { display: flex; gap: 8px; margin-top: 12px; }
.card-f .btn { flex: 1; }
.card-f.txt { justify-content: space-between; margin-bottom: -6px; }
.acts > .lnk { min-height: 44px; }
.done-line { display: flex; align-items: center; gap: 6px; font-size: 14px; color: var(--tx2); margin-top: 12px; text-align: left; }
.done-line > span { flex: 1; min-width: 0; }
.done-line > time { flex: none; font-variant-numeric: tabular-nums; }
.done-line svg.i { width: 16px; height: 16px; color: var(--ok); stroke-width: 2.2; flex: none; }
.done-line.bad svg.i { color: var(--bad); }
.done-line.mute svg.i { color: var(--tx2); }
.done-line.gone-line { color: var(--tx2); }
.ask-opts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.ask-in { display: flex; gap: 8px; margin-top: 10px; }
.ask-in input { flex: 1; min-width: 0; min-height: 44px; border-radius: calc(999px * var(--rk)); background: var(--bub); padding: 0 16px; font-size: 15px; color: var(--tx); border: 0; }
.hist li { display: grid; grid-template-columns: 76px 1fr; gap: 10px; padding: 9px 0; font-size: 15px; line-height: 1.5; }
.hist li + li { border-top: 1px solid var(--line); }
.hist time { white-space: nowrap; color: var(--tx2); font-variant-numeric: tabular-nums; }
.hist li.now { color: var(--tx); font-weight: 700; }
.sheet .card-h { margin-bottom: 4px; }
.sheet .card-h small { margin: 0 0 2px; }
.seg { display: flex; background: var(--surf); border-radius: calc(999px * var(--rk)); padding: 4px; margin-top: 8px; }
.seg button { flex: 1; min-height: 44px; border-radius: calc(999px * var(--rk)); font-size: 16px; font-weight: 700; color: var(--tx2); display: flex; align-items: center; justify-content: center; gap: 6px; }
.seg button.on { background: var(--bub); color: var(--tx); }
.seg button svg.i { width: 18px; height: 18px; }
.grp { font-size: 14px; font-weight: 700; color: var(--tx2); margin: 22px 4px 8px; }
.row > .onoff { flex: none; }
.onoff { flex: none; font-size: 15px; font-weight: 700; color: var(--tx2); }
.onoff.on { color: var(--ac-tx); }
.why { background: var(--bad-soft); border-radius: calc(16px * var(--rk)); padding: 10px 14px 12px; margin: 0 0 8px 56px; }
.why b { font-size: 14px; color: var(--bad); }
.why p { font-size: 15px; line-height: 1.6; margin-top: 2px; }
.row-acts { display: flex; gap: 8px; padding: 0 0 14px 56px; }
.hist-empty { font-size: 14px; color: var(--tx2); padding: 8px 4px; }

/* login gate · 설정 기기 */
.gate .btn { min-width: 240px; }
.pw { display: flex; flex-direction: column; gap: 8px; width: 100%; max-width: 320px; margin-top: 8px; }
.pw input, .inv-url { min-height: 48px; padding: 0 16px; border-radius: calc(14px * var(--rk)); background: var(--bub); color: var(--tx); font-size: 16px; border: 0; width: 100%; }
.devs:empty { display: none; }
.row-t small.cur { color: var(--ac-tx); font-weight: 700; }
.inv { margin-top: 8px; }
.inv-box { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 0 14px; }
.inv-box .inv-url { flex: 1; min-width: 0; font-size: 14px; }
.inv-box .note { flex-basis: 100%; margin-top: 2px; }
#logout { margin-top: 12px; color: var(--tx2); }

/* 모서리 (설정 · 둥글게 기본 / 각지게): every radius is calc(<size> * var(--rk)); circles that mean a face, a dot or a
   progress mark keep 50% (아바타 · 진행 점 · 색 견본 · 단계 번호) */
:root { --rk: 1; }
:root[data-corner="square"] { --rk: 0; }
.cc { width: 56px; height: 34px; border: 2px solid var(--tx2); background: var(--bub); }
.cc.r { border-radius: 12px; }
.cc.s { border-radius: 0; }

/* answers: bold · lists · links only, drawn as elements (타협 대-29 · no HTML from the text) */
.m > .b.rich { white-space: normal; }
.rich p { white-space: pre-wrap; }
.rich > * + * { margin-top: 8px; }
.rich ul, .rich ol { padding-left: 1.35em; }
.rich ul { list-style: disc; }
.rich ol { list-style: decimal; }
.rich li + li { margin-top: 2px; }
.rich li::marker { color: var(--tx2); }
.rich strong { font-weight: 800; }
.rich a { color: var(--ac-tx); text-decoration: underline; text-underline-offset: 2px; overflow-wrap: anywhere; }
.rich code { font-family: ui-monospace, Consolas, monospace; font-size: .92em; background: color-mix(in srgb, var(--tx) 8%, transparent); border-radius: calc(5px * var(--rk)); padding: 1px 5px; }
/* long press opens 복사 · 가리기: no phone text callout over our sheet */
.m > .b[aria-haspopup] { -webkit-touch-callout: none; }
@media (pointer: coarse) { .m > .b[aria-haspopup] { -webkit-user-select: none; user-select: none; } }

/* a long message of mine folds to 8 lines · 「더 보기」 opens it (타협 대-48) */
.m > .b.clamp > .fold-t { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 8; line-clamp: 8; overflow: hidden; }
.more-b { min-height: 44px; padding: 0 6px; font-size: 14px; font-weight: 700; color: var(--tx2); }
.m.me > .more-b { align-self: flex-end; }

/* a long mail body folds; the buttons stay in sight (타협 대-50) */
.mail-b.clamp { max-height: 12.5em; overflow: hidden; position: relative; }
.mail-b.clamp::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 3em; background: linear-gradient(color-mix(in srgb, var(--well) 0%, transparent), var(--well)); }
.well .more-b { margin: 2px 0 -10px -6px; }
.card-foot { position: sticky; bottom: 0; z-index: 1; background: var(--surf); margin: 0 -16px -16px; padding: 0 16px 16px; border-radius: 0 0 calc(24px * var(--rk)) calc(24px * var(--rk)); }
.card-foot .acts { margin-top: 12px; }
/* a press the server did not take says so in the card (타협 대-51) */
.note.press { margin-top: 12px; }
