/* ═══════════════════════════════════════════════════════════════
   PRINT-A-MASTERPIECE v6.0
   Enqueue alongside print-a-masterpiece.js.
   Eleven modes. Guestbook cards hold the artwork's own aspect.
   ═══════════════════════════════════════════════════════════════ */

.pam-page .site-header,
.pam-page #wrapper-navbar,
.pam-page .navbar {
  display: none !important;
}

/* ── Reset ── */
.pam-wrap, .pam-wrap * {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

.pam-wrap {
  background: #f5f3ef;
  min-height: 100vh;
  margin-left: calc(-50vw + 50%);
  margin-right: calc(-50vw + 50%);
  width: 100vw;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 60px 20px 120px;
  font-family: 'DM Sans', -apple-system, sans-serif;
  color: #1a1a1a;
  position: relative;
  overflow: hidden;
}

.pam-wrap::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 20% 50%, rgba(0,0,0,0.015) 0%, transparent 70%),
    radial-gradient(ellipse at 80% 30%, rgba(0,0,0,0.01) 0%, transparent 60%);
  pointer-events: none;
}

/* ── Header ── */
.pam-header {
  text-align: center;
  margin-bottom: 50px;
  position: relative;
  z-index: 2;
}

.pam-header h1 {
  font-family: 'Playfair Display', serif;
  font-size: 14px;
  font-weight: 400;
  letter-spacing: 6px;
  text-transform: uppercase;
  color: #999;
  margin-bottom: 8px;
}

.pam-header .subtitle {
  font-family: 'DM Sans', sans-serif;
  font-size: 11px;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: #bbb;
}

/* ── Mac window ── */
.mac-window {
  width: 100%;
  max-width: 920px;
  background: #ffffff;
  border-radius: 10px;
  box-shadow:
    0 20px 60px rgba(0,0,0,0.08),
    0 1px 3px rgba(0,0,0,0.06),
    0 0 0 1px rgba(0,0,0,0.04);
  position: relative;
  z-index: 2;
  overflow: hidden;
}

