/* ===========================================================
   아리 — 메일(Mail) · phase-9 이식 (design-reference/assets/mail.css)
   토큰은 tokens.css 단일 출처(:root/[data-theme] 제거). 상단바는 layout 의 Topbar.
   풀커스텀 3-pane 레이아웃 — 모든 규칙을 .mailpage 로 스코프(공유 클래스 충돌 방지).
   키프레임은 mail-* 로 페이지 고유 명명.
   =========================================================== */

.mailpage .ic {
  width: 1em;
  height: 1em;
  flex-shrink: 0;
  display: block;
}

/* ====================== 본문 레이아웃 ====================== */
.mailpage .mwork {
  display: grid;
  grid-template-columns: 248px 384px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
  padding-top: 12px;
  height: calc(100vh - 96px);
}
/* 아리 비서 보기: 메일 리스트 없이 사이드바 + 비서 다이제스트(읽기 중엔 + 리더). */
.mailpage .mwork.digest {
  grid-template-columns: 248px minmax(0, 1fr);
}
.mailpage .mwork.digest.reading {
  grid-template-columns: 248px minmax(380px, 0.95fr) minmax(0, 1.15fr);
}

/* -------- 사이드바: 계정 + 폴더 + 라벨 -------- */
.mailpage .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;
}
.mailpage .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;
}
.mailpage .compose-btn .ic {
  width: 17px;
  height: 17px;
}
.mailpage .compose-btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.06);
}

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

/* 아리 정리 — 스마트뷰(강조) */
.mailpage .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;
}
.mailpage .sn-smart:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}
.mailpage .sn-smart.on {
  box-shadow:
    var(--shadow-sm),
    inset 0 0 0 1.5px color-mix(in oklab, var(--coral) 55%, transparent);
}
.mailpage .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);
}
.mailpage .sn-smart .sp-ico .ic {
  width: 16px;
  height: 16px;
}
.mailpage .sn-smart .sp-txt {
  min-width: 0;
  line-height: 1.25;
}
.mailpage .sn-smart .sp-txt b {
  display: block;
  font-size: 13.5px;
  font-weight: 700;
}
.mailpage .sn-smart .sp-txt span {
  font-size: 11px;
  color: var(--ink-2);
}
.mailpage .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;
}

/* 전체 받은편지함 — 공통 시스템 폴더 플랫 목록(트리 아님). */
.mailpage .sn-unified-folders {
  display: flex;
  flex-direction: column;
  gap: 1px;
  margin-bottom: 4px;
}

.mailpage .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;
}
.mailpage .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;
}
.mailpage .sn-label .add .ic {
  width: 13px;
  height: 13px;
}
.mailpage .sn-label .add:hover {
  background: var(--glass-2);
  color: var(--ink);
}

