/* ===== DESIGN TOKENS — Soft Pastel Studio =====
   Editorial photo-studio palette. Light mode is cream-tinted off-white with
   warm graphite text — calm, paper-like, prints cleanly. Dark mode is soft
   graphite (never pure black) with the same pastel sage accent. The accent
   is restrained: a muted sage green that reads as 'creative studio', not
   'fintech app'. Text contrast is tuned for AAA legibility on screen and
   strong ink density when printed. */
:root,
[data-theme='light'] {
  /* Surfaces — layered off-whites/whites */
  --color-bg: #f7f5f1;            /* Warm cream — easy on the eyes */
  --color-surface: #ffffff;        /* Cards, modals */
  --color-surface-2: #fffdfa;
  --color-surface-offset: #f0ede7;  /* Section background, slightly warmer */
  --color-surface-offset-2: #e6e2da;
  --color-surface-dynamic: #ddd8cf;
  --color-divider: #d8d3c8;        /* Warm hairline */
  --color-border: #cdc7bb;

  /* Text — deep warm graphite scale. Muted text stays readable on cream and
     prints with full ink density. */
  --color-text: #1c1b18;           /* Primary text — warm near-black */
  --color-text-muted: #3a3833;     /* Secondary — plenty of contrast */
  --color-text-faint: #56544d;     /* Tertiary — still well above WCAG AA */
  --color-text-inverse: #1c2c25;   /* Deep forest — sits on pastel pills */

  /* Accent — muted sage green. Same hue in light and dark for consistency,
     just shifted in lightness. Prints as a recognizable mid-gray-green. */
  --color-primary: #6ba48a;        /* Sage — button fill in light mode */
  --color-primary-hover: #5d957c;
  --color-primary-active: #4f8068;
  --color-primary-highlight: #e9f1ec;
  --color-primary-tint: #e9f1ec;     /* alias of highlight, used by mileage/time/recurring/audit chips */

  /* Semantic — muted, ink-friendly */
  --color-success: #4f8068;        /* Same family as primary */
  --color-success-highlight: #e3ede7;
  --color-error: #b04848;          /* Muted brick red — not fire-engine */

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 18px;
  --radius-full: 9999px;

  --transition-interactive: 200ms cubic-bezier(0.4, 0, 0.2, 1);

  /* Soft shadows — light, no color tint */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 2px 8px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.08);

  --text-xs: clamp(0.75rem, 0.7rem + 0.25vw, 0.8125rem);
  --text-sm: clamp(0.8125rem, 0.78rem + 0.2vw, 0.9375rem);
  --text-base: clamp(0.9375rem, 0.9rem + 0.2vw, 1rem);
  --text-lg: clamp(1.0625rem, 1rem + 0.4vw, 1.25rem);
  --text-xl: clamp(1.375rem, 1.2rem + 0.85vw, 1.875rem);
  --text-2xl: clamp(1.875rem, 1.4rem + 2vw, 2.875rem);

  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;

  /* Typography — SF Pro on Apple devices, Inter elsewhere. The serif is
     reserved for invoice/contract headers; the body UI is all SF/Inter. */
  --font-display: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Inter', 'Helvetica Neue', sans-serif;
  --font-body: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Inter', 'Helvetica Neue', sans-serif;
  --font-serif: 'DM Serif Display', 'Times New Roman', Georgia, serif;

  --content-default: 1280px;
}

[data-theme='dark'],
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    /* Surfaces — layered graphite, never pure black */
    /* Soft graphite canvas — never pure black, easier on the eyes. */
    --color-bg: #161614;
    --color-surface: #1f1e1c;
    --color-surface-2: #25241f;
    --color-surface-offset: #1a1a18;
    --color-surface-offset-2: #2c2b27;
    --color-surface-dynamic: #3a3933;
    --color-divider: #2d2c28;
    --color-border: #3a3933;
    /* Text — warm cream scale, AAA contrast on the surface above. */
    --color-text: #f0ede7;
    --color-text-muted: #c9c5bb;
    --color-text-faint: #98948a;
    --color-text-inverse: #0e1f17;
    /* Pastel sage — same hue as light mode, lifted in lightness. */
    --color-primary: #a8d5c2;
    --color-primary-hover: #b8dccd;
    --color-primary-active: #8cc4ad;
    --color-primary-highlight: #1f2e28;
    --color-success: #9ad1b1;
    --color-success-highlight: #1a2922;
    --color-error: #e89b95;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.4);
    --shadow-md: 0 2px 10px rgba(0,0,0,0.5);
    --shadow-lg: 0 8px 28px rgba(0,0,0,0.6);
  }
}

[data-theme='dark'] {
  --color-bg: #161614;
  --color-surface: #1f1e1c;
  --color-surface-2: #25241f;
  --color-surface-offset: #1a1a18;
  --color-surface-offset-2: #2c2b27;
  --color-surface-dynamic: #3a3933;
  --color-divider: #2d2c28;
  --color-border: #3a3933;
  --color-text: #f0ede7;
  --color-text-muted: #c9c5bb;
  --color-text-faint: #98948a;
  --color-text-inverse: #0e1f17;
  --color-primary: #a8d5c2;
  --color-primary-hover: #b8dccd;
  --color-primary-active: #8cc4ad;
  --color-primary-highlight: #1f2e28;
  --color-success: #9ad1b1;
  --color-success-highlight: #1a2922;
  --color-error: #e89b95;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.4);
  --shadow-md: 0 2px 10px rgba(0,0,0,0.5);
  --shadow-lg: 0 8px 28px rgba(0,0,0,0.6);
}

/* ===== BASE RESET ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  scroll-behavior: smooth;
  scroll-padding-top: var(--space-16);
}
body {
  min-height: 100dvh;
  line-height: 1.5;
  font-family: var(--font-body);
  font-size: var(--text-base);
  color: var(--color-text);
  background-color: var(--color-bg);
  letter-spacing: -0.011em; /* Apple/SF tightening */
}
h1, h2, h3, h4 { letter-spacing: -0.022em; font-weight: 600; }
h5, h6 { letter-spacing: -0.014em; font-weight: 600; }
img, svg { display: block; max-width: 100%; }
h1, h2, h3, h4, h5, h6 { text-wrap: balance; line-height: 1.15; }
p, li { text-wrap: pretty; }
input, button, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: none; }
a, button, input, textarea, select, [role='button'] {
  transition: color var(--transition-interactive),
              background var(--transition-interactive),
              border-color var(--transition-interactive),
              box-shadow var(--transition-interactive),
              opacity var(--transition-interactive);
}
:focus-visible { outline: 2px solid var(--color-primary); outline-offset: 3px; border-radius: var(--radius-sm); }
::selection { background: color-mix(in oklab, var(--color-primary) 25%, transparent); }

/* ===== NAV ===== */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  /* Header sits on the page canvas — same color as body, separated only
     by a hairline. In dark mode that's pure black; in light mode that's
     the soft off-white. */
  background: var(--color-bg);
  border-bottom: none;
  box-shadow: none;
}
.nav-inner {
  max-width: var(--content-default);
  margin: 0 auto;
  padding: var(--space-3) var(--space-6);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
}
/* Brand mark — refined two-line wordmark.
   First name in semibold display, surname in tracked uppercase tagline.
   Inspired by Apple’s typographic restraint: legible, calm, premium. */
