:root {
  --ink: #eef2ff;
  --muted: #9aa3c0;
  --paper: #070a14;
  --panel: #11172a;
  --line: rgba(238, 242, 255, 0.1);
  --brand: #4d9fff;
  --accent: #a78bfa;
  --gradient: linear-gradient(135deg, #2e9aff 0%, #5b6cff 50%, #8a2be2 100%);
  --font-display: "Syne", sans-serif;
  --font-body: "Plus Jakarta Sans", sans-serif;
  --radius: 14px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--paper);
  min-height: 100vh;
  line-height: 1.55;
}

.page-bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(ellipse 70% 45% at 15% 0%, rgba(124, 77, 255, 0.22), transparent 55%),
    radial-gradient(ellipse 50% 35% at 90% 10%, rgba(46, 125, 255, 0.15), transparent 50%),
    var(--paper);
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  background: rgba(7, 10, 20, 0.85);
  z-index: 50;
  overflow: visible;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  color: var(--ink);
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.1rem;
}

.brand img {
  border-radius: 9px;
  background: #000;
}

.brand span span {
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  position: relative;
}

.topbar-links {
  display: flex;
  gap: 1rem;
}

.topbar a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 600;
}

.topbar a:hover { color: var(--ink); }

/* Hamburger dropdown in the header */
.menu-dropdown {
  position: relative;
}

.menu-toggle {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(17, 23, 42, 0.95);
  color: var(--ink);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.menu-toggle:hover,
.menu-toggle[aria-expanded="true"] {
  border-color: var(--brand);
}

.menu-toggle-bars,
.menu-toggle-bars::before,
.menu-toggle-bars::after {
  display: block;
  width: 16px;
  height: 2px;
  background: currentColor;
  border-radius: 2px;
  position: relative;
  transition: transform 0.2s, opacity 0.2s;
}

.menu-toggle-bars::before,
.menu-toggle-bars::after {
  content: "";
  position: absolute;
  left: 0;
}

.menu-toggle-bars::before { top: -5px; }
.menu-toggle-bars::after { top: 5px; }

body.menu-open .menu-toggle-bars {
  background: transparent;
}

body.menu-open .menu-toggle-bars::before {
  top: 0;
  transform: rotate(45deg);
}

body.menu-open .menu-toggle-bars::after {
  top: 0;
  transform: rotate(-45deg);
}

.menu-backdrop {
  position: fixed;
  inset: 0;
  background: transparent;
  z-index: 45;
  display: none;
}

.menu-backdrop.is-visible {
  display: block;
}

.dropdown-menu {
  position: absolute;
  top: calc(100% + 0.4rem);
  right: 0;
  z-index: 55;
  list-style: none;
  margin: 0;
  padding: 0.4rem 0;
  min-width: 200px;
  max-height: min(70vh, 420px);
  overflow: auto;
  background: #0c1222;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4);
  display: none;
}

.menu-dropdown.is-open .dropdown-menu {
  display: block;
}

.dropdown-menu > li {
  margin: 0;
  padding: 0;
}

.dropdown-tools {
  list-style: none;
  margin: 0;
  padding: 0;
}

.dropdown-sep {
  height: 1px;
  margin: 0.35rem 0;
  background: var(--line);
  list-style: none;
  pointer-events: none;
}

.dropdown-item {
  display: block;
  width: 100%;
  border: none;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 0.92rem;
  font-weight: 600;
  text-align: left;
  text-decoration: none;
  padding: 0.55rem 1rem;
  cursor: pointer;
  white-space: nowrap;
}

.dropdown-item:hover,
.dropdown-item:focus {
  background: rgba(46, 125, 255, 0.14);
  color: var(--ink);
  outline: none;
}

.dropdown-item.active {
  color: var(--brand);
}

@media (max-width: 720px) {
  .topbar-links { display: none; }
  .dropdown-menu {
    position: fixed;
    top: 4.15rem;
    right: 0.75rem;
    min-width: 220px;
  }
}

.wrap {
  width: min(1100px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 2.5rem 0 4rem;
}

.hero { margin-bottom: 1.5rem; max-width: 40rem; }

.trust-strip {
  margin: 0 0 2rem;
  padding: 1rem 1.15rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(46, 125, 255, 0.07);
  color: var(--muted);
  font-size: 0.92rem;
  max-width: 42rem;
  line-height: 1.55;
}

.trust-strip strong {
  color: var(--ink);
  display: block;
  margin-bottom: 0.25rem;
  font-size: 0.95rem;
}

.eyebrow {
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 700;
  margin-bottom: 0.6rem;
}

.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(1.9rem, 4vw, 2.8rem);
  letter-spacing: -0.02em;
  margin-bottom: 0.7rem;
}

.lead { color: var(--muted); font-size: 1.05rem; }

.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.85rem;
}