/* 폴더 행 */
.mailpage .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;
}
.mailpage .fl-row .ic {
  width: 16px;
  height: 16px;
  color: var(--muted);
  flex-shrink: 0;
}
.mailpage .fl-row .fl-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mailpage .fl-row:hover {
  background: var(--glass-2);
  color: var(--ink);
}
.mailpage .fl-row.on {
  background: var(--fill);
  color: var(--on-fill);
  font-weight: 600;
}
.mailpage .fl-row.on .ic {
  color: var(--on-fill);
}
.mailpage .fl-row .fl-cnt {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.mailpage .fl-row.on .fl-cnt {
  color: var(--on-fill);
  opacity: 0.85;
}

/* 계정 행 */
.mailpage .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;
}
.mailpage .acc-row:hover {
  background: var(--glass-2);
}
.mailpage .acc-row.on {
  background: var(--glass-2);
  box-shadow: inset 0 0 0 1px var(--glass-brd);
}
.mailpage .acc-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex-shrink: 0;
}
.mailpage .acc-info {
  min-width: 0;
  flex: 1;
  line-height: 1.2;
}
.mailpage .acc-info b {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  display: block;
}
.mailpage .acc-info span {
  font-size: 10.5px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
}
.mailpage .acc-row .fl-cnt {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

/* 계정 루트 트리 — 부모(통합/계정) + 폴더 서브트리 */
.mailpage .mt-branch {
  margin-top: 1px;
}
.mailpage .mt-parent {
  display: flex;
  align-items: center;
  gap: 1px;
  border-radius: 10px;
}
.mailpage .mt-parent.scope {
  background: var(--glass-2);
}
.mailpage .mt-twist {
  flex-shrink: 0;
  width: 20px;
  height: 30px;
  display: grid;
  place-items: center;
  color: var(--faint);
  border-radius: 8px;
  transition: color 0.13s;
}
.mailpage .mt-twist .ic {
  width: 12px;
  height: 12px;
  transition: transform 0.16s ease;
}
.mailpage .mt-twist.open .ic {
  transform: rotate(90deg);
}
.mailpage .mt-twist:hover {
  color: var(--ink);
}
.mailpage .mt-parent-main {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 9px;
  text-align: left;
  padding: 7px 8px;
  border-radius: 9px;
  transition: background 0.13s;
}
.mailpage .mt-parent-main:hover {
  background: var(--glass-2);
}
.mailpage .mt-parent-main > .ic {
  width: 16px;
  height: 16px;
  color: var(--muted);
  flex-shrink: 0;
}
.mailpage .mt-parent-txt {
  min-width: 0;
  flex: 1;
  line-height: 1.2;
}
.mailpage .mt-parent-txt b {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mailpage .mt-parent-txt span {
  font-size: 10.5px;
  color: var(--muted);
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mailpage .mt-parent-main .fl-cnt {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
/* 폴더 자식: 들여쓰기 + 연결선 */
.mailpage .mt-kids {
  margin: 1px 0 4px 20px;
  padding-left: 8px;
  border-left: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.mailpage .mt-child {
  padding: 6px 9px;
  font-size: 12.5px;
}

.mailpage .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;
}
.mailpage .acc-add .ic {
  width: 15px;
  height: 15px;
}
.mailpage .acc-add:hover {
  background: var(--glass-2);
  color: var(--ink);
  border-color: var(--muted);
}

.mailpage .sn-foot {
  margin-top: 10px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 10px;
}
.mailpage .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;
}
.mailpage .sn-foot .txt {
  min-width: 0;
  flex: 1;
}
.mailpage .sn-foot .txt b {
  font-size: 13px;
  font-weight: 600;
  display: block;
}
.mailpage .sn-foot .txt span {
  font-size: 11.5px;
  color: var(--muted);
}

/* ====================== 가운데: 메일 목록 ====================== */
.mailpage .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;
}
.mailpage .ml-head {
  padding: 16px 18px 12px;
  border-bottom: 1px solid var(--line);
}
.mailpage .ml-titlerow {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 12px;
}
.mailpage .ml-title {
  font-family: var(--font-disp);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.mailpage .ml-meta {
  font-size: 12px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.mailpage .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;
}
.mailpage .ml-sync .ic {
  width: 13px;
  height: 13px;
}
.mailpage .ml-sync:hover {
  color: var(--ink);
}
.mailpage .ml-sync.spin .ic {
  animation: mail-spin 0.8s linear infinite;
}
@keyframes mail-spin {
  to {
    transform: rotate(360deg);
  }
}
.mailpage .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;
}
.mailpage .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);
}
.mailpage .ml-search .ic {
  width: 15px;
  height: 15px;
  color: var(--muted);
}
.mailpage .ml-search input {
  flex: 1;
  min-width: 0;
  border: none;
  background: none;
  outline: none;
  font-size: 13px;
  color: var(--ink);
}
.mailpage .ml-search input::placeholder {
  color: var(--faint);
}

