/* JGAMail Signature Builder — clean white SaaS theme */

:root {
  --navy: #0f2440;
  --ink: #1f2937;
  --muted: #6b7280;
  --blue: #1a56db;
  --blue-dark: #1443ad;
  --blue-soft: #eaf1fe;
  --line: #e5e7eb;
  --bg: #f7f9fc;
  --card: #ffffff;
  --ok: #057a46;
  --ok-bg: #e6f7ee;
  --warn: #b54708;
  --warn-bg: #fef3e6;
  --err: #c81e1e;
  --err-bg: #fdecec;
  --radius: 12px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.6;
}

/* ---------- header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: #fff;
  border-bottom: 1px solid var(--line);
}
.site-header .wrap {
  display: flex;
  align-items: center;
  gap: 28px;
  max-width: 1240px;
  margin: 0 auto;
  padding: 14px 24px;
}
.logo {
  font-weight: 800;
  font-size: 20px;
  color: var(--navy);
  text-decoration: none;
  white-space: nowrap;
}
.logo span { color: var(--blue); }
.site-nav {
  display: flex;
  gap: 20px;
  margin-left: auto;
}
.site-nav a {
  color: var(--muted);
  text-decoration: none;
  font-weight: 600;
  font-size: 14px;
}
.site-nav a:hover { color: var(--navy); }

/* ---------- layout ---------- */

.wrap {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 24px;
}

.hero {
  text-align: center;
  padding: 56px 24px 36px;
  max-width: 760px;
  margin: 0 auto;
}
.hero .badge {
  display: inline-block;
  background: var(--blue-soft);
  color: var(--blue);
  font-weight: 700;
  font-size: 13px;
  padding: 6px 14px;
  border-radius: 999px;
  margin-bottom: 16px;
}
.hero h1 {
  color: var(--navy);
  font-size: clamp(28px, 4vw, 42px);
  margin: 0 0 12px;
  letter-spacing: -0.5px;
}
.hero p {
  color: var(--muted);
  font-size: 17px;
  margin: 0 0 20px;
}
.hero-points {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
  list-style: none;
  padding: 0;
  margin: 0;
}
.hero-points li {
  font-size: 13px;
  font-weight: 600;
  color: var(--navy);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 14px;
}

/* ---------- builder grid ---------- */

.builder {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  gap: 24px;
  align-items: start;
  padding-bottom: 56px;
}

.panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: 0 1px 3px rgba(15, 36, 64, 0.06);
}
.panel h2 {
  color: var(--navy);
  font-size: 18px;
  margin: 0 0 4px;
}
.panel .sub {
  color: var(--muted);
  font-size: 13px;
  margin: 0 0 16px;
}
.section-gap { margin-top: 28px; }

/* ---------- block cards ---------- */

