/* pdf2kit design system. Adapted from the screenrecording.app site:
   light theme, glass panels, pill buttons, red primary, cyan accents.
   Light-only by design, same as the reference. */

:root {
  color-scheme: light;
  --bg: #f4f8fc;
  --panel: rgba(255, 255, 255, 0.94);
  --ink: #102033;
  --muted: #5b6b7e;
  --accent: #00beff;
  --accent-strong: #009fd8;
  --accent-text: #0f7ea8;
  --brand-red: #ff5a4f;
  --brand-red-strong: #e94a40;
  --success-green: #16c784;
  --success-green-strong: #0faa70;
  --action-blue: #1e73e6;
  --action-blue-strong: #1560cc;
  --danger: #e03b2f;
  --line: rgba(16, 32, 51, 0.1);
  --shadow: 0 24px 60px rgba(46, 78, 114, 0.12);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  color: var(--ink);
  background: linear-gradient(180deg, #fcfeff 0%, var(--bg) 100%);
}

section[id] {
  scroll-margin-top: 18px;
}

h1,
h2,
p {
  margin-top: 0;
}

/* ----------------------------- top nav ----------------------------- */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 22px;
  background: rgba(252, 254, 255, 0.82);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
}

.site-nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--ink);
  font-weight: 750;
  letter-spacing: -0.02em;
}

.site-nav-brand img {
  display: block;
  width: 28px;
  height: 28px;
  border-radius: 22%;
}

.site-nav-links {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-left: 8px;
}

.site-nav-links a {
  padding: 8px 12px;
  border-radius: 999px;
  color: var(--muted);
  text-decoration: none;
  font-weight: 600;
  transition: background 150ms ease, color 150ms ease;
}

.site-nav-links a:hover {
  background: rgba(16, 32, 51, 0.06);
  color: var(--accent-strong);
}

.site-nav-cta {
  margin-left: auto;
  padding: 10px 18px;
  border-radius: 999px;
  background: var(--brand-red);
  color: #fff;
  text-decoration: none;
  font-weight: 700;
  transition: background 150ms ease, transform 150ms ease;
}

.site-nav-cta:hover {
  background: var(--brand-red-strong);
  transform: translateY(-1px);
}

/* ----------------------------- layout ----------------------------- */
.app-shell {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 40px 0 56px;
}

.hero {
  padding: 40px 0 26px;
}

/* Two-column hero (text left, visual right). Homepage only, via .hero-split.
   Plain .hero (the /vs pages) stays a normal stacked header. */
.hero-split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 360px);
  align-items: center;
  gap: 48px;
}

.hero-visual svg {
  display: block;
  width: 100%;
  height: auto;
}

@media (max-width: 900px) {
  .hero-split {
    grid-template-columns: 1fr;
    gap: 0;
  }
  .hero-visual {
    display: none;
  }
}

.eyebrow {
  margin: 0 0 16px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.78rem;
  font-weight: 700;
}

.hero h1 {
  max-width: 16ch;
  margin-bottom: 22px;
  font-size: clamp(2.4rem, 5vw, 4.4rem);
  line-height: 1.05;
  letter-spacing: -0.04em;
}

.hero .subtitle {
  max-width: 720px;
  margin: 0;
  color: var(--muted);
  font-size: 1.12rem;
  line-height: 1.7;
}

.hero-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}

.hero-badges span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 9px 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #ffffff;
  color: var(--ink);
  font-weight: 650;
  line-height: 1.2;
  box-shadow: 0 1px 2px rgba(16, 32, 51, 0.05);
}

.hero-badges svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: var(--muted);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.hero-badges .badge-privacy svg {
  stroke: #16a34a;
}

/* ----------------------------- panels ----------------------------- */
.panel {
  padding: 28px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.panel + .panel {
  margin-top: 24px;
}

h2 {
  margin-bottom: 10px;
  font-size: clamp(1.5rem, 3vw, 2rem);
  letter-spacing: -0.03em;
}

.section-intro {
  max-width: 720px;
  margin: 0 0 22px;
  color: var(--muted);
  line-height: 1.7;
}

/* --------------------------- buttons --------------------------- */
button,
.btn {
  border: 0;
  border-radius: 999px;
  padding: 13px 20px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  color: var(--ink);
  background: rgba(16, 32, 51, 0.06);
  transition: transform 150ms ease, background 150ms ease, box-shadow 150ms ease, opacity 150ms ease;
}

button:hover,
.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(13, 119, 255, 0.12);
}

button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
  pointer-events: none;
}

.primary {
  background: var(--brand-red);
  color: #fff;
  font-size: 1.1rem;
  font-weight: 700;
  padding: 15px 26px;
}

.primary:hover {
  background: var(--brand-red-strong);
}

.success {
  background: var(--success-green);
  color: #fff;
  box-shadow: 0 14px 28px rgba(22, 199, 132, 0.22);
}

.success:hover {
  background: var(--success-green-strong);
}

.danger {
  background: rgba(224, 59, 47, 0.12);
  color: #b3261e;
}

.danger:hover {
  background: rgba(224, 59, 47, 0.18);
}

.ghost {
  background: transparent;
  border: 1px solid var(--line);
}

/* --------------------------- workspace --------------------------- */
.workspace-panel {
  border: 2px solid rgba(255, 90, 79, 0.55);
}

.workspace-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
  margin-bottom: 18px;
}

.workspace-head p {
  margin: 0;
  color: var(--muted);
}

