/* ==========================================================================
   ScopeLock — Change-Order Studio, Client Sign-Off & Calculator Styles
   ========================================================================== */

:root {
  --brand: #0f294a;
  --brand-dark: #08172b;
  --brand-soft: #eef3f9;
  --accent: #c89d3c;
  --accent-soft: rgba(200, 157, 60, 0.14);

  --bg-app: #f4f6fa;
  --bg-surface: #ffffff;
  --bg-subtle: #f8fafc;
  --bg-input: #ffffff;

  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;

  --border-subtle: #e2e8f0;
  --border-strong: #cbd5e1;

  --success: #059669;
  --success-soft: #ecfdf5;
  --warning: #d97706;
  --warning-soft: #fffbeb;
  --danger: #dc2626;
  --danger-soft: #fef2f2;

  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.05);
  --shadow-md: 0 8px 24px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 18px 44px rgba(15, 23, 42, 0.14);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 22px;

  --font-display: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}

[data-theme="dark"] {
  --bg-app: #090d16;
  --bg-surface: #111827;
  --bg-subtle: #172033;
  --bg-input: #0f172a;

  --text-primary: #f8fafc;
  --text-secondary: #cbd5e1;
  --text-muted: #94a3b8;

  --border-subtle: #1e293b;
  --border-strong: #334155;

  --brand-soft: rgba(56, 189, 248, 0.12);
  --success: #34d399;
  --success-soft: rgba(16, 185, 129, 0.14);
  --warning: #fbbf24;
  --warning-soft: rgba(245, 158, 11, 0.14);
  --danger: #f87171;
  --danger-soft: rgba(239, 68, 68, 0.14);

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.35);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 20px 50px rgba(0, 0, 0, 0.65);
}

*, *::before, *::after {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  background-color: var(--bg-app);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  margin: 0;
  letter-spacing: -0.02em;
}

button, input, textarea, select {
  font-family: inherit;
}

svg {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
  vertical-align: middle;
}

.mono {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

.hidden {
  display: none !important;
}

/* ==========================================================================
   Buttons & Pills
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 9px 15px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.16s ease;
  text-decoration: none;
  white-space: nowrap;
}

.btn-primary {
  background: var(--brand);
  color: #ffffff;
  box-shadow: 0 2px 10px rgba(15, 41, 74, 0.24);
}

.btn-primary:hover {
  background: var(--brand-dark);
  transform: translateY(-1px);
}

.btn-accent {
  background: var(--accent);
  color: #0f172a;
  font-weight: 700;
  box-shadow: 0 4px 14px rgba(200, 157, 60, 0.32);
}

.btn-accent:hover {
  filter: brightness(1.06);
  transform: translateY(-1px);
}

.btn-success {
  background: var(--success);
  color: #ffffff;
  font-weight: 700;
}

.btn-success:hover {
  filter: brightness(1.06);
  transform: translateY(-1px);
}

.btn-outline {
  background: var(--bg-surface);
  color: var(--text-primary);
  border-color: var(--border-strong);
}

.btn-outline:hover {
  background: var(--bg-subtle);
  border-color: var(--text-muted);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
}

.btn-ghost:hover {
  background: var(--bg-subtle);
  color: var(--text-primary);
}

.btn-danger-ghost {
  background: transparent;
  color: var(--danger);
}

.btn-danger-ghost:hover {
  background: var(--danger-soft);
}

.btn-sm {
  padding: 6px 11px;
  font-size: 12px;
}

.btn-lg {
  padding: 13px 20px;
  font-size: 15px;
  border-radius: var(--radius-md);
  max-width: 100%;
  white-space: normal;
  text-align: center;
  line-height: 1.3;
}

.pro-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 700;
  white-space: nowrap;
  flex-shrink: 0;
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #fff;
  cursor: pointer;
  border: none;
  box-shadow: 0 2px 8px rgba(217, 119, 6, 0.3);
}

.pro-pill:hover {
  filter: brightness(1.06);
}

.pro-pill.active-pro {
  background: linear-gradient(135deg, #10b981, #059669);
}

/* ==========================================================================
   Topbar
   ========================================================================== */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-subtle);
}