.tool-card {
  text-align: left;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.15rem 1.1rem;
  cursor: pointer;
  color: inherit;
  font: inherit;
  transition: border-color 0.2s, transform 0.2s;
}

.tool-card:hover {
  border-color: var(--brand);
  transform: translateY(-2px);
}

.tool-card.active {
  border-color: var(--brand);
  box-shadow: 0 0 0 1px var(--brand);
}

.tool-card h3 {
  font-family: var(--font-display);
  font-size: 1.05rem;
  margin-bottom: 0.35rem;
}

.tool-card p {
  color: var(--muted);
  font-size: 0.88rem;
}

.workspace {
  margin-top: 1.25rem;
  scroll-margin-top: 5rem;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) + 4px);
  padding: 1.5rem;
}

.back {
  background: none;
  border: none;
  color: var(--brand);
  font: inherit;
  font-weight: 650;
  cursor: pointer;
  margin-bottom: 1rem;
}

.workspace h2 {
  font-family: var(--font-display);
  margin-bottom: 0.4rem;
}

.ws-desc {
  color: var(--muted);
  margin-bottom: 1.25rem;
}

.drop {
  position: relative;
  border: 1.5px dashed var(--line);
  border-radius: var(--radius);
  padding: 1.75rem 1.25rem;
  text-align: center;
  margin-bottom: 1rem;
  transition: border-color 0.2s, background 0.2s;
  scroll-margin-top: 5rem;
}

.drop.drag {
  border-color: var(--brand);
  background: rgba(46, 125, 255, 0.08);
}

.drop input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.hint, .status { color: var(--muted); font-size: 0.9rem; margin-top: 0.5rem; }

.sort-panel {
  margin: 0 0 1.25rem;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #0a0e1c;
  scroll-margin-top: 5rem;
}

.sort-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: flex-start;
  margin-bottom: 0.85rem;
}

.sort-head h3 {
  font-family: var(--font-display);
  font-size: 1rem;
  margin-bottom: 0.25rem;
}

.sort-zoom-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
}

.sort-workspace {
  display: grid;
  grid-template-columns: 140px minmax(0, 1fr);
  gap: 0.85rem;
  min-height: 60vh;
}

.sort-gallery {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  max-height: 78vh;
  overflow: auto;
  padding-right: 0.2rem;
}

.sort-stage-wrap {
  overflow: auto;
  max-height: 78vh;
  min-height: 55vh;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #0d0d12;
  padding: 1rem;
}

.sort-stage {
  position: relative;
  min-height: 240px;
  display: grid;
  place-items: center;
}

.sort-stage canvas {
  display: block;
  max-width: none;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.35);
  background: #fff;
}

.sort-stage img {
  max-width: 100%;
  display: block;
}

.sort-empty {
  text-align: center;
  padding: 2rem;
}

.sort-card.selected {
  border-color: var(--brand);
  box-shadow: 0 0 0 1px var(--brand);
}

@media (max-width: 800px) {
  .sort-workspace {
    grid-template-columns: 1fr;
  }
  .sort-gallery {
    flex-direction: row;
    max-height: none;
    overflow-x: auto;
  }
  .sort-card {
    min-width: 110px;
  }
}

