/* =========================================================================
   Screen Flow Board (board-editor.html). Builds on marker.css and the
   image editor shell (image-editor.css).

   Desktop: tool rail, the Screens list, the board, properties. Phones:
   the board, the properties sheet, the tool bar; the Screens list opens
   over the board from the tool bar.
   ========================================================================= */

/* ---- Screens list ------------------------------------------------------- */
.bd-list {
  flex: 0 0 248px;
  display: flex;
  flex-direction: column;
  min-height: 0;
  border-right: 1px solid var(--line);
  background: var(--surface);
}
.bd-list-head { display: flex; align-items: center; gap: 8px; padding: 14px 14px 4px 16px; }
.bd-list-head h2 { font-size: 15px; line-height: 20px; }
.bd-list-count { font-size: 13px; color: var(--muted); }
.bd-list-close { display: none; margin-left: auto; }
.bd-list-hint { padding: 0 16px 8px; font-size: 12px; line-height: 16px; margin: 0; }
.bd-items { list-style: none; margin: 0; padding: 4px 8px; overflow-y: auto; flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; gap: 2px; }
.bd-li { margin: 0; }
.bd-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 52px;
  padding: 6px 8px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  font: inherit;
}
.bd-item:hover { background: var(--raised); }
.bd-item[aria-pressed="true"] { background: var(--marker-tint); }
.bd-item:focus-visible { outline: 2px solid var(--selection); outline-offset: -2px; }
.bd-thumb { flex: 0 0 48px; width: 48px; height: 36px; border-radius: 4px; background: var(--raised); overflow: hidden; display: flex; align-items: center; justify-content: center; border: 1px solid var(--line); }
.bd-thumb img { max-width: 100%; max-height: 100%; display: block; }
.bd-item-text { display: flex; flex-direction: column; min-width: 0; }
.bd-item-name { font-size: 13px; line-height: 18px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bd-item-sub { font-size: 12px; line-height: 16px; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.bd-list-adds { display: flex; flex-direction: column; gap: 2px; padding: 8px; border-top: 1px solid var(--line); }
.bd-list-add { justify-content: flex-start; }
.bd-rail-list { display: none; }

/* ---- Board ---------------------------------------------------------------- */
.bd-stage { cursor: default; touch-action: none; }
.bd-stage[data-tool="hotspot"] { cursor: crosshair; }
.bd-stage[data-tool="connect"] { cursor: alias; }
.bd-stage.is-space, .bd-stage.is-space[data-tool] { cursor: grab; }
.bd-stage.is-panning, .bd-stage.is-panning[data-tool] { cursor: grabbing; }
.bd-hint {
  position: absolute;
  left: 50%;
  top: 12px;
  transform: translateX(-50%);
  max-width: calc(100% - 32px);
  margin: 0;
  padding: 8px 14px;
  border-radius: 10px;
  background: var(--surface);
  color: var(--ink);
  font-size: 13px;
  line-height: 18px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .12);
  pointer-events: none;
  z-index: 4;
}
.bd-hint[hidden] { display: none; }

/* ---- Properties -------------------------------------------------------- */
.bd-links { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.bd-link-btn { justify-content: flex-start; width: 100%; height: auto; min-height: 36px; padding-top: 6px; padding-bottom: 6px; text-align: left; white-space: normal; }
.bd-connect { display: flex; gap: 8px; }
.bd-connect .select { flex: 1 1 auto; min-width: 0; }
.ed-group > .btn { align-self: flex-start; }
.bd-find { display: flex; flex-direction: column; gap: 12px; }
.bd-find progress { width: 100%; }
.bd-find-sum:focus { outline: none; }
.bd-find-group { display: flex; flex-direction: column; gap: 6px; border-top: 1px solid var(--line); padding-top: 10px; }
.bd-find-group b { font-size: 13px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bd-find-row .btn { white-space: normal; height: auto; min-height: 40px; text-align: left; }
.bd-phone-only { display: none; }

/* ---- Export menu ---------------------------------------------------------- */
.ed-actions { position: relative; }
.bd-export .icon { margin-left: 2px; }
.bd-menu { top: calc(100% + 6px); right: 0; width: 320px; }
.bd-menu button { flex-direction: column; align-items: flex-start; gap: 2px; padding: 8px 10px; text-align: left; }
.bd-menu button b { font-weight: 600; font-size: 14px; }
.bd-menu-sub { font-size: 12px; line-height: 16px; color: var(--muted); }
.bd-menu-sep { height: 1px; background: var(--line); margin: 4px 6px; }

/* ---- Dialogs ---------------------------------------------------------------- */
dialog.dialog.bd-export-dlg { width: min(480px, calc(100vw - 32px)); }
.bd-export-body { display: flex; flex-direction: column; gap: 18px; }
.bd-export-body .segmented { flex-wrap: wrap; }
.bd-export-note { margin: 0; }
.bd-export-privacy { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; padding-top: 14px; border-top: 1px solid var(--line); }
.bd-export-privacy .helper { margin: 0; }
.bd-export-foot, .bd-review-foot { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
dialog.dialog.bd-work { width: min(420px, calc(100vw - 32px)); }
.bd-work-text { margin: 0 0 12px; font-size: 14px; }
.bd-bar { height: 6px; border-radius: 99px; background: var(--raised); overflow: hidden; margin-bottom: 16px; }
.bd-bar span { display: block; height: 100%; width: 0; background: var(--marker); transition: width .15s linear; }
@media (prefers-reduced-motion: reduce) { .bd-bar span { transition: none; } }

dialog.dialog.bd-review { width: min(880px, calc(100vw - 32px)); }
.bd-review-body { display: flex; flex-direction: column; gap: 16px; }
.bd-review-body .helper { margin: 0; }
.bd-strip { list-style: none; margin: 0; padding: 2px 2px 8px; display: flex; gap: 10px; overflow-x: auto; }
.bd-strip-item { flex: 0 0 auto; }
.bd-strip-pick { display: flex; flex-direction: column; gap: 6px; position: relative; cursor: pointer; }
.bd-strip-pick input { position: absolute; top: 6px; left: 6px; width: 20px; height: 20px; margin: 0; accent-color: var(--marker); }
.bd-strip-pick img { height: 120px; width: auto; max-width: 220px; object-fit: contain; border-radius: 6px; border: 2px solid var(--line); background: var(--raised); opacity: .5; }
.bd-strip-item.is-on img { border-color: var(--marker); opacity: 1; }
.bd-strip-pick input:focus-visible + img { outline: 2px solid var(--selection); outline-offset: 2px; }
.bd-strip-time { display: flex; align-items: center; gap: 4px; font-size: 12px; color: var(--muted); }
.bd-strip-hot { display: inline-flex; color: var(--marker); }
.bd-scrub { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; padding-top: 12px; border-top: 1px solid var(--line); }
.bd-scrub-view { width: 320px; max-width: 100%; height: auto; aspect-ratio: 8 / 5; background: var(--raised); border-radius: 6px; }
.bd-scrub-row { display: flex; align-items: center; gap: 10px; width: 100%; }
.bd-scrub-row input { flex: 1 1 auto; min-width: 0; }
.bd-scrub-row output { font-size: 13px; font-variant-numeric: tabular-nums; min-width: 40px; }
.bd-review-body .ed-check { display: flex; align-items: center; gap: 8px; font-size: 14px; }

/* ---- Phones ------------------------------------------------------------------ */
@media (max-width: 760px), (max-width: 900px) and (orientation: portrait) and (pointer: coarse) {
  .bd-add-top { display: none; }
  .bd-menu { position: fixed; top: 64px; right: 12px; left: 12px; width: auto; }
  .bd-list { display: none; }
  .bd-rail-list { display: flex; }
  .bd-phone-only { display: flex; }
  body.bd-list-open .bd-list {
    display: flex;
    position: absolute;
    inset: 0 0 auto 0;
    height: calc(100% - 72px);
    z-index: 9;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    box-shadow: 0 6px 20px rgba(0, 0, 0, .12);
  }
  .bd-list-close { display: inline-flex; width: 44px; height: 44px; }
  .bd-item { min-height: 56px; }
  .bd-list-add { min-height: 44px; }
  .bd-connect .btn { flex-shrink: 0; }
  .bd-strip-pick img { height: 96px; }
  .bd-hint { top: 8px; }
  .bd-phone-only .chip, .bd-find-row .btn, .bd-link-btn, .bd-export-privacy .btn { min-height: 44px; }
}
/* Every control people tap is at least 44 px on touch screens. */
@media (max-width: 1023px), (any-pointer: coarse) {
  .bd-item { min-height: 56px; }
  .bd-list-add, .bd-menu button { min-height: 44px; }
  .bd-strip-pick input { width: 24px; height: 24px; }
}
