/* ═══════════════════════════════════════
   WORKBENCH ART ATLAS — the places of the world and the art each needs
   (WorkbenchArtAtlasTemplates.js, WorkbenchArtAtlasPlaceTemplates.js,
   WorkbenchArtAtlasGallery.js, WorkbenchArtAtlasTree.js)
   ═══════════════════════════════════════ */

/* The Map sub-tab: the map card across the page, then the picked place's
   art in the main column beside its side cards. */
.wbaa-main {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}

/* ── Map ── */
.wbaa-mapcard {
  position: relative;
  display: flex;
  flex-direction: column;
  height: clamp(380px, 58vh, 760px);
  overflow: hidden;
  background: var(--bg-primary);
}

.wbaa-maptools {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 1;
  display: flex;
  gap: 6px;
}

.wbaa-map {
  cursor: grab;
  touch-action: none;
  user-select: none;
}

.wbaa-map:active {
  cursor: grabbing;
}

.wbaa-links path {
  fill: none;
  stroke: var(--border);
  stroke-width: 1.6;
}

.wbaa-links path.on {
  stroke: var(--accent);
  stroke-width: 2.4;
}

.wbaa-node {
  cursor: pointer;
}

.wbaa-node-box {
  fill: var(--bg-card);
  stroke: var(--border);
  stroke-width: 1;
}

.wbaa-node:hover .wbaa-node-box {
  fill: var(--bg-hover);
}

.wbaa-node.chain .wbaa-node-box {
  stroke: var(--accent);
  stroke-opacity: 0.55;
  stroke-width: 1.5;
}

.wbaa-node.sel .wbaa-node-box {
  fill: var(--bg-hover);
  stroke: var(--accent);
  stroke-width: 2.5;
}

.wbaa-node:focus-visible {
  outline: none;
}

.wbaa-node:focus-visible .wbaa-node-box {
  stroke: var(--accent);
}

.wbaa-node-kind {
  fill: var(--text-muted);
  font: 600 9px var(--font-sans);
  letter-spacing: 0.08em;
}

.wbaa-node-name {
  fill: var(--text-primary);
  font: 600 14px var(--font-sans);
}

.wbaa-node-sub {
  fill: var(--text-secondary);
  font: italic 11px var(--font-sans);
}

.wbaa-node-meta {
  fill: var(--text-muted);
  font: 10.5px var(--font-mono);
}

.wbaa-bar {
  fill: var(--border);
}

.wbaa-bar-ready {
  fill: var(--green);
}

/* A place listing art marked off style says so in its kind line. */
.wbaa-node.off .wbaa-node-kind {
  fill: var(--red);
}

/* The day palette along a box's foot; one taken from above is faded, so the
   places that set their own stand out. */
.wbaa-strip.inherited {
  opacity: 0.4;
}

/* ── Colours and style layers (side cards) ── */
.wbaa-pal + .wbaa-pal,
.wbaa-layer + .wbaa-layer {
  margin-top: 14px;
}

.wbaa-palstrip {
  display: flex;
  height: 22px;
  margin: 6px 0 8px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 4px;
}

.wbaa-palstrip > span {
  flex: 1;
}

.wbaa-palstrip.inherited {
  opacity: 0.55;
}

.wbaa-palfrom {
  margin: 0 0 8px;
  font-size: 12.5px;
}

.wbaa-swrow {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto auto;
  gap: 6px;
  align-items: center;
  margin-bottom: 6px;
}

.wbaa-swrow.wbaa-swnew {
  grid-template-columns: 34px minmax(0, 1fr) auto;
  margin-top: 8px;
}

/* The shared colour box (.wb-in), only narrowed to sit beside a name. */
.wbaa-swhex {
  width: 34px;
  padding: 2px;
  cursor: pointer;
}

.wbaa-swlist li {
  display: flex;
  align-items: center;
  gap: 8px;
}

.wbaa-swdot {
  width: 14px;
  height: 14px;
  flex: none;
  border: 1px solid var(--border);
  border-radius: 3px;
}

/* What the places above set for a layer: read, not edited. */
.wbaa-layer-above {
  margin: 4px 0 6px;
  color: var(--text-muted);
  font-size: 12.5px;
}

.wbaa-layer-from {
  color: var(--text-secondary);
  font-weight: 600;
}

/* ── The picked place's art ── */
.wbaa-art > .wb-check {
  align-self: flex-start;
}

.wbaa-group-h {
  display: flex;
  align-items: center;
  gap: 10px;
}

.wbaa-group-h .wb-btn {
  margin-left: auto;
}

/* Fixed columns: every group's line up under each other, and the name
   takes what the others leave. */
.wbaa-table {
  table-layout: fixed;
  width: 100%;
}

.wbaa-table td {
  vertical-align: top;
}

.wbaa-c-pic {
  width: 84px;
}

.wbaa-c-count {
  width: 84px;
}

.wbaa-c-status {
  width: 150px;
}

.wbaa-c-art {
  width: 200px;
}

.wbaa-c-acts {
  width: 128px;
}

.wbaa-thumb {
  width: 64px;
  height: 64px;
}

.wbaa-name {
  overflow-wrap: anywhere;
}

