/* ============================================================
   Inkwell design system — implemented from DESIGN-claude.md
   Cream canvas · coral primary · serif display · dark navy surfaces
   ============================================================ */

:root {
  /* colors */
  --primary: #cc785c;
  --primary-active: #a9583e;
  --primary-disabled: #e6dfd8;
  --ink: #141413;
  --body: #3d3d3a;
  --body-strong: #252523;
  --muted: #6c6a64;
  --muted-soft: #8e8b82;
  --hairline: #e6dfd8;
  --hairline-soft: #ebe6df;
  --canvas: #faf9f5;
  --surface-soft: #f5f0e8;
  --surface-card: #efe9de;
  --surface-cream-strong: #e8e0d2;
  --surface-dark: #181715;
  --surface-dark-elevated: #252320;
  --surface-dark-soft: #1f1e1b;
  --on-primary: #ffffff;
  --on-dark: #faf9f5;
  --on-dark-soft: #a09d96;
  --accent-teal: #5db8a6;
  --accent-amber: #e8a55a;
  --success: #5db872;
  --warning: #d4a017;
  --error: #c64545;

  /* type */
  --font-display: "Cormorant Garamond", "Tiempos Headline", Garamond, "Times New Roman", serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;

  /* radius */
  --r-xs: 4px; --r-sm: 6px; --r-md: 8px; --r-lg: 12px; --r-xl: 16px; --r-pill: 9999px;

  /* spacing */
  --sp-xxs: 4px; --sp-xs: 8px; --sp-sm: 12px; --sp-md: 16px;
  --sp-lg: 24px; --sp-xl: 32px; --sp-xxl: 48px; --sp-section: 96px;

  --shadow-soft: 0 1px 3px rgba(20, 20, 19, 0.08);
}

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

html, body { height: 100%; }

body {
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 400;
  line-height: 1.55;
  color: var(--body);
  background: var(--canvas);
  -webkit-font-smoothing: antialiased;
}

/* ---------- typography ---------- */

h1, h2, h3, .display {
  font-family: var(--font-display);
  font-weight: 500; /* Cormorant needs 500 to match Copernicus 400 presence */
  color: var(--ink);
}
.display-xl { font-size: 64px; line-height: 1.05; letter-spacing: -1.5px; }
.display-lg { font-size: 48px; line-height: 1.1; letter-spacing: -1px; }
.display-md { font-size: 36px; line-height: 1.15; letter-spacing: -0.5px; }
.display-sm { font-size: 28px; line-height: 1.2; letter-spacing: -0.3px; }
.title-lg { font-family: var(--font-body); font-size: 22px; font-weight: 500; line-height: 1.3; color: var(--ink); }
.title-md { font-family: var(--font-body); font-size: 18px; font-weight: 500; line-height: 1.4; color: var(--ink); }
.title-sm { font-family: var(--font-body); font-size: 16px; font-weight: 500; line-height: 1.4; color: var(--ink); }
.body-sm { font-size: 14px; }
.caption { font-size: 13px; font-weight: 500; line-height: 1.4; }
.caption-upper { font-size: 12px; font-weight: 500; letter-spacing: 1.5px; text-transform: uppercase; }
.muted { color: var(--muted); }
.muted-soft { color: var(--muted-soft); }
.mono { font-family: var(--font-mono); font-size: 14px; line-height: 1.6; }

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

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

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--font-body); font-size: 14px; font-weight: 500; line-height: 1;
  height: 40px; padding: 12px 20px; border-radius: var(--r-md);
  border: none; cursor: pointer; white-space: nowrap;
  transition: background-color 120ms ease;
  text-decoration: none;
}
.btn:disabled { cursor: default; }

.btn-primary { background: var(--primary); color: var(--on-primary); }
.btn-primary:hover, .btn-primary:active { background: var(--primary-active); }
.btn-primary:disabled { background: var(--primary-disabled); color: var(--muted); }

.btn-secondary {
  background: var(--canvas); color: var(--ink);
  border: 1px solid var(--hairline);
}
.btn-secondary:active { background: var(--surface-soft); }

