/* Wata - WhatsApp dark, as close as CSS gets. */
:root{
  --bg:#0b141a;            /* chat wallpaper base */
  --header:#202c33;        /* top bar + composer bar */
  --in:#202c33;            /* incoming bubble */
  --out:#005c4b;           /* outgoing bubble */
  --panel:#111b21;         /* lists, cards */
  --panel2:#202c33;
  --line:#222d34;
  --ink:#e9edef;
  --ink2:#8696a0;
  --ink3:#667781;
  --accent:#00a884;        /* WhatsApp green */
  --tick:#53bdeb;          /* read ticks */
  --link:#53bdeb;
  --open:#8696a0; --doing:#ffab00; --blocked:#f15c6d; --done:#00a884;
  --safe-b:env(safe-area-inset-bottom,0px);
  --safe-t:env(safe-area-inset-top,0px);
}
*{box-sizing:border-box}
html,body{height:100%}
body{margin:0;background:var(--bg);color:var(--ink);
  font:15px/1.4 -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",sans-serif;
  -webkit-font-smoothing:antialiased;overscroll-behavior-y:none}
button,textarea,input,select{font:inherit;color:inherit}
textarea{scrollbar-width:none}
textarea::-webkit-scrollbar{display:none}
button{cursor:pointer;border:0;background:none}
[hidden]{display:none!important}
.muted{color:var(--ink2)}
.err{color:var(--blocked);font-size:13px;margin:6px 0 0}
.offscreen{position:absolute;left:-9999px;width:1px;height:1px;opacity:0}

/* ---------- sign in ---------- */
.signin{min-height:100%;display:grid;place-items:center;padding:24px;background:var(--panel)}
.signin-card{width:100%;max-width:360px}
.brand{display:flex;align-items:center;gap:12px}
.brand h1{font-size:24px;margin:0;font-weight:600}
.brand-mark{width:44px;height:44px;border-radius:50%;background:var(--accent);color:#0b141a;
  display:grid;place-items:center;font-weight:700;font-size:20px}
.brand-mark.sm{width:34px;height:34px;font-size:15px}
.signin p{color:var(--ink2);margin:8px 0 0;font-size:14px}
.signin label{display:block;margin:20px 0 0;font-size:12.5px;color:var(--accent);font-weight:500}
.signin input{display:block;width:100%;margin-top:4px;padding:10px 2px;background:none;
  border:0;border-bottom:2px solid var(--accent);border-radius:0;color:var(--ink);font-size:16px}
