/* FieldQuote AI by Everformat — Truck-Ready Mobile-First Styles + Razor-Sharp Print PDF */

:root {
  --bg: #F8FAFC;
  --surface: #FFFFFF;
  --surface-subtle: #F1F5F9;
  --ink: #0F172A;
  --ink-muted: #475569;
  --ink-light: #64748B;
  --border: #E2E8F0;
  --border-strong: #CBD5E1;
  --amber: #F59E0B;
  --amber-hover: #D97706;
  --amber-soft: #FEF3C7;
  --emerald: #059669;
  --emerald-hover: #047857;
  --emerald-soft: #D1FAE5;
  --red: #DC2626;
  --red-soft: #FEE2E2;
  --radius-sm: 10px;
  --radius: 14px;
  --radius-lg: 20px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 10px 25px -5px rgba(15, 23, 42, 0.08), 0 4px 10px -4px rgba(15, 23, 42, 0.04);
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

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

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  line-height: 1.45;
}

button, input, textarea, select {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

[hidden] {
  display: none !important;
}

.num {
  font-variant-numeric: tabular-nums;
}

/* Topbar */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(15, 23, 42, 0.96);
  backdrop-filter: blur(8px);
  color: #FFFFFF;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

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

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.brand-icon {
  flex-shrink: 0;
  border-radius: 10px;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.brand-name {
  font-weight: 800;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
  white-space: nowrap;
}

@media (max-width: 440px) {
  .topbar-inner {
    padding: 8px 12px;
    gap: 6px;
  }
  .brand {
    gap: 8px;
  }
  .brand-name {
    font-size: 0.94rem;
  }
  .brand-sub {
    font-size: 0.68rem;
  }
  .quota-pill {
    min-height: 36px;
    padding: 0 10px;
    font-size: 0.74rem;
  }
}

.brand-sub {
  font-size: 0.72rem;
  color: #94A3B8;
  font-weight: 500;
}

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

.quota-pill {
  min-height: 44px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid rgba(245, 158, 11, 0.5);
  background: rgba(245, 158, 11, 0.16);
  color: #FDE68A;
  font-size: 0.82rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  white-space: nowrap;
}

.quota-pill.is-pro {
  border-color: rgba(16, 185, 129, 0.6);
  background: rgba(5, 150, 105, 0.25);
  color: #A7F3D0;
}

.quota-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--amber);
}

.quota-pill.is-pro .quota-dot {
  background: #34D399;
}

.nav-btn {
  min-height: 44px;
  padding: 0 12px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.06);
  color: #F8FAFC;
  font-size: 0.85rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.nav-btn:hover {
  background: rgba(255, 255, 255, 0.14);
}

