/* 리미키미 B2B 데모 공통 스타일. 흰 바탕, 무채색, 강조색 하나. */

:root {
  --bg: #ffffff;
  --fg: #1d1d1f;
  --fg-2: #6e6e73;
  --fg-3: #86868b;
  --line: #e8e8ed;
  --line-2: #d2d2d7;
  --fill: #f5f5f7;
  --fill-2: #ececf0;
  --accent: #0071e3;
  --accent-press: #0062c4;
  --accent-ink: #0066cc;
  --accent-tint: rgba(0, 113, 227, 0.08);

  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 20px;
  --sp-6: 24px;
  --sp-8: 32px;
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-xl: 20px;

  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --dur-1: 150ms;
  --dur-2: 220ms;

  --tabbar-h: 56px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --content-pad-bottom: calc(var(--tabbar-h) + var(--safe-bottom) + var(--sp-4));

  --font: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Noto Sans KR", system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
* { scrollbar-width: none; -webkit-tap-highlight-color: transparent; }
*::-webkit-scrollbar { display: none; }
[hidden] { display: none !important; }

html, body {
  height: 100%;
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  overscroll-behavior: none;
  word-break: keep-all;
  overflow-wrap: break-word;
}

h1, h2, h3, h4, p, ul, ol, dl, dd, figure { margin: 0; padding: 0; }
ul, ol { list-style: none; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }
textarea { font: inherit; color: inherit; }

button, .seg, .tabbar, .row, .card-actions, .controls {
  -webkit-user-select: none;
  user-select: none;
}

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
:focus:not(:focus-visible) { outline: none; }

/* 버튼 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 36px;
  padding: 0 14px;
  border: 0;
  border-radius: 999px;
  background: var(--fill);
  color: var(--fg);
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color var(--dur-1) ease, color var(--dur-1) ease, opacity var(--dur-1) ease, transform 160ms var(--ease-out);
}
.btn:active { transform: scale(0.97); }
.btn[disabled] { opacity: 0.4; pointer-events: none; }
.btn svg { width: 14px; height: 14px; flex: none; }
.btn.primary { background: var(--accent); color: #fff; }
.btn.text { background: transparent; color: var(--fg-2); padding: 0 10px; }
@media (hover: hover) {
  .btn:hover { background: var(--fill-2); }
  .btn.primary:hover { background: var(--accent-press); }
  .btn.text:hover { background: var(--fill); color: var(--fg); }
}

/* 칩 */
.chip {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 10px;
  border-radius: 999px;
  background: var(--fill);
  color: #424245;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.chip.accent { background: var(--accent-tint); color: var(--accent-ink); }
.chip.dark { background: var(--fg); color: #fff; }
.chip.sm { height: 20px; padding: 0 8px; font-size: 11px; }
.tag {
  display: inline-flex;
  align-items: center;
  height: 20px;
  padding: 0 7px;
  border: 1px solid var(--line-2);
  border-radius: 6px;
  color: var(--fg-2);
  font-size: 11px;
  font-weight: 500;
  white-space: nowrap;
}

/* 앱 프레임 */
.app { display: flex; flex-direction: column; height: 100vh; height: 100dvh; }

.top { flex: none; padding: var(--safe-top) var(--sp-4) 0; border-bottom: 1px solid var(--line); background: var(--bg); }
.top-main { display: flex; align-items: center; flex-wrap: wrap; gap: var(--sp-2); min-height: 48px; }
.back { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; margin-left: -8px; border-radius: 50%; color: var(--fg-2); transition: background-color var(--dur-1) ease, transform 160ms var(--ease-out); }
.back:active { transform: scale(0.94); }
.back svg { width: 18px; height: 18px; }
@media (hover: hover) { .back:hover { background: var(--fill); color: var(--fg); } }
.title { font-size: 17px; font-weight: 650; letter-spacing: -0.02em; }
.meta { display: flex; align-items: center; gap: var(--sp-2); flex: 0 0 100%; padding-left: 32px; margin-top: -6px; margin-bottom: var(--sp-2); }
.sample { display: inline-flex; align-items: center; height: 24px; padding: 0 10px; border: 1px solid var(--line-2); border-radius: 999px; color: var(--fg-2); font-size: 12px; font-weight: 500; white-space: nowrap; }
.top-bar { display: flex; flex-direction: column; gap: var(--sp-2); padding-bottom: var(--sp-3); }

/* 세그먼트 */
.seg { display: inline-flex; gap: 2px; padding: 3px; border-radius: 999px; background: var(--fill); max-width: 100%; overflow-x: auto; }
.seg button {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 14px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--fg-2);
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color var(--dur-1) ease, color var(--dur-1) ease, box-shadow var(--dur-1) ease, transform 160ms var(--ease-out);
}
.seg button:active { transform: scale(0.97); }
.seg button[aria-selected="true"] { background: #fff; color: var(--fg); box-shadow: 0 0 0 0.5px rgba(0, 0, 0, 0.06), 0 1px 3px rgba(0, 0, 0, 0.1); }
.seg .count { min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--fill-2); color: var(--fg-2); font-size: 11px; font-weight: 600; line-height: 18px; text-align: center; transition: background-color var(--dur-1) ease, color var(--dur-1) ease; }
.seg button[aria-selected="true"] .count { background: var(--fill); }
.seg .count.has, .seg button[aria-selected="true"] .count.has { background: var(--accent); color: #fff; }

.controls { display: flex; align-items: center; gap: var(--sp-2); }
.controls .progress { margin-left: auto; color: var(--fg-2); font-size: 13px; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* 패널 */
.panes { flex: 1; min-height: 0; position: relative; }
.pane { display: none; flex-direction: column; height: 100%; min-width: 0; min-height: 0; transition: opacity var(--dur-2) var(--ease-out), transform var(--dur-2) var(--ease-out); }
.app[data-pane="inbox"] .pane[data-pane="inbox"],
.app[data-pane="work"] .pane[data-pane="work"],
.app[data-pane="queue"] .pane[data-pane="queue"] { display: flex; }

.pane-head { flex: none; display: flex; align-items: center; justify-content: space-between; gap: var(--sp-2); min-height: 52px; padding: var(--sp-2) var(--sp-4) 0; }
.pane-head .seg button { padding: 0 12px; }
.pane-head h2 { font-size: 15px; font-weight: 650; letter-spacing: -0.01em; white-space: nowrap; }
.pane-sub { color: var(--fg-2); font-size: 13px; text-align: right; }
.pane-body { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: var(--sp-1) var(--sp-3) var(--content-pad-bottom); }

/* 받은 메시지 */
.group-head { display: flex; align-items: baseline; gap: var(--sp-2); padding: var(--sp-4) var(--sp-3) var(--sp-1); color: var(--fg-2); font-size: 13px; font-weight: 600; }
.group-head:first-child { padding-top: var(--sp-2); }
.group-head .n { font-weight: 500; color: var(--fg-3); font-variant-numeric: tabular-nums; }

.row {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: var(--sp-3);
  width: 100%;
  padding: var(--sp-3);
  border: 0;
  border-radius: var(--r-md);
  background: transparent;
  text-align: left;
  cursor: pointer;
  transition: background-color var(--dur-1) ease, opacity 240ms var(--ease-out), transform 240ms var(--ease-out);
}
.row.pre-enter { opacity: 0; transform: translateY(6px); }
.row:active { background: var(--fill); }
.row[aria-current="true"] { background: var(--fill); }
@media (hover: hover) { .row:hover { background: var(--fill); } }
.row[data-locked="true"] { cursor: default; }

.avatar { position: relative; flex: none; display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 50%; background: var(--fill-2); color: var(--fg-2); font-size: 15px; font-weight: 600; letter-spacing: 0; }
.avatar.sm { width: 32px; height: 32px; font-size: 13px; }
.avatar.word { font-size: 12px; }
.row[data-status="pending"] .avatar::after { content: ""; position: absolute; top: -1px; right: -1px; width: 10px; height: 10px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 2px var(--bg); }
.row[aria-current="true"][data-status="pending"] .avatar::after { box-shadow: 0 0 0 2px var(--fill); }

.row-main { flex: 1; min-width: 0; display: block; }
.row-top { display: flex; align-items: center; gap: 6px; min-height: 22px; }
.row-name { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 15px; font-weight: 600; }
.row-sub { flex: none; color: var(--fg-3); font-size: 13px; white-space: nowrap; }
.row-time { flex: none; padding-left: var(--sp-1); color: var(--fg-3); font-size: 12px; white-space: nowrap; }
.row-preview { display: -webkit-box; margin-top: 2px; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; color: var(--fg-2); font-size: 14px; line-height: 1.45; }
.row-state { flex: none; margin-left: auto; display: inline-flex; align-items: center; gap: 5px; color: var(--fg-3); font-size: 12px; font-weight: 500; white-space: nowrap; transition: color var(--dur-1) ease; }
.row-state svg { width: 12px; height: 12px; }
.row[data-status="working"] .row-state { color: var(--accent-ink); }
.row[data-status="queued"] .row-state { color: var(--fg-2); }
.row[data-status="sent"] .row-state { color: var(--fg-3); }

.spinner { flex: none; display: inline-block; width: 14px; height: 14px; border: 2px solid var(--line-2); border-top-color: var(--accent); border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* 에이전트 작업 */
.pane[data-pane="work"] .pane-body { display: flex; flex-direction: column; gap: var(--sp-4); }
.work-card { padding: var(--sp-4) var(--sp-4) var(--sp-4); border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--bg); transition: opacity var(--dur-2) var(--ease-out), transform var(--dur-2) var(--ease-out); }
.work-head { display: flex; align-items: center; gap: var(--sp-3); margin-bottom: var(--sp-3); }
.work-head .who { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 15px; font-weight: 600; }
.work-head .who span { margin-left: 6px; color: var(--fg-3); font-size: 13px; font-weight: 500; }
.shopbar { display: flex; align-items: center; gap: var(--sp-2); min-height: 38px; }
.shopbar b { margin-right: var(--sp-1); font-size: 15px; font-weight: 650; }
.work-state { display: inline-flex; align-items: center; gap: 6px; color: var(--fg-2); font-size: 12px; font-weight: 600; white-space: nowrap; }

.steps { position: relative; }
.step { position: relative; display: grid; grid-template-columns: 20px minmax(0, 1fr); column-gap: var(--sp-3); padding-bottom: var(--sp-3); }
.step:last-child { padding-bottom: 0; }
.step::before { content: ""; position: absolute; left: 9.5px; top: 24px; bottom: 4px; width: 1px; background: var(--line); }
.step:last-child::before { display: none; }
.step-mark { position: relative; z-index: 1; width: 20px; height: 20px; margin-top: 1px; border: 1.5px solid var(--line-2); border-radius: 50%; background: var(--bg); transition: background-color var(--dur-1) ease, border-color var(--dur-1) ease; }
.step-mark .spinner { position: absolute; inset: -1.5px; width: auto; height: auto; opacity: 0; transition: opacity var(--dur-1) ease; }
.step-mark svg { position: absolute; inset: 0; width: 100%; height: 100%; padding: 4px; color: #fff; opacity: 0; transform: scale(0.8); transition: opacity var(--dur-1) ease, transform var(--dur-2) var(--ease-out); }
.step[data-state="active"] .step-mark { border-color: transparent; }
.step[data-state="active"] .step-mark .spinner { opacity: 1; }
.step[data-state="done"] .step-mark { background: var(--fg); border-color: var(--fg); }
.step[data-state="done"] .step-mark svg { opacity: 1; transform: none; }
.step-title { min-height: 22px; color: var(--fg-3); font-size: 13px; font-weight: 600; line-height: 22px; transition: color var(--dur-1) ease; }
.step[data-state="active"] .step-title, .step[data-state="done"] .step-title { color: var(--fg); }
.step-body { margin-top: 6px; opacity: 0; transform: translateY(4px); transition: opacity var(--dur-2) var(--ease-out), transform var(--dur-2) var(--ease-out); }
.step[data-state="active"] .step-body, .step[data-state="done"] .step-body { opacity: 1; transform: none; }

.quote { padding: 8px var(--sp-3); border-radius: var(--r-md); background: var(--fill); font-size: 14px; line-height: 1.55; }
.srcs { display: flex; flex-direction: column; gap: var(--sp-2); }
.src { padding: 8px var(--sp-3); border-radius: var(--r-md); background: var(--accent-tint); }
.src b { display: block; color: var(--accent-ink); font-size: 13px; font-weight: 600; }
.src span { display: -webkit-box; margin-top: 2px; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; color: #424245; font-size: 13px; line-height: 1.45; }
.draft-text { font-size: 14px; line-height: 1.6; white-space: pre-line; }
.draft-text .rest { color: transparent; }
.cls { display: flex; flex-direction: column; align-items: flex-start; gap: var(--sp-2); }
.fields { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 2px var(--sp-3); font-size: 13px; line-height: 1.5; }
.fields dt { color: var(--fg-3); }
.fields dd { color: var(--fg); }
.memo { padding: 10px var(--sp-3); border-radius: var(--r-md); background: var(--fill); font-size: 13px; line-height: 1.5; }
.memo b { display: block; margin-bottom: 2px; color: var(--fg-2); font-size: 12px; font-weight: 600; }

.work-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--sp-3); padding: var(--sp-8) var(--sp-4); border: 1px dashed var(--line-2); border-radius: var(--r-lg); color: var(--fg-3); font-size: 14px; text-align: center; }
.work-empty svg { width: 28px; height: 28px; color: var(--line-2); }
.summary { padding: var(--sp-5); border: 1px solid var(--line); border-radius: var(--r-lg); transition: opacity var(--dur-2) var(--ease-out), transform var(--dur-2) var(--ease-out); }
.summary h3 { margin-bottom: var(--sp-3); font-size: 20px; font-weight: 650; letter-spacing: -0.02em; }
.summary li { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); padding: 10px 0; border-top: 1px solid var(--line); font-size: 14px; }
.summary li b { font-weight: 600; font-variant-numeric: tabular-nums; }
.summary .btn { margin-top: var(--sp-4); }

/* 회사 자료 */
.kb-wrap { flex: none; }
.kb-head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--sp-2); padding: 0 var(--sp-1) var(--sp-2); }
.kb-head h3 { font-size: 15px; font-weight: 650; }
.kb-head span { color: var(--fg-2); font-size: 13px; }
.kb-list { position: relative; display: flex; flex-direction: column; }
.kb-item { position: relative; padding: var(--sp-3); border-radius: var(--r-md); transition: background-color var(--dur-2) ease; }
.kb-item + .kb-item::before { content: ""; position: absolute; top: 0; left: var(--sp-3); right: var(--sp-3); height: 1px; background: var(--line); transition: opacity var(--dur-1) ease; }
.kb-item.used { background: var(--accent-tint); }
.kb-item.used::before, .kb-item.used + .kb-item::before { opacity: 0; }
.kb-item .kb-cat { display: block; color: var(--fg-3); font-size: 11px; font-weight: 600; }
.kb-item h4 { margin-top: 1px; font-size: 14px; font-weight: 600; }
.kb-item p { margin-top: 2px; color: var(--fg-2); font-size: 13px; line-height: 1.5; }
.kb-item.used .kb-cat { color: var(--accent-ink); }

/* 승인 대기, 보낸 메시지 */
.pane[data-pane="queue"] .pane-head { padding-right: var(--sp-3); }
.cards { display: flex; flex-direction: column; gap: var(--sp-3); padding-top: var(--sp-1); }
.card, .sent {
  position: relative;
  padding: var(--sp-4);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--bg);
  transition: opacity var(--dur-2) var(--ease-out), transform var(--dur-2) var(--ease-out);
}
.card.is-entering, .sent.is-entering { opacity: 0; transform: translateY(-8px); }
.card.is-leaving { opacity: 0; transform: translateX(16px); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-2); }
.card-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 15px; font-weight: 600; }
.card-chips { display: inline-flex; align-items: center; gap: 6px; flex: none; }
.card-name em { margin-left: 6px; color: var(--fg-3); font-size: 12px; font-style: normal; font-weight: 500; }
.card-src { display: flex; align-items: center; gap: 6px; margin-top: 4px; color: var(--fg-3); font-size: 12px; }
.card-src svg { width: 12px; height: 12px; flex: none; }
.card .draft { margin-top: var(--sp-3); }
.card .draft-text { font-size: 14.5px; line-height: 1.6; }
.card textarea {
  display: block;
  width: 100%;
  min-height: 132px;
  padding: 10px var(--sp-3);
  border: 1px solid var(--line-2);
  border-radius: var(--r-md);
  background: var(--bg);
  font-size: 14.5px;
  line-height: 1.6;
  letter-spacing: -0.01em;
  resize: vertical;
  word-break: keep-all;
}
.card textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-tint); }
.card .fields { margin-top: var(--sp-3); padding-top: var(--sp-3); border-top: 1px solid var(--line); }
.card .memo { margin-top: var(--sp-3); }
.card-actions { display: flex; gap: var(--sp-2); margin-top: var(--sp-4); }
.card-actions .btn { min-width: 64px; }
.card .edit-actions { display: none; }
.card.editing .view-actions { display: none; }
.card.editing .edit-actions { display: flex; gap: var(--sp-2); }
.card.editing .draft-text { display: none; }
.card .draft-edit { display: none; }
.card.editing .draft-edit { display: block; }