.wbaa-name .wb-in + .wb-in,
.wbaa-note {
  margin-top: 4px;
}

select.wbaa-family {
  margin-top: 4px;
  min-height: 26px;
  padding: 3px 8px;
  font-size: 12px;
}

input.wbaa-note {
  min-height: 26px;
  padding: 3px 8px;
  font-size: 12px;
  color: var(--text-secondary);
}

input.wbaa-count {
  text-align: right;
}

.wbaa-status,
.wbaa-link {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.wbaa-offcheck {
  margin-top: 6px;
  white-space: nowrap;
}

.wbaa-link > .wb-open {
  min-width: 0;
  overflow-wrap: anywhere;
}

/* Picture…, Remove picture and Delete, one under the other. */
.wbaa-acts {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 4px;
}

.wbaa-table tr.wbaa-off td:first-child {
  box-shadow: inset 3px 0 0 var(--red);
}

.wbaa-table tr.wbaa-inherited td {
  color: var(--text-muted);
}

.wbaa-table tr.wbaa-inherited .wbaa-thumb {
  opacity: 0.7;
}

.wbaa-upload {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.wbaa-add-place {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
}

/* ── Gallery ── */
.wbaa-gbar {
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
}

.wbaa-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 14px;
}

.wbaa-gcard {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.wbaa-gcard.off {
  border-color: var(--red);
}

.wbaa-gpic {
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  padding: 8px;
  border: none;
  border-bottom: 1px solid var(--border);
  background: repeating-conic-gradient(
      var(--bg-hover) 0 25%,
      var(--bg-tertiary) 0 50%
    )
    0 0 / 20px 20px;
  color: var(--text-muted);
  font: italic 12px var(--font-sans);
  cursor: pointer;
}

.wbaa-gpic img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.wbaa-gtext {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px 12px 12px;
  font-size: 12.5px;
}

.wbaa-gpills {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.wbaa-gtext .wb-btn {
  align-self: flex-start;
}

/* ── Totals ── */
.wbaa-ready {
  margin-left: 6px;
  font-size: 11px;
  color: var(--green);
}

.wbaa-totals tr.wbaa-total td {
  border-top: 1px solid var(--border);
  font-weight: 600;
}

/* ── Families ── */
.wbaa-famtree {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.wbaa-fam {
  display: flex;
  align-items: baseline;
  gap: 10px;
  width: 100%;
  padding: 6px 10px;
  border: none;
  border-radius: 6px;
  background: none;
  color: var(--text-primary);
  font: 13px var(--font-sans);
  text-align: left;
  cursor: pointer;
}

.wbaa-fam:hover {
  background: var(--bg-hover);
}

/* Picked as the shell's tree marks its row picked. */
.wbaa-fam.sel {
  background: var(--wb-selected);
  box-shadow: inset 2px 0 0 var(--accent);
}

.wbaa-fam-name {
  font-weight: 600;
}

.wbaa-fam .wb-dim {
  margin-left: auto;
  font-size: 11.5px;
}

/* Each step down the tree indents one more. */
.wbaa-d1 {
  padding-left: 30px;
}

.wbaa-d2 {
  padding-left: 50px;
}

.wbaa-d3 {
  padding-left: 70px;
}

.wbaa-d4 {
  padding-left: 90px;
}

.wbaa-famart > h2 {
  margin: 0 0 6px;
}

/* The family's art rule, over its art. */
.wbaa-rule {
  margin: 0 0 14px;
  padding: 8px 12px;
  border-left: 3px solid var(--accent);
  background: var(--bg-primary);
  color: var(--text-secondary);
  font-style: italic;
}

.wbaa-famart .wb-fgroup + .wb-fgroup {
  margin-top: 14px;
}

/* Under the family's signature switch: the family above that ticks it. */
.wbaa-sigfrom {
  margin: 4px 0 0;
  font-size: 12.5px;
}

/* ── Materials (WorkbenchArtAtlasMaterialTemplates.js) ── */
.wbaa-mat-list {
  margin: 4px 0 0;
  font-size: 12.5px;
}

.wbaa-mat-part {
  color: var(--text-secondary);
  font-weight: 600;
}

/* ── Realms side by side (WorkbenchArtAtlasRealms.js) ── */
.wbaa-realms-card {
  overflow-x: auto;
}

.wbaa-realms td {
  min-width: 160px;
  vertical-align: top;
  font-size: 12.5px;
}

/* A realm column's head reads as a name, not as a table caption; its
   link inherits this size (button.wb-open is never restated). */
.wbaa-realms thead th.wbaa-realm-head {
  font-size: 13px;
  letter-spacing: 0;
  text-transform: none;
}

.wbaa-realm-kind {
  display: block;
  margin-top: 2px;
  font-weight: 400;
}

/* A part the place leaves empty: what the base gives it, greyed. */
.wbaa-realms td.wbaa-inherited {
  color: var(--text-muted);
  font-style: italic;
}

/* A material word two realms share. */
.wbaa-clash {
  padding: 0 2px;
  border-radius: 3px;
  background: var(--amber-dim);
  box-shadow: inset 0 -1px 0 var(--amber);
  color: inherit;
}

.wbaa-clashes {
  margin: 12px 0 0;
  font-size: 12.5px;
}
