    /* Prevent swipe-to-navigate gestures */
    html, body {
      overscroll-behavior-x: none;
      overscroll-behavior-y: auto;
    }

    .damage-container {
      max-width: 1400px;
      margin: 0 auto;
      padding: 20px;
      box-sizing: border-box;
    }

    .damage-header {
      margin-bottom: 20px;
    }

    .brand {
      font-size: 24px;
      font-weight: 700;
      color: var(--text);
      margin: 0 0 4px 0;
    }

    .brand-subtitle {
      font-size: 13px;
      color: var(--muted);
    }

    .main-content {
      display: grid;
      grid-template-columns: 1fr 350px;
      gap: 20px;
      margin-bottom: 20px;
    }

    .builder-section {
      background: var(--card);
      border: 1px solid var(--border);
      border-radius: 12px;
      padding: 20px;
      box-shadow: var(--shadow-light);
      max-width: 100%;
      overflow: hidden;
    }

    .section-title {
      font-size: 18px;
      font-weight: 600;
      color: var(--text);
      margin: 0 0 16px 0;
      padding-bottom: 12px;
      border-bottom: 1px solid var(--border);
    }

    /* Recent Parts Styles */
    .recent-parts {
      margin-bottom: 12px;
      padding: 8px 10px;
      background: rgba(59, 130, 246, 0.03);
      border-bottom: 1px solid rgba(59, 130, 246, 0.1);
    }

    .recent-parts-label {
      font-size: 10px;
      font-weight: 600;
      color: var(--muted);
      text-transform: uppercase;
      letter-spacing: 0.5px;
      margin-bottom: 6px;
    }

    .recent-parts-grid {
      display: flex;
      gap: 4px;
      flex-wrap: wrap;
    }

    .recent-part-chip {
      padding: 4px 8px;
      background: transparent;
      border: 1px solid rgba(59, 130, 246, 0.2);
      border-radius: 4px;
      font-size: 11px;
      font-weight: 600;
      color: #2563eb;
      cursor: pointer;
      transition: all 0.15s;
      white-space: nowrap;
    }

    .recent-part-chip:hover {
      background: rgba(59, 130, 246, 0.1);
      border-color: rgba(59, 130, 246, 0.3);
      transform: translateY(-1px);
    }

    .recent-part-chip:active {
      transform: translateY(0);
    }

    /* Category Selection Styles */
    .category-grid {
      display: grid;
      grid-template-columns: repeat(3, 1fr);
      gap: 10px;
      margin-bottom: 16px;
    }

    .category-button {
      padding: 14px 10px;
      border: 1px solid var(--border);
      background: var(--card);
      color: var(--text);
      border-radius: 6px;
      cursor: pointer;
      transition: all 0.2s;
      text-align: center;
      font-weight: 600;
      font-size: 13px;
    }

    .category-button:hover {
      border-color: var(--primary-500);
      background: rgba(59, 130, 246, 0.05);
    }

    .category-button.active {
      border-color: var(--primary-500);
      background: rgba(59, 130, 246, 0.1);
      color: var(--primary-500);
      box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
    }

    .category-icon {
      width: 40px;
      height: 40px;
      display: block;
      margin: 0 auto 6px auto;
      object-fit: contain;
      filter: invert(1) brightness(1.2) drop-shadow(0 0 4px rgba(255, 255, 255, 0.3));
      opacity: 0.7;
      transition: all 0.3s ease;
    }

    /* Light mode: don't invert icons */
    [data-theme="light"] .category-icon {
      filter: invert(0) brightness(0.3) drop-shadow(0 0 4px rgba(0, 0, 0, 0.2));
    }

    .category-button:hover .category-icon {
      filter: invert(1) brightness(1.3) drop-shadow(0 0 8px rgba(59, 130, 246, 0.6));
      opacity: 1;
      transform: scale(1.05);
    }

    [data-theme="light"] .category-button:hover .category-icon {
      filter: invert(0) brightness(0.2) drop-shadow(0 0 8px rgba(59, 130, 246, 0.6));
    }

    .category-button.active .category-icon {
      filter: invert(1) brightness(1.5) drop-shadow(0 0 12px rgba(59, 130, 246, 0.8)) drop-shadow(0 0 20px rgba(59, 130, 246, 0.4));
      opacity: 1;
    }

    [data-theme="light"] .category-button.active .category-icon {
      filter: invert(0) brightness(0.15) drop-shadow(0 0 12px rgba(59, 130, 246, 0.8)) drop-shadow(0 0 20px rgba(59, 130, 246, 0.4));
    }

    /* Part Selection within Category */
    .parts-list {
      display: none;
      margin-top: 12px;
      padding-top: 12px;
      border-top: 1px dashed var(--border);
    }

    .parts-list.show {
      display: block;
    }

    .parts-grid {
      display: grid;
      gap: 6px;
    }

    .part-button {
      padding: 10px 12px;
      border: 1px solid var(--border);
      background: var(--card);
      color: var(--text);
      border-radius: 6px;
      cursor: pointer;
      transition: all 0.2s;
      text-align: left;
      font-size: 13px;
      font-weight: 500;
    }

    .part-button:hover {
      border-color: var(--primary-500);
      background: rgba(59, 130, 246, 0.05);
    }

    .part-button.selected {
      border-color: var(--ok);
      background: rgba(34, 197, 94, 0.1);
      color: #15803d;
      font-weight: 600;
    }

    .part-button.highlighted-option {
      animation: multiPulse 2s ease-in-out infinite;
      border: 2px solid #3b82f6 !important;
      box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
    }

    @keyframes multiPulse {
      0%, 100% { box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2); }
      50% { box-shadow: 0 0 0 6px rgba(59, 130, 246, 0.4); }
    }

    /* Selected Part Display */
    .selected-part-display {
      display: none;
      padding: 10px 12px;
      background: rgba(34, 197, 94, 0.1);
      border: 1px solid rgba(34, 197, 94, 0.2);
      color: #15803d;
      border-radius: 6px;
      margin-bottom: 16px;
      font-weight: 600;
      font-size: 13px;
      align-items: center;
      justify-content: space-between;
    }

    .selected-part-display.show {
      display: flex;
    }

    .change-part-btn {
      padding: 4px 10px;
      background: rgba(34, 197, 94, 0.2);
      color: #15803d;
      border: none;
      border-radius: 4px;
      font-size: 11px;
      font-weight: 600;
      cursor: pointer;
      transition: all 0.2s;
    }

    .change-part-btn:hover {
      background: rgba(34, 197, 94, 0.3);
    }

    /* View Diagram Button */
    .view-diagram-inline {
      width: 100%;
      padding: 16px 20px;
      background: linear-gradient(135deg, rgba(59, 130, 246, 0.15), rgba(59, 130, 246, 0.1));
      color: #1d4ed8;
      border: 2px solid rgba(59, 130, 246, 0.3);
      border-radius: 8px;
      font-size: 15px;
      font-weight: 700;
      cursor: pointer;
      transition: all 0.2s;
      margin: 20px 0;
      display: none;
      box-shadow: 0 2px 8px rgba(59, 130, 246, 0.15);
      letter-spacing: 0.3px;
    }

    .view-diagram-inline.show {
      display: block;
    }

    .view-diagram-inline:hover {
      background: linear-gradient(135deg, rgba(59, 130, 246, 0.25), rgba(59, 130, 246, 0.15));
      border-color: rgba(59, 130, 246, 0.4);
      box-shadow: 0 4px 12px rgba(59, 130, 246, 0.25);
      transform: translateY(-1px);
    }

    .view-diagram-inline:active {
      transform: translateY(0);
    }

    /* Diagram Helper Text - HIDDEN (replaced with inline diagram) */
    .diagram-helper-text {
      display: none !important; /* Removed notification - diagram now shows inline */
    }

    /* Inline Zone Diagram (Mobile) */
    .zone-diagram-inline {
      width: 100%;
      max-width: 400px;
      margin: 0 auto 16px auto;
      border-radius: 8px;
      border: 2px solid var(--border);
      background: var(--card);
      padding: 8px;
      box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
      display: none; /* Hidden by default, shown via JS */
    }

    .zone-diagram-inline img {
      width: 100%;
      height: auto;
      display: block;
      border-radius: 4px;
    }

    .zone-diagram-inline.show {
      display: block;
    }

    /* Hide inline diagram on desktop */
    @media (min-width: 769px) {
      .zone-diagram-inline {
        display: none !important;
      }
    }

    /* Floating Diagram Button (Mobile) - HIDDEN (replaced with inline diagram) */
    .floating-diagram-btn {
      display: none !important; /* Removed FAB - diagram now shows inline */
    }

    /* Hide inline button on mobile, show floating button */
    @media (max-width: 768px) {
      .view-diagram-inline {
        display: none !important;
      }
    }

    .diagram-overlay {
      position: fixed;
      top: 0;
      left: 0;
      right: 0;
      bottom: 0;
      background: rgba(0, 0, 0, 0.85);
      z-index: 1000;
      display: none;
      align-items: center;
      justify-content: center;
      padding: 20px;
    }

    .diagram-overlay.active {
      display: flex;
    }

    .diagram-modal {
      background: white;
      border-radius: 12px;
      max-width: 90vw;
      max-height: 90vh;
      overflow: auto;
      position: relative;
      box-shadow: var(--shadow-large);
    }

    .diagram-modal img {
      width: 100%;
      height: auto;
      display: block;
    }

    .close-diagram {
      position: absolute;
      top: 10px;
      right: 10px;
      background: var(--danger);
      color: white;
      border: none;
      border-radius: 50%;
      width: 40px;
      height: 40px;
      font-size: 24px;
      cursor: pointer;
      box-shadow: var(--shadow-medium);
      transition: all 0.2s;
    }

    .close-diagram:hover {
      background: #dc2626;
      transform: scale(1.1);
    }

    .form-group {
      margin-bottom: 16px;
      max-width: 100%;
      overflow: hidden;
    }

    .form-label {
      display: block;
      font-weight: 600;
      color: var(--text);
      margin-bottom: 8px;
      font-size: 13px;
    }

    /* Recent Damage Types */
    .recent-damage {
      margin-bottom: 12px;
      padding: 8px 10px;
      background: rgba(249, 115, 22, 0.03);
      border-bottom: 1px solid rgba(249, 115, 22, 0.1);
    }

    .recent-damage-label {
      font-size: 10px;
      font-weight: 600;
      color: var(--muted);
      text-transform: uppercase;
      letter-spacing: 0.5px;
      margin-bottom: 6px;
    }

    .recent-damage-grid {
      display: flex;
      gap: 4px;
      flex-wrap: wrap;
    }

    .recent-damage-chip {
      padding: 4px 8px;
      background: transparent;
      border: 1px solid rgba(249, 115, 22, 0.2);
      border-radius: 4px;
      font-size: 11px;
      font-weight: 600;
      color: #ea580c;
      cursor: pointer;
      transition: all 0.15s;
      white-space: nowrap;
    }

    .recent-damage-chip:hover {
      background: rgba(249, 115, 22, 0.1);
      border-color: rgba(249, 115, 22, 0.3);
      transform: translateY(-1px);
    }

    .recent-damage-chip:active {
      transform: translateY(0);
    }

    /* Damage Type Grid */
    .damage-type-grid {
      display: grid;
      grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
      gap: 8px;
    }

    .damage-type-button {
      padding: 12px 10px;
      border: 1px solid var(--border);
      background: var(--card);
      color: var(--text);
      border-radius: 6px;
      cursor: pointer;
      transition: all 0.2s;
      text-align: center;
    }

    .damage-type-button:hover {
      border-color: var(--primary-500);
      background: rgba(59, 130, 246, 0.05);
    }

    .damage-type-button.active {
      border-color: #ea580c;
      background: rgba(249, 115, 22, 0.1);
      color: #ea580c;
      box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.1);
    }

    .damage-type-code {
      font-size: 20px;
      font-weight: 700;
      margin-bottom: 2px;
      font-family: 'Courier New', monospace;
    }

    .damage-type-name {
      font-size: 11px;
      font-weight: 500;
      opacity: 0.8;
    }

    .damage-type-button.hidden {
      display: none;
    }

    /* Context SVG Display for Step 3 (inline version inside damageTypeGroup) */
    /* Hidden on desktop - only show on mobile during Step 3 */
    .damage-step-context-inline {
      display: none;
    }

    @media (max-width: 768px) {
      .damage-step-context-inline {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        padding: 0;
        flex: 1;
        /* Fill the space between breadcrumb and fixed damage selector */
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
      }
    }

    .context-svg-container {
      position: relative;
      width: 100%;
      height: 100%;
      max-width: none;
      max-height: none;
      margin-bottom: 0;
      display: flex;
      align-items: center;
      justify-content: center;
    }

    .context-svg-image {
      width: 100%;
      height: 100%;
      object-fit: contain;
      opacity: 0.85;
    }

    .context-svg-overlay {
      position: absolute;
      top: 0;
      left: 0;
      right: 0;
      bottom: 0;
      pointer-events: none;
    }

    .context-info {
      display: flex;
      gap: 8px;
      align-items: center;
      font-size: 14px;
      /* Position as overlay on bottom of SVG */
      position: absolute;
      bottom: 12px;
      left: 50%;
      transform: translateX(-50%);
      background: rgba(0, 0, 0, 0.7);
      padding: 8px 16px;
      border-radius: 20px;
      backdrop-filter: blur(8px);
      z-index: 10;
    }

    .context-part {
      font-weight: 600;
      color: #fff;
    }

    .context-zone {
      color: #3b82f6;
      font-weight: 600;
    }

    /* Fixed Bottom Damage Selector - Mobile only */
    .damage-selector-fixed {
      display: none; /* Hidden by default on desktop */
    }

    @media (max-width: 768px) {
      .damage-selector-fixed {
        display: none; /* Hidden by default, shown via JS when Step 3 is active */
        position: fixed;
        bottom: 108px; /* Above sticky footer */
        left: 0;
        right: 0;
        z-index: 50;
        background: var(--bg);
        padding: 8px 12px 12px;
        border-top: 1px solid var(--border);
      }

      .damage-selector-fixed.show {
        display: block;
      }
    }

    .damage-search-fixed {
      position: relative;
      margin-bottom: 10px;
    }

    .damage-search-fixed .damage-search-input {
      width: 100%;
      padding: 10px 40px 10px 14px;
      border: 1px solid var(--border);
      border-radius: 20px;
      background: var(--card);
      color: var(--text);
      font-size: 14px;
      outline: none;
    }

    .damage-search-fixed .damage-search-input:focus {
      border-color: var(--primary-500);
    }

    .damage-search-fixed .search-clear-btn {
      position: absolute;
      right: 8px;
      top: 50%;
      transform: translateY(-50%);
      background: none;
      border: none;
      color: var(--muted);
      font-size: 20px;
      cursor: pointer;
      padding: 4px 8px;
      display: none;
    }

    .damage-search-fixed .search-clear-btn.show {
      display: block;
    }

    /* Grouped Damage Type Pills */
    .damage-type-groups {
      display: flex;
      flex-direction: column;
      gap: 8px;
    }

    .damage-group {
      display: flex;
      flex-direction: column;
      gap: 4px;
    }

    .damage-group-label {
      font-size: 10px;
      font-weight: 600;
      text-transform: uppercase;
      letter-spacing: 0.5px;
      color: var(--muted);
      padding-left: 6px;
    }

    .damage-group-strip-wrapper {
      position: relative;
      /* Inset/recessed track effect */
      background: rgba(0, 0, 0, 0.25);
      border-radius: 24px;
      padding: 6px 0 6px 6px;
      box-shadow:
        inset 0 2px 4px rgba(0, 0, 0, 0.3),
        inset 0 1px 2px rgba(0, 0, 0, 0.2);
    }

    /* Right fade indicator - shows there's more to scroll */
    .damage-group-strip-wrapper::after {
      content: '';
      position: absolute;
      top: 6px;
      right: 0;
      bottom: 6px;
      width: 50px;
      background: linear-gradient(to right, transparent, rgba(0, 0, 0, 0.35));
      border-radius: 0 24px 24px 0;
      pointer-events: none;
      opacity: 1;
      transition: opacity 0.2s;
    }

    /* Hide fade when scrolled to end */
    .damage-group-strip-wrapper.scrolled-end::after {
      opacity: 0;
    }

    .damage-group-strip {
      display: flex;
      flex-wrap: nowrap;
      gap: 8px;
      overflow-x: auto;
      overflow-y: hidden;
      padding-right: 30px; /* Extra space so last pill isn't under fade */
      -webkit-overflow-scrolling: touch;
      scrollbar-width: none; /* Firefox */
      -ms-overflow-style: none; /* IE/Edge */
    }

    .damage-group-strip::-webkit-scrollbar {
      display: none; /* Chrome/Safari */
    }

    .damage-pill {
      display: flex;
      align-items: center;
      gap: 6px;
      padding: 8px 14px;
      border: 1px solid rgba(255, 255, 255, 0.1);
      background: var(--card);
      color: var(--text);
      border-radius: 18px;
      cursor: pointer;
      transition: all 0.2s;
      font-family: inherit;
      min-height: 36px;
      flex-shrink: 0; /* Don't shrink in scroll container */
      /* Raised/floating effect */
      box-shadow:
        0 2px 4px rgba(0, 0, 0, 0.2),
        0 1px 2px rgba(0, 0, 0, 0.15);
    }

    .damage-pill:hover {
      border-color: var(--primary-500);
      background: rgba(59, 130, 246, 0.15);
      transform: translateY(-1px);
      box-shadow:
        0 4px 8px rgba(0, 0, 0, 0.25),
        0 2px 4px rgba(0, 0, 0, 0.2);
    }

    .damage-pill:active {
      transform: translateY(1px);
      box-shadow:
        0 1px 2px rgba(0, 0, 0, 0.2);
    }

    .damage-pill.active {
      border-color: #ea580c;
      background: linear-gradient(135deg, rgba(249, 115, 22, 0.2), rgba(234, 88, 12, 0.15));
      color: #fb923c;
      box-shadow:
        0 2px 4px rgba(0, 0, 0, 0.2),
        0 0 0 2px rgba(249, 115, 22, 0.3);
    }

    .damage-pill .pill-code {
      font-size: 14px;
      font-weight: 700;
      font-family: 'Courier New', monospace;
      min-width: 14px;
      text-align: center;
    }

    .damage-pill .pill-name {
      font-size: 12px;
      font-weight: 500;
      white-space: nowrap;
    }

    .damage-pill.hidden {
      display: none;
    }

    /* Mobile Bottom Sheet for Damage Types */
    .damage-type-backdrop {
      display: none;
      position: fixed;
      top: 0;
      left: 0;
      right: 0;
      bottom: 0;
      background: rgba(0, 0, 0, 0.5);
      z-index: 998;
      opacity: 0;
      transition: opacity 0.3s ease;
    }

    .damage-type-backdrop.show {
      display: block;
      opacity: 1;
    }

    /* Progressive Disclosure Breadcrumb Navigation */
    .breadcrumb-nav {
      display: none;
      position: sticky;
      top: 0;
      background: var(--card);
      border-bottom: 1px solid var(--border);
      padding: 8px 12px;
      margin: 0;
      z-index: 100;
    }

    .breadcrumb-items {
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 6px;
      font-size: 12px;
      font-weight: 600;
      overflow-x: auto;
      -webkit-overflow-scrolling: touch;
    }

    .breadcrumb-items::-webkit-scrollbar {
      display: none;
    }

    .breadcrumb-item {
      display: flex;
      align-items: center;
      justify-content: center;
      color: var(--muted);
      white-space: nowrap;
      flex-shrink: 0;
      padding: 4px 8px;
      border-radius: 4px;
      transition: all 0.15s;
      background: transparent;
      min-width: 36px;
    }

    .breadcrumb-item.active {
      color: var(--text);
      background: rgba(59, 130, 246, 0.1);
      font-weight: 700;
      border: 1px solid rgba(59, 130, 246, 0.3);
    }

    .breadcrumb-item.completed {
      color: var(--text);
      cursor: pointer;
      transition: all 0.15s;
      background: rgba(34, 197, 94, 0.08);
      border: 1px solid rgba(34, 197, 94, 0.2);
      font-weight: 600;
    }

    .breadcrumb-item.completed:hover {
      background: rgba(34, 197, 94, 0.15);
      border-color: rgba(34, 197, 94, 0.4);
    }

    .breadcrumb-item.completed:active {
      transform: scale(0.98);
    }

    .breadcrumb-separator {
      color: var(--muted);
      font-size: 12px;
      font-weight: 400;
      opacity: 0.5;
    }

    /* Dark mode breadcrumb adjustments */
    [data-theme="dark"] .breadcrumb-item.active {
      background: rgba(59, 130, 246, 0.2);
      border-color: rgba(59, 130, 246, 0.4);
    }

    [data-theme="dark"] .breadcrumb-item.completed {
      background: rgba(34, 197, 94, 0.15);
      border-color: rgba(34, 197, 94, 0.3);
    }

    [data-theme="dark"] .breadcrumb-item.completed:hover {
      background: rgba(34, 197, 94, 0.25);
      border-color: rgba(34, 197, 94, 0.5);
    }

    /* Sticky Code Footer (Mobile) - Data-Dense 2-Row Layout */
    .sticky-code-footer {
      display: none;
      position: fixed;
      bottom: 0;
      left: 0;
      right: 0;
      background: linear-gradient(180deg, rgba(34, 197, 94, 0.08), rgba(22, 163, 74, 0.05));
      border-top: 3px solid rgba(34, 197, 94, 0.4);
      padding: 10px 16px 12px 16px;
      z-index: 100;
      box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.1);
      backdrop-filter: blur(10px);
    }

    /* Row 1: Codes (large) + Copy button (large, prominent) */
    .sticky-code-row-main {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
      margin-bottom: 8px;
    }

    .sticky-code-display {
      font-family: 'Courier New', monospace;
      font-size: 18px;
      font-weight: 700;
      color: var(--text);
      flex: 1;
      word-break: break-all;
      line-height: 1.3;
    }

    .sticky-code-display.empty {
      color: var(--muted);
      font-size: 13px;
      font-family: inherit;
      font-weight: 400;
    }

    .sticky-copy-btn {
      padding: 12px 20px;
      border: 2px solid rgba(59, 130, 246, 0.3);
      border-radius: 8px;
      font-size: 15px;
      font-weight: 700;
      cursor: pointer;
      transition: all 0.2s;
      background: rgba(59, 130, 246, 0.15);
      color: #2563eb;
      white-space: nowrap;
      flex-shrink: 0;
    }

    .sticky-copy-btn:hover:not(:disabled) {
      background: rgba(59, 130, 246, 0.25);
      border-color: rgba(59, 130, 246, 0.4);
      transform: translateY(-1px);
    }

    .sticky-copy-btn:active:not(:disabled) {
      transform: translateY(0);
    }

    .sticky-copy-btn:disabled {
      opacity: 0.4;
      cursor: not-allowed;
    }

    /* Row 2: Part name + hours (small, muted) + Clear button (small, subdued) */
    .sticky-code-row-secondary {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 8px;
    }

    .sticky-code-meta {
      font-size: 12px;
      color: var(--muted);
      font-weight: 500;
      flex: 1;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    .sticky-clear-btn {
      padding: 6px 12px;
      border: 1px solid rgba(239, 68, 68, 0.2);
      border-radius: 6px;
      font-size: 12px;
      font-weight: 600;
      cursor: pointer;
      transition: all 0.2s;
      background: rgba(239, 68, 68, 0.05);
      color: #dc2626;
      white-space: nowrap;
      flex-shrink: 0;
    }

    .sticky-clear-btn:hover:not(:disabled) {
      background: rgba(239, 68, 68, 0.12);
      border-color: rgba(239, 68, 68, 0.3);
    }

    .sticky-clear-btn:disabled {
      opacity: 0.4;
      cursor: not-allowed;
    }

    /* Progressive Disclosure Mobile Layout */
    @media (max-width: 768px) {
      .breadcrumb-nav {
        display: block;
      }

      .sticky-code-footer {
        display: block;
      }

      /* Hide the desktop 2-column layout on mobile */
      .main-content {
        display: block;
      }

      .code-output {
        display: none !important;
      }

      /* Header styling for mobile - Ultra compact */
      .damage-header {
        padding: 8px 12px;
        text-align: center;
        background: var(--card);
        border-bottom: 1px solid var(--border);
        margin: 0;
      }

      .damage-header .brand {
        font-size: 14px;
        font-weight: 600;
        margin: 0;
      }

      .damage-header .brand-subtitle {
        font-size: 10px;
        margin: 0;
        opacity: 0.7;
      }

      .section-title {
        display: none;
      }

      /* Full viewport for steps */
      .damage-container {
        padding: 0;
        margin: 0;
        height: 100vh;
        display: flex;
        flex-direction: column;
        overflow: hidden;
      }

      /* Remove any extra spacing from .app wrapper on mobile */
      .app {
        padding: 0;
        margin: 0;
      }

      .builder-section {
        flex: 1;
        padding: 16px;
        border: none;
        border-radius: 0;
        box-shadow: none;
        display: flex;
        flex-direction: column;
        padding-bottom: 110px; /* Space for footer with buttons */
        overflow-y: auto;
        min-height: 0;
      }

      /* Remove padding when showing zone selector or damage type selector for edge-to-edge display */
      .builder-section:has(#zoneGroup.active-step),
      .builder-section:has(#damageTypeGroup.active-step) {
        padding: 0;
        padding-bottom: 110px;
      }

      /* Step containers - only show active step */
      .form-group {
        display: none !important;
        flex: 1;
        margin-bottom: 0;
      }

      .form-group.active-step {
        display: flex !important;
        flex-direction: column;
      }

      /* Hide legacy desktop add button group on mobile */
      #addButtonGroup {
        display: none !important;
      }

      /* Hide form labels on mobile (breadcrumb shows progress) */
      .form-label {
        display: none;
      }

      /* Make steps fill available space */
      .category-grid,
      .zone-grid,
      .damage-type-grid {
        flex: 1;
        align-content: start;
      }

      /* Make zone group fill full height when SVG selector is active */
      #zoneGroup {
        position: relative;
        padding: 0 !important;
        margin: 0;
      }

      #zoneGroup.active-step {
        /* Fill available space: viewport - topbar(~56px) - breadcrumb(~44px) - footer(~108px) */
        min-height: calc(100vh - 210px);
        height: calc(100vh - 210px);
      }

      #zoneGroup .svg-zone-selector-container {
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        width: 100%;
        height: 100%;
        padding: 0;
      }

      /* Allow SVG to fill available height on mobile */
      .svg-zone-interactive {
        aspect-ratio: unset !important;
        height: 100%;
        width: 100%;
        position: relative;
      }

      .svg-layer-base {
        object-fit: contain;
        width: 100%;
        height: 100%;
      }

      .svg-layer-clickbox svg {
        width: 100%;
        height: 100%;
        object-fit: contain;
      }

      /* Make damage type group fill full height for Step 3 */
      #damageTypeGroup {
        position: relative;
        padding: 0 !important;
      }

      #damageTypeGroup.active-step {
        /* Fill available space between breadcrumb and fixed damage selector */
        /* viewport - topbar(56px) - breadcrumb(44px) - fixed selector(~180px) - footer(108px) */
        min-height: calc(100vh - 390px);
        height: calc(100vh - 390px);
        overflow: hidden;
      }

      /* Slide transitions */
      .form-group.slide-in-right {
        animation: slideInRight 0.3s ease-out;
      }

      .form-group.slide-in-left {
        animation: slideInLeft 0.3s ease-out;
      }

      @keyframes slideInRight {
        from {
          opacity: 0;
          transform: translateX(30px);
        }
        to {
          opacity: 1;
          transform: translateX(0);
        }
      }

      @keyframes slideInLeft {
        from {
          opacity: 0;
          transform: translateX(-30px);
        }
        to {
          opacity: 1;
          transform: translateX(0);
        }
      }

      /* Damage type uses full viewport in progressive disclosure - no bottom sheet needed */
      .damage-type-container {
        position: static;
        transform: none !important;
        padding: 0;
        max-height: none;
        overflow-y: visible;
        box-shadow: none;
        border-radius: 0;
      }

      .damage-type-container::before {
        display: none;
      }

      .damage-type-container > *:first-child {
        margin-top: 0;
      }

      /* Hide the backdrop on mobile progressive disclosure */
      .damage-type-backdrop {
        display: none !important;
      }

      /* Hide the select damage button - not needed with progressive disclosure */
      .select-damage-btn {
        display: none !important;
      }

      /* Hide compact summary displays on mobile - we show full grids with progressive disclosure */
      .selected-zone-display,
      .selected-damage-display {
        display: none !important;
      }

      /* Hide admin footer on mobile */
      .admin-footer {
        display: none !important;
      }
    }

    /* Select Damage Type Button (Mobile) */
    .select-damage-btn {
      width: 100%;
      padding: 14px 20px;
      background: linear-gradient(135deg, #f97316, #ea580c);
      color: white;
      border: none;
      border-radius: 8px;
      font-size: 15px;
      font-weight: 700;
      cursor: pointer;
      transition: all 0.2s;
      box-shadow: 0 4px 12px rgba(249, 115, 22, 0.3);
    }

    .select-damage-btn:hover {
      background: linear-gradient(135deg, #fb923c, #f97316);
      transform: translateY(-2px);
      box-shadow: 0 6px 16px rgba(249, 115, 22, 0.4);
    }

    .select-damage-btn:active {
      transform: translateY(0);
    }

    /* Damage Type Search */
    .damage-type-search {
      margin-bottom: 12px;
      position: relative;
    }

    .damage-search-input {
      width: 100%;
      padding: 10px 40px 10px 12px;
      border: 2px solid var(--border);
      background: var(--card);
      color: var(--text);
      border-radius: 6px;
      font-size: 14px;
      font-weight: 500;
      transition: all 0.2s;
      box-sizing: border-box;
    }

    .damage-search-input:focus {
      outline: none;
      border-color: #ea580c;
      background: var(--bg);
      box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.1);
    }

    .damage-search-input::placeholder {
      color: var(--muted);
      font-weight: 400;
    }

    .search-clear-btn {
      position: absolute;
      right: 8px;
      top: 50%;
      transform: translateY(-50%);
      background: transparent;
      border: none;
      color: var(--muted);
      font-size: 18px;
      cursor: pointer;
      padding: 4px 8px;
      border-radius: 4px;
      transition: all 0.2s;
      display: none;
    }

    .search-clear-btn.show {
      display: block;
    }

    .search-clear-btn:hover {
      background: rgba(239, 68, 68, 0.1);
      color: #dc2626;
    }

    .damage-search-helper {
      font-size: 11px;
      color: var(--muted);
      margin-top: 6px;
      font-style: italic;
    }

    /* Selected Zone Display (Compact) */
    .selected-zone-display {
      display: none;
      padding: 10px 12px;
      background: rgba(59, 130, 246, 0.1);
      border: 1px solid rgba(59, 130, 246, 0.2);
      color: #2563eb;
      border-radius: 6px;
      margin-bottom: 16px;
      font-weight: 600;
      font-size: 13px;
      align-items: center;
      justify-content: space-between;
    }

    .selected-zone-display.show {
      display: flex;
    }

    .change-zone-btn {
      padding: 4px 10px;
      background: rgba(59, 130, 246, 0.2);
      color: #2563eb;
      border: none;
      border-radius: 4px;
      font-size: 11px;
      font-weight: 600;
      cursor: pointer;
      transition: all 0.2s;
    }

    .change-zone-btn:hover {
      background: rgba(59, 130, 246, 0.3);
    }

    /* SVG Zone Selector - Interactive overlaid SVGs */
    .svg-zone-selector-container {
      margin: 0;
      padding: 0;
      background: transparent;
      border: none;
      width: 100%;
    }

    .svg-zone-interactive {
      position: relative;
      width: 100%;
      max-width: 100%;
      margin: 0 auto;
      aspect-ratio: 592 / 748;
    }

    .svg-zone-layer {
      position: absolute;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
    }

    .svg-layer-base {
      pointer-events: none;
      z-index: 1;
    }

    /* Invert SVG in light mode for better visibility */
    [data-theme="light"] .svg-layer-base {
      filter: invert(1) brightness(1.1);
    }

    .svg-layer-clickbox {
      z-index: 2;
      opacity: 0;
    }

    [data-theme="light"] .svg-layer-clickbox {
      filter: invert(1) brightness(1.1);
    }

    /* Zone Grid */
    .zone-grid-container {
      display: block;
    }

    .zone-grid-container.collapsed {
      display: none;
    }

    .zone-grid {
      display: grid;
      grid-template-columns: repeat(auto-fill, minmax(50px, 1fr));
      gap: 8px;
    }

    .zone-button {
      padding: 14px 8px;
      border: 1px solid var(--border);
      background: var(--card);
      color: var(--text);
      border-radius: 6px;
      cursor: pointer;
      transition: all 0.2s;
      font-size: 18px;
      font-weight: 700;
      text-align: center;
      min-width: 50px;
    }

    .zone-button:hover {
      border-color: var(--primary-500);
      background: rgba(59, 130, 246, 0.05);
    }

    .zone-button.active {
      border-color: var(--ok);
      background: rgba(34, 197, 94, 0.1);
      color: #15803d;
      box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.1);
    }

    /* Selected Damage Type Display (Compact) */
    .selected-damage-display {
      display: none;
      padding: 10px 12px;
      background: rgba(249, 115, 22, 0.1);
      border: 1px solid rgba(249, 115, 22, 0.2);
      color: #ea580c;
      border-radius: 6px;
      margin-bottom: 16px;
      font-weight: 600;
      font-size: 13px;
      align-items: center;
      justify-content: space-between;
    }

    .selected-damage-display.show {
      display: flex;
    }

    .change-damage-btn {
      padding: 4px 10px;
      background: rgba(249, 115, 22, 0.2);
      color: #ea580c;
      border: none;
      border-radius: 4px;
      font-size: 11px;
      font-weight: 600;
      cursor: pointer;
      transition: all 0.2s;
    }

    .change-damage-btn:hover {
      background: rgba(249, 115, 22, 0.3);
    }

    /* Damage Type Container */
    .damage-type-container {
      display: block;
    }

    .damage-type-container.collapsed {
      display: none;
    }

    /* Hours Selector Container */
    .hours-selector-container {
      background: var(--card);
      border: 1px solid var(--border);
      border-radius: 12px;
      padding: 20px;
      margin-bottom: 16px;
    }

    /* Hours Stepper Row - Large buttons with center display */
    .hours-stepper-row {
      display: flex;
      align-items: center;
      gap: 12px;
      margin-bottom: 20px;
    }

    .hours-stepper-btn {
      min-width: 44px;
      min-height: 44px;
      padding: 8px;
      border: 2px solid var(--primary-500);
      background: rgba(59, 130, 246, 0.1);
      color: var(--primary-500);
      border-radius: 8px;
      cursor: pointer;
      transition: all 0.2s;
      font-size: 20px;
      font-weight: 700;
      display: flex;
      align-items: center;
      justify-content: center;
      flex-shrink: 0;
    }

    .hours-stepper-btn:hover {
      background: rgba(59, 130, 246, 0.2);
      border-color: #2563eb;
      transform: scale(1.05);
    }

    .hours-stepper-btn:active {
      transform: scale(0.95);
    }

    .hours-stepper-display {
      flex: 1;
      text-align: center;
      padding: 12px 16px;
      background: linear-gradient(135deg, rgba(59, 130, 246, 0.05), rgba(59, 130, 246, 0.1));
      border: 2px solid var(--primary-500);
      border-radius: 10px;
      min-height: 44px;
      display: flex;
      align-items: center;
      justify-content: center;
    }

    .hours-stepper-display span {
      font-size: 24px;
      font-weight: 700;
      color: var(--primary-600);
      font-family: 'Courier New', monospace;
    }

    /* Hours Slider */
    .hours-slider-container {
      margin-bottom: 20px;
      padding: 0 8px;
    }

    .hours-slider {
      width: 100%;
      height: 8px;
      background: linear-gradient(90deg, var(--border) 0%, var(--primary-500) 100%);
      border-radius: 4px;
      outline: none;
      -webkit-appearance: none;
      appearance: none;
      cursor: pointer;
    }

    .hours-slider::-webkit-slider-thumb {
      -webkit-appearance: none;
      appearance: none;
      width: 24px;
      height: 24px;
      background: var(--primary-500);
      border: 3px solid white;
      border-radius: 50%;
      cursor: pointer;
      box-shadow: 0 2px 8px rgba(59, 130, 246, 0.4);
      transition: all 0.2s;
    }

    .hours-slider::-webkit-slider-thumb:hover {
      background: #2563eb;
      transform: scale(1.15);
      box-shadow: 0 4px 12px rgba(59, 130, 246, 0.6);
    }

    .hours-slider::-webkit-slider-thumb:active {
      transform: scale(1.05);
    }

    .hours-slider::-moz-range-thumb {
      width: 24px;
      height: 24px;
      background: var(--primary-500);
      border: 3px solid white;
      border-radius: 50%;
      cursor: pointer;
      box-shadow: 0 2px 8px rgba(59, 130, 246, 0.4);
      transition: all 0.2s;
    }

    .hours-slider::-moz-range-thumb:hover {
      background: #2563eb;
      transform: scale(1.15);
      box-shadow: 0 4px 12px rgba(59, 130, 246, 0.6);
    }

    .hours-slider::-moz-range-thumb:active {
      transform: scale(1.05);
    }

    .hours-slider-labels {
      display: flex;
      justify-content: space-between;
      margin-top: 8px;
      font-size: 11px;
      color: var(--muted);
      font-weight: 600;
      padding: 0 4px;
    }

    /* Hours Preset Buttons */
    .hours-presets-row {
      display: flex;
      gap: 8px;
      justify-content: center;
      flex-wrap: wrap;
    }

    .hours-preset-btn {
      min-width: 44px;
      min-height: 44px;
      padding: 8px 16px;
      border: 1px solid var(--border);
      background: var(--card);
      color: var(--text);
      border-radius: 8px;
      cursor: pointer;
      transition: all 0.2s;
      font-size: 16px;
      font-weight: 600;
      flex-shrink: 0;
    }

    .hours-preset-btn:hover {
      border-color: var(--primary-500);
      background: rgba(59, 130, 246, 0.05);
    }

    .hours-preset-btn.active {
      border-color: var(--primary-500);
      background: rgba(59, 130, 246, 0.15);
      color: var(--primary-500);
      box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
    }

    .hours-preset-btn:active {
      transform: scale(0.95);
    }

    /* Hours Section Header */
    .hours-section-header {
      text-align: center;
      margin-bottom: 20px;
    }

    .hours-section-title {
      font-size: 18px;
      font-weight: 700;
      color: var(--text);
      margin: 0 0 4px 0;
    }

    .hours-section-subtitle {
      font-size: 12px;
      color: var(--muted);
      font-style: italic;
    }

    .hours-helper-text {
      font-size: 11px;
      color: var(--muted);
      text-align: center;
      font-style: italic;
    }


    /* Auto-capitalize all text inputs */
    input[type="text"],
    input[type="search"],
    textarea {
      text-transform: uppercase;
    }

    .add-button {
      width: 100%;
      padding: 12px 16px;
      background: rgba(34, 197, 94, 0.1);
      color: #15803d;
      border: 1px solid rgba(34, 197, 94, 0.2);
      border-radius: 6px;
      font-size: 14px;
      font-weight: 600;
      cursor: pointer;
      transition: all 0.2s;
    }

    .add-button:hover {
      background: rgba(34, 197, 94, 0.15);
      border-color: rgba(34, 197, 94, 0.3);
    }

    .add-button:disabled {
      background: var(--muted);
      border-color: var(--border);
      color: var(--text);
      opacity: 0.5;
      cursor: not-allowed;
    }

    .code-output {
      background: var(--card);
      border: 1px solid var(--border);
      border-radius: 12px;
      padding: 20px;
      box-shadow: var(--shadow-light);
    }

    /* Current Part Header */
    .current-part-header {
      background: rgba(59, 130, 246, 0.05);
      border: 1px solid rgba(59, 130, 246, 0.2);
      border-radius: 6px;
      padding: 8px 12px;
      margin-bottom: 16px;
      display: flex;
      align-items: center;
      gap: 8px;
    }

    .current-part-label {
      font-size: 11px;
      color: var(--muted);
      font-weight: 600;
      text-transform: uppercase;
    }

    .current-part-name {
      font-size: 14px;
      color: #2563eb;
      font-weight: 700;
    }

    /* Main Code Display Card */
    .code-display-card {
      background: var(--bg);
      border: 2px solid var(--border);
      border-radius: 8px;
      padding: 16px;
      margin-bottom: 16px;
    }

    .code-display {
      font-family: 'Courier New', monospace;
      font-size: 28px;
      font-weight: 700;
      color: var(--text);
      min-height: 50px;
      display: flex;
      align-items: center;
      justify-content: center;
      word-break: break-all;
      text-align: center;
      margin-bottom: 8px;
    }

    .code-display.empty {
      color: var(--muted);
      font-size: 14px;
      font-family: inherit;
      font-weight: 400;
    }

    .total-hours {
      text-align: center;
      font-size: 13px;
      color: var(--muted);
      padding-top: 8px;
      border-top: 1px solid var(--border);
    }

    .total-hours strong {
      color: var(--text);
      font-size: 16px;
    }

    /* Code Breakdown Section */
    .code-breakdown-section {
      margin-bottom: 16px;
    }

    .code-breakdown-label {
      font-size: 12px;
      font-weight: 600;
      color: var(--muted);
      text-transform: uppercase;
      margin-bottom: 8px;
      letter-spacing: 0.5px;
    }

    .code-list {
      display: flex;
      flex-direction: column;
      gap: 6px;
    }

    .code-item {
      background: var(--row);
      border: 1px solid var(--border);
      border-radius: 6px;
      padding: 10px 12px;
      display: flex;
      justify-content: space-between;
      align-items: center;
    }

    .code-item-info {
      flex: 1;
    }

    .code-item-text {
      font-family: 'Courier New', monospace;
      font-weight: 700;
      color: var(--text);
      font-size: 14px;
      margin-bottom: 4px;
    }

    .code-item-desc {
      font-size: 11px;
      color: var(--muted);
      line-height: 1.4;
    }

    .remove-button {
      padding: 4px 10px;
      background: rgba(239, 68, 68, 0.1);
      color: #dc2626;
      border: 1px solid rgba(239, 68, 68, 0.2);
      border-radius: 4px;
      font-size: 11px;
      font-weight: 600;
      cursor: pointer;
      transition: all 0.2s;
      white-space: nowrap;
    }

    .remove-button:hover {
      background: rgba(239, 68, 68, 0.15);
      border-color: rgba(239, 68, 68, 0.3);
    }

    /* Action Buttons */
    .code-actions {
      display: flex;
      gap: 8px;
      margin-bottom: 20px;
    }

    .copy-button-large {
      flex: 1;
      padding: 14px 20px;
      background: var(--primary-500);
      color: white;
      border: none;
      border-radius: 6px;
      font-size: 15px;
      font-weight: 700;
      cursor: pointer;
      transition: all 0.2s;
      text-transform: uppercase;
      letter-spacing: 0.5px;
    }

    .copy-button-large:hover {
      background: #2563eb;
      transform: translateY(-2px);
      box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
    }

    .copy-button-large:disabled {
      background: var(--muted);
      color: var(--text);
      opacity: 0.5;
      cursor: not-allowed;
      transform: none;
    }

    .clear-button {
      padding: 14px 20px;
      background: var(--card);
      color: var(--text);
      border: 1px solid var(--border);
      border-radius: 6px;
      font-size: 13px;
      font-weight: 600;
      cursor: pointer;
      transition: all 0.2s;
    }

    .clear-button:hover {
      background: rgba(239, 68, 68, 0.05);
      border-color: rgba(239, 68, 68, 0.3);
      color: #dc2626;
    }

    .clear-button:disabled {
      opacity: 0.5;
      cursor: not-allowed;
    }

    /* Undo Button */
    .undo-button {
      display: none;
      position: fixed;
      bottom: 160px; /* Moved higher to account for larger sticky footer */
      left: 50%;
      transform: translateX(-50%);
      background: linear-gradient(135deg, #f97316, #ea580c);
      color: white;
      padding: 10px 24px;
      border-radius: 8px;
      border: none;
      box-shadow: 0 4px 16px rgba(249, 115, 22, 0.4);
      z-index: 1000;
      cursor: pointer;
      font-size: 13px;
      font-weight: 700;
      transition: all 0.3s ease;
      opacity: 0;
      animation: undoSlideUp 0.3s ease-out forwards;
      white-space: nowrap;
    }

    .undo-button.show {
      display: block;
    }

    .undo-button.hiding {
      animation: undoSlideDown 0.3s ease-in forwards;
    }

    @keyframes undoSlideUp {
      from {
        opacity: 0;
        transform: translateX(-50%) translateY(20px);
      }
      to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
      }
    }

    @keyframes undoSlideDown {
      from {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
      }
      to {
        opacity: 0;
        transform: translateX(-50%) translateY(20px);
      }
    }

    .undo-button:hover {
      background: linear-gradient(135deg, #fb923c, #f97316);
      transform: translateX(-50%) translateY(-2px);
      box-shadow: 0 6px 20px rgba(249, 115, 22, 0.5);
    }

    .undo-button:active {
      transform: translateX(-50%) translateY(0);
    }

    /* Confirmation Modal */
    .confirm-modal-backdrop {
      display: none;
      position: fixed;
      top: 0;
      left: 0;
      right: 0;
      bottom: 0;
      background: rgba(0, 0, 0, 0.6);
      z-index: 9999;
      animation: fadeIn 0.2s ease-out;
    }

    .confirm-modal-backdrop.show {
      display: flex;
      align-items: center;
      justify-content: center;
      padding: 20px;
    }

    .confirm-modal {
      background: var(--card);
      border-radius: 16px;
      padding: 24px;
      max-width: 400px;
      width: 100%;
      box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
      animation: modalSlideUp 0.3s ease-out;
    }

    @keyframes fadeIn {
      from { opacity: 0; }
      to { opacity: 1; }
    }

    @keyframes modalSlideUp {
      from {
        opacity: 0;
        transform: translateY(30px);
      }
      to {
        opacity: 1;
        transform: translateY(0);
      }
    }

    .confirm-modal-icon {
      text-align: center;
      font-size: 48px;
      margin-bottom: 16px;
    }

    .confirm-modal-title {
      font-size: 20px;
      font-weight: 700;
      color: var(--text);
      margin: 0 0 12px 0;
      text-align: center;
    }

    .confirm-modal-message {
      font-size: 14px;
      color: var(--muted);
      margin: 0 0 16px 0;
      text-align: center;
      line-height: 1.5;
    }

    .confirm-modal-code {
      background: rgba(239, 68, 68, 0.1);
      border: 2px solid rgba(239, 68, 68, 0.3);
      border-radius: 8px;
      padding: 12px;
      margin: 16px 0;
      font-family: 'Courier New', monospace;
      font-size: 16px;
      font-weight: 700;
      color: #dc2626;
      text-align: center;
      word-break: break-all;
    }

    .confirm-modal-actions {
      display: flex;
      gap: 12px;
      margin-top: 20px;
    }

    .confirm-modal-btn {
      flex: 1;
      padding: 14px 20px;
      border: none;
      border-radius: 8px;
      font-size: 15px;
      font-weight: 700;
      cursor: pointer;
      transition: all 0.2s;
      text-transform: uppercase;
      letter-spacing: 0.5px;
    }

    .confirm-modal-btn-cancel {
      background: rgba(59, 130, 246, 0.1);
      color: #2563eb;
      border: 2px solid rgba(59, 130, 246, 0.3);
    }

    .confirm-modal-btn-cancel:hover {
      background: rgba(59, 130, 246, 0.2);
      border-color: rgba(59, 130, 246, 0.5);
      transform: translateY(-2px);
    }

    .confirm-modal-btn-confirm {
      background: linear-gradient(135deg, #dc2626, #b91c1c);
      color: white;
      box-shadow: 0 4px 12px rgba(220, 38, 38, 0.3);
    }

    .confirm-modal-btn-confirm:hover {
      background: linear-gradient(135deg, #ef4444, #dc2626);
      transform: translateY(-2px);
      box-shadow: 0 6px 16px rgba(220, 38, 38, 0.4);
    }

    .confirm-modal-btn:active {
      transform: translateY(0);
    }

    /* Start New Part Button - Fixed above sticky footer */
    .done-with-part-section {
      display: none;
    }

    .done-with-part-section.show {
      display: block;
      position: fixed;
      bottom: 115px; /* Above sticky footer (footer is ~108px) */
      left: 16px;
      right: 16px;
      z-index: 99;
    }

    /* Hide the extra text on mobile - just show button */
    .done-helper-text,
    .done-main-text {
      display: none;
    }

    .done-with-part-btn {
      width: 100%;
      padding: 10px 16px;
      background: var(--card);
      color: var(--muted);
      border: 1px solid var(--border);
      border-radius: 6px;
      font-size: 13px;
      font-weight: 600;
      cursor: pointer;
      transition: all 0.2s;
      box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    }

    .done-with-part-btn:active {
      background: rgba(59, 130, 246, 0.1);
      border-color: var(--primary-500);
    }

    /* Hide on desktop */
    @media (min-width: 769px) {
      .done-with-part-section {
        display: none !important;
      }
    }

    /* Recent Codes Section */
    .recent-codes-section {
      border-top: 2px solid var(--border);
      padding-top: 16px;
    }

    .recent-codes-title {
      font-size: 13px;
      font-weight: 600;
      color: var(--text);
      margin: 0 0 12px 0;
    }

    .recent-codes-list {
      display: flex;
      flex-direction: column;
      gap: 4px;
    }

    .recent-code-item {
      background: rgba(34, 197, 94, 0.03);
      border-bottom: 1px solid rgba(34, 197, 94, 0.1);
      padding: 6px 8px;
      font-size: 11px;
      display: flex;
      justify-content: space-between;
      align-items: center;
      gap: 8px;
      transition: background 0.15s;
    }

    .recent-code-item:hover {
      background: rgba(34, 197, 94, 0.06);
    }

    .recent-code-info {
      flex: 1;
      min-width: 0;
      display: flex;
      align-items: center;
      gap: 8px;
    }

    .recent-code-part {
      font-weight: 600;
      color: #15803d;
      font-size: 10px;
      text-transform: uppercase;
      letter-spacing: 0.3px;
      flex-shrink: 0;
    }

    .recent-code-code {
      font-family: 'Courier New', monospace;
      color: var(--text);
      font-weight: 600;
      font-size: 12px;
      flex: 1;
      min-width: 0;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    .recent-code-time {
      color: var(--muted);
      font-size: 10px;
      white-space: nowrap;
      flex-shrink: 0;
    }

    .recent-code-copy {
      background: transparent;
      color: #15803d;
      border: none;
      padding: 4px;
      border-radius: 4px;
      font-size: 14px;
      cursor: pointer;
      flex-shrink: 0;
      line-height: 1;
      transition: all 0.15s;
    }

    .recent-code-copy:hover {
      background: rgba(34, 197, 94, 0.1);
      transform: scale(1.1);
    }

    .recent-code-copy:active {
      transform: scale(0.95);
    }

    .toast {
      position: fixed;
      top: 20px;
      right: 20px;
      background: linear-gradient(135deg, rgba(34, 197, 94, 0.98), rgba(22, 163, 74, 0.98));
      color: white;
      padding: 16px 24px;
      border-radius: 12px;
      box-shadow: 0 8px 24px rgba(34, 197, 94, 0.4), 0 2px 8px rgba(0, 0, 0, 0.2);
      z-index: 1000;
      opacity: 0;
      transform: translateX(120%) scale(0.9);
      transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
      font-weight: 700;
      font-size: 15px;
      max-width: 300px;
      backdrop-filter: blur(10px);
      border: 1px solid rgba(255, 255, 255, 0.2);
    }

    .toast.show {
      opacity: 1;
      transform: translateX(0) scale(1);
      animation: toastBounce 0.5s ease-out;
    }

    @keyframes toastBounce {
      0% {
        transform: translateX(120%) scale(0.9);
      }
      60% {
        transform: translateX(-10px) scale(1.05);
      }
      80% {
        transform: translateX(5px) scale(0.98);
      }
      100% {
        transform: translateX(0) scale(1);
      }
    }

    /* Toast variants for different message types */
    .toast.success {
      background: linear-gradient(135deg, rgba(34, 197, 94, 0.98), rgba(22, 163, 74, 0.98));
      box-shadow: 0 8px 24px rgba(34, 197, 94, 0.4), 0 2px 8px rgba(0, 0, 0, 0.2);
    }

    .toast.info {
      background: linear-gradient(135deg, rgba(59, 130, 246, 0.98), rgba(37, 99, 235, 0.98));
      box-shadow: 0 8px 24px rgba(59, 130, 246, 0.4), 0 2px 8px rgba(0, 0, 0, 0.2);
    }

    .toast.error {
      background: linear-gradient(135deg, rgba(239, 68, 68, 0.98), rgba(220, 38, 38, 0.98));
      box-shadow: 0 8px 24px rgba(239, 68, 68, 0.4), 0 2px 8px rgba(0, 0, 0, 0.2);
    }

    @media (max-width: 768px) {
      .toast {
        right: 50%;
        transform: translateX(50%) translateY(-100%);
        max-width: calc(100% - 40px);
      }

      .toast.show {
        transform: translateX(50%) translateY(0);
      }

      @keyframes toastBounce {
        0% {
          transform: translateX(50%) translateY(-100%);
        }
        60% {
          transform: translateX(50%) translateY(10px);
        }
        80% {
          transform: translateX(50%) translateY(-5px);
        }
        100% {
          transform: translateX(50%) translateY(0);
        }
      }
    }

    /* Pulse animation for newly visible steps */
    @keyframes stepPulse {
      0% {
        box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.5);
      }
      25% {
        box-shadow: 0 0 0 10px rgba(59, 130, 246, 0);
      }
      50% {
        box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.4);
      }
      75% {
        box-shadow: 0 0 0 8px rgba(59, 130, 246, 0);
      }
      100% {
        box-shadow: 0 0 0 0 rgba(59, 130, 246, 0);
      }
    }

    .step-highlight {
      animation: stepPulse 2s ease-out;
    }

    @media (max-width: 1200px) {
      .main-content {
        grid-template-columns: 1fr;
      }
    }

    @media (max-width: 768px) {
      .damage-container {
        padding: 12px;
        padding-bottom: 180px; /* Add space for sticky footer + action buttons */
      }

      .builder-section {
        padding: 16px;
        padding-bottom: 20px; /* Ensure buttons don't overlap */
      }

      .code-output {
        padding: 16px;
      }

      .brand {
        font-size: 20px;
      }

      .category-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
      }

      .damage-type-grid {
        grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
        gap: 6px;
      }

      .damage-type-button {
        padding: 10px 8px;
      }

      .damage-type-code {
        font-size: 18px;
      }

      .zone-grid {
        grid-template-columns: repeat(auto-fill, minmax(45px, 1fr));
        gap: 6px;
      }

      .zone-button {
        padding: 12px 6px;
        font-size: 16px;
      }

      /* Mobile adjustments for new hours selector */
      .hours-selector-container {
        padding: 16px;
      }

      .hours-stepper-display span {
        font-size: 20px;
      }

      .hours-presets-row {
        gap: 6px;
      }

      .hours-preset-btn {
        font-size: 14px;
        padding: 6px 12px;
        min-width: 40px;
        min-height: 40px;
      }

      /* Reposition hours selector to thumb-friendly zone (vertically centered) */
      #hoursGroup {
        display: flex;
        flex-direction: column;
        justify-content: center;
        min-height: calc(100vh - 200px); /* Account for breadcrumb and sticky footer */
        padding-bottom: 200px; /* Space for sticky footer and action buttons */
      }

    }
