:root {
  --bg: #fafaf9;
  --surface: #ffffff;
  --surface-2: #f5f5f4;
  --border: #e7e5e4;
  --text: #1c1917;
  --muted: #78716c;
  --accent: #c2410c;
  --accent-soft: #ffedd5;
  --claude: #7c3aed;
  --claude-soft: #f3e8ff;
  --ok: #15803d;
  --ok-soft: #dcfce7;
  --warn: #a16207;
  --warn-soft: #fef9c3;
  --bad: #b91c1c;
  --bad-soft: #fee2e2;
  --sidebar: #1c1917;
  --sidebar-text: #e7e5e4;
  --sidebar-muted: #a8a29e;
  --radius: 10px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0c0a09;
    --surface: #1c1917;
    --surface-2: #292524;
    --border: #3a3532;
    --text: #f5f5f4;
    --muted: #a8a29e;
    --accent: #fb923c;
    --accent-soft: #431407;
    --claude: #c4b5fd;
    --claude-soft: #2e1065;
    --ok: #4ade80;
    --ok-soft: #052e16;
    --warn: #facc15;
    --warn-soft: #422006;
    --bad: #f87171;
    --bad-soft: #450a0a;
    --sidebar: #0c0a09;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg); color: var(--text);
  font: 15px/1.55 -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Pretendard", "Noto Sans KR", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; }

.app { display: flex; height: 100dvh; }
.sidebar {
  width: 232px; flex-shrink: 0; background: var(--sidebar); color: var(--sidebar-text);
  display: flex; flex-direction: column; padding: 16px 10px; overflow-y: auto;
}
.brand img { border-radius: 8px; object-fit: contain; flex-shrink: 0; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 17px; padding: 4px 8px 16px; color: inherit; text-decoration: none; border-radius: 8px; }
.brand:hover { opacity: .85; }
.nav { display: flex; flex-direction: column; gap: 1px; flex: 1; }
.nav a {
  display: flex; align-items: center; justify-content: space-between;
  padding: 7px 10px; border-radius: 7px; text-decoration: none; color: var(--sidebar-text);
}
.nav a:hover { background: rgba(255,255,255,.07); }
.nav a.active { background: rgba(255,255,255,.13); font-weight: 600; }
.nav-label {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 12px; color: var(--sidebar-muted); padding: 14px 10px 4px; letter-spacing: .02em;
}
.nav-label .icon-btn { color: var(--sidebar-muted); }
.count { font-size: 12px; color: var(--sidebar-muted); }
.count.hot { background: var(--accent); color: #fff; border-radius: 99px; padding: 0 7px; }
.me {
  margin-top: 12px; text-align: left; background: rgba(255,255,255,.06); border: 0; border-radius: 8px;
  padding: 9px 10px; color: var(--sidebar-text); cursor: pointer; font-size: 14px;
}
.icon-btn { background: none; border: 0; cursor: pointer; font-size: 16px; padding: 2px 6px; border-radius: 6px; line-height: 1; }
.icon-btn:hover { background: rgba(127,127,127,.15); }

.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.topbar {
  display: flex; align-items: center; gap: 10px; padding: 12px 20px;
  border-bottom: 1px solid var(--border); background: var(--surface);
}
.topbar h1 { font-size: 17px; margin: 0; flex: 1; }
.menu-btn { display: none; }
.live { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.live.on { background: var(--ok); }
#view { flex: 1; overflow-y: auto; padding: 20px; }
#view.chat-view { padding: 0; display: flex; flex-direction: column; overflow: hidden; }

/* 공통 */
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.toolbar .grow { flex: 1; min-width: 160px; }
.btn {
  border: 1px solid var(--border); background: var(--surface); border-radius: 8px;
  padding: 7px 14px; cursor: pointer; white-space: nowrap;
}
.btn:hover { background: var(--surface-2); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
.btn.primary:hover { filter: brightness(1.08); }
.btn.danger { color: var(--bad); }
input[type=text], input[type=search], input[type=number], input[type=date], select, textarea {
  border: 1px solid var(--border); background: var(--surface); border-radius: 8px; padding: 7px 10px; width: 100%;
}
textarea { resize: vertical; min-height: 80px; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: transparent; }
.empty { color: var(--muted); text-align: center; padding: 40px 16px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.pill {
  display: inline-block; font-size: 12px; font-weight: 600; padding: 1px 9px; border-radius: 99px;
  background: var(--surface-2); color: var(--muted); white-space: nowrap;
}
.pill.accent { background: var(--accent-soft); color: var(--accent); }
.pill.claude { background: var(--claude-soft); color: var(--claude); }
.pill.ok { background: var(--ok-soft); color: var(--ok); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.bad { background: var(--bad-soft); color: var(--bad); }
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px;
}
.list { display: flex; flex-direction: column; gap: 10px; }
.card-head { display: flex; align-items: flex-start; gap: 10px; justify-content: space-between; }
.card-title { font-weight: 600; margin: 0; word-break: break-word; }
.card-body { white-space: pre-wrap; word-break: break-word; margin-top: 6px; }
.card-meta { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; margin-top: 10px; font-size: 13px; color: var(--muted); }
.card-meta select { width: auto; padding: 3px 8px; font-size: 13px; }
.result {
  margin-top: 10px; padding: 10px 12px; border-radius: 8px; background: var(--claude-soft);
  white-space: pre-wrap; word-break: break-word; font-size: 14px;
}
.tag { font-size: 12px; color: var(--accent); }

/* 대시보드 */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 20px; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; text-decoration: none; }
.stat:hover { border-color: var(--accent); }
.stat .label { font-size: 13px; color: var(--muted); }
.stat .value { font-size: 28px; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.2; margin-top: 2px; }
.pipeline { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin-bottom: 20px; }
.stage { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 12px; }
.stage .label { font-size: 13px; color: var(--muted); }
.stage .value { font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; }
.panel h2 { font-size: 15px; margin: 0 0 10px; display: flex; justify-content: space-between; align-items: baseline; }
.panel h2 a { font-size: 13px; font-weight: 400; color: var(--muted); }
.row { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--border); }
.row:last-child { border-bottom: 0; }
.row .grow { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* 채팅 */
.messages { flex: 1; overflow-y: auto; padding: 16px 20px; display: flex; flex-direction: column; gap: 2px; }
.msg { display: flex; gap: 10px; padding: 6px 0; }
.msg.cont { padding-top: 0; }
.msg.cont .avatar { visibility: hidden; height: 0; }
.avatar {
  width: 34px; height: 34px; border-radius: 9px; flex-shrink: 0; display: grid; place-items: center;
  font-weight: 700; font-size: 14px; color: #fff; background: var(--accent);
}
.msg.claude .avatar { background: var(--claude); }
.msg.agent .avatar { background: none; overflow: hidden; }
.msg.agent .avatar img, .typing img { width: 100%; height: 100%; display: block; }
.msg.agent .msg-author { color: var(--accent); }
.typing { display: flex; align-items: center; gap: 8px; padding: 6px 20px; font-size: 13px; color: var(--muted); }
.typing[hidden] { display: none; }
.typing img { width: 20px; height: 20px; border-radius: 5px; animation: bob 1s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(-3px) rotate(-6deg); } }
.msg-main { min-width: 0; flex: 1; }
.msg-head { display: flex; gap: 8px; align-items: baseline; }
.msg-author { font-weight: 700; font-size: 14px; }
.msg.claude .msg-author { color: var(--claude); }
.msg-time { font-size: 12px; color: var(--muted); }
.msg-body { white-space: pre-wrap; word-break: break-word; }
.msg-body .mention { background: var(--accent-soft); color: var(--accent); border-radius: 4px; padding: 0 3px; font-weight: 600; }
.msg-body a { color: var(--accent); }
.day { text-align: center; font-size: 12px; color: var(--muted); margin: 14px 0 6px; }
.composer { border-top: 1px solid var(--border); padding: 12px 20px calc(12px + env(safe-area-inset-bottom)); background: var(--surface); }
.composer form { display: flex; gap: 8px; align-items: flex-end; }
.composer textarea { min-height: 42px; max-height: 200px; resize: none; }
.composer .hint { font-size: 12px; color: var(--muted); margin-top: 6px; }

/* 파일 */
.file { display: flex; flex-direction: column; gap: 8px; }
.file audio { width: 100%; height: 36px; }

/* 다이얼로그 */
dialog {
  border: 1px solid var(--border); border-radius: 14px; padding: 0; width: min(520px, calc(100vw - 32px));
  background: var(--surface); color: var(--text); box-shadow: 0 20px 50px rgba(0,0,0,.25);
}
dialog::backdrop { background: rgba(0,0,0,.4); }
dialog form { padding: 20px; display: flex; flex-direction: column; gap: 12px; }
dialog h3 { margin: 0 0 4px; font-size: 17px; }
dialog label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); }
dialog .actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 4px; }
dialog .actions .spacer { flex: 1; }
.toast {
  position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); z-index: 50;
  background: var(--text); color: var(--bg); padding: 9px 16px; border-radius: 9px; font-size: 14px;
}

