/* Address label maker. Same paper, ink and plum tokens as ../styles.css. */

.labels { max-width: 880px; margin: 0 auto; padding: clamp(2rem, 6vw, 3.5rem) var(--gutter) 2rem; width: 100%; }
.labels h1 { font-size: clamp(2.2rem, 5vw, 3rem); margin-bottom: .5rem; }
.labels .lede { margin-bottom: .75rem; max-width: 52ch; }
.labels .privacy { margin-top: .25rem; }

.tool-block { margin-top: 2.25rem; max-width: 640px; }
.tool-block .sub-h { margin: 0 0 .25rem; }
.tool-block label { display: block; margin: 1.1rem 0 .2rem; font-family: var(--hand); font-size: 1.35rem; color: var(--ink-soft); }
.hint { margin: 0 0 .5rem; font-size: 1rem; color: var(--ink-soft); max-width: 60ch; }

.tool-block .field { max-width: none; width: 100%; min-height: 48px; margin: .2rem 0 .4rem; font-size: 1.1rem; line-height: 1.5; }
.tool-block textarea.field { min-height: 0; }
.tool-block .field.tall { min-height: 14rem; }
.tool-block .field.short { width: 9rem; max-width: 100%; }

#csv-file {
  display: block; width: 100%; max-width: 480px; min-height: 48px; margin: .3rem 0 .4rem;
  font: inherit; font-size: 1rem; color: var(--ink);
}
#csv-file::file-selector-button {
  min-height: 44px; margin-right: .9rem; padding: .5rem 1.1rem;
  font: inherit; font-size: 1rem; color: var(--ink);
  background: var(--paper-warm); border: 1.5px solid var(--ink); cursor: pointer;
  border-radius: 255px 18px 225px 18px / 18px 225px 18px 255px;
}
#csv-file::file-selector-button:hover { background: #fff; }

.tool-block .form-note { margin-top: .2rem; }

/* buttons */
.labels .actions { display: flex; flex-wrap: wrap; gap: .75rem; margin: 1rem 0 .5rem; }
.labels .btn { min-height: 48px; }
.btn-quiet { color: var(--ink); background: transparent; box-shadow: none; }
.btn-quiet:hover { color: var(--ink); background: var(--paper-warm); }

/* preview */
.preview { max-width: 880px; margin: 0 auto; padding: 2.5rem var(--gutter) 3rem; width: 100%; border-top: 1px dashed var(--pencil); }
.preview .sub-h { margin: 0 0 .5rem; }
.count { margin: .25rem 0 .5rem; font-family: var(--serif); font-size: 1.6rem; color: var(--ink); }
.warnings:empty { display: none; }
.warnings { margin: .75rem 0; padding: .8rem 1rem; font-size: 1rem; background: #F3E7C9; color: #4D3A1E; border: 1px dashed #B98C62; border-radius: 6px; }
.warnings p { margin: 0 0 .3rem; }
.warnings ul { margin: 0; padding-left: 1.2rem; }
.warnings li { margin-bottom: .25rem; }
.tip { margin: .75rem 0 0; font-size: 1rem; color: var(--ink-soft); }

.sheets { margin-top: 1.5rem; }
.sheet-caption { margin: 0 0 .4rem; font-family: var(--hand); font-size: 1.3rem; color: var(--ink-soft); }
.sheet-frame {
  position: relative; overflow: hidden; width: 100%; max-width: 8.5in; margin: 0 auto 1.75rem;
  background: #fff; box-shadow: 3px 5px 14px -8px rgba(58, 46, 39, .5);
}
.sheet { position: relative; width: 8.5in; height: 11in; background: #fff; transform-origin: 0 0; }

/* one Avery 5160 label: 2.625in x 1in */
.label {
  position: absolute; width: 2.625in; height: 1in; box-sizing: border-box;
  padding: .08in .12in; overflow: hidden;
  font-family: var(--body), Georgia, serif; font-size: 10pt; line-height: 1.2;
  text-align: left; color: #2A211C;
  outline: 1px dotted var(--pencil); outline-offset: -1px;
}
.label.is-flag { outline: 1.5px dashed var(--danger); outline-offset: -2px; background: rgba(154, 59, 46, .05); }

/* small screens: no horizontal scroll, comfortable controls */
@media (max-width: 560px) {
  .labels .btn, .labels .actions .btn { width: 100%; }
  .tool-block .field.short { width: 100%; }
}

/* ---------- print: Avery 5160, letter, no margins ---------- */
@page { size: letter; margin: 0; }

@media print {
  body { background: #fff !important; background-image: none !important; min-height: 0; display: block; }
  body > *:not(.preview) { display: none !important; }
  .preview { max-width: none; margin: 0; padding: 0; border: 0; width: auto; }
  .preview > *:not(.sheets) { display: none !important; }
  .sheets { margin: 0; }
  .sheet-caption { display: none !important; }
  .sheet-frame {
    height: auto !important; width: 8.5in; max-width: none; margin: 0; overflow: visible;
    box-shadow: none; border: 0;
    page-break-after: always; break-after: page;
  }
  .sheet-frame:last-child { page-break-after: auto; break-after: auto; }
  .sheet { transform: none !important; }
  .label, .label.is-flag { outline: none !important; background: none !important; }
}