#block-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 16px;
}
.empty-note {
  color: var(--muted);
  font-size: 14px;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  padding: 20px;
  text-align: center;
  margin: 0;
}
.block-card {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  overflow: hidden;
}
.block-card.dragging { opacity: 0.45; }
.block-card.drop-hint {
  border-color: var(--blue);
  box-shadow: 0 0 0 2px var(--blue-soft);
}
.block-head {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #f3f6fb;
  padding: 8px 12px;
  border-bottom: 1px solid var(--line);
}
.drag-handle {
  cursor: grab;
  color: var(--muted);
  font-size: 16px;
  line-height: 1;
  user-select: none;
}
.block-title {
  font-weight: 700;
  font-size: 13px;
  color: var(--navy);
}
.block-actions { margin-left: auto; display: flex; gap: 2px; }
.icon-btn {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 15px;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  cursor: pointer;
  line-height: 1;
}
.icon-btn:hover { background: #e2e8f5; color: var(--navy); }
.icon-btn.danger:hover { background: var(--err-bg); color: var(--err); }

.block-fields { padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.fld { display: flex; flex-direction: column; gap: 4px; }
.fld-label { font-size: 12px; font-weight: 600; color: var(--muted); }
.fld input, .fld textarea {
  font: inherit;
  font-size: 14px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  width: 100%;
}
.fld input:focus, .fld textarea:focus,
select:focus {
  outline: 2px solid var(--blue);
  outline-offset: 0;
  border-color: var(--blue);
}
.hint { font-size: 12px; color: var(--muted); margin: 6px 0 0; }
.hint code {
  background: #f3f4f6;
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 11px;
}

.upload-btn {
  display: inline-block;
  font-size: 13px;
  font-weight: 700;
  color: var(--blue);
  background: var(--blue-soft);
  border-radius: 8px;
  padding: 8px 14px;
  cursor: pointer;
}
.upload-btn:hover { background: #dbe7fd; }

.social-row {
  display: grid;
  grid-template-columns: 1fr 1.4fr auto;
  gap: 8px;
  margin-bottom: 8px;
}
.social-row input {
  font: inherit;
  font-size: 13px;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  min-width: 0;
}

/* ---------- buttons ---------- */

.btn {
  font: inherit;
  font-weight: 700;
  border: 0;
  border-radius: 999px;
  padding: 10px 20px;
  cursor: pointer;
  font-size: 14px;
}
.btn-primary { background: var(--blue); color: #fff; }
.btn-primary:hover { background: var(--blue-dark); }
.btn-secondary {
  background: #fff;
  color: var(--navy);
  border: 1px solid var(--line);
}
.btn-secondary:hover { border-color: var(--navy); }
.btn-ghost {
  background: transparent;
  color: var(--blue);
  padding: 6px 10px;
}
.btn-ghost:hover { background: var(--blue-soft); }
.btn-sm { font-size: 13px; padding: 8px 14px; }

.add-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.add-grid .btn-secondary { font-size: 13px; padding: 8px 14px; }

.template-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.link-btn {
  background: none;
  border: 0;
  color: var(--muted);
  font-size: 13px;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
}
.link-btn:hover { color: var(--err); }

/* ---------- style controls ---------- */

.style-grid {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.color-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 10px;
  align-items: center;
}
.color-row label { font-size: 14px; font-weight: 600; color: var(--navy); }
.color-row input[type="color"] {
  width: 44px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 2px;
  background: #fff;
  cursor: pointer;
}
.color-row input[type="text"] {
  width: 86px;
  font: inherit;
  font-size: 13px;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-family: ui-monospace, monospace;
}
.range-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 12px;
  align-items: center;
}
.range-row label { font-size: 14px; font-weight: 600; color: var(--navy); }
.range-row output { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.range-row input[type="range"] { grid-column: 1 / -1; width: 100%; accent-color: var(--blue); }
.select-row { display: flex; flex-direction: column; gap: 4px; }
.select-row label { font-size: 14px; font-weight: 600; color: var(--navy); }
select {
  font: inherit;
  font-size: 14px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  max-width: 280px;
}
.layout-opts { display: flex; gap: 8px; flex-wrap: wrap; }
.layout-opt {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  gap: 6px;
  align-items: center;
}
.layout-opt:has(input:checked) {
  border-color: var(--blue);
  background: var(--blue-soft);
  color: var(--navy);
}
.layout-opt.disabled { opacity: 0.45; }
.hidden { display: none !important; }

/* ---------- accessibility panel ---------- */

.ratios {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 12px;
}
.ratio {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  text-align: center;
  font-size: 12px;
}
.ratio-label { display: block; color: var(--muted); font-weight: 600; }
.ratio-val { display: block; font-size: 16px; font-weight: 800; color: var(--navy); font-variant-numeric: tabular-nums; }
.ratio-need { font-weight: 700; }
.ratio.pass .ratio-need { color: var(--ok); }
.ratio.fail { border-color: var(--err); background: var(--err-bg); }
.ratio.fail .ratio-need { color: var(--err); }

.issues { list-style: none; padding: 0; margin: 0 0 12px; display: flex; flex-direction: column; gap: 8px; }
.issues li {
  font-size: 13px;
  border-radius: 8px;
  padding: 10px 12px;
  display: flex;
  gap: 10px;
  align-items: flex-start;
}
.issues li.error { background: var(--err-bg); color: #7a1414; }
.issues li.warning { background: var(--warn-bg); color: #7a3a06; }
.issue-tag {
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.08);
  margin-top: 1px;
}
.a11y-ok {
  background: var(--ok-bg);
  color: #04402a;
  font-size: 13px;
  font-weight: 600;
  border-radius: 8px;
  padding: 10px 12px;
  margin: 0 0 12px;
}

/* ---------- preview column ---------- */

.preview-col { position: sticky; top: 76px; }
.preview-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 28px;
  margin-bottom: 16px;
  overflow-x: auto;
}
.actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
#code-view {
  background: var(--navy);
  color: #dbe7fd;
  border-radius: 10px;
  padding: 16px;
  font-size: 12px;
  overflow: auto;
  max-height: 380px;
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
}
#code-view code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }

/* ---------- info sections ---------- */

.info-section { padding: 40px 0; }
.info-section h2 {
  color: var(--navy);
  text-align: center;
  margin: 0 0 8px;
  font-size: 26px;
}
.info-section .lede {
  text-align: center;
  color: var(--muted);
  max-width: 640px;
  margin: 0 auto 28px;
}
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}
.card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
}
.card h3 { color: var(--navy); margin: 0 0 10px; font-size: 16px; }
.card ol { margin: 0; padding-left: 20px; font-size: 14px; color: var(--ink); }
.card ol li { margin-bottom: 6px; }
.card code {
  background: #f3f4f6;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 12px;
}
.check-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 12px; }
.check-list li {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px 18px;
  font-size: 14px;
}
.check-list strong { color: var(--navy); }