.btn-secondary-dark { background: var(--surface-dark-elevated); color: var(--on-dark); }

.btn-on-coral { background: var(--canvas); color: var(--ink); }

.btn-text { background: transparent; color: var(--ink); border: none; }
.btn-text:active { text-decoration: underline; }

.btn-danger-text { background: transparent; color: var(--error); border: none; }

.btn-icon {
  width: 36px; height: 36px; padding: 0; border-radius: var(--r-pill);
  background: var(--canvas); color: var(--ink); border: 1px solid var(--hairline);
  display: inline-flex; align-items: center; justify-content: center; cursor: pointer;
}

.btn-lg { height: 48px; padding: 14px 28px; font-size: 15px; }

/* ---------- inputs ---------- */

.input, .select, .textarea {
  font-family: var(--font-body); font-size: 16px; color: var(--ink);
  background: var(--canvas); border: 1px solid var(--hairline);
  border-radius: var(--r-md); padding: 10px 14px; height: 40px; width: 100%;
  outline: none;
}
.textarea { height: auto; min-height: 96px; resize: vertical; line-height: 1.55; }
.input:focus, .select:focus, .textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(204, 120, 92, 0.15);
}
.select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%236c6a64' stroke-width='1.5' fill='none'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 34px; }

.field-label { display: block; font-size: 13px; font-weight: 500; color: var(--body-strong); margin-bottom: 6px; }
.field-group { margin-bottom: var(--sp-md); }
.field-error { color: var(--error); font-size: 13px; margin-top: 6px; }

.checkbox-row { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--body); cursor: pointer; }
.checkbox-row input { width: 16px; height: 16px; accent-color: var(--primary); }

/* ---------- badges ---------- */

.badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 13px; font-weight: 500; line-height: 1.4;
  background: var(--surface-card); color: var(--ink);
  border-radius: var(--r-pill); padding: 4px 12px;
}
.badge-coral { background: var(--primary); color: var(--on-primary); font-size: 12px; letter-spacing: 1.5px; text-transform: uppercase; }
.badge .dot { width: 8px; height: 8px; border-radius: 50%; flex: 0 0 auto; }

.badge-status-draft .dot { background: var(--muted-soft); }
.badge-status-sent .dot { background: var(--accent-amber); }
.badge-status-completed .dot { background: var(--success); }
.badge-status-voided .dot { background: var(--muted); }
.badge-status-declined .dot { background: var(--error); }
.badge-status-viewed .dot { background: var(--accent-teal); }
.badge-status-created .dot { background: var(--muted-soft); }

/* ---------- top nav ---------- */

.top-nav {
  height: 64px; background: var(--canvas);
  border-bottom: 1px solid var(--hairline-soft);
  display: flex; align-items: center; gap: var(--sp-lg);
  padding: 0 var(--sp-xl);
  position: sticky; top: 0; z-index: 50;
}
.brand { display: flex; align-items: center; gap: 10px; cursor: pointer; text-decoration: none; }
.brand-mark { width: 22px; height: 22px; flex: 0 0 auto; }
.brand-name { font-family: var(--font-display); font-weight: 600; font-size: 24px; letter-spacing: -0.3px; color: var(--ink); }

.nav-links { display: flex; align-items: center; gap: 4px; }
.nav-link {
  font-size: 14px; font-weight: 500; color: var(--muted);
  padding: 8px 14px; border-radius: var(--r-md); cursor: pointer;
  background: transparent; border: none; font-family: var(--font-body);
  text-decoration: none;
}
.nav-link.active { background: var(--surface-card); color: var(--ink); }
.nav-spacer { flex: 1; }

.avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--surface-dark); color: var(--on-dark);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 500; cursor: pointer; border: none;
  font-family: var(--font-body);
}

