:root {
  --paper: #eef1f5;
  --sheet: #ffffff;
  --ink: #17212e;
  --graphite: #5b6676;
  --rule: #d6dce4;
  --rule-soft: #e6eaf0;
  --open: #2c5aa0;
  --open-soft: #e3ebf7;
  --done: #2f7a54;
  --done-soft: #e1f0e7;
  --late: #b23a26;
  --late-soft: #f8e4df;
  --mine: #c47a0a;
  --mine-soft: #fff6e5;
  --focus: #2c5aa0;
  --panel: #f5f7fb;
  --av-bg-l: 88%;
  --av-fg-l: 28%;
  --radius: 6px;
  --topbar-h: 108px;
  color-scheme: light;
  font-family: "Pretendard Variable", Pretendard, "Noto Sans KR", system-ui, -apple-system, sans-serif;
  font-size: 14px;
  line-height: 1.5;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #12161c;
    --sheet: #1a2029;
    --ink: #e6eaf0;
    --graphite: #93a0b2;
    --rule: #2a323e;
    --rule-soft: #222a35;
    --open: #7da4e6;
    --open-soft: #1d2a40;
    --done: #6fc197;
    --done-soft: #1a3027;
    --late: #f08a73;
    --late-soft: #3a211c;
    --mine: #e8a63a;
    --mine-soft: #332812;
    --focus: #7da4e6;
    --panel: #212936;
    --av-bg-l: 26%;
    --av-fg-l: 82%;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--paper); color: var(--ink); }
body { font-variant-numeric: tabular-nums; }
.hidden { display: none !important; }
button, input, select { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
svg { width: 16px; height: 16px; flex: none; }

/* ---------- 공통 컨트롤 ---------- */
.btn { background: var(--sheet); border: 1px solid var(--rule); border-radius: var(--radius); padding: 6px 12px; font-size: 13px; text-decoration: none; cursor: pointer; white-space: nowrap; color: var(--ink); display: inline-flex; align-items: center; gap: 6px; line-height: 20px; }
.btn:hover { border-color: var(--graphite); }
.btn.primary { background: var(--open); border-color: var(--open); color: #fff; font-weight: 500; }
.btn.primary:hover { filter: brightness(1.08); }
.btn.big { padding: 10px 18px; font-size: 14px; }
.icon-btn { background: transparent; border: 1px solid var(--rule); border-radius: var(--radius); width: 34px; height: 34px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; font-size: 15px; color: var(--graphite); }
.icon-btn:hover { color: var(--ink); border-color: var(--graphite); }
.seg { display: inline-flex; border: 1px solid var(--rule); border-radius: var(--radius); overflow: hidden; background: var(--sheet); }
.seg button { background: transparent; border: 0; border-right: 1px solid var(--rule); padding: 6px 11px; font-size: 13px; line-height: 20px; cursor: pointer; color: var(--graphite); }
.seg button:last-child { border-right: 0; }
.seg button:hover { color: var(--ink); }
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--sheet); }

