/* ============ Dejoiy Mail — responsive.css : brand voice + every-screen polish ============
   Loaded last. The default theme speaks the :Dejoiy brand (hot pink and ink, Bricolage type);
   the other 23 themes keep their own colours and only pick up the shapes. */

:root{--font:"Bricolage Grotesque","Segoe UI",system-ui,-apple-system,Roboto,"Helvetica Neue",Arial,sans-serif;
  --read-font:"Segoe UI",system-ui,-apple-system,Roboto,"Helvetica Neue",Arial,sans-serif;--pink:#ff4fa3;--ease-out:cubic-bezier(.16,1,.3,1)}
body{font-family:var(--font)}
/* letters are read in a plain text face; the app around them carries the voice */
.r-body,.tm-content,#compose-body{font-family:var(--read-font)}
::selection{background:#ffc2df;color:#121212}

/* Dejoiy colours: one bright "pop" for Compose, avatars and the header, a deeper accent that reads on white.
   The colour is its own setting (html[data-dj]), so it also sits on top of any background scene. */
html[data-dj="pink"]{--pop:#ff4fa3;--accent:#c4166c;--pop-soft:#ffe3f0;--pop-hover:#fff5fa;--pop-dark:#3a1d2c}
html[data-dj="green"]{--pop:#3ddc84;--accent:#12804a;--pop-soft:#dcf8e8;--pop-hover:#f2fcf6;--pop-dark:#14321f}
html[data-dj="yellow"]{--pop:#ffd23f;--accent:#8a6200;--pop-soft:#fff3c4;--pop-hover:#fffbea;--pop-dark:#352c0f}
html[data-dj="blue"]{--pop:#4da3ff;--accent:#1257c7;--pop-soft:#e0edff;--pop-hover:#f3f8ff;--pop-dark:#14273f}
html[data-dj="orange"]{--pop:#ff8a3d;--accent:#b04a06;--pop-soft:#ffe7d6;--pop-hover:#fff6f0;--pop-dark:#3a2415}
html[data-dj="lilac"]{--pop:#b892ff;--accent:#6b3fc9;--pop-soft:#eee5ff;--pop-hover:#f8f4ff;--pop-dark:#272040}
html[data-dj="mint"]{--pop:#2dd4bf;--accent:#0f766e;--pop-soft:#d5f7f2;--pop-hover:#f0fcfa;--pop-dark:#113230}
html[data-dj="red"]{--pop:#ff5a5f;--accent:#c21d2b;--pop-soft:#ffe1e2;--pop-hover:#fff5f5;--pop-dark:#3a1a1c}
html[data-dj]{--accent-ink:#fff}
html[data-dj][data-scenic="false"]{--hdr1:var(--pop);--hdr2:#121212}
html[data-dj][data-brightness="light"][data-scenic="false"] body{--active:var(--pop-soft);--hover:var(--pop-hover)}
html[data-dj][data-brightness="light"][data-scenic="true"] body{--active:color-mix(in srgb,var(--pop) 22%,transparent)}
html[data-dj]:is([data-brightness="dark"],[data-brightness="medium"]){--accent:var(--pop);--accent-ink:#121212}
html[data-dj]:is([data-brightness="dark"],[data-brightness="medium"]) body{--active:color-mix(in srgb,var(--pop) 24%,transparent);--hover:color-mix(in srgb,var(--pop) 10%,transparent)}
html[data-dj] :is(.compose-btn,.fab){background:var(--pop);color:#121212;box-shadow:0 10px 24px -10px color-mix(in srgb,var(--pop) 70%,#000)}
html[data-dj] .avatar{background:var(--pop);color:#121212;font-weight:800}

/* one logo, not two: the :D Mail lockup already carries the mark */
.brand-mark:not([data-logo-applied]){display:none}
.workspace-emblem img{display:block;width:100%;height:100%}

/* shapes everyone gets */
.compose-btn{border-radius:999px!important;font-weight:800;letter-spacing:-.01em;transition:transform .15s var(--ease-out),box-shadow .2s}
.compose-btn:hover{transform:translateY(-1px)}
.compose-btn:active,.fab:active{transform:scale(.96)}
.m-avatar{border-radius:14px!important;font-weight:700}
.mail-heading h1,.mail-title-line h1,.r-subject{letter-spacing:-.025em;font-weight:800}
.message-group{text-transform:none;letter-spacing:0;font-weight:700}

/* ---------- compact layouts: phones, tablets and narrow windows ---------- */
@media (max-width:1023px), (max-width:1199px) and (pointer:coarse){
  /* unread mail gets a pink dot on the avatar */
  .msg-row.unread .m-avatar::after{content:"";position:absolute;top:-3px;right:-3px;width:12px;height:12px;border-radius:50%;background:var(--pop,var(--pink));border:2.5px solid var(--surface)}
  .msg-row{transition:background .2s}
  .msg-row:active{background:var(--active)}
  .msg-row .m-from{font-weight:600}
  .msg-row.unread .m-from,.msg-row.unread .m-subj{font-weight:800}

  /* filter chips scroll sideways like stories */
  .mail-filterbar{overflow-x:auto;scrollbar-width:none;-webkit-mask-image:linear-gradient(90deg,#000 88%,transparent);mask-image:linear-gradient(90deg,#000 88%,transparent)}
  .mail-filterbar::-webkit-scrollbar{display:none}
  .mail-filterbar button{flex:none;height:36px;padding:0 15px!important;border-radius:999px!important;border:1.5px solid var(--line)!important;font-weight:700;white-space:nowrap;transition:background .2s,color .2s}
  .mail-filterbar button.active{background:var(--ink)!important;color:var(--surface)!important;border-color:var(--ink)!important}

  /* reply / forward sit at the bottom, in thumb reach */
  .thread-actions{position:sticky;bottom:0;z-index:4;background:var(--surface);padding:10px 0 calc(10px + env(safe-area-inset-bottom))!important;margin-top:8px}
  .thread-actions .btn{flex:1;min-height:48px;border-radius:999px;font-weight:700}
}

/* ---------- phones ---------- */
@media (max-width:680px){
  #topbar{border-bottom:0;background:var(--surface)}
  .search-wrap{height:48px!important;border-radius:999px!important;border:1.5px solid transparent!important}
  .search-wrap:focus-within{border-color:var(--ink)!important}
  #account-btn{width:38px;height:38px;border-radius:13px}

  /* a floating tab bar instead of a slab glued to the bottom edge */
  #bottomnav{left:12px!important;right:12px!important;bottom:calc(10px + env(safe-area-inset-bottom))!important;min-height:64px;padding:6px!important;
    border:1px solid var(--line)!important;border-radius:24px;box-shadow:0 18px 40px -18px rgba(40,10,30,.45);display:flex}
  #bottomnav button{flex:1;border-radius:18px;font-size:11.5px;font-weight:700;color:var(--ink-3);transition:color .2s}
  #bottomnav button.active{color:var(--ink)}
  #bottomnav button.active .b-ico{background:var(--active);padding:3px 18px;border-radius:999px}
  #bottomnav button:active{transform:scale(.94)}
  #view{padding-bottom:calc(96px + env(safe-area-inset-bottom))!important}
  .msg-list{padding-bottom:84px}
  .fab{right:16px;bottom:calc(88px + env(safe-area-inset-bottom));height:58px;border-radius:999px;font-weight:800;font-size:16px}
  body.fab-mini .fab{width:58px}

  .r-subject{font-size:24px;line-height:1.2}
  .message-group{padding:16px 16px 6px;font-size:13px;color:var(--ink-3)}
}

/* ---------- small phones (iPhone SE, older Android) ---------- */
@media (max-width:360px){
  #topbar{gap:6px;padding-left:8px;padding-right:8px}
  .msg-row{column-gap:10px;padding:10px 12px}
  .m-avatar{width:36px;height:36px}
  #bottomnav{left:8px!important;right:8px!important}
  #bottomnav button{font-size:10.5px}
}

/* ---------- tablets and narrow windows ---------- */
@media (min-width:681px) and (max-width:1199px) and (pointer:coarse), (min-width:681px) and (max-width:1023px){
  #sidebar .compose-btn{border-radius:20px!important}
  .nav-item.active{background:var(--active)}
  .search-wrap{border-radius:999px!important}
  .search-submit{border-radius:0 999px 999px 0!important}
}

/* ---------- big screens: keep lines readable ---------- */
@media (min-width:1600px){
  .r-body{max-width:78ch}
}

@media (prefers-reduced-motion:reduce){
  .compose-btn,.msg-row,#bottomnav button,.mail-filterbar button{transition:none}
}
@media (max-width:1023px), (max-width:1199px) and (pointer:coarse){.mail-filterbar button.active::after{display:none}}

/* ---------- mail cards: an open conversation is a card coloured by how much it matters ---------- */
:root{--tone-security:#ff5a5f;--tone-updates:#4da3ff;--tone-important:#ff4fa3;--tone-danger:#ff5a5f;--tone-money:#ff8a3d;--tone-work:#ffd23f;--tone-personal:#3ddc84;--tone-fun:#b892ff}
.mail-card{--card:var(--surface-2);--card-ink:var(--ink);position:relative;margin:12px clamp(8px,1.6vw,20px) 20px;padding:clamp(18px,2.4vw,28px) clamp(14px,2vw,24px) 14px;
  border-radius:28px;background:var(--card);color:var(--card-ink);animation:mcOpen .45s cubic-bezier(.16,1,.3,1) both}
.mail-card[data-tone]:not([data-tone=""]){--card-ink:#121212}
.mail-card[data-tone="important"]{--card:var(--tone-important)}
.mail-card[data-tone="danger"]{--card:var(--tone-danger)}
.mail-card[data-tone="money"]{--card:var(--tone-money)}
.mail-card[data-tone="work"]{--card:var(--tone-work)}
.mail-card[data-tone="personal"]{--card:var(--tone-personal)}
.mail-card[data-tone="fun"]{--card:var(--tone-fun)}
.mail-card .r-subject{font-size:clamp(24px,2.6vw,34px);line-height:1.08;letter-spacing:-.035em;font-weight:800;color:var(--card-ink);padding:0;margin:6px 0 16px;text-wrap:balance}
.mail-card .thread-count{font-size:14px;font-weight:700;padding:3px 10px;border-radius:999px;background:#121212;color:#fff;vertical-align:middle;letter-spacing:0}
.mc-tag{display:inline-flex;align-items:center;gap:8px;padding:6px 14px;border-radius:999px;background:#121212;color:#fff;font-size:14px;font-weight:800;transform:rotate(-2deg)}
.mc-tag::before{content:"";width:9px;height:9px;border-radius:50%;background:var(--card)}
/* each message sits on its own solid panel inside the card, so the letter stays easy to read */
.mail-card .thread-messages{display:grid;gap:10px}
.mail-card .thread-message{border:0!important;border-radius:22px;background:#fff!important;color:#1d2637;padding:4px 6px;overflow:hidden;--ink:#1d2637;--ink-2:#4c5871;--ink-3:#6b7489}
html[data-brightness="dark"] .mail-card .thread-message,html[data-brightness="medium"] .mail-card .thread-message{background:#1c1a20!important;color:#eef2fa;--ink:#eef2fa;--ink-2:#c3cbdf;--ink-3:#93a0bb}
.mail-card .thread-fold{border-radius:999px;background:#121212;color:#fff;border:0}
.mail-card .thread-actions{position:static;background:transparent!important;padding:14px 0 4px!important;margin:0;gap:10px}
.mail-card .thread-actions .btn{min-height:46px;padding:0 22px;border-radius:999px;border:0;background:#121212;color:#fff;font-weight:800;transition:transform .15s,background .2s}
.mail-card[data-tone=""] .thread-actions .btn{background:var(--ink);color:var(--surface-3,#fff)}
.mail-card .thread-actions .btn:hover{transform:translateY(-2px)}
.mail-card .thread-actions .btn:active{transform:scale(.97)}
.mail-card .thread-actions .btn .ui-icon{color:inherit}
@keyframes mcOpen{from{opacity:0;transform:translateY(18px) scale(.985)}}

/* label chips: a dot in the label's colour, like the category chips on dejoiy.com */
.lbl[data-tone]:not([data-tone=""]){display:inline-flex;align-items:center;gap:5px;border-radius:999px!important;font-weight:700}
.lbl[data-tone]:not([data-tone=""])::before{content:"";width:7px;height:7px;border-radius:50%;background:var(--t)}
.lbl[data-tone="danger"]{--t:var(--tone-danger)}.lbl[data-tone="money"]{--t:var(--tone-money)}.lbl[data-tone="work"]{--t:#e0a800}
.lbl[data-tone="personal"]{--t:#1fb866}.lbl[data-tone="fun"]{--t:var(--tone-fun)}
.mail-card .lbl{background:rgba(255,255,255,.7);color:#121212}
html[data-brightness="dark"] .mail-card .thread-message .lbl{background:rgba(255,255,255,.1);color:#eef2fa}


@media (max-width:1023px), (max-width:1199px) and (pointer:coarse){
  .mail-card{margin:8px 10px 16px;border-radius:24px}
  .mail-card .thread-actions{position:static!important;padding-bottom:calc(10px + env(safe-area-inset-bottom))!important}
  .mail-card .thread-actions .btn{flex:1}
}
@media (prefers-reduced-motion:reduce){.mail-card{animation:none}}

/* ---------- iPhone / iOS Safari ---------- */
@media (max-width:1023px), (max-width:1199px) and (pointer:coarse){
  /* Safari zooms the whole page when a field under 16px gets focus, which knocks the layout sideways */
  input:not([type=checkbox]):not([type=radio]):not([type=range]),select,textarea,[contenteditable="true"]{font-size:max(16px,1em)!important}
  /* a filter on the app frame turns it into the frame for every fixed bar, which jumps around in Safari */
  #app{backdrop-filter:none!important;-webkit-backdrop-filter:none!important}
  /* Reply / Forward stay on a solid strip of the card's colour, never over the letter */
  .mail-card .thread-actions{position:static!important;margin:6px 0 0!important;padding:10px 0 4px!important;background:transparent!important}
  .mail-card{overflow:clip}
  /* the sender line gets the width: reply lives at the bottom, more in the toolbar */
  .mail-card .thread-message .tm-act{display:none!important}
  .mail-card .tm-head{gap:10px}
  .mail-card .tm-who{flex:1 1 0;min-width:0}
  .mail-card .tm-line{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
  .mail-card .tm-email{display:none}
  .mail-card .tm-to{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
  .mail-card .r-body{overflow-x:auto;word-break:break-word}
  .mail-card .r-body img,.mail-card .r-body table{max-width:100%!important;height:auto}
  .reader{-webkit-overflow-scrolling:touch;overscroll-behavior:contain}
}
@media (max-width:680px){
  /* notch and home bar */
  #topbar{padding-left:max(8px,env(safe-area-inset-left));padding-right:max(8px,env(safe-area-inset-right))}
  body.reader-open .r-toolbar{padding-left:max(8px,env(safe-area-inset-left));padding-right:max(8px,env(safe-area-inset-right))}
  .dialog,.dlg,[role="dialog"]{max-height:calc(100dvh - 24px - env(safe-area-inset-top) - env(safe-area-inset-bottom))}
}


/* ============ the app on phones and tablets: colour cards, glass, a compose sheet ============ */
/* every mail has a colour: its label, what it is about, or your Dejoiy colour */
.msg-row{--t:var(--pop,#ff4fa3)}
.msg-row[data-tone="important"],.mail-card[data-tone="important"]{--t:var(--tone-important)}
.msg-row[data-tone="danger"],.msg-row[data-tone="security"]{--t:var(--tone-danger)}
.msg-row[data-tone="money"]{--t:var(--tone-money)}
.msg-row[data-tone="work"]{--t:var(--tone-work)}
.msg-row[data-tone="personal"]{--t:var(--tone-personal)}
.msg-row[data-tone="fun"]{--t:var(--tone-fun)}
.msg-row[data-tone="updates"]{--t:var(--tone-updates)}
.mail-card[data-tone="security"]{--card:var(--tone-security)}
.mail-card[data-tone="updates"]{--card:var(--tone-updates)}
.mail-card[data-tone=""]{--card:var(--pop,#ff4fa3);--card-ink:#121212}
.mail-card[data-tone=""] .thread-actions .btn{background:#121212;color:#fff}
/* the open card is glassy over a background scene, solid on plain looks */
html[data-scenic="true"] .mail-card{background:color-mix(in srgb,var(--card) 86%,transparent);backdrop-filter:blur(18px) saturate(1.3);-webkit-backdrop-filter:blur(18px) saturate(1.3)}

@media (max-width:1023px), (max-width:1199px) and (pointer:coarse){
  .msg-list{padding:4px 0 96px}
  html .msg-row{margin:7px 10px;border-radius:22px;min-height:84px;padding:13px 14px!important;border:1px solid color-mix(in srgb,var(--t) 38%,transparent)!important;
    background:color-mix(in srgb,var(--t) 15%,var(--row-base,#fff))!important;transition:transform .2s cubic-bezier(.16,1,.3,1),background .2s}
  html[data-brightness="light"] .msg-row{--row-base:#fff}
  html:is([data-brightness="dark"],[data-brightness="medium"]) .msg-row{--row-base:#18161b}
  html[data-scenic="true"] .msg-row{--row-base:transparent;background:color-mix(in srgb,var(--t) 26%,transparent)!important;
    backdrop-filter:blur(14px) saturate(1.35);-webkit-backdrop-filter:blur(14px) saturate(1.35)}
  html .msg-row.unread{border-color:color-mix(in srgb,var(--t) 70%,transparent)!important;box-shadow:inset 4px 0 0 0 transparent}
  html .msg-row.selected{background:color-mix(in srgb,var(--t) 34%,var(--row-base,transparent))!important}
  html .msg-row:active{transform:scale(.985)}
  .msg-row .m-avatar{box-shadow:0 0 0 2px color-mix(in srgb,var(--t) 70%,transparent)}
  .msg-row.unread .m-avatar::after{background:var(--t)}
  .message-group{background:transparent!important;padding:14px 18px 2px!important;font-weight:800;letter-spacing:-.01em}
  .msg-row .m-labels .lbl{background:color-mix(in srgb,var(--t) 22%,transparent)}

  /* compose: a sheet in your colour, fields as pills, a big send button */
  .compose{background:transparent!important;padding:0 0 calc(16px + env(safe-area-inset-bottom))!important;gap:0}
  .compose-head{display:flex;align-items:center;gap:8px;margin:0;padding:calc(10px + env(safe-area-inset-top)) 12px 18px!important;
    background:var(--pop,#ff4fa3)!important;color:#121212!important;border:0!important;border-radius:0 0 28px 28px}
  .compose-head .c-title{flex:1;min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-size:clamp(20px,6.4vw,26px);font-weight:800;letter-spacing:-.035em}
  .compose-head .icon-btn{color:#121212}
  .compose-head #c-discard{border:2px solid #121212!important;border-radius:999px;background:transparent;color:#121212;font-weight:700}
  .compose-head .c-send-top{width:46px;height:46px;border-radius:50%!important;background:#121212!important;color:#fff!important;border:0;display:inline-grid;place-items:center;padding:0}
  .compose .c-row{margin:10px 12px 0;padding:6px 8px 6px 6px!important;border:0!important;border-radius:999px;background:var(--compose-field)!important;min-height:52px;align-items:center;box-shadow:inset 0 0 0 1.5px color-mix(in srgb,var(--pop,#ff4fa3) 26%,transparent)}
  html[data-brightness="light"] .compose{--compose-field:#fff}
  html:is([data-brightness="dark"],[data-brightness="medium"]) .compose{--compose-field:#211e25}
  html[data-scenic="true"] .compose{--compose-field:color-mix(in srgb,var(--surface) 92%,transparent)}
  .compose .c-lab{flex:none;min-width:auto!important;padding:6px 12px;border-radius:999px;background:color-mix(in srgb,var(--pop,#ff4fa3) 22%,transparent);color:var(--ink);font-weight:800;font-size:13px}
  .compose .c-row input{background:transparent!important;border:0!important;box-shadow:none!important}
  .compose #c-ccbtn{border-radius:999px}
  .compose .fmt-bar{margin:12px 12px 0;padding:6px!important;border:0!important;border-radius:18px;background:var(--compose-field)!important;overflow-x:auto;flex-wrap:nowrap;scrollbar-width:none}
  .compose .fmt-bar::-webkit-scrollbar{display:none}
  .compose .fmt-bar .icon-btn{flex:none;min-width:40px;height:40px;border-radius:12px}
  .compose #compose-body{margin:10px 12px 0;min-height:42vh;padding:18px!important;border:0!important;border-radius:24px;background:var(--compose-field)!important;line-height:1.6;box-shadow:inset 0 0 0 1.5px color-mix(in srgb,var(--pop,#ff4fa3) 26%,transparent)}
  .compose #compose-body:focus{outline:3px solid color-mix(in srgb,var(--pop,#ff4fa3) 55%,transparent);outline-offset:0}
  .compose-foot{display:flex;gap:10px;flex-wrap:wrap;margin:14px 12px 0;padding:0!important;border:0!important;background:transparent!important}
  .compose-foot #c-send{flex:1 1 100%;min-height:56px;border-radius:999px;background:#121212!important;color:#fff!important;border:0;font-size:17px;font-weight:800;gap:10px;justify-content:center}
  .compose-foot #c-send:active{transform:scale(.98)}
  .compose-foot .btn:not(#c-send){flex:1;min-height:48px;border-radius:999px}
  .compose-foot #c-status{flex:1 1 100%;text-align:center;margin:0!important}
}
/* phones: the title gets its own line under the buttons, so it never gets cut */
@media (max-width:1023px), (max-width:1199px) and (pointer:coarse){
  .compose-head{flex-wrap:wrap}
  .compose-head .c-title{order:9;flex:1 1 100%;padding:4px 6px 0;font-size:clamp(26px,8vw,34px);white-space:normal}
  .compose-head #c-discard{margin-left:auto}
}

/* the message is written on paper, in the colours the recipient will see */
.compose #compose-body{background:#fffdf9!important;color:#121212}
.compose #compose-body:empty::before{color:#8a8590}
/* label picker */
.c-labels{flex-wrap:nowrap}
.c-label-pills{display:flex;gap:6px;overflow-x:auto;scrollbar-width:none;flex:1;min-width:0;padding:2px}
.c-label-pills::-webkit-scrollbar{display:none}
.c-pill{--t:var(--pop,#ff4fa3);flex:none;border:1.5px solid color-mix(in srgb,var(--t) 55%,transparent);background:color-mix(in srgb,var(--t) 12%,transparent);
  color:var(--ink);border-radius:999px;padding:7px 13px;font:inherit;font-size:13px;font-weight:700;cursor:pointer;transition:transform .15s,background .15s}
.c-pill[data-tone="important"]{--t:var(--tone-important)}.c-pill[data-tone="danger"],.c-pill[data-tone="security"]{--t:var(--tone-danger)}
.c-pill[data-tone="money"]{--t:var(--tone-money)}.c-pill[data-tone="work"]{--t:var(--tone-work)}.c-pill[data-tone="personal"]{--t:var(--tone-personal)}
.c-pill[data-tone="fun"]{--t:var(--tone-fun)}.c-pill[data-tone="updates"]{--t:var(--tone-updates)}
.c-pill[aria-checked="true"]{background:var(--t);color:#121212;border-color:#121212;box-shadow:0 2px 0 #121212}
.c-pill:active{transform:scale(.96)}
.c-pill:focus-visible{outline:3px solid var(--t);outline-offset:2px}
/* the drawer sits above the search bar, bottom bar and compose button, not under them */
@media (max-width:1023px), (max-width:1199px) and (pointer:coarse){
  body.nav-open #shell{z-index:60}
  body.nav-open .fab{visibility:hidden}
  body.nav-open #sidebar{background:var(--surface)!important;backdrop-filter:none;-webkit-backdrop-filter:none;
    padding:calc(18px + env(safe-area-inset-top)) 12px calc(18px + env(safe-area-inset-bottom))!important;overflow-y:auto;overscroll-behavior:contain;
    border-radius:0 28px 28px 0;box-shadow:12px 0 40px rgba(0,0,0,.35)}
  body.nav-open #sidebar .nav-item.active{background:color-mix(in srgb,var(--pop,#ff4fa3) 22%,transparent)!important;color:var(--ink)!important;font-weight:800}
  /* the open drawer is solid, not see-through, so it takes the theme's own text colours, not the photo-panel ones */
  html[data-panel-ink] body.nav-open #sidebar{--ink:inherit;--ink-2:inherit;--ink-3:inherit;color:var(--ink);text-shadow:none}
}
/* The background photo is sized to the tallest screen, so the keyboard and Safari's bars
   opening or closing never rescale it (that was the shake on every tap). */
#bg{bottom:auto;height:100vh;height:100lvh;transition:none}

/* ============ Dejoiy Updates and the company box: sticker cards ============ */
.upd{max-width:1040px;margin:0 auto;padding:clamp(14px,3vw,28px) clamp(12px,3vw,24px) 120px}
.upd-head{display:flex;align-items:center;gap:16px;margin:4px 0 18px;flex-wrap:wrap}
.upd-head>div{flex:1;min-width:200px}
.upd-head h1{font-size:clamp(28px,5vw,40px);font-weight:800;letter-spacing:-.04em;line-height:1.02;margin:0;color:var(--ink)}
.upd-head p{margin:4px 0 0;color:var(--ink-2)}
.upd-badge{flex:none;width:58px;height:58px;display:grid;place-items:center;background:var(--pop,#ff4fa3);color:#121212;border:2.5px solid #121212;
  border-radius:12% 46.7% 46.7% 12% / 12.86% 50% 50% 12.86%;box-shadow:4px 4px 0 #121212;transform:rotate(-4deg)}
.upd-badge .ui-icon{width:28px;height:28px}
.upd-company .upd-badge{background:#fff}
.upd-new-btn,.upd-post-btn{border:0;border-radius:999px;background:#121212;color:#fff;font:inherit;font-weight:800;min-height:46px;padding:0 22px;cursor:pointer;
  box-shadow:3px 3px 0 var(--pop,#ff4fa3);transition:transform .15s,box-shadow .15s}
.upd-new-btn:active,.upd-post-btn:active{transform:translate(2px,2px);box-shadow:1px 1px 0 var(--pop,#ff4fa3)}
.upd-post-btn:disabled{opacity:.6}
.upd-filters{display:flex;gap:8px;overflow-x:auto;scrollbar-width:none;margin:0 0 16px;padding:2px}
.upd-filters::-webkit-scrollbar{display:none}

/* kinds */
.upd-card,.upd-kind-pick{--k:var(--pop,#ff4fa3)}
[data-kind="news"]{--k:var(--pop,#ff4fa3)}[data-kind="feature"]{--k:#b892ff}[data-kind="policy"]{--k:#ffd23f}
[data-kind="notice"]{--k:#ff8a3d}[data-kind="tip"]{--k:#3ddc84}[data-kind="event"]{--k:#4da3ff}

/* cards */
.upd-grid{columns:2 330px;column-gap:16px}
.upd-card{break-inside:avoid;margin:0 0 16px;background:var(--surface);color:var(--ink);border:2px solid #121212;border-radius:26px;overflow:hidden;
  box-shadow:5px 5px 0 #121212;animation:updIn .5s cubic-bezier(.16,1,.3,1) both;animation-delay:calc(var(--i) * 55ms);transition:transform .2s cubic-bezier(.16,1,.3,1),box-shadow .2s}
@media (hover:hover){.upd-card:hover{transform:translate(-2px,-2px) rotate(-.3deg);box-shadow:7px 7px 0 var(--k)}}
html[data-scenic="true"] .upd-card{background:color-mix(in srgb,var(--surface) 94%,transparent)}
.upd-cover{position:relative;display:block;height:118px;background:var(--k);overflow:hidden;
  background-image:radial-gradient(circle at 1px 1px,rgba(18,18,18,.18) 1.4px,transparent 1.6px);background-size:16px 16px}
.upd-cover.is-photo{height:auto;max-height:300px;background:#121212}
.upd-cover.is-photo img{display:block;width:100%;height:100%;max-height:300px;object-fit:cover}
.upd-cover i{position:absolute;border:3px solid #121212;border-radius:50%;background:#fff}
.upd-cover i:nth-of-type(1){width:30px;height:30px;right:22px;top:18px}
.upd-cover i:nth-of-type(2){width:16px;height:16px;right:66px;bottom:20px;background:#121212}
.upd-cover i:nth-of-type(3){width:60px;height:60px;left:-14px;bottom:-26px;background:transparent}
.upd-sticker{position:absolute;left:22px;top:22px;width:72px;height:72px;display:grid;place-items:center;font-size:38px;background:#fff;border:2.5px solid #121212;
  border-radius:12% 46.7% 46.7% 12% / 12.86% 50% 50% 12.86%;box-shadow:4px 4px 0 #121212;transform:rotate(-6deg);transition:transform .3s cubic-bezier(.34,1.56,.64,1)}
.upd-card:hover .upd-sticker{transform:rotate(4deg) scale(1.06)}
.upd-body{padding:16px 20px 16px}
.upd-tags{display:flex;gap:6px;flex-wrap:wrap;margin-bottom:8px}
.upd-kind,.upd-pin{font-size:12px;font-weight:800;padding:4px 10px;border-radius:999px;background:color-mix(in srgb,var(--k) 26%,transparent);color:var(--ink);border:1.5px solid color-mix(in srgb,var(--k) 70%,#121212)}
.upd-pin{background:#121212;color:#fff;border-color:#121212}
.upd-card h2{font-size:21px;font-weight:800;letter-spacing:-.025em;line-height:1.18;margin:0 0 8px}
.upd-text p{margin:0 0 10px;line-height:1.6;color:var(--ink-2)}
.upd-text.is-clamped{display:-webkit-box;-webkit-line-clamp:5;-webkit-box-orient:vertical;overflow:hidden}
.upd-more{border:0;background:none;color:var(--ink);font:inherit;font-weight:800;padding:0;margin:-2px 0 10px;cursor:pointer;text-decoration:underline;text-decoration-color:var(--k);text-decoration-thickness:3px;text-underline-offset:3px}
.upd-link{display:inline-flex;align-items:center;gap:8px;margin:4px 0 12px;padding:10px 16px;border-radius:999px;background:var(--k);color:#121212;border:2px solid #121212;
  font-weight:800;text-decoration:none;box-shadow:3px 3px 0 #121212;transition:transform .15s,box-shadow .15s}
.upd-link span{transition:transform .2s}
.upd-link:hover span{transform:translateX(4px)}
.upd-link:active{transform:translate(2px,2px);box-shadow:1px 1px 0 #121212}
.upd-thumbs{display:grid;grid-template-columns:repeat(auto-fill,minmax(84px,1fr));gap:8px;margin:6px 0 12px}
.upd-thumbs img{width:100%;aspect-ratio:1;object-fit:cover;border-radius:14px;border:2px solid #121212;display:block}
.upd-files{display:grid;gap:8px;margin:6px 0 12px}
.upd-file{display:flex;align-items:center;gap:10px;padding:10px 12px;border-radius:16px;border:1.5px solid var(--line);background:var(--surface-2);color:var(--ink);text-decoration:none;transition:border-color .2s,transform .15s}
.upd-file:hover{border-color:var(--k)}.upd-file:active{transform:scale(.98)}
.upd-file span{font-size:22px}.upd-file b{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:14px}.upd-file small{color:var(--ink-3)}
.upd-meta{display:flex;align-items:center;gap:10px;padding-top:12px;border-top:1.5px dashed var(--line);font-size:13px}
.upd-meta>span:nth-child(2){display:flex;flex-direction:column;line-height:1.25}
.upd-meta small{color:var(--ink-3)}
.upd-av{width:32px;height:32px;flex:none;display:grid;place-items:center;border-radius:50%;background:var(--k);color:#121212;font-weight:800;border:2px solid #121212}
.upd-acts{margin-left:auto;display:flex;gap:2px}

/* the pinned or newest post */
.upd-hero{display:grid;grid-template-columns:minmax(0,.9fr) minmax(0,1.1fr);margin-bottom:20px;background:var(--k);color:#121212}
.upd-hero .upd-cover{height:auto;min-height:220px;background-color:color-mix(in srgb,var(--k) 80%,#fff)}
.upd-hero .upd-sticker{left:50%;top:50%;width:120px;height:120px;font-size:64px;transform:translate(-50%,-50%) rotate(-6deg)}
.upd-hero:hover .upd-sticker{transform:translate(-50%,-50%) rotate(4deg) scale(1.06)}
.upd-hero .upd-body{padding:24px 26px}
.upd-hero h2{font-size:clamp(26px,3.6vw,36px);letter-spacing:-.04em;line-height:1.05}
.upd-hero .upd-text p,.upd-hero .upd-meta small{color:#2b2730}
.upd-hero .upd-kind{background:#fff;border-color:#121212;color:#121212}
.upd-hero .upd-link{background:#121212;color:#fff}
.upd-hero .upd-meta{border-color:rgba(18,18,18,.25)}
.upd-hero .upd-av{background:#fff}
.upd-hero .icon-btn{color:#121212}
@media (max-width:700px){.upd-hero{grid-template-columns:1fr}.upd-hero .upd-cover{min-height:150px}.upd-hero .upd-sticker{width:96px;height:96px;font-size:50px}}

/* composer */
.upd-compose{display:grid;gap:10px;margin:0 0 20px;padding:16px;background:var(--surface);color:var(--ink);border:2px solid #121212;border-radius:24px;box-shadow:5px 5px 0 var(--pop,#ff4fa3);animation:updIn .35s cubic-bezier(.16,1,.3,1)}
.upd-compose input,.upd-compose textarea{width:100%;border:1.5px solid var(--line);border-radius:14px;background:var(--surface-2);color:var(--ink);font:inherit;font-size:16px;padding:11px 13px;outline:0;transition:border-color .2s,box-shadow .2s}
.upd-compose input:focus,.upd-compose textarea:focus{border-color:var(--pop,#ff4fa3);box-shadow:0 0 0 3px color-mix(in srgb,var(--pop,#ff4fa3) 25%,transparent)}
.upd-compose [name=title]{font-weight:800;font-size:18px}
.upd-compose textarea{resize:vertical;min-height:110px}
.upd-row{display:grid;grid-template-columns:2fr 1fr;gap:10px}
.upd-kinds{display:flex;gap:6px;overflow-x:auto;scrollbar-width:none;padding:2px}
.upd-kinds::-webkit-scrollbar{display:none}
.upd-kind-pick{flex:none;border:1.5px solid color-mix(in srgb,var(--k) 60%,transparent);background:color-mix(in srgb,var(--k) 14%,transparent);color:var(--ink);border-radius:999px;padding:8px 13px;font:inherit;font-size:13px;font-weight:700;cursor:pointer}
.upd-kind-pick[aria-checked="true"]{background:var(--k);color:#121212;border-color:#121212;box-shadow:0 2px 0 #121212}
.upd-picked{display:flex;flex-wrap:wrap;gap:6px}
.upd-picked:empty{display:none}
.upd-chip{display:inline-flex;align-items:center;gap:6px;padding:6px 8px 6px 12px;border-radius:999px;background:var(--surface-2);border:1.5px solid var(--line);font-size:13px;max-width:100%}
.upd-chip small{color:var(--ink-3)}
.upd-chip button{border:0;background:#121212;color:#fff;width:22px;height:22px;border-radius:50%;cursor:pointer;line-height:1}
.upd-compose-foot{display:flex;align-items:center;gap:10px;flex-wrap:wrap}
.upd-attach{cursor:pointer;font-weight:800;padding:10px 14px;border-radius:999px;border:2px dashed var(--line);transition:border-color .2s}
.upd-attach:hover{border-color:var(--pop,#ff4fa3)}
.upd-compose-foot .upd-post-btn{margin-left:auto}
.upd-who{font-size:12px;color:var(--ink-3)}
.upd-error{margin:0;color:#d4183d;font-weight:700;font-size:14px}.upd-error:empty{display:none}
@media (max-width:560px){.upd-row{grid-template-columns:1fr}.upd-compose-foot .upd-post-btn{flex:1 1 100%}.upd-who{flex:1}}

.upd-empty{display:grid;place-items:center;gap:6px;padding:40px 18px;text-align:center;border:2px dashed var(--line);border-radius:26px;color:var(--ink-3)}
.upd-empty span{font-size:42px}
.upd-skel{display:grid;gap:14px}
.upd-skel i{display:block;height:140px;border-radius:26px;background:linear-gradient(90deg,var(--surface-2),var(--surface),var(--surface-2));background-size:200% 100%;animation:updShimmer 1.2s linear infinite}
@keyframes updIn{from{opacity:0;transform:translateY(16px)}}
@keyframes updShimmer{to{background-position:-200% 0}}
@media (prefers-reduced-motion:reduce){.upd-card,.upd-compose,.upd-skel i{animation:none}.upd-card:hover{transform:none}}
/* contacts: divisions */
.ct-groups{display:flex;gap:8px;overflow-x:auto;scrollbar-width:none;margin:0 0 12px;padding:2px}
.ct-groups::-webkit-scrollbar{display:none}
.chip-filter{flex:none;border:1.5px solid var(--line);background:var(--surface);color:var(--ink);border-radius:999px;padding:8px 14px;font:inherit;font-size:13px;font-weight:700;cursor:pointer;transition:background .2s,transform .15s}
.chip-filter b{margin-left:4px;opacity:.6}
.chip-filter[aria-checked="true"]{background:#121212;color:#fff;border-color:#121212}
.chip-filter:active{transform:scale(.96)}
.ct-div th{text-align:left;font-size:13px;font-weight:800;padding:12px 14px 8px;background:var(--surface-2);color:var(--ink)}
.ct-div th span{opacity:.55;margin-left:6px}
.ct-div[data-div="work"] th{box-shadow:inset 4px 0 0 var(--pop,#ff4fa3)}
.ct-div[data-div="sup"] th{box-shadow:inset 4px 0 0 var(--accent,#2f6bff)}
.ct-status{font-size:12px;color:var(--muted);margin-top:2px}

/* ============ smoothness ============ */
/* rows no longer blur the photo behind each one: one glass layer for the page is enough, and scrolling stays at full speed */
html[data-scenic="true"] .msg-row{backdrop-filter:none!important;-webkit-backdrop-filter:none!important}
@media (max-width:1023px), (max-width:1199px) and (pointer:coarse){
  html[data-scenic="true"] .msg-row{background:color-mix(in srgb,var(--t) 22%,color-mix(in srgb,var(--surface) 70%,transparent))!important}
}
.msg-list{overscroll-behavior-y:contain;-webkit-overflow-scrolling:touch}
.msg-row{content-visibility:auto;contain-intrinsic-size:auto 88px}
.msg-row,.nav-item,.btn,.icon-btn,.chip-filter{-webkit-tap-highlight-color:transparent}
.nav-item,.btn,.icon-btn{transition:background-color .2s ease,color .2s ease,transform .15s ease,box-shadow .2s ease}
/* search box: a soft glow when you type, results fade in */
.search-wrap{transition:box-shadow .25s ease,background-color .25s ease}
.search-wrap:focus-within{box-shadow:0 0 0 3px color-mix(in srgb,var(--pop,#ff4fa3) 40%,transparent),0 8px 24px rgba(0,0,0,.12)}
#global-search{transition:color .2s}
body.list-fade .msg-row{animation:rowIn .32s cubic-bezier(.16,1,.3,1) both}
body.list-fade .msg-row:nth-child(2){animation-delay:30ms}body.list-fade .msg-row:nth-child(3){animation-delay:60ms}
body.list-fade .msg-row:nth-child(4){animation-delay:90ms}body.list-fade .msg-row:nth-child(n+5){animation-delay:120ms}
@keyframes rowIn{from{opacity:0;transform:translateY(6px)}}
@media (prefers-reduced-motion:reduce){body.list-fade .msg-row{animation:none}}
@media (max-width:680px){
  .ct-tbl{min-width:0!important}
  .ct-tbl thead,.ct-tbl tr:not(.ct-div) td:nth-child(3),.ct-tbl tr:not(.ct-div) td:nth-child(4){display:none}
  .ct-tbl tr:not(.ct-div) td:nth-child(2){font-size:13px;color:var(--ink-2);word-break:break-all}
}
html[data-scenic="true"] .upd-hero{background:var(--k)}
/* people photos on posts: the photo fills the cover, the kind sticker sits on it */
.upd-cover.is-photo{margin:0;position:relative}
figure.upd-cover.is-photo{height:210px}
figure.upd-cover.is-photo img{height:100%}
figure.upd-cover .upd-sticker{left:auto;right:16px;top:auto;bottom:16px;width:56px;height:56px;font-size:28px}
.upd-cover figcaption{position:absolute;left:10px;bottom:10px;font-size:11px;font-weight:700}
.upd-cover figcaption a{color:#fff;text-decoration:none;background:rgba(18,18,18,.6);padding:4px 9px;border-radius:999px;backdrop-filter:blur(6px);-webkit-backdrop-filter:blur(6px)}
figure.upd-cover.is-gone{height:118px;background:var(--k)}
figure.upd-cover.is-gone img,figure.upd-cover.is-gone figcaption{display:none}
.upd-hero figure.upd-cover.is-photo{height:auto;min-height:260px}
.upd-hero figure.upd-cover .upd-sticker{left:auto;top:auto;right:20px;bottom:20px;width:84px;height:84px;font-size:44px;transform:rotate(-6deg)}
.upd-hero:hover figure.upd-cover .upd-sticker{transform:rotate(4deg) scale(1.06)}
.upd-hero figure.upd-cover img{position:absolute;inset:0;max-height:none}
.upd-aud{font-size:12px;font-weight:800;padding:4px 10px;border-radius:999px;background:var(--surface-2);border:1.5px dashed var(--line);color:var(--ink)}
.upd-hero .upd-aud{background:#fff;color:#121212}
.upd-auds{align-items:center}
.upd-auds-lab{flex:none;font-size:13px;font-weight:800;color:var(--ink-3);margin-right:2px}
.upd-auds .upd-kind-pick{--k:var(--pop,#ff4fa3)}
/* the mail Compose button stays out of the way on the update pages */
body:is([data-route="news"],[data-route="company"]) .fab{display:none!important}

/* ============ phone pass: every screen fits, every control is easy to tap ============ */
@media (max-width:1023px), (max-width:1199px) and (pointer:coarse){
  /* an open mail uses the whole screen: no space kept for the hidden bottom bar, one scroll only */
  body.reader-open #view{padding-bottom:0!important}
  body.reader-open .reader{padding-bottom:calc(24px + env(safe-area-inset-bottom))!important}
  body.reader-open .r-body{overflow:visible!important;max-height:none!important}
  /* stars: a 44px target around the 16px icon */
  .msg-row .star{position:relative;min-width:24px;min-height:24px;justify-content:center}
  .msg-row .star::after{content:"";position:absolute;inset:-12px}
  /* selected mail shows a tick on its avatar */
  .msg-row.selected .m-avatar{position:relative}
  .msg-row.selected .m-avatar::before{content:"✓";position:absolute;inset:0;display:grid;place-items:center;border-radius:inherit;background:#121212;color:#fff;font-weight:800;font-size:18px;z-index:1}
  /* settings: the last fields scroll clear of the save bar and the bottom bar */
  body[data-route="settings"] #view{padding-bottom:calc(170px + env(safe-area-inset-bottom))!important}
  input[type=checkbox],input[type=radio]{width:22px;height:22px}
}
/* the selection bar fits a 320px phone: the count stays, the word goes */
@media (max-width:380px){
  .selection-status .sel-word{display:none}
  .list-toolbar{gap:2px!important;padding:8px 8px!important}
  .list-toolbar .icon-btn{min-width:40px!important;padding:0 4px!important}
}
/* phones on their side: short screens get compact bars so the mail has room */
@media (max-height:500px) and (orientation:landscape) and (pointer:coarse){
  #topbar{height:56px!important;padding:6px 12px!important}
  #bottomnav{min-height:0!important;padding-top:4px!important;padding-bottom:calc(4px + env(safe-area-inset-bottom))!important}
  #bottomnav button{min-height:40px!important;flex-direction:row!important;gap:6px!important}
  #view{padding-bottom:64px!important}
  .fab{min-height:48px!important;padding:0 18px!important;bottom:calc(64px + env(safe-area-inset-bottom))!important}
  .mail-filterbar{min-height:0!important}
  .message-group{padding-top:6px!important;padding-bottom:2px!important}
  html .msg-row{min-height:64px;margin:5px 10px!important}
  .compose-head{flex-wrap:nowrap!important;padding:8px 12px 10px!important;border-radius:0 0 20px 20px!important}
  .compose-head .c-title{order:0!important;flex:1 1 auto!important;font-size:22px!important;padding:0!important}
  .compose #compose-body{min-height:44vh!important}
}
/* a post whose photo can't load keeps a full sticker cover */
figure.upd-cover.is-gone .upd-sticker{left:22px;right:auto;top:22px;bottom:auto;width:72px;height:72px;font-size:38px}
.upd-hero figure.upd-cover.is-gone .upd-sticker{left:50%;top:50%;width:120px;height:120px;font-size:64px;transform:translate(-50%,-50%) rotate(-6deg)}
.upd-hero figure.upd-cover.is-gone{min-height:220px;background:color-mix(in srgb,var(--k) 80%,#fff)}

/* ===== Solid panels by default (Zoho Cliq / Claude apps look) =====
   Photo and scene themes keep their picture around the edges; panels on top of it are solid until the person
   moves Themes > Panel transparency, which sets --glass (0% = solid). No blur, and mail cards always stay solid. */
html :is(#app,#topbar,#sidebar,#app-rail,#view,.mail-card,.msg-row,.dlg-back){-webkit-backdrop-filter:none!important;backdrop-filter:none!important}
html #shell::before{-webkit-backdrop-filter:none!important;backdrop-filter:none!important}
html:is([data-photo-theme="true"],[data-scenic="true"]) :is(#topbar,#sidebar,#app-rail,#view){background:color-mix(in srgb,var(--surface) calc(100% - var(--glass,0%)),transparent)!important}
html[data-scenic="true"] .mail-card{background:var(--card)!important}
html[data-scenic="true"] .msg-row{--row-base:var(--card)!important;background:color-mix(in srgb,var(--t,var(--accent)) 15%,var(--card))!important}

/* ---------- see-through panels: text that reads on the picture behind it (set by Themes.panelInk) ---------- */
html[data-panel-ink="light"] :is(#topbar,#sidebar,#app-rail,.mail-heading,.mail-filterbar,.message-group,.msg-row,.r-toolbar,.list-toolbar){--ink:#fff;--ink-2:#f0f0f4;--ink-3:#dcdce4;color:#fff;text-shadow:0 1px 2px rgba(0,0,0,.5)}
html[data-panel-ink="dark"] :is(#topbar,#sidebar,#app-rail,.mail-heading,.mail-filterbar,.message-group,.msg-row,.r-toolbar,.list-toolbar){--ink:#121212;--ink-2:#2e2b33;--ink-3:#48434d;color:#121212;text-shadow:0 1px 1px rgba(255,255,255,.45)}
/* solid things inside those panels keep their own text colour */
html[data-panel-ink] :is(.search-wrap,.compose-btn,.btn,.lbl,.code-chip,.m-avatar,.avatar,.badge,.count,[role="menu"],.menu,.popover){text-shadow:none}
html[data-panel-ink="light"] .search-wrap{--ink:#121212;--ink-2:#3d3a42;--ink-3:#5b5560;background:#fff;color:#121212}
html[data-panel-ink="dark"] .search-wrap{--ink:#121212;--ink-2:#3d3a42;--ink-3:#5b5560;background:#fff;color:#121212}
html[data-panel-ink] :is(#topbar,#view,#sidebar) :is(select,input:not([type="checkbox"])){color:#121212;text-shadow:none}
html[data-panel-ink] .list-toolbar :is(button,.btn){color:inherit;text-shadow:inherit}
html[data-panel-ink] .folder-total{color:#121212;text-shadow:none}

/* Notepad: list beside the note on wide screens, above it on phones */
.nt-grid{grid-template-columns:240px minmax(0,1fr);align-items:start}
@media (max-width:760px){.nt-grid{grid-template-columns:minmax(0,1fr)}}
