@font-face {
  font-family: Pretendard;
  src: url("./fonts/PretendardVariable.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #f5f6f8;
  --sidebar: #f3f5f8;
  --surface: #ffffff;
  --ink: #1c2030;
  --muted: #5e6678;
  --faint: #8b93a3;
  --line: #e4e7ee;
  --line-strong: #d5dae4;
  --blue: #2f5bff;
  --blue-press: #2448d6;
  --blue-soft: #eef2ff;
  --blue-ink: #1e3fa8;
  --green: #157a45;
  --green-bg: #e7f6ee;
  --green-line: #b7e4c9;
  --red: #b43333;
  --red-bg: #fdecec;
  --red-line: #f3c7c7;
  --amber: #8a5a12;
  --amber-bg: #fff6e4;
  --amber-line: #f0ddb0;
  --shadow: 0 10px 30px rgba(22, 28, 45, 0.08);
  --radius-card: 16px;
  --radius-control: 12px;
  --radius-pill: 999px;
  --side: 248px;
  --top: 60px;
  --font: Pretendard, "Malgun Gothic", sans-serif;
  color-scheme: light;
}

html[data-theme="dark"] {
  --bg: #10141c;
  --sidebar: #141922;
  --surface: #1a2030;
  --ink: #f3f5f8;
  --muted: #b4bccb;
  --faint: #8e97a8;
  --line: #2c3446;
  --line-strong: #3a4458;
  --blue: #4c73ff;
  --blue-press: #3a5fe0;
  --blue-soft: #243056;
  --blue-ink: #d6e0ff;
  --green: #8ee0b0;
  --green-bg: #173524;
  --green-line: #245c3a;
  --red: #ffb4b4;
  --red-bg: #3a2224;
  --red-line: #6a3438;
  --amber: #f3d7a1;
  --amber-bg: #3a301c;
  --amber-line: #6a5428;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.28);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body, #app { height: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  font-size: 14px;
  line-height: 1.5;
  word-break: keep-all;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}
.num { font-variant-numeric: tabular-nums; }

.shell { display: flex; height: 100%; min-width: 0; }
.side {
  width: var(--side);
  flex: 0 0 var(--side);
  background: var(--sidebar);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  padding: 16px 12px 12px;
  min-height: 0;
}
.shell.collapsed { --side: 76px; }
.shell.collapsed .hide-collapsed { display: none; }
.brand { display: flex; align-items: center; gap: 8px; padding: 0 6px 14px; }
.logo, .logo-lg {
  width: 28px; height: 28px; border-radius: 22%;
  background: transparent; object-fit: cover;
  display: block; flex: 0 0 auto;
}
.logo-lg { width: 40px; height: 40px; }
.brand-name { font-weight: 700; font-size: 15px; letter-spacing: -0.02em; }
.icon-btn, .ghost, .outline, .primary, .text-btn {
  border: 0; background: transparent; border-radius: var(--radius-control);
}
.icon-btn { width: 28px; height: 28px; display: grid; place-items: center; color: var(--muted); margin-left: auto; }
.icon-btn:hover { background: rgba(28, 32, 48, 0.05); }
html[data-theme="dark"] .icon-btn:hover { background: rgba(255,255,255,0.06); }
.primary {
  background: var(--blue); color: #fff; font-weight: 600;
  height: 40px; padding: 0 16px; border-radius: 12px;
}
.primary:hover { background: var(--blue-press); }
.primary.block { width: 100%; display: flex; align-items: center; justify-content: center; gap: 6px; }
.outline {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 36px; padding: 0 14px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  border-radius: var(--radius-pill);
  color: var(--ink);
}
.outline:hover { background: var(--bg); }
.text-btn { color: var(--muted); height: 32px; padding: 0 8px; }
.text-btn:hover { color: var(--ink); }
.nav { display: flex; flex-direction: column; gap: 2px; margin-top: 14px; min-height: 0; overflow: auto; flex: 1; }
.nav-item, .chat-item, .user {
  display: flex; align-items: center; gap: 8px;
  width: 100%; text-align: left;
  border: 0; background: transparent;
  color: var(--ink);
  border-radius: 10px;
  padding: 8px 10px;
  min-height: 36px;
}
.nav-item { color: var(--muted); }
.nav-item svg, .chat-item svg { flex: 0 0 auto; }
.nav-item:hover, .chat-item:hover, .user:hover { background: rgba(28, 32, 48, 0.04); }
html[data-theme="dark"] .nav-item:hover,
html[data-theme="dark"] .chat-item:hover,
html[data-theme="dark"] .user:hover { background: rgba(255,255,255,0.05); }
.nav-item.active, .chat-item.active {
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 1px 2px rgba(22, 28, 45, 0.04);
}
.kbd { margin-left: auto; color: var(--faint); font-size: 12px; }
.group { margin: 16px 10px 6px; color: var(--faint); font-size: 12px; }
.chat-item { font-size: 13px; }
.chat-item span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-foot { margin-top: auto; padding-top: 8px; border-top: 1px solid var(--line); }
.user { gap: 10px; }
.avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--blue-soft); color: var(--blue-ink);
  display: grid; place-items: center; font-weight: 700; flex: 0 0 auto;
}
.user small { display: block; color: var(--faint); font-size: 12px; }
.user b { font-weight: 600; font-size: 13px; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; background: var(--bg); }
.top {
  height: var(--top);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 20px; gap: 12px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.top-left, .top-right { display: flex; align-items: center; gap: 8px; min-width: 0; }
.page-label { font-weight: 650; font-size: 15px; }
.doc-chip {
  display: inline-flex; align-items: center; gap: 8px;
  height: 36px; padding: 0 12px 0 10px;
  border: 1px solid var(--line); border-radius: var(--radius-pill);
  background: var(--surface); max-width: 420px;
}
.doc-chip b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pill {
  display: inline-flex; align-items: center; gap: 4px;
  height: 22px; padding: 0 8px; border-radius: var(--radius-pill);
  font-size: 12px; font-weight: 600; white-space: nowrap;
}
.pill.ok { background: var(--green-bg); color: var(--green); }
.pill.wait { background: var(--amber-bg); color: var(--amber); }
.pill.info { background: var(--blue-soft); color: var(--blue-ink); }
.select {
  height: 36px; padding: 0 12px;
  border: 1px solid var(--line); border-radius: var(--radius-pill);
  background: var(--surface);
}
.stage { flex: 1; min-height: 0; overflow: auto; }
.center {
  width: min(880px, calc(100% - 48px));
  margin: 0 auto;
  padding: 56px 0 48px;
}
.hero { text-align: center; }
.hero .logo-lg { margin: 0 auto 18px; }
.hero h1 {
  margin: 0;
  font-size: 32px;
  line-height: 1.35;
  letter-spacing: -0.035em;
  font-weight: 700;
}
.lede { margin: 12px auto 0; max-width: 460px; color: var(--muted); font-size: 15px; line-height: 1.65; }

.composer {
  margin-top: 28px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 14px 14px 12px;
}
.composer textarea {
  width: 100%; border: 0; resize: none; outline: none;
  background: transparent; min-height: 52px; padding: 4px 4px 0;
  line-height: 1.55;
}
.composer textarea::placeholder { color: var(--faint); }
.composer-bar { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.chip {
  height: 32px; padding: 0 12px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  display: inline-flex; align-items: center; gap: 6px;
}
.chip:hover { background: var(--bg); color: var(--ink); }
.chip.open { background: var(--blue-soft); color: var(--blue-ink); border-color: transparent; }
.send {
  margin-left: auto; width: 36px; height: 36px; border-radius: 50%;
  border: 0; background: var(--blue); color: #fff;
  display: grid; place-items: center;
}
.send:hover { background: var(--blue-press); }
.send:disabled { background: var(--line-strong); color: var(--faint); cursor: default; }
.note { margin: 10px 4px 0; color: var(--faint); font-size: 12px; text-align: center; }
.flow-line { margin-top: 14px; text-align: center; color: var(--muted); font-size: 13px; }

.tasks {
  margin-top: 28px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}
.task {
  text-align: left;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  padding: 16px;
  min-height: 132px;
  display: flex; flex-direction: column; gap: 8px;
}
.task:hover { border-color: var(--line-strong); }
.task .ic {
  width: 28px; height: 28px; border-radius: 8px;
  background: var(--bg); color: var(--muted);
  display: grid; place-items: center;
}
.task b { font-size: 14px; font-weight: 650; }
.task span { color: var(--muted); font-size: 13px; line-height: 1.5; }

.recent { margin-top: 16px; }
.recent h2, .block-title {
  margin: 0 0 8px; font-size: 13px; font-weight: 650; color: var(--muted);
}
.recent-row, .list-row {
  display: flex; align-items: center; gap: 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  padding: 12px 14px;
}
.recent-row .meta, .list-row .meta { color: var(--faint); font-size: 12px; }
.grow { flex: 1; min-width: 0; overflow: hidden; }
.recent-row b, .list-row b, .file-row b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stack { display: flex; flex-direction: column; gap: 12px; }

.fmt { width: 28px; height: 28px; flex: 0 0 auto; display: block; object-fit: contain; }
.fmt-lg { width: 40px; height: 40px; }
.fmt-sm { width: 18px; height: 18px; }
.fmt-xs { width: 14px; height: 14px; }
.diff-meta .fmt, .file-row .fmt { width: 22px; height: 22px; }

/* Supported formats: the five vendor marks, one row, as the product's "what it works on" strip */
.formats { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; margin: 24px 0 4px; }
.format {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 14px 8px 12px; border-radius: 14px;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  text-align: center; min-width: 0;
}
button.format { cursor: pointer; }
button.format:hover { border-color: var(--blue); background: var(--blue-soft); }
.format b { font-size: 13px; font-weight: 650; }
.format span { color: var(--faint); font-size: 12px; line-height: 1.35; }
.format.muted { background: transparent; border-style: dashed; }
.format.muted .fmt { opacity: 0.9; }

/* Sidebar quick open: one tap to the Hangul / Word / Excel picker */
.quick-open { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; margin-top: 8px; }
.quick {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  height: 34px; padding: 0 6px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  font-size: 12px; font-weight: 600; min-width: 0;
}
.quick span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.quick:hover { border-color: var(--line-strong); background: var(--bg); }
.shell.collapsed .quick-open { grid-template-columns: 1fr; }

/* Account button and the upward account menu */
.user { text-align: left; }
.user .user-text { display: block; min-width: 0; flex: 1; }
.user .user-text b, .user .user-text small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user .user-chev { color: var(--faint); transform: rotate(180deg); transition: transform 0.15s ease; }
.user.open { background: var(--surface); box-shadow: 0 1px 2px rgba(22, 28, 45, 0.04); }
.user.open .user-chev { transform: rotate(0deg); }
.menu.account { width: 272px; padding: 8px; }
.menu.account button { display: flex; align-items: center; gap: 10px; color: var(--ink); min-height: 36px; }
.menu.account button svg { color: var(--muted); flex: 0 0 auto; }
.menu.account .kbd { margin-left: auto; }
.menu-head { display: flex; align-items: center; gap: 10px; padding: 6px 8px 10px; }
.menu-head b { display: block; font-weight: 650; }
.menu-head small { display: block; color: var(--faint); font-size: 12px; }
.menu-label { padding: 8px 10px 4px; color: var(--faint); font-size: 12px; }
.menu-sep { border: 0; border-top: 1px solid var(--line); margin: 6px 0; }
.menu.account .env { align-items: flex-start; }
.menu.account .env .radio {
  width: 16px; height: 16px; margin-top: 2px; border-radius: 50%; flex: 0 0 auto;
  border: 1.5px solid var(--line-strong); display: grid; place-items: center;
}
.menu.account .env.on .radio { border-color: var(--blue); }
.menu.account .env.on .radio::after { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--blue); }
.menu.account .env-text b { display: block; font-weight: 600; font-size: 13px; }
.menu.account .env-text small { display: block; color: var(--faint); font-size: 12px; }
.login-formats { display: flex; justify-content: center; gap: 14px; margin-top: 18px; }

/* Desktop window: the title bar is the top bar. Drag it; keep its right edge clear for the native controls */
html.in-desktop .top { -webkit-app-region: drag; padding-right: 154px; }
html.in-desktop .top button, html.in-desktop .top a, html.in-desktop .top select, html.in-desktop .top input { -webkit-app-region: no-drag; }
html.in-desktop .brand { -webkit-app-region: drag; }
html.in-desktop .brand button { -webkit-app-region: no-drag; }
.live::after {
  content: "";
  display: inline-block;
  width: 2px;
  height: 1em;
  margin-left: 2px;
  background: var(--blue);
  vertical-align: text-bottom;
  animation: caret 1s steps(1) infinite;
}
@keyframes caret { 50% { opacity: 0; } }
.thread { display: flex; flex-direction: column; gap: 16px; width: min(760px, 100%); margin: 0 auto; }
.bubble {
  align-self: flex-end;
  max-width: 440px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px 16px 4px 16px;
  padding: 12px 14px;
  line-height: 1.6;
}
.assist { display: flex; gap: 10px; align-items: flex-start; }
.assist p { margin: 2px 0 0; }
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  padding: 18px;
}
.card h2 { margin: 0; font-size: 18px; letter-spacing: -0.02em; }
.card .sub { margin: 4px 0 0; color: var(--muted); }
.card-head { display: flex; align-items: flex-start; gap: 12px; }
.check {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--green-bg); color: var(--green);
  display: grid; place-items: center; flex: 0 0 auto;
}
.warn-ic {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--amber-bg); color: var(--amber);
  display: grid; place-items: center; flex: 0 0 auto;
}
.file-row {
  margin-top: 14px;
  display: flex; align-items: center; gap: 10px;
  background: var(--bg);
  border-radius: 12px;
  padding: 12px;
}
.file-row .meta { color: var(--muted); font-size: 12px; }
.checks { display: flex; gap: 18px; margin-top: 12px; color: var(--ink); font-size: 13px; }
.checks span { display: inline-flex; align-items: center; gap: 6px; color: var(--green); }
.actions { display: flex; align-items: center; gap: 8px; margin-top: 16px; }
.actions .push { margin-left: auto; }
.actions.stack-actions { flex-direction: column; align-items: stretch; }
.actions .block { width: 100%; }
.worklog { display: flex; flex-direction: column; gap: 6px; margin-bottom: 10px; color: var(--muted); }
.worklog .l { display: flex; align-items: center; gap: 8px; }
.worklog b { color: var(--ink); font-weight: 600; }
.review-bar { display: flex; gap: 8px; }
.kv { display: grid; gap: 8px; margin: 14px 0; }
.kv div { display: grid; grid-template-columns: 72px 1fr; gap: 8px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }
.well { background: var(--sidebar); border-radius: 12px; padding: 12px 14px; }
.lead { margin: 0; font-size: 16px; }
.sub { margin: 4px 0 0; color: var(--muted); }

