:root {
  --ink: #233747;
  --muted: #617079;
  --line: #dee3e4;
  --paper: #fff;
  --canvas: #eaf0f0;
  --accent: #dcef99;
  --accent-dark: #355437;
  --radius: 12px;
  font-family:
    Inter,
    ui-sans-serif,
    -apple-system,
    BlinkMacSystemFont,
    'Segoe UI',
    sans-serif;
  color: var(--ink);
  font-size: 16px;
  background: #f8faf9;
  color-scheme: light;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}
button,
select,
input[type='color'],
input[type='checkbox'] {
  cursor: pointer;
}
button {
  border: 1px solid var(--line);
  background: white;
  border-radius: 8px;
  padding: 9px 12px;
  font-size: 0.875rem;
  font-weight: 550;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 38px;
  transition:
    background 0.15s,
    border-color 0.15s,
    transform 0.15s;
}
button:hover {
  background: #f0f4f3;
  border-color: #b7c5c8;
}
button:active {
  transform: translateY(1px);
}
button:disabled {
  opacity: 0.38;
  cursor: not-allowed;
}
button[aria-pressed='true'],
button.active {
  background: var(--ink);
  color: #fff;
  border-color: var(--ink);
}
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid #608dcc;
  outline-offset: 3px;
}
button svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}
a {
  color: inherit;
}
.icon {
  width: 38px;
  padding: 8px;
}
.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #223525;
}
.primary:hover {
  background: #cfe68a;
  border-color: #bad772;
}
.dark {
  background: var(--ink);
  border-color: var(--ink);
  color: white;
}
.dark:hover {
  background: #38505f;
}
.quiet {
  background: transparent;
  border-color: transparent;
}
.wide {
  width: 100%;
}
.small {
  font-size: 0.8125rem;
}
.muted {
  color: var(--muted);
}
.hidden {
  display: none !important;
}
.row {
  display: flex;
  gap: 8px;
  align-items: center;
}
.between {
  justify-content: space-between;
}
.stack {
  display: grid;
  gap: 12px;
}
.wrap {
  flex-wrap: wrap;
}
h1,
h2,
h3,
p {
  margin: 0;
}
h2 {
  font-size: 1rem;
  font-weight: 650;
}
h3 {
  font-size: 0.875rem;
  font-weight: 650;
}
label,
.label {
  font-size: 0.875rem;
  font-weight: 500;
}
input:not([type='range']):not([type='color']):not([type='checkbox']),
select,
textarea {
  width: 100%;
  min-width: 0;
  background: #fff;
  border: 1px solid #d4dcdf;
  border-radius: 7px;
  padding: 8px 9px;
  min-height: 37px;
  font-size: 0.875rem;
}
input[type='range'] {
  width: 100%;
  accent-color: var(--ink);
  min-width: 70px;
}
input[type='checkbox'] {
  accent-color: var(--ink);
  width: 17px;
  height: 17px;
  flex-shrink: 0;
}
input[type='color'] {
  padding: 2px;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 7px;
  width: 40px;
  height: 36px;
}
textarea {
  resize: vertical;
  line-height: 1.5;
}
select {
  padding-right: 22px;
}
.field {
  display: grid;
  gap: 6px;
}
.fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.check {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 0.875rem;
  line-height: 1.4;
}
hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 17px 0;
}
.pill {
  font-size: 0.75rem;
  background: #edf3eb;
  color: #456440;
  border-radius: 20px;
  padding: 5px 8px;
  white-space: nowrap;
}
.kbd {
  display: inline-block;
  background: #edf1f1;
  border: 1px solid #dce2e2;
  padding: 1px 5px;
  border-radius: 4px;
  font-family: inherit;
  font-size: 0.75rem;
}
.topbar {
  min-height: 76px;
  padding: 15px 24px;
  display: flex;
  align-items: center;
  gap: 25px;
  background: white;
  border-bottom: 1px solid var(--line);
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.brandmark {
  display: grid;
  grid-template-columns: 12px 12px;
  gap: 3px;
  transform: rotate(-8deg);
}
.brandmark i {
  height: 12px;
  background: var(--ink);
  border-radius: 1px;
}
.brandmark i:nth-child(2) {
  background: #c5dc8c;
}
.brandmark i:nth-child(3) {
  background: #d78d71;
}
.brand h1 {
  font-family: Georgia, serif;
  font-size: 1.7rem;
  font-weight: 500;
  letter-spacing: -1px;
  line-height: 1;
}
.brand small {
  font-family: inherit;
  font-size: 0.625rem;
  letter-spacing: 2px;
  display: block;
  padding-top: 5px;
  margin-left: 2px;
}
.project-title {
  display: grid;
  gap: 3px;
  min-width: 80px;
  max-width: 260px;
  flex: 1;
  border-left: 1px solid var(--line);
  padding-left: 24px;
}
.project-title input {
  font-weight: 600;
  border: 0 !important;
  background: transparent !important;
  min-height: 26px !important;
  padding: 0 !important;
  font-size: 0.9375rem !important;
}
.project-title span {
  font-size: 0.75rem;
  color: var(--muted);
}
.top-actions {
  margin-left: auto;
  display: flex;
  gap: 8px;
  align-items: center;
}
.divider {
  height: 25px;
  width: 1px;
  background: var(--line);
  margin: 0 5px;
}
.app {
  display: grid;
  grid-template-columns: 276px minmax(320px, 1fr) 256px;
  height: calc(100dvh - 76px);
  min-height: 660px;
}
.sidebar {
  background: white;
  padding: 20px 18px;
  overflow-y: auto;
  scrollbar-width: thin;
}
.left {
  border-right: 1px solid var(--line);
}
.right {
  border-left: 1px solid var(--line);
}
.section-head {
  margin-bottom: 14px;
}
.section-head small {
  font-size: 0.75rem;
  color: var(--muted);
}
.workspace {
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: var(--canvas);
  overflow: hidden;
}
.workspace-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 17px 20px;
  border-bottom: 1px solid #d7e1e0;
  background: #f6f8f7;
  flex-wrap: wrap;
}
.tabs {
  display: flex;
  border-radius: 9px;
  background: #e6eceb;
  padding: 4px;
  gap: 3px;
}
.tabs button {
  border: 0;
  background: transparent;
  color: #5a6972;
  padding: 8px 15px;
  min-height: 35px;
}
.tabs button.active {
  background: #fff;
  color: var(--ink);
  box-shadow: 0 2px 5px #23374710;
}
.workspace-caption {
  font-size: 0.8125rem;
  color: #667780;
}
.stage-tools {
  padding: 12px 20px;
  display: flex;
  gap: 6px;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
}
.toolgroup {
  display: flex;
  padding: 3px;
  background: white;
  border-radius: 10px;
  box-shadow: 0 2px 5px #23374709;
  border: 1px solid #dde5e4;
}
.toolgroup button {
  border: 0;
  min-height: 34px;
  height: 34px;
  border-radius: 6px;
  padding: 7px 9px;
}
.toolgroup button:not(.active) {
  background: transparent;
}
.stage {
  flex: 1;
  min-height: 360px;
  position: relative;
  overflow: hidden;
  background-image: radial-gradient(#b9c9c9 0.8px, transparent 0.8px);
  background-size: 18px 18px;
}
.stage.no-dots {
  background-image: none;
}
.stage > svg {
  width: 100%;
  height: 100%;
  position: absolute;
  inset: 0;
  touch-action: none;
  user-select: none;
}
.stage .hint {
  position: absolute;
  left: 50%;
  bottom: 15px;
  transform: translateX(-50%);
  font-size: 0.8125rem;
  color: #4d6267;
  background: #ffffffeb;
  border: 1px solid #e0e7e7;
  border-radius: 22px;
  padding: 9px 14px;
  text-align: center;
  max-width: 90%;
  width: max-content;
  pointer-events: none;
  box-shadow: 0 2px 8px #263d4410;
}
.stage-footer {
  padding: 11px 20px;
  background: #f6f8f7;
  border-top: 1px solid #d7e1e0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 54px;
  flex-wrap: wrap;
  font-size: 0.8125rem;
}
.stage-footer .icon {
  height: 30px;
  width: 30px;
  min-height: 30px;
  padding: 5px;
}
.stage-footer input {
  width: 80px;
}
.stage-footer output {
  width: 42px;
  text-align: center;
}
.shortcut {
  font-size: 0.75rem;
  color: var(--muted);
}
.block-picker {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 7px;
}
.block-card {
  height: 55px;
  padding: 4px;
  border: 2px solid transparent;
  background: #f3f6f5;
}
.block-card.active {
  background: #edf4de;
  border-color: #769456;
}
.block-card svg {
  width: 100%;
  height: 100%;
  pointer-events: none;
}
.block-name {
  margin: 13px 0 9px;
  display: flex;
  gap: 5px;
  align-items: center;
}
.block-name input {
  font-weight: 600;
  background: #f9fbfa !important;
}
.editor-frame {
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f0f4f3;
  position: relative;
}
.editor-frame svg {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  touch-action: none;
  cursor: crosshair;
}
.editor-under {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 8px;
  font-size: 0.75rem;
  color: var(--muted);
}
.editor-under button {
  min-height: 30px;
  width: 30px;
  height: 30px;
  padding: 5px;
}
.shape-tools {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 5px;
  margin: 12px 0;
}
.shape-tools button {
  flex: 1;
  padding: 7px;
  min-width: 0;
}
.shape-tools svg {
  width: 25px;
  height: 25px;
}
.paint-colors {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}
.paint-color {
  flex: 1;
  justify-content: flex-start;
  padding: 7px;
  background: white !important;
  color: var(--ink) !important;
  border: 1px solid var(--line) !important;
  font-size: 0.8125rem;
}
.paint-color.active {
  border: 2px solid #547747 !important;
  padding: 6px;
  background: #f3f8ea !important;
}
.swatch {
  display: block;
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  border-radius: 5px;
  border: 1px solid #00000015;
}
.palettes {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 7px;
}
.palette-color {
  border-radius: 7px;
  padding: 0;
  height: 31px;
  min-height: 31px;
  border: 2px solid transparent;
}
.palette-color.active {
  outline: 2px solid #496944;
  outline-offset: 2px;
  border-color: white;
}
.palette-color:hover {
  border-color: #fff;
}
.palette-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 10px 0 7px;
  font-size: 0.8125rem;
}
.palette-change {
  display: flex;
  gap: 7px;
  margin-top: 10px;
}
.palette-change input {
  flex: 1;
}
.palette-change select {
  flex: 3;
}
.tip {
  font-size: 0.8125rem;
  line-height: 1.5;
  color: var(--muted);
  padding: 11px 12px;
  background: #f2f6ef;
  border-radius: 8px;
  margin-top: 13px;
}
.subtle-note {
  font-size: 0.75rem;
  line-height: 1.5;
  color: var(--muted);
  margin-top: 7px;
}
.layout-stat {
  background: #edf3e2;
  border: 1px solid #dbe7c7;
  border-radius: 10px;
  padding: 15px;
  margin-top: 16px;
}
.layout-stat strong {
  display: block;
  font-family: Georgia, serif;
  font-weight: 400;
  font-size: 1.75rem;
  letter-spacing: -0.5px;
  margin: 4px 0;
}
.layout-stat small {
  font-size: 0.75rem;
  color: #52703f;
}
.segmented {
  display: flex;
  gap: 5px;
}
.segmented button {
  flex: 1;
  padding: 7px 5px;
}
.color-field {
  display: flex;
  align-items: center;
  gap: 7px;
}
.color-field select {
  width: 100%;
}
.selected-info {
  font-size: 0.8125rem;
  line-height: 1.5;
  color: var(--muted);
  margin: 10px 0;
}
.board-empty {
  padding: 12px;
  border: 1px dashed #becdce;
  border-radius: 8px;
}
.fabric-key {
  display: grid;
  gap: 7px;
  margin-top: 10px;
}
.fabric-row {
  display: flex;
  justify-content: space-between;
  gap: 6px;
  align-items: center;
  font-size: 0.8125rem;
}
.fabric-row .swatch {
  width: 16px;
  height: 16px;
}
.fabric-row span:last-child {
  font-variant-numeric: tabular-nums;
}
.disclosure {
  border-top: 1px solid var(--line);
  margin-top: 18px;
  padding-top: 14px;
}
.disclosure summary {
  font-weight: 600;
  font-size: 0.875rem;
  cursor: pointer;
}
.toast {
  position: fixed;
  bottom: 25px;
  left: 50%;
  transform: translate(-50%, 20px);
  padding: 12px 20px;
  background: var(--ink);
  color: white;
  border-radius: 10px;
  z-index: 100;
  font-size: 0.875rem;
  box-shadow: 0 5px 25px #12232f30;
  opacity: 0;
  pointer-events: none;
  transition: 0.2s;
  max-width: 90%;
  text-align: center;
}
.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}
dialog {
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 16px;
  max-width: 560px;
  width: calc(100% - 32px);
  color: var(--ink);
  box-shadow: 0 24px 120px #14232e40;
}
dialog::backdrop {
  background: #1d354966;
  backdrop-filter: blur(3px);
}
.dialog-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 22px;
  border-bottom: 1px solid var(--line);
}
.dialog-body {
  padding: 22px;
}
.dialog-body p {
  font-size: 0.9375rem;
  line-height: 1.6;
  margin-bottom: 14px;
}
.dialog-body h3 {
  margin: 18px 0 8px;
}
.export-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.export-grid button {
  align-items: flex-start;
  flex-direction: column;
  text-align: left;
  padding: 15px;
  font-size: 0.9375rem;
}
.export-grid button span {
  font-size: 0.8125rem;
  font-weight: 400;
  line-height: 1.5;
  color: var(--muted);
}
.template-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.template-grid button {
  display: flex;
  flex-direction: column;
  padding: 12px 7px;
  font-size: 0.8125rem;
}
.template-grid svg {
  width: 100%;
  height: auto;
  max-height: 100px;
}
.help-step {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 9px;
  margin-bottom: 15px;
  font-size: 0.875rem;
  line-height: 1.6;
}
.help-step b:first-child {
  border-radius: 50%;
  height: 25px;
  width: 25px;
  background: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
}
.help-step p {
  margin: 0;
  font-size: 0.875rem;
}
.danger {
  color: #a64138;
}
.file-label {
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  padding: 9px 12px;
  border-radius: 8px;
  background: white;
  min-height: 38px;
  font-size: 0.875rem;
}
.selection-box {
  pointer-events: none;
  stroke: #5c8ac5;
  stroke-width: 2;
  stroke-dasharray: 7 4;
  fill: #659ddd0c;
  vector-effect: non-scaling-stroke;
}
.interactive-cell:focus {
  outline: none;
  stroke: #dfee92;
  stroke-width: 3;
}
.mobile-title {
  display: none;
}
@media (min-width: 1550px) {
  .app {
    grid-template-columns: 300px minmax(320px, 1fr) 290px;
  }
  .sidebar {
    padding: 23px;
  }
  .stage-tools {
    padding: 15px 26px;
  }
}
@media (max-width: 1150px) {
  .app {
    grid-template-columns: 260px minmax(300px, 1fr);
    height: auto;
    min-height: calc(100dvh - 76px);
  }
  .workspace {
    min-height: 740px;
    max-height: calc(100dvh - 76px);
  }
  .sidebar.left {
    max-height: 950px;
  }
  .right {
    grid-column: 1/-1;
    border-left: 0;
    border-top: 1px solid var(--line);
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    overflow: visible;
  }
  .right > section {
    min-width: 0;
  }
  .right > section + section {
    border-left: 1px solid var(--line);
    padding-left: 24px;
  }
  .right hr {
    display: none;
  }
  .right .disclosure {
    margin-top: 0;
    border-top: 0;
    padding-top: 0;
  }
  .workspace-caption {
    display: none;
  }
  .project-title {
    max-width: 210px;
  }
  .topbar {
    padding: 14px 18px;
    gap: 18px;
  }
  .button-label.optional {
    display: none;
  }
}
@media (max-width: 700px) {
  .topbar {
    gap: 10px;
    padding: 12px;
    flex-wrap: wrap;
  }
  .brand h1 {
    font-size: 1.45rem;
  }
  .brand small {
    font-size: 0.6rem;
  }
  .project-title {
    border: 0;
    padding-left: 6px;
    max-width: none;
  }
  .top-actions {
    width: 100%;
    margin-left: 0;
    justify-content: flex-end;
  }
  .top-actions .divider {
    margin-right: auto;
  }
  .app {
    display: flex;
    flex-direction: column;
    min-height: 0;
  }
  .workspace {
    order: 0;
    min-height: 580px;
    max-height: none;
    height: 68dvh;
  }
  .left {
    order: 1;
    overflow: visible;
    border-right: 0;
    border-top: 1px solid var(--line);
    max-height: none !important;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    padding: 20px 16px;
  }
  .left > section {
    min-width: 0;
  }
  .left hr {
    display: none;
  }
  .right {
    order: 2;
    display: block;
    padding: 20px 16px;
  }
  .right > section + section {
    border-left: 0;
    padding-left: 0;
    margin-top: 23px;
    border-top: 1px solid var(--line);
    padding-top: 20px;
  }
  .stage-tools,
  .workspace-header,
  .stage-footer {
    padding-left: 12px;
    padding-right: 12px;
  }
  .stage {
    min-height: 340px;
  }
  .tabs button {
    padding: 8px 12px;
  }
  .stage-footer .shortcut {
    display: none;
  }
  .paint-colors {
    gap: 4px;
  }
  .paint-color {
    font-size: 0.75rem;
    gap: 4px;
  }
  .palettes {
    gap: 5px;
  }
  .shape-tools {
    gap: 3px;
  }
  .shape-tools button {
    padding: 4px;
  }
  .sidebar .section-head h2 {
    font-size: 0.9375rem;
  }
  .block-picker {
    gap: 5px;
  }
  .block-card {
    height: 42px;
  }
  .editor-frame {
    padding: 5px;
  }
  .template-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .mobile-title {
    display: block;
  }
  .export-grid {
    grid-template-columns: 1fr;
  }
  .stage .hint {
    font-size: 0.75rem;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
  }
}
@media print {
  body > * {
    display: none !important;
  }
  #print-area {
    display: block !important;
    padding: 10mm;
  }
  #print-area svg {
    width: 100%;
    max-height: 225mm;
  }
  #print-area h1 {
    font-family: Georgia, serif;
    margin-bottom: 12px;
  }
  #print-area p {
    margin: 12px 0;
    font-size: 12px;
  }
  #print-area .print-key {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
  }
}
#template-dialog {
  max-width: 800px;
  max-height: 90dvh;
  overflow: hidden;
}
#template-dialog .dialog-body {
  overflow-y: auto;
  max-height: calc(90dvh - 78px);
  overscroll-behavior: contain;
}
.template-library {
  display: grid;
  gap: 22px;
}
.template-category h3 {
  margin: 0 0 10px;
  font-size: 1rem;
}
#template-dialog .template-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
#template-dialog .template-grid button {
  font-size: 0.875rem;
  gap: 9px;
  padding: 12px 8px;
  justify-content: flex-start;
}
#template-dialog .template-grid svg {
  max-height: 120px;
  aspect-ratio: 1;
}
.template-caption {
  display: grid;
  gap: 3px;
  text-align: center;
}
.template-caption small {
  font-weight: 400;
  font-size: 0.75rem;
  color: var(--muted);
}
@media (max-width: 600px) {
  #template-dialog .template-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
.feature-buttons {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}
.feature-buttons button {
  justify-content: flex-start;
}
.feature-dialog {
  max-width: 1050px;
  max-height: 92dvh;
  overflow: hidden;
}
.feature-dialog .dialog-body {
  max-height: calc(92dvh - 78px);
  overflow: auto;
  overscroll-behavior: contain;
}
.fabric-editor {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 22px;
}
.fabric-photo {
  aspect-ratio: 1;
  border: 1px solid var(--line);
  border-radius: 10px;
  background-size: cover;
  background-position: center;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  text-shadow: 0 1px 3px #000;
}
.fabric-options {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
  margin-bottom: 18px;
}
.fabric-options button {
  height: 45px;
  background-size: cover;
  background-position: center;
  border: 3px solid white;
  outline: 1px solid var(--line);
}
.fabric-options button.active {
  outline: 3px solid #789343;
}
.variation-controls {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin-bottom: 18px;
}
.lock-list {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.lock-list label {
  border: 1px solid var(--line);
  padding: 6px 8px;
  border-radius: 6px;
  background: #f7f9f5;
}
.variation-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}
.variation-card {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px;
}
.variation-card svg {
  width: 100%;
  aspect-ratio: 1;
  max-height: 240px;
  background: #eef1ef;
}
.variation-card button {
  width: 100%;
}
.plan-controls {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
.plan-section {
  margin: 20px 0;
}
.plan-summary {
  padding: 13px 16px;
  border-radius: 9px;
  background: #eef5df;
  line-height: 1.6;
}
.plan-table-wrap {
  overflow-x: auto;
  margin: 12px 0;
}
.plan-table {
  border-collapse: collapse;
  width: 100%;
  font-size: 0.875rem;
  line-height: 1.45;
}
.plan-table th,
.plan-table td {
  padding: 10px 9px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}
.plan-table th {
  background: #f0f4ef;
  white-space: nowrap;
}
.plan-table td small {
  display: block;
  color: var(--muted);
}
.piece-thumb {
  width: 58px;
  height: 58px;
  display: block;
}
.plan-note {
  border-left: 3px solid #a2b86c;
  padding: 9px 12px;
  background: #f6f8ef;
  font-size: 0.875rem;
  line-height: 1.55;
}
.plan-warning {
  background: #fff3dc;
  color: #694c17;
  padding: 12px;
  border-radius: 8px;
  font-size: 0.875rem;
  line-height: 1.5;
}
.plan-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 12px 0;
}
.plan-footnote {
  font-size: 0.8125rem !important;
  color: var(--muted);
}
@media (max-width: 700px) {
  .fabric-editor {
    grid-template-columns: 1fr;
  }
  .fabric-photo {
    max-width: 180px;
  }
  .variation-controls {
    grid-template-columns: 1fr;
  }
  .variation-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .plan-controls {
    grid-template-columns: 1fr 1fr;
  }
  .plan-table {
    font-size: 0.8125rem;
  }
  .feature-dialog .dialog-body {
    padding: 16px;
  }
}
@media print {
  #print-area .plan-table {
    font-size: 9px;
  }
  #print-area .plan-table td,
  #print-area .plan-table th {
    padding: 4px;
  }
  #print-area .plan-table tr {
    break-inside: avoid;
  }
  #print-area .plan-table th {
    background: #eee;
  }
  #print-area .plan-table-wrap {
    overflow: visible;
  }
  #print-area button {
    display: none;
  }
  #print-area .piece-thumb {
    width: 35px;
    height: 35px;
  }
  #print-area .plan-note,
  #print-area .plan-summary,
  #print-area .plan-warning {
    font-size: 10px;
  }
}

