/* Content density only. Load after the existing editor/mobile styles and before
   info-tip-fix.css. The shell, panels, dock and canvas keep their own geometry. */
.studio .tools-panel .tool-content label {
  margin-top: 6px;
  margin-bottom: 6px;
}

.studio .tools-panel .tool-intro {
  margin-bottom: 6px;
  line-height: 1.4;
}

.studio .tools-panel .config-section { margin-bottom: 6px; }
.studio .tools-panel .config-heading {
  min-height: 48px;
  padding: 0 10px;
  gap: 4px;
}
.studio .tools-panel button.config-toggle {
  height: 48px;
  min-height: 48px;
  padding: 6px 0;
  gap: 7px;
  line-height: 1.25;
}
.studio .tools-panel .section-number {
  width: 20px;
  height: 20px;
  font-size: 10px;
}
.studio .tools-panel .section-label { font-size: 13px; line-height: 1.25; }
.studio .tools-panel .config-summary { font-size: 11px; line-height: 1.25; }
.studio .tools-panel .config-body { padding: 10px; }
.studio .tools-panel .config-body .label-row { margin-bottom: 6px; }
.studio .tools-panel .config-body .label-row label { margin: 0; }
.studio .tools-panel .compact-size { padding: 4px 0 8px; margin-bottom: 8px; }
.studio .tools-panel .compact-size strong { font-size: 15px; }
.studio .tools-panel .compact-size > span { font-size: 11px; }
.studio .tools-panel .orientation-options { gap: 6px; }
.studio .tools-panel .orientation-options button {
  min-height: 36px;
  height: 36px;
  padding: 6px 5px;
  gap: 7px;
  font-size: 12px;
}
.studio .tools-panel .config-body .segmented { padding: 2px; gap: 2px; }
.studio .tools-panel .config-body .segmented > button {
  min-height: 36px;
  height: 36px;
  padding: 6px;
  font-size: 12px;
}
.studio .tools-panel .quantity-control > button {
  min-width: 36px;
  width: 36px;
  min-height: 36px;
  height: 36px;
  padding: 5px;
}
.studio .tools-panel .quantity-control input { height: 36px; }
.studio .tools-panel .config-note {
  gap: 6px;
  margin-top: 8px;
  padding: 4px 8px;
  font-size: 11px;
}
.studio .tools-panel .price-row { margin-top: 8px; }
.studio .tools-panel .price-row strong { font-size: 22px; }
.studio .tools-panel .tool-content > .wide { margin-top: 8px; }

/* Seven fabric colors occupy two short rows. These are option cards rather
   than circular ink swatches, so they override the mobile 44px swatch rule. */
.studio .tools-panel #towel-colors {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
  padding: 0;
}
.studio .tools-panel #towel-colors .color-swatch {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  height: 58px;
  min-height: 58px;
  max-height: 58px;
  padding: 3px 1px;
  border-radius: 5px;
  transform: none;
}
.studio .tools-panel #towel-colors .color-sample {
  display: block;
  flex: 0 0 32px;
  width: 32px;
  min-width: 32px;
  height: 32px;
  min-height: 32px;
  border-radius: 4px;
}
.studio .tools-panel #towel-colors .color-name {
  display: block;
  width: 100%;
  max-width: 100%;
  font-size: 10px;
  font-weight: 400;
  line-height: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: center;
}

/* Small ink/thread samples keep a larger independent click target. */
.studio .tools-panel .swatches { gap: 5px; padding: 2px 0; }
.studio .tools-panel .small-swatches { margin: 6px 0; }
.studio .tools-panel .swatches button.swatch:not(.color-swatch) {
  position: relative;
  flex: 0 0 32px;
  width: 32px;
  min-width: 32px;
  max-width: 32px;
  height: 32px;
  min-height: 32px;
  max-height: 32px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  transform: none;
}
.studio .tools-panel .swatches button.swatch:not(.color-swatch)::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 22px;
  height: 22px;
  transform: translate(-50%, -50%);
  border: 1px solid #ffffff55;
  border-radius: 50%;
  background: var(--swatch);
  pointer-events: none;
}
.studio .tools-panel .swatches button.swatch:not(.color-swatch).active { outline: none; }
.studio .tools-panel .swatches button.swatch:not(.color-swatch).active::before {
  outline: 2px solid var(--cyan);
  outline-offset: 2px;
}
.studio .tools-panel .swatches button.swatch:not(.color-swatch):focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 1px;
}

