/* ISBN barcode generator: this page only, on top of /style.css and /tools/tools.css. */

/* the light that crosses the glass sits under the text, not over it (it washed out the top-left labels) */
.tool-card.glass::before, .tool-card .glass::before { z-index: -1; }

/* ---------- layout: entry, then the result, then the options (one column);
   entry and options on the left, the result on the right (two columns) ---------- */
.tool-form.bc-grid { display: grid; gap: 26px; grid-template-areas: "entry" "results" "options"; }
.bc-entry { grid-area: entry; min-width: 0; }
.bc-options { grid-area: options; display: flex; flex-direction: column; gap: 26px; min-width: 0; }
.bc-results { grid-area: results; }
@media (min-width: 900px) {
  .tool-form.bc-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1.12fr); grid-template-rows: auto 1fr; grid-template-areas: "entry results" "options results"; column-gap: 44px; row-gap: 30px; align-items: start; }
  .bc-results { position: sticky; top: 100px; }
}

/* ---------- the ISBN field ---------- */
.bc-entry .big-input input { letter-spacing: 0.02em; font-variant-numeric: lining-nums tabular-nums; }
.bc-entry .big-input input::placeholder { color: rgba(61, 74, 102, 0.42); }
.link-btn {
  display: inline-block;
  padding: 11px 0;
  margin: -11px 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--gold-line);
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
  transition: color 0.2s var(--ease-out);
}
.link-btn:hover { color: var(--gold-deep); }
.bc-status { margin-top: 14px; }
.bc-status:empty { display: none; }
.bc-status .status { gap: 10px; padding: 11px 15px; border-radius: 16px; background: rgba(255, 255, 255, 0.6); font-size: 13.5px; line-height: 1.5; }
.bc-status .status .dot { width: 20px; height: 20px; font-size: 11px; }
.bc-status .status.typing { color: var(--ink-mute); }
.bc-status .status.typing .dot { background: transparent; border: 1.5px solid var(--gold-line); color: var(--gold-deep); font-size: 11px; }
.anim .bc-status .status { animation: msg-in 0.34s var(--ease-out); }
@keyframes msg-in { from { opacity: 0; transform: translateY(-6px); } }
.count { font-variant-numeric: lining-nums tabular-nums; color: var(--ink); font-weight: 600; }

/* ---------- price choice ---------- */
.seg-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.seg-2 span small { margin-left: 6px; font-size: 12.5px; font-weight: 500; opacity: 0.72; font-variant-numeric: lining-nums tabular-nums; letter-spacing: 0.04em; }
.reveal { display: grid; grid-template-rows: 0fr; opacity: 0; transition: grid-template-rows 0.42s var(--ease-out), opacity 0.3s var(--ease-out); }
.reveal.is-open { grid-template-rows: 1fr; opacity: 1; }
.reveal-in { min-height: 0; overflow: hidden; }
/* room for the field's border, shadow and focus ring, which overflow: hidden would cut */
.reveal.is-open > .reveal-in { padding: 8px; margin: -8px; }
.price-field { padding-top: 16px; }
.money { position: relative; max-width: 220px; }
.money span { position: absolute; left: 16px; top: 50%; transform: translateY(-52%); font-family: var(--serif); font-size: 22px; color: var(--ink-mute); pointer-events: none; }
.tool-form .money input { padding-left: 34px; font-family: var(--serif); font-size: 22px; font-weight: 500; }
.f-err { color: var(--bad); min-height: 0; }
.f-err:empty { display: none; }
.addon-why { margin-top: 12px; }
.addon-why strong { color: var(--ink-soft); font-weight: 600; }