.logo {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  color: var(--color-text);
  text-decoration: none;
  padding: 2px 0;
}
.logo svg { color: var(--color-text); opacity: 0.85; flex-shrink: 0; }
.logo-text {
  display: inline-flex;
  flex-direction: column;
  line-height: 1;
  font-family: var(--font-display);
  color: var(--color-text);
  /* Visually hide raw text node so we can render via ::before/::after */
  font-size: 0;
  letter-spacing: 0;
}
.logo-text::before {
  content: 'Funmi Adeshina';
  display: block;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.022em;
  color: var(--color-text);
  line-height: 1.1;
}
.logo-text em { display: none; }
@media (max-width: 480px) {
  .logo-text::before { font-size: 17px; }
}
.nav-actions { display: flex; align-items: center; gap: var(--space-3); }

/* ===== BUTTONS — Apple-style, soft pills ===== */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: 9px 18px;
  background: var(--color-primary);
  color: var(--color-text-inverse);
  border-radius: var(--radius-full);
  font-size: var(--text-sm);
  font-weight: 500;
  letter-spacing: -0.01em;
  border: none;
  white-space: nowrap;
}
.btn-primary:hover { background: var(--color-primary-hover); }
.btn-primary:active { background: var(--color-primary-active); }

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: 8px 16px;
  background: transparent;
  color: var(--color-primary);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  font-size: var(--text-sm);
  font-weight: 500;
  letter-spacing: -0.01em;
  white-space: nowrap;
}
.btn-secondary:hover { background: var(--color-surface-offset); border-color: var(--color-text-faint); color: var(--color-primary-hover); }

.btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: transparent;
  color: var(--color-text-muted);
  border-radius: var(--radius-full);
  border: 1px solid transparent;
}
.btn-ghost:hover { background: var(--color-surface-offset); color: var(--color-text); }

/* ===== LAYOUT ===== */
.main-layout {
  max-width: var(--content-default);
  margin: 0 auto;
  padding: var(--space-8) var(--space-6);
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: var(--space-6);
  align-items: start;
}

/* ===== CARDS — quiet, hairline-bordered ===== */
.card {
  background: var(--color-surface);
  border: 1px solid var(--color-divider);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  margin-bottom: var(--space-4);
  box-shadow: none;
}
.card:last-child { margin-bottom: 0; }
.card-title {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-text-faint);
  margin-bottom: var(--space-5);
}

/* ===== FORMS ===== */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-4);
}
.field { display: flex; flex-direction: column; gap: var(--space-1); }
.field-full { grid-column: 1 / -1; }
.field label {
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.field input,
.field select,
.field textarea {
  padding: 9px 12px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  color: var(--color-text);
  resize: vertical;
}

/* All <select>s — strip Safari's native chrome (which washes out text on dark
   backgrounds) and draw our own chevron. Apply globally so every dropdown
   stays readable in dark mode. */
select {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  color: var(--color-text);
  background-color: var(--color-surface);
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6' fill='none'><path d='M1 1l4 4 4-4' stroke='%2386868b' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/></svg>");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 28px !important;
}
select:disabled { opacity: 0.5; cursor: not-allowed; }
/* Native option list — force readable colors in dark mode (Safari/macOS
   inherits these but iOS sometimes ignores). */
select option {
  color: var(--color-text);
  background-color: var(--color-surface);
}
.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 4px color-mix(in oklab, var(--color-primary) 18%, transparent);
}
.field input::placeholder,
.field textarea::placeholder { color: var(--color-text-faint); }

/* ===== TABS ===== */
.tab-bar {
  display: flex;
  gap: var(--space-1);
  background: var(--color-surface-offset);
  border-radius: var(--radius-lg);
  padding: var(--space-1);
  margin-bottom: var(--space-5);
}
.tab {
  flex: 1;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md);
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--color-text-muted);
  text-align: center;
  white-space: nowrap;
}
.tab:hover { color: var(--color-text); }
.tab.active {
  background: var(--color-surface-2);
  color: var(--color-primary);
  box-shadow: var(--shadow-sm);
}
.tab-content { display: none; }
.tab-content.active { display: block; }

/* Custom tab highlight */
.tab-custom {
  color: var(--color-primary) !important;
  opacity: 0.8;
}
.tab-custom.active { opacity: 1; }

/* ===== CUSTOM SERVICES TAB ===== */
.custom-services-intro {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  margin: 0 0 var(--space-5);
  line-height: 1.6;
}
.custom-preset-section {
  margin-bottom: var(--space-5);
}
.custom-preset-label {
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-text-muted);
  margin-bottom: var(--space-3);
}
.custom-preset-grid {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}
.preset-chip {
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 500;
  background: var(--color-surface-offset);
  color: var(--color-text-muted);
  border: 1px solid var(--color-border);
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  white-space: nowrap;
}
.preset-chip:hover {
  background: var(--color-surface-dynamic);
  color: var(--color-primary);
  border-color: var(--color-primary);
}
.custom-empty {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  text-align: center;
  padding: var(--space-5) var(--space-4);
  border: 1px dashed var(--color-border);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-4);
}
.custom-items-list {
  margin-bottom: var(--space-3);
}
.custom-item-row {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) 0;
  border-bottom: 1px solid var(--color-border);
}
.custom-item-row:last-child { border-bottom: none; }
.custom-item-inputs {
  flex: 1;
  display: flex;
  gap: var(--space-2);
  align-items: center;
  flex-wrap: wrap;
}
.custom-item-label-input {
  flex: 2;
  min-width: 140px;
  padding: 7px 10px;
  background: var(--color-surface-offset);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  color: var(--color-text);
  font-size: var(--text-sm);
  font-family: inherit;
}
.custom-item-label-input:focus {
  outline: none;
  border-color: var(--color-primary);
}
.custom-item-cat-select {
  flex: 1;
  min-width: 110px;
  padding: 7px 8px;
  background: var(--color-surface-offset);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  color: var(--color-text-muted);
  font-size: 0.75rem;
  font-family: inherit;
  cursor: pointer;
}
.custom-item-cat-select:focus { outline: none; border-color: var(--color-primary); }
.custom-price-wrap {
  display: flex;
  align-items: center;
  background: var(--color-surface-offset);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  min-width: 100px;
}
.custom-price-symbol {
  padding: 7px 6px 7px 10px;
  font-size: var(--text-sm);
  color: var(--color-primary);
  font-weight: 600;
  line-height: 1;
}
.custom-item-price-input {
  flex: 1;
  border: none;
  background: transparent;
  padding: 7px 10px 7px 0;
  color: var(--color-text);
  font-size: var(--text-sm);
  font-family: inherit;
  min-width: 60px;
  -moz-appearance: textfield;
}
.custom-item-price-input:focus { outline: none; }
.custom-item-price-input::-webkit-outer-spin-button,
.custom-item-price-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.custom-item-desc-input {
  flex: 1 1 100%;
  width: 100%;
  padding: 7px 10px;
  margin-top: 4px;
  background: var(--color-surface-offset);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  color: var(--color-text);
  font-size: var(--text-sm);
  font-family: inherit;
  line-height: 1.5;
  resize: vertical;
  min-height: 50px;
  box-sizing: border-box;
}
.custom-item-desc-input:focus {
  outline: none;
  border-color: var(--color-primary);
}
.custom-item-desc-input::placeholder {
  color: var(--color-text-muted);
  opacity: 0.7;
}
.custom-item-remove {
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  border-radius: var(--radius-sm);
  background: transparent;
  border: 1px solid transparent;
  color: var(--color-text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, color 0.15s;
}
.custom-item-remove:hover {
  background: rgba(239,68,68,0.12);
  color: #ef4444;
  border-color: rgba(239,68,68,0.3);
}
.btn-add-custom-row {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  background: transparent;
  border: 1.5px dashed var(--color-border);
  border-radius: var(--radius-md);
  color: var(--color-text-muted);
  font-size: var(--text-sm);
  font-weight: 500;
  cursor: pointer;
  width: 100%;
  justify-content: center;
  transition: border-color 0.15s, color 0.15s;
  margin-top: var(--space-2);
}
.btn-add-custom-row:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
}