/* Always-visible access to the newer studio features. */
.feature-nav {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 10px 24px;
  background: #f0f5ec;
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}
.feature-nav button {
  font-size: 0.8125rem;
  min-height: 34px;
  padding: 7px 12px;
}
.release-tag {
  font-size: 0.75rem;
  color: var(--accent-dark);
  margin-right: 8px;
  font-weight: 650;
}
@media (min-width: 1151px) {
  .app {
    height: calc(100dvh - 132px);
  }
}
@media (max-width: 700px) {
  .feature-nav {
    padding: 10px 12px;
    gap: 6px;
  }
  .feature-nav button {
    flex: 1 1 44%;
  }
  .release-tag {
    width: 100%;
  }
}
@media print {
  .feature-nav {
    display: none !important;
  }
}

.patch-shape-label {
  font-size: 0.75rem;
  color: var(--muted);
  margin: -5px 0 12px;
  min-height: 1em;
}
.swap-paint {
  margin-bottom: 12px;
  font-size: 0.8125rem;
}

/* Account surfaces keep local design tools available to guests. */
.brand h1 {
  font-size: 1.55rem;
  letter-spacing: -0.065em;
  white-space: nowrap;
}
.account-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px 24px;
  background: #fff;
  border-bottom: 1px solid var(--line);
}
.account-bar .account-status {
  font-size: 0.75rem;
  color: var(--muted);
  margin-left: auto;
  max-width: 440px;
  line-height: 1.4;
}
.account-bar button {
  font-size: 0.8125rem;
  min-height: 34px;
}
.account-dialog {
  width: min(500px, calc(100vw - 24px));
}
.collection-dialog {
  width: min(880px, calc(100vw - 24px));
}
.account-eyebrow {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  margin-bottom: 6px;
}
.account-note {
  font-size: 0.8rem;
  line-height: 1.6;
  color: var(--muted);
}
.account-message {
  font-size: 0.875rem;
  line-height: 1.5;
  color: #345c39;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.account-message:empty {
  display: none;
}
.account-message.error,
.account-status.error {
  color: #a1322a;
}
.account-links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.account-links button {
  font-size: 0.78rem;
  background: #f3f6f2;
}
.account-detail {
  padding-top: 14px;
}
.account-danger {
  border-top: 1px solid var(--line);
  padding-top: 16px;
  color: #923d36;
}
.saved-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.saved-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px;
  display: grid;
  gap: 12px;
  overflow-wrap: anywhere;
}
.saved-card h3 {
  font-size: 1rem;
}
.saved-card p {
  font-size: 0.8rem;
  color: var(--muted);
}
.saved-colours {
  display: flex;
  border-radius: 7px;
  overflow: hidden;
  height: 30px;
}
.saved-colours i {
  flex: 1;
}
.saved-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.saved-actions button {
  font-size: 0.75rem;
  min-height: 32px;
  padding: 6px 9px;
}
.saved-actions button:first-child {
  background: var(--accent);
  border-color: var(--accent);
}
[hidden] {
  display: none !important;
}
@media (min-width: 1151px) {
  body {
    height: 100dvh;
    display: flex;
    flex-direction: column;
  }
  .app {
    height: auto !important;
    flex: 1;
    min-height: 0;
  }
  .topbar,
  .feature-nav,
  .account-bar {
    flex-shrink: 0;
  }
}
@media (max-width: 700px) {
  .account-bar {
    padding: 10px 12px;
  }
  .account-bar .account-status {
    flex-basis: 100%;
    margin-left: 0;
  }
  .brand h1 {
    font-size: 1.4rem;
  }
  .saved-grid {
    grid-template-columns: 1fr;
  }
}
@media print {
  [data-online-only] {
    display: none !important;
  }
  body {
    height: auto;
    display: block;
  }
}

