@font-face{font-family:"Noto Sans KR";src:url("./assets/fonts/NotoSansKR.woff2") format("woff2");font-weight:100 900;font-display:swap}
@font-face{font-family:"Black Han Sans";src:url("./assets/fonts/BlackHanSans-Regular.woff2") format("woff2");font-weight:400;font-display:swap}
@font-face{font-family:"IBM Plex Mono";src:url("./assets/fonts/IBMPlexMono-Medium.woff2") format("woff2");font-weight:500 600;font-display:swap}

/* Layout: a three-pane desk chat app at 2 a.m. — rail | chat list | conversation; at phone width only the conversation remains.
   Deliberately single-theme (night): the scene only exists in the dark. */
:root {
  color-scheme: dark;
  --bg: #12151b;
  --panel: #191d25;
  --panel-2: #20252f;
  --line: #2b313d;
  --ink: #e7eaf0;
  --muted: #8d95a5;
  --lamp: #f2b34b;      /* the desk lamp: the one warm thing in the room */
  --mine: #2a3349;
  --alert: #e5484d;
  --ok: #3fb27f;
  --av-mgr: #8a5a2b;
  --av-ptr: #3d5a80;
  --av-grp: #4f6b4a;
  --av-mom: #8a4a6b;
  --av-ana: #3f7a78;
  --f-display: "Black Han Sans", "Noto Sans KR", sans-serif;
  --f-body: "Noto Sans KR", "Malgun Gothic", system-ui, sans-serif;
  --f-num: "IBM Plex Mono", ui-monospace, "SFMono-Regular", monospace;
}
html, body { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--f-body); font-size: 14px; line-height: 1.6; -webkit-font-smoothing: antialiased; overflow: hidden; }
*, *::before, *::after { box-sizing: border-box; }
button { font: inherit; color: inherit; cursor: pointer; }
button:focus-visible, input:focus-visible { outline: 2px solid var(--lamp); outline-offset: 2px; }
.num { font-family: var(--f-num); font-variant-numeric: tabular-nums; }

