/* ===========================================================
   아리 — 메일(Mail)  ·  클린 화이트 글래스 테마
   상단바 = 메인 메뉴 (공유)
   좌측 사이드바 = 계정/폴더/라벨 · 가운데 = 메일 목록 · 우측 = 리딩 + 아리 분석
   AI 비서가 새 메일을 읽고 할 일·일정·답장·정리를 미리 준비해 둔다.
   =========================================================== */

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

:root {
  --bg-top: #f6efe7;
  --bg-mid: #eef0f1;
  --bg-bot: #e9ebed;
  --card: #ffffff;
  --card-2: #f4f5f6;
  --card-3: #eef0f1;
  --ink: #211f1c;
  --ink-2: #514d47;
  --muted: #8d8a85;
  --faint: #b6b3ad;
  --line: rgba(33, 31, 28, 0.07);
  --line-2: rgba(33, 31, 28, 0.13);
  --fill: #29241f;
  --fill-soft: #36302a;
  --on-fill: #f4efe6;
  --blue: #4f72e0;
  --coral: #df7256;
  --green: #4e9b66;
  --violet: #8b6fd4;
  --amber: #e0a23c;
  --radius: 22px;
  --radius-sm: 14px;
  --shadow: 0 10px 30px -14px rgba(30, 26, 22, 0.22), 0 2px 6px -2px rgba(30, 26, 22, 0.06);
  --shadow-sm: 0 4px 14px -8px rgba(30, 26, 22, 0.18);
  --glass: rgba(255, 255, 255, 0.4);
  --glass-2: rgba(255, 255, 255, 0.26);
  --glass-brd: rgba(255, 255, 255, 0.7);
  --glass-ink: rgba(26, 22, 18, 0.46);
  --blur: blur(26px) saturate(190%);
  --glass-hi: inset 0 1px 0 rgba(255, 255, 255, 0.75);
  --font-disp: "Onest", "Pretendard", system-ui, sans-serif;
  --font-ui: "Pretendard", "Onest", system-ui, sans-serif;
  --font-mono: "DM Mono", ui-monospace, monospace;
}
[data-theme="dark"] {
  --bg-top: #201d1a;
  --bg-mid: #1a1816;
  --bg-bot: #161413;
  --card: #2c2925;
  --card-2: #353029;
  --card-3: #3b352d;
  --ink: #f3eee6;
  --ink-2: #c3bdb4;
  --muted: #948e85;
  --faint: #6f6a62;
  --line: rgba(244, 239, 230, 0.09);
  --line-2: rgba(244, 239, 230, 0.16);
  --fill: #f4efe6;
  --fill-soft: #e7e0d4;
  --on-fill: #211f1c;
  --shadow: 0 14px 36px -16px rgba(0, 0, 0, 0.7), 0 2px 8px -3px rgba(0, 0, 0, 0.4);
  --shadow-sm: 0 6px 16px -10px rgba(0, 0, 0, 0.6);
  --glass: rgba(48, 43, 38, 0.4);
  --glass-2: rgba(70, 63, 55, 0.28);
  --glass-brd: rgba(255, 255, 255, 0.1);
  --glass-ink: rgba(16, 13, 11, 0.42);
  --glass-hi: inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

body {
  font-family: var(--font-ui);
  color: var(--ink);
  background: linear-gradient(178deg, var(--bg-top) 0%, var(--bg-mid) 20%, var(--bg-bot) 100%);
  background-attachment: fixed;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  letter-spacing: -0.011em;
  word-break: keep-all;
}
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, textarea { font-family: inherit; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; border-radius: 6px; }
.ic { width: 1em; height: 1em; flex-shrink: 0; display: block; }
.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }

.mpage { max-width: 1680px; margin: 0 auto; padding: 0 26px 26px; }

