/* ─────────────────────────────────────────────────────────────
   AI 팀 회의실 — styles
   다크 · 모바일 우선 · 외부 CDN 없음(오프라인에서도 그대로)
   ───────────────────────────────────────────────────────────── */

:root {
  --bg: #0a0c12;
  --bg-grad-1: #0e1220;
  --bg-grad-2: #0a0c12;
  --card: #141826;
  --card-2: #1a1f30;
  --line: #242a3c;
  --line-soft: #1d2231;
  --txt: #e9ecf5;
  --txt-2: #b9c2d6;
  --muted: #8893ab;

  --wait: #94a3b8;
  --doing: #5b9dff;
  --review: #f7a93b;
  --done: #35d39a;

  --accent: #7c9cff;
  --danger: #ff6b81;

  --r-lg: 18px;
  --r-md: 14px;
  --r-sm: 10px;
  --shadow: 0 10px 30px rgba(0, 0, 0, .35);
  --safe-b: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; }

/* 화면 전환·카드 표시는 hidden 속성으로만 끕니다(display 규칙에 밀리지 않게). */
[hidden] { display: none !important; }

html, body { height: 100%; }

body {
  margin: 0;
  background:
    radial-gradient(1100px 600px at 15% -10%, #1a2340 0%, transparent 60%),
    radial-gradient(900px 500px at 100% 0%, #1a1630 0%, transparent 55%),
    linear-gradient(180deg, var(--bg-grad-1), var(--bg-grad-2) 42%);
  background-attachment: fixed;
  color: var(--txt);
  font-family: "Pretendard", -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo",
    "Segoe UI", "Malgun Gothic", "Noto Sans KR", Roboto, sans-serif;
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
}

h1, h2, h3 { margin: 0; line-height: 1.3; letter-spacing: -.01em; }
p { margin: 0; }
code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .86em;
  background: #0e1320;
  border: 1px solid var(--line-soft);
  padding: .1em .38em;
  border-radius: 6px;
  word-break: break-all;
}
a { color: var(--accent); text-underline-offset: 2px; }

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--card); color: var(--txt); padding: 10px 14px; border-radius: 0 0 10px 0;
}
.skip-link:focus { left: 0; }

.app {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 14px calc(28px + var(--safe-b));
}