/* ---------- size ---------- */
.size-row { display: flex; align-items: center; gap: 18px; }
.size-row output { min-width: 4.2ch; text-align: right; font-family: var(--serif); font-size: 28px; font-weight: 500; line-height: 1; color: var(--ink); font-variant-numeric: lining-nums tabular-nums; }
input[type="range"] {
  --p: 16.67%;
  flex: 1;
  min-width: 0;
  height: 44px;
  margin: 0;
  background: transparent;
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
  touch-action: pan-y;
}
input[type="range"]:focus-visible { outline: none; }
input[type="range"]::-webkit-slider-runnable-track {
  height: 6px;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--gold-line) 0 var(--p), rgba(29, 42, 69, 0.13) var(--p) 100%);
  box-shadow: inset 0 1px 2px rgba(29, 42, 69, 0.12);
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 28px;
  height: 28px;
  margin-top: -11px;
  border-radius: 50%;
  border: 1px solid rgba(29, 42, 69, 0.14);
  background: radial-gradient(circle, var(--ink) 0 4px, transparent 4.6px), linear-gradient(160deg, #fff, #f3eee1);
  box-shadow: 0 6px 14px -6px rgba(29, 42, 69, 0.55), inset 0 1px 0 #fff;
  transition: transform 0.2s var(--ease-out), box-shadow 0.2s;
}
input[type="range"]:active::-webkit-slider-thumb { transform: scale(1.1); }
input[type="range"]:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 3px var(--paper), 0 0 0 5px var(--gold-deep); }
input[type="range"]::-moz-range-track { height: 6px; border-radius: 99px; background: rgba(29, 42, 69, 0.13); }
input[type="range"]::-moz-range-progress { height: 6px; border-radius: 99px; background: var(--gold-line); }
input[type="range"]::-moz-range-thumb {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid rgba(29, 42, 69, 0.14);
  background: radial-gradient(circle, var(--ink) 0 4px, transparent 4.6px), linear-gradient(160deg, #fff, #f3eee1);
  box-shadow: 0 6px 14px -6px rgba(29, 42, 69, 0.55);
}
input[type="range"]:focus-visible::-moz-range-thumb { box-shadow: 0 0 0 3px var(--paper), 0 0 0 5px var(--gold-deep); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.chip-btn {
  min-height: 44px;
  padding: 0 16px;
  border-radius: 999px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink-soft);
  background: rgba(255, 255, 255, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.75);
  box-shadow: 0 6px 16px -12px rgba(29, 42, 69, 0.4);
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}
.chip-btn:hover { background: rgba(255, 255, 255, 0.8); color: var(--ink); }
.chip-btn[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--cream); }
.chip-btn:focus-visible { outline: 2px solid var(--gold-deep); outline-offset: 2px; }

/* ---------- check box ---------- */
.tick { position: relative; display: flex; gap: 14px; align-items: flex-start; min-height: 44px; padding: 2px 0; cursor: pointer; }
.tick input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.tick-box {
  flex: none;
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  margin-top: 1px;
  border-radius: 9px;
  border: 1.5px solid rgba(29, 42, 69, 0.26);
  background: rgba(255, 255, 255, 0.65);
  transition: background 0.2s, border-color 0.2s;
}
.tick-box::after {
  content: "";
  width: 11px;
  height: 6px;
  border-left: 2px solid var(--cream);
  border-bottom: 2px solid var(--cream);
  opacity: 0;
  transform: translateY(-1px) rotate(-45deg) scale(0.4);
  transition: transform 0.28s var(--ease-out), opacity 0.2s;
}
.tick input:checked + .tick-box { background: var(--ink); border-color: var(--ink); }
.tick input:checked + .tick-box::after { opacity: 1; transform: translateY(-1px) rotate(-45deg) scale(1); }
.tick input:focus-visible + .tick-box { outline: 2px solid var(--gold-deep); outline-offset: 3px; }
.tick-text { font-size: 15px; font-weight: 600; line-height: 1.45; color: var(--ink); }
.tick-text small { display: block; margin-top: 3px; font-size: 13px; font-weight: 400; line-height: 1.55; color: var(--ink-mute); }
.ocr { display: inline-block; margin-left: 4px; font-family: var(--sans); font-weight: 600; color: var(--gold-deep); }

/* ---------- the result ---------- */
.bc-main { position: relative; padding-bottom: 22px; }
.bc-main .result-label { padding-right: 96px; }