.restore-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  padding: 14px 16px;
  border: 1px solid rgba(245, 163, 33, 0.28);
  border-radius: 14px;
  background: rgba(245, 163, 33, 0.12);
  color: #8c4d00;
  font-weight: 600;
}

.restore-actions {
  display: flex;
  gap: 8px;
}

.dropzone {
  display: grid;
  place-items: center;
  padding: 46px 24px;
  border: 2px dashed rgba(16, 32, 51, 0.18);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.55);
  text-align: center;
  transition: border-color 150ms ease, background 150ms ease;
}

.dropzone.is-dragover {
  border-color: var(--brand-red);
  background: rgba(255, 90, 79, 0.06);
}

.dropzone-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.dropzone-icon {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  margin-bottom: 14px;
  border-radius: 20px;
  background: rgba(0, 190, 255, 0.12);
  color: var(--accent-strong);
}

.dropzone-icon svg {
  width: 32px;
  height: 32px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.dropzone h3 {
  margin: 0 0 6px;
  font-size: 1.5rem;
  letter-spacing: -0.02em;
}

.dropzone p {
  margin: 0 0 18px;
  color: var(--muted);
}

.quick-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 20px;
}

.quick-action {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  font-size: 0.92rem;
  border: 1px solid var(--line);
  background: #fff;
}

.quick-action svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  color: var(--accent-strong);
}

/* toolbar shown once pages exist */
.workspace-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 10px;
  padding: 10px 12px;
  margin-bottom: 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.78);
}

.tbar-group {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.tbar-sep {
  width: 1px;
  align-self: stretch;
  min-height: 26px;
  background: var(--line);
}

.tbar-spacer {
  flex: 1 1 24px;
}

.tbar-count {
  padding-left: 2px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 600;
  white-space: nowrap;
}

.tbar-count strong {
  color: var(--ink);
}

.tbar-selnote {
  margin-left: 8px;
  color: var(--accent-text);
}

.tbar-field {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.tbar-label {
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 650;
  white-space: nowrap;
}

/* one control system: buttons, icon buttons, selects, inputs, menus */
.ctl {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 40px;
  padding: 0 15px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: rgba(16, 32, 51, 0.06);
  color: var(--ink);
  font: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background 150ms ease, color 150ms ease, box-shadow 150ms ease;
}

.ctl:hover {
  background: rgba(16, 32, 51, 0.11);
  transform: none;
  box-shadow: none;
}

.ctl:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
}

.ctl svg {
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.ctl-ico {
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
}

.ctl-caret {
  width: 13px;
  height: 13px;
  opacity: 0.55;
}

.ctl--icon {
  width: 40px;
  padding: 0;
}

.ctl--icon svg {
  width: 18px;
  height: 18px;
}

.ctl--primary {
  background: var(--brand-red);
  color: #fff;
  box-shadow: 0 10px 22px rgba(224, 59, 47, 0.2);
}

.ctl--primary:hover {
  background: var(--brand-red-strong);
  box-shadow: 0 12px 26px rgba(224, 59, 47, 0.26);
}

.ctl--danger {
  color: #b3261e;
}

.ctl--danger:hover {
  background: rgba(224, 59, 47, 0.14);
}

.ctl--accent {
  background: var(--action-blue);
  color: #fff;
  box-shadow: 0 10px 22px rgba(30, 115, 230, 0.18);
}

.ctl--accent:hover {
  background: var(--action-blue-strong);
  box-shadow: 0 12px 26px rgba(30, 115, 230, 0.24);
}

/* segmented set of icon buttons */
.tbar-iconset {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 3px;
  border-radius: 999px;
  background: rgba(16, 32, 51, 0.05);
}

.tbar-iconset .ctl {
  height: 34px;
  width: 34px;
  background: transparent;
}

.tbar-iconset .ctl:hover {
  background: rgba(16, 32, 51, 0.1);
}

.ctl-select,
.ctl-input {
  height: 40px;
  padding: 0 15px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 0.9rem;
}

.ctl-input {
  min-width: 160px;
}

.ctl-select {
  appearance: none;
  padding-right: 38px;
  cursor: pointer;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--muted) 50%),
    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 19px) 50%, calc(100% - 13px) 50%;
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
}

.menu {
  position: relative;
}

.menu > summary {
  list-style: none;
}

.menu > summary::-webkit-details-marker {
  display: none;
}

.menu[open] > summary {
  background: rgba(16, 32, 51, 0.12);
}

.menu-list {
  position: absolute;
  z-index: 40;
  top: calc(100% + 6px);
  left: 0;
  min-width: 210px;
  display: grid;
  gap: 2px;
  padding: 8px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
}

.menu-list button {
  justify-self: stretch;
  text-align: left;
  background: transparent;
  padding: 10px 12px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.9rem;
}

.menu-list button:hover {
  background: rgba(16, 32, 51, 0.06);
  transform: none;
  box-shadow: none;
}

/* thumbnail grid */
.page-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 16px;
}

.page-card {
  position: relative;
  margin: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 6px 16px rgba(27, 97, 145, 0.06);
  cursor: grab;
  transition: transform 140ms ease, box-shadow 140ms ease, border-color 140ms ease;
}

.page-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 26px rgba(13, 119, 255, 0.14);
}

.page-card.is-selected {
  border-color: var(--brand-red);
  box-shadow: 0 0 0 2px rgba(255, 90, 79, 0.35);
}

.page-card.is-dragging {
  opacity: 0.4;
}