.studio .tools-panel .source-picker { margin: 0 0 8px; padding-bottom: 8px; }
.studio .tools-panel .source-picker p { margin-bottom: 4px; }
.studio .tools-panel .source-picker > div { gap: 4px; }
.studio .tools-panel .source-picker button {
  min-height: 36px;
  height: 36px;
  padding: 6px;
  font-size: 12px;
  line-height: 1.2;
}

.studio .tools-panel .font-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}
.studio .tools-panel .font-grid .font-card {
  /* The previous mobile rule uses !important for a 62px minimum. */
  height: 50px;
  min-height: 50px !important;
  max-height: 50px;
  padding: 5px 8px;
  gap: 0;
}
.studio .tools-panel .font-card small {
  margin-bottom: 2px;
  font-size: 10px;
  line-height: 12px;
}
.studio .tools-panel .font-card span { font-size: 20px; line-height: 22px; }
.studio .tools-panel .color-input { gap: 8px; }
.studio .tools-panel #template-search { margin-bottom: 6px; }
.studio .tools-panel .template-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 8px;
  gap: 6px;
}
.studio .tools-panel .template-grid .template-card {
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: auto;
  min-width: 0;
  min-height: 84px;
  height: 84px;
  max-height: 84px;
  padding: 6px;
}
.studio .tools-panel .template-card img {
  width: 100%;
  height: 72px;
  max-height: 72px;
  object-fit: contain;
}
.studio .tools-panel .layout-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}
.studio .tools-panel .layout-card { padding: 6px; }
.studio .tools-panel .layout-card img { height: 78px; max-height: 78px; }
.studio .tools-panel .layout-card strong { margin-top: 4px; font-size: 12px; line-height: 1.3; }

/* Keep the upload decisions visible; reduce card spacing and preview size
   without hiding background/thread warnings or changing workflow controls. */
.studio .tools-panel .upload-workflow { font-size: 12px; }
.studio .tools-panel .upload-workflow .up-intro { margin-bottom: 6px; gap: 6px; }
.studio .tools-panel .upload-workflow .up-intro h2 { font-size: 14px; line-height: 1.3; }
.studio .tools-panel .upload-workflow .up-pick { margin: 0; padding: 10px; gap: 4px; }
.studio .tools-panel .upload-workflow .up-pick > span { font-size: 20px; line-height: 1; }
.studio .tools-panel .upload-workflow .up-pick strong { font-size: 12px; line-height: 1.3; }
.studio .tools-panel .upload-workflow .up-pick small { font-size: 11px; line-height: 1.3; }
.studio .tools-panel .upload-workflow .up-message { margin: 6px 0; line-height: 1.4; }
.studio .tools-panel .upload-workflow .up-file-row { margin: 0 0 6px; gap: 6px; }
.studio .tools-panel .upload-workflow .up-filename { font-size: 12px; }
.studio .tools-panel .upload-workflow .up-change {
  min-height: 32px;
  padding: 5px 0;
  font-size: 12px;
}
.studio .tools-panel .upload-workflow .up-section { margin-top: 8px; padding-top: 8px; }
.studio .tools-panel .upload-workflow .up-section h3 { margin-bottom: 4px; gap: 6px; font-size: 12px; }
.studio .tools-panel .upload-workflow .up-background-hint,
.studio .tools-panel .upload-workflow .up-color-summary,
.studio .tools-panel .upload-workflow .up-apply-hint { margin: 4px 0; font-size: 11px; line-height: 1.4; }
.studio .tools-panel .upload-workflow .up-comparison { margin-top: 5px; gap: 6px; }
.studio .tools-panel .upload-workflow .up-choice { min-height: 0; padding: 4px; }
.studio .tools-panel .upload-workflow .up-choice strong { margin: 4px 1px 1px; font-size: 12px; line-height: 1.25; }
.studio .tools-panel .upload-workflow .up-image { height: 64px; }
.studio .tools-panel .upload-workflow .up-image img { max-height: 64px; padding: 3px; }
.studio .tools-panel .upload-workflow .up-detected-colors { margin: 5px 0; gap: 5px; }
.studio .tools-panel .upload-workflow .up-detected-colors small { font-size: 10px; }
.studio .tools-panel .upload-workflow .up-reduction { margin-top: 6px; padding: 8px; }
.studio .tools-panel .upload-workflow .up-reduction-warning { margin-bottom: 6px; line-height: 1.4; }
.studio .tools-panel .upload-workflow .up-reduction > label:not(.up-approve) { margin: 0 0 6px; gap: 6px; }
.studio .tools-panel .upload-workflow .up-reduction select,
.studio .tools-panel .upload-workflow .up-thread-row select {
  min-height: 32px !important;
  padding: 5px 6px !important;
  font-size: 12px !important;
}
.studio .tools-panel .upload-workflow .up-reduce { min-height: 36px; padding: 7px; font-size: 12px; }
.studio .tools-panel .upload-workflow .up-approve { margin: 6px 0 0; font-size: 11px; line-height: 1.4; }
.studio .tools-panel .upload-workflow .up-thread-mappings { margin-top: 6px; gap: 4px; }
.studio .tools-panel .upload-workflow .up-thread-row { gap: 7px; }
.studio .tools-panel .upload-workflow .up-thread-pair { gap: 4px; }
.studio .tools-panel .upload-workflow .up-thread-pair > span:not(.up-thread-arrow) { width: 20px; height: 20px; }
.studio .tools-panel .upload-workflow .up-final-preview { height: 88px; padding: 6px; }
.studio .tools-panel .upload-workflow .up-use { margin-top: 8px !important; }

