/* ============================================================
   Boot splash · real notifications · AI · composer 0.7
   ============================================================ */
.boot-splash {
  position: fixed;
  inset: 0;
  z-index: 3000;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 50% 32%, rgba(94, 156, 255, .16), transparent 34%),
    linear-gradient(155deg, #071a2c 0%, #0a2a47 55%, #071827 100%);
  color: #fff;
  transition: opacity .35s ease, visibility .35s ease;
}
.boot-splash.is-hiding { opacity: 0; visibility: hidden; pointer-events: none; }
.boot-splash-inner { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 32px; }
.boot-splash .eyebrow { color: rgba(213, 231, 255, .62); margin: 26px 0 8px; }
.boot-splash h1 { margin: 0; font-size: clamp(1.4rem, 3vw, 2rem); letter-spacing: -.02em; }
.boot-splash p:not(.eyebrow) { margin: 9px 0 24px; color: rgba(224, 237, 255, .66); font-size: .875rem; }
.boot-progress { width: 190px; height: 3px; overflow: hidden; border-radius: 99px; background: rgba(255,255,255,.13); }
.boot-progress span { display: block; width: 45%; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #5ea0ff, #9ed8ff); animation: boot-progress 1.25s ease-in-out infinite; }
@keyframes boot-progress { 0% { transform: translateX(-110%); } 100% { transform: translateX(270%); } }
.boot-envelope { position: relative; width: 118px; height: 84px; animation: boot-float 2.2s ease-in-out infinite; filter: drop-shadow(0 18px 28px rgba(0,0,0,.32)); }
.boot-envelope-body { position: absolute; inset: 15px 0 0; border-radius: 12px; background: linear-gradient(150deg, #f9fbff, #cfe2ff); box-shadow: inset 0 -8px 16px rgba(42, 89, 148, .13); }
.boot-envelope-flap { position: absolute; inset-inline-start: 0; inset-inline-end: 0; top: 15px; height: 54px; clip-path: polygon(0 0, 100% 0, 50% 100%); border-radius: 12px 12px 0 0; background: linear-gradient(160deg, #ffffff, #c1d9ff); transform-origin: top center; animation: boot-flap 2.2s ease-in-out infinite; }
.boot-envelope-letter { position: absolute; inset-inline-start: 17px; inset-inline-end: 17px; top: -2px; height: 57px; border-radius: 7px; background: #fff; box-shadow: 0 4px 12px rgba(28, 64, 113, .18); animation: boot-letter 2.2s ease-in-out infinite; }
.boot-envelope-letter::before, .boot-envelope-letter::after { content: ""; position: absolute; inset-inline-start: 14px; inset-inline-end: 26px; height: 3px; border-radius: 4px; background: #cbd9ea; }
.boot-envelope-letter::before { top: 18px; }
.boot-envelope-letter::after { top: 28px; inset-inline-end: 40px; }
.boot-spark { position: absolute; width: 7px; height: 7px; border-radius: 50%; background: #9ccaff; opacity: 0; animation: boot-spark 2.2s ease-in-out infinite; }
.boot-spark-1 { inset-inline-start: -26px; top: 4px; animation-delay: .25s; }
.boot-spark-2 { inset-inline-end: -30px; top: 32px; animation-delay: .65s; }
.boot-spark-3 { inset-inline-start: -10px; bottom: -18px; animation-delay: 1s; }
@keyframes boot-float { 0%,100% { transform: translateY(0) rotate(-1deg); } 50% { transform: translateY(-11px) rotate(1.5deg); } }
@keyframes boot-flap { 0%,100% { transform: rotateX(0); } 50% { transform: rotateX(34deg); } }
@keyframes boot-letter { 0%,100% { transform: translateY(5px); } 50% { transform: translateY(-10px); } }
@keyframes boot-spark { 0%, 30%, 100% { opacity: 0; transform: scale(.4); } 55% { opacity: .9; transform: scale(1); } }

/* Sign-out reverse of the opening splash. */
.boot-lock {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  opacity: 0;
  pointer-events: none;
}
.boot-lock .icon { width: 42px; height: 42px; color: #e6efff; stroke-width: 1.7; }
.boot-splash.is-logout .boot-envelope { animation: none; filter: drop-shadow(0 12px 22px rgba(0, 0, 0, .28)); }
.boot-splash.is-logout .boot-envelope-letter { animation: boot-letter-close 1.8s ease forwards; }
.boot-splash.is-logout .boot-envelope-flap { animation: boot-flap-close 1.8s ease forwards; }
.boot-splash.is-logout .boot-envelope-body { animation: boot-body-fade 2.4s .6s ease forwards; }
.boot-splash.is-logout .boot-spark { animation: boot-spark-out 1.7s ease-out forwards; }
.boot-splash.is-logout .boot-lock { animation: boot-lock-in 1.6s .85s ease forwards; }
.boot-splash.is-logout .boot-progress span {
  width: 100%;
  background: #95a2b5;
  animation: boot-progress-drain 6s linear forwards;
}
@keyframes boot-letter-close {
  0% { transform: translateY(5px) scale(1); opacity: 1; }
  60% { transform: translateY(32px) scale(.9); opacity: .45; }
  100% { transform: translateY(42px) scale(.72); opacity: 0; }
}
@keyframes boot-flap-close {
  0% { transform: rotateX(0); opacity: 1; }
  45% { transform: rotateX(34deg); opacity: 1; }
  100% { transform: rotateX(180deg); opacity: .2; }
}
@keyframes boot-body-fade {
  0% { opacity: 1; }
  100% { opacity: .12; }
}
@keyframes boot-spark-out {
  0% { opacity: .8; transform: scale(1); }
  100% { opacity: 0; transform: scale(2.5); }
}
@keyframes boot-lock-in {
  0% { opacity: 0; transform: scale(.65); }
  60% { opacity: 1; transform: scale(1.06); }
  100% { opacity: 1; transform: scale(1); }
}
@keyframes boot-progress-drain {
  0% { transform: translateX(0); opacity: 1; }
  75% { opacity: .8; }
  100% { transform: translateX(-105%); opacity: .35; }
}

.notify-count {
  position: absolute; top: 1px; inset-inline-end: -1px; min-width: 16px; height: 16px; padding: 0 4px;
  border-radius: 99px; background: #d14343; color: #fff; font-size: 9px; font-weight: 800;
  display: grid; place-items: center; border: 2px solid var(--header-bg); line-height: 1;
}
.notify-btn { position: relative; }
.notify-pop { width: min(430px, calc(100vw - 28px)); padding: 0; overflow: hidden; }
.notify-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 17px 18px 13px; border-bottom: 1px solid var(--border); }
.notify-head h2 { margin: 0; font-size: .95rem; }
.notify-head > div > span { display: block; font-size: .675rem; color: var(--text-3); margin-top: 3px; }
.notify-list { max-height: min(460px, 58vh); overflow: auto; }
.notify-list .notify-empty { padding: 34px 24px; text-align: center; color: var(--text-3); font-size: .8rem; }
.notify-item { width: 100%; display: grid; grid-template-columns: 36px minmax(0,1fr) auto; align-items: start; gap: 11px; padding: 13px 18px; border: 0; border-bottom: 1px solid var(--border); background: transparent; text-align: start; color: var(--text); cursor: pointer; }
.notify-item:hover { background: var(--surface-2); }
.notify-item.is-unread { background: color-mix(in srgb, var(--accent) 5%, var(--surface)); }
.notify-icon { width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-ink); }
.notify-icon.accent { background: color-mix(in srgb, #7c3aed 14%, var(--surface)); color: #7c3aed; }
.notify-icon.security { background: color-mix(in srgb, #b45309 13%, var(--surface)); color: #a16207; }
.notify-icon svg { width: 17px; height: 17px; }
.notify-main { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.notify-main strong { font-size: .78rem; font-weight: 650; line-height: 1.3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.notify-main span { font-size: .71rem; color: var(--text-3); line-height: 1.4; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.notify-item time { font-size: .63rem; color: var(--text-3); white-space: nowrap; padding-top: 3px; }
.notify-item .notify-unread-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); display: inline-block; margin-inline-end: 5px; }
.notify-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 16px; background: var(--surface-2); border-top: 1px solid var(--border); font-size: .68rem; color: var(--text-3); }
.notify-viewall { display: inline-flex; align-items: center; gap: 2px; border: 0; background: transparent; color: var(--accent-ink); font-weight: 650; font-size: .7rem; cursor: pointer; }
.notify-viewall svg { width: 13px; height: 13px; }

.notice-layer { position: fixed; inset: 0; z-index: 190; display: grid; place-items: center; padding: 24px; background: rgba(6, 15, 26, .42); backdrop-filter: blur(3px); }
.notice-window { width: min(780px, 100%); max-height: min(760px, calc(100dvh - 48px)); display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border-strong); border-radius: 16px; box-shadow: 0 32px 90px rgba(7, 20, 36, .42); overflow: hidden; animation: compose-in .18s ease-out; }
.notice-window-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 17px 20px; background: var(--header-bg); color: var(--header-text); }
.notice-window-title { display: flex; align-items: center; gap: 12px; }
.notice-window-icon { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; background: rgba(255,255,255,.12); color: #fff; }
.notice-window-title h2 { margin: 2px 0 0; font-size: 1rem; }
.notice-window-title .eyebrow { color: var(--header-muted); margin: 0; }
.notice-window-actions { display: flex; align-items: center; gap: 8px; }
.notice-window-actions .btn-secondary { background: rgba(255,255,255,.12); border-color: rgba(255,255,255,.24); color: #fff; }
.notice-window-actions .btn-secondary:hover { background: rgba(255,255,255,.2); }
.notice-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px 20px; border-bottom: 1px solid var(--border); background: var(--surface-2); }
.notice-filters { display: flex; gap: 4px; }
.notice-filter { border: 1px solid transparent; background: transparent; color: var(--text-3); border-radius: 8px; padding: 6px 11px; font: inherit; font-size: .72rem; font-weight: 600; cursor: pointer; }
.notice-filter:hover { background: var(--surface-3); color: var(--text); }
.notice-filter.is-active { background: var(--surface); color: var(--text); border-color: var(--border); box-shadow: var(--shadow); }
.notice-count { font-size: .68rem; color: var(--text-3); }
.notice-window-body { overflow: auto; flex: 1; min-height: 180px; }
.notice-group { padding: 4px 20px 10px; }
.notice-group h3 { margin: 18px 0 8px; font-size: .65rem; text-transform: uppercase; letter-spacing: .09em; color: var(--text-3); }
.notice-center-item { display: grid; grid-template-columns: 38px minmax(0,1fr) auto; gap: 12px; align-items: start; padding: 13px 2px; border-bottom: 1px solid var(--border); }
.notice-center-item.is-unread { background: linear-gradient(90deg, color-mix(in srgb, var(--accent) 6%, transparent), transparent 65%); }
.notice-center-main strong { display: block; font-size: .8rem; }
.notice-center-main p { margin: 4px 0 0; font-size: .74rem; color: var(--text-2); line-height: 1.5; }
.notice-center-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; font-size: .64rem; color: var(--text-3); }
.notice-center-actions { display: flex; gap: 4px; align-items: center; }
.notice-center-actions .link-btn { font-size: .68rem; }
.notice-empty { padding: 54px 24px; text-align: center; color: var(--text-3); }
.notice-empty svg { width: 30px; height: 30px; opacity: .5; margin-bottom: 10px; }
.notice-window-foot { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px 20px; border-top: 1px solid var(--border); background: var(--surface-2); font-size: .68rem; color: var(--text-3); }
.notice-window-foot > span { display: inline-flex; align-items: center; gap: 6px; }

.ai-reader-split { position: relative; display: inline-flex; align-items: stretch; flex: none; height: 27px; border-radius: 7px; overflow: visible; filter: drop-shadow(0 2px 5px rgba(99, 70, 216, .24)); }
.ai-reader-primary, .ai-reader-chevron { height: 27px; border: 0; background: linear-gradient(135deg, #7c5cff, #5a3ee8); color: #fff; font: inherit; cursor: pointer; }
.ai-reader-primary { display: inline-flex; align-items: center; gap: 5px; padding: 0 8px; border-radius: 7px 0 0 7px; font-size: .69rem; font-weight: 750; letter-spacing: .02em; }
.ai-reader-primary svg { width: 15px; height: 15px; }
.ai-reader-chevron { width: 22px; display: grid; place-items: center; border-inline-start: 1px solid rgba(255, 255, 255, .28); border-radius: 0 7px 7px 0; }
.ai-reader-chevron svg { width: 12px; height: 12px; }
.ai-reader-primary:hover, .ai-reader-chevron:hover { background: linear-gradient(135deg, #6b49f5, #4a32d4); }
.ai-reader-menu { position: absolute; top: calc(100% + 8px); inset-inline-end: 0; z-index: 70; width: 278px; padding: 6px; border: 1px solid color-mix(in srgb, #7c5cff 30%, var(--border)); border-radius: 12px; background: var(--surface); box-shadow: var(--shadow-pop); }
.ai-reader-menu.is-portal { position: fixed; z-index: 500; }
.ai-reader-menu button { width: 100%; display: flex; align-items: center; gap: 10px; border: 0; border-radius: 8px; background: transparent; color: var(--text); padding: 9px; text-align: start; cursor: pointer; }
.ai-reader-menu button:hover { background: color-mix(in srgb, #7c5cff 9%, var(--surface-2)); }
.ai-menu-icon { width: 30px; height: 30px; flex: none; display: grid; place-items: center; border-radius: 9px; background: color-mix(in srgb, #7c5cff 12%, var(--surface)); color: #6d4aff; }
.ai-reader-menu svg { width: 16px; height: 16px; flex: none; }
.ai-reader-menu button > span:not(.ai-menu-icon) { display: flex; flex-direction: column; gap: 2px; }
.ai-reader-menu strong { font-size: .74rem; }
.ai-reader-menu small { font-size: .65rem; color: var(--text-3); }
.ai-reply-action { color: #6d4aff !important; }
.ai-reply-action:hover { background: color-mix(in srgb, #7c5cff 11%, transparent) !important; color: #5a3ee8 !important; }
.ai-reply-action svg { color: #6d4aff; }
.commandbar .ai-reader-split { height: 30px; margin: 0 2px; }
.commandbar .ai-reader-primary, .commandbar .ai-reader-chevron { height: 30px; }
.commandbar .ai-reader-primary { font-size: .72rem; }
.commandbar .ai-reader-menu { top: calc(100% + 7px); }
.ai-summary-card { margin: 0 0 14px; border: 1px solid color-mix(in srgb, #8b5cf6 28%, var(--border)); border-radius: 13px; background: linear-gradient(135deg, color-mix(in srgb, #8b5cf6 7%, var(--surface)), var(--surface) 60%); overflow: hidden; }
.ai-summary-card-head { display: flex; align-items: center; gap: 9px; padding: 11px 14px 0; color: #7c3aed; }
.ai-summary-card-head svg { width: 16px; height: 16px; }
.ai-summary-card-head strong { font-size: .7rem; letter-spacing: .04em; text-transform: uppercase; }
.ai-summary-card-head .ai-summary-close { margin-inline-start: auto; }
.ai-summary-body { padding: 9px 14px 13px; font-size: .82rem; line-height: 1.6; color: var(--text-2); white-space: pre-wrap; }
.ai-summary-loading { color: var(--text-3); font-style: italic; }
.ai-summary-note { padding: 0 14px 11px; font-size: .62rem; color: var(--text-3); }

.compose .compose-editor-wrap { position: relative; flex: 1; min-height: 180px; display: flex; flex-direction: column; overflow: hidden; }
.compose-editor-toolbar { flex: none; display: flex; flex-wrap: wrap; align-items: center; gap: 2px; padding: 6px 10px; border-bottom: 1px solid var(--border); background: var(--surface-2); }
.compose-editor-toolbar .editor-sep { width: 1px; height: 18px; margin: 0 3px; background: var(--border); }
.compose-editor-toolbar button { min-width: 27px; height: 27px; padding: 0 6px; display: inline-grid; place-items: center; border: 0; border-radius: 5px; background: transparent; color: var(--text-2); font: inherit; font-size: .74rem; font-weight: 700; cursor: pointer; }
.compose-editor-toolbar button:hover { background: var(--surface-4); color: var(--text); }
.compose-editor-toolbar button.is-active { background: var(--accent-soft-2); color: var(--accent-ink); }
.compose-editor-toolbar select { height: 27px; border: 1px solid var(--border); border-radius: 5px; background: var(--surface); color: var(--text); font: inherit; font-size: .68rem; padding: 0 5px; }
.compose-editor-toolbar .editor-font-select { width: 112px; }
.compose-editor-toolbar .editor-size-select { width: 62px; }
.compose-editor-toolbar .editor-align-group { display: inline-flex; align-items: center; gap: 1px; }
.compose-editor-toolbar .editor-align-btn { padding: 0 5px; }
.compose-editor-toolbar .align-icon { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.65; stroke-linecap: round; }
.editor-color-wrap { position: relative; width: 27px; height: 27px; flex: none; display: inline-grid; place-items: center; border-radius: 5px; color: var(--text-2); cursor: pointer; }
.editor-color-wrap:hover { background: var(--surface-4); color: var(--text); }
.editor-color-wrap input[type="color"] { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.editor-color-glyph { font-size: .76rem; font-weight: 800; line-height: 1; border-bottom: 3px solid #172230; padding-bottom: 1px; }
.editor-highlight-glyph { border-bottom-color: #f3d45a; }
.editor-highlight-glyph svg { width: 12px; height: 12px; display: block; }
.compose-editor { flex: 1; min-height: 150px; overflow: auto; padding: 14px; outline: 0; font-size: .875rem; line-height: 1.65; color: var(--text); }
.compose-editor:empty::before { content: attr(data-placeholder); color: var(--text-3); pointer-events: none; }
.compose-editor p { margin: 0 0 .8em; }
.compose-editor h1 { font-size: 1.35rem; margin: .2em 0 .5em; }
.compose-editor h2 { font-size: 1.15rem; margin: .2em 0 .5em; }
.compose-editor blockquote { margin: .5em 0; padding: 6px 12px; border-inline-start: 3px solid var(--accent); color: var(--text-2); background: var(--surface-2); }
.compose-editor pre, .compose-editor code { font-family: var(--font-mono); font-size: .8em; background: var(--surface-3); border-radius: 4px; }
.compose-editor pre { padding: 10px; white-space: pre-wrap; }
.compose-editor a { color: var(--accent-ink); }
.compose-editor .compose-quote { margin: 16px 0 0; padding-top: 12px; border-top: 1px solid var(--border); }
.compose-editor .compose-quote-inner { width: 100%; max-width: 720px; margin: 0; }
.compose-editor .compose-quote-lead { margin: 0 0 8px; color: var(--text-3); font-size: .78rem; font-style: italic; }
.compose-editor .compose-quote-meta { display: flex; flex-direction: column; gap: 2px; margin: 0 0 8px; color: var(--text-3); font-size: .72rem; }
.compose-editor .compose-quote-meta b { color: var(--text-2); font-weight: 600; }
.compose-editor .email-quote {
  margin: 0;
  padding: 14px 16px;
  border: 1px solid #dfe6ee;
  border-radius: 10px;
  background: #fff;
  color: #172230;
  overflow-x: auto;
}
.compose-editor .email-quote, .compose-editor .email-quote * { max-width: 100% !important; box-sizing: border-box; }
.compose-editor .email-quote img { max-width: 100% !important; height: auto !important; }
.compose-editor .email-quote table { border-collapse: collapse; }
.compose-editor .email-quote td, .compose-editor .email-quote th { overflow-wrap: anywhere; }
.compose-editor.is-quote-collapsed .email-quote,
.compose-editor.is-quote-collapsed .compose-quote-meta { display: none; }
.compose-editor .compose-quote-toggle.is-active,
.compose-editor-toolbar .compose-quote-toggle.is-active { background: var(--accent-soft-2); color: var(--accent-ink); }
.compose-editor-toolbar .compose-ai-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 28px;
  padding: 0 10px;
  border: 0;
  border-radius: 999px;
  background: #7c3aed;
  color: #fff;
  font-size: .66rem;
  font-weight: 800;
  letter-spacing: .04em;
  box-shadow: 0 0 0 0 rgba(124, 58, 237, .42);
  animation: compose-ai-pulse 2.3s ease-in-out infinite;
}
.compose-editor-toolbar .compose-ai-btn:hover { background: #6d28d9; color: #fff; }
.compose-editor-toolbar .compose-ai-btn svg { width: 16px; height: 16px; stroke-width: 2.5; }
.compose-ai-label { line-height: 1; }
@keyframes compose-ai-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(124, 58, 237, .42); transform: scale(1); }
  50% { box-shadow: 0 0 0 6px transparent; transform: scale(1.035); }
}
@media (prefers-reduced-motion: reduce) {
  .compose-editor-toolbar .compose-ai-btn { animation: none; }
}
.compose-priority { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.compose-priority-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 28px;
  padding: 0 11px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text-2);
  font-size: .68rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease, color .15s ease;
}
.compose-priority-btn:hover { background: var(--surface-3); color: var(--text); }
.priority-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--text-3); flex: none; }
.priority-dot.low { background: var(--success); }
.priority-dot.normal { background: var(--accent); }
.priority-dot.high { background: var(--danger); }
.compose-priority-btn.is-active { font-weight: 800; }
.compose-priority-btn[data-compose-priority="low"].is-active { color: var(--success); border-color: var(--success); background: var(--success-soft); }
.compose-priority-btn[data-compose-priority="normal"].is-active { color: var(--accent-ink); border-color: var(--accent); background: var(--accent-soft); }
.compose-priority-btn[data-compose-priority="high"].is-active { color: var(--danger); border-color: var(--danger); background: var(--danger-soft); }
.compose-editor table { border-collapse: collapse; width: 100%; }
.compose-editor td, .compose-editor th { border: 1px solid var(--border); padding: 5px 7px; }
.compose-toolbar-mode { margin-inline-start: auto; display: inline-flex; border: 1px solid var(--border); border-radius: 6px; overflow: hidden; }
.compose-toolbar-mode button { border-radius: 0; font-size: .65rem; font-weight: 650; }
.compose-toolbar-mode button + button { border-inline-start: 1px solid var(--border); }
.compose-direction { display: inline-flex; align-items: center; border: 1px solid var(--border); border-radius: 6px; overflow: hidden; }
.compose-direction button { border: 0; border-radius: 0; background: transparent; color: var(--text-2); padding: 3px 7px; font-size: .62rem; font-weight: 700; letter-spacing: .02em; }
.compose-direction button + button { border-inline-start: 1px solid var(--border); }
.compose-direction button.is-active { background: var(--accent-soft); color: var(--accent-ink); }
.compose-direction button:hover { background: var(--surface-3); }
.compose-ai-btn { color: #fff !important; }
.compose-ai-panel { flex: none; margin: 0 12px 10px; padding: 13px; border: 1px solid color-mix(in srgb, #8b5cf6 28%, var(--border)); border-radius: 11px; background: linear-gradient(145deg, color-mix(in srgb, #8b5cf6 7%, var(--surface)), var(--surface)); }
.compose-ai-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; color: #7c3aed; }
.compose-ai-head svg { width: 17px; height: 17px; }
.compose-ai-head strong { font-size: .74rem; }
.compose-ai-head button { margin-inline-start: auto; }
.compose-ai-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.compose-ai-grid label { display: flex; flex-direction: column; gap: 3px; font-size: .62rem; color: var(--text-3); }
.compose-ai-grid select, .compose-ai-grid input { height: 30px; border: 1px solid var(--border); border-radius: 6px; background: var(--surface); color: var(--text); font: inherit; font-size: .7rem; padding: 0 7px; }
.compose-ai-prompt { grid-column: 1 / -1; }
.compose-ai-prompt textarea { min-height: 54px; resize: vertical; border: 1px solid var(--border); border-radius: 6px; background: var(--surface); color: var(--text); font: inherit; font-size: .72rem; padding: 7px; }
.compose-ai-range { display: flex; align-items: center; gap: 8px; }
.compose-ai-range input { flex: 1; padding: 0; }
.compose-ai-actions { display: flex; align-items: center; gap: 8px; margin-top: 10px; }
.compose-ai-result { margin-top: 10px; padding: 9px; border: 1px solid var(--border); border-radius: 7px; background: var(--surface); font-size: .74rem; line-height: 1.55; white-space: pre-wrap; max-height: 160px; overflow: auto; }
.compose-ai-actions .settings-note { margin: 0; }

/* AI writing progress overlay: floats above the editor while the provider works. */
.compose-ai-thinking {
  position: absolute;
  inset: 0;
  z-index: 12;
  display: grid;
  place-items: center;
  padding: 18px;
  background: color-mix(in srgb, var(--surface) 68%, transparent);
  backdrop-filter: blur(3px);
  pointer-events: none;
}
.compose-ai-thinking-card {
  width: min(310px, 100%);
  padding: 20px 24px 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  text-align: center;
  border: 1px solid color-mix(in srgb, #8b5cf6 38%, var(--border));
  border-radius: 18px;
  background: linear-gradient(155deg, color-mix(in srgb, #a78bfa 13%, var(--surface)), var(--surface) 72%);
  box-shadow: 0 18px 48px rgba(76, 29, 149, .22), 0 0 0 4px color-mix(in srgb, #8b5cf6 7%, transparent), 0 0 42px rgba(124, 58, 237, .18);
  animation: ai-thinking-float 2.6s ease-in-out infinite;
}
.compose-ai-thinking-card strong { font-family: var(--font-display); font-size: .9rem; color: var(--text); }
.compose-ai-thinking-card > span { font-size: .68rem; line-height: 1.5; color: var(--text-3); }
.ai-writing-animation { width: 140px; height: 96px; margin-bottom: 0; filter: drop-shadow(0 5px 10px rgba(109, 40, 217, .18)); }
.ai-writing-animation svg { width: 100%; height: 100%; overflow: visible; }
.ai-writing-line { fill: none; stroke: #a78bfa; stroke-width: 3; stroke-linecap: round; stroke-dasharray: 4 10; animation: ai-writing-line 1.15s linear infinite; }
.ai-writing-hand { transform-box: fill-box; transform-origin: 68% 82%; animation: ai-hand-write 1.05s ease-in-out infinite alternate; }
.ai-hand { fill: color-mix(in srgb, #8b5cf6 18%, #fff); stroke: #7c3aed; stroke-width: 1.4; stroke-linejoin: round; }
.ai-finger { fill: none; stroke: #7c3aed; stroke-width: 1.2; stroke-linecap: round; }
.ai-pen { fill: #6d28d9; stroke: #4c1d95; stroke-width: 1; stroke-linejoin: round; }
.ai-pen-tip { fill: #fbbf24; stroke: #b45309; stroke-width: .8; stroke-linejoin: round; }
.ai-writing-pulse { display: flex; align-items: center; gap: 4px; height: 8px; margin-top: 3px; }
.ai-writing-pulse i { width: 5px; height: 5px; border-radius: 50%; background: #8b5cf6; opacity: .35; animation: ai-writing-dot 1.05s ease-in-out infinite; }
.ai-writing-pulse i:nth-child(2) { animation-delay: .14s; }
.ai-writing-pulse i:nth-child(3) { animation-delay: .28s; }
@keyframes ai-writing-line { to { stroke-dashoffset: -28; } }
@keyframes ai-hand-write { from { transform: translate(-6px, 4px) rotate(-2deg); } to { transform: translate(6px, -4px) rotate(2deg); } }
@keyframes ai-thinking-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-3px); } }
@keyframes ai-writing-dot { 0%, 100% { opacity: .28; transform: translateY(0); } 45% { opacity: 1; transform: translateY(-2px); } }

/* AI reply attachment picker */
.ai-context-overlay { z-index: 230; backdrop-filter: blur(4px); background: rgba(20, 9, 44, .5); }
.ai-context-dialog {
  width: min(640px, 100%);
  display: flex;
  flex-direction: column;
  border: 1px solid color-mix(in srgb, #8b5cf6 42%, var(--border));
  border-radius: 19px;
  background: linear-gradient(160deg, color-mix(in srgb, #a78bfa 8%, var(--surface)), var(--surface) 42%);
  box-shadow: 0 0 0 1px color-mix(in srgb, #8b5cf6 10%, transparent), 0 34px 100px rgba(25, 8, 60, .45), 0 0 64px rgba(124, 58, 237, .24);
}
.ai-context-head { display: flex; align-items: flex-start; gap: 12px; padding: 21px 22px 15px; }
.ai-context-mark { width: 43px; height: 43px; flex: none; display: grid; place-items: center; border-radius: 13px; color: #fff; background: linear-gradient(145deg, #9f7aea, #6d28d9); box-shadow: 0 8px 20px rgba(109, 40, 217, .3); }
.ai-context-mark svg { width: 21px; height: 21px; }
.ai-context-heading { flex: 1; min-width: 0; }
.ai-context-heading .eyebrow { margin: 0 0 2px; color: #7c3aed; font-size: .62rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.ai-context-heading h2 { margin: 0; font-family: var(--font-display); font-size: 1.05rem; }
.ai-context-heading p:not(.eyebrow) { margin: 4px 0 0; font-size: .7rem; line-height: 1.5; color: var(--text-3); }
.ai-context-close { color: var(--text-3); }
.ai-context-body { padding: 0 22px 4px; }
.ai-context-source { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid color-mix(in srgb, #8b5cf6 16%, var(--border)); border-radius: 11px; background: color-mix(in srgb, #8b5cf6 5%, var(--surface)); }
.ai-context-source-icon { width: 30px; height: 30px; flex: none; display: grid; place-items: center; border-radius: 9px; background: var(--surface); color: #7c3aed; border: 1px solid color-mix(in srgb, #8b5cf6 17%, var(--border)); }
.ai-context-source-icon svg { width: 15px; height: 15px; }
.ai-context-source > div { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.ai-context-source strong { font-size: .72rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ai-context-source span:not(.ai-context-source-icon) { font-size: .625rem; color: var(--text-3); }
.ai-context-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 2px 7px; font-size: .625rem; color: var(--text-3); }
.ai-context-select-all { display: inline-flex; align-items: center; gap: 6px; font-weight: 650; color: var(--text-2); cursor: pointer; }
.ai-context-select-all input { accent-color: #7c3aed; width: 13px; height: 13px; }
.ai-context-list { display: flex; flex-direction: column; gap: 6px; max-height: 282px; overflow: auto; padding: 1px; }
.ai-context-file { display: grid; grid-template-columns: 15px 42px minmax(0, 1fr) 20px; align-items: center; gap: 10px; padding: 9px 11px; border: 1px solid var(--border); border-radius: 11px; background: var(--surface); cursor: pointer; transition: border-color .14s, background .14s, box-shadow .14s; }
.ai-context-file:hover { border-color: color-mix(in srgb, #8b5cf6 36%, var(--border)); background: color-mix(in srgb, #8b5cf6 4%, var(--surface)); }
.ai-context-file.is-selected { border-color: color-mix(in srgb, #8b5cf6 56%, var(--border)); background: linear-gradient(100deg, color-mix(in srgb, #8b5cf6 11%, var(--surface)), var(--surface)); box-shadow: 0 0 0 2px color-mix(in srgb, #8b5cf6 8%, transparent); }
.ai-context-file.is-too-large { opacity: .52; cursor: not-allowed; }
.ai-context-file input { accent-color: #7c3aed; width: 14px; height: 14px; margin: 0; opacity: 0; pointer-events: none; }
.ai-context-file:focus-within { outline: 2px solid color-mix(in srgb, #7c3aed 55%, transparent); outline-offset: 2px; }
.ai-context-file-mark { width: 42px; height: 38px; display: grid; place-items: center; border-radius: 8px; font-size: .54rem; font-weight: 850; letter-spacing: .02em; color: #7c3aed; background: color-mix(in srgb, #8b5cf6 12%, var(--surface)); }
.ai-context-file-mark[data-kind="pdf"] { color: #b42318; background: var(--danger-soft); }
.ai-context-file-mark[data-kind="doc"], .ai-context-file-mark[data-kind="docx"] { color: #1d4ed8; background: var(--accent-soft); }
.ai-context-file-mark[data-kind="xls"], .ai-context-file-mark[data-kind="xlsx"], .ai-context-file-mark[data-kind="csv"] { color: #15803d; background: var(--success-soft); }
.ai-context-file-mark[data-kind="image"] { color: #a21caf; background: color-mix(in srgb, #d946ef 12%, var(--surface)); }
.ai-context-file-copy { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.ai-context-file-copy strong { font-size: .72rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ai-context-file-copy span { font-size: .59375rem; color: var(--text-3); }
.ai-context-file-check { width: 18px; height: 18px; display: grid; place-items: center; border-radius: 50%; border: 1px solid var(--border-strong); color: transparent; }
.ai-context-file-check svg { width: 11px; height: 11px; }
.ai-context-file.is-selected .ai-context-file-check { border-color: #7c3aed; background: #7c3aed; color: #fff; }
.ai-context-budget { margin: 12px 0 14px; padding: 10px 12px; border-radius: 11px; background: var(--surface-2); border: 1px solid var(--border); }
.ai-context-budget-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: .625rem; color: var(--text-3); }
.ai-context-budget-head strong { color: var(--text-2); font-variant-numeric: tabular-nums; }
.ai-context-meter { height: 5px; margin: 7px 0 8px; border-radius: 999px; background: color-mix(in srgb, #8b5cf6 13%, var(--surface-3)); overflow: hidden; }
.ai-context-meter span { display: block; width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #a78bfa, #7c3aed); transition: width .18s ease; }
.ai-context-meter.is-over span { background: linear-gradient(90deg, #f97316, #dc2626); }
.ai-context-budget p { margin: 0; font-size: .59375rem; line-height: 1.5; color: var(--text-3); }
.ai-context-budget p.is-error { color: var(--danger); font-weight: 600; }
.ai-context-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 22px 19px; border-top: 1px solid color-mix(in srgb, #8b5cf6 12%, var(--border)); }
.ai-context-foot .btn-primary { min-width: 130px; }
.ai-context-foot .btn-primary:disabled { opacity: .48; cursor: not-allowed; }

/* Attachments available inside the regular AI writing assistant. */
.compose-ai-attachments { margin-top: 11px; padding-top: 10px; border-top: 1px dashed color-mix(in srgb, #8b5cf6 22%, var(--border)); }
.compose-ai-attachments-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin-bottom: 7px; }
.compose-ai-attachments-head > div { min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.compose-ai-attachments-head strong { font-size: .67rem; color: var(--text-2); }
.compose-ai-attachments-head span { font-size: .59375rem; color: var(--text-3); }
.compose-ai-select-all { display: inline-flex; align-items: center; gap: 5px; flex: none; font-size: .59375rem; color: var(--text-3); cursor: pointer; }
.compose-ai-select-all input { accent-color: #7c3aed; width: 12px; height: 12px; }
.compose-ai-attachment-list { display: flex; flex-direction: column; gap: 4px; max-height: 136px; overflow: auto; }
.compose-ai-attachment { display: grid; grid-template-columns: 13px 31px minmax(0, 1fr) 17px; align-items: center; gap: 7px; padding: 6px 8px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); cursor: pointer; }
.compose-ai-attachment:hover { border-color: color-mix(in srgb, #8b5cf6 34%, var(--border)); }
.compose-ai-attachment.is-selected { border-color: color-mix(in srgb, #8b5cf6 48%, var(--border)); background: color-mix(in srgb, #8b5cf6 7%, var(--surface)); }
.compose-ai-attachment.is-too-large { opacity: .5; cursor: not-allowed; }
.compose-ai-attachment input { accent-color: #7c3aed; width: 12px; height: 12px; margin: 0; opacity: 0; pointer-events: none; }
.compose-ai-attachment:focus-within { outline: 2px solid color-mix(in srgb, #7c3aed 48%, transparent); outline-offset: 1px; }
.compose-ai-attachment-mark { width: 31px; height: 28px; display: grid; place-items: center; border-radius: 6px; background: color-mix(in srgb, #8b5cf6 11%, var(--surface)); color: #7c3aed; font-size: .49rem; font-weight: 800; }
.compose-ai-attachment-mark[data-kind="pdf"] { color: #b42318; background: var(--danger-soft); }
.compose-ai-attachment-mark[data-kind="doc"], .compose-ai-attachment-mark[data-kind="docx"] { color: #1d4ed8; background: var(--accent-soft); }
.compose-ai-attachment-mark[data-kind="xls"], .compose-ai-attachment-mark[data-kind="xlsx"], .compose-ai-attachment-mark[data-kind="csv"] { color: #15803d; background: var(--success-soft); }
.compose-ai-attachment-mark[data-kind="image"] { color: #a21caf; background: color-mix(in srgb, #d946ef 12%, var(--surface)); }
.compose-ai-attachment-copy { min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.compose-ai-attachment-copy strong { font-size: .64rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.compose-ai-attachment-copy span { font-size: .56rem; color: var(--text-3); }
.compose-ai-attachment-tick { width: 16px; height: 16px; display: grid; place-items: center; border: 1px solid var(--border-strong); border-radius: 50%; color: transparent; }
.compose-ai-attachment-tick svg { width: 10px; height: 10px; }
.compose-ai-attachment.is-selected .compose-ai-attachment-tick { border-color: #7c3aed; background: #7c3aed; color: #fff; }
.compose-ai-attachment-budget { margin-top: 5px; font-size: .56rem; color: var(--text-3); }
.compose-ai-attachment-budget.is-over { color: var(--danger); font-weight: 650; }

@media (max-width: 719px) {
  .ai-context-overlay { padding: 10px; }
  .ai-context-dialog { max-height: calc(100dvh - 20px); }
  .ai-context-head { padding: 16px 16px 12px; }
  .ai-context-body { padding: 0 16px 2px; }
  .ai-context-file { grid-template-columns: 14px 37px minmax(0, 1fr) 18px; gap: 8px; }
  .ai-context-file-mark { width: 37px; height: 34px; }
  .ai-context-foot { padding: 12px 16px 16px; }
  .ai-context-foot .btn-secondary, .ai-context-foot .btn-primary { flex: 1; }
  .preview-nav-btn span { display: none; }
  .preview-nav-btn { width: 29px; padding: 0; justify-content: center; }
  .preview-nav-count { min-width: 46px; }
}
@media (prefers-reduced-motion: reduce) {
  .ai-writing-line, .ai-writing-hand, .ai-writing-pulse i, .compose-ai-thinking-card { animation: none; }
}

.compose-file-grid { display: flex; flex-direction: row; flex-wrap: nowrap; gap: 8px; padding: 0 14px 12px; overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: thin; }
.compose-file-card { flex: 0 0 228px; min-width: 0; display: grid; grid-template-columns: 34px minmax(0,1fr) auto; align-items: center; gap: 9px; padding: 7px 9px; border: 1px solid var(--border); border-radius: 9px; background: var(--surface-2); cursor: pointer; transition: border-color .15s, background .15s; }
.compose-file-card.is-previewable:hover, .compose-file-card.is-previewable:focus-visible, .compose-file-card:focus-visible { border-color: var(--accent); background: var(--accent-soft); outline: 0; }
.compose-file-card .file-art { width: 34px; height: 34px; border-radius: 8px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-ink); }
.compose-file-card .file-art svg { width: 16px; height: 16px; }
.compose-file-card .file-copy { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.compose-file-card .file-copy strong { font-size: .72rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.compose-file-card .file-copy span { font-size: .64rem; color: var(--text-3); }
.compose-file-card .file-remove { width: 24px; height: 24px; border: 0; border-radius: 6px; background: transparent; color: var(--text-3); cursor: pointer; }
.compose-file-card .file-remove:hover { background: var(--danger-soft); color: var(--danger); }

.compose-attach-overlay { z-index: 220; }
.compose-attach-dialog { width: min(860px, calc(100vw - 32px)); max-height: min(840px, calc(100dvh - 32px)); display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border-strong); border-radius: 16px; box-shadow: 0 32px 90px rgba(7, 20, 36, .48); overflow: hidden; }
.compose-attach-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 16px 20px; background: var(--header-bg); color: var(--header-text); }
.compose-attach-title { display: flex; align-items: center; gap: 12px; }
.compose-attach-icon { width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; background: rgba(255,255,255,.12); }
.compose-attach-title h2 { margin: 2px 0 0; font-size: 1rem; }
.compose-attach-title .eyebrow { margin: 0; color: var(--header-muted); }
.compose-attach-head .icon-btn { color: #fff; }
.compose-attach-body { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; padding: 18px 20px; overflow: auto; }
.compose-dropzone { grid-column: 1 / -1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 7px; min-height: 150px; padding: 22px; border: 1.5px dashed var(--border-strong); border-radius: 13px; background: var(--surface-2); text-align: center; transition: border-color .15s, background .15s; }
.compose-dropzone.is-over, .compose-dropzone:focus-visible { border-color: var(--accent); background: var(--accent-soft); outline: 0; }
.compose-dropzone-art { width: 44px; height: 44px; border-radius: 13px; display: grid; place-items: center; background: var(--surface); border: 1px solid var(--border); color: var(--accent-ink); }
.compose-dropzone-art svg { width: 21px; height: 21px; }
.compose-dropzone strong { font-size: .86rem; }
.compose-dropzone > span:not(.compose-dropzone-art) { font-size: .7rem; color: var(--text-3); max-width: 360px; }
.compose-dropzone .btn-secondary { margin-top: 7px; }
.compose-attach-files, .compose-attach-current { min-width: 0; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.compose-attach-files-head, .compose-attach-current-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px; background: var(--surface-2); border-bottom: 1px solid var(--border); font-size: .66rem; color: var(--text-3); }
.compose-attach-current-head strong { font-size: .7rem; color: var(--text); }
.compose-attach-tabs { display: flex; gap: 3px; }
.compose-attach-tabs button { border: 0; background: transparent; color: var(--text-3); font: inherit; font-size: .67rem; font-weight: 600; padding: 4px 7px; border-radius: 6px; cursor: pointer; }
.compose-attach-tabs button.is-active { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.compose-attach-file-list { max-height: 220px; overflow: auto; padding: 6px; }
.compose-attach-current-list { display: flex; flex-direction: column; gap: 2px; max-height: 220px; overflow-x: hidden; overflow-y: auto; padding: 6px; }
.compose-attach-current-list .compose-file-card { flex: 0 0 auto; width: 100%; padding: 7px 8px; border-color: transparent; border-radius: 8px; background: transparent; }
.compose-attach-current-list .compose-file-card:hover,
.compose-attach-current-list .compose-file-card:focus-visible { border-color: transparent; background: var(--surface-2); }
.compose-attach-current-list .compose-file-card .file-copy strong { font-size: .7rem; }
.compose-attach-current-list > .settings-note { padding: 12px 8px; }
.compose-attach-pick { width: 100%; display: grid; grid-template-columns: 31px minmax(0,1fr) auto; gap: 8px; align-items: center; padding: 7px; border: 0; border-radius: 8px; background: transparent; color: var(--text); text-align: start; cursor: pointer; }
.compose-attach-pick:hover { background: var(--surface-2); }
.compose-attach-pick .file-art { width: 31px; height: 31px; border-radius: 8px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-ink); }
.compose-attach-pick .file-art svg { width: 14px; height: 14px; }
.compose-attach-pick .file-copy { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.compose-attach-pick .file-copy strong { font-size: .7rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.compose-attach-pick .file-copy span { font-size: .62rem; color: var(--text-3); }
.compose-attach-pick .file-add { color: var(--accent-ink); font-size: .65rem; font-weight: 650; }
.compose-attach-current-list .compose-file-card { background: var(--surface); }
.compose-upload-progress { padding: 10px 20px 12px; border-top: 1px solid var(--border); background: var(--surface); }
.compose-upload-progress[hidden] { display: none !important; }
.compose-upload-progress-copy { display: flex; align-items: center; gap: 8px; margin-bottom: 7px; font-size: .68rem; color: var(--text-2); }
.compose-upload-progress-copy #composeUploadLabel { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.compose-upload-progress-copy strong { margin-inline-start: auto; color: var(--text); font-variant-numeric: tabular-nums; }
.compose-upload-spinner { width: 14px; height: 14px; flex: 0 0 14px; border-radius: 50%; border: 2px solid var(--border-strong); border-top-color: var(--accent); animation: compose-upload-spin .8s linear infinite; }
.compose-upload-track { height: 6px; overflow: hidden; border-radius: 999px; background: var(--surface-3, var(--surface-2)); }
.compose-upload-track span { display: block; width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--accent), color-mix(in srgb, var(--accent) 55%, #22d3ee)); transition: width .15s ease; }
@keyframes compose-upload-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .compose-upload-spinner { animation: none; }
  .compose-upload-track span { transition: none; }
}
.compose-attach-foot { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px 20px; border-top: 1px solid var(--border); background: var(--surface-2); }
.compose-attach-footnote { display: inline-flex; align-items: center; gap: 6px; font-size: .66rem; color: var(--text-3); }
.compose-attach-footnote svg { width: 14px; height: 14px; }

.identity-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.identity-card { display: grid; grid-template-columns: 38px minmax(0,1fr) auto; gap: 11px; align-items: center; padding: 11px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); }
.identity-card.is-pending { border-color: color-mix(in srgb, var(--warning) 35%, var(--border)); background: color-mix(in srgb, var(--warning-soft) 45%, var(--surface)); }
.identity-art { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-ink); }
.identity-copy { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.identity-copy strong { font-size: .78rem; }
.identity-copy span { font-size: .68rem; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.identity-actions { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.identity-status { font-size: .61rem; font-weight: 750; text-transform: uppercase; letter-spacing: .05em; padding: 3px 7px; border-radius: 99px; background: var(--success-soft); color: var(--success); }
.identity-status.pending { background: var(--warning-soft); color: var(--warning); }
.identity-add-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.identity-add-grid .form-field:last-child { grid-column: 1 / -1; }
.forwarding-date-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 8px 0 4px; }
.identity-card.is-default { border-color: color-mix(in srgb, var(--accent) 30%, var(--border)); }
.identity-default-badge { display: inline-flex; align-items: center; gap: 4px; margin-inline-start: 7px; padding: 2px 6px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-ink); font-size: .56rem; font-weight: 750; text-transform: uppercase; letter-spacing: .04em; vertical-align: 1px; }
.identity-default-badge svg { width: 10px; height: 10px; }
.identity-default-row { display: grid; grid-template-columns: 36px minmax(0,1fr) auto; gap: 11px; align-items: center; margin: 4px 0 12px; padding: 11px 12px; border: 1px solid var(--border); border-radius: 11px; background: var(--surface-2); }
.identity-default-glyph { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--surface); border: 1px solid var(--border); color: var(--accent-ink); }
.identity-default-glyph svg { width: 16px; height: 16px; }
.identity-default-copy { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.identity-default-copy strong { font-size: .74rem; }
.identity-default-copy span { font-size: .67rem; color: var(--text-3); }
.identity-signature-field { margin-top: 4px; padding: 12px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-2); }
.identity-signature-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 9px; }
.identity-field-label { display: block; font-size: .73rem; font-weight: 650; color: var(--text); }
.identity-signature-head p { margin: 2px 0 0; font-size: .66rem; color: var(--text-3); }
.identity-signature-picker { display: flex; flex-direction: column; gap: 6px; max-height: 224px; overflow: auto; }
.identity-signature-option { display: grid; grid-template-columns: 18px minmax(0,1fr) auto; gap: 9px; align-items: center; width: 100%; padding: 8px 10px; border: 1px solid var(--border); border-radius: 9px; background: var(--surface); color: var(--text); text-align: start; font: inherit; cursor: pointer; transition: border-color .15s, background .15s; }
.identity-signature-option:hover { border-color: color-mix(in srgb, var(--accent) 40%, var(--border)); }
.identity-signature-option.is-selected { border-color: var(--accent); background: var(--accent-soft); }
.identity-signature-radio { width: 18px; height: 18px; display: grid; place-items: center; border: 1px solid var(--border-strong); border-radius: 50%; color: transparent; background: var(--surface); }
.identity-signature-radio svg { width: 11px; height: 11px; }
.identity-signature-option.is-selected .identity-signature-radio { border-color: var(--accent); background: var(--accent); color: #fff; }
.identity-signature-option-copy { min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.identity-signature-option-copy strong { font-size: .71rem; }
.identity-signature-option-copy small { font-size: .63rem; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.identity-signature-badge { padding: 2px 6px; border-radius: 999px; background: var(--surface-3, var(--surface-2)); border: 1px solid var(--border); color: var(--text-3); font-size: .55rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.identity-signature-empty { display: grid; grid-template-columns: 36px minmax(0,1fr) auto; gap: 11px; align-items: center; padding: 10px 11px; border: 1px dashed var(--border-strong); border-radius: 9px; background: var(--surface); }
.identity-signature-empty strong { display: block; font-size: .71rem; }
.identity-signature-empty p { margin: 2px 0 0; font-size: .63rem; color: var(--text-3); }
.forwarding-panel { display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: 13px; background: var(--surface); overflow: hidden; }
.forwarding-enable-row { display: grid; grid-template-columns: 38px minmax(0,1fr) auto; gap: 11px; align-items: center; padding: 13px 14px; background: var(--surface-2); border-bottom: 1px solid var(--border); }
.forwarding-glyph { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; background: var(--surface); border: 1px solid var(--border); color: var(--accent-ink); }
.forwarding-glyph svg { width: 17px; height: 17px; }
.forwarding-enable-copy { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.forwarding-enable-copy strong { font-size: .78rem; }
.forwarding-enable-copy span { font-size: .67rem; color: var(--text-3); }
.forwarding-target-field { padding: 13px 14px 12px; border-bottom: 1px solid var(--border); }
.forwarding-field-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.forwarding-field-head label { font-size: .68rem; font-weight: 650; color: var(--text-2); }
.forwarding-field-head span { font-size: .61rem; color: var(--text-3); }
.forwarding-address-field { display: grid; grid-template-columns: 20px minmax(0,1fr) auto; gap: 8px; align-items: center; padding: 0 11px; min-height: 40px; border: 1px solid var(--border-strong); border-radius: 10px; background: var(--surface); transition: border-color .15s, box-shadow .15s; }
.forwarding-address-field:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 16%, transparent); }
.forwarding-address-field > svg { width: 16px; height: 16px; color: var(--text-3); }
.forwarding-address-field input { width: 100%; min-width: 0; border: 0; background: transparent; color: var(--text); font: inherit; font-size: .76rem; outline: 0; padding: 9px 0; }
.forwarding-address-field input::placeholder { color: var(--text-3); }
.forwarding-address-field.is-error { border-color: var(--danger); box-shadow: 0 0 0 3px color-mix(in srgb, var(--danger) 14%, transparent); }
.forwarding-address-clear { width: 24px; height: 24px; display: grid; place-items: center; border: 0; border-radius: 6px; background: transparent; color: var(--text-3); cursor: pointer; }
.forwarding-address-clear:hover { background: var(--surface-2); color: var(--text); }
.forwarding-address-clear svg { width: 13px; height: 13px; }
.forwarding-recipient-preview { display: grid; grid-template-columns: 30px minmax(0,1fr) auto; gap: 9px; align-items: center; margin-top: 8px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 9px; background: var(--surface-2); }
.forwarding-recipient-avatar { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; background: var(--accent-soft); color: var(--accent-ink); font-size: .7rem; font-weight: 700; }
.forwarding-recipient-copy { min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.forwarding-recipient-copy strong { font-size: .7rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.forwarding-recipient-copy small { font-size: .6rem; color: var(--text-3); }
.forwarding-recipient-state { padding: 2px 7px; border-radius: 999px; background: var(--success-soft); color: var(--success); font-size: .56rem; font-weight: 750; text-transform: uppercase; letter-spacing: .04em; }
.forwarding-recipient-preview.is-invalid { border-color: color-mix(in srgb, var(--danger) 35%, var(--border)); }
.forwarding-recipient-preview.is-invalid .forwarding-recipient-avatar { background: var(--danger-soft); color: var(--danger); }
.forwarding-recipient-preview.is-invalid .forwarding-recipient-state { background: var(--danger-soft); color: var(--danger); }
.forwarding-field-error { margin: 7px 0 0; font-size: .64rem; color: var(--danger); }
.forwarding-options { padding: 4px 14px 6px; }
.forwarding-options .setting-row { padding: 10px 0; }
.forwarding-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 11px 14px 12px; border-top: 1px solid var(--border); background: var(--surface-2); }
.forwarding-actions .settings-note { margin: 0; }
.forwarding-panel.is-off .forwarding-target-field,
.forwarding-panel.is-off .forwarding-options { opacity: .62; }
.forwarding-panel.is-off .forwarding-target-field { background: color-mix(in srgb, var(--surface-2) 60%, var(--surface)); }
#signatureEditorOverlay.is-stacked { z-index: 97; }
#htmlSourceOverlay { z-index: 150; }
.app-password-layout { display: grid; grid-template-columns: minmax(0,1.15fr) minmax(280px,.85fr); gap: 16px; align-items: start; }
.app-password-history, .app-password-create { border: 1px solid var(--border); border-radius: 11px; background: var(--surface); padding: 13px; }
.app-password-subhead { display: flex; justify-content: space-between; gap: 10px; align-items: center; margin-bottom: 8px; font-size: .68rem; color: var(--text-3); }
.app-password-subhead strong { font-size: .72rem; color: var(--text); }
.app-password-list { gap: 7px; }
.app-password-item { display: grid; grid-template-columns: 30px minmax(0,1fr) auto; gap: 9px; align-items: center; padding: 8px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface-2); }
.app-password-item.is-inactive { opacity: .68; }
.app-password-item .session-icon { width: 30px; height: 30px; }
.app-password-item .pref-copy strong { font-size: .72rem; }
.app-password-item .pref-copy span { font-size: .63rem; line-height: 1.4; }
.app-password-item .app-password-status { font-size: .58rem; font-weight: 750; text-transform: uppercase; letter-spacing: .05em; padding: 2px 6px; border-radius: 99px; background: var(--success-soft); color: var(--success); }
.app-password-item .app-password-status.expired, .app-password-item .app-password-status.revoked { background: var(--surface-3); color: var(--text-3); }
.app-password-item .link-btn { font-size: .65rem; }
.app-password-create-head { display: flex; gap: 9px; align-items: center; margin-bottom: 11px; }
.app-password-art { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-ink); }
.app-password-create-head div { display: flex; flex-direction: column; gap: 2px; }
.app-password-create-head strong { font-size: .75rem; }
.app-password-create-head span { font-size: .63rem; color: var(--text-3); }
.app-password-create .form-field { margin-bottom: 8px; }
.app-password-token { margin-top: 14px; padding: 12px 14px; border: 1px solid color-mix(in srgb, var(--success) 35%, var(--border)); border-radius: 10px; background: var(--success-soft); font-size: .74rem; color: var(--text-2); overflow-wrap: anywhere; }
.app-password-token code { display: inline-block; margin-top: 7px; padding: 6px 8px; background: var(--surface); border: 1px solid var(--border); border-radius: 6px; font-family: var(--font-mono); user-select: all; }

@media (max-width: 760px) {
  .compose-attach-body { grid-template-columns: 1fr; }
  .compose-ai-grid { grid-template-columns: 1fr; }
  .app-password-layout, .identity-add-grid { grid-template-columns: 1fr; }
  .notice-layer { padding: 0; }
  .notice-window { max-height: 100dvh; height: 100dvh; border-radius: 0; border: 0; }
  .notify-pop { width: calc(100vw - 20px); }
  .compose-editor-toolbar { overflow-x: auto; flex-wrap: nowrap; }
  .compose-editor-toolbar button, .compose-editor-toolbar select, .compose-editor-toolbar .editor-color-wrap { flex: none; }
  .ai-reader-menu { width: min(278px, calc(100vw - 24px)); }
}
.notify-count[hidden], .ai-reader-split[hidden], .notice-layer[hidden], .compose-attach-overlay[hidden], .forwarding-date-grid[hidden], .compose-ai-panel[hidden], .ai-reader-menu[hidden], .app-password-token[hidden] { display: none !important; }
.boot-splash[hidden] { display: none !important; }

/* ---------- About / mail client setup ---------- */
.about-highlights { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 16px; }
.about-highlight { display: flex; gap: 10px; padding: 12px; border: 1px solid var(--border); border-radius: 11px; background: var(--surface-2); }
.about-highlight-icon { width: 32px; height: 32px; flex: none; display: grid; place-items: center; border-radius: 9px; background: var(--accent-soft); color: var(--accent-ink); }
.about-highlight-icon svg { width: 16px; height: 16px; }
.about-highlight div { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.about-highlight strong { font-size: .72rem; }
.about-highlight span { font-size: .65rem; line-height: 1.5; color: var(--text-3); }
.mail-client-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 13px; }
.mail-client-card { display: flex; flex-direction: column; gap: 8px; padding: 13px; border: 1px solid var(--border); border-radius: 11px; background: var(--surface); }
.mail-client-card.recommended { border-color: color-mix(in srgb, var(--accent) 35%, var(--border)); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 12%, transparent); }
.mail-client-card-head { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.mail-client-protocol { font-size: .62rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--accent-ink); }
.mail-client-recommended { font-size: .55rem; font-weight: 750; text-transform: uppercase; letter-spacing: .04em; padding: 2px 6px; border-radius: 99px; background: var(--accent-soft); color: var(--accent-ink); }
.mail-client-host { font-family: var(--font-mono); font-size: .84rem; overflow-wrap: anywhere; }
.mail-client-fields { margin: 0; display: grid; gap: 5px; }
.mail-client-fields div { display: flex; justify-content: space-between; gap: 8px; font-size: .66rem; }
.mail-client-fields dt { color: var(--text-3); }
.mail-client-fields dd { margin: 0; font-weight: 600; text-align: end; overflow-wrap: anywhere; }
.mail-client-label { margin-top: auto; padding-top: 7px; border-top: 1px solid var(--border); font-size: .6rem; color: var(--text-3); }
.mail-client-steps { margin: 15px 0 0; padding-inline-start: 1.25em; display: grid; gap: 7px; font-size: .72rem; line-height: 1.55; color: var(--text-2); }
.mail-client-steps strong { color: var(--text); }
.mail-client-note { margin: 13px 0 0; padding: 9px 11px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface-2); font-size: .66rem; line-height: 1.5; color: var(--text-3); }
@media (max-width: 860px) {
  .about-highlights, .mail-client-grid { grid-template-columns: 1fr; }
}

/* Ambient intelligence: catch-up, thread memory, tone and trust */
.catchup-card {
  display: flex;
  align-items: center;
  gap: 11px;
  margin: 0 0 6px;
  padding: 11px 12px;
  border: 1px solid color-mix(in srgb, #8b5cf6 28%, var(--border));
  border-radius: 12px;
  background: linear-gradient(135deg, color-mix(in srgb, #8b5cf6 8%, var(--surface)), var(--surface) 68%);
}
.catchup-icon {
  width: 30px;
  height: 30px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: color-mix(in srgb, #8b5cf6 14%, var(--surface));
  color: #7c3aed;
}
.catchup-icon svg { width: 16px; height: 16px; }
.catchup-copy { flex: 1; min-width: 0; }
.catchup-kicker {
  display: block;
  font-size: .52rem;
  font-weight: 750;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: #7c3aed;
}
.catchup-copy strong { display: block; margin-top: 1px; font-size: .76rem; color: var(--text); }
.catchup-copy p { margin: 2px 0 0; font-size: .65rem; line-height: 1.45; color: var(--text-2); }
.catchup-actions { display: flex; align-items: center; gap: 5px; flex: none; }
.ai-commitment-list { display: flex; flex-direction: column; gap: 7px; }
.ai-commitment-item {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--surface);
  color: var(--text);
  text-align: start;
  cursor: pointer;
  font: inherit;
}
.ai-commitment-item:hover { border-color: color-mix(in srgb, #8b5cf6 45%, var(--border)); background: color-mix(in srgb, #8b5cf6 5%, var(--surface)); }
.ai-commitment-kind {
  padding: 1px 6px;
  border-radius: 999px;
  font-size: .5rem;
  font-weight: 750;
  letter-spacing: .06em;
  text-transform: uppercase;
  background: var(--surface-3);
  color: var(--text-2);
}
.ai-commitment-kind.is-deadline { color: #9a6700; background: color-mix(in srgb, #f59e0b 16%, transparent); }
.ai-commitment-kind.is-request { color: #1d4ed8; background: color-mix(in srgb, #3b82f6 14%, transparent); }
.ai-commitment-kind.is-promise { color: #6d28d9; background: color-mix(in srgb, #8b5cf6 14%, transparent); }
.ai-commitment-item strong { font-size: .76rem; line-height: 1.4; }
.ai-commitment-quote { font-size: .68rem; line-height: 1.45; color: var(--text-2); font-style: italic; }
.ai-commitment-item small { font-size: .58rem; color: var(--text-3); }
.ai-commitment-empty { margin: 0; font-size: .74rem; color: var(--text-2); }
.ai-commitment-highlight {
  padding: 0 1px;
  border-radius: 2px;
  background: color-mix(in srgb, #facc15 42%, transparent);
  color: inherit;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}
.thread-msg.is-ai-commitment-target { box-shadow: 0 0 0 2px color-mix(in srgb, #8b5cf6 48%, transparent); }
.compose-tone-chip {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  max-width: 180px;
  padding: 2px 8px;
  border: 1px solid color-mix(in srgb, #8b5cf6 34%, var(--header-line));
  border-radius: 999px;
  background: var(--header-field);
  color: #c4b5fd;
  font-size: .55rem;
  font-weight: 650;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
}
.compose-tone-chip svg { width: 11px; height: 11px; flex: none; }
.compose-tone-chip[hidden] { display: none !important; }
.trust-explanation {
  margin: 12px 0 4px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-2);
}
.trust-explanation-head { display: flex; align-items: flex-start; gap: 9px; }
.trust-explanation-icon {
  width: 27px;
  height: 27px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--surface);
  color: var(--accent-ink);
}
.trust-explanation-icon svg { width: 15px; height: 15px; }
.trust-explanation-head strong { display: block; font-size: .72rem; color: var(--text); }
.trust-explanation-head span { display: block; margin-top: 1px; font-size: .6rem; color: var(--text-3); }
.trust-explanation ul { margin: 8px 0 0; padding-inline-start: 17px; display: grid; gap: 3px; font-size: .66rem; line-height: 1.5; color: var(--text-2); }
@media (max-width: 719px) {
  .catchup-card { flex-wrap: wrap; margin: 0 0 5px; }
  .catchup-actions { width: 100%; justify-content: flex-end; }
  .compose-tone-chip { display: none; }
}
.catchup-host:empty { display: none; }
.catchup-host { padding: 8px 8px 0; }
.thread-ai-row { display: flex; margin: 0 0 10px; }
.thread-ai-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 10px;
  border: 1px solid color-mix(in srgb, #8b5cf6 30%, var(--border));
  border-radius: 999px;
  background: color-mix(in srgb, #8b5cf6 6%, var(--surface));
  color: #7c3aed;
  font: inherit;
  font-size: .66rem;
  font-weight: 650;
  cursor: pointer;
}
.thread-ai-chip:hover { background: color-mix(in srgb, #8b5cf6 11%, var(--surface)); }
.thread-ai-chip svg { width: 14px; height: 14px; flex: none; }
.thread-ai-chip small { font-size: .56rem; font-weight: 500; color: var(--text-3); }
.catchup-trigger { color: #7c3aed !important; }
.compose-intent-check {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-inline-start: auto;
  padding: 2px 6px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: var(--text-3);
  font: inherit;
  font-size: .56rem;
  font-weight: 600;
  cursor: pointer;
}
.compose-intent-check:hover { border-color: var(--border); background: var(--surface-2); color: var(--text-2); }
.compose-intent-check svg { width: 12px; height: 12px; }
@media (max-width: 719px) {
  .thread-ai-chip small { display: none; }
  .compose-intent-check { display: none; }
}
/* Collaboration inside conversations */
.thread-collab-bar {
  display: flex;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 7px 10px;
  margin: 0 0 12px;
  padding: 9px 10px;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: var(--surface-2);
}
.collab-field { display: flex; flex-direction: column; gap: 2px; min-width: 126px; }
.collab-field > span { font-size: .52rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); }
.collab-field select {
  height: 27px;
  padding: 0 24px 0 7px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--surface);
  color: var(--text-2);
  font: inherit;
  font-size: .65rem;
}
.collab-action {
  height: 27px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 0 8px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--surface);
  color: var(--text-2);
  font: inherit;
  font-size: .63rem;
  font-weight: 600;
  cursor: pointer;
}
.collab-action:hover { border-color: var(--accent); color: var(--accent-ink); }
.collab-action.is-reopen { border-color: color-mix(in srgb, #16a34a 35%, var(--border)); color: #15803d; }
.collab-action svg { width: 13px; height: 13px; }
.collab-chip { display: inline-flex; align-items: center; gap: 4px; height: 24px; padding: 0 8px; border-radius: 999px; font-size: .55rem; font-weight: 700; }
.collab-chip.is-closed { color: #15803d; background: color-mix(in srgb, #16a34a 12%, transparent); }
.collab-chip svg { width: 12px; height: 12px; }
.thread-notes-panel {
  margin: -4px 0 13px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  overflow: hidden;
}
.thread-notes-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; padding: 9px 11px; background: var(--surface-2); }
.thread-notes-head strong { display: block; font-size: .7rem; }
.thread-notes-head span { display: block; margin-top: 1px; font-size: .57rem; color: var(--text-3); }
.thread-notes-list { display: flex; flex-direction: column; max-height: 230px; overflow-y: auto; }
.thread-note { padding: 8px 11px; border-top: 1px solid var(--border); }
.thread-note-head { display: flex; align-items: center; gap: 7px; }
.thread-note-head strong { font-size: .62rem; }
.thread-note-head time { margin-inline-start: auto; font-size: .55rem; color: var(--text-3); }
.thread-note-delete { width: 22px !important; height: 22px !important; opacity: .45; }
.thread-note:hover .thread-note-delete { opacity: 1; }
.thread-note p { margin: 3px 0 0; font-size: .68rem; line-height: 1.5; color: var(--text-2); white-space: pre-wrap; }
.thread-notes-empty, .thread-notes-loading { padding: 12px; margin: 0; font-size: .65rem; color: var(--text-3); }
.thread-note-form { display: flex; align-items: flex-end; gap: 6px; padding: 8px 10px; border-top: 1px solid var(--border); }
.thread-note-form textarea { flex: 1; min-height: 32px; max-height: 120px; resize: vertical; padding: 6px 8px; border: 1px solid var(--border); border-radius: 7px; background: var(--surface-2); color: var(--text); font: inherit; font-size: .66rem; }
.msg-snippet-row { display: flex; align-items: center; gap: 6px; min-width: 0; }
.msg-snippet-row .msg-snippet { flex: 1; min-width: 0; }
.msg-collab-chips { display: inline-flex; align-items: center; gap: 3px; min-width: 0; flex: none; }
.app[data-density="compact"] .msg-collab-chips { display: none; }
.msg-collab-assignee { width: 17px; height: 17px; display: inline-grid; place-items: center; border-radius: 50%; background: color-mix(in srgb, #3b82f6 16%, var(--surface-3)); color: #1d4ed8; font-size: .45rem; font-weight: 750; }
.msg-collab-status { display: inline-flex; align-items: center; gap: 2px; padding: 1px 4px; border-radius: 3px; font-size: .48rem; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; background: var(--surface-3); color: var(--text-3); }
.msg-collab-status.is-progress { color: #9a6700; background: color-mix(in srgb, #f59e0b 14%, transparent); }
.msg-collab-status.is-done { color: #15803d; background: color-mix(in srgb, #16a34a 13%, transparent); }
.msg-collab-status.is-closed { color: var(--text-2); }
.msg-collab-status svg { width: 10px; height: 10px; }
.compose-mention-btn { min-width: 22px; font-weight: 700; }
.compose-mention-menu {
  position: fixed;
  z-index: 700;
  padding: 5px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  box-shadow: var(--shadow-pop);
}
.compose-mention-menu button { width: 100%; display: flex; flex-direction: column; align-items: flex-start; gap: 1px; padding: 7px 9px; border: 0; border-radius: 7px; background: transparent; color: var(--text); text-align: start; cursor: pointer; }
.compose-mention-menu button:hover, .compose-mention-menu button.is-active { background: var(--surface-3); }
.compose-mention-name { font-size: .68rem; font-weight: 650; }
.compose-mention-address { font-size: .58rem; color: var(--text-3); }
@media (max-width: 719px) {
  .thread-collab-bar { gap: 6px; }
  .collab-field { min-width: 0; flex: 1 1 120px; }
  .collab-action { font-size: .58rem; }
}


/* Phase 3 — subscriptions, reactions, yearly review and recipient time */
.subscription-line {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 10px 0 2px;
  padding: 8px 10px;
  border: 1px solid color-mix(in srgb, var(--accent) 24%, var(--border));
  border-radius: 9px;
  background: color-mix(in srgb, var(--accent) 5%, var(--surface-2));
}
.subscription-line.is-done { border-color: color-mix(in srgb, #16a34a 28%, var(--border)); background: color-mix(in srgb, #16a34a 6%, var(--surface-2)); }
.subscription-line.is-failed { border-color: color-mix(in srgb, #dc2626 30%, var(--border)); background: color-mix(in srgb, #dc2626 5%, var(--surface-2)); }
.subscription-icon { width: 26px; height: 26px; display: grid; place-items: center; flex: none; border-radius: 7px; color: var(--accent-ink); background: color-mix(in srgb, var(--accent) 12%, transparent); }
.subscription-icon svg { width: 15px; height: 15px; }
.subscription-copy { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 1px; }
.subscription-copy strong { font-size: .64rem; }
.subscription-copy span { font-size: .57rem; color: var(--text-3); }
.subscription-line .btn-secondary { flex: none; }

.thread-reaction-hint { font-size: .58rem; color: var(--text-2); white-space: nowrap; }
.reaction-bar { display: flex; align-items: center; flex-wrap: wrap; gap: 5px; margin: 8px 0 4px; }
.reaction-chip { display: inline-flex; align-items: center; gap: 3px; height: 25px; padding: 0 7px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface-2); color: var(--text-2); font-size: .66rem; }
.reaction-chip.is-own { border-color: color-mix(in srgb, var(--accent) 38%, var(--border)); background: color-mix(in srgb, var(--accent) 8%, var(--surface)); }
.reaction-chip.is-failed { border-color: color-mix(in srgb, #dc2626 35%, var(--border)); }
.reaction-chip .icon { width: 11px; height: 11px; color: var(--text-3); }
.reaction-chip b { font-size: .58rem; font-weight: 700; }
.reaction-emoji { font-size: .82rem; line-height: 1; }
.reaction-remove { display: grid; place-items: center; width: 17px; height: 17px; margin-inline-start: 1px; padding: 0; border: 0; border-radius: 50%; background: transparent; color: var(--text-3); font-size: .72rem; line-height: 1; cursor: pointer; }
.reaction-remove:hover { background: color-mix(in srgb, #dc2626 12%, transparent); color: #b91c1c; }
.reaction-add { display: inline-flex; align-items: center; gap: 4px; height: 25px; padding: 0 8px; border: 1px dashed var(--border-strong); border-radius: 999px; background: transparent; color: var(--text-3); font: inherit; font-size: .6rem; cursor: pointer; }
.reaction-add:hover { border-color: var(--accent); color: var(--accent-ink); }
.reaction-smile { font-size: .8rem; line-height: 1; }
.reaction-status { display: inline-flex; align-items: center; gap: 3px; font-size: .57rem; color: var(--text-3); }
.reaction-status.is-pending { color: #9a6700; }
.reaction-status.is-failed { color: #b91c1c; }
.reaction-status .icon { width: 11px; height: 11px; }
.reaction-status button { padding: 0; border: 0; background: transparent; color: var(--accent-ink); font: inherit; font-weight: 700; cursor: pointer; text-decoration: underline; }
.reaction-summary { font-variant-emoji: emoji; }

.reaction-menu { position: fixed; z-index: 720; padding: 9px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); box-shadow: var(--shadow-pop); }
.reaction-menu-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.reaction-menu-head strong { font-size: .7rem; }
.reaction-quick { display: flex; gap: 3px; padding: 3px 0 8px; border-bottom: 1px solid var(--border); }
.reaction-quick button { width: 38px; height: 36px; border: 1px solid transparent; border-radius: 8px; background: var(--surface-2); font-size: 1.15rem; cursor: pointer; }
.reaction-quick button:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); background: var(--surface-3); transform: translateY(-1px); }
.reaction-suggestions { padding: 8px 0 2px; }
.reaction-suggestions-label { display: block; margin-bottom: 4px; font-size: .53rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); }
.reaction-suggestions-row { display: flex; flex-wrap: wrap; gap: 4px; }
.reaction-suggestions-row button { display: flex; align-items: center; gap: 4px; padding: 5px 7px; border: 1px solid var(--border); border-radius: 7px; background: var(--surface-2); color: var(--text-2); font: inherit; font-size: .6rem; cursor: pointer; }
.reaction-suggestions-row button:hover { border-color: var(--accent); color: var(--accent-ink); }
.reaction-suggestions-row button:first-child span:first-child { font-size: .85rem; }
.reaction-suggestions-loading, .reaction-suggestions-empty { display: block; padding: 4px 0; font-size: .6rem; color: var(--text-3); }
.reaction-visibility { display: flex; align-items: flex-start; gap: 7px; margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--border); font-size: .6rem; color: var(--text-2); cursor: pointer; }
.reaction-visibility input { margin-top: 2px; }
.reaction-visibility span { display: flex; flex-direction: column; gap: 1px; }
.reaction-visibility small { font-size: .53rem; color: var(--text-3); }

.year-review-overlay { align-items: flex-start; overflow-y: auto; padding: 30px 14px; }
.year-review-dialog { width: min(920px, 100%); max-height: none; }
.year-review-dialog .dialog-body { padding: 0; overflow: visible; }
.year-review-loading { padding: 48px 24px; text-align: center; color: var(--text-3); font-size: .75rem; }
.year-review-teaser { display: flex; align-items: center; gap: 11px; padding: 12px; border: 1px solid color-mix(in srgb, var(--accent) 22%, var(--border)); border-radius: 11px; background: color-mix(in srgb, var(--accent) 5%, var(--surface-2)); }
.year-review-teaser .btn-secondary { margin-inline-start: auto; flex: none; }
.year-review-teaser > div { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.year-review-teaser strong { font-size: .7rem; }
.year-review-teaser span:not(.year-review-mark) { font-size: .6rem; color: var(--text-3); }
.year-review-mark { width: 34px; height: 34px; display: grid; place-items: center; flex: none; border-radius: 9px; background: var(--header-bg); color: #fff; font-size: .8rem; font-weight: 800; letter-spacing: -.04em; }
.year-review-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; padding: 22px 24px 18px; background: linear-gradient(135deg, color-mix(in srgb, var(--header-bg) 92%, #000), color-mix(in srgb, var(--accent) 55%, var(--header-bg))); color: #fff; border-radius: 0; }
.year-review-top h3 { margin: 4px 0 5px; font-family: var(--font-display); font-size: 1.55rem; letter-spacing: -.035em; }
.year-review-top p { margin: 0; max-width: 520px; color: rgba(255,255,255,.76); font-size: .7rem; line-height: 1.6; }
.year-review-kicker { font-size: .53rem; font-weight: 750; letter-spacing: .12em; text-transform: uppercase; color: rgba(255,255,255,.58); }
.year-review-year { display: flex; flex-direction: column; gap: 3px; flex: none; font-size: .53rem; color: rgba(255,255,255,.62); }
.year-review-year select { height: 30px; border: 1px solid rgba(255,255,255,.25); border-radius: 7px; background: rgba(255,255,255,.12); color: #fff; padding: 0 8px; font: inherit; font-size: .7rem; }
.year-review-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 9px; padding: 15px 24px 4px; }
.year-stat { display: flex; flex-direction: column; gap: 2px; padding: 11px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2); }
.year-stat span { font-size: .55rem; color: var(--text-3); text-transform: uppercase; letter-spacing: .06em; font-weight: 700; }
.year-stat strong { font-size: 1.25rem; letter-spacing: -.03em; }
.year-stat small { font-size: .56rem; color: var(--text-3); }
.year-review-chart, .year-review-columns { margin: 12px 24px 0; }
.year-review-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; padding-bottom: 22px; }
.year-review-section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 7px; }
.year-review-section-head h3 { margin: 0; font-size: .78rem; }
.year-review-section-head p { margin: 2px 0 0; font-size: .58rem; color: var(--text-3); }
.year-review-section-head > span { font-size: .56rem; color: var(--text-3); }
.year-months { display: grid; grid-template-columns: repeat(12, 1fr); align-items: end; gap: 5px; height: 148px; padding: 10px 10px 0; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2); }
.year-month { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 4px; height: 100%; min-width: 0; }
.year-month-bar { width: 100%; max-width: 28px; min-height: 2px; border-radius: 4px 4px 2px 2px; background: linear-gradient(180deg, var(--accent), color-mix(in srgb, var(--accent) 64%, var(--header-bg))); }
.year-month.is-empty .year-month-bar { display: none; }
.year-month small { font-size: .48rem; color: var(--text-3); }
.year-review-foot { display: flex; flex-wrap: wrap; gap: 5px 14px; margin-top: 7px; font-size: .56rem; color: var(--text-3); }
.year-review-foot span { display: inline-flex; align-items: center; gap: 4px; }
.year-contact { display: flex; align-items: center; gap: 8px; padding: 7px 0; border-bottom: 1px solid var(--border); }
.year-contact:last-child { border-bottom: 0; }
.year-contact-rank { width: 18px; height: 18px; display: grid; place-items: center; flex: none; border-radius: 50%; background: var(--surface-3); color: var(--text-3); font-size: .5rem; font-weight: 700; }
.year-contact div { display: flex; flex-direction: column; gap: 1px; min-width: 0; flex: 1; }
.year-contact strong { font-size: .63rem; }
.year-contact span { font-size: .54rem; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.year-contact b { font-size: .62rem; }
.year-reactions { display: flex; flex-wrap: wrap; gap: 6px; }
.year-reaction { display: flex; flex-direction: column; align-items: center; gap: 1px; min-width: 58px; padding: 8px; border: 1px solid var(--border); border-radius: 9px; background: var(--surface-2); }
.year-reaction > span { font-size: 1.2rem; line-height: 1.1; }
.year-reaction b { font-size: .65rem; }
.year-reaction small { font-size: .48rem; color: var(--text-3); }
.year-highlights { margin: 0; padding-inline-start: 16px; font-size: .64rem; line-height: 1.65; color: var(--text-2); }
.year-highlights li { margin-bottom: 5px; }
.year-review-empty { padding: 14px 0; font-size: .62rem; color: var(--text-3); }

.reaction-rule-list { display: flex; flex-direction: column; gap: 6px; margin-bottom: 11px; }
.reaction-rule-row { display: flex; align-items: center; gap: 9px; padding: 8px 9px; border: 1px solid var(--border); border-radius: 9px; background: var(--surface-2); }
.reaction-rule-emoji { width: 30px; height: 30px; display: grid; place-items: center; flex: none; border-radius: 8px; background: var(--surface-3); font-size: 1rem; }
.reaction-rule-copy { display: flex; flex-direction: column; gap: 1px; min-width: 0; flex: 1; }
.reaction-rule-copy strong { font-size: .64rem; }
.reaction-rule-copy span { font-size: .55rem; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.reaction-rule-toggle { flex: none; height: 24px; padding: 0 9px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); color: var(--text-3); font: inherit; font-size: .55rem; font-weight: 700; cursor: pointer; }
.reaction-rule-toggle.is-on { border-color: color-mix(in srgb, #16a34a 34%, var(--border)); background: color-mix(in srgb, #16a34a 9%, var(--surface)); color: #15803d; }
.reaction-rule-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.reaction-rule-enabled { justify-content: flex-end; }
.reaction-rule-enabled input { width: 17px; height: 17px; }

.schedule-recipient-suggestions { margin: 11px 0 13px; padding: 10px; border: 1px solid color-mix(in srgb, var(--accent) 24%, var(--border)); border-radius: 10px; background: color-mix(in srgb, var(--accent) 4%, var(--surface-2)); }
.schedule-suggestion-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 7px; }
.schedule-suggestion-head span { font-size: .57rem; font-weight: 750; letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); }
.schedule-suggestion-head small { font-size: .54rem; color: var(--text-3); }
.schedule-suggestion-list { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 1px; }
.schedule-suggestion { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; min-width: 128px; padding: 7px 9px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--text); font: inherit; text-align: start; cursor: pointer; }
.schedule-suggestion:hover { border-color: var(--accent); }
.schedule-suggestion strong { font-size: .72rem; }
.schedule-suggestion span { font-size: .55rem; color: var(--text-2); }
.schedule-suggestion small { font-size: .5rem; color: var(--text-3); }

@media (max-width: 719px) {
  .subscription-line { align-items: flex-start; flex-wrap: wrap; }
  .subscription-line .btn-secondary { width: 100%; }
  .year-review-overlay { padding: 8px; }
  .year-review-top { flex-direction: column; }
  .year-review-stats { grid-template-columns: 1fr 1fr; padding: 12px 14px 2px; }
  .year-review-chart, .year-review-columns { margin-inline-start: 14px; margin-inline-end: 14px; }
  .year-review-columns { grid-template-columns: 1fr; }
  .year-months { gap: 3px; height: 126px; padding-inline-start: 5px; padding-inline-end: 5px; }
  .year-month small { font-size: .42rem; }
  .reaction-rule-row { flex-wrap: wrap; }
  .reaction-rule-copy { flex-basis: calc(100% - 45px); }
  .reaction-rule-grid { grid-template-columns: 1fr; }
  .schedule-suggestion-list { flex-direction: column; }
  .schedule-suggestion { min-width: 0; }
}
/* ============================================================
   Mail Home, Pulse, search reports and sticky notes
   ============================================================ */
.reader-home { min-height: calc(100vh - 130px); display: flex; flex-direction: column; }
.reader-home-bar { display: flex; align-items: center; gap: 10px; margin: -8px 0 18px; padding: 0 0 10px; border-bottom: 1px solid var(--border); }
.reader-home-tabs { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.reader-home-tab { position: relative; display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 0 12px; border: 1px solid transparent; border-radius: 999px; background: transparent; color: var(--text-3); font: inherit; font-size: .72rem; font-weight: 650; cursor: pointer; }
.reader-home-tab .icon { width: 15px; height: 15px; }
.reader-home-tab:hover { background: var(--surface-2); color: var(--text); }
.reader-home-tab.is-active { background: var(--accent-soft); color: var(--accent-ink); }
.reader-home-tab.is-closable { padding-inline-end: 6px; }
.reader-home-tab-close { display: inline-grid; place-items: center; width: 20px; height: 20px; margin-inline-start: 2px; border-radius: 50%; font-size: 1rem; line-height: 1; color: var(--text-3); }
.reader-home-tab-close:hover { background: color-mix(in srgb, var(--text) 10%, transparent); color: var(--text); }
.reader-home-private { margin-inline-start: auto; display: inline-flex; align-items: center; gap: 5px; font-size: .62rem; color: var(--text-3); white-space: nowrap; }
.reader-home-private .icon { width: 13px; height: 13px; }
.reader-home-body { position: relative; flex: 1; min-height: 0; }
.mail-home { position: relative; min-height: calc(100vh - 210px); display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 24px 16px 50px; }
.mail-home h2 { margin: 0 0 6px; font-family: var(--font-display); font-size: 1.125rem; font-weight: 600; }
.mail-home > p { margin: 0 0 22px; max-width: 36ch; font-size: .8125rem; line-height: 1.55; color: var(--text-3); }
.empty-stat-action { appearance: none; border: 1px solid var(--border); background: var(--surface-2); color: inherit; font: inherit; cursor: pointer; transition: border-color .15s ease, background .15s ease, transform .15s ease; }
.empty-stat-action:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); background: var(--accent-soft); transform: translateY(-1px); }
.empty-stat-action .empty-stat-value { display: flex; align-items: center; gap: 6px; color: var(--accent-ink); font-size: .95rem; }
.empty-stat-action .empty-stat-value .icon { width: 15px; height: 15px; }
.home-sticky-layer { position: absolute; inset: 0; pointer-events: none; z-index: 3; }
.home-sticky-layer .sticky-note { pointer-events: auto; }

.pulse-home { width: min(1080px, 100%); margin: 0 auto; padding: 8px 0 42px; }
.pulse-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 22px; margin-bottom: 16px; }
.pulse-head .eyebrow { margin: 0 0 5px; color: var(--accent-ink); font-size: .6rem; letter-spacing: .1em; text-transform: uppercase; font-weight: 750; }
.pulse-head h2 { margin: 0; font-family: var(--font-display); font-size: clamp(1.5rem, 3vw, 2.1rem); letter-spacing: -.03em; }
.pulse-head p { margin: 6px 0 0; max-width: 58ch; color: var(--text-3); font-size: .78rem; line-height: 1.55; }
.pulse-year { display: flex; align-items: center; gap: 8px; font-size: .68rem; color: var(--text-3); font-weight: 650; white-space: nowrap; }
.pulse-year select { height: 32px; padding: 0 28px 0 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface-2); color: var(--text); font: inherit; }
.pulse-search-form { display: flex; align-items: center; gap: 8px; margin-bottom: 16px; padding: 7px 8px 7px 12px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-2); }
.pulse-search-form .icon { width: 16px; height: 16px; color: var(--text-3); flex: none; }
.pulse-search-form input { flex: 1; min-width: 0; border: 0; background: transparent; color: var(--text); font: inherit; font-size: .78rem; outline: none; }
.pulse-search-form .btn-primary { flex: none; }
.pulse-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 14px; }
.pulse-stat { padding: 13px 14px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-2); }
.pulse-stat-label { display: flex; align-items: center; gap: 6px; color: var(--text-3); font-size: .62rem; font-weight: 650; text-transform: uppercase; letter-spacing: .04em; }
.pulse-stat-label .icon { width: 14px; height: 14px; }
.pulse-stat strong { display: block; margin: 6px 0 1px; font-family: var(--font-display); font-size: 1.55rem; letter-spacing: -.03em; }
.pulse-stat small { color: var(--text-3); font-size: .63rem; }
.pulse-loading { display: flex; flex-direction: column; align-items: center; gap: 5px; padding: 60px 20px; border: 1px dashed var(--border); border-radius: 14px; color: var(--text-3); font-size: .75rem; }
.pulse-loading b { color: var(--text-2); font-size: .82rem; }
.pulse-chart-card, .pulse-card { border: 1px solid var(--border); border-radius: 14px; background: var(--surface); }
.pulse-chart-card { padding: 15px 16px 12px; margin-bottom: 14px; }
.pulse-chart-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.pulse-chart-head h3, .pulse-card-head h3 { margin: 0; font-size: .82rem; }
.pulse-chart-head p { margin: 3px 0 0; color: var(--text-3); font-size: .65rem; }
.pulse-periods { display: flex; padding: 2px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface-2); }
.pulse-periods button { height: 26px; padding: 0 10px; border: 0; border-radius: 6px; background: transparent; color: var(--text-3); font: inherit; font-size: .64rem; font-weight: 650; cursor: pointer; }
.pulse-periods button.is-active { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgb(0 0 0 / .08); }
.pulse-legend { display: flex; align-items: center; gap: 13px; margin: 12px 0 4px; color: var(--text-3); font-size: .6rem; }
.pulse-legend span { display: inline-flex; align-items: center; gap: 5px; }
.pulse-legend-dot { width: 8px; height: 8px; border-radius: 2px; }
.pulse-legend-dot.is-received { background: color-mix(in srgb, var(--accent) 55%, var(--surface)); }
.pulse-legend-dot.is-sent { background: #e3a43e; }
.pulse-legend-note { margin-inline-start: auto; }
.pulse-bars { display: flex; align-items: flex-end; gap: 4px; height: 186px; padding: 8px 2px 0; overflow-x: auto; }
.pulse-bar { flex: 1 1 0; min-width: 13px; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 6px; padding: 0 1px; border: 0; background: transparent; cursor: pointer; }
.pulse-bar-stack { width: 100%; max-width: 28px; height: 156px; display: flex; flex-direction: column; justify-content: flex-end; gap: 2px; }
.pulse-bar-received, .pulse-bar-sent { display: block; width: 100%; border-radius: 4px 4px 2px 2px; transition: filter .15s ease; }
.pulse-bar-received { background: color-mix(in srgb, var(--accent) 55%, var(--surface)); }
.pulse-bar-sent { background: #e3a43e; border-radius: 2px 2px 4px 4px; }
.pulse-bar small { font-size: .52rem; color: var(--text-3); white-space: nowrap; }
.pulse-bar:hover .pulse-bar-received, .pulse-bar:hover .pulse-bar-sent, .pulse-bar.is-selected .pulse-bar-received, .pulse-bar.is-selected .pulse-bar-sent { filter: saturate(1.25) brightness(1.05); }
.pulse-bar.is-selected small { color: var(--accent-ink); font-weight: 750; }
.pulse-bar.is-empty { opacity: .45; }
.pulse-selection { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-top: 8px; padding: 9px 11px; border-radius: 9px; background: var(--surface-2); }
.pulse-selection > div { display: flex; flex-wrap: wrap; align-items: baseline; gap: 7px; font-size: .65rem; color: var(--text-3); }
.pulse-selection strong { color: var(--text); font-size: .78rem; }
.pulse-selection small { color: var(--text-3); }
.pulse-selection.is-empty { color: var(--text-3); font-size: .65rem; }
.pulse-chart-foot { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 10px; color: var(--text-3); font-size: .6rem; }
.pulse-chart-empty { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 44px 16px; color: var(--text-3); font-size: .68rem; }
.pulse-chart-empty .icon { width: 22px; height: 22px; }
.pulse-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.pulse-card { padding: 14px 16px; }
.pulse-card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.pulse-card-head span { color: var(--text-3); font-size: .6rem; }
.pulse-people { display: grid; gap: 7px; }
.pulse-person { display: grid; grid-template-columns: 20px minmax(0, 1fr) auto; align-items: center; gap: 8px; padding: 6px 0; border-top: 1px solid var(--border); }
.pulse-person:first-child { border-top: 0; }
.pulse-rank { width: 18px; height: 18px; display: grid; place-items: center; border-radius: 50%; background: var(--surface-2); color: var(--text-3); font-size: .55rem; font-weight: 700; }
.pulse-person div { min-width: 0; }
.pulse-person b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .7rem; }
.pulse-person small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-3); font-size: .58rem; }
.pulse-person strong { font-size: .7rem; font-variant-numeric: tabular-nums; }
.pulse-reactions { display: grid; gap: 6px; }
.pulse-reaction { display: flex; align-items: center; gap: 10px; padding: 6px 0; border-top: 1px solid var(--border); }
.pulse-reaction:first-child { border-top: 0; }
.pulse-reaction > span { font-size: 1.35rem; }
.pulse-reaction b { display: block; font-size: .7rem; text-transform: capitalize; }
.pulse-reaction small { color: var(--text-3); font-size: .6rem; }
.pulse-empty { padding: 14px 0; color: var(--text-3); font-size: .68rem; }
.pulse-highlights { display: flex; align-items: flex-start; gap: 10px; margin-top: 14px; padding: 12px 14px; border: 1px solid color-mix(in srgb, var(--accent) 28%, var(--border)); border-radius: 12px; background: var(--accent-soft); font-size: .68rem; line-height: 1.55; color: var(--text-2); }
.pulse-highlights-mark { color: var(--accent-ink); font-size: 1rem; }
.pulse-highlights div { display: grid; gap: 2px; }
.search-report { width: min(1080px, 100%); margin: 0 auto; padding: 8px 0 42px; }
.search-report-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 14px; }
.search-report-head .eyebrow { margin: 0 0 4px; font-size: .6rem; letter-spacing: .09em; text-transform: uppercase; color: var(--accent-ink); font-weight: 750; }
.search-report-head h2 { margin: 0; font-family: var(--font-display); font-size: clamp(1.25rem, 2.6vw, 1.8rem); letter-spacing: -.03em; }
.search-report-head p { margin: 5px 0 0; color: var(--text-3); font-size: .7rem; }
.search-report-form { display: flex; gap: 6px; min-width: min(320px, 100%); }
.search-report-form input { flex: 1; min-width: 0; height: 32px; padding: 0 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface-2); color: var(--text); font: inherit; font-size: .7rem; }
.search-report-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.search-report-grid { display: grid; grid-template-columns: 1.2fr .8fr; gap: 14px; margin-bottom: 14px; }
.search-report-bars { display: flex; align-items: flex-end; gap: 5px; height: 130px; padding-top: 6px; }
.search-report-bar { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; gap: 4px; align-items: center; min-width: 10px; }
.search-report-bar span { width: 100%; max-width: 26px; border-radius: 4px; background: color-mix(in srgb, var(--accent) 58%, var(--surface)); }
.search-report-bar small { color: var(--text-3); font-size: .5rem; }
.search-report-list { padding: 14px 16px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); }
.search-report-row { width: 100%; display: grid; grid-template-columns: 140px minmax(0, 1fr) 110px; align-items: center; gap: 12px; padding: 10px 0; border: 0; border-top: 1px solid var(--border); background: transparent; color: inherit; font: inherit; text-align: start; cursor: pointer; }
.search-report-row:hover { background: var(--surface-2); }
.search-report-from { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-3); font-size: .64rem; }
.search-report-subject { min-width: 0; }
.search-report-subject b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .72rem; }
.search-report-subject small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-3); font-size: .6rem; }
.search-report-meta { color: var(--text-3); font-size: .58rem; text-align: end; }
.search-report-empty { padding: 24px 0; text-align: center; }

/* Sticky note */
.sticky-list-host:not(:empty) { margin: 9px 12px 3px; }
.sticky-note { --sticky-bg: #fff2b0; --sticky-ink: #4a3c18; --sticky-line: #ead77f; width: 100%; border: 1px solid rgb(0 0 0 / .08); border-radius: 10px; background: var(--sticky-bg); color: var(--sticky-ink); box-shadow: 0 4px 10px rgb(28 32 38 / .09), inset 0 1px 0 rgb(255 255 255 / .45); overflow: visible; }
.sticky-note.is-yellow { --sticky-bg: #fff2b0; --sticky-ink: #4a3c18; --sticky-line: #ead77f; }
.sticky-note.is-blue { --sticky-bg: #dceeff; --sticky-ink: #173a5b; --sticky-line: #a9d0f0; }
.sticky-note.is-pink { --sticky-bg: #ffe1e9; --sticky-ink: #5b2437; --sticky-line: #efb5c5; }
.sticky-note.is-green { --sticky-bg: #dcf3df; --sticky-ink: #1d4429; --sticky-line: #a9d8b2; }
.sticky-note.is-drop-target { outline: 2px dashed color-mix(in srgb, var(--accent) 70%, var(--sticky-line)); outline-offset: 2px; transform: translateY(-1px); }
.sticky-note-head { display: flex; align-items: center; gap: 6px; padding: 7px 9px 5px; border-bottom: 1px dashed color-mix(in srgb, var(--sticky-ink) 16%, transparent); }
.sticky-pin { font-size: .72rem; filter: saturate(.8); }
.sticky-note-title { font-size: .6rem; font-weight: 800; letter-spacing: .045em; text-transform: uppercase; opacity: .72; }
.sticky-team { padding: 1px 5px; border: 1px solid color-mix(in srgb, var(--sticky-ink) 20%, transparent); border-radius: 999px; font-size: .48rem; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; opacity: .7; }
.sticky-note-head [data-sticky-drag-handle] { cursor: grab; }
.sticky-note-head [data-sticky-drag-handle]:active { cursor: grabbing; }
.sticky-icon { margin-inline-start: auto; width: 20px; height: 20px; display: inline-grid; place-items: center; border: 0; border-radius: 5px; background: transparent; color: var(--sticky-ink); opacity: .58; cursor: pointer; }
.sticky-icon:hover { background: rgb(0 0 0 / .07); opacity: 1; }
.sticky-icon + .sticky-icon, .sticky-icon + .sticky-dismiss-wrap { margin-inline-start: 0; }
.sticky-icon .icon { width: 13px; height: 13px; }
.sticky-note-head .sticky-icon:first-of-type { margin-inline-start: auto; }
.sticky-dismiss-wrap { position: relative; display: inline-flex; }
.sticky-dismiss-menu { position: absolute; inset-inline-end: 0; top: calc(100% + 4px); z-index: 20; min-width: 168px; padding: 4px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); box-shadow: var(--shadow-pop); }
.sticky-dismiss-menu button { display: block; width: 100%; padding: 7px 8px; border: 0; border-radius: 5px; background: transparent; color: var(--text); font: inherit; font-size: .65rem; text-align: start; white-space: nowrap; cursor: pointer; }
.sticky-dismiss-menu button:hover { background: var(--surface-2); }
.sticky-note-content { padding: 8px 11px 6px; font-size: .7rem; line-height: 1.5; max-height: 170px; overflow: auto; }
.sticky-note-content p { margin: 0 0 4px; }
.sticky-note-content p:last-child { margin-bottom: 0; }
.sticky-note-content a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.sticky-note.is-collapsed .sticky-note-content { padding-top: 6px; padding-bottom: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sticky-collapsed-line { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sticky-gap { display: block; height: 3px; }
.sticky-bullet { display: flex; gap: 5px; }
.sticky-check { display: flex; align-items: flex-start; gap: 6px; margin: 1px 0; cursor: pointer; }
.sticky-check input { width: 13px; height: 13px; margin: 2px 0 0; accent-color: var(--sticky-ink); }
.sticky-empty-copy { opacity: .55; font-style: italic; }
.sticky-links { display: grid; gap: 4px; margin-top: 7px; padding-top: 6px; border-top: 1px dashed color-mix(in srgb, var(--sticky-ink) 16%, transparent); }
.sticky-link-row { display: flex; align-items: stretch; gap: 3px; }
.sticky-link { flex: 1; min-width: 0; display: flex; align-items: center; gap: 5px; padding: 3px 4px; border: 0; border-radius: 5px; background: rgb(255 255 255 / .22); color: inherit; font: inherit; text-align: start; cursor: pointer; }
.sticky-link:hover { background: rgb(0 0 0 / .06); }
.sticky-link .icon { width: 12px; height: 12px; flex: none; opacity: .65; }
.sticky-link span { min-width: 0; }
.sticky-link b, .sticky-link small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sticky-link b { font-size: .62rem; }
.sticky-link small { font-size: .52rem; opacity: .65; }
.sticky-link-remove { width: 18px; border: 0; border-radius: 4px; background: transparent; color: inherit; opacity: .45; cursor: pointer; font-size: .8rem; }
.sticky-link-remove:hover { background: rgb(0 0 0 / .07); opacity: 1; }
.sticky-note-foot { display: flex; align-items: center; gap: 6px; padding: 4px 9px 6px; border-top: 1px dashed color-mix(in srgb, var(--sticky-ink) 14%, transparent); font-size: .5rem; opacity: .62; }
.sticky-note-hint { flex: 1; }
.sticky-shared { max-width: 55%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sticky-edit { display: inline-flex; align-items: center; gap: 3px; padding: 2px 4px; border: 0; border-radius: 4px; background: transparent; color: inherit; font: inherit; font-size: .52rem; cursor: pointer; opacity: .85; }
.sticky-edit:hover { background: rgb(0 0 0 / .07); opacity: 1; }
.sticky-edit .icon { width: 11px; height: 11px; }
.sticky-note.sticky-home { position: absolute; width: 292px; max-width: calc(100% - 24px); z-index: 4; box-shadow: 0 14px 30px rgb(20 28 38 / .16), 0 2px 6px rgb(20 28 38 / .08), inset 0 1px 0 rgb(255 255 255 / .5); transform: rotate(-1.3deg); }
.sticky-note.sticky-home:hover { transform: rotate(-1.3deg) translateY(-1px); }
.sticky-note.sticky-home .sticky-note-content { max-height: 220px; }
.sticky-note.is-compact { box-shadow: 0 3px 8px rgb(20 28 38 / .09); }
.sticky-spawn { position: absolute; inset-inline-end: 8px; top: 8px; display: flex; align-items: center; gap: 8px; max-width: 260px; padding: 8px 10px; border: 1px dashed var(--border); border-radius: 10px; background: color-mix(in srgb, var(--surface-2) 80%, transparent); color: var(--text-2); font: inherit; text-align: start; cursor: pointer; z-index: 4; }
.sticky-spawn:hover { border-color: var(--accent); background: var(--accent-soft); }
.sticky-spawn > span:first-child { font-size: 1rem; }
.sticky-spawn b, .sticky-spawn small { display: block; }
.sticky-spawn b { font-size: .65rem; }
.sticky-spawn small { margin-top: 1px; color: var(--text-3); font-size: .53rem; line-height: 1.35; }
.sticky-spawn .icon { width: 13px; height: 13px; color: var(--accent-ink); flex: none; }
.cal-sticky-host:not(:empty) { padding: 0 10px 8px; }
.cal-sticky-host .sticky-note { font-size: .92em; }
.sticky-editor-dialog { width: min(560px, calc(100vw - 24px)); }
.sticky-editor-mark { font-size: 1rem; }
.sticky-editor-text { width: 100%; min-height: 150px; padding: 11px 12px; border: 1px solid var(--border); border-radius: 9px; background: #fff8d8; color: #403614; font: inherit; font-size: .76rem; line-height: 1.55; resize: vertical; }
[data-theme="dark"] .sticky-editor-text { background: #332f20; color: #f3e8bd; }
.sticky-editor-colors { display: flex; gap: 7px; margin: 10px 0 4px; }
.sticky-color { width: 24px; height: 24px; border: 2px solid transparent; border-radius: 50%; cursor: pointer; box-shadow: inset 0 0 0 1px rgb(0 0 0 / .08); }
.sticky-color.is-yellow { background: #fff2b0; }
.sticky-color.is-blue { background: #dceeff; }
.sticky-color.is-pink { background: #ffe1e9; }
.sticky-color.is-green { background: #dcf3df; }
.sticky-color.is-active { border-color: var(--text); }
.sticky-editor-links { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 8px; }
.sticky-editor-links-label { width: 100%; color: var(--text-3); font-size: .58rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.sticky-editor-link { max-width: 100%; padding: 4px 7px; border: 1px solid var(--border); border-radius: 6px; background: var(--surface-2); color: var(--text-2); font: inherit; font-size: .6rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; cursor: pointer; }
.sticky-editor-hint { margin: 8px 0 0; color: var(--text-3); font-size: .6rem; line-height: 1.5; }
.sticky-editor-spacer { flex: 1; }

/* Full emoji picker and send confirmation */
.reaction-menu { max-height: calc(100vh - 24px); overflow: auto; }
.reaction-menu-head > div { min-width: 0; }
.reaction-menu-head strong { display: block; }
.reaction-menu-head small { display: block; margin-top: 1px; color: var(--text-3); font-size: .57rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.reaction-mode { display: flex; gap: 3px; margin: 0 0 7px; padding: 2px; border: 1px solid var(--border); border-radius: 7px; background: var(--surface-2); }
.reaction-mode button { flex: 1; height: 25px; border: 0; border-radius: 5px; background: transparent; color: var(--text-3); font: inherit; font-size: .58rem; font-weight: 650; cursor: pointer; }
.reaction-mode button.is-active { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgb(0 0 0 / .08); }
.reaction-mode button:disabled { opacity: .45; cursor: not-allowed; }
.reaction-search { display: flex; align-items: center; gap: 5px; margin-bottom: 6px; padding: 0 7px; border: 1px solid var(--border); border-radius: 7px; background: var(--surface-2); }
.reaction-search .icon { width: 13px; height: 13px; color: var(--text-3); flex: none; }
.reaction-search input { flex: 1; min-width: 0; height: 27px; border: 0; background: transparent; color: var(--text); font: inherit; font-size: .65rem; outline: none; }
.reaction-catalog { max-height: 190px; overflow: auto; margin-bottom: 5px; padding-inline-end: 2px; scrollbar-width: thin; }
.reaction-catalog-group { margin-bottom: 7px; }
.reaction-catalog-label { display: block; margin-bottom: 3px; color: var(--text-3); font-size: .5rem; font-weight: 750; letter-spacing: .055em; text-transform: uppercase; }
.reaction-catalog-grid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 2px; }
.reaction-catalog-grid button { height: 29px; border: 0; border-radius: 5px; background: transparent; font-size: 1.08rem; line-height: 1; cursor: pointer; }
.reaction-catalog-grid button:hover { background: var(--surface-2); transform: scale(1.15); }
.reaction-catalog-loading, .reaction-catalog-empty { display: flex; align-items: center; gap: 6px; padding: 12px 4px; color: var(--text-3); font-size: .6rem; }
.reaction-menu-note { margin: 5px 0 0; padding-top: 6px; border-top: 1px solid var(--border); color: var(--text-3); font-size: .52rem; line-height: 1.45; }
.react-tool-emoji { font-size: 1rem; line-height: 1; }
.reaction-confirm-overlay { z-index: 780; }
.reaction-confirm-dialog { width: min(390px, calc(100vw - 24px)); padding: 26px 24px 20px; text-align: center; }
.reaction-confirm-emoji { font-size: 3.4rem; line-height: 1.15; margin-bottom: 4px; }
.reaction-confirm-dialog h2 { margin: 0 0 5px; font-family: var(--font-display); font-size: 1.1rem; }
.reaction-confirm-dialog > p { margin: 0 auto 12px; max-width: 31ch; color: var(--text-3); font-size: .7rem; line-height: 1.55; }
.reaction-confirm-preview { display: flex; align-items: center; justify-content: center; gap: 9px; margin-bottom: 16px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 9px; background: var(--surface-2); text-align: start; }
.reaction-confirm-preview > span { font-size: 1.8rem; }
.reaction-confirm-preview b { display: block; font-size: .68rem; }
.reaction-confirm-preview small { color: var(--text-3); font-size: .58rem; }
.reaction-confirm-actions { display: flex; justify-content: center; gap: 6px; flex-wrap: wrap; }

@media (max-width: 900px) {
  .pulse-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pulse-columns, .search-report-grid { grid-template-columns: 1fr; }
  .search-report-row { grid-template-columns: 100px minmax(0, 1fr); }
  .search-report-meta { display: none; }
}
@media (max-width: 640px) {
  .reader-home { min-height: calc(100vh - 100px); }
  .reader-home-bar { align-items: flex-start; flex-direction: column; gap: 6px; margin-top: -4px; }
  .reader-home-private { margin-inline-start: 0; }
  .mail-home { min-height: calc(100vh - 200px); padding-top: 40px; }
  .home-sticky-layer .sticky-home { position: relative !important; inset-inline-start: auto !important; top: auto !important; width: 100%; max-width: 100%; transform: none; margin-bottom: 18px; }
  .home-sticky-layer .sticky-spawn { position: relative; inset-inline-end: auto; top: auto; max-width: 100%; width: 100%; margin-bottom: 18px; }
  .pulse-head, .search-report-head { align-items: flex-start; flex-direction: column; gap: 10px; }
  .pulse-year, .search-report-form { width: 100%; }
  .pulse-year select { flex: 1; }
  .pulse-stats, .search-report-stats { grid-template-columns: 1fr 1fr; }
  .pulse-search-form .btn-primary { padding-inline: 10px; font-size: .65rem; }
  .pulse-bars { gap: 2px; }
  .pulse-bar small { font-size: .45rem; }
  .search-report-row { grid-template-columns: 1fr; gap: 2px; padding: 9px 0; }
  .search-report-from { order: 2; }
  .search-report-subject { order: 1; }
  .reaction-catalog-grid { grid-template-columns: repeat(7, 1fr); }
  .sticky-note.sticky-home { transform: none; }
}

.home-sticky-layer .sticky-spawn { pointer-events: auto; }

.cmd-newmenu .newmenu-emoji { display: inline-grid; place-items: center; width: 14px; font-size: .9rem; }

.sticky-note { text-align: start; }

.reader-home-bar { position: sticky; top: 0; z-index: 8; background: var(--surface); }

/* Notes desk — multi-note foundation */
.notes-desk-trigger { position: relative; }
.notes-desk-trigger > span:first-child { font-size: .8rem; line-height: 1; }
.notes-desk-count { position: absolute; top: -3px; inset-inline-end: -3px; min-width: 13px; height: 13px; padding: 0 3px; border-radius: 999px; background: var(--accent); color: var(--on-accent); font-size: .46rem; font-weight: 800; line-height: 13px; text-align: center; }
.sticky-pinned-stack { display: grid; gap: 4px; }
.sticky-more-chip { justify-self: start; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); color: var(--text-2); font: inherit; font-size: .52rem; font-weight: 700; padding: 3px 8px; cursor: pointer; }
.sticky-more-chip:hover { border-color: var(--accent); color: var(--accent); }
.sticky-more-chip.is-home { position: absolute; inset-inline-end: 12px; bottom: 12px; z-index: 4; background: var(--surface); }
.sticky-desk-launcher { display: flex; align-items: center; gap: 8px; width: 100%; padding: 8px 10px; border: 1px dashed var(--border); border-radius: 10px; background: color-mix(in srgb, var(--surface-2) 80%, transparent); color: var(--text-2); font: inherit; text-align: start; cursor: pointer; }
.sticky-desk-launcher:hover { border-color: var(--accent); background: var(--accent-soft); }
.sticky-desk-mark { font-size: 1rem; }
.sticky-desk-copy { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.sticky-desk-copy b { font-size: .65rem; color: var(--text); }
.sticky-desk-copy small { font-size: .53rem; color: var(--text-3); }
.sticky-desk-launcher > .icon { width: 13px; height: 13px; color: var(--accent); }
.sticky-home-desk-chip { position: absolute; inset-inline-end: 12px; top: 12px; z-index: 5; pointer-events: auto; display: inline-flex; align-items: center; gap: 5px; padding: 6px 9px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); color: var(--text-2); font: inherit; font-size: .56rem; font-weight: 700; cursor: pointer; box-shadow: var(--shadow-soft); }
.sticky-home-desk-chip:hover { border-color: var(--accent); color: var(--accent); }
.sticky-inbox-badge { padding: 1px 5px; border-radius: 999px; background: color-mix(in srgb, var(--sticky-ink) 10%, transparent); font-size: .45rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; opacity: .72; }
.sticky-pin-action { margin-inline-start: auto; }
.sticky-editor-pin { display: flex; align-items: flex-start; gap: 8px; margin: 12px 0 0; padding: 9px 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface-2); cursor: pointer; }
.sticky-editor-pin input { width: 14px; height: 14px; margin: 2px 0 0; accent-color: var(--accent); }
.sticky-editor-pin span { display: flex; flex-direction: column; gap: 1px; }
.sticky-editor-pin b { font-size: .65rem; color: var(--text); }
.sticky-editor-pin small { font-size: .54rem; color: var(--text-3); line-height: 1.4; }
.notes-desk-dialog { width: min(880px, calc(100vw - 24px)); max-height: min(760px, calc(100vh - 40px)); display: flex; flex-direction: column; }
.notes-desk-dialog .dialog-body { overflow: auto; }
.notes-desk-mark { font-size: 1rem; }
.notes-desk-toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.notes-desk-search { flex: 1; min-width: 180px; display: flex; align-items: center; gap: 6px; padding: 0 9px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); }
.notes-desk-search .icon { width: 13px; height: 13px; color: var(--text-3); }
.notes-desk-search input { flex: 1; min-width: 0; border: 0; outline: 0; padding: 8px 0; background: transparent; color: var(--text); font: inherit; font-size: .67rem; }
.notes-desk-tabs { display: inline-flex; padding: 2px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface-2); }
.notes-desk-tabs button { border: 0; border-radius: 6px; background: transparent; color: var(--text-2); padding: 5px 8px; font: inherit; font-size: .58rem; font-weight: 700; cursor: pointer; }
.notes-desk-tabs button.is-active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-soft); }
.notes-desk-tabs span { margin-inline-start: 3px; color: var(--text-3); font-size: .5rem; }
.notes-desk-new { padding: 7px 10px; font-size: .6rem; }
.notes-desk-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 9px; }
.notes-desk-card { display: flex; flex-direction: column; min-height: 132px; border: 1px solid color-mix(in srgb, var(--sticky-line, #d6c56d) 50%, var(--border)); border-radius: 11px; background: var(--sticky-bg, #fff2b0); color: var(--sticky-ink, #4a3c18); overflow: hidden; }
.notes-desk-card.is-yellow { --sticky-bg: #fff2b0; --sticky-ink: #4a3c18; --sticky-line: #ead77f; }
.notes-desk-card.is-blue { --sticky-bg: #dceeff; --sticky-ink: #173a5b; --sticky-line: #a9d0f0; }
.notes-desk-card.is-pink { --sticky-bg: #ffe1e9; --sticky-ink: #5b2437; --sticky-line: #efb5c5; }
.notes-desk-card.is-green { --sticky-bg: #dcf3df; --sticky-ink: #1d4429; --sticky-line: #a9d8b2; }
.notes-desk-card.is-pinned { box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--sticky-ink) 20%, transparent); }
.notes-desk-card.is-archived { opacity: .78; }
.notes-desk-card-open { flex: 1; display: flex; flex-direction: column; gap: 4px; padding: 11px 11px 6px; border: 0; background: transparent; color: inherit; font: inherit; text-align: start; cursor: pointer; }
.notes-desk-card-open strong { font-size: .72rem; line-height: 1.3; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.notes-desk-card-open > span { font-size: .58rem; line-height: 1.4; opacity: .72; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; }
.notes-desk-card-open small { margin-top: auto; font-size: .5rem; opacity: .58; }
.notes-desk-card-foot { display: flex; align-items: center; justify-content: space-between; gap: 5px; padding: 5px 9px 7px; border-top: 1px dashed color-mix(in srgb, var(--sticky-ink) 14%, transparent); font-size: .5rem; }
.notes-desk-card-foot button { color: inherit; opacity: .72; }
.notes-desk-card-foot button:hover { opacity: 1; }
.notes-desk-pin-badge { font-weight: 800; letter-spacing: .03em; text-transform: uppercase; opacity: .68; }
.notes-desk-empty { grid-column: 1 / -1; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 36px 16px; text-align: center; color: var(--text-3); }
.notes-desk-empty > span { font-size: 1.35rem; }
.notes-desk-empty strong { color: var(--text); font-size: .78rem; }
.notes-desk-empty p { max-width: 380px; margin: 0; font-size: .62rem; line-height: 1.55; }
.notes-desk-empty .btn-primary { margin-top: 6px; }
.notes-settings-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; }
.notes-settings-row > div { display: flex; flex-direction: column; gap: 2px; }
.notes-settings-row b { font-size: .68rem; }
.notes-settings-row small { color: var(--text-3); font-size: .55rem; }
.notes-settings-row .btn-secondary { white-space: nowrap; }
@media (max-width: 620px) {
  .notes-desk-grid { grid-template-columns: 1fr; }
  .notes-desk-toolbar { align-items: stretch; }
  .notes-desk-search { flex-basis: 100%; }
  .notes-desk-new { margin-inline-start: auto; }
  .sticky-home-desk-chip { display: none; }
}

/* Notes desk — context, discovery and team indicators */
.notes-desk-team-badge { display: inline-flex; align-items: center; margin-inline-start: 6px; padding: 2px 6px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-ink); font-size: .46rem; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; vertical-align: middle; }
.notes-desk-team-badge[hidden], .notes-desk-scope[hidden], .sticky-editor-attach[hidden], .sticky-attach-picker[hidden] { display: none !important; }
.notes-desk-scope { max-width: 138px; padding: 7px 22px 7px 9px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--text-2); font: inherit; font-size: .6rem; }
.notes-desk-card-flags { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; margin-bottom: 2px; }
.notes-desk-card-team { padding: 1px 5px; border-radius: 999px; background: color-mix(in srgb, var(--sticky-ink) 12%, transparent); font-size: .43rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; opacity: .75; }
.notes-desk-card-owner { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .48rem; font-weight: 700; opacity: .62; }
.notes-desk-readonly { font-size: .48rem; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; opacity: .58; }
.sticky-editor-attach { margin-top: 9px; }
.sticky-editor-links-empty { width: 100%; color: var(--text-3); font-size: .58rem; line-height: 1.45; }
.sticky-editor-link { display: inline-flex; align-items: center; gap: 4px; }
.sticky-editor-link .icon { width: 11px; height: 11px; flex: none; opacity: .62; }
.sticky-editor-link > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.sticky-editor-link > button { display: inline-grid; place-items: center; width: 14px; height: 14px; padding: 0; border: 0; border-radius: 999px; background: transparent; color: inherit; font: inherit; line-height: 1; opacity: .55; cursor: pointer; }
.sticky-editor-link > button:hover { background: var(--surface); opacity: 1; }
.sticky-editor-attach-actions { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 4px; }
.sticky-attach-btn { display: inline-flex; align-items: center; gap: 4px; padding: 5px 8px; border: 1px solid var(--border); border-radius: 7px; background: var(--surface-2); color: var(--text-2); font: inherit; font-size: .58rem; font-weight: 700; cursor: pointer; }
.sticky-attach-btn:hover { border-color: var(--accent); color: var(--accent); }
.sticky-attach-btn .icon { width: 12px; height: 12px; }
.sticky-attach-picker { margin-top: 7px; border: 1px solid var(--border); border-radius: 9px; background: var(--surface); overflow: hidden; }
.sticky-attach-search { display: flex; align-items: center; gap: 6px; padding: 0 9px; border-bottom: 1px solid var(--border); }
.sticky-attach-search .icon { width: 12px; height: 12px; color: var(--text-3); }
.sticky-attach-search input { flex: 1; min-width: 0; padding: 8px 0; border: 0; outline: 0; background: transparent; color: var(--text); font: inherit; font-size: .62rem; }
.sticky-attach-results { max-height: 190px; overflow: auto; padding: 4px; }
.sticky-attach-item { width: 100%; display: flex; align-items: center; gap: 7px; padding: 6px 7px; border: 0; border-radius: 6px; background: transparent; color: var(--text); font: inherit; text-align: start; cursor: pointer; }
.sticky-attach-item:hover { background: var(--surface-2); }
.sticky-attach-item > .icon { width: 13px; height: 13px; flex: none; color: var(--text-3); }
.sticky-attach-item > span { flex: 1; min-width: 0; }
.sticky-attach-item b, .sticky-attach-item small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sticky-attach-item b { font-size: .62rem; }
.sticky-attach-item small { color: var(--text-3); font-size: .52rem; }
.sticky-attach-item .sticky-attach-add { color: var(--accent); }
.sticky-attach-loading, .sticky-attach-empty { display: flex; align-items: center; gap: 7px; padding: 10px 8px; color: var(--text-3); font-size: .58rem; }
.sticky-attach-loading .list-loading-spinner { width: 12px; height: 12px; }
.search-notes-strip { display: grid; gap: 1px; margin: 0 0 9px; padding: 8px 10px 6px; border: 1px solid color-mix(in srgb, var(--accent) 24%, var(--border)); border-radius: 10px; background: color-mix(in srgb, var(--accent-soft) 52%, var(--surface)); }
.search-notes-head { display: flex; align-items: center; gap: 7px; margin-bottom: 3px; }
.search-notes-label { display: inline-flex; align-items: center; gap: 4px; color: var(--text-2); font-size: .55rem; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; }
.search-notes-head strong { flex: 1; color: var(--text-3); font-size: .55rem; font-weight: 600; }
.search-notes-head .link-btn { color: var(--accent); font-size: .55rem; font-weight: 700; }
.search-note-row { display: flex; align-items: center; gap: 7px; width: 100%; padding: 5px 3px; border: 0; border-top: 1px dashed color-mix(in srgb, var(--accent) 14%, transparent); background: transparent; color: var(--text); font: inherit; text-align: start; cursor: pointer; }
.search-note-row:hover { background: color-mix(in srgb, var(--surface) 60%, transparent); }
.search-note-mark { width: 18px; text-align: center; font-size: .72rem; }
.search-note-copy { flex: 1; min-width: 0; }
.search-note-copy b, .search-note-copy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.search-note-copy b { font-size: .62rem; }
.search-note-copy small { color: var(--text-3); font-size: .53rem; }
.search-note-meta { max-width: 34%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-3); font-size: .5rem; }
@media (max-width: 640px) {
  .notes-desk-scope { flex: 1 1 100%; max-width: none; }
  .search-note-meta { display: none; }
}

/* Mail list — Outlook-style jump to date */
.date-jump-menu { position: absolute; z-index: 46; top: 48px; inset-inline-end: 48px; width: 222px; padding: 7px; border: 1px solid var(--border-strong); border-radius: 12px; background: var(--surface); box-shadow: var(--shadow-pop); }
.date-jump-menu[hidden] { display: none !important; }
.date-jump-presets { display: grid; gap: 1px; }
.date-jump-presets button { width: 100%; padding: 8px 9px; border: 0; border-radius: 7px; background: transparent; color: var(--text-2); font: inherit; font-size: .68rem; text-align: start; cursor: pointer; }
.date-jump-presets button:hover { background: var(--surface-3); color: var(--text); }
.date-jump-custom { margin-top: 6px; padding-top: 7px; border-top: 1px solid var(--border); }
.date-jump-custom > label { display: block; margin-bottom: 5px; color: var(--text-3); font-size: .52rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; }
.date-jump-custom > div { display: flex; gap: 5px; }
.date-jump-custom input { flex: 1; min-width: 0; padding: 7px 8px; border: 1px solid var(--border); border-radius: 7px; background: var(--surface-2); color: var(--text); font: inherit; font-size: .62rem; color-scheme: light; }
.date-jump-custom input::-webkit-calendar-picker-indicator { opacity: .72; cursor: pointer; }
:root[data-theme="dark"] .date-jump-custom input { color-scheme: dark; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .date-jump-custom input { color-scheme: dark; } }
.date-jump-custom button { padding: 0 12px; border: 0; border-radius: 7px; background: var(--accent); color: var(--on-accent); font: inherit; font-size: .62rem; font-weight: 700; cursor: pointer; }
.mail-group-head.is-date-jump-target { animation: mail-date-jump-flash 1.8s ease-out; }
@keyframes mail-date-jump-flash { 0%, 18% { background: var(--accent-soft); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 40%, transparent); } 100% { background: transparent; box-shadow: none; } }
@media (max-width: 640px) { .date-jump-menu { inset-inline-end: 10px; inset-inline-start: 10px; width: auto; } }

/* Mail Home — refined quiet-workspace hero */
.mail-home { overflow: hidden; isolation: isolate; }
.home-aurora { position: absolute; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; }
.home-aurora span { position: absolute; border-radius: 999px; filter: blur(0); opacity: .55; }
.home-aurora span:nth-child(1) { width: 360px; height: 360px; left: 50%; top: 46%; transform: translate(-76%, -50%); background: radial-gradient(circle, color-mix(in srgb, var(--accent) 10%, transparent), transparent 68%); }
.home-aurora span:nth-child(2) { width: 280px; height: 280px; left: 50%; top: 42%; transform: translate(8%, -50%); background: radial-gradient(circle, color-mix(in srgb, var(--cat-sales, #8b5cf6) 8%, transparent), transparent 70%); }
.home-aurora span:nth-child(3) { width: 520px; height: 240px; left: 50%; top: 72%; transform: translate(-50%, -50%); background: radial-gradient(ellipse, color-mix(in srgb, var(--success) 5%, transparent), transparent 72%); }
.home-hero { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; width: min(620px, 100%); }
.home-mail-art { position: relative; width: 112px; height: 112px; display: grid; place-items: center; margin-bottom: 17px; color: var(--accent-ink); }
.home-mail-halo { position: absolute; inset: 7px; border-radius: 34px; background: conic-gradient(from 210deg, color-mix(in srgb, var(--accent) 18%, var(--surface)), color-mix(in srgb, var(--cat-sales, #8b5cf6) 12%, var(--surface)), color-mix(in srgb, var(--success) 9%, var(--surface)), color-mix(in srgb, var(--accent) 18%, var(--surface))); transform: rotate(-8deg); opacity: .85; }
.home-mail-svg { position: relative; width: 96px; height: 96px; color: var(--accent-ink); filter: drop-shadow(0 12px 20px color-mix(in srgb, var(--accent) 18%, transparent)); }
.home-mail-spark { position: absolute; color: var(--accent); font-size: .72rem; opacity: .8; animation: home-mail-twinkle 3.6s ease-in-out infinite; }
.home-mail-spark.is-one { inset-inline-end: 2px; top: 14px; }
.home-mail-spark.is-two { inset-inline-start: 8px; bottom: 18px; font-size: .52rem; animation-delay: 1.2s; }
@keyframes home-mail-twinkle { 0%, 100% { opacity: .35; transform: scale(.88); } 50% { opacity: .9; transform: scale(1.08); } }
.home-eyebrow { margin: 0 0 5px; color: var(--accent-ink); font-size: .56rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.mail-home .home-hero h2 { margin: 0 0 7px; font-family: var(--font-display); font-size: clamp(1.25rem, 2.2vw, 1.52rem); letter-spacing: -.025em; }
.home-lead { max-width: 47ch; margin: 0; color: var(--text-3); font-size: .78rem; line-height: 1.65; }
.home-hero-actions { display: flex; align-items: center; justify-content: center; gap: 7px; flex-wrap: wrap; margin-top: 16px; }
.home-hero-actions .btn-primary, .home-hero-actions .btn-secondary { display: inline-flex; align-items: center; gap: 5px; height: 32px; padding: 0 12px; font-size: .64rem; }
.home-hero-actions .icon { width: 13px; height: 13px; }
.home-stats-grid { width: min(620px, 100%); margin: 24px 0 20px; grid-template-columns: repeat(auto-fit, minmax(136px, 1fr)); }
.home-stats-grid .empty-stat { border-radius: 10px; background: color-mix(in srgb, var(--surface) 72%, transparent); box-shadow: 0 1px 0 color-mix(in srgb, var(--surface) 70%, transparent); backdrop-filter: blur(6px); }
[data-theme="dark"] .home-stats-grid .empty-stat { background: color-mix(in srgb, var(--surface-2) 76%, transparent); }
.mail-home .empty-keys { opacity: .8; }
@media (max-width: 640px) {
  .home-aurora span:nth-child(1) { width: 250px; height: 250px; }
  .home-stats-grid { grid-template-columns: 1fr 1fr; margin-top: 20px; }
  .home-stats-grid .empty-stat:last-child { grid-column: 1 / -1; }
  .home-lead { max-width: 34ch; }
}

/* Cabinet — sticky multi-source upload manager */
.upload-manager { position: fixed; inset-inline-end: 20px; bottom: 20px; z-index: 96; width: min(430px, calc(100vw - 24px)); max-height: min(680px, calc(100vh - 90px)); display: flex; flex-direction: column; overflow: hidden; border: 1px solid var(--border-strong); border-radius: 17px; background: var(--surface); box-shadow: 0 28px 80px rgb(15 23 42 / .28), 0 4px 14px rgb(15 23 42 / .12); animation: upload-manager-in .24s cubic-bezier(.2,.9,.2,1); }
.upload-manager[hidden] { display: none !important; }
.upload-manager.is-minimized .upload-manager-tabs, .upload-manager.is-minimized .upload-manager-body { display: none; }
.upload-manager.is-minimized { width: min(330px, calc(100vw - 24px)); }
@keyframes upload-manager-in { from { opacity: 0; transform: translateY(12px) scale(.98); } to { opacity: 1; transform: none; } }
.upload-manager-head { display: flex; align-items: center; gap: 9px; padding: 11px 12px; border-bottom: 1px solid var(--border); background: linear-gradient(135deg, color-mix(in srgb, var(--accent-soft) 76%, var(--surface)), var(--surface)); cursor: grab; touch-action: none; }
.upload-manager-head:active { cursor: grabbing; }
.upload-manager-mark { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 9px; background: var(--accent); color: var(--on-accent); flex: none; }
.upload-manager-mark .icon { width: 15px; height: 15px; }
.upload-manager-title { flex: 1; min-width: 0; }
.upload-manager-title strong { display: block; font-size: .72rem; letter-spacing: -.01em; }
.upload-manager-title small { display: block; margin-top: 1px; color: var(--text-3); font-size: .55rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.upload-manager-btn { width: 26px; height: 26px; display: grid; place-items: center; border: 0; border-radius: 7px; background: transparent; color: var(--text-3); cursor: pointer; }
.upload-manager-btn:hover { background: var(--surface-3); color: var(--text); }
.upload-manager-btn .icon { width: 13px; height: 13px; }
.upload-manager-tabs { display: flex; gap: 2px; padding: 5px 7px 0; border-bottom: 1px solid var(--border); background: var(--surface); }
.upload-manager-tabs button { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 5px; padding: 7px 6px 8px; border: 0; border-bottom: 2px solid transparent; background: transparent; color: var(--text-3); font: inherit; font-size: .58rem; font-weight: 700; cursor: pointer; }
.upload-manager-tabs button .icon { width: 12px; height: 12px; }
.upload-manager-tabs button:hover { color: var(--text); }
.upload-manager-tabs button.is-active { color: var(--accent-ink); border-bottom-color: var(--accent); }
.upload-manager-body { flex: 1; min-height: 0; overflow-y: auto; }
.upload-panel { display: grid; gap: 11px; padding: 12px; }
.upload-drop { border: 1.5px dashed color-mix(in srgb, var(--accent) 32%, var(--border)); border-radius: 13px; background: color-mix(in srgb, var(--accent-soft) 45%, var(--surface)); padding: 18px 14px; text-align: center; transition: .18s border-color, .18s background; }
.upload-drop.is-drag, .upload-drop:hover { border-color: var(--accent); background: color-mix(in srgb, var(--accent-soft) 78%, var(--surface)); }
.upload-drop-icon { width: 36px; height: 36px; display: grid; place-items: center; margin: 0 auto 7px; border-radius: 11px; background: var(--surface); color: var(--accent); box-shadow: var(--shadow-soft); }
.upload-drop-icon .icon { width: 18px; height: 18px; }
.upload-drop strong { display: block; font-size: .72rem; }
.upload-drop > span { display: block; margin-top: 2px; color: var(--text-3); font-size: .58rem; }
.upload-drop small { display: block; margin-top: 8px; color: var(--text-3); font-size: .53rem; font-weight: 600; }
.upload-url-field { display: grid; gap: 5px; }
.upload-url-field span { color: var(--text-3); font-size: .54rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; }
.upload-url-field input { width: 100%; padding: 9px 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface-2); color: var(--text); font: inherit; font-size: .65rem; }
.upload-note { margin: -3px 0 0; color: var(--text-3); font-size: .55rem; line-height: 1.5; }
.upload-queue { display: grid; gap: 7px; }
.upload-item { display: flex; gap: 8px; padding: 8px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2); }
.upload-item.is-error { border-color: color-mix(in srgb, var(--danger) 45%, var(--border)); background: var(--danger-soft); }
.upload-item.is-done { border-color: color-mix(in srgb, var(--success) 30%, var(--border)); }
.upload-item-icon { width: 26px; height: 30px; display: grid; place-items: center; border-radius: 6px; background: var(--surface); color: var(--text-3); flex: none; }
.upload-item-icon .icon { width: 13px; height: 13px; }
.upload-item-main { flex: 1; min-width: 0; }
.upload-item-head { display: flex; gap: 8px; align-items: baseline; }
.upload-item-head b { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .62rem; }
.upload-item-head small { color: var(--text-3); font-size: .5rem; white-space: nowrap; }
.upload-bar { height: 4px; margin-top: 5px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.upload-bar span { display: block; height: 100%; border-radius: inherit; background: var(--accent); transition: width .2s; }
.upload-item.is-done .upload-bar span { background: var(--success); }
.upload-item.is-error .upload-bar span { background: var(--danger); }
.upload-item-status { display: flex; justify-content: space-between; gap: 8px; margin-top: 4px; color: var(--text-3); font-size: .51rem; }
.upload-item-status strong { color: var(--text-2); }
.upload-empty { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 24px 12px; text-align: center; color: var(--text-3); }
.upload-empty .icon { width: 22px; height: 22px; opacity: .5; }
.upload-empty strong { color: var(--text-2); font-size: .64rem; }
.upload-empty span { font-size: .54rem; }
.upload-mobile-card { display: flex; gap: 12px; align-items: flex-start; padding: 10px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-2); }
.upload-qr-frame { width: 150px; min-width: 150px; height: 150px; display: grid; place-items: center; padding: 6px; border-radius: 10px; background: #fff; }
.upload-qr-frame img, .upload-qr-frame canvas { max-width: 100%; height: auto; }
.upload-qr-host { width: 100%; display: grid; place-items: center; }
.upload-qr-host img { width: 100%; height: auto; }
.upload-qr-fallback { color: var(--accent); font-size: .58rem; text-align: center; }
.upload-qr-expired { display: flex; flex-direction: column; align-items: center; gap: 3px; color: var(--text-3); font-size: .55rem; text-align: center; }
.upload-qr-expired .icon { width: 18px; height: 18px; opacity: .55; }
.upload-mobile-copy { flex: 1; min-width: 0; }
.upload-mobile-copy > strong { display: block; font-size: .68rem; }
.upload-mobile-copy > span { display: block; margin-top: 3px; color: var(--text-3); font-size: .56rem; line-height: 1.5; }
.upload-mobile-actions { display: flex; gap: 5px; flex-wrap: wrap; margin-top: 8px; }
.upload-mobile-actions .btn-secondary { height: 26px; padding: 0 8px; font-size: .55rem; }
.upload-mobile-actions .icon { width: 11px; height: 11px; }
.upload-expiry { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; margin-top: 7px; color: var(--text-3); font-size: .5rem; }
.upload-expiry .icon { width: 11px; height: 11px; }
.upload-expiry button { border: 0; border-radius: 5px; background: var(--surface); color: var(--accent); font: inherit; font-size: .5rem; font-weight: 700; padding: 2px 5px; cursor: pointer; }
.upload-expiry button:hover { background: var(--accent-soft); }
.upload-mobile-list { display: grid; gap: 6px; }
.upload-mobile-head { display: flex; align-items: baseline; gap: 7px; color: var(--text-3); font-size: .54rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; }
.upload-mobile-head span { color: var(--text-2); }
@media (max-width: 640px) {
  .upload-manager { inset-inline-end: 8px; bottom: 8px; width: calc(100vw - 16px); max-height: calc(100vh - 70px); }
  .upload-mobile-card { flex-direction: column; align-items: center; text-align: center; }
  .upload-mobile-actions { justify-content: center; }
}

/* Compose defaults: Arial 12 */
.compose-editor { font-family: Arial, Helvetica, sans-serif; font-size: 12px; }
.compose-text { font-family: Arial, Helvetica, sans-serif; font-size: 12px; }

/* Subscription cleanup report */
.subscription-report-dialog { width: min(580px, calc(100vw - 28px)); }
.subscription-report-icon { background: var(--accent-soft); color: var(--accent-ink); }
.subscription-report-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-bottom: 12px; }
.subscription-report-summary > div { padding: 11px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2); }
.subscription-report-summary strong { display: block; color: var(--text); font-size: 1.15rem; line-height: 1.2; }
.subscription-report-summary span { display: block; margin-top: 2px; color: var(--text-3); font-size: .54rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.subscription-report-summary .is-failed strong { color: var(--danger); }
.subscription-report-note { margin: 0 0 10px; color: var(--text-3); font-size: .6rem; line-height: 1.55; }
.subscription-report-note.is-warning { padding: 8px 10px; border-radius: 8px; background: var(--warning-soft); color: var(--warning); }
.subscription-report-list { display: flex; flex-direction: column; gap: 5px; max-height: 320px; overflow: auto; }
.subscription-report-row { display: flex; align-items: flex-start; gap: 9px; padding: 9px 10px; border: 1px solid var(--border); border-radius: 9px; background: var(--surface); }
.subscription-report-status { width: 24px; height: 24px; flex: none; display: grid; place-items: center; border-radius: 7px; background: var(--surface-2); color: var(--text-3); }
.subscription-report-status .icon { width: 13px; height: 13px; }
.subscription-report-row.is-sent .subscription-report-status { background: var(--accent-soft); color: var(--accent-ink); }
.subscription-report-row.is-failed .subscription-report-status { background: var(--danger-soft); color: var(--danger); }
.subscription-report-copy { flex: 1; min-width: 0; }
.subscription-report-copy strong { display: block; color: var(--text); font-size: .65rem; line-height: 1.35; }
.subscription-report-copy span { display: block; color: var(--text-3); font-size: .55rem; line-height: 1.4; overflow-wrap: anywhere; }
.subscription-report-copy small { display: block; margin-top: 3px; color: var(--danger); font-size: .52rem; line-height: 1.4; overflow-wrap: anywhere; }
.subscription-report-state { flex: none; text-align: end; }
.subscription-report-state span { display: block; color: var(--text-2); font-size: .55rem; font-weight: 700; }
.subscription-report-state small { display: block; color: var(--text-3); font-size: .5rem; }
.subscription-report-empty { padding: 18px; text-align: center; color: var(--text-3); font-size: .62rem; }
@media (max-width: 520px) { .subscription-report-summary { grid-template-columns: 1fr; } }

/* Duplicate-subject reply reminder */
.compose-warning-host[hidden] { display: none !important; }
.compose-warning-host { margin: 0 0 8px; }
.compose-duplicate-warning {
  display: flex; align-items: flex-start; gap: 8px; padding: 9px 10px;
  border: 1px solid color-mix(in srgb, var(--warning) 30%, var(--border));
  border-radius: 9px; background: var(--warning-soft); color: var(--text);
}
.compose-duplicate-warning-icon { width: 18px; height: 18px; flex: none; display: grid; place-items: center; color: var(--warning); }
.compose-duplicate-warning-icon .icon { width: 17px; height: 17px; }
.compose-duplicate-warning-copy { flex: 1; min-width: 0; color: var(--text-2); font-size: .62rem; line-height: 1.45; }
.compose-duplicate-warning-copy strong { color: var(--text); font-weight: 650; }
.compose-duplicate-warning-close { width: 22px; height: 22px; flex: none; display: grid; place-items: center; border: 0; border-radius: 6px; background: transparent; color: var(--warning); cursor: pointer; }
.compose-duplicate-warning-close:hover { background: color-mix(in srgb, var(--warning) 12%, transparent); }
.compose-duplicate-warning-close .icon { width: 12px; height: 12px; }

/* ---------- compose attachment -> Cabinet link fallback ---------- */
.compose-share-overlay { z-index: 260; }
.compose-share-dialog {
  width: min(620px, calc(100vw - 32px));
  max-height: min(820px, calc(100dvh - 32px));
  display: flex;
  flex-direction: column;
}
.compose-share-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 20px 20px 14px;
}
.compose-share-head-icon {
  width: 40px;
  height: 40px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: var(--accent-soft);
  color: var(--accent-ink);
}
.compose-share-head-icon .icon { width: 20px; height: 20px; }
.compose-share-head-copy { flex: 1; min-width: 0; }
.compose-share-head-copy .eyebrow { margin: 2px 0 3px; color: var(--accent-ink); }
.compose-share-head h2 { margin: 0; font-size: 1.05rem; letter-spacing: -.02em; }
.compose-share-body {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 0 20px 18px;
  overflow-y: auto;
}
.compose-share-reason {
  display: flex;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-2);
}
.compose-share-reason .icon { width: 17px; height: 17px; flex: none; margin-top: 1px; color: var(--accent-ink); }
.compose-share-reason p { margin: 0; color: var(--text-2); font-size: .72rem; line-height: 1.55; }
.compose-share-file {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--shadow);
}
.compose-share-file-icon {
  width: 44px;
  height: 44px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: var(--surface-3);
  color: var(--text-2);
  font-size: .6rem;
  font-weight: 800;
  letter-spacing: .04em;
}
.compose-share-file-copy { flex: 1; min-width: 0; }
.compose-share-file-copy strong { display: block; font-size: .78rem; font-weight: 650; line-height: 1.35; overflow-wrap: anywhere; }
.compose-share-file-copy span { display: block; margin-top: 3px; color: var(--text-3); font-size: .64rem; }
.compose-share-file-copy b { color: var(--text-2); font-weight: 650; }
.compose-share-badge {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  background: var(--success-soft);
  color: var(--success);
  font-size: .55rem;
  font-weight: 700;
}
.compose-share-badge .icon { width: 12px; height: 12px; }
.compose-share-section { display: flex; flex-direction: column; gap: 8px; }
.compose-share-section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.compose-share-section-head > span { color: var(--text); font-size: .7rem; font-weight: 650; }
.compose-share-section-head > small { color: var(--text-3); font-size: .6rem; }
.compose-share-days { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.compose-share-day {
  height: 32px;
  padding: 0 11px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text-2);
  font: inherit;
  font-size: .66rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color .15s, background .15s, color .15s;
}
.compose-share-day:hover { border-color: var(--border-strong); background: var(--surface-2); }
.compose-share-day.is-active { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-ink); }
.compose-share-custom {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  margin-inline-start: auto;
  padding: 0 9px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text-3);
  font-size: .62rem;
}
.compose-share-custom:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.compose-share-custom input {
  width: 44px;
  border: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: .68rem;
  font-weight: 650;
  text-align: end;
  outline: 0;
}
.compose-share-privacy { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.compose-share-choice {
  position: relative;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 11px 12px;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: var(--surface);
  cursor: pointer;
  transition: border-color .15s, background .15s;
}
.compose-share-choice:hover { border-color: var(--border-strong); background: var(--surface-2); }
.compose-share-choice.is-active { border-color: var(--accent); background: var(--accent-soft); }
.compose-share-choice input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.compose-share-choice:focus-within { outline: 2px solid var(--focus); outline-offset: 1px; }
.compose-share-choice-icon {
  width: 30px;
  height: 30px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--text-2);
}
.compose-share-choice.is-active .compose-share-choice-icon { background: var(--surface); color: var(--accent-ink); }
.compose-share-choice-icon .icon { width: 15px; height: 15px; }
.compose-share-choice > span:nth-of-type(2) { flex: 1; min-width: 0; }
.compose-share-choice strong { display: block; color: var(--text); font-size: .68rem; font-weight: 650; line-height: 1.25; }
.compose-share-choice small { display: block; margin-top: 2px; color: var(--text-3); font-size: .57rem; line-height: 1.3; }
.compose-share-check { width: 14px; height: 14px; flex: none; color: var(--accent-ink); opacity: 0; }
.compose-share-choice.is-active .compose-share-check { opacity: 1; }
.compose-share-field { display: flex; flex-direction: column; gap: 6px; }
.compose-share-field > span { color: var(--text); font-size: .68rem; font-weight: 650; }
.compose-share-field em { font-style: normal; font-weight: 500; color: var(--text-3); }
.compose-share-field small { color: var(--text-3); font-size: .6rem; line-height: 1.4; }
.compose-share-input {
  width: 100%;
  height: 38px;
  padding: 0 11px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: .72rem;
  outline: 0;
}
.compose-share-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.compose-share-status { margin: 0; padding: 10px 12px; border-radius: 9px; background: var(--surface-2); color: var(--text-2); font-size: .66rem; line-height: 1.45; }
.compose-share-status.is-error { background: var(--danger-soft); color: var(--danger); }
.compose-share-progress { height: 6px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.compose-share-progress > span { display: block; width: 0; height: 100%; border-radius: inherit; background: var(--accent); transition: width .2s ease; }
.compose-share-foot {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
  padding: 14px 20px;
  border-top: 1px solid var(--border);
  background: var(--surface-2);
}
.compose-share-submit { display: inline-flex; align-items: center; gap: 8px; }
.compose-share-spinner {
  width: 14px;
  height: 14px;
  display: none;
  border: 2px solid rgba(255, 255, 255, .42);
  border-top-color: #fff;
  border-radius: 50%;
  animation: a8m-spin .7s linear infinite;
}
.compose-share-submit.is-busy .compose-share-spinner { display: block; }
.compose-share-submit:disabled { opacity: .72; cursor: progress; }
@media (max-width: 560px) {
  .compose-share-dialog { max-height: calc(100dvh - 16px); }
  .compose-share-head { padding: 16px 16px 12px; }
  .compose-share-body { padding: 0 16px 16px; }
  .compose-share-privacy { grid-template-columns: 1fr; }
  .compose-share-custom { margin-inline-start: 0; }
  .compose-share-badge { display: none; }
  .compose-share-foot { padding: 12px 16px; }
  .compose-share-foot .btn-primary { flex: 1; justify-content: center; }
}
