:root{--bg:#ebecee;--ink:#2b2f3a;--mute:#8a909c;--line:#5b6270;--acc:#3d6bff;--card:#fff;--shadow:0 1px 2px rgba(20,25,40,.12),0 2px 8px rgba(20,25,40,.06)}
*{box-sizing:border-box}
html,body{margin:0;height:100%;overflow:hidden;font:14px/1.45 -apple-system,"Segoe UI",Roboto,sans-serif;color:var(--ink);background:var(--bg)}
button{font:inherit;color:inherit;cursor:pointer;border:0;background:none}
input{font:inherit;color:inherit}

#top{position:fixed;inset:0 0 auto 0;height:56px;background:#fff;border-bottom:1px solid #dcdfe4;display:flex;align-items:center;justify-content:space-between;padding:0 14px;z-index:20;gap:12px}
#top .left,#top .right{display:flex;align-items:center;gap:6px;flex:1;min-width:0}
#top .right{justify-content:flex-end}
.logo{width:28px;height:28px;border-radius:8px;background:var(--ink);color:#fff;display:grid;place-items:center;font-weight:700}
#crumbs{display:flex;align-items:center;gap:4px;color:var(--mute);overflow:hidden;white-space:nowrap}
#crumbs a{cursor:pointer;padding:2px 6px;border-radius:6px}
#crumbs a:hover{background:#f0f1f4;color:var(--ink)}
#crumbs a.cur{color:var(--ink);font-weight:600;cursor:default}
#boardName{font:700 20px Georgia,serif;text-align:center;border:0;background:none;outline:0;width:min(40vw,420px);border-radius:6px;padding:4px 8px}
#boardName:hover,#boardName:focus{background:#f0f1f4}
#status{color:var(--mute);font-size:12px;margin-right:6px}
.ib{width:30px;height:30px;border-radius:8px;font-size:18px;line-height:1}
.ib:hover,.tb:hover,.zl:hover{background:#f0f1f4}
.zl{min-width:52px;height:30px;border-radius:8px;font-size:13px}
.tb{height:30px;padding:0 10px;border-radius:8px;font-size:13px}
.sep{width:1px;height:20px;background:#dcdfe4;margin:0 4px}

#tools{position:fixed;top:56px;bottom:0;left:0;width:72px;background:#fff;border-right:1px solid #dcdfe4;display:flex;flex-direction:column;align-items:center;padding:10px 0;gap:4px;z-index:15;overflow:auto}
#tools hr{width:36px;border:0;border-top:1px solid #e4e6ea;margin:6px 0}
#tools button{width:60px;padding:8px 0 6px;border-radius:10px;display:flex;flex-direction:column;align-items:center;gap:4px;font-size:11px;color:#555b68}
#tools button:hover{background:#f0f1f4}
#tools button.on{background:#e4ebff;color:var(--acc)}

#vp{position:fixed;top:56px;left:72px;right:0;bottom:0;overflow:hidden;outline:0;cursor:default;touch-action:none;
  background-color:var(--bg);background-image:radial-gradient(#cfd2d8 1.2px,transparent 1.3px);background-size:24px 24px}
#vp.panning,#vp.space{cursor:grab}
#vp.linemode{cursor:crosshair}
#world{position:absolute;left:0;top:0;transform-origin:0 0}
#lines{position:absolute;left:0;top:0;overflow:visible;pointer-events:none}
#lines path{fill:none}
#lines .ln{stroke:var(--line);stroke-width:2;marker-end:url(#arr)}
#lines .hit{stroke:transparent;stroke-width:16;pointer-events:stroke;cursor:pointer}
#lines g.sel .ln{stroke:var(--acc);stroke-width:3}
#lines .temp{stroke:var(--acc);stroke-width:2;stroke-dasharray:6 5;marker-end:url(#arr)}

.card{position:absolute;background:var(--c,var(--card));border-radius:6px;box-shadow:var(--shadow);user-select:none;-webkit-user-select:none}
.card.sel{outline:2px solid var(--acc);outline-offset:1px}
.card:hover{box-shadow:0 2px 4px rgba(20,25,40,.14),0 6px 18px rgba(20,25,40,.1)}
.rz{position:absolute;right:-5px;bottom:-5px;width:14px;height:14px;cursor:ew-resize;opacity:0;border-radius:50%;background:#fff;border:2px solid var(--acc)}
.card:hover .rz,.card.sel .rz{opacity:1}
.dot{position:absolute;width:12px;height:12px;border-radius:50%;background:var(--acc);border:2px solid #fff;opacity:0;cursor:crosshair;z-index:3}
.card:hover .dot,.card.sel .dot{opacity:1}
.dot[data-s=t]{left:calc(50% - 6px);top:-7px}.dot[data-s=b]{left:calc(50% - 6px);bottom:-7px}
.dot[data-s=l]{top:calc(50% - 6px);left:-7px}.dot[data-s=r]{top:calc(50% - 6px);right:-7px}
.linemode .card{cursor:crosshair}

.note .body{padding:12px 14px;min-height:44px;white-space:pre-wrap;word-break:break-word;outline:0;user-select:text;-webkit-user-select:text}
.note .body:empty:before{content:attr(data-ph);color:#b0b5bf}
.note .body[contenteditable=true]{cursor:text;background:rgba(61,107,255,.04)}

.note.hasimg{display:flex;align-items:flex-start;gap:0}
.thumb{flex:none;width:68px;height:68px;margin:10px 0 10px 10px;overflow:hidden;cursor:zoom-in;background:#f2f3f5;box-shadow:0 0 0 2px #fff,0 1px 4px rgba(0,0,0,.25)}
.thumb.circle{border-radius:50%}.thumb.square{border-radius:8px}
.thumb img{width:100%;height:100%;object-fit:cover;display:block;pointer-events:none}
.note.hasimg .body{flex:1;min-width:0;align-self:center}
.card.dropok{outline:2px dashed var(--acc);outline-offset:2px}
.image{padding:0;overflow:hidden;background:#fff;line-height:0}
.image img{width:100%;display:block;pointer-events:none;border-radius:6px;background:#f2f3f5}

.link{padding:10px 12px;display:flex;flex-direction:column;gap:6px}
.link .hd{display:flex;align-items:center;gap:8px;color:var(--mute);font-size:12px}
.link .hd img{width:16px;height:16px;border-radius:3px}
.link .hd span{flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.link .hd button{font-size:15px;padding:0 4px;border-radius:4px}
.link .hd button:hover{background:#f0f1f4}
.link input{border:0;outline:0;background:none;width:100%;padding:2px 0}
.link .t{font-weight:700;color:#e8541e}
.link .u{font-size:12px;color:var(--mute)}
.link input:focus{background:#f5f7ff}

.ttl{border:0;outline:0;background:none;width:100%;font:700 15px Georgia,serif;padding:2px 4px;border-radius:4px}
.ttl:focus{background:rgba(61,107,255,.07)}
.todo{padding:10px 12px}
.todo .top,.table .top{display:flex;align-items:center;gap:8px;margin-bottom:6px}
.todo .prog{font-size:12px;color:var(--mute)}
.todo .it{display:flex;align-items:center;gap:8px;padding:2px 0}
.todo .it input[type=text]{flex:1;border:0;outline:0;background:none;padding:3px 4px;border-radius:4px;min-width:0}
.todo .it input[type=text]:focus{background:rgba(61,107,255,.07)}
.todo .it.done input[type=text]{text-decoration:line-through;color:var(--mute)}
.todo input[type=checkbox]{width:16px;height:16px;accent-color:var(--acc);margin:0}
.add{font-size:12px;color:var(--mute);padding:3px 4px;border-radius:4px;margin-top:2px}
.add:hover{background:#f0f1f4;color:var(--ink)}

.board{padding:0;overflow:visible;cursor:pointer}
.board .face{border-radius:6px;overflow:hidden}
.board .prev{height:78px;background:linear-gradient(135deg,#dfe7ff,#f1ecff);display:grid;grid-template-columns:repeat(3,1fr);gap:6px;padding:10px}
.board .prev b{background:rgba(255,255,255,.85);border-radius:4px;box-shadow:0 1px 2px rgba(0,0,0,.08)}
.board .nm{padding:8px 12px 2px;font:700 15px Georgia,serif;word-break:break-word}
.board .ct{padding:0 12px 10px;font-size:12px;color:var(--mute)}

.table{padding:10px 10px 6px}
.table .tbl{overflow:auto;max-height:420px;border:1px solid #e3e5ea;border-radius:4px;background:#fff}
.table table{border-collapse:collapse;width:100%;table-layout:fixed;font-size:12px}
.table th{background:#d8dae0;font-weight:500;color:#555b68;font-size:11px;height:20px;position:sticky;top:0}
.table th:first-child{width:26px;background:#eceef2}
.table tr>th:first-child{position:static}
.table td{border:1px solid #eceef2;padding:0;height:24px}
.table td input{width:100%;height:24px;border:0;outline:0;background:none;padding:0 6px;font-size:12px}
.table td input:focus{box-shadow:inset 0 0 0 2px var(--acc);background:#fff}
.table .foot{display:flex;gap:2px;margin-top:4px;opacity:0;transition:.15s}
.table:hover .foot,.table.sel .foot{opacity:1}

#marquee{position:absolute;border:1px solid var(--acc);background:rgba(61,107,255,.08);pointer-events:none;z-index:5}
#empty{position:absolute;left:50%;top:42%;transform:translate(-50%,-50%);text-align:center;color:var(--mute);pointer-events:none;line-height:1.7}
#empty b{display:block;font:700 22px Georgia,serif;color:#a6abb6;margin-bottom:6px}
#dropHint{position:absolute;inset:12px;border:3px dashed var(--acc);border-radius:16px;background:rgba(61,107,255,.08);display:grid;place-items:center;font-size:18px;color:var(--acc);font-weight:600;pointer-events:none;z-index:8}

#menu{position:fixed;background:#fff;border-radius:10px;box-shadow:0 8px 30px rgba(20,25,40,.22);padding:6px;z-index:50;min-width:170px}
#menu button{display:block;width:100%;text-align:left;padding:7px 10px;border-radius:6px}
#menu button:hover{background:#f0f1f4}
#menu button.danger{color:#d23b3b}
#menu .sw{display:flex;gap:6px;padding:6px 10px}
#menu .sw i{width:20px;height:20px;border-radius:50%;border:1px solid rgba(0,0,0,.15);cursor:pointer}
#toast{position:fixed;left:50%;bottom:24px;transform:translateX(-50%);background:var(--ink);color:#fff;padding:10px 16px;border-radius:10px;z-index:60;box-shadow:0 6px 20px rgba(0,0,0,.25)}
#lightbox{position:fixed;inset:0;background:rgba(15,18,28,.88);display:grid;place-items:center;z-index:70;cursor:zoom-out}
#lightbox img{max-width:92vw;max-height:92vh;border-radius:6px;background:#fff}
[hidden]{display:none!important}

#vp.handmode,#vp.handmode .card{cursor:grab}
#vp.panning,#vp.panning .card{cursor:grabbing}
/* ícones da barra */

.link .main{display:flex;flex-direction:column;gap:6px;min-width:0;flex:1}
.link.hasimg{flex-direction:row;align-items:center;gap:12px}
.link .thumb{margin:0;width:60px;height:60px}
.note .body h1{font:700 26px/1.2 Georgia,serif;margin:0 0 2px}
.note .body h2{font:700 18px/1.3 Georgia,serif;margin:0 0 2px}
.note .body b{font-weight:700}
.fmt{position:absolute;left:0;bottom:calc(100% + 8px);background:#fff;border-radius:10px;box-shadow:0 4px 18px rgba(20,25,40,.25);padding:4px;display:flex;align-items:center;gap:2px;z-index:6;white-space:nowrap;user-select:none}
.fmt button{min-width:26px;height:26px;border-radius:6px;font-size:13px;padding:0 5px}
.fmt button:hover{background:#f0f1f4}
.fmt button.b{font-weight:700}.fmt button.i{font-style:italic}.fmt button.u{text-decoration:underline}
.fmt .sp{width:1px;height:18px;background:#dcdfe4;margin:0 4px}
.fmt .cs{width:16px;height:16px;border-radius:50%;cursor:pointer;margin:0 2px;border:1px solid rgba(0,0,0,.15)}

.image[class*=fr-] img{border-radius:0}
.image.fr-thin{border:3px solid var(--fc,#2b2f3a)}
.image.fr-thick{border:10px solid var(--fc,#2b2f3a)}
.image.fr-round{border:5px solid var(--fc,#2b2f3a);border-radius:24px}
.image.fr-polaroid{padding:10px 10px 40px;background:var(--fc,#fff);box-shadow:0 3px 12px rgba(0,0,0,.25)}
.image.fr-double{border:8px double var(--fc,#2b2f3a)}
.image.fr-glow{box-shadow:0 0 0 4px var(--fc,#2f6bff),0 0 24px 5px var(--fc,#2f6bff)}
#menu .lbl{font-size:11px;color:var(--mute);padding:6px 10px 0}
#menu .frs{display:flex;flex-wrap:wrap;gap:4px;padding:4px 8px;max-width:230px}
#menu .frs button{width:auto;padding:4px 8px;border-radius:14px;border:1px solid #dcdfe4;font-size:12px}
#menu .frs button.on{background:#e4ebff;border-color:var(--acc);color:var(--acc)}
#menu .sw{flex-wrap:wrap;max-width:230px}

#auth{display:flex;align-items:center;min-height:32px}
#auth .av{width:30px;height:30px;border-radius:50%;object-fit:cover;cursor:pointer;border:2px solid #fff;box-shadow:0 0 0 1px #dcdfe4}
#auth .av.ph{display:grid;place-items:center;background:var(--ink);color:#fff;font-weight:700;font-size:13px}
#menu .info{padding:6px 10px;font-size:12px;color:var(--mute);max-width:240px;word-break:break-all}
#roBar{position:fixed;top:56px;left:0;right:0;height:34px;background:#fff7d6;color:#6a5a00;z-index:14;display:flex;justify-content:center;align-items:center;gap:6px;font-size:13px;border-bottom:1px solid #eee0a0}
#roBar a{color:inherit;font-weight:700}
.readonly #tools,.readonly .dot,.readonly .rz,.readonly .fmt,.readonly #undo,.readonly #redo,.readonly #importBtn,.readonly #empty{display:none!important}
.readonly #roBar:not([hidden]) ~ #vp{top:90px}
.readonly #vp{left:0}
.readonly .card{cursor:grab}
#legal{position:fixed;right:12px;bottom:8px;z-index:9;font-size:11px;color:#9aa0ab}#legal a{color:inherit}#legal a:hover{color:var(--ink)}
#tools svg{width:24px;height:24px;display:block;fill:none;stroke:currentColor;stroke-width:1.6;stroke-linecap:round;stroke-linejoin:round}
#tools button{color:#4b5160}
#tools button:hover{color:var(--ink)}
#tools button.on{background:#e6e8ed;color:var(--ink)}
.brand{display:flex;align-items:center;margin-right:2px}.brand img{height:24px;width:auto;display:block}

.card{cursor:grab}
.card input[type=text],.card input:not([type]),.card textarea{cursor:text}
.card input[type=checkbox],.card button,.card .thumb{cursor:pointer}
.card .body[contenteditable=true]{cursor:text}
#vp.space,#vp.space *{cursor:grab!important}
#vp.panning,#vp.panning *{cursor:grabbing!important}

#moreBtn,#backBtn{display:none}
#sbar{display:none}
@media (max-width:820px),(pointer:coarse){
  html,body{overscroll-behavior:none}
  body{-webkit-touch-callout:none;-webkit-tap-highlight-color:transparent}
  #top{height:52px;padding:0 8px;gap:6px}
  #top .left,#top .right{flex:0 0 auto;gap:2px}
  #crumbs,#status,#zout,#zin,#zlabel,#exportBtn,#importBtn,#top .sep{display:none}
  #moreBtn,#backBtn:not([hidden]){display:grid;place-items:center}
  .ib{width:36px;height:36px;font-size:20px}
  #boardName{flex:1;min-width:0;width:auto;font-size:17px;padding:4px}
  .brand img{height:20px}
  #tools{top:auto;bottom:0;left:0;right:0;width:auto;height:calc(62px + env(safe-area-inset-bottom));padding:4px 6px env(safe-area-inset-bottom);flex-direction:row;justify-content:flex-start;gap:2px;border-right:0;border-top:1px solid #dcdfe4;overflow-x:auto;overflow-y:hidden}
  #tools hr{flex:none;width:0;height:34px;margin:0 6px;border:0;border-left:1px solid #e4e6ea}
  #tools button{flex:none;width:58px;height:54px;padding:6px 0 4px}
  #vp{top:52px;left:0;bottom:calc(62px + env(safe-area-inset-bottom))}
  .readonly #tools{display:none}.readonly #vp{bottom:0}
  #roBar{top:52px}.readonly #roBar:not([hidden]) ~ #vp{top:86px}
  #sbar:not([hidden]){display:flex;position:fixed;left:50%;transform:translateX(-50%);bottom:calc(72px + env(safe-area-inset-bottom));gap:2px;background:var(--ink);padding:4px;border-radius:14px;z-index:30;box-shadow:0 6px 20px rgba(0,0,0,.3);max-width:96vw}
  #sbar button{background:none;color:#fff;padding:10px 14px;border-radius:10px;font-size:14px;white-space:nowrap}
  #sbar button.danger{color:#ff9d9d}
  .dot{width:22px;height:22px;opacity:0}
  .dot[data-s=t]{left:calc(50% - 11px);top:-12px}.dot[data-s=b]{left:calc(50% - 11px);bottom:-12px}
  .dot[data-s=l]{top:calc(50% - 11px);left:-12px}.dot[data-s=r]{top:calc(50% - 11px);right:-12px}
  .card.sel .dot{opacity:1}.card:hover .dot{opacity:0}.card.sel:hover .dot{opacity:1}
  .rz{width:26px;height:26px;right:-12px;bottom:-12px;opacity:0}.card.sel .rz{opacity:1}.card:hover .rz{opacity:0}.card.sel:hover .rz{opacity:1}
  #lines .hit{stroke-width:30}
  .card input,.card textarea,.note .body{font-size:16px}
  .table td,.table td input{height:34px}
  .table th{height:24px}
  .fmt{max-width:92vw;flex-wrap:wrap}.fmt button{min-width:34px;height:34px}.fmt .cs{width:22px;height:22px}
  #menu{max-width:92vw}#menu button{padding:12px 14px}
  #toast{bottom:calc(84px + env(safe-area-inset-bottom));max-width:92vw;text-align:center}
  #legal{display:none}
  #empty{padding:0 24px;width:100%}
}

.board input.nm{display:block;width:100%;border:0;outline:0;background:none;font:700 15px Georgia,serif;padding:8px 12px 2px;border-radius:0;color:var(--ink);cursor:text;text-overflow:ellipsis}
.board input.nm:focus{background:rgba(61,107,255,.07)}
.board input.nm:disabled{color:var(--mute)}