@media (max-width: 700px), (max-height: 500px) and (pointer: coarse) {
  .studio .tools-panel .config-heading { min-height: 40px; }
  .studio .tools-panel button.config-toggle { min-height: 40px; height: 40px; padding: 4px 0; }
  .studio .tools-panel .section-label { font-size: 12px; }
  .studio .tools-panel .config-summary { font-size: 10px; }
  .studio .tools-panel #design-text { min-height: 64px; height: 64px; padding: 8px; }
  .studio .tools-panel .swatches button.swatch:not(.color-swatch) {
    flex-basis: 36px;
    width: 36px;
    min-width: 36px;
    max-width: 36px;
    height: 36px;
    min-height: 36px;
    max-height: 36px;
  }
  .studio .tools-panel .upload-workflow .up-change { min-height: 36px; }
  .studio .tools-panel .upload-workflow .up-reduce { min-height: 40px; }
  .studio .tools-panel .upload-workflow .up-reduction select,
  .studio .tools-panel .upload-workflow .up-thread-row select {
    min-height: 36px !important;
    font-size: 16px !important;
  }
}
.towel-size-options{display:grid;grid-template-columns:1fr 1fr;gap:6px;margin-bottom:8px}.towel-size-options button{min-height:52px;display:flex;flex-direction:column;gap:3px;align-items:center;justify-content:center;border:1px solid #ffffff20;border-radius:8px;padding:6px;background:#27272e;font-size:12px}.towel-size-options button span{font-size:11px;font-weight:400;color:#acb1bb}.towel-size-options button[aria-pressed=true]{border-color:#32bed0;background:#17333c;color:#b1e8ee}.compact-size{display:none!important}.finish-toggle-row{display:flex;align-items:center;justify-content:space-between;gap:8px;min-height:58px;padding:8px 10px;margin-bottom:7px;border:1px solid #ffffff20;border-radius:10px;background:#202026}.finish-toggle-row>div{min-width:0;flex:1}.finish-toggle-row strong{display:flex;align-items:center;gap:4px;font-size:12px;font-weight:600}.finish-toggle-row>div>span{display:block;font-size:11px;color:#9a9fa9;margin-top:3px}.finish-toggle-row small{font-size:10px;border-radius:12px;padding:2px 5px;background:#133e30;color:#68d5ac}.switch-control{position:relative;display:block!important;width:38px!important;height:24px!important;flex:0 0 38px;margin:0!important;cursor:pointer}.switch-control input{appearance:none!important;-webkit-appearance:none!important;position:absolute!important;inset:0!important;margin:0!important;padding:0!important;width:38px!important;min-width:38px!important;max-width:38px!important;height:24px!important;min-height:24px!important;max-height:24px!important;border:0!important;border-radius:20px!important;background:#52545f!important;cursor:pointer}.switch-control input:checked{background:#13c8df!important}.switch-control>span{position:absolute;width:18px;height:18px;left:3px;top:3px;background:white;border-radius:50%;pointer-events:none}.switch-control input:checked+span{transform:translateX(14px)}.switch-control input:focus-visible{outline:2px solid #8ee4ef!important;outline-offset:3px}.studio .template-grid{grid-template-columns:repeat(4,minmax(0,1fr))}
