:root {
  --bg: #0f1226;
  --bg2: #161a36;
  --panel: #1c2145;
  --panel2: #232a55;
  --line: #2c3466;
  --text: #eef0ff;
  --muted: #9aa3d4;
  --brand: #6366f1;
  --brand2: #7c3aed;
  --ok: #22c55e;
  --warn: #f59e0b;
  --danger: #ef4444;
  --chip: #2a3160;
  --radius: 14px;
  --safe-top: env(safe-area-inset-top, 0px);
  /* 바닥값은 평소 0 이고, env 가 0 인데 창이 실제로 시스템 바와 겹칠 때만 JS 가 채운다
     (core.js 의 guardSafeAreaBottom). env 가 답을 주면 max() 가 언제나 그쪽을 고른다. */
  --safe-bottom-floor: 0px;
  --safe-bottom: max(env(safe-area-inset-bottom, 0px), var(--safe-bottom-floor, 0px));
  /* How much of the layout viewport the on-screen keyboard is sitting on top of. Driven from JS
     (syncKeyboardInset) and normally 0: where interactive-widget=resizes-content is honored the
     browser already shrank the viewport for us. It is iOS, which ignores that hint and overlays
     the keyboard instead, that this exists for. */
  --kb: 0px;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; overflow: hidden; }
body {
  font-family: 'Pretendard Variable', Pretendard, -apple-system, BlinkMacSystemFont, "Segoe UI", "Malgun Gothic", "Apple SD Gothic Neo", sans-serif;
  background: var(--bg);
  color: var(--text);
  overscroll-behavior: none;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  letter-spacing: -0.01em;   /* Toss-like tight tracking; Pretendard reads well slightly condensed */
}
/* Tabular figures so counts/codes/times don't jitter as digits change (Toss uses lining tabular nums) */
.badge, .code-big, .pin-input, .app-pin-input, .msg .time, .unread-n, .tab-badge, .tag.due { font-variant-numeric: tabular-nums; }
.app { height: 100vh; height: 100dvh; height: calc(100dvh - var(--kb)); min-height: 0; overflow: hidden;
  display: flex; flex-direction: column; max-width: 720px; margin: 0 auto; position: relative; }
