/*!
 * 123PhotoTool phone editor shell (assets/js/pt-app.js).
 *
 * On a phone, once a photo is loaded, a tool's canvas and its settings form
 * are lifted into a full-screen editor: a top bar (close, title, compare,
 * undo, redo, Save), the photo, and a bottom bar (the tool's main slider and
 * its modes), with everything else in a bottom sheet. Desktop never sees it.
 *
 * Tokens first, so every tool's editor reads as one app.
 */
:root {
  --pt-app-bg: #111317;
  --pt-app-bar: #1b1e23;
  --pt-app-fg: #fff;
  --pt-app-muted: #c2c8d0;
  --pt-app-line: rgba(255, 255, 255, 0.1);
  --pt-app-accent: var(--bs-primary, #3f78e0);
  --pt-app-accent-fg: #8bb6ff;
  --pt-app-accent-soft: rgba(63, 120, 224, 0.24);
  --pt-app-press: rgba(255, 255, 255, 0.12);
  --pt-app-tap: 44px;
  --pt-app-radius: 12px;
  --pt-app-sheet-radius: 18px;
  --pt-app-ease: cubic-bezier(.4, 0, .2, 1);
  --pt-app-z: 1046; /* above the fixed navbar and offcanvas, below Bootstrap modals (1055) and toasts */
}

.pt-app {
  position: fixed;
  left: 0;
  top: 0;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  z-index: var(--pt-app-z);
  display: none;
  flex-direction: column;
  background: var(--pt-app-bg);
  color: var(--pt-app-fg);
  touch-action: none;
  overscroll-behavior: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
  font-family: var(--bs-font-sans-serif, sans-serif);
}
html.pt-app-open .pt-app { display: flex; }
html.pt-app-open, html.pt-app-open body {
  overflow: hidden !important;
  overscroll-behavior: none;
}
.pt-app button { font-family: inherit; }
.pt-app :focus-visible { outline: 2px solid var(--pt-app-accent-fg); outline-offset: 2px; }

/* ── Top bar ─────────────────────────────────────────────────────────────── */
.pt-app-top {
  flex: none;
  display: flex;
  align-items: center;
  gap: 2px;
  padding: calc(6px + env(safe-area-inset-top, 0px)) calc(8px + env(safe-area-inset-right, 0px)) 6px calc(8px + env(safe-area-inset-left, 0px));
  background: var(--pt-app-bar);
}
.pt-app-iconbtn {
  flex: none;
  width: var(--pt-app-tap);
  height: var(--pt-app-tap);
  border: 0;
  border-radius: var(--pt-app-radius);
  background: transparent;
  color: var(--pt-app-fg);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}
.pt-app-iconbtn svg { width: 24px; height: 24px; }
.pt-app-iconbtn i { font-size: 24px; line-height: 1; }
.pt-app-iconbtn:active, .pt-app-iconbtn.pressed { background: var(--pt-app-press); }
[dir="rtl"] .pt-app-undo svg, [dir="rtl"] .pt-app-redo svg { transform: scaleX(-1); }
.pt-app-iconbtn:disabled { opacity: 0.32; }
.pt-app-iconbtn[hidden] { display: none; }
/* Up to two lines: tool names run to 20+ characters in some languages, and
   the Save label next to them grows too ("Speichern"). pt-app.js steps the
   font down, then hides the title rather than show half a word. */
.pt-app-title {
  flex: 1 1 auto;
  min-width: 0;
  text-align: center;
  font-weight: 600;
  font-size: 0.95rem;
  line-height: 1.15;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.pt-app-save {
  flex: none;
  min-height: 40px;
  margin-inline-start: 4px;
  padding: 0 14px;
  border: 0;
  border-radius: var(--pt-app-radius);
  background: var(--bs-success, #45c4a0);
  /* Dark on green, like the site's own success buttons: white on #45c4a0
     is 2.2:1, under the 4.5:1 text needs. */
  color: #1e2228;
  font-weight: 600;
  font-size: 0.95rem;
  white-space: nowrap;
}
.pt-app-save:active { filter: brightness(0.9); }
.pt-app-save:disabled { opacity: 0.45; }
/* Set by fitTitle() when the title has no room. */
.pt-app-top.pt-app-top-tight { gap: 0; padding-left: calc(4px + env(safe-area-inset-left, 0px)); padding-right: calc(4px + env(safe-area-inset-right, 0px)); }
.pt-app-top-tight .pt-app-iconbtn { width: 40px; }
.pt-app-top-tight .pt-app-save { padding: 0 9px; font-size: 0.85rem; }
.pt-app-title-wrap .pt-app-title { overflow-wrap: anywhere; -webkit-hyphens: auto; hyphens: auto; }
@media (max-width: 380px) {
  .pt-app-top { padding-left: calc(4px + env(safe-area-inset-left, 0px)); padding-right: calc(4px + env(safe-area-inset-right, 0px)); }
  .pt-app-iconbtn { width: 40px; }
  .pt-app-save { padding: 0 10px; }
}

/* ── Stage ───────────────────────────────────────────────────────────────── */
/* overflow: hidden keeps the closed sheet below the stage; without it the
   sheet parks on top of the bottom bar and swallows its taps. */
.pt-app-stage {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  overflow: hidden;
  padding-left: env(safe-area-inset-left, 0px);
  padding-right: env(safe-area-inset-right, 0px);
}
/* The tool's own viewport, lifted in. Its page styling (card, border,
   fixed heights) gives way to the full stage. */
.pt-app-stage > .pt-app-viewport {
  flex: 1 1 auto;
  width: 100% !important;
  max-width: none !important;
  height: 100% !important;
  min-height: 0 !important;
  max-height: none !important;
  margin: 0 !important;
  padding: 10px;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  background: var(--pt-app-bg) !important;
}
.pt-app-stage > .pt-app-viewport canvas,
.pt-app-stage > .pt-app-viewport img { box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08); }
.pt-app-stage .pt-app-fit {
  width: var(--pt-fit-w) !important;
  height: var(--pt-fit-h) !important;
  max-width: none !important;
  max-height: none !important;
}
.pt-app-stage > .pt-app-viewport.pt-app-scroll {
  overflow-y: auto !important;
  touch-action: pan-y;
  -webkit-user-select: auto;
  user-select: auto;
}

.pt-app-hint {
  position: absolute;
  left: 50%;
  top: 10px;
  transform: translateX(-50%);
  /* max-content: at left 50% the box would otherwise only get the right
     half of the stage, so every hint wrapped at half the screen width. */
  width: max-content;
  max-width: calc(100% - 32px);
  padding: 6px 14px;
  border-radius: 18px;
  background: rgba(0, 0, 0, 0.62);
  color: #fff;
  font-size: 0.8rem;
  line-height: 1.3;
  text-align: center;
  pointer-events: none;
  z-index: 5;
  opacity: 0;
  transition: opacity 0.25s;
}
.pt-app-hint.show { opacity: 1; }
.pt-app-compare-badge {
  position: absolute;
  left: 12px;
  bottom: 12px;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.62);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 600;
  pointer-events: none;
  z-index: 5;
  display: none;
}
.pt-app.comparing .pt-app-compare-badge { display: block; }

.pt-app-busy {
  position: absolute;
  inset: 0;
  z-index: 9;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: rgba(17, 19, 23, 0.72);
  color: #fff;
  font-size: 0.9rem;
  text-align: center;
  padding: 24px;
}
.pt-app-busy.show { display: flex; }
.pt-app-spinner {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.25);
  border-top-color: #fff;
  animation: pt-app-spin 0.8s linear infinite;
}
@keyframes pt-app-spin { to { transform: rotate(360deg); } }