/* ---------- 상단 ---------- */
.topbar { position: sticky; top: 0; z-index: 5; background: var(--sheet); border-bottom: 1px solid var(--rule); }
.titlebar { display: flex; align-items: center; gap: 14px; padding: 12px 20px 8px; }
.brand { display: inline-flex; align-items: center; gap: 9px; text-decoration: none; color: var(--ink); margin-right: 10px; padding-right: 16px; border-right: 1px solid var(--rule); }
.logo { width: 30px; height: 30px; }
.wordmark { font-size: 20px; font-weight: 600; letter-spacing: -.02em; line-height: 1; }
.wordmark b { font-weight: 700; color: var(--open); }
.space { display: flex; align-items: center; gap: 8px; min-width: 0; }
.space-label { font-size: 12px; color: var(--graphite); }
.space select { font-size: 18px; font-weight: 600; border: 0; background: transparent; padding: 2px 4px; cursor: pointer; max-width: 46vw; }
.chat-btn { color: var(--open); border-color: var(--open); background: var(--open-soft); font-weight: 600; }
.chat-btn:hover { background: var(--open); color: #fff; }
.chat-btn::after { content: "↗"; font-size: 12px; opacity: .8; }
.titlebar-end { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.sync { font-size: 12px; color: var(--graphite); }
.sync .sync-error { color: var(--late); cursor: help; }
.user-chip { display: flex; align-items: center; gap: 8px; font-size: 13px; padding-left: 10px; border-left: 1px solid var(--rule); }
.user-chip a { font-size: 12px; color: var(--graphite); text-decoration: none; }
.user-chip a:hover { color: var(--ink); text-decoration: underline; }
.toolbar { display: flex; align-items: center; gap: 14px; padding: 0 20px 10px; flex-wrap: wrap; }
.search-wrap { position: relative; flex: 1 1 260px; max-width: 420px; }
.search-icon { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--graphite); pointer-events: none; }
.search { width: 100%; background: var(--paper); border: 1px solid transparent; border-radius: var(--radius); padding: 6px 12px 6px 32px; font-size: 13px; line-height: 20px; }
.search:focus { background: var(--sheet); border-color: var(--open); outline: none; }
.group { display: flex; align-items: center; gap: 8px; }
.group-label { font-size: 12px; color: var(--graphite); }
.custom-range { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--graphite); }
.toolbar-end { margin-left: auto; }
.opt { display: inline-flex; align-items: center; gap: 0; border: 1px solid var(--rule); border-radius: var(--radius); background: var(--paper); padding: 2px 2px 2px 10px; }
.opt-label { font-size: 12px; font-weight: 600; color: var(--graphite); margin-right: 8px; }
.opt .seg { border: 0; background: transparent; gap: 2px; }
.opt .seg button { border: 0; border-radius: 4px; padding: 5px 10px; display: inline-flex; align-items: center; gap: 6px; color: var(--graphite); background: transparent; }
.opt .seg button svg { width: 15px; height: 15px; }
.opt .seg button:hover { color: var(--ink); background: var(--sheet); }
.opt .seg button[aria-pressed="true"] { background: var(--sheet); color: var(--open); font-weight: 600; box-shadow: 0 1px 2px rgba(0, 0, 0, .12); }

/* ---------- 담당자 레일 ---------- */
.layout { display: grid; grid-template-columns: 280px 1fr; min-height: calc(100vh - var(--topbar-h)); }
.rail { border-right: 1px solid var(--rule); background: var(--sheet); position: sticky; top: var(--topbar-h); align-self: start; max-height: calc(100vh - var(--topbar-h)); overflow: auto; display: flex; flex-direction: column; }
.summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; padding: 14px 16px 12px; }
.stat { background: var(--paper); border-radius: var(--radius); border-top: 3px solid var(--rule); padding: 8px 10px 9px; }
.stat .n { display: block; font-size: 28px; font-weight: 800; line-height: 1.05; letter-spacing: -.02em; }
.stat .l { display: block; font-size: 12px; font-weight: 600; color: var(--graphite); margin-top: 3px; word-break: keep-all; line-height: 1.3; }
.stat.open { background: var(--open-soft); border-top-color: var(--open); }
.stat.open .n { color: var(--open); }
.stat.done { background: var(--done-soft); border-top-color: var(--done); }
.stat.done .n { color: var(--done); }
.stat.late { background: var(--late-soft); border-top-color: var(--late); }
.stat.late .n { color: var(--late); }
.stat.late.zero { background: var(--paper); border-top-color: var(--rule); }
.stat.late.zero .n { color: var(--graphite); }
.rail-cols { display: grid; grid-template-columns: 1fr 44px 44px; padding: 6px 16px 4px 16px; font-size: 11px; color: var(--graphite); border-bottom: 1px solid var(--rule-soft); }
.rail-cols .o, .rail-cols .d { text-align: right; }
.people { list-style: none; margin: 0; padding: 4px 0; }
.person { width: 100%; display: grid; grid-template-columns: 26px 1fr 44px 44px; grid-template-rows: auto auto; column-gap: 10px; align-items: center; padding: 8px 16px 8px 13px; background: transparent; border: 0; border-left: 3px solid transparent; text-align: left; cursor: pointer; }
.person:hover { background: var(--paper); }
.person[aria-pressed="true"] { background: var(--open-soft); border-left-color: var(--open); }
.person.me { background: var(--mine-soft); }
.person.me[aria-pressed="true"] { border-left-color: var(--mine); }
.person .who { font-size: 13px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: flex; align-items: center; gap: 6px; }
.chip-me { font-size: 10px; font-weight: 600; color: var(--mine); border: 1px solid var(--mine); border-radius: 3px; padding: 0 4px; line-height: 15px; }
.person .o, .person .d { text-align: right; font-size: 15px; font-weight: 600; }
.person .o { color: var(--open); }
.person .d { color: var(--done); }
.person .o.zero, .person .d.zero { color: var(--rule); font-weight: 400; }
.person .late { font-size: 11px; color: var(--late); font-weight: 500; background: var(--late-soft); border-radius: 3px; padding: 0 4px; line-height: 15px; }
.person .bar { grid-column: 2 / 5; height: 4px; border-radius: 2px; background: var(--rule-soft); margin-top: 6px; overflow: hidden; }
.person .bar span { display: block; height: 100%; background: var(--open); border-radius: 2px; }
.person.me .bar span { background: var(--mine); }
.rail-note { margin: auto 16px 12px; padding-top: 10px; font-size: 11px; color: var(--graphite); }