/* Physical rulers share the SVG's coordinate scale; dots are drawn in world units. */
#stage {
  background-image: none;
}
#stage > .measurement-rulers {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 2;
}
.measurement-rulers path {
  stroke: #647060;
  stroke-width: 1;
}
.measurement-rulers text {
  font:
    10px system-ui,
    sans-serif;
  fill: #354532;
  stroke: none;
}
.measurement-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 6px 12px;
  border-bottom: 1px solid var(--line);
  background: #f8faf6;
  flex-shrink: 0;
}
.measurement-bar button,
.measurement-bar select {
  min-height: 28px;
  font-size: 11px;
  padding: 4px 7px;
  width: auto;
}
#measurement-info {
  font-size: 11px;
  color: var(--muted);
  flex: 1;
  min-width: 160px;
}
.canvas-context {
  position: fixed;
  z-index: 1000;
  min-width: 275px;
  max-width: calc(100vw - 16px);
  max-height: calc(100dvh - 16px);
  overflow: auto;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 6px;
  box-shadow: 0 10px 40px #23374730;
}
.canvas-context button {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border: 0;
  background: none;
  width: 100%;
  text-align: left;
  font-size: 12px;
  border-radius: 5px;
}
.canvas-context button:hover,
.canvas-context button:focus-visible {
  background: #eef4e4;
}
.canvas-context kbd {
  color: var(--muted);
  white-space: nowrap;
}
.canvas-context hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 5px;
}
@media print {
  .measurement-bar,
  .measurement-rulers,
  .canvas-context {
    display: none !important;
  }
}