.mac-titlebar {
  height: 52px;
  background: linear-gradient(180deg, #f6f6f6 0%, #ececec 100%);
  border-bottom: 1px solid #d5d5d5;
  display: flex;
  align-items: center;
  padding: 0 16px;
  position: relative;
  -webkit-user-select: none;
  user-select: none;
}

.mac-dots { display: flex; gap: 8px; }

.mac-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  cursor: pointer;
  border: 1px solid;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  position: relative;
}
.mac-dot.red    { background: #ff5f57; border-color: #e0443e; }
.mac-dot.yellow { background: #febc2e; border-color: #dea123; }
.mac-dot.green  { background: #28c840; border-color: #1aab29; }

.mac-dot:hover { transform: scale(1.15); box-shadow: 0 0 0 2px rgba(0,0,0,0.05); }
.mac-dot.active { box-shadow: 0 0 0 2px rgba(0,0,0,0.15); }
.mac-dot:focus-visible { outline: 2px solid #1a1a1a; outline-offset: 3px; }

.mac-dot::after {
  content: attr(data-label);
  position: absolute;
  top: -22px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 9px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: #999;
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.15s ease;
  pointer-events: none;
}
.mac-dot:hover::after,
.mac-dot:focus-visible::after { opacity: 1; }

.mac-title {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  font-family: 'DM Sans', -apple-system, sans-serif;
  font-size: 13px;
  font-weight: 500;
  color: #4d4d4d;
}

/* ── Info dropdown panels ── */
.mac-info-panel {
  background: #fafaf8;
  border-bottom: 1px solid #e5e5e5;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s ease;
}
.mac-info-panel.open { max-height: 1100px; }

.mac-info-content { padding: 28px 36px 32px; position: relative; }

.mac-info-content::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
}
.mac-info-panel[data-color="red"]    .mac-info-content::before { background: #ff5f57; }
.mac-info-panel[data-color="yellow"] .mac-info-content::before { background: #febc2e; }
.mac-info-panel[data-color="green"]  .mac-info-content::before { background: #28c840; }

.mac-info-content h3 {
  font-family: 'Playfair Display', serif;
  font-size: 15px;
  font-weight: 400;
  font-style: italic;
  color: #333;
  margin-bottom: 14px;
  letter-spacing: 0.5px;
}

.mac-info-content p,
.mac-info-content li {
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  line-height: 1.6;
  color: #555;
  margin-bottom: 10px;
}

.mac-info-content ul { list-style: none; padding-left: 0; }
.mac-info-content li { padding-left: 14px; position: relative; margin-bottom: 6px; }
.mac-info-content li::before { content: '\00b7'; position: absolute; left: 0; color: #999; }

.mac-info-content em { color: #333; font-style: italic; }

.mac-info-content a {
  color: #555;
  border-bottom: 1px solid #ccc;
  text-decoration: none;
  transition: color 0.2s, border-color 0.2s;
}
.mac-info-content a:hover { color: #1a1a1a; border-color: #1a1a1a; }

.mac-info-close {
  position: absolute;
  top: 12px; right: 16px;
  background: none; border: none;
  font-size: 18px; color: #999;
  cursor: pointer; line-height: 1;
}
.mac-info-close:hover { color: #1a1a1a; }

/* ── Source tabs ── */
.source-tabs {
  display: flex;
  background: linear-gradient(180deg, #ececec 0%, #e2e2e2 100%);
  border-bottom: 1px solid #ccc;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.source-tabs::-webkit-scrollbar { display: none; }

.source-tab {
  font-family: 'DM Sans', sans-serif;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.5px;
  color: #777;
  padding: 10px 18px;
  border: none;
  background: transparent;
  cursor: pointer;
  white-space: nowrap;
  border-right: 1px solid #d5d5d5;
  transition: background 0.15s ease, color 0.15s ease;
  position: relative;
}
.source-tab:hover { background: rgba(255,255,255,0.5); color: #444; }
.source-tab:focus-visible { outline: 2px solid #1a1a1a; outline-offset: -3px; }
.source-tab.active { background: #ffffff; color: #1a1a1a; font-weight: 700; }
.source-tab.active::after {
  content: '';
  position: absolute;
  bottom: -1px; left: 0; right: 0;
  height: 2px;
  background: #1a1a1a;
}

/* ── Body ── */
.mac-body {
  padding: 40px;
  min-height: 400px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* ── Controls ── */
.pam-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: center;
  margin-bottom: 10px;
  width: 100%;
}

.pam-btn {
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 12px 28px;
  border: 1.5px solid #1a1a1a;
  background: #1a1a1a;
  color: #fff;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.1s ease;
}
.pam-btn:hover { background: #333; border-color: #333; }
.pam-btn:active { transform: scale(0.97); }
.pam-btn:disabled { background: #ccc; border-color: #ccc; cursor: not-allowed; }
.pam-btn:focus-visible { outline: 2px solid #1a1a1a; outline-offset: 3px; }

.pam-btn-secondary {
  font-family: 'DM Sans', sans-serif;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 8px 16px;
  border: 1.5px solid #ccc;
  background: transparent;
  color: #777;
  border-radius: 4px;
  cursor: pointer;
  transition: border-color 0.2s ease, color 0.2s ease;
}
.pam-btn-secondary:hover { border-color: #1a1a1a; color: #1a1a1a; }
.pam-btn-secondary:disabled { opacity: 0.4; cursor: not-allowed; }
.pam-btn-secondary:focus-visible { outline: 2px solid #1a1a1a; outline-offset: 2px; }

.mode-control, .contrast-control, .width-control, .sub-control {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: #888;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.mode-control select,
.sub-control select {
  padding: 7px 24px 7px 10px;
  border: 1px solid #ddd;
  border-radius: 3px;
  font-family: 'DM Sans', sans-serif;
  font-size: 12px;
  color: #1a1a1a;
  background: #fafafa;
  cursor: pointer;
  letter-spacing: 0.5px;
  -webkit-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%23999'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  max-width: 100%;
}
.mode-control select:focus-visible,
.sub-control select:focus-visible { outline: 2px solid #1a1a1a; outline-offset: 1px; }

.mode-control optgroup {
  font-family: 'DM Sans', sans-serif;
  font-style: normal;
  font-size: 10px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: #aaa;
}
.mode-control option { text-transform: none; letter-spacing: 0; color: #1a1a1a; }

.pam-mode-note {
  font-family: 'Playfair Display', serif;
  font-style: italic;
  font-size: 12.5px;
  color: #9a9a9a;
  text-align: center;
  margin-bottom: 16px;
  min-height: 16px;
  letter-spacing: 0.2px;
}

/* ── Range sliders ── */
.pam-range {
  -webkit-appearance: none;
  appearance: none;
  width: 110px;
  height: 28px;
  background: transparent;
  outline: none;
  margin: 0;
  cursor: pointer;
  touch-action: none;
}
.pam-range::-webkit-slider-runnable-track { height: 3px; background: #ccc; border-radius: 2px; }
.pam-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px; height: 20px;
  margin-top: -8.5px;
  background: #1a1a1a;
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(0,0,0,0.25);
}
.pam-range::-moz-range-track { height: 3px; background: #ccc; border-radius: 2px; }
.pam-range::-moz-range-thumb {
  width: 20px; height: 20px;
  border: none;
  background: #1a1a1a;
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(0,0,0,0.25);
}
.pam-range::-moz-focus-outer { border: 0; }
.pam-range:focus-visible { outline: 2px solid #1a1a1a; outline-offset: 2px; border-radius: 4px; }

.contrast-control span,
.width-control input[type="number"] {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  color: #1a1a1a;
}
.contrast-control span { min-width: 26px; text-align: right; }

.width-control input[type="number"] {
  width: 60px;
  padding: 6px 8px;
  border: 1px solid #ddd;
  border-radius: 3px;
  text-align: center;
  background: #fafafa;
}

/* ── Sub-controls ── */
.pam-sub-controls {
  display: none;
  flex-wrap: wrap;
  gap: 12px 18px;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
  width: 100%;
  padding: 12px 0;
  border-top: 1px dashed #eee;
  border-bottom: 1px dashed #eee;
}
.pam-sub-controls.visible { display: flex; }

/* ── Action bar ── */
.action-bar {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: center;
  margin-bottom: 24px;
  width: 100%;
  flex-wrap: wrap;
}

/* ── Signer modal ── */
.signer-modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
}
.signer-modal.open { display: flex; }
.signer-modal-inner {
  background: #fff;
  border-radius: 8px;
  padding: 30px 32px;
  max-width: 360px;
  width: 90%;
  box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}
.signer-modal h4 {
  font-family: 'Playfair Display', serif;
  font-size: 16px;
  font-weight: 400;
  font-style: italic;
  margin-bottom: 6px;
  color: #1a1a1a;
}
.signer-modal p { font-size: 12px; color: #888; margin-bottom: 16px; line-height: 1.5; }
.signer-modal input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  color: #1a1a1a;
  background: #fafafa;
  margin-bottom: 14px;
}
.signer-modal-actions { display: flex; gap: 8px; justify-content: flex-end; }

/* ── Status ── */
.pam-status {
  font-size: 12px;
  color: #aaa;
  text-align: center;
  margin-bottom: 20px;
  min-height: 18px;
  letter-spacing: 0.5px;
  transition: color 0.3s;
}
.pam-status.loading { color: #666; }
.pam-status.error   { color: #c0392b; }

/* ═══════════════════════════════════════════════════════════
   OUTPUT — one ground per process
   ═══════════════════════════════════════════════════════════ */
.pam-output-wrap {
  width: 100%;
  overflow-x: auto;
  border-radius: 4px;
  padding: 20px;
  margin-bottom: 24px;
  display: none;
  transition: background 0.3s ease;
}

.pam-output-wrap.mode-ascii    { background: #0d1117; border: 1px solid #1c2333; }
.pam-output-wrap.mode-ansi     { background: #0d1117; border: 1px solid #1c2333; }
.pam-output-wrap.mode-cmyk     { background: #f7f3eb; border: 1px solid #e8e0d0; }
.pam-output-wrap.mode-benday,
.pam-output-wrap.mode-dither   { background: #ffffff; border: 1px solid #e0e0e0; }
.pam-output-wrap.mode-comic    { background: #f7f2e4; border: 1px solid #e6ddc6; }
.pam-output-wrap.mode-riso     { background: #f4eedc; border: 1px solid #d8d0b8; }
.pam-output-wrap.mode-engrave  { background: #efe9dc; border: 1px solid #ded5c2; }
.pam-output-wrap.mode-cyano    { background: #e9e4d3; border: 1px solid #d4cdb6; }
.pam-output-wrap.mode-couture  { background: #f2f0eb; border: 1px solid #e2ded4; }
.pam-output-wrap.mode-ukiyo    { background: #ece5d0; border: 1px solid #d9cfb4; }

.ascii-output {
  font-family: 'JetBrains Mono', 'Courier New', monospace;
  font-size: 5px;
  line-height: 1.06;
  white-space: pre;
  color: #d4dce8;
  text-align: center;
  letter-spacing: 0.5px;
}

.cmyk-stack { position: relative; width: 100%; display: none; }
.cmyk-layer {
  font-family: 'JetBrains Mono', 'Courier New', monospace;
  font-size: 5px;
  line-height: 1.06;
  white-space: pre;
  text-align: center;
  letter-spacing: 0.5px;
  mix-blend-mode: multiply;
}
.cmyk-layer:first-child { position: relative; }
.cmyk-layer:not(:first-child) { position: absolute; top: 0; left: 0; right: 0; }
.cmyk-c { color: #00aeef; }
.cmyk-m { color: #ec008c; }
.cmyk-y { color: #fff200; }
.cmyk-k { color: #231f20; }

.benday-container, .comic-container, .dither-container,
.riso-container, .ansi-container, .engrave-container, .cyano-container,
.couture-container, .ukiyo-container {
  width: 100%;
  display: none;
  text-align: center;
}
.benday-container canvas,
.comic-container canvas,
.dither-container canvas,
.riso-container canvas,
.ansi-container canvas,
.engrave-container canvas,
.cyano-container canvas,
.couture-container canvas,
.ukiyo-container canvas {
  border-radius: 2px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}
.dither-container canvas, .ansi-container canvas {
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}
.engrave-container canvas,
.cyano-container canvas,
.ukiyo-container canvas { box-shadow: 0 2px 18px rgba(0,0,0,0.10); }
.couture-container canvas { box-shadow: 0 6px 30px rgba(0,0,0,0.10); }

/* ── Artwork info ── */
.artwork-info {
  text-align: center;
  padding: 20px 0 0;
  border-top: 1px solid #eee;
  width: 100%;
  display: none;
}
.artwork-info .artwork-title {
  font-family: 'Playfair Display', serif;
  font-size: 18px;
  font-weight: 400;
  font-style: italic;
  color: #1a1a1a;
  margin-bottom: 6px;
}
.artwork-info .artwork-artist { font-size: 13px; font-weight: 500; color: #555; margin-bottom: 4px; }
.artwork-info .artwork-date   { font-size: 12px; color: #999; margin-bottom: 4px; }
.artwork-info .artwork-medium { font-size: 11px; color: #bbb; margin-bottom: 4px; }
.artwork-info .artwork-source {
  font-size: 10px; color: #ccc;
  letter-spacing: 1px; text-transform: uppercase;
  margin-bottom: 8px;
}
.artwork-info .artwork-link {
  font-size: 11px;
  color: #999;
  text-decoration: none;
  letter-spacing: 1px;
  text-transform: uppercase;
  border-bottom: 1px solid #ddd;
  padding-bottom: 2px;
  transition: color 0.2s, border-color 0.2s;
}
.artwork-info .artwork-link:hover { color: #1a1a1a; border-color: #1a1a1a; }

/* ── Original preview ── */
.original-preview { display: none; text-align: center; margin-bottom: 20px; }
.original-preview img { max-height: 120px; border: 1px solid #eee; border-radius: 3px; }
.original-preview .preview-label {
  font-size: 10px; color: #bbb;
  letter-spacing: 2px; text-transform: uppercase;
  margin-top: 6px;
}

/* ── Empty state ── */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 200px;
  color: #ccc;
  text-align: center;
}
.empty-state .glyph-sample {
  font-family: 'JetBrains Mono', monospace;
  font-size: 24px;
  letter-spacing: 4px;
  margin-bottom: 16px;
  color: #ddd;
}
.empty-state p { font-size: 13px; color: #bbb; }

/* ═══════════════════════════════════════════════════════════
   GUESTBOOK
   Cards keep each print's own proportions — nothing is cropped.
   ═══════════════════════════════════════════════════════════ */
.guestbook-toggle {
  position: fixed;
  bottom: 20px; right: 20px;
  z-index: 100;
  width: 48px; height: 48px;
  border-radius: 50%;
  background: #1a1a1a;
  color: #fff;
  border: none;
  font-size: 18px;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(0,0,0,0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s;
}
.guestbook-toggle:hover { transform: scale(1.08); }
.guestbook-toggle:focus-visible { outline: 2px solid #fff; outline-offset: -6px; }

.guestbook-badge {
  position: absolute;
  top: -4px; right: -4px;
  background: #c0392b;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  min-width: 20px; height: 20px;
  padding: 0 4px;
  border-radius: 10px;
  display: none;
  align-items: center;
  justify-content: center;
}

.guestbook-panel {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 99;
  background: #fff;
  border-top: 1px solid #e0e0e0;
  box-shadow: 0 -10px 40px rgba(0,0,0,0.1);
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease;
}
.guestbook-panel.open { max-height: 75vh; overflow-y: auto; }

.guestbook-panel-inner { padding: 30px 30px 80px; }

.guestbook-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}
.guestbook-panel-header h3 {
  font-family: 'Playfair Display', serif;
  font-size: 16px;
  font-weight: 400;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: #666;
}
.guestbook-panel-subtitle {
  font-size: 11px;
  color: #aaa;
  letter-spacing: 1px;
  margin-bottom: 24px;
  font-style: italic;
}
.guestbook-panel-close {
  background: none; border: none;
  font-size: 24px; color: #999;
  cursor: pointer;
}
.guestbook-panel-close:hover { color: #1a1a1a; }

.guestbook-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  grid-auto-rows: min-content;
  align-items: start;
  gap: 16px;
}

.gb-card {
  border: 1px solid #eee;
  border-radius: 6px;
  overflow: hidden;
  transition: box-shadow 0.2s;
  position: relative;
  background: #fafafa;
}
.gb-card:hover { box-shadow: 0 4px 20px rgba(0,0,0,0.08); }

/* The whole print, at the proportions it was pulled at. */
.gb-card img {
  width: 100%;
  height: auto;
  display: block;
  background: #f0efec;
}

.gb-card-info { padding: 10px 12px; }
.gb-card-title {
  font-family: 'Playfair Display', serif;
  font-size: 12px;
  font-style: italic;
  color: #333;
  margin-bottom: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.gb-card-meta { font-size: 10px; color: #aaa; letter-spacing: 0.3px; margin-bottom: 4px; }
.gb-card-signer { font-size: 9px; color: #c0c0c0; letter-spacing: 1px; text-transform: uppercase; }
.gb-card-signer::before { content: '\2014\00a0'; }

.guestbook-pagination { display: flex; justify-content: center; gap: 6px; margin-top: 28px; flex-wrap: wrap; }
.gb-page-btn {
  font-family: 'DM Sans', sans-serif;
  font-size: 11px;
  padding: 6px 12px;
  border: 1px solid #ddd;
  background: #fff;
  cursor: pointer;
  border-radius: 3px;
  color: #666;
}
.gb-page-btn.active { background: #1a1a1a; color: #fff; border-color: #1a1a1a; }
.gb-page-btn:disabled { opacity: 0.3; cursor: not-allowed; }

.guestbook-empty {
  text-align: center;
  padding: 60px 40px;
  color: #ccc;
  font-size: 13px;
  font-style: italic;
}

/* ── Footer ── */
.pam-footer {
  margin-top: 60px;
  text-align: center;
  font-size: 10px;
  color: #ccc;
  letter-spacing: 2px;
  text-transform: uppercase;
  position: relative;
  z-index: 2;
  line-height: 2;
}
.pam-footer a { color: #aaa; text-decoration: none; border-bottom: 1px solid #ddd; }
.pam-footer a:hover { color: #666; }

/* ── Responsive ── */
@media (max-width: 600px) {
  .pam-wrap { padding: 30px 10px 80px; }
  .pam-header { margin-bottom: 30px; }
  .mac-body { padding: 20px 12px; }
  .mac-info-content { padding: 22px 22px 26px; }
  .ascii-output, .cmyk-layer { font-size: 3px; line-height: 1.0; }
  .source-tabs { padding: 0 4px; }
  .source-tab { padding: 10px 12px; font-size: 10px; }
  .pam-output-wrap { padding: 10px; }

  .pam-controls {
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
    justify-items: stretch;
  }
  .pam-controls > .pam-btn { width: 100%; }
  .mode-control { display: grid; grid-template-columns: auto 1fr; gap: 10px; align-items: center; }
  .mode-control select { width: 100%; }

  .contrast-control, .width-control {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 10px;
    align-items: center;
    width: 100%;
  }
  .pam-range { width: 100%; max-width: none; height: 40px; }
  .pam-range::-webkit-slider-thumb { width: 26px; height: 26px; margin-top: -11.5px; }
  .pam-range::-moz-range-thumb { width: 26px; height: 26px; }

  .pam-sub-controls { flex-direction: column; align-items: stretch; }
  .sub-control { display: grid; grid-template-columns: auto 1fr; gap: 10px; align-items: center; }
  .sub-control select { width: 100%; }

  .guestbook-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  .pam-wrap *, .pam-wrap *::before, .pam-wrap *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
  .mac-info-panel, .guestbook-panel { transition: none; }
}