/* 모바일 */
.scrim { display: none; }
@media (max-width: 760px) {
  .sidebar { position: fixed; inset: 0 auto 0 0; z-index: 30; transform: translateX(-100%); transition: transform .2s; width: 260px; }
  .sidebar.open { transform: none; }
  .scrim.open { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 20; }
  .menu-btn { display: block; }
  .topbar { padding: 10px 16px; }
  #view { padding: 16px; }
  .messages { padding: 12px 16px; }
  .composer { padding-left: 16px; padding-right: 16px; }
  .pipeline { grid-template-columns: repeat(3, 1fr); }
}

.worker { color: var(--muted); }
.worker.on { color: var(--claude); font-weight: 600; }
.btn:disabled { opacity: .5; cursor: default; }

/* @ 멘션 메뉴 */
.composer form { position: relative; }
.mention-menu {
  position: absolute; left: 0; right: 0; bottom: calc(100% + 8px); z-index: 10; max-width: 420px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 4px;
  box-shadow: 0 10px 30px rgba(0,0,0,.15); max-height: 260px; overflow-y: auto;
}
.mention-menu[hidden] { display: none; }
.mention-item { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 7px; cursor: pointer; }
.mention-item.active { background: var(--accent-soft); }
.mention-item .muted { margin-left: auto; text-align: right; }
.mention-icon {
  width: 24px; height: 24px; border-radius: 6px; display: grid; place-items: center; flex-shrink: 0;
  background: var(--claude); color: #fff; font-size: 13px; font-weight: 700; overflow: hidden;
}
.mention-icon img { width: 100%; height: 100%; }
.mention-item.person .mention-icon { background: var(--accent); }
.mention-icon.img { background: none; }
.mention-icon img { display: block; }