[data-theme="dark"] .topbar {
  background: rgba(17, 24, 39, 0.92);
}

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

.brand-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text-primary);
}

.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--brand) 0%, #1d4e89 65%, var(--accent) 100%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 800;
  font-size: 13px;
  font-family: var(--font-display);
  flex-shrink: 0;
}

.brand-title {
  display: block;
  font-size: 15px;
  font-family: var(--font-display);
  line-height: 1.1;
}

.brand-sub {
  display: block;
  font-size: 11px;
  color: var(--text-muted);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* ==========================================================================
   Hero & Template Controls
   ========================================================================== */
.studio-hero {
  background: linear-gradient(135deg, #08172b 0%, #0f294a 58%, #1a4375 100%);
  color: #ffffff;
  border-bottom: 3px solid var(--accent);
  padding: 26px 20px;
}

.studio-hero-inner {
  max-width: 1280px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.25fr 1fr;
  gap: 24px;
  align-items: center;
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 11px;
  border-radius: 999px;
  background: rgba(200, 157, 60, 0.2);
  border: 1px solid rgba(200, 157, 60, 0.48);
  color: #fde68a;
  font-size: 11.5px;
  font-weight: 700;
  margin-bottom: 10px;
}

.studio-hero h1 {
  font-size: clamp(23px, 3vw, 34px);
  font-weight: 800;
  line-height: 1.18;
  margin-bottom: 8px;
}

.studio-hero p {
  margin: 0;
  color: rgba(255, 255, 255, 0.86);
  font-size: 14px;
  max-width: 620px;
}

.hero-quick-panel {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: var(--radius-lg);
  padding: 16px;
}

.hero-quick-panel label {
  display: block;
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #fde68a;
  margin-bottom: 7px;
}

.quick-co-row {
  display: flex;
  gap: 8px;
}

.quick-co-row input {
  flex: 1;
  min-width: 0;
  padding: 9px 11px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(8, 23, 43, 0.72);
  color: #ffffff;
  font-size: 13px;
}

.quick-co-row input::placeholder {
  color: rgba(255, 255, 255, 0.56);
}

.quick-co-hint {
  margin-top: 7px;
  font-size: 11.5px;
  color: rgba(255, 255, 255, 0.75);
}

/* ==========================================================================
   Template Selector Bar
   ========================================================================== */
.main-shell {
  max-width: 1280px;
  margin: 0 auto;
  padding: 20px 20px 56px;
}

.template-bar {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  margin-bottom: 18px;
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.template-select-wrap {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
}

.template-select-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-secondary);
}

.template-select {
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--bg-input);
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 600;
  max-width: 340px;
}

.template-pills {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
}

.template-pill {
  padding: 6px 11px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: var(--bg-subtle);
  color: var(--text-primary);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.template-pill:hover {
  border-color: var(--brand);
  background: var(--brand-soft);
}

.template-pill.active {
  background: var(--brand);
  color: #ffffff;
  border-color: var(--brand);
}

/* ==========================================================================
   Studio Two-Column Layout
   ========================================================================== */
.studio-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.9fr);
  gap: 20px;
  align-items: start;
}

.card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 16px;
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.card-head h2 {
  font-size: 16px;
  font-weight: 800;
}

.card-sub {
  font-size: 12px;
  color: var(--text-muted);
}

.field-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.field-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.field-group {
  margin-bottom: 12px;
}

.field-group label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-secondary);
  margin-bottom: 5px;
}

.input,
.textarea,
select.input {
  width: 100%;
  padding: 9px 11px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--bg-input);
  color: var(--text-primary);
  font-size: 13.5px;
  transition: border-color 0.15s ease;
}

.input:focus,
.textarea:focus {
  outline: none;
  border-color: var(--brand);
}

.textarea {
  min-height: 76px;
  resize: vertical;
}

/* Reason Code Badges */
.reason-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.reason-btn {
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: var(--bg-subtle);
  color: var(--text-secondary);
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
}

.reason-btn.active[data-reason="Hidden Condition"] {
  background: var(--warning-soft);
  border-color: #f59e0b;
  color: #b45309;
}