.count-badge {
  background: var(--amber);
  color: var(--ink);
  font-size: 0.72rem;
  font-weight: 800;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Main Shell */
.app-shell {
  max-width: 980px;
  margin: 0 auto;
  padding: 18px 14px 48px;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

/* Capture Card */
.capture-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-md);
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.capture-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.capture-title {
  margin: 0 0 4px;
  font-size: clamp(1.28rem, 3.2vw, 1.65rem);
  font-weight: 800;
  letter-spacing: -0.025em;
  color: var(--ink);
}

.capture-subtitle {
  margin: 0;
  color: var(--ink-muted);
  font-size: 0.94rem;
  max-width: 560px;
}

.doc-mode-toggle {
  display: inline-flex;
  background: var(--surface-subtle);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 4px;
  gap: 4px;
}

.mode-btn {
  min-height: 44px;
  padding: 0 18px;
  border: none;
  border-radius: 9px;
  background: transparent;
  color: var(--ink-muted);
  font-weight: 700;
  font-size: 0.9rem;
}

.mode-btn.is-active {
  background: var(--ink);
  color: #FFFFFF;
  box-shadow: var(--shadow-sm);
}

/* Giant Record Button */
.record-stage {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.record-btn {
  position: relative;
  width: 100%;
  min-height: 86px;
  padding: 16px 20px;
  border-radius: 16px;
  border: 2px solid #D97706;
  background: linear-gradient(135deg, #F59E0B 0%, #FBBF24 100%);
  color: #0F172A;
  display: flex;
  align-items: center;
  gap: 16px;
  text-align: left;
  box-shadow: 0 8px 20px -6px rgba(245, 158, 11, 0.55);
  transition: transform 0.12s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.record-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 24px -6px rgba(245, 158, 11, 0.65);
}

.record-btn:active {
  transform: translateY(0);
}

.record-btn.is-recording {
  background: linear-gradient(135deg, #DC2626 0%, #EF4444 100%);
  border-color: #B91C1C;
  color: #FFFFFF;
  box-shadow: 0 10px 24px -6px rgba(220, 38, 38, 0.55);
}

.record-ring {
  position: absolute;
  inset: -4px;
  border-radius: 20px;
  pointer-events: none;
  opacity: 0;
}

.record-btn.is-recording .record-ring {
  opacity: 1;
  border: 3px solid rgba(220, 38, 38, 0.55);
  animation: pulseRing 1.4s ease-out infinite;
}

@keyframes pulseRing {
  0% { transform: scale(1); opacity: 0.85; }
  100% { transform: scale(1.035, 1.15); opacity: 0; }
}

.record-icon {
  width: 56px;
  height: 56px;
  flex-shrink: 0;
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
}

.record-btn.is-recording .record-icon {
  background: rgba(255, 255, 255, 0.2);
}

.record-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 0;
}

.record-label {
  font-size: clamp(1.05rem, 2.8vw, 1.22rem);
  font-weight: 800;
  letter-spacing: -0.015em;
}

.record-hint {
  font-size: 0.86rem;
  opacity: 0.85;
  font-weight: 500;
}

.record-timer {
  font-variant-numeric: tabular-nums;
  font-size: 1.15rem;
  font-weight: 800;
  padding: 6px 12px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.22);
}

.audio-ready-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--emerald-soft);
  border: 1px solid #6EE7B7;
  color: #065F46;
}

.audio-ready-info {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 0.92rem;
}

.audio-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--emerald);
}

.audio-ready-actions {
  display: flex;
  gap: 8px;
}

/* Photos */
.photo-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.photo-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.photo-add-btn {
  min-height: 48px;
  padding: 0 16px;
  border-radius: 12px;
  border: 1.5px dashed var(--border-strong);
  background: var(--surface-subtle);
  color: var(--ink);
  font-weight: 700;
  font-size: 0.92rem;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.photo-add-btn:hover {
  border-color: var(--amber);
  background: #FFFBEB;
}

.photo-hint {
  font-size: 0.82rem;
  color: var(--ink-light);
}

.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 10px;
}

.photo-thumb {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border);
  aspect-ratio: 4 / 3;
  background: #0F172A;
}

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