/* ── Bottom bar ──────────────────────────────────────────────────────────── */
.pt-app-bottom {
  flex: none;
  background: var(--pt-app-bar);
  padding: 6px calc(10px + env(safe-area-inset-right, 0px)) calc(8px + env(safe-area-inset-bottom, 0px)) calc(10px + env(safe-area-inset-left, 0px));
}
.pt-app-param {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 4px 2px;
  font-size: 0.8rem;
  color: var(--pt-app-muted);
}
.pt-app-param[hidden] { display: none; }
/* The label is a button: double-tap puts the slider back to its default. */
.pt-app-param-label {
  flex: none;
  max-width: 34%;
  min-height: 36px;
  padding: 0 4px;
  border: 0;
  background: transparent;
  color: var(--pt-app-muted);
  font-size: 0.8rem;
  text-align: start;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pt-app-param output {
  flex: none;
  min-width: 42px;
  text-align: end;
  font-variant-numeric: tabular-nums;
  color: var(--pt-app-fg);
  font-weight: 600;
  /* "0 px" inside an Arabic bar would read "px 0": the value takes its own
     direction from its first letter, and stays LTR when it has none. */
  unicode-bidi: plaintext;
}
.pt-app-param output { cursor: text; border-radius: 6px; padding: 4px 2px; }
.pt-app-param output:active { background: var(--pt-app-press); }
.pt-app-value-input {
  width: 64px;
  height: 32px;
  padding: 0 6px;
  border: 1px solid var(--pt-app-accent);
  border-radius: 8px;
  background: #fff;
  color: #212529;
  font-size: 16px; /* under 16px iOS zooms the page to the field */
  text-align: end;
  -webkit-user-select: text;
  user-select: text;
}
/* Drawn by hand: the browser's own range input paints a white box on the dark
   bar. The thumb is finger-sized, the track is a 36px-tall hit area. */
.pt-app-range {
  flex: 1 1 auto;
  min-width: 0;
  height: 36px;
  margin: 0;
  padding: 0;
  background: transparent;
  -webkit-appearance: none;
  appearance: none;
  touch-action: none;
}
.pt-app-range:focus { outline: none; }
.pt-app-range::-webkit-slider-runnable-track {
  height: 4px;
  border-radius: 2px;
  background: linear-gradient(to right,
    rgba(255, 255, 255, 0.28) 0, rgba(255, 255, 255, 0.28) var(--pt-from, 0%),
    var(--pt-app-accent) var(--pt-from, 0%), var(--pt-app-accent) var(--pt-fill, 0%),
    rgba(255, 255, 255, 0.28) var(--pt-fill, 0%));
}
[dir="rtl"] .pt-app-range::-webkit-slider-runnable-track {
  background: linear-gradient(to left,
    rgba(255, 255, 255, 0.28) 0, rgba(255, 255, 255, 0.28) var(--pt-from, 0%),
    var(--pt-app-accent) var(--pt-from, 0%), var(--pt-app-accent) var(--pt-fill, 0%),
    rgba(255, 255, 255, 0.28) var(--pt-fill, 0%));
}
.pt-app-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 26px;
  height: 26px;
  margin-top: -11px;
  border-radius: 50%;
  background: #fff;
  border: 4px solid var(--pt-app-accent);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.45);
}
.pt-app-range::-moz-range-track { height: 4px; border-radius: 2px; background: rgba(255, 255, 255, 0.28); }
.pt-app-range::-moz-range-progress { height: 4px; border-radius: 2px; background: var(--pt-app-accent); }
.pt-app-range::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  border: 4px solid var(--pt-app-accent);
}
.pt-app-sliders[hidden], .pt-app-panels[hidden] { display: none !important; }