/* ---------- shell ---------- */
.app { height: 100%; display: grid; grid-template-rows: auto 1fr; }
.topbar { display: flex; align-items: center; gap: 12px; padding: 8px 16px; background: var(--panel); border-bottom: 1px solid var(--line); min-width: 0; }
.logo { display: inline-flex; align-items: center; gap: 8px; flex: none; }
.logo b { width: 28px; height: 28px; border-radius: 7px; display: grid; place-items: center; background: var(--lamp); color: #1b1407; font-family: var(--f-display); font-size: 15px; font-weight: 400; }
.logo span { font-family: var(--f-display); font-size: 15px; letter-spacing: .06em; }
.search { flex: 1; min-width: 0; max-width: 520px; margin-inline: auto; height: 30px; border-radius: 6px; background: var(--panel-2); border: 1px solid var(--line); color: var(--muted); display: flex; align-items: center; padding-inline: 12px; font-size: 13px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.clock { font-family: var(--f-num); font-weight: 600; font-size: 15px; color: var(--lamp); flex: none; }
.sound { border: 1px solid var(--line); background: transparent; border-radius: 6px; padding: 2px 10px; font-size: 12px; color: var(--muted); flex: none; }
.sound[aria-pressed="true"] { color: var(--ink); }
.body { display: grid; grid-template-columns: 68px 280px minmax(0, 1fr); min-height: 0; }

.rail { background: var(--panel); border-right: 1px solid var(--line); display: flex; flex-direction: column; align-items: center; gap: 4px; padding-block: 10px; }
.rail button { width: 58px; border: 0; background: transparent; border-radius: 8px; padding: 6px 0 4px; display: grid; justify-items: center; gap: 2px; color: var(--muted); font-size: 10px; position: relative; }
.rail button svg { width: 22px; height: 22px; }
.rail button[aria-current="page"] { color: var(--ink); background: var(--panel-2); }
.rail button[aria-current="page"]::before { content: ""; position: absolute; left: -5px; top: 10px; bottom: 10px; width: 3px; border-radius: 2px; background: var(--lamp); }
.rail .dot { position: absolute; top: 4px; right: 12px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px; background: var(--alert); color: #fff; font-size: 10px; line-height: 16px; font-family: var(--f-num); }

.list { background: var(--panel); border-right: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; }
.list h2 { margin: 0; padding: 14px 16px 8px; font-size: 16px; }
.list ul { list-style: none; margin: 0; padding: 0 8px 8px; overflow-y: auto; }
.item { width: 100%; border: 0; background: transparent; text-align: left; border-radius: 8px; padding: 8px; display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; gap: 10px; align-items: center; }
.item[aria-current="true"] { background: var(--panel-2); }
.item .nm { font-weight: 700; font-size: 13px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.item .pv { color: var(--muted); font-size: 12px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.item.unread .pv { color: var(--ink); }
.item .tm { font-family: var(--f-num); font-size: 11px; color: var(--muted); text-align: right; display: grid; justify-items: end; gap: 2px; }
.item .badge { min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--alert); color: #fff; font-size: 11px; line-height: 18px; text-align: center; }

.av { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 14px; color: #fff; position: relative; flex: none; }
.av.sm { width: 30px; height: 30px; font-size: 12px; }
.av .st { position: absolute; right: -1px; bottom: -1px; width: 11px; height: 11px; border-radius: 50%; background: var(--ok); border: 2px solid var(--panel); }

/* ---------- conversation ---------- */
.chat { display: grid; grid-template-rows: auto auto minmax(0, 1fr) auto; min-height: 0; min-width: 0; background: var(--bg); }
.chead { display: flex; align-items: center; gap: 10px; padding: 10px 16px; border-bottom: 1px solid var(--line); background: var(--panel); min-width: 0; }
.chead .who { min-width: 0; }
.chead .who b { display: block; font-size: 15px; }
.chead .who small { color: var(--ok); font-size: 12px; }
.chead .tabs { display: flex; gap: 14px; margin-left: 12px; font-size: 13px; color: var(--muted); }
.chead .tabs span:first-child { color: var(--ink); border-bottom: 2px solid var(--lamp); padding-bottom: 2px; }
.chead .calls { margin-left: auto; display: flex; gap: 6px; }
.chead .calls button { border: 1px solid var(--line); background: var(--panel-2); border-radius: 6px; width: 34px; height: 30px; display: grid; place-items: center; color: var(--muted); }
.chead .calls svg { width: 18px; height: 18px; }

.meters { display: flex; flex-wrap: wrap; gap: 6px 18px; padding: 8px 16px; border-bottom: 1px solid var(--line); background: var(--panel); font-size: 12px; color: var(--muted); }
.meter { display: flex; align-items: center; gap: 8px; }
.meter .bar { width: 96px; height: 6px; border-radius: 3px; background: var(--panel-2); overflow: hidden; }
.meter .bar i { display: block; height: 100%; border-radius: 3px; background: var(--ok); transition: width .5s ease, background .5s; }
.meter .v { color: var(--ink); font-family: var(--f-num); min-width: 3ch; }
.meter.hit .v { color: var(--alert); }
.file-chip { font-family: var(--f-num); color: var(--ink); }

.log { overflow-y: auto; padding: 16px 16px 8px; display: flex; flex-direction: column; gap: 2px; scroll-behavior: smooth; }
.day { align-self: center; margin: 8px 0 12px; font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 10px; width: 100%; }
.day::before, .day::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.row { display: grid; grid-template-columns: 36px minmax(0, 1fr); gap: 10px; margin-top: 10px; max-width: 760px; }
.row .meta { font-size: 12px; color: var(--muted); display: flex; gap: 8px; align-items: baseline; }
.row .meta b { color: var(--ink); font-size: 13px; }
.bub { display: inline-block; max-width: 100%; background: var(--panel-2); border-radius: 4px 10px 10px 10px; padding: 7px 12px; margin-top: 3px; overflow-wrap: anywhere; }
.cont { margin-left: 46px; max-width: 714px; }
.cont .bub { border-radius: 4px 10px 10px 4px; }
.mine { align-self: flex-end; display: grid; justify-items: end; max-width: min(560px, 85%); margin-top: 10px; }
.mine .meta { font-size: 12px; color: var(--muted); }
.mine .bub { background: var(--mine); border-radius: 10px 4px 10px 10px; text-align: left; }
.mine .seen { font-size: 11px; color: var(--muted); margin-top: 2px; }
.sys { align-self: center; font-size: 12px; color: var(--muted); margin: 10px 0; display: flex; align-items: center; gap: 6px; }
.file { display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 10px; align-items: center; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; margin-top: 4px; max-width: 360px; }
.file .ic { width: 34px; height: 40px; border-radius: 4px; background: #c4552b; color: #fff; display: grid; place-items: center; font-size: 10px; font-weight: 700; font-family: var(--f-num); }
.file .ic.x { background: #2f7d4a; }
.file .ic.j { background: #5b6575; }
.file b { display: block; font-family: var(--f-num); font-size: 12px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.file small { color: var(--muted); font-size: 11px; }
.scrawl { margin-top: 4px; max-width: 360px; background: #f3f0e6; color: #2a2a2a; border-radius: 6px; padding: 12px 14px; font-size: 13px; line-height: 1.5; transform: rotate(-.6deg); box-shadow: 0 2px 10px rgba(0,0,0,.35); }
.scrawl em { font-style: normal; color: #c0392b; font-weight: 700; }
.react { display: inline-block; margin-left: 6px; font-size: 12px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 0 6px; }
.typing { height: 26px; padding: 0 16px; font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.typing i { width: 5px; height: 5px; border-radius: 50%; background: var(--muted); animation: blink 1.2s infinite; }
.typing i:nth-child(2) { animation-delay: .2s; } .typing i:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 80%, 100% { opacity: .25 } 40% { opacity: 1 } }

.compose { padding: 8px 16px calc(12px + env(safe-area-inset-bottom, 0px)); border-top: 1px solid var(--line); background: var(--panel); display: grid; gap: 8px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; min-height: 0; }
.chip { border: 1px solid var(--lamp); background: transparent; color: var(--ink); border-radius: 16px; padding: 5px 12px; font-size: 13px; text-align: left; line-height: 1.4; max-width: 100%; }
.chip:hover { background: rgba(242, 179, 75, .12); }
.chip:disabled { opacity: .35; cursor: default; }
.chips .hint { color: var(--muted); font-size: 12px; padding: 4px 2px; }
.box { display: flex; gap: 8px; }
.box input { flex: 1; min-width: 0; height: 38px; border-radius: 6px; border: 1px solid var(--line); background: var(--panel-2); color: var(--ink); padding: 0 12px; font: inherit; }
.box button { border: 0; border-radius: 6px; background: var(--lamp); color: #1b1407; font-weight: 700; padding: 0 16px; }
.box button:disabled, .box input:disabled { opacity: .45; cursor: default; }

/* ---------- overlays ---------- */
.veil { position: fixed; inset: 0; background: rgba(6, 8, 12, .72); display: grid; place-items: center; padding: 16px; z-index: 20; }
.card { width: min(460px, 100%); max-height: calc(100% - 16px); overflow-y: auto; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 28px 24px; display: grid; gap: 14px; box-shadow: 0 18px 60px rgba(0,0,0,.5); }
.card .big { font-family: var(--f-num); font-size: 48px; font-weight: 600; color: var(--lamp); line-height: 1; letter-spacing: .02em; }
.card h1 { margin: 0; font-family: var(--f-display); font-weight: 400; font-size: clamp(26px, 6vw, 34px); line-height: 1.25; letter-spacing: .02em; text-wrap: balance; }
.card h1.ttl { white-space: nowrap; letter-spacing: 0; font-size: min(30px, calc((100vw - 104px) / 13.4)); }
.card p { margin: 0; color: var(--muted); }
.card .lead { color: var(--ink); font-size: 15px; }
.card .go { border: 0; border-radius: 8px; background: var(--lamp); color: #1b1407; font-weight: 700; font-size: 16px; padding: 12px; }
.card .ghost { border: 1px solid var(--line); border-radius: 8px; background: transparent; padding: 10px; }
.card .fine { font-size: 12px; }
.card .fine a { color: var(--muted); text-decoration: underline; text-underline-offset: 3px; }
.card .fine a:hover { color: var(--ink); }
.btns { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.xshare { grid-column: 1 / -1; display: block; text-align: center; border-radius: 8px; background: var(--ink); color: var(--bg); font-weight: 700; font-size: 15px; padding: 11px; text-decoration: none; }
.xshare:hover { opacity: .9; }
.cm-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.stats div { background: var(--panel-2); padding: 10px 12px; display: grid; gap: 2px; }
.stats small { color: var(--muted); font-size: 11px; }
.stats b { font-family: var(--f-num); font-size: 20px; font-weight: 600; }
.title-badge { justify-self: start; border: 1px solid var(--lamp); color: var(--lamp); border-radius: 999px; padding: 3px 12px; font-size: 13px; }

.call { text-align: center; justify-items: center; }
.call .av { width: 84px; height: 84px; font-size: 30px; }
.ring { animation: ring 1.2s infinite; }
@keyframes ring { 0% { box-shadow: 0 0 0 0 rgba(242,179,75,.55) } 100% { box-shadow: 0 0 0 26px rgba(242,179,75,0) } }
.call .acts { display: flex; gap: 28px; }
.call .acts button { width: 56px; height: 56px; border-radius: 50%; border: 0; display: grid; place-items: center; color: #fff; }
.call .acts .yes { background: var(--ok); } .call .acts .no { background: var(--alert); }
.call .acts svg { width: 24px; height: 24px; }
.call .acts label { display: grid; gap: 6px; justify-items: center; font-size: 12px; color: var(--muted); }
.captions { display: grid; gap: 6px; width: 100%; min-height: 120px; text-align: left; }
.captions p { color: var(--ink); background: var(--panel-2); border-radius: 8px; padding: 6px 10px; }
.timer { font-family: var(--f-num); color: var(--muted); }

.toasts { position: fixed; right: 16px; bottom: 96px; display: grid; gap: 8px; z-index: 15; width: min(320px, calc(100% - 32px)); }
.toast { background: var(--panel-2); border: 1px solid var(--line); border-left: 3px solid var(--lamp); border-radius: 8px; padding: 10px 12px; box-shadow: 0 8px 24px rgba(0,0,0,.4); font-size: 13px; animation: slide .3s ease; }
.toast b { display: block; font-size: 12px; color: var(--muted); }
@keyframes slide { from { transform: translateY(8px); opacity: 0 } to { transform: none; opacity: 1 } }

[hidden] { display: none !important; }
.next { display: grid; gap: 8px; border-top: 1px solid var(--line); padding-top: 12px; }
.next h2 { margin: 0; font-size: 13px; color: var(--muted); font-weight: 700; }
.next-links { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.next-links a, .next-links button { display: grid; gap: 2px; text-align: left; text-decoration: none; color: var(--ink); background: var(--panel-2); border: 1px solid var(--line); border-radius: 8px; padding: 9px 11px; font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; }
.next-links a:hover, .next-links button:hover { border-color: var(--lamp); }
.next-links small { color: var(--muted); font-weight: 400; font-size: 11px; line-height: 1.4; }
.care { font-size: 12px; color: var(--muted); margin: 0; }
.care a { color: var(--ink); }
.modes { display: grid; gap: 10px; }
.mode { text-align: left; display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 12px; align-items: center; border: 1px solid var(--line); background: var(--panel-2); color: var(--ink); border-radius: 10px; padding: 10px 12px; cursor: pointer; font: inherit; }
.mode .ill { width: 64px; height: 56px; display: block; }
.mode .tx { display: grid; gap: 4px; min-width: 0; }
.mode:hover, .mode:focus-visible { border-color: var(--lamp); }
.mode b { font-size: 16px; display: flex; align-items: center; gap: 8px; }
.mode b em { font-style: normal; font-size: 11px; font-family: var(--f-num); color: #1b1407; background: var(--lamp); border-radius: 4px; padding: 1px 6px; }
.mode .tx > span { font-size: 13px; color: var(--muted); line-height: 1.55; }
.mode .tx b { color: var(--ink); }
.meter small { color: var(--muted); }
.opts { display: grid; gap: 8px; }
.seg { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.seg > span { font-size: 12px; color: var(--muted); min-width: 4em; }
.seg button { border: 1px solid var(--line); background: var(--panel-2); color: var(--ink); border-radius: 999px; padding: 4px 12px; font-size: 13px; }
.seg button[aria-pressed="true"] { border-color: var(--lamp); color: var(--lamp); background: rgba(242, 179, 75, .1); }
.linkish { border: 0; background: none; padding: 0; color: var(--ink); text-decoration: underline; text-underline-offset: 3px; font-size: inherit; margin-left: 4px; }
.caution { font-size: 12px; border-left: 3px solid var(--lamp); padding-left: 10px; }
.caution a { color: var(--ink); }
.card h2.sub, .next h2 { margin: 4px 0 0; font-size: 13px; color: var(--muted); font-weight: 700; }
.next-links.small a { padding: 7px 10px; font-size: 12px; }
.book1 { display: grid; gap: 3px; text-decoration: none; color: var(--ink); background: var(--panel-2); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; font-size: 14px; font-weight: 700; position: relative; }
.book1:hover { border-color: var(--lamp); }
.book1 small { color: var(--muted); font-weight: 400; font-size: 12px; line-height: 1.5; }
.book1 .pr { position: absolute; top: 8px; right: 10px; font-size: 10px; font-weight: 700; border: 1px solid var(--muted); color: var(--muted); border-radius: 4px; padding: 0 5px; line-height: 1.5; }
.bookmore { font-size: 12px; color: var(--muted); margin: 6px 0 0; }
.bookmore a { color: var(--muted); }
.modeTag { margin: -6px 0 0; font-size: 12px; color: var(--muted); }
.tbox { display: grid; gap: 4px; justify-items: start; }
.tnote { color: var(--muted); font-size: 12px; }
.evalq { border-left: 3px solid var(--lamp); background: var(--panel-2); border-radius: 6px; padding: 8px 12px; }
.evalq small { color: var(--muted); font-size: 11px; }
.evalq p { color: var(--ink); margin: 2px 0 0; }
.evalq .later { display: block; margin-top: 8px; color: var(--alert); }
.evalq .meetq { font-weight: 700; }
.tr { font-size: 11px; color: var(--lamp); margin: 2px 0 0 4px; }
.apt { display: grid; gap: 2px; border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; }
.apt small { color: var(--muted); font-size: 11px; }
.aptrow { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; }
.aptrow b { color: var(--lamp); letter-spacing: 1px; font-weight: 400; }
.meetcount { color: var(--alert) !important; font-weight: 700; }
.gloss dl { margin: 0; }
.gloss dt { font-weight: 700; margin-top: 10px; }
.gloss dd { margin: 2px 0 0; color: var(--muted); font-size: 13px; }
.file .ic.p { background: #a33a2e; }
@media (max-width: 960px) { .body { grid-template-columns: 68px minmax(0, 1fr); } .list { display: none; } }
@media (max-width: 640px) {
  .body { grid-template-columns: minmax(0, 1fr); } .rail { display: none; }
  .search, .chead .tabs { display: none; }
  .topbar { justify-content: space-between; }
  .meter .bar { width: 64px; }
  .toasts { top: calc(56px + env(safe-area-inset-top, 0px)); bottom: auto; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }

/* Korean typesetting: keep word boundaries while allowing long filenames to wrap. */
.card,.bub,.tx,.hint,.tr{word-break:keep-all;overflow-wrap:anywhere}
.ttl{line-height:1.35}.mode .tx>span{line-height:1.65}.rail button{font-size:10px}
.edition-nav{display:flex;justify-content:space-between;gap:12px;margin-bottom:14px;font-size:12px;color:var(--muted,#8d95a5)}.edition-nav a,.edition-home{color:#f2b34b;text-decoration:none}.edition-nav a:hover,.edition-home:hover{text-decoration:underline}.edition-nav span{font-weight:700;color:#f2b34b}.edition-home{display:inline-block;font-size:13px;margin:18px 0 4px}.topbar a.logo{text-decoration:none;color:inherit}a:focus-visible{outline:2px solid #f2b34b;outline-offset:4px}
@media(max-width:640px){.ttl{font-size:24px}.search{display:none}.topbar{gap:8px}}
