/* ═══════════════════════════════════════════════════════════
   보반 HQ — 화면 스타일
   ═══════════════════════════════════════════════════════════ */

:root {
  --bg: #070b14;
  --bg-2: #0b1220;
  --panel: #101a2c;
  --panel-2: #16223a;
  --panel-3: #1c2a45;
  --line: #223252;
  --line-soft: #1a2740;
  --txt: #e9eef8;
  --muted: #8a9bb8;
  --muted-2: #64748f;
  --accent: #f5a524;
  --accent-2: #ff7a45;
  --green: #3ddc97;
  --blue: #4cc9f0;
  --red: #ff5d6c;
  --violet: #b388ff;
  --radius: 14px;
  --shadow: 0 18px 50px rgba(0, 0, 0, .45);
  --sidebar-w: 286px;
  font-synthesis: none;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--txt);
  font-family: "Pretendard", "Apple SD Gothic Neo", "Malgun Gothic", -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  font-size: 15px;
  line-height: 1.5;
}

body {
  background:
    radial-gradient(1100px 600px at 8% -10%, rgba(245, 165, 36, .10), transparent 60%),
    radial-gradient(900px 500px at 110% 0%, rgba(76, 201, 240, .08), transparent 55%),
    var(--bg);
  overflow: hidden;
}

button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3, p { margin: 0; }
a { color: var(--accent); }

::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-thumb { background: #23324e; border-radius: 99px; }
::-webkit-scrollbar-track { background: transparent; }

.hidden, [hidden] { display: none !important; }

/* ───────────── 잠금 화면 ───────────── */

.lock {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  z-index: 50;
  background:
    radial-gradient(800px 500px at 50% 20%, rgba(245, 165, 36, .10), transparent 65%),
    #070b14;
}
.lock-glow {
  position: absolute;
  width: 620px; height: 620px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(245, 165, 36, .16), transparent 62%);
  filter: blur(20px);
  animation: breathe 7s ease-in-out infinite;
}
@keyframes breathe {
  0%, 100% { transform: scale(1); opacity: .75; }
  50% { transform: scale(1.08); opacity: 1; }
}
.lock-card {
  position: relative;
  width: min(380px, 100%);
  padding: 34px 28px 26px;
  border-radius: 22px;
  border: 1px solid rgba(255, 255, 255, .07);
  background: linear-gradient(180deg, rgba(22, 34, 58, .92), rgba(12, 19, 33, .96));
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, .06);
  text-align: center;
  animation: rise .5s cubic-bezier(.2, .8, .2, 1) both;
}
@keyframes rise {
  from { opacity: 0; transform: translateY(14px) scale(.985); }
  to { opacity: 1; transform: none; }
}
.crest {
  width: 38px; height: 38px;
  display: grid; place-items: center;
  border-radius: 11px;
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 700;
  font-size: 15px;
  letter-spacing: .5px;
  color: #1a1204;
  background: linear-gradient(145deg, #ffcd66, var(--accent) 55%, var(--accent-2));
  box-shadow: 0 6px 18px rgba(245, 165, 36, .35);
  flex: none;
}
.crest.big {
  width: 56px; height: 56px; margin: 0 auto 14px;
  font-size: 21px; border-radius: 16px;
}
.lock-card h1 { font-size: 22px; letter-spacing: -.3px; }
.lock-card .sub { color: var(--muted); font-size: 13.5px; margin-top: 4px; }
.pin-label {
  display: block;
  text-align: left;
  margin: 26px 0 7px 2px;
  font-size: 11.5px;
  letter-spacing: .16em;
  color: var(--muted-2);
  text-transform: uppercase;
}
#pin {
  width: 100%;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(6, 10, 18, .7);
  letter-spacing: .45em;
  text-align: center;
  font-size: 18px;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
#pin:focus { border-color: rgba(245, 165, 36, .65); box-shadow: 0 0 0 4px rgba(245, 165, 36, .12); }
#pin::placeholder { letter-spacing: .3em; color: #3c4a63; }
.lock-msg { min-height: 20px; margin-top: 12px; font-size: 13px; color: var(--red); }
.lock-msg.ok { color: var(--green); }
.lock-foot { margin-top: 22px; font-size: 11.5px; color: var(--muted-2); letter-spacing: .02em; }
.lock-card.shake { animation: shake .38s; }
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-8px); }
  40% { transform: translateX(7px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(3px); }
}