.user-menu {
  position: absolute; right: var(--sp-xl); top: 60px;
  background: var(--canvas); border: 1px solid var(--hairline);
  border-radius: var(--r-lg); box-shadow: var(--shadow-soft);
  min-width: 240px; padding: var(--sp-xs); z-index: 100;
}
.user-menu .menu-head { padding: 10px 12px; border-bottom: 1px solid var(--hairline-soft); margin-bottom: 6px; }
.user-menu button {
  display: block; width: 100%; text-align: left;
  font-family: var(--font-body); font-size: 14px; font-weight: 500;
  color: var(--ink); background: transparent; border: none;
  padding: 9px 12px; border-radius: var(--r-sm); cursor: pointer;
}
.user-menu button:hover { background: var(--surface-soft); }

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

.container { max-width: 1200px; margin: 0 auto; padding: 0 var(--sp-xl); }
.page { padding: var(--sp-xl) 0 var(--sp-section); }

.card {
  background: var(--canvas); border: 1px solid var(--hairline);
  border-radius: var(--r-lg); padding: var(--sp-xl);
}
.card-cream { background: var(--surface-card); border: none; }
.card-dark { background: var(--surface-dark); border: none; color: var(--on-dark); }
.card-dark h2, .card-dark h3 { color: var(--on-dark); }

.row { display: flex; align-items: center; gap: var(--sp-md); }
.spread { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-md); }
.stack { display: flex; flex-direction: column; gap: var(--sp-md); }

/* ---------- landing ---------- */

.hero-band { padding: var(--sp-section) 0; }
.hero-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-xxl); align-items: center; }
.hero-eyebrow { margin-bottom: var(--sp-md); }
.hero-sub { font-size: 18px; color: var(--body); margin: var(--sp-lg) 0 var(--sp-xl); max-width: 480px; }

.hero-mock {
  background: var(--surface-dark); border-radius: var(--r-xl);
  padding: var(--sp-lg); color: var(--on-dark);
}
.hero-mock .mock-titlebar { display: flex; gap: 6px; margin-bottom: 14px; }
.hero-mock .mock-titlebar span { width: 10px; height: 10px; border-radius: 50%; background: var(--surface-dark-elevated); }
.mock-doc {
  background: var(--surface-dark-soft); border-radius: var(--r-md);
  padding: var(--sp-lg); font-family: var(--font-mono); font-size: 13px; line-height: 1.7;
  color: var(--on-dark-soft);
}
.mock-doc .hl { color: var(--accent-amber); }
.mock-doc .teal { color: var(--accent-teal); }
.mock-sig-line {
  margin-top: 16px; padding: 12px 16px;
  border: 1px dashed var(--primary); border-radius: var(--r-md);
  display: flex; align-items: center; justify-content: space-between;
  color: var(--on-dark);
}
.mock-sig-line .sig { font-family: "Caveat", cursive; font-size: 26px; color: var(--primary); }

.section { padding: var(--sp-section) 0 0; }
.section-head { max-width: 640px; margin-bottom: var(--sp-xl); }
.section-head p { margin-top: var(--sp-md); color: var(--body); }

.feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--sp-lg); }
.feature-card {
  background: var(--surface-card); border-radius: var(--r-lg); padding: var(--sp-xl);
}
.feature-card .icon { margin-bottom: var(--sp-md); color: var(--ink); }
.feature-card h3 { font-family: var(--font-body); font-size: 18px; font-weight: 500; margin-bottom: var(--sp-xs); }
.feature-card p { font-size: 15px; color: var(--body); }

.steps-band { background: var(--surface-dark); border-radius: var(--r-lg); padding: var(--sp-xxl); color: var(--on-dark); }
.steps-band h2 { color: var(--on-dark); margin-bottom: var(--sp-xl); }
.steps-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--sp-xl); }
.step-num { font-family: var(--font-display); font-size: 36px; color: var(--primary); line-height: 1; margin-bottom: var(--sp-sm); }
.steps-grid h4 { color: var(--on-dark); font-size: 16px; font-weight: 500; margin-bottom: 6px; }
.steps-grid p { color: var(--on-dark-soft); font-size: 14px; }