.sort-card {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  padding: 0.45rem;
  cursor: grab;
  user-select: none;
  transition: border-color 0.15s, transform 0.15s, box-shadow 0.15s;
}

.sort-card:active { cursor: grabbing; }

.sort-card.dragging {
  opacity: 0.55;
  transform: scale(0.98);
}

.sort-card.over {
  border-color: var(--brand);
  box-shadow: 0 0 0 1px var(--brand);
}

.sort-thumb {
  aspect-ratio: 3 / 4;
  border-radius: 8px;
  overflow: hidden;
  background: #070a14;
  display: grid;
  place-items: center;
  margin-bottom: 0.4rem;
}

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

.sort-fallback {
  font-size: 0.72rem;
  color: var(--muted);
  text-align: center;
  padding: 0.4rem;
  word-break: break-word;
}

.sort-meta {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  min-width: 0;
}

.sort-num {
  flex: 0 0 auto;
  width: 1.35rem;
  height: 1.35rem;
  border-radius: 999px;
  display: grid;
  place-items: center;
  font-size: 0.72rem;
  font-weight: 700;
  background: var(--gradient);
  color: #fff;
}

.sort-label {
  font-size: 0.72rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sort-remove {
  position: absolute;
  top: 0.25rem;
  right: 0.25rem;
  width: 1.4rem;
  height: 1.4rem;
  border: none;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.65);
  color: #fff;
  cursor: pointer;
  font-size: 0.95rem;
  line-height: 1;
}

.sort-remove:hover {
  background: #c44;
}

/* Interactive PDF editor */
.pdf-editor {
  margin: 0 0 1.25rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #0a0e1c;
  padding: 0.85rem;
  scroll-margin-top: 5rem;
}

.editor-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  margin-bottom: 0.65rem;
}

.editor-btn {
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--ink);
  font: inherit;
  font-size: 0.85rem;
  font-weight: 650;
  padding: 0.45rem 0.7rem;
  border-radius: 9px;
  cursor: pointer;
}

.editor-btn.active,
.editor-btn:hover {
  border-color: var(--brand);
}

.editor-btn.danger:hover {
  border-color: #f66;
  color: #f99;
}

.editor-field {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.8rem;
  color: var(--muted);
}

.editor-field input[type="number"],
.editor-field select {
  width: 4rem;
  padding: 0.35rem 0.4rem;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #070a14;
  color: var(--ink);
  font: inherit;
}

.editor-field select {
  width: auto;
  min-width: 11rem;
  max-width: 14rem;
}

.editor-field input[type="color"] {
  width: 2rem;
  height: 1.6rem;
  border: none;
  background: none;
  padding: 0;
}

.editor-sep {
  width: 1px;
  height: 1.4rem;
  background: var(--line);
  margin: 0 0.15rem;
}

.editor-zoom {
  min-width: 3.2rem;
  text-align: center;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--brand);
}

.editor-body {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 0.85rem;
  min-height: 70vh;
}

.editor-stage-wrap {
  overflow: auto;
  max-height: 78vh;
  min-height: 60vh;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #0d0d12;
  padding: 1rem;
}

.editor-thumbs {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-height: 70vh;
  overflow: auto;
  padding-right: 0.25rem;
}

.editor-thumb {
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 10px;
  padding: 0.35rem;
  cursor: pointer;
  color: inherit;
  font: inherit;
  text-align: center;
}

.editor-thumb.active {
  border-color: var(--brand);
  box-shadow: 0 0 0 1px var(--brand);
}

.editor-thumb img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 6px;
  margin-bottom: 0.25rem;
}

.editor-thumb span {
  font-size: 0.7rem;
  color: var(--muted);
}

.editor-stage {
  position: relative;
  margin: 0 auto;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.35);
}

.editor-stage canvas {
  display: block;
  max-width: none;
}