/* ───────────── 공통 버튼 ───────────── */

.primary {
  border: 0;
  border-radius: 10px;
  padding: 9px 15px;
  font-weight: 700;
  font-size: 13.5px;
  color: #1b1204;
  background: linear-gradient(140deg, #ffcf6b, var(--accent) 55%, var(--accent-2));
  box-shadow: 0 6px 18px rgba(245, 165, 36, .22);
  transition: transform .12s, filter .12s;
  white-space: nowrap;
}
.primary:hover { filter: brightness(1.06); }
.primary:active { transform: translateY(1px); }
.primary.wide { width: 100%; padding: 13px; font-size: 15px; border-radius: 12px; margin-top: 16px; }
.primary:disabled { opacity: .55; cursor: wait; }

.ghost {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, .02);
  color: var(--muted);
  border-radius: 9px;
  padding: 7px 12px;
  font-size: 12.5px;
  transition: .15s;
}
.ghost:hover { color: var(--txt); border-color: #33456a; background: rgba(255, 255, 255, .05); }
.ghost.small { padding: 5px 10px; font-size: 12px; }
.ghost.danger:hover { color: var(--red); border-color: rgba(255, 93, 108, .5); }

.icon-btn {
  border: 0;
  background: transparent;
  color: var(--muted);
  width: 34px; height: 34px;
  border-radius: 9px;
  display: inline-grid;
  place-items: center;
  font-size: 16px;
  flex: none;
  transition: .15s;
}
.icon-btn:hover { background: rgba(255, 255, 255, .06); color: var(--txt); }
.icon-btn.tiny { width: 22px; height: 22px; font-size: 12px; }

.count {
  display: inline-grid;
  place-items: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 99px;
  background: rgba(255, 255, 255, .07);
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
}

/* ───────────── 앱 골격 ───────────── */

.app {
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
  height: 100dvh;
}

.sidebar {
  display: flex;
  flex-direction: column;
  min-height: 0;
  border-right: 1px solid var(--line-soft);
  background: linear-gradient(180deg, rgba(16, 26, 44, .92), rgba(9, 14, 24, .96));
  padding: 16px 12px 12px;
  gap: 12px;
}
.side-head { display: flex; align-items: center; gap: 10px; padding: 2px 6px 6px; }
.side-title { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.side-title strong { font-size: 15px; letter-spacing: -.2px; }
.side-title span { font-size: 11px; color: var(--muted-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.only-mobile { display: none; }

.side-label {
  display: flex; align-items: center; gap: 8px;
  padding: 4px 8px;
  font-size: 11px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted-2);
}
.room-list { display: flex; flex-direction: column; gap: 3px; overflow-y: auto; flex: 1; padding: 2px; }
.room-item {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2px 8px;
  text-align: left;
  border: 1px solid transparent;
  background: transparent;
  border-radius: 11px;
  padding: 10px 11px;
  transition: .15s;
}
.room-item:hover { background: rgba(255, 255, 255, .035); }
.room-item.on {
  background: linear-gradient(100deg, rgba(245, 165, 36, .13), rgba(245, 165, 36, .03));
  border-color: rgba(245, 165, 36, .22);
}
.room-item.on::before {
  content: "";
  position: absolute;
  left: -2px; top: 12px; bottom: 12px;
  width: 3px; border-radius: 3px;
  background: linear-gradient(var(--accent), var(--accent-2));
}
.room-item .r-name { font-size: 13.5px; font-weight: 600; letter-spacing: -.1px; display: flex; align-items: center; gap: 6px; }
.room-item .r-sub { grid-column: 1 / -1; font-size: 11.5px; color: var(--muted-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.room-item .r-type {
  font-size: 10px; color: var(--muted-2);
  border: 1px solid var(--line);
  border-radius: 5px; padding: 0 5px;
  font-weight: 500; letter-spacing: .02em;
}
.room-item .unread { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 8px rgba(245, 165, 36, .7); }

.new-room {
  border: 1px dashed #2b3c5c;
  background: rgba(255, 255, 255, .015);
  color: var(--muted);
  border-radius: 11px;
  padding: 11px;
  font-size: 12.5px;
  font-weight: 600;
  transition: .15s;
}
.new-room:hover { color: var(--accent); border-color: rgba(245, 165, 36, .45); background: rgba(245, 165, 36, .05); }

.side-foot {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 8px 2px;
  border-top: 1px solid var(--line-soft);
  font-size: 12.5px;
  color: var(--muted);
}
.who { display: inline-flex; align-items: center; gap: 7px; }
.dot-live { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 8px rgba(61, 220, 151, .7); }

.main { display: flex; flex-direction: column; min-width: 0; min-height: 0; }

/* ───────────── 상단 바 ───────────── */

.topbar {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--line-soft);
  background: rgba(8, 13, 24, .72);
  backdrop-filter: blur(14px);
  z-index: 5;
  min-height: 66px;
}
.room-title { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.room-title .line1 { display: flex; align-items: center; gap: 8px; min-width: 0; }
.room-title h1 { font-size: 17px; letter-spacing: -.3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tag {
  font-size: 10.5px;
  padding: 2px 7px;
  border-radius: 6px;
  border: 1px solid rgba(76, 201, 240, .28);
  color: #9fdcf2;
  background: rgba(76, 201, 240, .08);
  white-space: nowrap;
}
.room-key {
  align-self: flex-start;
  display: inline-flex; align-items: center; gap: 6px;
  border: 0; background: transparent; padding: 0;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 11.5px;
  color: var(--muted-2);
  letter-spacing: .04em;
  transition: .15s;
}
.room-key:hover { color: var(--accent); }
.copy-ico { font-size: 11px; opacity: .7; }
.key-row { display: flex; align-items: center; gap: 8px; }
.room-settings {
  border: 1px solid var(--line-soft);
  background: transparent;
  color: var(--muted-2);
  border-radius: 6px;
  font-size: 10.5px;
  padding: 1px 6px;
  transition: .15s;
}
.room-settings:hover { color: var(--accent); border-color: rgba(245, 165, 36, .4); }

.top-actions { margin-left: auto; display: flex; align-items: center; gap: 12px; min-width: 0; }

.presence { display: flex; align-items: center; flex: none; }
.presence-m { display: none; }
.presence .av {
  width: 27px; height: 27px;
  margin-left: -7px;
  border-radius: 50%;
  display: grid; place-items: center;
  font-size: 10.5px; font-weight: 700;
  color: #0a0f1c;
  border: 2px solid #0a1220;
  background: var(--c, #f5a524);
  position: relative;
}
.presence .av:first-child { margin-left: 0; }
.presence .av.off { filter: grayscale(.85) brightness(.6); }
.presence .av.online::after {
  content: "";
  position: absolute; right: -1px; bottom: -1px;
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--green);
  border: 2px solid #0a1220;
}
.presence .more { margin-left: 6px; font-size: 11.5px; color: var(--muted-2); }
.presence .p-label { margin-right: 8px; font-size: 11.5px; color: var(--muted-2); }

/* ───────────── 탭 ───────────── */

.tabs {
  display: flex; gap: 4px;
  padding: 8px 14px 0;
  border-bottom: 1px solid var(--line-soft);
  background: rgba(8, 13, 24, .5);
}
.tabs button {
  position: relative;
  border: 0; background: transparent;
  color: var(--muted);
  padding: 8px 12px 11px;
  font-size: 13.5px;
  font-weight: 600;
  display: inline-flex; align-items: center; gap: 6px;
  border-radius: 8px 8px 0 0;
  transition: .15s;
}
.tabs button:hover { color: var(--txt); background: rgba(255, 255, 255, .03); }
.tabs button.on { color: var(--txt); }
.tabs button.on::after {
  content: "";
  position: absolute; left: 10px; right: 10px; bottom: -1px; height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  border-radius: 2px;
}

.view { flex: 1; min-height: 0; display: flex; flex-direction: column; }

/* ───────────── 대화 ───────────── */

.chat-tools {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 18px 4px;
}
.chat-tools input[type="search"] {
  flex: 1; max-width: 280px;
  border: 1px solid var(--line-soft);
  background: rgba(255, 255, 255, .025);
  border-radius: 9px;
  padding: 7px 11px;
  font-size: 12.5px;
  outline: none;
}
.chat-tools input[type="search"]:focus { border-color: #2f4368; }
.switch { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); cursor: pointer; user-select: none; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch span { display: inline-flex; align-items: center; gap: 6px; }
.switch span::before {
  content: "";
  width: 26px; height: 15px;
  border-radius: 99px;
  background: #24334d;
  border: 1px solid #2f4160;
  transition: .18s;
  flex: none;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, .4);
}
.switch input:checked + span::before {
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  border-color: transparent;
}
.switch input:focus-visible + span::before { outline: 2px solid rgba(245, 165, 36, .5); outline-offset: 2px; }
.switch input:checked + span { color: #f3d6a2; }

.pinned {
  margin: 8px 18px 0;
  padding: 9px 12px;
  border-radius: 10px;
  border: 1px solid rgba(245, 165, 36, .25);
  background: rgba(245, 165, 36, .07);
  font-size: 12.5px;
  color: #f3d6a2;
  display: flex; gap: 8px; align-items: flex-start;
}
.pinned b { color: var(--accent); font-weight: 700; }
.pinned .pin-list { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.pinned .pin-list span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.messages {
  flex: 1;
  overflow-y: auto;
  padding: 14px 18px 8px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  scroll-behavior: smooth;
}

.msg { display: flex; gap: 10px; max-width: 100%; animation: msgIn .22s ease both; }
@keyframes msgIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.msg .avatar {
  width: 34px; height: 34px; flex: none;
  border-radius: 10px;
  display: grid; place-items: center;
  font-size: 13px; font-weight: 800;
  color: #0a0f1c;
  background: var(--c, #f5a524);
  margin-top: 18px;
}
.msg .body-wrap { min-width: 0; max-width: min(680px, 82%); }
.msg .meta {
  display: flex; align-items: center; gap: 7px;
  font-size: 11.5px;
  color: var(--muted-2);
  margin: 0 2px 4px;
}
.msg .meta .name { color: #cdd8ea; font-weight: 700; font-size: 12.5px; }
.msg .meta .role { font-size: 10.5px; color: var(--muted-2); }
.msg .bubble {
  position: relative;
  padding: 9px 13px 8px;
  border-radius: 3px 13px 13px 13px;
  background: var(--panel);
  border: 1px solid var(--line-soft);
  font-size: 14px;
  line-height: 1.55;
}
.msg .bubble p { white-space: pre-wrap; word-break: break-word; }
.msg .bubble p.clamped {
  max-height: 7.2em;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(#000 62%, transparent 100%);
  mask-image: linear-gradient(#000 62%, transparent 100%);
}
.more-btn {
  border: 0; background: transparent;
  color: var(--accent);
  font-size: 12px;
  padding: 2px 0 0;
}
.more-btn:hover { text-decoration: underline; }
.msg.system { justify-content: center; }
.msg.system .bubble {
  background: rgba(255, 255, 255, .03);
  border-style: dashed;
  border-radius: 999px;
  padding: 5px 14px;
  font-size: 12px;
  color: var(--muted);
}
.msg.system .meta, .msg.system .avatar { display: none; }
.msg.admin { flex-direction: row-reverse; }
.msg.admin .body-wrap { max-width: min(680px, 78%); }
.msg.admin .meta { justify-content: flex-end; }
.msg.admin .bubble {
  border-radius: 13px 3px 13px 13px;
  background: linear-gradient(150deg, rgba(245, 165, 36, .16), rgba(255, 122, 69, .09));
  border-color: rgba(245, 165, 36, .26);
}
.msg.admin .avatar { display: none; }

.reply-quote {
  border-left: 2px solid rgba(245, 165, 36, .6);
  padding: 2px 0 2px 8px;
  margin-bottom: 6px;
  font-size: 12px;
  color: var(--muted);
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.reply-quote b { color: #d9c39a; font-weight: 600; }

.attach {
  display: flex; align-items: center; gap: 8px;
  margin-top: 7px;
  padding: 7px 10px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, .22);
  font-size: 12.5px;
  color: #9fdcf2;
  text-decoration: none;
  word-break: break-all;
}
.attach:hover { border-color: rgba(76, 201, 240, .5); }
.attach .ext { font-size: 10px; padding: 1px 5px; border-radius: 4px; background: rgba(76, 201, 240, .12); color: #9fdcf2; }

.msg-tools { display: flex; gap: 2px; margin-top: 4px; opacity: 0; transition: opacity .15s; }
.msg:hover .msg-tools, .msg:focus-within .msg-tools { opacity: 1; }
.msg.admin .msg-tools { justify-content: flex-end; }
.msg-tools button {
  border: 0; background: transparent; color: var(--muted-2);
  font-size: 11.5px; padding: 2px 6px; border-radius: 6px;
}
.msg-tools button:hover { color: var(--accent); background: rgba(245, 165, 36, .08); }
.badge-pin { font-size: 10px; color: var(--accent); }
.badge-mask {
  font-size: 10px;
  color: #ffcf6b;
  border: 1px solid rgba(245, 165, 36, .35);
  border-radius: 5px;
  padding: 0 5px;
}

.day-sep {
  align-self: center;
  font-size: 11px;
  color: var(--muted-2);
  padding: 2px 10px;
  border-radius: 99px;
  background: rgba(255, 255, 255, .04);
  margin: 2px 0;
}

.messages .empty {
  margin: auto;
  text-align: center;
  color: var(--muted-2);
  font-size: 13px;
  line-height: 1.7;
}

/* ───────────── 입력창 ───────────── */

.composer {
  border-top: 1px solid var(--line-soft);
  background: rgba(8, 13, 24, .82);
  backdrop-filter: blur(12px);
  padding: 10px 16px calc(12px + env(safe-area-inset-bottom));
  display: flex; flex-direction: column; gap: 8px;
}
.composer-row { display: flex; align-items: flex-end; gap: 8px; }
.composer textarea {
  flex: 1;
  resize: none;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, .03);
  border-radius: 12px;
  padding: 11px 13px;
  font-size: 14px;
  line-height: 1.45;
  max-height: 132px;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.composer textarea:focus { border-color: rgba(245, 165, 36, .5); box-shadow: 0 0 0 3px rgba(245, 165, 36, .09); }
.composer .send {
  border: 0;
  border-radius: 11px;
  padding: 11px 18px;
  font-weight: 700;
  font-size: 13.5px;
  color: #1b1204;
  background: linear-gradient(140deg, #ffcf6b, var(--accent) 60%, var(--accent-2));
}
.composer .send:disabled { opacity: .5; }
.reply-chip {
  display: flex; align-items: center; gap: 8px;
  font-size: 12px; color: var(--muted);
  border-left: 2px solid var(--accent);
  padding: 3px 8px;
  background: rgba(245, 165, 36, .05);
  border-radius: 0 8px 8px 0;
}
.reply-chip span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.attach-row { display: flex; gap: 8px; }
.attach-row input {
  flex: 1;
  border: 1px solid var(--line-soft);
  background: rgba(255, 255, 255, .025);
  border-radius: 9px;
  padding: 8px 11px;
  font-size: 12.5px;
  outline: none;
}
.attach-row input:focus { border-color: #2f4368; }

/* ───────────── 업무 배분 ───────────── */

.view-tasks { overflow-y: auto; padding: 16px 18px 24px; gap: 14px; }
.task-toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.task-toolbar h2 { font-size: 14px; color: var(--muted); font-weight: 600; }
.task-toolbar .grow { flex: 1; }
.task-form {
  display: grid;
  grid-template-columns: minmax(180px, 2fr) minmax(120px, 1fr) 140px auto;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  background: rgba(255, 255, 255, .02);
}
.task-form input, .task-form select, .modal input, .modal select, .modal textarea {
  border: 1px solid var(--line);
  background: rgba(6, 10, 18, .6);
  border-radius: 9px;
  padding: 9px 11px;
  font-size: 13px;
  outline: none;
  min-width: 0;
}
.task-form input:focus, .modal input:focus, .modal select:focus { border-color: rgba(245, 165, 36, .5); }
.boards { display: grid; grid-template-columns: repeat(4, minmax(210px, 1fr)); gap: 12px; align-items: start; }
.board {
  border: 1px solid var(--line-soft);
  border-radius: 13px;
  background: rgba(255, 255, 255, .018);
  padding: 10px;
  min-height: 140px;
  display: flex; flex-direction: column; gap: 8px;
}
.board-head { display: flex; align-items: center; gap: 7px; padding: 2px 4px 6px; }
.board-head .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--c, var(--muted)); }
.board-head h3 { font-size: 12.5px; font-weight: 700; letter-spacing: .01em; }
.board-head .count { margin-left: auto; }
.task-card {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(28, 42, 69, .55), rgba(16, 26, 44, .7));
  padding: 10px 11px;
  display: flex; flex-direction: column; gap: 7px;
  transition: .15s;
}
.task-card:hover { border-color: #2f4368; transform: translateY(-1px); }
.task-card .t-title { font-size: 13px; line-height: 1.4; word-break: break-word; }
.task-card .t-meta { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 11px; color: var(--muted-2); }
.chip {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 10.5px;
  border-radius: 6px;
  padding: 1px 6px;
  background: rgba(255, 255, 255, .06);
  color: #c6d2e6;
}
.chip.person::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--c, var(--accent)); }
.chip.due-soon { color: #ffcf6b; background: rgba(245, 165, 36, .12); }
.chip.due-late { color: #ff9aa4; background: rgba(255, 93, 108, .13); }
.task-card .t-actions { display: flex; gap: 4px; margin-top: 1px; }
.task-card .t-actions button {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  border-radius: 6px;
  font-size: 11px;
  padding: 2px 7px;
}
.task-card .t-actions button:hover { color: var(--txt); border-color: #33456a; }
.task-card .t-actions .del { margin-left: auto; }
.task-card .t-actions .del:hover { color: var(--red); border-color: rgba(255, 93, 108, .45); }
.board-empty { font-size: 12px; color: var(--muted-2); text-align: center; padding: 18px 6px; }

/* ───────────── 에이전트 ───────────── */

.view-agents { overflow-y: auto; padding: 16px 18px 28px; gap: 14px; }
.agents-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.agents-head h2 { font-size: 15px; }
.agents-head p { font-size: 12.5px; color: var(--muted-2); }
.agents-head .grow { flex: 1; }
.agent-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.agent-card {
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  background: linear-gradient(170deg, rgba(22, 34, 58, .62), rgba(12, 19, 33, .8));
  padding: 14px;
  display: flex; flex-direction: column; gap: 10px;
}
.agent-top { display: flex; align-items: center; gap: 10px; }
.agent-av {
  width: 38px; height: 38px; border-radius: 11px;
  display: grid; place-items: center;
  font-weight: 800; font-size: 14px; color: #0a0f1c;
  background: var(--c, var(--accent));
  flex: none;
  position: relative;
}
.agent-av.off { filter: grayscale(.8) brightness(.65); }
.agent-av .pres {
  position: absolute; right: -2px; bottom: -2px;
  width: 10px; height: 10px; border-radius: 50%;
  border: 2px solid #0d1525;
  background: var(--muted-2);
}
.agent-av .pres.on { background: var(--green); box-shadow: 0 0 8px rgba(61, 220, 151, .7); }
.agent-id { min-width: 0; flex: 1; }
.agent-id strong { display: block; font-size: 14px; letter-spacing: -.2px; }
.agent-id span { font-size: 11.5px; color: var(--muted-2); }
.state-pill {
  font-size: 10.5px; font-weight: 700;
  border-radius: 99px; padding: 2px 8px;
  border: 1px solid var(--line);
  color: var(--muted);
}
.state-pill.on { color: var(--green); border-color: rgba(61, 220, 151, .35); background: rgba(61, 220, 151, .08); }
.state-pill.revoked { color: var(--red); border-color: rgba(255, 93, 108, .35); }
.agent-rows { display: flex; flex-direction: column; gap: 5px; font-size: 11.5px; color: var(--muted-2); }
.agent-rows div { display: flex; justify-content: space-between; gap: 10px; }
.agent-rows b { color: #c6d2e6; font-weight: 600; }
.token-row {
  display: flex; align-items: center; gap: 6px;
  font-family: ui-monospace, Menlo, monospace;
  font-size: 11px;
  background: rgba(0, 0, 0, .3);
  border: 1px solid var(--line-soft);
  border-radius: 7px;
  padding: 5px 8px;
  color: var(--muted);
}
.token-row span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.agent-acts { display: flex; gap: 6px; flex-wrap: wrap; }
.agent-acts .primary { padding: 6px 10px; font-size: 12px; }

/* ───────────── 모달 ───────────── */

.modal-back {
  position: fixed; inset: 0; z-index: 40;
  background: rgba(4, 7, 13, .72);
  backdrop-filter: blur(4px);
  display: grid; place-items: center;
  padding: 18px;
  animation: fade .16s ease both;
}
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.modal {
  width: min(560px, 100%);
  max-height: min(86dvh, 760px);
  overflow-y: auto;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, .08);
  background: linear-gradient(180deg, #14203a, #0c1524);
  box-shadow: var(--shadow);
  padding: 20px;
  display: flex; flex-direction: column; gap: 14px;
  animation: rise .22s cubic-bezier(.2, .8, .2, 1) both;
}
.modal.wide { width: min(720px, 100%); }
.modal-head { display: flex; align-items: flex-start; gap: 10px; }
.modal-head h2 { font-size: 17px; letter-spacing: -.3px; }
.modal-head p { font-size: 12.5px; color: var(--muted-2); margin-top: 2px; }
.modal-head .icon-btn { margin-left: auto; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field > label { font-size: 11.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted-2); }
.type-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.type-chips button {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  border-radius: 99px;
  padding: 6px 13px;
  font-size: 12.5px;
}
.type-chips button.on {
  color: #1b1204;
  background: linear-gradient(140deg, #ffcf6b, var(--accent));
  border-color: transparent;
  font-weight: 700;
}
.agent-picks { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 7px; }
.agent-picks label {
  display: flex; align-items: center; gap: 8px;
  border: 1px solid var(--line-soft);
  border-radius: 9px;
  padding: 8px 10px;
  font-size: 12.5px;
  color: var(--muted);
  cursor: pointer;
  transition: .15s;
}
.agent-picks label:has(input:checked) {
  border-color: rgba(245, 165, 36, .45);
  background: rgba(245, 165, 36, .07);
  color: var(--txt);
}
.agent-picks input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 17px; height: 17px;
  border-radius: 5px;
  border: 1px solid #33456a;
  background: rgba(0, 0, 0, .32);
  position: relative;
  flex: none;
  margin: 0;
  transition: .15s;
}
.agent-picks input[type="checkbox"]:checked {
  background: linear-gradient(140deg, #ffcf6b, var(--accent));
  border-color: transparent;
}
.agent-picks input[type="checkbox"]:checked::after {
  content: "✓";
  position: absolute; inset: 0;
  display: grid; place-items: center;
  font-size: 11px; font-weight: 800; color: #241703;
}
.boards-hint { display: none; font-size: 11.5px; color: var(--muted-2); margin-top: -4px; }
.modal-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 2px; }

.cmd-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line-soft); }
.cmd-tabs button {
  border: 0; background: transparent; color: var(--muted);
  padding: 7px 11px 9px; font-size: 12.5px; font-weight: 600;
  border-bottom: 2px solid transparent;
}
.cmd-tabs button.on { color: var(--accent); border-bottom-color: var(--accent); }
.cmd-box {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 11.8px;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
  background: rgba(2, 5, 10, .72);
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 13px;
  max-height: 300px;
  overflow-y: auto;
  color: #c9d6ea;
  margin: 0;
}
.cmd-foot { display: flex; align-items: center; gap: 8px; }
.cmd-foot .hint { font-size: 11.5px; color: var(--muted-2); flex: 1; }
.key-shower {
  display: flex; align-items: center; gap: 10px;
  border: 1px dashed rgba(245, 165, 36, .4);
  background: rgba(245, 165, 36, .06);
  border-radius: 11px;
  padding: 12px;
  font-family: ui-monospace, Menlo, monospace;
  font-size: 15px;
  letter-spacing: .06em;
  color: #ffd9a0;
  justify-content: center;
}

/* ───────────── 토스트 ───────────── */

.toast {
  position: fixed;
  left: 50%; bottom: 26px;
  transform: translateX(-50%);
  z-index: 80;
  background: rgba(20, 32, 54, .96);
  border: 1px solid rgba(245, 165, 36, .35);
  color: var(--txt);
  padding: 10px 16px;
  border-radius: 11px;
  font-size: 12.5px;
  box-shadow: var(--shadow);
  animation: toastIn .2s ease both;
  max-width: min(90vw, 520px);
  text-align: center;
}
.toast.err { border-color: rgba(255, 93, 108, .45); }
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, 8px); } to { opacity: 1; transform: translate(-50%, 0); } }

/* ───────────── 반응형 ───────────── */

@media (max-width: 1080px) {
  .boards { grid-template-columns: repeat(2, minmax(200px, 1fr)); }
}

@media (max-width: 900px) {
  :root { --sidebar-w: 0px; }
  .app { grid-template-columns: minmax(0, 1fr); }
  .only-mobile { display: inline-grid; }
  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: min(84vw, 320px);
    z-index: 30;
    transform: translateX(-102%);
    transition: transform .24s cubic-bezier(.3, .8, .3, 1);
    box-shadow: 24px 0 60px rgba(0, 0, 0, .5);
  }
  .app.nav-open .sidebar { transform: none; }
  .scrim { position: fixed; inset: 0; background: rgba(3, 6, 12, .6); z-index: 20; }
  .app.nav-open .scrim { display: block !important; }

  .topbar { padding: 10px 12px; gap: 8px; min-height: 60px; }
  .room-title h1 { font-size: 15.5px; }
  .top-actions .presence { display: none; }
  .presence-m { display: flex; margin-left: auto; align-self: center; padding: 0 6px 0 0; }
  .presence-m .av, .presence-m .more { display: none; }
  .presence-m .p-label {
    margin: 0;
    font-size: 11px;
    color: var(--muted);
    display: inline-flex; align-items: center; gap: 5px;
  }
  .presence-m .p-label::before {
    content: "";
    width: 6px; height: 6px; border-radius: 50%;
    background: var(--green);
    box-shadow: 0 0 6px rgba(61, 220, 151, .7);
  }
  .top-actions .primary { padding: 8px 11px; font-size: 12.5px; }
  .tabs { padding: 6px 8px 0; }
  .tabs button { padding: 8px 10px 10px; font-size: 13px; }
  .chat-tools { padding: 8px 12px 2px; }
  .chat-tools input[type="search"] { max-width: none; }
  .messages { padding: 12px 12px 4px; gap: 12px; }
  .msg .body-wrap { max-width: 84%; }
  .msg .avatar { width: 30px; height: 30px; font-size: 12px; }
  .composer { padding: 8px 10px calc(10px + env(safe-area-inset-bottom)); }
  .composer textarea { padding: 10px 12px; font-size: 14px; }
  .composer .send { padding: 10px 14px; }
  .pinned { margin: 6px 12px 0; }
  .view-tasks, .view-agents { padding: 12px 12px 24px; }
  .boards { display: flex; overflow-x: auto; gap: 10px; padding-bottom: 8px; scroll-snap-type: x mandatory; }
  .board { min-width: 78vw; scroll-snap-align: start; }
  .task-form { grid-template-columns: 1fr 1fr; gap: 7px; padding: 10px; }
  .task-form .t-title-in { grid-column: 1 / -1; }
  .task-form button[type="submit"] { grid-column: 1 / -1; }
  .boards-hint { display: block; }
  .agents-head h2 { font-size: 16px; }
  .agents-head p { order: 3; flex-basis: 100%; margin-top: 2px; }
  .agents-head .grow { display: none; }
  .agents-head #btn-new-agent { margin-left: auto; }
  .task-form input, .task-form select { padding: 8px 10px; font-size: 12.5px; }
  .task-toolbar .hint { display: none; }
  .agent-grid { grid-template-columns: 1fr; }
  .modal { padding: 16px; border-radius: 16px; }
  .toast { bottom: 14px; }
}