/* ====================== 상단바 — 메인 메뉴 (공유) ====================== */
.topbar {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; gap: 24px;
  height: 70px; margin: 0 -26px; padding: 0 30px;
  -webkit-backdrop-filter: blur(14px) saturate(150%);
  backdrop-filter: blur(14px) saturate(150%);
}
.brand { display: flex; align-items: center; gap: 11px; flex-shrink: 0; }
.brand-mark {
  width: 40px; height: 40px; border-radius: 12px;
  background: var(--fill); color: var(--coral);
  display: grid; place-items: center; position: relative;
}
.brand-mark .ic { width: 21px; height: 21px; }
.brand-mark::after {
  content: ""; position: absolute; top: -2px; right: -2px;
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--coral); border: 2px solid var(--bg-top);
}
.brand-tag { line-height: 1.15; }
.brand-tag b { display: block; font-size: 15px; font-weight: 700; letter-spacing: -0.02em; white-space: nowrap; }
.brand-tag span {
  font-size: 9.5px; font-weight: 700; letter-spacing: 0.08em;
  color: var(--muted); text-transform: uppercase; white-space: nowrap;
}
.mainnav { display: flex; align-items: center; gap: 2px; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.mainnav::-webkit-scrollbar { display: none; }
.mainnav a {
  text-decoration: none; cursor: pointer;
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 14px; font-weight: 500; color: var(--ink-2);
  padding: 9px 16px; border-radius: 999px; white-space: nowrap;
  transition: background 0.16s, color 0.16s, box-shadow 0.16s;
}
.mainnav a .ic { width: 16px; height: 16px; color: var(--muted); transition: color 0.16s; }
.mainnav a:hover { color: var(--ink); }
.mainnav a:hover .ic { color: var(--ink-2); }
.mainnav a.active {
  background: var(--glass);
  -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
  color: var(--ink); font-weight: 600; box-shadow: var(--shadow-sm);
  border: 1px solid var(--glass-brd);
}
.mainnav a.active .ic { color: var(--ink); }
.mainnav a .badge {
  font-size: 11px; font-weight: 700; background: var(--coral); color: #fff;
  border-radius: 999px; padding: 0 6px; min-width: 18px; text-align: center;
}
.top-actions { margin-left: auto; display: flex; align-items: center; gap: 9px; flex-shrink: 0; }
.t-btn {
  width: 40px; height: 40px; border-radius: 50%;
  display: grid; place-items: center; color: var(--ink-2);
  background: var(--glass);
  -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
  border: 1px solid var(--glass-brd); box-shadow: var(--shadow-sm);
  position: relative; transition: transform 0.12s, color 0.16s;
}
.t-btn .ic { width: 18px; height: 18px; }
.t-btn:hover { color: var(--ink); transform: translateY(-1px); }
.t-btn.dot::after {
  content: ""; position: absolute; top: 9px; right: 10px;
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--coral); border: 2px solid var(--card);
}
.t-ava {
  width: 40px; height: 40px; border-radius: 50%;
  background: linear-gradient(135deg, var(--coral), var(--violet));
  color: #fff; display: grid; place-items: center;
  font-weight: 700; font-size: 15px; box-shadow: var(--shadow-sm); cursor: pointer;
}

/* ====================== 본문 레이아웃 ====================== */
.mwork {
  display: grid;
  grid-template-columns: 248px 384px minmax(0, 1fr);
  gap: 16px; align-items: start; padding-top: 12px;
  height: calc(100vh - 96px);
}

/* -------- 사이드바: 계정 + 폴더 + 라벨 -------- */
.subnav {
  height: 100%;
  background: var(--glass);
  -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
  border: 1px solid var(--glass-brd);
  border-radius: var(--radius);
  box-shadow: var(--shadow), var(--glass-hi);
  padding: 14px 12px 12px;
  display: flex; flex-direction: column;
}
.compose-btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; padding: 12px; border-radius: 13px; white-space: nowrap;
  background: var(--fill); color: var(--on-fill);
  font-size: 14px; font-weight: 700; box-shadow: var(--shadow-sm);
  margin-bottom: 6px; transition: filter 0.14s, transform 0.12s;
}
.compose-btn .ic { width: 17px; height: 17px; }
.compose-btn:hover { transform: translateY(-1px); filter: brightness(1.06); }

.sn-scroll { overflow-y: auto; flex: 1; min-height: 0; margin: 0 -4px; padding: 4px; scrollbar-width: thin; }
.sn-scroll::-webkit-scrollbar { width: 6px; }
.sn-scroll::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 99px; }

/* 아리 정리 — 스마트뷰(강조) */
.sn-smart {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left;
  padding: 11px 12px; border-radius: 13px; margin-bottom: 8px; white-space: nowrap;
  background:
    radial-gradient(120% 140% at 0% 0%, color-mix(in oklab, var(--coral) 26%, transparent), transparent 60%),
    var(--glass-2);
  border: 1px solid color-mix(in oklab, var(--coral) 30%, var(--glass-brd));
  color: var(--ink); transition: transform 0.12s, box-shadow 0.14s;
}
.sn-smart:hover { transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.sn-smart.on { box-shadow: var(--shadow-sm), inset 0 0 0 1.5px color-mix(in oklab, var(--coral) 55%, transparent); }
.sn-smart .sp-ico {
  width: 30px; height: 30px; border-radius: 9px; flex-shrink: 0;
  display: grid; place-items: center; color: #fff; background: var(--coral);
  box-shadow: 0 5px 12px -5px var(--coral);
}
.sn-smart .sp-ico .ic { width: 16px; height: 16px; }
.sn-smart .sp-txt { min-width: 0; line-height: 1.25; }
.sn-smart .sp-txt b { display: block; font-size: 13.5px; font-weight: 700; }
.sn-smart .sp-txt span { font-size: 11px; color: var(--ink-2); }
.sn-smart .sp-cnt {
  margin-left: auto; flex-shrink: 0; font-size: 11px; font-weight: 800;
  background: var(--coral); color: #fff; border-radius: 999px;
  padding: 2px 8px; font-variant-numeric: tabular-nums;
}

.sn-label {
  font-size: 10.5px; font-weight: 700; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--faint);
  padding: 14px 10px 7px; display: flex; align-items: center;
}
.sn-label .add {
  margin-left: auto; width: 20px; height: 20px; border-radius: 6px;
  display: grid; place-items: center; color: var(--muted); transition: background 0.13s, color 0.13s;
}
.sn-label .add .ic { width: 13px; height: 13px; }
.sn-label .add:hover { background: var(--glass-2); color: var(--ink); }

