/* ── the menu bar (top bar, right end): File, Edit, View — plain words, as an app's menus (src/file-menu.js) ── */
.menu-bar { margin-left: auto; display: flex; align-items: center; gap: 2px; }
.file-btn {
  display: flex; align-items: center; height: 28px; padding: 0 10px;
  background: transparent; border: none; border-radius: 4px;
  color: #d0d0d0; font: inherit; font-size: 0.8rem; font-weight: 500; cursor: pointer;
}
.file-btn:hover { background: #2a2a2a; color: #fff; }
.file-btn[aria-expanded="true"] { background: #333; color: #fff; }
.file-menu {
  position: fixed; z-index: 1100; min-width: 230px; padding: 4px;
  background: #1e1e1e; border: 1px solid #3a3a3a; border-radius: 8px;
  box-shadow: 0 10px 30px #000a; display: flex; flex-direction: column;
}
.file-menu[hidden], .file-menu [hidden] { display: none; }
.file-menu button {
  display: flex; align-items: center; gap: 10px; height: 32px; padding: 0 10px;
  border: none; border-radius: 5px; background: transparent;
  color: #e0e0e0; font: inherit; font-size: 0.8rem; text-align: left; cursor: pointer;
}
.file-menu button svg { color: #aaa; flex-shrink: 0; }
.file-menu button:hover, .file-menu button:focus-visible { background: #ffffff12; outline: none; }
.file-menu button:hover svg { color: #e0e0e0; }
.file-menu button:disabled { opacity: 0.35; cursor: default; background: none; }
/* Delete drawing: red, so it's never taken for Close */
.file-menu button.fm-danger, .file-menu button.fm-danger svg { color: #e5605b; }
.file-menu button.fm-danger:hover { background: #e5484d1f; }
.file-menu button.fm-danger:hover svg { color: #f07470; }
.fm-label { flex: 1; }
.file-menu kbd { color: #777; font: 0.7rem ui-monospace, Consolas, monospace; }
.fm-sep { height: 1px; margin: 4px 6px; background: #2e2e2e; }
/* a submenu (Import ›): beside the menu, on its left (the menu sits at the screen's right edge); on phones,
   under its item */
.fm-has-sub { position: relative; display: flex; flex-direction: column; }
.file-menu .fm-arrow { color: #777; }
.file-menu button[aria-expanded="true"] { background: #ffffff12; }
.fm-sub {
  position: absolute; top: -5px; right: calc(100% + 6px); min-width: 210px; padding: 4px;
  background: #1e1e1e; border: 1px solid #3a3a3a; border-radius: 8px;
  box-shadow: 0 10px 30px #000a; display: flex; flex-direction: column;
}
@media (max-width: 760px) {
  .fm-sub { position: static; min-width: 0; padding: 0 0 0 18px; border: none; box-shadow: none; background: none; }
  .file-menu button[aria-expanded="true"] .fm-arrow { transform: rotate(90deg); }
}
/* Edit › Outline…: a small window over the canvas (it previews on the canvas, so no backdrop) */
#outline-panel {
  position: fixed; z-index: 1050; top: 110px; left: 50%; transform: translateX(-50%);
  width: 260px; max-width: calc(100vw - 32px); padding: 12px 14px; box-sizing: border-box;
  background: #1a1a1a; border: 1px solid #3a3a3a; border-radius: 8px; box-shadow: 0 12px 40px #000a;
  color: #e0e0e0; font-size: 0.8rem; display: flex; flex-direction: column; gap: 10px;
}
#outline-panel[hidden] { display: none; }
#outline-panel h2 { margin: 0; font-size: 0.9rem; font-weight: 600; cursor: move; user-select: none; touch-action: none; }
@media (max-width: 700px) { #outline-panel h2 { cursor: default; } }
.ol-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
#outline-panel .seg { display: inline-flex; border: 1px solid #3a3a3a; border-radius: 6px; overflow: hidden; }
#outline-panel .seg .btn { border: none; border-radius: 0; padding: 5px 10px; background: #1e1e1e; color: #bbb; font-size: 0.75rem; }
#outline-panel .seg .btn + .btn { border-left: 1px solid #3a3a3a; }
#outline-panel .seg .btn.active { background: #4a7fcb; color: #fff; }
#outline-panel .seg .btn:disabled { opacity: 0.35; cursor: default; }
.ol-color { width: 44px; height: 24px; border: 1px solid #555; border-radius: 5px; cursor: pointer; padding: 0; }
.ol-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 2px; }
#outline-panel .ts-hint { margin: 0; }
/* View menu: the windows, each ticked while it shows */
.fm-head { padding: 6px 10px 4px; color: #777; font-size: 0.66rem; text-transform: uppercase; letter-spacing: 0.06em; }
.file-menu .vm-check { color: #8fb4e8; visibility: hidden; }
.file-menu [aria-checked="true"] .vm-check { visibility: visible; }
.vm-note { color: #777; font-size: 0.7rem; }
.file-menu button[role="menuitemcheckbox"]:disabled { opacity: 0.6; }
/* a window turned off in View */
#tools-sidebar[hidden], #preview-widget[hidden], #palette-panel[hidden], #colors-panel[hidden], #layers-panel[hidden], #history-panel[hidden], #tileset-panel[hidden], #tile-editor[hidden], #timeline[hidden] { display: none !important; }