.page-card.drop-before::before,
.page-card.drop-after::after {
  content: "";
  position: absolute;
  top: 8px;
  bottom: 8px;
  width: 3px;
  border-radius: 3px;
  background: var(--brand-red);
}

.page-card.drop-before::before {
  left: -9px;
}

.page-card.drop-after::after {
  right: -9px;
}

.page-thumb {
  position: relative;
  aspect-ratio: 3 / 4;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 8px;
  background: #eef3f8;
}

.page-thumb img,
.page-thumb canvas {
  max-width: 100%;
  max-height: 100%;
  display: block;
  box-shadow: 0 2px 8px rgba(16, 32, 51, 0.14);
  transition: transform 160ms ease;
}

.page-thumb .spinner {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 3px solid rgba(16, 32, 51, 0.12);
  border-top-color: var(--accent-strong);
  animation: spin 700ms linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.page-foot {
  display: grid;
  gap: 6px;
  margin-top: 8px;
}

.page-foot-top {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.page-size {
  width: 100%;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 0.8rem;
  cursor: pointer;
}

.page-size:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.blank-thumb {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  background: #fff;
  border: 1px dashed rgba(16, 32, 51, 0.2);
  border-radius: 8px;
  color: var(--muted);
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.thumb-broken {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  background: #fbeaea;
  color: var(--brand-red-strong);
  font-size: 1.7rem;
  font-weight: 700;
}

/* Document options panel */
.doc-options {
  margin-bottom: 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--panel);
  box-shadow: 0 10px 30px rgba(27, 97, 145, 0.06);
  overflow: hidden;
}

.doc-options-summary {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  cursor: pointer;
  list-style: none;
  transition: background 150ms ease;
}

.doc-options-summary::-webkit-details-marker {
  display: none;
}

.doc-options-summary:hover {
  background: rgba(0, 190, 255, 0.05);
}

.doc-options-icon {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 14px;
  background: rgba(0, 190, 255, 0.12);
  color: var(--accent-strong);
}

.doc-options-icon svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.doc-options-text {
  flex: 1;
  min-width: 0;
  display: grid;
  gap: 2px;
}

.doc-options-title {
  font-weight: 750;
  font-size: 1.02rem;
  letter-spacing: -0.01em;
}

.doc-options-sub {
  overflow: hidden;
  color: var(--muted);
  font-size: 0.86rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.doc-options-chevron {
  flex: 0 0 auto;
  color: var(--muted);
  transition: transform 200ms ease;
}

.doc-options-chevron svg {
  display: block;
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.doc-options[open] .doc-options-chevron {
  transform: rotate(180deg);
}

.doc-options-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 14px;
  padding: 4px 16px 18px;
}

.doc-option {
  display: grid;
  gap: 10px;
  align-content: start;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.8);
}

.doc-option-head {
  display: flex;
  align-items: center;
  gap: 10px;
}

.doc-option-icon {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: rgba(255, 90, 79, 0.12);
  color: var(--brand-red-strong);
}

.doc-option-icon svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.doc-option-title {
  font-weight: 700;
  font-size: 0.98rem;
}

.opt-row {
  display: grid;
  gap: 4px;
  font-size: 0.85rem;
  color: var(--muted);
}

.opt-row input,
.opt-row select {
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font: inherit;
}

.opt-check {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.92rem;
}

.opt-check input {
  width: 16px;
  height: 16px;
}

.opt-hint {
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.4;
}

/* Camera modal */
.camera-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(8, 12, 20, 0.62);
  backdrop-filter: blur(2px);
}

.camera-modal[hidden] {
  display: none;
}

.camera-dialog {
  width: min(560px, 100%);
  background: #fff;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: var(--shadow);
}

.camera-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
}

.camera-head h3 {
  margin: 0;
  font-size: 1.1rem;
}

.icon-btn {
  width: 34px;
  height: 34px;
  padding: 0;
  border-radius: 999px;
  background: rgba(16, 32, 51, 0.06);
  font-weight: 700;
}

.camera-stage {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 200px;
  background: #101820;
}

.camera-stage video {
  display: block;
  width: 100%;
  max-height: 60vh;
  object-fit: contain;
  background: #101820;
}

.camera-error {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  margin: 0;
  padding: 28px 24px;
  color: #fff;
  text-align: center;
  line-height: 1.6;
}

.camera-error p {
  margin: 0;
}

.camera-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
}

.camera-controls select {
  flex: 1 1 100%;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  font: inherit;
}

.camera-count {
  flex: 1 1 auto;
  min-width: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.camera-controls button {
  padding: 11px 18px;
}

/* Generic modal (shortcuts cheat sheet) */
.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(8, 12, 20, 0.62);
  backdrop-filter: blur(2px);
}

.modal[hidden] {
  display: none;
}

.modal-dialog {
  width: min(600px, 100%);
  max-height: 86vh;
  overflow: auto;
  background: #fff;
  border-radius: 20px;
  box-shadow: var(--shadow);
}

.modal-head {
  position: sticky;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: #fff;
  border-bottom: 1px solid var(--line);
}

.modal-head h3 {
  margin: 0;
  font-size: 1.15rem;
}

.modal-body {
  padding: 18px 20px 22px;
}

.unlock-dialog {
  width: min(440px, 100%);
}

.unlock-file {
  margin: 0 0 4px;
  font-weight: 600;
  word-break: break-all;
}

.unlock-intro {
  margin: 0 0 14px;
  color: var(--muted);
}

