:root {
      --bg-dark: #0A0E17;
      --card-bg: rgba(18, 26, 43, 0.75);
      --card-border: rgba(255, 255, 255, 0.08);
      --brand-red: #E11B22;
      --brand-red-glow: rgba(225, 27, 34, 0.35);
      --accent-crimson: #FF4D4D;
      --accent-amber: #F59E0B;
      --accent-emerald: #10B981;
      --accent-cyan: #06B6D4;
      --accent-indigo: #6366F1;
      --accent-blue: #3B82F6;
      --text-main: #F8FAFC;
      --text-muted: #94A3B8;
      --border-subtle: rgba(255, 255, 255, 0.07);
      --border-accent: rgba(225, 27, 34, 0.3);
      --font-body: 'Inter', sans-serif;
      --font-heading: 'Outfit', sans-serif;
      --font-mono: 'JetBrains Mono', monospace;
    }

    * {
      box-sizing: border-box;
      margin: 0;
      padding: 0;
      -webkit-tap-highlight-color: transparent;
    }

    html {
      width: 100%;
      max-width: 100%;
      overflow-x: hidden !important;
      overscroll-behavior-x: none;
    }

    body {
      background-color: var(--bg-dark);
      color: var(--text-main);
      font-family: var(--font-body);
      min-height: 100vh;
      width: 100%;
      max-width: 100%;
      overflow-x: hidden !important;
      overscroll-behavior-x: none;
      position: relative;
      display: flex;
      flex-direction: column;
      background-image: 
        radial-gradient(at 0% 0%, rgba(225, 27, 34, 0.12) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(99, 102, 241, 0.08) 0px, transparent 50%);
      background-attachment: fixed;
      padding-bottom: 24px;
    }

    /* Top Navbar */
    header {
      background: rgba(10, 14, 23, 0.85);
      backdrop-filter: blur(12px);
      -webkit-backdrop-filter: blur(12px);
      border-bottom: 1px solid var(--border-subtle);
      position: sticky;
      top: 0;
      z-index: 50;
      padding: 12px 18px;
      display: flex;
      align-items: center;
      justify-content: space-between;
    }

    .brand {
      display: flex;
      align-items: center;
      gap: 10px;
    }

    .brand-icon {
      width: 34px;
      height: 34px;
      background: linear-gradient(135deg, #FF4D4D, #E11B22);
      border-radius: 9px;
      display: flex;
      align-items: center;
      justify-content: center;
      box-shadow: 0 4px 12px var(--brand-red-glow);
    }

    .brand-icon svg {
      width: 20px;
      height: 20px;
      fill: white;
    }

    .brand-text h1 {
      font-family: var(--font-heading);
      font-size: 1.15rem;
      font-weight: 700;
      letter-spacing: -0.01em;
      display: flex;
      align-items: center;
      gap: 6px;
    }

    .brand-text p {
      font-size: 0.72rem;
      color: var(--text-muted);
      font-weight: 500;
      text-transform: uppercase;
      letter-spacing: 0.05em;
    }

    .badge-live {
      font-size: 0.65rem;
      background: rgba(16, 185, 129, 0.15);
      color: #34D399;
      border: 1px solid rgba(16, 185, 129, 0.3);
      padding: 2px 6px;
      border-radius: 99px;
      font-family: var(--font-mono);
      font-weight: 600;
    }

    .header-actions {
      display: flex;
      align-items: center;
      gap: 8px;
    }

    .icon-btn {
      background: rgba(255, 255, 255, 0.05);
      border: 1px solid var(--border-subtle);
      color: var(--text-muted);
      width: 36px;
      height: 36px;
      border-radius: 8px;
      display: flex;
      align-items: center;
      justify-content: center;
      cursor: pointer;
      transition: all 0.2s;
    }

    .icon-btn:hover {
      background: rgba(255, 255, 255, 0.1);
      color: #FFF;
    }

    /* App Layout */
    .app-layout {
      display: flex;
      min-height: 100vh;
      width: 100%;
    }

    /* Left Sidebar */
    .sidebar {
      width: 250px;
      min-width: 250px;
      background: rgba(10, 14, 23, 0.98);
      border-right: 1px solid var(--border-subtle);
      display: flex;
      flex-direction: column;
      height: 100vh;
      position: sticky;
      top: 0;
      z-index: 120;
      box-shadow: 4px 0 24px rgba(0, 0, 0, 0.4);
      overflow-y: auto;
    }

    .sidebar-brand {
      padding: 16px 14px;
      display: flex;
      align-items: center;
      justify-content: space-between;
      border-bottom: 1px solid var(--border-subtle);
    }
    .sidebar-brand-link {
      display: flex;
      align-items: center;
      gap: 10px;
      cursor: pointer;
      flex: 1;
      user-select: none;
      transition: all 0.2s ease;
      border-radius: 8px;
      padding: 2px 4px;
    }
    .sidebar-brand-link:hover .brand-icon {
      transform: scale(1.08);
      box-shadow: 0 0 16px rgba(225, 27, 34, 0.65);
    }
    .sidebar-brand-link:hover .sidebar-title {
      color: #FF6B6B;
    }
    .sidebar-brand-link:active .brand-icon {
      transform: scale(0.95);
    }
    .sidebar-brand .brand-icon {
      width: 32px;
      height: 32px;
      background: linear-gradient(135deg, #E11B22, #B91C1C);
      border-radius: 8px;
      display: flex;
      align-items: center;
      justify-content: center;
      flex-shrink: 0;
      transition: all 0.2s ease;
    }
    .sidebar-brand .brand-icon svg {
      width: 18px;
      height: 18px;
      fill: white;
    }
    .sidebar-title {
      font-family: var(--font-heading);
      font-size: 1.05rem;
      font-weight: 800;
      color: #FFF;
      display: flex;
      align-items: center;
      gap: 6px;
      margin: 0;
    }
    .sidebar-subtitle {
      font-size: 0.68rem;
      color: var(--text-muted);
      margin: 0;
      text-transform: uppercase;
      letter-spacing: 0.05em;
    }
    .sidebar-close-btn {
      display: none;
      background: transparent;
      border: none;
      color: #94A3B8;
      font-size: 1.3rem;
      cursor: pointer;
      margin-left: auto;
      padding: 4px 8px;
      border-radius: 6px;
    }
    .sidebar-close-btn:hover {
      color: #FFF;
      background: rgba(255,255,255,0.1);
    }

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

    .sidebar-nav-header {
      font-size: 0.65rem;
      font-weight: 700;
      color: #64748B;
      text-transform: uppercase;
      letter-spacing: 0.08em;
      padding: 8px 12px 3px 12px;
      margin-top: 4px;
      user-select: none;
    }
    .sidebar-nav-header:not(:first-child) {
      border-top: 1px solid rgba(255, 255, 255, 0.06);
      padding-top: 10px;
      margin-top: 6px;
    }

    .sidebar-item {
      display: flex;
      align-items: center;
      gap: 12px;
      padding: 11px 12px;
      border-radius: 10px;
      background: transparent;
      border: 1px solid transparent;
      color: #94A3B8;
      font-family: var(--font-heading);
      font-size: 0.86rem;
      font-weight: 600;
      cursor: pointer;
      text-align: left;
      width: 100%;
      transition: all 0.18s ease;
      user-select: none;
    }
    .sidebar-item .nav-icon {
      font-size: 1.15rem;
      width: 24px;
      text-align: center;
      flex-shrink: 0;
    }
    .sidebar-item .nav-text {
      flex: 1;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }
    .sidebar-item .nav-badge {
      background: rgba(99, 102, 241, 0.2);
      border: 1px solid rgba(99, 102, 241, 0.4);
      color: #818CF8;
      font-size: 0.7rem;
      font-weight: 700;
      padding: 2px 7px;
      border-radius: 12px;
    }
    .sidebar-item:hover {
      background: rgba(255, 255, 255, 0.05);
      color: #FFF;
    }
    .sidebar-item.active {
      background: linear-gradient(135deg, rgba(225, 27, 34, 0.22), rgba(225, 27, 34, 0.08));
      border-color: rgba(225, 27, 34, 0.45);
      color: #FF6B6B;
      font-weight: 700;
      box-shadow: 0 2px 10px rgba(225, 27, 34, 0.15);
    }
    .sidebar-item.active .nav-badge {
      background: rgba(225, 27, 34, 0.3);
      border-color: rgba(225, 27, 34, 0.6);
      color: #FF4D4D;
    }

    /* Main Content Area */
    .main-wrapper {
      flex: 1;
      display: flex;
      flex-direction: column;
      min-width: 0;
      height: 100vh;
      overflow-y: auto;
    }

    .top-header {
      padding-top: calc(env(safe-area-inset-top, 0px) + 10px);
      padding-bottom: 10px;
      padding-left: calc(env(safe-area-inset-left, 0px) + 16px);
      padding-right: calc(env(safe-area-inset-right, 0px) + 16px);
      background: rgba(15, 23, 42, 0.94);
      border-bottom: 1px solid var(--border-subtle);
      display: flex;
      align-items: center;
      justify-content: space-between;
      position: sticky;
      top: 0;
      z-index: 100;
      backdrop-filter: blur(16px);
      -webkit-backdrop-filter: blur(16px);
    }
    .active-view-tag {
      display: flex;
      align-items: center;
      gap: 10px;
    }
    .active-view-title {
      font-family: var(--font-heading);
      font-size: 0.95rem;
      font-weight: 700;
      color: #FFF;
    }

    /* Mobile Backdrop */
    .sidebar-backdrop {
      display: none;
      position: fixed;
      inset: 0;
      background: rgba(0, 0, 0, 0.65);
      backdrop-filter: blur(4px);
      -webkit-backdrop-filter: blur(4px);
      z-index: 115;
    }
    .sidebar-backdrop.active {
      display: block;
    }

    /* Responsive Mobile (< 768px) */
    @media (max-width: 768px) {
      .app-layout, .main-wrapper, main {
        max-width: 100vw;
        overflow-x: hidden !important;
      }
      .sidebar {
        position: fixed;
        left: -270px;
        width: 270px;
        transition: left 0.25s cubic-bezier(0.4, 0, 0.2, 1);
        z-index: 130;
      }
      .sidebar.open {
        left: 0;
      }
      .sidebar-close-btn {
        display: block;
      }
      .top-header {
        padding: 8px 10px;
        gap: 6px;
        max-width: 100vw;
        overflow: hidden;
      }
      .active-view-tag {
        min-width: 0;
        flex: 1;
        overflow: hidden;
      }
      .active-view-title {
        font-size: 0.82rem;
        max-width: 140px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
      }
      .active-view-tag .badge-live {
        display: none !important;
      }
      .header-actions {
        gap: 4px;
        flex-shrink: 0;
      }
      #btn-universal-search {
        padding: 4px 8px !important;
        font-size: 0.7rem !important;
      }
      #btn-universal-search span:last-child {
        display: none !important;
      }
      #btn-cloud-sync {
        padding: 4px 8px !important;
        font-size: 0.7rem !important;
      }
      #btn-qr, #btn-clear-chat {
        display: none !important;
      }
    }
    /* Top Quick Navigation Bar (1-Tap Direct Access) */
    .top-quick-nav {
      display: flex;
      align-items: center;
      gap: 6px;
      padding: 8px 14px;
      background: rgba(10, 14, 23, 0.96);
      border-bottom: 1px solid rgba(255, 255, 255, 0.08);
      overflow-x: auto;
      white-space: nowrap;
      -webkit-overflow-scrolling: touch;
      position: sticky;
      top: 48px;
      z-index: 95;
      backdrop-filter: blur(12px);
      -webkit-backdrop-filter: blur(12px);
    }
    .top-quick-nav::-webkit-scrollbar { display: none; }
    .quick-nav-pill {
      padding: 6px 14px;
      border-radius: 20px;
      font-size: 0.78rem;
      font-weight: 600;
      color: #94A3B8;
      background: rgba(30, 41, 59, 0.6);
      border: 1px solid rgba(255, 255, 255, 0.08);
      cursor: pointer;
      transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
      flex-shrink: 0;
      user-select: none;
    }
    .quick-nav-pill:hover {
      color: #FFF;
      background: rgba(255, 255, 255, 0.1);
      border-color: rgba(255, 255, 255, 0.2);
    }
    .quick-nav-pill.active {
      color: #FFF;
      background: linear-gradient(135deg, #EF4444, #B91C1C);
      border-color: rgba(239, 68, 68, 0.5);
      box-shadow: 0 2px 10px rgba(239, 68, 68, 0.35);
      transform: scale(1.03);
    }
    .quick-nav-pill[data-nav="vault"] {
      border-color: rgba(168, 85, 247, 0.4);
      background: rgba(168, 85, 247, 0.12);
      color: #D8B4FE;
    }
    .quick-nav-pill[data-nav="vault"].active {
      color: #FFF !important;
      background: linear-gradient(135deg, #9333EA, #7E22CE) !important;
      border-color: rgba(168, 85, 247, 0.8) !important;
      box-shadow: 0 2px 12px rgba(168, 85, 247, 0.45) !important;
    }

    /* Persistent Active Claim Session Banner */
    .active-claim-context-bar {
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding: 7px 14px;
      background: linear-gradient(135deg, rgba(30, 41, 59, 0.96), rgba(15, 23, 42, 0.98));
      border-bottom: 1px solid rgba(99, 102, 241, 0.35);
      position: sticky;
      top: 84px;
      z-index: 94;
      box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3);
    }
    .claim-banner-info {
      display: flex;
      align-items: center;
      gap: 10px;
      min-width: 0;
      flex: 1;
      overflow: hidden;
    }
    .claim-banner-icon {
      font-size: 1.1rem;
      flex-shrink: 0;
    }
    .claim-banner-label {
      font-size: 0.58rem;
      font-weight: 700;
      color: #818CF8;
      letter-spacing: 0.06em;
      display: block;
    }
    .claim-banner-title {
      font-size: 0.84rem;
      font-weight: 700;
      color: #FFF;
      margin-right: 6px;
    }
    .claim-banner-address {
      font-size: 0.76rem;
      color: #94A3B8;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }
    .claim-banner-actions {
      display: flex;
      align-items: center;
      gap: 6px;
      flex-shrink: 0;
    }
    .claim-banner-btn {
      padding: 3px 8px;
      font-size: 0.7rem;
      font-weight: 600;
      border-radius: 12px;
      background: rgba(99, 102, 241, 0.15);
      border: 1px solid rgba(99, 102, 241, 0.4);
      color: #A5B4FC;
      cursor: pointer;
      transition: all 0.15s ease;
    }
    .claim-banner-btn:hover {
      background: rgba(99, 102, 241, 0.3);
      color: #FFF;
    }
    .claim-banner-close {
      background: transparent;
      border: none;
      color: #64748B;
      font-size: 0.9rem;
      cursor: pointer;
      padding: 2px 6px;
    }
    .claim-banner-close:hover {
      color: #FFF;
    }

    /* State Farm SOP Rule Cards Library */
    .sop-card-grid {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
      gap: 10px;
      margin-bottom: 12px;
    }
    .sop-rule-card {
      background: linear-gradient(135deg, rgba(15, 23, 42, 0.95), rgba(30, 41, 59, 0.85));
      border: 1px solid rgba(99, 102, 241, 0.35);
      border-radius: 10px;
      padding: 12px;
      display: flex;
      flex-direction: column;
      justify-content: space-between;
      transition: all 0.2s ease;
    }
    .sop-rule-card:hover {
      border-color: rgba(99, 102, 241, 0.65);
      box-shadow: 0 4px 16px rgba(99, 102, 241, 0.2);
    }
    .sop-card-header {
      display: flex;
      align-items: center;
      justify-content: space-between;
      margin-bottom: 6px;
    }
    .sop-card-title {
      font-size: 0.86rem;
      font-weight: 700;
      color: #FFF;
    }
    .sop-card-body {
      font-size: 0.76rem;
      color: #94A3B8;
      line-height: 1.4;
      margin-bottom: 10px;
    }
    .sop-copy-btn {
      padding: 5px 10px;
      font-size: 0.72rem;
      font-weight: 600;
      border-radius: 6px;
      background: rgba(99, 102, 241, 0.15);
      border: 1px solid rgba(99, 102, 241, 0.4);
      color: #A5B4FC;
      cursor: pointer;
      width: 100%;
      text-align: center;
      transition: all 0.15s ease;
    }
    .sop-copy-btn:hover {
      background: rgba(99, 102, 241, 0.3);
      color: #FFF;
    }

    /* Desktop Collapsed Sidebar Toggle */
    .sidebar.collapsed {
      display: none !important;
    }

    /* Miscellaneous & Tools Sub-Navigation */
    .misc-subnav {
      display: flex;
      gap: 8px;
      padding: 6px 4px 14px 4px;
      border-bottom: 1px solid var(--border-subtle);
      margin-bottom: 14px;
      overflow-x: auto;
      no-scrollbar: true;
      -webkit-overflow-scrolling: touch;
    }
    .misc-subnav::-webkit-scrollbar { display: none; }
    .misc-tab-btn {
      background: rgba(255, 255, 255, 0.05);
      border: 1px solid var(--border-subtle);
      color: var(--text-muted);
      font-family: var(--font-heading);
      font-size: 0.84rem;
      font-weight: 600;
      padding: 8px 14px;
      border-radius: 20px;
      cursor: pointer;
      white-space: nowrap;
      transition: all 0.2s ease;
      display: flex;
      align-items: center;
      gap: 6px;
    }
    .misc-tab-btn:hover {
      background: rgba(255, 255, 255, 0.1);
      color: #FFF;
    }
    .misc-tab-btn.active {
      background: linear-gradient(135deg, rgba(99, 102, 241, 0.3), rgba(79, 70, 229, 0.3));
      border-color: #818CF8;
      color: #FFF;
      box-shadow: 0 0 12px rgba(99, 102, 241, 0.25);
    }
    .misc-subpane {
      display: none;
      flex-direction: column;
      gap: 16px;
    }
    .misc-subpane.active {
      display: flex;
    }

    /* Toast Notifications System */
    .toast-container {
      position: fixed;
      bottom: 24px;
      left: 50%;
      transform: translateX(-50%);
      z-index: 9999;
      display: flex;
      flex-direction: column;
      gap: 8px;
      pointer-events: none;
      width: calc(100% - 32px);
      max-width: 420px;
    }
    .toast-msg {
      background: rgba(15, 23, 42, 0.95);
      border: 1px solid rgba(99, 102, 241, 0.5);
      color: #FFF;
      padding: 12px 18px;
      border-radius: 12px;
      font-size: 0.88rem;
      font-weight: 600;
      box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
      backdrop-filter: blur(16px);
      -webkit-backdrop-filter: blur(16px);
      display: flex;
      align-items: center;
      gap: 10px;
      animation: toastIn 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
      pointer-events: auto;
    }
    .toast-msg.success {
      border-color: rgba(52, 211, 153, 0.5);
      background: rgba(6, 44, 31, 0.95);
      color: #34D399;
    }
    .toast-msg.error {
      border-color: rgba(239, 68, 68, 0.5);
      background: rgba(45, 12, 12, 0.95);
      color: #EF4444;
    }
    .toast-msg.fadeout {
      animation: toastOut 0.25s ease forwards;
    }
    @keyframes toastIn {
      from { opacity: 0; transform: translateY(16px) scale(0.96); }
      to { opacity: 1; transform: translateY(0) scale(1); }
    }
    @keyframes toastOut {
      from { opacity: 1; transform: translateY(0) scale(1); }
      to { opacity: 0; transform: translateY(16px) scale(0.96); }
    }

    /* Main Container */
    main {
      flex: 1;
      max-width: 980px;
      width: 100%;
      margin: 0 auto;
      padding: 16px;
      display: flex;
      flex-direction: column;
      gap: 16px;
    }

    .tab-pane {
      display: none;
      flex-direction: column;
      gap: 16px;
      animation: fadeIn 0.2s ease-in-out;
    }

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

    @keyframes fadeIn {
      from { opacity: 0; transform: translateY(4px); }
      to { opacity: 1; transform: translateY(0); }
    }

    /* Glass Cards */
    .glass-card {
      background: var(--card-bg);
      border: 1px solid var(--card-border);
      border-radius: 14px;
      padding: 18px;
      box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
      backdrop-filter: blur(10px);
      -webkit-backdrop-filter: blur(10px);
      position: relative;
    }

    .glass-card-title {
      font-family: var(--font-heading);
      font-size: 1rem;
      font-weight: 700;
      color: #FFF;
      margin-bottom: 12px;
      display: flex;
      align-items: center;
      justify-content: space-between;
      flex-wrap: wrap;
      gap: 8px;
    }

    /* Quick Action Pills */
    .pill-scroll {
      display: flex;
      gap: 8px;
      overflow-x: auto;
      padding-bottom: 4px;
      no-scrollbar: true;
    }
    .pill-scroll::-webkit-scrollbar { display: none; }

    .action-pill {
      background: rgba(30, 41, 59, 0.6);
      border: 1px solid var(--border-subtle);
      padding: 6px 12px;
      border-radius: 99px;
      font-size: 0.76rem;
      font-weight: 500;
      color: #CBD5E1;
      white-space: nowrap;
      cursor: pointer;
      transition: all 0.2s;
    }

    .action-pill:hover {
      background: rgba(225, 27, 34, 0.15);
      border-color: rgba(225, 27, 34, 0.4);
      color: #FFF;
    }

    /* Chat Messages View */
    .chat-box {
      display: flex;
      flex-direction: column;
      gap: 14px;
      min-height: 240px;
      max-height: 480px;
      overflow-y: auto;
      padding: 14px;
      background: rgba(10, 14, 23, 0.6);
      border: 1px solid var(--border-subtle);
      border-radius: 12px;
    }

    .message {
      max-width: 90%;
      padding: 12px 16px;
      border-radius: 12px;
      font-size: 0.88rem;
      line-height: 1.5;
    }

    .message.user {
      align-self: flex-end;
      background: linear-gradient(135deg, rgba(225, 27, 34, 0.85), rgba(185, 28, 28, 0.9));
      color: white;
      border-bottom-right-radius: 2px;
      box-shadow: 0 4px 14px rgba(225, 27, 34, 0.25);
    }

    .message.assistant {
      align-self: flex-start;
      background: rgba(30, 41, 59, 0.7);
      border: 1px solid var(--border-subtle);
      color: var(--text-main);
      border-bottom-left-radius: 2px;
    }

    .message img {
      max-width: 100%;
      border-radius: 8px;
      margin-top: 8px;
      border: 1px solid rgba(255, 255, 255, 0.2);
    }

    .message-meta {
      font-size: 0.72rem;
      color: var(--text-muted);
      margin-top: 8px;
      display: flex;
      flex-wrap: wrap;
      justify-content: space-between;
      align-items: center;
      gap: 6px;
      border-top: 1px solid rgba(255, 255, 255, 0.05);
      padding-top: 6px;
    }

    /* Media Preview Box */
    .preview-box {
      display: none;
      align-items: center;
      gap: 10px;
      background: rgba(30, 41, 59, 0.8);
      border: 1px solid var(--border-accent);
      border-radius: 10px;
      padding: 8px 12px;
      margin-bottom: 8px;
    }

    .preview-box.active { display: flex; }

    .preview-thumb {
      width: 48px;
      height: 48px;
      border-radius: 6px;
      object-fit: cover;
    }

    .preview-info {
      flex: 1;
      font-size: 0.78rem;
    }

    .preview-info b { display: block; color: #FFF; }
    .preview-info span { color: var(--text-muted); }

    .preview-remove {
      background: none;
      border: none;
      color: #EF4444;
      cursor: pointer;
      font-size: 1.1rem;
      padding: 4px;
    }

    /* Multi-Photo Vault Dropzone */
    .scope-vault-dropzone {
      border: 2px dashed rgba(255, 255, 255, 0.15);
      border-radius: 12px;
      padding: 18px;
      text-align: center;
      background: rgba(15, 23, 42, 0.5);
      cursor: pointer;
      transition: all 0.2s ease;
    }

    .scope-vault-dropzone:hover, .scope-vault-dropzone.drag-over {
      border-color: var(--brand-red);
      background: rgba(225, 27, 34, 0.05);
    }

    .scope-vault-grid {
      display: grid;
      grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
      gap: 8px;
      margin-top: 12px;
    }

    .scope-thumb-card {
      position: relative;
      border-radius: 8px;
      overflow: hidden;
      aspect-ratio: 1;
      border: 1px solid var(--border-subtle);
      background: #000;
    }

    .scope-thumb-card img {
      width: 100%;
      height: 100%;
      object-fit: cover;
    }

    .scope-thumb-remove {
      position: absolute;
      top: 3px;
      right: 3px;
      width: 20px;
      height: 20px;
      background: rgba(0, 0, 0, 0.75);
      color: #FF6B6B;
      border: 1px solid rgba(255, 255, 255, 0.2);
      border-radius: 50%;
      display: flex;
      align-items: center;
      justify-content: center;
      cursor: pointer;
      font-size: 0.7rem;
    }

    .scope-thumb-num {
      position: absolute;
      bottom: 3px;
      left: 3px;
      background: rgba(0, 0, 0, 0.7);
      color: #FFF;
      font-size: 0.65rem;
      font-family: var(--font-mono);
      padding: 1px 4px;
      border-radius: 4px;
    }

    /* Copilot & Policy Multi-Photo Tray & Thumbs */
    .copilot-photo-tray {
      animation: fadeIn 0.2s ease;
    }

    .copilot-thumb-card {
      position: relative;
      flex-shrink: 0;
      width: 72px;
      height: 72px;
      border-radius: 8px;
      overflow: hidden;
      border: 1.5px solid rgba(239, 68, 68, 0.5);
      background: #0F172A;
      box-shadow: 0 2px 8px rgba(0,0,0,0.5);
    }

    .copilot-thumb-card img {
      width: 100%;
      height: 100%;
      object-fit: cover;
    }

    .copilot-thumb-remove {
      position: absolute;
      top: 2px;
      right: 2px;
      width: 18px;
      height: 18px;
      background: rgba(0, 0, 0, 0.85);
      color: #EF4444;
      border: 1px solid rgba(239, 68, 68, 0.6);
      border-radius: 50%;
      display: flex;
      align-items: center;
      justify-content: center;
      cursor: pointer;
      font-size: 0.65rem;
      line-height: 1;
      font-weight: bold;
    }

    .copilot-thumb-num {
      position: absolute;
      bottom: 2px;
      left: 2px;
      background: rgba(0, 0, 0, 0.8);
      color: #38BDF8;
      font-size: 0.62rem;
      font-family: var(--font-mono);
      padding: 1px 4px;
      border-radius: 4px;
      font-weight: 700;
    }

    /* Input Controls Bar */
    .control-bar {
      display: flex;
      flex-direction: column;
      gap: 8px;
    }

    .input-wrapper {
      display: flex;
      align-items: center;
      gap: 8px;
      background: rgba(15, 23, 42, 0.9);
      border: 1px solid var(--border-subtle);
      border-radius: 12px;
      padding: 6px 10px;
    }

    .input-wrapper:focus-within {
      border-color: var(--brand-red);
      box-shadow: 0 0 0 1px var(--brand-red);
    }

    .chat-textarea {
      flex: 1;
      background: transparent;
      border: none;
      color: #FFF;
      font-family: var(--font-body);
      font-size: 0.9rem;
      outline: none;
      resize: none;
      padding: 6px 4px;
      max-height: 120px;
    }

    .media-buttons {
      display: flex;
      align-items: center;
      gap: 6px;
    }

    .action-btn-circle {
      width: 40px;
      height: 40px;
      border-radius: 10px;
      border: 1px solid var(--border-subtle);
      background: rgba(30, 41, 59, 0.7);
      color: var(--text-main);
      display: flex;
      align-items: center;
      justify-content: center;
      cursor: pointer;
      position: relative;
      transition: all 0.2s ease;
      flex-shrink: 0;
    }

    .action-btn-circle:hover {
      background: rgba(45, 60, 88, 0.9);
      border-color: rgba(255, 255, 255, 0.2);
    }

    .action-btn-circle.recording {
      background: #E11B22;
      color: white;
      animation: pulseRecord 1.2s infinite ease-in-out;
      border-color: #FF4D4D;
    }

    @keyframes pulseRecord {
      0% { box-shadow: 0 0 0 0 rgba(225, 27, 34, 0.7); }
      70% { box-shadow: 0 0 0 12px rgba(225, 27, 34, 0); }
      100% { box-shadow: 0 0 0 0 rgba(225, 27, 34, 0); }
    }

    .send-btn {
      background: linear-gradient(135deg, #6366F1, #4F46E5);
      color: white;
      border: 1px solid rgba(255, 255, 255, 0.25);
      font-weight: 600;
      box-shadow: 0 4px 14px rgba(99, 102, 241, 0.45);
      cursor: pointer;
    }

    /* Forms and Selectors */
    .form-grid {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 12px;
      margin-bottom: 14px;
    }

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

    .form-group {
      display: flex;
      flex-direction: column;
      gap: 6px;
    }

    .form-label {
      font-size: 0.76rem;
      font-weight: 600;
      color: var(--text-muted);
      text-transform: uppercase;
      letter-spacing: 0.04em;
      display: flex;
      align-items: center;
      justify-content: space-between;
    }

    .form-input, .form-select {
      background: rgba(15, 23, 42, 0.85);
      border: 1px solid var(--border-subtle);
      border-radius: 9px;
      padding: 10px 12px;
      color: #FFF;
      font-family: var(--font-body);
      font-size: 0.88rem;
      outline: none;
      transition: border 0.2s;
    }

    .form-input:focus, .form-select:focus {
      border-color: var(--brand-red);
    }

    .btn-primary {
      background: linear-gradient(135deg, #FF4D4D, #E11B22);
      color: white;
      border: none;
      padding: 12px 18px;
      border-radius: 10px;
      font-family: var(--font-heading);
      font-weight: 600;
      font-size: 0.9rem;
      cursor: pointer;
      width: 100%;
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 8px;
      box-shadow: 0 4px 14px var(--brand-red-glow);
      transition: all 0.2s;
    }

    .btn-primary:hover {
      transform: translateY(-1px);
      box-shadow: 0 6px 20px rgba(225, 27, 34, 0.45);
    }

    .btn-secondary {
      background: rgba(255, 255, 255, 0.06);
      border: 1px solid var(--border-subtle);
      color: #CBD5E1;
      padding: 8px 14px;
      border-radius: 8px;
      font-size: 0.8rem;
      font-weight: 600;
      cursor: pointer;
      transition: all 0.2s;
      display: inline-flex;
      align-items: center;
      gap: 6px;
    }

    .btn-secondary:hover {
      background: rgba(255, 255, 255, 0.12);
      color: #FFF;
    }

    /* Structured Reports Formatting */
    .scope-report-container {
      background: rgba(10, 14, 23, 0.8);
      border: 1px solid var(--border-subtle);
      border-radius: 14px;
      padding: 20px;
      margin-top: 16px;
      display: none;
    }

    .scope-report-container.active { display: block; }

    .scope-header-bar {
      display: flex;
      flex-wrap: wrap;
      justify-content: space-between;
      align-items: center;
      gap: 10px;
      padding-bottom: 14px;
      border-bottom: 1px solid var(--border-subtle);
      margin-bottom: 16px;
    }

    .scope-actions-bar {
      display: flex;
      flex-wrap: wrap;
      gap: 8px;
    }

    /* ========================================================
       REPORT EXPAND, FULLSCREEN, ZOOM & MOBILE CARD STYLES
       ======================================================== */
    .report-zoom-bar {
      display: flex;
      align-items: center;
      gap: 6px;
      background: rgba(15, 23, 42, 0.85);
      border: 1px solid rgba(255, 255, 255, 0.1);
      border-radius: 8px;
      padding: 4px 8px;
    }
    .zoom-btn {
      padding: 3px 8px !important;
      font-size: 0.74rem !important;
      font-weight: 700 !important;
      border-radius: 6px !important;
      cursor: pointer;
    }
    .report-section-card {
      background: rgba(15, 23, 42, 0.85);
      border: 1px solid rgba(255, 255, 255, 0.08);
      border-radius: 12px;
      margin-bottom: 16px;
      overflow: hidden;
      transition: all 0.2s ease;
      box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    }
    .report-section-card:hover {
      border-color: rgba(99, 102, 241, 0.35);
    }
    .report-section-header {
      background: rgba(20, 30, 52, 0.95);
      padding: 10px 14px;
      display: flex;
      align-items: center;
      justify-content: space-between;
      border-bottom: 1px solid rgba(255, 255, 255, 0.06);
      flex-wrap: wrap;
      gap: 8px;
    }
    .report-section-title {
      display: flex;
      align-items: center;
      gap: 8px;
      font-family: var(--font-heading);
      font-size: 0.95rem;
      font-weight: 700;
      color: #F8FAFC;
      cursor: pointer;
      user-select: none;
      flex: 1;
    }
    .collapse-arrow {
      font-size: 0.75rem;
      color: #94A3B8;
      transition: transform 0.2s;
    }
    .report-section-card.collapsed .collapse-arrow {
      transform: rotate(-90deg);
    }
    .report-section-card.collapsed .report-section-body {
      display: none;
    }
    .report-section-tools {
      display: flex;
      align-items: center;
      gap: 6px;
    }
    .report-section-tools button {
      padding: 4px 10px;
      font-size: 0.72rem;
      border-radius: 6px;
      cursor: pointer;
    }
    .report-section-body {
      padding: 16px;
      font-size: 0.88rem;
      line-height: 1.6;
      color: #E2E8F0;
      overflow-x: auto;
    }

    /* Enhanced Table Styles */
    .table-wrapper {
      overflow-x: auto;
      margin: 12px 0;
      border-radius: 10px;
      border: 1px solid rgba(255, 255, 255, 0.08);
      background: rgba(10, 14, 23, 0.75);
      -webkit-overflow-scrolling: touch;
      position: relative;
    }
    .table-toolbar-bar {
      display: flex;
      align-items: center;
      justify-content: space-between;
      background: #111827;
      padding: 6px 12px;
      border-bottom: 1px solid rgba(255, 255, 255, 0.08);
      gap: 6px;
      flex-wrap: wrap;
    }
    table.scope-table {
      width: 100%;
      min-width: 640px;
      border-collapse: collapse;
      font-size: 0.84rem;
      text-align: left;
    }
    table.scope-table th {
      background: #111827;
      color: #CBD5E1;
      padding: 10px 12px;
      border-bottom: 1px solid rgba(255, 255, 255, 0.12);
      font-family: var(--font-heading);
      font-size: 0.76rem;
      text-transform: uppercase;
      letter-spacing: 0.04em;
      white-space: nowrap;
      position: sticky;
      top: 0;
      z-index: 2;
    }
    table.scope-table td {
      padding: 10px 12px;
      border-bottom: 1px solid rgba(255, 255, 255, 0.05);
      color: #E2E8F0;
      vertical-align: middle;
    }
    table.scope-table tr:nth-child(even) td {
      background: rgba(255, 255, 255, 0.015);
    }
    table.scope-table tr:hover td {
      background: rgba(99, 102, 241, 0.08);
    }

    /* Mobile Table Card Layout */
    .table-cards-container {
      display: flex;
      flex-direction: column;
      gap: 10px;
      margin: 12px 0;
    }
    .table-row-card {
      background: rgba(20, 30, 52, 0.85);
      border: 1px solid rgba(255, 255, 255, 0.08);
      border-radius: 10px;
      padding: 12px 14px;
      display: flex;
      flex-direction: column;
      gap: 6px;
    }
    .table-row-card-header {
      display: flex;
      align-items: center;
      justify-content: space-between;
      border-bottom: 1px solid rgba(255, 255, 255, 0.06);
      padding-bottom: 6px;
    }
    .table-row-card-grid {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
      gap: 8px;
      font-size: 0.8rem;
    }
    .table-card-field {
      display: flex;
      flex-direction: column;
      gap: 2px;
    }
    .table-card-label {
      font-size: 0.68rem;
      color: #94A3B8;
      text-transform: uppercase;
      font-weight: 600;
    }
    .table-card-val {
      font-weight: 600;
      color: #F8FAFC;
    }

    /* Fullscreen Modal View */
    .fullscreen-section-overlay {
      position: fixed;
      top: 0;
      left: 0;
      right: 0;
      bottom: 0;
      background: #090D16;
      z-index: 9999999;
      display: none;
      flex-direction: column;
      overflow: hidden;
    }
    .fullscreen-section-overlay.active {
      display: flex;
    }
    .fullscreen-modal-header {
      background: #111827;
      border-bottom: 1px solid rgba(255, 255, 255, 0.1);
      padding: 12px 16px;
      display: flex;
      align-items: center;
      justify-content: space-between;
      flex-shrink: 0;
      gap: 10px;
      flex-wrap: wrap;
    }
    .fullscreen-modal-body {
      flex: 1;
      overflow-y: auto;
      overflow-x: auto;
      padding: 20px;
      -webkit-overflow-scrolling: touch;
    }

    .split-code-tag {
      font-family: var(--font-mono);
      font-weight: 700;
      color: #FF4D4D;
      background: rgba(225, 27, 34, 0.15);
      padding: 2px 6px;
      border-radius: 4px;
      font-size: 0.78rem;
    }

    /* Follow-Up Adjuster Co-Pilot Styles */
    .scope-followup-box {
      margin-top: 24px;
      padding: 18px;
      border-radius: 12px;
      background: rgba(15, 23, 42, 0.85);
      border: 1px solid rgba(99, 102, 241, 0.35);
      box-shadow: 0 4px 24px rgba(0, 0, 0, 0.35);
    }
    .scope-followup-header {
      display: flex;
      align-items: center;
      justify-content: space-between;
      flex-wrap: wrap;
      gap: 8px;
      margin-bottom: 12px;
      padding-bottom: 10px;
      border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    }
    .scope-followup-header h3 {
      font-family: var(--font-heading);
      font-size: 0.98rem;
      color: #818CF8;
      display: flex;
      align-items: center;
      gap: 8px;
      margin: 0;
    }
    .scope-followup-messages {
      display: flex;
      flex-direction: column;
      gap: 12px;
      max-height: 460px;
      overflow-y: auto;
      margin-bottom: 14px;
      padding-right: 4px;
    }
    .followup-msg {
      padding: 12px 14px;
      border-radius: 10px;
      font-size: 0.85rem;
      line-height: 1.5;
    }
    .followup-msg.user {
      background: rgba(99, 102, 241, 0.2);
      border: 1px solid rgba(99, 102, 241, 0.4);
      align-self: flex-end;
      max-width: 88%;
      color: #E0E7FF;
    }
    .followup-msg.assistant {
      background: rgba(30, 41, 59, 0.85);
      border: 1px solid rgba(255, 255, 255, 0.1);
      align-self: flex-start;
      max-width: 98%;
      color: #F1F5F9;
    }
    .followup-msg pre {
      background: rgba(10, 14, 23, 0.9);
      padding: 10px;
      border-radius: 6px;
      overflow-x: auto;
      margin: 8px 0;
      font-family: var(--font-mono);
      font-size: 0.8rem;
    }
    .followup-chips {
      display: flex;
      flex-wrap: wrap;
      gap: 6px;
      margin-bottom: 10px;
    }
    .followup-chip {
      background: rgba(30, 41, 59, 0.9);
      border: 1px solid rgba(255, 255, 255, 0.12);
      color: #CBD5E1;
      font-size: 0.75rem;
      padding: 4px 10px;
      border-radius: 20px;
      cursor: pointer;
      transition: all 0.15s;
    }
    .followup-chip:hover {
      background: rgba(99, 102, 241, 0.25);
      border-color: #818CF8;
      color: #FFF;
    }
    .followup-input-bar {
      display: flex;
      gap: 8px;
      align-items: center;
    }
    .followup-input {
      flex: 1;
      background: rgba(10, 14, 23, 0.9);
      border: 1px solid var(--border-subtle);
      border-radius: 8px;
      padding: 10px 12px;
      color: #FFF;
      font-size: 0.85rem;
      outline: none;
      transition: border-color 0.2s;
    }
    .followup-input:focus {
      border-color: #818CF8;
    }

    /* Vault Timeframe Filter Chips */
    .vault-filter-chip {
      background: rgba(30, 41, 59, 0.85);
      border: 1px solid rgba(255, 255, 255, 0.12);
      color: #94A3B8;
      font-size: 0.78rem;
      font-weight: 600;
      padding: 6px 14px;
      border-radius: 20px;
      cursor: pointer;
      transition: all 0.15s;
    }
    .vault-filter-chip:hover {
      border-color: #818CF8;
      color: #FFF;
    }
    .vault-filter-chip.active {
      background: linear-gradient(135deg, rgba(99, 102, 241, 0.35), rgba(79, 70, 229, 0.35));
      border-color: #818CF8;
      color: #FFF;
      box-shadow: 0 0 10px rgba(99, 102, 241, 0.2);
    }

    /* Tasks & Voicemail Action Log Styles */
    .task-card {
      background: rgba(15, 23, 42, 0.85);
      border: 1px solid var(--border-subtle);
      border-radius: 12px;
      padding: 14px 16px;
      display: flex;
      flex-direction: column;
      gap: 8px;
      transition: all 0.2s;
    }
    .task-card:hover {
      border-color: rgba(99, 102, 241, 0.4);
      background: rgba(20, 30, 52, 0.9);
    }
    .task-card.done {
      opacity: 0.55;
      border-color: rgba(52, 211, 153, 0.3);
      background: rgba(10, 20, 30, 0.6);
    }
    .task-card.done .task-title {
      text-decoration: line-through;
      color: #94A3B8;
    }
    .task-header {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 10px;
    }
    .task-title-row {
      display: flex;
      align-items: flex-start;
      gap: 10px;
      flex: 1;
    }
    .task-checkbox {
      width: 20px;
      height: 20px;
      border-radius: 5px;
      cursor: pointer;
      accent-color: #10B981;
      margin-top: 2px;
    }
    .task-title {
      font-size: 0.92rem;
      font-weight: 600;
      color: #F8FAFC;
      line-height: 1.4;
    }
    .task-meta-row {
      display: flex;
      align-items: center;
      flex-wrap: wrap;
      gap: 8px;
      font-size: 0.76rem;
      color: #94A3B8;
      padding-left: 30px;
    }
    .task-badge-urgent {
      background: rgba(239, 68, 68, 0.18);
      color: #EF4444;
      border: 1px solid rgba(239, 68, 68, 0.4);
      padding: 2px 7px;
      border-radius: 4px;
      font-weight: 700;
      font-size: 0.72rem;
    }
    .task-badge-call {
      background: rgba(59, 130, 246, 0.18);
      color: #60A5FA;
      border: 1px solid rgba(59, 130, 246, 0.4);
      padding: 2px 7px;
      border-radius: 4px;
      font-weight: 600;
      font-size: 0.72rem;
    }
    .task-actions {
      display: flex;
      align-items: center;
      gap: 6px;
      margin-top: 4px;
      padding-left: 30px;
      flex-wrap: wrap;
    }

    /* Vault Report Cards */
    .vault-grid {
      display: flex;
      flex-direction: column;
      gap: 12px;
      margin-top: 12px;
    }

    .vault-card {
      background: rgba(15, 23, 42, 0.8);
      border: 1px solid var(--border-subtle);
      border-radius: 12px;
      padding: 16px;
      display: flex;
      flex-direction: column;
      gap: 10px;
      transition: all 0.2s;
    }

    .vault-card:hover {
      border-color: rgba(225, 27, 34, 0.3);
      background: rgba(20, 30, 52, 0.85);
    }

    .vault-card-header {
      display: flex;
      align-items: center;
      justify-content: space-between;
      flex-wrap: wrap;
      gap: 8px;
    }

    .vault-claim-badge {
      font-family: var(--font-mono);
      font-size: 0.85rem;
      font-weight: 700;
      color: #FFF;
      background: rgba(225, 27, 34, 0.2);
      border: 1px solid rgba(225, 27, 34, 0.4);
      padding: 3px 8px;
      border-radius: 6px;
      display: inline-flex;
      align-items: center;
      gap: 6px;
    }

    .vault-last4-tag {
      background: var(--brand-red);
      color: #FFF;
      padding: 1px 5px;
      border-radius: 4px;
      font-size: 0.72rem;
    }

    .vault-card-address {
      font-size: 0.88rem;
      font-weight: 600;
      color: #F1F5F9;
    }

    .vault-card-meta {
      display: flex;
      flex-wrap: wrap;
      gap: 10px;
      font-size: 0.76rem;
      color: var(--text-muted);
    }

    .vault-card-actions {
      display: flex;
      flex-wrap: wrap;
      gap: 6px;
      border-top: 1px solid rgba(255, 255, 255, 0.05);
      padding-top: 10px;
    }

    /* Calculator Results */
    .calc-result-box {
      background: rgba(15, 23, 42, 0.95);
      border: 1px solid var(--border-accent);
      border-radius: 12px;
      padding: 16px;
      margin-top: 14px;
    }

    .calc-result-header {
      font-family: var(--font-heading);
      font-size: 0.95rem;
      font-weight: 700;
      color: #FFF;
      display: flex;
      align-items: center;
      justify-content: space-between;
      margin-bottom: 10px;
    }

    .calc-stat-row {
      display: flex;
      justify-content: space-between;
      align-items: center;
      padding: 6px 0;
      border-bottom: 1px solid rgba(255, 255, 255, 0.06);
      font-size: 0.85rem;
    }
    .calc-stat-row:last-child { border-bottom: none; }

    .calc-badge-decision {
      display: inline-block;
      padding: 6px 12px;
      border-radius: 8px;
      font-weight: 700;
      font-size: 0.85rem;
      margin-top: 8px;
      text-align: center;
      width: 100%;
    }

    .badge-replace {
      background: rgba(225, 27, 34, 0.2);
      border: 1px solid #E11B22;
      color: #FF6B6B;
    }

    .badge-repair {
      background: rgba(16, 185, 129, 0.2);
      border: 1px solid #10B981;
      color: #34D399;
    }

    .badge-review {
      background: rgba(245, 158, 11, 0.2);
      border: 1px solid #F59E0B;
      color: #FBBF24;
    }

    /* Accordions & References */
    .accordion-item {
      background: rgba(15, 23, 42, 0.6);
      border: 1px solid var(--border-subtle);
      border-radius: 10px;
      margin-bottom: 8px;
      overflow: hidden;
    }

    .accordion-header {
      padding: 12px 14px;
      font-family: var(--font-heading);
      font-size: 0.9rem;
      font-weight: 600;
      color: #FFF;
      cursor: pointer;
      display: flex;
      align-items: center;
      justify-content: space-between;
      transition: background 0.2s;
    }

    .accordion-header:hover {
      background: rgba(255, 255, 255, 0.04);
    }

    .accordion-content {
      display: none;
      padding: 12px 14px;
      font-size: 0.84rem;
      line-height: 1.5;
      color: var(--text-muted);
      border-top: 1px solid var(--border-subtle);
      background: rgba(10, 14, 23, 0.4);
    }

    .accordion-item.open .accordion-content {
      display: block;
    }

    /* Xactimate List */
    .search-input {
      width: 100%;
      background: rgba(15, 23, 42, 0.8);
      border: 1px solid var(--border-subtle);
      border-radius: 9px;
      padding: 10px 14px;
      color: #FFF;
      font-size: 0.88rem;
      margin-bottom: 12px;
      outline: none;
    }
    .search-input:focus { border-color: var(--brand-red); }

    .code-list {
      display: flex;
      flex-direction: column;
      gap: 8px;
      max-height: 460px;
      overflow-y: auto;
    }

    .code-item {
      background: rgba(15, 23, 42, 0.7);
      border: 1px solid var(--border-subtle);
      padding: 10px 14px;
      border-radius: 9px;
      display: flex;
      flex-direction: column;
      align-items: stretch;
      gap: 6px;
      cursor: default;
      transition: all 0.15s ease;
      margin-bottom: 8px;
    }

    .code-item:hover {
      background: rgba(30, 41, 59, 0.85);
      border-color: rgba(99, 102, 241, 0.45);
    }

    .code-tag {
      font-family: var(--font-mono);
      font-weight: 700;
      color: #818CF8;
      font-size: 0.88rem;
    }

    .code-desc {
      font-size: 0.82rem;
      color: #E2E8F0;
      margin-top: 2px;
    }

    .code-f9-box {
      font-size: 0.75rem;
      color: #94A3B8;
      font-style: italic;
      background: rgba(0, 0, 0, 0.3);
      padding: 6px 10px;
      border-radius: 6px;
      border-left: 3px solid #6366F1;
      margin-top: 4px;
      line-height: 1.45;
    }

    .code-btn-action {
      padding: 4px 10px;
      font-size: 0.72rem;
      font-weight: 600;
      border-radius: 6px;
      cursor: pointer;
      transition: all 0.15s ease;
    }

    .code-copy-badge {
      font-size: 0.72rem;
      color: var(--text-muted);
      border: 1px solid var(--border-subtle);
      padding: 3px 7px;
      border-radius: 6px;
    }

    /* Modal for QR Code */
    .modal-backdrop {
      display: none;
      position: fixed;
      inset: 0;
      background: rgba(0, 0, 0, 0.8);
      backdrop-filter: blur(8px);
      z-index: 100;
      align-items: center;
      justify-content: center;
      padding: 20px;
    }

    .modal-backdrop.open { display: flex; }

    .modal-dialog {
      background: #111827;
      border: 1px solid var(--border-accent);
      border-radius: 16px;
      padding: 24px;
      max-width: 380px;
      width: 100%;
      text-align: center;
      box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
    }

    .modal-dialog h3 {
      font-family: var(--font-heading);
      font-size: 1.2rem;
      color: #FFF;
      margin-bottom: 8px;
    }

    .modal-dialog p {
      font-size: 0.82rem;
      color: var(--text-muted);
      margin-bottom: 16px;
    }

    .qr-container {
      background: #FFF;
      padding: 14px;
      border-radius: 12px;
      display: inline-block;
      margin-bottom: 16px;
    }

    /* Spinner */
    .spinner {
      width: 18px;
      height: 18px;
      border: 2px solid rgba(255, 255, 255, 0.2);
      border-top-color: #FFF;
      border-radius: 50%;
      animation: spin 0.6s linear infinite;
      display: inline-block;
    }
    @keyframes spin { to { transform: rotate(360deg); } }

    /* Markdown Styling */
    .markdown-content {
      max-width: 100%;
      overflow-wrap: break-word;
      word-break: break-word;
    }
    .markdown-content table {
      width: 100%;
      max-width: 100%;
      display: block;
      overflow-x: auto;
      -webkit-overflow-scrolling: touch;
      margin: 12px 0;
      border-collapse: collapse;
    }
    .markdown-content pre, .markdown-content code {
      max-width: 100%;
      overflow-x: auto;
      white-space: pre-wrap;
      word-break: break-word;
    }
    .markdown-content ul, .markdown-content ol {
      margin-left: 18px;
      margin-top: 6px;
      margin-bottom: 6px;
    }
    .markdown-content li { margin-bottom: 4px; }
    .markdown-content strong { color: #FFF; }
    .markdown-content h2, .markdown-content h3, .markdown-content h4 {
      margin-top: 12px;
      margin-bottom: 6px;
      color: #FF6B6B;
      font-family: var(--font-heading);
    }

    /* ========================================================
       SAMSUNG GALAXY S26+ PRO DOCUMENT & CAMERA SCANNER HUD
       ======================================================== */
    .s26-camera-overlay {
      position: fixed;
      inset: 0;
      z-index: 999999;
      background: #000;
      display: none;
      flex-direction: column;
      user-select: none;
      -webkit-user-select: none;
      overflow: hidden;
    }
    .s26-camera-overlay.active {
      display: flex;
    }

    /* Viewport wrapper holding live stream */
    .s26-camera-viewport {
      position: relative;
      flex: 1;
      width: 100%;
      height: 100%;
      overflow: hidden;
      background: #05070c;
      display: flex;
      align-items: center;
      justify-content: center;
    }
    .s26-camera-video {
      width: 100%;
      height: 100%;
      object-fit: cover;
      display: block;
    }

    /* Top HUD Bar */
    .s26-top-hud {
      position: absolute;
      top: 0;
      left: 0;
      right: 0;
      z-index: 10;
      padding: env(safe-area-inset-top, 12px) 14px 12px 14px;
      background: linear-gradient(180deg, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0.4) 65%, transparent 100%);
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 8px;
    }
    .s26-badge-group {
      display: flex;
      align-items: center;
      gap: 6px;
      background: rgba(15, 23, 42, 0.85);
      border: 1px solid rgba(239, 68, 68, 0.4);
      padding: 5px 10px;
      border-radius: 999px;
      backdrop-filter: blur(8px);
      -webkit-backdrop-filter: blur(8px);
    }
    .s26-lens-badge {
      font-size: 0.68rem;
      font-weight: 700;
      color: #F87171;
      letter-spacing: 0.04em;
      display: flex;
      align-items: center;
      gap: 5px;
    }
    .s26-live-dot {
      width: 7px;
      height: 7px;
      border-radius: 50%;
      background: #10B981;
      box-shadow: 0 0 8px #10B981;
      animation: s26-pulse 1.8s infinite ease-in-out;
    }
    @keyframes s26-pulse {
      0%, 100% { transform: scale(1); opacity: 1; }
      50% { transform: scale(1.3); opacity: 0.6; }
    }
    .s26-hud-btn {
      background: rgba(255, 255, 255, 0.12);
      border: 1px solid rgba(255, 255, 255, 0.2);
      color: #FFF;
      width: 38px;
      height: 38px;
      border-radius: 50%;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      font-size: 0.9rem;
      cursor: pointer;
      backdrop-filter: blur(8px);
      -webkit-backdrop-filter: blur(8px);
      transition: all 0.2s ease;
    }
    .s26-hud-btn:active {
      transform: scale(0.92);
      background: rgba(239, 68, 68, 0.35);
    }
    .s26-hud-btn.active-glow {
      background: #F59E0B;
      color: #000;
      border-color: #FCD34D;
      box-shadow: 0 0 14px rgba(245, 158, 11, 0.6);
    }

    /* Alignment & Document Guide Overlay */
    .s26-guide-layer {
      position: absolute;
      inset: 0;
      pointer-events: none;
      display: flex;
      align-items: center;
      justify-content: center;
      padding: 24px;
    }
    .s26-doc-frame {
      width: 88%;
      height: 72%;
      max-width: 440px;
      max-height: 600px;
      border-radius: 12px;
      position: relative;
      border: 2px dashed rgba(239, 68, 68, 0.45);
      box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.38);
      transition: all 0.3s ease;
    }
    .s26-doc-corner {
      position: absolute;
      width: 22px;
      height: 22px;
      border-color: #EF4444;
      border-style: solid;
      box-shadow: 0 0 8px rgba(239, 68, 68, 0.8);
    }
    .s26-doc-corner.tl { top: -2px; left: -2px; border-width: 4px 0 0 4px; border-top-left-radius: 8px; }
    .s26-doc-corner.tr { top: -2px; right: -2px; border-width: 4px 4px 0 0; border-top-right-radius: 8px; }
    .s26-doc-corner.bl { bottom: -2px; left: -2px; border-width: 0 0 4px 4px; border-bottom-left-radius: 8px; }
    .s26-doc-corner.br { bottom: -2px; right: -2px; border-width: 0 4px 4px 0; border-bottom-right-radius: 8px; }

    /* Laser Scan Animation Line */
    .s26-laser-line {
      position: absolute;
      left: 0;
      right: 0;
      height: 2px;
      background: linear-gradient(90deg, transparent 0%, #EF4444 50%, transparent 100%);
      box-shadow: 0 0 10px #EF4444, 0 0 20px #EF4444;
      animation: s26-scan 2.5s ease-in-out infinite alternate;
    }
    @keyframes s26-scan {
      0% { top: 4%; opacity: 0.2; }
      50% { opacity: 0.9; }
      100% { top: 96%; opacity: 0.2; }
    }

    /* 10x10 Test Square Grid (Roof Damage Mode) */
    .s26-testsquare-grid {
      position: absolute;
      inset: 0;
      display: none;
      grid-template-columns: repeat(10, 1fr);
      grid-template-rows: repeat(10, 1fr);
      border: 2px solid #38BDF8;
      box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.4);
    }
    .s26-testsquare-grid div {
      border: 0.5px solid rgba(56, 189, 248, 0.3);
    }
    .s26-guide-layer.mode-square .s26-doc-frame { display: none; }
    .s26-guide-layer.mode-square .s26-testsquare-grid {
      display: grid;
      width: 82vw;
      height: 82vw;
      max-width: 380px;
      max-height: 380px;
      margin: auto;
    }

    /* Guide Status Hint Pill */
    .s26-guide-hint {
      position: absolute;
      bottom: 20px;
      left: 50%;
      transform: translateX(-50%);
      background: rgba(15, 23, 42, 0.85);
      border: 1px solid rgba(255, 255, 255, 0.15);
      color: #E2E8F0;
      font-size: 0.72rem;
      font-weight: 600;
      padding: 5px 12px;
      border-radius: 99px;
      white-space: nowrap;
      backdrop-filter: blur(8px);
      box-shadow: 0 4px 12px rgba(0,0,0,0.5);
    }

    /* Mode & Filter Toolbar */
    .s26-mode-bar {
      position: absolute;
      top: 60px;
      left: 50%;
      transform: translateX(-50%);
      z-index: 10;
      display: flex;
      gap: 6px;
      background: rgba(10, 14, 23, 0.8);
      padding: 4px;
      border-radius: 99px;
      border: 1px solid rgba(255, 255, 255, 0.1);
      backdrop-filter: blur(10px);
    }
    .s26-mode-btn {
      background: transparent;
      border: none;
      color: #94A3B8;
      font-size: 0.7rem;
      font-weight: 700;
      padding: 4px 10px;
      border-radius: 99px;
      cursor: pointer;
      transition: all 0.2s ease;
    }
    .s26-mode-btn.active {
      background: #EF4444;
      color: #FFF;
      box-shadow: 0 2px 8px rgba(239, 68, 68, 0.5);
    }

    /* Shutter Flash Animation Effect */
    .s26-flash-screen {
      position: absolute;
      inset: 0;
      background: #FFF;
      opacity: 0;
      pointer-events: none;
      z-index: 20;
    }
    .s26-flash-screen.snap {
      animation: s26-flash-anim 0.25s ease-out;
    }
    @keyframes s26-flash-anim {
      0% { opacity: 0.9; }
      100% { opacity: 0; }
    }

    /* Bottom Control Deck */
    .s26-bottom-deck {
      background: #000;
      padding: 10px 18px env(safe-area-inset-bottom, 16px) 18px;
      display: flex;
      flex-direction: column;
      gap: 10px;
      z-index: 10;
    }

    /* Multi-Snap Thumbnail Tray */
    .s26-tray-wrapper {
      display: flex;
      align-items: center;
      justify-content: space-between;
      min-height: 48px;
      gap: 10px;
    }
    .s26-tray-scroll {
      display: flex;
      gap: 8px;
      overflow-x: auto;
      flex: 1;
      padding: 2px 0;
    }
    .s26-tray-thumb {
      width: 44px;
      height: 44px;
      border-radius: 8px;
      border: 2px solid #EF4444;
      object-fit: cover;
      position: relative;
      flex-shrink: 0;
      animation: s26-thumb-pop 0.25s ease-out;
    }
    @keyframes s26-thumb-pop {
      0% { transform: scale(0.5); opacity: 0; }
      100% { transform: scale(1); opacity: 1; }
    }
    .s26-tray-count {
      font-size: 0.75rem;
      font-weight: 700;
      color: #38BDF8;
      display: flex;
      align-items: center;
      gap: 4px;
      white-space: nowrap;
    }

    /* Main Shutter Deck Row */
    .s26-shutter-row {
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding: 4px 10px 6px 10px;
    }
    .s26-deck-sidebtn {
      background: rgba(255, 255, 255, 0.1);
      border: 1px solid rgba(255, 255, 255, 0.18);
      color: #FFF;
      padding: 9px 13px;
      border-radius: 12px;
      font-size: 0.78rem;
      font-weight: 600;
      display: inline-flex;
      align-items: center;
      gap: 6px;
      cursor: pointer;
      transition: all 0.2s;
    }
    .s26-deck-sidebtn:active {
      transform: scale(0.95);
      background: rgba(255, 255, 255, 0.2);
    }
    .s26-btn-done {
      background: linear-gradient(135deg, #10B981, #059669);
      border: none;
      color: #FFF;
      font-weight: 700;
      box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
    }

    /* Pro Shutter Button */
    .s26-shutter-btn {
      width: 72px;
      height: 72px;
      border-radius: 50%;
      background: transparent;
      border: 4px solid rgba(255, 255, 255, 0.85);
      padding: 4px;
      display: flex;
      align-items: center;
      justify-content: center;
      cursor: pointer;
      transition: transform 0.15s ease;
      box-shadow: 0 0 20px rgba(239, 68, 68, 0.35);
    }
    .s26-shutter-btn:active {
      transform: scale(0.9);
    }
    .s26-shutter-core {
      width: 100%;
      height: 100%;
      border-radius: 50%;
      background: linear-gradient(135deg, #EF4444, #B91C1C);
      display: flex;
      align-items: center;
      justify-content: center;
      box-shadow: inset 0 2px 4px rgba(255, 255, 255, 0.4);
    }
    .s26-shutter-core svg {
      width: 26px;
      height: 26px;
      fill: none;
      stroke: #FFF;
      stroke-width: 2;
    }

    /* ========================================================
       FLOATING FIELD MIC & ROOF VOICE MEMO SYSTEM
       ======================================================== */
    .floating-field-mic-btn {
      position: fixed;
      bottom: calc(env(safe-area-inset-bottom, 20px) + 85px);
      right: 18px;
      width: 54px;
      height: 54px;
      border-radius: 50%;
      background: linear-gradient(135deg, #EF4444, #B91C1C);
      border: 3px solid rgba(255, 255, 255, 0.35);
      color: #FFF;
      display: flex;
      align-items: center;
      justify-content: center;
      cursor: pointer;
      z-index: 99990;
      box-shadow: 0 8px 24px rgba(239, 68, 68, 0.5), 0 2px 6px rgba(0, 0, 0, 0.4);
      transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
    }
    body[data-active-view="copilot"] .floating-field-mic-btn,
    body:has(#pane-copilot.active) .floating-field-mic-btn,
    body.view-copilot .floating-field-mic-btn {
      display: none !important;
    }
    .floating-field-mic-btn:hover {
      transform: scale(1.08);
      box-shadow: 0 10px 28px rgba(239, 68, 68, 0.7);
    }
    .floating-field-mic-btn:active {
      transform: scale(0.92);
    }
    .floating-field-mic-btn svg {
      width: 26px;
      height: 26px;
    }
    .floating-mic-pulse {
      position: absolute;
      inset: -4px;
      border-radius: 50%;
      border: 2px solid #EF4444;
      animation: mic-radar 2.4s infinite ease-out;
      pointer-events: none;
    }
    @keyframes mic-radar {
      0% { transform: scale(0.95); opacity: 0.8; }
      100% { transform: scale(1.4); opacity: 0; }
    }

    /* Big Record / Pause Deck */
    .big-record-toggle-btn {
      width: 84px;
      height: 84px;
      border-radius: 50%;
      background: transparent;
      border: 4px solid rgba(255, 255, 255, 0.25);
      padding: 4px;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      cursor: pointer;
      transition: all 0.2s ease;
    }
    .big-record-toggle-btn:active {
      transform: scale(0.92);
    }
    .big-record-inner {
      width: 100%;
      height: 100%;
      border-radius: 50%;
      background: linear-gradient(135deg, #EF4444, #B91C1C);
      display: flex;
      align-items: center;
      justify-content: center;
      color: #FFF;
      box-shadow: 0 4px 14px rgba(239, 68, 68, 0.5);
      transition: all 0.25s ease;
    }
    .big-record-toggle-btn.recording {
      border-color: #EF4444;
      animation: big-rec-pulse 1.2s infinite ease-in-out;
    }
    .big-record-toggle-btn.recording .big-record-inner {
      background: linear-gradient(135deg, #EF4444, #DC2626);
      box-shadow: 0 0 20px rgba(239, 68, 68, 0.8);
    }
    .big-record-toggle-btn.paused {
      border-color: #F59E0B;
    }
    .big-record-toggle-btn.paused .big-record-inner {
      background: linear-gradient(135deg, #F59E0B, #D97706);
      box-shadow: 0 0 16px rgba(245, 158, 11, 0.6);
    }
    @keyframes big-rec-pulse {
      0%, 100% { transform: scale(1); }
      50% { transform: scale(1.06); }
    }

    /* Memo Area Chips */
    .memo-area-chip {
      background: rgba(255, 255, 255, 0.06);
      border: 1px solid rgba(255, 255, 255, 0.12);
      color: #94A3B8;
      font-size: 0.72rem;
      font-weight: 600;
      padding: 5px 11px;
      border-radius: 99px;
      cursor: pointer;
      transition: all 0.2s;
    }
    .memo-area-chip:hover {
      background: rgba(255, 255, 255, 0.12);
      color: #FFF;
    }
    .memo-area-chip.active {
      background: rgba(239, 68, 68, 0.2);
      border-color: #EF4444;
      color: #F87171;
    }

    /* Pending Voice Note Cards on Field Scope */
    .pending-note-card {
      background: rgba(10, 14, 23, 0.8);
      border: 1px solid rgba(239, 68, 68, 0.35);
      border-radius: 12px;
      padding: 12px;
      display: flex;
      flex-direction: column;
      gap: 8px;
      transition: all 0.2s ease;
    }
    .pending-note-card:hover {
      border-color: rgba(239, 68, 68, 0.6);
      box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
    }
    .pending-note-header {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 8px;
    }
    .pending-note-tag {
      font-size: 0.78rem;
      font-weight: 700;
      color: #F87171;
      display: flex;
      align-items: center;
      gap: 6px;
    }
    .pending-note-time {
      font-size: 0.68rem;
      color: #94A3B8;
      font-family: var(--font-mono);
    }
    .pending-note-body {
      font-size: 0.8rem;
      color: #E2E8F0;
      line-height: 1.45;
      background: rgba(0, 0, 0, 0.35);
      border-radius: 8px;
      padding: 8px 10px;
      white-space: pre-wrap;
      max-height: 140px;
      overflow-y: auto;
    }
    .pending-note-actions {
      display: flex;
      align-items: center;
      justify-content: flex-end;
      gap: 8px;
      flex-wrap: wrap;
    }
  
    /* ==================================================== */
    /* STATE FARM ROOFING SCOPE SHEET & EAGLEVIEW ESTIMATOR */
    /* ==================================================== */
    .sf-scope-container {
      display: flex;
      flex-direction: column;
      gap: 16px;
      margin-bottom: 24px;
    }
    .sf-scope-header-card {
      background: linear-gradient(135deg, rgba(225, 27, 34, 0.12), rgba(18, 26, 43, 0.9));
      border: 1px solid rgba(225, 27, 34, 0.35);
      border-radius: 12px;
      padding: 16px;
      box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35);
    }
    .sf-header-grid {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
      gap: 12px;
      margin-top: 12px;
    }
    .sf-form-group {
      display: flex;
      flex-direction: column;
      gap: 4px;
    }
    .sf-form-label {
      font-size: 0.75rem;
      font-weight: 700;
      color: #94A3B8;
      text-transform: uppercase;
      letter-spacing: 0.5px;
    }
    .sf-form-input, .sf-form-select {
      background: rgba(15, 23, 42, 0.85);
      border: 1px solid rgba(255, 255, 255, 0.12);
      border-radius: 8px;
      color: #FFF;
      padding: 8px 12px;
      font-size: 0.88rem;
      outline: none;
      transition: all 0.2s;
    }
    .sf-form-input:focus, .sf-form-select:focus {
      border-color: #E11B22;
      box-shadow: 0 0 0 2px rgba(225, 27, 34, 0.25);
    }
    .sf-structure-switch {
      display: flex;
      background: rgba(15, 23, 42, 0.9);
      padding: 4px;
      border-radius: 10px;
      border: 1px solid rgba(255, 255, 255, 0.08);
      gap: 6px;
    }
    .sf-structure-btn {
      flex: 1;
      padding: 10px;
      font-size: 0.84rem;
      font-weight: 700;
      color: #94A3B8;
      background: transparent;
      border: none;
      border-radius: 8px;
      cursor: pointer;
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 6px;
      transition: all 0.2s;
    }
    .sf-structure-btn.active {
      background: linear-gradient(135deg, #E11B22, #991B1B);
      color: #FFF;
      box-shadow: 0 2px 10px rgba(225, 27, 34, 0.35);
    }
    .sf-damage-matrix {
      width: 100%;
      border-collapse: collapse;
      margin-top: 10px;
      background: rgba(15, 23, 42, 0.7);
      border-radius: 8px;
      overflow: hidden;
    }
    .sf-damage-matrix th {
      background: rgba(30, 41, 59, 0.9);
      padding: 8px 10px;
      font-size: 0.75rem;
      font-weight: 700;
      color: #E2E8F0;
      text-align: center;
      border: 1px solid rgba(255, 255, 255, 0.08);
    }
    .sf-damage-matrix td {
      padding: 8px;
      border: 1px solid rgba(255, 255, 255, 0.06);
      text-align: center;
    }
    .sf-stepper {
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 4px;
    }
    .sf-step-btn {
      width: 32px;
      height: 32px;
      background: rgba(30, 41, 59, 0.9);
      border: 1px solid rgba(255, 255, 255, 0.15);
      border-radius: 6px;
      color: #FFF;
      font-size: 1.1rem;
      font-weight: bold;
      display: flex;
      align-items: center;
      justify-content: center;
      cursor: pointer;
      user-select: none;
      transition: background 0.15s;
    }
    .sf-step-btn:hover {
      background: rgba(225, 27, 34, 0.3);
      border-color: #E11B22;
    }
    .sf-step-input {
      width: 54px;
      height: 32px;
      background: rgba(15, 23, 42, 0.95);
      border: 1px solid rgba(255, 255, 255, 0.12);
      border-radius: 6px;
      color: #38BDF8;
      font-family: var(--font-mono);
      font-size: 0.95rem;
      font-weight: 700;
      text-align: center;
      outline: none;
    }
    .sf-appurtenances-grid {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
      gap: 14px;
    }
    .sf-appurtenance-card {
      background: rgba(18, 26, 43, 0.85);
      border: 1px solid rgba(255, 255, 255, 0.08);
      border-radius: 10px;
      padding: 14px;
      display: flex;
      flex-direction: column;
      gap: 10px;
    }
    .sf-appurtenance-card-title {
      font-size: 0.84rem;
      font-weight: 700;
      color: #F8FAFC;
      display: flex;
      align-items: center;
      gap: 6px;
      padding-bottom: 6px;
      border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    }
    .sf-appurtenance-row {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 8px;
    }
    .sf-appurtenance-name {
      font-size: 0.82rem;
      color: #CBD5E1;
      display: flex;
      flex-direction: column;
    }
    .sf-appurtenance-code {
      font-size: 0.68rem;
      color: #818CF8;
      font-family: var(--font-mono);
    }
    .sf-eagleview-dropzone {
      border: 2px dashed rgba(225, 27, 34, 0.4);
      background: rgba(225, 27, 34, 0.04);
      border-radius: 12px;
      padding: 20px 16px;
      text-align: center;
      cursor: pointer;
      transition: all 0.2s;
      display: flex;
      flex-direction: column;
      align-items: center;
      gap: 8px;
    }
    .sf-eagleview-dropzone:hover {
      background: rgba(225, 27, 34, 0.08);
      border-color: #E11B22;
    }
    .sf-action-toolbar {
      display: flex;
      flex-wrap: wrap;
      gap: 8px;
      margin-top: 14px;
    }
    .sf-calc-summary-pill {
      background: rgba(30, 41, 59, 0.8);
      border: 1px solid rgba(255, 255, 255, 0.1);
      border-radius: 8px;
      padding: 8px 12px;
      display: flex;
      flex-direction: column;
      gap: 2px;
    }
    .sf-pill-label {
      font-size: 0.68rem;
      color: #94A3B8;
      text-transform: uppercase;
      font-weight: 700;
    }
    .sf-pill-value {
      font-size: 1.1rem;
      font-weight: 800;
      color: #38BDF8;
      font-family: var(--font-mono);
    }

    /* ========================================================
       COLLAPSIBLE LOWER-LEFT APPS DRAWER (ECOSYSTEM NAVIGATOR)
       ======================================================== */
    .hub-dock-container {
      position: fixed;
      bottom: calc(env(safe-area-inset-bottom, 14px) + 14px);
      left: calc(env(safe-area-inset-left, 12px) + 12px);
      right: auto;
      z-index: 99990;
      display: flex;
      flex-direction: column;
      align-items: flex-start;
    }
    .hub-dock-trigger {
      display: inline-flex;
      align-items: center;
      gap: 5px;
      background: rgba(15, 23, 42, 0.92);
      border: 1px solid rgba(255, 255, 255, 0.18);
      color: #94A3B8;
      font-size: 0.72rem;
      font-weight: 700;
      padding: 5px 10px;
      border-radius: 20px;
      backdrop-filter: blur(14px);
      -webkit-backdrop-filter: blur(14px);
      box-shadow: 0 4px 14px rgba(0, 0, 0, 0.5);
      cursor: pointer;
      transition: all 0.2s ease;
    }
    .hub-dock-trigger:hover {
      color: #FFF;
      border-color: rgba(99, 102, 241, 0.5);
      background: #1E293B;
    }
    .hub-dock-drawer {
      background: rgba(15, 23, 42, 0.97);
      border: 1px solid rgba(255, 255, 255, 0.15);
      border-radius: 12px;
      padding: 10px;
      width: 220px;
      margin-bottom: 8px;
      box-shadow: 0 12px 30px rgba(0, 0, 0, 0.6);
      backdrop-filter: blur(16px);
      -webkit-backdrop-filter: blur(16px);
      animation: fadeIn 0.15s ease;
    }
    .hub-drawer-header {
      display: flex;
      justify-content: space-between;
      align-items: center;
      font-size: 0.72rem;
      font-weight: 700;
      color: #818CF8;
      text-transform: uppercase;
      padding-bottom: 6px;
      border-bottom: 1px solid rgba(255, 255, 255, 0.08);
      margin-bottom: 6px;
    }
    .hub-drawer-items {
      display: flex;
      flex-direction: column;
      gap: 4px;
    }
    .hub-drawer-link {
      display: flex;
      align-items: center;
      gap: 8px;
      padding: 6px 8px;
      border-radius: 8px;
      text-decoration: none;
      color: #CBD5E1;
      font-size: 0.76rem;
      transition: background 0.15s ease;
    }
    .hub-drawer-link:hover {
      background: rgba(255, 255, 255, 0.08);
      color: #FFF;
    }
    .hub-drawer-link.active {
      background: rgba(225, 27, 34, 0.15);
      border: 1px solid rgba(225, 27, 34, 0.3);
      color: #F87171;
    }
    .hub-drawer-link strong {
      display: block;
      font-size: 0.78rem;
      color: #FFF;
    }
    .hub-drawer-link small {
      display: block;
      font-size: 0.65rem;
      color: #94A3B8;
    }

    /* ========================================================
       UNIVERSAL SEARCH COMMAND PALETTE (⌘K)
       ======================================================== */
    .cmd-palette-backdrop {
      position: fixed;
      inset: 0;
      background: rgba(0, 0, 0, 0.75);
      backdrop-filter: blur(8px);
      -webkit-backdrop-filter: blur(8px);
      z-index: 999999;
      display: flex;
      align-items: flex-start;
      justify-content: center;
      padding: 60px 16px;
      opacity: 0;
      pointer-events: none;
      transition: opacity 0.2s ease;
    }
    .cmd-palette-backdrop.active {
      opacity: 1;
      pointer-events: auto;
    }
    .cmd-palette-card {
      background: #0B101B;
      border: 1px solid rgba(255, 255, 255, 0.15);
      border-radius: 16px;
      width: 100%;
      max-width: 580px;
      box-shadow: 0 25px 60px rgba(0, 0, 0, 0.8), 0 0 20px rgba(99, 102, 241, 0.15);
      overflow: hidden;
      transform: translateY(-10px) scale(0.98);
      transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    }
    .cmd-palette-backdrop.active .cmd-palette-card {
      transform: translateY(0) scale(1);
    }
    .cmd-search-input-row {
      display: flex;
      align-items: center;
      gap: 12px;
      padding: 16px 20px;
      border-bottom: 1px solid rgba(255, 255, 255, 0.08);
      background: rgba(15, 23, 42, 0.6);
    }
    .cmd-search-input {
      flex: 1;
      background: none;
      border: none;
      color: #FFF;
      font-size: 1.05rem;
      font-family: inherit;
      outline: none;
    }
    .cmd-search-input::placeholder {
      color: #64748B;
    }
    .cmd-results-list {
      max-height: 380px;
      overflow-y: auto;
      padding: 10px;
      display: flex;
      flex-direction: column;
      gap: 4px;
    }
    .cmd-item {
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding: 10px 14px;
      border-radius: 10px;
      cursor: pointer;
      color: #E2E8F0;
      text-decoration: none;
      transition: background 0.15s ease;
      background: transparent;
      border: 1px solid transparent;
    }
    .cmd-item:hover, .cmd-item.selected {
      background: rgba(99, 102, 241, 0.15);
      border-color: rgba(99, 102, 241, 0.3);
      color: #FFF;
    }
    .cmd-item-title {
      font-size: 0.88rem;
      font-weight: 600;
      display: flex;
      align-items: center;
      gap: 8px;
    }
    .cmd-item-badge {
      font-size: 0.68rem;
      font-weight: 700;
      padding: 2px 6px;
      border-radius: 4px;
      background: rgba(255, 255, 255, 0.08);
      color: #94A3B8;
      font-family: var(--font-mono);
    }
    .cmd-footer {
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding: 10px 18px;
      border-top: 1px solid rgba(255, 255, 255, 0.08);
      background: rgba(10, 14, 23, 0.8);
      font-size: 0.72rem;
      color: #64748B;
    }
    .top-header {
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding-top: calc(env(safe-area-inset-top, 0px) + 10px);
      padding-bottom: 10px;
      padding-left: calc(env(safe-area-inset-left, 0px) + 14px);
      padding-right: calc(env(safe-area-inset-right, 0px) + 14px);
      background: rgba(10, 14, 23, 0.94);
      backdrop-filter: blur(16px);
      -webkit-backdrop-filter: blur(16px);
      border-bottom: 1px solid rgba(255, 255, 255, 0.08);
      position: sticky;
      top: 0;
      z-index: 100;
      gap: 8px;
    }
    .header-actions {
      display: flex;
      align-items: center;
      gap: 6px;
      flex-shrink: 0;
    }
    @media (max-width: 600px) {
      .top-header {
        padding-top: calc(env(safe-area-inset-top, 0px) + 8px);
        padding-bottom: 8px;
        padding-left: calc(env(safe-area-inset-left, 0px) + 10px);
        padding-right: calc(env(safe-area-inset-right, 0px) + 10px);
      }
      .active-view-title {
        font-size: 0.95rem;
        max-width: 140px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
      }
      #sync-status-text {
        display: none;
      }
    }