.diff { border-radius: 12px; padding: 12px 14px; margin-top: 8px; line-height: 1.65; }
.diff.del { background: var(--red-bg); color: var(--red); text-decoration: line-through; }
.diff.add { background: var(--green-bg); color: var(--green); }
.diff-meta { display: flex; align-items: center; gap: 8px; margin-top: 12px; color: var(--muted); font-size: 12px; }
.card-title-row { display: flex; align-items: center; justify-content: space-between; }

.ready-hero { padding-top: 8px; }
.prompt-card {
  margin: 20px 0 0;
  width: 100%;
  text-align: left;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  padding: 14px 16px;
}
.prompt-card + .composer { margin-top: 12px; }
.prompt-card button.prompt-fill {
  width: 100%; text-align: left; border: 0; background: var(--bg);
  border-radius: 12px; padding: 12px; line-height: 1.6;
}
.scope { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12px; margin-bottom: 8px; }

.steps { margin-top: 14px; display: flex; flex-direction: column; gap: 8px; }
.step { display: flex; align-items: center; gap: 10px; min-height: 28px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--line-strong); flex: 0 0 auto; }
.step.done .dot { background: var(--green); }
.step.now .dot { background: var(--blue); }
.step.now { font-weight: 650; }
.step.wait { color: var(--faint); }