.reason-btn.active[data-reason="Code Required"] {
  background: var(--danger-soft);
  border-color: #ef4444;
  color: #b91c1c;
}

.reason-btn.active[data-reason="Client Request"] {
  background: var(--brand-soft);
  border-color: #3b82f6;
  color: var(--brand);
}

[data-theme="dark"] .reason-btn.active[data-reason="Hidden Condition"] { color: #fbbf24; }
[data-theme="dark"] .reason-btn.active[data-reason="Code Required"] { color: #fca5a5; }
[data-theme="dark"] .reason-btn.active[data-reason="Client Request"] { color: #93c5fd; }

.reason-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.reason-badge.reason-hidden {
  background: var(--warning-soft);
  color: #b45309;
  border: 1px solid rgba(245, 158, 11, 0.4);
}

.reason-badge.reason-code {
  background: var(--danger-soft);
  color: #b91c1c;
  border: 1px solid rgba(239, 68, 68, 0.4);
}

.reason-badge.reason-client {
  background: var(--brand-soft);
  color: var(--brand);
  border: 1px solid rgba(59, 130, 246, 0.35);
}

[data-theme="dark"] .reason-badge.reason-hidden { color: #fbbf24; }
[data-theme="dark"] .reason-badge.reason-code { color: #fca5a5; }
[data-theme="dark"] .reason-badge.reason-client { color: #93c5fd; }

/* Line Items Editor */
.line-items-list {
  display: grid;
  gap: 10px;
}

.line-item-row {
  border: 1px solid var(--border-subtle);
  background: var(--bg-subtle);
  border-radius: var(--radius-md);
  padding: 12px;
}

.line-item-top {
  display: grid;
  grid-template-columns: minmax(0, 2fr) 72px 84px 104px 100px 32px;
  gap: 8px;
  align-items: center;
}

.line-item-subtotal {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 13px;
  text-align: right;
  color: var(--text-primary);
}

.line-item-note {
  margin-top: 8px;
}

/* Evidence Photo Upload & Budget */
.budget-box {
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  margin-bottom: 12px;
}

.budget-top {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 6px;
}

.budget-track {
  height: 8px;
  border-radius: 999px;
  background: var(--border-subtle);
  overflow: hidden;
}

.budget-fill {
  height: 100%;
  border-radius: 999px;
  background: var(--success);
  transition: width 0.2s ease;
}

.budget-fill.warn { background: var(--warning); }
.budget-fill.over { background: var(--danger); }

.upload-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.evidence-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.evidence-card {
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  background: var(--bg-subtle);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.evidence-card img {
  width: 100%;
  height: 120px;
  object-fit: cover;
  display: block;
  background: #0f172a;
}

.evidence-meta {
  padding: 8px;
  display: grid;
  gap: 6px;
}

.evidence-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  color: var(--text-muted);
}

/* ==========================================================================
   Sequential Contract Rollup Ledger (Right Sticky Card + Client View)
   ========================================================================== */
.sticky-panel {
  position: sticky;
  top: 72px;
}

.ledger-card {
  background: linear-gradient(160deg, #0b1e38 0%, #102a4e 100%);
  color: #ffffff;
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-md);
  border: 1px solid rgba(200, 157, 60, 0.45);
  margin-bottom: 16px;
}

.ledger-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 14px;
}

.ledger-head h3 {
  font-size: 15px;
  color: #fde68a;
}

.ledger-rows {
  display: grid;
  gap: 9px;
}

.ledger-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13.5px;
  color: rgba(255, 255, 255, 0.85);
}

.ledger-row.is-delta {
  color: #fbbf24;
  font-weight: 700;
}

.ledger-divider {
  border: 0;
  border-top: 1px solid rgba(255, 255, 255, 0.18);
  margin: 6px 0;
}

.ledger-total {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 15px;
  font-weight: 800;
}

.ledger-total strong {
  font-size: 24px;
  color: #34d399;
}

.ledger-schedule {
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.08);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
}

.share-actions-card {
  display: grid;
  gap: 10px;
}

.generated-link-box {
  margin-top: 6px;
  padding: 10px;
  border-radius: var(--radius-sm);
  background: var(--bg-subtle);
  border: 1px solid var(--border-strong);
  font-size: 11.5px;
  word-break: break-all;
}

/* 3-Touch Approval Follow-Up Texts */
.followup-details {
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  background: var(--bg-subtle);
  overflow: hidden;
}

.followup-summary {
  list-style: none;
  cursor: pointer;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-primary);
  user-select: none;
}

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

.followup-summary::after {
  content: "▾";
  font-size: 11px;
  color: var(--text-muted);
  transition: transform 0.15s ease;
}

.followup-details[open] .followup-summary::after {
  transform: rotate(180deg);
}

.followup-badge {
  margin-left: auto;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 10.5px;
  font-weight: 700;
  white-space: nowrap;
}

.followup-body {
  padding: 0 10px 10px;
  display: grid;
  gap: 8px;
  border-top: 1px solid var(--border-subtle);
  padding-top: 10px;
}

.followup-item {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  display: grid;
  gap: 5px;
}

.followup-item-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.followup-touch-label {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text-primary);
}

.followup-copy-btn {
  padding: 3px 9px;
  font-size: 11px;
  line-height: 1.25;
}

.followup-msg-preview {
  font-size: 11.5px;
  line-height: 1.45;
  color: var(--text-secondary);
  overflow-wrap: anywhere;
  word-break: break-word;
}

/* ==========================================================================
   Client Sign-Off View
   ========================================================================== */
.client-banner {
  background: var(--brand);
  color: #ffffff;
  padding: 10px 20px;
}

.client-banner-inner {
  max-width: 920px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.client-shell {
  max-width: 920px;
  margin: 22px auto 56px;
  padding: 0 18px;
}

.client-doc {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: 28px;
  box-shadow: var(--shadow-lg);
  max-width: 100%;
  overflow-x: hidden;
}

.client-doc-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  flex-wrap: wrap;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 20px;
}

.client-doc-header h1 {
  font-size: clamp(22px, 3vw, 28px);
  margin: 6px 0 4px;
}

.client-meta-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 20px;
}