.unlock-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.unlock-input {
  width: 100%;
}

.unlock-error {
  margin: 0;
  color: var(--brand-red-strong);
  font-size: 0.9rem;
}

.unlock-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.unlock-note {
  margin: 16px 0 0;
  font-size: 0.82rem;
  line-height: 1.5;
  color: var(--muted);
}

.confirm-dialog {
  width: min(420px, 100%);
}

.confirm-msg {
  margin: 0 0 16px;
  color: var(--ink);
}

.confirm-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.confirm-note {
  margin: 14px 0 0;
  font-size: 0.82rem;
  color: var(--muted);
}

.wm-img {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.wm-img-btn {
  flex: 0 0 auto;
  padding: 6px 12px;
}

.wm-img-name {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.82rem;
  color: var(--muted);
}

.wm-img-clear {
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: rgba(16, 32, 51, 0.1);
  color: var(--ink);
  font-size: 0.72rem;
  cursor: pointer;
}

.wm-img-clear:hover {
  background: var(--brand-red);
  color: #fff;
}

.shortcut-group + .shortcut-group {
  margin-top: 18px;
}

.shortcut-group h4 {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.shortcut-list {
  margin: 0;
  display: grid;
  gap: 8px;
}

.shortcut-list > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(16, 32, 51, 0.02);
}

.shortcut-list dt {
  display: flex;
  align-items: center;
  gap: 5px;
  flex: 0 0 auto;
  font-weight: 600;
}

.shortcut-list dd {
  margin: 0;
  color: var(--muted);
  text-align: right;
}

kbd {
  display: inline-block;
  min-width: 20px;
  padding: 3px 7px;
  border: 1px solid var(--line);
  border-bottom-width: 2px;
  border-radius: 7px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1;
  text-align: center;
}

.shortcut-note {
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

/* Page preview modal */
.preview-dialog {
  display: flex;
  flex-direction: column;
  width: min(1040px, 100%);
  max-height: 94vh;
  overflow: hidden;
}

.preview-stage {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  align-items: stretch;
  gap: 8px;
  padding: 12px;
  background: #0f1622;
}

.preview-canvas-wrap {
  flex: 1;
  min-width: 0;
  min-height: 0;
  display: grid;
  place-items: center;
  overflow: auto;
}

.preview-media {
  max-width: 100%;
  max-height: 100%;
  display: block;
  background: #fff;
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.45);
  transition: transform 160ms ease;
}

.preview-blank {
  width: 52%;
  aspect-ratio: 3 / 4;
  background: #fff;
  border: 1px dashed rgba(255, 255, 255, 0.3);
}

/* Signature overlay: the media and the markup layer share one grid cell so the
   layer sits exactly on the page and rotates with it. */
.preview-canvas-wrap > .preview-media,
.preview-canvas-wrap > .markup-layer {
  grid-column: 1;
  grid-row: 1;
}

.markup-layer {
  position: relative;
  z-index: 3;
  pointer-events: none;
  transition: transform 160ms ease;
}

.stamp {
  position: absolute;
  cursor: move;
  pointer-events: auto;
  outline: 1px dashed rgba(0, 159, 216, 0.95);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.7);
  touch-action: none;
}

.stamp.dragging {
  outline-style: solid;
}

.stamp img {
  width: 100%;
  height: 100%;
  display: block;
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
}

.stamp-handle {
  position: absolute;
  right: -9px;
  bottom: -9px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--accent-strong);
  border: 2px solid #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
  cursor: nwse-resize;
  touch-action: none;
}

.stamp-del {
  position: absolute;
  top: -10px;
  right: -10px;
  width: 20px;
  height: 20px;
  padding: 0;
  display: grid;
  place-items: center;
  border: 2px solid #fff;
  border-radius: 50%;
  background: var(--brand-red-strong);
  color: #fff;
  font-size: 11px;
  line-height: 1;
  cursor: pointer;
}

/* Signature manager */
.sign-dialog {
  width: min(680px, 94vw);
}

.sign-panel {
  padding: 18px 20px 22px;
}

.sign-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 14px;
}

.sig-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sig-thumb {
  height: 92px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  overflow: hidden;
}

button.sig-thumb {
  cursor: pointer;
  transition: border-color 140ms ease, box-shadow 140ms ease, transform 140ms ease;
}

button.sig-thumb.pickable:hover {
  border-color: var(--brand-red);
  box-shadow: 0 8px 20px rgba(224, 74, 64, 0.16);
  transform: translateY(-1px);
}

.sig-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.sig-foot {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 2px;
}

.sig-name {
  flex: 1;
  min-width: 0;
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sig-del {
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: #b3261e;
  cursor: pointer;
}

.sig-del:hover {
  background: rgba(224, 59, 47, 0.12);
}

.sig-del svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sign-empty {
  margin: 4px 2px 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.sign-pick-hint {
  margin: 0 2px 14px;
}

.sign-pad {
  display: block;
  width: 100%;
  height: 240px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  touch-action: none;
  cursor: crosshair;
}

.sign-hint {
  margin: 10px 2px 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.sign-create-tools {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
}

.sign-create-tools .sign-hint {
  margin: 0;
  flex: 1;
}

.sign-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 16px;
}

.sign-spacer {
  flex: 1;
}

.sign-create-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
  flex-wrap: wrap;
}

.sign-name {
  flex: 1 1 220px;
  min-width: 0;
}

.sign-bg-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
  color: var(--muted);
  font-size: 14px;
  cursor: pointer;
}