.signin input:focus{outline:none}
.btn{padding:11px 20px;border-radius:24px;background:var(--panel2);color:var(--ink)}
.btn.primary{background:var(--accent);color:#0b141a;font-weight:600}
.btn.block{width:100%;margin-top:26px}
.btn.sm{padding:7px 14px;font-size:13px;border-radius:18px}

/* ---------- chat chrome ---------- */
#app{display:flex;flex-direction:column;height:100dvh}
.topbar{display:flex;align-items:center;justify-content:space-between;gap:10px;
  padding:calc(8px + var(--safe-t)) 12px 8px;background:var(--header);z-index:5;flex:none}
.topbar-left{display:flex;align-items:center;gap:11px;min-width:0}
.topbar h2{margin:0;font-size:16.5px;font-weight:600;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.topbar .sub{font-size:12.5px;color:var(--ink2);white-space:nowrap;overflow:hidden;
  text-overflow:ellipsis;margin-top:1px}
.topbar-right{display:flex;align-items:center;gap:4px;flex:none}
.icon-btn{width:38px;height:38px;border-radius:50%;display:grid;place-items:center;
  font-size:17px;color:var(--ink2)}
.icon-btn:active{background:#ffffff14}
.icon-btn.on{color:var(--accent)}
.chip{padding:5px 11px;border-radius:14px;background:#ffffff14;font-size:12px;white-space:nowrap}
/* The three screens sit side by side and snap, so a swipe follows your finger
   instead of being guessed at from touch events. */
.pages{flex:1;min-height:0;display:flex;overflow-x:auto;overflow-y:hidden;
  scroll-snap-type:x mandatory;overscroll-behavior-x:contain;
  -webkit-overflow-scrolling:touch;scrollbar-width:none}
.pages::-webkit-scrollbar{display:none}
.view{flex:0 0 100%;width:100%;scroll-snap-align:start;scroll-snap-stop:always;
  min-height:0;display:flex;flex-direction:column;overflow:hidden}
/* vertical scrollers must not eat the horizontal gesture */
.chat,.index,.board,.team{overflow-x:hidden;overscroll-behavior-x:none}

/* bottom nav, WhatsApp-flavoured */
.tabs{display:grid;grid-template-columns:repeat(4,1fr);background:var(--header);
  padding-bottom:var(--safe-b);flex:none;border-top:1px solid #ffffff0d}
.tabs button{padding:9px 0 10px;font-size:11px;color:var(--ink2);display:grid;gap:3px;
  justify-items:center;position:relative}
.tabs button span{font-size:19px;line-height:1;opacity:.85}
.ti{width:24px;height:24px;fill:none;stroke:currentColor;stroke-width:1.8;
  stroke-linecap:round;stroke-linejoin:round;opacity:.9}
.tabs button.on .ti{opacity:1;stroke-width:2.1}
.gi{width:22px;height:22px;fill:none;stroke:currentColor;stroke-width:1.8;
  stroke-linecap:round;stroke-linejoin:round}
#whoami .gi circle{fill:currentColor;stroke:none}
.tabs button.on{color:var(--ink)}
.tabs button.on span{opacity:1}
.badge{position:absolute;top:3px;right:calc(50% - 24px);min-width:18px;height:18px;padding:0 5px;
  border-radius:9px;background:var(--accent);color:#0b141a;font-size:10.5px;font-style:normal;
  display:grid;place-items:center;font-weight:700}

/* ---------- the chat ---------- */
.chat{flex:1;overflow-y:auto;padding:10px 14px 8px;display:flex;flex-direction:column;
  justify-content:flex-end;gap:2px;
  /* the doodle wallpaper */
  background-color:var(--bg);
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300' viewBox='0 0 300 300'%3E%3Cg fill='none' stroke='%23ffffff' stroke-width='2' opacity='0.028'%3E%3Ccircle cx='40' cy='40' r='14'/%3E%3Cpath d='M100 28h34v26h-34z'/%3E%3Cpath d='M186 22l14 24h-28z'/%3E%3Cpath d='M244 30q12-14 24 0t-24 22q-24-8-24-22t24 0'/%3E%3Cpath d='M28 104h30l-6 24h-18z'/%3E%3Ccircle cx='108' cy='116' r='13'/%3E%3Cpath d='M92 116h32M108 100v32'/%3E%3Cpath d='M170 104l22 12-22 12z'/%3E%3Crect x='232' y='102' width='28' height='28' rx='6'/%3E%3Cpath d='M20 196q16-18 32 0t-32 0'/%3E%3Cpath d='M92 182h36v30H92zm8-10h20v10h-20z'/%3E%3Ccircle cx='186' cy='196' r='15'/%3E%3Cpath d='M180 196l5 6 9-11'/%3E%3Cpath d='M236 182v30h28'/%3E%3Cpath d='M34 258h28v26H34zm6-8h16v8H40'/%3E%3Ccircle cx='114' cy='270' r='12'/%3E%3Cpath d='M168 256l18 14-18 14z'/%3E%3Cpath d='M228 256q14 0 14 14t-14 14-14-14 14-14m0 0v28'/%3E%3C/g%3E%3C/svg%3E");
  background-repeat:repeat;background-size:150px 150px}
.day{align-self:center;font-size:12.5px;color:var(--ink2);background:#182229;
  padding:5px 12px;border-radius:8px;margin:8px 0 6px;font-weight:400;
  box-shadow:0 1px 1px #00000026}

.bubble{position:relative;max-width:min(82%,520px);border-radius:8px;padding:6px 8px 7px;
  text-align:left;width:auto;font-size:15px;box-shadow:0 1px .5px #0000004d;
  margin-top:2px}
.bubble.out{align-self:flex-end;background:var(--out);border-top-right-radius:8px;margin-right:2px}
.bubble.in{align-self:flex-start;background:var(--in);margin-left:2px}
.bubble.tail{margin-top:8px}
.bubble.out.tail{border-top-right-radius:0}
.bubble.in.tail{border-top-left-radius:0}
.bubble.out.tail::after{content:'';position:absolute;top:0;right:-8px;width:8px;height:13px;
  background:var(--out);clip-path:polygon(0 0,100% 0,0 100%)}
.bubble.in.tail::after{content:'';position:absolute;top:0;left:-8px;width:8px;height:13px;
  background:var(--in);clip-path:polygon(0 0,100% 0,100% 100%)}
.bubble-from{font-size:13.5px;font-weight:600;margin-bottom:2px}
.bubble-body{white-space:pre-wrap;word-break:break-word;line-height:1.35}
.men{color:#a7f3d0;font-weight:500}
/* time + ticks ride the last line, like WhatsApp */
.stamp{float:right;margin:10px -2px -4px 12px;font-size:11px;line-height:1;
  color:#ffffff8f;display:inline-flex;align-items:center;gap:3px;white-space:nowrap}
.bubble.in .stamp{color:var(--ink2)}
.ticks{width:15px;height:11px;display:block}
.ticks.two{width:19px}
.ticks path{fill:none;stroke:#ffffff8f;stroke-width:2.2;stroke-linecap:round;stroke-linejoin:round}
.ticks.read path{stroke:var(--tick)}

/* what we understood, shown under the message */
.readout{display:flex;align-items:center;gap:6px;width:100%;text-align:left;
  margin-top:5px;padding:5px 7px;border-radius:6px;background:#00000026;
  font-size:12px;color:#ffffffbf;line-height:1.3}
.bubble.in .readout{background:#ffffff0f}
.readout:active{background:#00000040}
.readout b{font-weight:600;color:#fff;flex:none}
.readout span{color:#ffffff8c}
.readout em{font-style:normal;color:#ffffffa6;overflow:hidden;text-overflow:ellipsis;
  white-space:nowrap;flex:1;min-width:0}
.readout.late span{color:#ffb3bb}
.readout .pip{width:7px;height:7px;border-radius:50%;background:var(--open);flex:none}
.readout .pip.doing{background:var(--doing)} .readout .pip.blocked{background:var(--blocked)}
.readout .pip.done{background:var(--done)}
.nb2{background:var(--accent);color:#0b141a;font-weight:700;font-size:10px;
  padding:1px 6px;border-radius:8px;flex:none}
.bubble-meta{display:flex;align-items:center;gap:5px;flex-wrap:wrap;margin-top:5px;
  padding-top:5px;border-top:1px solid #ffffff14}
.tag{font-size:11.5px;padding:2px 7px;border-radius:10px;background:#ffffff1a;color:#ffffffbf}
.tag.soft{background:none;padding:2px 0;color:#ffffff73}
.tag.due.late{background:#f15c6d33;color:#ffb3bb}
.bubble.in .tag{background:#ffffff14;color:var(--ink2)}
.who-dots{display:flex;gap:7px;flex-wrap:wrap}
.dot{display:inline-flex;align-items:center;gap:4px;font-size:12px;color:#ffffffd9}
.dot i{width:7px;height:7px;border-radius:50%;background:var(--open);display:inline-block;flex:none}
.dot.doing i{background:var(--doing)} .dot.blocked i{background:var(--blocked)}
.dot.done i{background:var(--done)}
.dot.done{opacity:.6;text-decoration:line-through}
.reading{font-size:12px;color:#ffffff8c;margin-top:4px;font-style:italic}
.reading.pending{margin-top:5px;animation:pulse 1.3s ease-in-out infinite}
@keyframes pulse{50%{opacity:.4}}
.bubble .nb{position:absolute;top:-5px;left:-5px;min-width:18px;height:18px;padding:0 5px;
  border-radius:9px;background:var(--accent);color:#0b141a;font-size:10.5px;font-weight:700;
  display:grid;place-items:center}
.empty{margin:auto;text-align:center;color:var(--ink2);font-size:13.5px;padding:24px;
  max-width:300px;background:#182229cc;border-radius:8px;line-height:1.5}
.empty b{color:var(--ink);display:block;margin-bottom:6px;font-size:15px}
.empty i{color:var(--ink2)}

/* ---------- composer ---------- */
.composer-wrap{background:var(--header);padding:6px 8px calc(8px + var(--safe-b));flex:none}
.composer{display:flex;align-items:flex-end;gap:7px}
.composer textarea{flex:1;max-height:120px;resize:none;padding:10px 14px;background:#2a3942;
  border:0;border-radius:22px;overflow-y:auto;font-size:16px;line-height:1.35;color:var(--ink)}
.composer textarea::placeholder{color:var(--ink3)}
.composer textarea:focus{outline:none}
.send{width:46px;height:46px;border-radius:50%;background:var(--accent);color:#0b141a;
  display:grid;place-items:center;font-size:19px;flex:none}
.send:disabled{opacity:.5}

/* ---------- board / lists ---------- */
.toolbar{display:flex;gap:6px;padding:8px 10px;background:var(--panel);overflow-x:auto;flex:none}
.toolbar.wrap{flex-wrap:wrap;overflow:visible;gap:5px;padding:7px 10px}
.toolbar:empty{display:none}
.seg{display:flex;background:#2a3942;border-radius:20px;padding:3px}
.seg button{padding:6px 13px;border-radius:17px;font-size:13px;color:var(--ink2);white-space:nowrap}
.seg button.on{background:var(--accent);color:#0b141a;font-weight:600}
.fchip{padding:5px 11px;border-radius:14px;background:#2a3942;font-size:12px;color:var(--ink2);
  white-space:nowrap}
.fchip.on{background:#0b3d33;color:#a7f3d0;font-weight:600}
.board{flex:1;overflow-y:auto;padding:8px 10px calc(16px + var(--safe-b));background:var(--panel)}
.grp{margin-bottom:14px}
.grp-h{display:flex;align-items:center;gap:9px;margin:0 2px 6px;font-size:13.5px;font-weight:600;
  position:sticky;top:0;background:var(--panel);padding:6px 0;z-index:2;color:var(--accent)}
.grp-h .n{font-weight:400;color:var(--ink3);font-size:12px}
.grp-h .bar{flex:1;height:1px;background:var(--line)}
.card{background:var(--panel2);border-radius:8px;padding:10px 12px;margin-bottom:7px;
  width:100%;text-align:left;display:block;box-shadow:0 1px .5px #0000004d}
.card.late{border-left:3px solid var(--blocked)}
.card.is-done{opacity:.5}
.card-top{display:flex;justify-content:space-between;gap:8px;align-items:flex-start}
.card-body{white-space:pre-wrap;word-break:break-word;flex:1;line-height:1.35}
.card-sub{display:flex;gap:5px;flex-wrap:wrap;align-items:center;margin-top:7px}
.st{font-size:10px;font-weight:700;letter-spacing:.04em;text-transform:uppercase;
  padding:3px 8px;border-radius:10px;flex:none}
.st.open{background:#8696a029;color:var(--ink2)}
.st.doing{background:#ffab0029;color:#ffc966}
.st.blocked{background:#f15c6d29;color:#ffb3bb}
.st.done{background:#00a88429;color:#7ee2c0}

/* ---------- team ---------- */
.team{flex:1;overflow-y:auto;padding:4px 0 calc(20px + var(--safe-b));background:var(--panel)}
.row{display:flex;align-items:center;gap:13px;padding:11px 16px}
.row+.row{border-top:1px solid var(--line)}
.row .grow{flex:1;min-width:0}
.row .nm{font-weight:400;font-size:16px}
.row .sub{font-size:13px;color:var(--ink2);margin-top:2px}
.avatar{width:44px;height:44px;border-radius:50%;background:#2a3942;display:grid;
  place-items:center;font-weight:600;font-size:15px;flex:none;color:var(--ink2)}
.sect-h{font-size:14px;color:var(--accent);margin:18px 16px 6px;font-weight:500}
.form-grid{display:grid;gap:10px;padding:12px 16px}
.form-grid input,.form-grid select{padding:11px 14px;background:#2a3942;border:0;
  border-radius:8px;width:100%;font-size:15px}
.form-grid input:focus,.form-grid select:focus{outline:1px solid var(--accent)}

/* ---------- thread sheet ---------- */
.sheet{position:fixed;inset:0;z-index:20;display:flex;align-items:flex-end}
.sheet-back{position:absolute;inset:0;background:#000000a6}
.sheet-card{position:relative;width:100%;max-width:640px;margin:0 auto;background:var(--bg);
  border-radius:12px 12px 0 0;display:flex;flex-direction:column;max-height:94dvh;
  animation:up .16s ease-out}
@keyframes up{from{transform:translateY(20px);opacity:.7}}
.sheet-head{display:flex;align-items:center;gap:8px;padding:8px 10px;background:var(--header);
  border-radius:12px 12px 0 0}
.sheet-head span{flex:1;font-weight:600;font-size:15px;overflow:hidden;text-overflow:ellipsis;
  white-space:nowrap}
.sheet-body{flex:1;overflow-y:auto;padding:12px 12px 8px}
.sheet-foot{display:flex;gap:7px;align-items:flex-end;padding:7px 9px calc(9px + var(--safe-b));
  background:var(--header)}
.sheet-foot textarea{flex:1;max-height:110px;resize:none;padding:10px 14px;background:#2a3942;
  border:0;border-radius:22px;font-size:16px;color:var(--ink)}
.sheet-foot textarea:focus{outline:none}
.hero{background:var(--out);border-radius:8px;padding:11px 12px;box-shadow:0 1px .5px #0000004d}
.hero .body{white-space:pre-wrap;word-break:break-word;font-size:16px;line-height:1.35}
.hero .by{font-size:12px;color:#ffffff8f;margin-top:7px}
.statusbar{display:flex;gap:7px;margin:10px 0;overflow-x:auto;padding-bottom:2px}
.statusbar button{padding:8px 15px;border-radius:20px;background:#2a3942;font-size:13.5px;
  white-space:nowrap;flex:none;color:var(--ink2)}
.statusbar button.on{background:var(--accent);color:#0b141a;font-weight:600}
.owners{display:grid;gap:6px;margin:8px 0}
.owner-row{display:flex;align-items:center;gap:11px;font-size:14px;background:var(--panel2);
  border-radius:8px;padding:8px 11px}
.owner-row .avatar{width:36px;height:36px;font-size:13px}
.thread{display:flex;flex-direction:column;gap:3px;margin-top:8px}
.msg{position:relative;max-width:85%;background:var(--in);border-radius:8px;padding:6px 8px 7px;
  font-size:15px;box-shadow:0 1px .5px #0000004d;margin-top:2px}
.msg.out{align-self:flex-end;background:var(--out)}
.msg .who{font-size:13px;font-weight:600;margin-bottom:2px}
.sys{align-self:center;font-size:12px;color:var(--ink2);background:#182229;border-radius:8px;
  padding:5px 11px;text-align:center;margin:3px 0;box-shadow:0 1px 1px #00000026}
.due-row{display:flex;gap:7px;align-items:center;margin:8px 0}
.due-row input{flex:1;padding:10px 12px;background:#2a3942;border:0;border-radius:8px;
  color:var(--ink);color-scheme:dark;font-size:15px}

/* ---------- toast ---------- */
.toast{position:fixed;left:50%;transform:translateX(-50%);bottom:calc(84px + var(--safe-b));
  background:#182229;color:var(--ink);padding:11px 18px;border-radius:24px;font-size:13.5px;
  z-index:40;box-shadow:0 4px 16px #00000073;max-width:88vw;text-align:center}

/* ---------- board: index + drill-down ---------- */
.searchbar{padding:8px 10px;background:var(--panel);flex:none}
.searchbar input{width:100%;padding:10px 14px;background:#2a3942;border:0;border-radius:20px;
  font-size:15px;color:var(--ink);-webkit-appearance:none}
.searchbar input::placeholder{color:var(--ink3)}
.searchbar input:focus{outline:none}
.fchip .cnt{font-style:normal;margin-left:6px;opacity:.65;font-size:11px}
.index{flex:1;overflow-y:auto;background:var(--panel);padding-bottom:calc(16px + var(--safe-b))}
.irow{display:flex;align-items:center;gap:12px;width:100%;text-align:left;padding:11px 14px;
  border-bottom:1px solid var(--line)}
.irow:active{background:#ffffff0d}
.irow .nm{font-size:16px}
.irow .sub{font-size:13px;color:var(--ink2);margin-top:2px}
.irow .grow{flex:1;min-width:0}
.avatar.sm{width:40px;height:40px;font-size:14px}
.chev{color:var(--ink3);font-size:22px;line-height:1;flex:none}
.lateN{background:#f15c6d29;color:#ffb3bb;font-size:11.5px;font-weight:700;padding:3px 9px;
  border-radius:11px;flex:none}
.drillhead{display:flex;align-items:center;gap:6px;padding:8px 10px;background:var(--panel);
  border-bottom:1px solid var(--line);flex:none}
.drillhead .icon-btn{font-size:26px;color:var(--ink);width:32px}
.drillhead .nm{font-size:16.5px;font-weight:600}
.drillhead .sub{font-size:12.5px;color:var(--ink2);margin-top:1px}
.drillhead .grow{flex:1;min-width:0}

/* a bucket heading, then spare rows */
.bh{display:flex;align-items:center;gap:8px;font-size:12px;font-weight:700;color:var(--ink2);
  text-transform:uppercase;letter-spacing:.05em;padding:14px 4px 6px;position:sticky;top:0;
  background:var(--panel);z-index:2}
.bh.late{color:#ffb3bb}
.bh .n{font-weight:400;opacity:.6;letter-spacing:0}
.trow{display:flex;align-items:center;gap:11px;width:100%;text-align:left;padding:11px 6px;
  border-bottom:1px solid var(--line)}
.trow:active{background:#ffffff0d}
.trow.done{opacity:.45}
.trow.done .tt{text-decoration:line-through}
.trow .grow{flex:1;min-width:0}
.trow .tt{font-size:15px;line-height:1.3}
.trow .sub{font-size:12.5px;color:var(--ink2);margin-top:2px}
.trow .pip{width:9px;height:9px;border-radius:50%;background:var(--open);flex:none}
.trow .pip.doing{background:var(--doing)} .trow .pip.blocked{background:var(--blocked)}
.trow .pip.done{background:var(--done)}
.trow .rt{display:flex;align-items:center;gap:7px;flex:none}
.trow .due{font-size:12.5px;color:var(--ink2);white-space:nowrap}
.trow .due.late{color:#ff8a95;font-weight:600}
.more{width:100%;padding:14px;margin-top:10px;background:#2a3942;border-radius:10px;
  color:var(--ink2);font-size:13.5px}
.tickbtn{width:30px;height:30px;border-radius:50%;background:#2a3942;color:var(--ink2);
  font-size:14px;flex:none;display:grid;place-items:center;margin-left:2px}
.tickbtn:active{background:var(--accent);color:#0b141a}
.more.earlier{margin:0 0 8px;background:#182229cc;color:var(--ink2);padding:9px;
  border-radius:8px;font-size:12.5px;align-self:center;width:auto;min-width:180px}
.tabs.tabs-3{grid-template-columns:repeat(3,1fr)}
/* wider columns push the badge clear of the icon */
.tabs.tabs-3 .badge{right:calc(50% - 32px)}
.irow.pinned{background:#ffffff08}
.avatar.sm.me{background:var(--accent);color:#0b141a}