.editor-layer {
  position: absolute;
  inset: 0;
  cursor: crosshair;
}

.editor-overlay {
  position: absolute;
  cursor: move;
  border: 1px dashed transparent;
  padding: 2px 4px;
  transform-origin: top left;
  max-width: 90%;
}

.editor-overlay.selected {
  border-color: var(--brand);
  background: rgba(46, 125, 255, 0.12);
}

.editor-overlay.is-text {
  white-space: pre-wrap;
  font-family: Helvetica, Arial, sans-serif;
  font-weight: 600;
  line-height: 1.15;
  text-shadow: 0 0 2px #fff;
}

.editor-overlay.is-native {
  font-weight: 400;
  text-shadow: none;
  border-radius: 2px;
}

.editor-overlay.is-native-ghost {
  color: transparent !important;
  text-shadow: none;
  background: transparent;
}

.editor-overlay.is-native-ghost:hover,
.editor-overlay.is-native-ghost.selected {
  color: transparent !important;
  background: rgba(46, 125, 255, 0.18);
  border-color: var(--brand);
}

.editor-overlay.is-native.is-edited {
  text-shadow: none;
  z-index: 2;
}

.editor-native-cover {
  position: absolute;
  background: #fff;
  pointer-events: none;
  z-index: 1;
}

.editor-overlay.is-editing {
  cursor: text;
  outline: 2px solid var(--brand);
  background: #fff !important;
  color: inherit !important;
  z-index: 5;
  min-width: 1.5em;
  white-space: pre-wrap;
}

.editor-overlay.is-image {
  padding: 0;
  overflow: visible;
  max-width: none;
}

.editor-overlay.is-image img {
  width: 100%;
  height: 100%;
  object-fit: fill;
  display: block;
  pointer-events: none;
  border-radius: 2px;
}

.editor-resize-handle {
  position: absolute;
  width: 10px;
  height: 10px;
  background: var(--brand);
  border: 1px solid #fff;
  border-radius: 2px;
  z-index: 6;
  box-sizing: border-box;
}

.editor-resize-handle.nw {
  left: -5px;
  top: -5px;
  cursor: nwse-resize;
}
.editor-resize-handle.ne {
  right: -5px;
  top: -5px;
  cursor: nesw-resize;
}
.editor-resize-handle.sw {
  left: -5px;
  bottom: -5px;
  cursor: nesw-resize;
}
.editor-resize-handle.se {
  right: -5px;
  bottom: -5px;
  cursor: nwse-resize;
}

.editor-stamps {
  display: none;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.4rem;
  margin: 0 0 0.65rem;
  padding: 0.35rem 0.55rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(7, 10, 20, 0.55);
  overflow-x: auto;
  overflow-y: hidden;
}

.editor-stamps.is-open {
  display: flex;
}

.editor-stamps[hidden] {
  display: none !important;
}

.editor-stamps-label {
  flex: 0 0 auto;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--muted);
  white-space: nowrap;
}

.editor-stamp {
  flex: 0 0 auto;
  width: 2rem;
  height: 2rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--stamp-ink, #111111);
  font-size: 1.05rem;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.editor-stamp:hover,
.editor-stamp.active {
  border-color: var(--brand);
  box-shadow: 0 0 0 1px var(--brand);
}

.editor-stamp-color {
  flex: 0 0 auto;
  width: 1.55rem;
  height: 1.55rem;
  border-radius: 5px;
  border: 2px solid rgba(255, 255, 255, 0.75);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.35);
  cursor: pointer;
  padding: 0;
  appearance: none;
  -webkit-appearance: none;
}

.editor-stamp-color:hover,
.editor-stamp-color.active {
  outline: 2px solid var(--brand);
  outline-offset: 1px;
  border-color: #fff;
}

.editor-stamp-custom-color {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  margin: 0;
}

.editor-stamp-custom-color input[type="color"] {
  width: 1.7rem;
  height: 1.7rem;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #070a14;
  padding: 0;
  cursor: pointer;
}