.client-meta-tile {
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  min-width: 0;
}

.client-meta-tile small {
  display: block;
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 600;
}

.client-meta-tile strong {
  display: block;
  font-size: 13.5px;
  color: var(--text-primary);
  overflow-wrap: anywhere;
  word-break: break-word;
}

.client-photo-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(175px, 1fr));
  gap: 12px;
  margin: 14px 0 22px;
}

.client-photo-item {
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--bg-subtle);
}

.client-photo-item img {
  width: 100%;
  height: 150px;
  object-fit: cover;
  display: block;
}

.client-photo-item figcaption {
  padding: 8px 10px;
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 600;
}

.scope-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  margin-bottom: 20px;
}

.scope-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}

.scope-table th,
.scope-table td {
  padding: 11px 13px;
  border-bottom: 1px solid var(--border-subtle);
  text-align: left;
}

.scope-table thead th {
  background: var(--bg-subtle);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

.scope-table th.num,
.scope-table td.num {
  text-align: right;
}

.scope-table tbody tr:last-child td {
  border-bottom: none;
}

.terms-box {
  padding: 14px 16px;
  border-radius: var(--radius-md);
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 22px;
}

.esign-box {
  border: 2px solid var(--brand);
  border-radius: var(--radius-lg);
  padding: 20px;
  background: var(--bg-subtle);
}

.esign-consent-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 12.5px;
  color: var(--text-secondary);
  margin: 12px 0;
  cursor: pointer;
}

.esign-consent-row input[type="checkbox"] {
  margin-top: 2px;
  width: 17px;
  height: 17px;
  flex-shrink: 0;
}

.sig-pad-wrap {
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-md);
  background: #ffffff;
  overflow: hidden;
  margin-bottom: 12px;
}

.sig-canvas {
  display: block;
  width: 100%;
  height: 145px;
  touch-action: none;
  cursor: crosshair;
}

