/* Themes. Classic = :root (Gmail-like blue), Halo Light (default) and Halo Dark override it. */
:root{
  --bg:#f6f8fc; --search:#e9eef6; --search-focus:#fff; --compose:#c2e7ff; --compose-text:#001d35; --compose-line:transparent;
  --nav-active:#d3e3fd; --nav-active-text:#041e49; --accent:#0b57d0; --accent-soft:#d3e3fd; --on-accent:#fff;
  --surface:#fff; --surface-2:#f1f3f4; --read:#f2f6fc; --unread-bg:#fff;
  --text:#1f1f1f; --muted:#444746; --snip:#5f6368; --line:#e0e3e7; --row-line:#eef0f2; --sel:#c2dbff;
  --border:#dadce0; --border-strong:#747775; --hover:rgba(68,71,70,.08);
  --rail1:#0b57d0; --rail2:#f4b400; --rail3:#0b57d0; --rail4:#0b57d0;
  --avatar:#0b57d0; --avatar-text:#fff; --avatar-ring:#d3e3fd; --banner:#eef4fd; --banner-line:#d3e3fd; --cw-head:#f2f6fc; --cw-head-text:#041e49;
  --star:#f4b400; --star-off:#a5a9ad; --crit-text:#c5221f; --crit-bg:#fce8e6; --toast-action:#a8c7fa;
  --badge-promotions:#188038; --badge-social:#1967d2; --badge-updates:#b45309; --badge-text:#fff;
  --font:Inter,system-ui,-apple-system,'Segoe UI',sans-serif; --display:'Inter Tight',Inter,system-ui,sans-serif; --mono:'IBM Plex Mono',ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;
  /* graphite wordmark for light grounds (darkest stop #060607 = 19:1 on the canvas; lightest #5F6670 = 5.6:1) */
  --wm-solid:#060607; --wm-grad:linear-gradient(100deg,#2A2A2E 0%,#060607 38%,#060607 50%,#3A3D44 72%,#5F6670 100%); --slogan:#5C636D;
  --row-h:40px;
}
/* Halo Light: Gmail's light layout in Halo's metal. Ink text, graphite accents, champagne only where
   light would be (Compose, selection, the mark). All text pairs clear WCAG AA. */
html[data-theme=halo-light]{
  --bg:#F3F4F6; --search:#E7E9ED; --search-focus:#fff; --compose:#E8DEC4; --compose-text:#060607; --compose-line:#D6C9A6;
  --nav-active:#E2E4E9; --nav-active-text:#060607; --accent:#22252B; --accent-soft:#E6E8EC; --on-accent:#fff;
  --surface:#fff; --surface-2:#F0F1F4; --read:#F6F7F9; --unread-bg:#fff;
  --text:#16181C; --muted:#4A505A; --snip:#5C636D; --line:#E3E5E9; --row-line:#ECEEF1; --sel:#F2EBD9;
  --border:#D5D8DE; --border-strong:#6B727D; --hover:rgba(22,24,28,.06);
  --rail1:#22252B; --rail2:#9C7A31; --rail3:#22252B; --rail4:#9C7A31;
  --avatar:#0E0E11; --avatar-text:#E8DEC4; --avatar-ring:#E8DEC4; --banner:#FAF7EF; --banner-line:#E8DEC4; --cw-head:#ECEEF1; --cw-head-text:#060607;
  --star:#A8822F; --star-off:#9AA0A9; --crit-text:#A3483B; --crit-bg:#F8E9E6; --toast-action:#E8DEC4;
  --badge-promotions:#3E6B4C; --badge-social:#3F4A5A; --badge-updates:#7A5C1E; --badge-text:#fff;
}
/* Halo Dark: Halo's native ink and panel, champagne as the one warm light. */
html[data-theme=halo-dark]{
  color-scheme:dark;
  --bg:#060607; --search:#16161B; --search-focus:#1D1D23; --compose:#E8DEC4; --compose-text:#060607; --compose-line:transparent;
  --nav-active:rgba(232,222,196,.13); --nav-active-text:#E8DEC4; --accent:#E8DEC4; --accent-soft:rgba(232,222,196,.10); --on-accent:#060607;
  --surface:#0E0E11; --surface-2:#18181D; --read:#0E0E11; --unread-bg:#15151A;
  --text:#F2F4F7; --muted:#9AA3B0; --snip:#8A929E; --line:rgba(255,255,255,.075); --row-line:rgba(255,255,255,.06); --sel:rgba(232,222,196,.11);
  --border:rgba(255,255,255,.14); --border-strong:#8A929E; --hover:rgba(255,255,255,.06);
  --rail1:#C9CFD8; --rail2:#E8DEC4; --rail3:#C9CFD8; --rail4:#E8DEC4;
  --avatar:#E8DEC4; --avatar-text:#060607; --avatar-ring:rgba(232,222,196,.28); --banner:#131317; --banner-line:rgba(232,222,196,.22); --cw-head:#18181D; --cw-head-text:#F2F4F7;
  --star:#E8DEC4; --star-off:#6B727D; --crit-text:#D48174; --crit-bg:rgba(212,129,116,.14); --toast-action:#E8DEC4;
  --badge-promotions:#8FBF9E; --badge-social:#9AA3B0; --badge-updates:#D4B678; --badge-text:#060607;
  /* silver wordmark, as on asihalo.com */
  --wm-solid:#FFFFFF; --wm-grad:linear-gradient(100deg,#DADADA 0%,#FFFFFF 38%,#FFFFFF 50%,#CFCFCF 72%,#9A9A9A 100%); --slogan:#8A929E;
}
html.compact{--row-h:32px}
*{box-sizing:border-box;margin:0;padding:0}
[hidden]{display:none!important}
html,body{height:100%}
body{font-family:var(--font);background:var(--bg);color:var(--text);overflow:hidden;font-size:14px;-webkit-text-size-adjust:100%}
button{font:inherit;color:inherit;background:none;border:0;cursor:pointer}
input,textarea,select{font:inherit;color:inherit}
a{color:var(--accent)}
.ms{font-family:'Material Symbols Outlined';font-weight:400;font-size:20px;line-height:1;letter-spacing:normal;text-transform:none;white-space:nowrap;direction:ltr;-webkit-font-smoothing:antialiased;font-variation-settings:'FILL' 0,'wght' 400,'GRAD' 0,'opsz' 24;color:var(--muted);user-select:none;display:inline-block;font-style:normal}
.ms.fill{font-variation-settings:'FILL' 1,'wght' 400,'GRAD' 0,'opsz' 24}
.ib{width:40px;height:40px;border-radius:50%;display:inline-flex;align-items:center;justify-content:center;flex:none;position:relative}
.ib:hover{background:var(--hover)}
.ib:disabled{opacity:.38;cursor:default}
.ib:disabled:hover{background:none}
.ib .ms{font-size:22px}
.ib.sm{width:32px;height:32px}
.ib.sm .ms{font-size:20px}
.boot{position:fixed;inset:0;display:flex;align-items:center;justify-content:center;background:var(--bg);z-index:100}
.boot .lk-name{font-size:40px;animation:pulse 1.2s ease-in-out infinite}
@keyframes pulse{50%{opacity:.4}}