.sign-bg-toggle input {
  width: 16px;
  height: 16px;
}

.preview-nav {
  flex: 0 0 auto;
  align-self: center;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  cursor: pointer;
}

.preview-nav:hover {
  background: rgba(255, 255, 255, 0.26);
  transform: none;
  box-shadow: none;
}

.preview-nav:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.preview-nav svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.preview-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 14px 18px;
}

.preview-src {
  margin-left: auto;
  max-width: 100%;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.85rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Always-visible expand button in the bottom-right of each thumbnail that
   opens the large preview. It stays in the corner so it does not block a
   click meant to select the page. */
.page-expand {
  position: absolute;
  inset: auto 8px 8px auto;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: rgba(16, 32, 51, 0.62);
  color: #fff;
  opacity: 0.9;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(16, 32, 51, 0.35);
  transition: background 140ms ease, opacity 140ms ease;
}

.page-card:hover .page-expand {
  opacity: 1;
}

.page-expand:hover {
  background: var(--brand-red);
  transform: none;
  box-shadow: 0 2px 8px rgba(16, 32, 51, 0.35);
}

.page-expand svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.page-drag {
  position: absolute;
  inset: auto auto 8px 8px;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: rgba(16, 32, 51, 0.62);
  color: #fff;
  opacity: 0.9;
  cursor: grab;
  touch-action: none;
  box-shadow: 0 2px 8px rgba(16, 32, 51, 0.35);
}

.page-drag:active {
  cursor: grabbing;
}

.page-drag svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.page-num {
  display: grid;
  place-items: center;
  min-width: 24px;
  height: 24px;
  padding: 0 7px;
  border-radius: 999px;
  background: rgba(16, 32, 51, 0.07);
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 700;
}

.page-src {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
  font-size: 0.78rem;
}

.page-ops {
  position: absolute;
  top: 14px;
  right: 14px;
  display: flex;
  gap: 6px;
  opacity: 0;
  transition: opacity 140ms ease;
}

.page-card:hover .page-ops,
.page-card.is-selected .page-ops {
  opacity: 1;
}

.page-op {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--line);
  color: var(--ink);
  box-shadow: 0 2px 6px rgba(16, 32, 51, 0.12);
}

.page-op:hover {
  transform: none;
  box-shadow: 0 2px 6px rgba(16, 32, 51, 0.12);
}

.page-op.delete:hover {
  color: var(--danger);
  border-color: rgba(224, 59, 47, 0.4);
}

.page-op svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.page-check {
  position: absolute;
  top: 14px;
  left: 14px;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid var(--line);
  background: rgba(255, 255, 255, 0.92);
  color: transparent;
  transition: background 120ms ease, border-color 120ms ease, color 120ms ease;
}

.page-card:hover .page-check {
  border-color: var(--brand-red);
}

.page-card.is-selected .page-check {
  background: var(--brand-red);
  border-color: var(--brand-red);
  color: #fff;
}

.page-check svg {
  width: 13px;
  height: 13px;
  fill: none;
  stroke: currentColor;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* status center: one persistent message area with typed states */
.status-center {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(16, 32, 51, 0.04);
  color: var(--ink);
}

.status-icon {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: rgba(16, 32, 51, 0.08);
  color: var(--muted);
}

.status-icon svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.status-body {
  flex: 1;
  min-width: 0;
}

.status-main {
  margin: 0;
  font-weight: 700;
}

.status-detail {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.5;
}

.status-progress {
  flex: 0 0 200px;
  max-width: 40%;
  height: 12px;
  accent-color: var(--action-blue);
}

.status-center[data-state="busy"] {
  background: rgba(20, 80, 127, 0.06);
  border-color: rgba(20, 80, 127, 0.18);
  color: #14507f;
}

.status-center[data-state="info"] .status-icon {
  background: rgba(0, 190, 255, 0.14);
  color: var(--accent-strong);
}

.status-center[data-state="success"] {
  background: rgba(22, 199, 132, 0.12);
  border-color: rgba(22, 199, 132, 0.26);
  color: #136347;
}

.status-center[data-state="success"] .status-icon {
  background: rgba(22, 199, 132, 0.2);
  color: #0faa70;
}

.status-center[data-state="warning"] {
  background: rgba(245, 163, 33, 0.12);
  border-color: rgba(245, 163, 33, 0.28);
  color: #8c4d00;
}

.status-center[data-state="warning"] .status-icon {
  background: rgba(245, 163, 33, 0.22);
  color: #b06f00;
}

.status-center[data-state="error"] {
  background: rgba(224, 59, 47, 0.1);
  border-color: rgba(224, 59, 47, 0.28);
  color: #8c1d16;
}

.status-center[data-state="error"] .status-icon {
  background: rgba(224, 59, 47, 0.16);
  color: #c0392b;
}

/* --------------------------- trust cards --------------------------- */
.trust-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-top: 8px;
}

.trust-card {
  display: grid;
  gap: 12px;
  padding: 22px;
  border: 1px solid rgba(0, 190, 255, 0.16);
  border-radius: 20px;
  background: #ffffff;
  box-shadow: 0 16px 36px rgba(27, 97, 145, 0.08);
}

.trust-icon {
  display: inline-grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 16px;
  background: rgba(255, 90, 79, 0.12);
  color: var(--brand-red-strong);
}