/* Tool panels (tools[].panel): a page element lifted into the bottom bar
   while its tool is active. Page controls are themed for the dark bar. */
.pt-app-panels { padding: 4px 2px 6px; }
.pt-app-panels > .pt-app-panel { display: none !important; }
.pt-app-panels > .pt-app-panel.pt-app-panel-on { display: block !important; opacity: 1 !important; }
.pt-app-panels > .pt-app-panel.pt-app-strip.pt-app-panel-on {
  display: flex !important;
  flex-wrap: nowrap;
  gap: 8px;
  margin: 0;
  padding: 2px 2px 4px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.pt-app-strip::-webkit-scrollbar { display: none; }
.pt-app-strip > * { flex: none; }
.pt-app-panels { color: var(--pt-app-fg); }
.pt-app-panels .text-muted, .pt-app-panels .form-label, .pt-app-panels .small { color: var(--pt-app-muted) !important; }
.pt-app-panels .btn-outline-secondary,
.pt-app-panels .btn-outline-primary,
.pt-app-panels .btn-outline-warning {
  color: var(--pt-app-fg);
  border-color: rgba(255, 255, 255, 0.22);
  background: transparent;
}
.pt-app-panels .btn-outline-secondary.active,
.pt-app-panels .btn-outline-secondary:active,
.pt-app-panels .btn-outline-primary.active {
  color: var(--pt-app-fg);
  border-color: var(--pt-app-accent);
  background: var(--pt-app-accent-soft);
}
.pt-app-panels .form-select, .pt-app-panels .form-control {
  background-color: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.18);
  color: var(--pt-app-fg);
  font-size: 16px;
}
.pt-app-panels .form-select option { color: #212529; }

/* Several sliders share the one row: chips pick which one it drives. */
.pt-app-chips {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
  padding: 2px 2px 6px;
  touch-action: pan-x;
}
.pt-app-chips::-webkit-scrollbar { display: none; }
.pt-app-chips[hidden] { display: none !important; }
.pt-app-chip {
  flex: none;
  min-height: 32px;
  padding: 0 12px;
  border: 1px solid var(--pt-app-line);
  border-radius: 999px;
  background: transparent;
  color: var(--pt-app-muted);
  font-size: 0.78rem;
  white-space: nowrap;
}
.pt-app-chip.active { background: var(--pt-app-accent-soft); border-color: transparent; color: var(--pt-app-fg); }
.pt-app-chip[hidden] { display: none; }
.pt-app-chip.changed::after {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-inline-start: 6px;
  vertical-align: 2px;
  border-radius: 50%;
  background: var(--pt-app-accent-fg);
}
.pt-app-tools {
  display: flex;
  justify-content: space-around;
  gap: 4px;
}
.pt-app-tools[hidden] { display: none; }
.pt-app-tool {
  flex: 1 1 0;
  min-width: 0;
  max-width: 96px;
  min-height: 54px;
  border: 0;
  border-radius: 14px;
  background: transparent;
  color: var(--pt-app-muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  /* No side padding: in a row of five a label gets the button's full
     width ("Background" was a pixel over and broke onto two lines). */
  padding: 4px 0;
  font-size: 0.72rem;
  line-height: 1.1;
}
/* line-height 1.3: at the button's 1.1 the clipped box cut the tails off
   g, p and y ("Settings"). */
.pt-app-tool span {
  max-width: 100%;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
/* Set by pt-app.js when a label is too long for its button even at the
   smallest size: two lines, hyphenated by the browser in the page's language. */
.pt-app-tools-wrap .pt-app-tool span {
  white-space: normal;
  text-overflow: clip;
  -webkit-hyphens: auto;
  hyphens: auto;
  overflow-wrap: anywhere;
  text-align: center;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}
.pt-app-tool svg { width: 24px; height: 24px; }
.pt-app-tool i { font-size: 24px; line-height: 1; }
.pt-app-tool:active { background: var(--pt-app-press); }
.pt-app-tool.active { background: var(--pt-app-accent-soft); color: var(--pt-app-fg); }
.pt-app-tool.active svg, .pt-app-tool.active i { color: var(--pt-app-accent-fg); }
.pt-app-tool:disabled { opacity: 0.35; }

/* ── Settings sheet ──────────────────────────────────────────────────────── */
.pt-app-sheet-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.42);
  display: none;
  z-index: 7;
}
.pt-app-sheet-backdrop.show { display: block; }
.pt-app-sheet {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  max-height: 78%;
  overflow-y: auto;
  overscroll-behavior: contain;
  touch-action: pan-y;
  background: #fff;
  color: #212529;
  border-radius: var(--pt-app-sheet-radius) var(--pt-app-sheet-radius) 0 0;
  padding: 0 calc(16px + env(safe-area-inset-right, 0px)) 16px calc(16px + env(safe-area-inset-left, 0px));
  transform: translateY(105%);
  /* Hidden once the slide-out finishes, so a closed sheet can be neither
     tapped nor tabbed into. */
  visibility: hidden;
  transition: transform 0.28s var(--pt-app-ease), visibility 0s linear 0.28s;
  z-index: 8;
  -webkit-user-select: auto;
  user-select: auto;
  -webkit-touch-callout: default;
}
.pt-app-sheet.open {
  transform: none;
  visibility: visible;
  transition: transform 0.28s var(--pt-app-ease);
}
.pt-app-sheet.dragging { transition: none; }
.pt-app-sheet-head {
  position: sticky;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 0 10px;
  background: #fff;
  z-index: 2;
  touch-action: none;
}
/* Drag handle: pull the sheet down to close it. */
.pt-app-sheet-head::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 7px;
  width: 36px;
  height: 4px;
  margin-left: -18px;
  border-radius: 2px;
  background: #ced4da;
}
.pt-app-sheet-title { font-weight: 700; font-size: 1rem; margin: 0; color: #212529; }
.pt-app-sheet-done {
  flex: none;
  min-height: 36px;
  padding: 0 20px;
  border: 0;
  border-radius: 999px;
  background: var(--pt-app-accent);
  color: #fff;
  font-weight: 600;
  font-size: 0.9rem;
}
.pt-app-sheet-foot {
  display: flex;
  gap: 8px;
  padding-top: 14px;
  margin-top: 8px;
  border-top: 1px solid #e9ecef;
}
.pt-app-sheet-foot[hidden] { display: none; }
.pt-app-sheet-foot .btn { flex: 1 1 0; min-height: 44px; }
/* Three or four actions (a tool's own, after New Photo and Reset): two to a
   row rather than squeezed past the edge of a phone. */
.pt-app-sheet-foot { flex-wrap: wrap; }
.pt-app-sheet-foot:has(> .btn:nth-child(3)) > .btn { flex: 1 1 calc(50% - 4px); }
/* Desktop duplicates (Save, Undo, zoom rows …) the shell already offers. */
.pt-app-sheet .pt-app-hide { display: none !important; }
.pt-app-sheet input[type=range].form-range { height: 36px; }
.pt-app-sheet .form-select, .pt-app-sheet .form-control { min-height: 44px; font-size: 16px; } /* no iOS zoom on focus */
.pt-app-sheet .btn { min-height: 44px; }
.pt-app-sheet .form-check-input { width: 1.25em; height: 1.25em; }

/* Landscape phone: one slim bar, so the photo keeps most of the height. */
@media (orientation: landscape) and (max-height: 540px) {
  .pt-app-top { padding-top: calc(4px + env(safe-area-inset-top, 0px)); padding-bottom: 4px; }
  .pt-app-iconbtn { height: 40px; }
  .pt-app-bottom { display: flex; align-items: center; gap: 10px; padding-top: 4px; }
  .pt-app-bottom > .pt-app-sliders { flex: 1 1 auto; min-width: 0; display: flex; align-items: center; gap: 8px; }
  .pt-app-bottom > .pt-app-sliders > .pt-app-param { flex: 1 1 auto; min-width: 0; padding: 0; }
  .pt-app-bottom > .pt-app-sliders > .pt-app-chips { flex: none; max-width: 40%; padding: 0; order: -1; }
  .pt-app-tools { flex: none; }
  .pt-app-tool { flex: none; width: auto; max-width: none; min-width: 58px; min-height: 46px; padding: 4px 8px; }
  .pt-app-sheet { max-height: 92%; }
}

/* Phone page between editing sessions: the photo is a picture on the page,
   not a work surface. A tap on it reopens the editor. */
.pt-app-reopen {
  display: none;
  gap: 8px;
  width: 100%;
  align-self: stretch;
  margin-top: 10px;
}
html.pt-phone:not(.pt-app-open) .pt-app-reopen.ready { display: flex; flex-wrap: wrap; }
/* Side by side while both labels fit; a long one ("Schema speichern",
   "Сохранить схему") puts each on a full row instead of off the screen. */
.pt-app-reopen .btn { flex: 1 1 auto; min-width: 0; max-width: 100%; white-space: normal; min-height: 48px; font-weight: 600; }
html.pt-phone:not(.pt-app-open) .pt-app-viewport-home.pt-app-loaded { cursor: pointer; }
/* ...and a swipe on it scrolls the page. The tools' canvases are
   touch-action: none for their own drags and pinches, which the shell holds
   off here anyway; without this the picture, most of a phone's screen, would
   be a dead spot for scrolling. */
html.pt-phone:not(.pt-app-open) .pt-app-viewport-home.pt-app-loaded,
html.pt-phone:not(.pt-app-open) .pt-app-viewport-home.pt-app-loaded * { touch-action: pan-y pinch-zoom !important; }

/* ── "Your photo is ready" (PTApp.deliver on a phone) ─────────────────────── */
.pt-export {
  position: fixed;
  inset: 0;
  z-index: calc(var(--pt-app-z) + 2);
  display: flex;
  align-items: flex-end;
  background: rgba(0, 0, 0, 0.5);
  -webkit-tap-highlight-color: transparent;
}
.pt-export-panel {
  width: 100%;
  max-height: 92%;
  overflow-y: auto;
  overscroll-behavior: contain;
  background: #fff;
  color: #212529;
  border-radius: var(--pt-app-sheet-radius) var(--pt-app-sheet-radius) 0 0;
  padding: 10px calc(16px + env(safe-area-inset-right, 0px)) calc(16px + env(safe-area-inset-bottom, 0px)) calc(16px + env(safe-area-inset-left, 0px));
  animation: pt-export-in 0.24s var(--pt-app-ease);
}
@keyframes pt-export-in { from { transform: translateY(40px); opacity: 0; } }
.pt-export-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 44px; }
.pt-export-title { font-size: 1.05rem; font-weight: 700; margin: 0; color: #212529; }
.pt-export-x {
  flex: none;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: #495057;
  display: flex;
  align-items: center;
  justify-content: center;
}
.pt-export-x svg { width: 22px; height: 22px; }
.pt-export-preview {
  display: block;
  max-width: 100%;
  max-height: 46vh;
  margin: 6px auto 8px;
  border-radius: 10px;
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.15);
  background: repeating-conic-gradient(#eee 0 25%, #fff 0 50%) 50% / 16px 16px;
  -webkit-touch-callout: default;
  -webkit-user-select: auto;
  user-select: auto;
}
/* Several photos (PTApp.deliverAll): the pieces in their grid. */
.pt-export-grid {
  display: grid;
  gap: 4px;
  max-height: 46vh;
  overflow-y: auto;
  margin: 6px 0 8px;
}
.pt-export-grid img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 6px;
  background: repeating-conic-gradient(#eee 0 25%, #fff 0 50%) 50% / 12px 12px;
  -webkit-touch-callout: default;
}
.pt-export-meta { text-align: center; font-size: 0.8rem; color: #6c757d; word-break: break-all; }
.pt-export-tip { text-align: center; font-size: 0.8rem; color: #495057; margin: 6px 0 0; }
.pt-export-actions { display: flex; gap: 10px; margin-top: 14px; }
.pt-export-actions .btn { flex: 1 1 0; min-height: 48px; font-weight: 600; display: flex; align-items: center; justify-content: center; gap: 8px; }
.pt-export-actions .btn svg { width: 20px; height: 20px; }

@media (prefers-reduced-motion: reduce) {
  .pt-export-panel { animation: none; }
  .pt-app-sheet, .pt-app-sheet.open, .pt-app-hint { transition: none; }
  .pt-app-spinner { animation-duration: 2s; }
}
