@font-face {
  font-family: 'Crimson Text';
  src: url('fonts/CrimsonText-Regular.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Crimson Text';
  src: url('fonts/CrimsonText-SemiBold.ttf') format('truetype');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Crimson Text';
  src: url('fonts/CrimsonText-Italic.ttf') format('truetype');
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}

:root {
  --bg: #ece7df;
  --surface: #faf8f4;
  --card-paper: #faf8f3;
  --ink: #26231f;
  --muted: #6e675e;
  --border: #dcd5c9;
  --accent: #2d3e38;
  --accent-hover: #21302b;
  --danger: #9a3832;
  --shadow-card: 0 22px 54px rgba(38, 35, 31, 0.14), 0 4px 12px rgba(38, 35, 31, 0.06);
  --shadow-soft: 0 8px 24px rgba(38, 35, 31, 0.08);
  --radius: 12px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  min-height: 100%;
}

.hidden { display: none !important; }

.app-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Top bar */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(250, 248, 244, 0.94);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.topbar-inner {
  max-width: 1240px;
  margin: 0 auto;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.topbar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
}

.topbar-logo {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  flex-shrink: 0;
}

.topbar-brand-text {
  display: flex;
  align-items: baseline;
  gap: 10px;
  min-width: 0;
  overflow: hidden;
}

.topbar-title {
  font-family: 'Crimson Text', Georgia, serif;
  font-size: 1.28rem;
  font-weight: 600;
  color: var(--ink);
  min-width: 0;
  flex: 0 1 auto;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topbar-meta {
  font-size: 0.84rem;
  color: var(--muted);
  white-space: nowrap;
  flex-shrink: 0;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-shrink: 0;
}

.lang-select {
  font-family: inherit;
  font-size: 0.82rem;
  padding: 6px 8px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
}

.icon-pill {
  min-width: 32px;
  padding-left: 8px;
  padding-right: 8px;
  font-weight: 700;
}

/* Error state */
.error-state {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 16px;
}

.error-card {
  max-width: 440px;
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 28px 24px;
  text-align: center;
  box-shadow: var(--shadow-soft);
}

.error-card h1 {
  margin: 0 0 8px;
  font-family: 'Crimson Text', Georgia, serif;
  font-size: 1.6rem;
}

.error-card p {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 0.94rem;
  line-height: 1.5;
}

/* Workspace */
.workspace {
  flex: 1 1 auto;
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  padding: 20px 18px 40px;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  gap: 26px;
}

.stage-column {
  flex: 1 1 auto;
  max-width: 720px;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.privacy-pill {
  font-size: 0.78rem;
  color: #244036;
  background: #e3ece7;
  border: 1px solid #c4d7cd;
  padding: 5px 12px;
  border-radius: 999px;
  text-align: center;
}

.status-banner,
.placement-hint {
  width: 100%;
  border-radius: 10px;
  line-height: 1.4;
  text-align: center;
}

.status-banner {
  padding: 11px 14px;
  font-size: 0.9rem;
  background: #f4ece0;
  border: 1px solid #d9cbb6;
  color: #4f4232;
}

.placement-hint {
  padding: 8px 12px;
  font-size: 0.84rem;
  background: #e5eee9;
  border: 1px solid #bdd2c7;
  color: #1f392e;
  font-weight: 500;
}

.card-frame {
  width: 100%;
  max-width: 680px;
  background: var(--card-paper);
  border-radius: 5px;
  box-shadow: var(--shadow-card);
  overflow: hidden;
  position: relative;
}

#card-canvas {
  display: block;
  width: 100%;
  height: auto;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

#card-canvas.interactive { touch-action: none; cursor: grab; }
#card-canvas.dragging { cursor: grabbing; }

/* Placement bar (in-flow below card, never overlaps signatures) */
.floating-bar {
  width: 100%;
  max-width: 680px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.floating-sliders {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.slider-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.8rem;
  color: var(--muted);
}

.slider-group input[type="range"] {
  width: 100%;
  accent-color: var(--accent);
}

.floating-buttons {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

/* Signer CTA */
.signer-cta-bar {
  width: 100%;
  max-width: 680px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  text-align: center;
}

.signer-cta-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.signer-hint {
  margin: 0;
  font-size: 0.84rem;
  color: var(--muted);
}

/* Buttons */
.btn {
  appearance: none;
  border: 1px solid transparent;
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 500;
  padding: 9px 15px;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: background 0.15s ease, border-color 0.15s ease, opacity 0.15s ease;
}

.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--accent-hover); }
.btn-secondary { background: #e6e0d6; color: var(--ink); border-color: #d2c9ba; }
.btn-secondary:hover:not(:disabled) { background: #dcd4c7; }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--border); }
.btn-ghost:hover:not(:disabled) { background: rgba(38, 35, 31, 0.05); }
.btn-danger-ghost { background: transparent; color: var(--danger); border-color: #dfbbb8; }
.btn-danger-ghost:hover:not(:disabled) { background: #faeceb; }
.btn-lg { padding: 12px 22px; font-size: 0.98rem; border-radius: 10px; }
.btn-sm { padding: 7px 11px; font-size: 0.84rem; }
.btn-xs { padding: 5px 9px; font-size: 0.78rem; }
.btn-full { width: 100%; }
.btn-icon { width: 16px; height: 16px; flex-shrink: 0; }

/* Side panels (Builder & Organizer) */
.side-panel {
  width: 380px;
  flex: 0 0 380px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.panel-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow-soft);
  display: flex;
  flex-direction: column;
  gap: 11px;
}

.builder-heading {
  margin: 0;
  font-family: 'Crimson Text', Georgia, serif;
  font-size: 1.5rem;
  font-weight: 600;
  line-height: 1.2;
}

.panel-heading-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.panel-heading {
  margin: 0;
  font-size: 0.98rem;
  font-weight: 600;
}

.panel-sub {
  margin: 0;
  font-size: 0.82rem;
  line-height: 1.45;
  color: var(--muted);
}

.occasion-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.occasion-chip {
  appearance: none;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--ink);
  border-radius: 8px;
  padding: 7px 6px;
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  transition: all 0.14s ease;
}

.occasion-chip:hover { background: #f3efe8; }
.occasion-chip.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.theme-dots {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-top: 4px;
}

.theme-dot {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid #cfc6b8;
  cursor: pointer;
  padding: 0;
  transition: transform 0.12s ease;
}

.theme-dot.active {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--accent);
  transform: scale(1.08);
}

.photo-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.compact-select {
  font-family: inherit;
  font-size: 0.82rem;
  padding: 6px 8px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: #fff;
  color: var(--ink);
}

.settings-form { display: flex; flex-direction: column; gap: 10px; }

.field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.8rem;
  color: var(--muted);
}

.field input[type="text"],
.field textarea,
.field select {
  font-family: inherit;
  font-size: 0.9rem;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: #fff;
  color: var(--ink);
  width: 100%;
}

.field textarea { resize: vertical; line-height: 1.45; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.align-center { align-items: center; }
.top-pad { padding-top: 16px; }

.checkbox-field {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.84rem;
  color: var(--ink);
  cursor: pointer;
}

.share-box { display: flex; gap: 6px; }
.share-box input {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 0.8rem;
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: #f2eee7;
  color: var(--ink);
}

.btn-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }

.download-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
}

.span-2 { grid-column: span 2; }

.recent-list,
.sig-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.sig-list { max-height: 300px; overflow-y: auto; }

.recent-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  font-size: 0.84rem;
}

.recent-item a {
  color: var(--ink);
  text-decoration: none;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.recent-item a:hover { text-decoration: underline; }

.sig-list-empty { font-size: 0.82rem; color: var(--muted); padding: 6px 0; }

.sig-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 9px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
}

.sig-item:hover { background: #f6f3ed; }
.sig-item.selected { border-color: var(--accent); background: #eef4f1; }

.sig-thumb {
  width: 82px;
  height: 36px;
  border-radius: 5px;
  background: var(--card-paper);
  border: 1px solid #ece5da;
  flex-shrink: 0;
}

.sig-item-meta { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.sig-item-name { font-size: 0.84rem; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sig-item-time { font-size: 0.72rem; color: var(--muted); }
.sig-item-del {
  background: transparent;
  border: none;
  color: var(--muted);
  font-size: 1.1rem;
  padding: 4px 6px;
  cursor: pointer;
  border-radius: 5px;
}
.sig-item-del:hover { color: var(--danger); background: #faeceb; }

/* Modals */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(25, 22, 19, 0.56);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px;
}

.modal-sheet {
  width: 100%;
  max-width: 600px;
  background: var(--surface);
  border-radius: 16px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.25);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 13px;
  max-height: 94vh;
  overflow-y: auto;
}

.modal-compact { max-width: 360px; }
.modal-welcome { max-width: 460px; text-align: center; padding: 24px 22px; }

.modal-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.modal-header h2, .modal-welcome h2 {
  margin: 0;
  font-family: 'Crimson Text', Georgia, serif;
  font-size: 1.5rem;
  font-weight: 600;
}
.modal-sub { margin: 2px 0 0; font-size: 0.84rem; color: var(--muted); line-height: 1.4; }
.icon-close { background: transparent; border: none; font-size: 1.7rem; line-height: 1; color: var(--muted); cursor: pointer; padding: 2px 6px; }

.mode-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  background: #ebe5dc;
  border-radius: 10px;
  padding: 4px;
}

.mode-tab {
  appearance: none;
  border: none;
  background: transparent;
  color: var(--muted);
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 500;
  padding: 8px 10px;
  border-radius: 7px;
  cursor: pointer;
}

.mode-tab.active {
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 1px 4px rgba(38, 35, 31, 0.12);
}

.modal-mode-section { display: flex; flex-direction: column; gap: 10px; }

.pad-wrap {
  position: relative;
  width: 100%;
  height: 220px;
  background: var(--card-paper);
  border: 1.5px solid #cfc6b8;
  border-radius: 10px;
  overflow: hidden;
}

#pad-canvas {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  cursor: crosshair;
}

.pad-baseline {
  position: absolute;
  left: 24px;
  right: 24px;
  bottom: 50px;
  height: 1px;
  background: rgba(145, 134, 118, 0.26);
  pointer-events: none;
}

.pad-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Crimson Text', Georgia, serif;
  font-style: italic;
  font-size: 1.25rem;
  color: rgba(110, 103, 94, 0.52);
  pointer-events: none;
}

.pad-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.tool-group { display: flex; align-items: center; gap: 7px; }

.ink-dot,
.img-ink-dot {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  padding: 0;
  transition: transform 0.12s ease;
}

.ink-graphite { background: #1D232A; }
.ink-navy { background: #1B3252; }
.ink-forest { background: #1E3A2F; }
.ink-sepia { background: #4B3626; }

.ink-dot.active,
.img-ink-dot.active {
  box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--ink);
  transform: scale(1.08);
}

.img-ink-original {
  width: auto;
  height: 26px;
  padding: 0 9px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--ink);
  font-family: inherit;
  font-size: 0.74rem;
  font-weight: 500;
}

.img-ink-original.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  box-shadow: none;
  transform: none;
}

.width-pills .pill {
  border: 1px solid var(--border);
  background: #fff;
  color: var(--ink);
  border-radius: 999px;
  padding: 4px 9px;
  font-size: 0.76rem;
  cursor: pointer;
}

.width-pills .pill.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

/* Image Dropzone & Crop Frame */
.img-dropzone {
  position: relative;
  width: 100%;
  min-height: 220px;
  background: var(--card-paper);
  border: 1.5px dashed #c7bdb0;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  cursor: pointer;
}

.img-dropzone.has-image { border-style: solid; border-color: #cfc6b8; cursor: default; }
.img-dropzone.drag-over { border-color: var(--accent); border-style: dashed; background: #ebf2ee; }

.img-dropzone-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 20px;
  gap: 8px;
}

.img-drop-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-bottom: 4px; }
.img-drop-title { font-size: 0.94rem; font-weight: 500; color: var(--ink); }
.img-drop-hint { font-size: 0.8rem; line-height: 1.45; color: var(--muted); max-width: 400px; }

.img-preview-wrap {
  position: relative;
  width: 100%;
  height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  cursor: grab;
}

.img-preview-wrap.dragging { cursor: grabbing; }
#img-preview-canvas { display: block; width: 100%; height: 100%; touch-action: none; }

.img-crop-guide {
  position: absolute;
  inset: 10px;
  border: 1px dashed rgba(45, 62, 56, 0.25);
  border-radius: 6px;
  pointer-events: none;
}

.img-status-msg {
  font-size: 0.82rem;
  color: var(--danger);
  background: #faeceb;
  border: 1px solid #e6c6c4;
  border-radius: 8px;
  padding: 8px 10px;
  text-align: center;
}

.img-controls { display: flex; flex-direction: column; gap: 9px; }

.img-framing-row,
.img-bg-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  background: #f3efe8;
  border-radius: 8px;
}

.img-zoom-group,
.img-threshold-group { flex: 1 1 160px; min-width: 130px; }

.img-framing-hint {
  font-size: 0.76rem;
  color: var(--muted);
  text-align: center;
  margin-top: -3px;
}

.modal-footer { display: flex; justify-content: flex-end; gap: 8px; padding-top: 2px; }

/* Post-creation & QR */
.qr-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 10px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
}

.qr-hero canvas {
  width: 180px;
  height: 180px;
  image-rendering: pixelated;
}

.admin-secret-box {
  background: #f7f1e7;
  border: 1px solid #e2d4be;
  border-radius: 10px;
  padding: 10px;
}

/* luontoretki.fi-style Welcome & Spotlight Tutorial */
.welcome-langs {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
}

.lang-flag-btn {
  appearance: none;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--ink);
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.lang-flag-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.welcome-p {
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.5;
  color: var(--ink);
}

.welcome-em {
  color: #214034;
  background: #e6efe9;
  border-radius: 8px;
  padding: 9px 12px;
  font-size: 0.86rem;
  font-weight: 500;
}

.welcome-once { margin: 0; font-size: 0.78rem; color: var(--muted); }
.welcome-actions { display: flex; flex-direction: column; gap: 8px; margin-top: 4px; }

.tour-backdrop {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(25, 22, 19, 0.5);
}

.tour-spotlight {
  position: relative !important;
  z-index: 65 !important;
  box-shadow: 0 0 0 4px var(--surface), 0 0 0 7px var(--accent), 0 18px 40px rgba(0, 0, 0, 0.35) !important;
  border-radius: 12px;
}

.tour-card {
  position: fixed;
  z-index: 70;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 15px 16px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.tour-step-label {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent);
}

.tour-title {
  margin: 0;
  font-family: 'Crimson Text', Georgia, serif;
  font-size: 1.25rem;
}

.tour-body { margin: 0; font-size: 0.86rem; line-height: 1.45; color: var(--muted); }
.tour-actions { display: flex; justify-content: space-between; align-items: center; margin-top: 4px; }

/* Full-page drop overlay */
.page-drop-overlay {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(31, 44, 39, 0.48);
  backdrop-filter: blur(5px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  pointer-events: none;
}

.page-drop-box {
  background: var(--surface);
  border: 2px dashed var(--accent);
  border-radius: 18px;
  padding: 32px 36px;
  max-width: 420px;
  width: 100%;
  text-align: center;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.25);
}

.page-drop-title {
  font-family: 'Crimson Text', Georgia, serif;
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 6px;
}

.page-drop-sub { font-size: 0.86rem; color: var(--muted); }

/* Footer & Toast */
.site-footer {
  padding: 14px 16px 22px;
  text-align: center;
  font-size: 0.78rem;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

.site-footer a { color: var(--accent); text-decoration: none; font-weight: 500; }
.site-footer a:hover { text-decoration: underline; }

.toast {
  position: fixed;
  left: 50%;
  bottom: 20px;
  transform: translateX(-50%);
  z-index: 95;
  background: #23211e;
  color: #fff;
  padding: 10px 16px;
  border-radius: 10px;
  font-size: 0.88rem;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.25);
  max-width: 92vw;
  text-align: center;
}

/* Mobile adjustments */
@media (max-width: 960px) {
  .workspace {
    flex-direction: column;
    align-items: center;
    padding: 10px 10px 24px;
    gap: 14px;
  }

  .stage-column { gap: 10px; }
  .side-panel { width: 100%; max-width: 680px; flex: 1 1 auto; }
  .pad-wrap, .img-preview-wrap { height: 200px; }

  .floating-bar { padding: 9px 11px; gap: 8px; }
  .floating-sliders { grid-template-columns: 1fr 1fr; gap: 10px; }
  .floating-buttons { flex-wrap: nowrap; justify-content: space-between; gap: 6px; }
  .floating-buttons .btn { flex: 1 1 0; padding: 8px; font-size: 0.84rem; }
}

@media (max-width: 640px) {
  .topbar-inner { padding: 9px 12px; gap: 8px; }
  .topbar-logo { width: 24px; height: 24px; }
  .topbar-brand-text { flex-direction: column; align-items: flex-start; gap: 1px; }
  .topbar-title { max-width: 100%; font-size: 1.05rem; line-height: 1.2; }
  .topbar-meta { font-size: 0.76rem; }
  #btn-new-card { display: none; }

  .signer-cta-bar { gap: 6px; }
  .signer-cta-actions { width: 100%; flex-wrap: nowrap; gap: 6px; }
  .signer-cta-actions .btn { flex: 1 1 0; padding: 9px 7px; font-size: 0.83rem; white-space: nowrap; }
  .signer-hint { font-size: 0.78rem; }
}
