/* EDIT.OR.FX Studio OS - WedBridge Exact Rebuild
 * Color Tokens, Typography, and Responsive Shell
 */

:root {
  --canvas: #F9F8F6;
  --surface: #FFFFFF;
  --line: #EFEFED;
  --line-dark: #D1D5DB;
  --ink: #111827;
  --muted: #6B7280;
  --muted-soft: #9CA3AF;
  --accent: #15803d;
  --accent-soft: #dcfce7;
  --danger: #dc2626;
  --danger-soft: #fee2e2;

  --radius-xs: 6px;
  --radius-sm: 8px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;
  --radius-full: 9999px;

  --input-height: 42px;
  --btn-height: 40px;
  --topbar-height: 64px;
  --sidebar-width: 256px;

  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Inter", Helvetica, Arial, sans-serif;
  --font-serif: "Newsreader", "Playfair Display", Georgia, serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

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

body {
  background-color: var(--canvas);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* App Shell Layout */
.app-shell {
  display: flex;
  min-height: 100vh;
  position: relative;
  width: 100%;
  overflow-x: hidden;
}

/* Sidebar */
.wb-sidebar {
  width: var(--sidebar-width);
  background: var(--surface);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  min-height: 100vh;
  position: sticky;
  top: 0;
  z-index: 200;
  transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Mobile Sidebar Backdrop */
.wb-sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(17, 24, 39, 0.45);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  z-index: 190;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.wb-sidebar-backdrop.active {
  display: block;
  opacity: 1;
}

/* Close button inside sidebar on mobile */
.wb-sidebar-close {
  display: none;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  align-items: center;
  justify-content: center;
  margin-left: auto;
  transition: all 0.15s ease;
}

.wb-sidebar-close:hover {
  background: #f3f4f6;
  border-color: var(--line-dark);
}

/* Hamburger Menu Button */
.wb-menu-btn {
  display: none;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  align-items: center;
  justify-content: center;
  cursor: pointer;
  margin-right: 12px;
  flex-shrink: 0;
  transition: all 0.15s ease;
}

.wb-menu-btn:hover {
  background: #f3f4f6;
  border-color: var(--line-dark);
}

/* Mobile Bottom Navigation (Screens <= 768px) */
.wb-bottom-nav {
  display: none;
}

.wb-sidebar-brand {
  padding: 20px 24px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
  color: var(--ink);
}

.wb-brand-badge {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 800;
  font-size: 15px;
}

.wb-brand-name {
  font-weight: 700;
  font-size: 16px;
  letter-spacing: -0.01em;
}

.wb-nav {
  padding: 16px 12px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.wb-nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
  text-decoration: none;
  transition: all 0.15s ease;
}

.wb-nav-item:hover {
  background: var(--canvas);
  color: var(--ink);
}

.wb-nav-item.active {
  background: var(--ink);
  color: #ffffff;
}

.wb-badge-new {
  margin-left: auto;
  font-size: 10px;
  font-weight: 800;
  background: var(--accent-soft);
  color: var(--accent);
  padding: 2px 6px;
  border-radius: 999px;
  text-transform: uppercase;
}

.wb-sidebar-footer {
  padding: 16px;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 12px;
}

.wb-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #e5e7eb;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  color: var(--ink);
}

/* Main Area */
.wb-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.wb-topbar {
  height: 64px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  padding: 0 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.wb-container {
  max-width: 1440px;
  margin: 0 auto;
  width: 100%;
  padding: 32px;
}

/* Typography & Headings */
.kicker {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  margin-bottom: 4px;
}

.headline-title {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--ink);
  margin: 0;
}

.headline-desc {
  font-size: 14px;
  color: var(--muted);
  margin-top: 4px;
}

/* Buttons */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 38px;
  padding: 0 16px;
  background: var(--ink);
  color: #ffffff;
  border: 1px solid var(--ink);
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-primary:hover {
  background: #27272a;
  border-color: #27272a;
}

.btn-outline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 38px;
  padding: 0 16px;
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-outline:hover {
  border-color: var(--muted-soft);
  background: #fafafa;
}

/* Cards */
.wb-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.02);
}

