/* ===== RESET & BASE ===== */
    *,
    *::before,
    *::after {
      box-sizing: border-box;
      margin: 0;
      padding: 0
    }

    /* Fonts now consolidated natively via shared CSS/HTML */

    /* NOTE: Base :root tokens come from shared.css v2.0
       These overrides are calculator-specific additions only */

    html {
      scroll-behavior: smooth
    }

    body {
      font-family: 'Inter', system-ui, -apple-system, sans-serif;
    }

    /* Font loaded via <link> preload */

    /* ===== LAYOUT ===== */
    .app {
      max-width: 1000px;
      margin: 0 auto;
      padding-bottom: calc(40px + var(--safe-b));
    }

    /* Header inherits from shared.css v2.0 glassmorphism */

    .header-inner {
      max-width: 1000px;
    }

    .brand-icon {
      font-size: 28px
    }

    .brand h1 {
      font-family: 'Playfair Display', serif;
    }

    .admin-toggle {
      background: var(--inp-bg);
      border: 1px solid var(--inp-bd);
      border-radius: 8px;
      padding: 6px 12px;
      color: var(--dim);
      font-size: 12px;
      cursor: pointer;
      font-weight: 600;
      transition: all .2s;
    }

    .admin-toggle:hover,
    .admin-toggle.on {
      border-color: var(--gold);
      color: var(--gold)
    }

    /* Tabs */
    .tabs {
      display: flex;
      gap: 3px;
      background: var(--bg2);
      border-bottom: none;
      overflow-x: auto;
      position: sticky;
      top: 80px;
      z-index: 90;
      padding: 4px;
      max-width: 1000px;
      margin: 0 auto;
      border-radius: 10px;
      transition: top 0.3s cubic-bezier(0.2, 0.8, 0.2, 1), padding 0.3s ease;
    }

    .tabs.compact {
      top: 0;
      padding: 8px 4px;
      border-radius: 0;
      border-bottom: 1px solid var(--border);
      box-shadow: 0 4px 20px rgba(0,0,0,0.5);
    }

    .tab {
      flex: 1;
      padding: 9px 12px;
      border: none;
      background: transparent;
      color: var(--dim);
      font-size: 11px;
      font-weight: 600;
      cursor: pointer;
      border-radius: 8px;
      white-space: nowrap;
      text-align: center;
      transition: all .2s ease;
      font-family: inherit;
      position: relative;
    }

    .tab.active {
      color: var(--text);
      background: transparent;
      border: none;
      font-weight: 700;
    }

    .tab.active::after {
      content: '';
      position: absolute;
      bottom: -4px;
      left: 50%;
      transform: translateX(-50%);
      width: 24px;
      height: 3px;
      background: linear-gradient(90deg, var(--green), var(--gold));
      border-radius: 3px 3px 0 0;
      box-shadow: 0 -2px 8px var(--green-glow);
    }

    .tab:hover:not(.active) {
      color: var(--text);
      background: rgba(255, 255, 255, 0.04);
    }

    .nav-tab {
      color: var(--gold);
      opacity: 0.7;
      border-bottom-color: transparent;
      display: none
    }

    .nav-tab:hover {
      opacity: 1;
      color: var(--gold);
      background: rgba(212, 168, 67, 0.06);
      border-bottom-color: var(--gold)
    }

    /* Cards */
    .section {
      padding: 20px
    }

    .section:not(.hidden) {
      animation: fadeIn 0.3s ease-in-out forwards;
    }

    /* Cards inherit glassmorphism from shared.css v2.0 */

    /* Calculator-specific card title with accent bar */
    .card-t {
      font-size: 12px;
      text-transform: uppercase;
      letter-spacing: 0.5px;
      color: var(--green);
    }

    .card-t::before {
      content: '';
      width: 3px;
      height: 14px;
      background: linear-gradient(180deg, var(--green), var(--green2));
      border-radius: 2px;
    }

    /* Form */
    .form-grid {
      display: grid;
      gap: 20px;
    }

    .form-grid.cols2 {
      grid-template-columns: 1fr 1fr
    }

    .form-grid.cols3 {
      grid-template-columns: 1fr 1fr 1fr
    }

    @media(max-width:500px) {

      .form-grid.cols2,
      .form-grid.cols3 {
        grid-template-columns: 1fr
      }
    }

    .field label {
      display: block;
      font-size: 10px;
      color: rgba(255, 255, 255, 0.4);
      margin-bottom: 6px;
      font-weight: 600;
      letter-spacing: 0.5px;
      text-transform: uppercase;
    }

    .field input,
    .field select,
    .field textarea {
      width: 100%;
      background: var(--inp-bg);
      border: 1px solid var(--inp-bd);
      border-radius: 8px;
      padding: 12px 16px;
      color: var(--text);
      font-size: 14px;
      outline: none;
      font-family: inherit;
      transition: all .2s ease;
    }

    .field input:focus,
    .field select:focus,
    .field textarea:focus {
      border-color: var(--green);
      box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.15);
      background: rgba(255, 255, 255, 0.05);
    }

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

    .field select {
      cursor: pointer;
      appearance: none;
      background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%23888' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10z'/%3E%3C/svg%3E");
      background-repeat: no-repeat;
      background-position: right 12px center
    }

    .field select option {
      background: #12121E;
      color: #e4e8f5;
      padding: 8px 12px
    }

    .field select option:checked {
      background: #00D4FF;
      color: #000
    }

    .field select optgroup {
      background: #0A0A14;
      color: var(--green);
      font-weight: 700;
      font-size: 12px;
      padding: 6px 8px
    }

    .field input[type=number] {
      -moz-appearance: textfield;
      appearance: textfield;
    }

    .field input[type=number]::-webkit-inner-spin-button {
      -webkit-appearance: none;
      appearance: none;
    }

    .field-hint {
      font-size: 10px;
      color: var(--faint);
      margin-top: 2px
    }

    /* Toggles */
    .toggles-grid {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 8px
    }

    @media(max-width:400px) {
      .toggles-grid {
        grid-template-columns: 1fr
      }
    }

    .toggle-item {
      display: flex;
      align-items: center;
      gap: 10px;
      padding: 10px 12px;
      background: var(--inp-bg);
      border: 1px solid var(--inp-bd);
      border-radius: 8px;
      cursor: pointer;
      transition: all .2s;
      user-select: none;
    }

    .toggle-item.on {
      border-color: var(--green);
      background: rgba(0, 212, 255, 0.08)
    }

    .toggle-item .dot {
      width: 18px;
      height: 18px;
      border-radius: 5px;
      border: 2px solid var(--inp-bd);
      display: flex;
      align-items: center;
      justify-content: center;
      transition: all .2s;
      flex-shrink: 0;
      font-size: 11px;
    }

    .toggle-item.on .dot {
      border-color: var(--green);
      background: var(--green);
      color: #fff
    }

    .toggle-item .tg-label {
      font-size: 12px;
      font-weight: 500;
      color: var(--dim)
    }

    .toggle-item.on .tg-label {
      color: var(--text)
    }

    /* Buttons */
    /* Calculator-specific button variants */
    .btn {
      display: inline-flex;
      align-items: center;
      gap: 6px;
    }

    .btn-primary {
      background: linear-gradient(135deg, var(--green), var(--green2));
      color: #fff;
      box-shadow: 0 2px 10px var(--green-glow);
    }

    .btn-primary:hover {
      background: linear-gradient(135deg, var(--green3), var(--green));
      box-shadow: 0 6px 20px var(--green-glow);
    }

    .btn-gold {
      background: linear-gradient(135deg, var(--gold), var(--gold2));
      color: #06060A;
      box-shadow: 0 2px 8px rgba(245, 158, 11, 0.2);
    }

    .btn-gold:hover {
      box-shadow: 0 6px 20px rgba(245, 158, 11, 0.35);
    }

    .btn-outline {
      background: none;
      border: 1px solid var(--inp-bd);
      color: var(--dim);
      box-shadow: none;
    }

    .btn-outline:hover {
      border-color: var(--green);
      color: var(--green);
    }

    .btn-wa {
      background: linear-gradient(135deg, #25D366, #128C7E);
      color: #fff;
      box-shadow: 0 2px 8px rgba(37, 211, 102, 0.2);
    }

    .btn-wa:hover {
      box-shadow: 0 6px 20px rgba(37, 211, 102, 0.3);
    }

    .btn-danger {
      background: linear-gradient(135deg, var(--red), #DC2626);
      color: #fff;
      box-shadow: 0 2px 8px rgba(239, 68, 68, 0.2);
    }

    .btn-full {
      width: 100%;
      justify-content: center;
      padding: 14px
    }

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

    .btn-calculate {
      background: linear-gradient(135deg, var(--green), var(--green2));
      color: #fff;
      box-shadow: 0 4px 15px var(--green-glow);
      font-size: 16px;
      padding: 16px;
      font-weight: 700;
      border: none;
      border-radius: var(--radius);
      transition: all 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
      position: relative;
      overflow: hidden;
    }

    .btn-calculate:hover {
      background: linear-gradient(135deg, var(--green3), var(--green));
      box-shadow: 0 6px 20px rgba(0, 212, 255, 0.4);
      transform: translateY(-2px);
    }

    .btn-calculate:active {
      transform: scale(0.98);
      box-shadow: 0 2px 10px rgba(0, 212, 255, 0.3);
    }

    /* Step Progress */
    .step-progress {
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 0;
      padding: 14px 16px 12px;
      margin-bottom: 4px;
      background: rgba(255,255,255,0.015);
      border-bottom: 1px solid rgba(255,255,255,0.07);
    }

    .step-dot {
      width: 32px;
      height: 32px;
      border-radius: 50%;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 12px;
      font-weight: 800;
      background: rgba(255,255,255,0.04);
      border: 2px solid rgba(255,255,255,0.08);
      color: rgba(255,255,255,0.5);
      cursor: pointer;
      flex-shrink: 0;
      transition: all 0.3s ease;
      position: relative;
    }

    .step-dot.active {
      background: linear-gradient(135deg, #00A8CC, #00D4FF);
      border: 2px solid #00D4FF;
      color: #fff;
      box-shadow: 0 0 12px rgba(0, 212, 255, 0.3);
    }

    .step-line {
      width: 40px;
      height: 2px;
      background: rgba(255,255,255,0.06);
      flex-shrink: 0;
      transition: all 0.3s ease;
    }

    /* Results */
    .result-hero {
      background: linear-gradient(135deg, #0A1628, #0D2847, #0A1628);
      border-radius: var(--radius);
      padding: 24px;
      text-align: center;
      margin-bottom: 16px;
      border: 1px solid rgba(0, 212, 255, 0.15);
      box-shadow: 0 8px 32px rgba(0, 40, 80, 0.4), inset 0 1px 0 rgba(0, 212, 255, 0.08);
      position: relative;
      overflow: hidden;
    }

    .result-hero::before {
      content: '';
      position: absolute;
      top: -30px;
      right: -30px;
      width: 100px;
      height: 100px;
      background: rgba(0, 212, 255, 0.06);
      border-radius: 50%;
    }

    .result-hero::after {
      content: '';
      position: absolute;
      bottom: -40px;
      left: -20px;
      width: 120px;
      height: 120px;
      background: rgba(255, 184, 0, 0.04);
      border-radius: 50%;
    }

    .result-hero .big {
      font-family: 'Playfair Display', serif;
      font-size: 42px;
      font-weight: 800;
      color: #fff;
      line-height: 1
    }

    .result-hero .sub {
      font-size: 12px;
      color: var(--dim);
      margin-top: 4px
    }

    .result-hero .psf {
      display: inline-block;
      margin-top: 12px;
      background: rgba(0, 0, 0, 0.3);
      border-radius: 8px;
      padding: 8px 16px;
      font-size: 18px;
      font-weight: 700;
      color: var(--green3);
    }

    .metrics-grid {
      display: grid;
      grid-template-columns: repeat(4, 1fr);
      gap: 10px;
      margin-bottom: 16px
    }

    @media(max-width:500px) {
      .metrics-grid {
        grid-template-columns: 1fr 1fr
      }
    }

    .metric {
      background: var(--glass-bg);
      -webkit-backdrop-filter: blur(8px);
      backdrop-filter: blur(8px);
      border: 1px solid var(--glass-border);
      border-radius: var(--radius);
      padding: 14px;
      text-align: center;
      transition: all 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
    }

    .metric:hover {
      transform: translateY(-2px);
      border-color: var(--border-glow);
      box-shadow: 0 4px 16px rgba(0, 212, 255, 0.08);
    }

    .metric .m-label {
      font-size: 10px;
      color: var(--faint);
      text-transform: uppercase;
      letter-spacing: .5px;
      margin-bottom: 4px
    }

    .metric .m-value {
      font-size: 18px;
      font-weight: 800
    }

    /* Breakdown table — Professional Redesign */
    .bk-table {
      width: 100%;
      border-collapse: separate;
      border-spacing: 0;
      font-size: 13px;
    }

    .bk-table th {
      text-align: left;
      padding: 10px 14px;
      color: #fff;
      font-weight: 600;
      font-size: 10px;
      text-transform: uppercase;
      letter-spacing: .8px;
      background: rgba(0, 212, 255, 0.08);
      border-bottom: 2px solid var(--green);
    }

    .bk-table th:nth-child(n+2) {
      text-align: right
    }

    .bk-table td {
      padding: 8px 14px;
      border-bottom: 1px solid rgba(255, 255, 255, 0.04);
      color: var(--dim);
      font-size: 12.5px;
    }

    .bk-table td:nth-child(n+2) {
      text-align: right;
      font-variant-numeric: tabular-nums;
      font-weight: 500;
    }

    .bk-table td:last-child {
      color: var(--text);
      font-weight: 600;
    }

    .bk-table .auto-tag {
      font-size: 8px;
      color: var(--green);
      background: rgba(0, 212, 255, 0.10);
      padding: 2px 5px;
      border-radius: 3px;
      margin-left: 4px;
      font-weight: 700;
      text-transform: uppercase;
      letter-spacing: .3px;
    }

    /* Category header rows */
    .bk-table tr.cat-header td {
      padding: 16px 14px 6px;
      border-bottom: none;
      font-size: 11px;
      font-weight: 700;
      text-transform: uppercase;
      letter-spacing: .6px;
      color: var(--green3);
      position: relative;
    }

    .bk-table tr.cat-header td::after {
      content: '';
      position: absolute;
      bottom: 0;
      left: 14px;
      right: 14px;
      height: 1px;
      background: linear-gradient(90deg, var(--green), transparent);
    }

    /* Section subtotal rows */
    .bk-table tr.subtotal td {
      border-top: 1px solid rgba(255,255,255,0.08);
      font-weight: 700;
      color: var(--text);
      padding-top: 10px;
      padding-bottom: 10px;
    }

    /* Extras category header */
    .bk-table tr.cat-extras td {
      padding: 14px 14px 6px;
      color: #60a5fa;
      font-size: 11px;
      font-weight: 700;
      text-transform: uppercase;
      letter-spacing: .5px;
      border-bottom: none;
    }

    /* Services category header */
    .bk-table tr.cat-services td {
      padding: 14px 14px 6px;
      color: #a78bfa;
      font-size: 11px;
      font-weight: 700;
      text-transform: uppercase;
      letter-spacing: .5px;
      border-bottom: none;
    }

    /* Totals summary section below table */
    .results-totals {
      margin-top: 2px;
      border-radius: 0 0 12px 12px;
      overflow: hidden;
    }

    .results-totals .tot-row {
      display: flex;
      justify-content: space-between;
      padding: 9px 14px;
      font-size: 13px;
      border-bottom: 1px solid rgba(255,255,255,0.04);
    }

    .results-totals .tot-row .tot-label {
      color: var(--dim);
      font-weight: 500;
    }

    .results-totals .tot-row .tot-value {
      font-weight: 600;
      font-variant-numeric: tabular-nums;
      color: var(--text);
    }

    .results-totals .tot-row.accent .tot-value {
      color: var(--gold);
    }

    /* Grand total / Final Price */
    .results-final {
      margin-top: 6px;
      background: linear-gradient(135deg, rgba(255, 184, 0, 0.06), rgba(255, 184, 0, 0.02));
      border: 1px solid rgba(255, 184, 0, 0.2);
      border-radius: 12px;
      padding: 18px 20px;
      display: flex;
      justify-content: space-between;
      align-items: center;
    }

    .results-final .rf-label {
      font-size: 12px;
      font-weight: 700;
      letter-spacing: 1.5px;
      text-transform: uppercase;
      color: var(--dim);
    }

    .results-final .rf-value {
      font-family: 'Playfair Display', serif;
      font-size: 28px;
      font-weight: 800;
      color: var(--gold);
    }

    /* FINAL PRICE row inside table (kept for PDF compat) */
    .bk-table tr.total td {
      border-top: 2px solid var(--green);
      font-weight: 800;
      color: var(--green3);
      font-size: 15px;
      padding: 12px 14px;
    }


    /* Waste indicator badge */
    .waste-indicator {
      display: inline-block;
      margin-top: 10px;
      background: rgba(255, 255, 255, 0.08);
      border: 1px solid rgba(255, 255, 255, 0.12);
      border-radius: 20px;
      padding: 5px 14px;
      font-size: 11px;
      color: rgba(255, 255, 255, 0.7);
      letter-spacing: 0.3px;
    }

    /* Metric highlight (Net Profit) */
    .metric.metric-highlight {
      border-color: rgba(255, 184, 0, 0.3);
      background: rgba(255, 184, 0, 0.06);
    }
    .metric.metric-highlight .m-value {
      color: var(--gold);
    }

    /* BOM Summary card */
    .bom-summary {
      margin-top: 12px;
      background: var(--card);
      border: 1px solid var(--border);
      border-radius: 12px;
      padding: 16px;
    }

    .bom-title {
      font-size: 12px;
      font-weight: 700;
      color: var(--green);
      text-transform: uppercase;
      letter-spacing: .5px;
      margin-bottom: 12px;
      display: flex;
      align-items: center;
      gap: 6px;
    }

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

    @media(max-width:500px) {
      .bom-grid { grid-template-columns: 1fr 1fr; }
    }

    .bom-item {
      background: rgba(255, 255, 255, 0.02);
      border: 1px solid rgba(255, 255, 255, 0.05);
      border-radius: 8px;
      padding: 10px;
      text-align: center;
    }

    .bom-val {
      display: block;
      font-size: 16px;
      font-weight: 700;
      color: var(--text);
      font-variant-numeric: tabular-nums;
    }

    .bom-lbl {
      display: block;
      font-size: 10px;
      color: var(--faint);
      text-transform: uppercase;
      letter-spacing: .4px;
      margin-top: 3px;
    }

    .bom-note {
      font-size: 10px;
      color: var(--faint);
      margin-top: 10px;
      font-style: italic;
    }


    /* Quick Quote Comparison */
    .quick-quote {
      margin-top: 12px;
      background: var(--card);
      border: 1px solid var(--border);
      border-radius: 12px;
      padding: 16px;
    }

    .qq-title {
      font-size: 12px;
      font-weight: 700;
      color: var(--green);
      text-transform: uppercase;
      letter-spacing: .5px;
      margin-bottom: 12px;
    }

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

    @media(max-width:500px) {
      .qq-grid { grid-template-columns: 1fr; }
    }

    .qq-card {
      border: 1px solid rgba(255, 255, 255, 0.08);
      border-radius: 10px;
      padding: 14px 10px;
      text-align: center;
      position: relative;
      transition: border-color 0.2s, transform 0.2s;
    }

    .qq-card:hover {
      transform: translateY(-2px);
    }

    .qq-standard {
      border-color: rgba(0, 212, 255, 0.3);
      background: rgba(0, 212, 255, 0.04);
    }

    .qq-premium {
      border-color: rgba(96, 165, 250, 0.3);
      background: rgba(96, 165, 250, 0.04);
    }

    .qq-luxury {
      border-color: rgba(255, 184, 0, 0.3);
      background: rgba(255, 184, 0, 0.04);
    }

    .qq-tier {
      font-size: 11px;
      font-weight: 700;
      text-transform: uppercase;
      letter-spacing: .5px;
      color: var(--faint);
      margin-bottom: 4px;
    }

    .qq-desc {
      font-size: 10px;
      color: var(--dim);
      margin-bottom: 8px;
    }

    .qq-price {
      font-size: 20px;
      font-weight: 800;
      color: var(--text);
      font-variant-numeric: tabular-nums;
    }

    .qq-psf {
      font-size: 10px;
      color: var(--faint);
      margin-top: 2px;
    }

    .qq-badge {
      display: inline-block;
      margin-top: 8px;
      padding: 2px 10px;
      border-radius: 10px;
      font-size: 10px;
      font-weight: 600;
      background: rgba(0, 212, 255, 0.15);
      color: #00D4FF;
    }

    .qq-badge.qq-up {
      background: rgba(96, 165, 250, 0.12);
      color: #60a5fa;
    }

    /* Follow-up badges */
    .followup-badge {
      display: inline-block;
      padding: 1px 8px;
      border-radius: 8px;
      font-size: 9px;
      font-weight: 600;
      vertical-align: middle;
      margin-left: 4px;
    }

    .fu-fresh {
      background: rgba(0, 212, 255, 0.12);
      color: #00D4FF;
    }

    .fu-warm {
      background: rgba(245, 158, 11, 0.12);
      color: #FFB800;
    }

    .fu-cold {
      background: rgba(239, 68, 68, 0.12);
      color: #ef4444;
    }

    /* ROI Savings Calculator */
    .roi-card {
      margin-top: 12px;
      background: var(--card);
      border: 1px solid var(--border);
      border-radius: 12px;
      padding: 16px;
    }

    .roi-title {
      font-size: 12px;
      font-weight: 700;
      color: #00D4FF;
      text-transform: uppercase;
      letter-spacing: .5px;
      margin-bottom: 12px;
    }

    .roi-grid {
      display: grid;
      grid-template-columns: repeat(4, 1fr);
      gap: 10px;
    }

    @media(max-width:500px) {
      .roi-grid { grid-template-columns: repeat(2, 1fr); }
    }

    .roi-item {
      text-align: center;
      padding: 10px 6px;
      border-radius: 8px;
      background: rgba(255,255,255,0.02);
      border: 1px solid rgba(255,255,255,0.06);
    }

    .roi-item.roi-accent {
      background: rgba(0, 212, 255, 0.06);
      border-color: rgba(0, 212, 255, 0.2);
    }

    .roi-val {
      display: block;
      font-size: 18px;
      font-weight: 800;
      color: var(--text);
      font-variant-numeric: tabular-nums;
    }

    .roi-accent .roi-val {
      color: #00D4FF;
    }

    .roi-lbl {
      display: block;
      font-size: 9px;
      color: var(--faint);
      text-transform: uppercase;
      letter-spacing: .3px;
      margin-top: 2px;
    }

    /* Project Timeline */
    .timeline-card {
      margin-top: 12px;
      background: var(--card);
      border: 1px solid var(--border);
      border-radius: 12px;
      padding: 16px;
    }

    .tl-title {
      font-size: 12px;
      font-weight: 700;
      color: #60a5fa;
      text-transform: uppercase;
      letter-spacing: .5px;
      margin-bottom: 12px;
    }

    .tl-phases {
      display: flex;
      flex-direction: column;
      gap: 8px;
    }

    .tl-phase {
      display: flex;
      flex-direction: column;
      gap: 4px;
    }

    .tl-bar {
      height: 8px;
      border-radius: 4px;
      min-width: 30px;
    }

    .tl-prep { background: linear-gradient(90deg, #FFB800, #fbbf24); }
    .tl-base { background: linear-gradient(90deg, #60a5fa, #93c5fd); }
    .tl-turf { background: linear-gradient(90deg, #00D4FF, #33E0FF); }
    .tl-finish { background: linear-gradient(90deg, #a78bfa, #c4b5fd); }

    .tl-info {
      display: flex;
      justify-content: space-between;
      align-items: center;
    }

    .tl-name {
      font-size: 11px;
      color: var(--dim);
    }

    .tl-days {
      font-size: 11px;
      font-weight: 700;
      color: var(--text);
      font-variant-numeric: tabular-nums;
    }

    .tl-total {
      margin-top: 10px;
      padding-top: 8px;
      border-top: 1px solid rgba(255,255,255,0.06);
      font-size: 11px;
      color: var(--dim);
    }

    /* Actions bar */
    .actions {
      display: flex;
      gap: 8px;
      flex-wrap: wrap;
      margin-top: 16px
    }

    /* Admin */
    .admin-panel {
      background: rgba(255, 184, 0, 0.04);
      border: 1px solid rgba(255, 184, 0, 0.15);
      border-radius: var(--radius);
      padding: 18px;
      margin-bottom: 16px;
    }

    .admin-panel h3 {
      color: var(--gold);
      font-size: 14px;
      margin-bottom: 14px;
      display: flex;
      align-items: center;
      gap: 8px
    }

    .admin-grid {
      display: grid;
      grid-template-columns: 1fr 1fr 1fr;
      gap: 10px
    }

    @media(max-width:500px) {
      .admin-grid {
        grid-template-columns: 1fr 1fr
      }
    }

    .admin-grid label {
      font-size: 10px;
      color: var(--gold2);
      display: block;
      margin-bottom: 2px
    }

    .admin-grid input,
    .admin-grid select {
      width: 100%;
      background: rgba(255, 184, 0, 0.06);
      border: 1px solid rgba(255, 184, 0, 0.2);
      border-radius: 6px;
      padding: 7px 8px;
      color: var(--gold);
      font-size: 13px;
      outline: none;
      font-family: inherit;
    }

    .admin-grid input:focus,
    .admin-grid select:focus {
      border-color: var(--gold)
    }

    .admin-actions {
      display: flex;
      gap: 8px;
      margin-top: 12px;
      flex-wrap: wrap
    }

    /* Quote preview */
    /* Quote inherits from .letter-page — legacy .quote-box no longer used */
    .quote-tbl {
      width: 100%;
      border-collapse: collapse;
      font-size: 12px;
      margin-bottom: 16px
    }

    .quote-tbl th {
      background: #0A1628;
      color: #fff;
      padding: 8px 10px;
      text-align: left;
      font-weight: 600
    }

    .quote-tbl th:nth-child(n+2) {
      text-align: right
    }

    .quote-tbl td {
      padding: 7px 10px;
      border-bottom: 1px solid #e8e8e8
    }

    .quote-tbl td:nth-child(n+2) {
      text-align: right
    }

    .quote-tbl tr:nth-child(even) {
      background: #F5F7FD
    }

    .quote-totals {
      display: flex;
      justify-content: flex-end
    }

    .quote-totals-inner {
      width: 250px
    }

    .qt-row {
      display: flex;
      justify-content: space-between;
      padding: 5px 0;
      font-size: 13px;
      border-bottom: 1px solid #eee
    }

    .qt-row span:first-child {
      color: #666
    }

    .qt-grand {
      display: flex;
      justify-content: space-between;
      padding: 12px 0 4px;
      border-top: 3px solid #0A1628;
      margin-top: 6px;
      font-size: 20px;
      font-weight: 800;
      color: #0A1628
    }

    .qt-psf {
      text-align: right;
      font-size: 12px;
      color: #888;
      margin-top: 2px
    }

    /* Scope of work */
    .sow-header {
      display: flex;
      justify-content: space-between;
      align-items: flex-start;
      padding-bottom: 16px;
      border-bottom: 2px solid #0A1628;
      margin-bottom: 20px
    }

    .sow-header h2 {
      font-family: 'Playfair Display', serif;
      color: #0A1628;
      font-size: 24px;
      margin: 0
    }

    .sow-header .sow-sub {
      font-size: 12px;
      color: #888;
      margin-top: 2px
    }

    .sow-header .sow-date {
      font-size: 18px;
      color: #333;
      text-align: right;
      font-weight: 600
    }

    .sow-project {
      background: #F0F4FF;
      border-left: 4px solid #0A1628;
      border-radius: 0 8px 8px 0;
      padding: 14px 16px;
      margin-bottom: 20px;
      font-size: 14px;
      font-weight: 600;
      color: #0A1A30
    }

    .sow-section {
      margin-bottom: 20px
    }

    .sow-section h3 {
      font-size: 14px;
      font-weight: 700;
      color: #0A1628;
      margin-bottom: 10px;
      text-transform: uppercase;
      letter-spacing: .5px
    }

    .sow-list {
      list-style: none;
      counter-reset: sow
    }

    .sow-list li {
      counter-increment: sow;
      position: relative;
      padding: 8px 0 8px 32px;
      font-size: 13px;
      line-height: 1.6;
      color: #333;
      border-bottom: 1px solid #f0f0f0
    }

    .sow-list li::before {
      content: counter(sow)".";
      position: absolute;
      left: 0;
      font-weight: 700;
      color: #0A1628;
      font-size: 14px
    }

    .sow-upgrades {
      list-style: none;
      padding: 0
    }

    .sow-upgrades li {
      padding: 6px 0 6px 20px;
      font-size: 13px;
      color: #555;
      position: relative
    }

    .sow-upgrades li::before {
      content: "—";
      position: absolute;
      left: 0;
      color: #0A1628;
      font-weight: 700
    }

    .sow-notes {
      list-style: none;
      padding: 0
    }

    .sow-notes li {
      padding: 5px 0 5px 20px;
      font-size: 12px;
      color: #666;
      position: relative;
      line-height: 1.5
    }

    .sow-notes li::before {
      content: "•";
      position: absolute;
      left: 4px;
      color: #0A1628;
      font-weight: 700
    }

    .sow-price-box {
      background: linear-gradient(135deg, #081420, #0D2847);
      border-radius: 12px;
      padding: 26px;
      text-align: center;
      color: #fff;
      margin: 24px 0;
      position: relative;
      overflow: hidden;
    }

    .sow-price-box::before {
      content: '';
      position: absolute;
      top: -30px;
      right: -30px;
      width: 100px;
      height: 100px;
      background: rgba(255,255,255,0.05);
      border-radius: 50%;
    }

    .sow-price-box .sow-price {
      font-family: 'Playfair Display', serif;
      font-size: 38px;
      font-weight: 800
    }

    .sow-price-box .sow-psf {
      font-size: 14px;
      opacity: .8;
      margin-top: 4px
    }

    .sow-payment {
      background: #F5F7FD;
      border-radius: 8px;
      padding: 14px 16px;
      font-size: 12px;
      color: #555;
      line-height: 1.7
    }

    .sow-payment strong {
      color: #333
    }

    .sow-footer {
      text-align: center;
      padding-top: 16px;
      border-top: 1px solid #e8e8e8;
      font-size: 11px;
      color: #888;
      margin-top: 20px
    }

    .sow-edit-area {
      margin-bottom: 16px
    }

    .sow-edit-area textarea {
      width: 100%;
      min-height: 200px;
      background: var(--inp-bg);
      border: 1px solid var(--inp-bd);
      border-radius: 8px;
      padding: 12px;
      color: var(--text);
      font-size: 13px;
      font-family: inherit;
      line-height: 1.6;
      outline: none;
      resize: vertical;
    }

    .sow-edit-area textarea:focus {
      border-color: var(--green)
    }

    .sow-edit-label {
      font-size: 11px;
      color: var(--dim);
      margin-bottom: 6px;
      display: flex;
      justify-content: space-between;
      align-items: center
    }

    /* Quick examples */
    .examples {
      display: flex;
      gap: 8px;
      margin-bottom: 16px;
      flex-wrap: wrap
    }

    .ex-btn {
      background: var(--inp-bg);
      border: 1px solid var(--inp-bd);
      border-radius: 8px;
      padding: 8px 14px;
      cursor: pointer;
      transition: all .2s;
      font-family: inherit;
      font-size: 12px;
      color: var(--dim);
      font-weight: 600;
    }

    .ex-btn:hover {
      border-color: var(--green);
      color: var(--green)
    }

    /* Send config */
    .send-cfg {
      background: rgba(74, 154, 255, 0.04);
      border: 1px solid rgba(74, 154, 255, 0.15);
      border-radius: var(--radius);
      padding: 16px;
      margin-bottom: 12px;
    }

    .send-cfg h4 {
      color: var(--blue);
      font-size: 13px;
      margin-bottom: 10px
    }

    .send-method-tabs {
      display: flex;
      gap: 6px;
      margin-bottom: 12px
    }

    .smt {
      padding: 6px 12px;
      border-radius: 6px;
      border: 1px solid var(--inp-bd);
      background: none;
      color: var(--dim);
      font-size: 11px;
      cursor: pointer;
      font-family: inherit;
      font-weight: 600;
    }

    .smt.on {
      border-color: var(--blue);
      color: var(--blue);
      background: rgba(74, 154, 255, 0.08)
    }

    /* History */
    .hist-item {
      display: flex;
      justify-content: space-between;
      align-items: center;
      padding: 12px;
      border-bottom: 1px solid var(--border);
      cursor: pointer;
      transition: all .2s;
    }

    .hist-item:hover {
      background: rgba(255, 255, 255, 0.02)
    }

    .hist-item .h-name {
      font-size: 13px;
      font-weight: 600
    }

    .hist-item .h-meta {
      font-size: 11px;
      color: var(--faint)
    }

    .hist-item .h-price {
      font-size: 15px;
      font-weight: 700;
      color: var(--green3)
    }

    /* Print */
    /* ============================================
   LETTER-SIZE PAGE FORMAT (8.5 × 11 inches)
   Used by: Results, Quote/Estimate, Proposal
   ============================================ */
    .letter-page {
      background: #fff;
      color: #1a1a1a;
      width: 100%;
      max-width: 8.5in;
      min-height: 11in;
      margin: 0 auto 20px;
      padding: 0.6in 0.7in;
      box-shadow: 0 2px 24px rgba(0, 0, 0, 0.28);
      border-radius: 3px;
      font-family: 'Outfit', Arial, Helvetica, sans-serif;
      font-size: 13px;
      line-height: 1.55;
      position: relative;
      box-sizing: border-box;
      overflow: hidden;
    }

    .letter-page * {
      box-sizing: border-box
    }

    .letter-page h2,
    .letter-page h3 {
      color: #0A1628
    }

    .letter-page h2 {
      font-family: 'Playfair Display', serif;
      font-size: 22px;
      margin-bottom: 4px
    }

    .letter-page .page-header {
      display: flex;
      justify-content: space-between;
      align-items: flex-start;
      padding-bottom: 12px;
      border-bottom: 3px solid #0A1628;
      margin-bottom: 18px;
    }

    .letter-page .page-header img {
      height: 60px;
      width: auto;
      object-fit: contain
    }

    .letter-page .page-meta {
      text-align: right;
      font-size: 11.5px;
      color: #666;
      line-height: 1.6
    }

    .letter-page .page-meta .doc-num {
      font-size: 19px;
      font-weight: 800;
      color: #1a1a1a;
      display: block;
      margin-bottom: 3px
    }

    .letter-page .page-footer {
      text-align: center;
      font-size: 10px;
      color: #aaa;
      border-top: 1px solid #e8e8e8;
      padding-top: 10px;
      margin-top: 30px;
    }

    /* Results inside letter-page */
    .letter-page .result-hero {
      background: var(--bg);
      border-radius: 10px;
      padding: 22px;
      text-align: center;
      color: #fff;
      margin-bottom: 18px
    }

    .letter-page .result-hero .big {
      font-family: 'Playfair Display', serif;
      font-size: 38px;
      font-weight: 800;
      color: #fff
    }

    .letter-page .result-hero .sub {
      font-size: 11.5px;
      color: rgba(255, 255, 255, 0.7);
      margin-top: 3px
    }

    .letter-page .result-hero .psf {
      font-size: 15px;
      color: rgba(255, 255, 255, 0.9);
      font-weight: 600
    }

    .letter-page .metrics-grid {
      display: grid;
      grid-template-columns: repeat(4, 1fr);
      gap: 10px;
      margin-bottom: 16px
    }

    .letter-page .metric {
      background: #F0F3FA;
      border-radius: 8px;
      padding: 10px 8px;
      text-align: center
    }

    .letter-page .metric .m-label {
      font-size: 9.5px;
      color: #888;
      text-transform: uppercase;
      letter-spacing: 0.5px;
      margin-bottom: 3px
    }

    .letter-page .metric .m-value {
      font-size: 15px;
      font-weight: 700;
      color: #0A1628
    }

    .letter-page .bk-table {
      width: 100%;
      border-collapse: collapse;
      font-size: 11.5px;
      margin: 0
    }

    .letter-page .bk-table th {
      background: #0A1628;
      color: #fff;
      padding: 7px 9px;
      text-align: left;
      font-size: 11px
    }

    .letter-page .bk-table th:nth-child(n+2) {
      text-align: right
    }

    .letter-page .bk-table td {
      padding: 5px 9px;
      border-bottom: 1px solid #eee;
      font-size: 11.5px
    }

    .letter-page .bk-table td:nth-child(n+2) {
      text-align: right
    }

    .letter-page .bk-table tr:nth-child(even) {
      background: #fafafa
    }

    .letter-page .bk-table .subtotal td {
      font-weight: 700;
      border-top: 1px solid #ccc
    }

    .letter-page .bk-table .total td {
      font-weight: 800;
      font-size: 14px;
      color: #0A1628;
      border-top: 3px solid #0A1628
    }

    .letter-page .auto-tag {
      display: inline-block;
      background: #E3F0FF;
      color: #00A8CC;
      padding: 1px 5px;
      border-radius: 4px;
      font-size: 8.5px;
      font-weight: 700
    }

    /* Quote/Estimate inside letter-page */
    .letter-page .q-info {
      background: #F0F3FA;
      border-radius: 8px;
      padding: 12px 14px;
      margin-bottom: 14px;
      font-size: 12.5px;
      line-height: 1.7
    }

    .letter-page .q-info strong {
      color: #333
    }

    /* Mobile: collapse to card style */
    @media(max-width:700px) {
      .letter-page {
        padding: 18px 16px;
        min-height: auto;
        border-radius: 10px;
        margin: 0 0 16px
      }

      .letter-page .metrics-grid {
        grid-template-columns: 1fr 1fr
      }

      .letter-page .page-footer {
        position: static;
        margin-top: 20px
      }

      .letter-page .page-header img {
        height: 45px
      }

      .letter-page .result-hero .big {
        font-size: 30px
      }
    }

    /* Proposal uses .prop — same letter sizing */
    .prop {
      background: #fff;
      color: #1a1a1a;
      border-radius: 3px;
      box-shadow: 0 2px 24px rgba(0, 0, 0, 0.28);
      font-family: 'Outfit', Arial, Helvetica, sans-serif;
      font-size: 13px;
      line-height: 1.55;
      overflow: hidden;
      max-width: 8.5in;
      margin: 0 auto 20px
    }

    .prop-page {
      padding: 0.6in 0.7in;
      position: relative;
      min-height: auto
    }

    @media(max-width:700px) {
      .prop-page {
        padding: 18px 16px
      }
    }

    @media print {
      @page {
        size: letter;
        margin: 0.25in 0.4in;
      }

      * {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
        box-sizing: border-box !important
      }

      html,
      body {
        background: #fff !important;
        color: #000 !important;
        font-size: 9px !important;
        margin: 0 !important;
        padding: 0 !important;
        width: 100% !important;
        overflow: visible !important;
        max-width: 100% !important
      }

      .app {
        max-width: 1000px;
        margin: 0 auto;
        padding-bottom: calc(40px + var(--safe-b));
      }

      .header,
      .tabs,
      .actions,
      .admin-panel,
      .send-cfg,
      .examples,
      .btn,
      .toggle-item,
      .admin-toggle,
      .sow-edit-area,
      .card-h,
      .notif,
      .estimate-approve-card,
      .nav-tab,
      #quickAccessBar,
      #userSection {
        display: none !important
      }

      .section {
        padding: 0 !important;
        margin: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        overflow: visible !important
      }

      .card {
        background: var(--card);
        border: 1px solid var(--border);
        border-radius: var(--radius);
        margin-bottom: 24px;
        overflow: hidden;
        box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05), 0 8px 40px rgba(0, 0, 0, 0.5);
      }

      .card-body {
        padding: 8px 24px 24px;
      }

      /* Letter-page container: remove all extra spacing, let @page handle margins */
      .letter-page {
        box-shadow: none !important;
        border-radius: 0 !important;
        padding: 0 !important;
        margin: 0 !important;
        min-height: auto !important;
        max-width: 100% !important;
        width: 100% !important;
        overflow: visible !important;
        font-size: 9px !important;
      }

      .letter-page * {
        box-sizing: border-box !important
      }

      .letter-page div[style*="overflow"] {
        overflow: visible !important
      }

      .letter-page div[style*="background:#F0F3FA"] {
        padding: 5px 8px !important;
        margin-bottom: 5px !important;
        font-size: 8.5px !important;
        line-height: 1.4 !important
      }

      .letter-page .page-header {
        margin-bottom: 6px !important;
        padding-bottom: 5px !important
      }

      .letter-page .page-header img {
        height: 35px !important
      }

      .letter-page .page-meta {
        font-size: 8px !important
      }

      .letter-page .page-meta .doc-num {
        font-size: 11px !important
      }

      .letter-page .page-footer {
        position: static !important;
        margin-top: 8px !important
      }

      .letter-page .result-hero {
        padding: 8px !important;
        margin-bottom: 5px !important;
        background: #0A1628 !important;
        border-radius: 3px !important
      }

      .letter-page .result-hero .big {
        font-size: 20px !important
      }

      .letter-page .result-hero .psf {
        font-size: 9px !important
      }

      .letter-page .result-hero .sub {
        font-size: 7px !important
      }

      .letter-page .metrics-grid {
        gap: 3px !important;
        margin-bottom: 4px !important
      }

      .letter-page .metric {
        padding: 3px 3px !important;
        border-radius: 3px !important
      }

      .letter-page .metric .m-label {
        font-size: 6.5px !important;
        margin-bottom: 1px !important
      }

      .letter-page .metric .m-value {
        font-size: 9px !important
      }

      .letter-page .bk-table {
        width: 100% !important;
        table-layout: fixed !important;
        font-size: 8px !important;
        word-wrap: break-word !important
      }

      .letter-page .bk-table th {
        padding: 2px 4px !important;
        font-size: 7.5px !important;
        background: #0A1628 !important;
        color: #fff !important
      }

      .letter-page .bk-table td {
        padding: 2px 4px !important;
        font-size: 8px !important;
        word-wrap: break-word !important;
        overflow-wrap: break-word !important
      }

      .letter-page .bk-table th:first-child,
      .letter-page .bk-table td:first-child {
        width: 45% !important
      }

      .letter-page .bk-table th:nth-child(2),
      .letter-page .bk-table td:nth-child(2) {
        width: 15% !important
      }

      .letter-page .bk-table th:nth-child(3),
      .letter-page .bk-table td:nth-child(3) {
        width: 18% !important
      }

      .letter-page .bk-table th:nth-child(4),
      .letter-page .bk-table td:nth-child(4) {
        width: 22% !important
      }

      .letter-page .bk-table .total td {
        font-size: 9px !important
      }

      .letter-page .bk-table .auto-tag {
        font-size: 6px !important;
        padding: 0 2px !important
      }

      .letter-page .q-info {
        padding: 4px 6px !important;
        margin-bottom: 5px !important;
        font-size: 8.5px !important
      }

      /* Proposal: let @page margins do the work */
      .prop {
        box-shadow: none !important;
        border-radius: 0 !important;
        overflow: visible !important;
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important
      }

      .prop-page {
        padding: 0 !important;
        min-height: auto !important;
        page-break-inside: auto !important;
        overflow: visible !important
      }

      .prop-page+.prop-page {
        border-top: none !important;
        page-break-before: auto !important;
        padding-top: 0 !important
      }

      .prop-hdr {
        margin-bottom: 6px !important;
        padding-bottom: 4px !important
      }

      .prop-hdr img {
        height: 35px !important
      }

      .prop-hdr-right .prop-num {
        font-size: 11px !important
      }

      .prop-hdr-right .prop-meta {
        font-size: 8px !important
      }

      .prop-parties {
        margin-bottom: 5px !important;
        gap: 8px !important
      }

      .prop-party p {
        font-size: 8.5px !important
      }

      .prop-party h4 {
        font-size: 8px !important
      }

      .prop-deposit {
        margin-bottom: 6px !important;
        padding: 4px 8px !important
      }

      .prop-deposit .dep-amt {
        font-size: 11px !important
      }

      .prop-terms-bar {
        font-size: 8px !important;
        margin-bottom: 5px !important;
        padding: 3px 0 !important
      }

      .prop-item {
        page-break-inside: avoid !important;
        margin-bottom: 4px !important
      }

      .prop-item-hdr {
        padding: 4px 8px !important
      }

      .prop-item-hdr .item-title {
        font-size: 10px !important
      }

      .prop-item-hdr .item-cols {
        font-size: 8px !important;
        gap: 8px !important
      }

      .prop-item-body {
        padding: 5px 8px !important;
        font-size: 8.5px !important
      }

      .prop-item-body ol li,
      .prop-item-body ul li {
        padding: 1px 0 !important;
        font-size: 8px !important;
        line-height: 1.3 !important
      }

      .prop-item-body h5 {
        font-size: 8.5px !important;
        margin: 4px 0 2px !important
      }

      .prop-totals {
        margin: 5px 0 !important
      }

      .prop-totals td {
        padding: 2px 4px !important;
        font-size: 8.5px !important
      }

      .prop-totals .grand-total td {
        font-size: 11px !important
      }

      .prop-tc {
        page-break-before: always !important;
        page-break-inside: auto !important
      }

      .prop-tc h3,
      .prop-tc h4 {
        font-size: 9px !important
      }

      .prop-tc ol li {
        padding: 1px 0 !important;
        font-size: 8px !important;
        line-height: 1.3 !important
      }

      .prop-sig {
        page-break-inside: avoid !important;
        margin-top: 6px !important;
        padding-top: 5px !important
      }

      .prop-reps,
      .prop-footer {
        page-break-inside: avoid !important
      }

      .prop-footer {
        font-size: 7px !important;
        padding: 3px 0 !important
      }

      /* Quote/Estimate - Optimized for single page */
      .sow-header {
        margin-bottom: 6px !important;
        padding-bottom: 4px !important
      }

      .sow-header img {
        height: 50px !important
      }

      .sow-header .sow-sub {
        font-size: 8px !important
      }

      .sow-header .sow-date {
        font-size: 12px !important;
        font-weight: 600 !important
      }

      .sow-project {
        padding: 5px 8px !important;
        margin-bottom: 6px !important;
        font-size: 9px !important
      }

      .sow-section {
        margin-bottom: 6px !important
      }

      .sow-section h3 {
        font-size: 9px !important;
        margin-bottom: 3px !important
      }

      .sow-list li {
        padding: 2px 0 2px 20px !important;
        font-size: 8.5px !important;
        line-height: 1.3 !important
      }

      .sow-list li::before {
        font-size: 9px !important
      }

      .sow-upgrades li,
      .sow-notes li {
        font-size: 8px !important;
        padding: 1px 0 1px 12px !important;
        line-height: 1.3 !important
      }

      .sow-price-box {
        padding: 10px !important;
        margin: 8px 0 !important;
        background: #0A1628 !important;
        border-radius: 4px !important
      }

      .sow-price-box .sow-price {
        font-size: 22px !important
      }

      .sow-price-box .sow-psf {
        font-size: 9px !important
      }

      .sow-payment {
        padding: 5px 8px !important;
        font-size: 8.5px !important
      }

      .sow-footer {
        font-size: 7.5px !important;
        margin-top: 6px !important;
        padding-top: 4px !important
      }

      /* Additional Products section */
      .sow-section[style*="Additional Products"] h3,
      .add-products-title {
        font-size: 9px !important;
        margin-bottom: 3px !important
      }

      .add-products-list {
        font-size: 8px !important
      }

      .add-products-list li {
        padding: 1px 0 !important;
        line-height: 1.3 !important
      }

      /* Notes section */
      .sow-notes {
        margin-bottom: 4px !important
      }

      .sow-notes li {
        font-size: 7.5px !important;
        line-height: 1.25 !important;
        padding: 1px 0 1px 10px !important
      }

      /* Customer info */
      .q-info {
        padding: 4px 6px !important;
        margin-bottom: 5px !important;
        font-size: 8.5px !important;
        line-height: 1.4 !important
      }

      .q-info strong {
        font-size: 8.5px !important
      }
    }

    /* Notification */
    .notif {
      position: fixed;
      bottom: 20px;
      left: 50%;
      transform: translateX(-50%) translateY(100px);
      background: var(--green);
      color: #fff;
      padding: 12px 24px;
      border-radius: 10px;
      font-size: 14px;
      font-weight: 600;
      z-index: 1000;
      transition: transform .3s ease;
      box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
    }

    .notif.show {
      transform: translateX(-50%) translateY(0)
    }

    /* Animations */
    @keyframes fadeIn {
      from {
        opacity: 0;
        transform: translateY(10px)
      }

      to {
        opacity: 1;
        transform: translateY(0)
      }
    }

    .fade-in {
      animation: fadeIn .3s ease
    }


    /* Proposal document */
    .prop-page+.prop-page {
      border-top: 3px dashed #ccc
    }

    .prop-hdr {
      display: flex;
      justify-content: space-between;
      align-items: flex-start;
      margin-bottom: 24px;
      padding-bottom: 16px;
      border-bottom: 3px solid #0A1628
    }

    .prop-hdr-left {
      display: flex;
      align-items: flex-start;
      gap: 14px
    }

    .prop-hdr-logo {
      height: 65px;
      width: auto
    }

    .prop-hdr-co {
      font-size: 12px;
      color: #444;
      line-height: 1.5
    }

    .prop-hdr-right {
      text-align: right
    }

    .prop-hdr-right .prop-num {
      font-size: 22px;
      font-weight: 800;
      color: #1a1a1a
    }

    .prop-hdr-right .prop-meta {
      font-size: 11px;
      color: #666;
      line-height: 1.6
    }

    .prop-parties {
      display: flex;
      justify-content: space-between;
      gap: 30px;
      margin-bottom: 20px
    }

    .prop-party {
      flex: 1
    }

    .prop-party h4 {
      font-size: 11px;
      color: #0A1628;
      text-transform: uppercase;
      letter-spacing: 1px;
      margin-bottom: 6px;
      font-weight: 700
    }

    .prop-party p {
      font-size: 13px;
      color: #333;
      margin: 2px 0
    }

    .prop-deposit {
      background: #F0F4FF;
      border: 2px solid #0A1628;
      border-radius: 8px;
      padding: 14px 20px;
      text-align: center;
      margin-bottom: 24px
    }

    .prop-deposit .dep-amt {
      font-size: 18px;
      font-weight: 800;
      color: #0A1628
    }

    .prop-deposit .dep-note {
      font-size: 12px;
      color: #555;
      margin-top: 4px
    }

    .prop-terms-bar {
      display: flex;
      justify-content: space-between;
      align-items: center;
      padding: 8px 0;
      margin-bottom: 16px;
      border-bottom: 1px solid #ddd;
      font-size: 12px;
      color: #666
    }

    .prop-item {
      border: 1px solid #e0e0e0;
      border-radius: 6px;
      margin-bottom: 16px;
      overflow: hidden
    }

    .prop-item-hdr {
      display: flex;
      justify-content: space-between;
      align-items: center;
      background: #F5F7FD;
      padding: 12px 16px;
      border-bottom: 1px solid #e8e8e8
    }

    .prop-item-hdr .item-title {
      font-size: 15px;
      font-weight: 700;
      color: #1a1a1a
    }

    .prop-item-hdr .item-cols {
      display: flex;
      gap: 20px;
      font-size: 12px;
      color: #666;
      font-weight: 600
    }

    .prop-item-hdr .item-total {
      font-size: 15px;
      font-weight: 700;
      color: #1a1a1a
    }

    .prop-item-body {
      padding: 16px
    }

    .prop-item-body .item-product {
      font-size: 13px;
      color: #444;
      margin-bottom: 4px
    }

    .prop-item-body h5 {
      font-size: 12px;
      font-weight: 700;
      color: #0A1628;
      margin: 14px 0 8px;
      text-transform: uppercase;
      letter-spacing: .5px
    }

    .prop-item-body ol {
      padding-left: 20px;
      margin: 0
    }

    .prop-item-body ol li {
      padding: 4px 0;
      font-size: 13px;
      color: #333;
      line-height: 1.6
    }

    .prop-item-body ul {
      list-style: none;
      padding: 0;
      margin: 0
    }

    .prop-item-body ul li {
      padding: 3px 0 3px 16px;
      font-size: 12px;
      color: #555;
      position: relative
    }

    .prop-item-body ul li::before {
      content: "–";
      position: absolute;
      left: 0;
      color: #0A1628;
      font-weight: 700
    }

    .prop-totals {
      display: flex;
      justify-content: flex-end;
      margin: 20px 0
    }

    .prop-totals table {
      border-collapse: collapse;
      min-width: 280px
    }

    .prop-totals td {
      padding: 8px 14px;
      font-size: 14px
    }

    .prop-totals tr {
      border-bottom: 1px solid #e8e8e8
    }

    .prop-totals tr:first-child td:first-child {
      font-weight: 700;
      color: #0A1628;
      background: #F0F4FF
    }

    .prop-totals tr:first-child td:last-child {
      font-weight: 800;
      font-size: 16px;
      background: #F0F4FF;
      text-align: right
    }

    .prop-totals td:last-child {
      text-align: right;
      font-weight: 600
    }

    .prop-totals td:first-child {
      color: #555
    }

    .prop-tc {
      margin-top: 10px
    }

    .prop-tc h3 {
      font-size: 13px;
      font-weight: 700;
      color: #0A1628;
      margin-bottom: 10px;
      text-transform: uppercase;
      letter-spacing: .5px
    }

    .prop-tc ol {
      padding-left: 18px;
      margin: 0
    }

    .prop-tc ol li {
      padding: 6px 0;
      font-size: 11.5px;
      color: #444;
      line-height: 1.6;
      border-bottom: 1px solid #f0f0f0
    }

    .prop-tc ol li strong {
      color: #1a1a1a
    }

    .prop-sig {
      margin-top: 24px;
      padding-top: 20px;
      border-top: 2px solid #0A1628
    }

    .prop-sig h3 {
      font-size: 13px;
      font-weight: 700;
      color: #0A1628;
      margin-bottom: 16px
    }

    .prop-sig-line {
      display: flex;
      align-items: flex-end;
      gap: 20px;
      margin-bottom: 8px
    }

    .prop-sig-line .sig-x {
      font-size: 16px;
      font-weight: 700;
      color: #999
    }

    .prop-sig-line .sig-rule {
      flex: 1;
      border-bottom: 1px solid #333;
      min-height: 30px
    }

    .prop-sig-line .sig-date {
      font-size: 12px;
      color: #666;
      white-space: nowrap
    }

    .prop-sig-note {
      font-size: 11px;
      color: #888;
      margin-top: 4px
    }

    .prop-reps {
      display: flex;
      gap: 30px;
      margin-top: 16px
    }

    .prop-reps>div {
      flex: 1
    }

    .prop-reps h4 {
      font-size: 11px;
      color: #0A1628;
      text-transform: uppercase;
      letter-spacing: .5px;
      margin-bottom: 4px;
      font-weight: 700;
      border-bottom: 1px dashed #ccc;
      padding-bottom: 4px
    }

    .prop-reps p {
      font-size: 12px;
      color: #444;
      margin: 2px 0
    }

    .prop-footer {
      text-align: center;
      padding: 14px;
      background: #F5F7FD;
      border-top: 1px solid #e8e8e8;
      font-size: 11px;
      color: #888
    }

    .prop-add-svc {
      margin-bottom: 12px
    }

    .prop-add-svc .field {
      margin-bottom: 8px
    }

    .prop-add-svc textarea {
      min-height: 60px
    }

    /* Hide sections */
    .hidden {
      display: none !important
    }

    /* ═══════════════════════════════════════════════════════════════════
   MODAL COMPONENT — Reusable modal overlay for prompts
═══════════════════════════════════════════════════════════════════ */
    .tm-modal-overlay {
      position: fixed;
      inset: 0;
      z-index: 100000;
      background: rgba(0, 0, 0, 0.75);
      backdrop-filter: blur(8px);
      -webkit-backdrop-filter: blur(8px);
      display: none;
      align-items: center;
      justify-content: center;
      padding: 20px;
      opacity: 0;
      transition: opacity .2s ease;
    }

    .tm-modal-overlay.show {
      display: flex;
      opacity: 1
    }

    .tm-modal {
      background: var(--card-bg);
      border: 1px solid var(--card-bd);
      border-radius: 16px;
      max-width: 400px;
      width: 100%;
      box-shadow: 0 12px 48px rgba(0, 0, 0, 0.5);
      transform: scale(0.95);
      transition: transform .2s ease;
    }

    .tm-modal-overlay.show .tm-modal {
      transform: scale(1)
    }

    .tm-modal-header {
      padding: 18px 20px;
      border-bottom: 1px solid var(--card-bd);
      display: flex;
      align-items: center;
      justify-content: space-between;
    }

    .tm-modal-title {
      font-size: 16px;
      font-weight: 700;
      color: #fff;
      margin: 0
    }

    .tm-modal-close {
      background: none;
      border: none;
      color: var(--dim);
      font-size: 18px;
      cursor: pointer;
      padding: 4px 8px;
      border-radius: 6px;
      transition: all .2s;
    }

    .tm-modal-close:hover {
      color: #fff;
      background: rgba(255, 255, 255, 0.1)
    }

    .tm-modal-body {
      padding: 20px
    }

    .tm-modal-info {
      background: rgba(255, 255, 255, 0.04);
      border-radius: 10px;
      padding: 12px 14px;
      margin-bottom: 16px;
    }

    .tm-modal-info p {
      margin: 0 0 6px;
      font-size: 13px;
      color: var(--dim)
    }

    .tm-modal-info p:last-child {
      margin-bottom: 0
    }

    .tm-modal-info strong {
      color: #fff
    }

    .tm-modal-actions {
      display: flex;
      flex-direction: column;
      gap: 8px
    }

    .tm-modal-btn {
      background: var(--inp-bg);
      border: 1px solid var(--inp-bd);
      border-radius: 10px;
      padding: 12px 16px;
      color: #e4e8e5;
      font-size: 14px;
      font-weight: 600;
      cursor: pointer;
      text-align: left;
      transition: all .2s;
      display: flex;
      align-items: center;
      gap: 10px;
    }

    .tm-modal-btn:hover {
      border-color: var(--green);
      background: rgba(0, 212, 255, 0.1)
    }

    .tm-modal-btn.danger:hover {
      border-color: #e05252;
      background: rgba(224, 82, 82, 0.1);
      color: #e05252
    }

    .tm-modal-btn.primary {
      background: var(--green);
      border-color: var(--green);
      color: #000
    }

    .tm-modal-btn.primary:hover {
      background: #22d55e;
      border-color: #22d55e
    }

    .tm-modal-btn:disabled {
      opacity: 0.5;
      cursor: not-allowed;
      pointer-events: none
    }

    .tm-modal-footer {
      padding: 0 20px 20px;
      display: flex;
      gap: 10px;
      justify-content: flex-end
    }

    .tm-modal-footer .tm-modal-btn {
      flex: 1;
      justify-content: center
    }

    /* Radio button style for email type selection */
    .tm-modal-radio {
      display: flex;
      flex-direction: column;
      gap: 10px
    }

    .tm-modal-radio label {
      display: flex;
      align-items: center;
      gap: 10px;
      padding: 12px 14px;
      background: var(--inp-bg);
      border: 1px solid var(--inp-bd);
      border-radius: 10px;
      cursor: pointer;
      transition: all .2s;
      font-size: 13px;
      color: var(--dim);
    }

    .tm-modal-radio label:hover {
      border-color: var(--green);
      background: rgba(0, 212, 255, 0.05)
    }

    .tm-modal-radio input[type="radio"] {
      accent-color: var(--green);
      width: 16px;
      height: 16px
    }

    .tm-modal-radio label.selected {
      border-color: var(--green);
      background: rgba(0, 212, 255, 0.1);
      color: #fff
    }

    /* ═══════════════════════════════════════════════════════════════════
   OFFLINE BANNER — Shown when n8n backend is unreachable
═══════════════════════════════════════════════════════════════════ */
    .tm-offline-banner {
      position: fixed;
      top: 0;
      left: 0;
      right: 0;
      z-index: 99998;
      background: var(--bg);
      padding: 10px 16px;
      display: none;
      align-items: center;
      justify-content: center;
      gap: 10px;
      box-shadow: 0 2px 12px rgba(0, 0, 0, 0.4);
    }

    .tm-offline-banner.show {
      display: flex
    }

    .tm-offline-banner span {
      color: #fff;
      font-size: 13px;
      font-weight: 600
    }

    .tm-offline-banner button {
      background: rgba(255, 255, 255, 0.2);
      border: none;
      border-radius: 6px;
      padding: 5px 10px;
      color: #fff;
      font-size: 11px;
      cursor: pointer;
      font-weight: 600;
    }

    .tm-offline-banner button:hover {
      background: rgba(255, 255, 255, 0.3)
    }

    /* ═══ FIX: Logo + Button contrast on white documents ═══ */
    .letter-page .page-header img,
    .sow-header img,
    .prop-hdr img {
      filter: brightness(0) saturate(100%);
    }

    .sow-approve-box {
      background: #F0F4FF !important;
      border: 2px solid #0A1628 !important;
    }

    .sow-approve-box a {
      background: #0A1628 !important;
      color: #fff !important;
    }

    .sow-approve-box div[style*="color:#00A8CC"] {
      color: #0A1628 !important;
    }

    .sow-approve-box div[style*="color:#555"] {
      color: #444 !important;
    }

    .prop-payment-box {
      background: #F0F4FF !important;
      border: 2px solid #0A1628 !important;
    }

    .prop-payment-box a {
      background: #0A1628 !important;
      color: #fff !important;
    }

    .prop-payment-box div[style*="color:#1565c0"] {
      color: #0A1628 !important;
    }

    .prop-payment-box div[style*="color:#0d47a1"] {
      color: #0A1628 !important;
    }

    /* =========================================
       PHASE 4: DYNAMIC PROPOSALS
       ========================================= */
    .tier-container {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
      gap: 16px;
      margin: 24px 0;
    }

    .tier-card {
      border: 2px solid var(--border);
      border-radius: 12px;
      background: var(--card-bg);
      padding: 16px;
      cursor: pointer;
      transition: all 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
      position: relative;
      overflow: hidden;
      display: flex;
      flex-direction: column;
    }

    .tier-card:hover {
      transform: translateY(-4px);
      box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
      border-color: rgba(0, 212, 255, 0.3);
    }

    .tier-card.active {
      border-color: var(--green);
      background: rgba(0, 212, 255, 0.05);
      box-shadow: 0 8px 28px rgba(0, 212, 255, 0.2);
    }

    .tier-card.active::before {
      content: '';
      position: absolute;
      top: 0; left: 0; right: 0; height: 4px;
      background: linear-gradient(90deg, var(--green), #33E0FF);
    }

    .tier-badge {
      display: inline-block;
      padding: 4px 10px;
      border-radius: 12px;
      font-size: 10px;
      font-weight: 700;
      text-transform: uppercase;
      letter-spacing: 1px;
      margin-bottom: 12px;
      align-self: flex-start;
    }

    .tier-badge.essential { background: rgba(59, 130, 246, 0.15); color: #3b82f6; }
    .tier-badge.performance { background: rgba(0, 212, 255, 0.15); color: #00D4FF; }
    .tier-badge.luxury { background: rgba(168, 85, 247, 0.15); color: #a855f7; }

    .tier-title {
      font-size: 16px;
      font-weight: 700;
      color: var(--text);
      margin-bottom: 4px;
    }
    
    .tier-price {
      font-size: 24px;
      font-weight: 800;
      font-family: 'Playfair Display', serif;
      color: var(--green);
      margin: 8px 0;
    }

    .tier-features {
      list-style: none;
      padding: 0;
      margin: 16px 0 0 0;
      flex: 1;
    }

    .tier-features li {
      padding: 6px 0;
      font-size: 11px;
      color: var(--dim);
      display: flex;
      align-items: flex-start;
      gap: 6px;
      border-bottom: 1px solid rgba(255,255,255,0.03);
    }

    .tier-features li:last-child {
      border-bottom: none;
    }

    .tier-features li::before {
      content: '✓';
      color: var(--green);
      font-weight: bold;
    }

    .roi-widget {
      background: linear-gradient(135deg, rgba(59, 130, 246, 0.08), rgba(0, 212, 255, 0.08));
      border: 1px solid rgba(59, 130, 246, 0.2);
      border-radius: 12px;
      padding: 16px;
      margin: 24px 0;
      display: flex;
      gap: 16px;
      align-items: center;
    }

    .roi-icon {
      font-size: 32px;
    }

    .roi-info h4 {
      margin: 0 0 4px 0;
      color: var(--text);
      font-size: 14px;
    }

    .roi-info p {
      margin: 0;
      color: var(--dim);
      font-size: 11px;
      line-height: 1.5;
    }

    .roi-info strong {
      color: #3b82f6;
      font-size: 13px;
    }

    @media print {
      .tier-card:not(.active) {
        display: none !important;
      }
      .tier-container {
        display: block !important;
        margin: 0 !important;
      }
      .tier-card.active {
        box-shadow: none !important;
        border: 2px solid #0A1628 !important;
        background: #f0fdf4 !important;
        transform: none !important;
        padding: 16px !important;
        break-inside: avoid;
      }
      .roi-widget {
        page-break-inside: avoid;
        break-inside: avoid;
        border: 1px solid #ccc !important;
        background: #F5F7FD !important;
      }
      .tier-price {
        color: #0A1628 !important;
      }
      .tier-features li::before {
        color: #0A1628 !important;
      }
      .roi-info strong {
        color: #0A1628 !important;
      }
      .tier-badge.essential { background: #e0f2fe !important; color: #0284c7 !important; border: 1px solid #bae6fd !important; }
      .tier-badge.performance { background: #D8E8FF !important; color: #0D2847 !important; border: 1px solid #B8D4FF !important;}
      .tier-badge.luxury { background: #f3e8ff !important; color: #6b21a8 !important; border: 1px solid #e9d5ff !important;}
    }