.empty { padding: var(--sp-8) var(--sp-4); color: var(--fg-3); font-size: 14px; text-align: center; }

.sent { padding: var(--sp-4); }
.sent-who { margin-bottom: var(--sp-2); color: var(--fg-3); font-size: 12px; }
.bubble { max-width: 88%; padding: 9px 13px; border-radius: 18px; font-size: 14px; line-height: 1.55; white-space: pre-line; }
.bubble.in { background: var(--fill); border-bottom-left-radius: 6px; }
.bubble.out { margin: var(--sp-2) 0 0 auto; background: var(--accent); color: #fff; border-bottom-right-radius: 6px; }
.sent-meta { display: flex; align-items: center; justify-content: flex-end; gap: 6px; margin-top: 6px; color: var(--fg-3); font-size: 12px; }
.sent-meta svg { width: 12px; height: 12px; }
.sent .memo { margin-top: var(--sp-3); }
.log-head { display: flex; align-items: center; gap: var(--sp-2); }
.log-head svg { flex: none; width: 16px; height: 16px; padding: 3px; border-radius: 50%; background: var(--fg); color: #fff; }
.log-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; font-weight: 600; }
.log-time { color: var(--fg-3); font-size: 12px; white-space: nowrap; }
.log-done { margin-top: 4px; padding-left: 24px; color: var(--fg-2); font-size: 13px; }
.log-text { margin-top: var(--sp-2); padding: 9px 12px; border-radius: var(--r-md); background: var(--fill); font-size: 13px; line-height: 1.5; white-space: pre-line; color: #424245; }

/* 하단 탭 (좁은 화면) */
.tabbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10;
  display: flex;
  padding-bottom: var(--safe-bottom);
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.94);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
}
.tabbar button {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  height: var(--tabbar-h);
  border: 0;
  background: transparent;
  color: var(--fg-3);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: color var(--dur-1) ease, transform 160ms var(--ease-out);
}
.tabbar button:active { transform: scale(0.96); }
.tabbar button[aria-selected="true"] { color: var(--accent); }
.tabbar svg { width: 24px; height: 24px; }
.tabbar .badge { position: absolute; top: 5px; left: calc(50% + 6px); min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--accent); color: #fff; font-size: 11px; font-weight: 600; line-height: 18px; text-align: center; font-variant-numeric: tabular-nums; transition: transform 160ms var(--ease-out), opacity var(--dur-1) ease; }
.tabbar .badge.zero { opacity: 0; }
.tabbar .badge.bump { transform: scale(1.2); }

