
    :root {
      --primary: #20D094;
      --primary-hover: #1ab882;
      --bg: #f3f4f6;
      --surface: #ffffff;
      --border: #e5e7eb;
      --text: #1f2937;
      --text-muted: #6b7280;
      --danger: #ef4444;
      --success: #10b981;
    }

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

    input[type="checkbox"] {
      accent-color: var(--primary);
      width: 15px;
      height: 15px;
      cursor: pointer;
    }

    body,
    button,
    input,
    select,
    textarea {
      font-family: 'Inter', sans-serif;
    }

    body {
      background: var(--bg);
      color: var(--text);
      height: 100vh;
      display: flex;
      flex-direction: column;
      overflow: hidden;
    }

    /* Layout */
    .app-container {
      display: flex;
      flex: 1;
      overflow: hidden;
    }

    .product-tabs-bar {
      height: 64px;
      padding: 0 16px;
      background: #fff;
      border-bottom: 1px solid var(--border);
      display: flex;
      align-items: center;
      gap: 8px;
      overflow: hidden;
      flex-shrink: 0;
    }

    .product-tab {
      padding: 6px 14px;
      border: 1px solid var(--border);
      border-radius: 6px;
      background: #f9fafb;
      font-size: 0.85rem;
      font-weight: 500;
      cursor: pointer;
      display: flex;
      align-items: center;
      gap: 8px;
      transition: all 0.2s;
    }

    .product-tab.active {
      background: var(--primary);
      color: #fff;
      border-color: var(--primary);
    }

    .add-product-btn {
      width: 32px;
      height: 32px;
      display: flex;
      align-items: center;
      justify-content: center;
      background: #f3f4f6;
      border: 1px dashed #d1d5db;
      border-radius: 6px;
      cursor: pointer;
      color: #6b7280;
    }

    .add-product-btn:hover {
      background: #e5e7eb;
      color: var(--text);
    }

    .tab-actions {
      display: flex;
      gap: 4px;
      margin-left: 4px;
      border-left: 1px solid rgba(0, 0, 0, 0.1);
      padding-left: 4px;
    }

    .tab-btn-icon {
      padding: 2px;
      border-radius: 3px;
      display: flex;
      align-items: center;
      justify-content: center;
    }

    .tab-btn-icon:hover {
      background: rgba(0, 0, 0, 0.1);
    }

    .sidebar {
      width: 480px;
      background: var(--surface);
      border-right: 1px solid var(--border);
      display: flex;
      flex-direction: row;
      flex-shrink: 0;
      z-index: 10;
      box-shadow: 4px 0 24px rgba(0, 0, 0, 0.02);
    }

    /* Vertical Icon Nav Rail */
    .side-nav {
      width: 64px;
      background: var(--surface);
      display: flex;
      flex-direction: column;
      align-items: center;
      padding: 6px 0;
      border-right: 1px solid var(--border);
      flex-shrink: 0;
    }

    .side-nav-btn {
      width: 52px;
      height: 54px;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      gap: 4px;
      border: none;
      background: transparent;
      color: var(--text-muted);
      cursor: pointer;
      border-radius: 10px;
      margin: 2px 0;
      transition: all 0.18s;
      padding: 0;
    }

    .side-nav-btn:hover {
      background: #f3f4f6;
      color: var(--text);
    }

    .side-nav-btn.active {
      background: rgba(32, 208, 148, 0.12);
      color: var(--primary);
    }

    .side-nav-btn svg {
      width: 18px;
      height: 18px;
      flex-shrink: 0;
    }

    .side-nav-btn .nav-label {
      font-size: 0.55rem;
      font-weight: 600;
      letter-spacing: 0.02em;
      text-transform: uppercase;
      line-height: 1;
    }

    /* Content Panel beside icon nav */
    .sidebar-panel {
      flex: 1;
      display: flex;
      flex-direction: column;
      overflow: hidden;
    }

    .main-content {
      flex: 1;
      position: relative;
      display: flex;
      flex-direction: column;
      overflow: hidden;
    }

    /* Header */
    header.top-bar {
      height: 60px;
      background: var(--surface);
      border-bottom: 1px solid var(--border);
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding: 0 24px;
      flex-shrink: 0;
    }

    .brand {
      font-weight: 700;
      font-size: 1.25rem;
      color: var(--text);
      display: flex;
      align-items: center;
      gap: 10px;
    }

    /* Legacy tabs-nav hidden – replaced by side-nav */
    .tabs-nav {
      display: none;
    }

    /* Content */
    .tab-content {
      flex: 1;
      overflow-y: auto;
      padding: 24px;
    }

    .tab-pane {
      display: none;
      animation: fadeIn 0.3s ease;
    }

    .tab-pane.active {
      display: block;
    }

    @keyframes fadeIn {
      from {
        opacity: 0;
        transform: translateY(5px);
      }

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

    /* Form Elements */
    .form-group {
      margin-bottom: 20px;
    }

    .form-label {
      display: block;
      font-size: 0.875rem;
      font-weight: 500;
      margin-bottom: 6px;
      color: var(--text);
    }

    .form-control {
      width: 100%;
      padding: 10px 12px;
      border: 1px solid var(--border);
      border-radius: 6px;
      font-family: inherit;
      font-size: 0.95rem;
      transition: border-color 0.15s;
    }

    /* Features List */
    .feature-item {
      background: #f9fafb;
      border: 1px solid #e5e7eb;
      padding: 12px;
      border-radius: 6px;
      margin-bottom: 10px;
    }

    .feature-item-header {
      display: flex;
      justify-content: space-between;
      margin-bottom: 8px;
    }

    .grid-2 {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 16px;
    }

    /* Radio Cards */
    .radio-cards {
      display: grid;
      grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
      gap: 10px;
    }

    .radio-card {
      position: relative;
    }

    .radio-card input {
      position: absolute;
      opacity: 0;
    }

    .radio-card-content {
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      padding: 12px 8px;
      border: 1px solid var(--border);
      border-radius: 8px;
      cursor: pointer;
      transition: all 0.2s;
      text-align: center;
      height: 100%;
      font-size: 0.9rem;
    }

    .radio-card input:checked+.radio-card-content {
      border-color: var(--primary);
      background: rgba(37, 99, 235, 0.05);
      color: var(--primary);
      font-weight: 600;
      box-shadow: 0 0 0 1px var(--primary);
    }

    /* Canvas Area */
    .canvas-wrapper {
      flex: 1;
      background: #e5e7eb;
      position: relative;
      display: flex;
      align-items: center;
      justify-content: center;
      overflow: hidden;
      padding: 40px;
    }

    .canvas-container {
      background: #f8fafc;
      box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
      border-radius: 4px;
    }

    /* Bottom Status Bar */
    .status-bar {
      height: auto;
      min-height: 60px;
      background: var(--surface);
      border-top: 1px solid var(--border);
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding: 12px 24px;
      flex-shrink: 0;
    }

    .price-block {
      display: flex;
      flex-direction: column;
    }

    .price-tag {
      font-size: 1.5rem;
      font-weight: 700;
      color: var(--text);
    }

    .price-sub {
      font-size: 0.8rem;
      color: var(--text-muted);
    }

    .btn {
      padding: 10px 20px;
      border-radius: 6px;
      font-weight: 500;
      cursor: pointer;
      display: inline-flex;
      align-items: center;
      gap: 8px;
      transition: all 0.2s;
      border: none;
    }

    .btn-primary {
      background: var(--primary);
      color: white;
    }

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

    .btn-secondary {
      background: white;
      border: 1px solid var(--border);
      color: var(--text);
    }

    .btn-secondary:hover {
      background: #f9fafb;
      border-color: #d1d5db;
    }

    .btn-danger-sm {
      background: #fee2e2;
      color: #991b1b;
      padding: 4px 8px;
      font-size: 0.75rem;
      border-radius: 4px;
      border: none;
      cursor: pointer;
    }

    .alert {
      padding: 12px;
      border-radius: 6px;
      margin-bottom: 16px;
      font-size: 0.9rem;
      border: 1px solid transparent;
    }

    .alert-info {
      background: #eff6ff;
      border-color: #bfdbfe;
      color: #1e40af;
    }

    /* Cost Table in Calc Tab */
    .cost-table {
      width: 100%;
      border-collapse: collapse;
      font-size: 0.9rem;
      margin-top: 10px;
    }

    .cost-table td {
      padding: 8px 0;
      border-bottom: 1px solid #f3f4f6;
    }

    .cost-table .val {
      text-align: right;
      font-weight: 500;
    }

    .cost-table .total-row td {
      border-top: 2px solid #e5e7eb;
      font-weight: 700;
      padding-top: 12px;
      font-size: 1rem;
    }

    /* Modal */
    /* Window Tabs (New Organic Layout) */
    .product-tabs-bar {
      display: flex;
      align-items: center;
      gap: 8px;
      padding: 8px 8px;
      background: var(--surface);
      border-bottom: 1px solid var(--border);
      overflow-x: auto;
      position: relative;
      /* Ensure it doesn't float */
      z-index: 5;
      scrollbar-width: thin;
      scrollbar-color: #cbd5e1 transparent;
    }

    .product-tabs-bar::-webkit-scrollbar {
      height: 4px;
      /* Thin scrollbar */
    }

    .product-tabs-bar::-webkit-scrollbar-track {
      background: transparent;
    }

    .product-tabs-bar::-webkit-scrollbar-thumb {
      background: #cbd5e1;
      border-radius: 10px;
    }

    .product-tabs-bar::-webkit-scrollbar-thumb:hover {
      background: #94a3b8;
    }

    .product-tab {
      display: flex;
      align-items: center;
      gap: 10px;
      padding: 10px 16px;
      background: #f3f4f6;
      border: 1px solid transparent;
      border-radius: 8px;
      font-size: 0.95rem;
      font-weight: 500;
      color: var(--text-muted);
      cursor: pointer;
      transition: all 0.2s;
      user-select: none;
      flex-shrink: 0;
      white-space: nowrap;
    }

    .product-tab:hover {
      background: #e5e7eb;
      color: var(--text);
    }

    .product-tab.active {
      background: white;
      border-color: var(--border);
      color: var(--primary);
      box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    }

    .product-tab .tab-actions {
      display: flex;
      gap: 6px;
      margin-left: 8px;
      opacity: 0.6;
    }

    .product-tab:hover .tab-actions {
      opacity: 1;
    }

    .add-product-btn {
      width: 32px;
      height: 32px;
      display: flex;
      align-items: center;
      justify-content: center;
      background: #f3f4f6;
      border: 1px dashed #d1d5db;
      border-radius: 6px;
      cursor: pointer;
      color: var(--text-muted);
      transition: all 0.2s;
      flex-shrink: 0;
    }

    .add-product-btn:hover {
      background: #e5e7eb;
      color: var(--primary);
      border-color: var(--primary);
    }

    dialog::backdrop {
      background: rgba(0, 0, 0, 0.5);
    }

    @media print {
      body * {
        visibility: hidden;
      }

      #techModal,
      #techModal * {
        visibility: visible;
      }

      #techModal {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        max-width: 100% !important;
        margin: 0;
        padding: 0;
        border: none;
        box-shadow: none;
        background: white;
      }

      #techModal button,
      .btn {
        display: none !important;
      }

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

    /* Shape Previews Global Fix */
    .shape-preview {
      border: none !important;
      box-shadow: none !important;
    }

    /* Hide Spinners in Number Inputs */
    input::-webkit-outer-spin-button,
    input::-webkit-inner-spin-button {
      -webkit-appearance: none;
      margin: 0;
    }

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

    /* --- MOBILE RESPONSIVENESS --- */
    @media (max-width: 900px) {
      .app-container {
        flex-direction: column;
        overflow-y: auto;
      }

      header.top-bar {
        height: auto;
        padding: 10px 16px;
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
      }

      .top-bar .brand {
        width: 100%;
        justify-content: flex-start;
      }

      .top-bar .header-actions {
        width: 100%;
        justify-content: space-between;
        gap: 8px !important;
      }

      .top-bar .btn {
        padding: 8px 12px;
        font-size: 0.8rem;
        flex: 1;
        justify-content: center;
      }

      /* Hide system tools on very small screens to save space */
      .system-tools {
        display: none !important;
      }

      .sidebar {
        width: 100%;
        height: auto;
        flex-direction: column;
        border-right: none;
        border-bottom: 1px solid var(--border);
        order: 2; /* Move below canvas */
      }

      .side-nav {
        width: 100%;
        height: auto;
        flex-direction: row;
        padding: 4px;
        border-right: none;
        border-bottom: 1px bottom solid var(--border);
        overflow-x: auto;
        justify-content: flex-start;
        gap: 4px;
      }

      .side-nav-btn {
        width: 60px;
        height: 54px;
        flex-shrink: 0;
      }

      .sidebar-panel {
        height: auto;
        min-height: 400px;
      }

      .main-content {
        order: 1;
        height: 450px;
        flex: none;
      }

      .canvas-container {
        min-height: 350px !important;
        width: 100%;
      }

      .canvas-wrapper {
        padding: 12px;
      }

      .status-bar {
        padding: 16px;
        flex-direction: column;
        gap: 16px;
        position: sticky;
        bottom: 0;
        z-index: 20;
        box-shadow: 0 -4px 12px rgba(0,0,0,0.05);
      }

      .status-bar .price-block {
        align-items: center;
        width: 100%;
      }

      .status-bar .btn {
        width: 100%;
        justify-content: center;
      }

      /* Fix modals on mobile */
      dialog {
        width: 95% !important;
        max-height: 90vh !important;
      }

      .shape-grid {
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 12px !important;
      }
    }

    @media (max-width: 480px) {
      .shape-grid {
        grid-template-columns: repeat(2, 1fr) !important;
      }

      .radio-cards {
        grid-template-columns: repeat(2, 1fr) !important;
      }
    }
  