.trust-icon svg {
  width: 26px;
  height: 26px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.trust-card h3 {
  margin: 0;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
}

.trust-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

/* Tool cards (#tools) are links to the workspace: hover highlight + arrow. */
a.trust-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  transition: border-color 150ms ease, transform 150ms ease, box-shadow 150ms ease;
}

a.trust-card h3,
a.trust-card p {
  align-self: stretch;
}

a.trust-card:hover {
  border-color: rgba(255, 90, 79, 0.5);
  transform: translateY(-2px);
  box-shadow: 0 20px 40px rgba(27, 97, 145, 0.14);
}

.trust-arrow {
  margin-top: auto;
  align-self: flex-end;
  display: inline-flex;
  color: var(--muted);
}

.trust-arrow svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

a.trust-card:hover .trust-arrow {
  color: var(--brand-red);
}

/* --------------------------- how it works --------------------------- */
.how-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
  margin-top: 8px;
}

.how-step {
  display: grid;
  gap: 10px;
  align-content: start;
}

.step-number {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 999px;
  background: var(--brand-red);
  color: #fff;
  font-weight: 750;
}

.how-step h3 {
  margin: 0;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
}

.how-step p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

/* --------------------------- faq --------------------------- */
.faq-list {
  display: grid;
  gap: 10px;
  margin-top: 8px;
}

.faq-item {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.7);
  overflow: hidden;
}

.faq-item summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  cursor: pointer;
  font-weight: 700;
  list-style: none;
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item summary::after {
  content: "+";
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: rgba(16, 32, 51, 0.07);
  color: var(--muted);
  font-weight: 750;
  line-height: 1;
}

.faq-item[open] summary::after {
  content: "-";
}

.faq-item p {
  margin: 0;
  padding: 0 18px 18px;
  color: var(--muted);
  line-height: 1.65;
}

/* --------------------------- footer --------------------------- */
.site-footer {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 44px;
  border-top: 1px solid var(--line);
  color: var(--muted);
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-weight: 750;
  margin-bottom: 10px;
}

.footer-brand img {
  width: 24px;
  height: 24px;
  border-radius: 22%;
}

.site-footer a {
  color: var(--accent-text);
  text-decoration: none;
}

.site-footer a:hover {
  text-decoration: underline;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin-bottom: 10px;
}

.footer-note {
  font-size: 0.88rem;
  line-height: 1.6;
}

.site-footer-legal {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  font-size: 0.82rem;
  line-height: 1.6;
}

.site-footer-legal p {
  margin: 0 0 4px;
}

/* --------------------------- cookie notice --------------------------- */
.cookie-alert {
  position: fixed;
  left: 16px;
  bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  z-index: 200;
  max-width: 380px;
  opacity: 0;
  transform: translateY(120%);
  transition: opacity 350ms ease-out, transform 350ms ease-out;
  pointer-events: none;
}

.cookie-alert.show {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.cookie-alert > div {
  padding: 16px 18px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 14px 36px rgba(16, 32, 51, 0.18);
}

.cookie-alert p {
  margin: 0 0 12px;
  color: var(--ink);
  font-size: 0.9rem;
  line-height: 1.55;
}

.cookie-alert a {
  color: var(--accent-strong);
}

.cookie-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.btn-cookie {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 8px 18px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #ffffff;
  color: var(--ink);
  font-weight: 650;
  font-size: 0.9rem;
  text-decoration: none;
  cursor: pointer;
}

.btn-cookie-primary {
  background: var(--brand-red);
  border-color: var(--brand-red);
  color: #ffffff;
}

.btn-cookie-primary:hover {
  background: var(--brand-red-strong);
  border-color: var(--brand-red-strong);
}

@media (max-width: 480px) {
  .cookie-alert {
    left: 12px;
    right: 12px;
    max-width: none;
  }
}

/* --------------------------- privacy page --------------------------- */
.privacy-panel {
  max-width: 820px;
  margin: 0 auto;
}

.privacy-panel h1 {
  margin: 0 0 6px;
  font-size: clamp(1.9rem, 4vw, 2.6rem);
  letter-spacing: -0.02em;
}

.privacy-panel h2 {
  margin: 30px 0 8px;
  font-size: 1.25rem;
}

.privacy-panel h3 {
  margin: 20px 0 6px;
  font-size: 1.05rem;
}

.privacy-panel p,
.privacy-panel li {
  color: var(--muted);
  line-height: 1.7;
}

.privacy-panel ul {
  margin: 0 0 4px;
  padding-left: 20px;
}

.privacy-panel li {
  margin-bottom: 8px;
}

.privacy-panel code {
  padding: 1px 6px;
  border-radius: 6px;
  background: rgba(16, 32, 51, 0.06);
  font-size: 0.9em;
}

.privacy-updated {
  color: var(--muted);
  font-size: 0.9rem;
}

.privacy-back a {
  color: var(--accent-strong);
  text-decoration: none;
  font-weight: 600;
}

.how-install-btn {
  display: inline-flex;
  align-items: center;
  margin-top: 12px;
  padding: 9px 16px;
  border-radius: 999px;
  background: var(--brand-red);
  color: #ffffff;
  font-weight: 700;
  font-size: 0.9rem;
  text-decoration: none;
}

.how-install-btn:hover {
  background: var(--brand-red-strong);
}

.how-bonus {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 20px;
  padding: 18px 22px;
  border: 1px dashed var(--line);
  border-radius: 16px;
  background: rgba(0, 190, 255, 0.05);
}

.how-bonus h3 {
  margin: 4px 0 6px;
  font-size: 1.1rem;
}

.how-bonus p {
  margin: 0;
  color: var(--muted);
}

.how-bonus-label {
  margin: 0 0 2px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--accent-strong);
}