.editor-stamps .editor-btn {
  flex: 0 0 auto;
  flex-shrink: 0;
  padding: 0.4rem 0.7rem;
  font-size: 0.82rem;
  line-height: 1.2;
  white-space: nowrap;
  overflow: visible;
}

.editor-stamps .editor-sep {
  flex: 0 0 auto;
  height: 1.2rem;
}

.editor-crop-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(4, 8, 18, 0.72);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.editor-crop-modal[hidden] {
  display: none !important;
}

.editor-crop-dialog {
  width: min(640px, 100%);
  background: #0a0e1c;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 1rem 1.1rem 1.1rem;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
}

.editor-crop-dialog h3 {
  margin: 0 0 0.35rem;
  font-size: 1.05rem;
}

.editor-crop-stage {
  position: relative;
  margin: 0.75rem 0 1rem;
  max-height: 55vh;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #111;
  user-select: none;
  touch-action: none;
}

.editor-crop-stage img {
  display: block;
  max-width: 100%;
  height: auto;
  vertical-align: top;
}

.editor-crop-box {
  position: absolute;
  border: 2px solid var(--brand);
  background: rgba(46, 125, 255, 0.12);
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.45);
  cursor: move;
  box-sizing: border-box;
}

.editor-crop-handle {
  position: absolute;
  width: 12px;
  height: 12px;
  background: var(--brand);
  border: 1px solid #fff;
  border-radius: 2px;
}

.editor-crop-handle.nw {
  left: -6px;
  top: -6px;
  cursor: nwse-resize;
}
.editor-crop-handle.ne {
  right: -6px;
  top: -6px;
  cursor: nesw-resize;
}
.editor-crop-handle.sw {
  left: -6px;
  bottom: -6px;
  cursor: nesw-resize;
}
.editor-crop-handle.se {
  right: -6px;
  bottom: -6px;
  cursor: nwse-resize;
}

.editor-crop-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
}

@media (max-width: 800px) {
  .editor-body {
    grid-template-columns: 1fr;
  }
  .editor-thumbs {
    flex-direction: row;
    max-height: none;
    overflow-x: auto;
  }
  .editor-thumb {
    min-width: 72px;
  }
}

