:root {
  color-scheme: light;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  color: #243545;
  --muted: #526777;
  --line: #dce7ef;
  --blue: #1b5f98;
  --blue-soft: #edf6fc;
  --blue-line: #94bad5;
  --green: #51a151;
  --warm: #f7f3eb;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; padding: 2px; }
h1, h2, p, fieldset, ul { margin: 0; }
a { color: var(--blue); text-underline-offset: .15em; }
button, select { font: inherit; color: inherit; }
button, summary, select { cursor: pointer; }
:focus-visible { outline: 3px solid #79adce; outline-offset: 3px; }
.print-calculator {
  width: min(100%, 1392px);
  margin-inline: auto;
  padding: clamp(12px, 2.1vw, 26px);
  display: grid;
  gap: clamp(12px, 1.7vw, 24px);
  grid-template-columns: minmax(0, 1.85fr) minmax(250px, 1fr);
  align-items: start;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: white;
}
.calculator-form, .calculator-aside { min-width: 0; display: grid; gap: 12px; }
h1 { font-size: clamp(21px, 2.3vw, 29px); letter-spacing: -.02em; }
h2 { font-size: 15px; }
.field-label, legend { padding: 0; font-weight: 700; font-size: 14px; }
select { width: 100%; min-height: 44px; border: 1px solid #c4d5e1; padding-inline: 11px; border-radius: 8px; background: white; }
fieldset { border: 0; padding: 0; min-inline-size: 0; }
.format-list {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 7px;
  margin-top: 8px;
}
.format-list.flyer-formats { grid-template-columns: repeat(12, minmax(0, 1fr)); }
.format-list.many-formats, :is([data-product="banners"], [data-product="notebooks"]) .format-list {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.flyer-formats .format-tile { grid-column: span 3; }
.flyer-formats .format-tile:nth-child(n + 5) { grid-column: span 4; }
[data-product="folders"] .format-list { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.format-tile, .quantity-row {
  position: relative;
  cursor: pointer;
  min-width: 0;
  border: 1px solid var(--line);
  background: white;
  border-radius: 8px;
}
.format-tile:has(input:checked), .quantity-row:has(input:checked) {
  color: var(--blue);
  background: var(--blue-soft);
  border-color: var(--blue-line);
}
.format-tile:has(input:focus-visible) { outline: 3px solid #79adce; outline-offset: 1px; }
.format-tile input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}
.format-tile { min-height: 57px; padding: 7px; display: flex; gap: 7px; align-items: center; }
.format-copy { display: grid; gap: 3px; overflow-wrap: anywhere; }
.format-copy strong { font-size: 12px; }
.format-copy small { color: var(--muted); font-size: 11px; }
.flyer-formats .format-copy strong { overflow-wrap: normal; }
.format-icon {
  flex: 0 0 13px;
  height: 17px;
  border: 1px solid currentColor;
  border-radius: 2px;
  color: var(--muted);
}
.custom-format .format-icon { height: 15px; text-align: center; font-size: 11px; color: var(--blue); }
.fold-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; margin-top: 8px; }
.fold-choice {
  display: grid;
  align-content: center;
  gap: 4px;
  position: relative;
  padding: 8px 10px;
  min-height: 52px;
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
  font-size: 12px;
}
.fold-choice input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.fold-choice:has(input:checked) { background: var(--blue-soft); border-color: var(--blue-line); color: var(--blue); }
.fold-choice:has(input:focus-visible) { outline: 3px solid #79adce; outline-offset: 1px; }
.fold-choice small, #fold-hint, #sticker-size-hint { color: var(--muted); font-size: 12px; }
#fold-hint, #sticker-size-hint { margin-top: 7px; }
.quantity-fieldset { position: relative; }
.total-label { position: absolute; right: 10px; top: -17px; color: var(--muted); font-size: 12px; }
.quantity-list { margin-top: 8px; display: grid; gap: 5px; }
.quantity-row { min-height: 44px; padding: 7px 11px; display: flex; align-items: center; gap: 9px; }
.quantity-row input { margin: 0; accent-color: var(--blue); }
.banner-individual, .banner-note { color: var(--muted); font-size: 12px; }
.banner-note { margin-top: 7px; }
.price { display: flex; align-items: baseline; gap: 5px; margin-inline-start: auto; white-space: nowrap; font-variant-numeric: tabular-nums; }
.price small { color: var(--muted); }
details { margin-top: 9px; }
summary { color: var(--blue); font-size: 13px; font-weight: 650; }
.base-price, .manager-panel {
  border: 1px solid #c7dfef;
  background: var(--blue-soft);
  border-radius: 10px;
  padding: 12px 14px;
  line-height: 1.4;
}
.base-price { margin-top: 12px; }
.base-price p { margin-top: 5px; display: grid; gap: 3px; font-size: 13px; }
.base-price p span, .manager-panel p, #load-status { color: var(--muted); }
.manager-panel p { font-size: 14px; margin-top: 7px; }
.manager-button {
  min-height: 45px;
  display: inline-flex;
  gap: 14px;
  align-items: center;
  justify-content: center;
  border-radius: 9px;
  padding: 8px 16px;
  background: var(--green);
  color: white;
  font-size: 19px;
  font-weight: 750;
  text-decoration: none;
}
.manager-button:hover { background: #438e43; }
.retry { border: 0; padding: 0; background: none; color: var(--blue); text-decoration: underline; }
.preview, .services, .design-offer { min-width: 0; border-radius: 12px; padding: 12px; border: 1px solid var(--line); }
.preview { background: #f7fafd; display: grid; gap: 8px; }
.preview p { color: var(--muted); font-size: 12px; }
.banner-swatches { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 8px; }
.banner-swatch {
  min-width: 0;
  position: relative;
  cursor: pointer;
  background: white;
  border: 1px solid var(--line);
  padding: 7px;
  border-radius: 8px;
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  align-content: start;
  gap: 5px;
  font-size: 14px;
}
.banner-swatch input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.banner-swatch:has(input:checked) { border-color: var(--blue-line); background: var(--blue-soft); color: var(--blue); }
.banner-swatch:has(input:focus-visible) { outline: 3px solid #79adce; outline-offset: 1px; }
.banner-description { font-size: 12px; color: #334f64; line-height: 1.35; }
.banner-swatch small { font-size: 11px; color: var(--muted); }
.banner-swatch-image, .print-detail-image {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: 5px;
  background: #e6e8e9;
}
.banner-swatch-image canvas, .print-detail-image canvas {
  display: block;
  width: 100%;
  height: 100%;
}
.sample-unavailable { background: #eff3f5; }
.print-detail { margin-top: 7px; }
.print-detail summary { color: var(--blue); font-size: 12px; }
.print-detail-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; margin-top: 7px; }
.print-detail-card {
  display: grid;
  gap: 4px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 12px;
}
.print-detail-card small { color: var(--muted); }
.print-detail-image canvas { transform: scale(1.75); transform-origin: 60% 41%; }
.preview-scene {
  position: relative;
  aspect-ratio: 3 / 2;
  min-width: 0;
  overflow: hidden;
  border-radius: 8px;
  background: #e6ecef;
  container-type: inline-size;
}
.preview-photo { display: block; width: 100%; height: 100%; object-fit: cover; }
.preview-figure {
  position: relative;
  min-width: 0;
  --axis-side: 29px;
  --axis-bottom: 27px;
}
.preview-figure[data-measure="rectangle"] { padding-inline-end: var(--axis-side); }
.preview-figure:is([data-measure="rectangle"], [data-measure="diameter"]) { padding-bottom: var(--axis-bottom); }
.envelope-preview {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 20% 18%, #eff3f5 6%, #d7e0e8 64%, #becbd6);
}
.envelope-paper, .flyer-paper {
  position: absolute;
  top: var(--frame-y);
  left: var(--frame-x);
  width: var(--frame-w);
  height: var(--frame-h);
}
.envelope-back, .envelope-front {
  position: absolute;
  inset: 0;
  border: 1px solid #d9dfe2;
  box-shadow: 2px 5px 9px #283f5422;
}
.envelope-back { transform: translate(9%, -11%); background: #eef1f4; }
.envelope-back::before {
  position: absolute;
  content: "";
  left: -1px;
  right: -1px;
  top: -23%;
  height: 26%;
  border-radius: 5px 5px 0 0;
  background: linear-gradient(#fdfdfd, #e4e9ee);
  clip-path: polygon(4% 0, 96% 0, 100% 100%, 0 100%);
}
.envelope-preview[data-opening="short"] .envelope-back { transform: translate(12%, -11%); }
.envelope-preview[data-opening="short"] .envelope-back::before {
  inset: -1px auto -1px calc(100% - 1px);
  width: 12%;
  height: auto;
  border-radius: 0 5px 5px 0;
  clip-path: polygon(0 0, 100% 4%, 100% 96%, 0 100%);
}
.envelope-front { background: linear-gradient(145deg, #fff 26%, #f6f7f8 100%); }
.envelope-imprint {
  position: absolute;
  left: 8%;
  top: 16%;
  width: 33%;
  height: 38%;
  padding: 4%;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, #ecf3fb, #e2ebf4);
}
.envelope-imprint img { display: block; width: 100%; height: auto; }
.envelope-address {
  position: absolute;
  left: 51%;
  right: 9%;
  bottom: 13%;
  height: 30%;
  display: grid;
  align-content: space-around;
}
.envelope-address span { border-top: 1px solid #cfdbe4; }
.envelope-address span:last-child { width: 76%; }
.flyer-preview {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 26% 15%, #f6f1e8 5%, #e1d9cc 72%, #cec8bc);
}
.flyer-paper {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  overflow: hidden;
  container-type: inline-size;
  background: #f7f1e5;
  color: #253d4c;
  box-shadow: 1px 1px 0 #c9b9a8, 9px 13px 18px #51403038;
}
.flyer-copy { display: grid; gap: 3cqi; padding: 9cqi 8cqi 8cqi; }
.flyer-copy span { font-weight: 650; font-size: 5.6cqi; letter-spacing: .04em; text-transform: uppercase; }
.flyer-copy strong { font-family: Georgia, serif; font-size: 15cqi; font-weight: 600; line-height: 1; }
.flyer-paper[data-layout="slim"] .flyer-copy strong { max-width: 80%; font-size: 19cqi; }
.flyer-paper img { width: 100%; height: 100%; min-height: 0; object-fit: cover; object-position: 53% center; }
.flyer-cta { padding: 6cqi 8cqi; background: #38576a; color: white; font-size: 6.6cqi; font-weight: 650; }
.photo-brand {
  position: absolute;
  display: grid;
  gap: clamp(2px, 2cqi, 7px);
  justify-items: center;
  place-content: center;
  width: var(--brand-width, 23%);
  top: var(--brand-y, 51%);
  left: var(--brand-x, 50%);
  transform: translate(-50%, -50%);
  color: #243f56;
  text-align: center;
  line-height: 1.18;
  pointer-events: none;
}
.photo-brand img { width: 100%; height: auto; }
.photo-brand[data-cover="card"] { width: 18%; }
.photo-brand[data-cover="notebook"] img { width: 72%; }
.notebook-cover { display: grid; gap: 2px; }
.notebook-cover strong { font-size: clamp(10px, 5cqi, 19px); }
.notebook-cover small { font-size: clamp(5px, 2.2cqi, 10px); white-space: nowrap; }
.photo-measures {
  position: absolute;
  inset: 0 var(--axis-side) var(--axis-bottom) 0;
  color: #264761;
  font-size: 11px;
  line-height: 1.1;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  pointer-events: none;
}
.preview-figure[data-measure="diameter"] .photo-measures { inset-inline-end: 0; }
.dimension-width, .dimension-height { position: absolute; }
.dimension-width { inset: 100% 0 auto; height: var(--axis-bottom); }
.dimension-height { inset: 0 auto 0 100%; width: var(--axis-side); }
.photo-measures i, .photo-measures span { position: absolute; display: block; }
.photo-measures span { white-space: nowrap; }
.dimension-width i {
  left: var(--frame-x);
  top: 7px;
  width: var(--frame-w);
  border-top: 1px dashed #7292ad;
}
.dimension-height i {
  top: var(--frame-y);
  left: 7px;
  height: var(--frame-h);
  border-left: 1px dashed #7292ad;
}
.photo-measures i::before, .photo-measures i::after {
  position: absolute;
  content: "";
  background: #7292ad;
}
.dimension-width i::before, .dimension-width i::after { top: -4px; width: 1px; height: 7px; }
.dimension-width i::before, .dimension-height i::before { left: 0; }
.dimension-width i::after { right: 0; }
.dimension-height i::before, .dimension-height i::after { left: -4px; width: 7px; height: 1px; }
.dimension-height i::before { top: 0; }
.dimension-height i::after { bottom: 0; }
.dimension-width span {
  top: 13px;
  left: clamp(42px, calc(var(--frame-x) + var(--frame-w) / 2), calc(100% - 42px));
  transform: translateX(-50%);
}
.dimension-height span {
  left: 13px;
  top: clamp(35px, calc(var(--frame-y) + var(--frame-h) / 2), calc(100% - 35px));
  transform: translateY(-50%);
  writing-mode: vertical-rl;
}
.preview-trim { display: block; }
.services ul { padding-left: 1.2em; margin-top: .4em; font-size: 13px; line-height: 1.45; }
.services li::marker { color: #79a4c3; }
.design-offer { background: var(--warm); border-color: #e8dfd0; display: grid; gap: 4px; }
.design-offer p, .design-offer a { font-size: 12px; }
@media (max-width: 960px) {
  .format-tile { flex-direction: column; justify-content: center; align-items: flex-start; }
}
@media (max-width: 690px) {
  .print-calculator { grid-template-columns: minmax(0, 1fr); }
  .calculator-aside { order: -1; grid-template-columns: minmax(110px, 1fr) minmax(0, 1fr); gap: 7px; }
  [data-product="envelopes"] .calculator-aside { grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); }
  .preview { grid-row: span 2; padding: 7px; }
  [data-product="banners"] .calculator-aside { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  [data-product="banners"] .calculator-aside { order: 0; }
  [data-product="banners"] .preview { grid-row: auto; grid-column: 1 / -1; }
  .banner-swatches { gap: 5px; }
  .banner-swatch { padding: 5px; font-size: 12px; }
  .banner-description, .banner-swatch small { font-size: 10px; }
  .print-detail-grid { gap: 5px; }
  .print-detail-card { font-size: 11px; }
  .print-detail-image canvas { transform: scale(2.1); transform-origin: 58% 36%; }
  .preview h2 { font-size: 12px; }
  .preview-figure { --axis-side: 21px; --axis-bottom: 23px; }
  .photo-measures { font-size: 9px; }
  .dimension-height span { left: 11px; }
  .dimension-width span { top: 12px; }
  .services, .design-offer { padding: 7px; }
  .services h2, .design-offer h2 { font-size: 13px; }
  .services ul, .design-offer p, .design-offer a { font-size: 11.5px; }
  .format-list { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .fold-list, [data-product="folders"] .format-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .format-tile { min-height: 46px; }
  .format-tile .format-icon { display: none; }
  .custom-format { grid-column: 1 / -1; }
  .format-list.many-formats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  [data-product="notebooks"] .format-list { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .many-formats .custom-format, [data-product="banners"] .custom-format { grid-column: auto; }
  [data-product="banners"] .format-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .flyer-formats .format-tile { padding-inline: 5px; }
  .flyer-formats .format-copy strong { font-size: clamp(10px, 2.85vw, 12px); }
  .flyer-formats .format-copy small { font-size: clamp(9px, 2.6vw, 11px); }
  .manager-button { display: flex; }
}
@media (max-width: 355px) {
  .format-list, .format-list.many-formats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
