/* axi0 Draw (/draw/): on top of /slides/slides.css (the family look: colours, header, buttons, the Key card, the list and
   editor frame, the footer). No inline styles in the markup (the page runs under style-src 'self'); the whiteboard brings its
   own sheet (index.css from /apps-vendor/, loaded with an integrity check when the board starts). */
main { max-width: 1440px; }
.foot { max-width: 1440px; }
.is-unlocked h1, .has-docs h1 { margin-top: 12px; font-size: 30px; }

/* the list: a card per drawing, its sealed thumbnail on top */
.draws { display: flex; flex-direction: column; gap: 6px; }
.draw-btn { display: flex; flex-direction: column; gap: 6px; padding: 8px; }
.thumb {
  display: flex; align-items: center; justify-content: center; width: 100%; aspect-ratio: 16 / 10; overflow: hidden;
  border: 1px solid var(--line2); border-radius: 10px; background: #fff;
}
.thumb img { display: block; width: auto; height: auto; max-width: 100%; max-height: 100%; }
.thumb.is-empty { background: repeating-linear-gradient(135deg, transparent 0 8px, var(--veil) 8px 9px), var(--field); }
.draw-btn .dt, .draw-btn .dm { padding: 0 2px; }
.draw-btn[aria-current="true"] .thumb { border-color: var(--core); }
/* dark: the thumbnails get the board's own dark look (the same inversion the whiteboard draws with) */
html[data-axi0-theme="dark"] .thumb { background: #121212; }
html[data-axi0-theme="dark"] .thumb img { filter: invert(93%) hue-rotate(180deg); }
@media (prefers-color-scheme: dark) {
  html:not([data-axi0-theme="light"]) .thumb { background: #121212; }
  html:not([data-axi0-theme="light"]) .thumb img { filter: invert(93%) hue-rotate(180deg); }
}

/* the board */
.editor { min-width: 0; }
.board { position: relative; flex: 1 1 auto; min-height: 460px; height: 68vh; margin-top: 8px; overflow: hidden; border: 1px solid var(--line2); border-radius: 14px; background: var(--field); }
.board:focus-within { border-color: var(--line3b); }
.board-host { position: absolute; inset: 0; }
.board-ph {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; height: 100%; padding: 24px;
  background-image: radial-gradient(var(--line2) 1px, transparent 1.2px); background-size: 22px 22px; text-align: center;
}
.board-ph p { max-width: 34em; margin: 0; color: var(--mute); font-size: 14px; }
.board-ph .btn { min-height: 44px; padding: 0 22px; }
.is-loading .board-ph .btn { opacity: .6; pointer-events: none; }
.ed-foot #state:empty, .ed-foot #state:empty + .sep { display: none; }
#list:empty { display: none; }

/* the whiteboard's shapes library is not offered: it would be lost on reload (nothing of it is kept, sealed or not) and
   its "browse" button leads to another site */
.board .default-sidebar-trigger, .board .context-menu li[data-testid="addToLibrary"] { display: none !important; }

/* the whiteboard's own controls keep their own look: the family's field rules stop at its edge */
.board .excalidraw input[type="text"], .board .excalidraw input[type="search"], .board .excalidraw textarea, .board .excalidraw select { width: auto; min-height: 0; box-shadow: none; }
.board .excalidraw textarea.excalidraw-wysiwyg { border-radius: 0; }
.board .excalidraw h1, .board .excalidraw h2, .board .excalidraw h3 { margin: 0; font-size: revert; letter-spacing: normal; }

/* phones and tablets: the list, or the open drawing */
@media (max-width: 1023.9px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .side { min-height: 0; max-height: none; }
  .is-editing .side { display: none; }
  .editor { display: none; min-height: 0; }
  .is-editing .editor { display: flex; }
  .back { display: inline-flex; min-height: 36px; padding: 0 12px; }
  .ed-bar { flex-wrap: wrap; }
  .title { flex-basis: 100%; order: 3; font-size: 16px; }
  .ed-acts { margin-left: auto; }
  .ed-hint { display: none; }
  .draws { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
  .board { height: 70vh; min-height: 380px; }
  .is-editing .lede { display: none; }
}
@media (max-width: 600px) {
  .board { height: 66vh; min-height: 340px; margin-top: 6px; border-radius: 12px; }
  .draws { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