/* ---------- footer / toast ---------- */

.site-footer {
  background: var(--navy);
  color: #aebdd6;
  padding: 32px 0;
  font-size: 13px;
}
.site-footer .wrap {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
}
.site-footer strong { color: #fff; }

#toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%) translateY(20px);
  background: var(--navy);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  padding: 12px 20px;
  border-radius: 999px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s, transform 0.25s;
  z-index: 100;
  max-width: 90vw;
  text-align: center;
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
#toast.error { background: var(--err); }

/* ---------- responsive ---------- */

@media (max-width: 980px) {
  .builder { grid-template-columns: minmax(0, 1fr); }
  .preview-col { position: static; }
  .site-nav { display: none; }
}
@media (max-width: 560px) {
  .panel { padding: 16px; }
  .sig-bar { flex-wrap: wrap; }
  .save-note { margin-left: 0; }
  .ratios { grid-template-columns: 1fr; }
  .social-row { grid-template-columns: 1fr; }
}

/* ---------- signature switcher ---------- */

.sig-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}
.sig-bar .fld-label { white-space: nowrap; }
#sig-switcher {
  flex: 1;
  min-width: 0;
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  color: var(--navy);
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  max-width: none;
}
.sig-bar-btns { display: flex; gap: 2px; }

/* ---------- top row: designs / language / teams ---------- */

.editor-top-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.seg {
  display: inline-flex;
  border: 1px solid var(--line);
  border-radius: 999px;
  overflow: hidden;
}
.seg button {
  border: 0;
  background: #fff;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  padding: 8px 16px;
  cursor: pointer;
}
.seg button.on {
  background: var(--navy);
  color: #fff;
}
.seg button:not(.on):hover { background: #f3f6fb; }

/* ---------- brand tag on pre-filled blocks ---------- */

.tag-brand {
  display: inline-block;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--blue);
  background: var(--blue-soft);
  border-radius: 999px;
  padding: 2px 8px;
  margin-left: 8px;
  vertical-align: middle;
}

.brand-notice {
  background: var(--blue-soft);
  border: 1px solid #c4d7fa;
  color: var(--navy);
  border-radius: var(--radius);
  padding: 14px 18px;
  font-size: 14px;
  margin-bottom: 20px;
}
.brand-notice .link-btn { margin-left: 8px; }

/* ---------- modals ---------- */

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 36, 64, 0.55);
  backdrop-filter: blur(3px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 20px;
}
.modal-backdrop[hidden] { display: none; }
.modal {
  background: #fff;
  border-radius: 16px;
  max-width: 980px;
  width: 100%;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(15, 36, 64, 0.3);
}
.modal-backdrop:not([hidden]) .modal {
  animation: modal-in 0.18s ease-out;
}
@keyframes modal-in {
  from { transform: translateY(12px) scale(0.98); opacity: 0; }
}
.modal-narrow { max-width: 560px; }
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 24px;
  background: linear-gradient(135deg, var(--navy) 0%, #1b3a6b 100%);
  border-bottom: 0;
}
.modal-head h2 {
  margin: 0;
  font-size: 20px;
  color: #fff;
  letter-spacing: -0.3px;
}
.modal-sub {
  margin: 2px 0 0;
  font-size: 13px;
  color: #aebdd6;
}
.modal-close {
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 0;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}
.modal-close:hover { background: rgba(255, 255, 255, 0.28); }
.modal-body {
  padding: 24px;
  overflow-y: auto;
}