button { font: inherit; color: inherit; cursor: pointer; border: none; background: none; }
input, textarea, select {
  font: inherit; color: var(--text); background: var(--bg2);
  border: 1px solid var(--line); border-radius: 10px; padding: 11px 12px; width: 100%;
}
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--brand); }
::placeholder { color: #6b74a8; }
.btn { background: var(--brand); color: #fff; border-radius: 10px; padding: 11px 14px; font-weight: 600; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.btn.ghost { background: var(--panel2); color: var(--text); }
.btn.wide { width: 100%; }
.btn.sm { padding: 7px 10px; font-size: 13px; border-radius: 8px; }
.btn.danger { background: var(--danger); }
.hidden { display: none !important; }
.spacer { flex: 1; }

/* ---------- Lobby ---------- */
.lobby { flex: 1; overflow-y: auto; padding: calc(var(--safe-top) + 20px) 18px calc(var(--safe-bottom) + 24px); }
.brand { display: flex; align-items: center; gap: 12px; margin-bottom: 6px; }
.brand img { width: 44px; height: 44px; border-radius: 12px; }
.brand > div:nth-child(2) { min-width: 0; }
.brand h1 { font-size: 22px; margin: 0; }
.brand p { margin: 2px 0 0; color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.brand-actions { display: flex; align-items: center; gap: 6px; flex: none; }
.brand-actions .btn { white-space: nowrap; }
.lobby-settings { width: 44px; height: 44px; display: grid; place-items: center; flex: none;
  border-radius: 9px; background: var(--panel2); color: var(--muted); font-size: 19px; }
.lobby-settings:active { background: var(--panel); }
.lobby-settings:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
@media (max-width: 360px) {
  .brand { gap: 8px; }
}
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-top: 16px; }
.card h2 { font-size: 15px; margin: 0 0 10px; color: var(--muted); font-weight: 600; }
.field { margin-bottom: 10px; }
.field label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 5px; }
.row { display: flex; gap: 8px; }
.row > * { flex: 1; }

.member-card { display: flex; align-items: center; gap: 10px; padding: 13px 14px; }
.member-main { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; }
.member-main > div:last-child { min-width: 0; }
.member-main b { display: block; font-size: 14px; }
.member-main p { margin: 3px 0 0; color: var(--muted); font-size: 13px; line-height: 1.45; }
.google-mark { width: 32px; height: 32px; border-radius: 9px; flex: none; display: grid; place-items: center;
  background: #fff; color: #4285f4; border: 1px solid #d8dce8; font-weight: 800; font-family: Arial, sans-serif; }

.lobby-entry { display: grid; gap: 9px; padding: 11px; margin: 2px 0; border: 1px solid var(--line);
  border-radius: 12px; background: var(--bg2); }
.entry-block > label { display: block; margin: 0 2px 5px; color: var(--muted); font-size: 12px; font-weight: 650; }
.entry-row { display: flex; gap: 7px; align-items: stretch; }
.entry-row input { min-width: 0; padding: 9px 10px; font-size: 13px; background: var(--panel); }
.entry-row .btn { flex: none; min-width: 52px; }
.entry-error { margin: 4px 2px 0; color: var(--danger); font-size: 13px; line-height: 1.4; }
.entry-error:empty { display: none; }
.inline-link { color: var(--brand); text-decoration: underline; padding: 0; font-size: inherit; }

.roomlist { display: flex; flex-direction: column; gap: 10px; margin-top: 8px; }
.room-section-head { display: flex; align-items: flex-start; gap: 10px; margin: 10px 2px 2px; }
.room-section-copy { flex: 1; min-width: 0; padding-top: 5px; }
.room-section-head .r-sect { margin: 0; }
.room-sort-controls { display: flex; flex: none; flex-direction: column; align-items: flex-end; gap: 3px; }
.room-sort-line { display: flex; align-items: center; gap: 7px; }
.room-sort-label { color: var(--muted); font-size: 11px; font-weight: 700; white-space: nowrap; }
.room-sort-hint { color: var(--muted); font-size: 11px; line-height: 1.35; text-align: right; white-space: nowrap; }
.room-sort-toggle { display: inline-flex; flex: none; padding: 2px; border: 1px solid var(--line);
  border-radius: 9px; background: var(--bg2); }
.room-sort-option { min-width: 46px; padding: 6px 9px; border-radius: 7px;
  color: var(--muted); font-size: 12px; font-weight: 700; }
.room-sort-option.active { background: var(--brand); color: #fff; }
.mine-room-list { display: flex; flex-direction: column; gap: 10px; }
.room-pref-row { display: flex; align-items: stretch; gap: 7px; min-width: 0; }
.room-pref-row .room-item { flex: 1; width: auto; min-width: 0; }
.room-pref-action { width: 44px; flex: none; display: grid; place-items: center; border: 1px solid var(--line);
  border-radius: 12px; background: var(--panel); color: var(--muted); font-size: 21px; }
.room-pref-action:active { border-color: var(--brand); background: var(--panel2); }
/* 즐겨찾기 «표시». 예전에는 카드 옆 44px 짜리 버튼이었는데, 켜고 끄는 일이 잦지 않은 것에
   목록의 폭을 늘 내주고 있었다 — 그 자리는 방 이름이 쓴다. 켜는 곳은 방 안 설정이고 여기는
   결과만 보여 준다. 그래서 버튼이 아니라 이름 옆의 작은 글자다. */
.room-item .fav-star { color: var(--warn); font-size: 12px; margin-left: 6px; line-height: 1; }
.room-sort-handle { touch-action: none; cursor: grab; font-size: 20px; font-weight: 800; }
.room-sort-handle:active { cursor: grabbing; }
.room-sort-source { opacity: .28; }
.room-sort-ghost { position: fixed; z-index: 70; pointer-events: none; margin: 0;
  filter: drop-shadow(0 12px 18px rgba(0,0,0,.28)); }
@media (max-width: 390px) {
  .room-section-head { gap: 8px; }
  .room-sort-hint { font-size: 10.5px; }
  .room-sort-option { min-width: 43px; padding-inline: 7px; }
}
.room-item { display: flex; align-items: center; gap: 12px; background: var(--panel); border: 1px solid var(--line);
  border-radius: 12px; padding: 14px; text-align: left; width: 100%; transition: border-color .15s; }
.room-item:active { border-color: var(--brand); }
.room-item .r-ava { width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--brand), var(--brand2)); color: #fff; font-weight: 700; font-size: 17px; flex: none;
  text-shadow: 0 1px 2px rgba(0,0,0,.25); }   /* was inheriting dark --text → initials blended into the gradient */
.room-item .r-main { flex: 1; min-width: 0; }
/* 카드의 두 줄이 각각 하는 일:
     윗줄  이름 + 자물쇠. 이름이 이 줄을 «거의 통째로» 쓴다.
     아랫줄 할일 개수(왼쪽)와 마지막 활동 시각(오른쪽).
   시각이 윗줄에 있던 동안에는 이름이 네댓 글자에서 끊겼다. 좁은 줄 하나를 셋이 나눠 쓰면
   누가 밀리느냐만 바뀔 뿐이라, 아랫줄을 줄여 자리를 만들고 시각을 그리로 내렸다. */
.room-item .r-name { font-weight: 600; font-size: 15px;
  display: flex; align-items: baseline; min-width: 0; }
.room-item .r-sub { display: flex; align-items: baseline; min-width: 0; }
.room-item .rn-t,
.room-item .rs-t { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* 줄어드는 것은 «각 줄의 첫 칸 하나» 다. flex 아이템은 기본으로 내용보다 작아질 수 있어서, 이
   두 줄이 없으면 자리가 모자랄 때 옆의 표식들이 함께 눌린다 — 「저장됨」이 글자마다 줄바꿈되어
   «저/장/됨» 세 줄이 되고 그만큼 행이 통째로 높아졌다(실제로 그렇게 나갔다). `:not(...)` 로
   적은 것은 나중에 표식이 하나 더 붙어도 같은 규칙이 저절로 적용되게 하기 위해서다. */
.room-item .r-name > :not(.rn-t),
.room-item .r-sub > :not(.rs-t) { flex: none; white-space: nowrap; }
.room-item .r-time { margin-left: auto; padding-left: 8px;
  color: var(--muted); font-size: 11.5px; font-weight: 500; }
.badge { background: var(--brand); color: #fff; border-radius: 999px; font-size: 12px; font-weight: 700;
  min-width: 22px; height: 22px; padding: 0 7px; display: grid; place-items: center; }
.badge.zero { background: var(--panel2); color: var(--muted); }
.r-tail { display: inline-flex; align-items: center; gap: 5px; flex: none; }
.badge.room-unread { background: var(--danger); min-width: 24px; }
.saved-tag { font-size: 10px; font-weight: 600; color: var(--ok); background: #14361f; border-radius: 999px; padding: 1px 7px; margin-left: 7px; vertical-align: middle; }
.r-go { color: var(--muted); font-size: 22px; padding: 0 4px; }
.linklike { color: var(--muted); font-size: 13px; text-align: center; padding: 10px; width: 100%; text-decoration: underline; }
.empty { color: var(--muted); text-align: center; padding: 24px; font-size: 14px; }

/* ---------- Room ---------- */
.room { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.topbar { display: flex; align-items: center; gap: 8px; padding: calc(var(--safe-top) + 8px) 12px 8px;
  background: var(--bg2); border-bottom: 1px solid var(--line); }
.topbar .iconbtn { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; font-size: 20px; color: var(--muted); }
.topbar .iconbtn:active { background: var(--panel); }
.topbar .title { flex: 1; min-width: 0; }
.topbar .title b { display: block; font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar .title span { font-size: 11px; color: var(--muted); }

.tabs { display: flex; background: var(--bg2); border-bottom: 1px solid var(--line); }
.tabs button { flex: 1; padding: 13px 12px; font-weight: 600; font-size: 15.5px; color: var(--muted);
  position: relative; transition: color .15s, background .15s; }
/* selected tab: brand color + extra-bold + subtle raised fill + full-width underbar — unmistakable
   against the muted inactive tab (the old centered 3px line was too easy to miss on mobile) */
.tabs button.active { color: var(--brand); font-weight: 800; background: var(--panel2); }
.tabs button.active::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 3px;
  background: var(--brand); }
/* ＋ 는 flex 칸이 아니다. 주 탭 셋이 폭을 나눠 갖고 이 버튼은 자기 글자만큼만 차지한다 — 그래야
   기능이 늘어도 «할일·메모·채팅» 이 좁아지지 않는다. 세로선은 이게 넷째 탭이 아니라 서랍이라는
   표시다. 열려 있는 동안에는 그 탭 이름을 달고 .tabs button.active 를 그대로 물려받는다. */
.tabs .tab-more { flex: none; border-left: 1px solid var(--line); padding-left: 13px; padding-right: 13px; }
.tabs .tab-more:not(.active) { font-size: 19px; line-height: 1; }
.sheet .more-cur { font-size: 11px; color: var(--muted); margin-left: 7px; }
.tabs .tab-badge { position: absolute; top: 7px; margin-left: 5px; background: var(--danger); color: #fff;
  font-size: 10px; min-width: 16px; height: 16px; border-radius: 999px; padding: 0 4px; display: inline-grid; place-items: center; }

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

/* ---------- Chat ---------- */
.chat-scroll { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior-y: contain;
  padding: 14px; display: flex; flex-direction: column; gap: 8px; }
.msg { max-width: 82%; padding: 9px 12px; border-radius: 14px; background: var(--panel); border: 1px solid var(--line);
  align-self: flex-start; word-break: break-word; }
.msg .time { font-size: 10px; color: var(--muted); margin-top: 4px; text-align: right; }
.msg.mine { align-self: flex-end; background: linear-gradient(135deg, var(--brand), var(--brand2)); border-color: transparent; }

/* chat profile circles: colored first-letter avatar + name, grouped per author */
.msg-line { display: flex; align-items: flex-start; gap: 8px; align-self: flex-start; max-width: 90%; }
.msg-line.cont { margin-top: -4px; }
.msg-col { display: flex; flex-direction: column; min-width: 0; }
.msg-line .msg { max-width: 100%; align-self: flex-start; }
/* 40px, not the 34px it started at. The circle is mostly a FACE now that profiles carry photos,
   and at 34 a face was a smudge. The spacer below must always match this width or continuation
   lines stop aligning with the first line of their own group. */
.chat-ava { width: 40px; height: 40px; border-radius: 50%; flex: none; display: grid; place-items: center;
  font-size: 16px; font-weight: 800; color: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.35);
  user-select: none; -webkit-user-select: none; position: relative; overflow: hidden; }
/* A profile picture is laid OVER the colored initial rather than replacing it, so removing the
   <img> (onerror) uncovers the initial again instead of leaving an empty circle. */
.chat-ava img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.chat-ava.ava-lg { width: 104px; height: 104px; font-size: 40px; }
.chat-ava-sp { width: 40px; flex: none; }
.who { font-size: 11.5px; font-weight: 600; margin: 1px 0 3px 2px; }
.msg.system { align-self: center; background: transparent; border: none; color: var(--muted); font-size: 12px; text-align: center; }
.msg a { color: #c7d2fe; }
.filecard { display: flex; gap: 10px; align-items: center; text-decoration: none; color: inherit; }
.filecard .fc-ic { width: 40px; height: 40px; border-radius: 9px; background: var(--panel2); display: grid; place-items: center; font-size: 20px; flex: none; }
.filecard .fc-name { font-weight: 600; font-size: 14px; word-break: break-all; }
.filecard .fc-sub { font-size: 11px; color: var(--muted); }
.file-preview { margin-top: 8px; border-radius: 10px; overflow: hidden; border: 1px solid var(--line); background: #000; }
.file-preview img { width: 100%; display: block; }
.file-preview iframe { width: 100%; height: 260px; border: 0; background: #fff; }

/* replies */
.msg .reply-quote { border-left: 3px solid var(--brand); background: rgba(255,255,255,.07); padding: 5px 9px;
  border-radius: 7px; margin-bottom: 6px; font-size: 12px; cursor: pointer; }
.msg .reply-quote b { display: block; font-size: 11px; color: #c7d2fe; margin-bottom: 1px; }
.msg .reply-quote span { color: var(--muted); }
.msg.mine .reply-quote { background: rgba(255,255,255,.16); border-left-color: rgba(255,255,255,.6); }
.msg.mine .reply-quote b, .msg.mine .reply-quote span { color: #f0f0ff; }
.msg.flash { outline: 2px solid var(--brand); outline-offset: 2px; transition: outline-color .3s; }

/* task card inside a chat message */
.task-ref { display: flex; align-items: center; gap: 7px; width: 100%; text-align: left;
  background: #22364a; color: #cfe8ff; padding: 7px 10px; border-radius: 9px; margin-bottom: 6px; font-size: 12.5px; }
.msg.mine .task-ref { background: rgba(255,255,255,.16); color: #fff; }
.task-ref b { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.task-ref .tr-go { font-size: 16px; opacity: .7; }

/* bubble footer: reply button + unread counter + time */
.msg-foot { display: flex; align-items: center; justify-content: flex-end; gap: 7px; margin-top: 4px; }
.msg-foot .time { margin-top: 0; }
.msg-send-status { font-size: 11px; opacity: .7; }
.msg-send-failed { display: inline-flex; align-items: center; gap: 6px; color: #dc2626; }
.msg-send-failed > span { font-size: 20px; font-weight: 800; line-height: 1; }
.msg-send-failed button { color: inherit; border: 1px solid currentColor; border-radius: 4px; background: transparent; padding: 2px 5px; font-size: 11px; cursor: pointer; }
.msg-reply { font-size: 12px; color: var(--muted); opacity: .8; padding: 0 2px; line-height: 1; }
.msg.mine .msg-reply { color: #dcdcff; }
.unread-n { font-size: 10px; font-weight: 800; color: #ffd54a; min-width: 10px; text-align: center; }

/* uploaded images */
.img-wrap { display: block; }
.img-wrap img { max-width: min(300px, 100%); max-height: 300px; border-radius: 10px; display: block; }
/* photo album: several photos in one message, as square tiles */
/* A DEFINITE width, not min(300px, 100%): .msg shrink-wraps its content, so a percentage width here
   would be resolved against a containing block that the album itself is sizing — the circularity
   collapsed the grid to ~140px. width + max-width is the pattern that gives the bubble something to
   size to while still fitting a narrow screen. */
.album { display: grid; gap: 3px; width: 300px; max-width: 100%; border-radius: 10px; overflow: hidden; }
.album-tile { display: block; aspect-ratio: 1; background: var(--panel2); }
.album-tile img { width: 100%; height: 100%; object-fit: cover; display: block; }
.album-tile:active { opacity: .78; }
/* v98: was a fixed 11.5px — the smallest text in the app, and «탭하여 크게 보기» is an instruction.
   Scaled by --fs like everything else in a bubble, so 글자 크기 now reaches it too. */
.album-foot { margin-top: 5px; font-size: calc(12.5px * var(--fs)); color: var(--muted); }
.msg.mine .album-foot { color: #e7e6ff; }
.filecard.expired { opacity: .6; }

/* reply compose bar */
.reply-bar { display: flex; align-items: center; gap: 9px; padding: 8px 14px; background: var(--panel);
  border-top: 1px solid var(--line); font-size: 12px; }
.reply-bar .rb-ic { color: var(--brand); font-size: 15px; }
.reply-bar .rb-main { flex: 1; min-width: 0; }
.reply-bar .rb-main b { font-size: 12px; color: #c7d2fe; }
.reply-bar .rb-snip { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.reply-bar .rb-x { width: 28px; height: 28px; color: var(--muted); font-size: 13px; flex: none; }

/* task thread sheet */
.thread-list { max-height: 38vh; overflow-y: auto; display: flex; flex-direction: column; gap: 7px; margin-bottom: 12px; }
.thread-msg { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px;
  font-size: 13px; word-break: break-word; }
.thread-msg b { color: #c7d2fe; font-size: 12px; }
.thread-msg .th-time { display: block; font-size: 10px; color: var(--muted); margin-top: 3px; text-align: right; }

/* invite banner in the lobby */
.invite-banner { border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand) inset; }

.composer { display: flex; flex: none; gap: 8px; padding: 10px 12px calc(var(--safe-bottom) + 10px);
  background: var(--bg2); border-top: 1px solid var(--line); align-items: flex-end; }
.composer textarea { resize: none; max-height: 120px; min-height: 44px; }
.composer .iconbtn { width: 44px; height: 44px; border-radius: 10px; background: var(--panel2); display: grid; place-items: center; font-size: 20px; flex: none; }
.composer .send { background: var(--brand); }

/* ---------- Tasks ---------- */
.tasks-head { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--line); background: var(--bg2); }
.filterseg { display: flex; background: var(--panel); border-radius: 9px; padding: 3px; gap: 3px; }
.filterseg button { padding: 6px 11px; font-size: 13px; border-radius: 7px; color: var(--muted); }
.filterseg button.active { background: var(--brand); color: #fff; }
.tasks-scroll { flex: 1; overflow-y: auto; padding: 8px 10px calc(var(--safe-bottom) + 88px); }
.task-list { position: relative; }

.task { display: flex; align-items: flex-start; gap: 10px; padding: 10px; border-radius: 11px; background: var(--panel);
  border: 1px solid var(--line); margin: 6px 0; touch-action: pan-y; position: relative;
  user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.task.dragging { opacity: .3; }
.task.selected { border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand); }
.task.pinned { border-color: var(--brand); }
.task.flash { animation: taskflash 1.6s ease; }
@keyframes taskflash { 0%, 55% { background: #2b3f7a; border-color: var(--brand); } 100% { background: var(--panel); } }
.task.done .t-title { text-decoration: line-through; color: var(--muted); }
.task.cancelled .t-title { text-decoration: line-through; color: var(--muted); opacity: .7; }
/* 보류: parked, not finished. Dimmed enough to fall out of the scan and no further — .55 keeps the
   title legible on both the light and dark palettes, and there is no strike-through because a held
   task is still going to happen. Sorting puts it at the bottom of its level (see taskBand). */
.task.held { opacity: .55; }
.task.held:active { opacity: .8; }
.check { width: 24px; height: 24px; border-radius: 7px; border: 2px solid var(--line); flex: none; margin-top: 1px;
  display: grid; place-items: center; font-size: 15px; color: transparent; background: var(--bg2); }
.task.done .check { background: var(--ok); border-color: var(--ok); color: #fff; }
.task.cancelled .check { background: var(--panel2); border-color: var(--line); color: var(--muted); }
.t-body { flex: 1; min-width: 0; }
.t-title { font-size: 15px; font-weight: 500; word-break: break-word; }
.t-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 5px; align-items: center; }
.tag { font-size: 11px; padding: 2px 8px; border-radius: 999px; background: var(--chip); color: var(--muted); display: inline-flex; align-items: center; gap: 3px; }
.tag.assignee { background: #2b2f66; color: #c7d0ff; }
.tag.due { background: #33305e; color: #d6c9ff; }
.tag.due.soon { background: #4a3a1a; color: #ffd28a; }
.tag.due.over { background: #4a1f22; color: #ffb4b4; }
.tag.kids { background: #22364a; color: #a9d8ff; }
.tag.pinned { background: var(--taskref-bg); color: var(--taskref-fg); }
.tag.held { background: var(--chip); color: var(--muted); }
.t-details { font-size: 12.5px; color: var(--muted); margin-top: 4px; white-space: pre-wrap; word-break: break-word; }
.t-expand { width: 26px; height: 26px; border-radius: 7px; display: grid; place-items: center; color: var(--muted); flex: none; font-size: 12px; }
.t-expand.open { transform: rotate(90deg); }
.subtree { margin-left: 18px; border-left: 2px solid var(--line); padding-left: 6px; }

/* ---- 접힌 할일: 밑에 카드가 겹쳐 있는 것처럼 (v92) ----
   A folded parent and a childless task were the same flat card. Two slivers of card edge peek out
   from under the bottom, each narrower than the one above it — a stack of paper, read in one look.

   Both layers sit ENTIRELY BELOW the card (top: 100%), which is what lets this work without
   z-index: -1. A pseudo-element paints AFTER its host's background, so a layer that overlapped the
   card would cover it, and pushing it behind with a negative z-index escapes to whatever ancestor
   owns the stacking context — where a background can swallow it. Nothing overlaps here except the
   two layers with each other, and ::after painting over ::before is exactly the order we want:
   the near layer clips the far one down to a sliver.

   Two things make the steps readable, and the first pass had neither strongly enough. The insets
   have to differ by more than a hairline (7px → 16px, so each edge is obviously its own card), and
   the far layer is faded rather than recoloured: `opacity` blends it toward whatever is behind the
   list, so "further away" survives both the light and the dark palettes. A darker fill would have
   meant picking a colour that reads as recessed in one theme and raised in the other.

   The extra bottom margin is not decoration — without it the stack would sit on the next row. */
.task.folded { margin-bottom: 20px; }
.task.folded::before, .task.folded::after {
  content: ''; position: absolute; top: 100%;
  background: var(--panel); border: 1px solid var(--line); border-top: 0;
  pointer-events: none;
}
.task.folded::before { left: 16px; right: 16px; height: 12px; border-radius: 0 0 9px 9px; opacity: .72; }
.task.folded::after  { left: 7px;  right: 7px;  height: 6px;  border-radius: 0 0 10px 10px; }
/* the drag clone is lifted out of the list, so a stack hanging off it just smears the ghost */
.task.folded.ghost::before, .task.folded.ghost::after { display: none; }

/* drag: the row itself lifts (clone), a thick indented line marks the drop spot */
.drop-into { outline: 2px dashed var(--ok); outline-offset: 1px; border-radius: 11px; }
.task.ghost { position: fixed; z-index: 100; margin: 0; pointer-events: none; opacity: .95;
  border-color: var(--brand); box-shadow: 0 16px 38px rgba(0,0,0,.55); background: var(--panel2); }
.task.ghost.nesting { border-color: var(--ok); }
.ins-line { position: fixed; z-index: 99; height: 4px; border-radius: 4px; background: var(--brand);
  box-shadow: 0 0 10px var(--brand); pointer-events: none; transition: left .07s linear, top .07s linear, width .07s linear; }
body.dragging-lock { user-select: none; -webkit-user-select: none; }
.t-chat { width: 26px; height: 26px; border-radius: 7px; display: grid; place-items: center; flex: none;
  font-size: 14px; color: var(--muted); position: relative; }
.t-chat .cnt { position: absolute; top: -4px; right: -5px; background: var(--brand); color: #fff;
  font-size: 9px; font-weight: 700; min-width: 14px; height: 14px; border-radius: 999px; padding: 0 3px;
  display: grid; place-items: center; }

/* long-press task actions (movement itself stays direct-manipulation drag only) */
.move-bar { position: absolute; left: 10px; right: 10px; bottom: calc(var(--safe-bottom) + 12px);
  background: var(--panel2); border: 1px solid var(--brand); border-radius: 14px; padding: 10px 12px;
  z-index: 30; box-shadow: 0 12px 30px rgba(0,0,0,.5); }
.mv-top { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.mv-title { flex: 1; min-width: 0; font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mv-pin { color: var(--muted); font-size: 12px; font-weight: 700; padding: 4px 8px; border-radius: 8px; background: var(--panel); white-space: nowrap; }
.mv-pin.on { color: var(--taskref-fg); background: var(--taskref-bg); }
.mv-edit { color: #c7d2fe; font-size: 13px; font-weight: 600; padding: 4px 8px; border-radius: 8px; background: var(--panel); }
.mv-close { width: 28px; height: 28px; border-radius: 8px; color: var(--muted); font-size: 14px; }
.mv-row { display: flex; gap: 6px; }
.mv-row + .mv-row { margin-top: 6px; }
.mv-btn { flex: 1; min-width: 0; background: var(--panel); border: 1px solid var(--line); border-radius: 10px;
  padding: 7px 4px 6px; display: grid; place-items: center; gap: 1px; }
.mv-btn b { font-size: 15px; line-height: 1; }
/* `> span` — NOT a descendant selector. The icon now lives in a <span class="ui-ic"> inside the <b>
   (so 심플 can swap it for a line drawing), and a loose `.mv-btn span` would drag that one down to
   the 12px label size in every OTHER theme, shrinking the emoji it is supposed to leave alone. */
.mv-btn > span { font-size: 12px; color: var(--text); font-weight: 700; white-space: nowrap; }
.mv-btn:active { background: var(--chip); }
.mv-btn.on { background: var(--taskref-bg); border-color: var(--taskref-fg); }
.mv-btn.on > span, .mv-btn.on b { color: var(--taskref-fg); }
/* 삭제 — 되돌릴 수 없는 하나뿐이므로 글자색만 위험색으로. 배경까지 칠하면 4칸 중 한 칸이
   버튼 무리에서 튀어나와 오탭을 부른다. */
.mv-btn.danger b, .mv-btn.danger > span { color: var(--danger); }
.undo-bar { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-bottom: 1px solid var(--line);
  background: var(--taskref-bg); color: var(--taskref-fg); font-size: calc(12.5px * var(--fs)); font-weight: 600; }
.undo-bar span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.undo-bar .ub-x { width: 30px; height: 30px; border-radius: 8px; color: inherit; opacity: .6; flex: none; }

.fab { position: absolute; right: 18px; bottom: calc(var(--safe-bottom) + 20px); width: 56px; height: 56px; border-radius: 50%;
  background: linear-gradient(135deg, var(--brand), var(--brand2)); color: #fff; font-size: 28px; display: grid; place-items: center;
  box-shadow: 0 8px 24px rgba(79,70,229,.5); z-index: 20; }
.fab:active { transform: scale(.94); }

/* 할일 추가: 맨 위 / 맨 아래 (v92) — the .fab circle, cut across the middle.
   The first attempt was a 54×66 rounded slab and it read as a SCROLLBAR parked over the list: a
   tall pill against a scrolling column is exactly what a scroll thumb looks like. Keeping the
   round outline is what stops that, so this is .fab's geometry (56px, 50%) with two halves inside
   and one hairline between them. overflow:hidden clips each half to the circle, which is why the
   divider draws as a chord rather than a full-width rule. */
.fab-split { position: absolute; right: 18px; bottom: calc(var(--safe-bottom) + 20px); z-index: 20;
  width: 56px; height: 56px; border-radius: 50%; overflow: hidden; display: flex; flex-direction: column;
  background: linear-gradient(135deg, var(--brand), var(--brand2)); box-shadow: 0 8px 24px rgba(79,70,229,.5); }
.fab-half { flex: 1; min-height: 0; color: #fff; font-size: 19px; line-height: 1;
  display: grid; place-items: center; background: transparent; }
/* the ＋ sits in the middle of its own half, i.e. at 25%/75% of the circle — nudge each one a
   little toward the centre line so neither lands where the circle has already narrowed */
.fab-half:first-child { padding-top: 4px; }
.fab-half:last-child { padding-bottom: 4px; border-top: 1px solid rgba(255,255,255,.32); }
.fab-half:active { background: rgba(0,0,0,.18); }

/* ---------- Modal / sheet ---------- */
.overlay { position: fixed; inset: 0 0 auto; height: 100vh; height: 100dvh; height: calc(100dvh - var(--kb));
  background: rgba(4,6,20,.6); backdrop-filter: blur(3px); z-index: 50;
  display: flex; align-items: flex-end; justify-content: center; }
.sheet { background: var(--bg2); width: 100%; max-width: 720px; border-radius: 20px 20px 0 0; border: 1px solid var(--line);
  padding: 8px 18px calc(var(--safe-bottom) + 20px); max-height: calc(100dvh - var(--kb) - 16px);
  overflow-y: auto; animation: up .22s ease; }
.sheet.center { border-radius: 18px; align-self: center; margin: auto; max-width: 460px; }
.overlay.mid { align-items: center; }
/* A dialog (confirm / prompt) stacks ABOVE an open sheet rather than replacing it — window.confirm
   never closed what raised it, and neither should this. Below the toast (200) on purpose, so the
   "삭제했어요" that follows a confirmation is still readable over the fading backdrop. */
.overlay.dialog { z-index: 120; background: rgba(4,6,20,.5); }
.overlay.dialog .sheet { max-width: 400px; }
/* 사진 크게 보기 (v89). Above the dialog, still below the toast. Deliberately NOT built on .overlay:
   that class is themed (the simple themes repaint its background with a more specific selector), and
   a photo viewer is black in every theme. Nearly opaque rather than a scrim — this layer exists to
   look at ONE thing, and a half-visible chat behind it competes with the photo. No blur either:
   backdrop-filter on a full-screen layer costs a repaint on every frame of a pinch. */
.lb { position: fixed; inset: 0; height: 100vh; height: 100dvh; z-index: 140;
  background: rgba(0,0,0,.96); display: flex; align-items: stretch; justify-content: stretch; }
/* touch-action: none is what makes the gestures ours. Without it the browser claims the drag for
   scroll/overscroll first and the pan arrives already half-eaten (or, on iOS, as a page bounce). */
.lb-stage { flex: 1; min-width: 0; display: flex; align-items: center; justify-content: center;
  overflow: hidden; touch-action: none; user-select: none; -webkit-user-select: none; }
/* width/height auto so the <img> box IS the photo. With object-fit the box would stay the whole
   stage and the letterbox would count as part of the image — the pan bounds would then let the
   picture be dragged clean off screen. */
.lb-img { max-width: 100%; max-height: 100%; width: auto; height: auto; display: block;
  transform-origin: 50% 50%; -webkit-user-drag: none; }
.lb.lb-broken .lb-img { display: none; }
.lb.lb-broken .lb-stage::after { content: '사진을 불러오지 못했어요'; color: #cbd5e1; font-size: 14px; }
.lb-x, .lb-nav { position: absolute; border: 0; background: rgba(20,22,34,.62); color: #fff;
  border-radius: 999px; display: grid; place-items: center; cursor: pointer; }
.lb-x { top: calc(var(--safe-top) + 10px); right: 12px; width: 40px; height: 40px; font-size: 17px; }
.lb-nav { top: 50%; transform: translateY(-50%); width: 44px; height: 44px; font-size: 26px; line-height: 1; padding-bottom: 4px; }
.lb-prev { left: 8px; }
.lb-next { right: 8px; }
.lb-x:active, .lb-nav:active { background: rgba(20,22,34,.9); }
.lb-foot { position: absolute; left: 0; right: 0; bottom: 0; display: flex; align-items: center;
  justify-content: space-between; gap: 12px; padding: 26px 16px calc(var(--safe-bottom) + 14px);
  background: linear-gradient(rgba(0,0,0,0), rgba(0,0,0,.72)); pointer-events: none; }
.lb-cap { color: #e2e8f0; font-size: 12.5px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-orig { color: #c7d2fe; font-size: 12.5px; flex: none; pointer-events: auto; }
@keyframes up { from { transform: translateY(30px); opacity: .6; } to { transform: none; opacity: 1; } }
.grabber { width: 40px; height: 4px; background: var(--line); border-radius: 3px; margin: 8px auto 12px; }
.sheet h3 { margin: 4px 0 14px; font-size: 17px; }
.sheet .field { margin-bottom: 12px; }
.actions { display: flex; gap: 8px; margin-top: 16px; }
.actions .btn { flex: 1; }

.switch { display: flex; align-items: center; justify-content: space-between; padding: 12px 0; border-bottom: 1px solid var(--line); gap: 10px; }
.switch:last-child { border-bottom: none; }
/* 설명이 길어져도 버튼이 그 값을 치르지 않게. 이게 없으면 버튼이 남은 폭에 맞춰 줄어들다가 글자
   안에서 줄바꿈했다 — 「지우기」가 「지우/기」로, 「로그인」이 한 글자씩 세 줄로. v98 타입 조정
   이전부터 있던 문제고, 조정이 그걸 한 줄 더 나쁘게 만들면서 드러났다. 설명을 키우는 일이 버튼을
   깨뜨릴 수 있어서는 안 된다. */
.switch > .btn { flex: none; white-space: nowrap; }
.switch .s-label b { font-size: 14px; }
.switch .s-label p { margin: 2px 0 0; font-size: 12px; color: var(--muted); }
.toggle { width: 48px; height: 28px; border-radius: 999px; background: var(--line); position: relative; flex: none; transition: background .15s; }
.toggle::after { content: ''; position: absolute; width: 22px; height: 22px; border-radius: 50%; background: #fff; top: 3px; left: 3px; transition: left .15s; }
.toggle.on { background: var(--ok); }
.toggle.on::after { left: 23px; }
.checkline { display: flex; align-items: center; gap: 9px; margin-top: 10px; font-size: 14px; color: var(--muted); }
.checkbox { width: 22px; height: 22px; border-radius: 6px; border: 2px solid var(--line); display: grid; place-items: center; color: transparent; flex: none; }
.checkbox.on { background: var(--brand); border-color: var(--brand); color: #fff; }

.toast { position: fixed; left: 50%; bottom: 90px; transform: translateX(-50%) translateY(20px); background: #000c; color: #fff;
  padding: 10px 16px; border-radius: 999px; font-size: 13px; opacity: 0; pointer-events: none; transition: all .25s; z-index: 200; max-width: 90%; text-align: center; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

.hint { font-size: 12px; color: var(--muted); line-height: 1.5; }
.dnd-times { display: flex; gap: 10px; align-items: center; }
.dnd-times input { text-align: center; }
select { appearance: none; background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8'><path d='M1 1l5 5 5-5' stroke='%239aa3d4' stroke-width='2' fill='none'/></svg>"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 34px; }

/* ==================== user appearance: themes + font size ==================== */
:root { --fs: 1; }
/* color themes (override the base indigo palette when data-theme is set) */
:root[data-theme="slate"]  { --bg:#0f1117; --bg2:#161922; --panel:#1c202c; --panel2:#252a38; --line:#333a4a; --text:#eef1f7; --muted:#98a2b8; --brand:#3b82f6; --brand2:#2563eb; --chip:#2a3040; }
:root[data-theme="ocean"]  { --bg:#07191f; --bg2:#0b232b; --panel:#0f2e37; --panel2:#143a45; --line:#1e4c58; --text:#e7f6f8; --muted:#8db3bb; --brand:#06b6d4; --brand2:#0e7490; --chip:#123e48; }
:root[data-theme="forest"] { --bg:#0b1611; --bg2:#0f1f18; --panel:#142a20; --panel2:#1b3529; --line:#264d3a; --text:#e9f5ee; --muted:#93b5a1; --brand:#22c55e; --brand2:#15803d; --chip:#1c3b2c; }
:root[data-theme="plum"]   { --bg:#160f1d; --bg2:#1d1426; --panel:#271931; --panel2:#33223f; --line:#452f50; --text:#f2ecf7; --muted:#b09bbd; --brand:#a855f7; --brand2:#7c3aed; --chip:#332340; }
:root[data-theme="sunset"] { --bg:#191310; --bg2:#221a12; --panel:#2c2016; --panel2:#382a1d; --line:#4d3927; --text:#f7f0e8; --muted:#bda893; --brand:#f97316; --brand2:#ea580c; --chip:#3a2a1c; }

/* content font-size scale (declared last so it wins over the base sizes) */
.msg { font-size: calc(15px * var(--fs)); }
.who { font-size: calc(11.5px * var(--fs)); }
.msg .reply-quote { font-size: calc(12px * var(--fs)); }
.task-ref { font-size: calc(12.5px * var(--fs)); }
.thread-msg { font-size: calc(13px * var(--fs)); }
.t-title { font-size: calc(15px * var(--fs)); }
.t-details { font-size: calc(12.5px * var(--fs)); }
.tag { font-size: calc(11px * var(--fs)); }

/* topbar home logo (replaces the tiny back arrow) */
.topbar .brandbtn { width: 40px; height: 40px; border-radius: 11px; overflow: hidden; padding: 0; flex: none;
  display: grid; place-items: center; background: var(--panel); border: 1px solid var(--line); }
.topbar .brandbtn img { width: 100%; height: 100%; object-fit: cover; display: block; }
.topbar .brandbtn:active { transform: scale(.93); }

/* settings: font-size segmented control + theme swatches */
.fontseg { margin-top: 8px; }
.theme-row { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 10px; }
.theme-cell { display: flex; flex-direction: column; align-items: center; gap: 5px; }
.theme-sw { width: 46px; height: 46px; border-radius: 13px; border: 2px solid var(--line); display: grid; place-items: center; flex: none; }
.theme-sw.sel { border-color: var(--text); box-shadow: 0 0 0 2px var(--brand); }
.theme-sw .dot { width: 22px; height: 22px; border-radius: 50%; box-shadow: 0 1px 3px rgba(0,0,0,.4); }
.theme-name { font-size: 11px; color: var(--muted); }
.msg.system { font-size: calc(12px * var(--fs)); }
.unread-n { text-shadow: 0 1px 2px rgba(0,0,0,.55); }

/* ==================== accent variables + light themes ==================== */
:root {
  --link:#c7d2fe; --accent-text:#c7d2fe; --quote-bg:rgba(255,255,255,.07);
  --taskref-bg:#22364a; --taskref-fg:#cfe8ff;
  --tag-assignee-bg:#2b2f66; --tag-assignee-fg:#c7d0ff;
  --tag-due-bg:#33305e; --tag-due-fg:#d6c9ff;
  --tag-soon-bg:#4a3a1a; --tag-soon-fg:#ffd28a;
  --tag-over-bg:#4a1f22; --tag-over-fg:#ffb4b4;
  --tag-kids-bg:#22364a; --tag-kids-fg:#a9d8ff;
  --unread:#ffd54a; --saved-bg:#14361f; --saved-fg:#22c55e;
}
/* light palettes */
:root[data-theme="light"] { --bg:#f4f5fb; --bg2:#ffffff; --panel:#ffffff; --panel2:#eef0f8; --line:#dfe2ee; --text:#1b1f2e; --muted:#6b7185; --brand:#6366f1; --brand2:#7c3aed; --chip:#eef0f8; }
:root[data-theme="sand"]  { --bg:#f7f2e9; --bg2:#fffdf8; --panel:#fffdf8; --panel2:#f1eadc; --line:#e5dcc8; --text:#2a2419; --muted:#8a7a57; --brand:#d97706; --brand2:#b45309; --chip:#f1eadc; }
:root[data-theme="sage"]  { --bg:#eef5f0; --bg2:#ffffff; --panel:#ffffff; --panel2:#e6efe9; --line:#d4e2d9; --text:#16241c; --muted:#5c7566; --brand:#0d9488; --brand2:#0f766e; --chip:#e6efe9; }
/* accent overrides shared by every light theme */
:root[data-mode="light"] {
  --link:#4338ca; --accent-text:#4338ca; --quote-bg:rgba(0,0,0,.05);
  --taskref-bg:#e0edff; --taskref-fg:#1e40af;
  --tag-assignee-bg:#e0e7ff; --tag-assignee-fg:#3730a3;
  --tag-due-bg:#ede9fe; --tag-due-fg:#6d28d9;
  --tag-soon-bg:#fef3c7; --tag-soon-fg:#92400e;
  --tag-over-bg:#fee2e2; --tag-over-fg:#b91c1c;
  --tag-kids-bg:#dbeafe; --tag-kids-fg:#1e40af;
  --unread:#b45309; --saved-bg:#dcfce7; --saved-fg:#15803d;
}
/* apply the accent vars (declared last → win over the base hardcoded colors) */
.msg a { color: var(--link); }
.msg.mine { color: #fff; }               /* my bubble is always the saturated brand gradient */
.msg.mine a { color: #e2e8ff; }
.msg.mine .time { color: rgba(255,255,255,.72); }
.msg.mine .unread-n { color: #ffe08a; }
.msg .reply-quote { background: var(--quote-bg); }
.msg .reply-quote b { color: var(--accent-text); }
.reply-bar .rb-main b { color: var(--accent-text); }
.thread-msg b { color: var(--accent-text); }
.mv-edit { color: var(--accent-text); }
.task-ref { background: var(--taskref-bg); color: var(--taskref-fg); }
.tag.assignee { background: var(--tag-assignee-bg); color: var(--tag-assignee-fg); }
.tag.due { background: var(--tag-due-bg); color: var(--tag-due-fg); }
.tag.due.soon { background: var(--tag-soon-bg); color: var(--tag-soon-fg); }
.tag.due.over { background: var(--tag-over-bg); color: var(--tag-over-fg); }
.tag.kids { background: var(--tag-kids-bg); color: var(--tag-kids-fg); }
.unread-n { color: var(--unread); }
.saved-tag { background: var(--saved-bg); color: var(--saved-fg); }
/* bigger chat reply + time, and let them scale with the font-size setting */
.msg .time { font-size: calc(11.5px * var(--fs)); }
.msg .reply-quote { font-size: calc(13px * var(--fs)); }
.msg .reply-quote b { font-size: calc(12px * var(--fs)); }

/* ---------- 링크 미리보기 카드 (v92) ----------
   Under the text, inside the bubble. The thumbnail is a fixed 148px band rather than the image's
   own aspect ratio: a bubble that resizes when a slow thumbnail lands would shove the whole
   conversation up or down, and this card arrives after the message it belongs to. Text is clamped
   for the same reason — a card is a hint about the link, not a copy of the page. */
.lp-slot:empty { display: none; }
.link-preview { display: block; margin-top: 7px; border-radius: 11px; overflow: hidden;
  background: var(--panel2); border: 1px solid var(--line); color: inherit; text-decoration: none; }
.link-preview:active { filter: brightness(1.08); }
.lp-img { display: block; width: 100%; height: 148px; object-fit: cover; background: var(--chip); }
.lp-text { padding: 8px 10px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.lp-site { font-size: calc(11px * var(--fs)); color: var(--muted); font-weight: 700;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lp-site:empty { display: none; }
.lp-title { font-size: calc(13.5px * var(--fs)); font-weight: 700; line-height: 1.35;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.lp-desc { font-size: calc(12px * var(--fs)); color: var(--muted); line-height: 1.4;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
/* my own bubble is a saturated gradient — the card needs the same inset treatment .task-ref uses,
   or it reads as a white rectangle stapled onto the brand color */
.msg.mine .link-preview { background: rgba(255,255,255,.16); border-color: rgba(255,255,255,.28); color: #fff; }
.msg.mine .lp-site, .msg.mine .lp-desc { color: rgba(255,255,255,.82); }

/* ==================== reactions + message actions + members ==================== */
/* touch screens: the long-press menu owns copy, so disable native selection there —
   desktop keeps text selection and right-click */
@media (pointer: coarse) {
  .msg { user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
}
.msg-reply { font-size: calc(14px * var(--fs)); padding: 2px 6px; opacity: .9; }
.rx-row { display: flex; gap: 5px; flex-wrap: wrap; margin-top: 6px; }
.rx-chip { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 999px;
  background: var(--panel2); border: 1px solid var(--line); font-size: calc(12px * var(--fs)); line-height: 1.5; }
.rx-chip span { font-size: calc(11px * var(--fs)); color: var(--muted); font-weight: 700; }
.rx-chip.mine { border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand); }
.msg.mine .rx-chip { background: rgba(255,255,255,.18); border-color: rgba(255,255,255,.35); color: #fff; }
.msg.mine .rx-chip span { color: #fff; }
.msg.mine .rx-chip.mine { border-color: #fff; box-shadow: 0 0 0 1px #fff8; }
/* light themes: darken (not lighten) inside the brand-gradient bubble so the white count stays readable */
:root[data-mode="light"] .msg.mine .rx-chip { background: rgba(0,0,0,.25); border-color: rgba(255,255,255,.5); }
.rx-pick { display: flex; gap: 8px; justify-content: space-between; margin-top: 4px; }
.rx-big { flex: 1; font-size: 26px; padding: 10px 0; border-radius: 12px; background: var(--panel); border: 1px solid var(--line); }
.rx-big:active { transform: scale(.92); }
.rx-big.sel { border-color: var(--brand); box-shadow: 0 0 0 2px var(--brand); background: var(--panel2); }
.msg-preview { background: var(--panel); border-radius: 8px; padding: 8px 10px; }
.member-row { display: flex; align-items: center; gap: 12px; background: var(--panel); border: 1px solid var(--line);
  border-radius: 12px; padding: 10px 14px; }
button.member-row:active { border-color: var(--brand); background: var(--panel2); }
/* the tappable part of a member row. Scoped so the ban list, which reuses .member-row without it,
   keeps the layout it already has. */
.member-open { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; text-align: left; padding: 0; }
.member-open > .r-main { flex: 1; min-width: 0; }
.member-open:active .r-name { color: var(--brand); }

/* ---------- 사용자 프로필 (v72) ---------- */
/* segmented control: 기본 프로필 / «방»에서만 */
.seg { display: flex; padding: 3px; margin: 2px 0 14px; border: 1px solid var(--line);
  border-radius: 11px; background: var(--bg2); }
.seg-opt { flex: 1; min-width: 0; padding: 9px 8px; border-radius: 8px; font-size: 13px;
  font-weight: 700; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.seg-opt.active { background: var(--brand); color: #fff; }
.profile-view { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 4px 0 2px; }
/* only on a circle that actually holds a photograph — see openProfileView */
.chat-ava.ava-tap { cursor: zoom-in; }
.chat-ava.ava-tap:active { transform: scale(.97); }
/* my own face used as a shortcut into the editor: lobby (36px) and room crumb (22px) */
.chat-ava.ava-md { width: 36px; height: 36px; font-size: 15px; }
/* 34, not the 22 this started at. 22 was what fitted on the 20px-tall crumb line, and a face at
   22px is not a face — it is a smudge you cannot identify anyone by, which is exactly what came
   back as "너무 작아". Moving it into the control row is what made the size available. */
.chat-ava.ava-xs { width: 34px; height: 34px; font-size: 14px; }
.facebtn { border: 0; background: none; padding: 0; flex: none; display: block; cursor: pointer;
  border-radius: 50%; line-height: 0; }
.facebtn:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.facebtn .chat-ava { cursor: pointer; }
/* the lobby's 내 이름 row. :empty matters — myLobbyFace() returns an EMPTY span while the profile
   is still being fetched (and forever, for someone with no picture), and without this the flex gap
   would indent the input by 10px for a face that never arrives. */
.name-row { display: flex; align-items: center; gap: 10px; }
.name-row .my-face:empty { display: none; }
.name-row input { flex: 1; min-width: 0; }
.profile-bio { margin: 0; color: var(--muted); font-size: 13.5px; line-height: 1.5; text-align: center;
  white-space: pre-wrap; overflow-wrap: anywhere; }
.profile-bio.empty-bio { opacity: .65; font-style: italic; }
.profile-edit-row { display: flex; align-items: center; gap: 14px; margin: 2px 0 14px; }
.profile-edit-row .pe-actions { display: flex; flex-direction: column; gap: 6px; flex: 1; min-width: 0; }
.member-row .r-bio { margin: 3px 0 0; color: var(--muted); font-size: 13px; line-height: 1.4;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* forwarded-message provenance chip */
/* .msg is a plain block, so inline-block is what makes this chip hug its text instead of
   stretching the full bubble width. */
.fwd-tag { display: inline-block; font-size: 11px; color: var(--muted); margin-bottom: 5px;
  padding: 2px 7px; border-radius: 6px; background: var(--chip); border: 1px solid var(--line);
  max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: top; }
.msg.mine .fwd-tag { background: rgba(255,255,255,.18); border-color: rgba(255,255,255,.28); color: #f2f2ff; }

/* ==================== task color labels + task-event chat pills ==================== */
.t-color { position: absolute; left: 0; top: 0; bottom: 0; width: 5px; border-radius: 11px 0 0 11px; }
/* checklist progress: a hairline along the bottom edge of the card.
   Sits INSIDE the 1px border, so its radius is the card's minus that border — otherwise the fill
   pokes out past the rounded corners. The track is faint on purpose: the fill is the signal. */
.task-progress { position: absolute; left: 0; right: 0; bottom: 0; height: 3px;
  border-radius: 0 0 10px 10px; overflow: hidden; background: var(--line); pointer-events: none; }
.task-progress::after { content: ''; display: block; height: 100%; width: var(--p);
  background: var(--brand); transition: width .18s ease; }
.task-progress.all::after { background: var(--ok); }
/* a finished or cancelled task has already said so with the strikethrough — keep the bar from
   competing with that */
.task.done .task-progress, .task.cancelled .task-progress { opacity: .4; }
.color-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
.color-sw { width: 32px; height: 32px; border-radius: 9px; border: 2px solid var(--line); flex: none; }
.color-sw.none { width: auto; padding: 0 12px; font-size: 12px; color: var(--muted); }
.color-sw.sel { border-color: var(--text); box-shadow: 0 0 0 2px var(--brand); }
.msg.system.systask { display: inline-flex; align-items: center; gap: 6px; max-width: 90%; cursor: pointer;
  background: var(--chip); border: 1px solid var(--line); border-radius: 999px; padding: 6px 12px; color: var(--text); }
.msg.system.systask .st-go { color: var(--muted); font-weight: 700; }

/* ==================== v13: deleted messages + task editor fold + multi-assignee ==================== */
/* tombstone bubble: muted on BOTH sides (my deleted bubble must not keep the brand gradient) */
.msg.deleted, .msg.deleted.mine {
  background: var(--panel2); border: 1px dashed var(--line); color: var(--muted); font-style: italic;
}
.msg.deleted .time, .msg.deleted.mine .time { color: var(--muted); }
.tag.assignee.sel { background: var(--brand); color: #fff; }
.fold-btn { display: block; width: 100%; text-align: left; color: var(--accent-text);
  font-size: calc(14px * var(--fs)); font-weight: 600; padding: 8px 2px 10px; }

/* ==================== v11: 4-digit invite PIN input ==================== */
.pin-input { text-align: center; font-size: 26px; font-weight: 700; letter-spacing: 12px;
  padding: 12px; text-indent: 12px; }        /* text-indent balances the trailing letter-spacing */
.app-pin-input { font-size: 17px; font-weight: 600; letter-spacing: .04em; text-indent: 0;
  padding: 13px 14px; }
/* The lock PIN is a TEXT input masked here, not an <input type="password"> — see appLockPinInput.
   A password field makes the browser offer to save the PIN, and a saved lock PIN is not a lock.
   Only applied when the browser actually supports the property; otherwise the JS keeps type=password
   rather than leaving the digits readable. */
.app-pin-input.is-masked { -webkit-text-security: disc; text-security: disc; }
.app-pin-input::placeholder { font-size: 15px; font-weight: 400; letter-spacing: 0; }
.app-pin-status { min-height: 18px; margin: 2px 0 0; }
.app-pin-status.is-error { color: var(--danger); font-weight: 650; }
.app-pin-status:empty { display: none; }

/* ==================== v11: larger base type (≈ a browser's default reading size) ==================== */
/* The baseline was noticeably smaller than Chrome's ~16px. Bump it up here (declared last so
   these win over the sizes above); the 글자 크기 setting still scales content from this base.
   v98: the explanatory prose got another step. It needed one because of what the 글자 크기 setting
   does NOT reach — `--fs` multiplies into chat and task text only, so every size below is fixed and
   a reader who turns that setting all the way up to read messages still gets these sentences at
   their authored size. There is no user control for this text; the value here IS the control.
   Headings and buttons are deliberately left where they were — it was the small print that was hard
   to read, and moving everything together would only restore the same ratio. */
/* scaled content text (chat + tasks; multiplied by --fs) */
.msg { font-size: calc(16px * var(--fs)); }
.t-title { font-size: calc(16px * var(--fs)); }
.who { font-size: calc(12.5px * var(--fs)); }
.msg .time { font-size: calc(12.5px * var(--fs)); }
.msg .reply-quote { font-size: calc(14px * var(--fs)); }
.msg .reply-quote b { font-size: calc(13px * var(--fs)); }
.task-ref { font-size: calc(13.5px * var(--fs)); }
.t-details { font-size: calc(13.5px * var(--fs)); }
.thread-msg { font-size: calc(14px * var(--fs)); }
.tag { font-size: calc(12px * var(--fs)); }
.msg.system { font-size: calc(13px * var(--fs)); }
.msg-reply { font-size: calc(15px * var(--fs)); }
.rx-chip { font-size: calc(13px * var(--fs)); }
.rx-chip span { font-size: calc(12px * var(--fs)); }
/* unscaled UI chrome (lobby, topbar, tabs, sheets, settings) */
.brand h1 { font-size: 24px; }
.brand p { font-size: 14.5px; }
.card h2 { font-size: 15.5px; }
.field label { font-size: 13px; }
.empty { font-size: 15px; }
.room-item .r-name { font-size: 16px; }
.room-item .r-sub { font-size: 13px; }
.saved-tag { font-size: 11px; }
.linklike { font-size: 14px; }
.btn.sm { font-size: 14px; }
.topbar .title b { font-size: 17px; }
.topbar .title span { font-size: 12px; }
.filterseg button { font-size: 14.5px; }
.sheet h3 { font-size: 19px; }
.hint { font-size: 14.5px; }            /* v98 — 102 call sites; the app's main explanation voice */
.switch .s-label b { font-size: 15.5px; }
.switch .s-label p { font-size: 14.5px; }   /* v98 — what each 설정 toggle actually does */
.checkline { font-size: 15px; }
.toast { font-size: 14px; }
.filecard .fc-name { font-size: 15px; }
.filecard .fc-sub { font-size: 12px; }
.reply-bar { font-size: 13px; }
.reply-bar .rb-main b { font-size: 13px; }
.thread-msg b { font-size: 13px; }
.thread-msg .th-time { font-size: 11px; }
.member-row .r-sub { font-size: 13px; }

/* ==================== v19: line breaks, unread divider, task attachments ==================== */
/* THE line-break fix. The newline survives the whole pipeline (textarea → DB → DOM text node)
   and died only here: with the initial `white-space: normal`, CSS collapses every newline into a
   single space. .t-details (line 203) always had pre-wrap, which is why task details wrapped
   correctly and chat never did. Target .msg-body / .thread-msg and NOT .msg — pre-wrap on .msg
   would inherit into .reply-quote and re-expand one-line snippets into tall multi-line quotes. */
.msg-body { white-space: pre-wrap; }
.thread-msg { white-space: pre-wrap; }
.msg-body.truncated { max-height: 16.5em; overflow: hidden; }
.msg-more { display: block; margin-top: 7px; padding: 3px 0; color: var(--brand); font-size: calc(12.5px * var(--fs));
  font-weight: 800; text-align: left; }
.msg.mine .msg-more { color: #fff; text-decoration: underline; text-underline-offset: 2px; }
.long-message-full { max-height: min(62vh, 520px); overflow-y: auto; padding: 12px;
  border: 1px solid var(--line); border-radius: 12px; background: var(--panel);
  white-space: pre-wrap; word-break: break-word; line-height: 1.55; font-size: calc(14px * var(--fs)); }
.notice-editor { min-height: 180px; max-height: 52vh; resize: vertical; line-height: 1.5; }

/* '여기까지 읽었어요' divider */
.unread-sep { display: flex; align-items: center; gap: 10px; margin: 6px 2px; color: var(--danger); }
.unread-sep::before, .unread-sep::after { content: ''; flex: 1; height: 1px; background: var(--danger); opacity: .45; }
.unread-sep span { font-size: calc(11.5px * var(--fs)); font-weight: 700; white-space: nowrap; }

/* jump-to-bottom pill: only shown when a message lands while the user is reading history.
   The wrapper is a zero-height flex item sitting between the scroller and the composer, so the
   pill rides just above the composer no matter how tall the composer grows (anchoring it to .app
   with a fixed offset put it underneath a multi-line composer). */
.newmsg-wrap { position: relative; height: 0; }
.newmsg-pill { position: absolute; left: 50%; transform: translateX(-50%); bottom: 8px; z-index: 15;
  background: var(--brand); color: #fff; border-radius: 999px; padding: 7px 14px; font-size: 13px;
  font-weight: 600; box-shadow: 0 4px 14px rgba(0,0,0,.35); white-space: nowrap; }

/* «🤖 @ai 사용법» 칩(v117) — 입력이 @ai 로 시작하는 동안 새 메시지 알약과 같은 높이 0 칸의 왼쪽에
   뜬다. 알약은 가운데라 둘이 함께 떠도 겹치지 않는다. 채팅 목록의 높이는 바꾸지 않는다. */
.ai-chip { position: absolute; left: 12px; bottom: 8px; z-index: 15; display: inline-flex; align-items: center;
  background: var(--panel2); color: var(--text); border: 1px solid var(--brand); border-radius: 999px;
  padding: 6px 12px; font-size: 13px; font-weight: 700; box-shadow: 0 4px 14px rgba(0,0,0,.3); white-space: nowrap; }
.ai-chip:active { filter: brightness(.94); }
/* 남의 AI 를 고른 동안(v130) — 누구의 AI 로 가는지 한눈에. ✕ 는 «내 AI 로» 다. */
.ai-chip.ai-via { background: var(--brand); color: #fff; border-color: var(--brand); gap: 8px; }
.ai-chip .ai-via-x { font-size: 12px; opacity: .85; }

/* «@ai 사용법» 시트. keep-all: 좁은 폭에서 한국어가 낱말 가운데서 끊기지 않게(«만들어줘»처 / 럼). */
.ai-help-intro, .ai-help-status, .ai-help-head span, .ai-help-note, .ai-help-notes, .ai-help-foot { word-break: keep-all; }
.ai-help-intro { margin: -4px 0 12px; line-height: 1.5; }
.ai-help-status { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; margin-bottom: 16px;
  padding: 10px 12px; border-radius: 12px; background: var(--panel); border: 1px solid var(--line);
  font-size: 14px; line-height: 1.45; }
.ai-help-sec { margin-bottom: 16px; }
.ai-help-head { display: flex; flex-direction: column; gap: 2px; margin-bottom: 2px; }
.ai-help-head b { font-size: 15.5px; }
.ai-help-head span { font-size: 13px; color: var(--muted); line-height: 1.4; }
.ai-ex { display: flex; align-items: baseline; gap: 6px; width: 100%; margin-top: 6px; padding: 9px 12px;
  border-radius: 10px; background: var(--panel); border: 1px solid var(--line); text-align: left;
  font-size: 14.5px; line-height: 1.4; }
.ai-ex:active { border-color: var(--brand); background: var(--panel2); }
.ai-ex .ai-ex-at { flex: none; color: var(--brand); font-weight: 800; }
.ai-ex .ai-ex-text { flex: 1; min-width: 0; word-break: keep-all; overflow-wrap: anywhere; }
.ai-ex .ai-ex-go { flex: none; color: var(--muted); font-size: 12px; }
.ai-help-note { margin: 8px 2px 0; font-size: 13px; color: var(--muted); line-height: 1.45; }
.ai-help-notes { margin: 6px 0 0; padding-left: 18px; color: var(--muted); font-size: 13.5px; line-height: 1.55; }
.ai-help-notes li + li { margin-top: 3px; }
.ai-help-foot { text-align: center; margin: 4px 0 0; }
.ai-help-btns { display: flex; flex-wrap: wrap; gap: 6px; }

/* "알림이 꺼져 있어요" banner at the top of the chat — a permanent, quiet affordance so the app
   never has to nag with a modal. Amber (the existing due-soon accent) reads in light and dark. */
.notif-banner { display: flex; align-items: center; gap: 8px; width: 100%; text-align: left; flex: none;
  padding: 9px 14px; background: var(--tag-soon-bg); color: var(--tag-soon-fg);
  border-bottom: 1px solid var(--line); font-size: calc(13px * var(--fs)); font-weight: 600; }
.notif-banner:active { filter: brightness(.94); }
.notif-banner .nb-t { flex: 1; min-width: 0; }
.notif-banner .nb-go { opacity: .65; font-weight: 700; font-size: 15px; }
/* install variant: an upsell, so it's calmer than the amber warning and has its own ✕ */
.notif-banner.install { padding: 0; background: var(--taskref-bg); color: var(--taskref-fg); gap: 0; }
.notif-banner.install .nb-main { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0;
  padding: 9px 4px 9px 14px; color: inherit; font: inherit; text-align: left; }
.notif-banner.install .nb-x { width: 38px; align-self: stretch; color: inherit; opacity: .6; font-size: 12px; flex: none; }

/* task checklist — ticking never hides an item, and add/delete write immediately */
.field-label-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 5px; }
.field-label-row label { margin-bottom: 0; }
.checklist-members { flex: none; padding: 5px 9px; border: 1px solid var(--line); border-radius: 999px;
  background: var(--panel2); color: var(--text); font-size: 12px; font-weight: 700; line-height: 1.2; }
.checklist-members:active { border-color: var(--brand); }
.checklist-members:disabled { opacity: .55; cursor: default; }
.chk-list { display: flex; flex-direction: column; gap: 2px; }
.chk-list:empty { display: none; }
.chk-item { display: flex; align-items: center; gap: 9px; padding: 3px 0; }
.chk-item:not(:has(.chk-box:active)):not(:has(.chk-x:active)) { cursor: grab; }
.chk-item.chk-drag-source { opacity: .25; }
.chk-item.chk-drop-target { outline: 2px solid var(--brand); outline-offset: 1px; border-radius: 8px; }
.chk-item.chk-ghost { position: fixed; z-index: 1100; pointer-events: none; margin: 0; padding: 7px 8px;
  border: 1px solid var(--brand); border-radius: 9px; background: var(--panel2); opacity: .96;
  box-shadow: 0 12px 28px rgba(0,0,0,.45); cursor: grabbing; }
.chk-item .chk-box { width: 22px; height: 22px; border-radius: 6px; border: 2px solid var(--line); flex: none;
  display: grid; place-items: center; color: transparent; background: var(--bg2); font-size: 13px; }
.chk-item .chk-box.on { background: var(--ok); border-color: var(--ok); color: #fff; }
.chk-item .chk-t { flex: 1; min-width: 0; font-size: calc(14.5px * var(--fs)); word-break: break-word; }
.chk-item.done .chk-t { text-decoration: line-through; color: var(--muted); }
.chk-actions { display: flex; align-items: center; gap: 2px; flex: none; }
.chk-item .chk-x { width: 28px; height: 28px; border-radius: 7px; color: var(--muted); font-size: 12px; flex: none; }
.tag.chk { background: var(--tag-assignee-bg); color: var(--tag-assignee-fg); }
.tag.chk.all { background: var(--saved-bg); color: var(--saved-fg); }

/* task attachments */
.task-file { display: flex; align-items: center; gap: 8px; }
.task-file.preview { align-items: flex-start; }
.task-file-preview { flex: 1; min-width: 0; }
.task-file-preview .file-preview iframe { width: 100%; min-height: 220px; }
.task-file .filecard { flex: 1; min-width: 0; background: var(--panel); border: 1px solid var(--line);
  border-radius: 10px; padding: 8px 10px; }
.task-file .fc-ic { width: 32px; height: 32px; font-size: 16px; }
.task-file .tf-x { width: 30px; height: 30px; border-radius: 8px; color: var(--muted); flex: none; font-size: 13px; }
.tag.files { background: var(--tag-kids-bg); color: var(--tag-kids-fg); }

/* ===== v24: message pin + room notice ===== */
/* 📢 notice banner — the chat pane's top row. Calm blue (taskref palette): a room rule is
   information, not a warning like the amber 🔕 banner below it. */
.notice-bar { display: flex; align-items: stretch; width: 100%; flex: none;
  background: var(--taskref-bg); color: var(--taskref-fg); border-bottom: 1px solid var(--line); }
.notice-bar .ntc-main { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0;
  padding: 9px 4px 9px 14px; color: inherit; font: inherit; font-size: calc(13px * var(--fs));
  font-weight: 600; text-align: left; }
.notice-bar .ntc-t { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.notice-bar .ntc-go { opacity: .65; font-weight: 700; flex: none; }
.notice-bar .ntc-x { width: 38px; flex: none; color: inherit; opacity: .6; font-size: 12px; }
.notice-bar:not(.collapsed):active { filter: brightness(.94); }
/* collapsed → slim full-width chip (a notice stays one tap away, never fully dismissed) */
.notice-bar.collapsed { align-items: center; gap: 8px; padding: 5px 14px;
  font-size: calc(12px * var(--fs)); font-weight: 600; color: inherit; text-align: left; }
.notice-bar.collapsed .ntc-t { flex: 1; min-width: 0; }
/* full notice body in the sheet */
.notice-full { white-space: pre-wrap; word-break: break-word; max-height: 45vh; overflow-y: auto;
  margin: 0; font-size: calc(14px * var(--fs)); line-height: 1.5; }

/* 📌 pin bar — slim entry row to the pin board, quieter than the notice */
.pin-bar { display: flex; align-items: center; gap: 8px; width: 100%; flex: none; text-align: left;
  padding: 6px 14px; background: var(--bg2); color: var(--muted);
  border-bottom: 1px solid var(--line); font-size: calc(12px * var(--fs)); font-weight: 600; }
.pin-bar .pb-t { flex: 1; min-width: 0; }
.pin-bar .pb-go { opacity: .65; font-weight: 700; }
.pin-bar:active { filter: brightness(.94); }

/* pin board rows */
.pin-list { display: flex; flex-direction: column; gap: 8px; max-height: 55vh; overflow-y: auto; }
.pin-row { display: flex; align-items: stretch; gap: 6px; }
.pin-row .pin-main { flex: 1; min-width: 0; text-align: left; background: var(--bg2);
  border: 1px solid var(--line); border-radius: 12px; padding: 9px 12px; color: var(--text);
  font: inherit; }
.pin-row .pin-main:active { filter: brightness(.94); }
.pin-row .pin-head { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.pin-row .pin-head b { font-size: calc(13px * var(--fs)); }
.pin-row .pin-when { font-size: calc(11px * var(--fs)); color: var(--muted); flex: 1; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: right; }
.pin-row .pin-body { margin-top: 3px; font-size: calc(13px * var(--fs)); line-height: 1.4;
  white-space: pre-wrap; word-break: break-word; display: -webkit-box; -webkit-line-clamp: 3;
  -webkit-box-orient: vertical; overflow: hidden; }
.pin-row .pin-x { width: 34px; flex: none; color: var(--muted); font-size: 13px; border-radius: 12px; }
.pin-row .pin-x:active { background: var(--bg2); }

/* 📌 marker in a pinned message's footer */
.msg-foot .pin-ic { font-size: 10px; opacity: .8; }

/* ===== v25: public/private rooms + join codes ===== */
.r-sect { font-size: calc(12px * var(--fs)); font-weight: 700; color: var(--muted); margin: 10px 2px 2px; }
.lock-tag { font-size: 12px; margin-left: 6px; vertical-align: middle; opacity: .8; }
.code-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.code-big { font-size: 22px; font-weight: 800; letter-spacing: 5px; text-indent: 5px; background: var(--bg2);
  border: 1px solid var(--line); border-radius: 10px; padding: 6px 12px; flex: 1; min-width: 120px; text-align: center; }
.ownerbox { border-top: 1px solid var(--line); margin-top: 6px; }

/* ===== v26: task templates ===== */
.tpl-sect { font-size: calc(12px * var(--fs)); font-weight: 700; color: var(--muted); margin: 12px 2px 4px; }
.tpl-list { display: flex; flex-direction: column; gap: 6px; }
.tpl-list:empty { display: none; }
.tpl-row { display: flex; align-items: center; gap: 8px; background: var(--bg2);
  border: 1px solid var(--line); border-radius: 12px; padding: 8px 12px; }
.tpl-row .tpl-main { flex: 1; min-width: 0; }
.tpl-row .tpl-title { font-size: calc(14px * var(--fs)); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tpl-row .tpl-sub { font-size: calc(11px * var(--fs)); color: var(--muted); margin-top: 1px; }
.tpl-row .tpl-acts { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
.tpl-row .tpl-acts .btn.sm { padding: 4px 8px; font-size: calc(11px * var(--fs)); }

/* ===== v28: Toss-like type · clearer tabs · drag-hint banner · settings sections ===== */
/* 할일 drag tip — its own dismissible row above the list (was an inline header hint that wrapped
   onto 2–3 lines next to the filter + 템플릿 buttons on narrow phones). Calm taskref palette. */
.drag-hint { display: flex; align-items: center; gap: 8px; flex: none;
  padding: 8px 14px; background: var(--taskref-bg); color: var(--taskref-fg);
  border-bottom: 1px solid var(--line); font-size: calc(12.5px * var(--fs)); font-weight: 600; }
.drag-hint .dh-t { flex: 1; min-width: 0; line-height: 1.4; }
.drag-hint .dh-x { width: 30px; height: 28px; flex: none; color: inherit; opacity: .55; font-size: 12px; border-radius: 8px; }
.drag-hint .dh-x:active { background: rgba(0,0,0,.08); }

/* settings section headers — break the long toggle list into scannable groups */
.set-sect { font-size: calc(12.5px * var(--fs)); font-weight: 800; color: var(--muted); margin: 18px 2px 2px; letter-spacing: .2px; }
.set-sect:first-of-type { margin-top: 6px; }
/* a touch more air + contrast on each settings row */
.sheet .switch { padding: 13px 0; }
.sheet .switch .s-label b { font-weight: 700; }
.sheet .switch .s-label p { line-height: 1.45; margin-top: 3px; }

/* ===== v30: collapsible settings sections ===== */
.acc { border-bottom: 1px solid var(--line); }
.acc-head { display: flex; align-items: center; justify-content: space-between; width: 100%;
  padding: 15px 2px; text-align: left; font-weight: 800; font-size: calc(15px * var(--fs)); color: var(--text); }
.acc-head:active { opacity: .6; }
.acc-head .acc-chev { color: var(--muted); font-size: 13px; flex: none; transition: transform .18s; }
.acc.open > .acc-head .acc-chev { transform: rotate(180deg); }
.acc-body { display: none; padding-bottom: 8px; }
.acc.open > .acc-body { display: block; }
/* inside an accordion the last row's divider is redundant with the .acc border */
.acc-body > .switch:last-child { border-bottom: none; }

/* ===== v31: prominent "install app" row at the top of settings (browser only) ===== */
.install-top { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left;
  background: var(--taskref-bg); color: var(--taskref-fg); border: 1px solid var(--brand);
  border-radius: 12px; padding: 12px 14px; margin: 2px 0 12px; }
.install-top b { font-size: calc(15px * var(--fs)); font-weight: 800; }
.install-top p { margin: 3px 0 0; font-size: calc(12.5px * var(--fs)); opacity: .85; line-height: 1.4; }
.install-top .it-go { margin-left: auto; font-weight: 800; flex: none; }
.install-top:active { filter: brightness(.95); }

/* ===== v32: incoming webhooks ===== */
.who { display: flex; align-items: center; gap: 5px; }
.bot-tag { display: inline-flex; align-items: center; flex: none; padding: 1px 5px; border-radius: 999px;
  background: var(--taskref-bg); color: var(--taskref-fg); border: 1px solid var(--line);
  font-size: calc(9.5px * var(--fs)); font-weight: 800; line-height: 1.35; }
.webhook-manager { border-top: 1px solid var(--line); margin-top: 10px; padding-top: 12px; }
.webhook-head { display: flex; align-items: center; gap: 10px; }
.webhook-head > div { flex: 1; min-width: 0; }
/* 이 클래스들은 웹훅(v32) 때 생겨 v98 의 글자 키우기에서 빠진 채 10~13px 로 남아 있었고, AI 연결(v110)이
   그대로 빌려 썼다 — 폰에서 못 읽는다는 신고(2026-09-19, AI 연결 토큰 화면). 크기를 v98 의 설정 화면
   눈금(설명 14.5px 안팎)에 맞춘다. 웹훅 화면도 같은 클래스라 함께 커진다. */
.webhook-head b { font-size: calc(15.5px * var(--fs)); }
.webhook-head p { margin: 3px 0 0; color: var(--muted); font-size: calc(13.5px * var(--fs)); line-height: 1.4; }
.webhook-hint { margin: 7px 0 9px; }
.webhook-list { display: flex; flex-direction: column; gap: 7px; }
.webhook-row { display: flex; align-items: center; gap: 8px; padding: 9px 10px; border: 1px solid var(--line);
  border-radius: 12px; background: var(--bg2); }
.webhook-main { flex: 1; min-width: 0; }
.webhook-name { display: flex; align-items: center; gap: 6px; min-width: 0; font-size: calc(15px * var(--fs));
  font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.webhook-status { flex: none; padding: 1px 7px; border-radius: 999px; font-size: calc(11.5px * var(--fs));
  font-weight: 700; background: var(--panel); color: var(--muted); }
.webhook-status.on { background: rgba(34,197,94,.14); color: #22c55e; }
.webhook-status.off { background: rgba(148,163,184,.14); color: var(--muted); }
.webhook-meta { margin-top: 3px; color: var(--muted); font-size: calc(13px * var(--fs)); line-height: 1.4; }
.webhook-actions { display: flex; align-items: center; justify-content: flex-end; gap: 5px; flex-wrap: wrap; max-width: 180px; }
.webhook-actions .btn.sm { padding: 6px 10px; font-size: calc(13px * var(--fs)); }
.webhook-warning { margin: 8px 0 10px; padding: 10px 12px; border-radius: 10px; background: rgba(245,158,11,.13);
  border: 1px solid rgba(245,158,11,.35); color: var(--text); font-size: calc(14px * var(--fs)); line-height: 1.5; }
.webhook-url { width: 100%; min-height: 68px; resize: none; word-break: break-all; font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: calc(14px * var(--fs)); line-height: 1.5; }
.webhook-curl-title { margin: 16px 0 7px; font-weight: 800; font-size: calc(15px * var(--fs)); }
.webhook-curl { margin: 0; max-height: 260px; overflow: auto; white-space: pre-wrap; word-break: break-all;
  padding: 11px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg2);
  color: var(--text); font: calc(14px * var(--fs))/1.55 ui-monospace, SFMono-Regular, Consolas, monospace; }
/* AI 연결 토큰 화면: 토큰은 한 번 눌러 통째로 고르게, 설정 조각은 안쪽 스크롤 없이 전부 보이게 */
.ai-token { font-size: calc(15px * var(--fs)); user-select: all; -webkit-user-select: all; }
.ai-code { max-height: none; }
.ai-clients { margin-bottom: 8px; }
.ai-clients .seg-opt { padding: 9px 4px; font-size: 14px; }
@media (max-width: 430px) {
  .webhook-row { align-items: flex-start; flex-direction: column; }
  .webhook-actions { max-width: none; width: 100%; justify-content: flex-start; }
}

/* ===== v50: privacy lock + exact task deadline reminders ===== */
.app.privacy-covered { visibility: hidden; }
.privacy-lock {
  position: fixed; inset: 0; z-index: 5000; display: grid; place-items: center;
  min-height: 100vh; min-height: 100dvh;
  padding: calc(var(--safe-top) + 20px) 18px calc(var(--safe-bottom) + 20px);
  overflow-y: auto; background: var(--bg); color: var(--text);
}
.privacy-card {
  width: min(100%, 420px); padding: 26px 22px; border: 1px solid var(--line);
  border-radius: 22px; background: var(--panel); box-shadow: 0 24px 70px rgba(0,0,0,.28);
  text-align: center;
}
.privacy-card.shield { border-color: transparent; background: transparent; box-shadow: none; }
.privacy-card > img { width: 66px; height: 66px; border-radius: 18px; margin-bottom: 10px; }
.privacy-card h1 { margin: 2px 0 7px; font-size: 22px; }
.privacy-card.shield b { display: block; font-size: 20px; }
.privacy-card.shield p, .privacy-status { margin: 5px 0 18px; color: var(--muted); }
.privacy-methods { display: flex; flex-direction: column; gap: 9px; margin-top: 16px; }
.privacy-card .app-pin-input { text-align: center; }
.privacy-or { color: var(--muted); font-size: 12px; }
.privacy-recover { margin: 6px auto 0; color: var(--brand); }
.security-buttons { display: flex; flex: none; gap: 5px; flex-wrap: wrap; justify-content: flex-end; }
.passkey-row { gap: 10px; }

.due-datetime { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(105px, .65fr); gap: 7px; }
.reminder-field { padding: 11px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); }
.reminder-presets, .reminder-selected { display: flex; gap: 6px; flex-wrap: wrap; }
.reminder-preset, .reminder-chip {
  border: 1px solid var(--line); border-radius: 999px; padding: 6px 9px;
  background: var(--bg2); color: var(--text); font-size: 12px;
}
.reminder-preset.active { border-color: var(--brand); background: var(--taskref-bg); color: var(--taskref-fg); font-weight: 700; }
.reminder-preset:disabled { opacity: .45; cursor: not-allowed; }
.reminder-custom { display: grid; grid-template-columns: 86px 1fr auto; gap: 6px; margin: 9px 0; }
.reminder-custom input, .reminder-custom select { padding: 8px 10px; min-width: 0; }
.reminder-selected { min-height: 30px; align-items: center; }
.reminder-chip { color: var(--taskref-fg); background: var(--taskref-bg); }
.reminder-hint { margin: 8px 1px 0; line-height: 1.4; }
.tag.reminder { background: var(--taskref-bg); color: var(--taskref-fg); }
/* 반복 할일(v138) — 알림 태그와 같은 옅은 색. */
.tag.repeat { background: var(--taskref-bg); color: var(--taskref-fg); }

@media (max-width: 390px) {
  .due-datetime { grid-template-columns: 1fr; }
  .reminder-custom { grid-template-columns: 72px 1fr auto; }
  .privacy-card { padding: 22px 17px; }
  /* The topbar used to be a 4-button row and this bought the title its width back on a 360px
     phone. v91 dropped 참여자 and 초대 링크 into 방 설정, so it is a 2-button row plus a face —
     the squeeze is milder but the shrink still applies, and the face shrinks with it. */
  .topbar { gap: 4px; padding-left: 9px; padding-right: 9px; }
  .topbar .iconbtn { width: 34px; height: 34px; font-size: 18px; }
  /* the matching .topbar-face shrink lives with the .topbar-face rules further down — putting it
     here left the button at 38 while the circle inside it shrank to 31, because the base rule for
     the button is declared AFTER this block and wins the tie on source order. */
}

/* ===== v69: which identity am I on ===== */
.id-badge { display: inline-block; margin-left: 6px; padding: 1px 6px; border-radius: 999px;
  font-size: calc(10px * var(--fs)); font-weight: 700; line-height: 1.5; vertical-align: middle;
  border: 1px solid transparent; white-space: nowrap; }
.id-badge.google { background: var(--taskref-bg); color: var(--taskref-fg); border-color: var(--brand); }
/* muted on purpose — a guest badge is information, not a warning */
.id-badge.guest { background: var(--chip); color: var(--muted); border-color: var(--line); }
.topbar .title .id-badge { font-size: calc(9.5px * var(--fs)); padding: 0 5px; }

/* an author whose account is gone: the stored name stays (history is history), the colour does not,
   because a name-derived colour would imply the person it now belongs to */
/* .who is a SIBLING of .msg inside .msg-line, not a descendant — a `.msg .who` selector silently
   matches nothing here. */
.who.gone { color: var(--muted); }
.who .gone-tag { margin-left: 5px; padding: 0 5px; border-radius: 999px; background: var(--chip);
  color: var(--muted); font-size: calc(9.5px * var(--fs)); font-weight: 600; border: 1px solid var(--line);
  vertical-align: middle; }

/* ===== v65: message search ===== */
.srch-list { display: flex; flex-direction: column; gap: 8px; max-height: 50vh; overflow-y: auto; }
.srch-row { text-align: left; background: var(--bg2); border: 1px solid var(--line);
  border-radius: 12px; padding: 9px 12px; color: var(--text); font: inherit; }
.srch-row:active { filter: brightness(.94); }
.srch-row .srch-head { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.srch-row .srch-head b { font-size: calc(13px * var(--fs)); }
/* a system row (입장·할일 알림) is context, not something anyone searched for on purpose */
.srch-row.sys .srch-head b { font-weight: 500; color: var(--muted); }
.srch-when { font-size: calc(11px * var(--fs)); color: var(--muted); flex: 1; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: right; }
.srch-body { margin-top: 3px; font-size: calc(13px * var(--fs)); line-height: 1.45;
  word-break: break-word; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical;
  overflow: hidden; }
/* the browser default is black-on-yellow, which is unreadable on every dark theme here */
.srch-body mark { background: var(--taskref-bg); color: var(--taskref-fg); border-radius: 4px;
  padding: 0 2px; font-weight: 700; }

/* ==================== 상단바 브레드크럼 (홈 버튼을 읽히게) ====================
   The room name alone gave no clue that the logo was a home button. 'Cowork ›' takes the line
   above the room name rather than sitting beside it: the title column is only 165px wide on a
   375px screen, and a horizontal label would have eaten a third of it. Selectors are
   .topbar-scoped because the late type block sets `.topbar .title span { font-size: 12px }`,
   which would otherwise outrank a bare .crumb-me. Applies to every theme, not just '심플'. */
.topbar .title { display: flex; flex-direction: column; justify-content: center; gap: 1px; }
.topbar .title .crumb { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.topbar .title .crumb-home {
  flex: none; display: inline-flex; align-items: baseline; gap: 3px;
  margin-left: -5px; padding: 1px 5px; border-radius: 5px;      /* negative margin pulls the label
    toward the logo so the two read as one home target, without shifting the room name below */
  color: var(--muted); font-size: 12.5px; font-weight: 700; line-height: 1.4; white-space: nowrap;
}
.topbar .title .crumb-home:active { background: var(--panel2); color: var(--text); }
.topbar .title .crumb-home:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }
.topbar .title .crumb-sep { font-size: inherit; opacity: .6; }
.topbar .title .crumb-me {
  flex: 1; min-width: 0; text-align: right; color: var(--muted); font-size: 11.5px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
/* When the crumb holds a face instead of "나: 이름" it is a 22px circle, and a baseline-aligned
   circle sits visibly low next to text. Only this variant switches to center alignment — the
   text variant still needs the baseline it was designed on. */
/* My face sits with 🔍 and ⚙️, sized to their tap target so the row stays even. It is NOT inside
   .title — an .iconbtn-sized circle on the 20px crumb line would push the room name down and cost
   the topbar ~14px of height on every screen, whether or not anyone has a picture. */
.topbar .topbar-face { flex: none; display: flex; align-items: center; justify-content: center; }
.topbar .topbar-face:empty { display: none; }
.topbar .topbar-face .facebtn { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 50%; }
.topbar .topbar-face .facebtn:active { background: var(--panel); }
/* Narrow phones shrink the icon buttons; the face has to shrink with them or the row goes ragged.
   Declared HERE, after the base rules above, because the earlier .topbar media query sits before
   them in the file and would lose the specificity tie on source order. */
@media (max-width: 380px) {
  .topbar .topbar-face .facebtn { width: 34px; height: 34px; }
  .topbar .topbar-face .chat-ava.ava-xs { width: 31px; height: 31px; font-size: 13px; }
}

/* ==================== '심플' 테마 — 문서형(노션풍) 화면 ====================
   The other themes are palettes: they swap the color variables and stop there. This one also has to
   undo the app's *shape* — the 11–14px radii, the brand gradients, the deep drop shadows — because
   that is what actually reads as "app-like" rather than "document-like". Everything here is scoped
   to [data-theme^="simple"], so picking any other theme in 설정 → 🎨 화면 restores the old look
   completely; nothing above this line is edited.

   Palette: warm neutral grays (#37352f text on #ffffff, hairline #e6e5e1) with a single blue accent
   (#2383e2) and pastel property chips. Warm grays are the whole trick — a blue-gray light theme
   (the existing 라이트) looks like a dimmed dark theme, a warm one looks like paper. */
:root[data-theme^="simple"] {
  --bg:#ffffff; --bg2:#f7f7f5; --panel:#ffffff; --panel2:#f1f1ef;
  /* --muted is a notch darker than the reference's #787774: that value lands at 4.48:1 on white,
     just under AA, and nearly every secondary string in this app (부제·힌트·시각·비활성 탭) uses it.
     #6f6e69 reads 5.1:1 and still sits far below --text's 12.3:1, so the hierarchy is unchanged. */
  --line:#e6e5e1; --text:#37352f; --muted:#6f6e69;
  /* the reference blue is #2383e2, but white 14–16px button labels on it are 3.9:1. One step
     deeper is 4.8:1 and indistinguishable at chip size. --danger carries the same fix. */
  --brand:#1f76cd; --brand2:#1a63ae; --chip:#f1f1ef;
  /* --danger 는 '여기까지 읽었어요' 구분선으로도 쓰이는데, 오션 변형의 살짝 밝은 --bg2 위에서
     4.49:1 로 AA 를 아슬하게 놓쳤다. 한 단계 진하게 잡아 모든 변형에 여유를 준다. */
  --ok:#448361; --warn:#a86e18; --danger:#cb3232;
  --radius:6px;
  /* accent set — declared here (later in the file) so it wins over the shared [data-mode="light"] block */
  --link:#1a6dc4; --accent-text:#1a6dc4; --quote-bg:rgba(55,53,47,.06);
  --taskref-bg:#e7f1f7; --taskref-fg:#1c4966;
  --tag-assignee-bg:#e8deee; --tag-assignee-fg:#6940a5;
  --tag-due-bg:#e3e2e0; --tag-due-fg:#454239;
  --tag-soon-bg:#fdecc8; --tag-soon-fg:#8a5300;
  --tag-over-bg:#ffe2dd; --tag-over-fg:#ad3b32;
  --tag-kids-bg:#dbeddb; --tag-kids-fg:#2b593f;
  --unread:#8f4508; --saved-bg:#dbeddb; --saved-fg:#2b593f;
  --mine:#d3e5ef;          /* my chat bubble — a flat tint, not the brand gradient */
  --mine-line:#bcd7e6;
  --mine-fg2:#566670;      /* 시각·답글 등 내 말풍선 안의 보조 텍스트 */
  --mine-inset:rgba(255,255,255,.72);   /* 내 말풍선 안에 얹히는 칩/카드 배경 */
  --ck-line:#c4c2bc;       /* 체크박스 테두리 */
  --track:#d5d3cd;         /* 토글 꺼짐 · 시트 그래버 */
  --ph:#b4b2ac;            /* placeholder */
  --fav:#9a6700; --fav-line:#e3c37a;    /* ★ 즐겨찾기 · 할일 완료 플래시 */
  --focus:rgba(31,118,205,.24);
  --scrim:rgba(15,15,15,.32);
  --sw-1:0 1px 2px rgba(15,15,15,.08);
  --sw-2:0 4px 14px rgba(15,15,15,.13);
  --sw-sheet:0 -6px 28px rgba(15,15,15,.12);
  --sw-drag:drop-shadow(0 6px 12px rgba(15,15,15,.16));
}

/* ---- 심플 변형: 구조는 그대로, 팔레트만 ----
   위 블록의 선택자가 전부 [data-theme^="simple"] 이므로 라운드·평면·선 아이콘·타이포는
   simple-* 전부가 공유한다. 여기서는 "중성 표면 + 액센트"만 갈아끼운다.

   상태를 뜻하는 색(임박 앰버·지남 빨강·완료 파랑·추가 초록·취소 빨강)은 변형 사이에서
   일부러 고정한다 — 테마를 바꿨다고 "마감이 지났다"가 다른 색으로 보이면 안 된다.
   바꾸는 건 중성 표면, 브랜드, 그리고 브랜드에서 파생되는 것들(내 말풍선·taskref·포커스)뿐.

   각 브랜드는 흰 글씨 버튼 라벨이 AA(4.5:1)를 넘도록 원색보다 한두 단계 진하게 잡았다. */
:root[data-theme="simple-sand"] {
  --bg:#fffdf9; --bg2:#f8f4ec; --panel:#fffdf9; --panel2:#f2ece0;
  --line:#e8e0d0; --text:#38322a; --muted:#6f6757; --chip:#f2ece0;
  --brand:#9c5d12; --brand2:#7f4b0e;
  --link:#8a5210; --accent-text:#8a5210; --quote-bg:rgba(56,50,42,.07);
  --taskref-bg:#f6ecd9; --taskref-fg:#6b4410;
  --tag-due-bg:#eee7d9; --tag-due-fg:#4a4234;
  --mine:#f5e6cd; --mine-line:#e3d0ad; --mine-fg2:#6b5a3c;
  --ck-line:#c9bfa8; --track:#ded4c0; --ph:#b6ab94;
  --focus:rgba(156,93,18,.24);
}
:root[data-theme="simple-ocean"] {
  --bg:#fbfdfe; --bg2:#eef5f8; --panel:#ffffff; --panel2:#e6eff3;
  --line:#d7e3e9; --text:#22333a; --muted:#5c6c74; --chip:#e6eff3;
  --brand:#0d6e8c; --brand2:#0a5670;
  --link:#0b6280; --accent-text:#0b6280; --quote-bg:rgba(34,51,58,.07);
  --taskref-bg:#dcedf4; --taskref-fg:#164254;
  --tag-due-bg:#e2eaee; --tag-due-fg:#3a464c;
  --mine:#cfe6ee; --mine-line:#b0d3e0; --mine-fg2:#4a626c;
  --ck-line:#b8c8ce; --track:#cfdde3; --ph:#a4b3b9;
  --focus:rgba(13,110,140,.24);
}
:root[data-theme="simple-sage"] {
  --bg:#fbfdfb; --bg2:#eff5f0; --panel:#ffffff; --panel2:#e7f0e9;
  --line:#d9e5dc; --text:#26332a; --muted:#5c6d5f; --chip:#e7f0e9;
  --brand:#2f6b4f; --brand2:#25543f;
  --link:#2b6249; --accent-text:#2b6249; --quote-bg:rgba(38,51,42,.07);
  --taskref-bg:#e0eee5; --taskref-fg:#1f4632;
  --tag-due-bg:#e4ebe6; --tag-due-fg:#3c473e;
  --mine:#d6e9dc; --mine-line:#b6d4c0; --mine-fg2:#4c6154;
  --ck-line:#bccbc0; --track:#d2dfd6; --ph:#a7b5aa;
  --focus:rgba(47,107,79,.24);
}
/* 무채색 다크 — 표면과 크롬은 순수 그레이. 색은 상태를 뜻하는 곳에만 남는다(추가·완료·취소,
   임박·지남). 그 셋이 유일한 색이라 오히려 채팅 흐름에서 더 또렷하게 읽힌다. */
:root[data-theme="simple-dark"] {
  --bg:#191918; --bg2:#1f1f1e; --panel:#2c2c2a; --panel2:#242423;
  --line:#3a3a37; --text:#e8e8e5; --muted:#9c9c96; --chip:#35352f;
  --brand:#5f5f5c; --brand2:#4c4c49;
  --ok:#5f9d78; --warn:#c39a4a; --danger:#d76b6b;
  --link:#cdcdc7; --accent-text:#cdcdc7; --quote-bg:rgba(255,255,255,.08);
  --taskref-bg:#30302d; --taskref-fg:#d2d2cb;
  /* 임의 분류(담당자·마감일·하위·체크)는 회색, 상태(임박·지남·저장됨)만 색 */
  --tag-assignee-bg:#35352f; --tag-assignee-fg:#cfcfc8;
  --tag-due-bg:#35352f; --tag-due-fg:#cfcfc8;
  --tag-kids-bg:#35352f; --tag-kids-fg:#cfcfc8;
  --tag-soon-bg:#4a3a1a; --tag-soon-fg:#f0c987;
  --tag-over-bg:#4a2422; --tag-over-fg:#f2a5a5;
  --unread:#e0a35c; --saved-bg:#2c3d33; --saved-fg:#8fc7a5;
  --mine:#34342f; --mine-line:#48483f; --mine-fg2:#a8a8a1;
  --mine-inset:rgba(255,255,255,.09);
  --ck-line:#565651; --track:#454541; --ph:#6f6f69;
  --fav:#e0a35c; --fav-line:#6b5220;
  --focus:rgba(232,232,229,.22);
  --scrim:rgba(0,0,0,.58);
  --sw-1:0 1px 2px rgba(0,0,0,.4);
  --sw-2:0 4px 14px rgba(0,0,0,.5);
  --sw-sheet:0 -6px 28px rgba(0,0,0,.5);
  --sw-drag:drop-shadow(0 6px 12px rgba(0,0,0,.55));
  /* 회색 브랜드 위에서는 완료가 다른 이벤트와 구분되지 않는다 → 완료만 따로 뽑는다 */
  --ic-done:#7fb0dd;
}
/* 화살표 SVG는 밝은 배경 기준 색이라 어두운 표면에서 묻힌다 */
:root[data-theme="simple-dark"] select {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8'><path d='M1 1l5 5 5-5' stroke='%239c9c96' stroke-width='2' fill='none'/></svg>");
}
/* documents don't condense their tracking; the app-wide -0.01em reads cramped on paper */
:root[data-theme^="simple"] body { letter-spacing: normal; }

/* ---- shape: one small radius everywhere a card/row/bubble is drawn ---- */
:root[data-theme^="simple"] :is(
  .card, .room-item, .lobby-entry, .room-pref-action, .task, .msg, .msg-preview, .thread-msg,
  .member-row, .tpl-row, .webhook-row, .webhook-curl, .pin-row .pin-main, .pin-row .pin-x,
  .reminder-field, .long-message-full, .install-top, .task-file .filecard, .move-bar, .mv-btn,
  .rx-big, .code-big, .file-preview, .img-wrap img, .filecard .fc-ic, .drop-into, .privacy-card,
  .topbar .iconbtn, .topbar .brandbtn, .composer .iconbtn, .lobby-settings, .brand img, .theme-sw,
  .color-sw, .t-expand, .t-chat, .chk-item.chk-ghost, .chk-item.chk-drop-target, .toast,
  .album, .srch-row,                                 /* v65 검색 · v76 사진 앨범 */
  .memo-card, .memo-wysiwyg, .memo-pin, .memo-tb,   /* v80 메모 */
  .link-preview                                     /* v92 링크 미리보기 */
) { border-radius: 6px; }
/* .fab-split is deliberately NOT in that list: 심플 테마도 .fab 은 원으로 두므로 (아래 flat 블록이
   그라데이션만 걷어낸다) 반으로 나눈 쪽도 원이어야 짝이 맞는다. 각지게 만들면 다시 스크롤바다. */
:root[data-theme^="simple"] :is(input, textarea, select, .btn, .filterseg, .room-sort-toggle, .seg) { border-radius: 5px; }
:root[data-theme^="simple"] :is(.btn.sm, .filterseg button, .room-sort-option, .seg-opt, .mv-pin, .mv-edit, .mv-close, .chk-item .chk-x, .undo-bar .ub-x) { border-radius: 4px; }
:root[data-theme^="simple"] .room-item .r-ava { border-radius: 5px; }
:root[data-theme^="simple"] .t-color { border-radius: 6px 0 0 6px; }
/* the card is 6px here, so the bar's corners have to follow it down */
:root[data-theme^="simple"] .task-progress { border-radius: 0 0 5px 5px; }
/* the folded-stack slivers follow the card down to the small radius too */
:root[data-theme^="simple"] .task.folded::before { border-radius: 0 0 4px 4px; }
:root[data-theme^="simple"] .task.folded::after { border-radius: 0 0 5px 5px; }
:root[data-theme^="simple"] .sheet { border-radius: 10px 10px 0 0; }
:root[data-theme^="simple"] .sheet.center { border-radius: 8px; }
/* pills stay pills: property chips, counters and reaction chips are round in the reference too */

/* ---- flat surfaces: no brand gradients, no glow, only hairlines ---- */
:root[data-theme^="simple"] .room-item .r-ava {
  background: var(--panel2); border: 1px solid var(--line); color: var(--muted);
  font-weight: 600; text-shadow: none;
}
:root[data-theme^="simple"] .room-item:active { border-color: var(--line); background: var(--panel2); }
:root[data-theme^="simple"] :is(.fab, .fab-split) { background: var(--brand); box-shadow: var(--sw-2); }
:root[data-theme^="simple"] .ins-line { box-shadow: none; }
:root[data-theme^="simple"] .chat-ava { box-shadow: none; }
:root[data-theme^="simple"] .unread-n { text-shadow: none; }
:root[data-theme^="simple"] .file-preview { background: var(--panel2); }
:root[data-theme^="simple"] .subtree { border-left-width: 1px; }
:root[data-theme^="simple"] :is(.newmsg-pill, .task.ghost, .chk-item.chk-ghost, .memo-card.chk-ghost) { box-shadow: var(--sw-2); }
:root[data-theme^="simple"] .memo-card.flash { animation-name: taskflash-simple; }
:root[data-theme^="simple"] .move-bar { box-shadow: var(--sw-2); border-color: var(--line); }
:root[data-theme^="simple"] .privacy-card { box-shadow: var(--sw-2); }
:root[data-theme^="simple"] .room-sort-ghost { filter: var(--sw-drag); }
:root[data-theme^="simple"] .overlay { background: var(--scrim); backdrop-filter: none; }
:root[data-theme^="simple"] .sheet { box-shadow: var(--sw-sheet); }
:root[data-theme^="simple"] .grabber { background: var(--track); }

/* ---- chrome: white header, hairline separators, black underline on the live tab ---- */
:root[data-theme^="simple"] :is(.topbar, .tabs, .composer, .tasks-head) { background: var(--bg); }
:root[data-theme^="simple"] .tabs button { font-weight: 600; }
/* the underline alone was too quiet to find at a glance — a faint warm fill without going back to
   the brand-colored block the other themes use */
:root[data-theme^="simple"] .tabs button.active { color: var(--text); background: var(--bg2); font-weight: 700; }
:root[data-theme^="simple"] .tabs button.active::after { background: var(--text); height: 2px; }
:root[data-theme^="simple"] .composer .send { background: var(--brand); color: #fff; }
:root[data-theme^="simple"] .badge.zero { background: var(--panel2); color: var(--muted); }

/* ---- controls: white-on-gray segments, blue checks, blue toggles ---- */
:root[data-theme^="simple"] .filterseg { background: var(--panel2); }
:root[data-theme^="simple"] :is(.filterseg button, .room-sort-option, .seg-opt).active {
  background: var(--panel); color: var(--text); box-shadow: var(--sw-1);
}
:root[data-theme^="simple"] .btn.ghost { background: var(--panel); border: 1px solid var(--line); color: var(--text); }
:root[data-theme^="simple"] .toggle { background: var(--track); }
:root[data-theme^="simple"] .toggle.on { background: var(--brand); }
:root[data-theme^="simple"] :is(.check, .chk-item .chk-box, .checkbox) {
  border-radius: 3px; border-width: 1.5px; border-color: var(--ck-line); background: var(--panel);
}
:root[data-theme^="simple"] :is(.task.done .check, .chk-item .chk-box.on, .checkbox.on) {
  background: var(--brand); border-color: var(--brand); color: #fff;
}
:root[data-theme^="simple"] .task.cancelled .check { background: var(--panel2); border-color: var(--line); color: var(--muted); }
/* background-color, NOT the `background` shorthand: the shorthand also resets background-repeat and
   background-position, and the base `select` rule relies on both to pin its arrow SVG to the right
   edge. Resetting them tiled the arrow across the whole control as a zigzag pattern. */
:root[data-theme^="simple"] :is(input, textarea, select) { background-color: var(--panel); }
:root[data-theme^="simple"] :is(input, textarea, select):focus { box-shadow: 0 0 0 2px var(--focus); }
/* the base rule pairs --warn with hardcoded amber fills, which no longer match the darker --warn */
:root[data-theme^="simple"] .room-item .fav-star { color: var(--fav); }
:root[data-theme^="simple"] ::placeholder { color: var(--ph); }
/* the base arrow is tinted for the dark palette (#9aa3d4) and washes out on paper */
:root[data-theme^="simple"] select {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8'><path d='M1 1l5 5 5-5' stroke='%23787774' stroke-width='2' fill='none'/></svg>");
}
:root[data-theme^="simple"] .webhook-status.on { background: var(--saved-bg); color: var(--saved-fg); }

/* ---- chat: my bubble is a flat blue tint with body text, not white-on-gradient ---- */
:root[data-theme^="simple"] .chat-scroll { background: var(--bg2); }
:root[data-theme^="simple"] .msg.mine { background: var(--mine); border: 1px solid var(--mine-line); color: var(--text); }
:root[data-theme^="simple"] .msg.mine a { color: var(--link); }
/* --muted is tuned for white; on the blue tint it drops to 3.9:1, so the footer gets its own slate */
:root[data-theme^="simple"] .msg.mine :is(.time, .msg-reply) { color: var(--mine-fg2); }
:root[data-theme^="simple"] .msg.mine .unread-n { color: var(--unread); }
:root[data-theme^="simple"] .msg.mine .msg-more { color: var(--link); text-decoration: none; }
:root[data-theme^="simple"] .msg.mine .reply-quote { background: var(--quote-bg); border-left-color: var(--brand); }
:root[data-theme^="simple"] .msg.mine :is(.reply-quote b, .reply-quote span) { color: var(--text); }
:root[data-theme^="simple"] .msg.mine .reply-quote b { color: var(--accent-text); }
:root[data-theme^="simple"] .msg.mine .task-ref { background: var(--mine-inset); color: var(--taskref-fg); }
:root[data-theme^="simple"] .msg.mine .link-preview { background: var(--mine-inset); border-color: var(--mine-line); color: var(--text); }
:root[data-theme^="simple"] .msg.mine :is(.lp-site, .lp-desc) { color: var(--muted); }
:root[data-theme^="simple"] .msg.mine .rx-chip { background: var(--mine-inset); border-color: var(--mine-line); color: var(--text); }
:root[data-theme^="simple"] .msg.mine .rx-chip span { color: var(--muted); }
:root[data-theme^="simple"] .msg.mine .rx-chip.mine { border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand); }
/* both of these were picked to sit on the brand gradient — near-white on a light tint is invisible */
:root[data-theme^="simple"] .msg.mine .album-foot { color: var(--mine-fg2); }
:root[data-theme^="simple"] .msg.mine .fwd-tag {
  background: var(--mine-inset); border-color: var(--mine-line); color: var(--mine-fg2);
}
/* the tombstone outranks the bubble tint on BOTH sides — a deleted message of mine is not blue */
:root[data-theme^="simple"] :is(.msg.deleted, .msg.deleted.mine) {
  background: var(--panel2); border: 1px dashed var(--line); color: var(--muted);
}
:root[data-theme^="simple"] :is(.msg.deleted .time, .msg.deleted.mine .time) { color: var(--muted); }

/* ---- tasks: the completion flash is a dark navy in the base sheet, unreadable on paper ---- */
@keyframes taskflash-simple {
  0%, 55% { background: var(--tag-soon-bg); border-color: var(--fav-line); }
  100% { background: var(--panel); }
}
:root[data-theme^="simple"] .task.flash { animation-name: taskflash-simple; }
:root[data-theme^="simple"] .tag { font-weight: 500; }

/* ---- 글자 크기: 다른 테마와 동일 (v92) ----
   This block used to mirror the base "v11: larger base type" one step up (+1px on ~40 selectors),
   on the theory that a document-toned page is read from further away. In practice it just made
   심플 look bigger than every other theme for the same 글자 크기 setting — the two modes were
   supposed to differ in tone, not in size, and switching themes silently resized the chat and the
   task list. 심플 now inherits the base sizes verbatim; 설정 → 🎨 화면 → 글자 크기 is the one
   control that changes type size, and it means the same thing in every theme.

   Nothing replaces this block on purpose. If a 심플-only size ever comes back, it needs a reason
   that survives "then the same text is a different size depending on the theme". */

/* ---- 아이콘: 컬러 이모지 → 단색 선 아이콘 ----
   The chrome buttons were full-color emoji (👥🔗⚙️📎), which is most of what made the app read as
   loud next to a document-toned page. Each one becomes a stroked SVG painted through a CSS mask,
   so it takes `currentColor` and follows the theme instead of carrying its own palette. Color is
   kept only where it MEANS something: the ★ favorite stays amber, 보내기 stays on the blue button,
   and the pastel property chips (마감·담당자·알림) are untouched — those encode state.

   Emoji still live in the DOM as text; `font-size: 0` hides the glyph and ::before draws over it.
   That is what keeps this theme-scoped: every other theme renders the original emoji, untouched.
   ⚠️ The topbar hooks match on `title`, the only thing separating those four buttons. Change a
   title string in renderRoom() and that icon quietly falls back to its emoji. */
:root[data-theme^="simple"] :is(
  .topbar .iconbtn, .lobby-settings, .composer .iconbtn, .t-chat, .msg-reply,
  .room-sort-handle
) { font-size: 0; }
:root[data-theme^="simple"] :is(
  .topbar .iconbtn, .lobby-settings, .composer .iconbtn, .t-chat, .msg-reply,
  .room-sort-handle
)::before {
  content: ''; display: block; flex: none;
  width: var(--ic-size, 21px); height: var(--ic-size, 21px);
  background: currentColor;
  -webkit-mask: var(--ic) center / contain no-repeat;
          mask: var(--ic) center / contain no-repeat;
}
/* 상단바 — 검색 · 참여자 · 초대 · 방 설정 */
:root[data-theme^="simple"] .topbar .iconbtn { --ic-size: 20px; color: var(--muted); }
:root[data-theme^="simple"] .topbar .iconbtn[title="메시지 검색"] { --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M16.6 16.6 21 21'/%3E%3C/svg%3E"); }
:root[data-theme^="simple"] .topbar .iconbtn[title="참여자"] { --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='9.2' cy='8' r='3.5'/%3E%3Cpath d='M2.8 20c0-3.4 2.9-5.4 6.4-5.4s6.4 2 6.4 5.4'/%3E%3Cpath d='M16.4 5a3.5 3.5 0 0 1 0 6'/%3E%3Cpath d='M17.6 15c2.2.6 3.6 2.2 3.6 5'/%3E%3C/svg%3E"); }
:root[data-theme^="simple"] .topbar .iconbtn[title="초대 링크"] { --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M10.6 13.4a4.6 4.6 0 0 0 6.5 0l2.3-2.3a4.6 4.6 0 1 0-6.5-6.5l-1.3 1.3'/%3E%3Cpath d='M13.4 10.6a4.6 4.6 0 0 0-6.5 0l-2.3 2.3a4.6 4.6 0 1 0 6.5 6.5l1.3-1.3'/%3E%3C/svg%3E"); }
/* 설정은 톱니 대신 슬라이더 — 얇은 선에서 톱니는 뭉개져서 형태가 안 읽힌다 */
:root[data-theme^="simple"] :is(.topbar .iconbtn[title="방 설정"], .lobby-settings) { --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 7.5h8M17.5 7.5H20M4 16.5h2.6M12 16.5h8'/%3E%3Ccircle cx='14.7' cy='7.5' r='2.4'/%3E%3Ccircle cx='9.2' cy='16.5' r='2.4'/%3E%3C/svg%3E"); }
/* 입력줄 — 첨부 · 보내기 */
:root[data-theme^="simple"] .composer .iconbtn:not(.send) { --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.1' stroke-linecap='round'%3E%3Cpath d='M12 5.2v13.6M5.2 12h13.6'/%3E%3C/svg%3E"); color: var(--muted); }
:root[data-theme^="simple"] .composer .iconbtn.send { --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4.6 12h13.8'/%3E%3Cpath d='M12.8 6.2 18.8 12l-6 5.8'/%3E%3C/svg%3E"); }
/* 할일 코멘트 · 답글 */
:root[data-theme^="simple"] .t-chat { --ic-size: 16px; --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20.6 11.6a7.6 7.6 0 0 1-10.9 6.8l-5.3 1.4 1.4-5.2A7.6 7.6 0 1 1 20.6 11.6z'/%3E%3C/svg%3E"); }
:root[data-theme^="simple"] .msg-reply { --ic-size: 15px; --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9.4 6.6 4.4 11.6l5 5'/%3E%3Cpath d='M4.4 11.6h9.2a5.6 5.6 0 0 1 5.6 5.6v1'/%3E%3C/svg%3E"); }
/* 즐겨찾기 — 여기는 색이 상태를 뜻하므로 켜졌을 때만 채워진 별 + 앰버 유지 */
:root[data-theme^="simple"] .room-sort-handle { --ic-size: 18px; --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cg fill='%23000'%3E%3Ccircle cx='9' cy='6.2' r='1.5'/%3E%3Ccircle cx='15' cy='6.2' r='1.5'/%3E%3Ccircle cx='9' cy='12' r='1.5'/%3E%3Ccircle cx='15' cy='12' r='1.5'/%3E%3Ccircle cx='9' cy='17.8' r='1.5'/%3E%3Ccircle cx='15' cy='17.8' r='1.5'/%3E%3C/g%3E%3C/svg%3E"); }

/* ---- 글자 옆에 붙는 아이콘 (칩 · 배너 · 할일 이벤트 · 설정 머리글) ----
   Same mask trick as the icon buttons above, but these sit inline with text rather than filling a
   control, so they are inline-block and sized off the line. app.js wraps every UI emoji in
   <span class="ui-ic" data-ic="…"> (see UI_ICONS) — one hook, keyed by what the icon MEANS rather
   than by which component it happens to sit in, so the same name reuses one drawing everywhere.
   The wrapper renders the original emoji untouched in every other theme.

   Deliberately NOT wrapped, and therefore still emoji here: reactions, the 🤖 봇 badge, and any
   emoji a person typed. Those are content, not chrome. */
:root[data-theme^="simple"] .ui-ic { font-size: 0; }
:root[data-theme^="simple"] .ui-ic::before {
  content: ''; display: inline-block; flex: none;
  width: var(--ic-size, 13px); height: var(--ic-size, 13px); vertical-align: -0.15em;
  background: currentColor;
  -webkit-mask: var(--ic) center / contain no-repeat;
          mask: var(--ic) center / contain no-repeat;
  /* Breathing room between icon and label. Kept small by default because most of these sit either
     in a flex parent that already contributes a gap, or after the space labelParts() leaves in —
     --ic-gap is the top-up, not the whole distance, and is zeroed where the parent already pays. */
  margin-right: var(--ic-gap, 3px);
}
:root[data-theme^="simple"] :is(.systask, .notif-banner, .notice-bar, .drag-hint, .pin-bar, .task-ref) .ui-ic { --ic-gap: 0px; }
:root[data-theme^="simple"] :is(.lock-tag, .pin-ic) .ui-ic { --ic-gap: 0px; }   /* 아이콘 단독 — 뒤 여백 불필요 */

/* 추가는 초록, 완료는 파랑, 취소는 빨강 — 이 셋은 할일의 결과를 뜻하므로 단색 규칙의 예외로
   색을 남긴다. 채팅 흐름에서 한 줄씩 훑을 때 색만으로 어떤 사건인지 구분된다. */
:root[data-theme^="simple"] .ui-ic[data-ic="new"]::before { background: var(--ok); }
:root[data-theme^="simple"] .ui-ic[data-ic="done"]::before { background: var(--ic-done, var(--brand)); }
:root[data-theme^="simple"] .ui-ic[data-ic="cancel"]::before { background: var(--danger); }
/* 문맥별 크기 — 칩은 글자에 맞춰 작게, 배너·머리글은 크게 */
:root[data-theme^="simple"] :is(.systask, .notif-banner, .notice-bar, .drag-hint) .ui-ic { --ic-size: 14px; }
:root[data-theme^="simple"] :is(.acc-head, .install-top, .task-ref) .ui-ic { --ic-size: 16px; }
:root[data-theme^="simple"] :is(.btn, label, .checklist-members) .ui-ic { --ic-size: 14px; }
/* 자물쇠·고정 표식은 본문 옆 작은 표식이라 한 단계 더 작게 */
:root[data-theme^="simple"] :is(.lock-tag, .pin-ic) .ui-ic { --ic-size: 12px; }

/* 아이콘 정의 — data-ic 이름 하나당 하나. 필요한 곳 어디서든 재사용된다. */
:root[data-theme^="simple"] .ui-ic[data-ic="user"] { --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='8' r='3.6'/%3E%3Cpath d='M5 20c0-3.7 3.1-5.8 7-5.8s7 2.1 7 5.8'/%3E%3C/svg%3E"); }
:root[data-theme^="simple"] .ui-ic[data-ic="users"] { --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='9.2' cy='8' r='3.5'/%3E%3Cpath d='M2.8 20c0-3.4 2.9-5.4 6.4-5.4s6.4 2 6.4 5.4'/%3E%3Cpath d='M16.4 5a3.5 3.5 0 0 1 0 6'/%3E%3Cpath d='M17.6 15c2.2.6 3.6 2.2 3.6 5'/%3E%3C/svg%3E"); }
:root[data-theme^="simple"] .ui-ic[data-ic="pin"] { --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9.4 3.5h5.2l-.7 5.4 3.3 3.3H6.8l3.3-3.3z'/%3E%3Cpath d='M12 12.2v8.3'/%3E%3C/svg%3E"); }
:root[data-theme^="simple"] .ui-ic[data-ic="calendar"] { --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3.6' y='5.2' width='16.8' height='15.2' rx='2.2'/%3E%3Cpath d='M3.6 10h16.8M8.2 3.3v3.9M15.8 3.3v3.9'/%3E%3C/svg%3E"); }
:root[data-theme^="simple"] .ui-ic[data-ic="bell"] { --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M18 9.6a6 6 0 1 0-12 0c0 5.2-2 6.8-2 6.8h16s-2-1.6-2-6.8z'/%3E%3Cpath d='M13.7 20a2 2 0 0 1-3.4 0'/%3E%3C/svg%3E"); }
:root[data-theme^="simple"] .ui-ic[data-ic="bell-off"] { --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9.2 5.1A6 6 0 0 1 18 9.6c0 2.5.5 4.2 1 5.3'/%3E%3Cpath d='M6.3 7.4A6 6 0 0 0 6 9.6c0 5.2-2 6.8-2 6.8h13.2'/%3E%3Cpath d='M13.7 20a2 2 0 0 1-3.4 0'/%3E%3Cpath d='M3.2 3.2 20.8 20.8'/%3E%3C/svg%3E"); }
:root[data-theme^="simple"] .ui-ic[data-ic="list"] { --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M4 6.5h16M4 12h16M4 17.5h16'/%3E%3C/svg%3E"); }
:root[data-theme^="simple"] .ui-ic[data-ic="pause"] { --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.2' stroke-linecap='round'%3E%3Cpath d='M9 5.5v13M15 5.5v13'/%3E%3C/svg%3E"); }
:root[data-theme^="simple"] .ui-ic[data-ic="checkbox"] { --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3.8' y='3.8' width='16.4' height='16.4' rx='2.6'/%3E%3Cpath d='M8 12.2l2.8 2.8 5.2-5.6'/%3E%3C/svg%3E"); }
:root[data-theme^="simple"] .ui-ic[data-ic="clip"] { --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M19.6 11.4l-8 8a5.1 5.1 0 0 1-7.2-7.2l8.6-8.6a3.4 3.4 0 0 1 4.8 4.8l-8.4 8.4a1.7 1.7 0 0 1-2.4-2.4l7.7-7.7'/%3E%3C/svg%3E"); }
:root[data-theme^="simple"] .ui-ic[data-ic="install"] { --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3.6v11.2'/%3E%3Cpath d='M7.6 10.4 12 14.8l4.4-4.4'/%3E%3Cpath d='M4.6 19.6h14.8'/%3E%3C/svg%3E"); }
:root[data-theme^="simple"] .ui-ic[data-ic="search"] { --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M16.6 16.6 21 21'/%3E%3C/svg%3E"); }
:root[data-theme^="simple"] .ui-ic[data-ic="lock"] { --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='4.6' y='10.4' width='14.8' height='9.9' rx='2.2'/%3E%3Cpath d='M8.1 10.4V7.7a3.9 3.9 0 0 1 7.8 0v2.7'/%3E%3C/svg%3E"); }
:root[data-theme^="simple"] .ui-ic[data-ic="unlock"] { --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='4.6' y='10.6' width='14.8' height='9.8' rx='2.2'/%3E%3Cpath d='M8 10.6V7.9a4 4 0 0 1 7.7-1.5'/%3E%3C/svg%3E"); }
:root[data-theme^="simple"] .ui-ic[data-ic="key"] { --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='8' cy='16' r='4.2'/%3E%3Cpath d='M11 13 20 4'/%3E%3Cpath d='M17.2 6.8 19.4 9M14.8 9.2 17 11.4'/%3E%3C/svg%3E"); }
:root[data-theme^="simple"] .ui-ic[data-ic="home"] { --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3.6 10.4 12 3.6l8.4 6.8'/%3E%3Cpath d='M5.6 9v10.4a1 1 0 0 0 1 1h10.8a1 1 0 0 0 1-1V9'/%3E%3C/svg%3E"); }
:root[data-theme^="simple"] .ui-ic[data-ic="palette"] { --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 20.4a8.4 8.4 0 1 1 8.4-8.4c0 2-1.6 2.9-3.2 2.9h-1.4a2 2 0 0 0-1.4 3.4 1.7 1.7 0 0 1-1.2 2.1z'/%3E%3Cg fill='%23000' stroke='none'%3E%3Ccircle cx='8.2' cy='9.4' r='1.2'/%3E%3Ccircle cx='12' cy='7.4' r='1.2'/%3E%3Ccircle cx='15.8' cy='9.4' r='1.2'/%3E%3C/g%3E%3C/svg%3E"); }
:root[data-theme^="simple"] .ui-ic[data-ic="bulb"] { --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 18.2h6'/%3E%3Cpath d='M10 21h4'/%3E%3Cpath d='M8.4 15.2a5.8 5.8 0 1 1 7.2 0c-.8.6-1.2 1.3-1.3 2H9.7c-.1-.7-.5-1.4-1.3-2z'/%3E%3C/svg%3E"); }
:root[data-theme^="simple"] .ui-ic[data-ic="template"] { --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='5' y='5.4' width='14' height='14.8' rx='2'/%3E%3Crect x='9' y='3.2' width='6' height='3.8' rx='1.2'/%3E%3Cpath d='M8.8 11.8h6.4M8.8 15.6h4.4'/%3E%3C/svg%3E"); }
:root[data-theme^="simple"] .ui-ic[data-ic="notice"] { --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4.5 10.6v2.8A1.6 1.6 0 0 0 6.1 15H8l8 4.6V4.4L8 9H6.1a1.6 1.6 0 0 0-1.6 1.6z'/%3E%3Cpath d='M19 9.6a4 4 0 0 1 0 4.8'/%3E%3C/svg%3E"); }
:root[data-theme^="simple"] .ui-ic[data-ic="done"] { --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='8.4'/%3E%3Cpath d='M8.2 12.3l2.7 2.7 5-5.4'/%3E%3C/svg%3E"); }
:root[data-theme^="simple"] .ui-ic[data-ic="cancel"] { --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='8.4'/%3E%3Cpath d='M6.1 6.1 17.9 17.9'/%3E%3C/svg%3E"); }
:root[data-theme^="simple"] .ui-ic[data-ic="reopen"] { --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3.6 5.6v5.2h5.2'/%3E%3Cpath d='M4.4 13.4a8 8 0 1 0 1.6-5.6'/%3E%3C/svg%3E"); }
:root[data-theme^="simple"] .ui-ic[data-ic="new"] { --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='8.4'/%3E%3Cpath d='M12 8.2v7.6M8.2 12h7.6'/%3E%3C/svg%3E"); }
:root[data-theme^="simple"] .ui-ic[data-ic="edit"] { --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M16.5 3.9a2.3 2.3 0 0 1 3.3 3.3L8.4 18.7l-4.3 1 1-4.3z'/%3E%3C/svg%3E"); }
:root[data-theme^="simple"] .ui-ic[data-ic="alarm"] { --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12.6' r='7.8'/%3E%3Cpath d='M12 8.4v4.4l2.9 1.8'/%3E%3C/svg%3E"); }
:root[data-theme^="simple"] .ui-ic[data-ic="trash"] { --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4.6 6.8h14.8'/%3E%3Cpath d='M9.4 6.8V4.6h5.2v2.2'/%3E%3Cpath d='M6.7 6.8l.9 12.1a1.6 1.6 0 0 0 1.6 1.5h5.6a1.6 1.6 0 0 0 1.6-1.5l.9-12.1'/%3E%3C/svg%3E"); }
:root[data-theme^="simple"] .ui-ic[data-ic="enter"] { --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M13.6 3.6H6.4A1.6 1.6 0 0 0 4.8 5.2v13.6a1.6 1.6 0 0 0 1.6 1.6h7.2'/%3E%3Cpath d='M19.2 12H9.6'/%3E%3Cpath d='M15.8 8.6 19.2 12l-3.4 3.4'/%3E%3C/svg%3E"); }
/* 메시지 롱프레스 메뉴 · 할일 롱프레스 메뉴에서 쓰는 것들 (v93) */
:root[data-theme^="simple"] .ui-ic[data-ic="reply"] { --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9.4 6.6 4.4 11.6l5 5'/%3E%3Cpath d='M4.4 11.6h9.2a5.6 5.6 0 0 1 5.6 5.6v1'/%3E%3C/svg%3E"); }
:root[data-theme^="simple"] .ui-ic[data-ic="share"] { --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 15.4V3.8'/%3E%3Cpath d='M8.2 7.6 12 3.8l3.8 3.8'/%3E%3Cpath d='M5.2 13.4v5.4a1.4 1.4 0 0 0 1.4 1.4h10.8a1.4 1.4 0 0 0 1.4-1.4v-5.4'/%3E%3C/svg%3E"); }
:root[data-theme^="simple"] .ui-ic[data-ic="external"] { --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M13.4 4.4h6.2v6.2'/%3E%3Cpath d='M19.6 4.4 10.8 13.2'/%3E%3Cpath d='M18 14.4v4.2a1.4 1.4 0 0 1-1.4 1.4H5.4A1.4 1.4 0 0 1 4 18.6V7.4A1.4 1.4 0 0 1 5.4 6h4.2'/%3E%3C/svg%3E"); }
:root[data-theme^="simple"] .ui-ic[data-ic="copy"] { --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='9' y='9' width='11' height='11' rx='2'/%3E%3Cpath d='M15 5.6A1.6 1.6 0 0 0 13.4 4H5.6A1.6 1.6 0 0 0 4 5.6v7.8A1.6 1.6 0 0 0 5.6 15'/%3E%3C/svg%3E"); }
:root[data-theme^="simple"] .ui-ic[data-ic="play"] { --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M8 5.4 18 12 8 18.6z'/%3E%3C/svg%3E"); }
:root[data-theme^="simple"] .ui-ic[data-ic="folder"] { --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3.6 7.2a1.6 1.6 0 0 1 1.6-1.6h3.5l1.9 2.2h7.8a1.6 1.6 0 0 1 1.6 1.6v8.4a1.6 1.6 0 0 1-1.6 1.6H5.2a1.6 1.6 0 0 1-1.6-1.6z'/%3E%3C/svg%3E"); }
:root[data-theme^="simple"] .ui-ic[data-ic="plus"] { --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.1' stroke-linecap='round'%3E%3Cpath d='M12 5.2v13.6M5.2 12h13.6'/%3E%3C/svg%3E"); }
/* 할일 롱프레스 바 — 아이콘이 라벨 위에 홀로 서는 자리라 한 단계 크게, 뒤 여백은 없음 */
:root[data-theme^="simple"] .mv-btn .ui-ic { --ic-size: 17px; --ic-gap: 0px; }

/* ==================== v80: 메모 탭 ====================
   Uses the shared palette variables throughout, so every theme — including 심플, whose block below
   only has to restate radii — gets the memo surface for free. */
.memos-head { display: flex; align-items: center; gap: 8px; padding: 10px 12px;
  border-bottom: 1px solid var(--line); background: var(--bg2); }
.memo-search { flex: 1; min-width: 0; padding: 9px 11px; }
.memo-arch-btn { flex: none; white-space: nowrap; }
.memo-arch-btn.on { border-color: var(--brand); color: var(--brand); }

.memo-tagrow { display: flex; gap: 6px; overflow-x: auto; padding: 8px 12px;
  border-bottom: 1px solid var(--line); background: var(--bg2); scrollbar-width: none; }
.memo-tagrow::-webkit-scrollbar { display: none; }
.memo-tag { flex: none; border: 1px solid var(--line); border-radius: 999px; padding: 5px 11px;
  background: var(--panel); color: var(--muted); font-size: calc(12.5px * var(--fs));
  display: inline-flex; align-items: center; gap: 5px; }
.memo-tag.active { border-color: var(--brand); background: var(--taskref-bg); color: var(--taskref-fg); font-weight: 700; }
.memo-tag.sm { padding: 4px 9px; font-size: calc(11.5px * var(--fs)); }
.memo-tag .mt-n { font-size: calc(11px * var(--fs)); opacity: .7; font-variant-numeric: tabular-nums; }

.memos-scroll { flex: 1; overflow-y: auto; padding: 8px 10px calc(var(--safe-bottom) + 88px); }
.memo-list { position: relative; }
.memo-card { display: flex; align-items: flex-start; gap: 10px; padding: 11px 12px; margin: 6px 0;
  border-radius: 11px; background: var(--panel); border: 1px solid var(--line);
  touch-action: pan-y; position: relative;
  user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.memo-card.pinned { border-color: var(--brand); }
.memo-card.archived { opacity: .72; }
.memo-card.flash { animation: taskflash 1.6s ease; }
.memo-body { flex: 1; min-width: 0; }
.memo-title { font-size: calc(16px * var(--fs)); font-weight: 650; word-break: break-word; }
.memo-preview { font-size: calc(13.5px * var(--fs)); color: var(--muted); margin-top: 4px;
  word-break: break-word; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.memo-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 7px; align-items: center; }
.memo-pin { width: 30px; height: 30px; border-radius: 8px; flex: none; display: grid; place-items: center;
  font-size: 15px; opacity: .35; }
.memo-pin.on { opacity: 1; background: var(--taskref-bg); }
.tag.memo-tagchip { background: var(--taskref-bg); color: var(--taskref-fg); }
.tag.memo-archived { background: var(--chip); color: var(--muted); }

/* drag: the gesture is attachCheckPress, but its state classes are scoped to .chk-item */
.memo-card.chk-drag-source { opacity: .25; }
.memo-card.chk-drop-target { outline: 2px solid var(--brand); outline-offset: 1px; }
.memo-card.chk-ghost { position: fixed; z-index: 1100; pointer-events: none; margin: 0;
  box-shadow: 0 12px 28px rgba(0, 0, 0, .45); }

/* ---- memo body blocks ----
   Shared by the read-only render (card 미리보기 / 전체보기) and by the WYSIWYG editor, so what you
   type looks like what the memo will look like. One rule set, no second copy to drift. */
:is(.memo-render, .memo-wysiwyg) { font-size: calc(15px * var(--fs)); line-height: 1.6; word-break: break-word; }
:is(.memo-render, .memo-wysiwyg) :is(.memo-h1, h1) { font-size: calc(20px * var(--fs)); font-weight: 800; margin: 12px 0 5px; }
:is(.memo-render, .memo-wysiwyg) :is(.memo-h2, h2) { font-size: calc(17px * var(--fs)); font-weight: 750; margin: 10px 0 4px; }
:is(.memo-render, .memo-wysiwyg) :is(.memo-h3, h3) { font-size: calc(15.5px * var(--fs)); font-weight: 700; margin: 9px 0 3px; }
:is(.memo-render, .memo-wysiwyg) > :first-child { margin-top: 0; }
:is(.memo-render, .memo-wysiwyg) .memo-p { margin: 5px 0; }
:is(.memo-render, .memo-wysiwyg) :is(.memo-ul, ul) { margin: 5px 0; padding-left: 20px; }
:is(.memo-render, .memo-wysiwyg) :is(.memo-ul, ul) li { margin: 2px 0; }
:is(.memo-render, .memo-wysiwyg) :is(.memo-quote, blockquote) { margin: 7px 0; padding: 4px 0 4px 11px; border-left: 3px solid var(--line); color: var(--muted); }
:is(.memo-render, .memo-wysiwyg) a { color: var(--brand); }
:is(.memo-render, .memo-wysiwyg) :is(s, strike, del) { opacity: .65; }

/* ---- editor ---- */
.memo-toolbar { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 6px; }
.memo-tb { border: 1px solid var(--line); border-radius: 7px; padding: 6px 9px; min-width: 34px;
  background: var(--bg2); color: var(--text); font-size: calc(12.5px * var(--fs)); line-height: 1.2; }
.memo-tb.tb-b { font-weight: 900; }
.memo-tb.tb-i { font-style: italic; }
.memo-tb.tb-s { text-decoration: line-through; }
.memo-tb.tb-h1 { font-weight: 800; font-size: calc(13.5px * var(--fs)); }
.memo-tb.tb-h2 { font-weight: 700; }
/* The editable surface. It is a div, not a textarea, so it has to borrow the input chrome by hand —
   matching input/textarea above keeps it from looking like a different kind of control. */
.memo-wysiwyg {
  position: relative; width: 100%; min-height: 170px; max-height: 46vh; overflow-y: auto;
  color: var(--text); background: var(--bg2);
  border: 1px solid var(--line); border-radius: 10px; padding: 11px 12px;
}
.memo-wysiwyg:focus { outline: none; border-color: var(--brand); }
/* ::placeholder is a form-control pseudo and does nothing on a div; is-empty is set from JS
   because the element is never truly :empty — it always holds one paragraph for the caret. */
.memo-wysiwyg.is-empty::before {
  content: attr(data-placeholder); position: absolute; left: 12px; top: 11px;
  color: #6b74a8; pointer-events: none;
}
.memo-tagedit { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; min-height: 28px; margin-bottom: 6px; }
.memo-tagsuggest { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 7px; }

@media (max-width: 390px) {
  .memos-head { padding: 9px 10px; gap: 6px; }
  .memo-tb { padding: 6px 8px; }
}

/* ---- v84: 휴지통 ---- */
.memo-trash-btn { flex: none; min-width: 38px; padding-left: 10px; padding-right: 10px; }
.memo-trash-btn.on { border-color: var(--brand); color: var(--brand); }
.tag.memo-trashed { background: var(--tag-over-bg, var(--chip)); color: var(--tag-over-fg, var(--muted)); }
.memo-restore { opacity: 1; font-size: 16px; }
.memo-trashbar { display: flex; align-items: center; gap: 10px; padding: 9px 12px;
  border-bottom: 1px solid var(--line); background: var(--bg2); }
.memo-trashbar .hint { flex: 1; min-width: 0; margin: 0; }
.memo-trashbar .btn { flex: none; }

/* ===== 드라이브 (v96 · v98) — 이 방의 Google Drive 폴더로 가는 문 =====
   목록을 그리지 않으므로 리스트 스타일이 없다. 카드 하나와 큰 링크 하나가 전부고, 그게 설계다.

   v98: 「자료실」이라는 이름을 버렸다. 그 말은 «Cowork 안에 무언가 들어 있다» 로 읽히는데 파일은
   Cowork 에 하나도 없다 — 전부 방장의 Drive 에 있다. 이름·아이콘·문장이 전부 Drive 를 가리켜야
   사람이 Drive 링크로 공유하고 Drive 앱에서 연다. */
/* ?perf=1 계측 패널. 폰에는 콘솔이 없어서 숫자가 화면에 있어야 한다(core.js 참고).
   평소에는 이 요소 자체가 만들어지지 않으므로 규칙 하나가 노는 값이다. 탭하면 비워진다. */
#perf-panel {
  position: fixed; left: 6px; right: 6px; bottom: calc(var(--safe-bottom) + 6px); z-index: 9000;
  max-height: 40vh; overflow-y: auto; padding: 7px 9px; border-radius: 10px;
  background: rgba(0,0,0,.82); color: #9ef01a; pointer-events: auto;
  font: 11px/1.45 ui-monospace, SFMono-Regular, Consolas, monospace;
  white-space: pre; word-break: keep-all;
}

/* 브랜드 마크. .ui-ic 의 테마 치환에 태우지 않는다 — 심플 테마에서 회색 선 아이콘이 되면
   «구글 드라이브» 라는 신호가 통째로 사라지고, 그 신호가 이 탭이 하는 말의 절반이다. */
.gdrive-mark { flex: none; display: block; }
/* 열린 추가 탭은 그림만 단다(paintMoreTab 참고). 글자가 빠지면 버튼이 좁아지므로 좌우 여백을
   넓혀 손가락이 닿을 폭을 되돌린다 — 주 탭 셋의 폭은 건드리지 않는다. */
.tabs .tab-more.active { display: inline-flex; align-items: center; justify-content: center;
  padding-left: 20px; padding-right: 20px; }
.files-scroll { flex: 1; overflow-y: auto; padding: 14px 12px calc(var(--safe-bottom) + 24px); }
.files-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px 18px; text-align: center; }
.files-card .fs-ic { display: flex; justify-content: center; line-height: 1; margin-bottom: 12px; }
.files-card b { display: block; font-size: 17px; margin-bottom: 8px; }
/* v98: 13px → 15px. 이 카드는 화면 전체가 설명 하나다 — 읽히지 않으면 «자료실 만들기» 를 누를
   근거가 없다. 제목과의 차이를 3px(16/13)에서 2px(17/15)로 좁혀, 본문이 각주처럼 보이지 않게. */
.files-card p { font-size: 15px; color: var(--muted); line-height: 1.65; margin: 0 0 14px; word-break: keep-all; }
/* 권한 문구는 안내가 아니라 약속이라, 본문에서 한 번 더 떼어 놓는다 */
.files-card .files-scope { background: var(--chip); border-radius: 10px; padding: 11px 12px;
  font-size: 13.5px; line-height: 1.6; text-align: left; }
.files-card .btn { width: 100%; }

/* «열기» 는 이 탭의 주인공이라 버튼이 아니라 행 전체가 과녁이다 — 안드로이드에서는 이걸 누르면
   Drive 앱이 열린다. .filecard 와 같은 모양을 쓰지 않는 이유는 저건 첨부 한 개를 가리키고
   이건 폴더 전체를 가리키기 때문이다. */
.files-head { display: flex; align-items: stretch; gap: 8px; }
.files-head .files-open { flex: 1; min-width: 0; }
/* ⋯ 는 <a> 밖에 선다 — 링크 안에 버튼을 넣을 수 없다. 높이를 stretch 로 맞춰 두 개가 한 행으로
   읽히게 하고, 폭은 손가락이 닿는 44px 을 준다. */
.files-more { flex: none; width: 44px; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--panel); color: var(--muted); font-size: 19px; line-height: 1; }
.files-more:active { background: var(--panel2); }
.files-open { display: flex; align-items: center; gap: 12px; text-decoration: none; color: inherit;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 15px 14px; }
.files-open:active { background: var(--panel2); }
.files-open .fo-ic { display: flex; line-height: 1; flex: none; }
.files-open .fo-main { flex: 1; min-width: 0; }
.files-open .fo-main b { display: block; font-size: 15.5px; }
/* keep-all: at 13.5px this line wraps, and without it Korean breaks mid-word («…에서 해 / 요»). */
.files-open .fo-main span { display: block; font-size: 13.5px; color: var(--muted); margin-top: 3px;
  line-height: 1.45; word-break: keep-all; }
.files-open .fo-go { font-size: 20px; color: var(--muted); flex: none; }
/* 링크 복사 · 이름 바꾸기. «여는 것» 보다 한 단 작게 두는 것이 의도다 — 이 탭에서 가장 큰
   버튼은 언제나 Drive 로 나가는 문이어야 한다. */
.files-actions { display: flex; gap: 8px; margin-top: 10px; }
.files-actions .btn { flex: 1; min-width: 0; white-space: nowrap; }
/* v98: embeddedfolderview 미리보기를 걷어냈다. 그건 «링크가 있는 모든 사람» 으로 공개된 폴더에만
   그려진다 — 우리 폴더는 사람을 지정해 공유하므로 언제나 빈 네모였다. 이 파일의 옛 주석이 이미
   그 실패를 예고하고 있었는데(구글 로그인 화면은 프레임에 못 뜬다), «덤이니까» 로 남겨 둔 것이
   잘못이었다. 아무것도 안 보이는 큰 상자는 덤이 아니라 고장으로 읽힌다. */
/* 문단이 아니라 줄 셋. 서로 상관없는 사실이 셋이라, 이어 붙이면 읽는 사람이 스스로 갈라야 한다.
   가운뎃점은 ::before 로 그린다 — 기본 disc 는 이 크기에서 각주보다 눈에 띈다. */
.files-note { list-style: none; padding: 0; margin: 14px 2px 0;
  font-size: 13px; color: var(--muted); line-height: 1.55; word-break: keep-all; }
.files-note li { position: relative; padding-left: 11px; }
.files-note li + li { margin-top: 5px; }
.files-note li::before { content: '·'; position: absolute; left: 1px; opacity: .8; }
/* 용량이 누구 몫인지 — 이 각주에서 사람들이 반대로 짐작하는 유일한 대목이라 색까지 올린다. */
.files-note b { color: var(--text); font-weight: 700; }


/* ============================== 일정 (v120c) ==============================
 * 칸 안에 제목을 쓰지 않는다 — 375px 에서 한 칸은 47px 남짓이라 들어가는 글자가 두 자고, 그러면
 * «회의» 와 «회식» 이 같은 모양이 된다. 칸은 «몇 개가 무슨 색으로» 만 말하고 이름은 아래 목록이
 * 맡는다. 달력 한 번 보고 날짜 한 번 누르는 두 동작이, 읽을 수 없는 한 화면보다 낫다.
 * ------------------------------------------------------------------------------------------- */
.cal-head { display: flex; align-items: center; gap: 6px; padding: 8px 10px;
  background: var(--bg2); border-bottom: 1px solid var(--line); }
.cal-nav { width: 30px; height: 30px; border-radius: 8px; background: var(--panel);
  color: var(--text); font-size: 18px; line-height: 1; flex: none; }
.cal-nav:active { background: var(--panel2); }
.cal-month { font-size: 15.5px; font-weight: 800; min-width: 92px; text-align: center; }
.cal-seg { margin-left: auto; }

.cal-grid { padding: 4px 6px 0; }
.cal-dow { display: grid; grid-template-columns: repeat(7, 1fr); text-align: center;
  font-size: 11.5px; font-weight: 700; color: var(--muted); padding: 2px 0 4px; }
.cal-dow .cal-sun { color: #f87171; } .cal-dow .cal-sat { color: #60a5fa; }
.cal-week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; margin-bottom: 2px; }

/* 칸은 «날짜 + 표식» 두 줄이다. 높이를 고정하는 것은 달을 넘길 때 격자가 출렁이지 않게 하려는 것 —
   주 수가 4~6 으로 달라지므로 칸까지 늘었다 줄면 아래 목록이 함께 뛴다. */
.cal-cell { height: 46px; border-radius: 9px; background: var(--panel); border: 1px solid transparent;
  display: flex; flex-direction: column; align-items: center; justify-content: flex-start;
  gap: 2px; padding: 4px 2px 0; }
.cal-cell.cal-out { opacity: .38; }
.cal-cell.cal-sel { border-color: var(--brand); background: var(--panel2); }
.cal-cell.cal-today .cal-d { background: var(--brand); color: #fff; }
.cal-d { font-size: 12.5px; font-weight: 700; line-height: 1; min-width: 19px; height: 19px;
  border-radius: 999px; display: grid; place-items: center; }
.cal-d.cal-sun { color: #f87171; } .cal-d.cal-sat { color: #60a5fa; }
.cal-cell.cal-today .cal-d.cal-sun, .cal-cell.cal-today .cal-d.cal-sat { color: #fff; }
.cal-marks { display: flex; align-items: center; gap: 2px; flex-wrap: wrap;
  justify-content: center; line-height: 1; }
.cal-mark { width: 6px; height: 6px; border-radius: 2px; display: block; }
/* 할일·메모의 마감은 동그라미로, 일정은 막대로. 색이 같아도 «무엇인지» 가 갈린다.
   ⚠️ 갈래 이름에 cal- 을 붙이는 이유: 맨 이름을 쓰면 앱의 다른 규칙이 그대로 걸린다. 실제로
   class="cal-mark task" 가 할일 «카드» 의 .task(padding 10px · radius 11px)를 물어서 6px 점이
   22px 상자가 됐다(실측). 1800줄짜리 한 장짜리 스타일시트에서 맨 이름은 남의 것이다. */
.cal-mark.cal-task, .cal-mark.cal-memo { border-radius: 50%; }
.cal-mark.cal-done { opacity: .4; }
/* 반복 할일의 앞으로의 회차(v138) — 아직 없는 «예정». 흐리게, 줄은 긋지 않는다(끝낸 것이 아니다). */
.cal-mark.cal-next { opacity: .45; }
.cal-more { font-size: 9.5px; font-weight: 700; color: var(--muted); }

.cal-daybar { padding: 9px 12px 5px; font-size: 13.5px; font-weight: 800; color: var(--text); }
.cal-daybar .hint { font-weight: 600; }
.cal-scroll { flex: 1; overflow-y: auto; padding: 0 10px calc(var(--safe-bottom) + 88px); }

.cal-row { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 11px;
  background: var(--panel); border: 1px solid var(--line); margin: 6px 0; }
.cal-row:active { background: var(--panel2); }
.cal-row.cal-dim { opacity: .55; }
.cal-row.cal-dim .cal-row-title { text-decoration: line-through; }
.cal-row.cal-next { opacity: .7; border-style: dashed; }
.cal-bar { width: 4px; align-self: stretch; border-radius: 999px; flex: none; }
.cal-row-main { min-width: 0; flex: 1; }
.cal-row-title { font-size: 14.5px; font-weight: 700; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap; }
.cal-row-meta { font-size: 12px; color: var(--muted); margin-top: 2px; }
.cal-rep, .cal-src { font-size: 11.5px; margin-right: 4px; }
/* 알림을 눌러 들어왔을 때 «그 줄이 반짝인다» — gotoTask 의 강조와 같은 뜻, 같은 길이. */
.cal-row.cal-flash { animation: cal-flash 1.6s ease-out; }
@keyframes cal-flash {
  0%, 60% { border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand); }
  100% { border-color: var(--line); box-shadow: none; }
}

/* 편집기의 반복 칸 */
.repeat-box { margin-top: 8px; display: grid; gap: 8px; }
.repeat-box .row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 14px; }
.dow-row { display: flex; gap: 4px; }
.dow-sw { flex: 1; height: 34px; border-radius: 8px; background: var(--panel2); color: var(--muted);
  font-size: 13px; font-weight: 700; }
.dow-sw.sel { background: var(--brand); color: #fff; }
.scope-rows { display: block; }

/* 로비의 «다가오는 일정» (v122) — 카드 한 장, 넉 줄까지.
   방 목록과 같은 알약 모양을 쓰되 아바타 자리에 색 막대를 둔다: 여기서 먼저 읽어야 하는 것은
   «누구» 가 아니라 «언제·어느 방» 이다. */
.cal-card-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.cal-card-head h2 { margin: 0; flex: 1; }
.cal-up { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left;
  padding: 9px 10px; border-radius: 11px; background: var(--panel2); margin-top: 6px; }
.cal-up:active { background: var(--chip); }
.cal-up .cal-bar { width: 4px; align-self: stretch; min-height: 30px; border-radius: 999px; flex: none; }
.cal-up-main { min-width: 0; flex: 1; }
.cal-up-title { font-size: 14px; font-weight: 700; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap; }
.cal-up-meta { font-size: 12px; color: var(--muted); margin-top: 2px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* 일정 휴지통 (v123) — 메모 휴지통(v84)과 같은 말투. 줄은 달력의 줄(.cal-row)을 그대로 쓰되
   누르는 곳이 «되돌리기» 하나뿐이라 줄 자체는 눌리는 모양을 내지 않는다. */
.cal-daybar { display: flex; align-items: center; gap: 8px; }
.cal-daybar-label { flex: 1; min-width: 0; }
.cal-trash-link { flex: none; font-size: 12.5px; font-weight: 700; color: var(--muted);
  padding: 4px 8px; margin: -4px -6px -4px 0; border-radius: 8px; }
.cal-trash-link:active { background: var(--panel2); }
.cal-trash-title { font-size: 15.5px; font-weight: 800; }
.cal-trash-n { font-size: 12.5px; font-weight: 700; color: var(--muted); }
.cal-trashbar { display: flex; align-items: center; gap: 10px; padding: 9px 12px;
  border-bottom: 1px solid var(--line); background: var(--bg2); }
.cal-trashbar .hint { flex: 1; min-width: 0; margin: 0; }
.cal-trashbar .btn { flex: none; }
.cal-row.cal-trash-row { cursor: default; }
.cal-row.cal-trash-row:active { background: var(--panel); }
.cal-trash-row .cal-row-title { white-space: normal; }
.cal-trash-left { color: var(--tag-over-fg, var(--muted)); }
.cal-restore { flex: none; white-space: nowrap; }
/* 머리줄의 버튼 글자는 접히지 않는다 — «오늘» 이 «오/늘» 로 서면 버튼이 아니라 세로 글씨다. */
.cal-head .btn, .cal-seg button { white-space: nowrap; }

/* AI 비서 — 10분에 부를 수 있는 횟수(v124). 전역 select 는 폭 100% 라 줄 오른쪽에 제 폭으로 세운다. */
.ai-limit { border-bottom: none; padding-bottom: 4px; }
.ai-limit select { flex: none; width: auto; min-width: 96px; padding-top: 8px; padding-bottom: 8px; }
/* AI 비서 — 내 AI 규칙(v135). 글자 수와 저장 버튼을 입력칸 아래 한 줄에. */
.ai-rules textarea { margin-top: 8px; min-height: 112px; resize: vertical; line-height: 1.5; }
.ai-rules-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 6px; }
.ai-rules-count { font-size: calc(12.5px * var(--fs)); color: var(--muted); }
/* 방 설정 — 이 방의 AI 규칙(v137)을 방장이 아닌 사람이 볼 때. 적은 줄바꿈 그대로. */
.ai-room-rules { margin-top: 8px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--bg2); white-space: pre-wrap; word-break: break-word; line-height: 1.5; font-size: calc(14px * var(--fs)); }

/* 입력창의 ＋ (v124) */
.composer .composer-plus { font-size: 24px; font-weight: 500; color: var(--muted); }

/* 작은 메뉴 (v126, sheets.js 의 openMenu) — 누른 버튼 바로 옆에 뜬다. 층은 시트와 같은 #overlay 지만
   바탕을 어둡게 하지 않는다. ⚠️ 심플 테마의 «:root[data-theme^=simple] .overlay» 가 바탕을 칠하므로
   그보다 센 선택자로 걷어 낸다(맨 .overlay.ctx 는 그 규칙에 진다). */
.overlay.ctx, :root[data-theme] .overlay.ctx { background: transparent; backdrop-filter: none; display: block; }
.ctx-menu { position: absolute; min-width: 216px; max-width: calc(100vw - 16px); padding: 5px;
  background: var(--panel); color: var(--text); border: 1px solid var(--line); border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .18), 0 2px 8px rgba(0, 0, 0, .08);
  transform-origin: bottom left; animation: ctx-in .12s ease-out; }
.ctx-menu.below { transform-origin: top left; }
.ctx-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 12px;
  border-radius: 8px; text-align: left; font-size: 14.5px; color: var(--text); }
.ctx-item:hover, .ctx-item:focus-visible { background: var(--panel2); outline: none; }
.ctx-item:active { background: var(--chip); }
.ctx-ic { flex: none; width: 20px; text-align: center; font-size: 16px; line-height: 1; }
.ctx-label { flex: 1; min-width: 0; white-space: nowrap; font-weight: 600; }
.ctx-hint { flex: none; font-size: 12px; color: var(--muted); white-space: nowrap; }
.ctx-sep { height: 1px; background: var(--line); margin: 4px 8px; }
.ctx-note { padding: 6px 12px 4px; font-size: 11.5px; color: var(--muted); }
@keyframes ctx-in { from { opacity: 0; transform: translateY(4px) scale(.98); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .ctx-menu { animation: none; } }

/* ===== 위원회(Committee) — docs/committee-contract.md · src/legacy/js/committee.js =====
   위원회 글은 «AI 주관자» 한 명의 말풍선 안에 위원 카드로 보인다. 머리는 역할(굵게) | 실제로 쓴 모델(작게).
   모델을 모르면 «모델 미확인» 을 흐리게 — 추정한 것처럼 보이지 않게. 색은 모두 테마 변수만 쓴다. */
.cm-card { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.cm-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; }
.cm-role { font-weight: 800; font-size: calc(13.5px * var(--fs)); }
.cm-model { color: var(--muted); font-size: calc(11.5px * var(--fs)); overflow-wrap: anywhere; }
.cm-model.unknown { font-style: italic; opacity: .8; }
.cm-agenda, .cm-part { padding: 0 6px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted);
  font-size: calc(10.5px * var(--fs)); font-weight: 700; line-height: 1.5; }
.cm-title { font-weight: 700; font-size: calc(13.5px * var(--fs)); word-break: keep-all; }
.cm-text { white-space: pre-wrap; }
.cm-summary { border-left: 3px solid var(--brand); padding-left: 9px; }
.cm-summary .cm-role { color: var(--brand); }
.cm-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.cm-actions .btn.sm { padding: 5px 10px; }
.cm-tag { border-color: var(--brand); }
.ai-chip.cm-chip { border-color: var(--brand); }

/* 상단 상태 — 진행 중인 위원회 실행이 있을 때만(목록 위 한두 줄). */
.cm-status { display: flex; flex-direction: column; gap: 4px; padding: 6px 12px; background: var(--panel);
  border-bottom: 1px solid var(--line); }
.cm-status-row { display: flex; align-items: center; gap: 8px; min-width: 0; }
.cm-status-main { flex: 1; min-width: 0; display: flex; align-items: center; gap: 6px; text-align: left;
  font-size: calc(13px * var(--fs)); font-weight: 700; color: var(--text); overflow: hidden; }
.cm-status-main span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cm-status-row.warn .cm-status-main { color: var(--warn); }
.cm-status-row .btn.sm { flex: none; padding: 4px 10px; }

/* 안내 시트 · 방 설정 */
.cm-help-state { display: flex; flex-direction: column; gap: 4px; margin: 0 0 12px; padding: 10px 12px; border-radius: 12px;
  background: var(--panel); border: 1px solid var(--line); font-size: 14px; line-height: 1.45; word-break: keep-all; }
.cm-help-state p { margin: 0; color: var(--muted); font-size: 13px; }
.cm-ex .ai-ex-at { min-width: 7.5em; }
.cm-sec { margin-top: 14px; }
.cm-sec .hint { margin: 2px 0 6px; }
.cm-ops { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 4px 0 8px; }
.cm-op { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; }
.cm-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 6px 0 10px; }
.cm-grid label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); }
.cm-grid input { width: 100%; }
.cm-danger-row { display: flex; gap: 8px; margin: 12px 0 8px; flex-wrap: wrap; }
/* «중단» 은 위험한 동작이지만 늘 보이는 줄에 꽉 찬 빨강이면 시끄럽다 — 테두리만. */
.cm-status .btn.danger, .cm-actions .btn.danger { background: transparent; color: var(--danger); border: 1px solid var(--danger); }
