/* Barcode & Label Sheet Maker (/tools/barcode-label-maker/), 2026-11-29.
   Uses tokens from ft-shell-20261106.css and components from ft-tool-20261106.css.
   Reserves barcode and sheet stage heights from first paint so CLS stays 0.000. */

.ft-tool [hidden] {
  display: none !important;
}

.ft-tool .ft-fields {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 10.5rem), minmax(0, 1fr)));
}

.ft-tool .ft-field,
.ft-tool fieldset,
.ft-tool .ft-panel,
.ft-tool .ft-stack,
.ft-tool .ft-inputgroup,
.ft-tool figure {
  min-width: 0;
  max-width: 100%;
}

.ft-tool .ft-select {
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ft-tool input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]),
.ft-tool select,
.ft-tool .ft-input,
.ft-tool .ft-select {
  font-size: max(16px, 1rem);
  min-height: 44px;
}

.ft-tool textarea,
.ft-tool .ft-textarea {
  width: 100%;
  box-sizing: border-box;
  font-size: max(16px, 1rem);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  line-height: 1.45;
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--ft-line);
  border-radius: var(--ft-radius);
  background: var(--ft-surface);
  color: var(--ft-ink);
}

.ft-tool .ft-btn {
  min-width: 44px;
  min-height: 44px;
  height: auto;
  padding-block: 0.48rem;
  white-space: normal;
  overflow-wrap: anywhere;
}

.blm-presets {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--ft-space-2);
}

.blm-presets__label {
  margin: 0;
  color: var(--ft-ink);
  font-size: var(--ft-text-sm);
  font-weight: 600;
}

.blm-presets__list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--ft-space-2);
}

.blm-preset {
  justify-content: flex-start;
  text-align: left;
}

.blm-preset[aria-pressed="true"] {
  border-color: var(--ft-accent);
  background: var(--ft-accent-soft);
  color: var(--ft-ink);
}

.blm-group {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--ft-space-3);
  min-width: 0;
  margin: 0;
  padding: var(--ft-space-4) 0 0;
  border: 0;
  border-top: 1px solid var(--ft-line);
}

.blm-group__legend {
  float: left;
  width: 100%;
  margin: 0 0 var(--ft-space-1);
  padding: 0;
  color: var(--ft-ink);
  font-size: var(--ft-text-md);
  font-weight: 650;
}

.blm-group__legend + * {
  clear: both;
}

.blm-checknote {
  align-items: flex-start;
}

.blm-checknote__body {
  display: grid;
  gap: var(--ft-space-2);
  min-width: 0;
}

.blm-checknote__body p {
  margin: 0;
  overflow-wrap: anywhere;
}

.blm-check {
  display: flex;
  align-items: center;
  gap: var(--ft-space-2);
  min-width: 44px;
  min-height: 44px;
  padding: 0.35rem 0.65rem;
  border: 1px solid var(--ft-line);
  border-radius: var(--ft-radius);
  background: var(--ft-surface);
  color: var(--ft-ink);
  line-height: 1.35;
  box-sizing: border-box;
}

.blm-check input[type="checkbox"] {
  flex: 0 0 auto;
  margin: 0;
}

.blm-check span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.blm-stage {
  margin: 0;
}

.blm-barcode-frame {
  display: grid;
  place-items: center;
  min-height: 11.25rem;
  padding: var(--ft-space-3);
  border: 1px solid var(--ft-line);
  border-radius: var(--ft-radius);
  background: var(--ft-surface-2, var(--ft-surface));
  overflow: hidden;
}

.blm-barcode-frame svg {
  display: block;
  max-width: 100%;
  height: auto;
  border-radius: 4px;
  box-shadow: 0 4px 16px rgba(15, 23, 32, 0.1);
  background: #ffffff;
}

.blm-sheetcard {
  display: grid;
  gap: var(--ft-space-3);
  padding: var(--ft-space-3);
  border: 1px solid var(--ft-line);
  border-radius: var(--ft-radius);
  background: var(--ft-surface);
}

.blm-sheetcard__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--ft-space-2);
}

.blm-sheetcard__titles {
  display: grid;
  gap: 0.2rem;
  min-width: 0;
}

.blm-sheetcard__title {
  margin: 0;
  color: var(--ft-ink);
  font-size: var(--ft-text-md);
  font-weight: 650;
}

.blm-sheetcard__sub {
  margin: 0;
  color: var(--ft-ink-2);
  font-size: var(--ft-text-sm);
  overflow-wrap: anywhere;
}

.blm-page-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--ft-space-2);
}

.blm-page-label {
  font-size: var(--ft-text-sm);
  color: var(--ft-ink-2);
  font-weight: 600;
}

.blm-sheet-frame {
  display: grid;
  place-items: center;
  min-height: 16.5rem;
  padding: var(--ft-space-2);
  border: 1px solid var(--ft-line);
  border-radius: var(--ft-radius);
  background: var(--ft-surface-2, var(--ft-surface));
  overflow: hidden;
}

.blm-sheet-frame svg {
  display: block;
  width: auto;
  max-width: 100%;
  max-height: 15.5rem;
  height: auto;
  box-shadow: 0 6px 18px rgba(15, 23, 32, 0.12);
  background: #ffffff;
}

.blm-stats {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 10rem), minmax(0, 1fr)));
}

.blm-after-example {
  margin-top: var(--ft-space-3);
}

@media (max-width: 520px) {
  .blm-barcode-frame {
    min-height: 9.75rem;
    padding: var(--ft-space-2);
  }

  .blm-sheet-frame {
    min-height: 13.5rem;
  }

  .blm-sheet-frame svg {
    max-height: 12.75rem;
  }
}