.cta-band {
  background: var(--primary); color: var(--on-primary);
  border-radius: var(--r-lg); padding: 64px;
  display: flex; align-items: center; justify-content: space-between; gap: var(--sp-xl);
}
.cta-band h2 { color: var(--on-primary); }
.cta-band p { color: rgba(255,255,255,0.85); margin-top: var(--sp-xs); }

.footer { background: var(--surface-dark); color: var(--on-dark-soft); margin-top: var(--sp-section); padding: 64px 0; }
.footer .brand-name { color: var(--on-dark); }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: var(--sp-xl); }
.footer h5 { color: var(--on-dark); font-size: 14px; font-weight: 500; margin-bottom: var(--sp-sm); }
.footer ul { list-style: none; font-size: 14px; }
.footer li { margin-bottom: 8px; }
.footer .fine { margin-top: var(--sp-xxl); padding-top: var(--sp-lg); border-top: 1px solid var(--surface-dark-elevated); font-size: 13px; color: var(--muted-soft); }

/* ---------- auth ---------- */

.auth-wrap { max-width: 420px; margin: 72px auto; padding: 0 var(--sp-lg); }
.auth-card { background: var(--canvas); border: 1px solid var(--hairline); border-radius: var(--r-lg); padding: var(--sp-xl); }
.auth-wrap h1 { margin-bottom: var(--sp-lg); }
.auth-alt { margin-top: var(--sp-lg); font-size: 14px; color: var(--muted); text-align: center; }

/* ---------- dashboard home ---------- */

.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--sp-lg); margin: var(--sp-xl) 0; }
.stat-tile {
  background: var(--surface-card); border-radius: var(--r-lg); padding: var(--sp-lg) var(--sp-xl);
  cursor: pointer; border: none; text-align: left; font-family: var(--font-body);
}
.stat-tile .num { font-family: var(--font-display); font-size: 44px; font-weight: 500; line-height: 1.1; color: var(--ink); }
.stat-tile .lbl { font-size: 13px; font-weight: 500; color: var(--muted); margin-top: 2px; }
.stat-tile.tile-dark { background: var(--surface-dark); }
.stat-tile.tile-dark .num { color: var(--on-dark); }
.stat-tile.tile-dark .lbl { color: var(--on-dark-soft); }

.dropzone {
  border: 1.5px dashed var(--hairline); border-radius: var(--r-lg);
  background: var(--surface-soft);
  padding: var(--sp-xxl); text-align: center; cursor: pointer;
  transition: border-color 120ms ease, background 120ms ease;
}
.dropzone.dragover { border-color: var(--primary); background: var(--surface-card); }
.dropzone .dz-title { font-family: var(--font-display); font-size: 24px; font-weight: 500; color: var(--ink); margin-bottom: 4px; }
.dropzone p { color: var(--muted); font-size: 14px; }

/* ---------- manage / agreements ---------- */

.manage-layout { display: grid; grid-template-columns: 220px 1fr; gap: var(--sp-xl); align-items: start; }
.side-nav { display: flex; flex-direction: column; gap: 2px; position: sticky; top: 88px; }
.side-nav button {
  display: flex; justify-content: space-between; align-items: center;
  font-family: var(--font-body); font-size: 14px; font-weight: 500;
  color: var(--muted); background: transparent; border: none;
  padding: 9px 14px; border-radius: var(--r-md); cursor: pointer; text-align: left;
}
.side-nav button.active { background: var(--surface-card); color: var(--ink); }
.side-nav .count { font-size: 12px; color: var(--muted-soft); }

.env-table { width: 100%; border-collapse: collapse; }
.env-table th {
  text-align: left; font-size: 12px; font-weight: 500; letter-spacing: 1.5px; text-transform: uppercase;
  color: var(--muted-soft); padding: 10px 14px; border-bottom: 1px solid var(--hairline);
}
.env-table td { padding: 16px 14px; border-bottom: 1px solid var(--hairline-soft); vertical-align: middle; }
.env-table tbody tr { cursor: pointer; }
.env-table tbody tr:hover { background: var(--surface-soft); }
.env-subject { font-weight: 500; color: var(--ink); }
.env-meta { font-size: 13px; color: var(--muted); margin-top: 2px; }

