/* Tools Website — shared stylesheet
   Clean light design: white cards on a very light grey page, one coral-red
   accent. Mobile-first, no external fonts or libraries.
   Dark mode via [data-theme="dark"]. */

:root {
  --bg: #f6f7f9;
  --header-bg: #ffffff;
  --surface: #ffffff;
  --surface-2: #eef0f4;
  --text: #1d2330;
  --muted: #5f6875;
  --border: #e3e6ec;
  --border-hover: #f0b3b0;
  --primary: #e5322d;
  --primary-hover: #c9271f;
  --primary-contrast: #ffffff;
  --accent: #1f9d57;
  --badge-bg: #fff3d1;
  --badge-text: #856100;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.05), 0 1px 3px rgba(16, 24, 40, 0.04);
  --shadow: 0 2px 6px rgba(16, 24, 40, 0.05), 0 10px 24px rgba(16, 24, 40, 0.05);
  --shadow-lg: 0 6px 14px rgba(16, 24, 40, 0.08), 0 18px 38px rgba(16, 24, 40, 0.12);
  --header-shadow: 0 1px 0 rgba(16, 24, 40, 0.04), 0 4px 16px rgba(16, 24, 40, 0.05);
  --radius: 16px;
  --max-width: 1200px;
}

[data-theme="dark"] {
  --bg: #10131a;
  --header-bg: #161a22;
  --surface: #1a1f29;
  --surface-2: #242b37;
  --text: #eceef3;
  --muted: #9aa3b2;
  --border: #272e3b;
  --border-hover: #6e3532;
  --primary: #ff6f68;
  --primary-hover: #ff8a84;
  --primary-contrast: #1a0505;
  --accent: #4ade80;
  --badge-bg: #3a2f10;
  --badge-text: #fcd34d;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.35);
  --shadow: 0 2px 6px rgba(0, 0, 0, 0.35), 0 10px 24px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 6px 14px rgba(0, 0, 0, 0.4), 0 18px 38px rgba(0, 0, 0, 0.45);
  --header-shadow: 0 1px 0 rgba(0, 0, 0, 0.4), 0 4px 16px rgba(0, 0, 0, 0.35);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  line-height: 1.6;
  font-size: 16px;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 20px;
}

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--header-bg);
  box-shadow: var(--header-shadow);
}
.header-inner {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  padding-top: 11px;
  padding-bottom: 11px;
}
.logo {
  font-size: 1.32rem;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.02em;
}
.logo:hover { text-decoration: none; }
.logo span { color: var(--primary); }
.main-nav {
  display: flex;
  gap: 2px;
  flex-wrap: wrap;
  margin-left: auto;
}
.main-nav a {
  color: var(--text);
  padding: 8px 11px;
  border-radius: 999px;
  font-size: 0.95rem;
  font-weight: 500;
}
.main-nav a:hover { background: var(--surface-2); color: var(--primary); text-decoration: none; }
.theme-toggle {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  border-radius: 999px;
  padding: 7px 12px;
  cursor: pointer;
  font-size: 0.95rem;
  line-height: 1;
}
.theme-toggle:hover { background: var(--surface-2); border-color: var(--border-hover); }
.theme-toggle:focus-visible, .pill:focus-visible, .tool-card:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* ---------- Hero ---------- */
.hero {
  padding: 54px 0 10px;
  text-align: center;
}
.hero h1 {
  font-size: 2.15rem;
  line-height: 1.15;
  font-weight: 800;
  letter-spacing: -0.03em;
  max-width: 840px;
  margin: 0 auto 16px;
}
.hero h1 .hl { color: var(--primary); }
.hero p {
  color: var(--muted);
  font-size: 1.12rem;
  max-width: 660px;
  margin: 0 auto 28px;
}
.search-bar {
  max-width: 620px;
  margin: 0 auto;
}
.search-bar input {
  width: 100%;
  padding: 16px 24px;
  font-size: 1.06rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow);
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.search-bar input::placeholder { color: var(--muted); }
.search-bar input:focus {
  border-color: var(--primary);
  box-shadow: var(--shadow), 0 0 0 4px rgba(229, 50, 45, 0.14);
}
.search-empty {
  text-align: center;
  color: var(--muted);
  padding: 10px 0 26px;
  font-size: 1rem;
}