/* Responsive Grid Utilities */
.grid-2col {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

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

.grid-4col {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr;
  gap: 12px;
  align-items: center;
}

.grid-milestones {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  text-align: center;
}

@media (max-width: 768px) {
  .grid-2col {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .grid-3col {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .grid-4col {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }
  .grid-milestones {
    grid-template-columns: 1fr;
    gap: 8px;
  }
}

@media (max-width: 480px) {
  .grid-4col {
    grid-template-columns: 1fr;
    gap: 8px;
  }
}

/* Forms */
.form-group {
  margin-bottom: 16px;
}

.form-label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--muted);
  letter-spacing: 0.04em;
  margin-bottom: 6px;
}

.form-control {
  width: 100%;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0 14px;
  font-size: 14px;
  color: var(--ink);
  background: var(--surface);
  outline: none;
  transition: border-color 0.15s ease;
}

.form-control:focus {
  border-color: var(--ink);
}

/* Switches & Toggles */
.switch-toggle {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
}

.switch-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}

.switch-slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: #e5e7eb;
  transition: .2s;
  border-radius: 24px;
}

.switch-slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .2s;
  border-radius: 50%;
}

input:checked + .switch-slider {
  background-color: var(--ink);
}

input:checked + .switch-slider:before {
  transform: translateX(20px);
}

/* Stepper Stepper Buttons */
.counter-widget {
  display: flex;
  align-items: center;
  gap: 8px;
}

.counter-btn {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--surface);
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.counter-btn:hover {
  background: #f3f4f6;
}

.counter-value {
  width: 36px;
  text-align: center;
  font-weight: 700;
  font-size: 14px;
}

/* Tables */
.wb-table-wrap {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: var(--surface);
  margin-bottom: 20px;
}

.wb-table {
  width: 100%;
  border-collapse: collapse;
}

.wb-table th {
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--muted);
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  background: #fafafa;
}

.wb-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
}

.wb-table tr:hover td {
  background: #fcfcfc;
}

/* ==========================================================================
   THEMED FUNCTION-BASED PDF & PROPOSAL STYLES
   4 Luxury Studio Themes: Minimalist, Obsidian, Royal Heritage, Botanical
   ========================================================================== */

/* Theme Selector Control Bar */
.theme-selector-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #ffffff;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  box-shadow: 0 2px 8px rgba(0,0,0,0.03);
}

.theme-pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid transparent;
  background: transparent;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--muted);
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}

.theme-pill-btn:hover {
  color: var(--ink);
  background: #f3f4f6;
}