.options {
  display: grid;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.options label {
  display: grid;
  gap: 0.35rem;
  font-size: 0.88rem;
  font-weight: 600;
}

.options input, .options select {
  font: inherit;
  padding: 0.7rem 0.85rem;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #0a0e1c;
  color: var(--ink);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.85rem 1.4rem;
  border: none;
  border-radius: 11px;
  background: var(--gradient);
  color: #fff;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.btn:disabled {
  opacity: 0.55;
  cursor: wait;
}

.status.error { color: #ff8f9f; }
.status.ok { color: #7ddea8; }

.btn-secondary {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--ink);
  background-image: none;
}

.btn-secondary:hover:not(:disabled) {
  border-color: var(--accent, #2e7dff);
}

.email-panel {
  margin: 0;
  padding: 0;
  border: none;
}

.delivery-panel {
  margin-top: 1.25rem;
  padding-top: 1.15rem;
  border-top: 1px solid var(--line);
  display: grid;
  gap: 1.5rem;
}

.delivery-panel h3,
.share-panel h3,
.email-panel h3 {
  margin: 0 0 0.35rem;
  font-family: Syne, sans-serif;
  font-size: 1.05rem;
  font-weight: 700;
}

.share-result {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: 0.75rem;
  align-items: center;
}

.share-result input {
  flex: 1 1 16rem;
  min-width: 12rem;
  font: inherit;
  padding: 0.7rem 0.85rem;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #0a0e1c;
  color: var(--ink);
}

.sig-pad {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  padding: 0.9rem 1rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(46, 125, 255, 0.06);
  margin-bottom: 0.75rem;
}

.sig-mode-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.sig-mode-tabs .editor-btn.active {
  border-color: var(--brand);
  color: var(--ink);
  background: rgba(46, 125, 255, 0.18);
}

.sig-type-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  align-items: center;
  margin: 0.35rem 0 0.65rem;
}

.sig-type-row input {
  flex: 1 1 14rem;
  min-width: 12rem;
  font: inherit;
  padding: 0.65rem 0.85rem;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #0a0e1c;
  color: var(--ink);
}

.sig-style-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 0.65rem;
}

.sig-style {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 0.45rem;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #0a0e1c;
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  text-align: left;
}

.sig-style canvas {
  width: 100%;
  height: auto;
  border-radius: 8px;
  background: #fff;
  display: block;
}

.sig-style span {
  font-size: 0.78rem;
  font-weight: 600;
}

.sig-style:hover {
  border-color: rgba(77, 159, 255, 0.55);
}

.sig-style.selected {
  border-color: var(--brand);
  box-shadow: 0 0 0 1px rgba(77, 159, 255, 0.45);
  color: var(--ink);
}

.sig-pad canvas {
  width: 100%;
  max-width: 560px;
  height: auto;
  border-radius: 10px;
  border: 1px dashed var(--line);
  background: #fff;
  touch-action: none;
  cursor: crosshair;
}

.sig-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.sig-upload-label {
  cursor: pointer;
}

.sig-upload-preview {
  margin-top: 0.5rem;
  max-width: min(100%, 360px);
  max-height: 140px;
  object-fit: contain;
  border-radius: 10px;
  background: #fff;
  padding: 0.4rem;
}

.esign-preview {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  padding: 0.9rem 1rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(46, 125, 255, 0.06);
  margin: 0.75rem 0;
}

.esign-preview-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
}

.esign-page-label {
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 600;
  min-width: 5.5rem;
  text-align: center;
}

.esign-stage {
  position: relative;
  display: inline-block;
  max-width: 100%;
  border-radius: 10px;
  border: 1px solid var(--line);
  overflow: hidden;
  background: #111;
  touch-action: none;
  user-select: none;
}

.esign-stage canvas {
  display: block;
  max-width: 100%;
  height: auto;
  vertical-align: top;
}

.esign-sig {
  position: absolute;
  left: 0;
  top: 0;
  box-sizing: border-box;
  border: 1px dashed rgba(46, 154, 255, 0.95);
  background: rgba(255, 255, 255, 0.12);
  cursor: move;
  z-index: 2;
}

.esign-sig img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  pointer-events: none;
  background: transparent;
}

.esign-resize {
  position: absolute;
  right: -6px;
  bottom: -6px;
  width: 14px;
  height: 14px;
  border-radius: 3px;
  background: var(--brand);
  border: 2px solid #fff;
  cursor: nwse-resize;
  z-index: 3;
}

.share-page {
  max-width: 36rem;
  padding-top: 4rem;
}

.share-page .share-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.25rem;
}

.privacy-note {
  color: var(--muted);
  font-size: 0.92rem;
  margin-top: 0.85rem;
}

.email-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: 0.75rem;
  align-items: center;
}

.email-row input[type="email"] {
  flex: 1 1 14rem;
  min-width: 12rem;
  font: inherit;
  padding: 0.7rem 0.85rem;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #0a0e1c;
  color: var(--ink);
}

.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;
}

.size-report {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 0.85rem 1rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(46, 125, 255, 0.08);
  margin-bottom: 0.75rem;
}

.size-report strong {
  color: var(--ink);
  font-size: 0.9rem;
}

.size-report span {
  color: var(--muted);
  font-size: 0.88rem;
}

.size-report [data-size-result]:not([hidden]) {
  color: #7ddea8;
}

.foot {
  border-top: 1px solid var(--line);
  padding: 1.25rem 1.5rem 2rem;
  text-align: center;
  color: var(--muted);
  font-size: 0.85rem;
}

@media (max-width: 600px) {
  .topbar nav { display: none; }
}