/* copy, on the card it copies: the label turns to "Copied" for a moment */
.card-copy {
  position: absolute;
  top: 12px;
  right: 12px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 44px;
  padding: 0 15px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.08);
  color: var(--cream);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
  transition: background 0.2s, border-color 0.2s, opacity 0.3s var(--ease-out), transform 0.2s var(--ease-out);
}
.card-copy:hover { background: rgba(255, 255, 255, 0.16); border-color: rgba(255, 255, 255, 0.28); }
.card-copy:active { transform: scale(0.96); }
.card-copy:focus-visible { outline: 2px solid #e2c47e; outline-offset: 2px; }
.card-copy:disabled { opacity: 0; pointer-events: none; }
.card-copy svg { flex: none; }
.card-copy .cc-done { display: none; color: #e2c47e; }
.card-copy.is-done .cc-copy { display: none; }
.card-copy.is-done .cc-done { display: block; }
.anim .card-copy.is-done .cc-done { animation: cc-pop 0.36s var(--ease-out); }
@keyframes cc-pop { from { transform: scale(0.4); opacity: 0; } }
.bc-isbn {
  margin-top: 8px;
  font-family: var(--serif);
  font-size: clamp(1.85rem, 6vw, 2.55rem);
  font-weight: 500;
  line-height: 1.08;
  letter-spacing: 0.005em;
  font-variant-numeric: lining-nums tabular-nums;
  overflow-wrap: anywhere;
}
.bc-isbn.is-empty { opacity: 0.5; }
.anim .bc-isbn.is-new { animation: msg-in 0.4s var(--ease-out); }
.sticker {
  position: relative;
  margin-top: 18px;
  padding: clamp(12px, 3vw, 20px);
  border-radius: 16px;
  background: #fff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8), 0 22px 44px -22px rgba(0, 0, 0, 0.6), 0 2px 8px rgba(0, 0, 0, 0.16);
}
.sticker-art { position: relative; aspect-ratio: 16 / 10; display: flex; align-items: center; justify-content: center; }
.sticker-art svg { display: block; width: 100%; height: 100%; }
.sticker-art.is-ghost svg { opacity: 0.075; }
.ghost-note {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 12%;
  text-align: center;
  font-family: var(--serif);
  font-size: clamp(1.15rem, 3.4vw, 1.45rem);
  font-style: italic;
  line-height: 1.3;
  color: var(--ink-mute);
}
/* the bars grow up from their baseline when a barcode first appears, then the digits settle in */
.anim .sticker-art.is-drawing svg > g > rect { transform-box: fill-box; transform-origin: 50% 100%; animation: bar-up 0.52s var(--ease-out) both; animation-delay: calc(var(--i, 0) * 4ms); }
.anim .sticker-art.is-drawing svg > g > path { animation: digit-in 0.4s var(--ease-out) 0.22s both; }
.anim .sticker-art.is-swap svg { animation: swap 0.3s var(--ease-out); }
@keyframes bar-up { from { transform: scaleY(0.04); opacity: 0; } 40% { opacity: 1; } }
@keyframes digit-in { from { opacity: 0; transform: translateY(1.5px); } }
@keyframes swap { from { opacity: 0.4; } }

.bc-results .result-list .row { padding: 12px 0; }
.bc-results .result-list dt { color: var(--ink); }
.bc-results .result-list dd { font-variant-numeric: lining-nums tabular-nums; }
.bc-results .result-list dd small { margin-top: 2px; font-size: 12.5px; line-height: 1.45; }
.bc-results .tool-actions { gap: 8px; }
.bc-actions .copied:empty { display: none; }

/* no lone word on the last line of a hint or a note */
.tool-card .f-hint, .tool-card .status, .tick-text small { text-wrap: pretty; }

/* ---------- notes: one quiet list, not a pile of cards ---------- */
.bc-results .notes:not(:empty) {
  gap: 0;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.75);
  box-shadow: 0 10px 28px -20px rgba(29, 42, 69, 0.35);
}
.bc-results .notes .status { gap: 10px; padding: 11px 15px; border: 0; border-radius: 0; background: none; font-size: 13.5px; line-height: 1.5; }
.bc-results .notes .status + .status { border-top: 1px solid var(--hairline); }
.bc-results .notes .status .dot { width: 20px; height: 20px; margin-top: 0; font-size: 11px; }
.btn-tool svg { flex: none; margin-right: 8px; }
.btn-tool:disabled { opacity: 0.42; cursor: not-allowed; }
.bc-results .btn-tool:not(:disabled) { transition: transform 0.2s var(--ease-out), box-shadow 0.2s, background 0.2s; }
.bc-results .btn-tool:not(:disabled):hover { transform: translateY(-1px); }
.bc-results .btn-tool:not(:disabled):active { transform: scale(0.97); }
.btn-glass.btn-tool:not(:disabled):hover { background: linear-gradient(135deg, rgba(255, 255, 255, 0.85), rgba(255, 255, 255, 0.5)); }

/* ---------- closing call ---------- */
.bc-final { padding-bottom: 80px; }
.bc-final-copy { max-width: 36rem; margin: 18px auto 0; color: var(--ink-soft); font-size: 16.5px; line-height: 1.7; }

/* ---------- phones: the barcode follows the options in a small bar at the foot ---------- */
.peek {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  z-index: 44;
  display: flex;
  justify-content: center;
  pointer-events: none;
  visibility: hidden;
  opacity: 0;
  transform: translateY(calc(100% + 18px));
  transition: transform 0.46s var(--ease-out), opacity 0.3s var(--ease-out), visibility 0s linear 0.46s;
}
.peek.is-on { visibility: visible; opacity: 1; transform: none; transition-delay: 0s; }
.peek-in {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  max-width: 30rem;
  min-height: 64px;
  padding: 8px 8px 8px 8px;
  border-radius: 22px;
  cursor: pointer;
  -webkit-backdrop-filter: blur(14px) saturate(1.3);
  backdrop-filter: blur(14px) saturate(1.3);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22), 0 20px 44px -14px rgba(29, 42, 69, 0.62), 0 4px 12px -4px rgba(29, 42, 69, 0.3);
}
.peek-text { flex: 1; display: flex; align-items: center; gap: 12px; min-width: 0; margin: 0; }
.peek-art { flex: none; display: flex; align-items: center; justify-content: center; width: 78px; height: 48px; padding: 4px 5px; border-radius: 10px; background: #fff; box-shadow: 0 6px 14px -8px rgba(0, 0, 0, 0.6); }
.peek-art svg { display: block; width: 100%; height: 100%; }
.peek-meta { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.peek-title { font-size: 14.5px; font-weight: 600; line-height: 1.25; letter-spacing: 0.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-variant-numeric: lining-nums tabular-nums; }
.peek-sub { font-size: 13px; line-height: 1.3; opacity: 0.92; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-variant-numeric: lining-nums tabular-nums; }
.peek-go {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 48px;
  padding: 0 14px 0 16px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.1);
  color: var(--cream);
  font-size: 13.5px;
  font-weight: 600;
  transition: background 0.2s, transform 0.2s var(--ease-out);
}
.peek-in:hover .peek-go { background: rgba(255, 255, 255, 0.18); }
.peek-in:active .peek-go { transform: scale(0.96); }
html:not(.anim) .peek { transform: none; transition: opacity 0.2s, visibility 0s linear 0.2s; }
html:not(.anim) .peek.is-on { transition-delay: 0s; }
@media (max-width: 899px) {
  html { scroll-padding-bottom: 92px; }
}
@media (min-width: 900px) {
  .peek { display: none; }
}

@media (max-width: 479px) {
  .seg-2 span { padding: 0 10px; font-size: 13.5px; }
  .size-row output { font-size: 24px; }
  /* two downloads side by side, the message under them */
  .bc-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .bc-actions .btn-tool { width: 100%; padding: 0 12px; }
  .bc-actions .copied { grid-column: 1 / -1; text-align: center; }
  .bc-main .result-label { padding-right: 52px; }
  .card-copy { top: 10px; right: 10px; width: 44px; padding: 0; justify-content: center; }
  .card-copy .cc-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
}
.bc-results .result-list dt { white-space: nowrap; }
.formula .nw { color: inherit; font-style: normal; white-space: nowrap; }

/* the price table becomes one small card per code on phones */
@media (max-width: 559px) {
  .price-table thead { display: none; }
  .price-table, .price-table tbody, .price-table tr, .price-table th, .price-table td { display: block; }
  .price-table tr { padding: 14px 12px; border-bottom: 1px solid rgba(29, 42, 69, 0.08); }
  .price-table tbody tr:last-child { border-bottom: 0; }
  .price-table th, .price-table td { padding: 0; border: 0; }
  .price-table th { font-family: var(--serif); font-size: 21px; font-weight: 600; }
  .price-table td { margin-top: 6px; }
  .price-table td[data-k]::before { content: attr(data-k); display: block; margin-bottom: 1px; font-size: 11px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-mute); }
}