.theme-pill-btn.active {
  background: var(--ink);
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

/* Base PDF Sheet */
.themed-pdf-sheet {
  background: #ffffff;
  border-radius: 16px;
  padding: 36px;
  color: #111827;
  font-family: var(--font-sans);
  position: relative;
  transition: all 0.25s ease;
}

/* --- THEME 1: Minimalist Modern (Clean Alabaster & Emerald) --- */
.themed-pdf-sheet.theme-minimalist {
  background: #ffffff;
  color: #111827;
  border: 1px solid #e5e7eb;
}
.theme-minimalist .pdf-header {
  border-bottom: 2px solid #111827;
  padding-bottom: 20px;
}
.theme-minimalist .pdf-title {
  font-family: var(--font-serif);
  color: #111827;
}
.theme-minimalist .pdf-accent {
  color: #15803d;
}
.theme-minimalist .pdf-fn-card {
  background: #fafafa;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
}
.theme-minimalist .pdf-crew-badge {
  background: #f0fdf4;
  color: #15803d;
  border: 1px solid #bbf7d0;
}
.theme-minimalist .pdf-invest-box {
  background: #fafafa;
  border: 1px solid #e5e7eb;
}

/* --- THEME 2: Obsidian & Gold (EDIT.OR.FX Signature Luxury) --- */
.themed-pdf-sheet.theme-obsidian {
  background: #0f172a;
  color: #f8fafc;
  border: 1px solid #334155;
  box-shadow: 0 20px 40px rgba(0,0,0,0.3);
}
.theme-obsidian .pdf-header {
  border-bottom: 2px solid #d97706;
  padding-bottom: 20px;
}
.theme-obsidian .pdf-title {
  font-family: var(--font-serif);
  color: #fbbf24;
}
.theme-obsidian .pdf-subtitle {
  color: #94a3b8;
}
.theme-obsidian .pdf-accent {
  color: #f59e0b;
}
.theme-obsidian .pdf-fn-card {
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 12px;
}
.theme-obsidian .pdf-fn-card h4 {
  color: #ffffff;
}
.theme-obsidian .pdf-fn-card .pdf-fn-meta {
  color: #94a3b8;
}
.theme-obsidian .pdf-crew-badge {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.4);
}
.theme-obsidian .pdf-invest-box {
  background: #1e293b;
  border: 1px solid #d97706;
}
.theme-obsidian .pdf-invest-box .invest-label {
  color: #d97706;
}
.theme-obsidian .pdf-invest-box .invest-val {
  color: #ffffff;
}
.theme-obsidian .pdf-milestone-card {
  background: #1e293b;
  border: 1px solid #334155;
}
.theme-obsidian .pdf-milestone-card strong {
  color: #fbbf24;
}
.theme-obsidian .pdf-deliverables-list li {
  color: #e2e8f0;
}

/* --- THEME 3: Royal Heritage (Traditional Temple Mandapam & Gold) --- */
.themed-pdf-sheet.theme-royal {
  background: #fffdfa;
  color: #3b0764;
  border: 2px solid #b45309;
}
.theme-royal .pdf-header {
  border-bottom: 2px solid #881337;
  padding-bottom: 20px;
  background: linear-gradient(180deg, #fffbeb 0%, #fffdfa 100%);
  margin: -36px -36px 24px -36px;
  padding: 32px 36px 20px;
  border-top-left-radius: 14px;
  border-top-right-radius: 14px;
}
.theme-royal .pdf-title {
  font-family: var(--font-serif);
  color: #881337;
}
.theme-royal .pdf-subtitle {
  color: #78350f;
}
.theme-royal .pdf-accent {
  color: #b45309;
}
.theme-royal .pdf-fn-card {
  background: #ffffff;
  border: 1px solid #fed7aa;
  border-left: 4px solid #881337;
  border-radius: 10px;
}
.theme-royal .pdf-fn-card h4 {
  color: #881337;
}
.theme-royal .pdf-fn-card .pdf-fn-meta {
  color: #78350f;
}
.theme-royal .pdf-crew-badge {
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fde68a;
}
.theme-royal .pdf-invest-box {
  background: #fffbeb;
  border: 2px solid #881337;
}
.theme-royal .pdf-invest-box .invest-label {
  color: #881337;
}
.theme-royal .pdf-invest-box .invest-val {
  color: #881337;
}
.theme-royal .pdf-milestone-card {
  background: #ffffff;
  border: 1px solid #fde68a;
}
.theme-royal .pdf-milestone-card strong {
  color: #881337;
}
.theme-royal .pdf-deliverables-list li {
  color: #451a03;
}

/* --- THEME 4: Botanical Romance (Rose Blush & Sage) --- */
.themed-pdf-sheet.theme-botanical {
  background: #fffafb;
  color: #1e293b;
  border: 1px solid #fbcfe8;
}
.theme-botanical .pdf-header {
  border-bottom: 2px solid #db2777;
  padding-bottom: 20px;
}
.theme-botanical .pdf-title {
  font-family: var(--font-serif);
  color: #be185d;
}
.theme-botanical .pdf-subtitle {
  color: #64748b;
}
.theme-botanical .pdf-accent {
  color: #15803d;
}
.theme-botanical .pdf-fn-card {
  background: #ffffff;
  border: 1px solid #fce7f3;
  border-radius: 14px;
}
.theme-botanical .pdf-fn-card h4 {
  color: #9d174d;
}
.theme-botanical .pdf-fn-card .pdf-fn-meta {
  color: #64748b;
}
.theme-botanical .pdf-crew-badge {
  background: #ecfdf5;
  color: #047857;
  border: 1px solid #a7f3d0;
}
.theme-botanical .pdf-invest-box {
  background: #fff1f2;
  border: 1px solid #f43f5e;
}
.theme-botanical .pdf-invest-box .invest-label {
  color: #be185d;
}
.theme-botanical .pdf-invest-box .invest-val {
  color: #881337;
}
.theme-botanical .pdf-milestone-card {
  background: #ffffff;
  border: 1px solid #fce7f3;
}
.theme-botanical .pdf-milestone-card strong {
  color: #be185d;
}

/* Function Breakdown Cards Grid */
.pdf-functions-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-top: 12px;
}