/* ---------- Tools section: pills + grid ---------- */
.tools-section { padding-top: 30px; }
.tools-heading {
  text-align: center;
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 0 0 8px;
}
.tools-intro {
  text-align: center;
  margin-left: auto;
  margin-right: auto;
}
.filter-pills {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 9px;
  margin: 20px 0 30px;
}
.pill {
  appearance: none;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  border-radius: 999px;
  padding: 9px 18px;
  font: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}
.pill:hover { border-color: var(--primary); color: var(--primary); transform: translateY(-1px); }
.pill.is-active {
  background: var(--primary);
  border-color: var(--primary);
  color: #ffffff;
  box-shadow: 0 6px 16px rgba(229, 50, 45, 0.28);
}
.pill.is-active:hover { color: #ffffff; }

.tool-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  margin-bottom: 26px;
}
.tool-card {
  display: block;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 22px;
  color: var(--text);
  box-shadow: var(--shadow-sm);
  position: relative;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}
a.tool-card:hover {
  text-decoration: none;
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--border-hover);
}
.tool-card .icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: var(--chip, var(--surface-2));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.55rem;
  line-height: 1;
  margin-bottom: 15px;
  box-shadow: 0 4px 10px rgba(16, 24, 40, 0.14), inset 0 0 0 1px rgba(255, 255, 255, 0.16);
}
.tool-card .icon svg {
  width: 26px;
  height: 26px;
  stroke: #ffffff;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.tool-card h3 { margin: 0 0 6px; font-size: 1.09rem; font-weight: 700; letter-spacing: -0.01em; }
.tool-card p { margin: 0; color: var(--muted); font-size: 0.94rem; line-height: 1.55; }
.tool-card.is-soon { opacity: 0.88; }
.badge-soon {
  position: absolute;
  top: 14px;
  right: 14px;
  background: var(--badge-bg);
  color: var(--badge-text);
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 3px 9px;
  border-radius: 999px;
}

/* ---------- Trust strip ---------- */
.trust-strip {
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}
.trust-strip .container {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 30px;
  justify-content: center;
  padding-top: 15px;
  padding-bottom: 15px;
  font-weight: 600;
  font-size: 0.98rem;
}
.trust-strip .dot { color: var(--accent); }

/* ---------- Sections & content pages ---------- */
.section { padding: 36px 0 8px; }
.section h2 {
  font-size: 1.5rem;
  letter-spacing: -0.01em;
  margin: 0 0 6px;
}
.section .section-intro { color: var(--muted); margin: 0 0 18px; max-width: 760px; }
.section .view-all { font-weight: 600; }

.breadcrumbs {
  font-size: 0.9rem;
  color: var(--muted);
  padding: 20px 0 0;
}
.breadcrumbs a { color: var(--muted); }
.breadcrumbs a:hover { color: var(--primary); }
.breadcrumbs .sep { margin: 0 6px; }

.page { padding: 10px 0 44px; }
.page h1 { font-size: 1.95rem; letter-spacing: -0.02em; margin: 12px 0 10px; }
.page h2 { font-size: 1.3rem; margin: 28px 0 8px; }
.page p, .page li { max-width: 780px; }
.lede { color: var(--muted); font-size: 1.06rem; max-width: 780px; }

.notice {
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  background: var(--surface);
  border-radius: 10px;
  padding: 14px 16px;
  max-width: 780px;
  margin: 18px 0;
  box-shadow: var(--shadow-sm);
}
.notice strong { color: var(--accent); }

.chip-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0; }
.chip {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 999px;
  padding: 6px 13px;
  font-size: 0.9rem;
  font-weight: 600;
}
a.chip:hover { border-color: var(--primary); color: var(--primary); text-decoration: none; }

/* ---------- FAQ ---------- */
.faq { padding-bottom: 34px; }
.faq details {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  padding: 6px 18px;
  margin-bottom: 10px;
  max-width: 880px;
}
.faq summary {
  cursor: pointer;
  font-weight: 600;
  padding: 11px 0;
}
.faq summary:hover { color: var(--primary); }
.faq details p { color: var(--muted); margin: 0 0 13px; }

