:root{
  --bg:#F4F4F1; --ink:#1E1E2A; --muted:#6E6E7E; --line:rgba(30,30,42,.10);
  --accent:#5B5BD6; --accent-2:#4848C4; --accent-soft:#EEEEFD; --panel:#FFFFFF; --hover:#F1F1EE;
  --shadow:0 1px 2px rgba(20,20,40,.07),0 6px 22px -6px rgba(20,20,40,.18);
  --danger:#D33B42;
}
*{box-sizing:border-box}
html,body{margin:0;height:100%;overflow:hidden;font-family:Inter,system-ui,-apple-system,"Segoe UI",sans-serif;color:var(--ink);background:var(--bg);-webkit-font-smoothing:antialiased;overscroll-behavior:none}
button{font:inherit;color:inherit}
kbd{font:600 11px Inter,sans-serif;background:#F3F2EE;border:1px solid #E2E0DA;border-bottom-width:2px;border-radius:5px;padding:1px 6px;color:#45454F;white-space:nowrap}

/* ---------- canvas ---------- */
#viewport{position:fixed;inset:0;overflow:hidden;touch-action:none;user-select:none;-webkit-user-select:none;background-color:var(--bg);cursor:default}
#viewport.t-hand{cursor:grab}
#viewport.panning,#viewport.panning *{cursor:grabbing!important}
#viewport.t-pen,#viewport.t-sticky,#viewport.t-shape,#viewport.t-text,#viewport.t-line,#viewport.t-frame{cursor:crosshair}
#viewport.t-comment{cursor:copy}
#viewport.t-eraser{cursor:cell}
#world{position:absolute;left:0;top:0;transform-origin:0 0}
#links,#ink{position:absolute;left:0;top:0;width:1px;height:1px;overflow:visible}
#items,#frames,#labels{position:absolute;left:0;top:0}
#ink{pointer-events:none}
#links .hit{pointer-events:stroke;stroke:transparent;fill:none;cursor:pointer}
#links .nohit{pointer-events:none}
.item{position:absolute;left:0;top:0;transform-origin:center}
.item.popin,.frame.popin{animation:popin .22s cubic-bezier(.2,.9,.3,1.25)}
@keyframes popin{from{scale:.88;opacity:0}to{scale:1;opacity:1}}
.txt{outline:none;white-space:pre-wrap;word-break:break-word;overflow-wrap:anywhere;caret-color:var(--accent);min-width:2px}
.editing .txt{user-select:text;-webkit-user-select:text;cursor:text}
.editing .txt:empty::before{content:attr(data-ph);opacity:.4}
.sticky{display:flex;align-items:center;justify-content:center;overflow:hidden;box-shadow:0 1px 1px rgba(0,0,0,.05),0 8px 14px -8px rgba(60,50,20,.35)}
.sticky .txt{width:100%;line-height:1.28}
.shape .tb{position:absolute;display:flex;flex-direction:column;justify-content:center;overflow:hidden}
.shape svg{position:absolute;left:0;top:0;overflow:visible}
.shape .txt{line-height:1.3}
.text .txt{padding:2px 4px;line-height:1.3}
.image img{width:100%;height:100%;display:block;pointer-events:none;object-fit:fill}
.path{pointer-events:none}
.path svg{overflow:visible;position:absolute;left:0;top:0}
.path .hit{pointer-events:stroke;stroke:transparent;fill:none}
.path.erasing{opacity:.2}
.locked{cursor:default}
/* frames */
.frame{position:absolute;left:0;top:0;background:#fff;box-shadow:0 0 0 1px rgba(30,30,42,.08),0 1px 3px rgba(30,30,42,.05)}
.frame .ftitle{position:absolute;left:0;bottom:100%;white-space:nowrap;color:#5D5D6C;font-weight:500;cursor:default;outline:none;max-width:100%;overflow:hidden;text-overflow:ellipsis;transform-origin:0 100%}
.frame .ftitle.editing{color:var(--ink);background:#fff;box-shadow:0 0 0 1px var(--accent);border-radius:3px;user-select:text;-webkit-user-select:text;cursor:text;overflow:visible;text-overflow:clip}
.frame.sel .ftitle,.frame.hov .ftitle{color:var(--accent)}
.frame.drop{box-shadow:0 0 0 2px var(--accent),0 1px 3px rgba(30,30,42,.05)}
/* connector labels */
.lbl{position:absolute;left:0;top:0;transform:translate(-50%,-50%);background:#fff;padding:2px 6px;border-radius:4px;white-space:pre;font-size:14px;line-height:1.25;cursor:pointer;outline:none;box-shadow:0 0 0 1px rgba(30,30,42,.06)}
.lbl.editing{cursor:text;user-select:text;-webkit-user-select:text;box-shadow:0 0 0 1.5px var(--accent);min-width:20px}
.lbl.editing:empty::before{content:'Text';opacity:.4}
/* overlay */
#overlay{position:absolute;inset:0;width:100%;height:100%;pointer-events:none;overflow:visible}
#overlay .h{pointer-events:all;fill:#fff;stroke:var(--accent);stroke-width:1.5}
#overlay .qd{pointer-events:all;cursor:pointer}
#overlay .qd circle.b{fill:var(--accent);transition:r .12s}
#overlay .qd:hover circle.b{r:9}
#overlay .cp{fill:#fff;stroke:var(--accent);stroke-width:1.5;pointer-events:all;cursor:crosshair}
#overlay .cp.on{fill:var(--accent)}
/* comment pins */
#pins{position:absolute;inset:0;pointer-events:none}
.pin{position:absolute;left:0;top:0;width:30px;height:30px;transform:translate(-4px,-26px);pointer-events:all;cursor:pointer;border-radius:15px 15px 15px 3px;background:#FFC94D;box-shadow:0 2px 6px rgba(0,0,0,.2);display:grid;place-items:center;font:700 12px Inter;color:#3B2F00;border:2px solid #fff;transition:transform .12s}
.pin:hover{transform:translate(-4px,-28px) scale(1.06)}
.pin.res{background:#D7D7DE;color:#55556A}
.pin.open{box-shadow:0 0 0 3px var(--accent),0 2px 6px rgba(0,0,0,.2)}

/* ---------- chrome ---------- */
.panel{position:fixed;background:var(--panel);border-radius:10px;box-shadow:var(--shadow);z-index:10}
.bar{display:flex;align-items:center;gap:2px;padding:4px}
.vsep{width:1px;height:22px;background:var(--line);margin:0 4px;flex:none}
.hsep{height:1px;background:var(--line);margin:4px 6px}
.ib{width:36px;height:36px;border:0;background:transparent;border-radius:7px;display:grid;place-items:center;cursor:pointer;color:#33333F;position:relative;flex:none;padding:0;transition:background .1s,color .1s}
.ib.sm{width:28px;height:28px}
.ib:hover{background:var(--hover)}
.ib.on{background:var(--accent-soft);color:var(--accent)}
.ib:disabled{opacity:.32;cursor:default;background:transparent}
.ib svg,.chip svg{width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:1.75;stroke-linecap:round;stroke-linejoin:round}
.ib.sm svg{width:16px;height:16px}
[data-tip]:hover::after{content:attr(data-tip);position:absolute;white-space:nowrap;background:#23232F;color:#fff;font:500 12px Inter,sans-serif;padding:5px 8px;border-radius:6px;pointer-events:none;z-index:60;letter-spacing:0}
.tip-r[data-tip]:hover::after{left:calc(100% + 10px);top:50%;transform:translateY(-50%)}
.tip-b[data-tip]:hover::after{top:calc(100% + 8px);left:50%;transform:translateX(-50%)}
.tip-t[data-tip]:hover::after,#ctx [data-tip]:hover::after{bottom:calc(100% + 8px);left:50%;transform:translateX(-50%)}
#topLeft{left:12px;top:12px;height:48px;padding:0 4px 0 10px;gap:8px}
#topLeft .logo{display:grid;place-items:center}
#topLeft .brand{font-weight:700;font-size:15px;letter-spacing:-.01em}
#title{border:0;outline:none;font:500 14px Inter,sans-serif;color:var(--ink);background:transparent;width:190px;padding:7px 8px;border-radius:6px}
#title:hover{background:var(--hover)}#title:focus{background:var(--accent-soft)}
#topRight{right:12px;top:12px;height:48px;padding:0 6px}
#commentsBtn .badge{position:absolute;top:3px;right:2px;min-width:15px;height:15px;border-radius:8px;background:var(--accent);color:#fff;font:700 9.5px/15px Inter;padding:0 3px}
#toolbar{left:12px;top:50%;transform:translateY(-58%);padding:5px;display:flex;flex-direction:column;gap:1px;max-height:calc(100vh - 190px);overflow-y:auto;scrollbar-width:none}
#toolbar::-webkit-scrollbar{display:none}
#toolbar .ib{width:40px;height:40px}
#toolbar .ib svg{width:22px;height:22px}
#undoBar{left:12px;padding:5px;display:flex;flex-direction:column;gap:1px}
#undoBar .ib{width:40px;height:40px}
#flyout{left:68px;padding:8px;display:none;flex-direction:column;gap:6px;z-index:11}
#flyout.show{display:flex}
#flyout .ttl{font:600 11px Inter;color:var(--muted);text-transform:uppercase;letter-spacing:.04em;margin:2px 2px 0}
.grid{display:grid;gap:4px}
.g4{grid-template-columns:repeat(4,28px)}.g5{grid-template-columns:repeat(5,30px)}.g6{grid-template-columns:repeat(6,26px)}
.sw{width:24px;height:24px;border-radius:50%;border:0;cursor:pointer;box-shadow:inset 0 0 0 1px rgba(0,0,0,.12);position:relative;flex:none;margin:2px;padding:0}
.sw.sq{border-radius:5px;width:26px;height:26px}
.sw.on{box-shadow:inset 0 0 0 1px rgba(0,0,0,.12),0 0 0 2px #fff,0 0 0 3.5px var(--accent)}
.sw.none{background:linear-gradient(135deg,#fff 45%,#E5484D 46%,#E5484D 54%,#fff 55%)!important}
.chip{height:32px;min-width:32px;padding:0 7px;border:0;border-radius:7px;background:transparent;font-size:13px;font-weight:500;cursor:pointer;color:#33333F;display:inline-flex;align-items:center;justify-content:center;gap:4px;position:relative;flex:none;white-space:nowrap}
.chip:hover{background:var(--hover)}.chip.on{background:var(--accent-soft);color:var(--accent)}
.chip .car{font-size:9px;opacity:.55;margin-left:1px}
.chip .dot{width:18px;height:18px;border-radius:50%;box-shadow:inset 0 0 0 1px rgba(0,0,0,.15)}
.chip .dot.none{background:linear-gradient(135deg,#fff 45%,#E5484D 46%,#E5484D 54%,#fff 55%)}
.chip.fmt{font-family:Georgia,serif;font-size:15px;width:32px;padding:0}
.chip.wide{min-width:64px;justify-content:space-between}
#ctx{padding:4px;display:none;width:max-content;align-items:center;gap:1px;transform:translateX(-50%);z-index:12;max-width:calc(100vw - 16px);flex-wrap:wrap;justify-content:center}
#ctx.show{display:flex}
#ctx .vsep{height:20px;margin:0 3px}
#ctx .lockinfo{font-size:12.5px;color:var(--muted);padding:0 8px;display:flex;align-items:center;gap:6px}
#nav{right:12px;bottom:12px;height:46px}
#zoomPct{min-width:52px;height:34px;border:0;background:transparent;border-radius:7px;font-size:13px;font-weight:600;cursor:pointer;font-variant-numeric:tabular-nums;position:relative}
#zoomPct:hover{background:var(--hover)}
#minimap{right:12px;bottom:66px;padding:6px;display:none}
#minimap.show{display:block}
#mmCanvas{display:block;width:220px;height:140px;border-radius:6px;cursor:pointer;background:var(--bg)}
#framesBtn{left:12px;bottom:12px;height:46px;border:0;padding:0 14px 0 10px;display:flex;align-items:center;gap:8px;font-size:13px;font-weight:600;cursor:pointer}
#framesBtn:hover{background:#FAFAF8}
#framesBtn svg{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:1.75;stroke-linecap:round;stroke-linejoin:round}
#framesPanel{left:12px;bottom:66px;width:260px;max-height:50vh;overflow:auto;padding:6px;display:none}
#framesPanel.show{display:block}
#framesPanel .fr{display:flex;align-items:center;gap:10px;width:100%;border:0;background:transparent;padding:8px;border-radius:7px;cursor:pointer;text-align:left;font-size:13px}
#framesPanel .fr:hover{background:var(--hover)}
#framesPanel .fr .n{font:600 11px Inter;color:var(--muted);width:18px}
#framesPanel .empty{padding:14px;color:var(--muted);font-size:13px;line-height:1.45}
#searchBar{left:50%;top:12px;transform:translateX(-50%);height:46px;display:none;align-items:center;gap:4px;padding:0 6px 0 12px;z-index:20}
#searchBar.show{display:flex}
#searchBar input{border:0;outline:none;font:14px Inter;width:220px;background:transparent}
#searchBar .sicon svg{width:16px;height:16px;fill:none;stroke:var(--muted);stroke-width:2;stroke-linecap:round}
#searchCount{font-size:12px;color:var(--muted);min-width:44px;text-align:right;font-variant-numeric:tabular-nums}
/* popover / menus */
#pop{display:none;z-index:40;padding:6px;max-height:70vh;overflow:auto}
#pop.show{display:block}
.mi{display:flex;align-items:center;gap:10px;width:100%;border:0;background:transparent;padding:7px 10px;border-radius:6px;cursor:pointer;text-align:left;font-size:13.5px;min-width:200px}
.mi:hover{background:var(--hover)}
.mi:disabled{opacity:.38;cursor:default;background:transparent}
.mi .ic{width:18px;display:grid;place-items:center;color:#55556A}
.mi .ic svg{width:16px;height:16px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.mi .k{margin-left:auto;font-size:11.5px;color:var(--muted);padding-left:18px}
.mi.danger{color:var(--danger)}
.mi.on{color:var(--accent)}
.mi.on .ic{color:var(--accent)}
.mlabel{font:600 11px Inter;color:var(--muted);text-transform:uppercase;letter-spacing:.04em;padding:8px 10px 4px}
.mhr{height:1px;background:var(--line);margin:5px 4px}
.fontrow{display:flex;align-items:center;justify-content:space-between;gap:18px;width:100%;border:0;background:transparent;padding:8px 10px;border-radius:6px;cursor:pointer;text-align:left}
.fontrow:hover{background:var(--hover)}.fontrow.on{background:var(--accent-soft);color:var(--accent)}
.fontrow .k{font:500 11px Inter;color:var(--muted)}
.popsec{padding:4px 4px 6px}
.popsec+.popsec{border-top:1px solid var(--line);padding-top:8px}
.row{display:flex;gap:2px;flex-wrap:wrap;align-items:center}
/* comments */
#commentPop{display:none;width:300px;z-index:30;padding:0;overflow:hidden}
#commentPop.show{display:block}
#commentPop .ch{display:flex;align-items:center;gap:4px;padding:8px 8px 8px 14px;border-bottom:1px solid var(--line);font-weight:600;font-size:13px}
#commentPop .ch .sp{flex:1}
#commentPop .msgs{max-height:240px;overflow:auto}
#commentPop .msg{padding:10px 14px;font-size:13.5px;line-height:1.45;border-bottom:1px solid #F1F0EC}
#commentPop .msg .who{display:flex;align-items:center;gap:8px;font-weight:600;font-size:12.5px;margin-bottom:4px}
#commentPop .msg .who .av{width:22px;height:22px;border-radius:50%;background:linear-gradient(135deg,#6E62F0,#F08AA6);color:#fff;display:grid;place-items:center;font-size:10px}
#commentPop .msg .who .t{font-weight:500;color:var(--muted)}
#commentPop .msg .body{white-space:pre-wrap;word-break:break-word}
#commentPop .compose{padding:10px;display:flex;flex-direction:column;gap:8px}
#commentPop textarea{width:100%;min-height:62px;resize:vertical;border:1px solid var(--line);border-radius:8px;padding:8px 10px;font:13.5px Inter;outline:none}
#commentPop textarea:focus{border-color:var(--accent);box-shadow:0 0 0 3px var(--accent-soft)}
#commentPop .acts{display:flex;justify-content:flex-end;gap:6px}
/* misc */
#hint{position:fixed;left:50%;top:50%;transform:translate(-50%,-50%);text-align:center;color:var(--muted);pointer-events:none;display:none;font-size:14px;line-height:1.6}
#hint.show{display:block}
#hint b{display:block;font:600 20px Inter;color:#8A8A98;margin-bottom:4px}
#toast{position:fixed;left:50%;bottom:22px;transform:translate(-50%,20px);background:#23232F;color:#fff;padding:9px 14px;border-radius:9px;font-size:13px;font-weight:500;opacity:0;transition:.2s;pointer-events:none;z-index:80}
#toast.show{opacity:1;transform:translate(-50%,0)}
#dragGhost{position:fixed;left:0;top:0;pointer-events:none;z-index:90;display:none;opacity:.85}
.modal{position:fixed;inset:0;background:rgba(30,30,42,.32);display:none;align-items:center;justify-content:center;z-index:70}
.modal.show{display:flex}
.mcard{background:#fff;border-radius:14px;box-shadow:var(--shadow);padding:18px 22px 22px;max-width:min(720px,94vw);max-height:88vh;overflow:auto}
.mcard.wide{max-width:min(860px,94vw)}
.card-h{display:flex;align-items:center;justify-content:space-between;gap:20px;margin-bottom:6px}
.mcard h2{margin:0;font-size:18px;letter-spacing:-.01em}
.mcard p.sub{margin:0 0 16px;color:var(--muted);font-size:13px}
.keys{columns:2 300px;column-gap:32px;font-size:13px;margin-top:8px}
.keys .grp{break-inside:avoid;margin-bottom:16px}
.keys h3{font-size:12px;text-transform:uppercase;letter-spacing:.05em;color:var(--muted);margin:0 0 6px}
.keys .kr{display:flex;justify-content:space-between;align-items:center;gap:12px;padding:5px 0;border-bottom:1px solid #F1F0EC}
.keys .kr span:last-child{display:flex;gap:3px;align-items:center;flex-wrap:wrap;justify-content:flex-end}
.tpls{display:grid;grid-template-columns:repeat(auto-fill,minmax(180px,1fr));gap:14px}
.tpl{border:1px solid var(--line);border-radius:12px;background:#fff;cursor:pointer;padding:0;overflow:hidden;text-align:left;transition:box-shadow .15s,transform .15s}
.tpl:hover{box-shadow:0 0 0 2px var(--accent);transform:translateY(-1px)}
.tpl .pv{height:110px;background:var(--bg);display:grid;place-items:center}
.tpl .pv svg{width:150px;height:90px}
.tpl .nm{padding:10px 12px 2px;font-weight:600;font-size:14px}
.tpl .ds{padding:0 12px 12px;color:var(--muted);font-size:12.5px}
.pbtn{border:0;border-radius:8px;padding:9px 14px;font-weight:600;font-size:13px;cursor:pointer;background:#F2F1EE}
.pbtn.primary{background:var(--accent);color:#fff}
.pbtn:hover{filter:brightness(.96)}
.pbtn.sm{padding:6px 11px;font-size:12.5px}
#expImg{max-width:100%;max-height:55vh;display:block;margin:0 auto 16px;border-radius:8px;border:1px solid var(--line);background:#fff}
.row-btns{display:flex;gap:8px;justify-content:flex-end;flex-wrap:wrap}

/* ---------- v3: cards, links, rotation, rich text ---------- */
.item.card{background:#fff;border-radius:10px;box-shadow:0 0 0 1px rgba(30,30,42,.08),0 1px 2px rgba(20,20,40,.06),0 8px 18px -10px rgba(20,20,40,.28);overflow:hidden;display:flex}
.item.card .cbar{width:6px;flex:none}
.item.card .cin{flex:1;min-width:0;padding:13px 14px 12px 13px;display:flex;flex-direction:column;gap:6px}
.item.card .txt{line-height:1.3;color:var(--ink)}
.item.card .cdesc{font-size:13px;line-height:1.42;color:#55556A;white-space:pre-wrap;overflow-wrap:anywhere;display:-webkit-box;-webkit-line-clamp:4;-webkit-box-orient:vertical;overflow:hidden}
.item.card .cmeta{display:flex;align-items:center;gap:6px;margin-top:2px;min-height:24px}
.item.card .ctags{display:flex;flex-wrap:wrap;gap:4px;min-width:0}
.item.card .sp{flex:1}
.tag{display:inline-flex;align-items:center;gap:2px;font:600 11px/1 Inter,sans-serif;padding:4px 7px;border-radius:5px;background:hsl(var(--h) 80% 93%);color:hsl(var(--h) 55% 32%);white-space:nowrap}
.tag button{border:0;background:transparent;color:inherit;cursor:pointer;font-size:13px;line-height:1;padding:0 0 0 3px;opacity:.6}
.tag button:hover{opacity:1}
.item.card .cdue{font:600 11.5px Inter,sans-serif;color:#55556A;background:#F2F1EE;border-radius:5px;padding:4px 7px;white-space:nowrap}
.item.card .cdue.late{color:#B4262C;background:#FDECEC}
.item.card .cav{width:24px;height:24px;border-radius:50%;color:#fff;font:700 10px/24px Inter,sans-serif;text-align:center;flex:none;letter-spacing:.02em}
.olink{position:absolute;right:-10px;top:-10px;width:24px;height:24px;border-radius:50%;background:#fff;box-shadow:0 0 0 1px rgba(30,30,42,.12),0 2px 6px rgba(20,20,40,.18);display:grid;place-items:center;color:var(--accent);z-index:2;transform-origin:center;cursor:pointer}
.olink svg{width:14px;height:14px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
.olink:hover{background:var(--accent-soft)}
.txt a{color:#3E63DD;text-decoration:underline;text-underline-offset:2px;cursor:pointer}
.txt ul,.txt ol{margin:0;padding-left:1.35em;text-align:left}
.item.agent-touch{animation:agentglow 1.4s ease-out}
@keyframes agentglow{0%{filter:drop-shadow(0 0 0 rgba(142,78,198,0))}25%{filter:drop-shadow(0 0 10px rgba(142,78,198,.75))}100%{filter:drop-shadow(0 0 0 rgba(142,78,198,0))}}
#overlay .rh{pointer-events:all;cursor:grab}
#overlay .rh circle{fill:#fff;stroke:var(--accent);stroke-width:1.5}
#overlay .rh path{fill:none;stroke:var(--accent);stroke-width:1.6;stroke-linecap:round;stroke-linejoin:round;pointer-events:none}
#overlay .rh:hover circle{fill:var(--accent-soft)}
#overlay .ang{font:600 11px Inter,sans-serif;fill:#fff}
.linkform{display:flex;gap:6px;align-items:center;padding:4px;min-width:300px}
.linkform input{flex:1;min-width:0;border:1px solid var(--line);border-radius:7px;padding:7px 9px;font:13px Inter,sans-serif;outline:none}
.linkform input:focus{border-color:var(--accent);box-shadow:0 0 0 3px var(--accent-soft)}
.linkform.col{flex-direction:column;align-items:stretch;width:320px}
.linkform .lf-row{display:flex;gap:6px}
.linkform .lf-list{max-height:220px;overflow:auto;margin:0 -4px}
.linkform .lf-list .mi{min-width:0;font-size:13px;padding:6px 10px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;display:flex}
.pbtn.danger{color:var(--danger);background:#FBEDEE}

/* card details panel */
#cardPanel{right:12px;top:72px;width:340px;max-height:calc(100vh - 150px);overflow:auto;padding:14px 16px 16px;display:none;z-index:30}
#cardPanel.show{display:block;animation:slidein .18s ease-out}
@keyframes slidein{from{opacity:0;translate:12px 0}to{opacity:1;translate:0 0}}
.cp-h{display:flex;align-items:center;gap:8px;margin-bottom:6px;font-size:14px}
.cp-h .ib{margin-left:auto}
.cp-dot{width:12px;height:12px;border-radius:3px}
.cp-l{display:block;font:600 11px Inter,sans-serif;color:var(--muted);text-transform:uppercase;letter-spacing:.04em;margin:12px 0 5px}
.cp-in{width:100%;border:1px solid var(--line);border-radius:8px;padding:8px 10px;font:14px/1.4 Inter,sans-serif;color:var(--ink);outline:none;resize:vertical;background:#fff}
.cp-in:focus{border-color:var(--accent);box-shadow:0 0 0 3px var(--accent-soft)}
.cp-title{font-weight:600;font-size:15px}
.cp-row{display:grid;grid-template-columns:1fr 1fr;gap:10px}
.cp-tags{display:flex;flex-wrap:wrap;gap:5px;align-items:center;border:1px solid var(--line);border-radius:8px;padding:5px 6px;min-height:38px}
.cp-tags:focus-within{border-color:var(--accent);box-shadow:0 0 0 3px var(--accent-soft)}
.cp-tagl{display:contents}
.cp-tagin{border:0;outline:none;font:13px Inter,sans-serif;flex:1;min-width:80px;padding:3px}
.cp-colors{display:flex;flex-wrap:wrap;gap:2px}
.cp-foot{display:flex;align-items:center;gap:8px;margin-top:16px}
.cp-foot .sp{flex:1}

/* command palette */
.modal.pal{align-items:flex-start;background:rgba(30,30,42,.18)}
.palbox{position:relative;margin-top:12vh;width:min(580px,94vw);padding:0;overflow:hidden;display:flex;flex-direction:column;max-height:min(520px,76vh)}
.pal-in{display:flex;align-items:center;gap:10px;padding:0 16px;border-bottom:1px solid var(--line);flex:none}
.pal-in svg{width:18px;height:18px;fill:none;stroke:var(--muted);stroke-width:2;stroke-linecap:round;flex:none}
.pal-in input{flex:1;border:0;outline:none;font:15px Inter,sans-serif;padding:15px 0;background:transparent;color:var(--ink);min-width:0}
#palList{overflow:auto;padding:6px;flex:1}
#palList .mi{min-width:0}
#palList .mi.act{background:var(--accent-soft)}
#palList .mi.act .ic{color:var(--accent)}
#palList .pl{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
#palList .ic svg path{fill:none}
.pal-empty{padding:22px;text-align:center;color:var(--muted);font-size:13px}
.pal-foot{display:flex;gap:16px;padding:8px 14px;border-top:1px solid var(--line);font-size:11.5px;color:var(--muted);flex:none}
.pal-foot kbd{margin-right:3px;font-size:10px}

/* agents */
.ag-status{border-radius:10px;padding:10px 12px;font-size:13px;line-height:1.5;background:#F6F5F1;margin-bottom:14px}
.ag-status.on{background:#EAF7EF}
.ag-status code,#agentModal p code{font:12px JetBrains Mono,monospace;background:rgba(30,30,42,.06);padding:1px 5px;border-radius:4px}
.ag-b{margin-bottom:12px}
.ag-t{display:flex;align-items:center;justify-content:space-between;gap:10px;font-size:13px;font-weight:600;margin-bottom:5px}
.ag-b pre{margin:0;background:#1F1F2B;color:#E9E9F2;border-radius:9px;padding:11px 13px;font:12px/1.5 JetBrains Mono,monospace;overflow:auto;white-space:pre}
#agentModal p.sub{margin-bottom:12px}

/* file badge, people, cursors */
#fileState{display:none;align-items:center;gap:6px;border:0;background:transparent;height:30px;padding:0 8px;border-radius:7px;cursor:pointer;font:500 12px Inter,sans-serif;color:var(--muted);position:relative;max-width:220px}
#fileState.show{display:inline-flex}
#fileState:hover{background:var(--hover)}
#fileState svg{width:15px;height:15px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round;flex:none}
#fileState .fn{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:var(--ink)}
#fileState .st{white-space:nowrap}
#fileState[data-s=saved] .st{color:#2F9E63}
#fileState[data-s=error] .st{color:var(--danger)}
#fileState[data-s=auth] .st,#fileState[data-s=offline] .st{color:#B26A00}
#fileState[data-s=conflict] .st{color:var(--danger)}
#fileState[data-s=auth] svg,#fileState[data-s=offline] svg{stroke:#C27A0A}
#fileState[data-s=error] svg,#fileState[data-s=conflict] svg{stroke:var(--danger)}
/* Google Drive dialog */
.mcard.gd{width:min(520px,94vw)}
.gd-load{padding:26px 4px;color:var(--muted);font-size:13.5px;text-align:center}
.gd-list{display:flex;flex-direction:column;gap:2px;max-height:min(52vh,420px);overflow:auto;margin:0 -8px 14px;padding:0 2px}
.gd-row{display:flex;align-items:center;gap:10px;border:0;background:transparent;border-radius:9px;padding:10px 10px;text-align:left;cursor:pointer;font:500 14px Inter,sans-serif;color:var(--ink);min-height:44px}
.gd-row:hover{background:var(--hover)}
.gd-row.on{background:#EEF0FF}
.gd-row svg{width:18px;height:18px;flex:none;fill:none;stroke:#6E62F0;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.gd-n{flex:1;min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.gd-m{color:var(--muted);font-size:12.5px;white-space:nowrap}
.gd-empty{padding:22px 10px;color:var(--muted);font-size:13.5px;text-align:center;background:#F7F6F3;border-radius:10px;margin:0 8px}
.gd-foot{align-items:center}
.gd-sp{flex:1}
.gd-h{margin:4px 0 6px;font-size:13px;font-weight:600}
.gd-steps{margin:0 0 14px;padding-left:20px;font-size:13px;line-height:1.55;color:#3A3A48}
.gd-steps li{margin-bottom:5px}
.gd-steps a,.gd-more a{color:#5A4FE0}
.gd-steps code{font:12px JetBrains Mono,monospace;background:rgba(30,30,42,.06);padding:1px 5px;border-radius:4px;word-break:break-all}
.gd-f{display:flex;flex-direction:column;gap:5px;font-size:12.5px;font-weight:600;color:#3A3A48;margin-bottom:12px}
.gd-f input{font:13px JetBrains Mono,monospace;border:1px solid #DDDBD4;border-radius:8px;padding:9px 10px;outline:none;background:#fff;color:var(--ink);min-width:0}
.gd-f input:focus{border-color:#6E62F0;box-shadow:0 0 0 3px rgba(110,98,240,.16)}
.gd-more{margin:0 0 14px;font-size:13px;color:#3A3A48}
.gd-more summary{cursor:pointer;color:var(--muted);margin-bottom:8px}
.gd-more p{margin:0 0 10px;line-height:1.5}
.gd-choices{display:flex;flex-direction:column;gap:8px}
.gd-choice{display:flex;flex-direction:column;gap:3px;text-align:left;border:1px solid #E4E2DC;background:#fff;border-radius:11px;padding:11px 13px;cursor:pointer;font:500 13px Inter,sans-serif;color:var(--muted)}
.gd-choice b{color:var(--ink);font-size:14px;font-weight:600}
.gd-choice:hover{border-color:#6E62F0;background:#FAFAFF}
#peers{display:none;align-items:center;margin-right:4px}
#peers.show{display:flex}
#peers .av{width:28px;height:28px;border-radius:50%;border:2px solid #fff;margin-left:-6px;color:#fff;font:700 10.5px/24px Inter,sans-serif;text-align:center;position:relative;padding:0;display:grid;place-items:center;flex:none}
#peers .av.me{cursor:pointer}
#peers .av svg{width:15px;height:15px;fill:none;stroke:#fff;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
#peers .sdot{width:8px;height:8px;border-radius:50%;margin:0 12px 0 4px;position:relative;background:#A2A2B2}
#peers .sdot.on{background:#2F9E63;box-shadow:0 0 0 3px #DDF3E5}
#peers .sdot.wait{background:#F2C200;animation:blink 1s infinite}
#peers .sdot.off{background:var(--danger)}
@keyframes blink{50%{opacity:.35}}
#cursors{position:absolute;inset:0;pointer-events:none;overflow:hidden}
.cur{position:absolute;left:0;top:0;transition:translate .09s linear,opacity .4s}
.cur svg{width:18px;height:18px;display:block;fill:var(--c);stroke:#fff;stroke-width:1.4;stroke-linejoin:round;filter:drop-shadow(0 1px 1px rgba(0,0,0,.25))}
.cur span{position:absolute;left:14px;top:16px;background:var(--c);color:#fff;font:600 11.5px/1 Inter,sans-serif;padding:4px 7px;border-radius:6px;white-space:nowrap}
.cur.idle{opacity:.35}
#agentPill{position:fixed;left:50%;top:70px;transform:translate(-50%,-8px);background:#fff;border-radius:20px;box-shadow:var(--shadow);padding:7px 14px 7px 10px;font-size:13px;display:flex;align-items:center;gap:7px;opacity:0;pointer-events:none;transition:.2s;z-index:25;color:#33333F}
#agentPill.show{opacity:1;transform:translate(-50%,0)}
#agentPill svg{width:16px;height:16px;fill:none;stroke:#8E4EC6;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
#agentPill b{color:#8E4EC6}

@media (hover:none){
  [data-tip]:hover::after{display:none}
  .ib:hover,.chip:hover,.mi:hover,.fontrow:hover,#zoomPct:hover{background:transparent}
  .ib.on:hover,.chip.on:hover,.fontrow.on:hover{background:var(--accent-soft)}
}
@media (max-width:700px){
  #title{width:120px}
  #topLeft .brand,#topLeft .vsep{display:none}
  #topLeft{height:44px}#topRight{height:44px}
  #toolbar{top:64px;transform:none;left:8px;max-height:calc(100vh - 190px)}
  #toolbar .ib{width:38px;height:36px}
  #undoBar{display:none}
  #flyout{left:60px}
  #nav{right:8px;bottom:8px;height:44px}
  #framesBtn{left:8px;bottom:8px;height:44px}
  #framesBtn .lbltxt{display:none}
  #mmBtn,#nav .vsep,.hide-sm{display:none}
  #ctx{left:50%!important;top:auto!important;bottom:60px;flex-wrap:nowrap;overflow-x:auto;justify-content:flex-start;scrollbar-width:none;width:auto}
  #ctx::-webkit-scrollbar{display:none}
  #searchBar{top:62px;width:calc(100vw - 16px)}
  #searchBar input{width:auto;flex:1;min-width:0}
}
@media (max-width:420px){ #topRight #exportBtn{display:none} }
@media (max-width:700px){
  #fileState .fn,#fileState .st{display:none}
  #fileState{padding:0 6px}
  #cardPanel{left:8px;right:8px;top:auto;bottom:8px;width:auto;max-height:70vh;border-radius:14px}
  .palbox{margin-top:10px}
  .pal-foot{display:none}
  #peers .av:not(.me){display:none}
  #peers .sdot{margin:0 8px 0 2px}
  .linkform.col{width:min(320px,calc(100vw - 32px))}
}
/* custom colors */
.ccrow{border-top:1px solid var(--line);margin-top:6px;padding-top:6px}
.sw.add{background:#F6F6F3;box-shadow:inset 0 0 0 1px rgba(0,0,0,.14);display:grid;place-items:center;color:#55556A}
.sw.add:hover{background:#ECECE8;color:#1E1E2A}
.sw.add svg{width:13px;height:13px;fill:none;stroke:currentColor;stroke-width:2.2;stroke-linecap:round}
.cpick{width:204px;display:flex;flex-direction:column;gap:10px;padding:2px 2px 4px}
.cp-head{display:flex;align-items:center;gap:2px;min-height:28px;padding-left:4px;font:600 12.5px Inter;color:#33333F}
.cp-head .chip{height:28px;min-width:28px;padding:0;margin-left:-4px}
.cp-head .chip svg{width:18px;height:18px}
.cp-sv{position:relative;height:132px;border-radius:8px;cursor:crosshair;touch-action:none;
  background-image:linear-gradient(to top,#000,rgba(0,0,0,0)),linear-gradient(to right,#fff,rgba(255,255,255,0));box-shadow:inset 0 0 0 1px rgba(0,0,0,.08)}
.cp-hue{position:relative;height:12px;border-radius:6px;margin:0 7px;cursor:pointer;touch-action:none;
  background:linear-gradient(to right,#f00 0%,#ff0 16.66%,#0f0 33.33%,#0ff 50%,#00f 66.66%,#f0f 83.33%,#f00 100%)}
.cp-sv::after,.cp-hue::after{content:"";position:absolute;inset:-5px -7px}
.cp-sv i,.cp-hue i{position:absolute;z-index:1;width:16px;height:16px;border-radius:50%;transform:translate(-50%,-50%);pointer-events:none;
  box-shadow:0 0 0 2.5px #fff,0 0 0 3.5px rgba(0,0,0,.22),0 2px 6px rgba(0,0,0,.28)}
.cp-hue i{top:50%}
.cp-row{display:flex;align-items:center;gap:6px}
.cp-prev{width:30px;height:30px;border-radius:7px;flex:none;box-shadow:inset 0 0 0 1px rgba(0,0,0,.14)}
.cp-hexw{flex:1;min-width:0;display:flex;align-items:center;gap:1px;height:30px;padding:0 8px;border-radius:7px;border:1px solid var(--line);font:500 13px Inter;color:var(--muted);cursor:text}
.cp-hexw:focus-within{border-color:var(--accent);box-shadow:0 0 0 3px var(--accent-soft)}
.cp-hex{flex:1;min-width:0;width:100%;border:0;outline:0;padding:0;background:transparent;font:500 13px Inter;color:#1E1E2A;text-transform:uppercase;font-variant-numeric:tabular-nums;letter-spacing:.02em}
.cp-row .chip{width:30px;min-width:30px;height:30px;padding:0}
.cp-row .chip svg{width:17px;height:17px}
.cp-sys{overflow:hidden}
.cp-native{position:absolute;inset:0;width:100%;height:100%;opacity:0;border:0;padding:0;margin:0;cursor:pointer}
@media (pointer:coarse){ .cp-hex{font-size:16px} .cp-sv{height:150px} }
/* cloud boards */
.cb-new{display:flex;gap:8px;margin:2px 0 14px}
.cb-new input{flex:1;min-width:0;height:38px;border:1px solid var(--line);border-radius:9px;padding:0 12px;font:500 14px Inter,sans-serif;outline:0}
.cb-new input:focus{border-color:var(--accent);box-shadow:0 0 0 3px var(--accent-soft)}
.cb-row{display:flex;align-items:center;gap:4px}
.cb-row .gd-row{flex:1;min-width:0}
.cb-del{width:34px;height:34px;opacity:.55}
.cb-del:hover{opacity:1}
.cb-del svg{width:17px;height:17px}
@media (pointer:coarse){ .cb-new input{font-size:16px} .cb-del{opacity:.8} }

/* ---------- accounts and sharing (cloud boards) ---------- */
#roleTag{display:none;margin-left:2px;padding:3px 9px;border-radius:20px;background:#FFF4D6;color:#8A5A00;font-size:12px;font-weight:600;white-space:nowrap}
body.ro #roleTag{display:inline-block}
#shareBtn{display:none;margin-left:6px;border:0;border-radius:8px;height:34px;padding:0 15px;background:var(--accent);color:#fff;font-weight:600;font-size:13.5px;cursor:pointer}
#shareBtn.show{display:inline-flex;align-items:center}
#shareBtn:hover{background:var(--accent-2)}
body.ro #toolbar [data-tool]:not([data-tool="select"]):not([data-tool="hand"]):not([data-tool="comment"]){display:none}
body.ro-view #toolbar [data-tool="comment"]{display:none}
body.ro #undoBar,body.ro #ctx,body.ro #flyout,body.ro #hint{display:none!important}
body.ro #overlay .h,body.ro #overlay .rh,body.ro #overlay .qd,body.ro #overlay .cp{display:none}
body.ro #title{cursor:default}
body.ro #title:hover{background:transparent}
.ac-av{width:32px;height:32px;border-radius:50%;flex:none;display:grid;place-items:center;color:#fff;font:700 12px Inter,sans-serif}
.ac-av.pending{background:#EEEDE8;color:#8A8A96}
.ac-av.team{background:#EEF0FF;color:#5A4FE0}
.ac-av svg{width:17px;height:17px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}

#signinModal{background:rgba(244,244,241,.72);-webkit-backdrop-filter:blur(10px);backdrop-filter:blur(10px);z-index:90}
.si-card{width:min(400px,92vw);padding:26px 28px 24px;border-radius:18px;box-shadow:0 1px 2px rgba(20,20,40,.06),0 24px 60px -18px rgba(20,20,40,.28)}
.si-brand{display:flex;align-items:center;gap:9px;font:700 17px Inter,sans-serif;letter-spacing:-.01em;margin-bottom:20px}
.si-logo{display:flex}
.si-card h2{font-size:21px!important;letter-spacing:-.02em!important;margin:0 0 6px!important}
.si-card p.sub{font-size:14px!important;line-height:1.5;margin-bottom:18px!important}
.si-card p.sub b{color:var(--ink);font-weight:600}
.si-form{display:flex;flex-direction:column;gap:10px}
.si-in{height:46px;border:1px solid #DDDBD4;border-radius:11px;padding:0 14px;font:500 15px Inter,sans-serif;color:var(--ink);outline:0;background:#fff;min-width:0}
.si-in:focus{border-color:#6E62F0;box-shadow:0 0 0 3px rgba(110,98,240,.16)}
.si-code{font:600 26px JetBrains Mono,monospace;letter-spacing:.35em;text-align:center;height:58px;padding-left:.35em}
.si-code::placeholder{color:#D9D7D0}
.si-err{min-height:0;color:var(--danger);font-size:13px;line-height:1.4}
.si-err:empty{display:none}
.si-go{height:44px;font-size:14.5px;border-radius:11px}
.si-go:disabled{opacity:.7;cursor:default}
.si-links{display:flex;justify-content:center;gap:8px;margin-top:14px;color:var(--muted);font-size:13px}
.si-links button,.si-skip{border:0;background:none;color:#5A4FE0;cursor:pointer;font-size:13px;padding:2px}
.si-skip{display:flex;flex-direction:column;align-items:center;gap:2px;width:100%;margin-top:18px;padding-top:16px;border-top:1px solid var(--line);color:var(--ink);font-weight:500}
.si-skip span{color:var(--muted);font-size:12px;font-weight:400}
.si-skip:hover{color:#5A4FE0}
.si-acts{display:flex;gap:8px;flex-wrap:wrap}

.mcard.sh{width:min(540px,94vw)}
.sh-inv{display:flex;gap:8px;margin:6px 0 4px}
.sh-inv input{flex:1;min-width:0;height:38px;border:1px solid #DDDBD4;border-radius:9px;padding:0 12px;font:500 14px Inter,sans-serif;outline:0;color:var(--ink)}
.sh-inv input:focus{border-color:#6E62F0;box-shadow:0 0 0 3px rgba(110,98,240,.16)}
.sh-msg{color:var(--danger);font-size:12.5px;min-height:6px;margin-bottom:6px}
.sh-h{font-size:12px;font-weight:600;color:var(--muted);text-transform:uppercase;letter-spacing:.04em;margin:12px 0 4px}
.sh-list{display:flex;flex-direction:column;max-height:min(40vh,320px);overflow:auto}
.sh-row{display:flex;align-items:center;gap:11px;padding:8px 0;min-height:48px}
.sh-who{flex:1;min-width:0;display:flex;flex-direction:column;gap:1px}
.sh-who b{font-size:14px;font-weight:600;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.sh-who span{font-size:12.5px;color:var(--muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.sh-role{font-size:13px;color:var(--muted);white-space:nowrap}
.sh-sel{appearance:none;-webkit-appearance:none;border:1px solid transparent;background:#F4F3EF url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236E6E7E' stroke-width='2.4' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 9px center;border-radius:8px;height:34px;padding:0 28px 0 11px;font:500 13px Inter,sans-serif;color:var(--ink);cursor:pointer;flex:none}
.sh-sel:hover{background-color:#ECEBE6}
.sh-sel:focus{outline:0;border-color:#6E62F0}
.sh-foot{margin-top:14px;justify-content:flex-start}
.sh-foot .pbtn{display:inline-flex;align-items:center;gap:7px}
.sh-foot svg{width:15px;height:15px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
@media (max-width:700px){
  #shareBtn{height:32px;padding:0 12px;margin-left:2px}
  #roleTag{font-size:11px;padding:2px 7px}
}
@media (pointer:coarse){ .si-in,.sh-inv input{font-size:16px} .si-code{font-size:26px} .sh-sel{font-size:16px;height:38px} }
.cb-h{font-size:12px;font-weight:600;color:var(--muted);text-transform:uppercase;letter-spacing:.04em;margin:6px 0 4px}
.cb-empty{margin:0 0 12px;padding:14px 10px}
#cloudBody .gd-list{max-height:min(30vh,260px)}

/* ---------- home: all your boards ---------- */
#homeBtn{display:flex;align-items:center;gap:8px;border:0;background:none;padding:4px 6px 4px 2px;margin-left:-2px;border-radius:8px;cursor:pointer}
#homeBtn:hover{background:var(--hover)}
#homeBtn.inert{cursor:default;pointer-events:none}
body.at-home>*:not(#home):not(#pop):not(#toast):not(.modal){display:none!important}
#home{position:fixed;inset:0;z-index:35;display:grid;grid-template-columns:252px 1fr;background:var(--bg);color:var(--ink);overflow:hidden;
  --card:#FFFFFF;--soft:#F7F6F3;--line2:rgba(30,30,42,.08)}
#home[hidden]{display:none}
#home svg{width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round;flex:none}
#home button{border:0;background:none;cursor:pointer;font:inherit;color:inherit}
#home button:focus-visible,#home [data-open]:focus-visible,#home select:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
#home .sr{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0)}
#home .ac-av{width:32px;height:32px;font-size:12px}
#home .ac-av.sk{background:#E6E5E0}

.hm-side{display:flex;flex-direction:column;padding:18px 14px 14px;gap:18px;min-height:0}
.hm-brand{display:flex;align-items:center;gap:10px;padding:2px 4px 2px 8px;font-weight:700;font-size:19px;letter-spacing:-.02em}
.hm-brand .hm-logo{display:grid}
.hm-plus{margin-left:auto;width:40px;height:40px;border-radius:11px;display:grid;place-items:center;background:var(--ink)!important;color:#fff!important;box-shadow:0 2px 6px rgba(20,20,40,.18);transition:transform .12s}
.hm-plus:hover{transform:translateY(-1px)}
.hm-plus:disabled{opacity:.5}
.hm-navs{display:flex;flex-direction:column;gap:2px}
.hm-nav{display:flex;align-items:center;gap:12px;height:42px;padding:0 12px;border-radius:10px;font-size:15px;font-weight:500;color:#3C3C48!important;text-align:left}
.hm-nav:hover{background:rgba(30,30,42,.05)!important}
.hm-nav.on{background:#E9E8E3!important;color:var(--ink)!important;font-weight:600}
.hm-nav.on svg{stroke-width:2}
.hm-navs .hm-nav[data-hm="view:search"]{display:none}
.hm-foot{margin-top:auto;border-top:1px solid var(--line2);padding-top:12px}
.hm-me{display:flex;align-items:center;gap:10px;width:100%;padding:6px 8px;border-radius:10px;text-align:left;min-width:0}
.hm-me:hover{background:rgba(30,30,42,.05)!important}
.hm-mn{display:flex;flex-direction:column;min-width:0;line-height:1.25}
.hm-mn b{font-size:14px;font-weight:600;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.hm-mn span{font-size:12px;color:var(--muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}

.hm-main{display:flex;flex-direction:column;min-width:0;min-height:0;margin:10px 10px 10px 0;background:var(--card);border-radius:18px;box-shadow:0 0 0 1px var(--line2),0 8px 30px -14px rgba(20,20,40,.18);overflow:hidden}
.hm-top{display:flex;align-items:center;gap:12px;padding:16px 28px 8px}
.hm-mlogo{display:none;align-items:center;gap:9px;font-size:18px;letter-spacing:-.02em;min-width:0}
.hm-mlogo b{font-weight:700;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.hm-mlogo svg{width:28px!important;height:28px!important;stroke:none!important}
.hm-search{flex:1;max-width:460px;display:flex;align-items:center;gap:8px;height:42px;padding:0 12px;border-radius:11px;background:var(--soft);box-shadow:inset 0 0 0 1px var(--line2);color:var(--muted);cursor:text;transition:box-shadow .15s,background .15s}
.hm-search:focus-within{background:#fff;box-shadow:inset 0 0 0 1.5px var(--accent),0 0 0 4px var(--accent-soft)}
.hm-search input{flex:1;min-width:0;border:0;outline:0;background:none;font:500 14.5px Inter,sans-serif;color:var(--ink)}
.hm-search input::-webkit-search-cancel-button{cursor:pointer}
.hm-top .hm-me.sm{display:none;width:auto;padding:2px;border-radius:50%}
.hm-scroll{flex:1;overflow:auto;padding:8px 28px 40px;overscroll-behavior:contain;-webkit-overflow-scrolling:touch}
#home h2{font-size:19px;font-weight:650;letter-spacing:-.015em;margin:0}

.hm-start{background:var(--soft);border-radius:16px;padding:18px 20px 20px;margin:6px 0 28px}
.hm-start h2{margin-bottom:14px!important}
.hm-tpls{display:grid;grid-auto-flow:column;grid-auto-columns:minmax(150px,1fr);gap:14px;overflow-x:auto;scroll-snap-type:x mandatory;padding:2px 2px 4px;margin:-2px}
.hm-tpl{display:flex;flex-direction:column;gap:9px;text-align:left;scroll-snap-align:start;min-width:0}
.hm-tv{display:grid;place-items:center;aspect-ratio:16/10;border-radius:12px;background:#fff;box-shadow:0 0 0 1px var(--line2);overflow:hidden;transition:box-shadow .15s,transform .15s}
.hm-tv svg{width:100%!important;height:100%!important;stroke:none!important;fill:initial!important}
.hm-tpl:hover .hm-tv{box-shadow:0 0 0 1.5px var(--accent),0 6px 16px -6px rgba(60,60,160,.3);transform:translateY(-1px)}
.hm-tpl.blank .hm-tv{background:#fff;color:var(--ink)}
.hm-tpl.blank .hm-tv svg{width:30px!important;height:30px!important;stroke:currentColor!important;fill:none!important;stroke-width:1.6}
.hm-tn{font-size:13.5px;font-weight:600;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}

.hm-lh{display:flex;align-items:center;gap:12px;flex-wrap:wrap;margin-bottom:10px}
.hm-n{font-size:13px;font-weight:600;color:var(--muted);background:var(--soft);border-radius:20px;padding:2px 8px;vertical-align:3px;margin-left:4px}
.hm-tools{margin-left:auto;display:flex;align-items:center;gap:8px}
.hm-sel select{appearance:none;-webkit-appearance:none;border:0;background:var(--soft) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%236E6E7E' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat right 10px center;
  box-shadow:inset 0 0 0 1px var(--line2);border-radius:9px;height:36px;padding:0 28px 0 11px;font:500 13px Inter,sans-serif;color:var(--ink);cursor:pointer}
.hm-lay{display:flex;background:var(--soft);border-radius:9px;padding:3px;box-shadow:inset 0 0 0 1px var(--line2)}
.hm-lay button{width:32px;height:30px;border-radius:7px;display:grid;place-items:center;color:var(--muted)!important}
.hm-lay button.on{background:#fff!important;color:var(--ink)!important;box-shadow:0 1px 2px rgba(20,20,40,.12)}
.hm-lay svg{width:17px!important;height:17px!important}

.hm-row{display:grid;grid-template-columns:44px minmax(0,1fr) 140px 130px 150px 76px;align-items:center;gap:14px;padding:9px 10px;border-radius:12px;cursor:pointer;outline-offset:-2px}
.hm-row:not(.hm-head):hover{background:var(--soft)}
.hm-head{cursor:default;font-size:12.5px;font-weight:600;color:var(--muted);padding-top:4px;padding-bottom:6px;border-bottom:1px solid var(--line2);border-radius:0;margin-bottom:4px}
.hm-ic{width:44px;height:44px;border-radius:10px;overflow:hidden;background:#fff;box-shadow:0 0 0 1px var(--line2);display:grid;place-items:center}
.hm-head .hm-ic{visibility:hidden;height:0}
.hm-ic img,.hm-pv img{width:100%;height:100%;object-fit:cover;display:block}
.hm-ic.empty,.hm-pv.empty{background:linear-gradient(135deg,hsl(var(--h) 70% 92%),hsl(calc(var(--h) + 40) 70% 88%));box-shadow:none;color:hsl(var(--h) 45% 32%);font-weight:700;font-size:14px;letter-spacing:.02em}
.hm-name{display:flex;flex-direction:column;gap:2px;min-width:0}
.hm-name b{font-size:15px;font-weight:600;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.hm-name span{font-size:12.5px;color:var(--muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.hm-head .hm-name{font-size:12.5px}
.hm-c{font-size:13.5px;color:#4A4A57;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.hm-head .hm-c{font-size:12.5px;color:var(--muted)}
.hm-acts{display:flex;justify-content:flex-end;gap:2px}
.hm-star,.hm-more{width:34px;height:34px;border-radius:9px;display:grid;place-items:center;color:#8A8A98!important}
.hm-star:hover,.hm-more:hover{background:rgba(30,30,42,.07)!important;color:var(--ink)!important}
.hm-star svg,.hm-more svg{width:19px!important;height:19px!important}
.hm-row:not(:hover):not(:focus-within) .hm-star:not(.on),.hm-row:not(:hover):not(:focus-within) .hm-more,
.hm-card:not(:hover):not(:focus-within) .hm-star:not(.on),.hm-card:not(:hover):not(:focus-within) .hm-more{opacity:0}
.hm-star.on{color:#E8A400!important}
.hm-star.on svg{fill:#FFC21A;stroke:#E8A400}
@media (hover:none){.hm-row .hm-star,.hm-row .hm-more,.hm-card .hm-star,.hm-card .hm-more{opacity:1!important}}

.hm-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(220px,1fr));gap:18px 16px;padding-top:4px}
.hm-card{position:relative;display:flex;flex-direction:column;gap:9px;cursor:pointer;border-radius:14px;outline-offset:3px}
.hm-pv{display:grid;place-items:center;aspect-ratio:16/10;border-radius:12px;overflow:hidden;background:#fff;box-shadow:0 0 0 1px var(--line2);transition:box-shadow .15s}
.hm-pv.empty{font-size:26px}
.hm-card:hover .hm-pv{box-shadow:0 0 0 1.5px var(--accent),0 8px 18px -8px rgba(60,60,160,.35)}
.hm-cn{display:flex;flex-direction:column;gap:2px;min-width:0;padding:0 2px}
.hm-cn b{font-size:14.5px;font-weight:600;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.hm-cn span{font-size:12.5px;color:var(--muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.hm-card .hm-acts{position:absolute;top:8px;right:8px;gap:4px}
.hm-card .hm-star,.hm-card .hm-more{background:rgba(255,255,255,.94)!important;box-shadow:0 1px 3px rgba(20,20,40,.16);width:32px;height:32px}

.hm-empty{display:flex;flex-direction:column;align-items:center;text-align:center;gap:6px;padding:56px 20px;color:var(--muted)}
.hm-empty svg{width:34px!important;height:34px!important;color:#B4B3BE;margin-bottom:6px}
.hm-empty b{color:var(--ink);font-size:16px;font-weight:600}
.hm-empty span{font-size:14px;max-width:340px;line-height:1.45}
.hm-skel .hm-row{cursor:default}
.hm-skel .hm-ic,.hm-skel b,.hm-skel .hm-name span{background:linear-gradient(90deg,#EFEEEA,#F7F6F3,#EFEEEA);background-size:200% 100%;animation:hmsk 1.2s infinite linear;box-shadow:none;border-radius:8px}
.hm-skel b{height:14px;width:38%}.hm-skel .hm-name span{height:11px;width:22%}
@keyframes hmsk{to{background-position:-200% 0}}
.hm-tabs,.hm-fab{display:none}

@media (max-width:1100px){
  .hm-row{grid-template-columns:44px minmax(0,1fr) 120px 130px 76px}
  .hm-own{display:none}
}
@media (max-width:760px){
  #home{grid-template-columns:1fr;grid-template-rows:1fr auto}
  .hm-side{display:none}
  .hm-main{margin:0;border-radius:0;box-shadow:none;background:var(--bg)}
  .hm-top{padding:calc(10px + env(safe-area-inset-top)) 16px 8px;gap:10px;flex-wrap:wrap}
  .hm-mlogo{display:flex;flex:1}
  .hm-top .hm-me.sm{display:flex;order:2}
  .hm-search{order:3;flex:1 0 100%;max-width:none;background:#fff;height:44px}
  .hm-search input{font-size:16px}
  .hm-scroll{padding:6px 16px calc(96px + env(safe-area-inset-bottom))}
  .hide-sm{display:none}
  #home h2{font-size:17px}
  .hm-start{background:none;padding:6px 0 0;margin:0 0 22px}
  .hm-tpls{grid-auto-columns:132px;margin:-2px -16px;padding:2px 16px 4px;scroll-padding:0 16px;scrollbar-width:none}
  .hm-tpls::-webkit-scrollbar{display:none}
  .hm-tv{background:#fff}
  .hm-tn{font-size:13px}
  .hm-lh{gap:8px}
  .hm-tools{margin-left:0;width:100%}
  .hm-sel{flex:1;min-width:0}.hm-sel select{width:100%}
  .hm-head{display:none}
  .hm-table{background:#fff;border-radius:16px;box-shadow:0 0 0 1px var(--line2);padding:4px}
  .hm-row{grid-template-columns:52px minmax(0,1fr) auto;gap:12px;padding:8px 6px 8px 8px}
  .hm-c{display:none}
  .hm-ic{width:52px;height:52px;border-radius:11px}
  .hm-row .hm-star:not(.on){display:none}
  .hm-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:16px 12px}
  .hm-tabs{display:flex;justify-content:space-around;background:rgba(255,255,255,.94);-webkit-backdrop-filter:blur(14px);backdrop-filter:blur(14px);border-top:1px solid var(--line2);padding:6px 6px calc(6px + env(safe-area-inset-bottom))}
  .hm-tabs .hm-nav{flex:1;flex-direction:column;gap:3px;height:auto;padding:6px 0;font-size:11px;font-weight:600;justify-content:center;color:#7A7A88!important;background:none!important}
  .hm-tabs .hm-nav.on{color:var(--accent)!important}
  .hm-tabs .hm-nav.on svg{fill:var(--accent-soft)}
  .hm-tabs svg{width:23px!important;height:23px!important}
  .hm-fab{display:grid;place-items:center;position:fixed;right:18px;bottom:calc(78px + env(safe-area-inset-bottom));width:56px;height:56px;border-radius:18px;background:var(--ink)!important;color:#fff!important;box-shadow:0 8px 22px -6px rgba(20,20,40,.45);z-index:2}
  .hm-fab svg{width:26px!important;height:26px!important;stroke-width:2}
}