.how-bonus .how-install-btn {
  margin-top: 0;
  flex-shrink: 0;
}

/* --------------------------- tool pages --------------------------- */
.tool-intro {
  padding: 24px 0 6px;
}

.tool-intro h1 {
  margin: 0 0 12px;
  font-size: clamp(2rem, 4vw, 3rem);
  letter-spacing: -0.03em;
}

.tool-options {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 18px;
}

.tool-opt {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-weight: 650;
  font-size: 0.9rem;
  color: var(--muted);
}

.tool-status {
  margin: 14px 0 0;
  color: var(--muted);
  min-height: 1.2em;
}

.tool-download-all {
  margin-top: 14px;
}

.tool-result-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.tool-thumb {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #ffffff;
}

.tool-thumb img {
  width: 100%;
  height: auto;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #ffffff;
}

.tool-thumb-dl {
  justify-content: center;
}

.tool-text-actions {
  display: flex;
  gap: 10px;
  margin-top: 14px;
}

.tool-text-out {
  width: 100%;
  min-height: 320px;
  margin-top: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #ffffff;
  color: var(--ink);
  font: inherit;
  font-size: 0.95rem;
  line-height: 1.6;
  resize: vertical;
}

.tool-empty {
  margin-top: 14px;
  padding: 14px 16px;
  border: 1px solid rgba(245, 163, 33, 0.28);
  border-radius: 12px;
  background: rgba(245, 163, 33, 0.1);
  color: #8c4d00;
}

/* --------------------------- quick tools row --------------------------- */
.quick-tools {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
  margin-top: 16px;
}

.quick-tool {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #ffffff;
  text-decoration: none;
  color: var(--ink);
  transition: border-color 150ms ease, transform 150ms ease, box-shadow 150ms ease;
}

.quick-tool:hover {
  border-color: rgba(255, 90, 79, 0.5);
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(46, 78, 114, 0.1);
}

.quick-tool-ico {
  flex-shrink: 0;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: rgba(255, 90, 79, 0.12);
}

.quick-tool-ico svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: var(--brand-red-strong);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.quick-tool-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 0;
}

.quick-tool-name {
  font-weight: 700;
}

.quick-tool-desc {
  color: var(--muted);
  font-size: 0.9rem;
}

.quick-tool-arrow {
  flex-shrink: 0;
  color: var(--muted);
}

.quick-tool-arrow svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.quick-tool:hover .quick-tool-arrow {
  color: var(--brand-red);
}

/* ----------------------------- 404 page ----------------------------- */
.notfound {
  max-width: 640px;
  margin: 40px auto;
  text-align: center;
}

.notfound .notfound-code {
  margin: 0 0 6px;
  font-size: clamp(3.5rem, 12vw, 6rem);
  line-height: 1;
  font-weight: 800;
  letter-spacing: -0.04em;
  color: var(--brand-red);
}

.notfound h2 {
  margin: 0 0 12px;
  font-size: 1.5rem;
}

.notfound p {
  color: var(--muted);
  line-height: 1.7;
}

.notfound-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 24px;
}

/* --------- PWA standalone: focus on the workspace ---------
   When installed as an app (standalone window), hide the marketing
   sections tagged .pwa-hide so the PDF workspace is the whole app. */
@media (display-mode: standalone),
       (display-mode: minimal-ui),
       (display-mode: window-controls-overlay),
       (display-mode: fullscreen) {
  .pwa-hide { display: none !important; }
  .workspace-panel { margin-top: 10px; }
}

/* --------------------------- responsive --------------------------- */
@media (max-width: 900px) {
  .trust-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .how-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .site-nav-links {
    display: none;
  }
  .workspace-toolbar {
    flex-direction: column;
    align-items: stretch;
  }
  .toolbar-group.grow {
    margin-left: 0;
  }
}

@media (max-width: 560px) {
  .trust-grid,
  .how-grid {
    grid-template-columns: 1fr;
  }
  .page-grid {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  }
  /* Finger-sized controls on phones. */
  .ctl,
  .primary,
  .ctl-select,
  .ctl-input {
    min-height: 44px;
  }
}

/* Touch devices: bigger grab targets for the drag handle and magnifier. */
@media (pointer: coarse) {
  .page-drag,
  .page-expand {
    width: 38px;
    height: 38px;
    opacity: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

/* ===================== comparison (/vs) pages ===================== */
.vs-crumb {
  margin: 8px 0 14px;
  font-size: 0.85rem;
  color: var(--muted);
}
.vs-crumb a {
  color: var(--muted);
  text-decoration: none;
  font-weight: 600;
}
.vs-crumb a:hover {
  color: var(--accent-strong);
}

.vs-lead {
  max-width: 760px;
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 1.12rem;
  line-height: 1.7;
}

.vs-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 26px 0 4px;
}
.vs-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 700;
  min-height: 44px;
}
.vs-btn-primary {
  background: var(--brand-red);
  color: #fff;
  box-shadow: 0 10px 22px rgba(224, 59, 47, 0.2);
}
.vs-btn-primary:hover {
  background: var(--brand-red-strong);
  transform: translateY(-1px);
}
.vs-btn-ghost {
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--ink);
  font-weight: 600;
}
.vs-btn-ghost:hover {
  border-color: var(--accent);
  color: var(--accent-strong);
}