/* ---------- Forms ---------- */
.contact-form { max-width: 560px; display: grid; gap: 14px; margin-top: 18px; }
.contact-form label { font-weight: 600; display: grid; gap: 6px; }
.contact-form input,
.contact-form textarea {
  padding: 11px 13px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
}
.contact-form input:focus,
.contact-form textarea:focus {
  border-color: var(--primary);
  outline: none;
  box-shadow: 0 0 0 4px rgba(229, 50, 45, 0.13);
}
.btn {
  display: inline-block;
  background: var(--primary);
  color: var(--primary-contrast);
  border: none;
  border-radius: 10px;
  padding: 12px 26px;
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  justify-self: start;
  box-shadow: 0 6px 16px rgba(229, 50, 45, 0.25);
  transition: background 0.15s ease, transform 0.15s ease;
}
.btn:hover { background: var(--primary-hover); text-decoration: none; transform: translateY(-1px); }
[data-theme="dark"] .btn { color: #ffffff; }

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--border);
  background: var(--header-bg);
  margin-top: 48px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 22px;
  padding-top: 34px;
  padding-bottom: 12px;
}
.site-footer h3 { margin: 0 0 10px; font-size: 1rem; }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 7px; }
.site-footer a { color: var(--muted); }
.site-footer a:hover { color: var(--primary); }
.footer-bottom {
  border-top: 1px solid var(--border);
  padding: 15px 0 22px;
  color: var(--muted);
  font-size: 0.9rem;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  justify-content: space-between;
}

/* ---------- Responsive ---------- */
@media (min-width: 620px) {
  .tool-grid { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: repeat(3, 1fr); }
  .hero h1 { font-size: 2.6rem; }
}
@media (min-width: 920px) {
  .tool-grid { grid-template-columns: repeat(3, 1fr); }
  .hero { padding: 72px 0 14px; }
  .hero h1 { font-size: 3.15rem; }
  .tools-heading { font-size: 2rem; }
}
@media (min-width: 1200px) {
  .tool-grid { grid-template-columns: repeat(4, 1fr); }
}

/* ---------- Tool box (compress tool) ---------- */
.tool-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px;
  margin: 20px 0 8px;
  max-width: 880px;
}
.dropzone {
  border: 2px dashed var(--border-hover);
  border-radius: var(--radius);
  background: var(--bg);
  text-align: center;
  padding: 40px 22px 32px;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}
.dropzone:hover, .dropzone:focus-visible {
  border-color: var(--primary);
  outline: none;
  box-shadow: 0 0 0 4px rgba(229, 50, 45, 0.12);
}
.dropzone.is-dragover {
  border-color: var(--primary);
  background: var(--surface);
  box-shadow: 0 0 0 5px rgba(229, 50, 45, 0.16);
}
.dropzone-icon { font-size: 2.6rem; line-height: 1; margin-bottom: 10px; }
.dropzone-title { font-size: 1.2rem; font-weight: 700; margin: 0 0 4px; }
.dropzone-sub { color: var(--muted); margin: 0 0 14px; }
.dropzone-link { color: var(--primary); font-weight: 700; text-decoration: underline; }
.dropzone-note, .privacy-note { color: var(--muted); font-size: 0.9rem; margin: 0; }