/* 폴더 행 */
.fl-row {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left;
  padding: 8px 10px; border-radius: 10px; white-space: nowrap;
  font-size: 13.5px; font-weight: 500; color: var(--ink-2);
  transition: background 0.13s, color 0.13s;
}
.fl-row .ic { width: 16px; height: 16px; color: var(--muted); flex-shrink: 0; }
.fl-row .fl-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.fl-row:hover { background: var(--glass-2); color: var(--ink); }
.fl-row.on { background: var(--fill); color: var(--on-fill); font-weight: 600; }
.fl-row.on .ic { color: var(--on-fill); }
.fl-row .fl-cnt { font-size: 11.5px; font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; }
.fl-row.on .fl-cnt { color: var(--on-fill); opacity: 0.85; }

/* 계정 행 */
.acc-row {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left;
  padding: 8px 10px; border-radius: 10px; white-space: nowrap;
  transition: background 0.13s;
}
.acc-row:hover { background: var(--glass-2); }
.acc-row.on { background: var(--glass-2); box-shadow: inset 0 0 0 1px var(--glass-brd); }
.acc-dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.acc-info { min-width: 0; flex: 1; line-height: 1.2; }
.acc-info b { font-size: 13px; font-weight: 600; color: var(--ink); display: block; }
.acc-info span { font-size: 10.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.acc-row .fl-cnt { font-size: 11px; font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; }
.acc-add {
  display: flex; align-items: center; gap: 9px; width: 100%; white-space: nowrap;
  padding: 9px 10px; margin-top: 2px; border-radius: 10px;
  font-size: 12.5px; font-weight: 500; color: var(--muted);
  border: 1px dashed var(--line-2); transition: background 0.13s, color 0.13s, border-color 0.13s;
}
.acc-add .ic { width: 15px; height: 15px; }
.acc-add:hover { background: var(--glass-2); color: var(--ink); border-color: var(--muted); }

.sn-foot {
  margin-top: 10px; padding-top: 12px; border-top: 1px solid var(--line);
  display: flex; align-items: center; gap: 10px;
}
.sn-foot .av-lg {
  width: 32px; height: 32px; border-radius: 50%;
  background: linear-gradient(135deg, var(--coral), var(--violet));
  color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 13px; flex-shrink: 0;
}
.sn-foot .txt { min-width: 0; flex: 1; }
.sn-foot .txt b { font-size: 13px; font-weight: 600; display: block; }
.sn-foot .txt span { font-size: 11.5px; color: var(--muted); }

/* ====================== 가운데: 메일 목록 ====================== */
.mlist {
  height: 100%;
  background: var(--glass);
  -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
  border: 1px solid var(--glass-brd);
  border-radius: var(--radius);
  box-shadow: var(--shadow), var(--glass-hi);
  display: flex; flex-direction: column; overflow: hidden;
}
.ml-head { padding: 16px 18px 12px; border-bottom: 1px solid var(--line); }
.ml-titlerow { display: flex; align-items: center; gap: 9px; margin-bottom: 12px; }
.ml-title { font-family: var(--font-disp); font-size: 20px; font-weight: 700; letter-spacing: -0.02em; }
.ml-meta { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.ml-sync {
  margin-left: auto; display: inline-flex; align-items: center; gap: 6px; flex-shrink: 0;
  font-size: 11.5px; font-weight: 600; color: var(--muted);
  padding: 6px 11px; border-radius: 999px; background: var(--glass-2); border: 1px solid var(--glass-brd);
  transition: color 0.14s;
}
.ml-sync .ic { width: 13px; height: 13px; }
.ml-sync:hover { color: var(--ink); }
.ml-sync.spin .ic { animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.ml-search {
  display: flex; align-items: center; gap: 9px;
  padding: 9px 14px; border-radius: 999px;
  background: var(--card-2); border: 1px solid var(--line);
  transition: box-shadow 0.16s, border-color 0.16s;
}
.ml-search:focus-within { border-color: color-mix(in oklab, var(--blue) 40%, var(--line)); box-shadow: 0 0 0 4px rgba(79,114,224,0.1); }
.ml-search .ic { width: 15px; height: 15px; color: var(--muted); }
.ml-search input { flex: 1; min-width: 0; border: none; background: none; outline: none; font-size: 13px; color: var(--ink); }
.ml-search input::placeholder { color: var(--faint); }

.ml-scroll { overflow-y: auto; flex: 1; min-height: 0; scrollbar-width: thin; }
.ml-scroll::-webkit-scrollbar { width: 7px; }
.ml-scroll::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 99px; }

.mrow {
  display: flex; gap: 11px; padding: 13px 16px;
  border-bottom: 1px solid var(--line); cursor: pointer;
  position: relative; transition: background 0.12s;
}
.mrow:hover { background: var(--glass-2); }
.mrow.on { background: var(--card); box-shadow: inset 3px 0 0 0 var(--coral); }
.mrow.unread::before {
  content: ""; position: absolute; left: 6px; top: 20px;
  width: 7px; height: 7px; border-radius: 50%; background: var(--blue);
}
.mrow.unread .mr-from b { font-weight: 800; }
.mrow.unread .mr-subj { color: var(--ink); font-weight: 600; }
.mr-ava {
  width: 38px; height: 38px; border-radius: 11px; flex-shrink: 0;
  display: grid; place-items: center; color: #fff; font-size: 14px; font-weight: 700;
  position: relative;
}
.mr-ava .acc-pip {
  position: absolute; bottom: -2px; right: -2px;
  width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--card);
}
.mr-body { flex: 1; min-width: 0; }
.mr-top { display: flex; align-items: baseline; gap: 8px; }
.mr-from { font-size: 13.5px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1; min-width: 0; }
.mr-from b { font-weight: 600; color: var(--ink); }
.mr-time { font-size: 11px; color: var(--faint); white-space: nowrap; flex-shrink: 0; font-variant-numeric: tabular-nums; }
.mr-subj { font-size: 13px; color: var(--ink-2); margin-top: 3px; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mr-prev { font-size: 12px; color: var(--muted); margin-top: 2px; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.mr-tags { display: flex; align-items: center; gap: 5px; margin-top: 8px; flex-wrap: wrap; }
.ai-pill {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 10.5px; font-weight: 700; white-space: nowrap;
  padding: 2px 8px 2px 6px; border-radius: 999px;
}
.ai-pill .ic { width: 11px; height: 11px; }
.ai-pill.task { color: var(--blue); background: color-mix(in oklab, var(--blue) 12%, transparent); }
.ai-pill.event { color: var(--coral); background: color-mix(in oklab, var(--coral) 13%, transparent); }
.ai-pill.reply { color: var(--green); background: color-mix(in oklab, var(--green) 13%, transparent); }
.ai-pill.prio { color: var(--coral); background: color-mix(in oklab, var(--coral) 13%, transparent); }
.mr-flags { display: flex; flex-direction: column; align-items: center; gap: 7px; flex-shrink: 0; padding-top: 2px; }
.mr-star { color: var(--faint); transition: color 0.13s, transform 0.12s; }
.mr-star .ic { width: 15px; height: 15px; }
.mr-star.on { color: var(--amber); }
.mr-star:hover { color: var(--amber); transform: scale(1.12); }
.mr-attach { color: var(--muted); }
.mr-attach .ic { width: 14px; height: 14px; }

/* ====================== 우측: 리딩 + 아리 분석 ====================== */
.reader {
  height: 100%;
  background: var(--glass);
  -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
  border: 1px solid var(--glass-brd);
  border-radius: var(--radius);
  box-shadow: var(--shadow), var(--glass-hi);
  display: flex; flex-direction: column; overflow: hidden;
}
.rd-toolbar {
  display: flex; align-items: center; gap: 6px;
  padding: 12px 16px; border-bottom: 1px solid var(--line); flex-shrink: 0;
}
.rd-tool {
  display: inline-flex; align-items: center; gap: 7px; white-space: nowrap;
  padding: 8px 13px; border-radius: 10px; font-size: 12.5px; font-weight: 600;
  color: var(--ink-2); transition: background 0.13s, color 0.13s;
}
.rd-tool .ic { width: 15px; height: 15px; }
.rd-tool:hover { background: var(--glass-2); color: var(--ink); }
.rd-tool.icon-only { padding: 8px; }
.rd-tool.danger:hover { color: var(--coral); }
.rd-spacer { flex: 1; }

.rd-scroll { overflow-y: auto; flex: 1; min-height: 0; scrollbar-width: thin; }
.rd-scroll::-webkit-scrollbar { width: 8px; }
.rd-scroll::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 99px; }
.rd-inner { padding: 24px 30px 36px; }

.rd-subject { font-family: var(--font-disp); font-size: 24px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.25; margin: 0 0 16px; }
.rd-sender { display: flex; align-items: center; gap: 12px; margin-bottom: 6px; }
.rd-sender .av-lg {
  width: 44px; height: 44px; border-radius: 13px; flex-shrink: 0;
  display: grid; place-items: center; color: #fff; font-size: 16px; font-weight: 700;
}
.rd-sender .who { min-width: 0; flex: 1; }
.rd-sender .who b { font-size: 14.5px; font-weight: 700; }
.rd-sender .who .em { font-size: 12px; color: var(--muted); }
.rd-sender .when { font-size: 12px; color: var(--muted); flex-shrink: 0; text-align: right; font-variant-numeric: tabular-nums; }
.rd-to { font-size: 12px; color: var(--muted); margin: 4px 0 0 56px; }
.rd-acctag {
  display: inline-flex; align-items: center; gap: 6px; margin: 14px 0 0;
  font-size: 11px; font-weight: 600; color: var(--ink-2);
  padding: 4px 10px; border-radius: 999px; background: var(--glass-2); border: 1px solid var(--glass-brd);
}
.rd-acctag .acc-dot { width: 7px; height: 7px; }

.rd-divider { height: 1px; background: var(--line); margin: 20px 0; }
.rd-body p { font-size: 14.5px; line-height: 1.72; color: var(--ink-2); margin: 0 0 14px; }
.rd-attachments { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 20px; }
.att-chip {
  display: inline-flex; align-items: center; gap: 9px;
  padding: 9px 13px; border-radius: 12px; background: var(--card-2); border: 1px solid var(--line);
  transition: background 0.13s, transform 0.12s; cursor: pointer;
}
.att-chip:hover { background: var(--card-3); transform: translateY(-1px); }
.att-chip .ic { width: 17px; height: 17px; color: var(--coral); }
.att-chip .at-meta { line-height: 1.3; min-width: 0; }
.att-chip .at-meta b { font-size: 12.5px; font-weight: 600; display: block; white-space: nowrap; max-width: 180px; overflow: hidden; text-overflow: ellipsis; }
.att-chip .at-meta span { font-size: 10.5px; color: var(--muted); }

/* ---------- 아리 분석 패널 (핵심) ---------- */
.ari-panel {
  margin-top: 26px; border-radius: 18px; overflow: hidden;
  background:
    radial-gradient(120% 90% at 0% 0%, color-mix(in oklab, var(--coral) 14%, transparent), transparent 55%),
    var(--card);
  border: 1px solid color-mix(in oklab, var(--coral) 24%, var(--line-2));
  box-shadow: var(--shadow-sm);
}
.ap-head {
  display: flex; align-items: center; gap: 11px;
  padding: 15px 18px; border-bottom: 1px solid var(--line);
}
.ap-avatar {
  width: 32px; height: 32px; border-radius: 10px; flex-shrink: 0;
  display: grid; place-items: center; color: #fff; background: var(--coral);
  box-shadow: 0 5px 14px -5px var(--coral);
}
.ap-avatar .ic { width: 17px; height: 17px; }
.ap-head .ap-h { min-width: 0; flex: 1; line-height: 1.25; }
.ap-head .ap-h b { font-size: 14px; font-weight: 700; display: block; }
.ap-head .ap-h span { font-size: 11.5px; color: var(--muted); }
.ap-prio {
  flex-shrink: 0; font-size: 10.5px; font-weight: 700; white-space: nowrap;
  padding: 3px 9px; border-radius: 999px;
}
.ap-prio.높음 { color: #fff; background: var(--coral); }
.ap-prio.보통 { color: var(--amber); background: color-mix(in oklab, var(--amber) 16%, transparent); }
.ap-prio.낮음 { color: var(--muted); background: var(--card-2); }

.ap-summary { padding: 15px 18px; font-size: 13.5px; line-height: 1.6; color: var(--ink); }
.ap-summary b { font-weight: 700; }

.ap-section { padding: 4px 18px 16px; }
.ap-sec-title {
  display: flex; align-items: center; gap: 7px;
  font-size: 11.5px; font-weight: 700; color: var(--ink-2);
  margin-bottom: 9px;
}
.ap-sec-title .ic { width: 14px; height: 14px; color: var(--muted); }
.ap-sec-title .n { margin-left: auto; font-size: 11px; color: var(--muted); font-weight: 600; }

/* 제안 항목 카드 (할 일 / 일정) */
.sug {
  display: flex; align-items: flex-start; gap: 11px;
  padding: 11px 13px; border-radius: 12px; margin-bottom: 8px;
  background: var(--card-2); border: 1px solid var(--line);
  transition: border-color 0.14s, background 0.14s;
}
.sug:last-child { margin-bottom: 0; }
.sug.added { background: color-mix(in oklab, var(--green) 9%, var(--card-2)); border-color: color-mix(in oklab, var(--green) 30%, var(--line)); }
.sug-ico {
  width: 30px; height: 30px; border-radius: 9px; flex-shrink: 0;
  display: grid; place-items: center; margin-top: 1px;
}
.sug-ico .ic { width: 15px; height: 15px; }
.sug.task .sug-ico { background: color-mix(in oklab, var(--blue) 14%, transparent); color: var(--blue); }
.sug.event .sug-ico { background: color-mix(in oklab, var(--coral) 14%, transparent); color: var(--coral); }
.sug-main { flex: 1; min-width: 0; }
.sug-text { font-size: 13px; font-weight: 600; color: var(--ink); line-height: 1.35; }
.sug-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 5px; font-size: 11px; color: var(--muted); }
.sug-meta .chip2 { display: inline-flex; align-items: center; gap: 4px; }
.sug-meta .chip2 .ic { width: 11px; height: 11px; }
.sug-meta .dotsep { width: 3px; height: 3px; border-radius: 50%; background: var(--faint); }
.sug-add {
  flex-shrink: 0; align-self: center;
  display: inline-flex; align-items: center; gap: 5px; white-space: nowrap;
  padding: 7px 12px; border-radius: 9px; font-size: 12px; font-weight: 700;
  background: var(--fill); color: var(--on-fill); transition: filter 0.13s, transform 0.12s;
}
.sug-add .ic { width: 13px; height: 13px; }
.sug-add:hover { transform: translateY(-1px); filter: brightness(1.08); }
.sug-add.done { background: color-mix(in oklab, var(--green) 16%, transparent); color: var(--green); pointer-events: none; }

/* 답장 추천 */
.replies { display: flex; flex-direction: column; gap: 8px; }
.rep {
  text-align: left; width: 100%;
  padding: 12px 14px; border-radius: 12px;
  background: var(--card-2); border: 1px solid var(--line);
  transition: border-color 0.14s, background 0.14s, transform 0.12s;
}
.rep:hover { border-color: color-mix(in oklab, var(--green) 40%, var(--line)); background: var(--card); transform: translateY(-1px); }
.rep-top { display: flex; align-items: center; gap: 7px; margin-bottom: 5px; }
.rep-tone { font-size: 11.5px; font-weight: 700; color: var(--green); }
.rep-go { margin-left: auto; color: var(--muted); }
.rep-go .ic { width: 14px; height: 14px; }
.rep-prev { font-size: 12.5px; color: var(--ink-2); line-height: 1.45; }
.rep-prev::before { content: "“"; color: var(--faint); }
.rep-prev::after { content: "”"; color: var(--faint); }

/* 프로젝트 정리 제안 */
.ap-file {
  margin: 0 18px 16px; padding: 12px 14px; border-radius: 12px;
  display: flex; align-items: center; gap: 11px;
  background: var(--card-2); border: 1px dashed var(--line-2);
}
.ap-file.added { border-style: solid; background: color-mix(in oklab, var(--violet) 9%, var(--card-2)); border-color: color-mix(in oklab, var(--violet) 32%, var(--line)); }
.ap-file .fi-ico { width: 30px; height: 30px; border-radius: 9px; flex-shrink: 0; display: grid; place-items: center; background: color-mix(in oklab, var(--violet) 14%, transparent); color: var(--violet); }
.ap-file .fi-ico .ic { width: 15px; height: 15px; }
.ap-file .fi-main { flex: 1; min-width: 0; line-height: 1.3; }
.ap-file .fi-main b { font-size: 12.5px; font-weight: 700; }
.ap-file .fi-main span { font-size: 11px; color: var(--muted); display: block; }
.ap-file .sug-add { background: var(--violet); }
.ap-file .sug-add.done { background: color-mix(in oklab, var(--violet) 16%, transparent); color: var(--violet); }

/* 전체 적용 바 */
.ap-allbar {
  display: flex; align-items: center; gap: 10px;
  padding: 13px 18px; border-top: 1px solid var(--line);
  background: var(--card-2);
}
.ap-allbar .txt { font-size: 12px; color: var(--muted); flex: 1; min-width: 0; }
.ap-all-btn {
  display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; flex-shrink: 0;
  padding: 9px 15px; border-radius: 10px; font-size: 12.5px; font-weight: 700;
  background: var(--fill); color: var(--on-fill); transition: filter 0.13s, transform 0.12s;
}
.ap-all-btn .ic { width: 14px; height: 14px; }
.ap-all-btn:hover { transform: translateY(-1px); filter: brightness(1.08); }
.ap-all-btn.done { background: color-mix(in oklab, var(--green) 16%, transparent); color: var(--green); pointer-events: none; }

/* 빈 상태 */
.rd-empty { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 40px; }
.rd-empty .e-ico { width: 64px; height: 64px; border-radius: 18px; display: grid; place-items: center; background: var(--glass-2); border: 1px solid var(--glass-brd); color: var(--muted); margin-bottom: 18px; }
.rd-empty .e-ico .ic { width: 28px; height: 28px; }
.rd-empty h3 { font-family: var(--font-disp); font-size: 18px; font-weight: 700; margin: 0 0 6px; }
.rd-empty p { font-size: 13px; color: var(--muted); max-width: 30ch; line-height: 1.5; margin: 0; }

/* ====================== 아리 정리 (트리아지 뷰) ====================== */
.triage { padding: 22px 26px 30px; }
.tr-hero {
  display: flex; align-items: flex-start; gap: 16px;
  padding: 20px 22px; border-radius: 18px; margin-bottom: 18px;
  background:
    radial-gradient(90% 120% at 0% 0%, color-mix(in oklab, var(--coral) 18%, transparent), transparent 55%),
    var(--card);
  border: 1px solid color-mix(in oklab, var(--coral) 22%, var(--line-2));
  box-shadow: var(--shadow-sm);
}
.tr-hero .ap-avatar { width: 40px; height: 40px; border-radius: 12px; }
.tr-hero .ap-avatar .ic { width: 21px; height: 21px; }
.tr-hero .th-main { flex: 1; min-width: 0; }
.tr-hero .th-eyebrow { font-size: 12px; font-weight: 700; color: var(--coral); letter-spacing: 0.02em; }
.tr-hero h2 { font-family: var(--font-disp); font-size: 22px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.3; margin: 5px 0 0; }
.tr-hero p { font-size: 13.5px; color: var(--ink-2); line-height: 1.55; margin: 9px 0 0; max-width: 60ch; }
.tr-stats { display: flex; gap: 9px; flex-wrap: wrap; margin-top: 14px; }
.tr-stat {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 13px; border-radius: 12px; background: var(--card-2); border: 1px solid var(--line);
}
.tr-stat .ic { width: 15px; height: 15px; }
.tr-stat b { font-size: 16px; font-weight: 800; font-family: var(--font-disp); font-variant-numeric: tabular-nums; }
.tr-stat span { font-size: 12px; color: var(--muted); }
.tr-stat.task .ic { color: var(--blue); }
.tr-stat.event .ic { color: var(--coral); }
.tr-stat.reply .ic { color: var(--green); }

.tr-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; }
.tr-card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: 18px; box-shadow: var(--shadow-sm); padding: 16px 17px;
}
.tr-card-head { display: flex; align-items: center; gap: 9px; margin-bottom: 13px; }
.tr-card-head .h-ico { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; flex-shrink: 0; }
.tr-card-head .h-ico .ic { width: 16px; height: 16px; }
.tr-card.task .h-ico { background: color-mix(in oklab, var(--blue) 13%, transparent); color: var(--blue); }
.tr-card.event .h-ico { background: color-mix(in oklab, var(--coral) 13%, transparent); color: var(--coral); }
.tr-card.reply .h-ico { background: color-mix(in oklab, var(--green) 13%, transparent); color: var(--green); }
.tr-card-head b { font-size: 14px; font-weight: 700; flex: 1; }
.tr-card-head .n { font-size: 11.5px; font-weight: 700; color: var(--muted); background: var(--card-2); border-radius: 999px; padding: 2px 9px; }
.tr-item { padding: 10px 0; border-top: 1px solid var(--line); }
.tr-item:first-of-type { border-top: none; padding-top: 0; }
.tr-item .ti-src { font-size: 10.5px; font-weight: 600; color: var(--muted); margin-bottom: 3px; }
.tr-item .ti-text { font-size: 13px; font-weight: 600; color: var(--ink); line-height: 1.35; }
.tr-item .ti-meta { display: flex; align-items: center; gap: 7px; margin-top: 6px; flex-wrap: wrap; }
.tr-item .ti-meta .chip2 { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; color: var(--muted); }
.tr-item .ti-meta .chip2 .ic { width: 11px; height: 11px; }
.tr-empty { font-size: 12.5px; color: var(--faint); padding: 8px 0; }