/* 카테고리 탭(Outlook/Gmail 식 피벗) — 받은편지함 상단 */
.mailpage .ml-cats {
  display: flex;
  gap: 6px;
  margin-top: 12px;
  overflow-x: auto;
  scrollbar-width: none;
}
.mailpage .ml-cats::-webkit-scrollbar {
  display: none;
}
.mailpage .ml-cat {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--muted);
  background: var(--card-2);
  border: 1px solid var(--line);
  transition:
    color 0.14s,
    background 0.14s,
    border-color 0.14s;
}
.mailpage .ml-cat:hover {
  color: var(--ink);
}
.mailpage .ml-cat.on {
  color: #fff;
  background: var(--blue);
  border-color: var(--blue);
}
.mailpage .ml-cat-cnt {
  font-size: 10.5px;
  font-weight: 700;
  line-height: 1;
  padding: 2px 5px;
  border-radius: 999px;
  background: color-mix(in oklab, var(--blue) 16%, transparent);
  color: var(--blue);
  font-variant-numeric: tabular-nums;
}
.mailpage .ml-cat.on .ml-cat-cnt {
  background: rgba(255, 255, 255, 0.24);
  color: #fff;
}

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

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

/* ====================== 우측: 리딩 + 아리 분석 ====================== */
.mailpage .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;
}
.mailpage .rd-toolbar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}
.mailpage .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;
}
.mailpage .rd-tool .ic {
  width: 15px;
  height: 15px;
}
.mailpage .rd-tool:hover {
  background: var(--glass-2);
  color: var(--ink);
}
.mailpage .rd-tool.icon-only {
  padding: 8px;
}
.mailpage .rd-tool.danger:hover {
  color: var(--coral);
}
.mailpage .rd-spacer {
  flex: 1;
}

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

.mailpage .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;
}
.mailpage .rd-sender {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 6px;
}
.mailpage .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;
}
.mailpage .rd-sender .who {
  min-width: 0;
  flex: 1;
}
.mailpage .rd-sender .who b {
  font-size: 14.5px;
  font-weight: 700;
}
.mailpage .rd-sender .who .em {
  font-size: 12px;
  color: var(--muted);
}
.mailpage .rd-sender .when {
  font-size: 12px;
  color: var(--muted);
  flex-shrink: 0;
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.mailpage .rd-to {
  font-size: 12px;
  color: var(--muted);
  margin: 4px 0 0 56px;
}
.mailpage .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);
}
.mailpage .rd-acctag .acc-dot {
  width: 7px;
  height: 7px;
}

.mailpage .rd-divider {
  height: 1px;
  background: var(--line);
  margin: 20px 0;
}
.mailpage .rd-body p {
  font-size: 14.5px;
  line-height: 1.72;
  color: var(--ink-2);
  margin: 0 0 14px;
}
/* 원본 HTML 메일 본문(샌드박스 iframe) — 흰 배경 카드로 분리해 가독성 확보 */
.mailpage .rd-html {
  width: 100%;
  border: 0;
  display: block;
  background: #fff;
  border-radius: 10px;
  margin: 2px 0 4px;
}
.mailpage .rd-attachments {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 20px;
}
.mailpage .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;
}
.mailpage .att-chip:hover {
  background: var(--card-3);
  transform: translateY(-1px);
}
.mailpage .att-chip .ic {
  width: 17px;
  height: 17px;
  color: var(--coral);
}
.mailpage .att-chip .at-meta {
  line-height: 1.3;
  min-width: 0;
}
.mailpage .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;
}
.mailpage .att-chip .at-meta span {
  font-size: 10.5px;
  color: var(--muted);
}