.pdf-fn-card {
  padding: 16px 20px;
  transition: all 0.2s ease;
}

.pdf-fn-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 6px;
}

.pdf-fn-title {
  font-size: 15px;
  font-weight: 800;
  margin: 0;
}

.pdf-fn-date-badge {
  font-size: 11px;
  font-weight: 700;
  opacity: 0.85;
}

.pdf-fn-meta {
  font-size: 12px;
  margin-bottom: 10px;
}

.pdf-crew-badges-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.pdf-crew-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

/* ==========================================================================
   WEDBRIDGE BILL TYPE QUOTATION & INVOICE TABLE STYLES (CLEAN / NO BOXES)
   ========================================================================== */

.pdf-bill-container {
  margin: 18px 0;
  width: 100%;
}

.pdf-bill-meta-clean {
  display: block;
  margin-bottom: 22px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  font-size: 12px;
}

.pdf-bill-meta-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 800;
  opacity: 0.6;
  margin-bottom: 3px;
}

.pdf-bill-client-name {
  font-size: 22px;
  font-weight: 800;
  margin-bottom: 3px;
  color: inherit;
  font-family: var(--font-serif);
}

.pdf-bill-meta-line {
  font-size: 13px;
  opacity: 0.85;
  margin-bottom: 2px;
}

.pdf-bill-meta-sub {
  font-size: 11px;
  font-weight: 600;
  opacity: 0.7;
}

.pdf-bill-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  line-height: 1.5;
  margin: 14px 0;
}

.pdf-bill-table th {
  padding: 10px 8px;
  text-align: left;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border-top: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  background: none;
}

.pdf-bill-table td {
  padding: 12px 8px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.07);
  vertical-align: top;
}

.pdf-bill-table tr:last-child td {
  border-bottom: 1.5px solid currentColor;
}

.pdf-bill-item-title {
  font-weight: 800;
  font-size: 13.5px;
  margin-bottom: 3px;
  color: inherit;
}

.pdf-bill-item-sub {
  font-size: 11px;
  opacity: 0.75;
  margin-bottom: 5px;
}

.pdf-bill-specs-text {
  font-size: 11px;
  line-height: 1.45;
  opacity: 0.85;
  margin-top: 4px;
  font-weight: 500;
}

.pdf-bill-amount-cell {
  font-weight: 800;
  font-size: 13.5px;
  text-align: right;
  white-space: nowrap;
}

/* Bill Summary (Clean Typographic Ledger - No Box) */
.pdf-bill-summary-wrap {
  display: flex;
  justify-content: flex-end;
  margin: 16px 0 24px;
}

.pdf-bill-summary-clean {
  width: 100%;
  max-width: 340px;
  background: none;
  border: none;
  padding: 0;
}

.pdf-bill-summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  padding: 5px 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.pdf-bill-summary-row.total-row {
  margin-top: 8px;
  padding-top: 10px;
  border-top: 1.5px solid currentColor;
  border-bottom: none;
  font-size: 16px;
  font-weight: 800;
}