.receipt-box {
  border: 2px solid var(--success);
  border-radius: var(--radius-lg);
  padding: 22px;
  background: var(--success-soft);
}

.receipt-digest {
  margin: 12px 0;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  word-break: break-all;
  font-size: 12px;
}

.receipt-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.cross-promo-bar {
  margin-top: 18px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 12.5px;
}

/* ==========================================================================
   Pricing Section & Modal (#pricing-compare & #modal-pro)
   ========================================================================== */
.pricing-section {
  margin-top: 28px;
  padding: 24px;
  border-radius: var(--radius-lg);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-sm);
}

.thanksgiving-banner {
  padding: 10px 14px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.14), rgba(217, 119, 6, 0.08));
  border: 1px solid rgba(217, 119, 6, 0.45);
  font-size: 12.5px;
  color: var(--text-primary);
  margin-bottom: 14px;
}

.thanksgiving-code {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 6px;
  background: var(--accent);
  color: #0f172a;
  font-family: var(--font-mono);
  font-weight: 800;
  font-size: 12px;
}

.pricing-section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 16px;
}

.pricing-section-head h2 {
  font-size: 20px;
  margin-bottom: 4px;
}

.pricing-free-reassurance {
  font-size: 13px;
  color: var(--text-secondary);
  margin: 0;
}

.pricing-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.plan-box {
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 18px;
  background: var(--bg-subtle);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.plan-box.featured {
  background: var(--bg-surface);
  border: 2px solid var(--brand);
  box-shadow: var(--shadow-md);
}

.plan-badge {
  display: inline-block;
  align-self: flex-start;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: var(--brand-soft);
  color: var(--brand);
}

.plan-box.featured .plan-badge {
  background: var(--accent);
  color: #0f172a;
}

.plan-price {
  font-size: 22px;
  font-weight: 800;
  font-family: var(--font-display);
}

.plan-bullets {
  margin: 2px 0 8px;
  padding-left: 17px;
  font-size: 12.5px;
  color: var(--text-secondary);
  line-height: 1.55;
}

.pricing-compare-wrap {
  margin-top: 16px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow-x: auto;
  background: var(--bg-surface);
}

.pricing-compare-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
}

.pricing-compare-table th,
.pricing-compare-table td {
  padding: 9px 12px;
  border-bottom: 1px solid var(--border-subtle);
  text-align: center;
  vertical-align: middle;
}

.pricing-compare-table th:first-child,
.pricing-compare-table td:first-child {
  text-align: left;
  font-weight: 600;
}

.pricing-compare-table thead th {
  background: var(--bg-subtle);
  font-family: var(--font-display);
  font-weight: 800;
}

.pricing-compare-table tbody tr:last-child td {
  border-bottom: none;
}

.chk-yes {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: rgba(16, 185, 129, 0.14);
  color: #059669;
  font-weight: 800;
}

.chk-no {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.16);
  color: #94a3b8;
  font-weight: 700;
}

/* Modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(8, 23, 43, 0.62);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal-dialog {
  width: 100%;
  max-width: 920px;
  max-height: 90vh;
  overflow-y: auto;
  background: var(--bg-surface);
  border-radius: var(--radius-xl);
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-lg);
  padding: 22px;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

/* Toast */
.toast-container {
  position: fixed;
  bottom: 18px;
  right: 18px;
  z-index: 80;
  display: grid;
  gap: 8px;
  max-width: 340px;
}

.toast {
  padding: 10px 14px;
  border-radius: var(--radius-md);
  background: #0f172a;
  color: #ffffff;
  font-size: 13px;
  font-weight: 600;
  box-shadow: var(--shadow-lg);
  border-left: 4px solid var(--accent);
}

/* ==========================================================================
   Calculator Page Styles
   ========================================================================== */