/* ---------- 아리 분석 패널 (핵심) ---------- */
.mailpage .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);
}
.mailpage .ap-head {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 15px 18px;
  border-bottom: 1px solid var(--line);
}
.mailpage .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);
}
.mailpage .ap-avatar .ic {
  width: 17px;
  height: 17px;
}
.mailpage .ap-head .ap-h {
  min-width: 0;
  flex: 1;
  line-height: 1.25;
}
.mailpage .ap-head .ap-h b {
  font-size: 14px;
  font-weight: 700;
  display: block;
}
.mailpage .ap-head .ap-h span {
  font-size: 11.5px;
  color: var(--muted);
}
.mailpage .ap-prio {
  flex-shrink: 0;
  font-size: 10.5px;
  font-weight: 700;
  white-space: nowrap;
  padding: 3px 9px;
  border-radius: 999px;
}
.mailpage .ap-prio.높음 {
  color: #fff;
  background: var(--coral);
}
.mailpage .ap-prio.보통 {
  color: var(--amber);
  background: color-mix(in oklab, var(--amber) 16%, transparent);
}
.mailpage .ap-prio.낮음 {
  color: var(--muted);
  background: var(--card-2);
}

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

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

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

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

/* 프로젝트 정리 제안 */
.mailpage .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);
}
.mailpage .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));
}
.mailpage .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);
}
.mailpage .ap-file .fi-ico .ic {
  width: 15px;
  height: 15px;
}
.mailpage .ap-file .fi-main {
  flex: 1;
  min-width: 0;
  line-height: 1.3;
}
.mailpage .ap-file .fi-main b {
  font-size: 12.5px;
  font-weight: 700;
}
.mailpage .ap-file .fi-main span {
  font-size: 11px;
  color: var(--muted);
  display: block;
}
.mailpage .ap-file .sug-add {
  background: var(--violet);
}
.mailpage .ap-file .sug-add.done {
  background: color-mix(in oklab, var(--violet) 16%, transparent);
  color: var(--violet);
}

/* 전체 적용 바 */
.mailpage .ap-allbar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px 18px;
  border-top: 1px solid var(--line);
  background: var(--card-2);
}
.mailpage .ap-allbar .txt {
  font-size: 12px;
  color: var(--muted);
  flex: 1;
  min-width: 0;
}
.mailpage .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;
}
.mailpage .ap-all-btn .ic {
  width: 14px;
  height: 14px;
}
.mailpage .ap-all-btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.08);
}
.mailpage .ap-all-btn.done {
  background: color-mix(in oklab, var(--green) 16%, transparent);
  color: var(--green);
  pointer-events: none;
}

/* 빈 상태 */
.mailpage .rd-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 40px;
}
.mailpage .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;
}
.mailpage .rd-empty .e-ico .ic {
  width: 28px;
  height: 28px;
}
.mailpage .rd-empty h3 {
  font-family: var(--font-disp);
  font-size: 18px;
  font-weight: 700;
  margin: 0 0 6px;
}
.mailpage .rd-empty p {
  font-size: 13px;
  color: var(--muted);
  max-width: 30ch;
  line-height: 1.5;
  margin: 0;
}

/* ====================== 아리 정리 (트리아지 뷰) ====================== */
.mailpage .triage {
  padding: 22px 26px 30px;
}
.mailpage .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);
}
.mailpage .tr-hero .ap-avatar {
  width: 40px;
  height: 40px;
  border-radius: 12px;
}
.mailpage .tr-hero .ap-avatar .ic {
  width: 21px;
  height: 21px;
}
.mailpage .tr-hero .th-main {
  flex: 1;
  min-width: 0;
}
.mailpage .tr-hero .th-eyebrow {
  font-size: 12px;
  font-weight: 700;
  color: var(--coral);
  letter-spacing: 0.02em;
}
.mailpage .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;
}
.mailpage .tr-hero p {
  font-size: 13.5px;
  color: var(--ink-2);
  line-height: 1.55;
  margin: 9px 0 0;
  max-width: 60ch;
}
.mailpage .tr-stats {
  display: flex;
  gap: 9px;
  flex-wrap: wrap;
  margin-top: 14px;
}
.mailpage .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);
}
.mailpage .tr-stat .ic {
  width: 15px;
  height: 15px;
}
.mailpage .tr-stat b {
  font-size: 16px;
  font-weight: 800;
  font-family: var(--font-disp);
  font-variant-numeric: tabular-nums;
}
.mailpage .tr-stat span {
  font-size: 12px;
  color: var(--muted);
}
.mailpage .tr-stat.task .ic {
  color: var(--blue);
}
.mailpage .tr-stat.event .ic {
  color: var(--coral);
}
.mailpage .tr-stat.reply .ic {
  color: var(--green);
}

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

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