.palettes {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(30px, 1fr));
  gap: 6px;
}
.palette-actions {
  margin: 8px 0;
  gap: 5px;
}
.palette-actions button {
  font-size: 11px;
  padding: 5px 7px;
}
.fabric-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.saved-colours.textured-preview {
  height: auto;
  min-height: 64px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(45px, 1fr));
  gap: 4px;
  overflow: visible;
}
.saved-fabric-swatch {
  position: relative;
  display: block;
  aspect-ratio: 1;
  border-radius: 5px;
  overflow: hidden;
}
.saved-fabric-swatch img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.wheel-editor {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 25px;
  align-items: start;
}
.colour-wheel {
  position: relative;
  width: 200px;
  height: 200px;
  border-radius: 50%;
  background: conic-gradient(#f00, #ff0, #0f0, #0ff, #00f, #f0f, #f00);
  touch-action: none;
  cursor: crosshair;
}
.colour-wheel:after {
  content: '';
  position: absolute;
  inset: 30px;
  border-radius: 50%;
  background: radial-gradient(white, #ffffffb0);
  pointer-events: none;
}
#wheel-pointer {
  position: absolute;
  width: 16px;
  height: 16px;
  border: 3px solid #fff;
  box-shadow: 0 0 0 2px #233747;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  z-index: 1;
  pointer-events: none;
}
.wheel-sample {
  height: 35px;
  margin-top: 14px;
  border-radius: 5px;
}
.harmony-swatches {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.harmony-swatches button {
  width: 95px;
  height: 80px;
  align-items: end;
  padding: 5px;
}
.harmony-swatches span {
  background: #ffffffe6;
  color: #233747;
  font-size: 10px;
  padding: 3px;
}
.making-overview {
  width: 320px;
  max-width: 100%;
  margin: 15px 0;
}
.making-step {
  padding: 15px 0;
  border-bottom: 1px solid var(--line);
  break-inside: avoid;
}
.making-step label {
  display: flex;
  align-items: center;
  gap: 10px;
}
.making-step p {
  margin: 8px 0 0;
  line-height: 1.65;
}
.making-blocks {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 20px;
}
.making-diagrams {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.making-diagrams svg {
  width: 180px;
  max-width: 100%;
}
.making-placement {
  width: 100%;
  border-collapse: collapse;
}
.making-placement td,
.making-placement th {
  padding: 10px;
  border: 1px solid var(--line);
  vertical-align: top;
  text-align: left;
}
@media (max-width: 600px) {
  .wheel-editor {
    grid-template-columns: 1fr;
  }
  .colour-wheel {
    margin: auto;
  }
}
.admin-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 12px;
}
.admin-stats > div {
  border: 1px solid #ccd6d9;
  border-radius: 12px;
  padding: 15px;
  background: #f5f8f2;
}
.admin-stats span {
  display: block;
  font-size: 13px;
}
.admin-stats strong {
  display: block;
  font-size: 25px;
  margin-top: 6px;
}
.admin-table {
  overflow: auto;
}
.admin-table table {
  width: 100%;
  border-collapse: collapse;
}
.admin-table td,
.admin-table th {
  text-align: left;
  padding: 9px;
  border-bottom: 1px solid #ddd;
}

/* Studio interface: persistent tools, separate surfaces and one scroll area per dialog. */
:root {
  --ink: #253d43;
  --muted: #657571;
  --line: #d6dfdb;
  --canvas: #e8eeeb;
  --accent: #27695e;
  --accent-dark: #1e5149;
  --paper: #fffefa;
  background: #f2f4ef;
}
[hidden] {
  display: none !important;
}
button {
  border-radius: 9px;
  min-height: 40px;
  box-shadow: 0 1px 1px #1e393808;
}
button.primary,
.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}
button.primary:hover {
  background: var(--accent-dark);
  border-color: var(--accent-dark);
  color: white;
}
button.secondary {
  background: #eaf2ee;
  border-color: #bfd2c9;
  color: #244e42;
}
button.secondary:hover {
  background: #dcece3;
}
button.danger {
  color: #a13e32;
  border-color: #e6c7c0;
  background: #fff8f6;
}
button.danger.quiet {
  border-color: transparent;
  background: transparent;
}
select,
input:not([type='range']):not([type='checkbox']):not([type='radio']),
textarea {
  border: 1px solid #bccbc5;
  background: #fffefa;
  border-radius: 8px;
}
select {
  appearance: none;
  background-color: #f5f8f4;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='10'%3E%3Cpath d='m2 2 5 5 5-5' fill='none' stroke='%23253d43' stroke-width='2'/%3E%3C/svg%3E");
  background-position: right 12px center;
  background-repeat: no-repeat;
  padding-right: 34px !important;
  min-height: 44px;
}
.topbar {
  background: #fffefa;
}
.feature-strip {
  background: #e9efdf;
}
.release-tag {
  background: #dbe5d8;
  color: #344c3b;
}
.account-bar {
  background: #f8faf6;
}
.account-bar .primary {
  background: #27695e;
}
.app {
  grid-template-columns: 320px minmax(320px, 1fr) 270px;
}
.sidebar.left {
  padding: 14px;
  background: #edf1eb;
  display: flex;
  flex-direction: column;
  gap: 16px;
  scrollbar-width: auto;
  scrollbar-color: #91a49b #edf1eb;
}
.editor-panel {
  padding: 17px;
  border: 1px solid #d6dfd4;
  border-radius: 13px;
  background: #fffefa;
  box-shadow: 0 2px 4px #24453b05;
  flex-shrink: 0;
}
.editor-panel .section-head {
  padding-bottom: 12px;
  margin-bottom: 14px;
  border-bottom: 1px solid #e1e7df;
}
.editor-panel h2 {
  font-size: 15px;
  letter-spacing: 0;
}
.panel-kicker {
  font-size: 10px !important;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: #6b786a;
  margin: 0 0 5px !important;
  font-weight: 650;
  line-height: 1.4 !important;
}
.editor-panel .block-picker {
  margin-bottom: 14px;
}
.editor-panel .block-name {
  margin-bottom: 12px;
}
.editor-panel .editor-frame {
  background: #edf1e9;
  padding: 7px;
  border-color: #d6dfd4;
  border-radius: 8px;
}
.brush-panel {
  border-top: 3px solid #7897aa;
}
.fabrics-panel {
  border-top: 3px solid #ac8663;
}
.making-panel {
  border-top: 3px solid #719377;
}
.brush-panel .fields {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid #e1e7df;
}
.brush-panel .disclosure {
  margin-top: 12px;
  border-top: 1px solid #e1e7df;
  padding-top: 12px;
}
.editor-panel .subtle-note {
  margin-top: 12px;
  line-height: 1.55;
}
.shape-tools {
  gap: 8px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.shape-tools button {
  min-height: 44px;
  padding: 8px;
  background: #f7f8f3;
  border-color: #d9e1d6;
}
.shape-tools button.active {
  background: #e1eee7;
  border-color: #3b7765;
  box-shadow: 0 0 0 1px #3b7765;
}
.paint-colors {
  margin-top: 14px;
}
.paint-color.active {
  background: #e4f0e9 !important;
  color: #234e40 !important;
  border-color: #568673 !important;
}
.swap-paint {
  margin-top: 9px;
  background: #f3f6f1;
  color: #3c5b49;
}
.palettes {
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 9px;
  padding: 2px;
  margin-bottom: 16px;
}
.palette-color {
  height: auto !important;
  width: 100% !important;
  aspect-ratio: 1;
  min-height: 32px;
  position: relative;
  border: 2px solid #ffffff !important;
  border-radius: 9px;
}
.palette-color.active {
  outline: 2px solid #315f51;
  outline-offset: 1px;
}
.palette-color.active:after {
  content: '✓';
  position: absolute;
  right: -3px;
  bottom: -3px;
  background: #315f51;
  color: #fff;
  width: 17px;
  height: 17px;
  line-height: 17px;
  border-radius: 50%;
  font-size: 11px;
}
.palette-actions {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  margin: 0 0 16px;
}
.palette-actions button {
  font-size: 12px;
  padding: 8px;
}
.palette-actions #colour-wheel-open {
  grid-column: 1/-1;
  text-align: left;
  justify-content: flex-start;
  min-height: 34px;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.palette-label {
  margin: 0 0 8px;
}
.palette-change {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 14px;
}
.edit-colour {
  width: 100%;
  justify-content: flex-start;
  background: #f5f7f0 !important;
  padding: 10px !important;
}
.edit-colour span:last-child {
  margin-left: auto;
}
.edit-colour #selected-colour-chip {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  border: 1px solid #21382933;
  flex: none;
}
.palette-preset-field {
  width: 100%;
}
.palette-preset-field select {
  width: 100%;
}
.making-panel .feature-buttons {
  margin: 0;
  gap: 10px;
}
.making-panel button {
  justify-content: flex-start;
  text-align: left;
  padding: 12px;
}
.analytics-toast {
  position: fixed;
  bottom: 22px;
  right: 22px;
  width: min(330px, calc(100vw - 32px));
  z-index: 500;
  padding: 15px 18px;
  margin: 0;
  background: #253d43;
  color: #fff;
  border: 1px solid #ffffff33;
  border-radius: 12px;
  box-shadow: 0 8px 30px #253d4340;
  pointer-events: none;
  font-size: 12px;
  line-height: 1.5;
}
.analytics-toast strong {
  display: block;
  color: #e1edca;
  margin-bottom: 3px;
}
.analytics-toast span {
  display: block;
}
dialog {
  background: #edf2ee;
  border: 1px solid #a7bdb4;
  border-radius: 18px;
  max-height: 90dvh;
  box-shadow: 0 25px 90px #122d3266;
}
dialog[open] {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
dialog::backdrop {
  background: #122c38a6;
  backdrop-filter: blur(5px);
}
dialog .dialog-head {
  flex: 0 0 auto;
  background: #fffefa;
  padding: 20px 24px;
  border-bottom: 1px solid #c7d5cd;
  box-shadow: 0 3px 8px #173d3208;
  gap: 16px;
}
dialog .dialog-head h2 {
  font-size: 19px;
  letter-spacing: -0.02em;
}
dialog .dialog-head button {
  width: 40px;
  min-width: 40px;
  height: 40px;
  background: #eef3ed;
  border-color: #d2ddd4;
  color: #253d43;
  box-shadow: none;
}
dialog > .dialog-body {
  min-height: 0;
  flex: 1 1 auto;
  max-height: none !important;
  overflow-y: auto !important;
  overflow-x: hidden;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  scrollbar-width: auto;
  scrollbar-color: #9bafa5 #e7eee7;
  padding: 22px;
  background: #edf2ee;
}
.dialog-scroll-cue {
  flex: 0 0 auto;
  text-align: center;
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.03em;
  background: #dde9e0;
  color: #375847;
  padding: 6px;
  border-top: 1px solid #bccfc2;
}
.dialog-actions {
  flex: 0 0 auto;
  padding: 14px 22px;
  background: #fffefa;
  border-top: 1px solid #c7d5cd;
  box-shadow: 0 -4px 12px #173d3208;
}
.modal-panel {
  padding: 20px;
  border: 1px solid #d0ddd3;
  background: #fffefa;
  border-radius: 12px;
  margin-bottom: 18px;
}
.modal-panel .section-head {
  border-bottom: 1px solid #e3e8df;
  padding-bottom: 12px;
  margin-bottom: 18px;
}
.modal-panel h3 {
  margin: 0;
  font-size: 16px;
}
.modal-panel .field {
  gap: 8px;
}
#colour-wheel-dialog {
  width: min(760px, calc(100vw - 32px));
  max-width: 760px;
}
.wheel-editor {
  grid-template-columns: 200px minmax(0, 1fr);
  gap: 26px;
}
.wheel-preview {
  display: flex;
  flex-direction: column;
  align-items: center;
}
.colour-wheel {
  flex-shrink: 0;
  box-shadow:
    0 0 0 1px #d0dacf,
    0 4px 12px #37544415;
}
.colour-wheel:after {
  inset: 32px;
  background: var(--wheel-current, #fff);
  box-shadow: inset 0 0 0 8px #fffefa;
}
.wheel-sample {
  width: 100%;
  height: 28px;
  border: 1px solid #23493722;
}
.wheel-preview output {
  font:
    600 13px ui-monospace,
    monospace;
  letter-spacing: 0.04em;
  margin-top: 9px;
}
.wheel-controls {
  gap: 14px;
}
.slider-label {
  display: flex;
  justify-content: space-between;
  width: 100%;
}
.slider-label output {
  color: #677e71;
  font-variant-numeric: tabular-nums;
}
.wheel-controls input[type='range'] {
  width: 100%;
  height: 28px;
  margin: 0;
  accent-color: #27695e;
  cursor: pointer;
}
.wheel-controls input[type='text'] {
  width: 100%;
  font:
    600 14px ui-monospace,
    monospace;
  padding: 10px 12px;
}
.harmony-panel select {
  width: 100%;
  margin-bottom: 4px;
}
.harmony-panel p {
  margin: 10px 0 12px;
}
.harmony-swatches {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(94px, 1fr));
  gap: 12px;
}
.harmony-swatches button {
  width: 100%;
  height: 100px;
  border-radius: 10px;
  padding: 0;
  overflow: hidden;
  align-items: stretch;
  justify-content: flex-end;
  flex-direction: column;
  border: 1px solid #263b3b22;
  position: relative;
}
.harmony-swatches span {
  font:
    600 11px ui-monospace,
    monospace;
  text-align: center;
  padding: 8px;
  background: #fffffff0;
}
.harmony-swatches .match-state {
  font: 600 11px system-ui;
  color: #315c48;
  background: #f4fbf2f0;
  padding: 5px;
}
.harmony-swatches button.added {
  opacity: 1;
  box-shadow: 0 0 0 2px #427b60;
  border-color: white;
  cursor: default;
}
.inline-feedback {
  margin: 0 0 9px;
  min-height: 18px;
  font-size: 12px;
  color: #2c6b4e;
}
.inline-feedback.error {
  color: #a1372f;
}
#library-dialog .saved-card {
  background: #fffefa;
  border: 1px solid #c7d7cb;
  padding: 18px;
  box-shadow: 0 3px 10px #23423108;
}
.saved-actions {
  border-top: 1px solid #e3e8df;
  padding-top: 12px;
}
.saved-actions button[data-saved-action='delete'] {
  color: #a13e32;
  border-color: #e9d2cc;
}
.saved-card h3 {
  margin-top: 16px !important;
}
.library-tabs {
  padding-bottom: 14px;
  border-bottom: 1px solid #cbd9cf;
}
.template-card,
.variation-card {
  background: #fffefa !important;
  border-color: #cbd8cc !important;
}
@media (min-width: 1101px) {
  .sidebar.right {
    background: #f8faf5;
    padding: 18px;
  }
  .sidebar.right > section {
    padding-bottom: 18px;
    margin-bottom: 18px;
    border-bottom: 1px solid #d5dfd5;
  }
}
@media (max-width: 1100px) {
  .app {
    grid-template-columns: 290px minmax(300px, 1fr);
  }
  .sidebar.left {
    padding: 12px;
  }
  .editor-panel {
    padding: 14px;
  }
}
@media (max-width: 700px) {
  .app {
    display: flex;
    flex-direction: column;
    height: auto;
    min-height: 0;
  }
  .sidebar.left {
    display: flex;
    overflow: visible;
    width: 100%;
    padding: 12px;
    gap: 12px;
  }
  .editor-panel {
    width: 100%;
    padding: 16px;
  }
  .block-picker {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }
  .editor-frame {
    max-width: 360px;
    margin-inline: auto;
  }
  .shape-tools {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }
  .palettes {
    grid-template-columns: repeat(8, minmax(0, 1fr));
  }
  .account-bar {
    padding: 10px 12px;
    gap: 6px;
  }
  .account-bar .account-status {
    width: 100%;
    max-width: none;
    margin-left: 0;
  }
  .account-bar button {
    min-height: 38px;
  }
  .workspace {
    min-height: 520px;
  }
  .analytics-toast {
    bottom: 16px;
    right: 16px;
  }
  dialog {
    width: calc(100vw - 20px) !important;
    max-width: none;
    max-height: 92dvh;
    border-radius: 14px;
  }
  dialog .dialog-head {
    padding: 14px 16px;
  }
  dialog .dialog-head h2 {
    font-size: 17px;
  }
  dialog > .dialog-body {
    padding: 12px !important;
  }
  .dialog-actions {
    padding: 12px 14px;
  }
  .dialog-actions .row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }
  .dialog-actions button {
    font-size: 12px;
    padding: 10px 8px;
    min-height: 44px;
  }
  .modal-panel {
    padding: 15px;
    margin-bottom: 12px;
  }
  .wheel-editor {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  .wheel-preview {
    width: 200px;
    margin: auto;
  }
  .wheel-controls {
    gap: 15px;
  }
  .wheel-controls input[type='range'] {
    height: 32px;
  }
  .harmony-swatches {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .harmony-swatches button {
    height: 105px;
  }
  .dialog-scroll-cue {
    padding: 7px;
    font-size: 12px;
  }
  .library-grid {
    grid-template-columns: 1fr !important;
  }
  .fabric-editor {
    grid-template-columns: 1fr;
  }
  .fabric-photo {
    max-width: 200px;
  }
  .feature-strip {
    overflow-x: auto;
    flex-wrap: nowrap;
  }
  .feature-strip button {
    white-space: nowrap;
  }
}
.saved-actions button:first-child {
  color: #fff;
  background: #27695e;
  border-color: #27695e;
}
.saved-actions button:first-child:hover {
  color: #fff;
  background: #1e5149;
}
@media (min-width: 701px) and (max-width: 1150px) {
  .app {
    grid-template-columns: 290px minmax(300px, 1fr);
  }
}
.dialog-actions button {
  min-width: 0;
  overflow-wrap: anywhere;
}
@media (max-width: 700px) {
  .palettes {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }
}
@media (max-width: 360px) {
  .shape-tools {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}
/* Illustrated making lessons */
#sewing-dialog {
  width: min(1080px, 96vw);
}
.sewing-selectors {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.sewing-selectors .field {
  min-width: 0;
}
.sewing-selectors select {
  width: 100%;
}
.sewing-key {
  grid-column: 1 / -1;
  border-top: 1px solid #dae3d7;
  padding-top: 14px;
}
.sewing-key summary {
  cursor: pointer;
  font-weight: 650;
  color: #27695e;
}
.sewing-key dt {
  font-weight: 700;
  margin-top: 12px;
}
.sewing-key dd {
  margin: 3px 0 0;
  line-height: 1.6;
}
.sewing-key p {
  border-top: 1px solid #dae3d7;
  padding-top: 12px;
}
.sewing-location {
  color: #486050;
  font-size: 12px;
  font-weight: 600;
}
.sewing-step {
  background: #fffefa;
  border: 1px solid #cad8cb;
  border-radius: 12px;
  padding: 22px;
}
.sewing-step h3 {
  font-size: 21px;
  line-height: 1.3;
  margin: 5px 0 14px;
}
.sewing-step p {
  line-height: 1.65;
}
.sewing-step .panel-kicker {
  color: #27695e;
  font-weight: 650;
}
.sewing-illustration {
  margin-top: 20px;
}
.sewing-illustration > svg {
  display: block;
  width: 100%;
  max-width: 390px;
  height: auto;
  margin: 0 auto;
}
.sewing-join,
.sewing-cuts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}
.sewing-join figure,
.sewing-cuts article {
  margin: 0;
  min-width: 0;
  padding: 12px;
  border: 1px solid #d4ddd0;
  border-radius: 9px;
  background: #fff;
}
.sewing-join svg,
.sewing-cuts svg {
  display: block;
  width: 100%;
  height: auto;
}
.sewing-join figcaption {
  font-weight: 700;
  padding-top: 10px;
  color: #27695e;
}
.sewing-join p,
.sewing-cuts p {
  font-size: 13px;
}
.sewing-cuts h4 {
  font-size: 14px;
  margin: 12px 0 0;
}
.sewing-template {
  width: 100%;
  font-size: 12px;
  white-space: normal;
}
.sewing-piece-key {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 20px;
}
.sewing-piece-key span {
  border: 1px solid #cfdccb;
  padding: 6px 10px;
  border-radius: 6px;
  background: #f2f5ed;
  font-size: 12px;
}
.sewing-navigation {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 12px;
  align-items: center;
}
.sewing-navigation button {
  min-height: 44px;
}
#sewing-step-progress {
  font-size: 12px;
  text-align: center;
  font-weight: 650;
}
.sewing-exports {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}
.sewing-exports button {
  font-size: 12px;
}
.making-step {
  padding: 22px;
  margin: 18px 0;
  border: 1px solid #cdd9cd;
  border-radius: 12px;
  background: #fffefa;
}
.making-step-illustration {
  width: 300px;
  max-width: 100%;
  margin-top: 16px;
}
.making-step-illustration svg {
  width: 100%;
  height: auto;
  display: block;
  border: 1px solid #d8e1d5;
  border-radius: 8px;
}
.making-step-illustration small {
  display: block;
  margin-top: 6px;
  font-size: 11px;
  color: #51695b;
}
.making-block {
  border: 1px solid #cdd9cd;
  padding: 18px;
  border-radius: 12px;
  background: #fffefa;
}
@media (max-width: 700px) {
  .sewing-selectors {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .sewing-join,
  .sewing-cuts {
    grid-template-columns: 1fr;
  }
  .sewing-step {
    padding: 16px;
  }
  .sewing-step h3 {
    font-size: 19px;
  }
  .sewing-join svg,
  .sewing-cuts svg {
    max-width: 300px;
    margin: auto;
  }
  .sewing-navigation {
    gap: 8px;
    padding: 12px;
  }
  .sewing-navigation button {
    padding: 10px 8px;
  }
  .making-step {
    padding: 16px;
  }
}
@media print {
  #print-area .sewing-step,
  #print-area .making-step {
    break-inside: avoid;
    border: 0;
    border-top: 1px solid #aaa;
    border-radius: 0;
    padding: 15px 0;
  }
  #print-area .sewing-join,
  #print-area .sewing-cuts {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  #print-area .sewing-illustration > svg {
    width: 280px;
    max-height: 220px;
  }
  #print-area .sewing-join svg,
  #print-area .sewing-cuts svg {
    max-height: 170px;
  }
  #print-area .making-step-illustration {
    width: 220px;
  }
  #print-area .making-step-illustration svg {
    max-height: 200px;
  }
}
/* Keep workspace identity and view controls next to the canvas. */
.workspace {
  overflow: visible;
  max-height: none;
  min-height: 760px;
}
.workspace > :not(.stage) {
  flex-shrink: 0;
}
.workspace-header {
  padding: 12px 16px;
}
.workspace-header .tabs {
  width: 100%;
  padding: 4px;
  gap: 6px;
  background: #dce7e0;
}
.workspace-header .tabs button {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
  padding: 12px;
  border: 1px solid transparent;
}
.workspace-header .tabs strong {
  font-size: 14px;
}
.workspace-header .tabs small {
  font-size: 11px;
  opacity: 0.85;
}
.workspace-header .tabs button.active {
  color: #fff;
  background: #27695e;
  border-color: #1d554b;
  box-shadow: 0 2px 4px #1f3f3720;
}
[data-workspace='board'] .tabs button.active {
  background: #62547c;
  border-color: #514266;
}
.workspace-mode {
  margin: 12px 16px 0;
  padding: 14px;
  border: 1px solid #bdcec3;
  border-left: 4px solid #27695e;
  border-radius: 10px;
  background: #f8fbf6;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
}
.workspace-mode > div:first-child {
  flex: 1 1 220px;
}
.workspace-mode strong {
  display: block;
  font-size: 15px;
}
#canvas-summary {
  display: block;
  font-size: 12px;
  font-weight: 600;
  margin-top: 4px;
}
.workspace-mode p {
  font-size: 12px;
  line-height: 1.5;
  margin: 6px 0 0;
}
.workspace-mode.grid-full {
  background: #fff6e7;
  border-color: #d9bd88;
  border-left-color: #a36c2d;
}
[data-workspace='board'] .workspace-mode {
  background: #f7f4fc;
  border-color: #cec4dc;
  border-left-color: #62547c;
}
[data-workspace='board'] .stage {
  background-color: #ece9f1;
}
#quilt-grow {
  gap: 6px;
}
#quilt-grow button {
  min-height: 40px;
  padding: 8px 10px;
  font-size: 12px;
}
.stage-tools {
  padding: 10px 16px;
  gap: 8px;
}
.toolgroup {
  flex-wrap: wrap;
  gap: 2px;
}
.toolgroup button {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  height: auto;
  min-height: 40px;
  padding: 7px;
}
.toolgroup button svg {
  width: 19px;
  height: 19px;
}
.viewport-controls {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 12px;
  padding: 10px 16px;
  border-block: 1px solid #ccd8ce;
  background: #fffefa;
  position: sticky;
  top: 0;
  z-index: 4;
}
.viewport-controls label {
  font-weight: 700;
  font-size: 12px;
}
.zoom-controls {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1 1 230px;
}
.zoom-controls button {
  flex: 0 0 auto;
  min-width: 40px;
  height: 40px;
  min-height: 40px;
  padding: 8px;
}
.zoom-controls input {
  min-width: 40px;
  width: 90px;
  flex: 1;
}
.zoom-controls output {
  flex: 0 0 42px;
  text-align: center;
  font-size: 12px;
  font-weight: 650;
}
.viewport-controls small {
  width: 100%;
  font-size: 11px;
  color: #5f7068;
}
.stage {
  min-height: 320px;
}
#main-canvas {
  touch-action: none;
}
#wheel-name {
  display: block;
  margin-top: 8px;
  line-height: 1.5;
  font-weight: 650;
  color: #425a4c;
}
@media (min-width: 1151px) {
  .app {
    min-height: 760px;
  }
}
@media (max-width: 700px) {
  .workspace {
    min-height: 0;
    height: auto;
    max-height: none;
  }
  .stage {
    flex: none;
    height: 50dvh;
    min-height: 320px;
  }
  .workspace-header,
  .stage-tools,
  .viewport-controls {
    padding-inline: 12px;
  }
  .workspace-mode {
    margin-inline: 12px;
  }
  .zoom-controls {
    flex-basis: 100%;
  }
}
.interactive-cell.empty-cell {
  stroke: #648271;
  stroke-width: 1;
  stroke-opacity: 0.65;
  stroke-dasharray: 4 3;
  fill: #ffffff18;
}
@media (max-width: 420px) {
  .top-actions {
    justify-content: space-between;
    gap: 4px;
    flex-wrap: wrap;
  }
  .top-actions .divider {
    display: none;
  }
  .top-actions button {
    min-width: 40px;
    min-height: 40px;
    padding: 8px;
    font-size: 12px;
  }
  .top-actions .icon {
    width: 40px;
  }
  .top-actions #save-project svg,
  .top-actions #export svg {
    display: none;
  }
  .project-title {
    flex: 1 1 80px;
    min-width: 0;
  }
}

