@layer components {
  .excalidraw-wrap {
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    position: relative;
  }
  .excalidraw-canvas {
    --excalidraw-canvas-min-block-size: 300px;

    block-size: 500px;
    inline-size: 100%;
    min-block-size: var(--excalidraw-canvas-min-block-size);
    overflow: hidden;
    position: relative;
    resize: vertical;

    &.excalidraw-canvas--tall { --excalidraw-canvas-min-block-size: 500px; }
  }

  .excalidraw-offline {
    color: var(--color-text-muted);
    padding: 1rem;
    text-align: center;
  }
}

/* Directly in vendor, so these beat Excalidraw's own CSS in vendor.excalidraw (application.css). */
@layer vendor {
  .excalidraw {
    /* The "More tools" overflow button and its dropdown panel (frame, web embed, laser pointer,
       mermaid: none exam-relevant) */
    .App-toolbar__extra-tools-trigger,
    button[aria-label="More tools"],
    button[title="More tools"],
    .App-toolbar__extra-tools,
    /* The same tools, should they be reached another way */
    button[aria-label="Frame"],
    button[title="Frame"],
    button[aria-label="Web Embed"],
    button[title="Web Embed"],
    button[aria-label="Laser pointer"],
    button[title="Laser pointer"],
    button[aria-label="Mermaid to Excalidraw"],
    button[title="Mermaid to Excalidraw"],
    /* The hyperlink button */
    button[aria-label="Hyperlink"],
    button[title="Hyperlink"],
    button[aria-label="Add link"],
    button[title="Add link"],
    /* The help button */
    button[aria-label="Help"],
    button[title="Help"],
    /* Links to excalidraw.com, GitHub, Twitter/X and Discord in menus and the welcome screen */
    a[href*="excalidraw.com"],
    a[href*="github.com/excalidraw"],
    a[href*="twitter.com"],
    a[href*="x.com"],
    a[href*="discord.gg"] { display: none; }
  }

  /* Only the subject library injected via initialData.libraryItems is shown: hide the Personal
     Library section and the browse/import/publish/remove chrome. */
  .excalidraw-canvas {
    .library-menu-browse-button,
    .library-menu-dropdown-container,
    .single-library-item--remove,
    .library-unit__checkbox,
    .library-menu-items__no-items,
    .library-menu-items-container__header:not(.library-menu-items-container__header--excal) { display: none; }
  }
}