/* ── 대시보드 ── */
:root { --s0: #fed7aa; --s1: #fdba74; --s2: #fb923c; --s3: #ea580c; --s4: #9a3412; }
.dash { display: block; max-width: 1440px; margin: 0 auto; }
.dash-main, .dash-side { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.dash-side { position: sticky; top: 0; }
.hero {
  display: flex; align-items: center; gap: 18px; padding: 22px 24px; border-radius: 16px; color: #fff7ed;
  background: radial-gradient(120% 140% at 0% 0%, #7c2d12 0%, #1c1917 55%), #1c1917;
  position: relative; overflow: hidden;
}
.hero::after {
  content: ''; position: absolute; right: -40px; top: -40px; width: 200px; height: 200px; border-radius: 50%;
  background: radial-gradient(circle, rgba(250,204,21,.25), transparent 70%);
}
.hero-logo { width: 84px; height: 84px; object-fit: contain; border-radius: 18px; flex-shrink: 0; box-shadow: 0 8px 24px rgba(0,0,0,.35); transform: rotate(-4deg); background: #fefbf0; }
.hero-text { flex: 1; min-width: 0; position: relative; z-index: 1; }
.hero-hello { font-size: 13px; color: #fdba74; }
.hero-title { font-size: 20px; margin: 2px 0 6px; line-height: 1.35; word-break: keep-all; }
.hero-sub { font-size: 13px; color: #d6d3d1; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.hero-sub a { color: #fdba74; }
.hero-dday { position: relative; z-index: 1; text-align: center; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.14); border-radius: 14px; padding: 10px 16px; }
.hero-dday span { display: block; font-size: 26px; font-weight: 800; color: #facc15; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.hero-dday small { font-size: 12px; color: #d6d3d1; }

.tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.tile {
  display: flex; gap: 12px; align-items: flex-start; padding: 16px; border-radius: 14px; text-decoration: none;
  background: var(--surface); border: 1px solid var(--border); transition: transform .15s, border-color .15s, box-shadow .15s;
}
.tile:hover { transform: translateY(-2px); border-color: var(--accent); box-shadow: 0 6px 18px rgba(0,0,0,.06); }
.tile-icon { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; font-size: 19px; background: var(--accent-soft); flex-shrink: 0; }
.tile-icon.claude { background: var(--claude-soft); color: var(--claude); font-weight: 700; }
.tile-value { font-size: 26px; font-weight: 800; line-height: 1.1; font-variant-numeric: tabular-nums; }
.tile-value.small-val { font-size: 18px; padding: 4px 0 2px; }
.tile-label { font-size: 13px; font-weight: 600; margin-top: 2px; }
.tile-sub { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 5px; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); display: inline-block; }
.dot.on { background: var(--ok); box-shadow: 0 0 0 3px var(--ok-soft); }

.card { border-radius: 14px; }
.panel-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 10px; }
.panel-head h2 { font-size: 15px; margin: 0; }
.panel-head a { font-size: 13px; color: var(--muted); text-decoration: none; }
.panel-head a:hover { color: var(--accent); }

.pipe-bar { display: flex; gap: 2px; height: 14px; margin: 4px 0 14px; }
.pipe-seg { border-radius: 4px; min-width: 8px; }
.s0 { background: var(--s0); } .s1 { background: var(--s1); } .s2 { background: var(--s2); } .s3 { background: var(--s3); } .s4 { background: var(--s4); }
.pipe-steps { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.pipe-step { display: grid; grid-template-columns: auto 1fr auto; align-items: center; column-gap: 7px; padding: 8px 10px; border-radius: 10px; background: var(--surface-2); text-decoration: none; }
.pipe-step:hover { outline: 1px solid var(--accent); }
.pipe-swatch { width: 10px; height: 10px; border-radius: 3px; }
.pipe-name { font-size: 13px; font-weight: 600; }
.pipe-num { font-size: 18px; font-weight: 800; font-variant-numeric: tabular-nums; }
.pipe-hint { grid-column: 1 / -1; font-size: 11px; color: var(--muted); }

.dash-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.dash-grid > * { min-width: 0; }
.ep-row, .req-row, .feed-row { display: flex; align-items: center; gap: 12px; padding: 9px 6px; border-radius: 9px; text-decoration: none; }
.ep-row:hover, .req-row:hover, .feed-row:hover { background: var(--surface-2); }
.ep-row .grow, .req-row .grow, .feed-row .grow { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.ep-num { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; font-weight: 800; background: var(--accent-soft); color: var(--accent); flex-shrink: 0; }
.dday-chip { font-size: 12px; font-weight: 700; color: var(--accent); font-variant-numeric: tabular-nums; min-width: 44px; text-align: right; }
.req-type { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; flex-shrink: 0; background: var(--claude-soft); color: var(--claude); font-weight: 700; }
.req-type.edit { background: var(--accent-soft); color: var(--accent); }
.clamp { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.idea-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.idea-chip { display: flex; flex-direction: column; padding: 8px 12px; border-radius: 12px; background: var(--surface-2); text-decoration: none; max-width: 100%; border: 1px solid transparent; }
.idea-chip:hover { border-color: var(--accent); }
.idea-chip.fresh { background: var(--accent-soft); }
.idea-chip b { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.idea-chip span { font-size: 11px; color: var(--muted); }
.feed-av { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; flex-shrink: 0; background: var(--accent); color: #fff; font-size: 13px; font-weight: 700; overflow: hidden; }
.feed-av.claude { background: var(--claude); }
.feed-av.agent { background: none; }
.feed-av img { width: 100%; height: 100%; }

@media (max-width: 1000px) { .tiles { grid-template-columns: repeat(2, 1fr); } .dash-grid { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 760px) {
  .hero { padding: 18px; gap: 14px; flex-wrap: wrap; }
  .hero-logo { width: 48px; height: 48px; }
  .hero-title { font-size: 17px; }
  .hero-dday { width: 100%; display: flex; align-items: baseline; justify-content: center; gap: 8px; padding: 8px; }
  .pipe-steps { grid-template-columns: repeat(3, 1fr); }
  .tile { padding: 12px; }
}
.file video { width: 100%; max-height: 360px; border-radius: 8px; background: #000; }

/* AI 사용량 */
.usage-agent { padding: 10px 0 12px; border-bottom: 1px solid var(--border); }
.usage-agent:last-of-type { border-bottom: 0; }
.usage-name { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.usage-name .muted { margin-left: auto; }
.usage-av { width: 24px; height: 24px; border-radius: 7px; display: grid; place-items: center; overflow: hidden; font-size: 13px; font-weight: 700; }
.usage-av img { width: 100%; height: 100%; }
.usage-av.claude { background: var(--claude-soft); color: var(--claude); }
.usage-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.usage-stats > div { background: var(--surface-2); border-radius: 10px; padding: 8px 10px; display: flex; flex-direction: column; }
.u-label { font-size: 11px; color: var(--muted); }
.u-val { font-size: 22px; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1.2; }
.u-val small { font-size: 12px; font-weight: 600; margin-left: 2px; color: var(--muted); }
.u-sub { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.ubars { display: flex; align-items: flex-end; gap: 2px; height: 34px; margin-top: 10px; border-bottom: 1px solid var(--border); }
.ubar { flex: 1; background: var(--accent); border-radius: 3px 3px 0 0; min-width: 2px; opacity: .85; }
.ubar:hover { opacity: 1; }
.usage-agent:nth-of-type(2) .ubar { background: var(--claude); }
.usage-note { margin: 6px 0 0; }

/* 업무 가이드 */
.guide { margin-top: 8px; }
.guide-toggle { background: none; border: 0; padding: 2px 0; font-size: 12px; font-weight: 600; color: var(--muted); cursor: pointer; }
.guide-toggle:hover { color: var(--text); }
.guide .chev { display: inline-block; transition: transform .15s; }
.guide.collapsed .chev { transform: rotate(-90deg); }
.guide.collapsed .guide-body { display: none; }
.guide-body { display: flex; flex-direction: column; gap: 6px; margin-top: 6px; }
.guide-row { display: flex; align-items: flex-start; gap: 10px; }
.guide-who { display: flex; align-items: center; gap: 6px; flex-shrink: 0; width: 170px; font-size: 13px; padding-top: 3px; }
.guide-who img, .g-claude { width: 20px; height: 20px; border-radius: 6px; display: grid; place-items: center; font-size: 11px; }
.g-claude { background: var(--claude); color: #fff; }
.guide-who small { font-size: 11px; color: var(--muted); }
.guide-row.judy b { color: var(--accent); }
.guide-row.claude b { color: var(--claude); }
.guide-chips { display: flex; flex-wrap: wrap; gap: 5px; }
.guide-chip {
  border: 1px solid var(--border); background: var(--surface-2); border-radius: 99px; padding: 3px 10px;
  font-size: 12px; cursor: pointer; white-space: nowrap;
}
.guide-row.judy .guide-chip:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.guide-row.claude .guide-chip:hover { border-color: var(--claude); color: var(--claude); background: var(--claude-soft); }
.guide-foot { font-size: 11px; color: var(--muted); }
/* 모바일: 가이드는 가로로 넘기는 한 줄 (제목·안내 숨김, 접힘 상태 무시) */
@media (max-width: 760px) {
  .guide { margin-top: 6px; }
  .guide-toggle, .guide-foot { display: none; }
  .guide.collapsed .guide-body, .guide-body { display: flex; }
  .guide-body { flex-direction: row; flex-wrap: nowrap; gap: 10px; margin: 0; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  .guide-body::-webkit-scrollbar { display: none; }
  .guide-row { flex-shrink: 0; align-items: center; gap: 5px; }
  .guide-who { width: auto; padding: 0; gap: 4px; font-size: 12px; }
  .guide-who small { display: none; }
  .guide-chips { flex-wrap: nowrap; gap: 4px; }
  .guide-chip { font-size: 11px; padding: 2px 8px; }
}

/* 최근 스레드 */
.threads { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 8px; }
.thread { display: flex; flex-direction: column; gap: 6px; padding: 10px 12px; border-radius: 10px; background: var(--surface-2); text-decoration: none; min-width: 0; border: 1px solid transparent; }
.thread:hover { border-color: var(--accent); }
.thread-name { font-weight: 700; font-size: 14px; display: flex; align-items: center; gap: 6px; }
.thread-count { font-size: 11px; font-weight: 700; color: var(--accent); background: var(--accent-soft); border-radius: 99px; padding: 0 7px; }
.thread-last { display: flex; align-items: center; gap: 8px; min-width: 0; font-size: 13px; }
.thread-last .feed-av { width: 22px; height: 22px; border-radius: 6px; font-size: 11px; }
.thread-last .clamp { min-width: 0; }

/* 왼쪽 바: 남은 사용량 */
.limits { margin-top: 12px; padding: 10px; border-radius: 10px; background: rgba(255,255,255,.05); display: flex; flex-direction: column; gap: 10px; }
.limits:empty { display: none; }
.limits-title { font-size: 11px; color: var(--sidebar-muted); letter-spacing: .02em; }
.limit-head { display: flex; align-items: center; gap: 6px; font-size: 13px; margin-bottom: 4px; }
.limit-head img, .limit-head .g-claude { width: 18px; height: 18px; border-radius: 5px; font-size: 10px; }
.limit-head span:last-child { margin-left: auto; font-size: 11px; color: var(--sidebar-muted); }
.limit-win { display: grid; grid-template-columns: 38px 1fr 34px; align-items: center; gap: 6px; font-size: 11px; color: var(--sidebar-muted); margin-top: 3px; cursor: default; }
.limit-track { height: 6px; border-radius: 99px; background: rgba(255,255,255,.12); overflow: hidden; }
.limit-fill { display: block; height: 100%; border-radius: 99px; background: #4ade80; }
.limit-fill.mid { background: #facc15; }
.limit-fill.low { background: #f87171; }
.limit-pct { text-align: right; color: var(--sidebar-text); font-weight: 700; font-variant-numeric: tabular-nums; }
.limit-none { font-size: 11px; color: var(--sidebar-muted); }

/* 파일 업로드 */
.dropzone {
  border: 2px dashed var(--border); border-radius: 14px; padding: 22px; text-align: center; background: var(--surface);
  display: flex; flex-direction: column; align-items: center; gap: 10px; transition: border-color .15s, background .15s;
}
.dropzone.over { border-color: var(--accent); background: var(--accent-soft); }
.drop-icon { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); font-size: 20px; font-weight: 800; }
.dropzone label.btn { margin-left: 6px; display: inline-block; }
.drop-opts { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; justify-content: center; }
.drop-opts select { width: auto; }
.up-list { width: 100%; max-width: 640px; display: flex; flex-direction: column; gap: 6px; }
.up-list:empty { display: none; }
.up-row { display: grid; grid-template-columns: minmax(0, 1fr) 140px 150px; gap: 10px; align-items: center; text-align: left; font-size: 13px; }
.up-track { height: 6px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.up-track span { display: block; height: 100%; background: var(--accent); border-radius: 99px; transition: width .2s; }
.up-row.done .up-track span { background: var(--ok); }
.up-row.fail { color: var(--bad); }
.chip-btn { border-radius: 99px; padding: 4px 12px; font-size: 13px; }
.chip-btn.on { background: var(--text); color: var(--bg); border-color: var(--text); }
.file-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.file-grid .file { min-width: 0; }
.file-img { width: 100%; max-height: 200px; object-fit: cover; border-radius: 8px; display: block; }
.file video { max-height: 200px; }
@media (max-width: 760px) { .up-row { grid-template-columns: 1fr; gap: 3px; } }

/* 에피소드 보드 (칸반) */
.seg { display: inline-flex; background: var(--surface-2); border-radius: 9px; padding: 3px; }
.seg button { border: 0; background: none; padding: 5px 12px; border-radius: 7px; font-size: 13px; cursor: pointer; color: var(--muted); }
.seg button.on { background: var(--surface); color: var(--text); font-weight: 600; box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.board { display: grid; grid-template-columns: repeat(5, minmax(220px, 1fr)); gap: 12px; align-items: start; overflow-x: auto; padding-bottom: 8px; }
.col { background: var(--surface-2); border-radius: 14px; padding: 10px; min-height: 160px; border: 2px solid transparent; transition: border-color .15s, background .15s; }
.col.over { border-color: var(--accent); background: var(--accent-soft); }
.col-head { display: flex; align-items: center; gap: 7px; padding: 2px 4px 10px; font-size: 14px; }
.col-dot { width: 10px; height: 10px; border-radius: 3px; flex-shrink: 0; }
.col-count { font-size: 12px; font-weight: 700; color: var(--muted); background: var(--surface); border-radius: 99px; padding: 0 8px; }
.col-head .icon-btn { margin-left: auto; color: var(--muted); font-size: 18px; }
.col-body { display: flex; flex-direction: column; gap: 8px; min-height: 60px; }
.col-empty { border: 1.5px dashed var(--border); border-radius: 10px; padding: 18px 8px; text-align: center; font-size: 12px; color: var(--muted); }
.kcard {
  background: var(--surface); border: 1px solid var(--border); border-radius: 11px; padding: 10px 12px; cursor: grab;
  box-shadow: 0 1px 2px rgba(0,0,0,.04); transition: box-shadow .15s, transform .15s; position: relative;
}
.kcard:hover { box-shadow: 0 6px 16px rgba(0,0,0,.08); transform: translateY(-1px); }
.kcard:focus-visible { outline: 2px solid var(--accent); }
.kcard.dragging { opacity: .45; transform: rotate(2deg); }
.kcard-top { display: flex; align-items: center; gap: 6px; margin-bottom: 4px; min-height: 18px; }
.kcard-num { font-size: 11px; font-weight: 800; color: var(--accent); background: var(--accent-soft); border-radius: 6px; padding: 1px 7px; }
.kcard-dday { margin-left: auto; font-size: 11px; font-weight: 800; color: var(--muted); font-variant-numeric: tabular-nums; }
.kcard-dday.soon { color: var(--accent); }
.kcard-dday.late { color: var(--bad); }
.kcard-title { font-size: 14px; margin: 0; line-height: 1.4; word-break: keep-all; }
.kcard-notes { font-size: 12px; color: var(--muted); margin: 5px 0 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; white-space: pre-line; }
.kcard-meta { display: flex; flex-wrap: wrap; gap: 4px 10px; margin-top: 8px; font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.kcard-move { position: absolute; right: 6px; bottom: 6px; display: none; gap: 2px; }
.kcard:hover .kcard-move, .kcard:focus-within .kcard-move { display: flex; }
.kcard-move .icon-btn { font-size: 10px; padding: 3px 5px; color: var(--muted); }
.kcard-move .icon-btn:disabled { opacity: .25; cursor: default; }
.col.s-col4 .kcard { opacity: .75; }
@media (hover: none) { .kcard-move { display: flex; } }
@media (max-width: 760px) {
  .board { grid-template-columns: repeat(5, 78vw); scroll-snap-type: x mandatory; }
  .col { scroll-snap-align: start; }
}

/* 아이디어 보드 */
.board-hint { margin: -6px 0 12px; }
.idea-col.ic2 { background: color-mix(in srgb, var(--ok-soft) 55%, var(--surface-2)); }
.idea-col.ic3 .kcard, .idea-col.ic4 .kcard { opacity: .75; }
.kcard.idea .kcard-title { font-size: 14px; }
.kcard-tags { display: flex; flex-wrap: wrap; gap: 2px 8px; margin-top: 6px; }
.kcard-link { margin-top: 6px; font-size: 12px; font-weight: 600; color: var(--accent); }
.promote-btn { width: 100%; margin-top: 10px; padding: 6px 10px; font-size: 13px; }

/* 로그인 전 화면 · 멤버 관리 */
.gate { min-height: 100dvh; display: grid; place-items: center; padding: 16px; background: radial-gradient(120% 120% at 0% 0%, #7c2d12 0%, #1c1917 60%); }
.gate-card { width: min(380px, 100%); background: var(--surface); color: var(--text); border-radius: 18px; padding: 28px 24px; text-align: center; box-shadow: 0 20px 60px rgba(0,0,0,.4); }
.gate-card h1 { margin: 10px 0 0; font-size: 22px; }
.gate-card p { margin: 6px 0; }
.gate-card form { text-align: left; margin-top: 16px; }
.gate-card label { display: flex; flex-direction: column; gap: 4px; }
.gate-logo { width: 150px; height: 150px; object-fit: contain; border-radius: 22px; }
.gate-err { color: var(--bad); font-weight: 600; }
.members { display: flex; flex-direction: column; gap: 6px; }
.member { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 9px; background: var(--surface-2); }
.member .grow { flex: 1; min-width: 0; }
.invite-link { display: flex; gap: 8px; margin-top: 4px; }
.invite-link input { font-size: 12px; font-family: ui-monospace, monospace; }

.pair-code { font-size: 34px; font-weight: 800; letter-spacing: .18em; font-variant-numeric: tabular-nums; margin: 14px 0 6px; padding: 12px; border-radius: 12px; background: var(--accent-soft); color: var(--accent); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }

/* 스레드 */
#view.chat-view { flex-direction: row; }
.chat-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.msg { position: relative; border-radius: 8px; margin: 0 -8px; padding-left: 8px; padding-right: 8px; }
.msg:hover { background: var(--surface-2); }
.msg.threaded { background: var(--accent-soft); }
.msg-actions { position: absolute; right: 8px; top: -10px; display: none; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; box-shadow: 0 2px 8px rgba(0,0,0,.08); }
.msg:hover .msg-actions { display: flex; }
@media (hover: none) { .msg-actions { display: flex; position: static; background: none; border: 0; box-shadow: none; align-self: flex-start; } }
.thread-summary { display: inline-flex; align-items: center; gap: 8px; margin-top: 4px; padding: 3px 8px 3px 4px; border: 1px solid transparent; border-radius: 8px; background: none; cursor: pointer; font-size: 13px; color: var(--accent); }
.thread-summary:hover { background: var(--surface); border-color: var(--border); }
.thread-summary .muted { font-size: 12px; }
.ts-avs { display: inline-flex; }
.ts-av { width: 20px; height: 20px; border-radius: 6px; display: grid; place-items: center; font-size: 10px; font-weight: 700; color: #fff; background: var(--accent); margin-right: -4px; border: 2px solid var(--bg); }
.thread-panel { width: 400px; flex-shrink: 0; border-left: 1px solid var(--border); background: var(--surface); display: flex; flex-direction: column; min-height: 0; }
.thread-panel[hidden] { display: none; }
.thread-head { display: flex; align-items: center; gap: 8px; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.thread-head .icon-btn { margin-left: auto; }
.thread-body { flex: 1; overflow-y: auto; padding: 12px 16px; display: flex; flex-direction: column; gap: 2px; }
.thread-parent .msg { padding-bottom: 6px; }
.thread-divider { display: flex; align-items: center; gap: 8px; margin: 8px 0; font-size: 12px; color: var(--muted); }
.thread-divider::after { content: ''; flex: 1; height: 1px; background: var(--border); }
.thread-composer { display: flex; gap: 8px; align-items: flex-end; padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); border-top: 1px solid var(--border); }
.thread-composer textarea { min-height: 42px; max-height: 160px; resize: none; }
.thread-body .typing { padding: 6px 0; }
@media (max-width: 1100px) { .thread-panel { width: 340px; } }
@media (max-width: 760px) {
  .thread-panel { position: fixed; inset: 0; width: auto; z-index: 25; border-left: 0; }
}
.tile-sub.stage-sub { display: block; line-height: 1.4; }

.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin: 26px 0 10px; }
.section-head h2 { font-size: 15px; margin: 0; }
.req-card.done { opacity: .8; }
.req-card.done .card-body { color: var(--muted); }

/* 활동 기록 · 휴지통 */
.activity { padding: 6px 14px; }
.act-day { font-size: 12px; font-weight: 700; color: var(--muted); margin: 12px 0 4px; }
.act-row { display: flex; align-items: baseline; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--border); font-size: 14px; }
.act-row:last-child { border-bottom: 0; }
.act-row .grow { flex: 1; min-width: 0; }
.act-icon { width: 22px; text-align: center; flex-shrink: 0; }
.act-title { font-weight: 600; }
.trash-row { display: flex; align-items: center; gap: 12px; }
.trash-row .grow { flex: 1; min-width: 0; }

/* 하단 ⚙️ 관리 메뉴 */
.admin { margin-top: 10px; border-top: 1px solid rgba(255,255,255,.08); padding-top: 8px; }
.admin .nav-label { padding-top: 4px; }
.admin-links { display: flex; flex-direction: column; gap: 1px; }

/* 정리 구분선 */
.marker { display: flex; align-items: center; gap: 10px; margin: 14px 0; font-size: 12px; font-weight: 600; color: var(--accent); }
.marker::before, .marker::after { content: ''; flex: 1; height: 1px; background: var(--accent); opacity: .35; }
.marker span { white-space: nowrap; }
.marker .icon-btn { font-size: 11px; color: var(--muted); padding: 0 4px; }
.msg.flash { animation: flash 1.6s ease; }
@keyframes flash { 0%, 40% { background: var(--accent-soft); } }

/* #세팅: 오른쪽 확정 리스트 */
.settings-tabs { display: none; }
.settings-panel { width: 360px; flex-shrink: 0; border-left: 1px solid var(--border); background: var(--surface); display: flex; flex-direction: column; min-height: 0; }
#view.thread-open .settings-panel { display: none; }
.sp-head { display: flex; align-items: center; gap: 8px; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.sp-head .count { color: var(--accent); font-weight: 700; }
.sp-head .btn { margin-left: auto; padding: 4px 10px; font-size: 13px; }
.sp-body { flex: 1; overflow-y: auto; padding: 12px 14px; display: flex; flex-direction: column; gap: 14px; }
.sp-label { font-size: 12px; font-weight: 700; color: var(--muted); margin-bottom: 6px; }
.scard, .sdone { background: var(--surface-2); border-radius: 10px; padding: 10px 12px; margin-bottom: 8px; }
.scard.hold { box-shadow: inset 3px 0 0 var(--warn); }
.scard-title { font-weight: 700; font-size: 14px; word-break: keep-all; }
.scard-detail { font-size: 13px; color: var(--muted); margin-top: 4px; white-space: pre-wrap; word-break: break-word; }
.scard-q { font-size: 13px; margin-top: 6px; padding: 6px 8px; border-radius: 7px; background: var(--warn-soft); }
.scard-meta { display: flex; align-items: center; gap: 8px; margin-top: 8px; font-size: 12px; color: var(--muted); }
.scard-actions { margin-left: auto; display: flex; }
.scard-actions .icon-btn { font-size: 13px; }
.linkish { background: none; border: 0; padding: 0; color: var(--accent); cursor: pointer; font-size: 12px; text-decoration: underline; }
.sp-done summary { cursor: pointer; font-size: 13px; font-weight: 700; margin-bottom: 8px; }
.sp-done .sdone { opacity: .8; }
.sp-foot { padding: 10px 14px; border-top: 1px solid var(--border); font-size: 12px; color: var(--muted); }
.settings-guide .guide-body { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 0; }
.sg-hint { margin-left: 4px; }
@media (max-width: 1100px) { .settings-panel { width: 300px; } }
@media (max-width: 760px) {
  .settings-tabs { display: flex; gap: 4px; padding: 8px 16px 0; }
  .settings-tabs button { flex: 1; border: 1px solid var(--border); background: var(--surface); border-radius: 8px; padding: 6px; font-size: 13px; }
  .settings-tabs button.on { background: var(--text); color: var(--bg); border-color: var(--text); }
  .settings-panel { display: none; }
  #view.show-settings .settings-panel { display: flex; position: fixed; inset: 96px 0 0 0; width: auto; z-index: 15; border-left: 0; }
  .sg-hint { display: none; }
}
.scard-no { font-size: 11px; color: var(--muted); font-weight: 600; }
.sbtn { padding: 2px 8px; font-size: 12px; }
.scard-actions { gap: 4px; }

/* 음성 회의 */
#topbar-actions { display: flex; gap: 6px; }
.call-btn { padding: 5px 12px; font-size: 13px; }
.call-btn.live { background: var(--ok-soft); color: var(--ok); border-color: var(--ok); font-weight: 700; animation: pulse 2s infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 4px var(--ok-soft); } }
.call-widget { position: fixed; right: 16px; bottom: 16px; z-index: 40; width: 280px; background: var(--sidebar); color: var(--sidebar-text);
  border-radius: 14px; padding: 12px 14px; box-shadow: 0 12px 32px rgba(0,0,0,.35); display: flex; flex-direction: column; gap: 8px; }
.call-widget[hidden] { display: none; }
.cw-top { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.cw-time { font-variant-numeric: tabular-nums; color: var(--sidebar-muted); font-size: 13px; }
.cw-rec { margin-left: auto; color: #f87171; font-size: 12px; font-weight: 700; animation: blink 1.6s infinite; }
@keyframes blink { 50% { opacity: .4; } }
.cw-people { display: flex; flex-wrap: wrap; gap: 6px; }
.cw-p { font-size: 12px; background: rgba(255,255,255,.08); border-radius: 99px; padding: 2px 9px; }
.cw-p.me { background: rgba(251,146,60,.25); }
.cw-actions { display: flex; gap: 6px; }
.cw-actions .btn { flex: 1; padding: 6px; font-size: 13px; background: rgba(255,255,255,.08); color: var(--sidebar-text); border-color: transparent; }
.cw-actions .btn.danger { background: #b91c1c; color: #fff; }
@media (max-width: 760px) { .call-widget { left: 12px; right: 12px; width: auto; bottom: calc(12px + env(safe-area-inset-bottom)); } }

/* 음성 회의록 */
.meet-row { text-decoration: none; display: block; }
.meet-row:hover { border-color: var(--accent); }
.clamp2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; color: var(--muted); }
.meet-head { display: flex; align-items: center; gap: 10px; margin: 8px 0 4px; }
.meet-head h2 { margin: 0; font-size: 20px; }
.meet-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 14px; }
.meet-grid h3, .meet-transcript summary, .card h3 { font-size: 15px; margin: 0 0 8px; }
.meet-list { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 6px; font-size: 14px; }
.meet-transcript { margin-top: 14px; }
.meet-transcript summary { cursor: pointer; }
.meet-transcript .card-body { font-size: 13px; max-height: 480px; overflow-y: auto; }
.bad-box { background: var(--bad-soft); color: var(--bad); }
.card audio { width: 100%; margin-top: 6px; }
@media (max-width: 900px) { .meet-grid { grid-template-columns: minmax(0, 1fr); } }
.ch-del { padding: 5px 9px; font-size: 13px; }
.danger-link { color: var(--bad); }
.cf-ico { width: 18px; height: 18px; border-radius: 5px; display: grid; place-items: center; background: #f38020; color: #fff; font-size: 11px; }
.cw-relay { font-size: 11px; color: var(--sidebar-muted); }