/* --- Extracted Style --- */


                .hw-side-btn {
                  display: flex; align-items: center; gap: 8px; padding: 8px 12px; border: 1px solid #e2e8f0;
                  border-radius: 8px; font-size: 13px; font-weight: 500; cursor: pointer; transition: all 0.2s;
                  background: white;
                }
                .hw-side-btn:hover { background: #f8fafc; border-color: var(--primary); }
                .hw-side-btn:has(input:checked) { background: #eff6ff; border-color: var(--primary); color: var(--primary); }
                .hw-side-btn input { width: 16px; height: 16px; margin: 0; }
              

/* --- Extracted Style --- */


    .shape-grid {
      display: grid;
      grid-template-columns: repeat(5, 1fr);
      gap: 16px;
      width: 100%;
    }

    .shape-card {
      cursor: pointer;
      padding: 0;
      border: none;
      background: transparent;
      transition: transform 0.1s;
      display: flex;
      flex-direction: column;
      align-items: center;
    }

    .shape-card:hover {
      transform: scale(1.05);
      border: none;
      box-shadow: none;
    }

    .shape-preview {
      width: 70px;
      height: 70px;
      background: #bae6fd;
      /* Simulate 2px border using drop-shadows.
         Note: clip-path applies to the element. Drop-shadow works on the resulting shape. */
      filter:
        drop-shadow(1.5px 0 0 #000) drop-shadow(-1.5px 0 0 #000) drop-shadow(0 1.5px 0 #000) drop-shadow(0 -1.5px 0 #000);
    }

    .shape-preview::after {
      content: '';
      position: absolute;
      top: 3px;
      left: 3px;
      right: 3px;
      bottom: 3px;
      background: #bae6fd;
      /* The clip-path needs to be on the PARENT to clip the black, 
         and the user needs to see the shape. 
         If I put clip-path on .shape-preview, it clips the whole box.
         If I put padding, the inner area is the "fill".
         So: .shape-preview { background: black; clip-path: polygon(...) }
         .shape-preview::after { background: blue; clip-path: polygon(... same ...) } -> No, ::after is inside.
         Actually, if I put clip-path on .shape-preview, the whole square becomes the shape. 
         The background is black. 
         I need a generic way to make the "inner" blue part smaller to create a border.
         Scaling the inner clip-path? Hard with polygon coordinates.
         
         Alternative: `filter: drop-shadow` on a transparent div?
         .shape-preview { background: blue; clip-path: ...; filter: drop-shadow(0 0 0 3px black); } -> Doesn't work well for stroke.
         
         Let's just use the blue shapes for now without the thick black border if it's too complex for CSS-only, 
         OR, just use the `border: 2px solid black` on the rectangular card if it looks okay?
         The user's image showing borders *on the shape* is key.
         
         Let's try to pass the clip-path string to the style and use `clip-path` on the element 
         and `box-shadow` inset? No.
         
         Let's try SVGs! It's cleaner. I will wrap each in an <svg>. 
         But I just wrote HTML with `div` and `clip-path`.
         
         Okay, I will just style them as blue shapes for now. The black border is a "nice to have" but the *shape* is critical.
         I'll add a `border: 1px solid #333` to the CARD for definition if needed, 
         but the reference shows the shapes floating.
         
         Let's stick to: .shape-preview has the clip-path and background blue.
         I'll add `filter: drop-shadow(0 0 1px #000)` to give edge definition.
      */
    }

    .shape-preview-inner {
      width: 100%;
      height: 100%;
      background: #bae6fd;
    }

    .shape-name {
      display: none;
      /* Hide labels as per visual reference */
    }
  

/* --- Extracted Style --- */


          .tech-page { width: 800px; height: 1130px; padding: 40px; box-sizing: border-box; position: relative; display: flex; flex-direction: column; background: white; color: black; break-inside: avoid; page-break-after: always; }
          .tech-page:last-child { page-break-after: auto; }
          .tech-header { font-size: 20px; font-weight: bold; padding-bottom: 20px; border-bottom: 3px solid #000; margin-bottom: 25px; display: flex; justify-content: space-between; align-items: flex-end; }
          .tech-title { font-size: 28px; font-weight: 900; text-transform: uppercase; letter-spacing: 0.5px; }
          .tech-row { display: flex; width: 100%; gap: 30px; margin-bottom: 25px; }
          .tech-col { flex: 1; display: flex; flex-direction: column; }
          .tech-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; font-size: 16px; margin-bottom: 20px; }
          .tech-label { color: #64748b; font-size: 14px; margin-bottom: 4px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px;}
          .tech-val { font-size: 20px; font-weight: 800; color: #0f172a;}
          .tech-box { border: 2px solid #e2e8f0; padding: 20px; border-radius: 12px; background: #f8fafc; margin-bottom: 20px; }
          
          .remnant-box { background: #f0fdf4; border: 2px dashed #16a34a; padding: 15px; border-radius: 8px; text-align: center; margin-top: 15px;}
          .remnant-title { font-size: 14px; color: #166534; font-weight: 800; text-transform: uppercase; margin-bottom: 8px; letter-spacing: 0.5px;}
          .remnant-val { font-size: 22px; font-weight: 900; color: #14532d; }
          
          .seam-box { background: #fef2f2; border: 2px dashed #ef4444; padding: 15px; border-radius: 8px; text-align: center; margin-top: 15px;}
          .seam-title { font-size: 20px; color: #991b1b; font-weight: 900; text-transform: uppercase; }
          
          .cut-img-container { flex: 1.2; display:flex; justify-content:center; align-items:center; background:#ffffff; border: 2px solid #e2e8f0; border-radius:12px; padding: 20px; min-height: 480px; }
          .cut-img-container img { max-width: 100%; max-height: 100%; object-fit: contain; }
          
          .hw-list { list-style: none; padding: 0; margin: 0; }
          .hw-list li { font-size: 15px; font-weight: 600; color: #1e293b; margin-bottom: 8px; display: flex; align-items: center;}
          .hw-list li span.val { color: #2563eb; margin-left: auto; font-size: 18px; font-weight: 800;}
        

/* --- Extracted Style --- */


          .pdf-page { width: 1100px; height: 740px; overflow: hidden; padding: 40px; box-sizing: border-box; position: relative; display: flex; flex-direction: column; background: white; color: black; font-family: 'Inter', sans-serif; }
          .pdf-row { display: flex; flex-direction: row; height: 100%; }
          .pdf-col-left { flex: 1.2; padding-right: 40px; display: flex; flex-direction: column; }
          .pdf-col-right { flex: 0.8; padding-left: 40px; border-left: 1px solid #ddd; display: flex; flex-direction: column; }
          .pdf-info-grid { display: grid; grid-template-columns: 140px 1fr; row-gap: 12px; margin-top: 30px; font-size: 14px; }
          .pdf-info-grid span:first-child { color: #555; }
          .pdf-subhed { font-size: 18px; font-weight: bold; margin-top: 20px; margin-bottom: 10px; }
          .pdf-list-item { font-size: 13px; margin-bottom: 8px; padding-left: 15px; }
        