*{box-sizing:border-box} [hidden]{display:none!important}
/* Iron grey shell. The board used to be near-white (#f5f7f8) which is the largest
   surface on screen and the reason the page glared at night; the shell now sits in
   iron grey and the yellow stickers keep their own dark ink so content contrast is
   unchanged (yellow on grey is ~7:1, dark ink on yellow is ~12:1). */
:root{
  --iron:#4b5158; --iron-deep:#454b52; --chrome:#3d434a; --chrome-deep:#353b41; --chrome-line:#2e343a;
  --ink:#e8edf1; --ink-soft:#cfe3ec; --field:#33383e; --field-line:#6d777f;
  --tab:#7e93a8; --tab-line:#4d5c69; --tab-ink:#131c25; --tab-active:#e3b653; --tab-active-line:#8a6d1f; --tab-active-ink:#241c06;
  --btn:#98a3ad; --btn-line:#5c6873; --btn-ink:#151d24; --dot:#5c6873;
  font-family:system-ui,sans-serif;color:var(--ink);background:var(--iron)
}
body{margin:0}
/* The app owns all scrolling. A document that can move even 3px is enough for a
   fling to strand the tab strip above the visible area, and once they
   are gone nothing left on screen can scroll them back. overflow:clip (where
   supported; hidden stays as fallback) also removes the *programmatic* scroll
   hazard: an overflow:hidden box can still be scrolled by focus() on a clipped
   control, which strands chrome inside the clipped area with no scrollbar. */
html,body{height:100dvh;overflow:hidden;overflow:clip;overscroll-behavior:none}
body{display:flex;flex-direction:column}main{flex:1 1 auto;min-height:0;display:flex;flex-direction:column;overflow:hidden;overflow:clip}
.toolbar{display:flex;gap:.35rem;align-items:center;padding:.3rem .5rem;flex-wrap:wrap;background:var(--chrome);border-bottom:1px solid var(--chrome-line)}
#tabbar{background:var(--chrome)}#actions{background:var(--chrome-deep)}
/* Compact strips: 30px targets (was 36) with tighter padding and .86rem type, so the
   two toolbars give roughly a sticker row of height back to the board. */