/* Bill Milestone Table (No Boxes) */
.pdf-bill-ms-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11.5px;
  margin: 10px 0 20px;
}

.pdf-bill-ms-table th {
  background: none;
  padding: 8px 6px;
  text-align: left;
  font-size: 9.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1.5px solid currentColor;
}

.pdf-bill-ms-table td {
  padding: 9px 6px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

/* Bank & Remittance (Clean Typography - No Box) */
.pdf-bill-remittance-clean {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  padding: 16px 0;
  margin: 20px 0 24px;
  border-top: 1px solid rgba(0, 0, 0, 0.1);
  font-size: 11.5px;
  line-height: 1.6;
}

.remit-title {
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  opacity: 0.7;
  margin-bottom: 5px;
}

.remit-upi {
  font-size: 13.5px;
  font-weight: 800;
  font-family: var(--font-mono);
  margin: 2px 0;
}

.remit-sub {
  font-size: 10.5px;
  opacity: 0.7;
}

/* Signature & Seal Area */
.pdf-bill-sign-area {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-top: 32px;
  padding-top: 16px;
  border-top: 1px dashed rgba(0, 0, 0, 0.15);
}

/* Theme Adaptations for Clean Bill Table */
.theme-obsidian .pdf-bill-table th {
  border-color: #fbbf24;
  color: #fbbf24;
}
.theme-obsidian .pdf-bill-table td {
  border-color: #334155;
  color: #f1f5f9;
}
.theme-obsidian .pdf-bill-table tr:last-child td {
  border-color: #fbbf24;
}
.theme-obsidian .pdf-bill-meta-clean,
.theme-obsidian .pdf-bill-remittance-clean {
  border-color: #334155;
}
.theme-obsidian .pdf-bill-summary-row {
  border-color: #334155;
}
.theme-obsidian .pdf-bill-summary-row.total-row {
  border-color: #fbbf24;
  color: #fbbf24;
}
.theme-obsidian .pdf-bill-ms-table th {
  color: #fbbf24;
  border-color: #fbbf24;
}
.theme-obsidian .pdf-bill-ms-table td {
  border-color: #334155;
}

.theme-royal .pdf-bill-table th {
  border-color: #881337;
  color: #881337;
}
.theme-royal .pdf-bill-table td {
  border-color: #fecdd3;
  color: #4c0519;
}
.theme-royal .pdf-bill-table tr:last-child td {
  border-color: #881337;
}
.theme-royal .pdf-bill-meta-clean,
.theme-royal .pdf-bill-remittance-clean {
  border-color: #fecdd3;
}
.theme-royal .pdf-bill-summary-row {
  border-color: #fecdd3;
}
.theme-royal .pdf-bill-summary-row.total-row {
  border-color: #881337;
  color: #881337;
}
.theme-royal .pdf-bill-ms-table th {
  color: #881337;
  border-color: #881337;
}
.theme-royal .pdf-bill-ms-table td {
  border-color: #fecdd3;
}

.theme-botanical .pdf-bill-table th {
  border-color: #15803d;
  color: #15803d;
}
.theme-botanical .pdf-bill-table td {
  border-color: #bbf7d0;
  color: #14532d;
}
.theme-botanical .pdf-bill-table tr:last-child td {
  border-color: #15803d;
}
.theme-botanical .pdf-bill-meta-clean,
.theme-botanical .pdf-bill-remittance-clean {
  border-color: #bbf7d0;
}
.theme-botanical .pdf-bill-summary-row {
  border-color: #bbf7d0;
}
.theme-botanical .pdf-bill-summary-row.total-row {
  border-color: #15803d;
  color: #15803d;
}
.theme-botanical .pdf-bill-ms-table th {
  color: #15803d;
  border-color: #15803d;
}
.theme-botanical .pdf-bill-ms-table td {
  border-color: #bbf7d0;
}

/* Format switcher buttons */
.format-pill-btn {
  padding: 5px 11px;
  border-radius: var(--radius-full);
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.format-pill-btn:hover {
  background: #f3f4f6;
  color: var(--ink);
}
.format-pill-btn.active {
  background: var(--ink);
  color: #ffffff;
  border-color: var(--ink);
}

/* ==========================================================================
   RESPONSIVE DESIGN & MOBILE DEVICE ADAPTATIONS
   Breakpoints: 1200px (Laptops), 992px (Tablets), 768px (Phablets), 480px (Phones)
   ========================================================================== */

@media (max-width: 1200px) {
  .calc-layout-grid {
    grid-template-columns: 1fr !important;
    gap: 24px !important;
    padding: 24px !important;
  }
}

@media (max-width: 992px) {
  .wb-sidebar {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    bottom: 0 !important;
    height: 100vh !important;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2) !important;
    transform: translateX(-100%);
  }
  .wb-sidebar.open {
    transform: translateX(0) !important;
  }
  .wb-menu-btn {
    display: inline-flex !important;
  }
  .wb-topbar {
    padding: 0 16px !important;
    height: 56px !important;
  }
  .wb-container {
    padding: 20px 16px !important;
  }
  .settings-layout {
    grid-template-columns: 1fr !important;
    padding: 20px 16px !important;
    gap: 20px !important;
  }
  .settings-subnav {
    display: flex !important;
    flex-direction: row !important;
    overflow-x: auto !important;
    padding-bottom: 6px !important;
    scrollbar-width: none !important;
    gap: 8px !important;
  }
  .settings-subnav::-webkit-scrollbar {
    display: none;
  }
  .settings-sublink {
    white-space: nowrap !important;
    padding: 7px 14px !important;
    border-radius: var(--radius-full) !important;
    border: 1px solid var(--line) !important;
    background: var(--surface) !important;
    font-size: 12.5px !important;
    font-weight: 600 !important;
    color: var(--muted) !important;
    text-decoration: none !important;
  }
  .settings-sublink.active {
    background: var(--ink) !important;
    color: #ffffff !important;
    border-color: var(--ink) !important;
  }
}

@media (max-width: 768px) {
  /* Safe-area insets & Mobile Bottom Nav */
  .wb-bottom-nav {
    display: flex !important;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: calc(58px + env(safe-area-inset-bottom, 0px));
    padding-bottom: env(safe-area-inset-bottom, 0px);
    background: #ffffff;
    border-top: 1px solid var(--line);
    z-index: 180;
    align-items: center;
    justify-content: space-around;
    padding-left: 6px;
    padding-right: 6px;
    box-shadow: 0 -2px 12px rgba(0,0,0,0.06);
  }
  .wb-bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    text-decoration: none;
    color: var(--muted);
    font-size: 10px;
    font-weight: 700;
    flex: 1;
    height: 100%;
    transition: color 0.15s ease, transform 0.1s ease;
  }
  .wb-bottom-nav-item svg {
    display: block;
    transition: stroke 0.15s ease;
  }
  .wb-bottom-nav-item.active {
    color: var(--ink);
  }
  .wb-bottom-nav-item.active svg {
    stroke: var(--ink);
    stroke-width: 2.4;
  }
  .wb-main {
    padding-bottom: calc(76px + env(safe-area-inset-bottom, 0px)) !important;
  }

  /* Form & Control adjustments for touch devices (iOS 16px font prevents auto-zoom) */
  .form-control, input[type="text"], input[type="number"], input[type="date"], input[type="time"], select, textarea {
    font-size: 16px !important;
    min-height: 42px !important;
  }
  .counter-btn {
    width: 38px !important;
    height: 38px !important;
    font-size: 18px !important;
    border-radius: var(--radius-sm) !important;
  }

  .calc-layout-grid {
    padding: 14px 10px !important;
    gap: 16px !important;
  }
  .stepper-nav {
    gap: 6px !important;
    padding-bottom: 8px !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
  }
  .step-node {
    padding: 6px 12px !important;
    font-size: 12px !important;
    flex-shrink: 0 !important;
  }
  .choice-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 8px !important;
  }
  .choice-card {
    padding: 12px 10px !important;
    font-size: 13px !important;
    border-radius: var(--radius-md) !important;
  }
  .stepper-row {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 10px !important;
    padding: 12px 0 !important;
  }
  .stepper-row .counter-widget {
    width: 100% !important;
    justify-content: space-between !important;
  }

  /* Cards & Sheets */
  .wb-card {
    padding: 16px 14px !important;
    border-radius: var(--radius-lg) !important;
  }
  .themed-pdf-sheet {
    padding: 20px 14px !important;
    border-radius: var(--radius-lg) !important;
  }
  .proposal-sheet {
    padding: 20px 14px !important;
    border-radius: var(--radius-lg) !important;
  }
  .proposal-outer-wrap {
    margin: 12px auto 40px !important;
    padding: 0 8px !important;
  }

  /* Themed PDF mobile adjustments */
  .pdf-fn-card {
    padding: 14px 12px !important;
    border-radius: var(--radius-lg) !important;
  }
  .pdf-fn-title {
    font-size: 14.5px !important;
  }
  .pdf-crew-badges-row {
    gap: 4px !important;
  }
  .pdf-crew-badge {
    font-size: 10px !important;
    padding: 2px 6px !important;
  }
  .theme-selector-bar {
    max-width: 100% !important;
    overflow-x: auto !important;
    scrollbar-width: none !important;
    -webkit-overflow-scrolling: touch !important;
  }
  .theme-selector-bar::-webkit-scrollbar {
    display: none;
  }
  .theme-pill-btn {
    padding: 6px 12px !important;
    font-size: 11.5px !important;
    white-space: nowrap !important;
  }
  .pdf-invest-box {
    padding: 16px 14px !important;
    border-radius: var(--radius-lg) !important;
  }
  .pdf-invest-box .invest-val {
    font-size: 26px !important;
  }

  /* Landing Page & Other Subpages */
  .landing-header {
    padding: 0 16px !important;
    height: 60px !important;
  }
  .landing-nav {
    gap: 14px !important;
  }
  .simulator-container {
    grid-template-columns: 1fr !important;
    padding: 20px 16px !important;
    gap: 24px !important;
  }
  .pricing-tabs-bar {
    gap: 12px !important;
    margin-bottom: 16px !important;
    -webkit-overflow-scrolling: touch !important;
  }
  .ptab-btn {
    padding: 8px 0 !important;
    font-size: 12px !important;
  }
}
  .pdf-invest-box .invest-val {
    font-size: 26px !important;
  }
}

@media (max-width: 480px) {
  .choice-grid {
    grid-template-columns: 1fr !important;
  }
  .headline-title {
    font-size: 20px !important;
  }
  .hero-h1 {
    font-size: 28px !important;
  }
  .btn-primary, .btn-outline {
    height: 42px !important;
    font-size: 13.5px !important;
  }
}

/* Print Optimization */
@media print {
  body {
    background: #ffffff !important;
  }
  .no-print, .wb-sidebar, .wb-topbar, .stepper-nav, .theme-selector-bar {
    display: none !important;
  }
  .app-shell {
    display: block !important;
  }
  .wb-main {
    margin: 0 !important;
    padding: 0 !important;
  }
  .calc-layout-grid {
    display: block !important;
  }
  .themed-pdf-sheet {
    box-shadow: none !important;
    border: none !important;
    padding: 0 !important;
    margin: 0 !important;
    max-width: 100% !important;
    page-break-after: auto;
  }
  .pdf-fn-card {
    page-break-inside: avoid;
    break-inside: avoid;
  }
  .proposal-sheet {
    box-shadow: none !important;
    border: none !important;
    padding: 10px !important;
    margin: 0 !important;
    max-width: 100% !important;
  }
}