.preview-grid, .result-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  align-items: start;
}
.preview-card {
  margin: 0;
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  background: var(--surface-2);
}
.preview-card img {
  display: block;
  width: 100%;
  max-height: 340px;
  object-fit: contain;
  background:
    repeating-conic-gradient(rgba(127, 127, 127, 0.14) 0% 25%, transparent 0% 50%) 0 0 / 22px 22px;
}
.preview-card figcaption {
  padding: 10px 14px;
  font-size: 0.9rem;
  color: var(--muted);
  background: var(--surface);
  border-top: 1px solid var(--border);
  word-break: break-word;
}
.controls-card { display: grid; gap: 12px; align-content: start; }
.target-label { font-weight: 700; font-size: 1.02rem; }
.target-row { display: flex; align-items: center; gap: 10px; }
.target-input {
  width: 130px;
  padding: 12px 14px;
  font: inherit;
  font-size: 1.15rem;
  font-weight: 700;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
}
.target-input:focus {
  border-color: var(--primary);
  outline: none;
  box-shadow: 0 0 0 4px rgba(229, 50, 45, 0.13);
}
.target-unit { font-weight: 700; color: var(--muted); font-size: 1.05rem; }
.preset-chips { margin: 0; }
button.chip { font: inherit; cursor: pointer; }
.preset-chip.is-active {
  background: var(--primary);
  border-color: var(--primary);
  color: #ffffff;
}
.preset-chip.is-active:hover { color: #ffffff; }
.already-note { margin: 0; max-width: none; }
.btn-big {
  justify-self: stretch;
  text-align: center;
  padding: 15px 26px;
  font-size: 1.08rem;
}
.btn[disabled] { opacity: 0.6; cursor: wait; transform: none; }
.tool-status { margin: 0; color: var(--muted); font-size: 0.95rem; min-height: 1.2em; }

.result-panel {
  margin-top: 22px;
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 20px;
  box-shadow: var(--shadow-sm);
}
.result-title { margin: 0 0 16px; font-size: 1.2rem; }
.result-stats { display: grid; gap: 9px; align-content: start; }
.stat-row {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  border-bottom: 1px dashed var(--border);
  padding-bottom: 7px;
  font-size: 0.97rem;
}
.stat-row span { color: var(--muted); }
.stat-row strong { text-align: right; }
.btn-download {
  justify-self: stretch;
  text-align: center;
  margin-top: 8px;
  padding: 15px 26px;
  font-size: 1.08rem;
}
.btn-ghost {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  box-shadow: none;
  justify-self: stretch;
  text-align: center;
}
.btn-ghost:hover { background: var(--surface-2); color: var(--primary); border-color: var(--border-hover); }
[data-theme="dark"] .btn-ghost { color: var(--text); }

.howto-steps { max-width: 780px; }
.howto-steps li { margin-bottom: 9px; }

/* ---------- Specs table ---------- */
.table-wrap { overflow-x: auto; margin: 16px 0 6px; max-width: 880px; }
.specs-table {
  border-collapse: collapse;
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  font-size: 0.95rem;
}
.specs-table th, .specs-table td {
  text-align: left;
  padding: 11px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.specs-table thead th {
  background: var(--surface-2);
  font-weight: 700;
  white-space: nowrap;
}
.specs-table tbody tr:last-child td { border-bottom: none; }

/* ---------- Share buttons ---------- */
.share-row { display: flex; flex-wrap: wrap; gap: 10px; margin: 14px 0 6px; }
.share-btn {
  display: inline-block;
  padding: 11px 20px;
  border-radius: 999px;
  font-weight: 700;
  color: #ffffff;
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s ease, filter 0.15s ease;
}
.share-btn:hover { text-decoration: none; transform: translateY(-1px); filter: brightness(1.07); color: #ffffff; }
.share-wa { background: #1fae55; }
.share-fb { background: #1877f2; }

/* ---------- Tool layout: wider screens ---------- */
@media (min-width: 641px) {
  .preview-grid, .result-grid { grid-template-columns: 1fr 1fr; }
  .tool-box { padding: 28px; }
}

/* ---------- Responsive standard (site-wide) ----------
   Breakpoints: mobile <= 640px, tablet 641–1024px, laptop/desktop > 1024px.
   Rules: no horizontal scrolling, controls >= 44px touch targets and
   >= 14px text, single-column stacking on mobile, tool box above the fold. */
img, video, svg { max-width: 100%; }
.chip, button.chip {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}
.btn { min-height: 48px; }
.theme-toggle { min-height: 44px; }
.main-nav a { display: inline-flex; align-items: center; min-height: 44px; }
.target-input { min-height: 48px; }
.table-wrap {
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}
.specs-table { min-width: 560px; } /* scrolls inside .table-wrap instead of crushing */

@media (max-width: 640px) {
  /* Keep the tool box above the fold: tighten everything above it. */
  .breadcrumbs { padding-top: 12px; }
  .page { padding-top: 2px; }
  .page h1 { font-size: 1.55rem; margin: 8px 0 6px; }
  .lede { font-size: 0.98rem; }
  .tool-box { padding: 16px; margin-top: 14px; }
  .dropzone { padding: 26px 14px 20px; }
  .dropzone-icon { font-size: 2.1rem; margin-bottom: 6px; }
  .dropzone-title { font-size: 1.08rem; }
  .preview-card img { max-height: 260px; }
  .preview-grid, .result-grid { grid-template-columns: 1fr; }
  .btn-big, .btn-download, .btn-ghost { width: 100%; justify-self: stretch; }
  .target-input { width: 112px; font-size: 1.05rem; }
  .stat-row { flex-wrap: wrap; }
  .stat-row strong { text-align: left; }
  .share-btn { flex: 1 1 100%; text-align: center; }
  .result-panel { padding: 16px; }
}

@media (min-width: 641px) and (max-width: 1024px) {
  /* Tablet: two-column tool layout already applies from 641px;
     give content a little more air without going full desktop. */
  .tool-box { padding: 24px; }
  .container { padding: 0 24px; }
}

/* ---------- Photo & Signature Resizer (tool 2) ---------- */
.mode-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 18px;
}
.mode-tab {
  flex: 1 1 0;
  appearance: none;
  font: inherit;
  font-weight: 700;
  font-size: 1rem;
  min-height: 48px;
  padding: 11px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.mode-tab:hover { border-color: var(--primary); color: var(--primary); }
.mode-tab.is-active {
  background: var(--primary);
  border-color: var(--primary);
  color: #ffffff;
  box-shadow: 0 6px 16px rgba(229, 50, 45, 0.25);
}
.mode-tab.is-active:hover { color: #ffffff; }
.mode-tab:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.fr-orig-meta {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 0.95rem;
  word-break: break-word;
}

/* Crop stage: the image fills the width; the crop box floats over it and
   everything outside the box is dimmed with a giant box-shadow. */
.crop-stage {
  position: relative;
  width: 100%;
  overflow: hidden;
  border-radius: 12px;
  border: 1px solid var(--border);
  background:
    repeating-conic-gradient(rgba(127, 127, 127, 0.12) 0% 25%, transparent 0% 50%) 0 0 / 22px 22px;
  line-height: 0;
}
.crop-stage img {
  display: block;
  width: 100%;
  height: auto;
  user-select: none;
  -webkit-user-drag: none;
}
.crop-box {
  position: absolute;
  border: 2px solid var(--primary);
  box-shadow: 0 0 0 9999px rgba(8, 10, 14, 0.55);
  cursor: move;
  touch-action: none;
  background-image:
    linear-gradient(to right, transparent calc(33.33% - 0.5px), rgba(255, 255, 255, 0.45) 33.33%, transparent calc(33.33% + 0.5px)),
    linear-gradient(to right, transparent calc(66.66% - 0.5px), rgba(255, 255, 255, 0.45) 66.66%, transparent calc(66.66% + 0.5px)),
    linear-gradient(to bottom, transparent calc(33.33% - 0.5px), rgba(255, 255, 255, 0.45) 33.33%, transparent calc(33.33% + 0.5px)),
    linear-gradient(to bottom, transparent calc(66.66% - 0.5px), rgba(255, 255, 255, 0.45) 66.66%, transparent calc(66.66% + 0.5px));
}
.crop-handle {
  position: absolute;
  right: 5px;
  bottom: 5px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--primary);
  border: 3px solid #ffffff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
  cursor: nwse-resize;
  touch-action: none;
}
.crop-handle::after {
  content: "⤡";
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-size: 17px;
  font-weight: 700;
  line-height: 1;
}
.fr-crop-hint {
  color: var(--muted);
  font-size: 0.92rem;
  margin: 10px 0 14px;
}
.fr-sig-tip { margin: 0 0 16px; max-width: none; }

.fr-controls { margin-top: 4px; }
.fr-custom {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 12px;
}
.fr-custom[hidden] { display: none; }
.fr-custom label {
  display: grid;
  gap: 5px;
  font-weight: 600;
  font-size: 0.92rem;
}
.fr-custom input {
  width: 100%;
  min-height: 48px;
  padding: 10px 12px;
  font: inherit;
  font-size: 1rem;
  font-weight: 600;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
}
.fr-custom input:focus {
  border-color: var(--primary);
  outline: none;
  box-shadow: 0 0 0 4px rgba(229, 50, 45, 0.13);
}
.fr-preset-spec {
  margin: 0;
  font-weight: 700;
  font-size: 0.98rem;
  color: var(--text);
  background: var(--surface-2);
  border: 1px dashed var(--border-hover);
  border-radius: 10px;
  padding: 9px 13px;
}
.fr-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.fr-actions .btn { flex: 1 1 auto; text-align: center; }

/* In-band / warning status line in the result panel */
.band-status {
  border-radius: 10px;
  padding: 11px 14px;
  font-weight: 700;
  font-size: 0.98rem;
  border: 1px solid var(--border);
  background: var(--surface-2);
}
.band-status.is-ok {
  border-color: var(--accent);
  background: rgba(31, 157, 87, 0.1);
  color: var(--accent);
}
[data-theme="dark"] .band-status.is-ok { background: rgba(74, 222, 128, 0.12); }
.band-status.is-warn {
  border-color: #d97706;
  background: rgba(217, 119, 6, 0.1);
  color: #b45309;
}
[data-theme="dark"] .band-status.is-warn { color: #fbbf24; background: rgba(251, 191, 36, 0.1); }
.pad-note {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

/* Tool 2 responsive: same standard as the rest of the site. */
@media (max-width: 640px) {
  .mode-tab { font-size: 0.95rem; padding: 10px 8px; }
  .fr-custom { grid-template-columns: 1fr; }
  .fr-actions { flex-direction: column; }
  .fr-actions .btn { width: 100%; }
  .crop-handle { width: 38px; height: 38px; }
}
@media (min-width: 641px) and (max-width: 1024px) {
  .crop-stage { max-width: 640px; }
}
/* ---------- Signature Resizer (tool 3) ----------
   No new rules: the standalone Signature Resizer reuses the Tool 2 crop
   workspace markup and classes verbatim (dropzone, crop-stage, crop-box,
   fr-custom, fr-actions, band-status, pad-note) plus the Tool 1 result
   panel, so the Tool 2 block above and the site-wide responsive standard
   (chips/buttons >= 44px, crop-stage caps, single-column mobile) already
   cover it at 375 / 768 / 1280 px. */

@media (min-width: 1025px) {
  .crop-stage { max-width: 720px; }
}

/* Passport Photo Maker — face guide inside the crop frame, background
   colour dots on chips, and the print-sheet block in the result panel.
   The guide is pointer-events:none so it never interferes with the
   crop drag/resize handling. */
.crop-guide {
  position: absolute;
  left: 50%;
  top: 46%;
  width: 62%;
  height: 72%;
  transform: translate(-50%, -50%);
  border: 2px dashed rgba(255, 255, 255, 0.9);
  box-shadow:
    0 0 0 2px rgba(0, 0, 0, 0.22),
    inset 0 0 0 2px rgba(0, 0, 0, 0.22);
  border-radius: 50%;
  pointer-events: none;
}
.crop-guide-line {
  position: absolute;
  left: 7%;
  right: 7%;
  bottom: 12%;
  border-top: 2px dashed rgba(255, 255, 255, 0.75);
  box-shadow: 0 -1px 0 rgba(0, 0, 0, 0.18);
  pointer-events: none;
}
.bg-dot {
  display: inline-block;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 1px solid rgba(0, 0, 0, 0.28);
  margin-right: 7px;
  vertical-align: -2px;
}
.sheet-block {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}
.sheet-block .target-label { display: block; margin-bottom: 8px; }
.sheet-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }

/* Add Name & Date on Photo — live preview of the printed strip. */
.nd-strip-preview {
  display: block;
  width: 260px;
  max-width: 100%;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #ffffff;
  margin: 6px 0 4px;
}

/* Joiner slots (Photo & Signature Joiner) */
.joiner-slot + .joiner-slot { margin-top: 1.5rem; }

.slot-title { font-size: 1.08rem; margin: 0 0 0.6rem; }

/* Image to PDF item list */
.pdf-items { display: grid; gap: 8px; margin-top: 14px; }

.pdf-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 8px 10px;
}

.pdf-item-thumb {
  width: 52px;
  height: 52px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--border);
  flex: none;
}

.pdf-item-info { display: grid; gap: 2px; min-width: 0; flex: 1; }

.pdf-item-info strong {
  font-size: 0.95rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pdf-item-info span { color: var(--muted); font-size: 0.85rem; }

.pdf-item-actions { display: flex; gap: 6px; flex: none; }

.pdf-item-btn { min-width: 40px; min-height: 40px; padding: 6px 8px; }

.result-meta-line { color: var(--muted); margin: 2px 0 0; }