/* The layout inspector shares the block editor's separate paper cards. */
.sidebar.right {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 14px;
  background: #edf1eb;
  scrollbar-width: auto;
  scrollbar-color: #91a49b #edf1eb;
}
.sidebar.right .settings-group {
  display: contents;
}
.sidebar.right > section.editor-panel,
.sidebar.right .settings-group > .editor-panel {
  padding: 17px;
  margin: 0;
  border: 1px solid #d6dfd4;
  border-radius: 13px;
  min-width: 0;
}
.sidebar.right .fields {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.sidebar.right .field {
  min-width: 0;
}
.sidebar.right .field input,
.sidebar.right .field select {
  width: 100%;
  min-width: 0;
}
.sidebar.right .stack {
  gap: 14px;
}
.sidebar.right .subtle-note {
  margin: 12px 0 0;
  font-size: 12px;
}
.sidebar.right .section-head + .subtle-note {
  margin: 0 0 16px;
}
.sidebar.right .check {
  align-items: flex-start;
  line-height: 1.5;
  font-size: 12px;
}
.sidebar.right .check input {
  flex: 0 0 auto;
  margin-top: 3px;
}
.sidebar.right button {
  white-space: normal;
  line-height: 1.4;
}
.sidebar.right .dimensions-panel {
  border-top: 3px solid #7897aa !important;
}
.sidebar.right .repeat-panel {
  border-top: 3px solid #719377 !important;
}
.sidebar.right .edges-panel {
  border-top: 3px solid #ac8663 !important;
}
.sidebar.right .board-panel,
.sidebar.right .selection-panel {
  border-top: 3px solid #9383a4 !important;
}
.sidebar.right .balance-panel {
  border-top: 3px solid #b0a16b !important;
}
.sidebar.right .layout-stat {
  background: #eaf0e6;
  border: 1px solid #cbd7c3;
  border-radius: 9px;
  padding: 14px;
  margin-top: 18px;
}
.sidebar.right .layout-stat strong {
  font-size: 20px;
}
.sidebar.right .selected-info {
  background: #f0edf4;
  border: 1px solid #d7cfe1;
  border-radius: 8px;
  padding: 12px;
  font-size: 12px;
  line-height: 1.6;
}
.sidebar.right .selection-inset {
  margin-top: 20px;
  border-top: 1px solid #d7dfd2;
  padding-top: 16px;
}
.sidebar.right .selection-inset h3 {
  margin: 0 0 12px;
  font-size: 14px;
}
.sidebar.right .balance-panel .disclosure {
  margin: 0;
  border: 0;
  padding: 0;
}
.sidebar.right .balance-panel summary {
  border-bottom: 1px solid #e1e7df;
  padding-bottom: 14px;
  margin-bottom: 14px;
  font-size: 15px;
}
.sidebar.right .balance-panel summary .panel-kicker {
  display: block;
}
.sidebar.right #repeat-board {
  background: #eaf2ee;
  color: #244e42;
  border-color: #bfd2c9;
}
#send-to-board {
  white-space: normal;
  text-align: left;
  line-height: 1.35;
  min-height: 40px;
}
#help-tour-start {
  margin-bottom: 20px;
}
#get-started {
  border-color: #97b7a9;
  font-weight: 650;
}
@media (min-width: 1151px) {
  .app {
    grid-template-columns: 320px minmax(320px, 1fr) 300px;
  }
}
@media (min-width: 701px) and (max-width: 1150px) {
  .sidebar.right {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: start;
  }
}
@media (max-width: 700px) {
  .sidebar.right {
    width: 100%;
    padding: 12px;
    gap: 12px;
    overflow: visible;
  }
  .sidebar.right > section.editor-panel,
  .sidebar.right .settings-group > .editor-panel {
    padding: 16px;
  }
  #send-to-board {
    padding-inline: 6px;
  }
}

