/* Great Boards — layout: top bar (logo · search · create) / home with sidebar / board with side panels + bottom dock / two-column card modal */
:root{
  --brand:#2C5DDB; --brand-2:#1f4fc7; --brand-soft:rgba(44,93,219,.12); --navy:#112959;
  --bg:#ffffff; --surface:#ffffff; --surface2:#f7f8f9; --sunken:#f1f2f4; --list:#f1f2f4; --card:#ffffff; --modal:#ffffff; --modal-side:#f7f8f9;
  --line:#dcdfe4; --line2:#c7ccd4; --text:#172b4d; --muted:#44546f; --subtle:#626f86; --strong:#172b4d;
  --hover:rgba(9,30,66,.06); --hover2:rgba(9,30,66,.12); --btn:rgba(9,30,66,.06);
  --header:#ffffff; --shadow:0 1px 1px rgba(9,30,66,.25),0 0 1px rgba(9,30,66,.31); --shadow-lg:0 8px 12px rgba(9,30,66,.15),0 0 1px rgba(9,30,66,.31);
  --danger:#c9372c; --ok:#1f845a; --warn:#e2b203; --scrim:rgba(9,30,66,.54);
  --logo-filter:none; --input:#ffffff;
  --font:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Noto Sans",Ubuntu,"Helvetica Neue",sans-serif;
}
:root[data-theme="dark"]{color-scheme:dark;
  --bg:#1d2125; --surface:#22272b; --surface2:#282e33; --sunken:#161a1d; --list:#101204; --card:#22272b; --modal:#323940; --modal-side:#2c333a;
  --line:#38414a; --line2:#454f59; --text:#b6c2cf; --muted:#9fadbc; --subtle:#8c9bab; --strong:#dee4ea;
  --hover:rgba(161,189,217,.08); --hover2:rgba(166,197,226,.16); --btn:rgba(161,189,217,.08);
  --header:#1d2125; --shadow:0 1px 1px rgba(3,4,4,.5),0 0 1px rgba(3,4,4,.5); --shadow-lg:0 8px 12px rgba(3,4,4,.36),0 0 1px rgba(3,4,4,.5);
  --danger:#f87168; --ok:#4bce97; --scrim:rgba(16,18,4,.6);
  --logo-filter:brightness(0) invert(1); --input:#22272b; --brand-soft:rgba(87,157,255,.16);
}
*{box-sizing:border-box}
html,body{margin:0;height:100%}
body{background:var(--bg);color:var(--text);font:14px/20px var(--font);display:flex;flex-direction:column;-webkit-font-smoothing:antialiased;overflow:hidden}
button,input,select,textarea{font:inherit;color:inherit}
button{cursor:pointer;border:0;background:none;padding:0}
a{color:var(--brand)}
:root[data-theme="dark"] .descr-view a,:root[data-theme="dark"] .bubble a,:root[data-theme="dark"] .citem a{color:#579dff}
.sidenav a,.recent a,.upc a{color:var(--text)}
[hidden]{display:none!important}
.ico{width:16px;height:16px;stroke:currentColor;fill:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;flex:none}
.ico.sm{width:14px;height:14px}.ico.lg{width:20px;height:20px}
.sp{flex:1}

/* ===== top bar ===== */
.top{height:48px;flex:none;display:flex;align-items:center;gap:8px;padding:0 max(8px,env(safe-area-inset-right)) 0 max(8px,env(safe-area-inset-left));background:var(--header);border-bottom:1px solid var(--line);position:relative;z-index:20}
.top .ib{color:var(--muted)}
.logo{display:flex;align-items:center;gap:8px;text-decoration:none;color:var(--strong)!important;padding:4px 6px;border-radius:4px}
.logo:hover{background:var(--hover)}
.logo img{height:22px;filter:var(--logo-filter)}
.logo-fb{display:none;font:800 17px var(--font);letter-spacing:1.5px}
.logo small{font-size:12px;font-weight:600;color:var(--muted)}
.searchbox{flex:1;max-width:780px;margin:0 auto;position:relative}
.searchbox input{width:100%;height:32px;border-radius:6px;border:1px solid var(--line2);background:var(--input);padding:0 10px 0 32px;outline:none;color:var(--text)}
.searchbox input:focus{border-color:var(--brand);box-shadow:inset 0 0 0 1px var(--brand)}
.searchbox>.ico{position:absolute;left:10px;top:8px;color:var(--subtle)}
.sresults{position:absolute;left:0;right:0;top:38px;background:var(--surface);border:1px solid var(--line);border-radius:8px;box-shadow:var(--shadow-lg);max-height:70vh;overflow:auto;padding:8px;z-index:40}
.sresults h6{font-size:11px;text-transform:uppercase;color:var(--subtle);margin:8px 8px 4px;font-weight:700;letter-spacing:.3px}
.sres{display:flex;align-items:center;gap:10px;padding:6px 8px;border-radius:6px;cursor:pointer;color:var(--text);text-decoration:none}
.sres:hover,.sres.on{background:var(--hover)}
.sres .sw{width:32px;height:24px;border-radius:3px;flex:none}
.sres small{display:block;color:var(--subtle);font-size:12px}
.createbtn{height:32px;padding:0 12px;border-radius:4px;background:var(--brand);color:#fff;font-weight:500;display:inline-flex;align-items:center;gap:4px}
.createbtn:hover{background:var(--brand-2)}
:root[data-theme="dark"] .createbtn{background:#579dff;color:#1d2125}
.tools{display:flex;align-items:center;gap:4px}
.tbtn{display:inline-flex;align-items:center;gap:6px;height:32px;padding:0 8px;border-radius:4px;color:var(--muted);font-size:13px;font-weight:500}
.tbtn:hover{background:var(--hover)}
.tswitch{position:relative;cursor:pointer}
.tswitch input{position:absolute;opacity:0;width:0;height:0}
.tswitch .trk{position:relative;width:34px;height:18px;border-radius:99px;background:var(--sunken);border:1px solid var(--line2);transition:.2s}
.tswitch .trk:after{content:"";position:absolute;top:2px;left:2px;width:12px;height:12px;border-radius:50%;background:var(--brand);transition:.2s}
.tswitch input:checked+.trk:after{transform:translateX(16px)}
.tswitch input:focus-visible+.trk{outline:2px solid var(--brand);outline-offset:2px}
.bell{position:relative}
.bell .dot{position:absolute;top:5px;right:5px;width:8px;height:8px;border-radius:50%;background:#e2483d;box-shadow:0 0 0 2px var(--header)}

/* ===== avatars & buttons ===== */
.av{width:28px;height:28px;border-radius:50%;display:inline-flex;align-items:center;justify-content:center;color:#fff;font-size:11px;font-weight:700;flex:none;text-transform:uppercase}
.av.sm{width:24px;height:24px;font-size:10px}.av.xs{width:20px;height:20px;font-size:9px}.av.lg{width:40px;height:40px;font-size:15px}
.avs{display:flex}.avs .av{box-shadow:0 0 0 2px var(--card)}.avs .av+.av{margin-left:-4px}
.ib{width:32px;height:32px;border-radius:4px;display:inline-flex;align-items:center;justify-content:center;color:var(--muted);flex:none}
.ib:hover{background:var(--hover2);color:var(--text)}
.btn{display:inline-flex;align-items:center;justify-content:center;gap:6px;height:32px;padding:0 12px;border-radius:3px;background:var(--btn);color:var(--text);font-weight:500;white-space:nowrap}
.btn:hover{background:var(--hover2)}
.btn.primary{background:var(--brand);color:#fff}.btn.primary:hover{background:var(--brand-2)}
:root[data-theme="dark"] .btn.primary{background:#579dff;color:#1d2125}
.btn.danger{background:var(--danger);color:#fff}
.btn.ghost{background:transparent}.btn.ghost:hover{background:var(--hover2)}
.btn.outline{background:transparent;border:1px solid var(--line2)}
.btn.full{width:100%;justify-content:flex-start}
.btn:disabled{opacity:.5;cursor:default}
.btn:focus-visible,.ib:focus-visible,.tbtn:focus-visible,a:focus-visible{outline:2px solid var(--brand);outline-offset:2px}
.input,textarea.input,select.input{width:100%;min-height:36px;padding:7px 10px;border-radius:3px;border:1px solid var(--line2);background:var(--input);outline:none;color:var(--text)}
.input:focus{border-color:var(--brand);box-shadow:inset 0 0 0 1px var(--brand)}
textarea.input{resize:vertical;min-height:90px;line-height:20px}
.field{display:block;margin-bottom:12px}
.field>span{display:block;font-size:12px;font-weight:700;color:var(--muted);margin-bottom:4px}
.err{color:var(--danger);font-size:13px;min-height:18px;margin:4px 0}
.muted{color:var(--subtle)}
h1,h2,h3{color:var(--strong);margin:0}
.loading{flex:1;display:flex;align-items:center;justify-content:center;min-height:160px}
.spin{width:24px;height:24px;border-radius:50%;border:3px solid var(--line2);border-top-color:var(--brand);animation:sp 1s linear infinite;display:inline-block}
@keyframes sp{to{transform:rotate(360deg)}}
main{flex:1;min-height:0;display:flex;flex-direction:column}

/* ===== auth ===== */
.auth{flex:1;display:flex;align-items:center;justify-content:center;background:var(--sunken);padding:24px 16px;overflow:auto}
.auth-card{width:100%;max-width:400px;background:var(--surface);border-radius:4px;box-shadow:rgba(0,0,0,.1) 0 0 10px;padding:32px 40px}
.auth-card .brandmark{display:flex;justify-content:center;margin-bottom:20px}
.auth-card .brandmark img{height:34px;filter:var(--logo-filter)}
.auth-card h2{font-size:16px;text-align:center;margin-bottom:6px;color:var(--strong)}
.auth-card p.muted{text-align:center;margin:0 0 20px;font-size:13px}
.auth-card .btn{width:100%;height:40px}

/* ===== home ===== */
.home{flex:1;overflow:auto;padding:40px max(16px,env(safe-area-inset-right)) 40px max(16px,env(safe-area-inset-left))}
.homegrid{display:grid;grid-template-columns:256px minmax(0,1fr) 300px;gap:32px;max-width:1240px;margin:0 auto;align-items:start}
.homegrid.two{grid-template-columns:256px minmax(0,1fr)}
.sidenav{position:sticky;top:0;display:flex;flex-direction:column;gap:4px}
.sidenav a{display:flex;align-items:center;gap:10px;height:36px;padding:0 10px;border-radius:8px;color:var(--text);text-decoration:none;font-weight:500;white-space:nowrap}
.sidenav a:hover{background:var(--hover)}
.sidenav a.on{background:var(--brand-soft);color:var(--brand)}
:root[data-theme="dark"] .sidenav a.on{color:#579dff}
.sidenav hr{border:0;border-top:1px solid var(--line);margin:8px 0}
.sidenav small{padding:8px 10px 2px;color:var(--subtle);font-size:12px;font-weight:600}
.home h1{font-size:20px;margin-bottom:6px}
.home h2{font-size:16px;font-weight:700;display:flex;align-items:center;gap:8px;margin:26px 0 12px;color:var(--strong)}
.home h2:first-child{margin-top:0}
.bgrid{display:grid;grid-template-columns:repeat(auto-fill,minmax(194px,1fr));gap:16px}
.btile{position:relative;height:96px;border-radius:8px;padding:8px 10px;color:#fff;text-decoration:none;display:flex;flex-direction:column;justify-content:space-between;overflow:hidden;box-shadow:var(--shadow)}
.btile:after{content:"";position:absolute;inset:0;background:rgba(0,0,0,0);transition:.15s}
.btile:hover:after{background:rgba(0,0,0,.15)}
.btile>*{position:relative;z-index:1}
.btile b{font-size:16px;font-weight:700;word-break:break-word;text-shadow:0 1px 2px rgba(0,0,0,.25)}
.btile small{opacity:.9;font-size:12px}
.btile .star{position:absolute;right:8px;bottom:8px;color:#fff;opacity:0;transition:.15s;z-index:2}
.btile:hover .star,.btile .star.on{opacity:1}
.star.on .ico{fill:#e2b203;stroke:#e2b203}
.btile.new{background:var(--btn);color:var(--text);align-items:center;justify-content:center;box-shadow:none;font-weight:500}
.btile.new:hover{background:var(--hover2)}
.recent a{display:flex;align-items:center;gap:10px;padding:6px;border-radius:6px;color:var(--text);text-decoration:none}
.recent a:hover{background:var(--hover)}
.recent .sw{width:40px;height:32px;border-radius:4px;flex:none;display:flex;align-items:center;justify-content:center;color:var(--muted)}
.recent small{display:block;color:var(--subtle);font-size:12px}
.side-h{display:flex;align-items:center;gap:8px;font-size:12px;font-weight:600;color:var(--muted);margin:0 0 10px}
.upc{background:var(--surface);border:1px solid var(--line);border-radius:8px;overflow:hidden}
.upc a{display:flex;gap:12px;align-items:center;padding:10px 12px;border-bottom:1px solid var(--line);color:var(--text);text-decoration:none}
.upc a:last-child{border-bottom:0}
.upc a:hover{background:var(--hover)}
.upc .sw{width:6px;align-self:stretch;border-radius:3px;flex:none}
.empty-card{background:var(--surface);border:1px solid var(--line);border-radius:8px;padding:24px;text-align:center}
.empty-card .art{height:120px;border-radius:6px;background:linear-gradient(135deg,var(--brand),var(--navy));margin-bottom:16px;display:flex;gap:8px;align-items:flex-start;justify-content:center;padding:18px}
.empty-card .art i{width:70px;background:rgba(255,255,255,.9);border-radius:4px;display:block}
.tpl-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(230px,1fr));gap:16px}
.tpl{border-radius:8px;overflow:hidden;background:var(--surface);border:1px solid var(--line);text-align:left;display:flex;flex-direction:column;cursor:pointer;color:var(--text)}
.tpl:hover{box-shadow:var(--shadow-lg)}
.tpl .art{height:96px;padding:10px;display:flex;gap:6px}
.tpl .art div{flex:1;background:rgba(255,255,255,.28);border-radius:4px;padding:4px;display:flex;flex-direction:column;gap:4px}
.tpl .art i{display:block;height:10px;background:rgba(255,255,255,.85);border-radius:2px}
.tpl .tb{padding:10px 12px}
.tpl b{display:block;color:var(--strong)}
.tpl small{color:var(--subtle);font-size:12px}

/* ===== board ===== */
.bwrap{flex:1;min-height:0;display:flex;position:relative}
.panel{width:320px;flex:none;display:flex;flex-direction:column;background:var(--surface);border-right:1px solid var(--line);min-height:0}
.panel>header{display:flex;align-items:center;gap:6px;padding:12px 12px 8px}
.panel>header h3{flex:1;font-size:16px}
.panel .pbody{flex:1;overflow:auto;padding:4px 12px 80px}
.inboxlist{background:transparent!important;box-shadow:none!important;width:auto!important;max-height:none!important}
.inboxlist .cards{padding:0;margin:0;overflow:visible}
.inbox-add{margin:0 12px 10px}
.pl-day{margin-bottom:14px}
.pl-day h6{font-size:12px;color:var(--subtle);margin:0 0 6px;font-weight:700;display:flex;gap:6px;align-items:baseline}
.pl-day h6.today{color:var(--brand)}
.pl-item{display:flex;gap:8px;align-items:center;padding:8px 10px;border-radius:8px;background:var(--card);box-shadow:var(--shadow);margin-bottom:6px;cursor:pointer;color:var(--text);text-decoration:none}
.pl-item:hover{box-shadow:0 0 0 2px var(--brand)}
.pl-item .sw{width:4px;align-self:stretch;border-radius:2px;flex:none}
.pl-item small{display:block;color:var(--subtle);font-size:12px}
.pl-item.done .tt{text-decoration:line-through;opacity:.7}
.board{flex:1;min-width:0;min-height:0;display:flex;flex-direction:column;background:var(--brand);position:relative}
.bhead{display:flex;align-items:center;gap:4px;min-height:56px;padding:10px max(10px,env(safe-area-inset-right)) 10px max(16px,env(safe-area-inset-left));background:rgba(0,0,0,.24);backdrop-filter:blur(4px);color:#fff;flex-wrap:nowrap}
.bhead .btitle{font:700 18px/32px var(--font);color:#fff;padding:0 10px;border-radius:3px;min-width:0;max-width:50vw;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;text-align:left;flex:0 1 auto}
.bhead .btitle:hover{background:rgba(255,255,255,.2)}
.bhead input.btitle{background:var(--input);color:var(--text);outline:none;border:0;box-shadow:inset 0 0 0 2px var(--brand)}
.hb{display:inline-flex;align-items:center;justify-content:center;gap:6px;height:32px;min-width:32px;padding:0 8px;border-radius:3px;color:#fff;font-weight:500;flex:none}
.hb:hover{background:rgba(255,255,255,.2)}
.hb.on{background:rgba(255,255,255,.3)}
.hb.solid{background:#dfe1e6;color:#172b4d;padding:0 12px}
.hb.solid:hover{background:#fff}
.bhead .avs{margin:0 6px}
.bhead .avs .av{box-shadow:0 0 0 2px rgba(0,0,0,.25)}
.bhead .star.on .ico{fill:#e2b203;stroke:#e2b203}
.canvas{flex:1;min-height:0;overflow-x:auto;overflow-y:hidden;display:flex;align-items:flex-start;gap:12px;padding:12px max(12px,env(safe-area-inset-right)) 76px max(12px,env(safe-area-inset-left))}
.lists{display:flex;align-items:flex-start;gap:12px;height:100%}
.list{width:272px;flex:none;background:var(--list);border-radius:12px;display:flex;flex-direction:column;max-height:100%;box-shadow:var(--shadow);padding-bottom:4px}
.lhead{display:flex;align-items:center;gap:4px;padding:8px 8px 0 12px;cursor:grab;min-height:40px}
.lhead h3{flex:1;font:600 14px/20px var(--font);color:var(--strong);padding:6px 0;word-break:break-word;cursor:pointer}
.lhead input{flex:1;font-weight:600}
.lhead .count{font-size:14px;color:var(--subtle);padding:0 4px}
.cards{display:flex;flex-direction:column;gap:8px;padding:4px 4px 2px;margin:0 4px;overflow-y:auto;overflow-x:hidden;min-height:4px}
.card{background:var(--card);border-radius:8px;box-shadow:var(--shadow);cursor:pointer;position:relative;overflow:hidden;touch-action:manipulation;user-select:none;-webkit-user-select:none;-webkit-touch-callout:none;flex:none}
.card:hover{box-shadow:inset 0 0 0 2px var(--brand)}
:root[data-theme="dark"] .card:hover{box-shadow:inset 0 0 0 2px #85b8ff}
.card .cover{height:36px}
.card .cb{padding:8px 12px 4px}
.card .trow{display:flex;align-items:flex-start}
.card .ct{word-break:break-word;color:var(--strong);padding-bottom:4px;flex:1;min-width:0}
.card .ck{width:0;overflow:hidden;opacity:0;transition:width .15s,opacity .15s,margin .15s;flex:none;display:flex;align-items:center;height:20px}
.card:hover .ck,.card.done .ck{width:16px;opacity:1;margin-right:6px}
.circle{width:16px;height:16px;border-radius:50%;border:1.5px solid var(--subtle);display:inline-flex;align-items:center;justify-content:center;flex:none;background:transparent}
.circle.on{background:var(--ok);border-color:var(--ok);color:#fff}
.circle.on .ico{width:11px;height:11px;stroke-width:3}
.lbls{display:flex;flex-wrap:wrap;gap:4px;margin-bottom:6px}
.lbl{height:8px;min-width:40px;max-width:100%;border-radius:4px}
.lbls.open .lbl{height:16px;padding:0 8px;font-size:12px;font-weight:500;color:#fff;line-height:16px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.badges{display:flex;flex-wrap:wrap;align-items:center;gap:2px 4px;padding-bottom:4px;font-size:12px;color:var(--muted)}
.badge{display:inline-flex;align-items:center;gap:4px;height:24px;padding:0 4px;border-radius:3px}
.badge.due-done{background:#1f845a;color:#fff}
.badge.due-over{background:#c9372c;color:#fff}
.badge.due-soon{background:#f5cd47;color:#172b4d}
.badge.ok{background:#1f845a;color:#fff}
.card .avs{margin-left:auto}
.lfoot{display:flex;align-items:center;gap:4px;padding:4px 8px}
.addcard{flex:1;text-align:left;height:32px;padding:0 8px;border-radius:8px;color:var(--muted);display:flex;gap:8px;align-items:center;font-weight:500}
.addcard:hover{background:var(--hover2);color:var(--text)}
.composer{padding:0 4px 4px;margin:0 4px}
.composer textarea{width:100%;border:0;border-radius:8px;padding:8px 12px;box-shadow:var(--shadow);resize:none;background:var(--card);outline:none;min-height:56px;color:var(--text)}
.composer .row{display:flex;gap:4px;margin-top:8px;align-items:center}
.addlist{width:272px;flex:none;background:rgba(255,255,255,.24);color:#fff;border-radius:12px;height:44px;padding:0 12px;text-align:left;display:flex;gap:8px;align-items:center;font-weight:500}
.addlist:hover{background:rgba(255,255,255,.34)}
.addlist-form{width:272px;flex:none;background:var(--list);border-radius:12px;padding:8px}
.card-ph{border-radius:8px;background:var(--hover2);flex:none}
.list-ph{width:272px;flex:none;border-radius:12px;background:rgba(0,0,0,.2)}
.ghost{position:fixed;z-index:100;pointer-events:none;transform:rotate(4deg);box-shadow:var(--shadow-lg)!important;opacity:.95}
body.dragging,body.dragging *{cursor:grabbing!important;user-select:none}
.card.filtered-out{display:none}
.dock{position:absolute;left:50%;bottom:16px;transform:translateX(-50%);display:flex;align-items:center;gap:2px;padding:4px;background:var(--surface);border-radius:8px;box-shadow:var(--shadow-lg);z-index:15;border:1px solid var(--line)}
.dock button{display:inline-flex;align-items:center;gap:6px;height:36px;padding:0 12px;border-radius:6px;color:var(--text);font-weight:500;position:relative;white-space:nowrap}
.dock button:hover{background:var(--hover)}
.dock button.on{background:var(--brand-soft);color:var(--brand)}
.dock button.on:after{content:"";position:absolute;left:30%;right:30%;bottom:2px;height:2px;border-radius:2px;background:currentColor}
:root[data-theme="dark"] .dock button.on{color:#579dff}
.dock .sep{width:1px;height:20px;background:var(--line);margin:0 4px}

/* table + calendar views */
.vwrap{flex:1;min-height:0;overflow:auto;padding:12px max(12px,env(safe-area-inset-right)) 80px max(12px,env(safe-area-inset-left))}
.vtable{width:100%;border-collapse:separate;border-spacing:0;background:var(--surface);border-radius:8px;overflow:hidden;box-shadow:var(--shadow);min-width:720px}
.vtable th,.vtable td{text-align:left;padding:10px 12px;border-bottom:1px solid var(--line);vertical-align:middle}
.vtable th{font-size:12px;color:var(--subtle);font-weight:700;background:var(--surface2);position:sticky;top:0}
.vtable tr.row{cursor:pointer}.vtable tr.row:hover td{background:var(--hover)}
.vtable .chip{display:inline-block;padding:0 8px;height:20px;line-height:20px;border-radius:3px;font-size:12px;color:#fff;margin:1px 2px 1px 0}
.cal{background:var(--surface);border-radius:8px;box-shadow:var(--shadow);overflow:hidden;min-width:720px}
.cal-h{display:flex;align-items:center;gap:8px;padding:10px 12px;border-bottom:1px solid var(--line)}
.cal-h h3{font-size:16px;flex:1}
.cal-g{display:grid;grid-template-columns:repeat(7,1fr)}
.cal-g .dow{padding:6px 8px;font-size:12px;font-weight:700;color:var(--subtle);border-bottom:1px solid var(--line)}
.cal-g .day{min-height:110px;border-right:1px solid var(--line);border-bottom:1px solid var(--line);padding:4px;display:flex;flex-direction:column;gap:3px;min-width:0}
.cal-g .day:nth-child(7n){border-right:0}
.cal-g .day.out{background:var(--surface2)}
.cal-g .day .n{font-size:12px;color:var(--subtle);padding:2px 6px;align-self:flex-start;border-radius:10px}
.cal-g .day.today .n{background:var(--brand);color:#fff}
.cal-g .ev{font-size:12px;padding:2px 6px;border-radius:3px;background:var(--brand-soft);color:var(--text);cursor:pointer;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;border-left:3px solid var(--brand)}
.cal-g .ev.done{opacity:.6;text-decoration:line-through}

/* ===== popover ===== */
.pop{position:fixed;z-index:60;width:304px;max-width:calc(100vw - 16px);max-height:min(600px,calc(100vh - 64px));overflow:auto;background:var(--surface);border-radius:8px;box-shadow:var(--shadow-lg);padding:12px;border:1px solid var(--line)}
:root[data-theme="dark"] .pop{background:#282e33}
.pop h4{margin:0 0 12px;text-align:center;font-size:14px;font-weight:600;color:var(--muted);position:relative;line-height:32px}
.pop h4 .x{position:absolute;right:-4px;top:0}
.pop .sec-t{font-size:12px;font-weight:700;color:var(--muted);margin:14px 0 6px}
.optrow{display:flex;align-items:center;gap:8px;padding:6px;border-radius:4px;cursor:pointer;width:100%;text-align:left;color:var(--text)}
.optrow:hover{background:var(--hover)}
.optrow .chk{margin-left:auto;color:var(--brand)}
.lblpick{flex:1;height:32px;border-radius:3px;color:#fff;font-weight:500;display:flex;align-items:center;padding:0 12px;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.swatches{display:grid;grid-template-columns:repeat(6,1fr);gap:6px}
.swatches button{height:32px;border-radius:3px}
.swatches button.on{box-shadow:0 0 0 2px var(--surface),0 0 0 4px var(--brand)}
.bgpick{display:grid;grid-template-columns:repeat(4,1fr);gap:6px}
.bgpick button{height:40px;border-radius:4px}
.bgpick button.on{box-shadow:0 0 0 2px var(--surface),0 0 0 4px var(--brand)}
.menu-list button,.menu-list a{display:flex;width:100%;gap:10px;align-items:center;padding:0 8px;height:36px;border-radius:4px;text-align:left;color:var(--text);text-decoration:none}
.menu-list button:hover,.menu-list a:hover{background:var(--hover)}
.menu-list .danger{color:var(--danger)}
.menu-list hr{border:0;border-top:1px solid var(--line);margin:6px 0}
.notif{display:flex;gap:10px;padding:8px 22px 8px 8px;border-radius:6px;cursor:pointer;position:relative}
.notif:hover{background:var(--hover)}
.notif.unread:before{content:"";position:absolute;right:8px;top:12px;width:8px;height:8px;border-radius:50%;background:var(--brand)}
.notif small{color:var(--subtle);font-size:12px}
.notif .ctx{font-size:12px;color:var(--subtle)}

/* ===== card modal ===== */
.modal{position:fixed;inset:0;z-index:50;background:var(--scrim);overflow:auto;padding:48px 16px;display:flex;align-items:flex-start;justify-content:center}
.dialog{background:var(--modal);border-radius:12px;width:100%;max-width:1040px;box-shadow:var(--shadow-lg);position:relative;overflow:hidden;color:var(--text)}
.dialog.sm{max-width:420px;padding:20px}
.cm-top{display:flex;align-items:center;gap:4px;padding:12px 12px 12px 24px;border-bottom:1px solid var(--line)}
.listpill{display:inline-flex;align-items:center;gap:4px;height:28px;padding:0 8px;border-radius:3px;background:var(--btn);font-weight:600;font-size:13px;color:var(--text);max-width:260px}
.listpill:hover{background:var(--hover2)}
.listpill span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.cm-cover{height:116px}
.cm-grid{display:grid;grid-template-columns:minmax(0,1.45fr) minmax(0,1fr);min-height:420px}
.cm-main{padding:20px 24px 28px;min-width:0}
.cm-side{background:var(--modal-side);border-left:1px solid var(--line);padding:16px 16px 28px;min-width:0}
.cm-titlerow{display:flex;gap:12px;align-items:flex-start;margin-bottom:12px}
.cm-titlerow .circle{width:20px;height:20px;margin-top:8px;cursor:pointer}
.cm-titlerow .circle .ico{width:13px;height:13px}
.cm-title{flex:1;font:600 20px/28px var(--font);color:var(--strong);border:0;border-radius:3px;padding:4px 6px;margin:0 0 0 -6px;background:transparent;resize:none;overflow:hidden;width:100%;outline:none;min-width:0}
.cm-title:focus{background:var(--input);box-shadow:inset 0 0 0 2px var(--brand)}
.cm-actions{display:flex;flex-wrap:wrap;gap:8px;margin:0 0 20px 32px}
.cm-actions .btn{background:transparent;border:1px solid var(--line2);height:32px;font-weight:500;color:var(--muted)}
.cm-actions .btn:hover{background:var(--hover)}
.chips{display:flex;flex-wrap:wrap;gap:16px 24px;margin:0 0 20px 32px}
.chips .grp>span{display:block;font-size:12px;font-weight:700;color:var(--muted);margin-bottom:6px}
.chips .row{display:flex;gap:4px;flex-wrap:wrap;align-items:center}
.chip-l{height:32px;border-radius:3px;padding:0 12px;display:inline-flex;align-items:center;color:#fff;font-weight:500;min-width:48px;cursor:pointer}
.addsq{width:32px;height:32px;border-radius:3px;background:var(--btn);display:inline-flex;align-items:center;justify-content:center;color:var(--text)}
.addsq:hover{background:var(--hover2)}
.duechip{display:inline-flex;align-items:center;gap:8px;height:32px;padding:0 10px;border-radius:3px;background:var(--btn);font-weight:500}
.duechip:hover{background:var(--hover2)}
.duechip input{width:16px;height:16px;accent-color:var(--ok)}
.duechip .badge{height:20px;font-size:12px}
.sec{margin-bottom:24px}
.sec-h{display:flex;align-items:center;gap:12px;margin-bottom:10px;min-height:32px}
.sec-h h5{flex:1;font-size:16px;font-weight:600;margin:0;color:var(--strong);display:flex;align-items:center;gap:12px}
.sec-h h5 .ico{width:20px;height:20px;color:var(--muted)}
.sec-body{margin-left:32px}
.descr-view{cursor:pointer;padding:8px 12px;border-radius:3px;background:var(--btn);min-height:56px;white-space:pre-wrap;word-break:break-word;color:var(--muted)}
.descr-view.filled{background:transparent;padding:0;color:var(--text);min-height:0}
.descr-view:not(.filled):hover{background:var(--hover2)}
.prog{display:flex;align-items:center;gap:10px;font-size:11px;color:var(--subtle);margin-bottom:6px}
.prog span{width:30px;text-align:right}
.prog .bar{flex:1;height:8px;border-radius:4px;background:var(--hover2);overflow:hidden}
.prog .bar i{display:block;height:100%;background:var(--brand);transition:width .2s}
.prog.full .bar i{background:var(--ok)}
.citem{display:flex;align-items:flex-start;gap:12px;padding:6px 4px;border-radius:6px;margin-left:-4px}
.citem:hover{background:var(--hover)}
.citem input[type=checkbox]{width:16px;height:16px;margin-top:2px;accent-color:var(--brand);flex:none}
.citem span{flex:1;word-break:break-word;cursor:text}
.citem.done span{text-decoration:line-through;color:var(--subtle)}
.citem .ib{width:24px;height:24px;opacity:0}
.citem:hover .ib{opacity:1}
.att{display:flex;gap:12px;align-items:center;padding:4px;border-radius:6px;margin-bottom:6px}
.att:hover{background:var(--hover)}
.att .thumb{width:64px;height:48px;border-radius:3px;background:var(--btn) center/cover no-repeat;display:flex;align-items:center;justify-content:center;font-weight:700;color:var(--muted);font-size:12px;text-transform:uppercase;flex:none;text-decoration:none}
.att .meta{flex:1;min-width:0}
.att .meta a{font-weight:600;word-break:break-all;color:var(--strong);text-decoration:none}
.att .meta a:hover{text-decoration:underline}
.att small{color:var(--subtle);font-size:12px}
.cside-h{display:flex;align-items:center;gap:8px;margin-bottom:12px}
.cside-h h5{flex:1;font-size:14px;font-weight:600;margin:0;color:var(--strong);display:flex;align-items:center;gap:10px}
.feed .ent{display:flex;gap:8px;margin-bottom:16px}
.feed .ent .txt{flex:1;min-width:0;font-size:14px}
.feed .ent b{color:var(--strong);font-weight:600}
.feed .bubble{background:var(--input);border-radius:8px;padding:8px 12px;margin:4px 0;white-space:pre-wrap;word-break:break-word;box-shadow:var(--shadow)}
.feed .when{color:var(--brand);font-size:12px;text-decoration:underline;cursor:pointer}
:root[data-theme="dark"] .feed .when{color:#579dff}
.feed .acts{font-size:12px;color:var(--subtle)}
.feed .acts button{color:var(--subtle);text-decoration:underline;font-size:12px}
.feed .acts button:hover{color:var(--text)}
.commentbox{margin-bottom:20px}
.commentbox textarea{min-height:36px;resize:none;box-shadow:var(--shadow);border:0;border-radius:8px}
.commentbox.open textarea{min-height:80px}
.archived-bar{background:#f8e6a0;color:#533f04;padding:10px 24px;font-weight:500;display:flex;align-items:center;gap:8px}

/* drawer */
.drawer{position:fixed;top:48px;right:0;bottom:0;width:340px;max-width:100vw;background:var(--surface);border-left:1px solid var(--line);box-shadow:var(--shadow-lg);z-index:30;display:flex;flex-direction:column}
.drawer header{display:flex;align-items:center;padding:12px;border-bottom:1px solid var(--line)}
.drawer header h4{flex:1;margin:0;text-align:center;font-size:14px;color:var(--muted)}
.drawer .dbody{flex:1;overflow:auto;padding:12px}
.drawer .sec-t{font-size:12px;font-weight:700;color:var(--muted);margin:12px 0 6px}

/* admin table */
.table{width:100%;border-collapse:collapse;background:var(--surface);border-radius:8px;overflow:hidden;box-shadow:var(--shadow)}
.table th,.table td{text-align:left;padding:10px 12px;border-bottom:1px solid var(--line);vertical-align:middle}
.table th{font-size:12px;color:var(--subtle);font-weight:700;background:var(--surface2)}
.tablewrap{overflow-x:auto}
.pill{display:inline-block;padding:0 8px;line-height:20px;border-radius:3px;font-size:12px;font-weight:600;background:var(--btn)}
.pill.admin{background:var(--brand-soft);color:var(--brand)}

.toast{position:fixed;left:50%;bottom:76px;transform:translate(-50%,20px);background:#172b4d;color:#fff;padding:10px 16px;border-radius:6px;opacity:0;pointer-events:none;transition:.25s;z-index:90;box-shadow:var(--shadow-lg);max-width:calc(100vw - 32px)}
.toast.on{opacity:1;transform:translate(-50%,0)}
:root[data-theme="dark"] .toast{background:#dee4ea;color:#1d2125}

@media (max-width:1100px){.homegrid{grid-template-columns:220px minmax(0,1fr)}.homegrid .rightcol{display:none}}
@media (max-width:860px){
  .cm-grid{grid-template-columns:1fr}
  .cm-side{border-left:0;border-top:1px solid var(--line)}
  .cm-actions,.chips,.sec-body{margin-left:0}
  .modal{padding:0}
  .dialog{border-radius:0;min-height:100%}
  .logo small{display:none}
  .tbtn>span:not(.trk){display:none}
  .homegrid,.homegrid.two{grid-template-columns:1fr}
  .sidenav{position:static;flex-direction:row;overflow-x:auto}
  .sidenav hr,.sidenav small{display:none}
  .panel{position:absolute;left:0;top:0;bottom:0;z-index:12;width:min(340px,92vw);box-shadow:var(--shadow-lg)}
  .dock button span{display:none}
}
@media (max-width:600px){
  .createbtn span{display:none}.createbtn{padding:0 9px}
  .bhead .hide-sm{display:none}
  .searchbox input::placeholder{color:transparent}
}
@media (prefers-reduced-motion:reduce){*{transition:none!important;animation:none!important}}