/* ---------- login ---------- */
.login{position:fixed;inset:0;display:flex;flex-direction:column;align-items:center;justify-content:center;background:var(--bg);overflow:auto;padding:24px}
.card{background:var(--surface);border-radius:28px;padding:40px 40px 32px;width:100%;max-width:448px;box-shadow:0 1px 3px rgba(0,0,0,.06)}
.lbrand{display:flex;align-items:center}
.lbrand .lk-name{font-size:34px}
.lbrand .lk-by{font-size:11px;margin-top:6px}
.card h1{font-size:32px;font-weight:400;margin:24px 0 8px;color:var(--text);letter-spacing:-.3px}
.card .sub{font-size:16px;color:var(--text);margin-bottom:28px}
.field{display:block;position:relative;margin-bottom:18px}
.field input{width:100%;height:56px;border:1px solid var(--border-strong);border-radius:4px;padding:16px 15px 0;font-size:16px;outline:none;background:var(--surface)}
.field input:focus{border:2px solid var(--accent);padding-left:14px}
.field span{position:absolute;left:12px;top:18px;padding:0 4px;color:var(--muted);font-size:16px;background:var(--surface);transition:all .15s;pointer-events:none}
.field input:focus+span,.field input:not(:placeholder-shown)+span{top:-8px;font-size:12px;color:var(--accent)}
.field input:not(:focus):not(:placeholder-shown)+span{color:var(--muted)}
.showpw{display:flex;align-items:center;gap:10px;font-size:14px;color:var(--text);margin:-4px 0 14px}
.showpw input{width:18px;height:18px;accent-color:var(--accent)}
.err{display:flex;align-items:center;gap:8px;color:var(--crit-text);font-size:13px;margin:-6px 0 12px}
.err .ms{color:var(--crit-text);font-size:18px}
.note{font-size:13px;color:var(--muted);line-height:19px;margin:8px 0 28px}
.actions{display:flex;justify-content:flex-end}
.btn{height:40px;border-radius:20px;padding:0 24px;font-weight:500;font-size:14px;letter-spacing:.25px;display:inline-flex;align-items:center;gap:8px}
.btn.primary{background:var(--accent);color:var(--on-accent)}
.btn.primary:hover{box-shadow:0 1px 3px rgba(0,0,0,.25)}
.btn.primary:disabled{opacity:.6}
.btn.text{color:var(--accent)}
.btn.text:hover{background:var(--hover)}
.btn.outline{border:1px solid var(--border-strong);color:var(--accent)}
.lfoot{display:flex;gap:28px;font-size:12px;color:var(--muted);margin-top:18px;width:100%;max-width:448px;padding:0 8px}

/* ---------- header ---------- */
#shell{height:100%;display:flex;flex-direction:column}
header.top{height:64px;display:flex;align-items:center;padding:8px;flex:none}
.brand{display:flex;align-items:center;width:240px;flex:none}
.brand .ib{margin:0 4px}
.logo{display:flex;align-items:center;text-decoration:none;margin-left:8px;height:48px}
/* Halo lockup (after asihalo.com): heavy Inter Tight wordmark with a metal gradient clipped to the
   letters and a one-off light sweep; slogan in IBM Plex Mono directly below. */
.lockup{display:inline-flex;flex-direction:column;align-items:flex-start;justify-content:center;gap:4px;white-space:nowrap;line-height:1}
.lk-name{font-family:var(--display);font-weight:800;font-size:24px;letter-spacing:-.045em;text-transform:uppercase;line-height:.9;
  color:var(--wm-solid);background-image:var(--wm-grad);-webkit-background-clip:text;background-clip:text;-webkit-text-fill-color:transparent;
  background-size:200% 100%;background-position:100% 0;animation:lockup-light 1.6s cubic-bezier(.22,1,.36,1) .2s 1 both;padding-right:.05em}