.empty-state { text-align: center; padding: var(--sp-section) var(--sp-xl); }
.empty-state .display-sm { margin-bottom: var(--sp-xs); }
.empty-state p { color: var(--muted); }

/* ---------- envelope detail ---------- */

.detail-grid { display: grid; grid-template-columns: 1fr 340px; gap: var(--sp-xl); align-items: start; }

.recipient-row {
  display: flex; align-items: center; gap: var(--sp-md);
  padding: var(--sp-md) 0; border-bottom: 1px solid var(--hairline-soft);
}
.recipient-row:last-child { border-bottom: none; }
.rcpt-chip {
  width: 36px; height: 36px; border-radius: 50%; flex: 0 0 auto;
  color: #fff; display: inline-flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 500;
}

.history-table { width: 100%; font-size: 14px; border-collapse: collapse; }
.history-table td { padding: 10px 8px; border-bottom: 1px solid var(--hairline-soft); vertical-align: top; }
.history-table .t { color: var(--muted-soft); font-size: 13px; white-space: nowrap; }

.link-box {
  display: flex; gap: 8px; align-items: center;
  background: var(--surface-soft); border: 1px solid var(--hairline);
  border-radius: var(--r-md); padding: 6px 6px 6px 12px; margin-top: 8px;
  font-family: var(--font-mono); font-size: 12px; color: var(--muted);
  overflow: hidden;
}
.link-box .url { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.link-box button { flex: 0 0 auto; height: 28px; padding: 0 12px; font-size: 12px; }

/* ---------- prepare flow ---------- */

.flow-header {
  height: 64px; background: var(--canvas); border-bottom: 1px solid var(--hairline);
  display: flex; align-items: center; gap: var(--sp-lg); padding: 0 var(--sp-xl);
  position: sticky; top: 0; z-index: 60;
}
.flow-steps { display: flex; align-items: center; gap: 4px; flex: 1; justify-content: center; }
.flow-step { display: flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: var(--r-md); font-size: 14px; font-weight: 500; color: var(--muted); background: transparent; border: none; font-family: var(--font-body); cursor: pointer; }
.flow-step.active { background: var(--surface-card); color: var(--ink); }
.flow-step.done { color: var(--body-strong); }
.flow-step .n {
  width: 22px; height: 22px; border-radius: 50%; font-size: 12px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--surface-cream-strong); color: var(--ink);
}
.flow-step.active .n { background: var(--primary); color: var(--on-primary); }
.flow-step.done .n { background: var(--success); color: #fff; }
.flow-step-sep { color: var(--hairline); }

.doc-row {
  display: flex; align-items: center; gap: var(--sp-md);
  padding: var(--sp-md); border: 1px solid var(--hairline); border-radius: var(--r-md);
  margin-bottom: var(--sp-sm); background: var(--canvas);
}
.doc-thumb {
  width: 40px; height: 52px; background: var(--surface-card); border-radius: var(--r-xs);
  display: flex; align-items: center; justify-content: center; color: var(--muted);
  flex: 0 0 auto;
}

.rcpt-editor {
  border: 1px solid var(--hairline); border-radius: var(--r-lg);
  padding: var(--sp-lg); margin-bottom: var(--sp-md); background: var(--canvas);
  display: grid; grid-template-columns: 44px 1fr 1fr 190px 40px; gap: var(--sp-md); align-items: end;
}
.order-pill {
  width: 36px; height: 36px; border-radius: 50%; color: #fff;
  display: flex; align-items: center; justify-content: center; font-weight: 500; font-size: 14px;
  margin-bottom: 2px;
}

/* ---------- tagger (field placement) ---------- */

.tagger-layout {
  display: grid; grid-template-columns: 230px 1fr 260px; gap: 0;
  height: calc(100vh - 64px);
}
.tagger-palette {
  background: var(--canvas); border-right: 1px solid var(--hairline);
  padding: var(--sp-lg); overflow-y: auto;
}
.tagger-palette h4 { font-size: 12px; font-weight: 500; letter-spacing: 1.5px; text-transform: uppercase; color: var(--muted-soft); margin: var(--sp-lg) 0 var(--sp-sm); }
.tagger-palette h4:first-child { margin-top: 0; }

.palette-item {
  display: flex; align-items: center; gap: 10px; width: 100%;
  font-family: var(--font-body); font-size: 14px; font-weight: 500; color: var(--ink);
  background: var(--canvas); border: 1px solid var(--hairline); border-radius: var(--r-md);
  padding: 10px 12px; margin-bottom: 8px; cursor: grab; text-align: left;
}
.palette-item:active { cursor: grabbing; background: var(--surface-soft); }
.palette-item .swatch { width: 10px; height: 10px; border-radius: 3px; flex: 0 0 auto; }

.tagger-canvas {
  background: var(--surface-soft); overflow-y: auto; padding: var(--sp-xl);
}
.pdf-page-wrap {
  position: relative; margin: 0 auto var(--sp-lg); box-shadow: var(--shadow-soft);
  background: #fff; border-radius: 2px;
}
.pdf-page-wrap canvas { display: block; border-radius: 2px; }
.page-label { text-align: center; font-size: 12px; color: var(--muted-soft); margin-bottom: var(--sp-md); }

.tagger-props {
  background: var(--canvas); border-left: 1px solid var(--hairline);
  padding: var(--sp-lg); overflow-y: auto;
}

.field-box {
  position: absolute; border: 1.5px solid; border-radius: 3px;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 500; cursor: move; user-select: none;
  overflow: hidden; white-space: nowrap;
}
.field-box.selected { box-shadow: 0 0 0 3px rgba(204, 120, 92, 0.25); }
.field-box .resize-handle {
  position: absolute; right: -1px; bottom: -1px; width: 12px; height: 12px;
  cursor: nwse-resize; border-radius: 2px 0 2px 0;
}

/* ---------- signing ceremony ---------- */

.sign-topbar {
  height: 64px; background: var(--surface-dark); color: var(--on-dark);
  display: flex; align-items: center; gap: var(--sp-lg); padding: 0 var(--sp-xl);
  position: sticky; top: 0; z-index: 60;
}
.sign-topbar .brand-name { color: var(--on-dark); }
.sign-topbar .meta { font-size: 13px; color: var(--on-dark-soft); }

.consent-bar {
  background: var(--surface-card); border-bottom: 1px solid var(--hairline);
  padding: var(--sp-md) var(--sp-xl);
  display: flex; align-items: center; gap: var(--sp-lg); justify-content: center;
  position: sticky; top: 64px; z-index: 55;
}

.sign-canvas { background: var(--surface-soft); min-height: calc(100vh - 64px); padding: var(--sp-xl) var(--sp-xl) 140px; }

.sign-field {
  position: absolute; border: 1.5px solid var(--primary);
  background: rgba(204, 120, 92, 0.12);
  border-radius: 3px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 500; color: var(--primary-active);
  overflow: hidden;
}
.sign-field.filled { background: rgba(93, 184, 114, 0.08); border-color: var(--success); color: var(--ink); }
.sign-field.flash { box-shadow: 0 0 0 4px rgba(204, 120, 92, 0.35); }
.sign-field img { max-width: 100%; max-height: 100%; }

.sign-footer {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 60;
  background: var(--canvas); border-top: 1px solid var(--hairline);
  padding: var(--sp-md) var(--sp-xl);
  display: flex; align-items: center; justify-content: space-between; gap: var(--sp-md);
}

/* ---------- signature modal ---------- */

.modal-backdrop {
  position: fixed; inset: 0; background: rgba(20, 20, 19, 0.5);
  display: flex; align-items: center; justify-content: center; z-index: 200;
  padding: var(--sp-lg);
}
.modal {
  background: var(--canvas); border-radius: var(--r-lg);
  width: 100%; max-width: 560px; max-height: 90vh; overflow-y: auto;
  padding: var(--sp-xl);
}
.modal h2 { margin-bottom: var(--sp-md); }
.modal-actions { display: flex; justify-content: flex-end; gap: var(--sp-sm); margin-top: var(--sp-lg); }

.tab-row { display: flex; gap: 4px; margin-bottom: var(--sp-lg); border-bottom: 1px solid var(--hairline); padding-bottom: var(--sp-sm); }
.tab-row button {
  font-family: var(--font-body); font-size: 14px; font-weight: 500;
  color: var(--muted); background: transparent; border: none;
  padding: 8px 14px; border-radius: var(--r-md); cursor: pointer;
}
.tab-row button.active { background: var(--surface-card); color: var(--ink); }

.sig-style-option {
  display: flex; align-items: center; justify-content: space-between;
  border: 1px solid var(--hairline); border-radius: var(--r-md);
  padding: 10px 16px; margin-bottom: 10px; cursor: pointer; background: var(--canvas);
  width: 100%; text-align: left;
}
.sig-style-option.selected { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(204,120,92,0.15); }
.sig-style-option .preview { font-size: 30px; color: var(--ink); line-height: 1.2; }
.sig-style-option .ini { font-size: 24px; color: var(--muted); }

.draw-pad {
  border: 1px solid var(--hairline); border-radius: var(--r-md);
  background: #fff; width: 100%; height: 180px; cursor: crosshair;
  touch-action: none;
}

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

.toast-wrap { position: fixed; bottom: 24px; right: 24px; z-index: 500; display: flex; flex-direction: column; gap: 10px; }
.toast {
  background: var(--surface-dark); color: var(--on-dark);
  border-radius: var(--r-lg); padding: 14px 20px; font-size: 14px;
  box-shadow: 0 4px 16px rgba(20,20,19,0.2); max-width: 380px;
  display: flex; gap: 10px; align-items: center;
}
.toast.error { border-left: 3px solid var(--error); }
.toast.success { border-left: 3px solid var(--success); }

/* ---------- notice banners ---------- */

.banner {
  display: flex; gap: 10px; align-items: flex-start;
  background: var(--surface-soft); border: 1px solid var(--hairline);
  border-radius: var(--r-md); padding: var(--sp-sm) var(--sp-md);
  font-size: 14px; color: var(--body);
}
.banner.warn { border-color: var(--warning); }

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

@media (max-width: 1024px) {
  .feature-grid, .steps-grid { grid-template-columns: repeat(2, 1fr); }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .detail-grid { grid-template-columns: 1fr; }
  .tagger-layout { grid-template-columns: 200px 1fr 220px; }
}

@media (max-width: 768px) {
  .display-xl { font-size: 32px; letter-spacing: -0.5px; }
  .display-lg { font-size: 30px; }
  .hero-grid { grid-template-columns: 1fr; }
  .feature-grid, .steps-grid, .stat-grid { grid-template-columns: 1fr; }
  .manage-layout { grid-template-columns: 1fr; }
  .side-nav { flex-direction: row; flex-wrap: wrap; position: static; }
  .footer-grid { grid-template-columns: 1fr; }
  .cta-band { flex-direction: column; text-align: center; padding: var(--sp-xl); }
  .rcpt-editor { grid-template-columns: 1fr; }
  .tagger-layout { grid-template-columns: 1fr; height: auto; }
  .tagger-palette { border-right: none; border-bottom: 1px solid var(--hairline); }
  .nav-links { display: none; }
  .container { padding: 0 var(--sp-md); }
}

/* utility */
.hidden { display: none !important; }
.mt-xs { margin-top: var(--sp-xs); } .mt-sm { margin-top: var(--sp-sm); } .mt-md { margin-top: var(--sp-md); }
.mt-lg { margin-top: var(--sp-lg); } .mt-xl { margin-top: var(--sp-xl); } .mt-xxl { margin-top: var(--sp-xxl); }
.mb-xs { margin-bottom: var(--sp-xs); } .mb-sm { margin-bottom: var(--sp-sm); } .mb-md { margin-bottom: var(--sp-md); }
.mb-lg { margin-bottom: var(--sp-lg); } .mb-xl { margin-bottom: var(--sp-xl); }