.layout-2 { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 16px; align-items: start; }
.paper {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  padding: 28px 32px 20px;
  min-height: 520px;
}
.paper h2 { margin: 0 0 4px; font-size: 22px; letter-spacing: -0.03em; }
.paper .doc-kicker { color: var(--faint); font-size: 12px; margin-bottom: 22px; }
.paper h3 { margin: 18px 0 6px; font-size: 15px; }
.paper p { margin: 0; color: var(--muted); }
.hl {
  margin-top: 8px;
  background: var(--blue-soft);
  border-radius: 12px;
  padding: 12px 14px;
}
.hl h3 { margin-top: 0; color: var(--blue-ink); }
.page-no { text-align: center; color: var(--faint); margin-top: 28px; }
.side-card h2 { font-size: 16px; }
.ref { display: flex; gap: 10px; align-items: flex-start; padding: 10px 0; border-top: 1px solid var(--line); }
.ref:first-of-type { border-top: 0; }
.quote { margin-top: 8px; padding: 10px 12px; background: var(--bg); border-radius: 12px; color: var(--muted); font-size: 13px; }

.tabs { display: flex; gap: 18px; margin: 18px 0 16px; border-bottom: 1px solid var(--line); }
.tabs button {
  border: 0; background: transparent; padding: 8px 0 10px;
  color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.tabs button.active { color: var(--ink); font-weight: 650; border-bottom-color: var(--blue); }
.section {
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  padding: 16px;
  background: var(--surface);
  margin-bottom: 12px;
}
.section h3 { margin: 0 0 10px; font-size: 14px; }
.choice-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.choice {
  text-align: left; border: 1px solid var(--line); background: var(--surface);
  border-radius: 12px; padding: 12px; min-height: 84px;
}
.choice.active { border-color: var(--blue); background: var(--blue-soft); }
.choice b { display: block; margin-bottom: 4px; }
.choice span { color: var(--muted); font-size: 13px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.switch { width: 40px; height: 24px; border-radius: 999px; border: 0; background: var(--line-strong); position: relative; flex: 0 0 auto; }
.switch.on { background: var(--blue); }
.switch i { position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform 160ms ease; }
.switch.on i { transform: translateX(16px); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.rule { display: flex; justify-content: space-between; gap: 16px; padding: 10px 0; border-top: 1px solid var(--line); }
.rule span { color: var(--muted); }
.help { color: var(--muted); font-size: 13px; margin: 8px 0 0; }
.field { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 0; border-top: 1px solid var(--line); }
.field:first-child { border-top: 0; padding-top: 0; }
.field label { font-weight: 600; }
.field p { margin: 2px 0 0; color: var(--muted); font-size: 13px; }
.field input[type="text"], .field input[type="password"], .reason {
  height: 36px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--surface); padding: 0 10px; min-width: 220px;
}
.reason { width: 100%; height: 72px; padding: 8px 10px; resize: vertical; }

.table-wrap { overflow: auto; border: 1px solid var(--line); border-radius: var(--radius-card); background: var(--surface); }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--line); font-size: 13px; }
th { color: var(--muted); font-weight: 600; background: var(--bg); }
tr:last-child td { border-bottom: 0; }
tr.clickable { cursor: pointer; }
tr.clickable:hover td { background: var(--blue-soft); }
.filters { display: flex; gap: 8px; align-items: center; margin: 14px 0; }
.filters .push { margin-left: auto; }