/* 좁은 화면 보정 */
@media (max-width: 1023px) {
  .btn { height: 40px; }
  .controls .btn.primary { padding: 0 18px; }
  .card-actions .btn { height: 44px; flex: 1; }
  .seg button { height: 34px; }
  .controls { min-height: 44px; }
  .pane-body { padding-left: var(--sp-3); padding-right: var(--sp-3); }
}
@media (min-width: 640px) and (max-width: 1023px) {
  .pane-body, .pane-head { width: 100%; max-width: 640px; margin-left: auto; margin-right: auto; }
}

/* 데스크톱 3열 */
@media (min-width: 1024px) {
  .top { padding-left: var(--sp-6); padding-right: var(--sp-6); }
  .top-main { min-height: 60px; flex-wrap: nowrap; gap: var(--sp-3); }
  .title { font-size: 20px; }
  .meta { flex: 0 0 auto; padding: 0; margin: 0 0 0 var(--sp-1); }
  .top-bar { flex-direction: row; align-items: center; justify-content: space-between; padding-bottom: var(--sp-3); }
  .controls .progress { margin-left: var(--sp-3); }

  .panes { display: grid; grid-template-columns: minmax(280px, 1fr) minmax(340px, 1.15fr) minmax(344px, 1fr); }
  .pane, .app[data-pane] .pane { display: flex; }
  .pane + .pane { border-left: 1px solid var(--line); }
  .pane-head { padding: var(--sp-2) var(--sp-5) 0; }
  .pane[data-pane="queue"] .pane-head { padding-right: var(--sp-4); }
  .pane-body { padding: var(--sp-1) var(--sp-3) var(--sp-5); }
  .pane[data-pane="work"] .pane-body { padding: var(--sp-1) var(--sp-4) var(--sp-4); }
  .work-wrap { flex: none; }
  .pane[data-pane="work"] .pane-body { overflow-y: auto; overflow-x: hidden; }
  .kb-wrap { flex: 1 0 220px; min-height: 0; display: flex; flex-direction: column; }
  .kb-list { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
  .tabbar { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.01ms !important; transition-delay: 0ms !important; animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; }
  .spinner { animation: none; border-top-color: var(--accent); border-right-color: var(--accent); }
}

/* 첫 화면 */
.home { min-height: 100%; padding: calc(var(--safe-top) + var(--sp-6)) var(--sp-5) calc(var(--safe-bottom) + var(--sp-8)); }
.home-inner { max-width: 1120px; margin: 0 auto; }
.home-top { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); min-height: 40px; }
.home-top b { font-size: 15px; font-weight: 650; letter-spacing: -0.01em; }
.home h1 { margin-top: var(--sp-8); font-size: 34px; font-weight: 700; line-height: 1.2; letter-spacing: -0.03em; }
.home-cards { display: grid; grid-template-columns: 1fr; gap: var(--sp-4); margin-top: var(--sp-8); }
.hcard {
  display: flex;
  flex-direction: column;
  min-height: 320px;
  padding: var(--sp-6);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  background: var(--bg);
  transition: border-color var(--dur-2) ease, transform 160ms var(--ease-out);
}
.hcard:active { transform: scale(0.99); }
@media (hover: hover) { .hcard:hover { border-color: var(--line-2); } .hcard:hover .go svg { transform: translateX(3px); } }
.hcard .art { flex: 1; display: flex; align-items: center; justify-content: center; padding: var(--sp-4) 0 var(--sp-6); }
.hcard .art svg { width: 100%; max-width: 360px; height: auto; }
.hcard h2 { font-size: 26px; font-weight: 700; line-height: 1.25; letter-spacing: -0.025em; }
.hcard .row-meta { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); margin-top: var(--sp-3); }
.hcard .go { display: inline-flex; align-items: center; gap: 4px; color: var(--accent-ink); font-size: 15px; font-weight: 600; }
.hcard .go svg { width: 16px; height: 16px; transition: transform var(--dur-2) var(--ease-out); }
@media (min-width: 760px) {
  .home { padding-left: var(--sp-8); padding-right: var(--sp-8); }
  .home h1 { font-size: 48px; margin-top: 56px; }
  .home-cards { grid-template-columns: 1fr 1fr; gap: var(--sp-6); }
  .hcard { min-height: 480px; padding: var(--sp-8); }
  .hcard h2 { font-size: 30px; }
}
