/* Composition workbench */
@media (min-width: 821px) {
  .library,
  .settings {
    max-height: calc(100dvh - 175px);
    overflow-y: auto;
    position: sticky;
    top: 18px;
    scrollbar-width: thin;
    scrollbar-color: #c4cebc transparent;
  }
}
.canvas-options {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: -2px 0 12px;
  flex-wrap: wrap;
}
.canvas-options label {
  font-size: 10px;
  margin: 0;
  gap: 5px;
  justify-content: flex-start;
}
.canvas-options input {
  accent-color: var(--teal);
}
.selection-modes {
  display: flex;
  gap: 3px;
}
.selection-modes button {
  font-size: 10px;
  padding: 5px 9px;
  border: 0;
}
.selection-modes .active {
  background: #dce7d9;
  color: #245c62;
}
.stage {
  padding: 22px 20px 14px;
}
.tile-wrap {
  box-shadow: none;
}
.tile-wrap.glazed:after {
  inset: 10.1%;
  box-shadow:
    inset 0 0 0 1px #fff5,
    inset 0 0 15px #7895740b;
  background: linear-gradient(125deg, #ffffff12, transparent 38%, #ffffff09 70%, transparent);
  border-radius: 1px;
}
.tile-wrap.no-neighbors.glazed:after {
  inset: 0;
}
#editor.box-mode,
#editor.box-mode [data-id] {
  cursor: crosshair;
}
.motifs {
  gap: 9px;
}
.motif {
  background: #fcfaf1;
  padding: 8px 2px 7px;
}
.motif svg {
  width: 72px;
  height: 72px;
}
.motif span {
  font-size: 9px;
}
.motif-filter {
  display: flex;
  gap: 4px;
  margin-bottom: 12px;
}
.motif-filter button {
  flex: 1;
  font-size: 9px;
  padding: 6px 3px;
}
.motif-filter .active {
  background: #e5ecdf;
  border-color: #b7c8af;
}
.library #regionNote {
  min-height: 0;
}
.selection-help {
  font-size: 9px;
  line-height: 1.7;
  color: #7a8b7f;
  margin: 0 0 10px;
}
.align-tools {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
}
.align-tools button {
  font-size: 9px;
  padding: 6px 2px;
}
.align-tools button[data-distribute] {
  grid-column: span 1;
}
.align-tools button:nth-last-child(2) {
  grid-column: 1 / span 2;
}
.save-motif {
  display: flex;
  gap: 5px;
}
.save-motif input {
  width: 0;
  flex: 1;
  padding: 8px 6px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #fffef9;
  font-size: 10px;
  color: var(--ink);
}
.save-motif button {
  padding: 7px 10px;
  background: #edf0e4;
}
.my-motifs {
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}
.my-motifs h3 {
  font-size: 17px;
}
.my-motifs .panel-heading {
  margin-bottom: 10px;
}
#shelf {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
}
.shelf-card {
  position: relative;
  background: #f4f2e8;
  border: 1px solid #e4e5d7;
  border-radius: 7px;
  overflow: hidden;
}
.shelf-card > button:first-child {
  border: 0;
  padding: 12px 5px 7px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: center;
  width: 100%;
  height: 100%;
}
.shelf-card svg {
  width: 65px;
  height: 65px;
}
.shelf-card span {
  font-size: 9px;
  line-height: 1.4;
  word-break: break-word;
}
.shelf-card > button:last-child {
  position: absolute;
  right: 0;
  top: 0;
  border: 0;
  padding: 0 5px;
  font-size: 13px;
  color: #8b8c79;
  background: #f5f3e9b8;
}
#shelf > .small-note {
  grid-column: 1/-1;
}
.settings {
  padding-bottom: 20px;
}
.settings #selectionControls > .pair {
  margin-top: 10px;
}
.settings #selectionControls > label {
  margin-top: 17px;
}
.library-note {
  margin-top: 18px;
}
footer span + span {
  letter-spacing: 1px;
}
@media (min-width: 1250px) {
  main {
    grid-template-columns: 228px minmax(400px, 1fr) 273px;
  }
  .tile-wrap,
  #fullRepeat {
    width: min(100%, 540px);
  }
  .stage-caption {
    max-width: 540px;
  }
}
@media (max-width: 1100px) {
  .motif svg {
    width: 60px;
    height: 60px;
  }
  .canvas-options {
    gap: 5px;
  }
  .canvas-options label {
    font-size: 8px;
  }
  .selection-modes button {
    padding: 4px 5px;
    font-size: 9px;
  }
}
@media (max-width: 820px) {
  .settings #selectionControls > .selection-help,
  .settings #selectionControls > .align-tools,
  .settings #selectionControls > .save-motif {
    grid-column: 1/-1;
  }
  .settings #selectionControls > .align-tools {
    max-width: 400px;
  }
  .settings #selectionControls > .save-motif {
    max-width: 400px;
  }
  .canvas-options {
    justify-content: flex-start;
    gap: 8px;
  }
  .stage {
    padding: 14px 10px;
  }
  .motif svg {
    width: 51px;
    height: 51px;
  }
  #shelf {
    grid-template-columns: 1fr;
  }
  .shelf-card svg {
    width: 65px;
    height: 65px;
  }
}
@media (max-width: 500px) {
  .motif svg {
    width: 42px;
    height: 42px;
  }
  .motif {
    padding: 4px 1px;
    gap: 1px;
  }
  .motif span {
    font-size: 7px;
  }
  .motif-filter {
    flex-direction: column;
    gap: 3px;
  }
  .motif-filter button {
    font-size: 8px;
    padding: 4px;
  }
  .canvas-options label {
    font-size: 8px;
  }
  .stage {
    padding: 8px 5px;
  }
  .my-motifs h3 {
    font-size: 13px;
  }
  .shelf-card svg {
    width: 60px;
    height: 60px;
  }
  .stage-caption {
    font-size: 5.5px;
    letter-spacing: 0.2px;
  }
  .library-note p {
    font-size: 8px;
  }
}

#motifSearch {
  width: 100%;
  margin: 0 0 8px;
  padding: 8px 9px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--paper, #fffef9);
  color: var(--ink);
  font: inherit;
  font-size: 11px;
}
.motif-filter {
  flex-wrap: wrap;
}
.motif-filter button {
  min-width: 50px;
}

.material-tabs {
  display: flex;
  gap: 3px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 3px;
}
.material-tabs a {
  text-decoration: none;
  color: var(--muted);
  font-size: 12px;
  padding: 7px 14px;
  border-radius: 5px;
}
.material-tabs a[aria-current="page"] {
  background: var(--teal);
  color: #fff;
}
@media (max-width: 520px) {
  .material-tabs a {
    padding: 6px 10px;
  }
  .material-tabs {
    margin-left: auto;
  }
}

@media (min-width: 821px) and (max-width: 1250px) {
  header {
    flex-wrap: wrap;
  }
  header .header-actions {
    margin-left: auto;
  }
}