/* ====================== 작성 (Compose) 슬라이드오버 ====================== */
.mailpage .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: mail-fade 0.18s ease;
}
@keyframes mail-fade {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
.mailpage .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: mail-slidein 0.24s cubic-bezier(0.2, 0.7, 0.2, 1);
}
@keyframes mail-slidein {
  from {
    transform: translateX(40px);
    opacity: 0;
  }
  to {
    transform: none;
    opacity: 1;
  }
}
.mailpage .cp-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 22px;
  border-bottom: 1px solid var(--line);
}
.mailpage .cp-head .h-ic {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  background: var(--fill);
  color: var(--on-fill);
}
.mailpage .cp-head .h-ic .ic {
  width: 16px;
  height: 16px;
}
.mailpage .cp-head b {
  font-family: var(--font-disp);
  font-size: 16px;
  font-weight: 700;
}
.mailpage .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;
}
.mailpage .cp-close .ic {
  width: 17px;
  height: 17px;
}
.mailpage .cp-close:hover {
  background: var(--card-2);
  color: var(--ink);
}

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

/* AI 작성 도우미 바 */
.mailpage .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));
}
.mailpage .cp-ai-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}
.mailpage .cp-ai-head .a-ic {
  width: 24px;
  height: 24px;
  border-radius: 7px;
  display: grid;
  place-items: center;
  background: var(--coral);
  color: #fff;
}
.mailpage .cp-ai-head .a-ic .ic {
  width: 13px;
  height: 13px;
}
.mailpage .cp-ai-head b {
  font-size: 12.5px;
  font-weight: 700;
}
.mailpage .cp-ai-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}
.mailpage .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;
}
.mailpage .cp-ai-btn .ic {
  width: 13px;
  height: 13px;
  color: var(--coral);
}
.mailpage .cp-ai-btn:hover {
  color: var(--ink);
  transform: translateY(-1px);
}
.mailpage .cp-ai-btn:disabled {
  opacity: 0.55;
  cursor: default;
  transform: none;
}

.mailpage .cp-foot {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 22px;
  border-top: 1px solid var(--line);
}
.mailpage .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;
}
.mailpage .cp-send .ic {
  width: 16px;
  height: 16px;
}
.mailpage .cp-send:hover {
  transform: translateY(-1px);
  filter: brightness(1.06);
}
.mailpage .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;
}
.mailpage .cp-foot .cp-tool .ic {
  width: 17px;
  height: 17px;
}
.mailpage .cp-foot .cp-tool:hover {
  background: var(--card-2);
  color: var(--ink);
}
.mailpage .cp-foot .cp-spacer {
  flex: 1;
}
.mailpage .cp-foot .cp-discard {
  font-size: 13px;
  color: var(--muted);
  padding: 8px 12px;
  border-radius: 9px;
}
.mailpage .cp-foot .cp-discard:hover {
  color: var(--coral);
}