/* ===== SERVICE GROUPS ===== */
.service-group { margin-bottom: var(--space-6); }
.service-group:last-child { margin-bottom: 0; }
.group-label {
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-text-faint);
  margin-bottom: var(--space-3);
  padding-bottom: var(--space-2);
  border-bottom: 1px solid var(--color-divider);
}

.service-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--color-divider);
}
.service-row:last-child { border-bottom: none; }

.service-check {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex: 1;
  min-width: 0;
}
.service-check label {
  font-size: var(--text-sm);
  color: var(--color-text);
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* Custom checkbox — always renders a solid dark check on a pastel-sage fill
   so the check stays legible in both light and dark modes. */
.svc-check,
input[type="checkbox"].svc-check,
.addon-chip input[type="checkbox"],
input[type="checkbox"]:not([role]):not(.no-custom-cb) {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  min-width: 18px;
  border: 1.5px solid var(--color-border);
  border-radius: 4px;
  background: var(--color-surface);
  cursor: pointer;
  position: relative;
  flex-shrink: 0;
  transition: background 0.12s ease, border-color 0.12s ease;
  vertical-align: middle;
}
.addon-chip input[type="checkbox"] { width: 14px; height: 14px; min-width: 14px; }
.svc-check:hover,
.addon-chip input[type="checkbox"]:hover,
input[type="checkbox"]:not([role]):not(.no-custom-cb):hover { border-color: var(--color-primary); }
.svc-check:checked,
.addon-chip input[type="checkbox"]:checked,
input[type="checkbox"]:not([role]):not(.no-custom-cb):checked {
  background: var(--color-primary);
  border-color: var(--color-primary);
}
/* Solid black/near-black checkmark drawn via SVG mask — stays dark on any
   accent color, ensures "check mark remains black" per user request. */
.svc-check:checked::after,
.addon-chip input[type="checkbox"]:checked::after,
input[type="checkbox"]:not([role]):not(.no-custom-cb):checked::after {
  content: '';
  position: absolute;
  inset: 0;
  background-color: #0c0c0a;
  -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'><path d='M3.5 8.5l3 3 6-7' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/></svg>") center / 78% 78% no-repeat;
          mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'><path d='M3.5 8.5l3 3 6-7' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/></svg>") center / 78% 78% no-repeat;
}
.svc-check:focus-visible,
.addon-chip input[type="checkbox"]:focus-visible,
input[type="checkbox"]:not([role]):not(.no-custom-cb):focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}
/* Indeterminate (partial) state used by select-all in transactions table */
.svc-check:indeterminate,
.addon-chip input[type="checkbox"]:indeterminate,
input[type="checkbox"]:not([role]):not(.no-custom-cb):indeterminate {
  background: var(--color-primary);
  border-color: var(--color-primary);
}
.svc-check:indeterminate::after,
.addon-chip input[type="checkbox"]:indeterminate::after,
input[type="checkbox"]:not([role]):not(.no-custom-cb):indeterminate::after {
  content: '';
  position: absolute;
  left: 20%; right: 20%; top: 45%;
  height: 2px;
  background: #0c0c0a;
  border-radius: 1px;
}

.service-controls { display: flex; flex-direction: column; gap: var(--space-1); flex-shrink: 0; }
.service-controls select {
  padding: var(--space-1) var(--space-3);
  background: var(--color-surface-offset);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-size: var(--text-xs);
  color: var(--color-text);
  max-width: 200px;
}
.service-controls select:focus { outline: 2px solid var(--color-primary); outline-offset: -1px; border-color: transparent; }
.ctrl-label { font-size: var(--text-xs); color: var(--color-text-faint); }
.duration-row { display: flex; align-items: center; gap: var(--space-2); }

/* ===== ADDON CHIPS ===== */
.addon-grid {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-top: var(--space-3);
}
.addon-chip {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  background: var(--color-surface-offset);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  cursor: pointer;
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}
.addon-chip:hover { background: var(--color-surface-dynamic); color: var(--color-text); }
/* (custom .addon-chip checkbox styling now handled in unified rule above) */
.addon-chip:has(input:checked) {
  background: var(--color-primary-highlight);
  border-color: var(--color-primary);
  color: var(--color-primary);
}

/* ===== RIGHT PANEL ===== */
.right-panel { position: relative; }
.summary-sticky {
  position: sticky;
  top: calc(56px + var(--space-8));
}
.summary-card { padding: var(--space-5); }