/* ── 상단 바 ─────────────────────────────────────────────── */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 12px 2px 10px;
  margin: 0 -14px;
  padding-left: 14px; padding-right: 14px;
  padding-top: max(12px, env(safe-area-inset-top));
  background: linear-gradient(180deg, rgba(10, 12, 18, .96) 62%, rgba(10, 12, 18, 0));
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand-mark {
  width: 38px; height: 38px; flex: 0 0 auto;
  display: grid; place-items: center;
  border-radius: 12px;
  background: linear-gradient(145deg, #2b2f6b, #4a2a6b);
  border: 1px solid #3b3f7a;
  font-size: 19px;
}
.brand-text { min-width: 0; }
.brand-text h1 { font-size: 18px; font-weight: 800; }
.brand-text p {
  font-size: 11.5px; color: var(--muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  max-width: 46vw;
}
.top-actions { display: flex; align-items: center; gap: 8px; }

.sync-pill {
  display: inline-flex; align-items: center; gap: 6px;
  font: inherit; font-size: 12px; font-weight: 600;
  color: var(--txt-2); background: #151a28;
  border: 1px solid var(--line); border-radius: 999px;
  padding: 6px 11px; cursor: pointer;
  white-space: nowrap;
}
.sync-pill .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.sync-pill.is-demo .dot { background: var(--muted); }
.sync-pill.is-locked { color: #b6c0d6; border-color: #2b3348; background: #141a29; }
.sync-pill.is-locked .dot { background: #8a94ab; }
.sync-pill.is-ok { color: #7ee2b8; border-color: #1f5946; background: #10231d; }
.sync-pill.is-dirty { color: #ffc978; border-color: #5c4620; background: #241d10; }
.sync-pill.is-err { color: #ff9aa8; border-color: #5e2731; background: #241317; }
.sync-pill.is-busy .dot { animation: pulse 1s infinite; }
@keyframes pulse { 0%, 100% { opacity: .25; } 50% { opacity: 1; } }

.icon-btn {
  width: 38px; height: 38px; flex: 0 0 auto;
  display: grid; place-items: center;
  font-size: 17px; color: var(--txt-2);
  background: #151a28; border: 1px solid var(--line);
  border-radius: 12px; cursor: pointer;
}
.icon-btn:hover { color: var(--txt); border-color: #36405c; }

/* ── 탭 ─────────────────────────────────────────────────── */
.tabs {
  display: flex; gap: 6px;
  padding: 4px;
  background: #10141f;
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  margin: 4px 0 16px;
  overflow-x: auto;
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  flex: 1 0 auto;
  font: inherit; font-size: 13.5px; font-weight: 700;
  color: var(--muted);
  background: transparent; border: 0; border-radius: 10px;
  padding: 9px 14px; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  white-space: nowrap;
}
.tab:hover { color: var(--txt-2); }
.tab.is-active { color: #fff; background: #222a40; box-shadow: inset 0 0 0 1px #303a57; }
.tab-count {
  font-size: 11px; font-weight: 700;
  background: #0c101a; border: 1px solid var(--line);
  border-radius: 999px; padding: 1px 7px; color: var(--txt-2);
}

/* ── 공통 ───────────────────────────────────────────────── */
.view { animation: fade .18s ease-out; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

.btn {
  font: inherit; font-size: 13.5px; font-weight: 700;
  color: var(--txt);
  background: #1c2234; border: 1px solid #2b334a;
  border-radius: 11px; padding: 9px 14px;
  cursor: pointer; text-decoration: none;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  white-space: nowrap;
}
.btn:hover { border-color: #3c4767; background: #212840; }
.btn:active { transform: translateY(1px); }
.btn.primary {
  background: linear-gradient(180deg, #5d7cf0, #4a63d8);
  border-color: #6d88f5; color: #fff;
  box-shadow: 0 6px 18px rgba(80, 110, 240, .28);
}
.btn.primary:hover { background: linear-gradient(180deg, #6a87f7, #5069e2); }
.btn.ghost { background: transparent; border-color: var(--line); color: var(--txt-2); }
.btn.ghost:hover { color: var(--txt); }
.btn.small { padding: 6px 10px; font-size: 12.5px; border-radius: 9px; }
.btn.danger { color: #ff8d9c; border-color: #4a2730; }
.btn.danger:hover { background: #2a171c; }
.btn:disabled { opacity: .5; cursor: default; }

.hint { font-size: 12px; color: var(--muted); }
.empty { color: var(--muted); text-align: center; padding: 40px 10px; font-size: 13.5px; }

/* ── 상태 통계 ──────────────────────────────────────────── */
.stat-row {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px;
  margin-bottom: 14px;
}
.stat {
  background: linear-gradient(180deg, #161b2a, #12161f);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-md);
  padding: 10px 12px;
}
.stat b { display: block; font-size: 20px; font-weight: 800; letter-spacing: -.02em; }
.stat span { font-size: 11.5px; color: var(--muted); }
.stat.s-doing b { color: var(--doing); }
.stat.s-review b { color: var(--review); }
.stat.s-wait b { color: var(--wait); }

/* ── 작성 폼 ────────────────────────────────────────────── */
.composer {
  background: #121724;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  margin-bottom: 14px;
  overflow: hidden;
}
.composer > summary {
  list-style: none;
  cursor: pointer;
  padding: 14px 16px;
  font-weight: 700; font-size: 14px;
  color: var(--txt-2);
  display: flex; align-items: center; gap: 8px;
  user-select: none;
}
.composer > summary::-webkit-details-marker { display: none; }
.composer[open] > summary { color: var(--txt); border-bottom: 1px solid var(--line-soft); }
.composer > summary .plus {
  display: grid; place-items: center;
  width: 22px; height: 22px; border-radius: 7px;
  background: #232b44; color: #a9bbff; font-size: 14px; font-weight: 700;
}
.form { padding: 14px 16px 16px; display: grid; gap: 12px; }
.form-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
}
.form-grid .span-2 { grid-column: 1 / -1; }
.form label, .card label {
  display: grid; gap: 5px;
  font-size: 12px; font-weight: 700; color: var(--muted);
}
input[type="text"], input[type="password"], input[type="search"], input:not([type]), select, textarea {
  font: inherit; font-size: 14px;
  color: var(--txt);
  background: #0d1119;
  border: 1px solid #262e42;
  border-radius: 10px;
  padding: 9px 11px;
  width: 100%;
  min-width: 0;
}
textarea { resize: vertical; line-height: 1.5; }
input::placeholder, textarea::placeholder { color: #5b6478; }
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: #4a5b8f;
  box-shadow: 0 0 0 3px rgba(90, 120, 235, .16);
}
select {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, #7d89a6 50%), linear-gradient(135deg, #7d89a6 50%, transparent 50%);
  background-position: calc(100% - 16px) 52%, calc(100% - 11px) 52%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: 30px;
}
.form-actions {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
}

/* ── 필터 ───────────────────────────────────────────────── */
.filters { display: grid; gap: 8px; margin-bottom: 12px; }
.chips { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  font: inherit; font-size: 12.5px; font-weight: 600;
  color: var(--txt-2);
  background: #12171f;
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  padding: 6px 12px;
  cursor: pointer;
  white-space: nowrap;
  display: inline-flex; align-items: center; gap: 6px;
}
.chip:hover { border-color: #35405c; }
.chip.is-on { background: #26304b; border-color: #3d4a70; color: #fff; }
.chip .cdot { width: 6px; height: 6px; border-radius: 50%; }
.filter-row { display: flex; gap: 8px; align-items: center; }
.active-filter {
  display: flex; align-items: center; gap: 8px;
  font-size: 12.5px; color: var(--txt-2);
}
.active-filter button {
  font: inherit; font-size: 12px; color: var(--muted);
  background: #1b2130; border: 1px solid var(--line); border-radius: 999px;
  padding: 3px 9px; cursor: pointer;
}

/* ── 피드 ───────────────────────────────────────────────── */
.feed { display: grid; gap: 10px; }
.post {
  background: linear-gradient(180deg, #151a27, #12161f);
  border: 1px solid var(--line-soft);
  border-left: 3px solid transparent;
  border-radius: var(--r-lg);
  padding: 13px 14px 11px;
}
.post.st-wait { border-left-color: rgba(148, 163, 184, .55); }
.post.st-doing { border-left-color: rgba(91, 157, 255, .75); }
.post.st-review { border-left-color: rgba(247, 169, 59, .8); }
.post.st-done { border-left-color: rgba(53, 211, 154, .7); }
.post.st-done .post-title { color: var(--txt-2); }
.post.st-done .post-body { opacity: .72; }

.post-head {
  display: flex; align-items: center; gap: 7px; flex-wrap: wrap;
  margin-bottom: 8px;
}
.role {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11.5px; font-weight: 800;
  padding: 3px 9px 3px 7px;
  border-radius: 999px;
  border: 1px solid;
  white-space: nowrap;
}
.role .rem { font-size: 12px; }
.kind {
  font-size: 11px; font-weight: 700;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 999px; padding: 2px 8px;
  background: #0f141f;
}
.post-time { font-size: 11.5px; color: #6f7a92; margin-left: auto; white-space: nowrap; }

.status-select {
  font: inherit; font-size: 11.5px; font-weight: 800;
  border-radius: 999px; padding: 3px 8px;
  width: auto; min-width: 74px;
  border: 1px solid;
  background-image: none;
}
.status-select.st-wait { color: #cfd8e6; background: #1b2130; border-color: #313c52; }
.status-select.st-doing { color: #9dc2ff; background: #12233d; border-color: #274a7d; }
.status-select.st-review { color: #ffc978; background: #2a2113; border-color: #5c4620; }
.status-select.st-done { color: #7ee2b8; background: #10231d; border-color: #1f5946; }

.post-title { font-size: 15.5px; font-weight: 800; margin-bottom: 4px; }
.post-body {
  font-size: 13.5px; color: var(--txt-2);
  white-space: pre-wrap; word-break: break-word;
}
.post-body.is-clamped {
  display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden;
}
.post-meta {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin-top: 9px;
}
.meta-chip {
  font: inherit; font-size: 11.5px; font-weight: 600;
  color: #9aa7c2; background: #0f141f;
  border: 1px solid var(--line-soft); border-radius: 8px;
  padding: 3px 8px; cursor: pointer;
}
.meta-chip:hover { color: var(--txt); border-color: #33405c; }
.meta-need { font-size: 11.5px; color: var(--muted); }
.meta-need b { color: #ffc978; font-weight: 700; }

.replies { display: grid; gap: 7px; margin-top: 10px; }
.reply {
  background: #0f141f;
  border: 1px solid var(--line-soft);
  border-radius: 11px;
  padding: 8px 10px;
}
.reply-head { display: flex; align-items: center; gap: 6px; margin-bottom: 3px; }
.reply-head .who { font-size: 11.5px; font-weight: 800; }
.reply-head .when { font-size: 10.5px; color: #6b7488; margin-left: auto; }
.reply-text { font-size: 13px; color: var(--txt-2); white-space: pre-wrap; word-break: break-word; }

.post-foot { display: flex; align-items: center; gap: 6px; margin-top: 10px; flex-wrap: wrap; }
.mini {
  font: inherit; font-size: 12px; font-weight: 700;
  color: #9aa7c2; background: transparent;
  border: 1px solid var(--line); border-radius: 9px;
  padding: 4px 10px; cursor: pointer;
}
.mini:hover { color: var(--txt); border-color: #36415c; }
.mini.danger { color: #b8798a; border-color: transparent; margin-left: auto; }
.mini.danger:hover { color: var(--danger); }
.mini.spacer { margin-left: auto; border-color: transparent; }

.reply-form { margin-top: 9px; display: grid; gap: 7px; }
.reply-form .row { display: flex; gap: 7px; align-items: flex-start; }
.reply-form select { width: 128px; flex: 0 0 auto; font-size: 12.5px; padding: 8px 26px 8px 9px; }
.reply-form textarea { font-size: 13px; padding: 8px 10px; }

/* ── 프로젝트 ───────────────────────────────────────────── */
.section-head { margin: 2px 0 12px; }
.section-head h2 { font-size: 18px; font-weight: 800; }
.section-head p { font-size: 12px; color: var(--muted); margin-top: 4px; }
.grid { display: grid; gap: 10px; grid-template-columns: 1fr; }
.proj {
  background: linear-gradient(180deg, #161b2a, #12161f);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-lg);
  padding: 14px;
  display: flex; flex-direction: column; gap: 8px;
}
.proj-top { display: flex; align-items: center; gap: 8px; }
.proj-emoji { font-size: 18px; line-height: 1; }
.proj h3 { font-size: 15px; font-weight: 800; flex: 1; min-width: 0; }
.badge {
  font-size: 11px; font-weight: 800;
  border-radius: 999px; padding: 3px 9px;
  border: 1px solid; white-space: nowrap;
}
.badge.st-wait { color: #cfd8e6; background: #1b2130; border-color: #313c52; }
.badge.st-doing { color: #9dc2ff; background: #12233d; border-color: #274a7d; }
.badge.st-review { color: #ffc978; background: #2a2113; border-color: #5c4620; }
.badge.st-done { color: #7ee2b8; background: #10231d; border-color: #1f5946; }

.proj-lines { display: grid; gap: 3px; font-size: 11.5px; color: #8b96ad; }
.proj-lines .row { display: flex; gap: 6px; min-width: 0; }
.proj-lines .lbl { color: #5f6a80; flex: 0 0 34px; }
.proj-summary { font-size: 13px; color: var(--txt-2); }
.proj-next {
  background: #0f141f; border: 1px solid var(--line-soft);
  border-radius: 11px; padding: 8px 10px;
  font-size: 12.5px; color: var(--txt-2);
}
.proj-next .t { font-size: 10.5px; font-weight: 800; color: #8ba0d8; letter-spacing: .04em; }
.proj-foot { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 11.5px; color: var(--muted); }
.proj-foot .wait b { color: #ffc978; }
.proj-actions { display: flex; gap: 6px; margin-top: 2px; }
.proj-actions .btn { flex: 1; font-size: 12.5px; padding: 7px 10px; }

/* ── 설정 카드 ──────────────────────────────────────────── */
/* ── 잠금 화면 (토큰 없음) ───────────────────────────────── */
.lock-card {
  max-width: 520px;
  margin: 18px auto 0;
  background: #121724;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 26px 20px 20px;
  display: grid; gap: 13px;
  text-align: center;
  box-shadow: var(--shadow);
}
.lock-mark {
  width: 54px; height: 54px; margin: 0 auto;
  display: grid; place-items: center;
  font-size: 26px; border-radius: 50%;
  background: #161d2e; border: 1px solid var(--line);
}
.lock-card h2 { font-size: 19px; font-weight: 800; }
.lock-lead { font-size: 13.5px; color: var(--txt-2); line-height: 1.6; }
.lock-lead b { color: var(--txt); }
.lock-card form { display: grid; gap: 11px; text-align: left; }
.lock-card .btn-row { justify-content: center; }
.lock-card .status-line { text-align: left; }
.lock-card .status-line:empty { display: none; }
.lock-card .help { text-align: left; }
.lock-card .hint { text-align: left; line-height: 1.6; }
.bootstrap-card { border-color: #2b3a57; background: #111a2a; }
.bootstrap-card h2 { font-size: 15.5px; font-weight: 800; }
.bootstrap-card p { font-size: 12.5px; color: var(--txt-2); line-height: 1.6; }

.card {
  background: #121724;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 16px;
  margin-bottom: 12px;
  display: grid; gap: 12px;
}
.card-head h2 { font-size: 15.5px; font-weight: 800; display: flex; align-items: center; gap: 8px; }
.card-head p { font-size: 12.5px; color: var(--muted); margin-top: 5px; }
.tag {
  font-size: 10px; font-weight: 800; letter-spacing: .02em;
  color: #9fd0b9; background: #12251e; border: 1px solid #1f4a3a;
  border-radius: 6px; padding: 2px 6px;
}
.token-field input { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12.5px; }
.btn-row { display: flex; gap: 7px; flex-wrap: wrap; }
.status-line {
  font-size: 12.5px; color: var(--txt-2);
  background: #0f141f; border: 1px solid var(--line-soft);
  border-radius: 10px; padding: 9px 11px;
  word-break: break-word;
}
.status-line.ok { color: #9fe8c8; border-color: #1f4a3a; background: #0e1d18; }
.status-line.err { color: #ffafba; border-color: #53242c; background: #1d1114; }
.preview {
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: 11.5px; line-height: 1.5;
  background: #0b0f18; color: #c3cddf;
}
.help summary { cursor: pointer; font-size: 12.5px; font-weight: 700; color: var(--txt-2); }
.help ol { margin: 8px 0 6px; padding-left: 20px; font-size: 12.5px; color: var(--txt-2); display: grid; gap: 5px; }
.kv { display: grid; grid-template-columns: 96px 1fr; gap: 6px 10px; margin: 0; font-size: 12.5px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; color: var(--txt-2); word-break: break-word; }

.foot {
  margin-top: 22px; padding-top: 14px;
  border-top: 1px solid var(--line-soft);
  font-size: 11px; color: #5b6478; text-align: center;
}

/* ── 토스트 · 다이얼로그 ─────────────────────────────────── */
.toast {
  position: fixed; left: 50%; bottom: calc(18px + var(--safe-b));
  transform: translateX(-50%) translateY(8px);
  max-width: min(92vw, 460px);
  background: #1d2436; color: #fff;
  border: 1px solid #33405c;
  border-radius: 12px; padding: 10px 15px;
  font-size: 13px; font-weight: 600;
  box-shadow: var(--shadow);
  opacity: 0; pointer-events: none;
  transition: opacity .18s, transform .18s;
  z-index: 60;
  text-align: center;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.err { background: #2a161b; border-color: #5e2731; color: #ffc3cc; }
.toast.ok { background: #10241d; border-color: #1f5946; color: #a6eed0; }

.dlg {
  border: 1px solid var(--line);
  background: #151a27;
  color: var(--txt);
  border-radius: var(--r-lg);
  padding: 18px;
  max-width: min(92vw, 420px);
  box-shadow: var(--shadow);
}
.dlg::backdrop { background: rgba(4, 6, 10, .68); backdrop-filter: blur(3px); }
.dlg h3 { font-size: 16px; font-weight: 800; margin-bottom: 8px; }
.dlg p { font-size: 13.5px; color: var(--txt-2); white-space: pre-wrap; }
.dlg-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 16px; flex-wrap: wrap; }

/* ── 사무실 (도트 픽셀) ────────────────────────────────── */
.office-legend {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  margin-bottom: 10px; font-size: 11.5px;
}
.ol { border: 1px solid; border-radius: 999px; padding: 2px 9px; font-weight: 800; white-space: nowrap; }
.ol.is-working { color: #9dc2ff; background: #12233d; border-color: #274a7d; }
.ol.is-waiting { color: #ffc978; background: #2a2113; border-color: #5c4620; }
.ol.is-idle { color: #b9c2d6; background: #1b2130; border-color: #313c52; }
.ol-note { color: var(--muted); margin-left: auto; }

.office-card {
  background: linear-gradient(180deg, #131826, #0f131d);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 10px 10px 12px;
  margin-bottom: 12px;
  box-shadow: var(--shadow);
}
.office-stage { max-width: 760px; margin: 0 auto; }
.office-svg {
  display: block; width: 100%; height: auto;
  image-rendering: pixelated;
  touch-action: manipulation;
}
.office-svg text { user-select: none; -webkit-user-select: none; }

.office-role { cursor: pointer; }
.office-role:focus { outline: none; }
.office-role:focus-visible .office-hit { stroke: #7c9cff; stroke-width: 2; }
.office-role:hover .office-hit { fill: rgba(124, 156, 255, .12); }

/* 상태에 따라 한 가지 효과만 보입니다 */
.office-role .fx-working,
.office-role .fx-waiting,
.office-role .fx-idle { display: none; }
.office-role.is-working .fx-working,
.office-role.is-waiting .fx-waiting,
.office-role.is-idle .fx-idle { display: inline; }

.office-role.is-working .screen { animation: screenPulse 1.5s steps(2, end) infinite; }
.office-role.is-working .hand { animation: handType .55s steps(2, end) infinite; }
.office-role.is-waiting .wait-bubble { animation: bubblePop 1.8s steps(2, end) infinite; }
.office-role.is-idle .zzz { animation: zzzFloat 2.6s steps(4, end) infinite; }

@keyframes screenPulse { 0%, 100% { opacity: 1; } 50% { opacity: .55; } }
@keyframes handType { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
@keyframes bubblePop { 0%, 100% { opacity: 1; } 50% { opacity: .55; } }
@keyframes zzzFloat { 0% { opacity: .2; } 60% { opacity: 1; } 100% { opacity: .2; } }

.office-tip { text-align: center; margin-top: 7px; }
.office-roster { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; margin-top: 8px; }
.roster-btn {
  font: inherit; font-size: 12px; font-weight: 700;
  display: inline-flex; align-items: center; gap: 5px;
  color: var(--txt-2); background: #151b29;
  border: 1px solid var(--line); border-radius: 999px;
  padding: 5px 10px; cursor: pointer;
}
.roster-btn:hover { color: #fff; border-color: #3c4767; background: #1a2132; }
.roster-btn .rb-emoji { font-size: 13px; line-height: 1; }
.roster-btn .rb-state { font-size: 10.5px; color: var(--muted); }
.roster-btn.is-working { border-color: #274a7d; }
.roster-btn.is-working .rb-state { color: #9dc2ff; }
.roster-btn.is-waiting { border-color: #5c4620; }
.roster-btn.is-waiting .rb-state { color: #ffc978; }

/* 팀원을 누르면 열리는 서랍 */
.office-drawer {
  position: fixed; z-index: 55;
  right: 14px; bottom: calc(14px + var(--safe-b));
  width: min(430px, calc(100vw - 28px));
  max-height: min(74vh, 640px);
  overflow: auto;
  background: #121724; border: 1px solid #2b3550;
  border-radius: var(--r-lg);
  box-shadow: 0 18px 50px rgba(0, 0, 0, .55);
  padding: 14px;
  display: grid; gap: 10px;
  animation: drawerIn .18s ease-out;
}
@keyframes drawerIn { from { transform: translateY(14px); opacity: 0; } to { transform: none; opacity: 1; } }
.od-head { display: flex; align-items: center; gap: 9px; }
.od-avatar {
  width: 34px; height: 34px; flex: 0 0 auto;
  display: grid; place-items: center; font-size: 18px;
  background: #1a2133; border: 1px solid var(--line); border-radius: 10px;
}
.od-who { flex: 1; min-width: 0; }
.od-who h3 { font-size: 15px; font-weight: 800; }
.od-who p { font-size: 11.5px; color: var(--muted); }
.od-badge { font-size: 11px; font-weight: 800; border-radius: 999px; padding: 3px 9px; border: 1px solid; white-space: nowrap; }
.od-badge.is-working { color: #9dc2ff; background: #12233d; border-color: #274a7d; }
.od-badge.is-waiting { color: #ffc978; background: #2a2113; border-color: #5c4620; }
.od-badge.is-idle { color: #b9c2d6; background: #1b2130; border-color: #313c52; }
.od-close {
  flex: 0 0 auto; font: inherit; font-size: 14px; line-height: 1;
  color: var(--muted); background: transparent;
  border: 1px solid var(--line); border-radius: 9px;
  width: 30px; height: 30px; cursor: pointer;
}
.od-close:hover { color: var(--txt); border-color: #36415c; }
.od-stats { display: flex; gap: 6px; flex-wrap: wrap; }
.od-stats span {
  font-size: 11.5px; color: #9aa7c2; background: #0f141f;
  border: 1px solid var(--line-soft); border-radius: 8px; padding: 3px 8px;
}
.od-tasks { display: grid; gap: 6px; }
.od-none { font-size: 12px; color: var(--muted); line-height: 1.5; }
.od-task {
  display: flex; gap: 8px; align-items: flex-start; text-align: left;
  font: inherit; color: var(--txt-2); background: #0f141f;
  border: 1px solid var(--line-soft); border-radius: 10px;
  padding: 8px 10px; cursor: pointer;
}
.od-task:hover { border-color: #33405c; }
.od-task .dot2 { width: 6px; height: 6px; border-radius: 50%; margin-top: 6px; flex: 0 0 auto; }
.od-task-main { display: grid; gap: 2px; min-width: 0; flex: 1; }
.od-task-main b { font-size: 12.5px; font-weight: 700; color: var(--txt); word-break: break-word; }
.od-task-main span { font-size: 11px; color: #6f7a92; }
.od-task-st { font-size: 10.5px; font-weight: 800; color: var(--muted); white-space: nowrap; }
.od-more {
  font: inherit; font-size: 12px; font-weight: 700;
  color: #9aa7c2; background: transparent;
  border: 1px dashed var(--line); border-radius: 10px;
  padding: 7px 10px; cursor: pointer;
}
.od-more:hover { color: var(--txt); border-color: #36415c; }
.od-form { display: grid; gap: 8px; }
.od-form label { display: grid; gap: 5px; font-size: 12px; font-weight: 700; color: var(--muted); }
.od-form textarea { font-size: 13px; }
.od-form-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.od-proj { flex: 1 1 150px; }
.od-auto {
  display: inline-flex !important; flex-direction: row; align-items: center; gap: 5px;
  font-size: 11.5px !important; font-weight: 600 !important; color: var(--txt-2) !important;
}
.od-auto input { width: auto; }

@media (min-width: 700px) {
  .office-card { padding: 14px 14px 16px; }
}

/* ── 넓은 화면 ──────────────────────────────────────────── */
@media (min-width: 700px) {
  body { font-size: 15px; }
  .app { padding: 0 24px 40px; }
  .topbar { margin: 0 -24px; padding-left: 24px; padding-right: 24px; }
  .brand-text h1 { font-size: 20px; }
  .brand-text p { max-width: none; }
  .grid { grid-template-columns: 1fr 1fr; }
  .form-grid { grid-template-columns: repeat(4, 1fr); }
  .form-grid label:nth-child(1), .form-grid label:nth-child(2) { grid-column: span 2; }
  .form-grid.form-5 { grid-template-columns: repeat(5, 1fr); }
  .form-grid.form-5 label:nth-child(1), .form-grid.form-5 label:nth-child(2) { grid-column: auto; }
  .stat-row { grid-template-columns: repeat(4, 1fr); gap: 10px; }
  .tab { flex: 0 0 auto; }
  .tabs { justify-content: flex-start; }
  .post { padding: 15px 16px 13px; }
  .proj-actions .btn { flex: 0 1 auto; }
}
@media (max-width: 400px) {
  .tab { padding: 9px 9px; font-size: 12.5px; gap: 4px; }
  .tab-count { display: none; }
  .brand-text p { max-width: 42vw; }
}
@media (min-width: 1080px) {
  .grid { grid-template-columns: repeat(3, 1fr); }
  .feed { gap: 11px; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* 인쇄(회의록 종이로 뽑을 때) */
@media print {
  body { background: #fff; color: #111; }
  .topbar, .tabs, .composer, .filters, .post-foot, .reply-form, .foot, .btn { display: none !important; }
  .post, .proj, .card { border-color: #ccc; background: #fff; box-shadow: none; }
  .post-body, .post-title, .proj-summary { color: #111; }
}