.tools { display: grid; grid-template-columns: 180px 1fr; gap: 16px; }
.tool-tab { text-align: left; }
.tool-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tool {
  text-align: left; border: 1px solid var(--line); background: var(--surface);
  border-radius: 12px; padding: 12px; min-height: 88px;
}
.tool.active { border-color: var(--blue); background: var(--blue-soft); }
.tool b { display: block; margin-bottom: 4px; }
.tool span { color: var(--muted); font-size: 13px; }

.empty {
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-card);
  padding: 36px 20px;
  text-align: center;
  background: var(--surface);
}
.empty h2 { margin: 0 0 6px; font-size: 18px; }
.empty p { margin: 0 0 16px; color: var(--muted); }

.login {
  min-height: 100%;
  display: grid; place-items: center;
  padding: 32px 16px;
}
.login-card { width: min(420px, 100%); text-align: center; }
.login-card h1 { margin: 16px 0 8px; font-size: 28px; letter-spacing: -0.03em; }
.seg { display: flex; background: var(--sidebar); border-radius: 12px; padding: 4px; margin: 20px 0; }
.seg button { flex: 1; height: 36px; border: 0; background: transparent; border-radius: 10px; color: var(--muted); }
.seg button.active { background: var(--surface); color: var(--ink); font-weight: 650; }