/* ===== LINE ITEMS ===== */
.line-items {
  min-height: 80px;
  margin-bottom: var(--space-4);
}
.empty-state {
  color: var(--color-text-faint);
  font-size: var(--text-sm);
  text-align: center;
  padding: var(--space-6) 0;
  font-style: italic;
}
.line-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-2) 0;
  border-bottom: 1px solid var(--color-divider);
}
.line-item:last-child { border-bottom: none; }
.line-item-label {
  font-size: var(--text-sm);
  color: var(--color-text);
  flex: 1;
}
.line-item-desc {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  margin-top: 2px;
  line-height: 1.4;
}
.line-item-desc-wrap {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  margin-top: 2px;
}
.line-item-desc-wrap .line-item-desc {
  flex: 1;
  margin-top: 0;
  padding: 3px 6px;
  border-radius: 4px;
  border: 1px dashed transparent;
  cursor: text;
  transition: border-color 120ms ease, background-color 120ms ease;
  white-space: pre-wrap;
}
.line-item-desc-wrap .line-item-desc:hover {
  border-color: var(--color-border, #d8d4cc);
}
.line-item-desc-wrap .line-item-desc:focus,
.line-item-desc-wrap .line-item-desc:focus-visible {
  outline: none;
  border-color: var(--color-primary, #6ba48a);
  border-style: solid;
  background-color: var(--color-surface-2, rgba(107,164,138,0.06));
  color: var(--color-text);
}
.line-item-desc-wrap .line-item-desc.is-edited {
  border-color: var(--color-primary, #6ba48a);
  border-style: solid;
  background-color: var(--color-surface-2, rgba(107,164,138,0.06));
  color: var(--color-text);
}
.desc-reset-btn {
  flex: 0 0 auto;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid var(--color-border, #d8d4cc);
  background: transparent;
  color: var(--color-text-muted);
  cursor: pointer;
  align-self: flex-start;
}
.desc-reset-btn:hover {
  border-color: var(--color-primary, #6ba48a);
  color: var(--color-text);
}
.line-item-price {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-text);
  white-space: nowrap;
}
.line-item-addon {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}
.line-item-addon .line-item-price { color: var(--color-text-muted); font-weight: 500; }

/* ===== TOTALS ===== */
.summary-totals {
  border-top: 2px solid var(--color-border);
  padding-top: var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
.total-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}
.subtotal-row { color: var(--color-text); }
.grand-total-row {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  color: var(--color-text);
  padding-top: var(--space-2);
  border-top: 1px solid var(--color-border);
  margin-top: var(--space-1);
}
.deposit-row { color: var(--color-primary); font-weight: 600; }
.text-success { color: var(--color-success); }
.text-accent { color: var(--color-primary); }

/* ===== PREVIEW ACTIONS ===== */
.preview-actions {
  display: flex;
  gap: var(--space-3);
  margin-top: var(--space-4);
}
.preview-actions .btn-primary,
.preview-actions .btn-secondary { flex: 1; justify-content: center; }

/* Compact 3-button row that fits within the live-quote panel width */
.preview-actions-compact {
  display: flex;
  gap: 6px;
  margin-top: var(--space-3);
  width: 100%;
  flex-wrap: nowrap;
}
.preview-actions-compact .btn-compact {
  flex: 1 1 0;
  min-width: 0;
  justify-content: center;
  align-items: center;
  padding: 0.5rem 0.5rem;
  font-size: 0.78rem;
  font-weight: 500;
  border-radius: 8px;
  gap: 0.3rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: 0;
}
.preview-actions-compact .btn-compact svg {
  flex-shrink: 0;
}
/* Contract variant: same shape as Generate Invoice but outlined to differentiate */
.preview-actions-compact .btn-contract {
  background: transparent;
  color: var(--color-primary);
  border: 1px solid var(--color-primary);
}
.preview-actions-compact .btn-contract:hover {
  background: rgba(107, 164, 138, 0.1);
}
@media (max-width: 380px) {
  .preview-actions-compact .btn-compact {
    font-size: 0.7rem;
    padding: 0.45rem 0.35rem;
    gap: 0.2rem;
  }
  .preview-actions-compact .btn-compact svg {
    width: 11px;
    height: 11px;
  }
}

/* ===== MODAL ===== */
.modal-overlay,
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
  z-index: 200;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: var(--space-8) var(--space-4);
  overflow-y: auto;
}

/* Inputs inside any modal need explicit colors so text is legible.
   Without this, mobile Safari renders white-on-white in dark mode. */
.modal input[type="text"],
.modal input[type="number"],
.modal input[type="date"],
.modal input[type="time"],
.modal input[type="email"],
.modal input[type="tel"],
.modal input[type="url"],
.modal input:not([type]),
.modal textarea,
.modal select,
.modal-backdrop input[type="text"],
.modal-backdrop input[type="number"],
.modal-backdrop input[type="date"],
.modal-backdrop input[type="time"],
.modal-backdrop input[type="email"],
.modal-backdrop input[type="tel"],
.modal-backdrop input[type="url"],
.modal-backdrop input:not([type]),
.modal-backdrop textarea,
.modal-backdrop select {
  background: var(--color-surface-offset);
  color: var(--color-text);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 14px;
  font-family: inherit;
  width: 100%;
  box-sizing: border-box;
  -webkit-text-fill-color: var(--color-text); /* iOS Safari override */
}
.modal input::placeholder,
.modal textarea::placeholder,
.modal-backdrop input::placeholder,
.modal-backdrop textarea::placeholder {
  color: var(--color-text-faint);
  opacity: 1;
}
.modal input:focus,
.modal textarea:focus,
.modal select:focus,
.modal-backdrop input:focus,
.modal-backdrop textarea:focus,
.modal-backdrop select:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 2px var(--color-primary-tint);
}
.modal {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 760px;
  box-shadow: var(--shadow-lg);
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-5) var(--space-6);
  border-bottom: 1px solid var(--color-border);
}
.modal-header h2 {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  color: var(--color-text);
}
.modal-actions { display: flex; align-items: center; gap: var(--space-2); flex-wrap: wrap; }
.modal-close {
  width: 32px;
  height: 32px;
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}
.modal-body { padding: var(--space-6); }

/* ===== PROPOSAL CONTENT ===== */
.proposal {
  font-family: var(--font-body);
  color: var(--color-text);
}
.proposal-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: var(--space-8);
  padding-bottom: var(--space-6);
  border-bottom: 2px solid var(--color-primary);
}
.proposal-brand { display: flex; align-items: center; gap: var(--space-3); }
.proposal-brand .brand-name {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  color: var(--color-text);
}
.proposal-brand .brand-name em { color: var(--color-primary); font-style: normal; }
.proposal-brand .brand-sub {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.proposal-meta { text-align: right; font-size: var(--text-sm); color: var(--color-text-muted); line-height: 1.8; }

.proposal-section { margin-bottom: var(--space-6); }
.proposal-section-title {
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-text-faint);
  margin-bottom: var(--space-3);
  padding-bottom: var(--space-2);
  border-bottom: 1px solid var(--color-divider);
}

.client-block {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-4);
}
.client-field { display: flex; flex-direction: column; gap: var(--space-1); }
.client-field .label { font-size: var(--text-xs); color: var(--color-text-faint); text-transform: uppercase; letter-spacing: 0.06em; }
.client-field .value { font-size: var(--text-sm); color: var(--color-text); font-weight: 500; }

.proposal-table { width: 100%; border-collapse: collapse; margin-top: var(--space-3); }
.proposal-table th {
  text-align: left;
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text-muted);
  padding: var(--space-2) var(--space-3);
  background: var(--color-surface-offset);
  border-bottom: 2px solid var(--color-border);
}
.proposal-table th:last-child { text-align: right; }
.proposal-table td {
  padding: var(--space-3) var(--space-3);
  font-size: var(--text-sm);
  border-bottom: 1px solid var(--color-divider);
  vertical-align: top;
}
.proposal-table td:last-child { text-align: right; font-weight: 600; white-space: nowrap; }
.proposal-table tr:last-child td { border-bottom: none; }
.prop-category { font-size: var(--text-xs); color: var(--color-text-muted); margin-top: 2px; }

.proposal-totals {
  margin-top: var(--space-4);
  border-top: 2px solid var(--color-border);
  padding-top: var(--space-4);
}
.prop-total-row {
  display: flex;
  justify-content: space-between;
  padding: var(--space-2) 0;
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  border-bottom: 1px solid var(--color-divider);
}
.prop-total-row:last-child { border-bottom: none; }
.prop-grand {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  color: var(--color-text);
  font-weight: 700;
  border-top: 2px solid var(--color-primary) !important;
  border-bottom: none !important;
  padding-top: var(--space-3) !important;
  margin-top: var(--space-2);
}
.prop-deposit {
  color: var(--color-primary) !important;
  font-weight: 700 !important;
}

.proposal-terms {
  margin-top: var(--space-6);
  padding: var(--space-5);
  background: var(--color-surface-offset);
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
}
.proposal-terms p { font-size: var(--text-sm); color: var(--color-text-muted); margin-bottom: var(--space-2); line-height: 1.7; }
.proposal-terms p:last-child { margin-bottom: 0; }
.terms-title {
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-text-faint);
  margin-bottom: var(--space-3);
}

.proposal-notes {
  margin-top: var(--space-4);
  padding: var(--space-4);
  background: var(--color-primary-highlight);
  border-left: 3px solid var(--color-primary);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
}
.proposal-notes p { font-size: var(--text-sm); color: var(--color-text); line-height: 1.7; }

.signature-block {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-8);
  margin-top: var(--space-8);
  padding-top: var(--space-6);
  border-top: 1px solid var(--color-border);
}
.sig-field { display: flex; flex-direction: column; gap: var(--space-2); }
.sig-line { height: 1px; background: var(--color-border); margin-top: var(--space-10); }
.sig-label { font-size: var(--text-xs); color: var(--color-text-faint); text-transform: uppercase; letter-spacing: 0.06em; }