/* 토스트 */
.mailpage .toast-wrap {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 80;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
}
.mailpage .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: mail-toastin 0.3s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.mailpage .toast .ic {
  width: 16px;
  height: 16px;
}
.mailpage .toast .t-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}
@keyframes mail-toastin {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

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

/* ── phase-18: 일괄 선택 · 첨부 다운로드 · cc/bcc · 대화(스레드) ── */
.mailpage .att-chip {
  text-decoration: none;
  color: inherit;
}
.mailpage .att-chip .ic:last-child {
  color: var(--muted);
  width: 15px;
  height: 15px;
  margin-left: 2px;
}

/* 일괄 선택 행 + 체크박스 */
.mailpage .ml-rowwrap {
  display: flex;
  align-items: stretch;
}
.mailpage .ml-check {
  display: flex;
  align-items: center;
  padding: 0 4px 0 10px;
  cursor: pointer;
}
.mailpage .ml-check input {
  width: 15px;
  height: 15px;
  accent-color: var(--blue);
  cursor: pointer;
}
.mailpage .ml-rowwrap.picked {
  background: color-mix(in srgb, var(--blue) 9%, transparent);
}
.mailpage .ml-rowwrap > .mrow {
  flex: 1;
  min-width: 0;
}

/* 일괄 작업 바 */
.mailpage .ml-bulk {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 9px 14px;
  border-bottom: 1px solid var(--line);
  background: var(--card-2);
}
.mailpage .ml-bulk-count {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  margin-right: auto;
}
.mailpage .ml-bulk-btn {
  font-size: 12px;
  padding: 5px 11px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: var(--card);
  cursor: pointer;
  transition: background 0.12s;
}
.mailpage .ml-bulk-btn:hover {
  background: var(--card-3);
}
.mailpage .ml-bulk-btn.danger {
  color: var(--coral);
}
.mailpage .ml-bulk-btn.ghost {
  border: none;
  background: transparent;
  padding: 5px 6px;
}
.mailpage .ml-bulk-btn.ghost .ic {
  width: 15px;
  height: 15px;
}

/* cc/bcc 토글 */
.mailpage .cp-cc-toggle {
  margin-left: auto;
  font-size: 11.5px;
  color: var(--muted);
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 2px 6px;
}
.mailpage .cp-cc-toggle:hover {
  color: var(--ink);
}

/* 작성 첨부 칩 */
.mailpage .cp-attachments {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}
.mailpage .cp-att {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 10px;
  border-radius: 10px;
  background: var(--card-2);
  border: 1px solid var(--line);
  font-size: 12px;
}
.mailpage .cp-att .ic {
  width: 15px;
  height: 15px;
  color: var(--coral);
}
.mailpage .cp-att-name {
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.mailpage .cp-att-size {
  color: var(--muted);
  font-size: 10.5px;
}
.mailpage .cp-att-x {
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--muted);
  display: flex;
  padding: 0;
}
.mailpage .cp-att-x .ic {
  width: 13px;
  height: 13px;
  color: var(--muted);
}
.mailpage .cp-att-x:hover .ic {
  color: var(--coral);
}

/* 대화(스레드) */
.mailpage .rd-thread {
  margin-top: 22px;
  border-top: 1px solid var(--line);
  padding-top: 16px;
}
.mailpage .rd-thread-head {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 10px;
}
.mailpage .rd-thread-head .ic {
  width: 15px;
  height: 15px;
}
.mailpage .rd-thread-msg {
  display: flex;
  align-items: baseline;
  gap: 10px;
  width: 100%;
  text-align: left;
  padding: 9px 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--card-2);
  cursor: pointer;
  margin-bottom: 7px;
  transition: background 0.12s;
}
.mailpage .rd-thread-msg:hover {
  background: var(--card-3);
}
.mailpage .rd-thread-msg:disabled {
  cursor: default;
}
.mailpage .rd-thread-msg .tm-from {
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
}
.mailpage .rd-thread-msg .tm-prev {
  flex: 1;
  min-width: 0;
  font-size: 12px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.mailpage .rd-thread-msg .tm-time {
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
}

/* ====================== 아리 비서 다이제스트(아리 정리) ====================== */
.mailpage .secretary {
  height: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  overflow: hidden;
}
.mailpage .sec-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 22px;
  scrollbar-width: thin;
}
.mailpage .sec-hero {
  display: flex;
  gap: 14px;
  padding: 18px 18px 20px;
  border-radius: 16px;
  background:
    radial-gradient(120% 160% at 0% 0%, color-mix(in oklab, var(--coral) 16%, transparent), transparent 55%),
    var(--card-2);
  border: 1px solid var(--line);
  margin-bottom: 18px;
}
.mailpage .sec-spark {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  border-radius: 12px;
  display: grid;
  place-items: center;
  color: #fff;
  background: linear-gradient(135deg, var(--coral), var(--violet));
  box-shadow: 0 8px 18px -8px var(--coral);
}
.mailpage .sec-spark .ic {
  width: 20px;
  height: 20px;
}
.mailpage .sec-hero-main {
  min-width: 0;
}
.mailpage .sec-eyebrow {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--coral);
  margin-bottom: 4px;
}
.mailpage .sec-hero-main h2 {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--ink);
  margin: 0 0 6px;
}
.mailpage .sec-hero-main p {
  font-size: 13px;
  line-height: 1.6;
  color: var(--ink-2);
  margin: 0;
}
.mailpage .sec-stats {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  flex-wrap: wrap;
}
.mailpage .sec-stat {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 11px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-2);
  background: var(--card);
  border: 1px solid var(--line);
}
.mailpage .sec-stat .ic {
  width: 14px;
  height: 14px;
}
.mailpage .sec-stat b {
  font-weight: 800;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.mailpage .sec-stat.task .ic {
  color: var(--blue);
}
.mailpage .sec-stat.event .ic {
  color: var(--coral);
}
.mailpage .sec-stat.reply .ic {
  color: var(--green);
}

/* ---- 발신자 카드 ---- */
.mailpage .sec-cards {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.mailpage .sc-card {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--card);
  padding: 16px 16px 14px;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.14s;
}
.mailpage .sc-card:hover {
  border-color: var(--line-2);
}
.mailpage .sc-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.mailpage .sc-ava {
  width: 34px;
  height: 34px;
  flex-shrink: 0;
  border-radius: 10px;
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 800;
  font-size: 14px;
}
.mailpage .sc-who {
  min-width: 0;
  flex: 1;
  line-height: 1.3;
}
.mailpage .sc-who b {
  display: block;
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mailpage .sc-status {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--ink-2);
}
.mailpage .sc-status.coral {
  color: var(--coral);
}
.mailpage .sc-status.violet {
  color: var(--violet);
}
.mailpage .sc-status.blue {
  color: var(--blue);
}
.mailpage .sc-status.green {
  color: var(--green);
}
.mailpage .sc-open {
  width: 30px;
  height: 30px;
  flex-shrink: 0;
  border-radius: 9px;
  display: grid;
  place-items: center;
  color: var(--muted);
  transition:
    background 0.13s,
    color 0.13s;
}
.mailpage .sc-open:hover {
  background: var(--card-2);
  color: var(--ink);
}
.mailpage .sc-open .ic {
  width: 17px;
  height: 17px;
}
.mailpage .sc-title {
  font-size: 14.5px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--ink);
  margin: 0 0 4px;
  cursor: pointer;
}
.mailpage .sc-title:hover {
  color: var(--coral);
}
.mailpage .sc-sub {
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--ink-2);
  margin: 0 0 12px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.mailpage .sc-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.mailpage .sc-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  text-align: left;
  padding: 10px 11px;
  border-radius: 12px;
  background: var(--card-2);
  border: 1px solid transparent;
  transition:
    background 0.13s,
    border-color 0.13s;
}
.mailpage button.sc-item {
  cursor: pointer;
}
.mailpage button.sc-item:hover {
  border-color: var(--line);
}
.mailpage .si-ico {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  border-radius: 8px;
  display: grid;
  place-items: center;
}
.mailpage .si-ico .ic {
  width: 15px;
  height: 15px;
}
.mailpage .si-ico.task {
  color: var(--blue);
  background: color-mix(in oklab, var(--blue) 14%, transparent);
}
.mailpage .si-ico.event {
  color: var(--coral);
  background: color-mix(in oklab, var(--coral) 14%, transparent);
}
.mailpage .si-ico.reply {
  color: var(--green);
  background: color-mix(in oklab, var(--green) 14%, transparent);
}
.mailpage .si-body {
  min-width: 0;
  flex: 1;
  line-height: 1.35;
}
.mailpage .si-body b {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mailpage .si-meta {
  font-size: 11.5px;
  color: var(--ink-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
}
.mailpage .sc-item.reply > .ic {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  color: var(--muted);
}
.mailpage .si-add {
  width: 30px;
  height: 30px;
  flex-shrink: 0;
  border-radius: 9px;
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--ink);
  cursor: pointer;
  transition:
    transform 0.12s,
    background 0.14s;
}
.mailpage .si-add:hover {
  transform: translateY(-1px);
}
.mailpage .si-add .ic {
  width: 16px;
  height: 16px;
}
.mailpage .si-add.done {
  background: var(--green);
  cursor: default;
}
.mailpage .sc-applyall {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 12px;
  padding: 8px 14px;
  border-radius: 10px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--coral);
  background: color-mix(in oklab, var(--coral) 10%, transparent);
  border: 1px solid color-mix(in oklab, var(--coral) 26%, transparent);
  cursor: pointer;
  transition:
    background 0.14s,
    transform 0.12s;
}
.mailpage .sc-applyall:hover {
  transform: translateY(-1px);
  background: color-mix(in oklab, var(--coral) 16%, transparent);
}
.mailpage .sc-applyall .ic {
  width: 15px;
  height: 15px;
}