.vs-section {
  margin: 44px 0;
}
.vs-section > h2 {
  font-size: clamp(1.5rem, 3vw, 2.1rem);
  letter-spacing: -0.02em;
  margin: 0 0 10px;
}
.vs-section > .vs-sub {
  max-width: 760px;
  color: var(--muted);
  line-height: 1.7;
  margin: 0 0 22px;
}

/* bottom-line verdict */
.vs-verdict {
  display: grid;
  gap: 8px;
  padding: 26px 30px;
  border: 1px solid var(--line);
  border-left: 14px solid var(--brand-red);
  border-radius: 0 16px 16px 0;
  background: #ffffff;
  box-shadow: var(--shadow);
}
.vs-verdict h2 {
  margin: 0 0 4px;
  font-size: 1.25rem;
  color: var(--ink);
}
.vs-verdict p {
  margin: 0;
  color: var(--ink);
  line-height: 1.7;
}

/* feature comparison table */
.vs-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--panel);
  box-shadow: var(--shadow);
}
.vs-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 520px;
}
.vs-table th,
.vs-table td {
  padding: 14px 16px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
  line-height: 1.5;
}
.vs-table tbody tr:last-child td {
  border-bottom: 0;
}
.vs-table thead th {
  font-size: 0.98rem;
  font-weight: 700;
}
.vs-table .vs-feat {
  color: var(--muted);
  font-weight: 600;
  width: 34%;
}
.vs-table col.vs-mine,
.vs-table td.vs-mine {
  background: rgba(255, 90, 79, 0.06);
}
.vs-table thead th.vs-mine {
  background: rgba(255, 90, 79, 0.12);
  color: var(--brand-red-strong);
  font-weight: 800;
}
.vs-yes {
  color: var(--success-green-strong);
  font-weight: 700;
}
.vs-no {
  color: var(--muted);
}

/* key differences (3 cards) */
.vs-diffs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}
.vs-diff {
  padding: 22px 22px 24px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--panel);
  box-shadow: var(--shadow);
}
.vs-diff-ico {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: rgba(255, 90, 79, 0.12);
  color: var(--brand-red-strong);
  margin-bottom: 14px;
}
.vs-diff-ico svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.vs-diff h3 {
  margin: 0 0 8px;
  font-size: 1.1rem;
}
.vs-diff p {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}

/* when to choose each (2 cards) */
.vs-choose {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}
.vs-choose-card {
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--panel);
  box-shadow: var(--shadow);
}
.vs-choose-card.is-mine {
  border-top: 3px solid var(--brand-red);
}
.vs-choose-card.is-them {
  border-top: 3px solid var(--accent);
}
.vs-choose-card h3 {
  margin: 0 0 14px;
  font-size: 1.15rem;
}
.vs-choose-card ul {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 11px;
}
.vs-choose-card li {
  position: relative;
  padding-left: 26px;
  color: var(--ink);
  line-height: 1.6;
}
.vs-choose-card li::before {
  content: "";
  position: absolute;
  left: 3px;
  top: 3px;
  width: 6px;
  height: 11px;
  border: solid var(--success-green-strong);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
.vs-choose-card.is-them li::before {
  border-color: var(--accent-strong);
}

/* get-started steps */
.vs-steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  counter-reset: vsstep;
}
.vs-step {
  padding: 22px 22px 24px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--panel);
  box-shadow: var(--shadow);
}
.vs-step::before {
  counter-increment: vsstep;
  content: counter(vsstep);
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: var(--brand-red);
  color: #fff;
  font-weight: 800;
  margin-bottom: 14px;
}
.vs-step h3 {
  margin: 0 0 6px;
  font-size: 1.05rem;
}
.vs-step p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

/* faq */
.vs-faq {
  display: grid;
  gap: 12px;
}
.vs-faq details {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
  padding: 2px 18px;
}
.vs-faq summary {
  cursor: pointer;
  padding: 15px 0;
  font-weight: 700;
  list-style: none;
}
.vs-faq summary::-webkit-details-marker {
  display: none;
}
.vs-faq details[open] summary {
  color: var(--brand-red-strong);
}
.vs-faq details p {
  margin: 0 0 15px;
  color: var(--muted);
  line-height: 1.7;
}

/* final CTA band */
.vs-cta {
  text-align: center;
  padding: 44px 24px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--panel);
  box-shadow: var(--shadow);
}
.vs-cta h2 {
  margin: 0 0 10px;
  font-size: clamp(1.5rem, 3vw, 2.1rem);
}
.vs-cta p {
  max-width: 560px;
  margin: 0 auto 22px;
  color: var(--muted);
  line-height: 1.7;
}

/* hub index cards */
.vs-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 18px;
}
.vs-card {
  display: grid;
  gap: 8px;
  align-content: start;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--panel);
  box-shadow: var(--shadow);
  text-decoration: none;
  color: var(--ink);
  transition: transform 150ms ease, box-shadow 150ms ease;
}
.vs-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 18px 40px rgba(46, 78, 114, 0.16);
}
.vs-card h3 {
  margin: 0;
  font-size: 1.2rem;
}
.vs-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
  font-size: 0.96rem;
}
.vs-card .vs-card-go {
  margin-top: 4px;
  color: var(--brand-red-strong);
  font-weight: 700;
  font-size: 0.9rem;
}

@media (max-width: 820px) {
  .vs-diffs,
  .vs-steps {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 640px) {
  .vs-choose {
    grid-template-columns: 1fr;
  }
}
