/* joobmail design system · 2026-10-23
   One accent, warm neutral surfaces, IBM Plex Sans Thai (OFL, self-hosted), real dark mode.
   Every URL is relative so the same files work at / and at /joobmail/ behind Apache. */

@font-face { font-family:"IBM Plex Sans Thai"; font-style:normal; font-weight:400; font-display:swap; src:url(./fonts/IBMPlexSansThai-Regular.woff2?v=0350508969da) format("woff2") }
@font-face { font-family:"IBM Plex Sans Thai"; font-style:normal; font-weight:500; font-display:swap; src:url(./fonts/IBMPlexSansThai-Medium.woff2?v=8249537de376) format("woff2") }
@font-face { font-family:"IBM Plex Sans Thai"; font-style:normal; font-weight:600; font-display:swap; src:url(./fonts/IBMPlexSansThai-SemiBold.woff2?v=83f9d86c099e) format("woff2") }

:root {
  --font:"IBM Plex Sans Thai","Leelawadee UI","Segoe UI",system-ui,-apple-system,sans-serif;
  --mono:ui-monospace,"Cascadia Mono",Consolas,Menlo,monospace;
  --bg:#f4f3ef; --surface:#ffffff; --surface-2:#edece7; --surface-3:#e4e2dc;
  --text:#17191c; --text-2:#3d4248; --muted:#5b616a; --border:#e2e0da; --border-strong:#cfccc5;
  --accent:#0f5f58; --accent-hover:#0b4b45; --accent-soft:#e2efec; --accent-text:#ffffff; --accent-ring:rgba(15,95,88,.28);
  --danger:#b42318; --danger-soft:#fbeae8; --success:#166b3f; --success-soft:#e3f3e9; --warning:#9a5b00; --warning-soft:#fbf0dc; --info:#2f5aa6; --info-soft:#e6edfa;
  --radius:12px; --radius-sm:8px; --radius-lg:20px; --radius-pill:999px;
  --shadow:0 1px 2px rgba(23,25,28,.05),0 6px 20px rgba(23,25,28,.06); --shadow-lg:0 2px 6px rgba(23,25,28,.08),0 24px 60px rgba(23,25,28,.14);
  --header-h:64px; --sidebar-w:264px; --list-w:400px; --tabbar-h:60px;
  --ease:cubic-bezier(.2,.7,.2,1); --fast:150ms; --normal:220ms;
  color-scheme:light;
}
[data-theme="dark"] {
  --bg:#0f1113; --surface:#171a1d; --surface-2:#1e2226; --surface-3:#262b30;
  --text:#eceeef; --text-2:#c6cacf; --muted:#9aa0a6; --border:#272c31; --border-strong:#363c43;
  --accent:#6ed3c3; --accent-hover:#8be0d2; --accent-soft:#163331; --accent-text:#07201d; --accent-ring:rgba(110,211,195,.35);
  --danger:#f08f86; --danger-soft:#3a1d1b; --success:#7bd3a0; --success-soft:#17301f; --warning:#f0bf6a; --warning-soft:#3a2a10; --info:#8db0f0; --info-soft:#1a2740;
  --shadow:0 1px 2px rgba(0,0,0,.4),0 8px 24px rgba(0,0,0,.35); --shadow-lg:0 2px 6px rgba(0,0,0,.5),0 24px 60px rgba(0,0,0,.6);
  color-scheme:dark;
}

/* ---------- base ---------- */
*,*::before,*::after { box-sizing:border-box }
html { -webkit-text-size-adjust:100%; scroll-behavior:smooth }
body { margin:0; font-family:var(--font); font-size:15px; line-height:1.6; color:var(--text); background:var(--bg); font-synthesis:none; -webkit-font-smoothing:antialiased; text-rendering:optimizeLegibility }
[hidden] { display:none !important }
h1,h2,h3,h4 { margin:0; font-weight:600; line-height:1.25; letter-spacing:-.01em; overflow-wrap:anywhere }
h1 { font-size:28px } h2 { font-size:22px } h3 { font-size:17px } h4 { font-size:15px }
p { margin:0 } a { color:var(--accent); text-decoration:none } a:hover { text-decoration:underline }
button,input,select,textarea { font:inherit; color:inherit }
button { cursor:pointer; background:none; border:0; padding:0; margin:0 }
button:disabled { cursor:not-allowed; opacity:.55 }
img,svg { display:block; max-width:100% }
code,pre,kbd { font-family:var(--mono); font-size:.92em }
pre { white-space:pre-wrap; overflow-wrap:anywhere; margin:0 }
small { font-size:13px }
.num,time,.tabular { font-variant-numeric:tabular-nums }
.visually-hidden { position:absolute !important; width:1px; height:1px; overflow:hidden; clip:rect(0 0 0 0); white-space:nowrap }
.skip-link { position:absolute; left:-999px; top:8px; z-index:100; padding:8px 12px; background:var(--surface); border-radius:var(--radius-sm); box-shadow:var(--shadow) }
.skip-link:focus { left:8px }
:focus-visible { outline:2px solid var(--accent); outline-offset:2px; border-radius:4px }
::selection { background:var(--accent-soft) }
.icon { width:20px; height:20px; flex:none; fill:none; stroke:currentColor; stroke-width:1.75; stroke-linecap:round; stroke-linejoin:round }
.icon.sm { width:16px; height:16px } .icon.lg { width:28px; height:28px }
@media (prefers-reduced-motion:reduce) { *,*::before,*::after { animation:none !important; transition:none !important; scroll-behavior:auto !important } }