.modal-back {
  position: fixed; inset: 0; background: rgba(18, 22, 32, 0.42);
  display: grid; place-items: center; padding: 24px; z-index: 20;
}
.modal {
  width: min(520px, 100%);
  background: var(--surface);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 20px;
}
.modal h2 { margin: 0 0 6px; font-size: 18px; }
.modal p { margin: 0; color: var(--muted); }
.doc-list { margin: 14px 0; display: flex; flex-direction: column; gap: 8px; }
.doc-pick {
  display: flex; align-items: center; gap: 10px;
  width: 100%; text-align: left;
  border: 1px solid var(--line); background: var(--surface);
  border-radius: 12px; padding: 10px 12px;
}
.doc-pick:hover, .doc-pick.active { border-color: var(--blue); background: var(--blue-soft); }
.toast {
  position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%);
  background: var(--ink); color: var(--surface);
  border-radius: 999px; padding: 10px 16px;
  box-shadow: var(--shadow); z-index: 30; font-size: 13px;
}
.menu {
  position: absolute; z-index: 15;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 12px; box-shadow: var(--shadow);
  min-width: 220px; padding: 6px;
}
.menu.place-top { top: 64px; right: 20px; }
.menu.place-user { left: 12px; bottom: 72px; top: auto; right: auto; }
.menu button {
  display: block; width: 100%; text-align: left;
  border: 0; background: transparent; border-radius: 8px;
  padding: 8px 10px;
}
.menu button:hover { background: var(--bg); }
.anchor { position: relative; }