button,input,textarea{font:inherit}button{border:1px solid var(--btn-line);border-radius:.4rem;background:var(--btn);color:var(--btn-ink);padding:.2rem .5rem;cursor:pointer;min-height:30px;font-size:.86rem}button:disabled{opacity:.5;cursor:default}button:not(:disabled):hover{background:#aab4be}button:focus-visible{outline:3px solid #ffd98a;outline-offset:2px}
/* Tabs read as steel chips with dark ink, action buttons as lighter grey chips --
   two families instead of one, and no near-white label text on either. */
#tabbar button{background:var(--tab);border-color:var(--tab-line);color:var(--tab-ink)}#tabbar button:not(:disabled):hover{background:#8fa3b6}
#actions #auto-space.active{background:#e3b653;border-color:#8a6d1f;color:#241c06;font-weight:700}
#tabbar button[aria-current="page"]{background:var(--tab-active);border-color:var(--tab-active-line);color:var(--tab-active-ink);box-shadow:inset 0 -2px #a8801f;font-weight:700}
/* Hover must not repaint the active tab back to steel: with colour as the primary
   active signal, the hover rule (higher specificity) has to keep the gold family. */
#tabbar button[aria-current="page"]:not(:disabled):hover{background:#ecc167}
#logout{margin-left:auto}
/* Toast sits above the zoombar band at every width and every root font size: the
   band is bottom .7rem + ~40px tall, so 4.2rem clears it even at 12px root font
   (where rem shrinks but the 30px button min-height does not). */
#status{position:fixed;left:50%;bottom:4.2rem;transform:translateX(-50%);z-index:60;max-width:min(92vw,36rem);padding:.45rem .85rem;border:1px solid var(--btn-line);border-radius:.6rem;background:#20262bee;color:var(--ink-soft);font-size:.85rem;box-shadow:0 6px 16px #00000088;pointer-events:none;opacity:0;transition:opacity .25s}#status.show{opacity:1}
#login{margin:auto;max-height:100%;overflow:auto;max-width:25rem;background:var(--chrome);padding:1.25rem;border-radius:1rem;display:grid;gap:1rem}input{min-width:0;padding:.5rem;background:var(--field);border:1px solid var(--field-line);border-radius:.45rem;color:var(--ink)}
#tabs{display:flex;flex:1;min-width:0;overflow-x:auto;overflow-y:hidden;overscroll-behavior:contain;gap:.35rem;scrollbar-width:thin}#tabs button{flex:none;max-width:15rem;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
/* No magic offset against the chrome height here: the shell is a flex column, so
   the board gets exactly whatever the two toolbars leave behind. */
#workspace{flex:1 1 auto;min-height:0;display:flex;flex-direction:column}#stage{flex:1;min-height:0;position:relative;display:flex;flex-direction:column}#viewport{flex:1;min-height:0;overflow:auto;overscroll-behavior:contain;touch-action:pan-x pan-y;scrollbar-color:var(--btn-line) #3a4046}#sizer{position:relative}#board{position:absolute;left:0;top:0;transform-origin:0 0;touch-action:pan-x pan-y;background:var(--iron-deep);background-image:radial-gradient(var(--dot) 1px,transparent 1px);background-size:19px 19px}
.note{position:absolute;display:grid;grid-template-rows:auto 1fr auto;background:#fff4b8;color:#17242b;border:1px solid #ddc97b;border-radius:.65rem;box-shadow:0 4px 14px #00000066;overflow:hidden}
/* Sticker-local buttons keep the sticker palette AND the sticker metrics: the
   global button rule is tuned for the grey shell (smaller, light ink) and would
   both shrink the sticker controls and paint light ink on the pale yellow strips. */
.note button{background:#fff8d4;border-color:#806b20;color:#17242b;font-size:1rem;min-height:36px}.note button:not(:disabled):hover{background:#ffefb0}
.note .drag{background:transparent;border-color:transparent;color:#17242b}
.note-head,.note-foot{display:flex;align-items:center;gap:.25rem;padding:.25rem}.note-head{background:#f1df8a}.drag{flex:1;text-align:left;cursor:grab;touch-action:none;background:transparent;border-color:transparent}.note-body{min-height:0;overflow:auto;padding:.35rem;display:flex;flex-direction:column;gap:.3rem}.note-body textarea{display:block;width:100%;min-height:44px;flex:1 1 auto;resize:none;background:#fff8d4;border:1px solid transparent;padding:.4rem;color:inherit}.note-body textarea:focus{border-color:#74611a;outline:0}.note-body textarea.blank{flex:0 0 36px;min-height:36px}.note-foot{justify-content:space-between}.size{cursor:nwse-resize;touch-action:none}.image{position:relative;flex:0 0 auto}.image img{display:block;width:100%;height:auto}.image .imgbar{position:absolute;right:.2rem;top:.2rem;display:flex;gap:.2rem}.image .imgbar button{min-height:0;padding:.15rem .4rem;font-size:.75rem;background:#ffffffe0;color:#17242b}
/* --grip is set in board units so its visible hit target remains 34px at every zoom. */
.grip{position:absolute;right:0;bottom:0;width:var(--grip-size,34px);height:var(--grip-size,34px);padding:0;border:0;background:linear-gradient(135deg,transparent 45%,#a8924b99 45%,#a8924b99 55%,transparent 55%,transparent 65%,#a8924b99 65%,#a8924b99 75%,transparent 75%);cursor:nwse-resize;touch-action:none;z-index:2}
.note.top{z-index:1}
.zoombar{position:absolute;right:.5rem;bottom:.7rem;display:flex;gap:.25rem;align-items:center;padding:.25rem;background:#3d434ae6;border:1px solid var(--btn-line);border-radius:.6rem;box-shadow:0 4px 12px #00000077;z-index:2}
.zoombar button{min-width:2.4rem;padding:.3rem .45rem;background:var(--btn)}
#zoom-label{min-width:3.3rem;text-align:center;font-variant-numeric:tabular-nums}
@media(max-width:520px){.toolbar{padding:.25rem .4rem;gap:.25rem}.toolbar button{padding:.18rem .4rem;font-size:.82rem}#login{margin:auto .6rem}}