.entered .mwork > * { animation: rise 0.42s cubic-bezier(0.2,0.7,0.2,1) both; }
.entered .mlist { animation-delay: 0.05s; }
.entered .reader { animation-delay: 0.1s; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* ====================== 작성 (Compose) 슬라이드오버 ====================== */
.cp-backdrop {
  position: fixed; inset: 0; z-index: 60;
  background: rgba(26, 22, 18, 0.34);
  -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px);
  animation: fade 0.18s ease;
}
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.compose {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 61;
  width: 620px; max-width: 100vw;
  background: var(--card); border-left: 1px solid var(--line);
  box-shadow: -20px 0 60px -20px rgba(26,22,18,0.4);
  display: flex; flex-direction: column;
  animation: slidein 0.24s cubic-bezier(0.2, 0.7, 0.2, 1);
}
@keyframes slidein { from { transform: translateX(40px); opacity: 0; } to { transform: none; opacity: 1; } }
.cp-head { display: flex; align-items: center; gap: 10px; padding: 16px 22px; border-bottom: 1px solid var(--line); }
.cp-head .h-ic { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: var(--fill); color: var(--on-fill); }
.cp-head .h-ic .ic { width: 16px; height: 16px; }
.cp-head b { font-family: var(--font-disp); font-size: 16px; font-weight: 700; }
.cp-close { margin-left: auto; width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; color: var(--muted); transition: background 0.13s, color 0.13s; }
.cp-close .ic { width: 17px; height: 17px; }
.cp-close:hover { background: var(--card-2); color: var(--ink); }

