:root {
  --bg: #f6f5f2; --surface: #ffffff; --surface-2: #f0efeb; --line: #e4e2dc; --line-2: #d4d1c9;
  --text: #1c1b19; --muted: #6b6860; --faint: #9a968c;
  --accent: #4338ca; --accent-2: #eef0ff; --accent-ink: #ffffff;
  --ok: #15803d; --ok-bg: #e7f6ec; --warn: #b45309; --warn-bg: #fdf3e2; --bad: #b91c1c; --bad-bg: #fdeaea; --info: #0369a1; --info-bg: #e6f3fb;
  --radius: 10px; --shadow: 0 1px 2px rgba(28,27,25,.06), 0 4px 16px rgba(28,27,25,.06);
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans Bengali", sans-serif;
  color-scheme: light;
}
/* Dark colours: when the phone or computer is set to dark (unless Light is chosen in My settings), or when Dark is chosen. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #141412; --surface: #1d1c1a; --surface-2: #262522; --line: #33312d; --line-2: #45423c;
    --text: #edebe6; --muted: #a8a49a; --faint: #78746b;
    --accent: #8b8cf8; --accent-2: #26264a; --accent-ink: #12121f;
    --ok: #4ade80; --ok-bg: #16301f; --warn: #fbbf24; --warn-bg: #352a12; --bad: #f87171; --bad-bg: #3a1a1a; --info: #38bdf8; --info-bg: #10293a;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 6px 20px rgba(0,0,0,.3);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
    --bg: #141412; --surface: #1d1c1a; --surface-2: #262522; --line: #33312d; --line-2: #45423c;
    --text: #edebe6; --muted: #a8a49a; --faint: #78746b;
    --accent: #8b8cf8; --accent-2: #26264a; --accent-ink: #12121f;
    --ok: #4ade80; --ok-bg: #16301f; --warn: #fbbf24; --warn-bg: #352a12; --bad: #f87171; --bad-bg: #3a1a1a; --info: #38bdf8; --info-bg: #10293a;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 6px 20px rgba(0,0,0,.3);
    color-scheme: dark;
}
:root[data-theme="light"] { color-scheme: light; }
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 14px/1.5 var(--font); -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0; line-height: 1.25; letter-spacing: -0.01em; }
h1 { font-size: 22px; font-weight: 650; }
h2 { font-size: 16px; font-weight: 620; }
h3 { font-size: 14px; font-weight: 600; }
.boot { display: grid; place-items: center; height: 100vh; color: var(--muted); }
.muted { color: var(--muted); } .faint { color: var(--faint); } .small { font-size: 12.5px; }
.hidden { display: none !important; }
.row { display: flex; align-items: center; gap: 8px; }
.row.wrap { flex-wrap: wrap; } .spacer { flex: 1; }
.stack > * + * { margin-top: 12px; }

/* ---------- buttons & inputs ---------- */
button, .btn { font: inherit; cursor: pointer; border: 1px solid var(--line-2); background: var(--surface); color: var(--text);
  padding: 7px 13px; border-radius: 8px; display: inline-flex; align-items: center; gap: 6px; font-weight: 550; white-space: nowrap; }
button:hover, .btn:hover { background: var(--surface-2); text-decoration: none; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: var(--accent); filter: brightness(1.08); }
.btn-danger { color: var(--bad); }
.btn-ghost { border-color: transparent; background: transparent; }
.btn-sm { padding: 4px 9px; font-size: 12.5px; }
button:disabled { opacity: .55; cursor: default; }
input, select, textarea { font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--line-2); border-radius: 8px; padding: 8px 10px; width: 100%; }
textarea { resize: vertical; min-height: 80px; }
label { display: block; font-weight: 550; font-size: 12.5px; color: var(--muted); margin-bottom: 4px; }
.field { margin-bottom: 12px; }
.check { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--text); font-weight: 450; margin: 6px 0; }
.check input { width: auto; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }

