:root {
  color-scheme: light;
  --accent: #1f6c52;
  --accent-strong: #145c44;
  --accent-soft: #e7f2ec;
  --text: #242424;
  /* 次要文字色。取值必须同时过本 App 出现的三种浅底，取最深的 .profile-card 渐变端 #eef7f2 为准：
     #777 → 4.05、#767676 → 4.16、#707070 → 4.53 —— 只有 #707070 一次全过（白底 4.95、附件卡 #fbfbfb 4.79）。 */
  --muted: #707070;
  --line: #e7e7e7;
  --surface: #ffffff;
  --soft: #f7f7f7;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  /* 安全区最多取 10px 放进底栏，避免 iOS 的 34px inset 被画成大块空白。 */
  --bottom-inset: min(var(--safe-bottom), 10px);
  --bottom: calc(70px + var(--bottom-inset));
  /* iOS 主屏幕 Web App 冷启动时，布局视口偶尔比物理屏幕少一个状态栏高度。
     index.html 会用 fixed 探针实测差值；正常启动时保持 0。 */
  --app-gap: 0px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; width: 100%; min-height: 100%; background: #fff; color: var(--text); }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { overflow-x: hidden; overscroll-behavior: none; }
button, input, textarea { font: inherit; }
button { color: inherit; border: 0; background: none; cursor: pointer; }
img { display: block; }
[hidden] { display: none !important; }

.app {
  position: relative;
  width: min(100vw, 480px);
  height: calc(100dvh + var(--app-gap));
  min-height: calc(100dvh + var(--app-gap));
  margin: 0 auto;
  overflow: hidden;
  background: var(--surface);
  box-shadow: 0 0 52px rgba(30, 55, 45, .18);
}

.view { position: absolute; inset: 0 0 var(--bottom); display: none; background: #fff; overflow: hidden; }
.view.is-active { display: block; }
.hero {
  position: relative;
  color: #fff;
  background-image: linear-gradient(90deg, rgba(10, 51, 38, .11), rgba(10, 51, 38, .02)), url("assets/outlook-hero.svg");
  background-position: center;
  /* 保持壁纸原始纵横比，避免 100% 100% 把中间绿叶横向拉宽。 */
  background-size: cover;
  background-repeat: no-repeat;
}
.mail-hero { height: calc(94px + var(--safe-top)); padding: calc(8px + var(--safe-top)) 27px 6px; }
.hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(3, 29, 21, .08), rgba(3, 29, 21, .18)); pointer-events: none; }
/* 网格间隙 11→10px：给 hero-actions 让出 1px 加宽（见下），净效果是标题轨反而变宽。 */
.hero-topline { position: relative; z-index: 1; display: grid; grid-template-columns: 32px 1fr auto; align-items: center; gap: 8px; }
/* 原版 iOS Outlook 的左上入口视觉直径约 32px，但点击热区仍是 44px。 */
.hero h1 { margin: 0; color: var(--accent-strong); font-size: clamp(28px, 7vw, 31px); font-weight: 700; letter-spacing: -.55px; }
.brand-button { position: relative; display: grid; place-items: center; justify-self: center; width: 32px; height: 32px; border-radius: 50%; background: transparent; }
.brand-button::before { content: ""; position: absolute; inset: 0; border-radius: 50%; background: rgba(255, 255, 255, .97); box-shadow: 0 1px 6px rgba(0, 0, 0, .09); }
.brand-button::after { content: ""; position: absolute; left: 50%; top: 50%; width: 44px; height: 44px; transform: translate(-50%, -50%); }
.brand-button > * { position: relative; z-index: 1; }
.account-home-icon { width: 18px; height: 18px; }
.microsoft-mark { display: grid; grid-template-columns: repeat(2, 10px); gap: 2px; }
.microsoft-mark i { width: 10px; height: 10px; }
.microsoft-mark i:nth-child(1) { background: #f35325; }
.microsoft-mark i:nth-child(2) { background: #81bc06; }
.microsoft-mark i:nth-child(3) { background: #05a6f0; }
.microsoft-mark i:nth-child(4) { background: #ffba08; }
.microsoft-mark.small { grid-template-columns: repeat(2, 8px); }
.microsoft-mark.small i { width: 8px; height: 8px; }
/* 顶栏两个图标按钮视觉保持 36px，热区用 ::after 扩到 44px。
   两者中心距必须 ≥44px 才不互相吃掉，所以 gap 由 3px 提到 8px（36+8=44）。
   不能直接把盒子放大到 44px —— 那样图标区多占 13px，320px 视口下
   "September"（min-content 148px）会撞上图标区。 */
/* 间隙 9px ⇒ 两按钮中心距 45px，两条 44px 热区互不侵占，各自拿到完整 44px（8px 时中心距正好 44，边界像素被判给后绘制者，左键只剩 43.75px）。 */
.hero-actions { display: flex; align-items: center; gap: 9px; }
.hero-icon-button { position: relative; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: transparent; }
.hero-icon-button::after { content: ""; position: absolute; left: 50%; top: 50%; width: max(100%, 44px); height: max(100%, 44px); transform: translate(-50%, -50%); }
.hero-icon-button img { width: 22px; height: 22px; filter: brightness(0) invert(1); }
.mail-controls { position: absolute; z-index: 2; left: 16px; right: 16px; bottom: 6px; display: flex; align-items: center; justify-content: space-between; }
.focus-switch { display: flex; align-items: center; padding: 1px 2px; border-radius: 15px; background: rgba(20, 34, 28, .54); backdrop-filter: blur(15px); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .1); }
.focus-tab { position: relative; min-width: 0; min-height: 28px; padding: 2px 9px; border-radius: 14px; color: rgba(255, 255, 255, .9); font-size: 13px; font-weight: 620; }
.focus-tab::after { content: ""; position: absolute; inset: 50% 0 auto; height: 44px; transform: translateY(-50%); }
.focus-tab.is-active { color: var(--accent); background: #fff; box-shadow: 0 2px 10px rgba(0, 0, 0, .13); }
.filter-button { position: relative; display: flex; align-items: center; gap: 4px; min-height: 27px; padding: 2px 10px; border-radius: 14px; color: #fff; background: rgba(20, 34, 28, .53); backdrop-filter: blur(15px); font-size: 13px; font-weight: 610; }
.filter-button::after { content: ""; position: absolute; inset: 50% 0 auto; height: 44px; transform: translateY(-50%); }
.filter-button img { width: 16px; height: 16px; filter: brightness(0) invert(1); }

.mail-body { height: calc(100% - 94px - var(--safe-top)); overflow-y: auto; overscroll-behavior: contain; background: #fff; padding-bottom: 92px; }
.mail-group-title { margin: 0; padding: 14px 17px 7px; font-size: 17px; line-height: 1.15; font-weight: 540; color: #5f5f5f; }
.message-row { position: relative; display: grid; grid-template-columns: 40px minmax(0, 1fr) 54px; gap: 10px; min-height: 79px; padding: 9px 15px 8px; background: #fff; text-align: left; }
.message-row::after { content: ""; position: absolute; left: 65px; right: 0; bottom: 0; height: 1px; background: var(--line); }
.message-row:active { background: #f3f5f4; }
.sender-avatar { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; color: #fff; font-size: 13px; font-weight: 700; letter-spacing: .2px; }
.message-main { min-width: 0; padding-top: 1px; }
.sender-line { display: flex; align-items: center; gap: 7px; min-width: 0; }
.sender-line strong { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 15px; font-weight: 640; }
.unread-dot { flex: 0 0 8px; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.message-subject, .message-preview { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.message-subject { margin-top: 1px; color: #313131; font-size: 13.5px; line-height: 1.2; font-weight: 570; }
.message-preview { margin-top: 2px; color: var(--muted); font-size: 12.5px; line-height: 1.2; }
.message-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 12px; padding-top: 2px; color: var(--muted); font-size: 11px; white-space: nowrap; }
.message-meta img { width: 18px; height: 18px; opacity: .58; }
.empty-state { min-height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 0 24px 88px; text-align: center; }
.empty-state img { width: 128px; max-height: 150px; }
.empty-state h2 { margin: 11px 0 5px; font-size: 18px; font-weight: 650; }
.empty-state p { margin: 0; color: #737373; font-size: 14px; }

.calendar-hero { height: calc(110px + var(--safe-top)); padding: calc(11px + var(--safe-top)) 17px 8px; }
.calendar-brand img { width: 23px; height: 23px; filter: invert(35%) sepia(18%) saturate(1135%) hue-rotate(107deg) brightness(88%); }
.weekday-row { position: absolute; z-index: 1; left: 0; right: 0; bottom: 0; display: grid; grid-template-columns: repeat(7, 1fr); padding: 7px 0; border-radius: 0; background: rgba(20, 34, 28, .5); backdrop-filter: blur(15px); }
.weekday-row span { text-align: center; font-size: 13px; font-weight: 650; }
/* 底部内边距 10 → 8，把日期按钮内容高从 42 顶到 44；总高仍是 54，所以 .agenda-list 的 164px 不用改。 */
.date-strip { position: relative; z-index: 2; display: grid; grid-template-columns: repeat(7, 1fr); height: 54px; padding: 2px 8px 8px; background: #fff; border-radius: 0 0 18px 18px; box-shadow: 0 4px 12px rgba(28, 58, 45, .08); }
.date-strip button { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; color: #424242; }
.date-strip small { display: grid; place-items: center; width: 33px; height: 33px; border-radius: 50%; font-size: 15px; }
.date-strip em { position: absolute; top: 2px; font-size: 11px; color: var(--muted); font-style: normal; }
.date-strip button:has(em) small { margin-top: 8px; }
.date-strip .is-today small { color: #fff; background: var(--accent); font-weight: 700; }
.date-grabber { position: absolute; left: 50%; bottom: 3px; width: 30px; height: 4px; border-radius: 4px; background: #656565; transform: translateX(-50%); opacity: .62; }
.agenda-list { height: calc(100% - 164px - var(--safe-top)); overflow-y: auto; padding-bottom: 92px; background: #fff; }
.agenda-day { border-bottom: 1px solid var(--line); }
.agenda-day-heading { display: flex; align-items: baseline; gap: 5px; padding: 10px 16px 8px; font-size: 15px; font-weight: 560; }
.agenda-day.is-today .agenda-day-heading { color: var(--accent); background: var(--accent-soft); }
.agenda-day-heading span { color: #686868; font-weight: 500; }
.agenda-day.is-today .agenda-day-heading span { color: var(--accent); }
.agenda-empty { padding: 13px 16px 15px; color: var(--muted); font-size: 13px; }
.agenda-event { display: grid; grid-template-columns: 66px 10px 1fr; gap: 9px; width: 100%; padding: 11px 16px 13px; background: #fff; text-align: left; }
.agenda-event:active { background: #f4f6f5; }
.agenda-time { color: #5f5f5f; font-size: 13px; }
.event-dot { width: 9px; height: 9px; margin-top: 3px; border-radius: 50%; background: #7655a8; }
.event-copy strong { display: block; font-size: 15px; font-weight: 620; line-height: 1.25; }
.event-copy span { display: block; margin-top: 4px; color: var(--muted); font-size: 13px; }

.floating-actions { position: absolute; z-index: 25; right: 14px; bottom: calc(var(--bottom) + 13px); display: flex; gap: 10px; }
.float-button { display: grid; place-items: center; width: 50px; height: 50px; border-radius: 15px; background: rgba(255, 255, 255, .98); box-shadow: 0 5px 18px rgba(22, 56, 43, .2), inset 0 0 0 1px rgba(0, 0, 0, .04); }
.primary-float { order: 1; }
.copilot-button { order: 2; }
.float-button img { width: 25px; height: 25px; }
.copilot-button img { width: 30px; height: 30px; }
.primary-float img { filter: invert(36%) sepia(18%) saturate(1246%) hue-rotate(107deg) brightness(83%); }

.bottom-nav { position: fixed; z-index: 30; left: 50%; right: auto; bottom: calc(-1 * var(--app-gap)); width: min(100%, 480px); height: var(--bottom); display: grid; grid-template-columns: repeat(3, 1fr); padding: 6px 10px calc(6px + var(--bottom-inset)); transform: translateX(-50%); background: #fff; border-top: 1px solid #e2e2e2; }
.app.apps-open .bottom-nav { z-index: 75; }
.app.apps-open .floating-actions { visibility: hidden; }
.nav-item { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-height: 52px; color: #656565; font-size: 12px; line-height: 1; font-weight: 520; }
.nav-item img { width: 23px; height: 23px; opacity: .78; }
.nav-item .filled { display: none; }
.nav-item.is-active { color: var(--accent); font-weight: 650; }
.nav-item.is-active .regular { display: none; }
.nav-item.is-active .filled { display: block; filter: invert(36%) sepia(18%) saturate(1246%) hue-rotate(107deg) brightness(83%); opacity: 1; }

.overlay { position: absolute; z-index: 49; inset: 0; background: rgba(0, 0, 0, .42); opacity: 0; transition: opacity .2s ease; }
.overlay.is-open { opacity: 1; }
/* 关闭态必须 visibility:hidden —— 只靠 translateX(-102%) 推出屏幕是不够的：抽屉仍留在渲染树里，
   box-shadow 12px 0 30px 照样画。抽屉宽 360.8、位移 -368 ⇒ 右边缘在 -7.2，阴影偏移 +12 落到 +4.8，
   模糊再糊出三十多像素，实测左边缘 x=0..35 是一条全高灰带（x=0 处 227，纯白应为 255）。
   日历视图里正是它把 .agenda-empty 的对比度从 4.95 压到 4.42。
   visibility 用 0s 时长 + 延迟：关闭时等 250ms 滑出动画走完再隐藏，打开时立刻可见，
   这样阴影只会和抽屉本体一起出现，不会在抽屉还在屏外时先冒出来。
   （.bottom-sheet 没有这个问题，是因为它在关闭时被赋了 hidden 属性直接移出渲染树。） */
.account-drawer { position: absolute; z-index: 50; inset: 0 auto 0 0; display: flex; width: min(92%, 360px); background: #fff; box-shadow: 12px 0 30px rgba(0, 0, 0, .18); transform: translateX(-102%); visibility: hidden; transition: transform .25s cubic-bezier(.2, .8, .2, 1), visibility 0s .25s; }
.account-drawer.is-open { transform: translateX(0); visibility: visible; transition: transform .25s cubic-bezier(.2, .8, .2, 1), visibility 0s 0s; }
/* 抽屉默认态按真机原版的“总账户”布局重建：70px 账户轨 + 约 290px 文件夹面板。
   之前的 57px 轨道与单邮箱 Favorites 详情页不是同一种状态，怎么微调都无法对齐。 */
.account-rail { display: flex; flex: 0 0 70px; flex-direction: column; align-items: center; gap: 12px; padding: max(8px, env(safe-area-inset-top)) 13px calc(18px + env(safe-area-inset-bottom)); background: #f1f2f3; border-right: 1px solid #e1e1e1; }
.account-rail::-webkit-scrollbar { display: none; }
.rail-icon, .rail-avatar { display: grid; place-items: center; flex: 0 0 44px; width: 44px; height: 44px; border-radius: 50%; }
.rail-icon { font-size: 27px; color: #5e5e5e; }
.rail-icon img { width: 24px; height: 24px; opacity: .72; }
.rail-icon.is-selected { background: #fff; box-shadow: 0 0 0 2px var(--accent), 0 3px 10px rgba(0, 0, 0, .08); }
.rail-avatar { color: #fff; font-size: 12px; font-weight: 700; letter-spacing: .3px; }
.rail-avatar.gold { background: #93701f; }
.rail-avatar.blue { background: #3c77ab; }
.rail-avatar.violet { background: #8064a2; }
/* 账户首字是文字，不是纯装饰色块；候选色均以白字 ≥4.5:1 校验。 */
.rail-avatar.pink { background: #b32f7d; }
.rail-avatar.brown { background: #9b5d48; }
.rail-avatar.red { background: #c72f2a; }
.rail-avatar.green { background: #16864a; }
.rail-spacer { flex: 1 0 12px; }
.folder-panel { min-width: 0; flex: 1; overflow-y: auto; padding: max(8px, env(safe-area-inset-top)) 0 25px; }
.account-heading { display: flex; justify-content: space-between; align-items: center; min-height: 66px; padding: 0 20px 8px; border-bottom: 1px solid #e5e5e5; }
/* 总账户标题在最窄档仍需给时钟完整留位；文案可省略而按钮热区不可溢出到遮罩。 */
.account-heading > div { min-width: 0; }
.account-heading strong { display: block; font-size: 22px; font-weight: 650; letter-spacing: -.25px; }
.account-heading span { display: block; max-width: 225px; margin-top: 3px; color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-heading button { position: relative; display: grid; place-items: center; flex: 0 0 30px; padding: 0; }
.account-heading button::after { content: ""; position: absolute; left: 50%; top: 50%; width: max(100%, 44px); height: max(100%, 44px); transform: translate(-50%, -50%); }
.account-heading button img { width: 23px; height: 23px; opacity: .75; }
.folder-list { padding: 6px 13px 0; }
.folder-row { display: grid; grid-template-columns: 29px 1fr auto; align-items: center; gap: 12px; width: 100%; min-height: 50px; padding: 4px 8px; border-radius: 10px; text-align: left; }
/* 原版总账户态只以绿色图标/文字标示 Inbox，不铺浅绿背景。 */
.folder-row.is-active { color: var(--accent); background: transparent; font-weight: 650; }
.folder-row img { width: 22px; height: 22px; opacity: .68; }
.folder-row.is-active img { filter: invert(36%) sepia(18%) saturate(1246%) hue-rotate(107deg) brightness(83%); opacity: 1; }
.folder-row span { font-size: 16px; }
.folder-row small { min-width: 24px; padding: 2px 5px; border-radius: 6px; color: var(--muted); background: #f6f6f6; font-size: 12px; text-align: center; }
.folder-row.is-active small { color: var(--accent); background: transparent; }

.dim-overlay { z-index: 69; backdrop-filter: blur(1px); }
.bottom-sheet { position: absolute; z-index: 70; left: 0; right: 0; bottom: 0; border-radius: 25px 25px 0 0; background: #fff; box-shadow: 0 -12px 34px rgba(0, 0, 0, .16); transform: translateY(105%); transition: transform .25s cubic-bezier(.2, .8, .2, 1); }
.bottom-sheet.is-open { transform: translateY(0); }
/* 按钮盒本身即 44px 热区，可见把手条用 ::after 钉在盒内同一视觉位置（13px）。
   不能再用居中的 ::before 扩热区：.apps-sheet 有 overflow-y:auto，会把上探的 4.5px 剪到弹层顶边，
   实测只剩 39.5px；.filter-sheet 无 overflow 声明所以侥幸完整 —— 两处行为不一致，是同一个 bug 的两种表现。 */
.sheet-grabber { position: absolute; top: 0; left: 50%; width: 56px; height: 44px; padding: 0; transform: translateX(-50%); opacity: .78; }
.sheet-grabber::after { content: ""; position: absolute; left: 7px; right: 7px; top: 13px; height: 5px; border-radius: 5px; background: #555; }
.apps-sheet { bottom: var(--bottom); height: min(400px, calc(100% - var(--bottom) - var(--safe-top) - 70px)); padding: 42px 20px 24px; overflow-y: auto; }
.reorder-button { position: absolute; top: 25px; right: 22px; color: var(--accent); font-size: 14px; font-weight: 650; }
/* 加高会盖住第一行 App 磁贴（磁贴从 60px 起），只扩热区。 */
.reorder-button::after { content: ""; position: absolute; left: 50%; top: 50%; width: max(100%, 44px); height: max(100%, 44px); transform: translate(-50%, -50%); }
.app-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 25px 10px; padding-top: 18px; }
.app-grid button { display: flex; flex-direction: column; align-items: center; gap: 8px; font-size: 12px; }
.app-icon { display: grid; place-items: center; width: 49px; height: 49px; border: 1px solid #dbdddc; border-radius: 13px; background: #fff; box-shadow: 0 3px 10px rgba(0, 0, 0, .04); }
.app-icon img { width: 26px; height: 26px; opacity: .78; }
.app-grid button[data-app="copilot"] .app-icon img { width: 31px; height: 31px; opacity: 1; }
.sheet-nav { position: absolute; left: 0; right: 0; bottom: 0; display: grid; grid-template-columns: repeat(3, 1fr); height: 66px; border-top: 1px solid #e8e8e8; }
.sheet-nav button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: #747474; font-size: 11px; }
.sheet-nav img { width: 23px; height: 23px; opacity: .68; }
.sheet-nav .is-active { color: var(--accent); font-weight: 650; }
.sheet-nav .is-active img { filter: invert(36%) sepia(18%) saturate(1246%) hue-rotate(107deg) brightness(83%); opacity: 1; }
.filter-sheet { padding: 30px 18px calc(20px + env(safe-area-inset-bottom)); }
.filter-sheet h2 { margin: 9px 0 15px; font-size: 20px; }
.filter-option { display: flex; align-items: center; justify-content: space-between; width: 100%; padding: 14px 4px; border-bottom: 1px solid var(--line); font-size: 16px; text-align: left; }
.filter-option img { display: none; width: 21px; height: 21px; }
.filter-option.is-active { color: var(--accent); font-weight: 650; }
.filter-option.is-active img { display: block; filter: invert(36%) sepia(18%) saturate(1246%) hue-rotate(107deg) brightness(83%); }

.full-panel { position: absolute; z-index: 80; inset: 0; overflow-x: hidden; overflow-y: auto; background: #fff; transform: translateX(102%); transition: transform .23s cubic-bezier(.2, .8, .2, 1); }
.full-panel.is-open { transform: translateX(0); }
.panel-bar { position: sticky; z-index: 2; top: 0; display: flex; align-items: center; gap: 9px; min-height: calc(58px + env(safe-area-inset-top)); padding: calc(9px + env(safe-area-inset-top)) 12px 9px; background: rgba(255, 255, 255, .97); border-bottom: 1px solid var(--line); backdrop-filter: blur(20px); }
.panel-bar > button { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; }
.panel-bar > button img { width: 22px; height: 22px; }
.search-field { flex: 1; display: flex; align-items: center; gap: 8px; height: 44px; padding: 0 12px; border-radius: 10px; background: #f0f2f1; }
.search-field img { width: 20px; height: 20px; opacity: .6; }
/* align-self: stretch 让输入框撑满 44px 字段高度，否则热区只有一行文字高（实测 20px）。 */
.search-field input { align-self: stretch; min-width: 0; flex: 1; border: 0; outline: 0; background: transparent; font-size: 16px; }
.search-results { padding: 20px; }
.search-results > p { color: var(--muted); text-align: center; }
.search-hit { display: grid; grid-template-columns: 42px 1fr; gap: 11px; width: 100%; padding: 12px 0; border-bottom: 1px solid var(--line); text-align: left; }
.search-hit .sender-avatar { width: 40px; height: 40px; }
.search-hit strong, .search-hit span:not(.sender-avatar) { display: block; }
.search-hit span:not(.sender-avatar) { margin-top: 3px; color: var(--muted); font-size: 13px; }

.detail-topbar, .compose-topbar, .utility-topbar { position: sticky; z-index: 2; top: 0; display: flex; align-items: center; gap: 8px; min-height: calc(58px + env(safe-area-inset-top)); padding: calc(9px + env(safe-area-inset-top)) 11px 9px; background: rgba(255, 255, 255, .97); border-bottom: 1px solid var(--line); backdrop-filter: blur(20px); }
.detail-topbar button, .compose-topbar button, .utility-topbar button { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; }
.detail-topbar img, .compose-topbar img, .utility-topbar img { width: 22px; height: 22px; }
.detail-topbar .bar-spacer, .compose-topbar .bar-spacer, .utility-topbar .bar-spacer { flex: 1; }
.detail-copy { padding: 22px 20px 120px; }
.detail-copy h2 { margin: 0 0 17px; font-size: 24px; line-height: 1.25; }
.detail-sender { display: grid; grid-template-columns: 47px 1fr auto; gap: 11px; align-items: center; padding-bottom: 20px; border-bottom: 1px solid var(--line); }
.detail-sender .sender-avatar { width: 46px; height: 46px; }
.detail-sender strong, .detail-sender span:not(.sender-avatar) { display: block; }
.detail-sender span:not(.sender-avatar), .detail-sender time { color: var(--muted); font-size: 12px; }
.message-body { padding-top: 19px; font-size: 16px; line-height: 1.55; }
.message-body p { white-space: pre-line; }
.attachment-list { display: grid; gap: 9px; margin-top: 20px; }
.attachment-card { display: flex; align-items: center; gap: 10px; padding: 12px; border: 1px solid #dedede; border-radius: 12px; background: #fbfbfb; }
.attachment-card img { width: 24px; height: 24px; }
.attachment-card strong, .attachment-card small { display: block; }
.attachment-card small { margin-top: 3px; color: var(--muted); }

.compose-topbar strong { font-size: 18px; }
.compose-topbar .send-button { display: grid; place-items: center; min-width: 44px; min-height: 44px; color: var(--accent); font-weight: 700; }
.compose-form { padding: 0 17px 120px; }
.compose-field { display: grid; grid-template-columns: 63px 1fr; align-items: center; min-height: 54px; border-bottom: 1px solid var(--line); }
.compose-field label { color: #6c6c6c; font-size: 15px; }
.compose-field input { align-self: stretch; min-height: 44px; width: 100%; border: 0; outline: 0; font-size: 16px; }
.compose-form textarea { width: 100%; min-height: 330px; padding: 17px 0; border: 0; outline: 0; resize: none; font-size: 16px; line-height: 1.55; }
.compose-tools { display: flex; gap: 8px; }
.compose-tools button { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: #f4f4f4; }
.compose-tools img { width: 21px; height: 21px; }
.compose-extras { min-height: 34px; padding-top: 8px; }
.compose-chip { display: inline-flex; align-items: center; gap: 7px; min-height: 34px; padding: 5px 8px; border-radius: 9px; background: #edf4f0; color: var(--accent); font-size: 13px; font-weight: 600; }
.compose-chip > img { width: 17px; height: 17px; }
.compose-chip > button { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; font-size: 20px; line-height: 1; }

.utility-copy { padding: 18px 18px 110px; }
.utility-copy h2 { margin: 0 0 4px; font-size: 25px; }
.utility-copy > p { margin-top: 5px; color: var(--muted); }
.utility-list { margin-top: 20px; border-top: 1px solid var(--line); }
.utility-row { display: grid; grid-template-columns: 43px 1fr; gap: 11px; align-items: center; width: 100%; padding: 13px 0; border-bottom: 1px solid var(--line); text-align: left; }
.utility-row .sender-avatar { width: 40px; height: 40px; }
.utility-row strong, .utility-row span:not(.app-icon):not(.sender-avatar) { display: block; }
.utility-row span:not(.app-icon):not(.sender-avatar) { margin-top: 3px; color: var(--muted); font-size: 13px; }
.utility-empty { padding: 24px 0; color: var(--muted); text-align: center; }
.danger-row strong { color: #b42318; }
.task-row.is-complete { opacity: .62; }
.task-row.is-complete strong { text-decoration: line-through; }
.profile-card { margin-top: 18px; padding: 18px; border-radius: 16px; background: linear-gradient(135deg, #eef7f2, #f8fbf9); border: 1px solid #dcebe3; }
.profile-card dl { margin: 14px 0 0; }
.profile-card dl > div { padding: 8px 0; border-top: 1px solid #dce7e1; }
.profile-card dt { color: var(--muted); font-size: 12px; }
.profile-card dd { margin: 3px 0 0; font-size: 15px; font-weight: 560; }
.quick-actions { display: grid; gap: 9px; margin-top: 16px; }
.quick-actions button { min-height: 44px; padding: 9px 12px; border: 1px solid #d6e5dd; border-radius: 11px; background: #fff; color: var(--accent); font-weight: 650; text-align: left; }
.quick-actions button.is-selected { color: #fff; background: var(--accent); border-color: var(--accent); }
.view-actions { grid-template-columns: repeat(3, 1fr); }
.view-actions button { text-align: center; }
.copilot-response { min-height: 0; margin-top: 12px; padding: 0; border: 0; color: #315144; font-size: 14px; line-height: 1.45; }
.copilot-response:not(:empty) { padding: 12px; border-radius: 11px; background: #fff; box-shadow: inset 0 0 0 1px #dce7e1; }
.setting-list { margin-top: 20px; border-top: 1px solid var(--line); }
.setting-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; width: 100%; min-height: 67px; padding: 11px 0; border-bottom: 1px solid var(--line); text-align: left; }
.setting-row span, .setting-row strong, .setting-row small { display: block; }
.setting-row small { margin-top: 3px; color: var(--muted); font-size: 12px; }
.setting-row i { position: relative; flex: 0 0 47px; width: 47px; height: 28px; border-radius: 16px; background: #b9b9b9; transition: .18s ease; }
.setting-row i::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 4px rgba(0,0,0,.2); transition: .18s ease; }
.setting-row.is-on i { background: var(--accent); }
.setting-row.is-on i::after { transform: translateX(19px); }
.record-card { position: relative; overflow: hidden; }
.record-accent { position: absolute; inset: 0 auto 0 0; width: 5px; }
.record-card h3, .contact-card h3, .file-card h3 { margin-bottom: 5px; }
.contact-card > .sender-avatar { width: 52px; height: 52px; margin-bottom: 12px; font-size: 16px; }
.file-card > .app-icon { margin-bottom: 12px; }
.record-actions { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 9px; margin-top: 16px; }
.record-actions button { min-height: 44px; padding: 8px; border-radius: 10px; color: var(--accent); background: #fff; box-shadow: inset 0 0 0 1px #cfe1d8; font-weight: 650; }

.toast { position: absolute; z-index: 100; left: 50%; bottom: calc(var(--bottom) + 18px); max-width: 84%; padding: 10px 15px; border-radius: 10px; color: #fff; background: rgba(31, 31, 31, .92); font-size: 13px; text-align: center; opacity: 0; pointer-events: none; transform: translate(-50%, 10px); transition: .2s ease; }
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 360px) {
  .focus-tab { min-width: 0; padding-inline: 8px; }
  .message-row { grid-template-columns: 38px minmax(0, 1fr) 48px; gap: 8px; padding-inline: 12px; }
  .sender-avatar { width: 38px; height: 38px; }
  .message-row::after { left: 58px; }
  .app-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (min-width: 481px) {
  body { display: grid; place-items: start center; padding: 0; }
  .app { border-radius: 0; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; }
}