/* ---------- design gallery ---------- */

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 16px;
}
.design-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: #fff;
  transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
}
.design-card:hover {
  border-color: var(--blue);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(15, 36, 64, 0.1);
}
.design-preview {
  height: 150px;
  overflow: hidden;
  background: #fff;
  border-bottom: 1px solid var(--line);
}
.design-preview-inner {
  transform: scale(0.5);
  transform-origin: top left;
  width: 200%;
  padding: 10px;
}
.design-meta { padding: 12px 14px 14px; }
.design-meta h3 {
  margin: 0 0 2px;
  font-size: 15px;
  color: var(--navy);
}
.design-meta p {
  margin: 0 0 10px;
  font-size: 13px;
  color: var(--muted);
}
.design-meta .btn {
  width: 100%;
}

/* ---------- dark-mode preview simulation ---------- */

.preview-card.dark-sim { background: #202124; }
.preview-card.dark-sim #preview > table {
  filter: invert(0.92) hue-rotate(180deg);
}
.warn-note {
  background: var(--warn-bg);
  color: #7a3a06;
  border-radius: 8px;
  padding: 10px 12px;
  margin: 0 0 12px;
  font-weight: 600;
}
.warn-note[hidden] { display: none; }

#brand-link-out {
  font-family: ui-monospace, monospace;
  font-size: 12px;
}

/* ---------- v3: stats band ---------- */

.stats {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
  list-style: none;
  padding: 0;
  margin: 28px 0 0;
}
.stats li {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 22px;
  min-width: 110px;
  text-align: center;
  box-shadow: 0 1px 3px rgba(15, 36, 64, 0.06);
}
.stats strong {
  display: block;
  font-size: 26px;
  font-weight: 800;
  color: var(--navy);
  font-variant-numeric: tabular-nums;
}
.stats span { font-size: 12px; color: var(--muted); font-weight: 600; }

/* ---------- v3: steps indicator ---------- */