.avatar { width: 26px; height: 26px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 600; flex: none; background: hsl(var(--hue, 215) 40% var(--av-bg-l)); color: hsl(var(--hue, 215) 45% var(--av-fg-l)); }
.avatar.sm { width: 20px; height: 20px; font-size: 10px; }
.avatar.lg { width: 32px; height: 32px; font-size: 12px; }

/* ---------- 보드 ---------- */
.board { padding: 18px 20px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; align-content: start; }
.board.people-view { display: flex; flex-direction: column; gap: 0; }
.board.people-view .cards { gap: 8px; }
.col-head { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 8px; border: 1px solid var(--rule); border-left: 6px solid var(--rule); background: var(--sheet); margin-bottom: 12px; }
.col-head h2 { font-size: 18px; font-weight: 700; margin: 0; letter-spacing: -.01em; }
.col-head .count { font-size: 22px; font-weight: 800; line-height: 1; color: var(--sheet); border-radius: 999px; padding: 5px 13px; min-width: 44px; text-align: center; }
.col-head.open { background: var(--open-soft); border-color: var(--open); }
.col-head.open h2 { color: var(--open); }
.col-head.open .count { background: var(--open); }
.col-head.done { background: var(--done-soft); border-color: var(--done); }
.col-head.done h2 { color: var(--done); }
.col-head.done .count { background: var(--done); }
.col-head .caption { font-size: 13px; color: var(--graphite); margin-left: auto; text-align: right; }
.cards { display: flex; flex-direction: column; gap: 10px; }
.empty { color: var(--graphite); font-size: 13px; padding: 18px 4px; }