@media (max-width: 1100px) {
  .formats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .tasks { grid-template-columns: 1fr 1fr; }
  .layout-2, .tools, .choice-grid { grid-template-columns: 1fr; }
  .center { width: min(880px, calc(100% - 32px)); }
}
@media (max-width: 760px) {
  .side { display: none; }
  .tasks { grid-template-columns: 1fr; }
  .hero h1 { font-size: 26px; }
}
@media (prefers-reduced-motion: reduce) {
  .switch i { transition: none; }
}

/* ---------------------------------------------------------------- real sessions (desktop app, live-ui.js) */
.pill.bad { background: var(--red-bg); color: var(--red); }
.fmt-generic { display: inline-grid; place-items: center; color: var(--muted); }
.empty.slim { padding: 18px; text-align: left; }
.empty.slim p { margin: 0; }
.empty.boot { display: flex; align-items: center; gap: 10px; justify-content: center; margin-top: 18vh; border: 0; background: transparent; }
.side-empty { padding: 4px 10px; margin: 0; }
.live-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--blue); margin-left: auto; flex: 0 0 auto; }
.chat-item .fmt { flex: 0 0 auto; }
.chat-ic { width: 28px; height: 28px; border-radius: 8px; background: var(--bg); display: grid; place-items: center; color: var(--muted); flex: 0 0 auto; }
.ghost-chip { cursor: default; }
.send.stop { background: var(--ink); }
.send.stop:hover { background: var(--muted); }
.spin {
  width: 14px; height: 14px; border-radius: 50%; flex: 0 0 auto;
  border: 2px solid var(--line-strong); border-top-color: var(--blue);
  animation: spin 0.9s linear infinite; display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

.thread.is-live { gap: 14px; }
#live-send-slot { margin-left: auto; display: inline-flex; }
#live-send-slot .send { margin-left: 0; }
#live-thread { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.assist-body { display: flex; flex-direction: column; gap: 8px; min-width: 0; flex: 1; }
.md { line-height: 1.7; overflow-wrap: anywhere; }
.md p { margin: 0 0 8px; }
.md p:last-child { margin-bottom: 0; }
.md .md-h { font-weight: 700; margin-top: 6px; }
.md ul, .md ol { margin: 0 0 8px; padding-left: 20px; }
.md li + li { margin-top: 2px; }
.md code { font-family: Consolas, "D2Coding", monospace; font-size: 12.5px; background: var(--bg); border-radius: 6px; padding: 1px 5px; }
.typing { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 13px; padding-left: 38px; }
.dots { display: inline-flex; gap: 4px; }
.dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--faint); animation: blink 1.2s infinite ease-in-out; }
.dots i:nth-child(2) { animation-delay: 0.15s; }
.dots i:nth-child(3) { animation-delay: 0.3s; }
@keyframes blink { 0%, 80%, 100% { opacity: 0.25; } 40% { opacity: 1; } }