@keyframes lockup-light{from{background-position:100% 0}to{background-position:0% 0}}
.lk-by{font-family:var(--mono);font-weight:400;font-size:8.5px;letter-spacing:.08em;text-transform:uppercase;color:var(--slogan)}
@media (prefers-reduced-motion:reduce){.lk-name{animation:none;background-position:0% 0}}
@media (forced-colors:active){.lk-name{background:none;-webkit-text-fill-color:CanvasText;color:CanvasText;animation:none}}
.dbrand{display:none}
.search{flex:1;min-width:0;max-width:720px;height:48px;background:var(--search);border-radius:24px;display:flex;align-items:center;padding:0 4px;margin-left:16px;position:relative}
.search.focus{background:var(--search-focus);box-shadow:0 1px 1px 0 rgba(65,69,73,.3),0 1px 3px 1px rgba(65,69,73,.15)}
.search input{flex:1;width:0;border:0;background:none;outline:none;font-size:16px;padding-left:4px;min-width:0;color:var(--text)}
.search input::placeholder{color:var(--snip)}
.adv{position:absolute;top:52px;left:0;right:0;background:var(--surface);border-radius:8px;box-shadow:0 4px 8px 3px rgba(60,64,67,.15),0 1px 3px rgba(60,64,67,.3);padding:20px 24px;z-index:30}
.adv .r{display:flex;align-items:center;margin-bottom:10px;font-size:14px}
.adv .r label{width:120px;color:var(--muted)}
.adv .r input,.adv .r select{flex:1;border:0;border-bottom:1px solid var(--border);height:30px;outline:none}
.adv .r input:focus{border-bottom:2px solid var(--accent)}
.adv .f{display:flex;justify-content:flex-end;gap:8px;margin-top:8px}
.hright{margin-left:auto;display:flex;align-items:center;gap:2px;padding-right:4px}
.org{display:flex;align-items:center;gap:8px;border:1px solid var(--line);border-radius:8px;padding:4px 10px 4px 8px;margin:0 10px 0 6px;background:var(--surface);height:40px}
.org small{font-size:12px;color:var(--muted)}
.avatar{width:32px;height:32px;border-radius:50%;background:var(--avatar);color:var(--avatar-text);display:flex;align-items:center;justify-content:center;font-weight:500;font-size:15px;box-shadow:0 0 0 3px var(--avatar-ring);flex:none;margin:0 6px}

/* ---------- layout ---------- */
.wrap{display:flex;flex:1;min-height:0}
nav{width:256px;flex:none;padding-right:16px;overflow-y:auto;overflow-x:hidden;padding-bottom:16px}
.compose{display:inline-flex;align-items:center;gap:12px;height:56px;padding:0 22px 0 16px;margin:8px 0 16px 8px;border-radius:16px;background:var(--compose);border:1px solid var(--compose-line);color:var(--compose-text);font-weight:500;font-size:14px;letter-spacing:.25px;box-shadow:0 1px 2px rgba(0,0,0,.08);transition:box-shadow .15s}
.compose:hover{box-shadow:0 1px 3px 0 rgba(60,64,67,.3),0 4px 8px 3px rgba(60,64,67,.15)}
.compose .ms{color:var(--compose-text);font-size:24px}
.ni{height:32px;display:flex;align-items:center;padding:0 12px 0 26px;border-radius:0 16px 16px 0;font-size:14px;color:var(--text);letter-spacing:.2px;text-decoration:none;cursor:pointer;user-select:none;white-space:nowrap}
.ni:hover{background:var(--hover)}
.ni .ms{margin-right:18px;flex:none}
.ni .nm{overflow:hidden;text-overflow:ellipsis}
.ni b{margin-left:auto;font-size:12px;font-weight:700;padding-left:8px}
.ni b.light{font-weight:400}
.ni.on{background:var(--nav-active);color:var(--nav-active-text);font-weight:700}
.ni.on .ms{color:var(--nav-active-text)}
.ni.drop{background:var(--accent-soft)}
.lab{display:flex;align-items:center;justify-content:space-between;padding:14px 4px 4px 26px;font-size:16px;font-weight:500;color:var(--text)}
.dot{width:12px;height:12px;border-radius:3px;margin:0 22px 0 4px;flex:none}
.scrim{display:none}

main{flex:1;background:var(--surface);border-radius:16px;margin-bottom:16px;display:flex;overflow:hidden;min-width:0}
.pane{display:flex;flex-direction:column;min-width:0;flex:1}
main.split #listPane{flex:0 0 46%;border-right:1px solid var(--line)}
main.split #threadPane{display:flex}
main.split .from{width:150px}
main.split .tabs .tab{width:auto;flex:1 0 auto;padding:0 12px;gap:10px}
main.split .tab .badge{margin-left:0}
.tool{height:48px;display:flex;align-items:center;padding:0 8px 0 10px;flex:none;gap:0}
.tool .count{margin-left:auto;font-size:12px;color:var(--muted);margin-right:6px;white-space:nowrap}
.tool .vsep{width:1px;height:20px;background:var(--line);margin:0 6px}
.cb{width:18px;height:18px;border:2px solid var(--border-strong);border-radius:2px;display:inline-flex;align-items:center;justify-content:center;flex:none}
.cb.on{background:var(--accent);border-color:var(--accent)}
.cb.on:after{content:"";width:5px;height:10px;border:solid var(--on-accent);border-width:0 2px 2px 0;transform:rotate(45deg) translate(-1px,-1px)}
.cb.some{background:var(--accent);border-color:var(--accent)}
.cb.some:after{content:"";width:10px;height:2px;background:var(--on-accent)}
.banner{margin:0 16px 4px;padding:6px 6px 6px 14px;border-radius:12px;background:var(--banner);border:1px solid var(--banner-line);display:flex;align-items:center;gap:12px;font-size:13.5px;color:var(--text);flex:none}
.banner .ms{color:var(--accent)}
.banner a{color:var(--accent);font-weight:500;text-decoration:none;margin-left:6px}
.banner .x{margin-left:auto}
.tabs{display:flex;border-bottom:1px solid var(--line);flex:none;overflow-x:auto;scrollbar-width:none}
.tab{text-decoration:none;width:254px;height:56px;display:flex;align-items:center;padding:0 16px;gap:18px;font-size:14px;font-weight:500;color:var(--muted);position:relative;flex:none;white-space:nowrap}
.tab:hover{background:var(--hover)}
.tab .badge{font-size:11px;font-weight:500;color:var(--badge-text);border-radius:8px;padding:1px 7px;margin-left:-8px}
.tab.on{color:var(--accent)}
.tab.on .ms{color:var(--accent)}
.tab.on:after{content:"";position:absolute;left:8px;right:8px;bottom:0;height:3px;border-radius:3px 3px 0 0;background:var(--accent)}
.list{flex:1;overflow-y:auto;overflow-x:hidden;outline:none}
.empty{padding:28px 24px;color:var(--muted);text-align:center;font-size:14px}
.empty .ms{font-size:48px;display:block;margin:12px auto;color:var(--border)}
.loading{height:3px;position:relative;overflow:hidden;flex:none}
.loading:after{content:"";position:absolute;left:-30%;width:30%;height:100%;background:var(--accent);animation:load 1s linear infinite}
@keyframes load{to{left:100%}}