.calc-hero {
  background: linear-gradient(135deg, #08172b 0%, #0f294a 60%, #1d4e89 100%);
  color: #ffffff;
  padding: 36px 20px;
  border-bottom: 3px solid var(--accent);
}

.calc-hero-inner {
  max-width: 1120px;
  margin: 0 auto;
}

.calc-breadcrumb {
  font-size: 12.5px;
  color: rgba(255, 255, 255, 0.76);
  margin-bottom: 10px;
}

.calc-breadcrumb a {
  color: #ffffff;
  text-decoration: none;
}

.calc-pill {
  display: inline-block;
  padding: 4px 11px;
  border-radius: 999px;
  background: rgba(200, 157, 60, 0.22);
  border: 1px solid rgba(200, 157, 60, 0.45);
  color: #fde68a;
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 10px;
}

.calc-hero h1 {
  font-size: clamp(25px, 4vw, 36px);
  margin-bottom: 8px;
}

.calc-hero p {
  margin: 0;
  color: rgba(255, 255, 255, 0.88);
  max-width: 740px;
  font-size: 15px;
}

.calc-container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 26px 20px 56px;
}

.calc-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
}

.calc-layout {
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: 24px;
  align-items: start;
}

.calc-sub {
  color: var(--text-secondary);
  font-size: 13.5px;
  margin: 4px 0 14px;
}

.calc-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-bottom: 14px;
}

.preset-btn {
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: var(--bg-subtle);
  color: var(--text-primary);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.preset-btn:hover {
  border-color: var(--brand);
  background: var(--brand-soft);
}

.calc-form-grid {
  display: grid;
  gap: 10px;
}

.field-row-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.calc-kpis {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.calc-kpi {
  padding: 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  background: var(--bg-subtle);
}

.calc-kpi.is-danger {
  background: var(--danger-soft);
  border-color: rgba(239, 68, 68, 0.35);
}

.calc-kpi.is-highlight {
  background: var(--success-soft);
  border-color: rgba(16, 185, 129, 0.45);
}

.calc-kpi span {
  display: block;
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 600;
}

.calc-kpi strong {
  display: block;
  font-size: 22px;
  margin-top: 4px;
}

.calc-breakdown-box {
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  background: var(--bg-subtle);
  display: grid;
  gap: 7px;
  margin-bottom: 12px;
}

.calc-breakdown-row {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
}

.calc-roi-note {
  font-size: 13px;
  color: var(--text-secondary);
  margin: 0 0 16px;
}

.calc-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.calc-compare-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 14px;
}

.calc-compare-box {
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 16px;
  background: var(--bg-subtle);
}

.calc-compare-box.is-win {
  background: var(--success-soft);
  border-color: rgba(16, 185, 129, 0.4);
}

.calc-bullets {
  margin: 8px 0 0;
  padding-left: 18px;
  font-size: 13.5px;
  color: var(--text-secondary);
}

.calc-bullets li {
  margin-bottom: 6px;
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  padding: 20px;
  font-size: 12.5px;
  color: var(--text-muted);
}

.site-footer-inner {
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.footer-links {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

.footer-links a {
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 600;
}

.footer-links a:hover {
  color: var(--brand);
}

/* ==========================================================================
   Responsive & Print
   ========================================================================== */
@media (max-width: 960px) {
  .studio-hero-inner,
  .studio-grid,
  .pricing-grid,
  .calc-layout,
  .calc-compare-grid {
    grid-template-columns: 1fr;
  }
  .sticky-panel {
    position: static;
  }
  .client-meta-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 679px) {
  .topbar-inner {
    padding: 9px 12px;
  }
  .pro-pill {
    font-size: 10.5px;
    padding: 5px 9px;
  }
  .field-grid-2,
  .field-grid-3,
  .field-row-2,
  .evidence-grid,
  .calc-kpis {
    grid-template-columns: 1fr;
  }
  .line-item-top {
    grid-template-columns: 1fr 1fr;
  }
  .template-select {
    max-width: 100%;
  }
  .client-doc {
    padding: 16px;
  }
  .client-meta-grid {
    grid-template-columns: 1fr;
  }
  .quick-co-row {
    flex-direction: column;
  }
}

@media print {
  .topbar,
  .client-banner,
  .no-print,
  .site-footer {
    display: none !important;
  }
  body {
    background: #ffffff;
    color: #000000;
  }
  .client-doc {
    box-shadow: none;
    border: none;
    padding: 0;
  }
}