.cp-body { flex: 1; min-height: 0; overflow-y: auto; padding: 6px 22px 22px; display: flex; flex-direction: column; }
.cp-field { display: flex; align-items: center; gap: 10px; padding: 13px 2px; border-bottom: 1px solid var(--line); }
.cp-field label { font-size: 12px; font-weight: 600; color: var(--muted); width: 48px; flex-shrink: 0; }
.cp-field input { flex: 1; min-width: 0; border: none; background: none; outline: none; font-size: 14px; color: var(--ink); }
.cp-field input::placeholder { color: var(--faint); }
.cp-field .from-pick { display: inline-flex; align-items: center; gap: 7px; font-size: 13.5px; font-weight: 600; color: var(--ink); }
.cp-field .from-pick .acc-dot { width: 8px; height: 8px; }
.cp-text {
  flex: 1; min-height: 220px; resize: none; border: none; background: none; outline: none;
  font-size: 14.5px; line-height: 1.7; color: var(--ink-2); padding: 16px 2px; width: 100%;
}
.cp-text::placeholder { color: var(--faint); }

/* AI 작성 도우미 바 */
.cp-ai {
  margin: 4px 0 0; padding: 12px 14px; border-radius: 14px;
  background:
    radial-gradient(120% 120% at 0% 0%, color-mix(in oklab, var(--coral) 13%, transparent), transparent 60%),
    var(--card-2);
  border: 1px solid color-mix(in oklab, var(--coral) 22%, var(--line));
}
.cp-ai-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.cp-ai-head .a-ic { width: 24px; height: 24px; border-radius: 7px; display: grid; place-items: center; background: var(--coral); color: #fff; }
.cp-ai-head .a-ic .ic { width: 13px; height: 13px; }
.cp-ai-head b { font-size: 12.5px; font-weight: 700; }
.cp-ai-actions { display: flex; flex-wrap: wrap; gap: 7px; }
.cp-ai-btn {
  display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
  font-size: 12px; font-weight: 600; color: var(--ink-2);
  padding: 7px 12px; border-radius: 999px; background: var(--card); border: 1px solid var(--line);
  transition: background 0.13s, color 0.13s, transform 0.12s;
}
.cp-ai-btn .ic { width: 13px; height: 13px; color: var(--coral); }
.cp-ai-btn:hover { color: var(--ink); transform: translateY(-1px); }
.cp-ai-btn:disabled { opacity: 0.55; cursor: default; transform: none; }

.cp-foot { display: flex; align-items: center; gap: 10px; padding: 14px 22px; border-top: 1px solid var(--line); }
.cp-send {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 20px; border-radius: 12px; font-size: 14px; font-weight: 700;
  background: var(--fill); color: var(--on-fill); box-shadow: var(--shadow-sm);
  transition: filter 0.13s, transform 0.12s;
}
.cp-send .ic { width: 16px; height: 16px; }
.cp-send:hover { transform: translateY(-1px); filter: brightness(1.06); }
.cp-foot .cp-tool { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; color: var(--muted); transition: background 0.13s, color 0.13s; }
.cp-foot .cp-tool .ic { width: 17px; height: 17px; }
.cp-foot .cp-tool:hover { background: var(--card-2); color: var(--ink); }
.cp-foot .cp-spacer { flex: 1; }
.cp-foot .cp-discard { font-size: 13px; color: var(--muted); padding: 8px 12px; border-radius: 9px; }
.cp-foot .cp-discard:hover { color: var(--coral); }

/* 토스트 */
.toast-wrap { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); z-index: 80; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 18px; border-radius: 13px;
  background: var(--fill); color: var(--on-fill);
  font-size: 13px; font-weight: 600; box-shadow: var(--shadow);
  animation: toastin 0.3s cubic-bezier(0.2,0.7,0.2,1);
}
.toast .ic { width: 16px; height: 16px; }
.toast .t-dot { width: 8px; height: 8px; border-radius: 50%; }
@keyframes toastin { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

/* ====================== 반응형 ====================== */
@media (max-width: 1320px) {
  .mwork { grid-template-columns: 224px 340px minmax(0, 1fr); }
}
@media (max-width: 1080px) {
  .mwork { grid-template-columns: 320px minmax(0, 1fr); height: auto; }
  .subnav { display: none; }
}
@media (max-width: 760px) {
  .mpage { padding: 0 12px 20px; }
  .topbar { margin: 0 -12px; padding: 0 14px; gap: 14px; }
  .mainnav { display: none; }
  .mwork { grid-template-columns: 1fr; }
  .mlist.has-sel { display: none; }
  .compose { width: 100vw; }
}