/* ---------- primitives ---------- */
.btn { display:inline-flex; align-items:center; justify-content:center; gap:8px; min-height:44px; padding:0 18px; border-radius:var(--radius-sm); border:1px solid var(--border-strong); background:var(--surface); color:var(--text); font-weight:500; font-size:14px; white-space:nowrap; transition:background var(--fast) var(--ease),border-color var(--fast) var(--ease),transform var(--fast) var(--ease),box-shadow var(--fast) var(--ease) }
.btn:hover { background:var(--surface-2); text-decoration:none } .btn:active { transform:translateY(1px) }
.btn-primary,.primary-button { display:inline-flex; align-items:center; justify-content:center; gap:8px; min-height:46px; padding:0 20px; border-radius:var(--radius-sm); border:1px solid transparent; background:var(--accent); color:var(--accent-text); font-weight:600; font-size:14px; white-space:nowrap; transition:background var(--fast) var(--ease),transform var(--fast) var(--ease),box-shadow var(--fast) var(--ease) }
.btn-primary:hover,.primary-button:hover { background:var(--accent-hover); text-decoration:none; box-shadow:0 6px 18px var(--accent-ring) }
.btn-primary:active,.primary-button:active { transform:translateY(1px) }
.btn-ghost,.text-button,.portal-secondary { display:inline-flex; align-items:center; justify-content:center; gap:8px; min-height:40px; padding:0 12px; border-radius:var(--radius-sm); color:var(--text-2); font-weight:500; font-size:14px; white-space:nowrap; transition:background var(--fast) var(--ease),color var(--fast) var(--ease) }
.btn-ghost:hover,.text-button:hover,.portal-secondary:hover { background:var(--surface-2); color:var(--text); text-decoration:none }
.portal-secondary { border:1px solid var(--border-strong); background:var(--surface) }
.btn-danger { color:var(--danger) } .btn-danger:hover { background:var(--danger-soft) }
.btn-sm { min-height:36px; padding:0 12px; font-size:13px }
.btn-block { width:100% }
.icon-btn,.icon-button { display:inline-flex; align-items:center; justify-content:center; width:44px; height:44px; border-radius:var(--radius-sm); color:var(--text-2); transition:background var(--fast) var(--ease),color var(--fast) var(--ease) }
.icon-btn:hover,.icon-button:hover { background:var(--surface-2); color:var(--text) }
.icon-btn[aria-pressed="true"] { background:var(--accent-soft); color:var(--accent) }
.chip { display:inline-flex; align-items:center; gap:6px; min-height:34px; padding:0 14px; border-radius:var(--radius-pill); border:1px solid var(--border); background:var(--surface); color:var(--text-2); font-size:13px; font-weight:500; transition:background var(--fast) var(--ease),color var(--fast) var(--ease),border-color var(--fast) var(--ease) }
.chip:hover { background:var(--surface-2) }
.chip[aria-pressed="true"],.chip.active { background:var(--text); color:var(--bg); border-color:var(--text) }
.badge,.user-badge { display:inline-flex; align-items:center; gap:4px; padding:2px 9px; border-radius:var(--radius-pill); background:var(--surface-2); color:var(--text-2); font-size:12px; font-weight:500; line-height:1.6; white-space:nowrap }
.badge.accent { background:var(--accent-soft); color:var(--accent) } .badge.success { background:var(--success-soft); color:var(--success) } .badge.warning { background:var(--warning-soft); color:var(--warning) } .badge.danger { background:var(--danger-soft); color:var(--danger) } .badge.info { background:var(--info-soft); color:var(--info) }
.dot { display:inline-block; width:8px; height:8px; border-radius:50%; background:var(--muted); flex:none }
.dot.success { background:var(--success) } .dot.warning { background:var(--warning) } .dot.danger { background:var(--danger) } .dot.accent { background:var(--accent) }
.avatar { display:inline-flex !important; align-items:center; justify-content:center; line-height:1; padding:0; width:36px; height:36px; border-radius:50%; background:var(--surface-2); color:var(--text-2); font-size:13px; font-weight:600; flex:none; text-transform:uppercase }
.avatar.teal { background:#dcefe9; color:#0f5f58 } .avatar.purple { background:#e8e4f6; color:#4a3b8f } .avatar.amber { background:#f8ecd2; color:#8a5a00 } .avatar.neutral { background:var(--surface-3); color:var(--text-2) }
[data-theme="dark"] .avatar.teal { background:#163331; color:#8be0d2 } [data-theme="dark"] .avatar.purple { background:#2a2550; color:#c3b8f5 } [data-theme="dark"] .avatar.amber { background:#3a2a10; color:#f0bf6a }
.card,.portal-card { background:var(--surface); border:1px solid var(--border); border-radius:var(--radius); padding:20px; box-shadow:var(--shadow) }
.card + .card,.portal-card + .portal-card { margin-top:16px }
.field { display:flex; flex-direction:column; gap:6px; margin:0 0 16px }
.field > span,.field > label { font-size:13px; font-weight:500; color:var(--text-2) }
.input,.field input,.field select,.field textarea,.auth-card input,#mailbox-form input,#mailbox-form select,.portal-card input,.portal-card select,.portal-card textarea { width:100%; min-width:0; min-height:44px; padding:10px 12px; font-size:16px; border:1px solid var(--border-strong); border-radius:var(--radius-sm); background:var(--surface); color:var(--text); transition:border-color var(--fast) var(--ease),box-shadow var(--fast) var(--ease) }
.field textarea,.portal-card textarea { min-height:120px; resize:vertical; line-height:1.55 }
.input:focus,.field input:focus,.field select:focus,.field textarea:focus,.auth-card input:focus,#mailbox-form input:focus,#mailbox-form select:focus,.portal-card input:focus,.portal-card select:focus,.portal-card textarea:focus { outline:none; border-color:var(--accent); box-shadow:0 0 0 3px var(--accent-ring) }
.field.inline { flex-direction:row; align-items:center; gap:10px } .field.inline input[type="checkbox"] { width:18px; height:18px; min-height:0; margin:0; accent-color:var(--accent) }
.hint,.auth-hint,.portal-muted,.auth-footnote { font-size:13px; line-height:1.6; color:var(--muted) }
.form-status,.status { min-height:20px; margin-top:10px; font-size:13px; line-height:1.5; color:var(--text-2) }
.form-status:empty,.status:empty { display:none }
.form-status.error,.status.error { color:var(--danger) }
input[aria-invalid="true"] { border-color:var(--danger) }
.notice,.portal-note { padding:12px 14px; border-radius:var(--radius-sm); background:var(--accent-soft); color:var(--text); font-size:13px; line-height:1.6; border:1px solid transparent }
.notice.warning { background:var(--warning-soft) } .notice.danger { background:var(--danger-soft) } .notice.info { background:var(--info-soft) }
.eyebrow { font-size:12px; font-weight:600; letter-spacing:.08em; text-transform:uppercase; color:var(--accent) }
html:lang(th) .eyebrow { letter-spacing:.02em; text-transform:none }
/* Brand "Linked Inboxes" (owner, 24 Oct 2026): one inline symbol per page. The mark takes the accent colour and the
   lettering the text colour, so the same SVG is the kit's primary logo on light and its dark logo on dark backgrounds. */
.brand { display:inline-flex; align-items:center; flex:none; color:var(--accent); fill:var(--text) }
.brand:hover { text-decoration:none }
.brand .brand-logo { display:block; height:28px; width:auto; aspect-ratio:1250 / 185 }
.brand .brand-mark { display:none; height:24px; width:auto; aspect-ratio:2 / 1 }
.divider { height:1px; background:var(--border); margin:16px 0 }
.empty { display:flex; flex-direction:column; align-items:center; justify-content:center; gap:8px; padding:40px 20px; text-align:center; color:var(--muted) }
.empty .icon { width:36px; height:36px; color:var(--border-strong) } .empty h3 { color:var(--text-2) } .empty p { max-width:360px; font-size:14px }
.skeleton { background:linear-gradient(90deg,var(--surface-2) 25%,var(--surface-3) 37%,var(--surface-2) 63%); background-size:400% 100%; animation:shimmer 1.4s ease infinite; border-radius:6px; color:transparent !important }
@keyframes shimmer { 0% { background-position:100% 0 } 100% { background-position:0 0 } }
.toast { position:fixed; left:50%; bottom:24px; transform:translateX(-50%); z-index:60; max-width:min(92vw,480px); padding:12px 18px; border-radius:var(--radius); background:var(--text); color:var(--bg); font-size:14px; box-shadow:var(--shadow-lg); animation:rise var(--normal) var(--ease) }
@keyframes rise { from { opacity:0; transform:translate(-50%,8px) } to { opacity:1; transform:translate(-50%,0) } }
.lang-select,.language-picker select,.portal-language select { min-height:36px; padding:4px 28px 4px 10px; border:1px solid var(--border); border-radius:var(--radius-sm); background:var(--surface); appearance:none; font-size:13px; color:var(--text) }
.language-picker,.portal-language { position:relative; display:inline-flex; align-items:center; gap:8px; font-size:13px; color:var(--muted) }
/* CSS chevron instead of a data: image (the CSP allows img-src 'self' only). */
.language-picker::after,.portal-language::after { content:""; position:absolute; right:12px; top:50%; width:7px; height:7px; border-right:1.5px solid var(--muted); border-bottom:1.5px solid var(--muted); transform:translateY(-70%) rotate(45deg); pointer-events:none }
.language-picker > span,.portal-language > span { position:absolute; width:1px; height:1px; overflow:hidden; clip:rect(0 0 0 0) }
kbd.key { display:inline-flex; align-items:center; justify-content:center; min-width:20px; height:20px; padding:0 5px; border:1px solid var(--border-strong); border-bottom-width:2px; border-radius:5px; background:var(--surface); font-size:11px; color:var(--muted) }

/* ---------- dialogs ---------- */
dialog { border:0; padding:0; background:transparent; color:inherit; max-width:min(96vw,560px); width:100% }
dialog::backdrop { background:rgba(10,12,14,.5); backdrop-filter:blur(2px) }
dialog .sheet,dialog > form,dialog > .sheet { background:var(--surface); border:1px solid var(--border); border-radius:var(--radius-lg); padding:24px; box-shadow:var(--shadow-lg); max-height:90vh; overflow:auto; animation:pop var(--normal) var(--ease) }
dialog.wide { max-width:min(96vw,760px) }
@keyframes pop { from { opacity:0; transform:translateY(10px) scale(.985) } to { opacity:1; transform:none } }
.dialog-heading { display:flex; align-items:flex-start; justify-content:space-between; gap:12px; margin-bottom:16px }
.dialog-heading h2 { font-size:20px } .dialog-heading .eyebrow { margin-bottom:4px }
.dialog-actions,.compose-actions { display:flex; flex-wrap:wrap; gap:10px; align-items:center; margin-top:18px }
.dialog-actions .spacer { flex:1 }
@media (max-width:640px) { dialog { max-width:100vw; width:100vw; max-height:100dvh; margin:0 } dialog .sheet,dialog > form,dialog > .sheet { border-radius:var(--radius-lg) var(--radius-lg) 0 0; max-height:92dvh; margin-top:8dvh; padding:20px 16px calc(16px + env(safe-area-inset-bottom)) } .dialog-actions .btn,.dialog-actions .btn-primary,.compose-actions .btn,.compose-actions .btn-primary { flex:1 1 140px } }

/* ---------- landing ---------- */
.landing { min-height:100vh; display:flex; flex-direction:column }
.site-header { position:sticky; top:0; z-index:40; display:flex; align-items:center; justify-content:space-between; gap:16px; height:var(--header-h); padding:0 clamp(16px,4vw,48px); background:color-mix(in srgb,var(--bg) 82%,transparent); backdrop-filter:saturate(1.4) blur(14px); border-bottom:1px solid var(--border) }
.site-nav { display:flex; align-items:center; gap:4px }
.site-nav a { padding:8px 12px; border-radius:var(--radius-sm); color:var(--text-2); font-size:14px; font-weight:500 }
.site-nav a:hover { background:var(--surface-2); color:var(--text); text-decoration:none }
.site-actions { display:flex; align-items:center; gap:8px } .site-actions .btn-primary { min-height:44px }
.hero { display:grid; grid-template-columns:minmax(0,1.05fr) minmax(0,1fr); align-items:center; gap:clamp(24px,5vw,72px); max-width:1180px; width:100%; margin:0 auto; padding:clamp(40px,8vh,96px) clamp(16px,4vw,48px) clamp(32px,6vh,64px) }
.hero h1 { font-size:clamp(34px,5vw,56px); line-height:1.12; letter-spacing:-.02em; margin:14px 0 18px }
html:lang(th) .hero h1 { line-height:1.3; letter-spacing:0 }
.hero-lead { font-size:17px; line-height:1.7; color:var(--text-2); max-width:520px }
.hero-cta { display:flex; flex-wrap:wrap; gap:12px; margin-top:28px }
.hero-meta { display:flex; flex-wrap:wrap; gap:16px; margin-top:28px; font-size:13px; color:var(--muted) }
.hero-meta span { display:inline-flex; align-items:center; gap:6px }
/* Hero: every inbox flows into one (owner, 29 Oct 2026: "ตรง hero section มี interactive ล้ำๆ เป็น email กำลังส่งมาแต่ละ inbox
   แต่ถูก joobmail ดูดมาอยู่ที่เดียว แล้วแสดงไล่บรรทัดเรื่อยๆ"). A dark stage on the light page: three inboxes on top, the
   joobmail core in the middle, the one inbox below. hero-flow.js sends each message along its light path into the core and
   adds its line; without the script the stage is the same picture, still. The stage sizes itself by its own width. */
.flow { --flow-ink:#f3efe6; --flow-dim:rgba(243,239,230,.62); position:relative; min-width:0; container-type:inline-size }
.flow-stage { position:relative; isolation:isolate; display:grid; grid-template-rows:auto minmax(150px,1fr) auto; height:548px; padding:20px; border-radius:28px; overflow:hidden; color:var(--flow-ink); background:radial-gradient(90% 55% at 50% 100%,rgba(34,160,141,.32),transparent 70%),radial-gradient(70% 45% at 100% 0%,rgba(212,181,124,.16),transparent 65%),linear-gradient(165deg,#0b0d0e 0%,#0e1817 55%,#0f2421 100%); box-shadow:0 30px 70px rgba(12,24,22,.28),0 2px 8px rgba(12,24,22,.16); transform:perspective(1400px) rotateX(var(--tilt-x,0deg)) rotateY(var(--tilt-y,0deg)); transition:transform .6s var(--ease) }
.flow-stage::before { content:""; position:absolute; inset:0; z-index:-1; background:radial-gradient(rgba(255,255,255,.08) 1px,transparent 1.6px) 0 0/18px 18px; -webkit-mask-image:radial-gradient(75% 65% at 50% 42%,#000,transparent); mask-image:radial-gradient(75% 65% at 50% 42%,#000,transparent) }
.flow-stage::after { content:""; position:absolute; inset:0; z-index:-1; border-radius:inherit; pointer-events:none; box-shadow:inset 0 0 0 1px rgba(212,181,124,.24),inset 0 1px 0 rgba(255,255,255,.08); background:radial-gradient(260px 220px at var(--glare-x,78%) var(--glare-y,6%),rgba(255,255,255,.07),transparent 70%) }
.flow-paths [data-src="work"],.flow-pod[data-pod="work"],.flow-row[data-src="work"],.flow-mail[data-src="work"] { --pod:#5b95ff }
.flow-paths [data-src="home"],.flow-pod[data-pod="home"],.flow-row[data-src="home"],.flow-mail[data-src="home"] { --pod:#f2737a }
.flow-paths [data-src="shop"],.flow-pod[data-pod="shop"],.flow-row[data-src="shop"],.flow-mail[data-src="shop"] { --pod:#f1b04f }
.flow-paths [data-src="core"] { --pod:#d4b57c }
.flow-paths { position:absolute; inset:0; width:100%; height:100%; pointer-events:none }
.flow-path { fill:none; stroke:rgba(255,255,255,.14); stroke-width:1.5; stroke-dasharray:3 6; animation:flow-dash 1.4s linear infinite; transition:opacity .3s var(--ease) }
.flow-glow { fill:none; stroke:var(--pod); stroke-width:3; stroke-linecap:round; opacity:0 }
@keyframes flow-dash { to { stroke-dashoffset:-18 } }
.flow-pods { position:relative; z-index:2; display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:10px }
.flow-pod { position:relative; display:flex; align-items:center; gap:9px; min-width:0; padding:10px 12px; border-radius:14px; background:linear-gradient(180deg,#19211f,#121816); border:1px solid rgba(255,255,255,.12); box-shadow:inset 0 1px 0 rgba(255,255,255,.06),0 8px 20px rgba(0,0,0,.25); cursor:pointer; user-select:none; -webkit-user-select:none; -webkit-tap-highlight-color:transparent; transition:border-color .35s var(--ease),box-shadow .35s var(--ease),opacity .3s var(--ease) }
.flow-pod:hover,.flow-pod.got { border-color:color-mix(in srgb,var(--pod) 65%,transparent); box-shadow:inset 0 1px 0 rgba(255,255,255,.06),0 0 0 3px color-mix(in srgb,var(--pod) 16%,transparent),0 10px 26px color-mix(in srgb,var(--pod) 24%,transparent) }
.pod-dot { flex:none; width:9px; height:9px; border-radius:50%; background:var(--pod); box-shadow:0 0 10px var(--pod) }
.pod-text { display:flex; flex-direction:column; min-width:0; line-height:1.3 }
.pod-text strong { font-size:12.5px; font-weight:600 }
.pod-address { font-size:11px; color:var(--flow-dim); white-space:nowrap }
.pod-plus { position:absolute; top:-9px; right:10px; padding:1px 7px; border-radius:var(--radius-pill); background:var(--pod); color:#0b0d0e; font-size:10.5px; font-weight:700; pointer-events:none }
.flow-core { position:relative; z-index:2; grid-row:2; grid-column:1; align-self:center; justify-self:center; display:grid; place-items:center; width:84px; height:84px; border-radius:50%; background:radial-gradient(circle at 50% 35%,#1e5650,#0c2421 72%); box-shadow:0 0 0 1px rgba(212,181,124,.4),0 0 46px rgba(34,160,141,.45),inset 0 1px 0 rgba(255,255,255,.14) }
.core-ring { position:absolute; inset:-9px; border-radius:50%; background:conic-gradient(from 0deg,transparent 0 35%,rgba(110,211,195,.9) 60%,#d4b57c 70%,transparent 80%); -webkit-mask:radial-gradient(farthest-side,transparent calc(100% - 2.5px),#000 calc(100% - 2px)); mask:radial-gradient(farthest-side,transparent calc(100% - 2.5px),#000 calc(100% - 2px)); animation:flow-spin 5s linear infinite }
@keyframes flow-spin { to { transform:rotate(1turn) } }
.core-mark { position:relative; width:48px; height:24px; color:var(--flow-ink); filter:drop-shadow(0 0 10px rgba(110,211,195,.55)) }
.flow-ripple { position:absolute; inset:0; border-radius:50%; border:1.5px solid rgba(110,211,195,.75); pointer-events:none }
.flow-toggle { position:relative; z-index:3; grid-row:2; grid-column:1; align-self:center; justify-self:end; display:grid; place-items:center; width:34px; height:34px; border-radius:50%; color:var(--flow-ink); background:rgba(255,255,255,.08); border:1px solid rgba(255,255,255,.16); transition:background var(--fast) var(--ease) }
.flow-toggle:hover { background:rgba(255,255,255,.16) } .flow-toggle:focus-visible { outline:2px solid #d4b57c; outline-offset:2px }
.flow-mail { position:absolute; left:0; top:0; z-index:4; display:grid; place-items:center; width:34px; height:24px; border-radius:6px; background:#fbfaf7; color:color-mix(in srgb,var(--pod) 80%,#000); box-shadow:0 8px 20px rgba(0,0,0,.4),0 0 0 1px color-mix(in srgb,var(--pod) 55%,transparent),0 0 22px color-mix(in srgb,var(--pod) 60%,transparent); opacity:0; pointer-events:none; will-change:transform,opacity }
.flow-inbox { position:relative; z-index:2; grid-row:3; display:flex; flex-direction:column; border-radius:16px; background:#fbfaf7; color:#17191c; box-shadow:0 20px 50px rgba(0,0,0,.4),inset 0 0 0 1px rgba(255,255,255,.6); overflow:hidden }
.flow-inbox-head { display:flex; align-items:center; justify-content:space-between; gap:8px; padding:11px 14px; border-bottom:1px solid #ebe8e1; font-size:12.5px; font-weight:600 }
.flow-inbox-title { display:inline-flex; align-items:center; gap:7px } .flow-inbox-title .icon { color:#0f5f58 }
.flow-live { display:inline-flex; align-items:center; gap:6px; font-size:11px; font-weight:500; color:#0f5f58 }
.flow-live-dot { width:7px; height:7px; border-radius:50%; background:#1fa595; animation:flow-live 1.8s ease-out infinite }
@keyframes flow-live { from { box-shadow:0 0 0 0 rgba(31,165,149,.55) } to { box-shadow:0 0 0 8px rgba(31,165,149,0) } }
.flow-rows { height:216px; overflow:hidden }
.flow-row { display:grid; grid-template-columns:30px minmax(0,1fr) auto auto; align-items:center; gap:10px; height:54px; padding:0 14px; border-bottom:1px solid #f0ede7; font-size:12px; overflow:hidden; transition:background-color 1.4s var(--ease),opacity .3s var(--ease) }
.flow-row.fresh { background:#e6f2ef; transition:opacity .3s var(--ease) }
.flow-avatar { display:grid; place-items:center; width:30px; height:30px; border-radius:50%; background:color-mix(in srgb,var(--pod) 85%,#000); color:#fff; font-size:10.5px; font-weight:700; letter-spacing:.02em }
.flow-text { display:flex; flex-direction:column; min-width:0; line-height:1.4 }
.flow-text strong { font-weight:600; white-space:nowrap; overflow:hidden; text-overflow:ellipsis }
.flow-text span { color:#6b6f76; white-space:nowrap; overflow:hidden; text-overflow:ellipsis }
.flow-tag { padding:2px 8px; border-radius:var(--radius-pill); background:color-mix(in srgb,var(--pod) 15%,#fff); color:color-mix(in srgb,var(--pod) 60%,#111); font-size:10.5px; font-weight:600; white-space:nowrap }
.flow-row time { color:#8a8d93; font-size:11px; font-variant-numeric:tabular-nums }
/* Pointing at an inbox lights its own path and lines. */
.flow-stage[data-focus="work"] :is(.flow-pod:not([data-pod="work"]),.flow-row:not([data-src="work"]),.flow-path:not([data-src="work"])),
.flow-stage[data-focus="home"] :is(.flow-pod:not([data-pod="home"]),.flow-row:not([data-src="home"]),.flow-path:not([data-src="home"])),
.flow-stage[data-focus="shop"] :is(.flow-pod:not([data-pod="shop"]),.flow-row:not([data-src="shop"]),.flow-path:not([data-src="shop"])) { opacity:.35 }
.flow.paused :is(.core-ring,.flow-live-dot,.flow-path),.flow.offscreen :is(.core-ring,.flow-live-dot,.flow-path) { animation-play-state:paused }
@media (prefers-reduced-motion:reduce) { .flow-stage { transform:none; transition:none } .core-ring,.flow-live-dot,.flow-path { animation:none } }
@media (max-width:700px) { .flow-toggle { width:40px; height:40px } }
/* A narrower stage: the domains only, then stacked inboxes, three lines and no times. */
@container (max-width:540px) { .pod-local { display:none } }
@container (max-width:430px) {
  .flow-stage { height:476px; padding:16px; border-radius:22px; grid-template-rows:auto minmax(120px,1fr) auto }
  .flow-pods { gap:8px }
  .flow-pod { flex-direction:column; justify-content:center; gap:5px; padding:10px 6px; text-align:center }
  .pod-text { align-items:center } .pod-address { font-size:10px }
  .flow-core { width:72px; height:72px } .core-mark { width:42px; height:21px }
  .flow-rows { height:156px }
  .flow-row { grid-template-columns:28px minmax(0,1fr) auto; gap:8px; height:52px; padding:0 12px } .flow-row time { display:none }
  .flow-avatar { width:28px; height:28px }
}
@container (max-width:300px) { .pod-address { display:none } }
.section { max-width:1180px; width:100%; margin:0 auto; padding:clamp(40px,7vh,80px) clamp(16px,4vw,48px) }
.section-head { max-width:620px; margin-bottom:32px }
.section-head h2 { font-size:clamp(24px,3vw,34px); margin:10px 0 12px; letter-spacing:-.015em }
.section-head p { color:var(--text-2); font-size:16px; line-height:1.7 }
.feature-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(300px,1fr)); gap:16px }
.feature { padding:22px; border:1px solid var(--border); border-radius:var(--radius); background:var(--surface); transition:transform var(--normal) var(--ease),box-shadow var(--normal) var(--ease) }
.feature:hover { transform:translateY(-2px); box-shadow:var(--shadow) }
.feature .icon { width:26px; height:26px; color:var(--accent); margin-bottom:14px }
.feature h3 { margin-bottom:6px; font-size:16px } .feature p { font-size:14px; color:var(--text-2) }
.steps { display:grid; grid-template-columns:repeat(auto-fit,minmax(240px,1fr)); gap:16px; counter-reset:step }
.step { position:relative; padding:24px 22px 22px; border-radius:var(--radius); background:var(--surface-2) }
.step::before { counter-increment:step; content:counter(step,decimal-leading-zero); display:block; font-size:12px; font-weight:600; color:var(--accent); letter-spacing:.08em; margin-bottom:10px }
.step h3 { font-size:16px; margin-bottom:6px } .step p { font-size:14px; color:var(--text-2) }
.how-guide { display:flex; justify-content:center; margin:20px 0 } .how-guide .btn .icon { color:var(--accent) } /* the landing's ways to the features page (8 Nov 2026; until then, to the user guide) */
.protocol-row { display:grid; grid-template-columns:repeat(auto-fit,minmax(200px,1fr)); gap:12px }
.protocol { display:flex; align-items:center; gap:14px; padding:16px 18px; border:1px solid var(--border); border-radius:var(--radius); background:var(--surface) }
.protocol .icon { color:var(--accent) } .protocol strong { display:block; font-size:15px } .protocol small { color:var(--muted) }
.security { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1fr); gap:32px; align-items:start; padding:32px; border-radius:var(--radius-lg); background:var(--text); color:var(--bg) }
[data-theme="dark"] .security { background:var(--surface-2); color:var(--text) }
.security .eyebrow { color:var(--accent) } [data-theme="dark"] .security .eyebrow { color:var(--accent) }
.security h2 { font-size:clamp(22px,3vw,30px); margin:10px 0 12px; color:inherit }
.security p { opacity:.85; font-size:15px; line-height:1.7 }
.security ul { list-style:none; margin:0; padding:0; display:grid; gap:12px }
.security li { display:flex; gap:12px; align-items:flex-start; font-size:14px; line-height:1.6 } .security li .icon { color:var(--accent); margin-top:3px }
.pricing-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(220px,250px)); gap:16px; justify-content:center } /* four plans in one row on wide screens (24 Oct 2026) */
@media (max-width:600px) { .pricing-grid { grid-template-columns:minmax(0,360px) } }
.plan { padding:26px; border:1px solid var(--border); border-radius:var(--radius-lg); background:var(--surface); text-align:left; display:flex; flex-direction:column }
.plan > .btn-block { margin-top:auto } /* the start buttons line up when one plan's features take more lines */
.plan.featured { border-color:var(--accent); box-shadow:0 0 0 1px var(--accent) inset }
.plan .price { display:flex; align-items:baseline; gap:6px; margin:14px 0 } .plan .price strong { font-size:36px; letter-spacing:-.02em } .plan .price s { color:var(--muted); font-weight:400; font-size:16px } .plan .price small { color:var(--muted) }
.plan ul { list-style:none; margin:16px 0 20px; padding:0; display:grid; gap:8px; font-size:14px; color:var(--text-2) } .plan li { display:flex; gap:8px } .plan li .icon { color:var(--accent); width:16px; height:16px; margin-top:4px }
.site-footer { margin-top:auto; border-top:1px solid var(--border); background:var(--surface) }
.site-footer .inner { max-width:1180px; margin:0 auto; padding:32px clamp(16px,4vw,48px); display:grid; grid-template-columns:minmax(0,1.4fr) repeat(2,minmax(0,1fr)); gap:24px; font-size:14px; color:var(--text-2) }
.site-footer h3 { margin-bottom:10px; font-size:13px; color:var(--muted); font-weight:500 }
.site-footer ul { list-style:none; margin:0; padding:0; display:grid; gap:8px } .site-footer a { color:var(--text-2) } .site-footer a:hover { color:var(--accent) }
.site-footer .legal { max-width:1180px; margin:0 auto; padding:0 clamp(16px,4vw,48px) 24px; font-size:12px; color:var(--muted); display:flex; flex-wrap:wrap; gap:12px; justify-content:space-between }
@media (max-width:900px) { .hero { grid-template-columns:1fr } .flow { max-width:560px } .security { grid-template-columns:1fr; padding:24px } .site-footer .inner { grid-template-columns:1fr 1fr } .site-nav { display:none } }
@media (max-width:600px) { .site-header { padding:0 16px } .site-footer .inner { grid-template-columns:1fr } .hero-cta .btn,.hero-cta .btn-primary { flex:1 1 100% } }
@media (max-width:520px) { .site-header { gap:8px } .site-header .brand .brand-logo { display:none } .site-header .brand .brand-mark { display:block } .site-actions { gap:4px } .site-actions .btn,.site-actions .btn-ghost,.site-actions .btn-primary { padding:0 12px } .lang-select { padding-left:8px; padding-right:24px } .language-picker::after,.portal-language::after { right:9px } }

/* ---------- auth ---------- */
.auth-screen { display:flex; align-items:center; justify-content:center; min-height:calc(100vh - var(--header-h)); padding:32px 16px }
.auth-card { width:100%; max-width:440px; background:var(--surface); border:1px solid var(--border); border-radius:var(--radius-lg); padding:32px; box-shadow:var(--shadow-lg) }
.auth-card h2 { font-size:24px; margin:8px 0 18px }
.auth-tabs { display:flex; gap:4px; padding:4px; border-radius:10px; background:var(--surface-2); margin-bottom:22px }
.auth-tabs button { flex:1; min-height:38px; border-radius:7px; font-size:14px; font-weight:500; color:var(--text-2) }
.auth-tabs button[aria-pressed="true"] { background:var(--surface); color:var(--text); box-shadow:var(--shadow) }
.auth-card label { display:flex; flex-direction:column; gap:6px; font-size:13px; font-weight:500; color:var(--text-2); margin:0 0 14px }
.auth-card .primary-button { width:100%; margin-top:6px }
.auth-links { display:flex; flex-wrap:wrap; justify-content:space-between; gap:8px; margin-top:16px; font-size:13px }
.auth-footnote { border-top:1px solid var(--border); padding-top:16px; margin-top:18px }
@media (max-width:480px) { .auth-card { padding:24px 18px; border-radius:var(--radius) } }

/* ---------- app shell ---------- */
.app-shell { display:grid; grid-template-columns:var(--sidebar-w) minmax(0,1fr); min-height:100vh; background:var(--bg) }
.sidebar { position:sticky; top:0; height:100vh; display:flex; flex-direction:column; gap:4px; padding:16px 12px; border-right:1px solid var(--border); background:var(--surface); overflow:auto }
.sidebar .brand { padding:6px 10px 14px }
.compose-button { display:flex; align-items:center; gap:10px; min-height:46px; margin:0 4px 12px; padding:0 16px; border-radius:var(--radius); background:var(--accent); color:var(--accent-text); font-weight:600; font-size:14px; box-shadow:0 6px 18px var(--accent-ring); transition:background var(--fast) var(--ease),transform var(--fast) var(--ease) }
.compose-button:hover { background:var(--accent-hover) } .compose-button:active { transform:translateY(1px) } .compose-button kbd { margin-left:auto; opacity:.75 }
/* "รับเมลล่าสุด" under the compose button (owner, 1 Dec 2026: "แบบดำ-ทอง"): the list band's black and champagne gold, the same
   in light and dark, so it stands out on the sidebar without competing with the green of "เขียนอีเมล"; always with its name. */
.sidebar-actions { display:flex; flex-direction:column; gap:8px; margin-bottom:12px } .sidebar-actions > button { margin:0 4px }
.receive-button { display:flex; align-items:center; gap:10px; min-height:42px; padding:0 16px; border:1px solid var(--band-line); border-radius:var(--radius); background:var(--band); color:var(--band-text); font-weight:600; font-size:14px; text-align:left; box-shadow:var(--band-light); transition:filter var(--fast) var(--ease),transform var(--fast) var(--ease) }
.receive-button .icon { flex:none; color:var(--gold-text) } .receive-button span { min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap }
.receive-button:hover:not([disabled]) { filter:brightness(1.25) } .receive-button:active:not([disabled]) { transform:translateY(1px) } .receive-button[hidden] { display:none }
.receive-button:focus-visible { outline:2px solid var(--gold); outline-offset:2px }
.receive-button[disabled] { cursor:progress } .receive-button.busy .icon { animation:receive-turn 1s linear infinite }
@keyframes receive-turn { to { transform:rotate(360deg) } }
@media (prefers-reduced-motion:reduce) { .receive-button.busy .icon { animation:none } }
.nav-group { display:flex; flex-direction:column; gap:2px }
.nav-button { display:flex; align-items:center; gap:12px; min-height:40px; padding:0 12px; border-radius:var(--radius-sm); color:var(--text-2); font-size:14px; font-weight:500; text-align:left; width:100%; transition:background var(--fast) var(--ease),color var(--fast) var(--ease) }
.nav-button:hover { background:var(--surface-2); color:var(--text); text-decoration:none }
.nav-button.active,.nav-button[aria-current="page"] { background:var(--accent-soft); color:var(--accent) }
.nav-button .count { margin-left:auto; font-size:12px; color:var(--muted); font-variant-numeric:tabular-nums } .nav-button.active .count { color:var(--accent) }
.section-label { display:flex; align-items:center; justify-content:space-between; padding:16px 12px 6px; font-size:11px; font-weight:600; letter-spacing:.08em; text-transform:uppercase; color:var(--muted) }
html:lang(th) .section-label { letter-spacing:.02em; text-transform:none; font-size:12px }
.account-button { display:grid; grid-template-columns:auto minmax(0,1fr) auto; align-items:center; gap:10px; width:100%; min-height:48px; padding:6px 10px; border-radius:var(--radius-sm); text-align:left; transition:background var(--fast) var(--ease) }
.account-button:hover { background:var(--surface-2) } .account-button.selected { background:var(--accent-soft) }
.account-button .avatar { width:32px; height:32px; font-size:12px }
.account-label strong { display:block; font-size:14px; font-weight:500; white-space:nowrap; overflow:hidden; text-overflow:ellipsis } .account-label small { display:block; font-size:12px; color:var(--muted); white-space:nowrap; overflow:hidden; text-overflow:ellipsis }
.account-button .dot { justify-self:end }
/* The profile row carries the settings gear (owner, 27 Oct 2026: one row for the account instead of two). */
.profile-row { display:flex; align-items:center; gap:4px } .profile-row > .user-chip { flex:1; min-width:0 } .profile-row > .user-settings { flex:none }
.sidebar-bottom { margin-top:auto; padding-top:12px; border-top:1px solid var(--border); display:flex; flex-direction:column; gap:2px }
.user-chip { display:flex; align-items:center; gap:10px; width:100%; min-height:48px; padding:6px 10px; border-radius:var(--radius-sm); text-align:left } .user-chip:hover { background:var(--surface-2) }
.user-chip strong { display:block; font-size:14px; font-weight:500; white-space:nowrap; overflow:hidden; text-overflow:ellipsis } .user-chip small { display:block; font-size:12px; color:var(--muted) }
.main { display:flex; flex-direction:column; min-width:0; min-height:100vh }
.topbar { position:sticky; top:0; z-index:30; display:flex; align-items:center; gap:12px; height:var(--header-h); padding:0 clamp(12px,2vw,24px); background:color-mix(in srgb,var(--bg) 86%,transparent); backdrop-filter:blur(12px); border-bottom:1px solid var(--border) }
.topbar #page-title { font-size:18px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; min-width:0 }
.topbar .sub { font-size:13px; color:var(--muted); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; min-width:0 }
.topbar .title { display:flex; flex-direction:column; min-width:0; flex:1 }
.topbar-actions { display:flex; align-items:center; gap:4px; flex:none }
.banner { display:flex; flex-wrap:wrap; align-items:center; gap:10px; margin:12px clamp(12px,2vw,24px) 0; padding:10px 14px; border-radius:var(--radius-sm); font-size:13px; line-height:1.5; background:var(--accent-soft); color:var(--text) }
.banner.warning { background:var(--warning-soft) } .banner.danger { background:var(--danger-soft) } .banner .btn,.banner .btn-ghost { margin-left:auto }
/* The search row (owner, 29 Oct 2026: "ย้ายพวกที่วงไว้ลงมาอยู่แถวเดียวกับ search บาร์ ... หากคลิก search bar ค่อยขยาย", then
   "จะขยายส่วนนี้มากิน search bar ... มีแต่ icon ไม่เข้าใจเลยว่าคือไร", then "shortbut มันล้น ส่วนล้นดูไม่ได้ อยากให้ลดขนาดข้อความลง"):
   the open mailbox's tools keep short names beside a search box that gives up its width down to 17rem; while the search
   box is in use they step aside and it takes the row. A row too narrow for both wraps the tools onto the next line (app.js
   marks it .tools-below), where they stay put, so nothing moves under the fingers; a line narrower than the names keeps the
   tools that fit and puts the rest under More (.spilled), so none is cut off. 3 px of padding keep focus rings whole. */
.list-head { display:flex; flex-wrap:wrap; align-items:center; gap:8px; padding:10px 12px; border-bottom:1px solid var(--border) }
.list-head > .search-form { flex:1 1 17rem; min-width:0; padding:0; border-bottom:0 }
.mailbox-tools { display:flex; flex:0 1 auto; gap:6px; min-width:0; max-width:calc(100% + 6px); margin:-3px; padding:3px; overflow:hidden; transition:max-width .22s ease,opacity .18s ease,margin .22s ease,padding .22s ease }
.mailbox-tools > .chip { flex:none }
.mailbox-tools > .chip.spilled { display:none }
.mailbox-tools[hidden] { display:none }
.list-head:not(.tools-below):has(.search-form:focus-within) > .mailbox-tools { max-width:0; opacity:0; margin:-3px 0 -3px -8px; padding:3px 0 }
/* The header bands of the list and of the reader (owner, 29 Oct 2026: "อยากให้กรอบแดงมีสีพื้นหลังที่ต่างแบบสวยๆ พรีเมี่ยม", then
   "สีกรอบที่เพิ่มใหม่ดูไม่ค่อยสวยเลย อยากให้สีตัดกัน และดูพรีเมี่ยม หรู", then from the candidates shown "เปลี่ยนเป็นดำ-ทอง"): black
   to charcoal with a soft champagne glow and a champagne hairline below; ivory text, glass buttons with champagne icons, solid
   fields, the chosen filter in ivory. The same in both themes: in the dark theme the glow, the hairline and the fields' edge
   keep it apart from the grey surfaces. */
:root { --gold:#d4b57c; --gold-text:#e8cd97; --band-text:#f5f0e6; --band-muted:rgba(245,240,230,.72); --band-ink:#14171a;
  --band:radial-gradient(120% 170% at 100% 0%,rgba(212,181,124,.18),transparent 58%),linear-gradient(115deg,#0b0d0e 0%,#16191b 55%,#202427 100%);
  --band-line:rgba(212,181,124,.6); --band-rule:rgba(255,255,255,.09); --band-light:inset 0 1px 0 rgba(255,255,255,.07);
  --glass:rgba(255,255,255,.07); --glass-hover:rgba(255,255,255,.15); --glass-line:rgba(255,255,255,.2) }
.list-chrome { background:var(--band); color:var(--band-text); box-shadow:var(--band-light); border-bottom:1px solid var(--band-line) }
.list-chrome > .list-head { border-bottom-color:var(--band-rule) }
.list-chrome > .list-toolbar { border-bottom:0 }
.list-chrome > .search-filters { margin:0 12px 10px; border:0; border-radius:var(--radius); color:var(--text); box-shadow:0 10px 30px rgba(0,0,0,.28) } /* a card on the band */
.list-chrome .search-form input:not(:focus) { background:var(--surface); border-color:var(--glass-line); box-shadow:0 1px 3px rgba(0,0,0,.22) }
.list-chrome .search-form input:focus { border-color:var(--gold); box-shadow:0 0 0 3px rgba(212,181,124,.4) }
.list-chrome .icon-btn { color:var(--band-text) }
.list-chrome .icon-btn:not([aria-pressed="true"],[aria-expanded="true"]):hover { background:var(--glass-hover); color:#fff }
.list-chrome .search-form > .icon-btn[aria-expanded="true"] { background:var(--glass-hover); color:var(--gold-text) }
.list-chrome .chip:not([aria-pressed="true"],.active) { background:var(--glass); border-color:var(--glass-line); color:var(--band-text) }
.list-chrome .chip:not([aria-pressed="true"],.active):hover { background:var(--glass-hover); border-color:rgba(255,255,255,.34); color:#fff }
.list-chrome .chip[aria-pressed="true"],.list-chrome .chip.active,.list-chrome .layout-switch .icon-btn[aria-pressed="true"] { background:var(--band-text); border-color:var(--band-text); color:var(--band-ink) }
.list-chrome .mailbox-tools .chip .icon { color:var(--gold-text) }
.list-chrome .sort-picker select { background:var(--surface); border-color:var(--glass-line); color:var(--text) }
.list-chrome .layout-switch { background:var(--glass); border-color:var(--glass-line) }
.list-chrome .list-count,.list-chrome .search-status { color:var(--band-muted) }
.list-chrome .search-status.pending::before { background:var(--gold) }
.list-chrome .search-chip { background:rgba(212,181,124,.18); color:var(--gold-text) }
.list-chrome .check-all input { accent-color:var(--gold) }
.list-chrome :focus-visible,.reader-toolbar :focus-visible { outline-color:var(--gold) }
.search-form .search-key { display:none; position:absolute; right:9px; top:50%; transform:translateY(-50%); cursor:text }
@media (hover:hover) and (pointer:fine) { .search-form .search-key { display:inline-flex } .search-form .search-wrap input { padding-right:36px } } /* a keyboard's / hint, inside the box */
.search-form input:focus ~ .search-key,.search-form input:not(:placeholder-shown) ~ .search-key { display:none }
.mailbox-notice { display:block; margin:12px clamp(12px,2vw,24px) 0; width:fit-content; max-width:calc(100% - 2 * clamp(12px,2vw,24px)); white-space:normal }
.panes { display:grid; grid-template-columns:var(--list-w) minmax(0,1fr); flex:1; min-height:0; margin:12px clamp(12px,2vw,24px) 16px; gap:16px }
.list-pane { display:flex; flex-direction:column; min-width:0; min-height:0; background:var(--surface); border:1px solid var(--border); border-radius:var(--radius); overflow:hidden }
.search-form { position:relative; display:flex; align-items:center; gap:8px }
.search-form .search-wrap { position:relative; flex:1 } .search-form .search-wrap .icon { position:absolute; left:10px; top:50%; transform:translateY(-50%); color:var(--muted); width:18px; height:18px }
.search-form input { width:100%; min-height:40px; padding:8px 12px 8px 36px; font-size:16px; border:1px solid var(--border); border-radius:var(--radius-sm); background:var(--surface-2); color:var(--text) }
.search-form input:focus { outline:none; border-color:var(--accent); background:var(--surface); box-shadow:0 0 0 3px var(--accent-ring) }
.list-toolbar { display:flex; align-items:center; justify-content:space-between; gap:8px; padding:8px 12px; border-bottom:1px solid var(--border) }
.list-toolbar .tabs { display:flex; flex-wrap:wrap; gap:6px; overflow:auto; scrollbar-width:none } .list-toolbar .tabs::-webkit-scrollbar { display:none }
.list-toolbar .chip { flex:none; min-height:34px; padding:0 12px; font-size:12px; white-space:nowrap }
.list-count { font-size:12px; color:var(--muted); white-space:nowrap }
.message-list { flex:1; overflow:auto; min-height:200px; overscroll-behavior:contain }
.message-row { --pad-y:12px; --pad-x:14px; --check:18px; --check-top:9px; --check-gap:12px; display:grid; grid-template-columns:auto minmax(0,1fr) auto; gap:var(--check-gap); align-items:start; width:100%; padding:var(--pad-y) var(--pad-x); border-bottom:1px solid var(--border); text-align:left; transition:background var(--fast) var(--ease) }
.message-row:hover { background:var(--surface-2) } .message-row:last-child { border-bottom:0 }
/* The open message is marked only beside the reading pane (Outlook layout on a computer); in the list on its own (Gmail
   layout, phones) the message last opened looks like any other read row (owner, 29 Oct 2026: a tint read as unread). */
@media (min-width:901px) { html[data-layout="outlook"] .message-row.selected { background:var(--accent-soft) } }
.message-row .avatar { width:36px; height:36px; margin-top:2px }
.message-summary { display:flex; flex-direction:column; gap:2px; min-width:0 }
.message-row-heading { display:flex; align-items:baseline; justify-content:space-between; gap:8px }
.message-row-heading strong { font-size:14px; font-weight:500; white-space:nowrap; overflow:hidden; text-overflow:ellipsis } .message-row.unread .message-row-heading strong,.message-row.unread .message-subject { font-weight:600 }
.message-row-heading time,.message-row-heading small { font-size:12px; color:var(--muted); white-space:nowrap; flex:none }
.message-subject { font-size:14px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; color:var(--text) }
.message-preview { font-size:13px; color:var(--muted); white-space:nowrap; overflow:hidden; text-overflow:ellipsis }
.message-meta { display:flex; flex-wrap:wrap; gap:6px; margin-top:4px }
.account-pill { display:inline-flex; align-items:center; gap:5px; padding:1px 8px; border-radius:var(--radius-pill); background:var(--surface-2); color:var(--text-2); font-size:11px; font-weight:500; max-width:100%; white-space:nowrap; overflow:hidden; text-overflow:ellipsis }
.row-markers { display:flex; flex-direction:column; align-items:center; gap:6px; margin-top:6px; color:var(--warning) }
.unread-dot { width:8px; height:8px; border-radius:50%; background:var(--accent); display:block }
.list-empty { padding:40px 20px; text-align:center; color:var(--muted) } .list-empty h3 { color:var(--text-2); margin-bottom:6px } .list-empty p { font-size:14px; margin-bottom:12px }
.list-placeholder { padding:20px; color:var(--muted); font-size:14px }
.pagination { display:flex; align-items:center; justify-content:space-between; gap:8px; padding:8px 12px; border-top:1px solid var(--border); font-size:12px; color:var(--muted) }
.pagination div { display:flex; gap:4px }
.reader { min-width:0; min-height:0; overflow:auto; background:var(--surface); border:1px solid var(--border); border-radius:var(--radius) }
.reader-empty { height:100%; min-height:320px; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:8px; padding:32px; text-align:center; color:var(--muted) }
.reader-empty .icon { width:40px; height:40px; color:var(--border-strong) } .reader-empty h2 { font-size:18px; color:var(--text-2) } .reader-empty p { font-size:14px; max-width:380px }
.reader-toolbar { position:sticky; top:0; z-index:2; display:flex; align-items:center; gap:6px; padding:8px 12px; border-bottom:1px solid var(--band-line); background:var(--band); color:var(--band-text); box-shadow:var(--band-light) }
.reader-toolbar .spacer { flex:1 }
.reader-toolbar > .badge { display:block; flex:0 1 auto; min-width:0; max-width:min(40%,240px); overflow:hidden; text-overflow:ellipsis; background:rgba(212,181,124,.16); color:var(--gold-text) }
.reader-toolbar .icon-btn { color:var(--band-text) }
.reader-toolbar .icon-btn:not(.danger):hover,.reader-toolbar .icon-btn[aria-pressed="true"],.reader-toolbar .icon-btn[aria-expanded="true"] { background:var(--glass-hover); color:#fff }
.reader-toolbar .icon-btn.starred,.reader-toolbar .icon-btn.starred:hover { color:var(--gold-text) }
.reader-replies { display:inline-flex; flex:none; gap:6px; margin-left:4px }
.reader-replies .btn-ghost { border:1px solid var(--glass-line); border-radius:var(--radius-pill); background:var(--glass); color:var(--band-text) } .reader-replies .btn-ghost .icon { color:var(--gold-text) }
.reader-replies .btn-ghost:hover { border-color:rgba(255,255,255,.34); background:var(--glass-hover); color:#fff }
@media (hover:hover) and (pointer:fine) { .reader-toolbar { gap:2px } .reader-toolbar .icon-btn { width:36px; height:36px } } /* one line in an Outlook-width reading pane */
.reader-content { padding:20px clamp(16px,3vw,32px) 32px }
.reader-content h2 { font-size:22px; margin:8px 0 16px; line-height:1.35 }
.sender-details { display:grid; grid-template-columns:auto minmax(0,1fr) auto; gap:12px; align-items:center; padding:14px 0; border-top:1px solid var(--border); border-bottom:1px solid var(--border); margin-bottom:20px }
.sender-details strong { display:block; font-size:14px } .sender-details div > span,.sender-details small { display:block; font-size:13px; color:var(--muted); overflow-wrap:anywhere } .sender-details time { font-size:12px; color:var(--muted); white-space:nowrap }
.message-body { white-space:pre-wrap; overflow-wrap:anywhere; font-size:15px; line-height:1.75; color:var(--text) }
.attachments { margin-top:24px; padding-top:16px; border-top:1px solid var(--border) } .attachments h3 { font-size:13px; color:var(--muted); font-weight:500; margin-bottom:10px }
.attachment { display:grid; grid-template-columns:auto minmax(0,1fr) auto; gap:12px; align-items:center; padding:10px 12px; border:1px solid var(--border); border-radius:var(--radius-sm); margin-bottom:8px; color:var(--text) } .attachment:hover { background:var(--surface-2); text-decoration:none }
.attachment strong { display:block; font-size:14px; font-weight:500; overflow-wrap:anywhere } .attachment small { color:var(--muted) }
.reply-area { display:flex; flex-wrap:wrap; gap:8px; margin-top:24px }
.reader-footnote { margin-top:20px; font-size:12px; color:var(--muted) }
.imap-details { padding:24px; display:flex; flex-direction:column; gap:10px } .imap-details p { font-size:14px; color:var(--text-2) } .imap-details .kv { display:grid; grid-template-columns:auto 1fr; gap:6px 14px; font-size:14px } .imap-details .kv span { color:var(--muted) }
.tabbar { display:none }
.view-toggle { display:none }
@media (max-width:1100px) { :root { --sidebar-w:224px; --list-w:340px } }
@media (max-width:900px) {
  .app-shell { grid-template-columns:1fr }
  .sidebar { position:fixed; inset:0 auto 0 0; width:min(84vw,320px); z-index:50; transform:translateX(-102%); transition:transform var(--normal) var(--ease); box-shadow:var(--shadow-lg) }
  .sidebar[data-open="true"] { transform:none }
  .scrim { position:fixed; inset:0; z-index:45; background:rgba(10,12,14,.45); animation:fade var(--fast) var(--ease) }
  @keyframes fade { from { opacity:0 } to { opacity:1 } }
  .main { padding-bottom:calc(var(--tabbar-h) + env(safe-area-inset-bottom)) }
  .panes { grid-template-columns:1fr; margin:10px 12px 12px; gap:0 }
  .panes[data-view="list"] .reader { display:none } .panes[data-view="reader"] .list-pane { display:none }
  .reader { min-height:60vh }
  .tabbar { position:fixed; left:0; right:0; bottom:0; z-index:40; display:grid; grid-template-columns:repeat(5,1fr); height:calc(var(--tabbar-h) + env(safe-area-inset-bottom)); padding-bottom:env(safe-area-inset-bottom); background:var(--surface); border-top:1px solid var(--border) }
  .tabbar button { display:flex; flex-direction:column; align-items:center; justify-content:center; gap:2px; font-size:11px; color:var(--muted); min-height:44px }
  .tabbar button.active { color:var(--accent) } .tabbar button .icon { width:22px; height:22px }
  .tabbar .fab { align-self:center; justify-self:center; width:52px; height:52px; border-radius:50%; background:var(--accent); color:var(--accent-text); box-shadow:0 6px 18px var(--accent-ring); font-size:0 } .tabbar .fab .icon { width:24px; height:24px }
  .topbar { height:56px } .topbar #page-title { font-size:16px }
  .view-toggle { display:inline-flex }
  .topbar .language-picker { display:none }
}
@media (max-width:600px) { .message-row { --pad-x:12px } .reader-content { padding:16px 14px 28px } .mailbox-notice,.banner { margin-left:12px; margin-right:12px } }

/* ---------- compose / connect ---------- */
#compose-form .field.row { display:grid; grid-template-columns:72px minmax(0,1fr); align-items:center; gap:10px; margin:0; padding:8px 0; border-bottom:1px solid var(--border) }
#compose-form .field.row > span { font-size:13px; color:var(--muted) }
#compose-form .field.row input,#compose-form .field.row select { border:0; background:transparent; padding:6px 0; min-height:36px } #compose-form .field.row input:focus,#compose-form .field.row select:focus { box-shadow:none }
#compose-form textarea { width:100%; min-height:220px; margin-top:10px; padding:8px 0; border:0; background:transparent; font-size:16px; line-height:1.65; resize:vertical } #compose-form textarea:focus { outline:none }
.compose-notice { font-size:12px; color:var(--muted); margin-bottom:8px }
.copy-note { padding:8px 12px; border-radius:10px; background:var(--accent-soft); color:var(--text); margin:12px 0 4px } /* opened from the copy in joobmail (4 Nov 2026) */
.certificate-notice { padding:14px; border-radius:var(--radius-sm); background:var(--warning-soft); border:1px solid color-mix(in srgb,var(--warning) 30%,transparent); font-size:13px; line-height:1.6; margin:14px 0 }
.provider-hint { margin:10px 0 2px; padding:10px 12px; border-left:3px solid var(--accent); border-radius:var(--radius-sm); background:var(--accent-soft); font-size:13px; line-height:1.55; color:var(--text-2) }
.gmail-steps strong { display:block; margin-bottom:4px; color:var(--text) } .gmail-steps ol { margin:4px 0 10px 18px; padding:0 } .gmail-steps li { margin:3px 0 } .gmail-steps .btn-sm { display:inline-block; margin:2px 0 8px } .gmail-steps .hint { margin:0 }
.certificate-notice strong { display:block; margin-bottom:6px; color:var(--warning) }
.certificate-notice pre { margin:10px 0; padding:10px; background:var(--surface); border-radius:6px; font-size:12px }
.certificate-consent { display:flex; gap:10px; align-items:flex-start; font-size:13px; margin:10px 0 0 } .certificate-consent input { width:18px; height:18px; margin-top:2px; accent-color:var(--accent) }
details { border:1px solid var(--border); border-radius:var(--radius-sm); padding:10px 14px; margin:12px 0 } summary { cursor:pointer; font-size:14px; font-weight:500; color:var(--text-2) } details[open] summary { margin-bottom:10px }
#send-preview { padding:14px; border-radius:var(--radius-sm); background:var(--surface-2); font-size:13px; max-height:40vh; overflow:auto; margin:12px 0 }
.protocol-picker { display:grid; grid-template-columns:repeat(auto-fit,minmax(120px,1fr)); gap:8px; margin-bottom:16px }
.protocol-picker label { position:relative; display:flex; flex-direction:column; gap:2px; padding:12px; border:1px solid var(--border); border-radius:var(--radius-sm); cursor:pointer; font-size:14px; font-weight:500 } .protocol-picker small { font-size:12px; color:var(--muted); font-weight:400 }
.protocol-picker input { position:absolute; opacity:0; inset:0; margin:0 } .protocol-picker label:has(input:checked) { border-color:var(--accent); background:var(--accent-soft) } .protocol-picker label:has(input:focus-visible) { outline:2px solid var(--accent) }
.info-card { padding:14px 16px; border-radius:var(--radius-sm); background:var(--surface-2); margin-bottom:10px } .info-card strong { display:block; margin-bottom:4px; font-size:14px } .info-card p { font-size:13px; color:var(--text-2) }
.kv-list { display:grid; grid-template-columns:auto 1fr; gap:6px 14px; font-size:14px } .kv-list span { color:var(--muted) }

/* ---------- portal pages (activate, integrations, legacy admin) ---------- */
.portal-page { background:var(--bg) }
.portal-header { display:flex; align-items:center; justify-content:space-between; gap:12px; height:var(--header-h); padding:0 clamp(16px,4vw,48px); background:var(--surface); border-bottom:1px solid var(--border) }
.portal-header-actions { display:flex; align-items:center; gap:10px; font-size:14px }
.admin-main,.integration-main { max-width:960px; margin:0 auto; padding:32px clamp(16px,4vw,48px) 64px }
.admin-main h1 { font-size:clamp(24px,3vw,32px); margin:8px 0 8px }
.admin-main > .portal-muted { margin-bottom:24px }
.activation-card { max-width:460px; margin:40px auto; padding:32px; background:var(--surface); border:1px solid var(--border); border-radius:var(--radius-lg); box-shadow:var(--shadow-lg) }
.activation-card h1 { font-size:24px; margin:8px 0 }
.activation-card form { margin-top:20px } .activation-card label { display:flex; flex-direction:column; gap:6px; font-size:13px; font-weight:500; color:var(--text-2); margin-bottom:14px } .activation-card input { width:100%; min-height:44px; padding:10px 12px; font-size:16px; border:1px solid var(--border-strong); border-radius:var(--radius-sm); background:var(--surface); color:var(--text) }
.activation-card .primary-button { width:100%; margin-top:8px } .activation-card > a { display:inline-block; margin-top:16px; font-size:14px }
.portal-section-heading { display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:10px; margin-bottom:14px }
.portal-card h2 { font-size:18px; margin-bottom:12px }
.portal-card label { display:flex; flex-direction:column; gap:6px; font-size:13px; font-weight:500; color:var(--text-2); margin-bottom:14px }
.integration-fields { display:grid; grid-template-columns:minmax(0,2fr) minmax(0,1fr); gap:12px } @media (max-width:600px) { .integration-fields { grid-template-columns:1fr } }
.integration-scopes { border:1px solid var(--border); border-radius:var(--radius-sm); padding:12px 14px; margin:0 0 14px } .integration-scopes legend { font-size:13px; font-weight:500; color:var(--text-2); padding:0 4px } .integration-scopes label { flex-direction:row; align-items:center; gap:10px; font-weight:400; margin:0; min-height:34px; padding:3px 0 } .integration-scopes input { width:18px; height:18px; min-height:0; padding:0; accent-color:var(--accent); flex:none }
/* Thirteen permissions (9 Nov 2026): rows as tall as a line of text with a mouse, a full touch target on a phone; a label
   that wraps keeps a little air above and below. */
@media (max-width:700px) { .integration-scopes label { min-height:44px; padding:6px 0 } }
.integration-scopes .scope-group { margin:14px 0 2px; font-size:12px; font-weight:600; letter-spacing:.04em; text-transform:uppercase; color:var(--text-3,var(--text-2)) } .integration-scopes legend + .scope-group { margin-top:4px }
.integration-scopes .scope-warning { margin:0 0 8px 28px; padding:8px 10px; border-left:3px solid var(--danger,#b3261e); background:color-mix(in srgb,var(--danger,#b3261e) 8%,transparent); border-radius:var(--radius-sm); font-size:13px; color:var(--text) }
.integration-scopes .scope-never { margin:14px 0 0; padding-top:10px; border-top:1px solid var(--border); font-size:13px; color:var(--text-2) }
.integration-steps { padding-left:20px; font-size:14px; color:var(--text-2); display:grid; gap:6px; margin:0 0 12px }
.user-row { display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:10px; padding:12px 0; border-bottom:1px solid var(--border) } .user-row:last-child { border-bottom:0 }
.user-info strong { display:block; font-size:14px } .user-info small { color:var(--muted) } .user-badges { display:flex; flex-wrap:wrap; gap:6px; margin-top:6px }
.setup-result { background:var(--accent-soft); border-color:transparent }
.setup-code { display:block; padding:12px 14px; border-radius:var(--radius-sm); background:var(--surface); border:1px solid var(--border); font-size:13px; overflow-wrap:anywhere; user-select:all; margin:10px 0 }
.directory-search input { min-width:200px }

/* ---------- maintenance / legal ---------- */
.maintenance { min-height:100vh; display:flex; align-items:center; justify-content:center; padding:32px 16px; text-align:center }
.maintenance .card { max-width:460px; padding:40px 32px } .maintenance h2 { font-size:24px; margin:12px 0 8px } .maintenance p { color:var(--text-2) }
.legal { max-width:820px; margin:0 auto; padding:40px clamp(16px,4vw,48px) 80px } .legal h1 { font-size:clamp(26px,3vw,36px); margin:8px 0 12px } .legal h2 { font-size:20px; margin:32px 0 10px; padding-top:8px } .legal p,.legal li { font-size:15px; line-height:1.75; color:var(--text-2) } .legal ul { padding-left:20px } .legal .meta { font-size:13px; color:var(--muted) }
.consent-box { display:flex; flex-wrap:wrap; align-items:center; gap:10px; padding:16px; border:1px solid var(--border); border-radius:var(--radius); background:var(--surface); margin:16px 0 } .consent-box p { flex:1 1 240px; margin:0; font-size:14px }

/* Touch targets ≥ 44 px and 16 px inputs (no iOS zoom) on phones — kv-flow RULES 28. Kept last so it wins over component rules. */
@media (max-width:700px) { .chip,.btn-sm,.btn-ghost,.text-button,.portal-secondary,.auth-tabs button,.list-toolbar .chip { min-height:44px } .lang-select,.language-picker select,.portal-language select { min-height:40px; font-size:16px } .pagination .icon-btn { width:44px; height:44px } }

/* ---------- recipients: chips + autocomplete (Gmail-style) ---------- */
.recipients { position:relative; display:flex; flex-wrap:wrap; align-items:center; gap:6px; min-height:36px; padding:2px 0 }
.recipients input,#compose-form .field.row .recipients input { flex:1 1 160px; min-width:120px; width:auto; border:0; background:transparent; padding:6px 0; min-height:32px; font-size:16px }
.rcpt { display:inline-flex; align-items:center; gap:4px; max-width:100%; padding:2px 4px 2px 10px; border-radius:var(--radius-pill); background:var(--surface-2); border:1px solid var(--border); font-size:13px; line-height:1.4; color:var(--text) }
.rcpt > span { white-space:nowrap; overflow:hidden; text-overflow:ellipsis; max-width:240px } .rcpt small { color:var(--muted); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; max-width:200px }
.rcpt button { display:inline-flex; width:32px; height:32px; margin:-5px -4px -5px 0; align-items:center; justify-content:center; border-radius:50%; color:var(--muted) } .rcpt button:hover { background:var(--surface-3); color:var(--text) }
.rcpt.invalid { border-color:var(--danger); background:var(--danger-soft) }
button.rcpt.more { padding:2px 10px; min-height:28px; font-weight:600; color:var(--accent); cursor:pointer } button.rcpt.more:hover { background:var(--surface-3) }
.suggest { position:absolute; left:0; right:0; top:100%; z-index:5; margin:4px 0 0; padding:6px; list-style:none; background:var(--surface); border:1px solid var(--border); border-radius:var(--radius-sm); box-shadow:var(--shadow-lg); max-height:240px; overflow:auto }
.suggest li { display:flex; flex-direction:column; gap:1px; padding:8px 10px; border-radius:6px; cursor:pointer; font-size:14px; color:var(--text) } .suggest li small { color:var(--muted); font-size:12px } .suggest li[aria-selected="true"],.suggest li:hover { background:var(--accent-soft) }
@media (max-width:700px) { .rcpt button { width:40px; height:40px; margin:-8px -6px -8px 0 } .suggest li { min-height:44px; justify-content:center } }

/* ---------- multi-select + bulk actions, folder tree (phase 1, 23 Oct 2026) ---------- */
.message-row { cursor:pointer; grid-template-columns:auto auto minmax(0,1fr) auto }
/* The row's checkbox is easy to hit (owner, 29 Oct 2026: "ตรง checkbox อยากให้กดติดง่ายๆ อาจจะให้กดได้ไกลกว่ารูป checkbox"):
   its box covers the start of the row from the top edge to the bottom edge and from the left edge to the next column (the
   star, the avatar), and draws the small box inside; pointing anywhere on it rings the small box. The grid column keeps
   the small box's width, so nothing else moves. While some mail is checked, app.js widens it further (pickingClick). */
.message-row .row-check { appearance:none; -webkit-appearance:none; display:grid; grid-template:var(--check) / var(--check); place-items:center; align-content:start; justify-content:start; box-sizing:border-box; width:calc(var(--pad-x) + var(--check) + var(--check-gap)); height:calc(100% + 2 * var(--pad-y)); margin:calc(-1 * var(--pad-y)) calc(-1 * var(--check-gap)) calc(-1 * var(--pad-y)) calc(-1 * var(--pad-x)); padding:calc(var(--pad-y) + var(--check-top)) var(--check-gap) 0 var(--pad-x); border:0; border-radius:0; background:transparent; cursor:pointer; flex:none }
.message-row .row-check::before,.message-row .row-check::after { content:""; grid-area:1 / 1 }
.message-row .row-check::before { box-sizing:border-box; width:var(--check); height:var(--check); border:2px solid var(--border-strong); border-radius:5px; background:var(--surface); transition:background var(--fast) var(--ease),border-color var(--fast) var(--ease),box-shadow var(--fast) var(--ease) }
.message-row .row-check::after { width:calc(var(--check) * .55); height:calc(var(--check) * .55); background:var(--accent-text); clip-path:polygon(14% 44%,0 65%,50% 100%,100% 16%,80% 0,43% 62%); transform:scale(0); transition:transform var(--fast) var(--ease) }
@media (hover:hover) { .message-row .row-check:hover::before { box-shadow:0 0 0 7px color-mix(in srgb,var(--text) 10%,transparent) } }
.message-row .row-check:checked::before { border-color:var(--accent); background:var(--accent) } .message-row .row-check:checked::after { transform:scale(1) }
.message-row .row-check:focus-visible { outline:none } .message-row .row-check:focus-visible::before { border-color:var(--accent); box-shadow:0 0 0 3px var(--accent-ring) }
.message-row.checked { background:var(--accent-soft) }
.list-toolbar .check-all { display:inline-flex; align-items:center; justify-content:center; width:32px; height:32px; margin-right:2px } .list-toolbar .check-all input { width:18px; height:18px; margin:0; accent-color:var(--accent); cursor:pointer }
.bulk-bar { display:flex; flex-wrap:wrap; align-items:center; gap:6px; padding:8px 12px; border-bottom:1px solid var(--border); background:var(--accent-soft); font-size:13px }
.bulk-bar strong { margin-right:4px; white-space:nowrap } .bulk-bar .spacer { flex:1 }
.folder-tree { display:flex; flex-direction:column; gap:1px; margin:2px 0 6px 24px; padding-left:8px; border-left:1px solid var(--border) }
.folder-tree .nav-button { min-height:34px; font-size:13px; padding:0 8px } .folder-tree .nav-button .icon { width:16px; height:16px }
@media (max-width:700px) { .message-row { --check:22px; --check-top:7px } .bulk-bar .btn-sm { min-height:40px } .folder-tree .nav-button { min-height:40px } }
.icon.flip { transform:scaleX(-1) }
.icon-btn.starred { color:var(--warning) } .icon-btn.starred .icon { fill:currentColor }
.icon-btn.danger:hover { color:var(--danger); background:var(--danger-soft) }
.reader-toolbar { flex-wrap:wrap }
/* phase 2 (23 Oct 2026): move menu, folder tree controls, drag and drop, swipe */
.move-wrap { position:relative; display:inline-flex }
.move-menu { left:0; right:auto; min-width:220px; max-width:320px } .move-menu li { flex-direction:row; align-items:center; gap:8px; white-space:nowrap } .move-menu li span { overflow:hidden; text-overflow:ellipsis }
.tree-row { display:flex; align-items:center; gap:2px } .tree-row .nav-button { flex:1; min-width:0 }
.tree-row .tree-edit { width:28px; height:28px; flex:none; opacity:0; transition:opacity var(--fast) var(--ease) } .tree-row:hover .tree-edit,.tree-row:focus-within .tree-edit { opacity:1 }
.tree-add { color:var(--muted); font-size:13px } .tree-add:hover { color:var(--text) }
.nav-button.drop-target { background:var(--accent-soft); box-shadow:inset 0 0 0 2px var(--accent); color:var(--accent) }
.message-row.dragging { opacity:.55 }
.message-row.swiping { transition:none; touch-action:pan-y } .message-row.swipe-left { background:var(--danger-soft) } .message-row.swipe-right { background:var(--success-soft) }
.message-row .badge.info { font-size:11px }
@media (pointer: coarse) { .tree-row .tree-edit { opacity:1; width:36px; height:36px } .move-menu li { min-height:44px } }
/* sidebar: unread number per mailbox, bold name while unread, dot only when the connection needs attention */
.account-button .unread-count { justify-self:end; min-width:22px; padding:1px 7px; border-radius:999px; font-size:12px; font-weight:600; color:var(--accent); background:var(--accent-soft); text-align:center; font-variant-numeric:tabular-nums }
.account-button.selected .unread-count { background:var(--surface); }
.account-button.has-unread .account-label strong { font-weight:600 }
/* The workspace column is viewport-high so the message list and the reader scroll on their own (Gmail), instead of the page */
.app-shell .main { display:flex; flex-direction:column; height:100vh; height:100dvh; min-height:0; min-width:0 }
.app-shell .main > .panes { flex:1; min-height:0 }
@media (max-width:900px) { .app-shell .main { height:auto; min-height:100vh; min-height:100dvh } }
/* junk folder + folder menus */
.folder-row { display:flex; align-items:center; gap:2px; position:relative } .folder-row > .nav-button { flex:1; min-width:0 }
.folder-row .folder-more { width:36px; height:36px; flex:none; opacity:0; transition:opacity var(--fast) var(--ease) } .folder-row:hover .folder-more,.folder-row:focus-within .folder-more,.folder-row .folder-more[aria-expanded="true"] { opacity:1 }
.folder-menu { position:absolute; left:auto; right:0; top:100%; min-width:230px; max-width:320px; z-index:60 } .folder-menu li { flex-direction:row; align-items:center; gap:8px; white-space:nowrap } .folder-menu li.danger { color:var(--danger) } .folder-menu li.danger:hover { background:var(--danger-soft) }
@media (pointer: coarse) { .folder-row .folder-more { opacity:1; width:40px; height:40px } .folder-menu li { min-height:44px } }
/* Mailbox order (owner, 26 Oct 2026): drag a mailbox (a long press on touch), its ⋯ menu, or Alt+↑ / Alt+↓. The ⋯ shows
   over the unread number while the row is hovered or focused; touch screens keep it in the row. */
#accounts { position:relative }
.account-row { display:flex; align-items:center; gap:2px; position:relative } .account-row > .account-button { flex:1; min-width:0 }
.account-row { -webkit-user-select:none; user-select:none; -webkit-touch-callout:none }
.account-row:hover > .account-button:not(.selected) { background:var(--surface-2) }
.account-row .account-more { position:absolute; top:50%; right:6px; width:32px; height:32px; margin-top:-16px; opacity:0; pointer-events:none; transition:opacity var(--fast) var(--ease) }
.account-row:hover .account-more,.account-row .account-more:focus-visible,.account-row .account-more[aria-expanded="true"] { opacity:1; pointer-events:auto }
.account-row:hover .account-button > :last-child { visibility:hidden }
/* Reached with the keyboard, not merely holding the focus (2 Dec 2026): a mailbox opened with a click kept its ⋯ over its
   number until the focus went elsewhere. :has() in rules of its own, so a browser without it drops only these. */
.account-row:has(:focus-visible) .account-more { opacity:1; pointer-events:auto }
.account-row:has(:focus-visible) .account-button > :last-child,.account-row:has(.account-more[aria-expanded="true"]) .account-button > :last-child { visibility:hidden }
.account-more-space { display:none }
.account-row.drag-source { border-radius:var(--radius-sm); background:var(--accent-soft); box-shadow:inset 0 0 0 1px var(--accent) } .account-row.drag-source > * { visibility:hidden }
#accounts.reordering .folder-tree { display:none }
.mailbox-ghost { position:fixed; z-index:90; margin:0; pointer-events:none; border-radius:var(--radius-sm); background:var(--surface); box-shadow:var(--shadow-lg); outline:1px solid var(--border); transform:scale(1.02) }
.mailbox-ghost .account-more { display:none }
body.reordering-mailboxes,body.reordering-mailboxes * { cursor:grabbing }
.folder-menu li.menu-hint { cursor:default; min-height:0; padding:6px 10px 2px; white-space:normal; font-size:12px; color:var(--muted) } .folder-menu li.menu-hint:hover { background:none }
.folder-menu li.menu-title { padding:4px 10px 6px; font-weight:600; color:var(--text-2); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; display:block }
@media (pointer: coarse) {
  .account-row .account-more { position:static; flex:none; width:40px; height:40px; margin:0; opacity:1; pointer-events:auto }
  .account-row:hover .account-button > :last-child,.account-row:focus-within .account-button > :last-child { visibility:visible }
  .account-row:has(.account-more[aria-expanded="true"]) .account-button > :last-child { visibility:visible }
  .account-more-space { display:block; flex:none; width:40px }
}
@media (prefers-reduced-motion: reduce) { .mailbox-ghost { transform:none } }
/* ---------- HTML mail (A1, 24 Oct 2026): sandboxed frame, remote images bar, attachments above the body, details ---------- */
.reader.has-frame { display:flex; flex-direction:column; overflow:hidden }
.reader.has-frame .reader-content { flex:1; min-height:0; display:flex; flex-direction:column; overflow:auto }
.reader-body { display:flex; flex-direction:column; min-height:0 }
.reader.has-frame .reader-body { flex:1 1 auto }
.mail-html { display:block; width:100%; flex:1 1 auto; min-height:380px; border:1px solid var(--border); border-radius:var(--radius-sm); background:#fff; color-scheme:light }
.images-bar { display:flex; flex-wrap:wrap; align-items:center; gap:8px; padding:8px 12px; margin:0 0 12px; border-radius:var(--radius-sm); background:var(--info-soft); color:var(--text); font-size:13px; line-height:1.5 }
.images-bar > span { flex:1 1 220px; min-width:0 } .images-bar .icon { color:var(--info) } .images-bar.trusted { background:var(--success-soft) } .images-bar.trusted .icon { color:var(--success) }
.view-switch { display:inline-flex; gap:6px; margin:0 0 10px; align-self:flex-start }
.sender-side { display:flex; flex-direction:column; align-items:flex-end; gap:2px } .sender-side .icon-btn { width:36px; height:36px }
.reader-content .attachments { margin:0 0 14px; padding:0; border:0 }
.attachment-list { display:grid; grid-template-columns:repeat(auto-fill,minmax(220px,1fr)); gap:8px }
.attachment-list .attachment { margin:0; text-align:left; width:100%; background:var(--surface); font:inherit; cursor:pointer }
.attachment-thumb { width:40px; height:40px; object-fit:cover; border-radius:6px; background:var(--surface-2); border:1px solid var(--border) }
.reader-more-wrap { position:relative; display:inline-flex }
.reader-menu { left:auto; right:0; min-width:240px; max-width:320px; z-index:20 } .reader-menu li { flex-direction:row; align-items:center; gap:8px; white-space:nowrap }
.details-list { display:grid; grid-template-columns:auto minmax(0,1fr); gap:8px 16px; font-size:14px; margin-bottom:12px } .details-list > span { color:var(--muted) } .details-list > strong { font-weight:500; overflow-wrap:anywhere }
.preview-body { display:flex; align-items:center; justify-content:center; min-height:200px; background:var(--surface-2); border-radius:var(--radius-sm); overflow:auto }
.preview-body img { display:block; max-width:100%; max-height:70vh; height:auto }
.preview-body iframe { width:100%; height:70vh; border:0; background:#fff }
.sender-list { display:flex; flex-direction:column; gap:2px; margin-top:6px } .sender-row { display:flex; align-items:center; justify-content:space-between; gap:8px; font-size:13px } .sender-row > span { overflow-wrap:anywhere }
.message-body a { overflow-wrap:anywhere }
@media (max-width:900px) {
  .reader.has-frame { overflow:visible } .reader.has-frame .reader-content { overflow:visible }
  .mail-html { flex:none; height:72vh; height:72dvh; min-height:340px }
}
@media (pointer: coarse) { .reader-menu li { min-height:44px } }
@media (max-width:700px) { .sender-side .icon-btn { width:40px; height:40px } .view-switch .chip { min-height:40px } }
@media (max-width:600px) { .sender-details { grid-template-columns:auto minmax(0,1fr) } .sender-side { grid-column:1 / -1; flex-direction:row; justify-content:space-between; align-items:center } }
/* ---------- compose (A2, 24 Oct 2026): Cc/Bcc rows, attachments with progress, drop zone ---------- */
#compose-form .field.row.with-action { grid-template-columns:72px minmax(0,1fr) auto }
#compose-form #toggle-cc { min-height:36px; padding:0 10px; font-size:13px }
.compose-files { margin-top:8px; padding-top:8px; border-top:1px solid var(--border) }
.draft-files { display:flex; flex-direction:column; gap:6px }
.draft-file { display:grid; grid-template-columns:auto minmax(0,1fr) auto auto auto; align-items:center; gap:8px; padding:4px 6px 4px 10px; border:1px solid var(--border); border-radius:var(--radius-sm); background:var(--surface-2); font-size:13px }
.draft-file-name,.draft-file > span { min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; color:var(--text) } .draft-file small { color:var(--muted); white-space:nowrap }
/* The name opens the file (9 Nov 2026): only the words are the target, the rest of the row is not. */
.draft-file-name { justify-self:start; max-width:100%; min-height:32px; line-height:32px; text-align:left; text-decoration:none } .draft-file-name:hover,.draft-file-name:focus-visible { color:var(--accent); text-decoration:underline; text-underline-offset:2px }
.draft-file .icon-btn { width:36px; height:36px } .draft-file .draft-file-download { margin-right:-4px }
.draft-file.uploading { grid-template-columns:auto minmax(0,1fr) minmax(60px,120px) auto; padding-right:10px } .draft-file progress { width:100%; height:6px; accent-color:var(--accent) }
.compose-files-bar { display:flex; flex-wrap:wrap; align-items:center; gap:8px; margin-top:6px }
#compose-form.drop-files { outline:2px dashed var(--accent); outline-offset:-10px; background:color-mix(in srgb,var(--accent-soft) 60%,var(--surface)) }
@media (pointer: coarse) { .drop-hint { display:none } }
@media (max-width:700px) { .draft-file .icon-btn { width:40px; height:40px } .draft-file-name { min-height:40px; line-height:40px } #compose-form .field.row.with-action { grid-template-columns:56px minmax(0,1fr) auto } #compose-form #toggle-cc { min-height:40px } }
/* ---------- live inbox, undo, whole folder, search filters, sort, shortcuts (B, 24 Oct 2026) ---------- */
.toast { display:flex; align-items:center; gap:14px }
.toast.working::before { content:""; flex:none; width:16px; height:16px; border-radius:50%; border:2px solid color-mix(in srgb,var(--bg) 35%,transparent); border-top-color:var(--bg); animation:flow-spin 1s linear infinite }
html[data-returning] #landing { display:none }
.toast-action { flex:none; min-height:34px; padding:0 14px; border-radius:var(--radius-pill); border:1px solid color-mix(in srgb,var(--bg) 55%,transparent); color:var(--bg); font-weight:600; font-size:13px }
.toast-action:hover { background:color-mix(in srgb,var(--bg) 16%,transparent) }
.select-all-bar { display:flex; flex-wrap:wrap; align-items:center; justify-content:center; gap:4px 10px; padding:4px 12px; border-bottom:1px solid var(--border); background:var(--surface-2); font-size:13px; text-align:center }
.search-form > .icon-btn { width:40px; height:40px; flex:none } .search-form > .icon-btn[aria-expanded="true"] { background:var(--accent-soft); color:var(--accent) }
.search-filters { padding:12px; border-bottom:1px solid var(--border); background:var(--surface) }
.filters-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(150px,1fr)); gap:0 10px }
.filters-grid .field { margin-bottom:10px } .filters-grid .field input,.filters-grid .field select { min-height:38px; padding:6px 10px; font-size:14px }
.filters-checks { display:flex; flex-wrap:wrap; gap:4px 16px } .filters-checks .field { margin:0 }
.search-filters .dialog-actions { margin-top:10px }
.search-chips { display:flex; flex-wrap:wrap; gap:6px; padding:8px 12px 0 }
.search-status { margin:0; padding:6px 14px 0; font-size:13px; line-height:1.5; color:var(--text-2); font-variant-numeric:tabular-nums }
/* Search help (owner, 26 Oct 2026): floats under the search bar at the (i), within the list pane on every screen. */
.search-help { position:absolute; top:calc(100% - 4px); right:12px; z-index:30; width:min(400px,calc(100% - 24px)); padding:14px 16px; border:1px solid var(--border); border-radius:var(--radius); background:var(--surface); color:var(--text); box-shadow:var(--shadow-lg); font-size:13px; line-height:1.55; max-height:min(560px,calc(100dvh - 200px)); overflow-y:auto; overscroll-behavior:contain; animation:pop var(--fast) var(--ease) }
.search-help-title { margin:0 0 8px; font-size:14px; font-weight:600 }
.search-help dl { display:grid; grid-template-columns:max-content minmax(0,1fr); gap:6px 12px; margin:0 }
.search-help dt { color:var(--text-2); font-weight:500 } .search-help dd { margin:0; overflow-wrap:anywhere }
.search-help code { display:inline-block; margin:0 2px 3px 0; padding:0 5px; border:1px solid var(--border); border-radius:5px; background:var(--surface-2); font-size:12px }
.search-help-tip { margin:10px 0 0; padding-top:8px; border-top:1px solid var(--border); color:var(--text-2) }
@media (max-width:480px) { .search-help dl { grid-template-columns:minmax(0,1fr); gap:2px } .search-help dd + dt { margin-top:6px } }
/* Importance the sender set (26 Oct 2026, night): a red ! before the subject, a quiet arrow for low; words in the reader. */
.importance { display:inline-flex; align-items:center; gap:4px; margin-right:6px; vertical-align:-1px; line-height:1 }
.importance.high b { display:inline-grid; place-items:center; width:16px; height:16px; border-radius:50%; background:var(--danger); color:#fff; font-size:11px; font-weight:800 }
.importance.low { color:var(--info) } .importance.low .icon { width:14px; height:14px }
.importance-words { font-size:12px; font-weight:600; color:var(--danger) } .importance.low .importance-words { color:var(--info) }
h2 .importance { margin-right:10px; vertical-align:2px } h2 .importance.high b { width:20px; height:20px; font-size:13px }
.compose-importance .importance { margin-right:0 } .compose-importance:not(.active) .importance.high b { background:var(--muted) }
.compose-importance.active { background:var(--danger-soft); border-color:var(--danger); color:var(--danger); font-weight:600 }
/* A search that goes on: the row at the end of the list says how far it got, with Stop / Search on. */
.search-more { display:flex; align-items:center; justify-content:center; flex-wrap:wrap; gap:6px 12px; padding:12px 16px; border-top:1px solid var(--border); color:var(--text-2); font-size:13px; text-align:center; font-variant-numeric:tabular-nums }
.search-more-text::before { content:''; display:inline-block; width:8px; height:8px; margin-right:8px; border-radius:50%; background:var(--accent); vertical-align:1px; animation:searching 1.2s ease-in-out infinite }
.search-more.stopped .search-more-text::before { background:var(--muted); animation:none }
@media (prefers-reduced-motion:reduce) { .search-more-text::before,.search-help { animation:none } }
.search-status.pending::before { content:''; display:inline-block; width:8px; height:8px; margin-right:8px; border-radius:50%; background:var(--accent); vertical-align:1px; animation:searching 1.2s ease-in-out infinite }
@keyframes searching { 0%,100% { opacity:.25 } 50% { opacity:1 } }
@media (prefers-reduced-motion:reduce) { .search-status.pending::before { animation:none } }
.search-chip { display:inline-flex; align-items:center; gap:2px; max-width:100%; padding:2px 2px 2px 10px; border-radius:var(--radius-pill); background:var(--accent-soft); color:var(--accent); font-size:12px; font-weight:500 } .search-chip > span { overflow:hidden; text-overflow:ellipsis; white-space:nowrap }
.search-chip button { display:inline-flex; flex:none; width:32px; height:32px; align-items:center; justify-content:center; border-radius:50%; color:inherit } .search-chip button:hover { background:color-mix(in srgb,var(--accent) 14%,transparent) }
.sort-picker { position:relative; display:inline-flex; flex:none }
.sort-picker select { min-height:34px; padding:2px 26px 2px 10px; border:1px solid var(--border); border-radius:var(--radius-sm); background:var(--surface); font-size:12px; color:var(--text-2); appearance:none; max-width:150px }
.sort-picker::after { content:""; position:absolute; right:10px; top:50%; width:6px; height:6px; border-right:1.5px solid var(--muted); border-bottom:1.5px solid var(--muted); transform:translateY(-70%) rotate(45deg); pointer-events:none }
.list-toolbar { flex-wrap:wrap } .list-toolbar .tabs { flex:1 1 auto }
/* The filters say what they show and the bulk buttons what they do (owner, 29 Oct 2026: "แสดงทั้งหมด", "แสดงที่ยังไม่อ่าน",
   "แสดงที่ติดดาว", "ตั้งเป็นอ่านแล้ว", "ตั้งเป็นยังไม่อ่าน"). Where the list is narrow (phones, the list column of the Outlook
   layout) the longer names would push the select-all box onto a line of its own, so the filters take the first line and the
   box, the sort order, the view switch and the count share the second; the bulk buttons sit a little tighter to keep their lines.
   A filter's name never breaks inside its chip: below 360 px the chips are tighter, and on a still narrower screen a whole chip
   takes the next line. */
@media (max-width:700px) {
  .list-toolbar { justify-content:flex-start } .list-toolbar .tabs { order:-1; flex:1 0 100% } .list-toolbar .list-count { margin-left:auto }
  .bulk-bar .btn-sm { padding:0 10px }
}
@media (max-width:359px) { .list-toolbar .tabs { gap:4px } .list-toolbar .chip { padding:0 8px } }
@media (min-width:901px) {
  html[data-layout="outlook"] .list-toolbar { justify-content:flex-start } html[data-layout="outlook"] .list-toolbar .tabs { order:-1; flex:1 0 100% } html[data-layout="outlook"] .list-toolbar .list-count { margin-left:auto }
  html[data-layout="outlook"] .bulk-bar .btn-sm { padding:0 10px }
}
.message-row.arrived { animation:arrive .6s var(--ease) }
@keyframes arrive { from { opacity:0; transform:translateY(-6px); background:var(--accent-soft) } to { opacity:1; transform:none } }
.shortcuts-list { display:grid; grid-template-columns:auto 1fr; gap:8px 16px; margin:0 0 12px; font-size:14px } .shortcuts-list dt { display:flex; gap:4px; align-items:center; white-space:nowrap } .shortcuts-list dd { margin:0; color:var(--text-2) }
@media (max-width:700px) { .toast-action { min-height:40px } .search-chip button { width:40px; height:40px } .sort-picker select { min-height:40px; font-size:16px } .filters-grid .field input,.filters-grid .field select { min-height:44px; font-size:16px } .select-all-bar .btn-ghost { min-height:40px } }
/* ---------- conversations, older mail, drafts on the server (C, 24 Oct 2026) ---------- */
.thread-count { flex:none; margin-right:auto; min-width:22px; padding:0 7px; border-radius:var(--radius-pill); background:var(--surface-3); color:var(--text-2); font-size:12px; font-weight:600; line-height:1.6; text-align:center }
.message-row.unread .thread-count { background:var(--accent-soft); color:var(--accent) }
.load-more { display:flex; justify-content:center; padding:14px 12px 18px }
.load-more .btn { min-width:160px }
.list-section { display:flex; align-items:center; gap:8px; margin:0; padding:14px 14px 8px; border-top:1px solid var(--border); color:var(--muted); font-size:12px; font-weight:600; letter-spacing:.02em; text-transform:uppercase }
.message-row.server-draft .message-subject { color:var(--text-2) }
/* A server draft's row (16 Nov 2026): the row's own button opens it; the named "Move to Trash" button sits at its end. */
.message-row.server-draft { display:flex; align-items:center; cursor:default }
.server-draft-open { display:grid; grid-template-columns:auto minmax(0,1fr); gap:var(--check-gap); align-items:start; flex:1; min-width:0; padding:0; border:0; background:none; color:inherit; font:inherit; text-align:left; cursor:pointer }
@media (max-width:700px) { .message-row.server-draft { flex-wrap:wrap } }
/* The mailboxes whose server drafts could not be read just now (16 Nov 2026 review): one quiet line under the part's title. */
.server-drafts-note { margin:0; padding:0 14px 8px; color:var(--muted); font-size:12px; line-height:1.5 }
.field.inline.sub-option { padding-left:28px } .field.inline.sub-option input:disabled + span { color:var(--muted) }
.thread-meta { display:flex; align-items:center; gap:10px; margin:-6px 0 14px }
.thread-cards { display:flex; flex-direction:column; gap:10px }
.thread-card { border:1px solid var(--border); border-radius:var(--radius); background:var(--surface) }
.thread-card.expanded { box-shadow:var(--shadow) }
.thread-card-head { display:grid; grid-template-columns:auto minmax(0,1fr) auto; gap:12px; align-items:center; width:100%; min-height:56px; padding:10px 14px; text-align:left; color:var(--text) }
.thread-card-head { border-radius:calc(var(--radius) - 1px) } .thread-card.expanded .thread-card-head { border-radius:calc(var(--radius) - 1px) calc(var(--radius) - 1px) 0 0 } .thread-card-head:hover { background:var(--surface-2) }
.thread-card-head time { font-size:12px; color:var(--muted); white-space:nowrap }
.thread-card-who { display:flex; flex-direction:column; min-width:0 } .thread-card-who strong { font-size:14px; font-weight:500 } .thread-card.unread .thread-card-who strong { font-weight:700 }
.thread-card-preview,.thread-card-address { font-size:13px; color:var(--muted); white-space:nowrap; overflow:hidden; text-overflow:ellipsis }
.thread-card.expanded .thread-card-preview,.thread-card:not(.expanded) .thread-card-address { display:none }
.thread-card-body { padding:0 14px 14px } .thread-card:not(.expanded) .thread-card-body { display:none }
.thread-card-tools { display:flex; flex-wrap:wrap; align-items:center; gap:4px 6px; padding:8px 0 10px; margin-bottom:10px; border-bottom:1px solid var(--border) }
.thread-card-tools small { flex:1 1 100%; color:var(--muted); font-size:12px; min-width:0; overflow-wrap:anywhere } .thread-card-tools .spacer { display:none }
.thread-card .mail-html { flex:none; height:60vh; height:60dvh; min-height:320px }
.thread-card .attachments { margin:0 0 12px }
@media (max-width:700px) { .thread-card-head { padding:10px 12px } .thread-card-body { padding:0 12px 12px } .thread-card-tools .btn-ghost { min-height:40px } .load-more .btn { width:100% } }
/* ---------- brand graphics (Linked Inboxes, 24 Oct 2026): a large, faint mark behind the sign-in card, as on the kit's
   link-preview card. It takes no clicks and is clipped to the sign-in screen. ---------- */
.auth-screen { position:relative; isolation:isolate; overflow:hidden }
.auth-screen::before { content:""; position:absolute; z-index:-1; pointer-events:none; width:min(980px,110vw); aspect-ratio:720 / 420; right:-14%; bottom:-12%; background:url("./brand/svg/mark-primary.svg?v=38249af1ab41") no-repeat center / contain; opacity:.07 }
[data-theme="dark"] .auth-screen::before { background-image:url("./brand/svg/mark-dark.svg?v=f3bdf6d41f18"); opacity:.06 }
/* mail view (24 Oct 2026, night): Gmail-style one-line list by default, Outlook-style reading pane on request */
.layout-switch { display:inline-flex; gap:2px; margin-left:6px; padding:2px; border:1px solid var(--border); border-radius:var(--radius-pill) }
.layout-switch .icon-btn { width:34px; height:32px; border-radius:var(--radius-pill) } .layout-switch .icon-btn[aria-pressed="true"] { background:var(--accent-soft); color:var(--accent) }
@media (min-width:901px) {
  html[data-layout="gmail"] .panes { grid-template-columns:1fr; gap:0 }
  html[data-layout="gmail"] .panes[data-view="list"] .reader { display:none } html[data-layout="gmail"] .panes[data-view="reader"] .list-pane { display:none }
}
@media (max-width:900px) { .layout-switch { display:none } }
.message-row.compact { --pad-y:4px; --check-gap:10px; grid-template-columns:auto auto auto 200px minmax(0,1fr) auto auto; align-items:center; gap:var(--check-gap); padding:var(--pad-y) var(--pad-x); min-height:46px }
.message-row.compact .row-check { align-content:center; padding-top:0 }
.message-row.compact .row-star { width:32px; height:32px; color:var(--muted) } .message-row.compact .row-star.static { display:inline-flex; align-items:center; justify-content:center }
.message-row.compact .row-star.starred { color:var(--warning) } .message-row.compact .row-star.starred .icon { fill:currentColor }
.message-row.compact .compact-sender { min-width:0; display:flex; align-items:center; gap:6px } .message-row.compact .compact-sender strong { font-size:14px; font-weight:500; white-space:nowrap; overflow:hidden; text-overflow:ellipsis }
.message-row.compact .compact-text { min-width:0; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; font-size:14px }
.message-row.compact .compact-text .message-subject,.message-row.compact .compact-text .message-preview { display:inline; white-space:nowrap } .message-row.compact .compact-text .message-preview { color:var(--muted) }
.message-row.compact.unread .compact-sender strong,.message-row.compact.unread .message-subject { font-weight:600 } .message-row.compact.unread { background:color-mix(in srgb,var(--accent-soft) 40%,var(--surface)) }
.message-row.compact.checked { background:var(--accent-soft) }
.message-row.compact .message-meta { display:inline-flex; gap:6px; margin:0 }
.message-row.compact .compact-end { display:inline-flex; align-items:center; justify-content:flex-end; min-width:108px }
.message-row.compact .compact-time { font-size:12px; color:var(--muted); white-space:nowrap }
.message-row.compact .row-actions { display:none; gap:2px } .message-row.compact .row-actions .icon-btn { width:32px; height:32px }
.message-row.compact:hover .row-actions,.message-row.compact:focus-within .row-actions { display:inline-flex } .message-row.compact:hover .compact-time,.message-row.compact:focus-within .compact-time { display:none }
/* The j / k cursor shows while the keyboard is in use (html[data-keys]); a click or tap hides it again, like Gmail. */
html[data-keys] .message-row.cursor { box-shadow:inset 3px 0 0 var(--accent) }
@media (max-width:1100px) { .message-row.compact { grid-template-columns:auto auto auto 150px minmax(0,1fr) auto auto } }
/* labels, pins, snoozes and rules (item 10, 24 Oct 2026 night) */
.labels-group { margin-top:4px } .labels-group .section-label { padding:8px 12px 2px; display:flex; align-items:center; justify-content:space-between }
.labels-group .section-label .icon-btn { width:32px; height:32px }
.label-dot { width:10px; height:10px; border-radius:50%; flex:none; display:inline-block; background:var(--label-teal) }
.label-chip { display:inline-flex; align-items:center; gap:5px; padding:1px 8px; border-radius:var(--radius-pill); font-size:11px; font-weight:500; background:var(--surface-2); color:var(--text-2); max-width:140px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis }
.label-chip .label-dot { width:7px; height:7px }
:root { --label-teal:#1b7f73; --label-purple:#6b4fc7; --label-amber:#b66d00; --label-rose:#c43b6a; --label-blue:#2f5aa6; --label-green:#1b7f4b; --label-slate:#5b6472 }
.label-dot.teal,.swatch.teal { background:var(--label-teal) } .label-dot.purple,.swatch.purple { background:var(--label-purple) } .label-dot.amber,.swatch.amber { background:var(--label-amber) } .label-dot.rose,.swatch.rose { background:var(--label-rose) } .label-dot.blue,.swatch.blue { background:var(--label-blue) } .label-dot.green,.swatch.green { background:var(--label-green) } .label-dot.slate,.swatch.slate { background:var(--label-slate) }
.swatches { border:0; padding:0; margin:0 0 16px; display:flex; flex-wrap:wrap; gap:8px } .swatches legend { font-size:13px; font-weight:500; color:var(--text-2); margin-bottom:8px }
.swatch { width:30px; height:30px; border-radius:50%; border:2px solid transparent; cursor:pointer; position:relative } .swatch input { position:absolute; opacity:0; inset:0; cursor:pointer } .swatch:has(input:checked) { border-color:var(--text); box-shadow:0 0 0 2px var(--surface) inset }
.icon.pin { color:var(--accent); transform:rotate(30deg) }
.message-row .badge.snooze { background:var(--info-soft); color:var(--info) } .message-row .badge.due { background:var(--success-soft); color:var(--success) }
.label-menu li,.snooze-menu li,#label-menu li,#snooze-menu li { flex-direction:row; align-items:center; gap:8px } .label-menu li .check,#label-menu li .check { margin-left:auto; color:var(--accent) } .label-menu li.create,.snooze-menu li.pick,#label-menu li.create,#snooze-menu li.pick { border-top:1px solid var(--border); margin-top:4px; padding-top:10px }
.snooze-menu .pick-row,#snooze-menu .pick-row,.row-menu .pick-row { display:flex; gap:6px; align-items:center } .snooze-menu input[type="datetime-local"],#snooze-menu input[type="datetime-local"],.row-menu input[type="datetime-local"] { min-height:36px; font-size:14px; padding:4px 8px; border:1px solid var(--border-strong); border-radius:var(--radius-sm); background:var(--surface); color:var(--text) }
.rules-list { display:flex; flex-direction:column; gap:6px; margin:10px 0 }
.rule-row { display:grid; grid-template-columns:auto minmax(0,1fr) auto; gap:10px; align-items:center; padding:8px 10px; border:1px solid var(--border); border-radius:var(--radius-sm); background:var(--surface-2) }
.rule-row strong { display:block; font-size:14px; font-weight:500 } .rule-row small { display:block; color:var(--muted); font-size:12px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis } .rule-row.off strong { color:var(--muted) }
.rule-row .icon-btn { width:32px; height:32px }
.rule-form { max-width:720px } .rule-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:0 14px } .rule-grid .field.inline { margin-bottom:10px }
@media (max-width:700px) { .rule-grid { grid-template-columns:1fr } }
@media (max-width:700px) { .labels-group .section-label .icon-btn,.rule-row .icon-btn { width:40px; height:40px } }
/* ---------- QC 25 Oct 2026: phones, floating menus, sheets, contrast, compose, sidebar (docs/QC-2026-10-25-desktop.md, docs/QC-2026-10-25-mobile.md) ---------- */
/* M02: the public header never scrolls sideways at 320–600 px. The mark replaces the logo at ≤ 520 px (landing block: the theme button on
   /terms and /integrations needs 497 px with the full logo), and at ≤ 700 px when the header carries two text buttons (signed-in /integrations). */
@media (max-width:600px) { .site-header { gap:8px } .site-actions { min-width:0; gap:4px } .site-actions .btn,.site-actions .btn-ghost,.site-actions .btn-primary { padding:0 10px } .lang-select { padding-left:8px; padding-right:22px } .language-picker::after,.portal-language::after { right:9px } }
@media (max-width:700px) { .site-header:has(.site-actions > :is(.btn,.btn-ghost,.btn-primary):not([hidden]) ~ :is(.btn,.btn-ghost,.btn-primary):not([hidden])) { gap:8px } .site-header:has(.site-actions > :is(.btn,.btn-ghost,.btn-primary):not([hidden]) ~ :is(.btn,.btn-ghost,.btn-primary):not([hidden])) .brand .brand-logo { display:none } .site-header:has(.site-actions > :is(.btn,.btn-ghost,.btn-primary):not([hidden]) ~ :is(.btn,.btn-ghost,.btn-primary):not([hidden])) .brand .brand-mark { display:block } .site-header:has(.site-actions > :is(.btn,.btn-ghost,.btn-primary):not([hidden]) ~ :is(.btn,.btn-ghost,.btn-primary):not([hidden])) .site-actions { min-width:0; gap:4px } }
@media (max-width:480px) { .site-header:has(.site-actions > :is(.btn,.btn-ghost,.btn-primary):not([hidden]) ~ :is(.btn,.btn-ghost,.btn-primary):not([hidden])) { flex-wrap:wrap; justify-content:flex-end; height:auto; min-height:var(--header-h); padding-top:8px; padding-bottom:8px; gap:4px 6px } .site-header:has(.site-actions > :is(.btn,.btn-ghost,.btn-primary):not([hidden]) ~ :is(.btn,.btn-ghost,.btn-primary):not([hidden])) .brand { margin-right:auto } .site-header:has(.site-actions > :is(.btn,.btn-ghost,.btn-primary):not([hidden]) ~ :is(.btn,.btn-ghost,.btn-primary):not([hidden])) .site-actions { display:contents } }
/* The smallest phones (under 360 px) have no room for the brand, the language and both buttons on one line (owner, 29 Oct
   2026: sign-up and sign-in as separate buttons): the brand and the language take the first line, sign-in and sign-up share
   the second, and the header scrolls away with the page. */
@media (max-width:359px) {
  .landing > .site-header:has(#header-register:not([hidden])) { position:relative; display:grid; grid-template-columns:1fr 1fr; grid-template-areas:"brand language" "login signup"; align-items:center; gap:8px; height:auto; padding-top:10px; padding-bottom:10px }
  .landing > .site-header:has(#header-register:not([hidden])) .brand { grid-area:brand; margin:0 }
  .landing > .site-header:has(#header-register:not([hidden])) .language-picker { grid-area:language; justify-self:end }
  .landing > .site-header:has(#header-register:not([hidden])) .site-actions > .btn { grid-area:login }
  .landing > .site-header:has(#header-register:not([hidden])) .site-actions > .btn-primary { grid-area:signup }
}
@media (max-width:360px) { .site-header { padding:0 12px; gap:6px } .site-actions { gap:2px } .site-actions .btn,.site-actions .btn-ghost,.site-actions .btn-primary { padding:0 8px; font-size:13px } .site-actions .icon-btn { width:40px } }
/* D30: the preview's addresses stay inside their column; the trust line wraps per item. M30: balanced English headings — Thai keeps
   normal wrapping, because balance splits ของ|คุณ in the hero title (a clean Thai break needs markup, see the QC report) */
.hero-meta { gap:8px 18px } .hero-meta > span { white-space:nowrap } @media (min-width:1200px) { .hero-meta { column-gap:12px; font-size:12.5px } }
html:lang(en) :is(.hero h1,.section-head h2,.security h2) { text-wrap:balance }
.hero h1 .title-line { display:inline-block } /* for the requested markup: each phrase of the title in a span.title-line, so Thai breaks only between them */
/* D15/M15: contrast — placeholders use the muted token, the shortcut key on the compose button is readable, the security
   card (dark in the light theme) gets the light teal for its eyebrow and icons. No theme follows the device: light unless
   the switch picked dark (owner, 12 Nov 2026) */
input::placeholder,textarea::placeholder { color:var(--muted); opacity:1 }
.compose-button kbd { opacity:1; color:var(--accent-text); background:color-mix(in srgb,var(--accent-text) 14%,transparent); border-color:color-mix(in srgb,var(--accent-text) 45%,transparent) }
.security .eyebrow,.security li .icon { color:#6ed3c3 }
/* D11: selects use the whole field and end in an ellipsis instead of a hard cut */
.field select { width:100%; max-width:100%; text-overflow:ellipsis }
/* D21/M09: the toast sits bottom-left on desktop (clear of the list's page buttons) and above the tab bar on phones.
   In the mail app on a computer (owner, 29 Oct 2026) it sits in the top bar instead, just left of its buttons, over
   nothing that can be clicked: app.js sets --toast-right / --toast-top from the buttons' place (placeToast). */
@keyframes rise-left { from { opacity:0; transform:translateY(8px) } to { opacity:1; transform:none } }
@keyframes drop-in { from { opacity:0; transform:translateY(-8px) } to { opacity:1; transform:none } }
@media (min-width:901px) {
  .toast { left:24px; transform:none; animation-name:rise-left }
  body:has(> #workspace:not([hidden])) .toast { top:var(--toast-top,10px); right:var(--toast-right,24px); bottom:auto; left:auto; max-width:min(480px,calc(100vw - var(--toast-right,24px) - var(--sidebar-w) - 32px)); padding:8px 16px; animation-name:drop-in }
  body:has(> #workspace:not([hidden])) .toast:has(.toast-action:not([hidden])) { padding-right:8px }
}
@media (max-width:900px) { .toast { left:12px; right:12px; width:fit-content; max-width:min(calc(100vw - 24px),480px); margin:0 auto; transform:none; animation-name:rise-left } body:has(> #workspace:not([hidden])) .toast { bottom:calc(var(--tabbar-h) + 12px + env(safe-area-inset-bottom)) } } /* centred by margin, so the toast is no longer squeezed into half the screen */
/* D17: desktop sidebar — logo and compose button stay at the top, account links at the bottom, the middle scrolls.
   No wrapper element: the three parts are sticky inside the scrolling sidebar (top/bottom offsets cancel its 16 px padding);
   the compose button's surface-coloured spread shadow hides the rows that scroll beneath it. */
@media (min-width:901px) {
  .sidebar > .brand { position:sticky; top:-16px; z-index:3; margin:-16px -12px 0; padding:22px 22px 14px; background:var(--surface) }
  /* "เขียนอีเมล" and "รับเมลล่าสุด" stay under the brand while the sidebar scrolls (1 Dec 2026): one solid block from side to
     side, from the brand's edge (stuck at -16 + 64 = 48) down to 12 px under the second button, so no scrolled row shows
     above, between or under them; the buttons sit where they did (compose at 52 when stuck); a hairline under it once the
     sidebar has scrolled. */
  .sidebar > .sidebar-actions { position:sticky; top:48px; z-index:3; margin:-4px -12px 0; padding:4px 12px 12px; background:var(--surface); transition:box-shadow var(--fast) var(--ease) }
  .sidebar.scrolled > .sidebar-actions { box-shadow:0 1px 0 var(--border) }
  .sidebar > .sidebar-bottom { position:sticky; bottom:-16px; z-index:3; margin:auto -12px -16px; padding:12px 12px 16px; background:var(--surface) }
}
/* The sidebar's folds (owner, 4 Nov 2026): on a computer the rows seldom used wait in a card beside the sidebar, opened by
   pointing at or clicking the row that names them (app.js); the sidebar lies above the mail for that card. Phones keep the rows
   in the drawer as they were: the row is not drawn and the card is an ordinary group. */
.nav-fold-label { min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap }
.nav-fold-chevron { flex:none; margin-left:auto; color:var(--muted) } .nav-fold-toggle .count:not([hidden]) + .nav-fold-chevron { margin-left:-6px }
.nav-fold-toggle[aria-expanded="true"]:not(.active) { background:var(--surface-2); color:var(--text) }
.nav-fold-toggle.active .nav-fold-chevron { color:var(--accent) }
@media (min-width:901px) {
  .sidebar { z-index:45 }
  .nav-fold-panel { display:none; position:fixed; z-index:5; width:256px; max-height:calc(100vh - 16px); padding:6px; background:var(--surface); border:1px solid var(--border); border-radius:var(--radius); box-shadow:var(--shadow-lg); animation:fold-in var(--fast) var(--ease) }
  .nav-fold[data-open="true"] > .nav-fold-panel { display:flex }
  .nav-fold-panel .nav-button { min-height:44px }
}
@keyframes fold-in { from { opacity:0; transform:translateX(-6px) } to { opacity:1; transform:none } }
@media (max-width:900px) { .nav-fold-toggle { display:none } }
@media (prefers-reduced-motion:reduce) { .nav-fold-panel { animation:none } }
/* The sidebar's numbers in one column (owner, 2 Dec 2026, on a picture of the three top rows: "เป็นงาน ui เล็กๆ ตรงนี้ไม่รวยเลย
   จัดให้ดี"). The inbox's number sat inside a row cut short for its ⋯, the Drafts number at the edge and the folded row's
   number before its chevron: three lines for three numbers. Now every row is as wide as the two buttons above it, every
   number ends 12px inside its row, the ⋯ of a row shows over its number while the row is pointed at or reached with the
   keyboard (as the mailbox rows always did) and the chevron of a folded row follows its name. Touch screens keep the ⋯ in
   the row: there the rows without one end where the others do, so the numbers still share one line (67px from the edge
   instead of 25px), with the ⋯, the "+" of the labels and the chevron of a folded row in one line after them. */
.sidebar .sidebar-actions > button { margin:0 }
.sidebar .nav-button .count { font-weight:600; color:var(--text-2) } .sidebar .nav-button.active .count,.sidebar .nav-button[aria-current="page"] .count { color:var(--accent) }
.sidebar .folder-tree .nav-button,.sidebar .account-button { padding-right:12px }
@media not all and (pointer:coarse) {
  .sidebar .nav-fold-chevron { margin-left:-6px } .sidebar .nav-fold-toggle .count { order:1 }
  .sidebar .folder-row .folder-more { position:absolute; top:50%; right:6px; width:32px; height:32px; margin-top:-16px; opacity:0; pointer-events:none }
  .sidebar .folder-row:hover .folder-more,.sidebar .folder-row .folder-more:focus-visible,.sidebar .folder-row .folder-more[aria-expanded="true"] { opacity:1; pointer-events:auto }
  .sidebar .folder-row:hover .count { visibility:hidden }
  .sidebar .folder-row:hover > .nav-button:not(.active) { background:var(--surface-2); color:var(--text) }
  /* :has() in rules of its own: a browser without it drops only these, and the ⋯ still shows when it holds the focus itself. */
  .sidebar .folder-row:has(:focus-visible) .folder-more { opacity:1; pointer-events:auto }
  .sidebar .folder-row:has(:focus-visible) .count,.sidebar .folder-row:has(.folder-more[aria-expanded="true"]) .count { visibility:hidden }
  /* Room for the ⋯ whether or not the row has a number: a long name wraps before the ⋯ instead of running under it. */
  .sidebar .folder-row > .nav-button:not(:only-child) .count { min-width:20px; text-align:right }
  .sidebar .folder-row > .nav-button:not(:only-child) > span:not(.count):last-child { margin-right:32px }
  .sidebar .labels-group .section-label { padding-right:6px }
}
@media (pointer:coarse) {
  .sidebar .folder-row > .nav-button:only-child { margin-right:42px }
  .sidebar .apps-group .nav-button,.sidebar #more-folders > .nav-button,.sidebar #accounts > .account-button { width:auto; margin-right:42px }
  /* A wide touch screen has the folded rows too: their chevron stands where the other rows have their ⋯, the number in the column. */
  .sidebar .nav-fold-toggle .count:not([hidden]) + .nav-fold-chevron { margin-left:14px } .sidebar .nav-fold-toggle .nav-fold-label { margin-right:-6px }
  .sidebar #mailbox-count { margin-right:42px }
  .sidebar .labels-group .section-label { padding-right:0 } .sidebar .labels-group .section-label .icon-btn { width:40px; height:40px }
}
/* M30: no keyboard hint on touch layouts */
@media (max-width:900px) { .compose-button kbd { display:none } }
/* D06: compose — the action bar sticks to the bottom of the scrolling form and the body gives way on short screens */
#compose-form textarea { height:clamp(160px,32vh,280px); min-height:120px } /* rows=10 alone is 280 px */
#compose-form .compose-actions { position:sticky; bottom:-24px; z-index:3; margin:18px -24px 0; padding:12px 24px; background:var(--surface); border-top:1px solid var(--border) }
/* D10/M16: the HTML mail frame takes most of the viewport, so a newsletter is read in one frame-high scroll. (A single scroll
   would need the mail document to report its height; it is sandboxed without scripts, so that stays out of reach.) */
@media (min-width:901px) { .mail-html { min-height:clamp(380px,calc(100dvh - 210px),1600px) } } /* 1366×768: 558 px = 73 % and still inside the reader */
@media (max-width:900px) { .mail-html { height:calc(100dvh - 200px) } }
/* D19: the empty star column of non-IMAP rows folds away when no row in the list can show a star; starred looks the same in both views */
.message-list:not(:has(.row-star:not(.static),.row-star.static:not(:empty))) .message-row.compact > .row-star.static { width:0; overflow:hidden }
.message-list:not(:has(.row-star:not(.static),.row-star.static:not(:empty))) .message-row.compact > .row-star.static + .row-pin { margin-left:-10px }
.message-row.compact .row-star.static.starred,.row-markers .icon:not(.pin) { color:var(--warning) } .message-row.compact .row-star.static.starred .icon,.row-markers .icon:not(.pin) { fill:currentColor }
/* D33: the Outlook-style view shows the list beside the reader, so the reader's back button has nothing to do */
@media (min-width:901px) { html[data-layout="outlook"] .reader-toolbar > .back-btn,html[data-layout="outlook"] .reader-toolbar > button:first-child:has(use[href="#i-back"]) { display:none } }
/* D23/M23: label colours in one row, 36 px circles (44 px on phones) */
.swatches { flex-direction:row; align-items:center; gap:10px } .swatch { width:36px; height:36px; flex:none }
/* M30: rule on/off is a brand switch, not a 13 px browser checkbox */
.rule-row > input[type="checkbox"] { appearance:none; -webkit-appearance:none; display:inline-grid; place-items:center; width:44px; height:32px; margin:0; padding:0; border:0; background:transparent; cursor:pointer; flex:none }
.rule-row > input[type="checkbox"]::before,.rule-row > input[type="checkbox"]::after { content:""; grid-area:1 / 1; border-radius:var(--radius-pill); transition:background var(--fast) var(--ease),border-color var(--fast) var(--ease),transform var(--fast) var(--ease),width var(--fast) var(--ease),height var(--fast) var(--ease) }
.rule-row > input[type="checkbox"]::before { width:40px; height:24px; border:2px solid var(--muted); background:var(--surface-3) }
.rule-row > input[type="checkbox"]::after { width:12px; height:12px; background:var(--muted); transform:translateX(-8px) }
.rule-row > input[type="checkbox"]:checked::before { border-color:var(--accent); background:var(--accent) }
.rule-row > input[type="checkbox"]:checked::after { width:16px; height:16px; background:var(--accent-text); transform:translateX(8px) }
.rule-row > input[type="checkbox"]:focus-visible { outline:none } .rule-row > input[type="checkbox"]:focus-visible::before { box-shadow:0 0 0 3px var(--accent-ring) }
/* M08: on phones the reader toolbar sticks below the 56 px top bar (overflow:clip keeps the page, not the reader, as its scroller) */
@media (max-width:900px) { .reader { overflow:visible; overflow:clip } .reader-toolbar { top:56px } }
/* M28: swipe shows what will happen — a red strip on the right for a left swipe, a green one on the left for a right swipe,
   labelled from data-swipe-left / data-swipe-right on the row (the strips ride on the row's own transform) */
@media (max-width:900px) {
  .message-list { overflow-x:hidden }
  .message-row { position:relative }
  .message-row.swipe-left,.message-row.swipe-right { background:var(--surface) }
  .message-row.swipe-left::after,.message-row.swipe-right::before { position:absolute; top:0; bottom:0; display:flex; align-items:center; width:120px; padding:0 16px; color:var(--surface); font-size:13px; font-weight:600; white-space:nowrap; pointer-events:none }
  .message-row.swipe-left::after { content:attr(data-swipe-left); left:100%; justify-content:flex-start; background:var(--danger) }
  .message-row.swipe-right::before { content:attr(data-swipe-right); right:100%; justify-content:flex-end; background:var(--success) }
  .message-row.swipe-armed::after,.message-row.swipe-armed::before { font-size:14px; text-decoration:underline; text-underline-offset:3px }
}
/* M20/M25: phone sheets — the heading (title + close) stays at the top while the sheet scrolls; the wide compose sheet is full width */
@media (max-width:640px) {
  dialog.wide { max-width:100vw }
  dialog :is(.sheet,form) > .dialog-heading:first-child { position:sticky; top:-20px; z-index:6; margin:-20px -16px 12px; padding:14px 16px 10px; background:var(--surface); border-bottom:1px solid var(--border) }
  #compose-form .compose-actions { bottom:calc(-16px - env(safe-area-inset-bottom)); margin:14px -16px 0; padding:10px 16px calc(10px + env(safe-area-inset-bottom)) }
}
/* M03/M13: on phones the floating menus are bottom sheets above the tab bar — always inside the screen, left-aligned, 44 px rows */
@media (max-width:700px) {
  .label-menu,.snooze-menu,.move-menu,.reader-menu,.folder-menu,.row-menu,#label-menu,#snooze-menu,#move-menu { position:fixed; left:12px; right:12px; top:auto; bottom:calc(var(--tabbar-h) + 12px + env(safe-area-inset-bottom)); width:auto; min-width:0; max-width:none; max-height:60dvh; margin:0; padding:8px; overflow:auto; overscroll-behavior:contain; z-index:70; border-radius:var(--radius) }
  .label-menu li,.snooze-menu li,.move-menu li,.reader-menu li,.folder-menu li,.row-menu li,#label-menu li,#snooze-menu li { justify-content:flex-start; min-height:44px; text-align:left }
  #snooze-menu .pick-row,.snooze-menu .pick-row,.row-menu .pick-row { flex-wrap:wrap; width:100% } #snooze-menu input[type="datetime-local"],.snooze-menu input[type="datetime-local"],.row-menu input[type="datetime-local"] { flex:1 1 180px; min-width:0; min-height:44px; font-size:16px } #snooze-menu .pick-row .btn,.snooze-menu .pick-row .btn,.row-menu .pick-row .btn { flex:none }
  .reader-toolbar:has(.reader-menu) { z-index:65 } /* above the tab bar (40) and a toast (60) while its sheet is open */
}
/* M14: tap targets ≥ 40 px on phones — select-all, rule switch, inline checkbox rows, swatches (the row checkbox's box fills the
   start of its row on every screen, 29 Oct 2026) */
@media (max-width:700px) {
  .list-toolbar .check-all { width:40px; height:40px; margin-right:0 }
  .rule-row > input[type="checkbox"] { width:48px; height:44px }
  .field.inline { min-height:40px }
  .swatch { width:44px; height:44px }
}

/* Remembered sign-in and the unlock PIN (25 Oct 2026) */
.auth-card label.remember-field,.activation-card label.remember-field { flex-direction:row; align-items:flex-start; gap:10px; margin:0 0 14px; cursor:pointer }
.auth-card label.remember-field input,.activation-card label.remember-field input { width:20px; height:20px; min-height:0; padding:0; margin:1px 0 0; flex:none; accent-color:var(--accent) }
.remember-field > span { display:flex; flex-direction:column; gap:2px; color:var(--text); font-size:14px }
.lock-card { text-align:center }
.lock-card form { text-align:left; margin-top:18px }
.lock-card h2 { margin:6px 0 8px }
.lock-card .auth-links { justify-content:center }
.lock-badge { position:relative; display:inline-flex; margin:0 auto 16px }
.lock-badge .avatar { width:64px; height:64px; font-size:22px; background:var(--accent-soft); color:var(--accent) }
.lock-badge .icon { position:absolute; right:-4px; bottom:-4px; width:26px; height:26px; padding:5px; border-radius:50%; background:var(--accent); color:var(--accent-text); box-shadow:0 0 0 3px var(--surface) }
.pin-input { font-size:22px !important; letter-spacing:.35em; text-align:center; font-variant-numeric:tabular-nums }
.device-heading { margin:14px 0 4px; font-size:13px; font-weight:600; color:var(--text-2) }
.device-row .btn-sm.forget-here { flex:none; white-space:nowrap; gap:6px }
.device-list { display:flex; flex-direction:column }
.device-row { display:flex; align-items:center; gap:10px; padding:8px 0; border-top:1px solid var(--border) } .device-row:first-child { border-top:0 }
.device-row > .icon { color:var(--muted) }
.device-info { flex:1; min-width:0; display:flex; flex-direction:column; gap:2px }
.info-card .device-info strong { display:flex; flex-wrap:wrap; align-items:center; gap:6px; margin:0; font-size:13px; font-weight:600 }
.device-info small { color:var(--muted); font-size:12px }
.security-card .field { margin-top:10px }
#pin-new-fields .hint { margin:0 0 12px }
.trash-actions { display:flex; flex-wrap:wrap; justify-content:flex-end; gap:6px; flex:none; margin-left:auto }
/* In-page confirmation (owner, 25 Oct 2026): replaces the browser's confirm and prompt boxes everywhere in the mail area */
#confirm-dialog { max-width:min(94vw,460px) }
.confirm-sheet { display:flex; flex-direction:column; gap:14px }
.confirm-icon { display:none; width:44px; height:44px; flex:none; border-radius:50%; align-items:center; justify-content:center; background:var(--danger-soft); color:var(--danger) }
.confirm-sheet.danger .confirm-icon { display:inline-flex }
.confirm-text { margin:0; font-size:15px; line-height:1.65; color:var(--text) }
/* Confirm before deleting (owner, 8 Nov 2026): a tick instead of a typed word — the whole row is the target, roomy on phones */
.confirm-tick { display:flex; gap:12px; align-items:flex-start; margin:0; padding:12px 14px; border:1px solid var(--border); border-radius:var(--radius); background:var(--surface); font-size:14px; line-height:1.55; color:var(--text); cursor:pointer }
.confirm-sheet.danger .confirm-tick,.confirm-tick.danger { background:var(--danger-soft); border-color:transparent }
.confirm-tick input { flex:none; width:20px; height:20px; margin:1px 0 0; accent-color:var(--danger); cursor:pointer }
.confirm-tick:has(input:focus-visible) { outline:2px solid var(--accent); outline-offset:2px }
.confirm-password { margin:0 } .confirm-password > span { font-weight:600; color:var(--text-2) }
.confirm-password input { font-size:16px }
.confirm-status:empty { display:none }
.confirm-note { margin:0; font-size:14px; line-height:1.55; color:var(--text-2) } /* what a delete forever's count found (17 Nov 2026) */
@media (max-width:640px) { #confirm-dialog { max-width:100vw } } /* a phone's sheet spans the screen like every other dialog (it sat at 94vw, flush left) */
.confirm-sheet .dialog-actions { margin-top:4px }
.confirm-sheet .btn-primary.btn-danger { background:var(--danger); border-color:var(--danger); color:var(--surface) }
.confirm-sheet .btn-primary.btn-danger:hover { box-shadow:0 6px 18px color-mix(in srgb,var(--danger) 30%,transparent) }
.confirm-sheet .btn-primary:disabled { opacity:.45; cursor:not-allowed; box-shadow:none }
/* Quick pin next to the star (owner, 25 Oct 2026; Outlook's flag) */
.row-pin { width:32px; height:32px; color:var(--muted) } .row-pin .icon { transform:rotate(30deg) }
.row-pin.pinned,.row-markers .row-pin.pinned { color:var(--accent) } .row-pin.pinned .icon { fill:currentColor }
.message-row.compact .row-pin:not(.pinned) { opacity:.4 } .message-row.compact:hover .row-pin,.message-row.compact:focus-within .row-pin { opacity:1 }
.row-markers .row-pin { width:32px; height:32px; color:var(--muted) } .row-markers .row-pin .icon { color:inherit; fill:none } .row-markers .row-pin.pinned .icon { fill:currentColor }
.message-row:not(.compact) .row-pin:not(.pinned) { opacity:0 } .message-row:not(.compact):hover .row-pin:not(.pinned),.message-row:not(.compact):focus-within .row-pin:not(.pinned) { opacity:.65 }
@media (hover:none) { .message-row:not(.compact) .row-pin:not(.pinned) { display:none } }
/* Notes on messages (owner, 25 Oct 2026): a quiet sticky note under the sender, the owner's own words */
.note-holder:empty { display:none }
.note-card { margin:0 0 16px; padding:12px 14px; border-radius:var(--radius); border:1px solid color-mix(in srgb,var(--warning) 28%,var(--border)); background:color-mix(in srgb,var(--warning-soft) 70%,var(--surface)); box-shadow:var(--shadow) }
.note-head { display:flex; align-items:center; gap:8px; min-height:32px; color:var(--text-2) } .note-head > .icon { color:var(--warning) }
.note-head strong { font-size:13px; font-weight:600; color:var(--text); white-space:nowrap } .note-head small { font-size:12px; color:var(--muted) }
.note-head .icon-btn { width:36px; height:36px } .note-head .spacer { flex:1 }
.note-text { margin:4px 0 2px; font-size:14px; line-height:1.65; white-space:pre-wrap; overflow-wrap:anywhere; color:var(--text) }
.note-input { width:100%; min-height:84px; margin-top:6px; padding:10px 12px; border-radius:var(--radius-sm); border:1px solid var(--border-strong); background:var(--surface); color:var(--text); font:inherit; font-size:14px; line-height:1.6; resize:vertical }
.note-input:focus { outline:none; border-color:var(--accent); box-shadow:0 0 0 3px var(--accent-ring) }
.note-card .hint { display:block; margin-top:6px; font-size:12px; color:var(--muted) }
.note-actions { display:flex; align-items:center; gap:8px; margin-top:8px } .note-actions .spacer { flex:1 }
.note-count { font-size:12px; color:var(--muted); font-variant-numeric:tabular-nums }
.badge.note-badge { padding:2px 6px; background:var(--warning-soft); color:var(--warning) }
.badge.invite-badge { padding:2px 6px; background:var(--info-soft); color:var(--info) }
/* Meeting invitations: add to Google Calendar / Outlook.com, or download the .ics */
.invite-card { display:flex; gap:14px; margin:0 0 16px; padding:16px; border-radius:var(--radius); border:1px solid var(--border); background:linear-gradient(135deg,var(--info-soft),var(--surface) 70%); box-shadow:var(--shadow) }
.invite-icon { display:inline-flex; flex:none; align-items:center; justify-content:center; width:46px; height:46px; border-radius:var(--radius-sm); background:var(--surface); color:var(--info); box-shadow:var(--shadow) }
.invite-main { flex:1; min-width:0; display:flex; flex-direction:column; gap:4px }
.invite-main .eyebrow { margin:0; color:var(--info) }
.invite-title { font-size:16px; font-weight:600; line-height:1.4; overflow-wrap:anywhere }
.invite-when { margin:0; font-size:14px; font-weight:500; color:var(--text) }
.invite-line { display:flex; align-items:flex-start; gap:6px; margin:0; font-size:13px; color:var(--text-2); overflow-wrap:anywhere } .invite-line .icon { margin-top:3px; color:var(--muted); flex:none }
.invite-actions { display:flex; flex-wrap:wrap; gap:8px; margin-top:8px }
.invite-main .hint { font-size:12px; color:var(--muted) }
.invite-card.cancelled { background:var(--surface-2) } .invite-card.cancelled .invite-title { text-decoration:line-through; color:var(--muted) } .invite-card.cancelled .eyebrow { color:var(--danger) }
/* Read receipts: the sender's request, the owner's answer, and receipts for the owner's own mail */
.receipt-bar { display:flex; flex-wrap:wrap; align-items:center; gap:8px 10px; margin:0 0 14px; padding:10px 12px; border-radius:var(--radius-sm); background:var(--accent-soft); color:var(--text); font-size:13px; line-height:1.5 }
.receipt-bar > .icon { color:var(--accent); flex:none }
.receipt-text { flex:1 1 240px; min-width:0 } .receipt-text small { display:block; margin-top:2px; color:var(--warning); font-size:12px }
.receipt-actions { display:flex; gap:6px; flex:none }
.receipt-note { display:flex; align-items:center; gap:6px; margin:0 0 12px; font-size:12px; color:var(--success) } .receipt-note.muted { color:var(--muted) }
.read-by { display:flex; align-items:flex-start; gap:8px; margin:0 0 14px; padding:8px 12px; border-radius:var(--radius-sm); background:var(--success-soft); color:var(--text); font-size:13px }
.read-by > .icon { color:var(--success); margin-top:3px; flex:none } .read-by p { margin:0; overflow-wrap:anywhere }
.compose-option { display:inline-flex; align-items:center; gap:6px; min-height:40px; padding:0 8px; font-size:13px; color:var(--text-2); cursor:pointer }
.compose-option input { width:16px; height:16px; accent-color:var(--accent) }
/* Phones: tap targets of 40px or more and 16px text in the note box (iOS would zoom in on smaller text) */
@media (max-width:700px) { .row-markers .row-pin { width:40px; height:40px; margin:-4px 0 } .note-head { flex-wrap:wrap; row-gap:0 } .note-head .icon-btn { width:44px; height:44px } .note-head small { order:5; flex-basis:100%; padding-left:24px } }
@media (max-width:900px) { .note-input { font-size:16px } }
@media (max-width:600px) { .invite-card { padding:14px; gap:10px } .invite-icon { width:38px; height:38px } .receipt-actions { width:100% } .receipt-actions .btn,.receipt-actions .btn-ghost { flex:1 } }
/* Account recovery (owner, 25 Oct 2026, night): recovery codes shown once, and the sign-up note */
.recovery-codes { margin-top:6px }
.code-list { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:6px 18px; margin:0 0 12px; padding:14px 18px 14px 40px; border-radius:var(--radius-sm); background:var(--surface-2); font-variant-numeric:tabular-nums }
.code-list code { font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace; font-size:15px; letter-spacing:.06em; color:var(--text) }
@media (max-width:420px) { .code-list { grid-template-columns:1fr } }
.register-note { margin:2px 0 10px } .register-note a { font-weight:600 }
/* Unsubscribe next to the sender (List-Unsubscribe, 25 Oct 2026, night) */
.unsubscribe-link { display:inline; padding:0; border:0; background:none; color:var(--accent); font:inherit; font-size:12px; font-weight:600; text-decoration:underline; text-underline-offset:2px; cursor:pointer }
.unsubscribe-link:hover { color:var(--accent-hover) } .unsubscribe-link:disabled { opacity:.5; cursor:progress }
.unsubscribe-done { display:inline-flex; align-items:center; gap:4px; font-size:12px; color:var(--success) }
@media (pointer:coarse),(max-width:700px) { .unsubscribe-link { display:inline-block; min-height:40px; padding:10px 2px; margin:-10px 0 } }
/* Send later and the waiting messages above the drafts (25 Oct 2026, night) */
.send-later { margin:0 0 12px; padding:12px; border-radius:var(--radius-sm); background:var(--surface-2) }
.send-later .hint { margin:0 0 8px }
.send-later-presets { display:flex; flex-wrap:wrap; gap:8px; margin-bottom:10px }
.send-later-presets .chip { flex-direction:column; align-items:flex-start; gap:0; min-height:48px; padding:6px 14px; border-radius:var(--radius-sm) }
.send-later-presets .chip strong { font-size:13px; color:var(--text) } .send-later-presets .chip span { font-size:12px; color:var(--muted) }
.send-later-custom { display:flex; flex-wrap:wrap; align-items:flex-end; gap:8px } .send-later-custom .field { flex:1 1 220px; margin:0 }
.scheduled-section { border-bottom:1px solid var(--border); background:color-mix(in srgb,var(--accent-soft) 45%,var(--surface)) }
.scheduled-section h3 { display:flex; align-items:center; gap:6px; margin:0; padding:10px 16px 4px; font-size:12px; font-weight:600; letter-spacing:.04em; text-transform:uppercase; color:var(--accent) }
/* A waiting row has three parts (avatar, text, buttons), not the four columns of a mail row (the guide session, 16 Nov 2026:
   at 390 px "ส่งทันที" lay over the time and the subject); on a phone the buttons take their own line under the text. */
.scheduled-row { cursor:default; grid-template-columns:auto minmax(0,1fr) auto } .scheduled-row .message-row-heading { gap:8px }
.scheduled-actions { display:flex; flex-wrap:wrap; align-items:center; gap:6px; margin-left:auto }
@media (max-width:700px) { .scheduled-row .scheduled-actions { grid-column:2 / -1; width:auto; justify-content:flex-end; margin-left:0 } .message-row.server-draft .scheduled-actions { width:100%; justify-content:flex-end } .scheduled-actions .btn,.scheduled-actions .btn-ghost { min-height:40px } }

/* ---------- rich text compose (owner, 25 Oct 2026, night): toolbar, editor, link box, the quoted original ---------- */
.editor-shell { position:relative; margin-top:10px }
.editor-toolbar { display:flex; align-items:center; gap:2px; padding:4px; border:1px solid var(--border); border-radius:var(--radius-sm); background:var(--surface-2); overflow-x:auto; scrollbar-width:none }
.editor-toolbar::-webkit-scrollbar { display:none }
.tool-btn { display:inline-flex; align-items:center; justify-content:center; flex:none; width:34px; height:34px; border-radius:6px; color:var(--text-2); transition:background var(--fast) var(--ease),color var(--fast) var(--ease) }
.tool-btn:hover { background:var(--surface); color:var(--text) }
.tool-btn[aria-pressed="true"] { background:var(--accent-soft); color:var(--accent) }
.tool-btn:focus-visible { outline:2px solid var(--accent); outline-offset:1px }
.tool-sep { flex:none; width:1px; height:20px; margin:0 4px; background:var(--border-strong) }
.draft-editor { position:relative; min-height:220px; max-height:min(52vh,560px); overflow-y:auto; margin-top:6px; padding:8px 2px; font-size:16px; line-height:1.65; overflow-wrap:anywhere; cursor:text }
.draft-editor:focus { outline:none }
.draft-editor.is-empty::before { content:attr(placeholder); position:absolute; top:8px; left:2px; color:var(--muted); pointer-events:none }
.draft-editor p { margin:0 0 10px }
.draft-editor blockquote { margin:6px 0 6px 2px; padding-left:12px; border-left:3px solid var(--border-strong); color:var(--text-2) }
.draft-editor ul,.draft-editor ol { margin:4px 0; padding-left:28px }
.draft-editor a { color:var(--accent); text-decoration:underline }
.draft-editor h1,.draft-editor h2,.draft-editor h3 { margin:10px 0 6px; line-height:1.3 } .draft-editor h1 { font-size:24px } .draft-editor h2 { font-size:20px } .draft-editor h3 { font-size:17px }
.draft-editor pre { margin:6px 0; padding:10px 12px; border-radius:var(--radius-sm); background:var(--surface-2); white-space:pre-wrap; font-family:var(--mono); font-size:14px }
.draft-editor code { font-family:var(--mono); font-size:.92em }
.draft-editor table { border-collapse:collapse; margin:6px 0 } .draft-editor td,.draft-editor th { border:1px solid var(--border-strong); padding:4px 8px; vertical-align:top }
.draft-editor hr { border:0; border-top:1px solid var(--border-strong); margin:10px 0 }
.draft-editor .joobmail-signature { color:var(--text-2) }
.link-popover { position:absolute; z-index:5; top:48px; left:0; width:min(380px,100%); padding:14px; border:1px solid var(--border); border-radius:var(--radius); background:var(--surface); box-shadow:var(--shadow-lg) }
.link-popover .field { margin-bottom:10px }
.link-actions { display:flex; flex-wrap:wrap; gap:8px }
.compose-quote { margin-top:8px; border:1px solid var(--border); border-radius:var(--radius-sm); background:var(--surface) }
.compose-quote-bar,.quote-removed { display:flex; align-items:center; gap:8px; padding:4px 6px }
.compose-quote-bar[hidden],.quote-removed[hidden] { display:none }
.quote-header { flex:1 1 auto; min-width:0; overflow:hidden; white-space:nowrap; text-overflow:ellipsis; font-size:12px; color:var(--muted) }
.quote-removed > span { flex:1 1 auto; font-size:13px; color:var(--muted) }
.quote-frame { display:block; width:100%; height:280px; border:0; border-top:1px solid var(--border); border-radius:0 0 var(--radius-sm) var(--radius-sm); background:#fff; color-scheme:light }
@media (max-width:700px) {
  .tool-btn { width:40px; height:40px }
  .compose-quote-bar { flex-wrap:wrap } .quote-header { order:3; flex-basis:100%; padding:0 4px 4px }
  .draft-editor { min-height:180px; max-height:none }
  .link-popover { left:0; right:0; width:auto }
}

/* ---------- Outlook.com / Hotmail with Microsoft sign-in (owner, 25 Oct 2026, night) ---------- */
.oauth-connect { margin:4px 0 14px }
.oauth-btn { display:flex; align-items:center; justify-content:center; gap:10px; width:100%; min-height:48px; font-weight:600 }
.ms-logo { width:20px; height:20px; flex:none }
.oauth-connect .hint { margin:6px 0 0; text-align:center }
.oauth-or { display:flex; align-items:center; gap:10px; margin:14px 0 0; font-size:12px; color:var(--muted) }
.oauth-or::before,.oauth-or::after { content:''; flex:1; height:1px; background:var(--border) }

/* ---------- one scroll for HTML mail (D10/M16, 25 Oct 2026, night): a frame that reported its height keeps it ---------- */
.mail-html.sized,.thread-card .mail-html.sized { flex:none; min-height:0 }
.quote-frame.sized { min-height:0 }

/* ---------- rules as a sentence + the message menu (owner, 27 Oct 2026) ---------- */
.rule-form .dialog-heading .eyebrow { margin-bottom:2px }
.rule-lines { display:flex; flex-direction:column; gap:8px; margin:2px 0 6px }
.rule-line { display:grid; grid-template-columns:44px minmax(150px,max-content) minmax(0,1fr) 36px; gap:8px; align-items:center }
.rule-line .rule-join { font-size:13px; font-weight:600; color:var(--muted); text-align:right; white-space:nowrap }
.rule-line select,.rule-line input { min-height:40px; margin:0 } .rule-line .rule-kind { font-weight:500 }
.rule-line .rule-remove-line { width:36px; height:36px; color:var(--muted) } .rule-line .rule-remove-line:hover { color:var(--danger); background:var(--danger-soft) }
.rule-add { display:inline-flex; align-items:center; min-height:32px; margin:0 0 8px 52px; padding:0 6px; font-size:13px; color:var(--accent); font-weight:500 } .rule-add:disabled { opacity:.45 }
.rule-sentence { margin:12px 0 16px; padding:12px 16px; border-left:3px solid var(--accent); background:var(--accent-soft); border-radius:0 var(--radius-sm) var(--radius-sm) 0; font-size:14px; line-height:1.65; color:var(--text-2) } .rule-sentence:empty { display:none }
.rule-switches { display:flex; flex-wrap:wrap; gap:4px 24px; margin-top:4px }
.row-menu { position:fixed; margin:0; z-index:70 }
@media (min-width:701px) { .row-menu { left:0; top:0; right:auto; min-width:264px; max-width:360px; max-height:calc(100vh - 16px) } } /* on phones the bottom-sheet rule above places it · every row shown while the window has room, else it scrolls inside itself (18 Nov 2026) */
.row-menu li { flex-direction:row; align-items:center; gap:10px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis } .row-menu li span { overflow:hidden; text-overflow:ellipsis }
.row-menu li.danger { color:var(--danger) } .row-menu li.danger:hover,.row-menu li.danger:focus-visible { background:var(--danger-soft) }
.row-menu li .icon { color:var(--muted); flex:none } .row-menu li.danger .icon { color:var(--danger) }
.row-menu li.menu-divider { min-height:0; height:0; margin:4px 6px; padding:0; border-top:1px solid var(--border); cursor:default; pointer-events:none }
.row-menu li.menu-note { cursor:default; font-size:13px; font-weight:600; color:var(--muted) } .row-menu li.menu-note:hover { background:none }
.row-menu li.pick { cursor:default } .row-menu li.pick:hover { background:none } .row-menu li .label-dot { flex:none } .row-menu li .check { margin-left:auto }
@media (max-width:700px) {
  .rule-line { grid-template-columns:minmax(0,1fr) 44px } .rule-line .rule-join { grid-column:1 / -1; text-align:left } .rule-line .rule-value { grid-column:1 } .rule-line .rule-fixed { display:none }
  .rule-line select,.rule-line input { min-height:44px; font-size:16px } .rule-line .rule-remove-line { width:44px; height:44px }
  .rule-add { margin-left:0; min-height:44px; padding:0 8px }
}

/* ---------- joobmail's own calendar (owner, 30 Oct 2026): the band at the top like the mail list, month / week / day / agenda ---------- */
.calendar { display:flex; flex-direction:column; flex:1; min-height:0; margin:12px clamp(12px,2vw,24px) 16px; border:1px solid var(--border); border-radius:var(--radius-lg); background:var(--surface); box-shadow:var(--shadow); overflow:hidden }
.cal-chrome { background:var(--band); color:var(--band-text); box-shadow:var(--band-light); border-bottom:1px solid var(--band-line) }
.cal-head { display:flex; flex-wrap:wrap; align-items:center; gap:8px; padding:10px 12px }
.cal-head .chip:not(.active) { background:var(--glass); border-color:var(--glass-line); color:var(--band-text) } .cal-head .chip:not(.active):hover { background:var(--glass-hover); border-color:rgba(255,255,255,.34); color:#fff }
.cal-head .chip.active { background:var(--band-text); border-color:var(--band-text); color:var(--band-ink) }
.cal-head .icon-btn { color:var(--band-text) } .cal-head .icon-btn:hover { background:var(--glass-hover); color:#fff } .cal-head .icon-btn[aria-expanded="true"] { background:var(--glass-hover); color:var(--gold-text) }
.cal-head :focus-visible { outline-color:var(--gold) }
.cal-steps { display:inline-flex; gap:2px }
.cal-title { flex:1 1 auto; min-width:0; margin:0 4px; font-size:18px; font-weight:600; color:var(--band-text); white-space:nowrap; overflow:hidden; text-overflow:ellipsis }
.cal-views { display:flex; flex-wrap:wrap; gap:6px }
.cal-new { min-height:36px; background:var(--gold); border-color:var(--gold); color:var(--band-ink); box-shadow:none } .cal-new:hover { background:var(--gold-text); border-color:var(--gold-text); box-shadow:0 6px 18px rgba(212,181,124,.35) } .cal-new .icon { color:inherit }
.cal-more-wrap { position:relative; display:inline-flex }
.cal-menu { left:auto; right:0; min-width:250px; z-index:30 } .cal-menu li { flex-direction:row; align-items:center; gap:8px; white-space:nowrap } .cal-menu li .icon { color:var(--muted) }
.cal-body { flex:1; min-height:0; overflow:auto; position:relative; background:var(--surface); display:flex; flex-direction:column }
.cal-body[aria-busy="true"] { opacity:.6 }
:root { --cal-teal:var(--label-teal); --cal-purple:var(--label-purple); --cal-amber:var(--label-amber); --cal-rose:var(--label-rose); --cal-blue:var(--label-blue); --cal-green:var(--label-green); --cal-slate:var(--label-slate) }
.cal-chip.teal,.cal-block.teal,.cal-dot.teal,.cal-color.teal { background:var(--cal-teal) } .cal-chip.purple,.cal-block.purple,.cal-dot.purple,.cal-color.purple { background:var(--cal-purple) } .cal-chip.amber,.cal-block.amber,.cal-dot.amber,.cal-color.amber { background:var(--cal-amber) }
.cal-chip.rose,.cal-block.rose,.cal-dot.rose,.cal-color.rose { background:var(--cal-rose) } .cal-chip.blue,.cal-block.blue,.cal-dot.blue,.cal-color.blue { background:var(--cal-blue) } .cal-chip.green,.cal-block.green,.cal-dot.green,.cal-color.green { background:var(--cal-green) } .cal-chip.slate,.cal-block.slate,.cal-dot.slate,.cal-color.slate { background:var(--cal-slate) }
/* month */
.cal-month { display:grid; grid-template-rows:auto 1fr; flex:1 0 auto }
.cal-weekdays { display:grid; grid-template-columns:repeat(7,1fr); border-bottom:1px solid var(--border); background:var(--surface-2) }
.cal-weekdays span { padding:6px 4px; font-size:12px; font-weight:600; color:var(--muted); text-align:center; letter-spacing:.02em; white-space:nowrap; overflow:hidden; text-overflow:ellipsis }
.cal-grid { display:grid; grid-template-columns:repeat(7,1fr); grid-auto-rows:minmax(104px,1fr); min-height:0 }
.cal-day { position:relative; display:flex; flex-direction:column; align-items:stretch; gap:3px; padding:6px; border-right:1px solid var(--border); border-bottom:1px solid var(--border); border-radius:0; text-align:left; color:var(--text); background:var(--surface); overflow:hidden; min-width:0; transition:background var(--fast) var(--ease) }
.cal-day:nth-child(7n) { border-right:0 } .cal-day:hover { background:var(--surface-2) }
.cal-day.other { color:var(--muted); background:color-mix(in srgb,var(--surface-2) 45%,var(--surface)) } .cal-day.weekend:not(.other) { background:color-mix(in srgb,var(--surface-2) 28%,var(--surface)) }
.cal-day.selected { box-shadow:inset 0 0 0 2px var(--accent) }
.cal-day-num { align-self:flex-start; min-width:32px; min-height:32px; margin:-3px 0 -3px -3px; padding:0 3px; border-radius:8px; display:inline-flex; align-items:center; justify-content:center; font-size:13px; font-weight:600; font-variant-numeric:tabular-nums } .cal-day-num:hover { background:var(--surface-3) }
.cal-day-num > span { display:inline-flex; align-items:center; justify-content:center; min-width:26px; height:26px; padding:0 6px; border-radius:13px }
.cal-day.today .cal-day-num > span { background:var(--accent); color:var(--accent-text) }
.cal-chip { display:flex; align-items:center; gap:6px; width:100%; min-height:32px; padding:0 8px; border-radius:7px; border-left:3px solid rgba(0,0,0,.18); font-size:12.5px; font-weight:500; line-height:1.3; color:#fff; text-align:left; overflow:hidden; white-space:nowrap; text-overflow:ellipsis; transition:filter var(--fast) var(--ease) }
.cal-chip:hover { filter:brightness(1.08) } .cal-chip > span { flex:1 1 auto; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap } .cal-chip time { flex:none; font-size:11.5px; font-weight:400; opacity:.88 }
.cal-chip.cancelled,.cal-block.cancelled,.cal-agenda-item.cancelled strong { text-decoration:line-through; opacity:.72 }
.cal-more-link { align-self:flex-start; min-height:32px; padding:0 6px; border-radius:6px; font-size:12px; color:var(--accent) } .cal-more-link:hover { background:var(--accent-soft) }
.cal-dots { display:none }
/* week and day: a time grid with the all-day row above it */
.cal-timegrid { display:grid; grid-template-rows:auto auto minmax(0,1fr); flex:1 1 auto; min-height:0; --hour-h:48px; --gutter:52px }
.cal-tg-head { display:grid; grid-template-columns:var(--gutter) repeat(var(--cols),minmax(0,1fr)); border-bottom:1px solid var(--border); background:var(--surface-2) }
.cal-tg-day { display:flex; flex-direction:column; align-items:center; justify-content:center; gap:1px; min-height:48px; padding:4px 2px; border-left:1px solid var(--border); border-radius:0; color:var(--text) } .cal-tg-day:hover { background:var(--surface-3) }
.cal-tg-day small { font-size:11px; color:var(--muted); letter-spacing:.02em; white-space:nowrap } .cal-tg-day strong { display:inline-flex; width:28px; height:28px; border-radius:14px; align-items:center; justify-content:center; font-size:15px; font-variant-numeric:tabular-nums }
.cal-tg-day.today strong { background:var(--accent); color:var(--accent-text) } .cal-tg-day.weekend small { color:var(--text-2) }
.cal-allday { display:grid; grid-template-columns:var(--gutter) repeat(var(--cols),minmax(0,1fr)); border-bottom:1px solid var(--border); min-height:38px }
.cal-allday-label { padding:8px 6px 0 0; font-size:11px; color:var(--muted); text-align:right; white-space:nowrap }
.cal-allday-cell { display:flex; flex-direction:column; gap:3px; min-width:0; padding:3px; border-left:1px solid var(--border) }
.cal-tg-scroll { overflow:auto; min-height:0; position:relative; overscroll-behavior:contain }
.cal-tg-body { display:grid; grid-template-columns:var(--gutter) repeat(var(--cols),minmax(0,1fr)); height:calc(var(--hour-h) * 24); position:relative }
.cal-hours { position:relative } .cal-hour-label { position:absolute; right:6px; transform:translateY(-50%); font-size:11px; color:var(--muted); font-variant-numeric:tabular-nums; white-space:nowrap }
.cal-col { position:relative; min-width:0; border-left:1px solid var(--border) } .cal-col.today { background:color-mix(in srgb,var(--accent-soft) 35%,var(--surface)) }
.cal-hour { position:absolute; left:0; right:0; display:block; width:100%; height:var(--hour-h); border-top:1px solid var(--border); border-radius:0 } .cal-hour.first { border-top:0 } .cal-hour:hover { background:var(--accent-soft) }
.cal-block { position:absolute; min-height:32px; padding:3px 6px; border-radius:7px; border-left:3px solid rgba(0,0,0,.18); color:#fff; font-size:12px; line-height:1.3; text-align:left; overflow:hidden; box-shadow:0 1px 2px rgba(0,0,0,.22); z-index:1; transition:filter var(--fast) var(--ease) } .cal-block:hover { filter:brightness(1.08); z-index:3 }
.cal-block strong { display:block; font-weight:600; overflow:hidden; text-overflow:ellipsis; white-space:nowrap } .cal-block time { display:block; font-size:11px; opacity:.9; white-space:nowrap }
.cal-now { position:absolute; left:0; right:0; height:2px; background:var(--danger); z-index:2; pointer-events:none } .cal-now::before { content:""; position:absolute; left:-4px; top:-3px; width:8px; height:8px; border-radius:50%; background:var(--danger) }
/* agenda */
.cal-agenda { padding:4px 0 24px; flex:1 0 auto }
.cal-agenda-day { display:grid; grid-template-columns:72px minmax(0,1fr); gap:12px; padding:12px 16px; border-bottom:1px solid var(--border) }
.cal-agenda-date { text-align:center; padding-top:4px } .cal-agenda-date strong { display:block; font-size:22px; line-height:1.1; font-variant-numeric:tabular-nums } .cal-agenda-date small { display:block; font-size:11px; color:var(--muted); white-space:nowrap }
.cal-agenda-day.today .cal-agenda-date strong { color:var(--accent) } .cal-agenda-day.today .cal-agenda-date small { color:var(--accent) }
.cal-agenda-list { display:flex; flex-direction:column; gap:4px; min-width:0 }
.cal-agenda-item { display:grid; grid-template-columns:12px 96px minmax(0,1fr); gap:10px; align-items:center; width:100%; min-height:44px; padding:6px 10px; border-radius:var(--radius-sm); text-align:left; color:var(--text) } .cal-agenda-item:hover { background:var(--surface-2) }
.cal-agenda-item .cal-color { width:10px; height:10px; border-radius:50%; flex:none }
.cal-agenda-item time { font-size:13px; color:var(--muted); font-variant-numeric:tabular-nums; white-space:nowrap } .cal-agenda-item strong { display:block; font-weight:500; overflow:hidden; text-overflow:ellipsis; white-space:nowrap } .cal-agenda-item small { display:block; color:var(--muted); overflow:hidden; text-overflow:ellipsis; white-space:nowrap }
.cal-empty { display:flex; flex:1 0 auto; flex-direction:column; align-items:center; justify-content:center; gap:10px; padding:56px 24px; text-align:center; color:var(--muted) } .cal-empty .icon { width:36px; height:36px; color:var(--border-strong) } .cal-empty p { max-width:420px }
/* the event dialog */
.event-allday { margin:-6px 0 12px }
.event-when { display:grid; grid-template-columns:64px minmax(0,1fr) 128px; gap:8px; align-items:center; margin-bottom:10px } .event-when .field { margin:0 } .event-when-label { font-size:13px; font-weight:500; color:var(--text-2) }
#event-form[data-allday="true"] .event-when { grid-template-columns:64px minmax(0,1fr) } #event-form[data-allday="true"] .event-time { display:none }
.event-zone { margin:0 0 14px; font-size:12px } .event-grid { display:grid; grid-template-columns:1fr 1fr; gap:12px }
#event-form .swatches { margin-bottom:12px }
.feed-link input { font-family:var(--mono); font-size:13px }
@media (max-width:900px) {
  .calendar { margin:10px 12px 12px; border-radius:var(--radius) }
  .cal-head { padding:8px 10px } .cal-title { font-size:16px; order:-1; flex:1 1 100%; margin:0 2px 2px } .cal-views .chip { min-height:40px; padding:0 10px } .cal-head .chip,.cal-head .icon-btn,.cal-new { min-height:40px }
  .cal-grid { grid-auto-rows:minmax(60px,1fr) } .cal-day { min-height:60px; padding:4px 2px; align-items:center; gap:0 } .cal-day-num { align-self:center; min-height:40px; min-width:40px; margin:0 }
  .cal-day .cal-chip,.cal-day .cal-more-link { display:none } .cal-dots { display:flex; flex-wrap:wrap; justify-content:center; gap:3px; max-width:100% } .cal-dot { width:7px; height:7px; border-radius:50% }
  .cal-timegrid { --hour-h:56px; --gutter:44px } .cal-block { min-height:40px } .cal-tg-day { min-height:44px }
  .cal-agenda-day { grid-template-columns:56px minmax(0,1fr); padding:10px 12px; gap:10px } .cal-agenda-item { grid-template-columns:12px minmax(0,1fr); row-gap:2px } .cal-agenda-item time { grid-column:2 } .cal-agenda-item .cal-agenda-text { grid-column:2 } .cal-agenda-item .cal-color { grid-row:1 / span 2 }
  .event-when { grid-template-columns:56px minmax(0,1fr) 112px } .event-grid { grid-template-columns:1fr }
  .tabbar { grid-template-columns:repeat(6,1fr) }
  .feed-link input { font-size:16px }
}
@media (max-width:480px) { .cal-tg-head .cal-tg-day small { font-size:10px } .cal-tg-day strong { width:26px; height:26px; font-size:14px } }
/* DD/MM/YYYY date fields with the native picker behind a button, and where an event came from (owner, 30 Oct 2026) */
.date-field { position:relative } .date-field input[type="text"] { padding-right:44px; font-variant-numeric:tabular-nums }
.date-field .date-picker { position:absolute; left:0; bottom:0; width:1px; height:1px; opacity:0; pointer-events:none; border:0; padding:0; min-height:0 }
.date-field .date-pick { position:absolute; right:4px; bottom:4px; width:36px; height:36px; color:var(--muted) } .date-field .date-pick:hover { color:var(--accent); background:var(--accent-soft) }
.event-source { display:flex; flex-wrap:wrap; align-items:center; gap:6px 10px; margin:0 0 4px; padding:10px 12px; border-radius:var(--radius-sm); background:var(--surface-2); font-size:13px; color:var(--text-2); line-height:1.5 }
.event-source .event-source-text { flex:1 1 240px; min-width:0; overflow-wrap:anywhere } .event-source .event-source-text strong { font-weight:600; color:var(--text) }
.event-source .btn-ghost { flex:none; border:1px solid var(--border-strong); background:var(--surface) }
.cal-agenda-item .cal-source { display:block; color:var(--muted); font-size:12px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap }
.cal-agenda-date time { display:block; font-size:11px; color:var(--muted); font-variant-numeric:tabular-nums; white-space:nowrap }
.reader-missing { margin:0 auto; max-width:520px; padding:12px 16px; border-radius:var(--radius-sm); background:var(--surface-2); text-align:left; font-size:14px } .reader-missing strong { display:block; margin-bottom:2px }
@media (max-width:900px) { .date-field .date-pick { width:44px; height:44px; right:0; bottom:0 } .date-field input[type="text"] { padding-right:48px } .cal-agenda-item .cal-source { white-space:normal } }
/* ---------- joobmail's own address book (owner, 30–31 Oct 2026; docs/CONTACTS.md): rail · list · card under the band ---------- */
.people { display:flex; flex-direction:column; flex:1; min-height:0; margin:12px clamp(12px,2vw,24px) 16px; border:1px solid var(--border); border-radius:var(--radius-lg); background:var(--surface); box-shadow:var(--shadow); overflow:hidden }
.people-chrome { background:var(--band); color:var(--band-text); box-shadow:var(--band-light); border-bottom:1px solid var(--band-line) }
.people-head { display:flex; flex-wrap:wrap; align-items:center; gap:8px; padding:10px 12px }
.people-head .chip:not(.active) { background:var(--glass); border-color:var(--glass-line); color:var(--band-text) } .people-head .chip:not(.active):hover,.people-head .chip[aria-expanded="true"] { background:var(--glass-hover); border-color:rgba(255,255,255,.34); color:#fff }
.people-head .chip .icon { color:var(--gold-text) } .people-head :focus-visible { outline-color:var(--gold) }
.people-head .search-form input:not(:focus) { background:var(--surface); border-color:var(--glass-line); box-shadow:0 1px 3px rgba(0,0,0,.22) }
.people-head .search-form input:focus { border-color:var(--gold); box-shadow:0 0 0 3px rgba(212,181,124,.4) }
.people-head .sort-picker select { background:var(--surface); border-color:var(--glass-line); color:var(--text); min-height:40px; font-size:13px }
.people-search { flex:1 1 280px; min-width:0 }
.people-new { min-height:40px; background:var(--gold); border-color:var(--gold); color:var(--band-ink); box-shadow:none } .people-new:hover { background:var(--gold-text); border-color:var(--gold-text); box-shadow:0 6px 18px rgba(212,181,124,.35) } .people-new .icon { color:inherit }
.people-rail-wrap { display:none }
.people-body { display:grid; grid-template-columns:232px minmax(280px,380px) minmax(0,1fr); flex:1; min-height:0 }
/* the rail */
.people-rail { display:flex; flex-direction:column; gap:2px; padding:10px 8px 16px; border-right:1px solid var(--border); overflow:auto; background:color-mix(in srgb,var(--surface-2) 40%,var(--surface)) }
.people-rail .section-label { padding:14px 8px 4px } .people-rail .section-label .icon-btn { width:32px; height:32px }
.people-rail-item .count { margin-left:auto; font-size:12px; color:var(--muted); font-variant-numeric:tabular-nums } .people-rail-item.active .count { color:inherit }
.people-rail-item > span:not(.count) { flex:1 1 auto; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap }
.people-rail-item.soon { color:var(--muted); cursor:default } .people-rail-item.soon:hover { background:transparent; color:var(--muted) }
.soon-tag { margin-left:auto; padding:1px 7px; border-radius:var(--radius-pill); background:var(--surface-3); font-size:10.5px; font-weight:600; color:var(--text-2); white-space:nowrap }
.people-rail-sep { height:1px; margin:8px 6px; background:var(--border) }
.people-rail-hint { margin:2px 10px 4px; font-size:12px; line-height:1.45 }
/* the list */
.people-list-pane { display:flex; flex-direction:column; min-width:0; min-height:0; border-right:1px solid var(--border) }
.people-list-head { display:flex; align-items:center; gap:6px; min-height:44px; padding:4px 12px; border-bottom:1px solid var(--border) }
.people-list-head .check-all { display:inline-flex; align-items:center; justify-content:center; width:32px; height:32px } .people-list-head .check-all input { width:18px; height:18px; margin:0; accent-color:var(--accent); cursor:pointer }
.people-count { font-size:12.5px; color:var(--muted); font-variant-numeric:tabular-nums }
.people-bulk { padding:8px 10px } .people-bulk strong { margin-right:4px } .people-bulk .move-wrap { position:relative }
.people-bulk-everyone { color:var(--accent); font-weight:600 } /* contacts QC D15 */
html[data-keys] #people-list .person-row.cursor { box-shadow:inset 3px 0 0 var(--accent) } /* the keyboard's row, as the mail list's (QC D16) */
.people-list-wrap { position:relative; flex:1; min-height:0; display:flex }
.people-list { flex:1; min-width:0; overflow:auto; overscroll-behavior:contain; padding:4px 0 24px }
.people-list[aria-busy="true"] { opacity:.65 }
.people-letter { position:sticky; top:0; z-index:1; padding:6px 16px 4px; font-size:12px; font-weight:700; letter-spacing:.06em; color:var(--accent); background:color-mix(in srgb,var(--surface) 92%,transparent); backdrop-filter:blur(6px) }
.person-row { display:flex; align-items:center; gap:2px; min-height:56px; padding:0 6px 0 4px; border-radius:0; transition:background var(--fast) var(--ease) }
.person-row:hover { background:var(--surface-2) } .person-row.selected { background:var(--accent-soft) } .person-row.checked { background:color-mix(in srgb,var(--accent-soft) 70%,var(--surface)) }
.person-check { display:inline-flex; align-items:center; justify-content:center; width:40px; height:44px; flex:none; cursor:pointer } .person-check input { width:18px; height:18px; margin:0; accent-color:var(--accent); cursor:pointer }
.person-open { display:flex; align-items:center; gap:12px; flex:1 1 auto; min-width:0; min-height:52px; padding:4px 6px; border-radius:var(--radius-sm); text-align:left; color:var(--text) }
.person-row-text { display:flex; flex-direction:column; min-width:0 } .person-row-text strong { font-weight:600; font-size:14.5px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap } .person-row-text small { font-size:12.5px; color:var(--muted); overflow:hidden; text-overflow:ellipsis; white-space:nowrap }
.person-star { flex:none; color:var(--border-strong) } .person-star.starred,.person-starred .icon { color:#d4a72c } .person-star.starred .icon { fill:#d4a72c }
.person-add-suggested { flex:none; min-height:36px; padding:0 12px; font-size:13px }
.people-more-row { display:flex; justify-content:center; padding:10px }
.people-empty { display:flex; flex-direction:column; align-items:center; gap:10px; padding:48px 24px; text-align:center; color:var(--muted) } .people-empty .icon { width:36px; height:36px; color:var(--border-strong) } .people-empty p { max-width:320px; margin:0 }
.people-index { display:flex; flex-direction:column; align-items:center; gap:0; padding:6px 2px; overflow:auto; scrollbar-width:none; width:30px; flex:none; border-left:1px solid var(--border) }
.people-index[hidden] { display:none } .people-index::-webkit-scrollbar { display:none }
.people-index-letter { display:flex; align-items:center; justify-content:center; flex:none; width:26px; min-height:32px; border-radius:6px; font-size:11px; font-weight:600; color:var(--text-2) } .people-index-letter:hover { background:var(--accent-soft); color:var(--accent) }
/* avatars: a photo or the initials, in one of the label colours */
.person-avatar { display:inline-flex; align-items:center; justify-content:center; flex:none; width:38px; height:38px; border-radius:50%; overflow:hidden; color:#fff; font-size:14px; font-weight:600; text-transform:uppercase; background:var(--label-slate); line-height:1 }
.person-avatar img { width:100%; height:100%; object-fit:cover; display:block }
.person-avatar.sm { width:28px; height:28px; font-size:11.5px } .person-avatar.lg { width:72px; height:72px; font-size:24px } .person-avatar.xl { width:88px; height:88px; font-size:30px }
.person-avatar.teal { background:var(--label-teal) } .person-avatar.purple { background:var(--label-purple) } .person-avatar.amber { background:var(--label-amber) } .person-avatar.rose { background:var(--label-rose) }
.person-avatar.blue { background:var(--label-blue) } .person-avatar.green { background:var(--label-green) } .person-avatar.slate { background:var(--label-slate) }
/* the person card */
.people-card { min-width:0; overflow:auto; overscroll-behavior:contain; padding:0 0 32px }
.people-card-empty { display:flex; flex-direction:column; align-items:center; justify-content:center; gap:8px; min-height:100%; padding:48px 24px; text-align:center; color:var(--muted) } .people-card-empty .icon { width:40px; height:40px; color:var(--border-strong) } .people-card-empty h2 { margin:0; font-size:17px; color:var(--text-2) } .people-card-empty p { margin:0; max-width:340px }
.person-head { position:relative; display:flex; flex-direction:column; align-items:center; gap:10px; padding:28px 20px 18px; text-align:center; border-bottom:1px solid var(--border); background:linear-gradient(180deg,color-mix(in srgb,var(--gold) 9%,var(--surface)),var(--surface)) }
.person-head .person-avatar.xl { box-shadow:0 0 0 4px var(--surface),0 0 0 5px color-mix(in srgb,var(--gold) 55%,transparent) }
.person-head-text h2 { display:flex; align-items:center; justify-content:center; gap:6px; margin:0; font-size:22px; font-weight:650; line-height:1.25; overflow-wrap:anywhere } .person-head-text p { margin:2px 0 0; color:var(--text-2); overflow-wrap:anywhere }
.person-muted { color:var(--muted) !important; font-size:13px }
.person-back { display:none; position:absolute; left:8px; top:8px }
.person-actions { display:flex; flex-wrap:wrap; justify-content:center; gap:6px; margin-top:4px }
.person-action { display:inline-flex; flex-direction:column; align-items:center; justify-content:center; gap:4px; min-width:68px; min-height:60px; padding:6px 8px; border-radius:var(--radius); color:var(--text-2); font-size:12px; font-weight:500; text-decoration:none; transition:background var(--fast) var(--ease),color var(--fast) var(--ease) }
.person-action .icon { width:22px; height:22px; padding:9px; box-sizing:content-box; border-radius:50%; background:var(--surface-2); color:var(--accent); transition:background var(--fast) var(--ease) }
.person-action:hover:not(:disabled) { background:var(--surface-2); color:var(--text); text-decoration:none } .person-action:hover:not(:disabled) .icon { background:var(--accent-soft) }
.person-action:disabled { opacity:.45; cursor:default } .person-action.starred .icon { color:#d4a72c; fill:#d4a72c }
.person-actions .move-wrap { position:relative; display:inline-flex }
.person-trash-note { display:flex; flex-wrap:wrap; align-items:center; justify-content:center; gap:8px; padding:8px 12px; border-radius:var(--radius-sm); background:var(--warning-soft,var(--surface-2)); color:var(--text-2); font-size:13px }
.person-section { padding:16px 22px 4px } .person-section h3 { margin:0 0 8px; font-size:12px; font-weight:700; letter-spacing:.06em; text-transform:uppercase; color:var(--muted) }
.person-field { display:grid; grid-template-columns:24px minmax(0,1fr); gap:12px; align-items:start; padding:8px 0; border-bottom:1px solid color-mix(in srgb,var(--border) 70%,transparent) } .person-field:last-child { border-bottom:0 }
.person-field > .icon { margin-top:2px; color:var(--muted) }
.person-field-text { display:flex; flex-direction:column; min-width:0 } .person-field-text > a,.person-field-text > span,.person-field-link { overflow-wrap:anywhere; font-size:14.5px; color:var(--text); text-align:left }
.person-field-text > a,.person-field-link { color:var(--accent) } .person-field-link:hover { text-decoration:underline } .person-field-link { display:inline-flex; align-items:center; align-self:flex-start; min-height:32px; padding:0; max-width:100% } .person-field-text > a { display:inline-flex; align-items:center; align-self:flex-start; min-height:32px }
.person-field-text .multiline,.person-notes { white-space:pre-line } .person-field-text small { color:var(--muted); font-size:12px }
.person-notes { margin:0; padding:10px 12px; border-radius:var(--radius-sm); background:var(--surface-2); font-size:14px; line-height:1.55; overflow-wrap:anywhere }
.person-groups { display:flex; flex-wrap:wrap; align-items:center; gap:6px } .person-group-chip { min-height:34px } .person-groups .move-wrap { position:relative; display:inline-flex }
.person-mail { display:flex; flex-direction:column }
.person-mail-row { display:grid; grid-template-columns:20px minmax(0,1fr) auto; gap:10px; align-items:center; min-height:44px; padding:6px 8px; margin:0 -8px; border-radius:var(--radius-sm); text-align:left; color:var(--text) } .person-mail-row:hover { background:var(--surface-2) }
.person-mail-row .icon { color:var(--muted) } .person-mail-subject { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:14px }
.person-mail-meta { display:flex; align-items:center; gap:6px; font-size:12px; color:var(--muted); font-variant-numeric:tabular-nums; white-space:nowrap }
.person-search-all { margin-top:6px }
.person-source { margin:16px 22px 0; font-size:12px }
.people-menu { position:absolute; left:auto; right:0; top:100%; min-width:240px; z-index:30 } .people-bulk .people-menu { left:0; right:auto }
.people-menu li { flex-direction:row; align-items:center; gap:8px; white-space:nowrap } .people-menu li span { flex:1 1 auto; overflow:hidden; text-overflow:ellipsis } .people-menu li.danger { color:var(--danger) } .people-menu li .icon { color:var(--muted) } .people-menu li.danger .icon { color:var(--danger) }
.people-group-chip .label-dot,.people-menu .label-dot { flex:none }
/* names in mail that open the person card */
@media (hover:hover) and (pointer:fine) { .message-row strong.person-name:hover { text-decoration:underline; text-underline-offset:3px; cursor:pointer } }
.person-link { display:inline; min-height:0; padding:0; border:0; background:none; font:inherit; color:inherit; text-align:inherit; cursor:pointer; border-radius:3px } .person-link:hover { text-decoration:underline; text-underline-offset:3px; color:var(--accent) }
.recipient-links .person-link { color:var(--text-2) }
.person-menu { padding-top:0; max-height:min(72vh,560px) } .person-menu li.person-menu-head { display:flex; flex-direction:row; align-items:center; gap:12px; padding:12px 10px; margin:0 -6px 6px; border-bottom:1px solid var(--border); cursor:default; background:transparent; border-radius:0 }
.person-menu li.person-menu-head:hover { background:transparent } .person-menu-text { display:flex; flex-direction:column; min-width:0 } .person-menu-text strong { font-size:15px; overflow:hidden; text-overflow:ellipsis } .person-menu-text small { color:var(--muted); overflow:hidden; text-overflow:ellipsis }
.person-menu-status { color:var(--accent) !important; font-size:12px } .person-menu li[aria-disabled="true"] { opacity:.5; pointer-events:none }
/* compose: people, groups and suggestions */
.suggest li.suggest-row { flex-direction:row; align-items:center; gap:10px } .suggest-text { display:flex; flex-direction:column; min-width:0 } .suggest-text > span { overflow:hidden; text-overflow:ellipsis; white-space:nowrap } .suggest-text small { overflow:hidden; text-overflow:ellipsis; white-space:nowrap }
.suggest-icon { display:inline-flex; align-items:center; justify-content:center; width:28px; height:28px; border-radius:50%; background:var(--accent-soft); color:var(--accent); flex:none }
/* the dialog */
.person-dialog form { display:block }
.person-photo-row { display:flex; align-items:center; gap:16px; margin:0 0 16px } .person-photo-actions { display:flex; flex-wrap:wrap; align-items:center; gap:8px } .person-photo-actions .hint { flex:1 1 100%; margin:0; font-size:12px }
.person-grid { display:grid; grid-template-columns:1fr 1fr; gap:0 12px } .person-grid.three { grid-template-columns:repeat(3,1fr) }
.person-list-field { border:0; padding:0; margin:0 0 12px } .person-list-field legend { font-size:13px; font-weight:500; color:var(--text-2); margin-bottom:6px; padding:0 }
.person-item { display:grid; grid-template-columns:minmax(0,1fr) 128px 44px; gap:6px; align-items:start; margin-bottom:6px }
.person-item:has(.person-label-text:not([hidden])) { grid-template-columns:minmax(0,1fr) 128px 120px 44px }
.person-item.custom { grid-template-columns:160px minmax(0,1fr) 44px } .person-item.date { grid-template-columns:150px minmax(0,1fr) 44px } .person-item.date:has(.person-label-text:not([hidden])) { grid-template-columns:150px 140px minmax(0,1fr) 44px }
.person-item input,.person-item select,.person-item textarea,.person-birthday input { width:100%; min-width:0; min-height:44px; padding:8px 10px; font-size:15px; border:1px solid var(--border-strong); border-radius:var(--radius-sm); background:var(--surface); color:var(--text) }
.person-item textarea { min-height:64px; resize:vertical; font-family:inherit }
.person-item input:focus,.person-item select:focus,.person-item textarea:focus { outline:none; border-color:var(--accent); box-shadow:0 0 0 3px var(--accent-ring) }
.person-remove { width:44px; height:44px; color:var(--muted) } .person-remove:hover { color:var(--danger); background:var(--danger-soft) }
.person-add { min-height:40px; color:var(--accent) }
.person-birthday { display:grid; grid-template-columns:minmax(0,220px) auto; gap:12px; align-items:end } .person-birthday .field.inline { margin-bottom:14px }
.person-birthday-hint { margin:-6px 0 12px; font-size:12px }
.person-more-toggle { margin:0 0 10px } .person-more-toggle .icon { transition:transform var(--fast) var(--ease) } .person-more-toggle[aria-expanded="true"] .icon { transform:rotate(90deg) }
.person-more { padding:12px 0 0; border-top:1px dashed var(--border) }
.person-conflict { display:flex; flex-wrap:wrap; align-items:center; gap:8px 10px; margin:0 0 12px; padding:10px 12px; border-radius:var(--radius-sm); background:var(--danger-soft); color:var(--text); font-size:13.5px } .person-conflict .icon { color:var(--danger) } .person-conflict span { flex:1 1 220px }
.people-shortcut .dialog-actions { margin-top:6px }
/* contacts QC 1 Nov 2026: Save stays in view while the form scrolls, as compose (D11 = M06); another date has the birthday's
   picker (D12); the empty book offers an import too (D22); the person card from mail is a sheet on a scrim with a handle and
   a close button on phones (M04) */
#person-form .dialog-actions { position:sticky; bottom:-24px; z-index:3; margin:18px -24px 0; padding:12px 24px; background:var(--surface); border-top:1px solid var(--border) }
.person-date-value { display:block; min-width:0 }
.people-empty-actions { display:flex; flex-wrap:wrap; justify-content:center; gap:8px }
.person-menu-close { display:none; margin-left:auto; flex:none }
.menu-scrim { z-index:60 }
@media (max-width:700px) {
  .person-menu { z-index:72 } .person-menu::before { content:''; display:block; width:36px; height:4px; margin:6px auto 0; border-radius:2px; background:var(--border-strong) }
  .person-menu-close { display:inline-flex; width:44px; height:44px }
}
@media (max-width:640px) { #person-form .dialog-actions { bottom:calc(-16px - env(safe-area-inset-bottom)); margin:14px -16px 0; padding:10px 16px calc(10px + env(safe-area-inset-bottom)) } }
@media (max-width:1100px) { .people-body { grid-template-columns:200px minmax(260px,340px) minmax(0,1fr) } }
/* "รวมรายชื่อซ้ำ" on a computer: the groups take the card's room, so the people of a group sit side by side */
@media (min-width:901px) { .people[data-mode="duplicates"] .people-body { grid-template-columns:232px minmax(0,1fr) } .people[data-mode="duplicates"] .people-card { display:none } .people[data-mode="duplicates"] .people-list-pane { border-right:0 } }
@media (min-width:901px) and (max-width:1100px) { .people[data-mode="duplicates"] .people-body { grid-template-columns:200px minmax(0,1fr) } }
/* phones and narrow windows: one column at a time — the list, then the card (the rail opens as a sheet) */
@media (max-width:900px) {
  .people { margin:10px 12px 12px; border-radius:var(--radius) }
  .people-head { padding:8px 10px } .people-rail-wrap { display:inline-flex; min-width:0 } .people-head .chip,.people-head .sort-picker select,.people-new { min-height:44px }
  /* two lines: the view and "new" first, then the search with the sort beside it */
  .people-rail-wrap { order:1; flex:0 1 auto } .people-new { order:2; margin-left:auto } .people-search { order:3; flex:1 1 160px } .people-head .sort-picker { order:4 }
  .people-head .sort-picker select { font-size:16px; max-width:132px }
  .people-rail-toggle { max-width:56vw } .people-rail-toggle span { overflow:hidden; text-overflow:ellipsis; white-space:nowrap }
  .people[data-view="card"] .people-chrome { display:none } /* the card has its own way back; the list's band waits behind it */
  .people-rail .section-label .icon-btn { width:44px; height:44px } .person-group-chip { min-height:44px }
  .people-body { grid-template-columns:minmax(0,1fr) }
  .people-rail { position:fixed; left:12px; right:12px; bottom:calc(var(--tabbar-h) + 12px + env(safe-area-inset-bottom)); max-height:70dvh; z-index:70; border:1px solid var(--border); border-radius:var(--radius); box-shadow:var(--shadow-lg); background:var(--surface); transform:translateY(calc(100% + 120px)); visibility:hidden; transition:transform var(--normal) var(--ease),visibility 0s linear var(--normal) }
  .people-rail[data-open="true"] { transform:none; visibility:visible; transition:transform var(--normal) var(--ease) }
  .people-rail .nav-button { min-height:48px } .people-rail .folder-row .folder-more { opacity:1; width:44px; height:44px } .people-scrim { z-index:65 }
  .people[data-view="list"] .people-card { display:none } .people[data-view="card"] .people-list-pane { display:none }
  .people-list-pane { border-right:0 } .person-row { min-height:60px } .person-check { width:44px; height:48px } .person-open { min-height:56px }
  /* every control here at least 44 px on phones (review 31 Oct 2026: these later rules beat the ≤700px .btn-sm rule) */
  .people-index { width:40px } .people-index-letter { min-height:44px; width:38px } .person-field-link,.person-field-text > a { min-height:44px }
  .people-list-head .check-all { width:44px; height:44px } .person-add,.person-add-suggested { min-height:44px } .person-add-suggested { padding:0 14px }
  .person-back { display:inline-flex } .person-head { padding-top:40px }
  .person-action { min-width:62px; min-height:64px } .person-section { padding:14px 16px 4px } .person-source { margin:14px 16px 0 }
  .person-grid,.person-grid.three { grid-template-columns:1fr }
  .person-item,.person-item:has(.person-label-text:not([hidden])) { grid-template-columns:minmax(0,1fr) 112px 44px } .person-item .person-label-text:not([hidden]) { grid-column:1 / 3 }
  .person-item.custom { grid-template-columns:minmax(0,1fr) 44px } .person-item.custom .person-custom-label { grid-column:1 / 3 } .person-item.custom .person-value { grid-column:1 }
  .person-item.date,.person-item.date:has(.person-label-text:not([hidden])) { grid-template-columns:minmax(0,1fr) 44px } .person-item.date > * { grid-column:1 } .person-item.date .person-remove { grid-column:2; grid-row:1 }
  .person-item input,.person-item select,.person-item textarea,.person-birthday input { font-size:16px }
  .person-birthday { grid-template-columns:1fr } .person-birthday .field.inline { margin:-4px 0 8px }
  .person-mail-row { grid-template-columns:20px minmax(0,1fr); row-gap:2px } .person-mail-meta { grid-column:2 }
  .people-bulk .btn { min-height:44px } .people-bulk .people-menu { position:fixed; left:12px; right:12px; top:auto; bottom:calc(var(--tabbar-h) + 12px + env(safe-area-inset-bottom)); z-index:70 }
  .person-actions .people-menu,.person-groups .people-menu { position:fixed; left:12px; right:12px; top:auto; bottom:calc(var(--tabbar-h) + 12px + env(safe-area-inset-bottom)); z-index:70 } .people-menu li { min-height:48px }
}
/* contacts QC 1 Nov 2026: phones' 44 px targets (M08) — the name in the reader that opens the person card, the drawer's
   contacts and calendar entries, the letter index, the selection bar's Delete and Clear; at 360 px and below a row's label goes
   under its full-width value (M09: at 320 px an address or e-mail had 118 px beside a 112 px label) */
@media (max-width:900px) {
  .sender-details strong > .person-link { display:inline-flex; align-items:center; min-height:44px }
  .recipient-links .person-link { padding:11px 2px; margin:0 -2px }
  .apps-group .nav-button { min-height:44px }
  .people-index-letter { width:44px } .people-index { width:46px }
  .people-bulk .btn,.people-bulk .btn-ghost { min-width:44px; min-height:44px }
}
@media (max-width:360px) {
  .person-item,.person-item:has(.person-label-text:not([hidden])) { grid-template-columns:minmax(0,1fr) minmax(0,1fr) 44px }
  .person-item > .person-value { grid-column:1 / -1 } .person-item > .person-label { grid-column:1 / 3 } .person-item > .person-remove { grid-column:3 }
  .person-item:has(.person-label-text:not([hidden])) > .person-label { grid-column:1 } .person-item > .person-label-text:not([hidden]) { grid-column:2 }
}
@media print { .people-chrome,.people-rail,.people-list-pane,.person-actions,.person-back,.person-search-all { display:none !important } .people-body { display:block } .people { border:0; box-shadow:none } }

/* ---- the address book's import / export, duplicates and merge (session contacts-exchange, 31 Oct 2026) ---- */
.exchange-tabs { display:flex; gap:8px; margin:0 0 16px }
.exchange-tabs .chip { min-height:44px; padding:0 16px } /* 44 px on every width (review 31 Oct 2026: 40 px between 641 and 700 px) */
.exchange-panel[hidden] { display:none }
.import-drop { display:flex; flex-direction:column; align-items:center; gap:10px; padding:28px 18px; border:1.5px dashed var(--border-strong); border-radius:var(--radius); background:var(--surface-2); text-align:center; transition:border-color var(--fast) var(--ease),background var(--fast) var(--ease) }
.import-drop > .icon { width:34px; height:34px; color:var(--accent) } .import-drop-title { margin:0; font-weight:600; color:var(--text) } .import-drop .hint { margin:0; max-width:440px }
.import-drop.dragging { border-color:var(--accent); background:var(--accent-soft) }
.import-summary { margin:0 0 12px; font-weight:600; line-height:1.5 }
.import-table-wrap { max-height:min(46vh,420px); overflow:auto; border:1px solid var(--border); border-radius:var(--radius-sm) }
.import-table { width:100%; border-collapse:collapse; font-size:13.5px }
.import-table th { position:sticky; top:0; z-index:1; padding:8px 10px; background:var(--surface-2); text-align:left; font-size:12px; font-weight:600; color:var(--muted) }
.import-table td { padding:8px 10px; border-top:1px solid var(--border); max-width:220px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap }
.import-status { display:inline-block; padding:2px 9px; border-radius:var(--radius-pill); font-size:12px; font-weight:600; white-space:nowrap }
.import-status.new { background:var(--success-soft); color:var(--success) } .import-status.duplicate { background:var(--info-soft); color:var(--info) } .import-status.invalid { background:var(--warning-soft); color:var(--warning) }
.import-status.inFile { background:var(--surface-2); color:var(--muted) } .import-why { display:block; margin-top:3px; color:var(--muted); font-size:12px } /* QC 1 Nov 2026 D01/D02 */
.import-row.invalid td:not(:last-child) { color:var(--muted) }
.import-notes { display:flex; flex-direction:column; gap:4px; margin:10px 0 0 } .import-note { margin:0 }
.import-choice,.export-formats { display:flex; flex-direction:column; gap:2px; margin:16px 0 0; padding:0; border:0 }
.import-choice legend,.export-formats legend { margin-bottom:6px; font-weight:600; font-size:14px }
.import-choice label,.export-formats label { display:flex; align-items:center; gap:10px; min-height:44px; padding:0 10px; border-radius:var(--radius-sm); cursor:pointer }
.import-choice label:hover,.export-formats label:hover { background:var(--surface-2) }
.import-choice input,.export-formats input { width:18px; height:18px; margin:0; flex:none; accent-color:var(--accent) }
.import-result { margin:0; font-size:16px; font-weight:600 }
.exchange-panel .dialog-actions { margin-top:16px }
/* duplicates: groups of people side by side, one kept */
.dup-group { margin:12px; padding:14px; border:1px solid var(--border); border-radius:var(--radius); background:var(--surface) }
.dup-head { display:flex; flex-wrap:wrap; align-items:center; gap:6px 8px; margin-bottom:12px } .dup-head .icon { color:var(--accent) } .dup-head .hint { flex:1 1 100%; margin:0 }
.dup-shared { color:var(--muted); font-size:13px; overflow-wrap:anywhere } .dup-warn { margin:-4px 0 12px }
.dup-people { display:grid; grid-template-columns:repeat(auto-fit,minmax(190px,1fr)); gap:10px }
.dup-person { position:relative; display:flex; flex-direction:column; align-items:flex-start; gap:4px; min-width:0; padding:12px; border:1.5px solid var(--border); border-radius:var(--radius-sm); cursor:pointer; transition:border-color var(--fast) var(--ease),background var(--fast) var(--ease) }
.dup-person:hover { border-color:var(--border-strong) } .dup-person.keep { border-color:var(--accent); background:var(--accent-soft) }
.dup-pick { display:flex; align-items:center; gap:8px; min-height:32px; font-size:12.5px; font-weight:600; color:var(--muted) } .dup-pick input { width:18px; height:18px; margin:0; accent-color:var(--accent) } .dup-person.keep .dup-pick { color:var(--accent) }
.dup-who { display:flex; align-items:center; gap:10px; min-width:0; margin:2px 0 4px } .dup-who-text { display:flex; flex-direction:column; min-width:0 }
.dup-name { font-size:15px; overflow-wrap:anywhere } .dup-job { color:var(--text-2); font-size:12.5px }
.dup-line { display:flex; align-items:center; gap:6px; max-width:100%; font-size:13px; color:var(--text-2) } .dup-line .icon { flex:none; color:var(--muted) } .dup-line span { overflow:hidden; text-overflow:ellipsis; white-space:nowrap }
.dup-after { margin:10px 0 0 } .dup-actions { display:flex; flex-wrap:wrap; gap:8px; margin-top:12px }
.merge-dialog .search-form { margin-bottom:10px } .merge-results { display:flex; flex-direction:column; max-height:min(50vh,440px); overflow:auto }
.merge-candidate { width:100% } .merge-candidate:hover { background:var(--surface-2) }
.merge-compare .dup-group { margin:0 0 10px }
.cal-chip .icon { flex:none; width:14px; height:14px }
@media (max-width:640px) {
  .import-table thead { display:none } .import-table,.import-table tbody,.import-table tr,.import-table td { display:block; width:100% }
  .import-table tr { padding:8px 10px; border-top:1px solid var(--border) } .import-table td { padding:2px 0; border:0; max-width:none; white-space:normal }
  .import-table td::before { content:attr(data-label) " · "; color:var(--muted); font-size:12px }
  .import-table td:first-child { font-weight:600 } .import-table td:first-child::before { content:none }
  .dup-group { margin:10px 8px; padding:12px } .dup-actions .btn-primary,.dup-actions .btn-ghost { flex:1 1 140px; min-height:44px }
  .exchange-tabs .chip { flex:1 1 0; justify-content:center; min-height:44px }
}
/* Phones: every control of the calendar's header is a 44 px target too — the 900 px rule above kept them at 40 (review 1 Nov 2026,
   the birthdays chip). Last in the file so it wins by order. */
@media (max-width:700px) { .cal-head .chip,.cal-head .icon-btn,.cal-new,.cal-views .chip,#cal-birthdays { min-height:44px } }
/* Deleting the account (1 Nov 2026, docs/ACCOUNT-DELETION.md): the account dialog's card and what the dialog lists. */
.delete-card { border:1px solid color-mix(in srgb,var(--danger) 28%,transparent) }
.delete-points { margin:0 0 12px; padding-left:20px; font-size:14px; line-height:1.6; color:var(--text-2) } .delete-points li + li { margin-top:6px }
/* The public legal pages /privacy, /delete-account and /terms (1 Nov 2026): links between them, the provider from the back
   office, the steps of deleting an account. */
.legal .legal-links { display:flex; flex-wrap:wrap; gap:4px 8px; align-items:center } .legal .legal-links a { display:inline-flex; align-items:center; min-height:44px }
.legal .controller { display:grid; gap:8px; margin:12px 0 0; padding:16px; border:1px solid var(--border); border-radius:var(--radius); background:var(--surface) }
.legal .controller div { display:grid; grid-template-columns:minmax(120px,max-content) minmax(0,1fr); gap:4px 16px } .legal .controller dt { color:var(--muted); font-size:14px } .legal .controller dd { margin:0; font-size:15px; color:var(--text); overflow-wrap:anywhere }
.legal .steps { padding-left:22px } .legal .steps li + li { margin-top:6px }
/* The breadcrumb of a public page (11 Nov 2026, kv-flow RULES 61): the same two steps as its BreadcrumbList. Not .crumbs: the articles' own breadcrumb (articles.css) has that name. */
.page-crumbs { display:flex; flex-wrap:wrap; align-items:center; gap:4px 8px; margin:0 0 12px; font-size:14px; color:var(--muted) } .page-crumbs a { color:var(--text-2); display:inline-flex; align-items:center; min-height:32px } .page-crumbs [aria-current] { color:var(--text-2) }
.legal .legal-note { padding:12px 16px; border-left:3px solid var(--accent); background:var(--surface-2); border-radius:0 var(--radius-sm) var(--radius-sm) 0 }
.legal p > .btn { display:inline-flex; min-height:44px; align-items:center }
@media (max-width:480px) { .legal .controller div { grid-template-columns:minmax(0,1fr); gap:0 } }
/* A destructive main button outside the confirm sheet (delete the account, remove the recovery e-mail, remove the PIN): solid
   red with light text as in the confirm sheet — the red text alone sat on the teal of .btn-primary on phones (1 Nov 2026). */
.btn-primary.btn-danger { background:var(--danger); border-color:var(--danger); color:var(--surface) }
.btn-primary.btn-danger:hover { background:var(--danger); box-shadow:0 6px 18px color-mix(in srgb,var(--danger) 30%,transparent) }