/* ---- 비어있음 ---- */
.mailpage .sec-empty {
  text-align: center;
  padding: 50px 30px;
  color: var(--ink-2);
}
.mailpage .sec-empty .se-ico {
  width: 52px;
  height: 52px;
  margin: 0 auto 14px;
  border-radius: 15px;
  display: grid;
  place-items: center;
  color: var(--green);
  background: color-mix(in oklab, var(--green) 14%, transparent);
}
.mailpage .sec-empty .se-ico .ic {
  width: 24px;
  height: 24px;
}
.mailpage .sec-empty h3 {
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
  margin: 0 0 6px;
}
.mailpage .sec-empty p {
  font-size: 13px;
  margin: 0;
}

/* 비서 히어로: 통계 + 정리 맡기기 버튼 한 줄. */
.mailpage .sec-hero-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 12px;
}
.mailpage .sec-hero-row .sec-stats {
  margin-top: 0;
}
.mailpage .sec-analyze {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
  padding: 8px 15px;
  border-radius: 11px;
  font-size: 12.5px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, var(--coral), var(--violet));
  box-shadow: 0 8px 18px -9px var(--coral);
  cursor: pointer;
  transition:
    transform 0.12s,
    filter 0.14s;
}
.mailpage .sec-analyze:hover {
  transform: translateY(-1px);
  filter: brightness(1.05);
}
.mailpage .sec-analyze:disabled {
  cursor: default;
  opacity: 0.85;
}
.mailpage .sec-analyze .ic {
  width: 15px;
  height: 15px;
}
.mailpage .sec-analyze:disabled .ic {
  animation: sec-spin 0.9s linear infinite;
}
@keyframes sec-spin {
  to {
    transform: rotate(360deg);
  }
}
/* 기준 시각 안내 + '지금부터 다시' 재설정 */
.mailpage .sec-baseline {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 12px;
  font-size: 11.5px;
  color: var(--muted);
}
.mailpage .sec-baseline b {
  color: var(--text);
  font-weight: 650;
}
.mailpage .sec-baseline button {
  padding: 3px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  background: var(--surface);
  cursor: pointer;
  transition:
    color 0.12s,
    border-color 0.12s;
}
.mailpage .sec-baseline button:hover {
  color: var(--text);
  border-color: var(--muted);
}
.mailpage .sec-baseline button:disabled {
  cursor: default;
  opacity: 0.6;
}