/* Full-screen transparent dialog: one continuous dimmed surface with a real-page spotlight. */
#studio-tour {
  display: none;
  position: fixed;
  inset: 0;
  width: 100vw !important;
  height: 100dvh;
  max-width: none !important;
  max-height: none !important;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  overflow: hidden;
  overscroll-behavior: none;
}
#studio-tour[open] {
  display: block;
}
#studio-tour::backdrop {
  background: transparent;
  backdrop-filter: none;
}
#studio-tour .tour-overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
#studio-tour .tour-card {
  position: absolute;
  width: 360px;
  max-height: min(470px, calc(100dvh - 24px));
  overflow-y: auto;
  overscroll-behavior: contain;
  background: #fffefa;
  color: #253d43;
  border: 1px solid #c9d9c9;
  border-top: 4px solid #e0c580;
  border-radius: 14px;
  box-shadow: 0 18px 60px #071d2555;
  padding: 18px 20px;
}
.tour-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}
#studio-tour .tour-card-top .panel-kicker {
  color: #52685a;
}
#tour-close {
  min-height: 32px;
  width: 32px;
  padding: 0;
  font-size: 22px;
  line-height: 1;
  border-color: transparent;
  background: #edf1e8;
  flex-shrink: 0;
}
#studio-tour h2 {
  font-size: 21px;
  line-height: 1.25;
  margin: 0 0 12px;
  color: #253d43;
}
#studio-tour p {
  font-size: 14px;
  line-height: 1.65;
  margin: 0 0 18px;
  color: #425b50;
}
.tour-track {
  height: 4px;
  border-radius: 4px;
  overflow: hidden;
  background: #e5eadf;
  margin-bottom: 18px;
}
.tour-track span {
  display: block;
  height: 100%;
  background: #527b65;
  transition: width 160ms ease;
}
.tour-navigation {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}
.tour-navigation button {
  min-height: 42px;
  font-size: 13px;
}
.tour-key-hint {
  display: block;
  font-size: 10px;
  color: #64766b;
  margin-top: 12px;
  text-align: center;
}
#studio-tour button:focus-visible {
  outline: 3px solid #c09336;
  outline-offset: 3px;
}
@media (max-width: 1150px) {
  body.tour-active {
    padding-bottom: var(--tour-reserve, 300px);
  }
  #studio-tour .tour-card {
    padding: 13px 16px;
    max-height: 49dvh;
  }
  #studio-tour h2 {
    font-size: 18px;
    margin-bottom: 9px;
  }
  #studio-tour p {
    font-size: 13px;
    line-height: 1.55;
    margin-bottom: 14px;
  }
  .tour-card-top {
    margin-bottom: 8px;
  }
  .tour-track {
    margin-bottom: 13px;
  }
  .tour-key-hint {
    display: none;
  }
}
@media (prefers-reduced-motion: reduce) {
  .tour-track span {
    transition: none;
  }
}

#hex-dialog {
  width: min(1150px, 96vw);
}
.hex-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: end;
}
.hex-controls .field {
  min-width: 100px;
  flex: 1;
}
.hex-controls input[type='number'] {
  width: 100%;
  min-width: 80px;
}
.hex-viewport {
  overflow: auto;
  max-height: 65vh;
  background: #e7ebe3;
  border: 1px solid #bac6b8;
  border-radius: 10px;
  padding: 12px;
}
#hex-map {
  min-width: 280px;
  margin: auto;
}
#hex-map svg {
  width: 100%;
  display: block;
}
#hex-map path {
  cursor: pointer;
}
#hex-map path:focus {
  outline: none;
  stroke: #bc5423;
  stroke-width: 3;
}
.hex-palette {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 16px 0;
}
.hex-palette button {
  display: flex;
  align-items: center;
  gap: 6px;
}
.hex-palette span {
  width: 22px;
  height: 22px;
  border-radius: 5px;
}
.hex-palette button[aria-pressed='true'] {
  outline: 2px solid #467156;
  background: #eef4e2;
}
#hex-lessons li {
  margin: 18px 0;
}
#hex-lessons svg {
  max-width: 320px;
}
.template-downloads {
  margin-bottom: 18px;
}
.template-downloads select {
  max-width: 240px;
}

/* Main navigation uses a small set of fixed actions; secondary actions live in menus. */
.action-menu {
  position: relative;
  flex-shrink: 0;
  margin: 0;
}
.action-menu > summary {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 9px 14px;
  min-height: 40px;
  border: 1px solid #becfc5;
  border-radius: 9px;
  background: #fffefa;
  color: #253d43;
  cursor: pointer;
  font-size: 13px;
  font-weight: 650;
  white-space: nowrap;
}
.action-menu > summary::-webkit-details-marker {
  display: none;
}
.action-menu > summary::after {
  content: '';
  width: 6px;
  height: 6px;
  border-right: 1.5px solid;
  border-bottom: 1.5px solid;
  transform: rotate(45deg);
  margin-top: -3px;
}
.action-menu > summary.primary {
  background: #27695e;
  border-color: #27695e;
  color: #fff;
}
.action-menu[open] > summary {
  outline: 2px solid #91b2a2;
  outline-offset: 2px;
}
.action-menu .menu-panel {
  position: fixed;
  z-index: 240;
  min-width: 250px;
  max-width: calc(100vw - 24px);
  max-height: min(65dvh, 600px);
  overflow: auto;
  padding: 10px;
  background: #fffefa;
  border: 1px solid #b8cac0;
  border-radius: 14px;
  box-shadow: 0 18px 60px #162f3a40;
}
.action-menu:not([open]) > .menu-panel {
  display: none;
}
.menu-panel .menu-heading {
  padding: 8px 10px 12px;
  font-size: 11px;
  font-weight: 750;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #67796c;
}
.action-menu .menu-panel button {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  width: 100%;
  min-height: 44px;
  padding: 10px;
  border: 0;
  background: transparent;
  box-shadow: none;
  color: #253d43;
  white-space: normal;
  text-align: left;
  font-size: 14px;
}
.action-menu .menu-panel button:hover {
  background: #eaf2e7;
}
.action-menu .menu-panel button:disabled {
  opacity: 0.45;
}
.action-menu .menu-panel button small {
  font-size: 11px;
  font-weight: 400;
  color: #657571;
  margin-top: 4px;
}
.menu-panel hr {
  border: 0;
  border-top: 1px solid #dce4d9;
  margin: 6px;
}
.menu-scrim {
  position: fixed;
  inset: 0;
  background: #152e3566;
  z-index: 230;
}
.primary-nav {
  flex-wrap: nowrap;
  gap: 10px;
}
.primary-nav button {
  white-space: nowrap;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
}
.primary-nav #get-started {
  display: flex;
}
.primary-nav #account-button {
  max-width: 190px;
  margin-left: auto;
}
.account-bar {
  display: none;
  padding: 0 24px;
  background: #fff3df;
}
.account-bar[data-attention='true'] {
  display: block;
}
.account-bar summary {
  padding: 8px 0;
  font-size: 12px;
  font-weight: 700;
  color: #805218;
  cursor: pointer;
}
.workspace-warning {
  display: grid;
  gap: 10px;
  padding: 4px 0 12px;
}
.account-bar .account-status {
  max-width: none;
  width: auto;
  margin: 0;
}
.profile-preferences {
  display: grid;
  gap: 10px;
}
.profile-preferences button {
  text-align: left;
  justify-content: flex-start;
}
.brand .release-tag {
  margin: 3px 0 0;
  letter-spacing: 0.05em;
  font-size: 10px;
  background: none;
  display: block;
}
.mobile-history {
  display: none;
}
.hex-palette button[aria-pressed='true'] {
  color: #223c2d !important;
}
.hex-controls .field > span {
  display: inline;
}
@media (min-width: 1151px) {
  .app {
    grid-template-columns: 360px minmax(320px, 1fr) 300px;
  }
}
@media (min-width: 701px) and (max-width: 1150px) {
  .app {
    grid-template-columns: 320px minmax(300px, 1fr);
  }
  .sidebar.right {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 700px) {
  .topbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas: 'brand actions' 'title title';
    gap: 10px;
    padding: 12px;
  }
  .topbar .brand {
    grid-area: brand;
    min-width: 0;
    gap: 0;
  }
  .topbar .brandmark {
    display: none;
  }
  .topbar .brand h1 {
    font-size: 20px;
    letter-spacing: -0.065em;
  }
  .topbar .top-actions {
    grid-area: actions;
    width: auto;
    flex-wrap: nowrap;
    margin-left: auto;
    gap: 7px;
  }
  .top-actions > #undo,
  .top-actions > #redo {
    display: none;
  }
  .top-actions .action-menu > summary {
    padding: 9px 11px;
    min-height: 40px;
  }
  .topbar .project-title {
    grid-area: title;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    order: 3;
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 0;
    border: 0;
  }
  .project-title input {
    padding: 5px 8px !important;
    min-height: 34px !important;
    font-size: 14px !important;
  }
  .project-title #save-status {
    font-size: 10px;
  }
  .primary-nav {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 10px 12px;
    gap: 8px;
  }
  .primary-nav button {
    width: 100%;
    min-height: 40px;
    font-size: 13px;
    justify-content: center;
  }
  .primary-nav #account-button {
    max-width: none;
    margin: 0;
  }
  .account-bar {
    padding: 0 12px;
  }
  .mobile-history {
    display: block;
  }
  .stage-tools {
    padding: 10px 12px;
    gap: 10px;
  }
}
@media (max-width: 600px) {
  .action-menu .menu-panel {
    width: auto !important;
    min-width: 0;
    max-height: 65dvh;
    padding: 12px;
    border-radius: 18px;
  }
  .menu-panel .menu-heading {
    padding-top: 12px;
  }
  .action-menu .menu-panel button {
    min-height: 46px;
  }
}
.palette-actions > .action-menu {
  width: 100%;
}
.palette-actions > .action-menu > summary {
  justify-content: space-between;
  background: #f0f4eb;
}
.palette-actions {
  display: block;
  margin: 12px 0;
}
.collection-kind-picker {
  display: none;
}
.collection-actions {
  justify-content: space-between;
  align-items: center;
  flex-wrap: nowrap;
}
.collection-actions > #library-capture {
  white-space: normal;
  min-width: 0;
}
.saved-actions {
  align-items: center;
}
.saved-actions > .action-menu {
  margin-left: auto;
}
@media (max-width: 700px) {
  .collection-kind-tabs {
    display: none;
  }
  .collection-kind-picker {
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: center;
  }
  .collection-kind-picker span {
    font-size: 12px;
  }
}
#hex-dialog {
  max-width: min(1150px, calc(100vw - 24px));
}

.hex-controls .field:has(#hex-side) {
  min-width: 155px;
}
.hex-controls .field > span {
  white-space: nowrap;
}

@media (max-width: 360px) {
  .topbar .brand h1 {
    font-size: 18px;
  }
  .top-actions .action-menu > summary {
    padding: 9px;
    gap: 8px;
  }
}
.analytics-toast {
  z-index: 220;
}