/* ---------- layout ---------- */
.shell { display: grid; grid-template-columns: 232px 1fr; min-height: 100vh; }
.side { background: var(--surface); border-right: 1px solid var(--line); padding: 16px 12px; position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 16px; padding: 4px 8px 16px; }
.brand img { width: 28px; height: 28px; }
/* app switcher at the top of the ☰ menu: TaskFlow | Warehouse */
.apps { display: grid; grid-template-columns: 1fr 1fr; gap: 3px; padding: 3px; margin: 0 4px 14px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; }
.apps a, .apps span { display: flex; align-items: center; justify-content: center; gap: 6px; padding: 7px 4px; border-radius: 7px; font-weight: 600; font-size: 13px; color: var(--muted); }
.apps svg { width: 16px; height: 16px; flex: none; }
.apps .on { background: var(--surface); color: var(--accent); box-shadow: 0 1px 2px rgba(28,27,25,.1); }
.apps-pick { border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px 4px; margin: 4px 0 12px; }
.apps-pick legend { font-size: 13px; font-weight: 600; color: var(--muted); padding: 0 4px; }
.apps-pick .check { align-items: flex-start; }
.apps-pick .check input { margin-top: 3px; }
.apps-pick .app-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.apps-pick .app-row .check { flex: 1 1 220px; }
.apps-pick select { width: auto; min-width: 130px; }
.apps-pick select:disabled { opacity: .5; }
.apps-pick p { margin: 2px 0 6px; }
.apps-pick p:empty { display: none; }
.apps-cell { display: inline-flex; gap: 4px; flex-wrap: wrap; }
.pill.app-tf { background: var(--accent-2); color: var(--accent); }
.pill.app-wh { background: var(--ok-bg, var(--surface-2)); color: var(--ok, var(--muted)); }
.apps a:hover { color: var(--text); background: var(--surface); text-decoration: none; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; color: var(--muted); font-weight: 550; }
.nav a:hover { background: var(--surface-2); text-decoration: none; color: var(--text); }
.nav a.on { background: var(--accent-2); color: var(--accent); }
.nav svg { width: 18px; height: 18px; flex: none; }
.nav-sep { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--faint); padding: 14px 10px 4px; }
.side-foot { margin-top: auto; border-top: 1px solid var(--line); padding-top: 12px; }
.me { display: flex; align-items: center; gap: 10px; padding: 6px 8px; }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--accent-2); color: var(--accent); display: grid; place-items: center; font-weight: 650; font-size: 12px; flex: none; }
.avatar.sm { width: 22px; height: 22px; font-size: 10px; }
.main { min-width: 0; }
.top { display: flex; align-items: center; gap: 12px; padding: 14px 28px; border-bottom: 1px solid var(--line); background: var(--bg); position: sticky; top: 0; z-index: 5; }
.top h1 { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu-btn { display: none; }
.content { padding: 24px 28px 64px; max-width: 1280px; }

/* ---------- cards ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.card-h { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin-bottom: 12px; }
.card-h h2 { flex: 1 1 auto; min-width: min(100%, 8em); }   /* a long note beside the heading moves below it instead of squeezing it */
.cards { display: grid; gap: 16px; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 20px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.stat b { display: block; font-size: 26px; font-weight: 650; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.stat span { color: var(--muted); font-size: 12.5px; }
.stat.bad b { color: var(--bad); } .stat.warn b { color: var(--warn); } .stat.ok b { color: var(--ok); }
.dash { display: grid; grid-template-columns: 1.4fr 1fr; gap: 16px; }
.empty { color: var(--faint); text-align: center; padding: 24px 8px; }

/* ---------- task rows ---------- */
.tlist { list-style: none; margin: 0; padding: 0; }
.trow { display: flex; align-items: center; gap: 10px; padding: 10px 4px; border-bottom: 1px solid var(--line); cursor: pointer; }
.trow:last-child { border-bottom: 0; }
.trow:hover { background: var(--surface-2); }
.trow .t-title { flex: 1; min-width: 0; font-weight: 550; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.trow .t-meta { display: flex; gap: 8px; align-items: center; color: var(--muted); font-size: 12.5px; flex-wrap: wrap; justify-content: flex-end; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--c, var(--accent)); flex: none; }
.pill { display: inline-flex; align-items: center; gap: 4px; padding: 1px 8px; border-radius: 99px; font-size: 11.5px; font-weight: 600; background: var(--surface-2); color: var(--muted); white-space: nowrap; }
.s-todo { background: var(--surface-2); color: var(--muted); }
.s-in_progress { background: var(--info-bg); color: var(--info); }
.s-review { background: var(--warn-bg); color: var(--warn); }
.s-done { background: var(--ok-bg); color: var(--ok); }
.p-low { color: var(--faint); } .p-medium { color: var(--info); } .p-high { color: var(--warn); } .p-urgent { color: var(--bad); background: var(--bad-bg); }
.btn-take { color: var(--accent); border-color: var(--accent); background: var(--accent-2); padding: 1px 9px; font-size: 12px; }
.btn-take:hover { background: var(--accent); color: var(--accent-ink); }
.stack-sm { display: grid; gap: 6px; justify-items: start; }
.due-over { color: var(--bad); font-weight: 600; } .due-soon { color: var(--warn); font-weight: 600; }

/* ---------- table ---------- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
tr.click { cursor: pointer; } tr.click:hover td { background: var(--surface-2); }

/* ---------- projects ---------- */
.pgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.pcard { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; cursor: pointer; border-top: 4px solid var(--c, var(--accent)); }
.pcard:hover { box-shadow: var(--shadow); }
.pcard p { color: var(--muted); margin: 6px 0 12px; min-height: 2.6em; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.bar { height: 6px; background: var(--surface-2); border-radius: 99px; overflow: hidden; }
.bar i { display: block; height: 100%; width: var(--w, 0%); background: var(--c, var(--accent)); border-radius: 99px; }
.faces { display: flex; }
.faces .avatar { border: 2px solid var(--surface); margin-left: -6px; }
.faces .avatar:first-child { margin-left: 0; }

/* ---------- board ---------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 16px; }
.tabs button { border: 0; border-bottom: 2px solid transparent; border-radius: 0; background: none; color: var(--muted); padding: 8px 12px; }
.tabs button.on { color: var(--accent); border-bottom-color: var(--accent); }
.board { display: grid; grid-template-columns: repeat(4, minmax(240px, 1fr)); gap: 12px; overflow-x: auto; padding-bottom: 8px; }
.col { background: var(--surface-2); border-radius: var(--radius); padding: 10px; min-height: 200px; }
.col.drop { outline: 2px dashed var(--accent); }
.col-h { display: flex; align-items: center; gap: 8px; padding: 2px 4px 10px; font-weight: 600; }
.kcard { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; margin-bottom: 8px; cursor: pointer; }
.kcard:hover { box-shadow: var(--shadow); }
.kcard[draggable="true"] { cursor: grab; }
.kcard .k-title { font-weight: 550; margin-bottom: 8px; }
.kcard .k-meta { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); flex-wrap: wrap; }

/* ---------- filters ---------- */
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.filters input, .filters select { width: auto; min-width: 140px; }
.filters input[type=search] { flex: 1; min-width: 180px; }

/* ---------- calendar ---------- */
.cal-head { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.cal-head h2 { min-width: 160px; }
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--line); gap: 1px; }
.cal .dow { background: var(--surface-2); padding: 6px 8px; font-size: 12px; font-weight: 600; color: var(--muted); }
.cal .day { background: var(--surface); min-height: 108px; padding: 6px; cursor: pointer; }
.cal .day.out { background: var(--bg); color: var(--faint); }
.cal .day.today .dn { background: var(--accent); color: var(--accent-ink); border-radius: 99px; }
.cal .dn { display: inline-grid; place-items: center; min-width: 24px; height: 24px; padding: 0 6px; font-size: 12.5px; font-weight: 600; margin-bottom: 4px; }
.cal .ev { display: block; font-size: 11.5px; padding: 2px 6px; border-radius: 5px; margin-bottom: 3px; background: var(--accent-2); border-left: 3px solid var(--c, var(--accent));
  color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; }
.cal .ev.done { opacity: .5; text-decoration: line-through; }
.cal .more { font-size: 11.5px; color: var(--muted); }
.agenda { display: none; }

/* ---------- reports ---------- */
.hbar { display: grid; grid-template-columns: 140px 1fr 48px; gap: 10px; align-items: center; margin-bottom: 10px; }
.hbar .track { display: flex; height: 14px; border-radius: 4px; overflow: hidden; background: var(--surface-2); }
.hbar .track i { display: block; height: 100%; width: var(--w); }
.seg-done { background: var(--ok); } .seg-review { background: var(--warn); } .seg-in_progress { background: var(--info); } .seg-todo { background: var(--line-2); }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--muted); margin-bottom: 14px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }

/* ---------- modal / drawer ---------- */
.overlay { position: fixed; inset: 0; background: rgba(20,19,17,.45); z-index: 50; display: flex; justify-content: center; align-items: flex-start; padding: 6vh 16px; overflow-y: auto; }
.modal { background: var(--surface); border-radius: 14px; width: 100%; max-width: 520px; box-shadow: var(--shadow); border: 1px solid var(--line); }
.modal.wide { max-width: 860px; }
.modal-h { display: flex; align-items: center; gap: 8px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.modal-h h2 { flex: 1; }
.modal-b { padding: 18px 20px; }
.modal-f { display: flex; gap: 8px; justify-content: flex-end; padding: 14px 20px; border-top: 1px solid var(--line); }
.x { border: 0; background: none; font-size: 22px; line-height: 1; padding: 4px 8px; color: var(--muted); }
.tdetail { display: grid; grid-template-columns: 1fr 240px; gap: 24px; }
.tdetail .desc { white-space: pre-wrap; margin: 0 0 18px; }
.props { display: grid; gap: 12px; align-content: start; }
.props .field { margin: 0; }
.comment { display: flex; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.comment .body { flex: 1; min-width: 0; word-wrap: break-word; }
.comment .ctext { white-space: pre-wrap; margin-top: 2px; }
.files { list-style: none; padding: 0; margin: 0 0 8px; }
.files li { display: flex; align-items: center; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.files li a { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dropzone { border: 1.5px dashed var(--line-2); border-radius: 8px; padding: 12px; text-align: center; color: var(--muted); cursor: pointer; }
.dropzone.drag { border-color: var(--accent); background: var(--accent-2); }

/* ---------- notifications ---------- */
.bell { position: relative; }
.bell .badge { position: absolute; top: -4px; right: -4px; background: var(--bad); color: #fff; font-size: 10.5px; font-weight: 700; border-radius: 99px; min-width: 18px; height: 18px; display: grid; place-items: center; padding: 0 4px; }
.npanel { position: absolute; right: 20px; top: 58px; width: 360px; max-width: calc(100vw - 24px); max-height: 70vh; overflow-y: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); z-index: 30; }
.npanel .nh { display: flex; align-items: center; padding: 12px 14px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--surface); }
.nitem { display: flex; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--line); cursor: pointer; }
.nitem:hover { background: var(--surface-2); }
.nitem.unread { background: var(--accent-2); }
.nitem .ico { font-size: 16px; line-height: 1.3; }

/* ---------- login ---------- */
.login { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.login .card { width: 100%; max-width: 380px; padding: 28px; box-shadow: var(--shadow); }
.login .brand { padding: 0 0 20px; justify-content: center; font-size: 20px; }
.err { background: var(--bad-bg); color: var(--bad); padding: 8px 12px; border-radius: 8px; margin-bottom: 12px; font-size: 13px; }
.note { background: var(--info-bg); color: var(--info); padding: 10px 12px; border-radius: 8px; font-size: 13px; margin-bottom: 14px; }

/* ---------- toast ---------- */
#toast-root { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); z-index: 100; display: grid; gap: 8px; }
.toast { background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: 10px; box-shadow: var(--shadow); font-weight: 550; animation: pop .2s ease; }
.toast.bad { background: var(--bad); color: #fff; }
@keyframes pop { from { opacity: 0; transform: translateY(6px); } }
@media (prefers-reduced-motion: reduce) { .toast { animation: none; } }

/* ---------- mobile ---------- */
@media (max-width: 900px) {
  .dash { grid-template-columns: 1fr; }
  .tdetail { grid-template-columns: 1fr; }
  .props { grid-template-columns: 1fr 1fr; order: -1; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
}
@media (max-width: 760px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; left: 0; top: 0; width: 260px; z-index: 40; transform: translateX(-100%); transition: transform .2s; box-shadow: var(--shadow); }
  .side.open { transform: none; }
  .scrim { position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 35; }
  .menu-btn { display: inline-flex; }
  .top { padding: 10px 16px; }
  .content { padding: 16px 16px 80px; }
  h1 { font-size: 18px; }
  .board { grid-template-columns: repeat(4, 82vw); scroll-snap-type: x mandatory; }
  .col { scroll-snap-align: start; }
  .cal { display: none; }
  .agenda { display: block; }
  .grid2 { grid-template-columns: 1fr; }
  .trow { flex-wrap: wrap; }
  .trow .t-title { flex-basis: calc(100% - 20px); }
  .trow .t-meta { justify-content: flex-start; padding-left: 19px; }
  .hbar { grid-template-columns: 90px 1fr 36px; }
  .overlay { padding: 0; align-items: flex-start; }   /* the window grows with its content (stretch kept it one screen tall) */
  .modal, .modal.wide { max-width: none; border-radius: 0; min-height: 100vh; }
  .hide-m { display: none; }
}

/* ---------- requests & timeline ---------- */
.nav .count { margin-left: auto; font-size: 11px; font-weight: 700; background: var(--bad); color: #fff; border-radius: 99px; min-width: 18px; padding: 0 6px; text-align: center; }
.reqnote { display: flex; align-items: center; gap: 8px; color: var(--info); text-decoration: none; }
.reqnote:hover { text-decoration: none; filter: brightness(.97); }
.rqlist { list-style: none; margin: 0; padding: 0; }
.rq { display: flex; gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.rq:last-child { border-bottom: 0; }
.rq-body { flex: 1; min-width: 0; display: grid; gap: 4px; }
.rq-title { overflow-wrap: anywhere; }
.rq-desc { margin: 2px 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.rq-actions { margin-top: 4px; }
.dot.inline { display: inline-block; width: 8px; height: 8px; margin: 0 4px 0 0; vertical-align: 0; }
.ok-text { color: var(--ok); font-weight: 600; }
.timeline { list-style: none; margin: 0; padding: 0 0 0 14px; border-left: 2px solid var(--line); display: grid; gap: 10px; }
.timeline li { position: relative; }
.timeline li::before { content: ""; position: absolute; left: -20px; top: 5px; width: 10px; height: 10px; border-radius: 50%; background: var(--surface); border: 2px solid var(--line-2); }
.timeline li.on::before { background: var(--accent); border-color: var(--accent); }
.history { list-style: none; margin: 0; padding: 0; font-size: 12.5px; }
.history li { display: grid; grid-template-columns: 150px 1fr; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.history .when { color: var(--faint); font-variant-numeric: tabular-nums; }
@media (max-width: 760px) { .history li { grid-template-columns: 1fr; gap: 0; } }
/* task rows keep room for the title; details wrap onto a second line in narrow cards */
.trow { flex-wrap: wrap; row-gap: 4px; }
.trow .t-title { flex: 1 1 160px; }
.trow .t-meta { margin-left: auto; }
.filters .check input { min-width: 0; }

/* reminder schedule */
.remtable td { padding: 8px 10px; }
.remtable select, .remtable input { width: auto; }
.remtable .rm-n { width: 76px; }
.remtable .rm-every { gap: 6px; flex-wrap: nowrap; }
[hidden] { display: none !important; }
#rem-card .row select { width: auto; }

/* ---------- phone navigation: bottom tab bar + round add button ---------- */
:root { --bar-bg: rgba(255,255,255,.86); --bar-line: rgba(0,0,0,.07); --bar-shadow: 0 8px 28px rgba(20,19,17,.18); --fab-shadow: 0 8px 22px rgba(67,56,202,.45), 0 2px 6px rgba(0,0,0,.18); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --bar-bg: rgba(40,39,36,.82); --bar-line: rgba(255,255,255,.08); --bar-shadow: 0 8px 28px rgba(0,0,0,.5); --fab-shadow: 0 8px 22px rgba(0,0,0,.55); } }
:root[data-theme="dark"] { --bar-bg: rgba(40,39,36,.82); --bar-line: rgba(255,255,255,.08); --bar-shadow: 0 8px 28px rgba(0,0,0,.5); --fab-shadow: 0 8px 22px rgba(0,0,0,.55); }
.tabbar, .fab { display: none; }
@media (max-width: 760px) {
  .tabbar { display: flex; position: fixed; z-index: 30; left: max(12px, env(safe-area-inset-left)); right: max(12px, env(safe-area-inset-right));
    bottom: calc(12px + env(safe-area-inset-bottom)); justify-content: space-around; align-items: center; padding: 7px 6px; border-radius: 30px;
    background: var(--bar-bg); -webkit-backdrop-filter: blur(18px) saturate(1.4); backdrop-filter: blur(18px) saturate(1.4);
    border: 1px solid var(--bar-line); box-shadow: var(--bar-shadow); }
  .tabbar a { position: relative; flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 7px 2px;
    border-radius: 22px; color: var(--muted); font-size: 11.5px; font-weight: 600; line-height: 1; text-decoration: none; }
  .tabbar a:hover { text-decoration: none; }
  .tabbar a.on { background: var(--accent-2); color: var(--accent); }
  .tabbar a span:not(.tcount) { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
  .tabbar .tcount { position: absolute; top: 0; left: calc(50% + 5px); min-width: 20px; height: 20px; padding: 0 5px; border-radius: 99px;
    background: var(--bad); color: #fff; font-size: 11px; font-weight: 700; line-height: 16px; text-align: center; border: 2px solid var(--surface); }
  .fab { display: grid; place-items: center; position: fixed; z-index: 31; width: 60px; height: 60px; padding: 0; border-radius: 50%; border: 0;
    right: max(20px, env(safe-area-inset-right)); bottom: calc(100px + env(safe-area-inset-bottom));
    background: var(--accent); color: var(--accent-ink); box-shadow: var(--fab-shadow); }
  .fab:hover { background: var(--accent); filter: brightness(1.08); }
  .fab.hidden { display: none !important; }
  #actions .fab-src { display: none; }                 /* the + moves from the top bar to the round button */
  .nav a[data-nav=dashboard], .nav a[data-nav=tasks], .nav a[data-nav=requests], .nav a[data-nav=work] { display: none; }
  .content { padding-bottom: calc(170px + env(safe-area-inset-bottom)) !important; }
  #toast-root { bottom: calc(104px + env(safe-area-inset-bottom)); }
}

/* files on work reports */
.rfiles { display: flex; flex-wrap: wrap; gap: 6px; margin: 2px 0 4px; }
.rfile { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; padding: 4px 10px; border-radius: 99px; background: var(--surface-2); border: 1px solid var(--line); font-size: 12.5px; color: var(--text); }
.rfile:hover { text-decoration: none; border-color: var(--accent); }
.rfile span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 220px; }
.rfile small { color: var(--muted); }
#wf-pending .pf { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* photo viewer */
.pv { position: fixed; inset: 0; z-index: 80; background: #0d0d0d; display: flex; flex-direction: column; }
.pv-bar { display: flex; align-items: center; gap: 8px; padding: 10px 12px; padding-top: max(10px, env(safe-area-inset-top)); color: #fff; }
.pv-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.pv-btn { display: inline-flex; align-items: center; gap: 6px; background: rgba(255,255,255,.12); color: #fff; border: 0; border-radius: 99px; padding: 8px 14px; font-size: 14px; cursor: pointer; text-decoration: none; }
.pv-btn:hover { background: rgba(255,255,255,.22); text-decoration: none; }
#pv-x { font-size: 22px; line-height: 1; padding: 6px 14px; }
.pv-body { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; padding: 8px 8px max(8px, env(safe-area-inset-bottom)); }
.pv-body img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 4px; }
.pv-err { color: #ddd; }
.files li .thumb { flex: 0 0 auto; }
.files li .thumb img { width: 40px; height: 40px; object-fit: cover; border-radius: 6px; display: block; border: 1px solid var(--line); }
.rfile img { width: 20px; height: 20px; object-fit: cover; border-radius: 4px; margin-left: -4px; }

/* team requests filter */
.seg { display: inline-flex; background: var(--surface-2); border: 1px solid var(--line); border-radius: 99px; padding: 2px; }
.seg button { border: 0; background: none; border-radius: 99px; padding: 4px 12px; font-size: 13px; cursor: pointer; color: var(--muted); }
.seg button.on { background: var(--surface); color: var(--text); box-shadow: 0 1px 2px rgba(0,0,0,.08); }

/* page-switch loading bar */
body.navloading #view { opacity: .5; transition: opacity .15s .05s; pointer-events: none; }
body.navloading::before { content: ''; position: fixed; top: 0; left: 0; z-index: 90; height: 3px; width: 40%;
  background: var(--accent, #4338ca); border-radius: 0 3px 3px 0; animation: navbar 1s ease-in-out infinite; }
@keyframes navbar { 0% { left: -40%; } 100% { left: 100%; } }
@media (prefers-reduced-motion: reduce) { body.navloading::before { animation: none; width: 100%; opacity: .6; } }

/* clearer edit buttons */
.editbtn { display: inline-flex; align-items: center; gap: 5px; }

/* Long words (photo file names, links) wrap inside their card instead of making the page wider than the
   phone. Grid columns may shrink below their content, and iPhone must not enlarge text on its own. */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
.dash > *, .cards > *, .grid2 > *, .stats > *, .card { min-width: 0; }
.card, .comment .body, .rq-body, .modal-b, .note { overflow-wrap: anywhere; }
@media (max-width: 760px) { .dash, .grid2 { grid-template-columns: minmax(0, 1fr); } }
.tdetail { grid-template-columns: minmax(0, 1fr) 240px; }
.tdetail > *, .props > * { min-width: 0; }
@media (max-width: 760px) { .tdetail { grid-template-columns: minmax(0, 1fr); } .props { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }

/* "I received a Warehouse order" in work reports */
.rcbox { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; margin: 4px 0 12px; background: var(--surface-2); }
.rcbox .check { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; }
.rcbox .check input { margin-top: 4px; width: 18px; height: 18px; flex: 0 0 auto; }
#rc-body { margin-top: 12px; }
.rclines { display: grid; gap: 8px; }
.rcline { display: grid; grid-template-columns: minmax(0, 1fr) 90px auto 110px; gap: 8px; align-items: center; }
.rcline .rcname { min-width: 0; overflow-wrap: anywhere; }
.rcline .rcname .small { display: block; }
@media (max-width: 560px) { .rcline { grid-template-columns: minmax(0, 1fr) 84px auto; } .rcline [data-rcr] { grid-column: 1 / -1; } }
.rcpt { display: flex; gap: 8px; align-items: flex-start; margin: 6px 0; padding: 8px 10px; border-radius: 8px; background: var(--surface-2); border: 1px solid var(--line); }
.rcpt svg { flex: 0 0 auto; margin-top: 2px; color: var(--accent); }

/* ---------- chat ---------- */
.cx-page { max-width: 760px; }
.cx-search { display: flex; gap: 8px; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 0 12px; color: var(--muted); margin: 0 0 10px; }
.cx-search input { border: 0; background: none; padding: 11px 0; flex: 1; min-width: 0; box-shadow: none; outline: none; color: var(--text); font-size: 15px; }
.cx-chips { display: flex; gap: 8px; margin: 0 0 12px; overflow-x: auto; scrollbar-width: none; }
.cx-chip { padding: 6px 14px; border-radius: 99px; border: 1px solid var(--line); background: var(--surface); font-size: 14px; color: var(--muted); white-space: nowrap; }
.cx-chip.on { background: var(--accent-2); color: var(--accent); border-color: transparent; font-weight: 600; }
.cx-list { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.cx-list > li + li { border-top: 1px solid var(--line); }
.cx-list .empty { padding: 28px 16px; }
.cx-row { display: flex; gap: 12px; align-items: center; padding: 12px 14px; color: var(--text); text-decoration: none; }
.cx-row:hover { background: var(--surface-2); text-decoration: none; }
.cx-avw { position: relative; flex: 0 0 auto; display: inline-flex; }
.cx-av { width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; color: #fff; background: var(--c, #64748b); font-size: 16px; flex: 0 0 auto; }
.cx-av.sm { width: 40px; height: 40px; font-size: 14px; } .cx-av.lg { width: 84px; height: 84px; font-size: 28px; }
.dot-on { position: absolute; right: 1px; bottom: 1px; width: 12px; height: 12px; border-radius: 50%; background: #22c55e; border: 2px solid var(--surface); }
.cx-mid { flex: 1; min-width: 0; display: block; }
.cx-top { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.cx-name { font-weight: 600; font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.cx-tag { font-size: 11px; padding: 1px 7px; border-radius: 99px; background: var(--surface-2); color: var(--muted); margin-left: 6px; font-weight: 500; vertical-align: 2px; }
.cx-time { font-size: 12px; color: var(--muted); flex: 0 0 auto; } .cx-time.new { color: var(--accent); font-weight: 650; }
.cx-last { display: flex; align-items: center; gap: 6px; margin-top: 3px; font-size: 14px; color: var(--muted); min-width: 0; }
.cx-lt { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cx-badge { background: var(--accent); color: var(--accent-ink); border-radius: 99px; min-width: 21px; height: 21px; padding: 0 6px; font-size: 12px; font-weight: 700; display: grid; place-items: center; flex: 0 0 auto; }
.cx-mute { color: var(--muted); display: inline-flex; }
.typing-t { color: #16a34a; font-style: italic; }
.tick { color: var(--muted); font-weight: 700; letter-spacing: -3px; margin-right: 5px; font-size: 12px; } .tick.read { color: #3b9ee8; }
.cx-opt { display: flex; gap: 12px; align-items: center; width: 100%; border: 0; background: none; padding: 6px 0 12px; font-weight: 600; font-size: 15px; color: var(--text); }
.cx-opt .k { width: 42px; height: 42px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; }
.cx-lbl { display: flex; justify-content: space-between; align-items: center; font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; margin: 10px 0 4px; }
.cx-people { list-style: none; margin: 0; padding: 0; max-height: 52vh; overflow: auto; }
.cx-people button, .cx-people label, .cx-people .pp { display: flex; gap: 12px; align-items: center; width: 100%; padding: 8px 2px; border: 0; background: none; text-align: left; color: var(--text); }
.cx-people button:hover { background: var(--surface-2); border-radius: 10px; }
.cx-people small { display: block; color: var(--muted); font-size: 13px; }
.cx-people span:not(.cx-av):not(.cx-avw):not(.dot-on):not(.k) { min-width: 0; flex: 1; }
.cx-people .pick input, .cx-people.pick input { width: 20px; height: 20px; flex: 0 0 auto; }
.cx-people .k.task { width: 36px; height: 36px; border-radius: 9px; background: var(--accent-2); color: var(--accent); display: grid; place-items: center; flex: 0 0 auto; }
.pp-a { display: flex; gap: 2px; flex: 0 0 auto !important; }
.cx-info { text-align: center; margin-bottom: 8px; } .cx-info .cx-av { margin: 0 auto 8px; } .cx-info h3 { margin: 0; }
.cx-mute-row { margin: 12px 0; } .cx-leave { width: 100%; margin-top: 14px; }
.cx-actions { display: flex; flex-direction: column; }
.cx-actions > * { display: flex; gap: 12px; align-items: center; padding: 12px 4px; border: 0; background: none; font-size: 15px; color: var(--text); text-align: left; border-radius: 10px; }
.cx-actions > *:hover { background: var(--surface-2); text-decoration: none; }
.cx-actions .danger { color: var(--danger, #dc2626); }
.cx-actions.grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.cx-actions.grid > * { flex-direction: column; font-size: 13px; text-align: center; padding: 10px 2px; }
.cx-actions.grid .k { width: 52px; height: 52px; border-radius: 50%; color: #fff; display: grid; place-items: center; }

/* conversation */
.cv { display: flex; flex-direction: column; height: calc(100vh - 140px); height: calc(100dvh - 140px); max-width: 860px; background: var(--bg); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.cv-h { display: flex; align-items: center; gap: 6px; padding: 8px 10px; background: var(--surface); border-bottom: 1px solid var(--line); flex: 0 0 auto; }
.cv-back { display: none; color: var(--accent); padding: 4px; }
.cv-who { display: flex; align-items: center; gap: 10px; border: 0; background: none; padding: 2px 4px; flex: 1; min-width: 0; text-align: left; color: var(--text); }
.cv-who .cx-av { width: 40px; height: 40px; font-size: 14px; }
.cv-names { min-width: 0; } .cv-names b { display: block; font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cv-names small { display: block; color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cv-menu { color: var(--muted); }
.cv-b { flex: 1; overflow-y: auto; padding: 10px 12px 6px; display: flex; flex-direction: column; overscroll-behavior: contain;
  background-image: radial-gradient(color-mix(in srgb, var(--line) 75%, transparent) 1px, transparent 1px); background-size: 18px 18px; }
#cv-list { display: flex; flex-direction: column; gap: 4px; } #cv-more { text-align: center; }
.cv-b .day { align-self: center; background: var(--surface); border: 1px solid var(--line); color: var(--muted); font-size: 12px; padding: 3px 10px; border-radius: 8px; margin: 8px 0 4px; }
.cv-b .sys { align-self: center; text-align: center; background: var(--accent-2); color: var(--muted); font-size: 12.5px; padding: 4px 10px; border-radius: 8px; margin: 4px 16px; max-width: 90%; }
.m { max-width: min(80%, 520px); padding: 6px 9px 4px; border-radius: 12px; font-size: 15px; line-height: 1.38; box-shadow: 0 1px 1px rgba(0,0,0,.06); overflow-wrap: anywhere; cursor: pointer; outline: none; transition: background .3s; }
.m.in { align-self: flex-start; background: var(--surface); border-top-left-radius: 4px; }
.m.out { align-self: flex-end; background: color-mix(in srgb, var(--accent) 15%, var(--surface)); border-top-right-radius: 4px; }
.m.flash { background: color-mix(in srgb, var(--accent) 30%, var(--surface)); }
.m .who { font-size: 13px; font-weight: 700; margin-bottom: 1px; }
.m .txt { white-space: pre-wrap; } .m .txt a { color: var(--accent); text-decoration: underline; }
.m .meta { display: flex; justify-content: flex-end; align-items: center; gap: 3px; font-size: 11px; color: var(--muted); margin-top: 1px; white-space: nowrap; }
.m .meta .tick { margin-right: 0; margin-left: 2px; }
.m .gone { color: var(--muted); font-style: italic; display: inline-flex; gap: 5px; align-items: center; }
.m .quote, .cv-reply .quote { display: block; width: 100%; text-align: left; border: 0; border-left: 3px solid var(--accent); background: color-mix(in srgb, var(--accent) 9%, transparent); padding: 4px 8px; border-radius: 6px; font-size: 13px; color: var(--muted); margin: 2px 0 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.m .quote b, .cv-reply .quote b { color: var(--accent); display: block; font-size: 12px; }
.m .ph { display: block; margin: 2px -5px 4px; } .m .ph img { display: block; max-width: 100%; width: 260px; max-height: 340px; object-fit: cover; border-radius: 8px; }
.m .vid { display: block; width: 260px; max-width: 100%; max-height: 360px; border-radius: 8px; background: #000; margin: 2px -5px 2px; }
.m .dl { display: inline-flex; gap: 4px; align-items: center; }
.m .voice { display: flex; align-items: center; gap: 6px; color: var(--accent); } .m .voice audio { width: 210px; max-width: 58vw; height: 36px; }
.m .card { display: flex; gap: 9px; align-items: center; width: 100%; text-align: left; border: 1px solid var(--line); background: var(--surface); border-radius: 9px; padding: 8px; margin: 2px 0 4px; font-size: 13px; color: var(--text); text-decoration: none; }
.m .card .k { width: 34px; height: 34px; border-radius: 8px; background: var(--accent-2); color: var(--accent); display: grid; place-items: center; flex: 0 0 auto; font-size: 10px; font-weight: 800; }
.m .card.file .k { background: #fde2e1; color: #b42318; }
.m .card b { display: block; overflow-wrap: anywhere; } .m .card small { color: var(--muted); display: block; }
.m.sending { opacity: .85; cursor: default; } .m .bar { height: 4px; background: var(--line); border-radius: 4px; overflow: hidden; margin: 6px 0 2px; width: 180px; max-width: 100%; }
.m .bar i { display: block; height: 100%; background: var(--accent); transition: width .2s; }
.ment { color: var(--accent); font-weight: 600; }
.typing-b { align-self: flex-start; background: var(--surface); border-radius: 12px; padding: 9px 12px; margin-top: 4px; box-shadow: 0 1px 1px rgba(0,0,0,.06); }
.dots { display: inline-flex; gap: 4px; } .dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); animation: cxdot 1.2s infinite; }
.dots i:nth-child(2) { animation-delay: .2s; } .dots i:nth-child(3) { animation-delay: .4s; }
@keyframes cxdot { 0%, 60%, 100% { opacity: .3; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-3px); } }
@media (prefers-reduced-motion: reduce) { .dots i { animation: none; } }
.cv-reply { display: flex; align-items: center; gap: 6px; padding: 6px 10px 0; background: var(--surface); border-top: 1px solid var(--line); }
.cv-reply .quote { flex: 1; min-width: 0; margin: 0; }
.cv-f { display: flex; gap: 8px; align-items: flex-end; padding: 8px 10px; background: var(--surface); border-top: 1px solid var(--line); flex: 0 0 auto; }
.cv-reply:not(.hidden) + .cv-f { border-top: 0; }
.cv-in { flex: 1; min-width: 0; display: flex; align-items: flex-end; gap: 2px; background: var(--bg); border: 1px solid var(--line); border-radius: 22px; padding: 2px 4px; }
.cv-in textarea { flex: 1; min-width: 0; border: 0; background: none; resize: none; padding: 10px 4px; font-size: 16px; line-height: 1.3; max-height: 140px; box-shadow: none; outline: none; color: var(--text); }
.cv-ic { color: var(--muted); padding: 8px; display: inline-flex; cursor: pointer; }
.cv-send { width: 46px; height: 46px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; border: 0; flex: 0 0 auto; }
.cv-no { flex: 1; text-align: center; margin: 8px; }
.rec { flex: 1; display: flex; align-items: center; gap: 10px; background: var(--bg); border: 1px solid var(--line); border-radius: 22px; padding: 4px 12px 4px 4px; font-variant-numeric: tabular-nums; }
.rec .btn-ghost { color: var(--danger, #dc2626); }
.rec-dot { width: 11px; height: 11px; border-radius: 50%; background: #ef4444; animation: cxrec 1s infinite; }
@keyframes cxrec { 50% { opacity: .25; } }
/* on phones a chat fills the screen, like WhatsApp */
@media (max-width: 760px) {
  body.in-chat .top, body.in-chat .tabbar, body.in-chat .fab { display: none !important; }
  body.in-chat .content { padding: 0; }
  body.in-chat .cv { position: fixed; inset: 0; z-index: 30; height: auto; max-width: none; border: 0; border-radius: 0; }
  .cv-h { padding-top: max(8px, env(safe-area-inset-top)); }
  .cv-f { padding-bottom: max(8px, env(safe-area-inset-bottom)); }
  .cv-back { display: inline-flex; }
  .cx-page { max-width: none; }
}
.cv-in textarea { min-height: 0; height: 42px; }
.cv-send:hover, .cv-send:focus-visible { background: var(--accent); color: var(--accent-ink); filter: brightness(1.08); }
.cx-mute-row { align-items: flex-start; } .cx-mute-row input { margin-top: 3px; }
.cx-mute-row small { display: block; color: var(--muted); font-size: 12.5px; font-weight: 400; }

/* chat: press-and-hold menu, edited messages, message info */
.m { -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; }
.m .txt a { -webkit-touch-callout: default; }
.hm-shade { position: fixed; inset: 0; z-index: 90; background: rgba(15, 15, 25, .38); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); animation: hmfade .15s ease-out; }
.hm-pick { position: fixed; z-index: 91; margin: 0 !important; overflow: hidden; pointer-events: none; box-shadow: 0 10px 30px rgba(0, 0, 0, .25) !important; animation: hmlift .15s ease-out forwards; }
.hm-menu { position: fixed; z-index: 92; min-width: 230px; max-width: calc(100vw - 24px); background: var(--surface); border-radius: 14px; box-shadow: 0 12px 36px rgba(0, 0, 0, .28); overflow: hidden; animation: hmfade .15s ease-out; }
.hm-menu button { display: flex; justify-content: space-between; align-items: center; gap: 16px; width: 100%; padding: 13px 16px; border: 0; border-radius: 0; background: none; font-size: 16px; color: var(--text); text-align: left; }
.hm-menu button + button { border-top: 1px solid var(--line); }
.hm-menu button:hover, .hm-menu button:focus-visible { background: var(--surface-2); outline: none; }
.hm-menu svg { color: var(--muted); flex: 0 0 auto; }
.hm-menu .danger, .hm-menu .danger svg { color: var(--danger, #dc2626); }
@keyframes hmfade { from { opacity: 0; } }
@keyframes hmlift { to { transform: scale(1.03); } }
@media (prefers-reduced-motion: reduce) { .hm-shade, .hm-pick, .hm-menu { animation: none; } }
.m .edited { font-style: italic; margin-right: 4px; }
.mi-prev { display: flex; flex-direction: column; padding: 12px; margin: -4px 0 10px; border-radius: 12px; background-color: var(--bg);
  background-image: radial-gradient(color-mix(in srgb, var(--line) 75%, transparent) 1px, transparent 1px); background-size: 18px 18px; }
.mi-prev .m { cursor: default; max-width: 90%; }
.cx-lbl .tick { margin-right: 6px; }
/* chat videos: a preview with ▶ (tap = full screen, hold = menu) */
.m .vthumb { position: relative; display: block; width: 260px; max-width: 100%; margin: 2px -5px 2px; padding: 0; border: 0; border-radius: 8px; overflow: hidden; background: #000; cursor: pointer; }
.m .vthumb video { display: block; width: 100%; max-height: 360px; object-fit: cover; pointer-events: none; }
.m .vthumb .vplay { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 56px; height: 56px; border-radius: 50%; background: rgba(0, 0, 0, .55); color: #fff; display: grid; place-items: center; }
.m .vthumb .vplay svg { margin-left: 3px; }
.m .vthumb .vdur { position: absolute; left: 8px; bottom: 6px; color: #fff; font-size: 12px; text-shadow: 0 1px 2px rgba(0, 0, 0, .7); }
.pv-body video { max-width: 100%; max-height: 100%; border-radius: 4px; background: #000; }
/* voice messages: ▶, a bar, the time */
.m .voice { display: flex; align-items: center; gap: 10px; width: 230px; max-width: 62vw; padding: 2px 0; }
.m .vp-btn { width: 38px; height: 38px; border-radius: 50%; border: 0; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; flex: 0 0 auto; padding: 0; }
.m .vp-btn:hover { background: var(--accent); filter: brightness(1.08); }
.m .vp-bar { flex: 1; height: 4px; border-radius: 4px; background: color-mix(in srgb, var(--muted) 35%, transparent); position: relative; cursor: pointer; padding: 8px 0; background-clip: content-box; }
.m .vp-bar i { position: absolute; left: 0; top: 8px; height: 4px; width: 0; border-radius: 4px; background: var(--accent); }
.m .vp-t { color: var(--muted); font-variant-numeric: tabular-nums; min-width: 32px; text-align: right; }
.m .voice audio { display: none; }

/* Videos on tasks and work reports: a small still with ▶; tapping opens the full-screen player. */
.fvid { position: relative; display: block; width: 40px; height: 40px; border-radius: 6px; overflow: hidden; background: #000; border: 1px solid var(--line); }
.fvid video { width: 100%; height: 100%; object-fit: cover; display: block; pointer-events: none; }
.fvid .fplay { position: absolute; inset: 0; display: grid; place-items: center; color: #fff; background: rgba(0, 0, 0, .3); }
.fvid .fplay svg { margin-left: 2px; }
.rfile .fvid { width: 20px; height: 20px; border-radius: 4px; margin-left: -4px; border: 0; flex: 0 0 auto; }
.rfile .fvid .fplay svg { width: 10px; height: 10px; margin-left: 1px; }

/* @mention name list */
.mention-host { position: relative; }
.mention-box { position: absolute; z-index: 60; left: 8px; bottom: calc(100% + 6px); width: 320px; max-width: calc(100% - 16px); max-height: min(260px, 40vh); margin: 0; padding: 4px; list-style: none; overflow-y: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 8px 28px rgba(0, 0, 0, .18); }
.mention-box li { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; cursor: pointer; font-size: 14.5px; color: var(--text); }
.mention-box li.on, .mention-box li:hover { background: var(--surface-2); }
.ctext .ment { color: var(--accent); font-weight: 600; }

/* Support page */
.sup { max-width: 860px; margin: 0 auto; display: flex; flex-direction: column; gap: 14px; }
.sup-ask { display: flex; flex-direction: column; gap: 12px; }
.sup-head { display: flex; gap: 12px; align-items: flex-start; color: var(--accent); }
.sup-head h2 { margin: 0 0 2px; color: var(--text); }
.sup-head p { margin: 0; }
.sup-f { display: flex; gap: 8px; }
.sup-f input { flex: 1; min-width: 0; }
.sup-chips, .sup-links { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 99px; border: 1px solid var(--line); background: var(--bg); color: var(--text); font-size: 13px; font-weight: 500; cursor: pointer; text-align: left; min-height: 0; max-width: 100%; white-space: normal; line-height: 1.3; }
.chip svg { flex: 0 0 auto; }
.chip:hover { border-color: var(--accent); color: var(--accent); }
.sup-log { display: flex; flex-direction: column; gap: 10px; }
.sup-log:empty { display: none; }
.sup-msg { max-width: 92%; padding: 10px 14px; border-radius: 16px; line-height: 1.5; overflow-wrap: anywhere; }
.sup-msg p { margin: 0 0 6px; } .sup-msg p:last-child { margin-bottom: 0; }
.sup-msg ol, .sup-msg ul { margin: 4px 0 8px; padding-left: 22px; }
.sup-msg.me { align-self: flex-end; background: var(--accent); color: #fff; border-bottom-right-radius: 4px; }
.sup-msg.bot { align-self: flex-start; background: var(--bg); border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.sup-msg .sup-links { margin-top: 8px; }
.sup-h { margin: 6px 2px 0; font-size: 16px; }
.sup-list { display: flex; flex-direction: column; gap: 8px; }
.sup-topic { padding: 0; }
.sup-topic summary { list-style: none; display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; cursor: pointer; }
.sup-topic summary::-webkit-details-marker { display: none; }
.sup-topic summary > span:last-child { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.sup-ic { flex: 0 0 auto; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: var(--accent-2); color: var(--accent); }
.sup-topic[open] summary { border-bottom: 1px solid var(--line); }
.sup-body { padding: 12px 16px 16px 62px; line-height: 1.55; }
.sup-body p { margin: 0 0 8px; }
.sup-body ol { margin: 0 0 10px; padding-left: 20px; }
.sup-body li { margin-bottom: 4px; }
.sup-ex { padding: 10px 12px; border-radius: 10px; background: var(--accent-2); border-left: 3px solid var(--accent); }
@media (max-width: 700px) { .sup-body { padding-left: 16px; } .sup-f .btn-primary { padding-left: 14px; padding-right: 14px; } }
.sup-how { display: flex; gap: 18px; align-items: flex-start; }
.sup-how > div { flex: 1; min-width: 0; }
.sup-shot { margin: 0 0 10px; flex: 0 0 220px; }
.sup-shot img { display: block; width: 100%; height: auto; aspect-ratio: 390 / 760; border-radius: 14px; border: 1px solid var(--line); box-shadow: 0 4px 14px rgba(0,0,0,.08); background: var(--bg); }
.sup-shot figcaption { margin-top: 6px; line-height: 1.35; }
.sup-shot.small { max-width: 200px; margin-top: 8px; }
@media (max-width: 700px) { .sup-how { flex-direction: column; gap: 4px; } .sup-shot { flex: none; width: min(260px, 100%); align-self: center; } }