.card { position: relative; display: grid; grid-template-columns: 92px 1fr; background: var(--sheet); border: 1px solid var(--rule); border-radius: 8px; cursor: pointer; overflow: hidden; box-shadow: 0 1px 2px rgba(23, 33, 46, .06); }
.card:hover { border-color: var(--graphite); box-shadow: 0 4px 12px rgba(23, 33, 46, .1); }
.who-block { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 12px 6px; background: var(--paper); border-right: 1px solid var(--rule-soft); text-align: center; }
.who-block .avatar { width: 38px; height: 38px; font-size: 13px; }
.who-block .name { font-size: 14px; font-weight: 600; line-height: 1.2; word-break: keep-all; }
.who-block .chip-me { margin-top: 1px; }
.card.open .who-block { box-shadow: inset 4px 0 0 var(--open); }
.card.done .who-block { box-shadow: inset 4px 0 0 var(--done); }
.card.mine .who-block { background: var(--mine-soft); box-shadow: inset 4px 0 0 var(--mine); }
.card.mine .who-block .name { color: var(--mine); }
.card-main { min-width: 0; padding: 12px 14px 10px; }
.card .top { display: flex; align-items: center; gap: 6px; min-height: 18px; }
.card .title { font-size: 16px; font-weight: 600; line-height: 1.45; letter-spacing: -.01em; margin: 6px 0 10px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; word-break: keep-all; }
.card .title.untitled { font-weight: 500; color: var(--graphite); }
.card .snippet { font-size: 13px; color: var(--graphite); background: var(--paper); border-radius: 4px; padding: 5px 9px; margin: -4px 0 10px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card .snippet mark { background: transparent; color: var(--ink); font-weight: 600; }
.tags { display: flex; flex-wrap: wrap; gap: 4px; }
.tag { font-size: 12px; font-weight: 500; color: var(--graphite); background: var(--paper); border: 1px solid var(--rule); border-radius: 4px; padding: 0 6px; line-height: 19px; }
.foot { display: flex; align-items: center; gap: 6px 12px; font-size: 13px; color: var(--graphite); flex-wrap: wrap; padding-top: 9px; border-top: 1px dashed var(--rule); }
.foot .kv { display: inline-flex; align-items: baseline; gap: 4px; }
.foot .kv b { color: var(--ink); font-weight: 600; }
.foot .age { color: var(--ink); font-weight: 500; }
.foot .due { color: var(--ink); }
.age-pill { --t: 0; display: inline-block; border-radius: 4px; padding: 0 8px; line-height: 21px; font-weight: 600; color: var(--ink);
  background: color-mix(in oklab, var(--late) calc(var(--t) * 85%), var(--rule-soft)); }
.age-pill.strong { color: #fff; }
.foot .end { margin-left: auto; display: inline-flex; align-items: center; gap: 8px; }
.badge-late { color: var(--late); background: var(--late-soft); border-radius: 4px; padding: 0 7px; font-weight: 600; line-height: 21px; }
.badge-link { color: var(--graphite); border: 1px dashed var(--rule); border-radius: 4px; padding: 0 6px; }
.replies { display: inline-flex; align-items: center; gap: 4px; color: var(--graphite); background: var(--paper); border: 1px solid var(--rule); border-radius: 999px; padding: 2px 9px 2px 7px; font-size: 13px; line-height: 18px; }
.replies svg { width: 14px; height: 14px; }
.replies b { color: var(--ink); font-weight: 700; }
.chat-go { display: inline-flex; align-items: center; gap: 4px; color: var(--open); background: var(--open-soft); border: 1px solid transparent; border-radius: 999px; padding: 2px 9px 2px 8px; font-size: 13px; font-weight: 600; line-height: 18px; text-decoration: none; }
.chat-go svg { width: 14px; height: 14px; }
.chat-go .arrow { font-size: 11px; opacity: .8; }
.chat-go:hover, .chat-go:focus-visible { background: var(--open); color: #fff; }

.lane { --hue: 215; border: 1px solid var(--rule); border-top: 5px solid hsl(var(--hue) 45% 55%); border-radius: 8px; background: var(--sheet); margin-bottom: 18px; overflow: hidden; }
.lane.mine { border-top-color: var(--mine); }
.lane-head { display: flex; align-items: center; gap: 14px; padding: 14px 18px; border-bottom: 1px solid var(--rule); }
.lane-head .avatar { width: 44px; height: 44px; font-size: 15px; }
.lane-head .name { font-size: 20px; font-weight: 700; letter-spacing: -.01em; display: flex; align-items: center; gap: 8px; }
.lane-head .full { font-size: 12px; font-weight: 400; color: var(--graphite); }
.lane-head .nums { margin-left: auto; display: flex; gap: 8px; }
.lane-head .nums span { font-size: 15px; font-weight: 700; padding: 5px 12px; border-radius: 999px; background: var(--paper); }
.lane-head .nums .o { color: var(--open); background: var(--open-soft); }
.lane-head .nums .d { color: var(--done); background: var(--done-soft); }
.lane-head .nums .l { color: var(--late); background: var(--late-soft); }
.lane-cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; padding: 14px 18px 18px; background: var(--paper); }
.lane-col h3 { font-size: 15px; font-weight: 700; color: var(--ink); margin: 0 0 10px; display: flex; align-items: center; gap: 8px; }
.lane-col h3 .n { font-size: 15px; font-weight: 800; color: var(--sheet); background: var(--graphite); border-radius: 999px; padding: 2px 10px; min-width: 30px; text-align: center; }
.lane-col:first-child h3 .n { background: var(--open); }
.lane-col:last-child h3 .n { background: var(--done); }

/* ---------- 상세 ---------- */
.scrim { position: fixed; inset: 0; background: rgba(9, 14, 22, .55); backdrop-filter: blur(3px); z-index: 9; }
.drawer { --accent: var(--open); --accent-soft: var(--open-soft); position: fixed; top: 0; right: 0; bottom: 0; width: min(680px, 100vw); background: var(--sheet); box-shadow: -20px 0 60px rgba(0, 0, 0, .3); z-index: 10; display: flex; flex-direction: column; }
.drawer[data-status="done"] { --accent: var(--done); --accent-soft: var(--done-soft); }
.drawer[data-status="late"] { --accent: var(--late); --accent-soft: var(--late-soft); }
.hint { font-size: 12px; color: var(--graphite); margin: 6px 0 0; }

/* 상단 바: 상태 · 스페이스 · 동작 */
.drawer-top { flex: none; display: flex; align-items: center; gap: 10px; padding: 12px 14px 12px 24px; border-bottom: 1px solid var(--rule); }
.lozenge { flex: none; font-size: 12px; font-weight: 700; color: var(--accent); background: var(--accent-soft); border-radius: 4px; padding: 2px 8px; line-height: 18px; }
.crumb { font-size: 13px; color: var(--graphite); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.drawer-actions { margin-left: auto; display: flex; align-items: center; gap: 4px; flex: none; }
.drawer-actions .btn { margin-right: 6px; }
.drawer-actions .icon-btn { border-color: transparent; }
.drawer-actions .icon-btn:hover { background: var(--paper); border-color: transparent; }

/* 본문: 제목 · 세부 정보 · 대화 */
.drawer-body { flex: 1; min-height: 0; overflow: auto; display: grid; grid-template-columns: minmax(0, 1fr); grid-template-areas: "title" "side" "conv"; align-content: start; }
.detail-title { grid-area: title; padding: 22px 24px 0; }
.detail-title h2 { font-size: 22px; font-weight: 700; line-height: 1.4; letter-spacing: -.015em; margin: 8px 0 0; word-break: keep-all; }
.detail-side { grid-area: side; align-self: start; margin: 18px 24px 0; padding: 14px 16px; background: var(--panel); border: 1px solid var(--rule); border-radius: 10px; }
.side-title { font-size: 12px; font-weight: 700; color: var(--graphite); margin: 0 0 12px; }
.meta { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 18px; margin: 0; font-size: 14px; }
.meta .pair { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 10px; align-items: center; min-height: 24px; }
.meta dt { color: var(--graphite); font-size: 13px; }
.meta dd { margin: 0; font-weight: 500; min-width: 0; }
.meta dd.who-cell { display: flex; align-items: center; gap: 8px; }
.meta dd.who-cell span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.meta .avatar { width: 24px; height: 24px; font-size: 10px; }
.readonly { margin: 14px 0 0; padding-top: 10px; border-top: 1px solid var(--rule); font-size: 12px; color: var(--graphite); }
.section { margin-top: 22px; }
.section-title { font-size: 14px; font-weight: 700; margin: 0 0 12px; display: flex; align-items: baseline; gap: 8px; }
.section-title .count { font-weight: 500; color: var(--graphite); font-size: 13px; }
.notes { font-size: 14px; line-height: 1.6; white-space: pre-wrap; padding: 12px 14px; background: var(--panel); border-radius: 8px; }
.link-box { margin-top: 18px; padding: 12px 16px; border: 1px dashed var(--graphite); border-radius: 8px; font-size: 13px; }
.link-box p { margin: 0 0 8px; color: var(--graphite); }
.link-row { display: flex; gap: 8px; }
.link-row select { flex: 1; min-width: 0; }

/* 대화 */
.conversation { grid-area: conv; padding: 0 24px 32px; }
.conversation.section { margin-top: 26px; }
.thread { display: flex; flex-direction: column; gap: 16px; }
.day { display: flex; align-items: center; gap: 12px; font-size: 12px; font-weight: 600; color: var(--graphite); }
.day::before, .day::after { content: ""; flex: 1; height: 1px; background: var(--rule); }
.msg { display: grid; grid-template-columns: 32px minmax(0, 1fr); gap: 12px; }
.msg .avatar { width: 32px; height: 32px; font-size: 12px; }
.msg .head { display: flex; gap: 8px; align-items: baseline; font-size: 12px; color: var(--graphite); }
.msg .head strong { color: var(--ink); font-weight: 600; font-size: 14px; }
.msg .body { margin-top: 6px; font-size: 15px; line-height: 1.6; white-space: pre-wrap; word-break: break-word; background: var(--sheet); border: 1px solid var(--rule); border-radius: 2px 10px 10px 10px; padding: 10px 14px; box-shadow: 0 1px 2px rgba(23, 33, 46, .05); }
.msg.mine .head strong { color: var(--mine); }
.msg.mine .body { box-shadow: inset 3px 0 0 var(--mine), 0 1px 2px rgba(23, 33, 46, .05); }
.attachments { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.att { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; color: var(--ink); font-size: 12px; border: 1px solid var(--rule); border-radius: 8px; padding: 6px 10px; background: var(--panel); max-width: 100%; }
.att:hover { border-color: var(--open); color: var(--open); }
.att.image { flex-direction: column; align-items: flex-start; padding: 6px; }
.att.image img { display: block; max-width: min(100%, 420px); max-height: 260px; border-radius: 4px; background: var(--sheet); }
.att-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 300px; }
.att-kind { color: var(--graphite); }
.att-icon { font-size: 14px; color: var(--graphite); }
.event { display: flex; align-items: center; gap: 12px; font-size: 13px; color: var(--graphite); }
.event::before { content: ""; flex: none; width: 10px; height: 10px; margin: 0 11px; border-radius: 50%; background: var(--rule); box-shadow: 0 0 0 4px var(--panel); }
.event.created::before { background: var(--open); box-shadow: 0 0 0 4px var(--open-soft); }
.event.completed::before { background: var(--done); box-shadow: 0 0 0 4px var(--done-soft); }

/* 가운데 팝업: 왼쪽 본문, 오른쪽 세부 정보 */
.drawer.center { top: 5vh; right: auto; bottom: auto; left: 50%; transform: translateX(-50%); width: min(1100px, 94vw); height: 90vh; border-radius: 12px; box-shadow: 0 30px 90px rgba(0, 0, 0, .45); overflow: hidden; }
.drawer.center .drawer-top { padding: 14px 18px 14px 32px; }
.drawer.center .drawer-body { grid-template-columns: minmax(0, 1fr) 320px; grid-template-areas: "title side" "conv side"; grid-template-rows: auto 1fr; }
.drawer.center .detail-title { padding: 28px 32px 0; }
.drawer.center .detail-title h2 { font-size: 26px; }
.drawer.center .detail-side { position: sticky; top: 0; margin: 28px 28px 28px 0; padding: 18px 20px; }
.drawer.center .meta { grid-template-columns: 1fr; gap: 14px; }
.drawer.center .meta .pair { grid-template-columns: 56px minmax(0, 1fr); }
.drawer.center .conversation { padding: 0 32px 40px; }
.drawer.center .msg .body { font-size: 16px; line-height: 1.65; }
.drawer.center .att.image img { max-width: min(100%, 640px); max-height: 400px; }

/* ---------- 이미지 크게 보기 ---------- */
.att.image { cursor: zoom-in; }
.lightbox { position: fixed; inset: 0; z-index: 40; background: rgba(10, 14, 20, .9); display: flex; flex-direction: column; }
.lb-bar { display: flex; align-items: center; gap: 14px; padding: 10px 16px; color: #e6eaf0; font-size: 13px; flex: none; }
.lb-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.lb-count { color: #9aa6b8; }
.lb-hint { margin-left: auto; color: #9aa6b8; font-size: 12px; }
.lb-link { color: #b9cdf3; text-decoration: none; white-space: nowrap; }
.lb-link:hover { text-decoration: underline; }
.lb-btn { background: transparent; border: 1px solid rgba(255, 255, 255, .3); color: #fff; border-radius: 6px; width: 34px; height: 34px; cursor: pointer; font-size: 15px; flex: none; }
.lb-btn:hover { background: rgba(255, 255, 255, .12); }
.lb-stage { flex: 1; min-height: 0; overflow: auto; display: flex; align-items: center; justify-content: center; padding: 0 64px 24px; }
.lb-stage img { max-width: 100%; max-height: calc(100vh - 80px); object-fit: contain; border-radius: 4px; background: #fff; cursor: zoom-in; }
.lb-stage.actual { align-items: flex-start; justify-content: flex-start; }
.lb-stage.actual img { max-width: none; max-height: none; cursor: zoom-out; margin: auto; }
.lb-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 44px; height: 64px; border: 0; border-radius: 8px; background: rgba(255, 255, 255, .12); color: #fff; font-size: 30px; cursor: pointer; }
.lb-nav:hover { background: rgba(255, 255, 255, .24); }
.lb-nav.prev { left: 12px; }
.lb-nav.next { right: 12px; }

/* ---------- 로그인, 토스트 ---------- */
.login { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; background: var(--paper); z-index: 20; padding: 16px; }
.login-card { width: min(440px, 100%); background: var(--sheet); border: 1px solid var(--rule); border-radius: 14px; padding: 36px 36px 30px; box-shadow: 0 18px 50px rgba(23, 33, 46, .08); }
.login-brand { display: flex; align-items: center; gap: 11px; margin-bottom: 22px; }
.login-brand .logo { width: 40px; height: 40px; }
.login-brand .wordmark { font-size: 26px; }
.login-card h1 { margin: 0 0 8px; font-size: 20px; font-weight: 600; letter-spacing: -.01em; }
.login-card p { color: var(--graphite); margin: 0 0 22px; line-height: 1.6; }
.login-card .btn.big { width: 100%; justify-content: center; gap: 10px; padding: 11px 18px; font-size: 15px; }
.login-card .btn.big svg { width: 18px; height: 18px; }
.login-card .hint { margin: 14px 0 0; font-size: 12px; text-align: center; }
.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--ink); color: var(--sheet); padding: 10px 16px; border-radius: var(--radius); z-index: 30; font-size: 13px; }
.toast.error { background: var(--late); color: #fff; }

/* ---------- 좁은 화면 ---------- */
@media (max-width: 1100px) {
  .layout { grid-template-columns: 240px 1fr; }
  .board { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .topbar { position: static; }
  .titlebar { flex-wrap: wrap; }
  .titlebar-end { margin-left: 0; width: 100%; }
  .search-wrap { flex-basis: 100%; max-width: none; }
  .seg.period { overflow-x: auto; max-width: 100%; }
  .toolbar-end { margin-left: 0; }
  .layout { grid-template-columns: 1fr; }
  .rail { position: static; max-height: none; border-right: 0; border-bottom: 1px solid var(--rule); }
  .rail-cols, .rail-note { display: none; }
  .people { display: flex; overflow-x: auto; gap: 4px; padding: 4px 12px 10px; }
  .person { min-width: 220px; border-left: 0; border-bottom: 3px solid transparent; border-radius: var(--radius); }
  .person[aria-pressed="true"] { border-bottom-color: var(--open); }
  .lane-cols { grid-template-columns: 1fr; }
  .drawer.center { top: 0; left: 0; transform: none; width: 100vw; height: 100vh; border-radius: 0; }
  .drawer.center .drawer-body { grid-template-columns: minmax(0, 1fr); grid-template-areas: "title" "side" "conv"; grid-template-rows: none; }
  .drawer.center .detail-side { position: static; margin: 18px 24px 0; }
  .drawer.center .detail-title, .drawer.center .conversation { padding-left: 24px; padding-right: 24px; }
  .card { grid-template-columns: 68px 1fr; }
  .brand { border-right: 0; padding-right: 0; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