.photo-remove-btn {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 30px;
  height: 30px;
  border-radius: 999px;
  border: none;
  background: rgba(15, 23, 42, 0.82);
  color: #FFFFFF;
  font-size: 1.1rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Notes & Submit */
.notes-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.field-label {
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--ink-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.notes-textarea {
  width: 100%;
  padding: 13px 14px;
  border-radius: 12px;
  border: 1.5px solid var(--border-strong);
  background: #FFFFFF;
  font-size: 1rem;
  resize: vertical;
  min-height: 92px;
}

.notes-textarea:focus {
  outline: none;
  border-color: var(--ink);
  box-shadow: 0 0 0 3px rgba(15, 23, 42, 0.1);
}

.submit-row {
  display: flex;
  gap: 10px;
  margin-top: 4px;
}

.btn-primary-lg {
  width: 100%;
  min-height: 54px;
  padding: 0 22px;
  border-radius: 12px;
  border: none;
  background: var(--ink);
  color: #FFFFFF;
  font-size: 1rem;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  box-shadow: var(--shadow-sm);
}

.btn-primary-lg:hover {
  background: #1E293B;
}

.btn-primary-lg:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Sample Jobs */
.samples-section {
  border-top: 1px solid var(--border);
  padding-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.samples-label {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--ink-light);
}

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

.sample-chip {
  min-height: 54px;
  padding: 9px 12px;
  border-radius: 12px;
  border: 1px solid var(--border-strong);
  background: var(--bg);
  text-align: left;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
  transition: border-color 0.12s ease, background 0.12s ease;
}

.sample-chip:hover {
  border-color: var(--amber);
  background: #FFFBEB;
}

.sample-trade {
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #B45309;
}

.sample-name {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--ink);
}

/* Loading & Error Banners */
.loading-banner {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border-radius: 12px;
  background: #EFF6FF;
  border: 1px solid #BFDBFE;
  color: #1E3A8A;
}

.loading-sub {
  font-size: 0.85rem;
  color: #3B82F6;
}

.spinner {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 3px solid #BFDBFE;
  border-top-color: #1D4ED8;
  animation: spin 0.75s linear infinite;
  flex-shrink: 0;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.error-banner {
  padding: 13px 15px;
  border-radius: 12px;
  background: var(--red-soft);
  border: 1px solid #FCA5A5;
  color: #991B1B;
  font-weight: 600;
  font-size: 0.92rem;
}

/* Action Bar */
.doc-wrapper {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.action-bar {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 10px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.action-bar-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.btn-emerald-bar,
.btn-slate-bar,
.btn-outline-bar,
.btn-ghost-bar {
  min-height: 48px;
  padding: 0 14px;
  border-radius: 11px;
  font-weight: 700;
  font-size: 0.88rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  white-space: nowrap;
}

.btn-emerald-bar {
  background: var(--emerald);
  color: #FFFFFF;
  border: none;
}

.btn-emerald-bar:hover {
  background: var(--emerald-hover);
}

.btn-slate-bar {
  background: var(--ink);
  color: #FFFFFF;
  border: none;
}

.btn-slate-bar:hover {
  background: #1E293B;
}

.btn-outline-bar {
  background: #FFFBEB;
  color: #92400E;
  border: 1.5px solid var(--amber);
}

.btn-outline-bar:hover {
  background: var(--amber-soft);
}

.btn-ghost-bar {
  background: var(--surface-subtle);
  color: var(--ink);
  border: 1px solid var(--border);
}

.btn-ghost-bar:hover {
  background: var(--border);
}

/* Editable Contractor Document Sheet */
.quote-sheet {
  background: #FFFFFF;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: var(--shadow-md);
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.sheet-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
  border-bottom: 2px solid var(--ink);
  padding-bottom: 18px;
}

.sheet-company {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  max-width: 520px;
}

.sheet-logo {
  max-width: 88px;
  max-height: 68px;
  object-fit: contain;
  border-radius: 8px;
}

.sheet-company-name {
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.sheet-company-meta {
  font-size: 0.88rem;
  color: var(--ink-muted);
  margin-top: 2px;
}

.inline-link {
  margin-top: 6px;
  padding: 0;
  border: none;
  background: none;
  color: #B45309;
  font-weight: 700;
  font-size: 0.82rem;
  text-decoration: underline;
}

.sheet-doc-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
  min-width: 240px;
}

.doc-stamp {
  font-size: 1.35rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  padding: 5px 14px;
  border-radius: 8px;
  background: var(--amber-soft);
  color: #92400E;
  border: 1.5px solid var(--amber);
}

.doc-stamp.is-invoice {
  background: var(--emerald-soft);
  color: #065F46;
  border-color: var(--emerald);
}

.meta-grid {
  display: flex;
  flex-direction: column;
  gap: 5px;
  width: 100%;
}

.meta-row {
  display: grid;
  grid-template-columns: 95px 1fr;
  align-items: center;
  gap: 8px;
  font-size: 0.86rem;
}

.meta-k {
  color: var(--ink-light);
  font-weight: 700;
  text-align: right;
}

.sheet-two-col {
  display: grid;
  grid-template-columns: 1fr 1.25fr;
  gap: 16px;
}

.sheet-box {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sheet-section-label {
  font-size: 0.74rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-light);
}

.sheet-input,
.sheet-textarea {
  width: 100%;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.75);
  color: var(--ink);
  font-size: 0.94rem;
  min-height: 40px;
}

.sheet-input:hover,
.sheet-textarea:hover {
  border-color: var(--border-strong);
  background: #FFFFFF;
}

.sheet-input:focus,
.sheet-textarea:focus {
  outline: none;
  border-color: var(--ink);
  background: #FFFFFF;
}

.strong-input {
  font-weight: 700;
  font-size: 1.02rem;
}

.meta-input {
  min-height: 36px;
  padding: 4px 8px;
  text-align: right;
  font-weight: 600;
}

.sheet-inline-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

/* Line Items Table */
.sheet-items-wrap {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

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

.items-edit-hint {
  font-size: 0.8rem;
  color: var(--ink-light);
}

.items-table {
  width: 100%;
  border-collapse: collapse;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}

.items-table thead th {
  background: #0F172A;
  color: #FFFFFF;
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 10px 8px;
  text-align: left;
}

.items-table thead th.num {
  text-align: right;
}

.items-table tbody td {
  border-bottom: 1px solid var(--border);
  padding: 6px;
  vertical-align: middle;
}

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

.cell-input,
.cell-select {
  width: 100%;
  min-height: 42px;
  padding: 6px 8px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  font-size: 0.92rem;
}

.cell-input:hover,
.cell-select:hover {
  border-color: var(--border-strong);
  background: var(--bg);
}

.cell-input:focus,
.cell-select:focus {
  outline: none;
  border-color: var(--ink);
  background: #FFFFFF;
}

.cell-num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.col-cat { width: 118px; }
.col-qty { width: 76px; }
.col-unit { width: 76px; }
.col-price { width: 112px; }
.col-total { width: 112px; }
.col-act { width: 44px; text-align: center; }

.line-total-cell {
  font-weight: 700;
  text-align: right;
  padding-right: 10px !important;
  white-space: nowrap;
}

.row-del-btn {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: var(--ink-light);
  font-size: 1.2rem;
  font-weight: 700;
}

.row-del-btn:hover {
  background: var(--red-soft);
  color: var(--red);
}

.btn-add-line {
  min-height: 44px;
  padding: 0 14px;
  border-radius: 10px;
  border: 1.5px dashed var(--border-strong);
  background: var(--bg);
  color: var(--ink);
  font-weight: 700;
  font-size: 0.88rem;
}

.btn-add-line:hover {
  border-color: var(--ink);
  background: var(--surface-subtle);
}

/* Totals & Terms */
.sheet-bottom-grid {
  display: grid;
  grid-template-columns: 1.3fr 0.85fr;
  gap: 20px;
  align-items: start;
}

.sheet-terms-col {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.sheet-block {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sheet-totals-card {
  background: var(--bg);
  border: 1.5px solid var(--border-strong);
  border-radius: 14px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.total-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 0.96rem;
}

.tax-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.tax-input-wrap {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  background: #FFFFFF;
  border: 1px solid var(--border-strong);
  border-radius: 7px;
  padding: 2px 6px;
}

.tax-input {
  width: 58px;
  border: none;
  background: transparent;
  text-align: right;
  font-weight: 700;
  min-height: 32px;
}

.tax-input:focus {
  outline: none;
}

.grand-total-row {
  border-top: 2px solid var(--ink);
  padding-top: 12px;
  font-size: 1.24rem;
  font-weight: 800;
  color: var(--emerald);
}

.grand-total-row span {
  color: var(--ink);
}

/* Photos in Sheet */
.sheet-photos-block {
  display: flex;
  flex-direction: column;
  gap: 10px;
  border-top: 1px solid var(--border);
  padding-top: 16px;
}

.sheet-photos-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.toggle-inline {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.84rem;
  color: var(--ink-muted);
  cursor: pointer;
}

.doc-photos-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.doc-photos-grid img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid var(--border);
}

/* Signature Block */
.signature-block {
  border-top: 1px solid var(--border-strong);
  padding-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sig-heading {
  font-weight: 800;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.sig-note {
  margin: 0;
  font-size: 0.84rem;
  color: var(--ink-muted);
}

.sig-lines {
  margin-top: 22px;
  display: grid;
  grid-template-columns: 1.5fr 1.2fr 0.7fr;
  gap: 18px;
}

.sig-line {
  border-bottom: 1.5px solid var(--ink);
  height: 26px;
}

.sig-caption {
  margin-top: 5px;
  font-size: 0.78rem;
  color: var(--ink-light);
}

.sheet-watermark {
  text-align: center;
  font-size: 0.78rem;
  color: var(--ink-light);
  border-top: 1px dashed var(--border);
  padding-top: 12px;
}

.transcript-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 16px;
  font-size: 0.88rem;
  color: var(--ink-muted);
}

.transcript-box summary {
  font-weight: 700;
  cursor: pointer;
  color: var(--ink);
}

.site-footer {
  max-width: 980px;
  margin: 0 auto 24px;
  padding: 0 16px;
  text-align: center;
  font-size: 0.84rem;
  color: var(--ink-light);
  display: flex;
  justify-content: center;
  gap: 8px;
}

.site-footer a {
  color: var(--ink-muted);
  font-weight: 600;
  text-decoration: none;
}

/* Modals & Drawer */
.modal-backdrop,
.drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(15, 23, 42, 0.58);
  backdrop-filter: blur(3px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.drawer-backdrop {
  justify-content: flex-end;
  padding: 0;
}

.modal-panel {
  background: #FFFFFF;
  border-radius: 20px;
  width: 100%;
  max-width: 560px;
  max-height: 92vh;
  overflow-y: auto;
  box-shadow: 0 24px 50px -12px rgba(15, 23, 42, 0.35);
}

.drawer-panel {
  background: #FFFFFF;
  width: 100%;
  max-width: 420px;
  height: 100vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  box-shadow: -12px 0 35px rgba(15, 23, 42, 0.25);
}

.modal-head {
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.modal-head h2 {
  margin: 0;
  font-size: 1.18rem;
  font-weight: 800;
}

.icon-close {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  border: none;
  background: var(--surface-subtle);
  font-size: 1.5rem;
  line-height: 1;
}

.modal-body {
  padding: 18px 20px 22px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

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

/* Profile Form */
.logo-uploader {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px;
  border-radius: 12px;
  background: var(--bg);
  border: 1px solid var(--border);
}

.logo-preview-box {
  width: 72px;
  height: 72px;
  border-radius: 12px;
  border: 1px solid var(--border-strong);
  background: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--ink-light);
}

.logo-preview-box img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.logo-uploader-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.micro-note {
  width: 100%;
  font-size: 0.78rem;
  color: var(--ink-light);
}

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

.form-full {
  grid-column: 1 / -1;
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--ink-muted);
}

.form-field input,
.form-field select,
.form-field textarea {
  min-height: 46px;
  padding: 9px 12px;
  border-radius: 10px;
  border: 1.5px solid var(--border-strong);
  background: #FFFFFF;
  color: var(--ink);
  font-weight: 500;
}

/* Small Buttons */
.btn-primary-sm,
.btn-emerald-sm,
.btn-outline-sm,
.btn-ghost-sm {
  min-height: 44px;
  padding: 0 15px;
  border-radius: 10px;
  font-weight: 700;
  font-size: 0.88rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.btn-primary-sm {
  border: none;
  background: var(--ink);
  color: #FFFFFF;
}

.btn-emerald-sm {
  border: none;
  background: var(--emerald);
  color: #FFFFFF;
}

.btn-outline-sm {
  border: 1.5px solid var(--border-strong);
  background: #FFFFFF;
  color: var(--ink);
  cursor: pointer;
}

.btn-ghost-sm {
  border: none;
  background: rgba(15, 23, 42, 0.08);
  color: var(--ink);
}

/* History Drawer */
.history-list {
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.history-empty {
  padding: 36px 16px;
  text-align: center;
  color: var(--ink-light);
}

.history-item {
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 13px;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.history-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
}

.history-title {
  font-weight: 800;
  font-size: 0.95rem;
}

.history-sub {
  font-size: 0.82rem;
  color: var(--ink-muted);
}

.history-total {
  font-weight: 800;
  color: var(--emerald);
  font-size: 0.98rem;
  white-space: nowrap;
}

.pill-est,
.pill-inv {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 6px;
  text-transform: uppercase;
  margin-right: 6px;
}

.pill-est {
  background: var(--amber-soft);
  color: #92400E;
}

.pill-inv {
  background: var(--emerald-soft);
  color: #065F46;
}

.history-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.history-actions button {
  min-height: 36px;
  padding: 0 10px;
  border-radius: 8px;
  border: 1px solid var(--border-strong);
  background: #FFFFFF;
  font-size: 0.8rem;
  font-weight: 700;
}

.history-actions button.danger {
  color: var(--red);
}

/* Upgrade Modal */
.pro-eyebrow {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--emerald);
  margin-bottom: 2px;
}

.upgrade-lead {
  margin: 0;
  color: var(--ink-muted);
  font-size: 0.94rem;
}

.claimed-box {
  padding: 14px;
  border-radius: 12px;
  background: var(--emerald-soft);
  border: 1.5px solid var(--emerald);
  color: #065F46;
}

.claimed-title {
  font-weight: 800;
  font-size: 0.98rem;
}

.claimed-sub {
  margin: 4px 0 10px;
  font-size: 0.84rem;
}

.claimed-key-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.claimed-key-row code {
  flex: 1;
  background: #FFFFFF;
  padding: 10px 12px;
  border-radius: 8px;
  font-weight: 800;
  font-size: 0.92rem;
  word-break: break-all;
}

.tier-compare {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 12px;
}

.tier-col {
  border: 1px solid var(--border-strong);
  border-radius: 14px;
  padding: 14px;
  background: var(--bg);
}

.tier-pro {
  border: 2px solid var(--emerald);
  background: #F0FDF4;
}

.tier-badge {
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: #065F46;
  margin-bottom: 4px;
}

.tier-name {
  font-weight: 800;
  font-size: 1rem;
}

.tier-price {
  font-size: 1.45rem;
  font-weight: 900;
  margin: 4px 0 8px;
}

.tier-price span {
  font-size: 0.86rem;
  font-weight: 600;
}

.tier-price small {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--ink-muted);
}

.tier-list {
  margin: 0;
  padding-left: 18px;
  font-size: 0.84rem;
  color: var(--ink-muted);
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.checkout-stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.btn-checkout-annual,
.btn-checkout-monthly {
  min-height: 54px;
  padding: 0 18px;
  border-radius: 12px;
  font-weight: 800;
  font-size: 0.98rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.btn-checkout-annual {
  border: none;
  background: var(--emerald);
  color: #FFFFFF;
}

.btn-checkout-annual:hover {
  background: var(--emerald-hover);
}

.save-pill {
  background: rgba(255, 255, 255, 0.22);
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 0.76rem;
}

.btn-checkout-monthly {
  border: 1.5px solid var(--ink);
  background: #FFFFFF;
  color: var(--ink);
  justify-content: center;
}

.license-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.8rem;
  color: var(--ink-light);
}

.license-divider::before,
.license-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}

.license-form {
  display: flex;
  gap: 8px;
}

.license-input {
  flex: 1;
  min-height: 46px;
  padding: 0 12px;
  border-radius: 10px;
  border: 1.5px solid var(--border-strong);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.license-status {
  font-size: 0.86rem;
  font-weight: 700;
  min-height: 20px;
}

.license-status.ok { color: var(--emerald); }
.license-status.err { color: var(--red); }

/* Toast */
.toast {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  background: var(--ink);
  color: #FFFFFF;
  padding: 12px 18px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 0.9rem;
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.35);
  max-width: calc(100vw - 32px);
}

/* Mobile Responsive */
@media (max-width: 760px) {
  .topbar-inner {
    padding: 8px 12px;
  }
  .nav-btn span:not(.count-badge) {
    display: none;
  }
  .capture-card {
    padding: 16px;
  }
  .samples-grid {
    grid-template-columns: 1fr;
  }
  .quote-sheet {
    padding: 18px 14px;
  }
  .sheet-doc-meta {
    align-items: flex-start;
    width: 100%;
  }
  .meta-k {
    text-align: left;
  }
  .meta-input {
    text-align: left;
  }
  .sheet-two-col,
  .sheet-bottom-grid,
  .tier-compare,
  .form-grid,
  .sig-lines {
    grid-template-columns: 1fr;
  }
  .doc-photos-grid {
    grid-template-columns: 1fr;
  }
  .items-table thead {
    display: none;
  }
  .items-table,
  .items-table tbody,
  .items-table tr,
  .items-table td {
    display: block;
    width: 100%;
  }
  .items-table tr {
    border: 1px solid var(--border);
    border-radius: 12px;
    margin-bottom: 10px;
    padding: 8px;
    background: var(--bg);
  }
  .items-table tbody td {
    border: none;
    padding: 4px 2px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
  }
  .items-table tbody td::before {
    content: attr(data-label);
    font-size: 0.74rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--ink-light);
    min-width: 82px;
  }
  .items-table tbody td.col-act::before {
    content: "";
    min-width: 0;
  }
  .items-table tbody td.col-act {
    justify-content: flex-end;
  }
}

/* Razor-Sharp Client-Ready Print / PDF Stylesheet */
@media print {
  @page {
    size: letter;
    margin: 0.45in 0.5in;
  }

  html, body {
    background: #FFFFFF !important;
    color: #0F172A !important;
    font-size: 10pt;
  }

  .no-print {
    display: none !important;
  }

  .app-shell {
    max-width: none;
    margin: 0;
    padding: 0;
  }

  .quote-sheet {
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    padding: 0 !important;
    gap: 14px !important;
  }

  .sheet-box,
  .sheet-totals-card {
    background: #F8FAFC !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .items-table thead th {
    background: #0F172A !important;
    color: #FFFFFF !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .doc-stamp {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .sheet-input,
  .sheet-textarea,
  .cell-input,
  .cell-select,
  .tax-input {
    border: none !important;
    background: transparent !important;
    padding: 2px 0 !important;
    min-height: auto !important;
    resize: none !important;
    appearance: none !important;
    -webkit-appearance: none !important;
  }

  .tax-input-wrap {
    border: none !important;
    background: transparent !important;
    padding: 0 !important;
  }

  .sheet-two-col {
    grid-template-columns: 1fr 1.25fr !important;
  }

  .sheet-bottom-grid {
    grid-template-columns: 1.3fr 0.85fr !important;
    break-inside: avoid;
  }

  .signature-block {
    break-inside: avoid;
  }

  .sheet-photos-block.exclude-from-print {
    display: none !important;
  }

  .doc-photos-grid {
    grid-template-columns: repeat(3, 1fr) !important;
    break-inside: avoid;
  }
}