.tool-row {
  display: flex; align-items: center; flex-wrap: wrap; gap: 6px 8px;
  border: 1px solid var(--line); background: var(--surface);
  border-radius: 12px; padding: 8px 12px; font-size: 13px; color: var(--muted);
}
.tool-row b { color: var(--ink); font-weight: 600; }
.tool-row .tool-detail { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 46ch; }
.tool-row .tool-state { margin-left: auto; font-size: 12px; }
.tool-row.done svg { color: var(--green); }
.tool-row.error { border-color: var(--red-line); }
.tool-row.error svg, .tool-row.error .tool-state { color: var(--red); }
.tool-row.rejected svg, .tool-row.stopped svg { color: var(--amber); }
.tool-row .tool-err { flex-basis: 100%; color: var(--red); font-size: 12px; }

.todo-card { padding: 14px 16px; }
.todos { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.todos li { display: flex; align-items: center; gap: 8px; color: var(--muted); }
.todos li.completed { color: var(--faint); text-decoration: line-through; }
.todos li.completed svg { color: var(--green); }
.todos li.in_progress { color: var(--ink); font-weight: 600; }
.todos .dot { margin: 0 3px; }

.card.hitl { border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-soft); }
.card.hitl.question h2 { font-size: 16px; }
.card .file-row + .sub, .card .file-row + .md { margin-top: 10px; }
.approval-body { margin-top: 12px; }
.q-options { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.q-options .choice { text-align: left; }
.q-free {
  width: 100%; margin-top: 10px; height: 40px; padding: 0 12px;
  border: 1px solid var(--line); border-radius: var(--radius-control); background: var(--surface);
}
.reject-label { display: block; margin-top: 14px; font-weight: 600; }
.reject-label .reason { margin-top: 6px; font-weight: 400; }
pre.code {
  margin: 10px 0 0; padding: 12px; border-radius: 12px; background: var(--bg);
  font-family: Consolas, "D2Coding", monospace; font-size: 12px; line-height: 1.55;
  overflow: auto; max-height: 260px; white-space: pre;
}
.card.error-card { border-color: var(--red-line); }
.card.error-card .warn-ic { background: var(--red-bg); color: var(--red); }
.card.handoff .file-row, .card.artifacts .file-row { margin-top: 0; }
.card.artifacts { display: flex; flex-direction: column; gap: 8px; }
.card.artifacts .sub { margin: 0 0 4px; }
.center-note { text-align: center; display: flex; gap: 6px; justify-content: center; align-items: center; }
.review-bar { justify-content: center; flex-wrap: wrap; }
.review-bar.saved { align-items: center; gap: 12px; }
.review-bar .help { flex-basis: 100%; text-align: center; margin: 0; }

.attach-row { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.bubble .attach-row { margin: 8px 0 0; }
.attach-chip {
  display: inline-flex; align-items: center; gap: 6px; max-width: 260px;
  height: 28px; padding: 0 6px 0 8px; border-radius: var(--radius-pill);
  background: var(--bg); border: 1px solid var(--line); font-size: 12px;
}
.attach-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.attach-chip.static { padding-right: 10px; background: var(--surface); }
.attach-chip .x { border: 0; background: transparent; color: var(--muted); width: 20px; height: 20px; border-radius: 50%; }
.attach-chip .x:hover { background: var(--line); color: var(--ink); }

.tasks.compact { grid-template-columns: 1fr 1fr; margin-top: 16px; }
.tasks.compact .task { min-height: 0; padding: 12px; flex-direction: row; align-items: center; gap: 8px; }
.menu.sessions { left: 16px; right: auto; width: min(320px, calc(100vw - 32px)); }
.menu.sessions button { display: flex; align-items: center; gap: 10px; }
.menu.sessions button span:not(.kbd) { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu.sessions .kbd { margin-left: auto; }

/* 한/글 · Word · Excel edit window: docked beside the document, about 480px wide */
html.edit-window .side { display: none; }
html.edit-window .center { width: calc(100% - 32px); padding: 28px 0 32px; }
html.edit-window .doc-chip { max-width: calc(100vw - 190px); }
html.edit-window .hero h1 { font-size: 24px; }
html.edit-window .hero .fmt-lg { margin: 0 auto 14px; display: block; }
html.edit-window .composer-bar { gap: 6px; }
html.edit-window .composer-bar .chip { padding: 0 10px; }
html.edit-window .chip.attach .chip-label { display: none; }
html.edit-window .bubble { max-width: 88%; }
html.edit-window .tool-row .tool-detail { max-width: 24ch; }
html.edit-window .typing { padding-left: 0; }
.cta-row { display: flex; justify-content: center; margin-top: 16px; }
.composer-bar .chip { white-space: nowrap; }
.composer-bar .chip.model { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.tool-row details.tool-err { flex-basis: 100%; font-size: 12px; color: var(--red); }
.tool-row details.tool-err summary { cursor: pointer; }
.tool-row details.tool-err pre { margin: 6px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; font-family: Consolas, "D2Coding", monospace; color: var(--muted); max-height: 160px; overflow: auto; }
.logo-gap { width: 28px; flex: 0 0 28px; }
.assist.cont { margin-top: -6px; }
.review-bar.saved .help svg { color: var(--green); vertical-align: -3px; }