/* rows */
.row{display:flex;align-items:center;min-height:var(--row-h);padding:0 16px 0 10px;border-bottom:1px solid var(--row-line);background:var(--read);font-size:14px;color:var(--text);position:relative;cursor:pointer;user-select:none}
.row.u{background:var(--unread-bg)}
.row.u .from,.row.u .subj,.row.u .date{font-weight:700;color:var(--text)}
.row .from b{font-weight:700}
.row .cbx{width:40px;height:var(--row-h);display:flex;align-items:center;justify-content:center;flex:none}
.row .st{width:32px;height:var(--row-h);display:flex;align-items:center;justify-content:center;flex:none}
.row .st .ms{font-size:20px;color:var(--star-off)}
.row .st .ms.y,.ms.y{color:var(--star)}
.row .imp{width:24px;display:flex;justify-content:center;flex:none}
.row .imp .ms{font-size:18px;color:var(--border)}
.row .imp .ms.on{color:var(--star)}
.from{width:196px;flex:none;padding-left:8px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.from em{font-style:normal;font-weight:400;color:var(--muted);font-size:12px;margin-left:2px}
.from .dr{color:var(--crit-text);font-weight:400}
.mid{flex:1;min-width:0;padding-right:16px;align-self:center}
.mid .line{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.snip{color:var(--snip);font-weight:400}
.date{width:80px;text-align:right;font-size:12px;color:var(--muted);flex:none;white-space:nowrap}
.date.sched{color:var(--crit-text);width:auto}
.lbl{background:color-mix(in srgb,var(--lc,#888) 18%,transparent);color:color-mix(in srgb,var(--lc,#888) 62%,var(--text));display:inline-block;font-size:12px;padding:0 6px;border-radius:4px;margin-right:6px;line-height:18px;font-weight:400;vertical-align:1px;max-width:160px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.row.tall{align-items:flex-start;padding-top:0}
.row.tall .mid{padding-top:11px;padding-bottom:8px}
.row.tall .date{padding-top:12px}
.row.tall .from{padding-top:11px;align-self:flex-start}
.row.tall .imp{padding-top:10px;align-self:flex-start}
.chips{display:flex;gap:8px;margin-top:6px;flex-wrap:nowrap;overflow:hidden}
.chip{display:inline-flex;align-items:center;gap:6px;border:1px solid var(--border);border-radius:16px;height:26px;padding:0 12px 0 8px;font-size:13px;color:var(--muted);font-weight:400;background:var(--surface);max-width:200px;white-space:nowrap}
.chip span:last-child{overflow:hidden;text-overflow:ellipsis}
.chip .ms{font-size:18px}
.row:hover{box-shadow:inset 1px 0 0 var(--border),inset -1px 0 0 var(--border),0 1px 2px 0 rgba(60,64,67,.3),0 1px 3px 1px rgba(60,64,67,.15);z-index:2}
.row.sel{background:var(--sel)}
.row.cur:before{content:"";position:absolute;left:0;top:0;bottom:0;width:3px;background:var(--accent)}
.row.open{background:var(--accent-soft)}
.acts{display:none;margin-left:auto;flex:none;align-self:center}
.acts .ib{width:34px;height:34px}
.acts .ms{font-size:20px}
.row:hover .acts{display:flex}
.row:hover .date{display:none}
.row .mob{display:none}
.mh .meta .dshort{display:none}
@media (max-width:760px){#thread .mh .meta .dshort{display:inline;margin-right:2px}}

/* thread */
.thread{flex:1;overflow-y:auto;padding:0 0 40px}
.thead{display:flex;align-items:flex-start;padding:18px 16px 8px 72px;gap:8px}
.thead h2{font-size:22px;font-weight:400;color:var(--text);line-height:28px;word-break:break-word}
.thead .lbl{font-size:12px;vertical-align:4px;margin-left:8px}
.thead .lbl.x{cursor:pointer}
.thead .r{margin-left:auto;display:flex}
.msg{padding:0 16px 0 16px;border-bottom:1px solid var(--row-line)}
.msg:last-child{border-bottom:0}
.mh{display:flex;align-items:flex-start;padding:20px 0 0;gap:16px;cursor:pointer}
.av{width:40px;height:40px;border-radius:50%;color:#fff;display:flex;align-items:center;justify-content:center;font-size:18px;font-weight:500;flex:none;text-transform:uppercase}
.mh .who{flex:1;min-width:0}
.mh .who .n{font-weight:700;font-size:14px;color:var(--text)}
.mh .who .a{font-size:12px;color:var(--muted);font-weight:400;margin-left:4px}
.mh .who .t{font-size:12px;color:var(--muted);margin-top:2px;display:flex;align-items:center;gap:2px}
.mh .who .t .ms{font-size:18px}
.mh .meta{display:flex;align-items:center;font-size:12px;color:var(--muted);white-space:nowrap;gap:0}
.mh .meta .ib{width:36px;height:36px}
.mh .meta .ms{font-size:20px}
.msg.collapsed .mh{padding:12px 0}
.msg.collapsed .snip{display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-size:14px;margin-top:2px}
.msg.collapsed .body,.msg.collapsed .atts,.msg.collapsed .mfoot,.msg.collapsed .details,.msg.collapsed .imgbar,.msg.collapsed .cal{display:none}
.msg:not(.collapsed) .snip{display:none}
.more-msgs{display:flex;align-items:center;gap:0;padding:0 16px;position:relative;height:28px;border-bottom:1px solid var(--row-line)}
.more-msgs button{width:40px;height:40px;border-radius:50%;background:var(--surface);border:1px solid var(--border);color:var(--muted);font-size:13px;font-weight:500;position:absolute;left:16px;top:-6px;z-index:2}
.more-msgs:before,.more-msgs:after{content:"";position:absolute;left:0;right:0;height:1px;border-top:1px solid var(--row-line)}
.more-msgs:before{top:4px}.more-msgs:after{top:8px}
.details{margin:8px 0 0 56px;font-size:12px;color:var(--muted);background:var(--surface);border:1px solid var(--line);border-radius:8px;padding:10px 14px;display:grid;grid-template-columns:auto 1fr;gap:4px 12px;max-width:560px}
.details b{font-weight:400;text-align:right}
.body{margin:4px 0 0 56px;padding-bottom:16px}
.body iframe{width:100%;border:0;display:block;min-height:40px}
.trim{width:28px;height:14px;border-radius:7px;background:var(--surface-2);display:flex;align-items:center;justify-content:center;margin:4px 0 8px;font-size:0}
.trim:after{content:"•••";font-size:10px;color:var(--snip);letter-spacing:1px}
.trim:hover{background:var(--border)}
.imgbar{margin:12px 0 0 56px;padding:10px 14px;background:var(--surface-2);border-radius:8px;font-size:13px;color:var(--muted);display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.imgbar a{font-weight:500;cursor:pointer;text-decoration:none}
.cal{margin:12px 0 0 56px;border:1px solid var(--line);border-radius:12px;padding:14px 16px;display:flex;gap:14px;max-width:560px}
.cal .ms{font-size:28px;color:var(--accent)}
.cal b{display:block;font-size:15px;font-weight:500;margin-bottom:4px}
.cal div div{font-size:13px;color:var(--muted);line-height:20px}
.atts{margin:0 0 16px 56px;border-top:1px solid var(--row-line);padding-top:14px}
.atts h4{font-size:14px;font-weight:500;margin-bottom:12px;color:var(--text)}
.atts .grid{display:flex;flex-wrap:wrap;gap:12px}
.att{width:180px;height:120px;border:1px solid var(--border);border-radius:8px;overflow:hidden;position:relative;background:var(--surface-2);cursor:pointer;display:flex;flex-direction:column}
.att .pv{flex:1;display:flex;align-items:center;justify-content:center;overflow:hidden;background:var(--surface-2)}
.att .pv img{width:100%;height:100%;object-fit:cover}
.att .pv .ms{font-size:44px}
.att .nm{height:40px;display:flex;align-items:center;gap:8px;padding:0 10px;font-size:13px;background:var(--surface);border-top:1px solid var(--line)}
.att .nm span:last-child{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.att .nm .ms{font-size:18px}
.att .ov{position:absolute;inset:0;background:rgba(0,0,0,.55);display:none;flex-direction:column;justify-content:space-between;padding:10px;color:#fff}
.att:hover .ov{display:flex}
.att .ov .n{font-size:13px;word-break:break-all}
.att .ov .s{font-size:12px;opacity:.8}
.att .ov .b{display:flex;gap:6px;justify-content:center}
.att .ov .ib{background:rgba(255,255,255,.2);width:36px;height:36px}
.att .ov .ms{color:#fff}
.mfoot{display:flex;gap:12px;margin:8px 0 24px 56px;flex-wrap:wrap}
.mfoot .btn{border:1px solid var(--border-strong);color:var(--text);height:36px;padding:0 20px 0 16px}
.mfoot .btn .ms{font-size:20px;color:var(--text)}
.mfoot .btn:hover{background:var(--hover)}

/* rail */
.rail{width:56px;flex:none;display:flex;flex-direction:column;align-items:center;padding-top:4px;gap:10px}
.app{width:40px;height:40px;border-radius:50%;display:flex;align-items:center;justify-content:center}
.app:hover{background:var(--hover)}
.app .ms{font-size:22px}
.r1{color:var(--rail1)!important}.r2{color:var(--rail2)!important}.r3{color:var(--rail3)!important}.r4{color:var(--rail4)!important}
.sep{width:20px;height:1px;background:var(--border);margin:6px 0}
.fab{display:none}

/* compose */
.dock{position:fixed;right:72px;bottom:0;display:flex;flex-direction:row-reverse;align-items:flex-end;gap:16px;z-index:40;pointer-events:none}
.cw{width:560px;height:560px;max-height:calc(100vh - 80px);background:var(--surface);border-radius:12px 12px 0 0;box-shadow:0 8px 10px 1px rgba(0,0,0,.14),0 3px 14px 2px rgba(0,0,0,.12),0 5px 5px -3px rgba(0,0,0,.2);display:flex;flex-direction:column;pointer-events:auto;position:relative}
.cw.min{height:40px;width:280px}
.cw.min > :not(.hd){display:none!important}
.cw.max{position:fixed;inset:5vh 10vw;width:auto;height:auto;max-height:none;border-radius:12px;z-index:60}
.cwback{position:fixed;inset:0;background:rgba(0,0,0,.5);z-index:55;pointer-events:auto}
.cw .hd{height:40px;background:var(--cw-head);border-radius:12px 12px 0 0;display:flex;align-items:center;padding:0 8px 0 16px;font-size:14px;font-weight:500;color:var(--cw-head-text);flex:none;cursor:pointer}
.cw .hd .ttl{flex:1;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}
.cw .hd .r{margin-left:auto;display:flex}
.cw .hd .ib{width:28px;height:28px}
.cw .hd .ms{font-size:18px;color:var(--cw-head-text)}
.fld{margin:0 16px;min-height:40px;border-bottom:1px solid var(--surface-2);display:flex;align-items:center;font-size:14px;color:var(--muted);gap:6px;flex-wrap:wrap;padding:4px 0;position:relative;flex:none}
.fld > .lb{width:28px;flex:none}
.fld input{border:0;outline:none;flex:1;min-width:80px;height:30px;font-size:14px;color:var(--text);background:none}
.fld .pill{display:inline-flex;align-items:center;gap:6px;background:var(--surface-2);border-radius:14px;height:26px;padding:0 4px 0 3px;color:var(--text);font-size:13px;max-width:100%}
.fld .pill.bad{background:var(--crit-bg);color:var(--crit-text)}
.fld .pill i{width:20px;height:20px;border-radius:50%;background:var(--muted);color:#fff;font-style:normal;display:flex;align-items:center;justify-content:center;font-size:11px;font-weight:500;flex:none;text-transform:uppercase}
.fld .pill .x{width:20px;height:20px;border-radius:50%;display:flex;align-items:center;justify-content:center}
.fld .pill .x .ms{font-size:16px}
.fld .pill .x:hover{background:rgba(0,0,0,.08)}
.fld .ccb{margin-left:auto;color:var(--muted);display:flex;gap:8px}
.fld .ccb button:hover{text-decoration:underline}
.ac{position:absolute;left:30px;top:100%;background:var(--surface);border-radius:8px;box-shadow:0 4px 8px 3px rgba(60,64,67,.15),0 1px 3px rgba(60,64,67,.3);z-index:5;min-width:320px;padding:6px 0}
.ac div{padding:8px 16px;display:flex;gap:12px;align-items:center;cursor:pointer}
.ac div.on,.ac div:hover{background:var(--surface-2)}
.ac .av{width:32px;height:32px;font-size:14px}
.ac small{display:block;color:var(--muted);font-size:12px}
.cw .subj{border:0;outline:none;font-size:14px;width:100%;height:30px}
.cw .ed{flex:1;overflow-y:auto;padding:12px 16px;font-size:14px;line-height:1.5;color:var(--text);outline:none;min-height:80px;word-wrap:break-word}
.cw .ed blockquote{margin:0 0 0 .8ex;border-left:1px solid #ccc;padding-left:1ex}
.cw .ed .sig{color:var(--snip)}
.cw .catts{padding:0 16px;display:flex;flex-direction:column;gap:4px;flex:none;max-height:120px;overflow-y:auto}
.catt{display:flex;align-items:center;background:var(--surface-2);height:32px;padding:0 4px 0 10px;font-size:13px;border-radius:4px;gap:6px}
.catt b{color:var(--accent);font-weight:500;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:320px}
.catt small{color:var(--muted)}
.catt .ib{margin-left:auto;width:28px;height:28px}
.fmt{display:flex;align-items:center;gap:2px;margin:0 12px;padding:2px 6px;border-radius:20px;box-shadow:0 1px 2px rgba(0,0,0,.15),0 1px 3px 1px rgba(0,0,0,.08);flex:none;flex-wrap:wrap}
.fmt .ib{width:30px;height:30px;border-radius:4px}
.fmt .ib .ms{font-size:20px}
.fmt .ib.on{background:var(--surface-2)}
.cf{height:60px;display:flex;align-items:center;padding:0 12px 0 16px;gap:2px;flex:none}
.send{display:flex;height:36px;border-radius:18px;overflow:hidden;margin-right:8px;flex:none}
.send button{background:var(--accent);color:var(--on-accent);font-weight:500;font-size:14px;letter-spacing:.25px}
.send .s{padding:0 18px 0 22px}
.send .d{border-left:1px solid color-mix(in srgb,var(--on-accent) 35%,transparent);width:30px;display:flex;align-items:center;justify-content:center}
.send .d .ms{color:var(--on-accent)}
.send button:hover{filter:brightness(1.1)}
.cf .ib{width:32px;height:32px}
.cf .del{margin-left:auto}
.cf .saved{font-size:12px;color:var(--muted);margin-left:8px;white-space:nowrap}

/* menus, dialogs, toasts */
.menu{position:fixed;background:var(--surface);border-radius:4px;box-shadow:0 2px 2px 0 rgba(0,0,0,.14),0 3px 1px -2px rgba(0,0,0,.12),0 1px 5px 0 rgba(0,0,0,.2);padding:6px 0;z-index:80;min-width:200px;max-height:70vh;overflow-y:auto}
.menu .mi{display:flex;align-items:center;gap:14px;padding:0 20px 0 16px;height:32px;font-size:14px;cursor:pointer;white-space:nowrap;width:100%;text-align:left}
.menu .mi:hover,.menu .mi.on{background:var(--surface-2)}
.menu .mi .ms{font-size:20px}
.menu .mi small{margin-left:auto;color:var(--muted);padding-left:24px}
.menu .mh{padding:8px 16px 6px;font-size:13px;color:var(--muted);font-weight:500}
.menu hr{border:0;border-top:1px solid var(--line);margin:6px 0}
.menu input[type=datetime-local]{margin:6px 16px;padding:6px;border:1px solid var(--border);border-radius:4px}
.dlgback{position:fixed;inset:0;background:rgba(0,0,0,.4);z-index:90;display:flex;align-items:center;justify-content:center;padding:16px}
.dlg{background:var(--surface);border-radius:16px;box-shadow:0 24px 38px 3px rgba(0,0,0,.14),0 9px 46px 8px rgba(0,0,0,.12);max-width:100%;max-height:100%;display:flex;flex-direction:column;min-width:320px}
.dlg .dh{display:flex;align-items:center;padding:18px 16px 10px 24px;font-size:22px;color:var(--text)}
.dlg .dh .ib{margin-left:auto}
.dlg .db{padding:4px 24px 16px;overflow-y:auto;font-size:14px;line-height:20px;color:var(--muted)}
.dlg .df{display:flex;justify-content:flex-end;gap:8px;padding:8px 16px 16px}
.dlg label.blk{display:block;margin:10px 0 4px;color:var(--text);font-weight:500}
.dlg input[type=text],.dlg input[type=date],.dlg textarea{width:100%;border:1px solid var(--border);border-radius:4px;padding:8px 10px;outline:none;color:var(--text)}
.dlg input:focus,.dlg textarea:focus{border-color:var(--accent)}
.keys{display:grid;grid-template-columns:repeat(3,1fr);gap:4px 32px;color:var(--text)}
.keys h4{grid-column:1/-1;font-size:14px;font-weight:500;color:var(--accent);margin-top:12px}
.keys div{display:flex;justify-content:space-between;gap:12px;font-size:13px;padding:3px 0;border-bottom:1px solid var(--surface-2)}
kbd{font-size:12px;background:var(--surface-2);border-radius:4px;padding:1px 6px;color:var(--text);white-space:nowrap}
.preview{position:fixed;inset:0;background:rgba(0,0,0,.85);z-index:95;display:flex;flex-direction:column}
.preview .ph{height:56px;display:flex;align-items:center;padding:0 12px;color:#fff;gap:12px;flex:none}
.preview .ph .ms{color:#fff}
.preview .ph .t{flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.preview .pb{flex:1;display:flex;align-items:center;justify-content:center;padding:0 24px 24px;min-height:0}
.preview .pb img{max-width:100%;max-height:100%;object-fit:contain;background:#fff}
.preview .pb iframe{width:min(1000px,100%);height:100%;border:0;background:#fff}
.toasts{position:fixed;left:24px;bottom:24px;z-index:100;display:flex;flex-direction:column;gap:8px}
.toast{background:#303030;color:#f2f2f2;border-radius:4px;min-height:48px;padding:6px 8px 6px 24px;display:flex;align-items:center;gap:16px;font-size:14px;box-shadow:0 3px 5px -1px rgba(0,0,0,.2),0 6px 10px 0 rgba(0,0,0,.14);max-width:min(560px,calc(100vw - 48px))}
.toast button{color:var(--toast-action);font-weight:500;padding:8px;border-radius:4px}
.toast button:hover{background:rgba(255,255,255,.08)}
.toast .ms{color:#f2f2f2}
.settings{position:fixed;top:64px;right:0;bottom:0;width:360px;background:var(--surface);box-shadow:-2px 0 6px rgba(0,0,0,.08);z-index:70;display:flex;flex-direction:column;border-radius:16px 0 0 0}
.settings .sh{display:flex;align-items:center;padding:12px 8px 8px 24px;font-size:16px;font-weight:500}
.settings .sh .ib{margin-left:auto}
.settings .sb{flex:1;overflow-y:auto;padding:0 24px 24px}
.settings h3{font-size:12px;font-weight:500;letter-spacing:.8px;text-transform:uppercase;color:var(--muted);margin:20px 0 10px}
.opt{display:flex;align-items:center;gap:12px;padding:8px 0;cursor:pointer;font-size:14px}
.opt input{width:18px;height:18px;accent-color:var(--accent)}
.swatches{display:flex;gap:12px}
.sw{width:86px;border-radius:12px;border:2px solid transparent;padding:6px;text-align:center;font-size:13px;cursor:pointer}
.sw.on{border-color:var(--accent)}
.sw i{display:block;height:44px;border-radius:8px;margin-bottom:6px}
.settings textarea,.settings .siged{width:100%;min-height:90px;border:1px solid var(--border);border-radius:8px;padding:8px 10px;outline:none;font-size:14px;line-height:1.4;overflow:auto}
.settings input[type=text],.settings input[type=date]{width:100%;border:1px solid var(--border);border-radius:8px;padding:8px 10px;outline:none}
.settings .row2{display:flex;gap:8px}
.settings small.hint{display:block;color:var(--muted);font-size:12px;margin-top:4px;line-height:16px}
.settings .btn{margin-top:10px}

/* ---------- responsive ---------- */
@media (max-width:1100px){
  /* tabs never shrink below their content; the strip scrolls sideways instead */
  .tab{width:auto;flex:1 0 auto;padding:0 14px;gap:10px}
  .tab .badge{margin-left:0}
  .from{width:160px}
  .rail{display:none}
  .dock{right:16px}
  .org{display:none}
}
@media (max-width:900px){
  .logo .lk-by{display:none}
  .brand{width:auto}
  .hright #appsBtn{display:none}
}
@media (max-width:760px){
  header.top{height:56px;padding:4px}
  .brand{width:auto}
  .logo{display:none}
  .search{margin-left:4px;height:44px}
  .hright .hide-m{display:none}
  .hright #helpBtn{display:none}
  .wrap{position:relative}
  nav{position:fixed;left:0;top:0;bottom:0;width:280px;background:var(--bg);z-index:75;transform:translateX(-100%);transition:transform .2s;padding-top:8px;box-shadow:0 0 16px rgba(0,0,0,.2)}
  body.drawer nav{transform:none}
  body.drawer .scrim{display:block;position:fixed;inset:0;background:rgba(0,0,0,.4);z-index:74}
  nav .compose{display:none}
  .dbrand{display:flex;padding:14px 16px 16px 26px;border-bottom:1px solid var(--line);margin-bottom:8px}
  .dbrand .lk-name{font-size:28px}
  .dbrand .lk-by{font-size:9.5px;margin-top:3px}
  main{border-radius:0;margin-bottom:0}
  main.split #listPane{flex:1;border:0}
  #listPane.hide-m{display:none!important}
  .tool{padding:0 4px}
  .banner{margin:0 8px 4px;font-size:13px}
  .banner > div a{display:inline-block}
  .tabs .tab{flex:0 0 auto;padding:0 14px;gap:8px;height:48px;font-size:13px}
  /* phone rows, Gmail iOS style: 16px edge, 40px avatar, 14px gap, then a three-line text column
     (sender + time / subject + star / preview) with label and attachment chips inside it */
  .row{align-items:flex-start;padding:12px 16px 12px 16px;min-height:76px}
  .row .cbx{width:40px;height:40px;padding:0;margin-right:14px;align-items:flex-start}
  .row .cbx .cb{display:none}
  .row .cbx .mob{display:flex}
  .row .av{width:40px;height:40px;font-size:17px}
  .row.sel .cbx .av{background:var(--accent)!important;color:var(--on-accent)}
  .row .st,.row .imp,.row .from,.row .mid .line{display:none}
  .row .mid,.row.tall .mid{display:grid;grid-template-columns:minmax(0,1fr) auto;column-gap:10px;row-gap:1px;align-items:baseline;padding:0}
  .row .mid .fn{grid-column:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:15px;line-height:20px;color:var(--text)}
  .row .mid .dt{grid-column:2;font-size:12px;color:var(--muted);text-align:right;white-space:nowrap}
  .row .mid .msub{grid-column:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:14px;line-height:20px;color:var(--text)}
  .row .mid .mstar{grid-column:2;justify-self:end;align-self:start;width:28px;height:24px;display:flex;align-items:center;justify-content:flex-end;margin-right:-4px}
  .row .mid .mstar .ms{font-size:20px;color:var(--star-off)}
  .row .mid .mstar .ms.y{color:var(--star)}
  .row .mid .mprev{grid-column:1 / -1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:14px;line-height:20px;color:var(--snip)}
  .row .mid .chips{grid-column:1 / -1;margin-top:6px}
  .row.u .mid .fn,.row.u .mid .msub{font-weight:700}
  .row.u .mid .dt{font-weight:700;color:var(--text)}
  .row .mid .msub .lbl{vertical-align:1px}
  .row .date{display:none}
  .row:hover .acts{display:none}
  .row:hover{box-shadow:none}
  .chips{flex-wrap:wrap}
  .thead{padding:14px 12px 4px 16px}
  .mh .who .n{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;display:block}
  .mh .who .a,.mh .meta .dlong,.mh .meta .star,.mh .meta > .ms{display:none}
  .mh .meta .dshort{display:inline}
  .mh .who > div:first-child{display:flex;min-width:0}
  #threadTool .hide-m,#threadTool .vsep,#threadTool .count,#threadTool [data-t=newer],#threadTool [data-t=older]{display:none}
  .row .dash{display:none}
  .thead h2{font-size:20px}
  .msg{padding:0 12px}
  .mh{gap:12px}
  .details,.body,.atts,.mfoot,.imgbar,.cal{margin-left:0}
  .mfoot .btn{flex:1;justify-content:center;padding:0 10px}
  .att{width:calc(50% - 6px)}
  .fab{display:flex;position:fixed;right:16px;bottom:20px;height:56px;border-radius:16px;background:var(--compose);box-shadow:0 1px 3px 0 rgba(60,64,67,.3),0 4px 8px 3px rgba(60,64,67,.15);align-items:center;padding:0 20px;gap:12px;z-index:30;color:var(--compose-text);font-weight:500}
  .fab .ms{color:var(--compose-text)}
  .fab:after{content:"Compose"}
  body.thread-open .fab{display:none}
  .dock{right:0;left:0;top:0;flex-direction:column}
  .cw,.cw.max{position:fixed;inset:0;width:100%;height:100%;max-height:none;border-radius:0}
  .cw.min{inset:auto 0 0 0;height:40px;width:100%}
  .cw .hd{border-radius:0;height:48px}
  .cwback{display:none}
  .cf{flex-wrap:nowrap;overflow-x:auto}
  .settings{top:0;width:100%;border-radius:0}
  .keys{grid-template-columns:1fr}
  .toasts{left:8px;right:8px;bottom:84px}
  .adv{position:fixed;left:8px;right:8px;top:56px}
  .acts.mobile{display:flex}
}
.mob{display:none}
.mh .meta .dshort{display:none}
@media (min-width:761px){.row .mid .m{display:none}}
@media (max-width:400px){
  /* very narrow phones: keep the search box usable; Settings stays in the avatar menu */
  #qTune,.hright #settingsBtn{display:none}
}

/* tab badges per theme */
.badge.b-promotions{background:var(--badge-promotions)}.badge.b-social{background:var(--badge-social)}.badge.b-updates{background:var(--badge-updates)}
/* form controls follow the theme */
.dlg input,.dlg textarea,.settings input[type=text],.settings input[type=date],.settings textarea,.settings .siged,.adv input,.adv select,.menu input,.cw .subj{background:var(--surface);color:var(--text)}
/* Halo Dark: mail bodies are authored for white paper, so show them on a white card like other dark webmail */
html[data-theme=halo-dark] .msg .body{background:#fff;border-radius:8px;padding:12px 16px}
html[data-theme=halo-dark] .cw .ed blockquote{border-left-color:#3a3a42}
html[data-theme=halo-dark] .toast{background:#1D1D23;border:1px solid rgba(255,255,255,.08)}
html[data-theme=halo-dark] .att .pv{background:#18181D}
/* Security panel */
.sec{color:var(--text);font-size:14px;line-height:20px}
.sec .it{display:flex;gap:14px;padding:12px 0;border-bottom:1px solid var(--line)}
.sec .it:last-child{border-bottom:0}
.sec .it .ms{font-size:22px;flex:none;margin-top:1px}
.sec .it b{display:block;font-weight:500}
.sec .it small{display:block;color:var(--muted);font-size:13px;margin-top:2px}
.sec .ok{color:var(--badge-promotions)}
html[data-theme=halo-dark] .sec .ok{color:#8FBF9E}
.sec .warn{color:var(--badge-updates)}
html[data-theme=halo-dark] .sec .warn{color:#D4B678}
.sec .soon{color:var(--muted)}
.sec h4{font-size:12px;font-weight:500;letter-spacing:.8px;text-transform:uppercase;color:var(--muted);margin:16px 0 2px}
/* theme picker swatches */
.sw i.s-halo-light{background:linear-gradient(135deg,#F3F4F6 50%,#E8DEC4 50%);border:1px solid #D5D8DE}
.sw i.s-halo-dark{background:linear-gradient(135deg,#0E0E11 50%,#E8DEC4 50%);border:1px solid #2a2a30}
.sw i.s-classic{background:linear-gradient(135deg,#f6f8fc 50%,#c2e7ff 50%);border:1px solid #dde}
.swatches{flex-wrap:wrap}

/* typography: Inter Tight for display, IBM Plex Mono for small meta */
.card h1,.thead h2,.compose,.fab,.dlg .dh,.settings .sh,.lab,.cw .hd{font-family:var(--display)}
.card h1,.thead h2{letter-spacing:-.02em}
.compose,.fab{font-weight:600;letter-spacing:0}
.dlg .dh{font-weight:600;letter-spacing:-.01em}
.tool .count,.settings h3,.sec h4,.lfoot,kbd{font-family:var(--mono)}
.tool .count{font-size:11.5px;letter-spacing:.02em}
.settings h3,.sec h4{letter-spacing:.08em}