.steps {
  display: flex;
  list-style: none;
  padding: 0;
  margin: 0 0 20px;
  border: 1px solid var(--line);
  border-radius: 999px;
  overflow: hidden;
  background: #f8fafc;
}
.steps li { flex: 1; }
.steps a {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 6px;
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  text-decoration: none;
  transition: background 0.2s, color 0.2s;
}
.steps a span {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #e2e8f0;
  color: var(--muted);
  font-size: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, color 0.2s;
}
.steps li.on a { color: var(--navy); background: #fff; }
.steps li.on a span { background: var(--blue); color: #fff; }

/* ---------- v3: editor extras ---------- */

.undo-group {
  display: inline-flex;
  border: 1px solid var(--line);
  border-radius: 999px;
  overflow: hidden;
  background: #fff;
}
.undo-group .icon-btn { border-radius: 0; width: 36px; height: 34px; }
.undo-group .icon-btn:disabled { opacity: 0.35; cursor: default; }
.undo-group .icon-btn:disabled:hover { background: transparent; color: var(--muted); }

.editor-foot {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 14px;
}
.foot-sep { color: var(--line); }

.share-row {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}
.share-row[hidden] { display: none; }
.share-row input {
  flex: 1;
  min-width: 0;
  font: inherit;
  font-size: 13px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.tag-hidden {
  display: inline-block;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--muted);
  background: #f1f5f9;
  border-radius: 999px;
  padding: 2px 8px;
  margin-left: 8px;
  vertical-align: middle;
}
.block-card.is-hidden { opacity: 0.55; }
.block-card.is-hidden .block-fields { display: none; }

.photo-tools { display: flex; flex-direction: column; gap: 4px; }

/* ---------- v3: block card animations ---------- */

@keyframes card-in {
  from { opacity: 0; transform: translateY(-8px); }
}
.block-card.enter { animation: card-in 0.22s ease-out; }
.block-card.leaving {
  transition: opacity 0.18s, transform 0.18s;
  opacity: 0;
  transform: translateX(24px);
}

/* ---------- v3: preview effects ---------- */

@keyframes preview-pulse {
  0% { box-shadow: 0 0 0 0 rgba(26, 86, 219, 0.35); }
  100% { box-shadow: 0 0 0 12px rgba(26, 86, 219, 0); }
}
.preview-card.pulse { animation: preview-pulse 0.45s ease-out; }

.preview-card { position: relative; }
@keyframes shine-sweep {
  from { transform: translateX(-120%) skewX(-18deg); }
  to { transform: translateX(240%) skewX(-18deg); }
}
.preview-card.shine { overflow: hidden; }
.preview-card.shine::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  width: 45%;
  background: linear-gradient(90deg, transparent, rgba(26, 86, 219, 0.12), transparent);
  animation: shine-sweep 0.9s ease-out;
  pointer-events: none;
}
.preview-card.mobile-sim { max-width: 375px; margin-left: auto; margin-right: auto; }
.btn.copied { background: var(--ok); border-color: var(--ok); color: #fff; }

/* ---------- v3: gallery tools + skeletons ---------- */

.gallery-tools {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 16px;
}
.gallery-tools input[type="search"] {
  flex: 1;
  min-width: 180px;
  font: inherit;
  font-size: 14px;
  padding: 9px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #f8fafc;
}
.gchips { display: flex; gap: 6px; flex-wrap: wrap; }
.gchip {
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 14px;
  cursor: pointer;
}
.gchip:hover { border-color: var(--navy); color: var(--navy); }
.gchip.on { background: var(--navy); border-color: var(--navy); color: #fff; }

@keyframes shimmer {
  from { background-position: -400px 0; }
  to { background-position: 400px 0; }
}
.design-preview.shimmer {
  background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%);
  background-size: 800px 100%;
  animation: shimmer 1.2s linear infinite;
  border-bottom: 1px solid var(--line);
}
.sk-line {
  height: 14px;
  border-radius: 7px;
  background: #eef2f7;
  margin-bottom: 8px;
}
.sk-line.short { width: 60%; }

/* ---------- v3: history ---------- */

.history-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 14px;
  margin-bottom: 8px;
}
.history-item strong { display: block; font-size: 14px; color: var(--navy); }
.history-when { font-size: 12px; color: var(--muted); }

/* ---------- v3: accordions ---------- */

.acc-head {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  font: inherit;
  text-align: left;
}
.acc-head h3 { margin: 0; }
.acc-chev {
  color: var(--muted);
  font-size: 14px;
  transition: transform 0.25s;
}
.acc.open .acc-chev { transform: rotate(180deg); }
.acc-panel {
  display: grid;
  grid-template-rows: 1fr;
  transition: grid-template-rows 0.28s ease, visibility 0.28s;
  visibility: visible;
}
.acc:not(.open) .acc-panel { grid-template-rows: 0fr; visibility: hidden; }
.acc-inner { overflow: hidden; min-height: 0; }

/* ---------- v3: entrance + scroll animations ---------- */

@keyframes hero-rise {
  from { opacity: 0; transform: translateY(18px); }
}
.hero .badge { animation: hero-rise 0.5s ease-out both; }
.hero h1 { animation: hero-rise 0.5s 0.08s ease-out both; }
.hero p { animation: hero-rise 0.5s 0.16s ease-out both; }
.hero-points { animation: hero-rise 0.5s 0.24s ease-out both; }
.stats { animation: hero-rise 0.5s 0.32s ease-out both; }

.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.5s ease-out, transform 0.5s ease-out;
}
.reveal.in { opacity: 1; transform: none; }

/* ---------- v3: reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .reveal { opacity: 1; transform: none; }
  .hero .badge, .hero h1, .hero p, .hero-points, .stats { animation: none; }
}

@media (max-width: 560px) {
  .steps a { font-size: 12px; }
  .steps a span { width: 20px; height: 20px; }
}

/* ---------- legal pages ---------- */

.legal {
  max-width: 820px;
  margin: 0 auto;
  padding: 48px 24px 72px;
}
.legal .badge {
  display: inline-block;
  background: var(--blue-soft);
  color: var(--blue);
  font-weight: 700;
  font-size: 13px;
  padding: 6px 14px;
  border-radius: 999px;
  margin-bottom: 16px;
}
.legal h1 {
  color: var(--navy);
  font-size: clamp(28px, 4vw, 38px);
  letter-spacing: -0.5px;
  margin: 0 0 8px;
}
.legal .updated { color: var(--muted); font-size: 14px; margin: 0 0 8px; }
.legal h2 {
  color: var(--navy);
  font-size: 20px;
  margin: 36px 0 8px;
}
.legal p, .legal li { font-size: 15px; color: var(--ink); }
.legal ul { padding-left: 22px; margin: 8px 0 16px; }
.legal li { margin-bottom: 8px; }
.legal a { color: var(--blue); }
.legal .card { margin-top: 24px; }