/* Drawing tools stay on the canvas, independent of its zoom and pan. */
.canvas-toolbar {
  position: absolute;
  top: 30px;
  left: 30px;
  z-index: 3;
  width: 276px;
  max-width: calc(100% - 40px);
  touch-action: manipulation;
}
.canvas-toolbar .toolgroup {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  padding: 5px;
  background: #fffefa;
  border: 1px solid #a8bdb2;
  border-radius: 13px;
  box-shadow: 0 4px 18px #263e4530;
}
.canvas-toolbar .toolgroup button {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 4px;
  padding: 5px 1px;
  height: 48px;
  min-height: 48px;
  min-width: 0;
  border-radius: 8px;
  color: #344e51;
  touch-action: manipulation;
}
.canvas-toolbar button svg {
  width: 19px;
  height: 19px;
  display: block;
}
.canvas-toolbar .canvas-tool-label {
  font-size: 10px;
  line-height: 1;
  font-weight: 650;
  white-space: nowrap;
}
.canvas-toolbar .toolgroup button:not(.active):hover {
  background: #e9f0e8;
}
.canvas-toolbar .toolgroup button.active {
  background: #27695e;
  color: #fff;
  box-shadow: inset 0 0 0 1px #205c52;
}
.canvas-toolbar .toolgroup button:focus-visible {
  outline: 2px solid #296ea4;
  outline-offset: 1px;
}
.viewport-controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px 12px;
}
.viewport-controls > label {
  grid-column: 1;
  grid-row: 1;
}
.viewport-controls .canvas-menu {
  grid-column: 2;
  grid-row: 1;
}
.viewport-controls .canvas-menu > summary {
  min-height: 34px;
  padding: 6px 10px;
  font-size: 12px;
}
.viewport-controls .zoom-controls {
  grid-column: 1 / -1;
  grid-row: 2;
  width: 100%;
  min-width: 0;
}
.viewport-controls > small {
  grid-column: 1 / -1;
  grid-row: 3;
}
@media print {
  .canvas-toolbar {
    display: none;
  }
}

.block-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 8px 0 12px;
}
.block-actions button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 40px;
  padding: 8px 5px;
  font-size: 12px;
}
.block-actions svg {
  width: 16px;
  height: 16px;
  display: block;
}
#block-delete-hint {
  margin: -2px 0 12px;
  font-size: 11px;
  line-height: 1.5;
}
#confirm-dialog {
  width: min(480px, calc(100vw - 24px));
  padding: 0;
}
#confirm-dialog .dialog-head {
  align-items: flex-start;
}
#confirm-title {
  overflow-wrap: anywhere;
}
#confirm-message {
  margin: 0;
  white-space: pre-line;
  overflow-wrap: anywhere;
  line-height: 1.6;
}
#confirm-input-field {
  margin-top: 18px;
}
.app-confirm-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.app-confirm-actions button {
  min-width: 0;
  min-height: 44px;
  white-space: normal;
  justify-content: center;
}
.app-confirm-actions:has(#confirm-secondary:not([hidden])) {
  grid-template-columns: 1fr;
}
.app-confirm-actions:has(#confirm-secondary:not([hidden])) #confirm-cancel {
  order: 3;
}
#confirm-dialog[data-tone='danger'] #confirm-yes {
  background: #a13c37;
  border-color: #a13c37;
  color: #fff;
}
#confirm-dialog[data-tone='danger'] .dialog-head {
  border-top: 4px solid #a13c37;
}

#studio-loading {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 30px;
  background: #f5f4ee;
  color: #294c43;
  text-align: center;
}
#block-editor .pending-paint {
  opacity: 0.55;
}

/* Studio 1.15: keep the design in view and place controls beside their subject. */
body {
  overflow: hidden;
}
.app {
  height: calc(100dvh - var(--studio-header-height, 134px));
  min-height: 0;
}
.workspace {
  min-height: 0;
  overflow: hidden;
}
.workspace .stage {
  min-height: 0;
  flex: 1 1 0;
  height: auto;
}
.workspace-header {
  padding: 10px 16px 6px;
}
.workspace-header .tabs {
  width: 100%;
}
.workspace-header .tabs button {
  padding: 9px 14px;
  min-height: 44px;
}
.workspace-header .tabs small {
  display: none;
}
.workspace-mode {
  margin: 0;
  padding: 5px 16px;
  min-height: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  gap: 8px;
}
#workspace-mode-title,
#workspace-description {
  display: none;
}
#canvas-summary {
  font-size: 12px;
  font-weight: 500;
}
#quilt-grow {
  gap: 4px;
  flex-wrap: nowrap;
}
#quilt-grow button {
  min-height: 36px;
  padding: 5px 8px;
  font-size: 12px;
}
.viewport-controls {
  display: flex;
  align-items: center;
  padding: 4px 12px;
  gap: 8px;
}
.viewport-controls > label,
.viewport-controls > small {
  display: none;
}
.viewport-controls .zoom-controls {
  flex: 1;
  width: auto;
  gap: 4px;
}
.zoom-controls input {
  flex: 1;
  min-width: 30px;
  max-width: 180px;
}
.viewport-controls .canvas-menu {
  margin-left: auto;
}
.measurement-bar {
  padding: 2px 16px 7px;
  min-height: 0;
  border: 0;
}
#measurement-info {
  font-size: 12px;
}
.ruler-options {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
}
.ruler-options select {
  width: auto;
  flex: 1;
}
.menu-note {
  font-size: 12px;
  padding: 8px;
  color: var(--muted);
}
.canvas-toolbar {
  width: 322px;
  max-width: calc(100% - 40px);
}
.canvas-toolbar .toolgroup button {
  height: 48px;
  min-height: 48px;
}
.canvas-toolbar .canvas-tool-label {
  font-size: 12px;
  font-weight: 600;
}
.hint {
  font-size: 12px;
  max-width: calc(100% - 40px);
}
.save-split {
  display: flex;
  align-items: stretch;
}
#save-now {
  border-radius: 8px 0 0 8px;
  min-height: 44px;
}
#save-menu > summary {
  border-radius: 0 8px 8px 0;
  border-left: 1px solid #ffffff55;
  width: 40px;
  min-height: 44px;
  padding: 10px;
}
#save-menu > summary::after {
  margin: auto;
}
#save-status {
  font-size: 12px;
}
.sheet-heading,
.mobile-editor-dock {
  display: none;
}
.sidebar.left {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 12px;
  gap: 0;
}
.sidebar.left .blocks-panel {
  flex-shrink: 0;
  margin: 0;
  padding: 0 6px 8px;
  border: 0;
  box-shadow: none;
  border-radius: 0;
  background: transparent;
}
.blocks-panel .section-head {
  margin: 0 0 6px;
  padding: 0;
  border: 0;
}
.blocks-panel .block-picker {
  display: flex;
  flex-wrap: nowrap;
  overflow-x: auto;
  padding: 3px 1px 6px;
  margin: 0;
  gap: 6px;
  scrollbar-width: thin;
}
.blocks-panel .block-card {
  flex: 0 0 48px;
  width: 48px;
  height: 48px;
}
.blocks-panel .block-name {
  margin: 4px 0;
}
.blocks-panel .block-name input {
  min-height: 36px;
}
.block-usage {
  color: var(--muted);
  font-size: 12px;
  margin: 4px 0 6px;
  line-height: 1.4;
}
.blocks-panel .block-actions {
  margin: 0 0 8px;
}
.blocks-panel .block-actions button {
  min-height: 36px;
  padding: 6px 9px;
  font-size: 12px;
}
.blocks-panel .editor-frame {
  max-width: 210px;
  width: min(100%, 23dvh);
  margin: 0 auto;
  padding: 4px;
}
.blocks-panel .editor-under {
  margin-top: 4px;
}
.blocks-panel .editor-under button {
  min-height: 36px;
  height: 36px;
}
.editor-tabs,
.colour-mode-tabs {
  display: flex;
  gap: 4px;
  padding: 4px;
  border-radius: 9px;
  background: #e4ece6;
  flex-shrink: 0;
}
.editor-tabs button,
.colour-mode-tabs button {
  flex: 1;
  background: transparent;
  border-color: transparent;
  min-height: 44px;
}
.editor-tabs button[aria-selected='true'],
.colour-mode-tabs button[aria-selected='true'] {
  background: #fffefa;
  color: #244a40;
  border-color: #a6beb3;
  box-shadow: 0 1px 3px #243e3514;
  font-weight: 700;
}
.editor-controls {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 12px 4px 6px;
  scrollbar-width: thin;
}
.editor-controls > .editor-panel {
  padding: 0 2px;
  border: 0;
  background: transparent;
  box-shadow: none;
}
.editor-controls .section-head {
  display: none;
}
.editor-controls .shape-tools {
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 5px;
}
.editor-controls .shape-tools button {
  min-height: 44px;
}
.editor-controls .shape-tools svg {
  width: 30px;
  height: 30px;
}
.editor-controls .patch-shape-label {
  margin: 6px 0;
}
.editor-controls .paint-colors {
  margin: 6px 0;
}
.editor-controls .swap-paint {
  margin-bottom: 10px;
}
.sidebar.right {
  padding: 12px 16px;
  background: #fbfbf6;
}
.sidebar.right > section.editor-panel,
.sidebar.right .settings-group > .editor-panel {
  padding: 16px 0;
  border: 0;
  border-bottom: 1px solid #d4dfd7;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  margin: 0;
}
.sidebar.right .panel-kicker,
.editor-controls .panel-kicker {
  display: none;
}
.sidebar.right .section-head {
  border: 0;
  padding: 0;
  margin-bottom: 12px;
}
.sidebar.right .layout-stat {
  padding: 12px;
  margin-top: 12px;
}
.sidebar.right .subtle-note {
  font-size: 12px;
}
.colour-live-preview {
  display: flex;
  gap: 16px;
  align-items: center;
  padding: 12px 24px;
  border-bottom: 1px solid var(--line);
  background: #edf3ee;
  flex-shrink: 0;
}
#colour-quilt-preview {
  width: 108px;
  height: 108px;
  flex-shrink: 0;
}
#colour-quilt-preview svg {
  width: 100%;
  height: 100%;
  display: block;
}
.colour-live-preview p {
  font-size: 12px;
  color: #52675d;
  max-width: 420px;
  margin-top: 6px;
}
.colour-mode-tabs {
  margin: 10px 24px 0;
}
.colour-studio-body .modal-panel {
  border: 0;
  padding: 0;
  background: transparent;
}
.colour-studio-body .panel-kicker,
.colour-studio-body .section-head {
  display: none;
}
.colour-studio-body .wheel-editor {
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 22px;
}
.colour-studio-body .colour-wheel {
  width: 140px;
  height: 140px;
}
.colour-studio-body .wheel-sample {
  margin-top: 8px;
  height: 20px;
}
.colour-studio-body #wheel-pointer {
  margin: -8px 0 0 -8px;
}
.colour-studio-body .wheel-preview {
  width: 150px;
}
.colour-studio-body .wheel-controls {
  gap: 10px;
}
#colour-wheel-dialog .dialog-actions {
  padding: 12px 24px;
}
button,
.action-menu > summary {
  touch-action: manipulation;
}
[hidden] {
  display: none !important;
}
@media (min-width: 1151px) {
  .app {
    grid-template-columns: 360px minmax(320px, 1fr) 300px;
  }
}
@media (max-width: 1150px) {
  .app {
    display: flex;
    flex-direction: column;
    height: calc(100dvh - var(--studio-header-height, 160px));
    padding-bottom: calc(60px + env(safe-area-inset-bottom));
  }
  .workspace {
    width: 100%;
    flex: 1;
    min-height: 0;
    padding: 0;
    order: 0;
  }
  .app .sidebar {
    display: none;
    position: fixed;
    z-index: 35;
    bottom: calc(60px + env(safe-area-inset-bottom));
    width: min(520px, 100%);
    height: min(70dvh, 700px);
    max-height: calc(100dvh - var(--studio-header-height) - 60px);
    margin: 0;
    border: 1px solid #a9beb2;
    border-radius: 18px 18px 0 0;
    box-shadow: 0 -8px 30px #233e452b;
    background: #fffefa;
  }
  .app .sidebar.left {
    left: 0;
    padding: 0 12px 8px;
  }
  .app .sidebar.right {
    right: 0;
    padding: 0 18px 18px;
    overflow-y: auto;
  }
  body[data-editing-panel='blocks'] #block-panel,
  body[data-editing-panel='fabrics'] #block-panel {
    display: flex;
  }
  body[data-editing-panel='layout'] #layout-panel {
    display: block;
  }
  .sheet-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
    min-height: 46px;
    position: sticky;
    top: 0;
    z-index: 2;
    background: #fffefa;
    border-bottom: 1px solid #dbe3dc;
    margin-bottom: 8px;
  }
  .sheet-heading::before {
    content: '';
    position: absolute;
    width: 32px;
    height: 3px;
    border-radius: 3px;
    background: #b3c4bb;
    top: 5px;
    left: calc(50% - 16px);
  }
  .sheet-heading button {
    min-width: 44px;
    min-height: 44px;
    border-color: transparent;
    background: transparent;
    font-size: 22px;
  }
  .blocks-panel .section-head {
    display: none;
  }
  .blocks-panel .editor-frame {
    width: min(28dvh, 150px);
    max-width: 150px;
  }
  .blocks-panel .block-picker {
    max-width: 100%;
  }
  .blocks-panel {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 140px;
    column-gap: 10px;
  }
  .blocks-panel .block-picker,
  .blocks-panel .block-name,
  .blocks-panel .block-usage,
  .blocks-panel .block-actions,
  #block-delete-hint {
    grid-column: 1;
  }
  .blocks-panel .editor-frame {
    grid-column: 2;
    grid-row: 1 / span 4;
    width: 100%;
    align-self: center;
  }
  .blocks-panel .editor-under {
    grid-column: 1 / -1;
  }
  .blocks-panel .block-actions {
    flex-wrap: wrap;
    gap: 4px;
  }
  body[data-editing-panel='fabrics'] .blocks-panel,
  body[data-editing-panel='fabrics'] .editor-tabs {
    display: none;
  }
  body[data-editing-panel='fabrics'] #block-panel {
    height: min(52dvh, 510px);
  }
  .editor-controls {
    padding-top: 10px;
  }
  .mobile-editor-dock {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 40;
    padding: 7px 12px calc(7px + env(safe-area-inset-bottom));
    background: #fffefa;
    border-top: 1px solid #b9ccbf;
    height: calc(60px + env(safe-area-inset-bottom));
  }
  .mobile-editor-dock button {
    min-height: 44px;
    font-size: 14px;
  }
  .mobile-editor-dock button[aria-expanded='true'] {
    background: #27695e;
    border-color: #27695e;
    color: white;
    box-shadow: inset 0 -3px #143e36;
  }
  .tour-active .app .sidebar {
    top: 8px;
    bottom: auto;
    max-height: calc(100dvh - var(--tour-reserve, 250px) - 16px);
    height: calc(100dvh - var(--tour-reserve, 250px) - 16px);
  }
}
@media (max-width: 700px) {
  .topbar {
    padding: 8px 12px 6px;
    gap: 5px 8px;
  }
  .topbar .brand h1 {
    font-size: 19px;
  }
  .release-tag {
    display: none !important;
  }
  .topbar .top-actions {
    gap: 5px;
  }
  .topbar .project-title {
    flex-direction: row;
    align-items: center;
    gap: 6px;
  }
  .topbar .project-title input {
    flex: 1;
    min-width: 0;
  }
  .project-title #save-status {
    font-size: 11px;
    max-width: 46%;
    text-align: right;
  }
  #save-now {
    padding: 8px 10px;
  }
  #save-menu > summary {
    width: 32px;
    padding: 8px;
  }
  .primary-nav {
    display: flex;
    gap: 5px;
    padding: 5px 10px 7px;
  }
  .primary-nav button {
    flex: 1;
    width: auto;
    min-width: 0;
    font-size: 12px;
    min-height: 44px;
    padding: 6px 4px;
    white-space: normal;
  }
  .primary-nav #get-started svg {
    display: none;
  }
  .workspace-header {
    padding: 6px 10px 3px;
  }
  .workspace-header .tabs button {
    padding: 7px 10px;
  }
  .workspace-mode {
    padding: 2px 10px;
  }
  #canvas-summary {
    font-size: 12px;
  }
  #quilt-grow button {
    min-height: 36px;
    font-size: 12px;
    padding: 4px 6px;
  }
  .viewport-controls {
    padding: 2px 6px;
    gap: 4px;
  }
  .viewport-controls .canvas-menu > summary {
    min-height: 44px;
    padding: 6px;
  }
  .zoom-controls button {
    min-width: 38px;
    min-height: 44px;
  }
  .zoom-controls #fit {
    padding: 6px;
  }
  .zoom-controls output {
    font-size: 12px;
    min-width: 36px;
  }
  .measurement-bar {
    padding: 0 10px 5px;
  }
  #measurement-info {
    font-size: 11px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .canvas-toolbar {
    left: 28px;
    top: 28px;
    width: 322px;
    max-width: calc(100% - 36px);
  }
  .canvas-toolbar .toolgroup {
    padding: 3px;
    gap: 0;
  }
  .canvas-toolbar .canvas-tool-label {
    font-size: 11px;
  }
  .hint {
    font-size: 11px;
    padding: 6px 10px;
    bottom: 8px;
  }
  #colour-wheel-dialog {
    width: 100%;
    max-width: 100%;
    height: 100dvh;
    max-height: 100dvh;
    border-radius: 0;
    margin: 0;
  }
  #colour-wheel-dialog .dialog-head {
    padding: 10px 14px;
  }
  .colour-live-preview {
    padding: 8px 14px;
    gap: 12px;
  }
  #colour-quilt-preview {
    width: 80px;
    height: 80px;
  }
  .colour-live-preview strong {
    font-size: 14px;
  }
  .colour-mode-tabs {
    margin: 6px 14px 0;
  }
  .colour-studio-body .wheel-editor {
    grid-template-columns: 110px minmax(0, 1fr);
    gap: 12px;
    align-items: start;
  }
  .colour-studio-body .wheel-preview {
    width: 110px;
  }
  .colour-studio-body .colour-wheel {
    width: 110px;
    height: 110px;
  }
  .colour-studio-body #wheel-name {
    font-size: 12px;
  }
  #colour-wheel-dialog .dialog-body {
    padding: 14px;
  }
  #colour-wheel-dialog .dialog-actions {
    padding: 10px 14px;
  }
  #colour-wheel-dialog .dialog-actions button {
    min-height: 44px;
  }
  input:not([type='range']):not([type='checkbox']),
  select,
  textarea {
    font-size: 16px;
  }
}
@media print {
  body {
    overflow: visible;
  }
  .mobile-editor-dock {
    display: none !important;
  }
}