/* ===== PRINT STYLES ===== */
@page {
  size: letter;
  margin: 1.2cm 1.5cm;
}

@media print {
  /* ── Hide everything except the contract/invoice content ── */
  .nav,
  .main-layout,
  .modal-header,
  .modal-also-generate,
  #contract-send-footer,
  #modal-also-generate,
  .contract-sig,
  #contract-esign-block { display: none !important; }

  /* ── Hide SVG logo icon in header ── */
  .logo svg,
  .contract-header svg,
  .contract-header img { display: none !important; }

  /* ── Reset page & body ── */
  * {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  html, body {
    background: #ffffff !important;
    color: #111111 !important;
    font-family: Georgia, serif !important;
    font-size: 11pt !important;
    margin: 0;
    padding: 0;
  }

  /* ── Modal becomes the full page — remove all height/overflow constraints ── */
  .modal-overlay {
    position: static !important;
    background: none !important;
    backdrop-filter: none !important;
    padding: 0 !important;
    display: block !important;
    height: auto !important;
    max-height: none !important;
    overflow: visible !important;
  }
  .modal {
    border: none !important;
    box-shadow: none !important;
    max-width: none !important;
    width: 100% !important;
    border-radius: 0 !important;
    background: #ffffff !important;
    height: auto !important;
    max-height: none !important;
    overflow: visible !important;
    position: static !important;
  }
  .modal-body {
    padding: 0 !important;
    height: auto !important;
    max-height: none !important;
    overflow: visible !important;
    overflow-y: visible !important;
  }

  /* ── Proposal / contract wrapper ── */
  .proposal {
    background: #ffffff !important;
    color: #111111 !important;
    padding: 0 !important;
  }

  /* ── Force ALL text to black ── */
  .proposal *,
  .proposal p,
  .proposal span,
  .proposal div,
  .proposal li {
    color: #111111 !important;
    background: transparent !important;
    border-color: #cccccc !important;
  }

  /* ── Contract header ── */
  .contract-header {
    background: transparent !important;
    text-align: center;
    padding-bottom: 16pt;
    border-bottom: 1pt solid #cccccc !important;
    margin-bottom: 14pt;
  }
  .contract-header * { color: #111111 !important; background: transparent !important; }
  .contract-type-badge {
    background: #111111 !important;
    color: #ffffff !important;
    border: none !important;
    display: inline-block;
    padding: 3pt 10pt;
    border-radius: 20pt;
    font-size: 8pt;
    font-weight: bold;
    letter-spacing: 0.05em;
  }
  .contract-title { color: #111111 !important; font-size: 18pt !important; }
  .contract-subtitle { color: #444444 !important; font-size: 9pt !important; }

  /* ── Parties block ── */
  .contract-parties {
    background: #f5f5f5 !important;
    border: 1pt solid #cccccc !important;
    border-radius: 4pt;
    padding: 10pt 14pt;
    margin-bottom: 14pt;
  }
  .contract-parties * { color: #111111 !important; }
  .party-label { color: #666666 !important; font-size: 7.5pt !important; font-weight: bold; text-transform: uppercase; }
  .party-info { color: #111111 !important; font-size: 10pt !important; }

  /* ── Section labels & titles ── */
  .clause-number {
    color: #666666 !important;
    font-size: 7.5pt !important;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.06em;
  }
  .clause-title {
    color: #111111 !important;
    font-size: 12pt !important;
    font-weight: bold;
    margin: 2pt 0 5pt;
  }
  .clause-body,
  .clause-body * {
    color: #111111 !important;
    font-size: 10pt !important;
    line-height: 1.55 !important;
    background: transparent !important;
  }
  .contract-clause {
    border-bottom: 0.5pt solid #cccccc !important;
    padding-bottom: 10pt;
    margin-bottom: 10pt;
    page-break-inside: avoid;
  }

  /* ── Section header (AGREEMENT TERMS label) ── */
  .proposal-section-title {
    color: #666666 !important;
    font-size: 8pt !important;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    border-bottom: 0.5pt solid #cccccc !important;
    padding-bottom: 4pt;
    margin-bottom: 10pt;
  }

  /* ── Invoice specifics ── */
  .invoice-header * { color: #111111 !important; background: transparent !important; }
  .invoice-badge {
    background: #111111 !important;
    color: #ffffff !important;
    padding: 2pt 8pt;
    border-radius: 3pt;
    font-size: 8pt;
    font-weight: bold;
  }
  .invoice-due-box {
    background: #f5f5f5 !important;
    border: 1pt solid #cccccc !important;
    color: #111111 !important;
  }
  .invoice-due-box * { color: #111111 !important; }
  .invoice-status { color: #666666 !important; }
  .proposal-table th { background: #eeeeee !important; color: #111111 !important; }
  .proposal-table td { color: #111111 !important; }
  .payment-box { background: #f9f9f9 !important; border: 1pt solid #cccccc !important; }
  .payment-box * { color: #111111 !important; }
  .pay-method { border-color: #cccccc !important; color: #111111 !important; }

  /* ── Signature block ── */
  .contract-sig * { color: #111111 !important; background: transparent !important; }
  .sig-line { border-bottom: 1pt solid #111111 !important; }

  /* ── Page breaks ── */
  .contract-header { page-break-after: avoid; }
  .contract-parties { page-break-after: avoid; }
  h2, h3 { page-break-after: avoid; }
}

/* ===== RESPONSIVE ===== */
@media (max-width: 900px) {
  .main-layout {
    grid-template-columns: 1fr;
    padding: var(--space-4);
  }
  .summary-sticky { position: static; }
  .form-grid { grid-template-columns: 1fr; }
  .client-block { grid-template-columns: 1fr; }
  .signature-block { grid-template-columns: 1fr; gap: var(--space-6); }
}
@media (max-width: 600px) {
  .tab-bar { flex-wrap: wrap; }
  .tab { flex: none; }
  .service-row { flex-direction: column; align-items: flex-start; gap: var(--space-2); }
  .service-controls select { max-width: 100%; }
  .proposal-header { flex-direction: column; gap: var(--space-4); }
  .proposal-meta { text-align: left; }
}

/* ===== DOC MODE BUTTONS (NAV) ===== */
.doc-btn-group {
  display: flex;
  align-items: center;
  background: var(--color-surface-offset);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-1);
  gap: var(--space-1);
}
.btn-doc {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-md);
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--color-text-muted);
  white-space: nowrap;
  border: none;
  background: none;
}
.btn-doc:hover { color: var(--color-text); background: var(--color-surface-dynamic); }
.btn-doc.active {
  background: var(--color-primary);
  color: var(--color-text-inverse);
}

/* ===== CONTRACT TYPE PICKER ===== */
.contract-type-picker {
  margin-top: var(--space-4);
  padding: var(--space-4);
  background: var(--color-surface-offset);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
}
.picker-label {
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-text-faint);
  margin-bottom: var(--space-3);
}
.contract-type-grid {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}
.ctype-btn {
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-full);
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-text-muted);
  font-size: var(--text-xs);
  font-weight: 600;
  cursor: pointer;
}
.ctype-btn:hover { background: var(--color-surface-dynamic); color: var(--color-text); }
.ctype-btn.active {
  background: var(--color-primary-highlight);
  border-color: var(--color-primary);
  color: var(--color-primary);
}

/* ===== INVOICE STYLES ===== */
.invoice-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: var(--space-8);
  padding-bottom: var(--space-6);
  border-bottom: 2px solid var(--color-primary);
}
.invoice-badge {
  display: inline-block;
  padding: var(--space-1) var(--space-3);
  background: var(--color-primary);
  color: var(--color-text-inverse);
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: var(--space-3);
}
.invoice-num {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  color: var(--color-text);
}
.invoice-status {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  background: var(--color-success-highlight);
  color: var(--color-success);
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.invoice-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-6);
  margin-bottom: var(--space-6);
}
.invoice-block-title {
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-text-faint);
  margin-bottom: var(--space-3);
}
.invoice-detail { font-size: var(--text-sm); color: var(--color-text); line-height: 1.8; }
.invoice-detail strong { font-weight: 600; }
.invoice-due-box {
  padding: var(--space-4);
  background: var(--color-primary-highlight);
  border: 1px solid var(--color-primary);
  border-radius: var(--radius-lg);
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-6);
}
.invoice-due-label { font-size: var(--text-sm); color: var(--color-primary); font-weight: 600; }
.invoice-due-amount { font-family: var(--font-display); font-size: var(--text-xl); color: var(--color-primary); }
.payment-box {
  margin-top: var(--space-6);
  padding: var(--space-5);
  background: var(--color-surface-offset);
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
}
.payment-box .terms-title {
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-text-faint);
  margin-bottom: var(--space-3);
}
.payment-methods { display: flex; flex-wrap: wrap; gap: var(--space-3); margin-top: var(--space-3); }
.pay-method {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  font-weight: 500;
  text-decoration: none;
}
.pay-method-link {
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}
.pay-method-link:hover {
  border-color: #6D1ED4;
  color: #6D1ED4;
  background: rgba(109,30,212,0.06);
}

/* ===== CONTRACT STYLES ===== */
.contract-header {
  text-align: center;
  padding-bottom: var(--space-6);
  margin-bottom: var(--space-6);
  border-bottom: 2px solid var(--color-primary);
}
.contract-type-badge {
  display: inline-block;
  padding: var(--space-1) var(--space-4);
  background: var(--color-primary-highlight);
  color: var(--color-primary);
  border: 1px solid var(--color-primary);
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: var(--space-3);
}
.contract-title {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  color: var(--color-text);
  margin-bottom: var(--space-2);
}
.contract-subtitle {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}
.contract-parties {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-6);
  margin-bottom: var(--space-6);
  padding: var(--space-5);
  background: var(--color-surface-offset);
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
}
.party-label {
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-text-faint);
  margin-bottom: var(--space-2);
}
.party-info { font-size: var(--text-sm); color: var(--color-text); line-height: 1.8; }

.contract-clause {
  margin-bottom: var(--space-6);
}
.contract-clause:last-child { margin-bottom: 0; }
.clause-number {
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--color-primary);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: var(--space-2);
}
.clause-title {
  font-size: var(--text-base);
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: var(--space-3);
}
.clause-body {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  line-height: 1.8;
}
.clause-body p { margin-bottom: var(--space-2); }
.clause-body p:last-child { margin-bottom: 0; }
.clause-body ul {
  list-style: disc;
  padding-left: var(--space-6);
  margin-top: var(--space-2);
}
.clause-body ul li { margin-bottom: var(--space-1); }

.contract-sig {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-8);
  margin-top: var(--space-8);
  padding-top: var(--space-6);
  border-top: 2px solid var(--color-border);
}
.contract-sig-field { display: flex; flex-direction: column; gap: var(--space-2); }
.contract-sig-line { height: 1px; background: var(--color-border); margin-top: var(--space-10); }
.contract-sig-label { font-size: var(--text-xs); color: var(--color-text-faint); text-transform: uppercase; letter-spacing: 0.06em; }
.contract-sig-name { font-size: var(--text-sm); color: var(--color-text); font-weight: 500; margin-top: var(--space-1); }
.contract-date-line {
  margin-top: var(--space-4);
  display: flex;
  gap: var(--space-6);
  font-size: var(--text-xs);
  color: var(--color-text-faint);
}
.contract-date-field {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  flex: 1;
}
.contract-date-underline {
  height: 1px;
  background: var(--color-border);
  margin-top: var(--space-6);
}

/* ===== RESPONSIVE (additions) ===== */
@media (max-width: 600px) {
  .doc-btn-group { flex-wrap: wrap; }
  .btn-doc { padding: var(--space-2) var(--space-3); }
  .invoice-grid { grid-template-columns: 1fr; }
  .contract-parties { grid-template-columns: 1fr; }
  .contract-sig { grid-template-columns: 1fr; gap: var(--space-6); }
}

/* ===== PROPOSAL PKG DETAILS BLOCK ===== */
.pkg-details-block {
  margin-top: var(--space-4);
  padding: var(--space-4);
  background: var(--color-surface-offset);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
}
.pkg-details-block p {
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--color-text);
  margin: var(--space-3) 0 var(--space-2);
}
.pkg-details-block p:first-child { margin-top: 0; }
.pkg-details-block ul {
  margin: 0 0 var(--space-2);
  padding-left: var(--space-5);
}
.pkg-details-block li {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  line-height: 1.7;
}

/* ===== PACKAGE CARDS ===== */
.pkg-card {
  margin: var(--space-2) 0 var(--space-3);
  padding: var(--space-3) var(--space-4);
  background: var(--color-surface-offset);
  border: 1px solid var(--color-border);
  border-left: 3px solid var(--color-primary);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  animation: fadeSlideIn 0.2s ease;
}
.pkg-card-name {
  font-family: var(--font-display);
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--color-primary);
  margin-bottom: var(--space-2);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.pkg-card-items {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}
.pkg-card-items li {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  padding-left: var(--space-3);
  position: relative;
  line-height: 1.5;
}
.pkg-card-items li::before {
  content: '✓';
  position: absolute;
  left: 0;
  color: var(--color-primary);
  font-size: 0.75em;
  top: 2px;
}
@keyframes fadeSlideIn {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ===== ALBUM BUILDER ===== */
.album-builder {
  margin-top: var(--space-3);
  padding: var(--space-3) var(--space-4);
  background: var(--color-surface-offset);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  align-items: center;
}
.album-row {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  flex: 1;
  min-width: 140px;
}
.album-field-label {
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.album-price-display {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--color-primary);
  min-width: 80px;
  text-align: right;
  align-self: flex-end;
  padding-bottom: 2px;
}

/* ===== ALBUM NOTE ===== */
.album-note {
  font-size: var(--text-xs);
  color: var(--color-text-faint);
  margin-top: var(--space-3);
  padding: var(--space-2) var(--space-3);
  background: var(--color-surface-offset);
  border-left: 2px solid var(--color-primary);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  line-height: 1.6;
}

/* ===== STRIPE INTEGRATION ===== */
@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* Stripe button in modal header */
.btn-stripe {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  background: #635BFF;
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-size: var(--text-sm);
  font-weight: 500;
  cursor: pointer;
  transition: background 0.18s, opacity 0.18s;
  white-space: nowrap;
}
.btn-stripe:hover { background: #4f46e5; }
.btn-stripe:disabled { opacity: 0.65; cursor: default; }

/* Email-to-client button in modal header */
.btn-email-client {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  background: var(--color-primary);
  color: var(--color-text-inverse);
  border: none;
  border-radius: var(--radius-md);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.18s, opacity 0.18s;
  white-space: nowrap;
}
.btn-email-client:hover { background: var(--color-primary-hover); }
.btn-email-client:disabled { opacity: 0.65; cursor: default; }

/* Send-to-client button (appears inside invoice status panel) */
.btn-send-client {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  width: 100%;
  margin-top: 10px;
  padding: 11px 20px;
  background: var(--color-primary);
  color: var(--color-text-inverse);
  border: none;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.18s, opacity 0.18s;
}
.btn-send-client:hover { background: var(--color-primary-hover); }
.btn-send-client:disabled { opacity: 0.65; cursor: default; }

/* Stripe status panel (appears inside invoice modal body) */
.qb-status-panel {
  margin: var(--space-5) 0 0;
  border-radius: var(--radius-md);
  padding: var(--space-5);
  font-size: var(--text-sm);
}
.qb-success {
  background: color-mix(in srgb, #635BFF 8%, var(--color-surface));
  border: 1px solid color-mix(in srgb, #635BFF 30%, transparent);
}
.qb-error {
  background: color-mix(in srgb, #dc3545 8%, var(--color-surface));
  border: 1px solid color-mix(in srgb, #dc3545 30%, transparent);
}

.qb-status-header {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-4);
  color: var(--color-text);
}
.qb-success .qb-status-header { color: #4f46e5; }
[data-theme="dark"] .qb-success .qb-status-header { color: #a5b4fc; }
.qb-error .qb-status-header { color: #c0392b; }
[data-theme="dark"] .qb-error .qb-status-header { color: #e57373; }

.qb-status-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-2) var(--space-4);
  padding: var(--space-3) var(--space-4);
  background: var(--color-surface);
  border-radius: var(--radius-sm);
  margin-bottom: var(--space-4);
}
.qb-detail-row {
  display: contents;
}
.qb-detail-row span:first-child {
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-faint);
}
.qb-detail-row span:last-child {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-text);
}

/* Big purple "Pay Now" CTA */
.btn-stripe-pay {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  width: 100%;
  padding: var(--space-4) var(--space-4);
  background: #635BFF;
  color: #fff;
  border-radius: var(--radius-sm);
  font-size: var(--text-sm);
  font-weight: 700;
  text-decoration: none;
  margin-bottom: var(--space-3);
  letter-spacing: 0.02em;
  transition: background 0.18s;
}
.btn-stripe-pay:hover { background: #4f46e5; }

/* Stripe chip in payment methods */
.pay-method-stripe {
  color: #635BFF;
  font-weight: 500;
}

.qb-note {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  text-align: center;
  margin: 0;
  line-height: 1.6;
}

@media (max-width: 600px) {
  .qb-status-body { grid-template-columns: 1fr; }
  .qb-detail-row span:first-child { font-size: var(--text-xs); }
}

/* ── Polling indicator ─────────────────────────────────────────────────────── */
.stripe-poll-indicator {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: var(--space-4);
  font-size: var(--text-xs);
  color: var(--color-text-faint);
  justify-content: center;
}

/* ── Paid banner ───────────────────────────────────────────────────────────── */
.stripe-paid-panel {
  margin: var(--space-5) 0 0;
  border-radius: var(--radius-md);
  padding: var(--space-6);
  font-size: var(--text-sm);
  background: color-mix(in srgb, var(--color-success) 10%, var(--color-surface));
  border: 1.5px solid color-mix(in srgb, var(--color-success) 40%, transparent);
  text-align: center;
  animation: paidFadeIn 0.4s ease;
}
@keyframes paidFadeIn {
  from { opacity: 0; transform: scale(0.97); }
  to   { opacity: 1; transform: scale(1); }
}

.stripe-paid-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  font-size: 1rem;
  font-weight: 700;
  color: var(--color-success);
  margin-bottom: var(--space-2);
}
[data-theme="dark"] .stripe-paid-header { color: var(--color-success); }

.stripe-paid-check {
  color: var(--color-success);
  flex-shrink: 0;
}
[data-theme="dark"] .stripe-paid-check { color: var(--color-success); }

.stripe-paid-amount {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 700;
  color: var(--color-success);
  letter-spacing: -0.02em;
  margin-bottom: var(--space-4);
}
[data-theme="dark"] .stripe-paid-amount { color: var(--color-success); }

.stripe-paid-meta {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  background: var(--color-surface);
  border-radius: var(--radius-sm);
  padding: var(--space-3) var(--space-4);
  margin-bottom: var(--space-4);
  text-align: left;
}

.stripe-paid-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: var(--text-sm);
}
.stripe-paid-row span:first-child {
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-faint);
}
.stripe-paid-row span:last-child {
  font-weight: 600;
  color: var(--color-text);
}

.stripe-paid-pdf {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  text-decoration: none;
  margin-top: var(--space-2);
}
.stripe-paid-pdf:hover { color: var(--color-text); }

/* ── Optional docs row ──────────────────────────────── */
.optional-docs-row {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-top: var(--space-2);
  flex-wrap: wrap;
}
.optional-docs-label {
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text-faint);
  white-space: nowrap;
}
.btn-optional-doc {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.45rem 0.9rem;
  border-radius: 6px;
  border: 1px solid var(--color-border);
  background: transparent;
  color: var(--color-text-muted);
  font-size: var(--text-sm);
  font-family: inherit;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}
.btn-optional-doc:hover {
  border-color: var(--color-gold);
  color: var(--color-gold);
  background: rgba(212,160,48,0.06);
}

/* ===== FINANCE TAB ===== */
.finance-sub {
  background: transparent;
  border: 1px solid var(--color-border);
  color: var(--color-text-muted);
  padding: 6px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}
.finance-sub.active, .finance-sub:hover {
  background: var(--color-primary);
  color: var(--color-text-inverse);
  border-color: var(--color-primary);
}
.fin-kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin-bottom: 24px; }
.fin-kpi { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: 12px; padding: 18px 20px; transition: transform .12s ease, border-color .12s ease, background-color .12s ease; }
.fin-kpi-clickable { cursor: pointer; }
.fin-kpi-grid button:hover .fin-kpi-clickable, .fin-kpi-grid button:focus-visible .fin-kpi-clickable { border-color: var(--color-text-muted); background: var(--color-surface-offset); }
.fin-kpi-grid button:hover .fin-kpi-chev, .fin-kpi-grid button:focus-visible .fin-kpi-chev { color: var(--color-text); opacity: 1; }
.fin-kpi-grid button:active .fin-kpi-clickable { transform: scale(0.985); }
.fin-kpi-grid button:focus-visible .fin-kpi-clickable { outline: 2px solid var(--color-primary); outline-offset: 2px; }
.fin-kpi-label { font-size: 11px; text-transform: uppercase; letter-spacing: .07em; color: var(--color-text-faint); margin-bottom: 6px; }
.fin-kpi-value { font-size: 26px; font-weight: 800; letter-spacing: -.02em; color: var(--color-text); }
.fin-kpi-value.green { color: var(--color-success); }
.fin-kpi-value.red { color: var(--color-error); }
.fin-kpi-value.yellow { color: #b48a3a; }
.fin-section { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: 12px; padding: 20px 24px; margin-bottom: 16px; }
.fin-section-title { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--color-text-faint); margin-bottom: 14px; }
.fin-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.fin-table th { text-align: left; font-size: 10px; text-transform: uppercase; letter-spacing: .07em; color: var(--color-text-faint); padding: 0 8px 10px; }
.fin-table td { padding: 10px 8px; border-top: 1px solid var(--color-border); color: var(--color-text); }
.fin-table tr:hover td { background: var(--color-surface-offset); }
.fin-bar-row { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; font-size: 13px; }
.fin-bar-track { flex: 1; height: 6px; background: var(--color-border); border-radius: 3px; overflow: hidden; }
.fin-bar-fill { height: 100%; background: var(--color-primary); border-radius: 3px; transition: width .4s ease; }
.fin-bar-fill.green { background: var(--color-success); }
.fin-bar-fill.red { background: var(--color-error); }
.expense-form { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.expense-form input, .expense-form select { flex: 1; min-width: 120px; background: var(--color-surface-offset); border: 1px solid var(--color-border); color: var(--color-text); padding: 8px 12px; border-radius: 8px; font-size: 13px; }
.btn-add-expense { background: var(--color-primary); color: var(--color-text-inverse); border: none; padding: 8px 18px; border-radius: 8px; font-size: 13px; font-weight: 700; cursor: pointer; white-space: nowrap; }
.btn-del { background: none; border: none; color: var(--color-text-faint); cursor: pointer; font-size: 16px; padding: 4px 8px; border-radius: 6px; }
.btn-del:hover { color: var(--color-error); background: color-mix(in oklab, var(--color-error) 14%, transparent); }
.quarterly-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.quarterly-box { background: var(--color-surface-offset); border: 1px solid var(--color-border); border-radius: 10px; padding: 14px 16px; text-align: center; }
.quarterly-box .q-label { font-size: 10px; text-transform: uppercase; letter-spacing: .07em; color: var(--color-text-faint); margin-bottom: 4px; }
.quarterly-box .q-date { font-size: 11px; color: var(--color-text-muted); margin-bottom: 8px; }
.quarterly-box .q-amount { font-size: 20px; font-weight: 800; color: #b48a3a; }

/* ── PWA / iPhone install ──────────────────────────────────────────────── */
/* Respect iPhone safe areas (notch, dynamic island, home indicator) when
   running in standalone (home-screen-installed) mode. */
@supports (padding: max(0px)) {
  body {
    padding-top: env(safe-area-inset-top);
    padding-bottom: env(safe-area-inset-bottom);
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
  }
}

/* iOS install hint banner (shown only in mobile Safari, dismissible) */
.ios-install-banner {
  position: sticky;
  top: 0;
  z-index: 9000;
  background: #1a1814;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  color: #f5f1e9;
  font-size: 13px;
  line-height: 1.4;
}
.ios-install-inner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  padding-top: max(10px, env(safe-area-inset-top));
  max-width: 720px;
  margin: 0 auto;
}
.ios-install-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: rgba(255,255,255,0.06);
  color: #f5f1e9;
  flex-shrink: 0;
}
.ios-install-text { flex: 1; }
.ios-install-text strong { font-weight: 600; }
.ios-share-glyph {
  display: inline-block;
  vertical-align: middle;
  margin: 0 2px;
}
.ios-install-close {
  background: transparent;
  border: none;
  color: rgba(255,255,255,0.55);
  font-size: 22px;
  line-height: 1;
  width: 32px;
  height: 32px;
  cursor: pointer;
  border-radius: 8px;
  flex-shrink: 0;
}
.ios-install-close:hover { color: #fff; background: rgba(255,255,255,0.06); }

/* ============================================================ */
/* Lock screen — full-viewport overlay; covers the app until    */
/* the passcode is verified. Soft pastel studio direction:      */
/* warm cream background, gentle inner shadow on the card,      */
/* readable serif title, mono-style passcode input.             */
/* ============================================================ */
.lock-screen {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: var(--color-bg);
  /* Mobile-safe area padding */
  padding-top: max(20px, env(safe-area-inset-top));
  padding-bottom: max(20px, env(safe-area-inset-bottom));
  /* Block all pointer/keyboard events on whatever is behind it */
  overscroll-behavior: contain;
  touch-action: manipulation;
  font-family: inherit;
}
.lock-screen[hidden] { display: none !important; }
.lock-screen__card {
  width: 100%;
  max-width: 420px;
  background: var(--color-surface);
  border-radius: var(--radius-xl);
  padding: 36px 28px 24px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.04), 0 24px 48px -12px rgba(0,0,0,0.12);
  border: 1px solid var(--color-border);
}
[data-theme="dark"] .lock-screen__card {
  box-shadow: 0 1px 2px rgba(0,0,0,0.4), 0 24px 48px -12px rgba(0,0,0,0.6);
}
.lock-screen__brand {
  text-align: center;
  margin-bottom: 24px;
}
.lock-screen__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--color-primary-highlight);
  color: var(--color-primary);
  margin-bottom: 14px;
}
.lock-screen__title {
  font-size: 22px;
  font-weight: 700;
  color: var(--color-text);
  letter-spacing: -0.01em;
  margin-bottom: 4px;
}
.lock-screen__subtitle {
  font-size: 14px;
  color: var(--color-text-muted);
  line-height: 1.4;
}
.lock-screen__form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.lock-screen__form[hidden] { display: none !important; }
.lock-screen__intro {
  font-size: 13px;
  color: var(--color-text-muted);
  line-height: 1.5;
  margin: 0 0 4px;
}
.lock-screen__label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text-faint);
  margin-bottom: -8px;
}
.lock-screen__input {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  font-size: 18px;
  /* iOS won't auto-zoom on focus when font-size >= 16 */
  font-family: 'SF Mono', Menlo, Consolas, monospace;
  letter-spacing: 0.18em;
  padding: 14px 16px;
  background: var(--color-surface-offset);
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-md);
  color: var(--color-text);
  text-align: center;
  outline: none;
  transition: border-color 120ms ease, background 120ms ease;
}
.lock-screen__input:focus {
  border-color: var(--color-primary);
  background: var(--color-surface);
}
.lock-screen__primary {
  width: 100%;
  padding: 14px 18px;
  background: var(--color-primary);
  color: #fff;
  border: none;
  border-radius: var(--radius-md);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: background 120ms ease, transform 80ms ease;
}
.lock-screen__primary:hover { background: var(--color-primary-hover); }
.lock-screen__primary:active { background: var(--color-primary-active); transform: translateY(1px); }
.lock-screen__primary:disabled { opacity: 0.55; cursor: not-allowed; }
.lock-screen__secondary {
  width: 100%;
  padding: 12px 16px;
  background: transparent;
  color: var(--color-primary);
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 120ms ease;
}
.lock-screen__secondary:hover { background: var(--color-primary-highlight); }
.lock-screen__link {
  background: transparent;
  border: none;
  color: var(--color-primary);
  font-size: 13px;
  cursor: pointer;
  text-decoration: underline;
  padding: 4px;
  margin-top: -2px;
}
.lock-screen__link:hover { color: var(--color-primary-hover); }
.lock-screen__error {
  font-size: 13px;
  color: #b04545;
  background: #fdf0f0;
  border: 1px solid #f0d0d0;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
}
[data-theme="dark"] .lock-screen__error {
  color: #ff8a8a;
  background: rgba(176, 69, 69, 0.12);
  border-color: rgba(255, 138, 138, 0.25);
}
.lock-screen__error[hidden] { display: none !important; }
.lock-screen__footer {
  margin-top: 20px;
  font-size: 11px;
  color: var(--color-text-faint);
  text-align: center;
  letter-spacing: 0.04em;
}
