/* AC-6 (owner acceptance 2.10): the board controls once lay over the table and covered zoomed cards, so the viewport kept transparent side borders
   (142 / 148 px) as a gutter the cards could not enter. #609 Reading Desk layout (Astra prototype 14.11): the controls now live in the table's top rail,
   OUTSIDE the cards' viewport, so the gutter is gone and the board's fit gets the full width of the table. */
.d01-atelier-page .reading-workspace .reading-table .spread-viewport { border: 0; background-clip: border-box; }

/* ======================================================================
 * Reading Desk board tools (#609, owner 15.11; desk-toolbar.js): more room for the table.
 *  4. the tool row: in the table's rail (default) or the old vertical column at the table's start side (a switch in the panel, stored in localStorage);
 *     "Full screen" is the standard icon; item 8: "Card titles" is a tool in the same panel (the strip under the table is gone).
 *  5. the action row (Reveal all, Hide all, Save reading, Share reading) is the table's own bottom rail: it stays at the bottom of the window while the
 *     table is taller than the window (the board keeps its full height after a draw, desk-fit-release), and sits under the board when the table fits.
 * ====================================================================== */
.d01-atelier-page #readingWorkspace .reading-table > .reading-desk-actions {
  position: sticky;
  bottom: 0;
  z-index: 5;
  margin: 0;
  padding: 8px 12px 10px;
  max-width: none;
  justify-self: auto;
  border-top: 1px solid var(--rw-control-edge);
  background: rgba(13, 15, 33, .84);
  backdrop-filter: blur(6px);
}
.d01-atelier-page #readingWorkspace[data-expanded="true"] .reading-table > .reading-desk-actions { margin: 0; }
/* the rail is the table's dark glass in both themes: the secondary actions take the table's ink and edge (Share keeps its gold) */
.d01-atelier-page #readingWorkspace .reading-table > .reading-desk-actions .ui-button:not([data-variant="primary"]) {
  background: rgba(255, 255, 255, .06); border-color: var(--rw-control-edge); color: var(--rw-control-ink);
}
.d01-atelier-page #readingWorkspace .reading-table > .reading-desk-actions .ui-button:not([data-variant="primary"]):hover:not(:disabled) { border-color: var(--d01-gold); }
.d01-atelier-page #readingWorkspace .reading-table > .reading-desk-actions .ui-button:disabled { opacity: .55; }
@media (max-width: 760px) {
  .d01-atelier-page #readingWorkspace .reading-table > .reading-desk-actions { width: auto; box-sizing: border-box; padding-inline: 10px; }
}
/* icon tools */
.d01-atelier-page #readingWorkspace .board-controls .board-control-icon { padding-inline: 9px; display: inline-flex; align-items: center; justify-content: center; }
.d01-atelier-page #readingWorkspace .board-controls .desk-icon { display: block; width: 20px; height: 20px; pointer-events: none; }
.reading-expanded-exit.has-desk-icon { display: inline-flex; align-items: center; gap: 8px; }
.reading-expanded-exit .desk-icon { width: 18px; height: 18px; flex: none; }
/* "Card titles" as a tool: the same switch (a native checkbox in a label), drawn like Labels / Relations; pressed = on */
.d01-atelier-page #readingWorkspace .board-controls .card-title-toggle--tool {
  min-width: 44px; min-height: 40px; padding: 6px 11px; gap: 0;
  border: 1px solid transparent; border-radius: 8px; background: transparent; color: var(--rw-control-ink);
  font-size: .78rem; font-weight: 600; line-height: 1.15; text-align: center;
}
.d01-atelier-page #readingWorkspace .board-controls .card-title-toggle--tool .card-title-toggle-state { display: none; }
.d01-atelier-page #readingWorkspace .board-controls .card-title-toggle--tool:hover { border-color: var(--d01-gold); }
.d01-atelier-page #readingWorkspace .board-controls .card-title-toggle--tool:has(.card-title-toggle-input:checked) { border-color: var(--rw-control-edge); background: rgba(226, 177, 92, .16); }
.d01-atelier-page #readingWorkspace .board-controls .card-title-toggle--tool:focus-within { outline: 3px solid var(--d01-gold); outline-offset: 2px; }
@media (max-width: 760px) {
  .d01-atelier-page #readingWorkspace .board-controls .card-title-toggle--tool { min-width: 44px; min-height: 40px; padding: 5px 8px; font-size: .72rem; }
}
/* the old placement: the tools as a vertical column at the table's start side, the status line above, the cards' viewport beside it (its fit measures what is left) */
.d01-atelier-page #readingWorkspace .reading-table[data-toolbar="left"] {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-areas: "notice notice" "tools board" "actions actions";
}
.d01-atelier-page #readingWorkspace .reading-table[data-toolbar="left"] .reading-table-rail { display: contents; }
.d01-atelier-page #readingWorkspace .reading-table[data-toolbar="left"] .reading-notice { grid-area: notice; flex: none; margin: 10px 12px 6px; }
.d01-atelier-page #readingWorkspace .reading-table[data-toolbar="left"] .board-controls {
  grid-area: tools; align-self: start; flex-direction: column; flex-wrap: nowrap; align-items: stretch; justify-content: flex-start;
  margin-block: 8px; margin-inline: 8px 0; padding: 2px;
}
.d01-atelier-page #readingWorkspace .reading-table[data-toolbar="left"] .board-controls #boardZoomStatus { display: block; max-width: 3.6rem; padding: 4px 2px; text-align: center; white-space: normal; font-size: .66rem; line-height: 1.2; }
.d01-atelier-page #readingWorkspace .reading-table[data-toolbar="left"] .board-controls #boardZoomStatus:empty { display: none; }
.d01-atelier-page #readingWorkspace .reading-table[data-toolbar="left"] .spread-viewport { grid-area: board; border-radius: 0; }
.d01-atelier-page #readingWorkspace .reading-table[data-toolbar="left"] > .reading-desk-actions { grid-area: actions; }

/* G zoom-rail 17.11: at 200% zoom (720x450, 640x450), 320 px phones (568 tall) and phones on their side the sticky action rail (115 px as a 2x2 grid) pinned to the bottom of
   the window and covered most of the 168-224 px of the board that was visible. When the window is short the rail is no longer pinned: it is the last row of the table, UNDER the board
   (the board gets the window's height; the four actions are one scroll or one Tab away, and never lie over a card), and where the width allows it is ONE row. Same template on every deck and on Tarot.
   A tall window keeps the pinned rail exactly as before. CSS only. */
@media (max-height: 620px) {
  .d01-atelier-page #readingWorkspace .reading-table > .reading-desk-actions { position: static; backdrop-filter: none; padding: 8px 10px; }
}
@media (max-height: 620px) and (min-width: 540px) {
  .d01-atelier-page #readingWorkspace .reading-table > .reading-desk-actions { display: flex; flex-wrap: nowrap; justify-content: stretch; gap: 8px; width: auto; max-width: none; }
  .d01-atelier-page #readingWorkspace .reading-table > .reading-desk-actions :is(.ui-button, #saveReadingBtn) { flex: 1 1 0; width: auto; min-width: 0; padding-inline: 8px; font-size: .85rem; line-height: 1.15; white-space: normal; }
}