.sidebar.left > .paint-colors {
  flex-shrink: 0;
  margin: 8px 4px 0;
}
.sidebar.right .editor-panel {
  border-top-width: 0 !important;
}
@media (min-width: 1151px) and (max-height: 900px) {
  .blocks-panel .editor-frame {
    width: clamp(90px, calc(100dvh - 650px), 210px);
  }
}
@media (max-width: 700px) {
  body[data-editing-panel]:not([data-editing-panel='']) {
    --open-sheet-height: min(52dvh, calc(100dvh - var(--studio-header-height) - 180px));
  }
  body[data-editing-panel]:not([data-editing-panel='']) .workspace {
    padding-bottom: var(--open-sheet-height);
  }
  body[data-editing-panel]:not([data-editing-panel='']) .workspace > :not(.stage),
  body[data-editing-panel]:not([data-editing-panel='']) .canvas-toolbar,
  body[data-editing-panel]:not([data-editing-panel='']) .stage-hint,
  body[data-editing-panel]:not([data-editing-panel='']) .hint {
    display: none;
  }
  body[data-editing-panel]:not([data-editing-panel='']) .app .sidebar {
    height: var(--open-sheet-height);
  }
  .app .sidebar.left {
    overflow-y: auto;
  }
  .app .sidebar.left .blocks-panel {
    grid-template-columns: minmax(0, 1fr) 100px;
  }
  .app .sidebar.left .editor-frame {
    max-width: 100px;
  }
  .app .sidebar.left .block-picker {
    padding-bottom: 3px;
  }
  .app .sidebar.left .block-card {
    flex-basis: 40px;
    width: 40px;
    height: 40px;
  }
  .app .sidebar.left .block-actions {
    display: flex;
    flex-wrap: nowrap;
  }
  .app .sidebar.left .block-actions button {
    padding: 5px;
    font-size: 11px;
  }
  .app .sidebar.left .editor-under {
    grid-column: 1;
    padding: 0;
    min-height: 0;
    margin: 0;
  }
  .app .sidebar.left .editor-under .row {
    gap: 0;
  }
  .app .sidebar.left .editor-under button {
    min-height: 32px;
    height: 32px;
    width: 32px;
  }
  .editor-tabs button {
    min-height: 40px;
  }
  .sidebar.left > .paint-colors {
    margin: 4px 4px 0;
  }
  #colour-wheel-dialog.feature-dialog,
  #creation-dialog.feature-dialog {
    width: 100vw !important;
    max-width: 100vw !important;
  }
  #creation-dialog .dialog-head h2 {
    font-size: 16px;
    white-space: nowrap;
  }
  .colour-studio-body .colour-wheel::after {
    inset: 18px;
  }
}
@media (max-width: 700px) and (max-height: 740px) {
  .app .sidebar.left .editor-controls {
    flex: 0 0 auto;
    overflow: visible;
  }
  .app .sidebar.left > .sheet-heading {
    position: relative;
  }
}

.sheet-heading .sheet-add-block {
  margin-left: auto;
  font-size: 13px;
  border: 1px solid #b9ccbf;
  min-height: 36px;
  margin-right: 8px;
}
body[data-editing-panel='fabrics'] .sheet-add-block {
  display: none;
}
.app .sidebar.left .block-actions button {
  font-size: 12px;
}

.enlarge-block {
  display: none;
}
@media (max-width: 700px) {
  .enlarge-block {
    display: inline-flex;
    min-height: 36px;
    font-size: 12px;
    padding: 5px 7px;
  }
  .app .sidebar.left .editor-under {
    grid-column: 1 / -1;
  }
  body[data-editing-panel='blocks'][data-large-editor='true'] {
    --open-sheet-height: min(78dvh, calc(100dvh - var(--studio-header-height) - 100px));
  }
  body[data-editing-panel='blocks'][data-large-editor='true'] .blocks-panel .block-picker,
  body[data-editing-panel='blocks'][data-large-editor='true'] .blocks-panel .block-name,
  body[data-editing-panel='blocks'][data-large-editor='true'] .blocks-panel .block-usage,
  body[data-editing-panel='blocks'][data-large-editor='true'] .blocks-panel .block-actions {
    display: none;
  }
  body[data-editing-panel='blocks'][data-large-editor='true'] .blocks-panel .editor-frame {
    grid-column: 1 / -1;
    grid-row: auto;
    width: min(100%, 36dvh);
    max-width: 300px;
  }
}

.action-menu.menu-host {
  position: fixed;
  inset: 0;
  z-index: 240;
  pointer-events: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
}
.action-menu.menu-host .menu-panel {
  pointer-events: auto;
}
.ruler-options button {
  width: auto !important;
  flex: 0 0 auto;
}
.ruler-options select {
  min-width: 130px;
}

#toast {
  width: max-content;
  max-width: calc(100vw - 24px);
  pointer-events: none;
}
@media (max-width: 700px) {
  .topbar .project-title input {
    font-size: 16px !important;
  }
  body[data-tour-step='brush'] .blocks-panel {
    display: none;
  }
}
@media (max-width: 350px) {
  .topbar .brand h1 {
    font-size: 14px;
    letter-spacing: -0.04em;
  }
  .topbar .top-actions {
    gap: 3px;
  }
}
#block-panel .editor-under .enlarge-block {
  width: auto;
  min-width: 100px;
  height: 36px;
  min-height: 36px;
  flex-shrink: 0;
  white-space: nowrap;
  padding: 5px 8px;
}
