/* Page numbers and watermark: preview on the left, options on the right. Colours come from style.css variables. */

.stamp-loading { display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 240px; color: var(--muted); }
.stamp-loading .spin, .stamp-stage .spin { width: 22px; height: 22px; border: 2px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; }
.stamp-file { min-width: 0; max-width: 100%; }
.stamp-name { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.stamp-grid { display: grid; grid-template-columns: minmax(220px, 320px) 1fr; gap: 24px; align-items: start; }

.stamp-preview { margin: 0; position: sticky; top: 76px; }
.stamp-stage { display: grid; place-items: center; min-height: 260px; padding: 16px; border-radius: 12px; background: var(--soft); }
.stamp-page { position: relative; width: 100%; max-width: 288px; box-shadow: var(--shadow); background: var(--card); }
.stamp-page canvas { display: block; width: 100% !important; height: auto; }
.stamp-page .stamp-over { position: absolute; inset: 0; height: 100%; pointer-events: none; }
.stamp-caption { margin-top: 8px; text-align: center; }

.stamp-fields { display: grid; gap: 18px; }
.opt { display: grid; gap: 8px; min-width: 0; }
.opt-label { font-size: 14px; font-weight: 600; }
.opt-row { display: flex; flex-wrap: wrap; gap: 18px 28px; }

/* Segmented choice: real radio buttons, styled labels */
.seg { display: flex; flex-wrap: wrap; gap: 6px; }
.seg label { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 40px; padding: 0 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); cursor: pointer; font-size: 15px; white-space: nowrap; user-select: none; -webkit-user-select: none; }
.seg label:hover { background: var(--soft); }
.seg input:checked + label { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.seg input:focus-visible + label { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Position picker: a little page with three spots at the top and three at the bottom */
.pos-picker { display: grid; grid-template-columns: repeat(3, 40px); grid-template-rows: 40px 34px 40px; gap: 4px; width: max-content; padding: 6px; border: 1px solid var(--line); border-radius: 10px; background: var(--soft); }
.pos-picker label { min-width: 0; width: 40px; height: 40px; padding: 0; border-color: transparent; background: transparent; }
.pos-picker label:nth-of-type(n+4) { grid-row: 3; }
.pos-picker input:checked + label { background: var(--accent-soft); border-color: var(--accent); }
.pos-dot { width: 18px; height: 6px; border-radius: 3px; background: var(--muted); opacity: .45; }
.pos-picker input:checked + label .pos-dot { background: var(--accent); opacity: 1; }

/* Colour swatches */
.swatches label { min-width: 0; width: 40px; height: 40px; padding: 0; border-radius: 50%; }
.swatch { width: 26px; height: 26px; border-radius: 50%; box-shadow: inset 0 0 0 1px var(--line); }
.swatches input:checked + label { background: var(--card); box-shadow: 0 0 0 2px var(--accent); border-color: transparent; }

.stamp-input { width: 100%; min-height: 44px; padding: 0 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); color: var(--ink); font: inherit; }
.stamp-input:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.stamp-num { width: 120px; }

.stamp-check { display: inline-flex; align-items: center; gap: 10px; min-height: 40px; cursor: pointer; width: max-content; max-width: 100%; }
.stamp-check input { width: 20px; height: 20px; margin: 0; accent-color: var(--accent); flex: none; }

.stamp-range { width: 100%; height: 36px; margin: 0; accent-color: var(--accent); cursor: pointer; }
.stamp-val { font-weight: 400; color: var(--muted); }

.stamp-logo { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; min-width: 0; }
.stamp-logo-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }

.tool .result { margin-top: 14px; }

@media (max-width: 720px) {
  .stamp-grid { grid-template-columns: 1fr; gap: 18px; }
  .stamp-preview { position: static; }
  .stamp-stage { min-height: 200px; }
  .stamp-page { max-width: 220px; }
}