/* ---------- footer links ---------- */

.footer-links { display: flex; gap: 18px; flex-wrap: wrap; }
.site-footer a { color: #aebdd6; text-decoration: none; font-size: 13px; }
.site-footer a:hover { color: #fff; text-decoration: underline; }

/* ---------- scroll to top ---------- */

#to-top {
  position: fixed;
  right: 24px;
  bottom: 24px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--navy);
  color: #fff;
  border: 0;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: opacity 0.25s, transform 0.25s, background 0.2s;
  z-index: 150;
  box-shadow: 0 6px 18px rgba(15, 36, 64, 0.28);
}
#to-top.show { opacity: 1; transform: none; pointer-events: auto; }
#to-top:hover { background: var(--blue); }

/* ---------- autosave indicator ---------- */

.save-note {
  margin-left: auto;
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
}
.save-note.flash { color: var(--ok); }

/* ---------- signature size meter ---------- */

.size-meter { margin-top: 18px; }
.size-meter-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 6px;
}
.size-meter-value { font-size: 13px; font-weight: 700; color: var(--ink); }
.size-meter-track {
  height: 8px;
  border-radius: 999px;
  background: #e8edf5;
  overflow: hidden;
}
.size-meter-fill {
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: var(--ok);
  transition: width 0.3s;
}
.size-meter.fill-watch .size-meter-fill { background: var(--warn); }
.size-meter.fill-heavy .size-meter-fill { background: var(--err); }
.size-meter .hint { margin-top: 6px; }

/* ---------- tour ---------- */

.tour-body h3 { margin: 0 0 8px; color: var(--navy); font-size: 18px; }
.tour-body p { font-size: 14px; color: var(--ink); margin: 0 0 10px; }
.tour-dots { display: flex; gap: 8px; margin: 16px 0 4px; }
.tour-dots button {
  width: 10px; height: 10px; border-radius: 50%;
  border: 0; background: var(--line); cursor: pointer; padding: 0;
}
.tour-dots button.on { background: var(--blue); }
.tour-never { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); margin: 10px 0; cursor: pointer; }
.tour-actions { align-items: center; }
.tour-spacer { flex: 1; }

/* ---------- shortcuts ---------- */

.shortcut-list { list-style: none; margin: 0 0 12px; padding: 0; }
.shortcut-list li {
  display: flex; justify-content: space-between; align-items: center;
  gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line);
  font-size: 14px;
}
.shortcut-list li:last-child { border-bottom: 0; }
.keys { white-space: nowrap; }
kbd, .kbd {
  display: inline-block;
  padding: 2px 8px;
  border: 1px solid var(--line);
  border-bottom-width: 2px;
  border-radius: 6px;
  background: #f3f6fb;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink);
}

/* ---------- pre-flight checklist ---------- */

.preflight-progress {
  height: 8px; border-radius: 999px; background: #e8edf5; overflow: hidden; margin-bottom: 8px;
}
.preflight-bar { height: 100%; width: 0; background: var(--blue); border-radius: 999px; transition: width 0.3s; }
.preflight-count { font-size: 13px; font-weight: 700; color: var(--muted); margin: 0 0 8px; }
.preflight-list { list-style: none; margin: 0; padding: 0; }
.preflight-list li {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 10px 12px; margin-bottom: 8px;
  border: 1px solid var(--line); border-radius: 10px; background: var(--card);
  font-size: 14px; cursor: pointer;
}
.preflight-list li.done { border-color: var(--ok); background: var(--ok-bg); }
.preflight-list input { margin-top: 3px; accent-color: var(--blue); }
.preflight-list li.done span { text-decoration: line-through; color: var(--muted); }

/* ---------- footer buttons ---------- */

.footer-btn {
  background: none; border: 0; padding: 0;
  color: #aebdd6; font-size: 13px; cursor: pointer; font-family: inherit;
}
.footer-btn:hover { color: #fff; text-decoration: underline; }
