:root {
      --bg-main: #070B12;
      --bg-panel: #0E1522;
      --bg-card: #131D2E;
      --bg-input: #0A0F1A;
      --bg-hover: #1A263B;
      --border-color: #1E2B3E;
      --border-light: #2A3B54;
      
      --text-main: #F8FAFC;
      --text-muted: #94A3B8;
      --text-dim: #64748B;
      
      --accent-blue: #3B82F6;
      --accent-blue-hover: #2563EB;
      --accent-indigo: #6366F1;
      --accent-cyan: #06B6D4;
      --accent-green: #10B981;
      --accent-gold: #F59E0B;
      --accent-red: #EF4444;
      
      --map-ocean: #15273B;
      --map-land: #E3DBD0;
      --map-stroke: #4B5B6D;

      /* Floating Overlays & Controls */
      --floating-bg: rgba(14, 21, 34, 0.88);
      --floating-border: var(--border-color);
      --floating-shadow: 0 4px 16px rgba(0, 0, 0, 0.45);
      --floating-text: #F8FAFC;
      --floating-text-dim: #94A3B8;
      --floating-hover: var(--bg-hover);
      --zoom-pill-bg: #0c4a6e;
      --zoom-pill-color: #FFFFFF;
      --zoom-pill-border: rgba(255, 255, 255, 0.15);
      --zoom-pill-hover: rgba(255, 255, 255, 0.18);
      --zoom-pill-divider: rgba(255, 255, 255, 0.25);

      /* Component Tokens */
      --card-header-color: #CBD5E1;
      --card-header-hover: #FFFFFF;
      --scrollbar-thumb: #1E2B3E;
      --scrollbar-thumb-hover: #334460;
      --switch-bg: #1E293B;
      --dropdown-bg: #0d1524;
      --dropdown-search-bg: rgba(10, 15, 26, 0.92);
      
      --radius-sm: 4px;
      --radius-md: 6px;
      --radius-lg: 8px;
      --radius-pill: 9999px;
      
      --font-ui: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
      --font-mono: 'JetBrains Mono', monospace;
    }

    [data-theme="light"] {
      --bg-main: #EDE7DF;
      --bg-panel: #FAF7F2;
      --bg-card: #FFFFFF;
      --bg-input: #FFFFFF;
      --bg-hover: #EAE4DA;
      --border-color: #E2DACF;
      --border-light: #D7CEC2;
      
      --text-main: #1F2937;
      --text-muted: #4B5563;
      --text-dim: #6B7280;

      --accent-blue: #1E5E45;
      --accent-blue-hover: #164E37;
      --accent-indigo: #2D6A4F;
      
      --map-ocean: #FAF8F5;
      --map-land: #EDE6D8;
      --map-stroke: #8C8275;

      /* Floating Overlays & Controls for Light Mode */
      --floating-bg: rgba(255, 255, 255, 0.95);
      --floating-border: #E2DACF;
      --floating-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
      --floating-text: #1F2937;
      --floating-text-dim: #6B7280;
      --floating-hover: #F5EFE6;
      --zoom-pill-bg: #FFFFFF;
      --zoom-pill-color: #1F2937;
      --zoom-pill-border: #E2DACF;
      --zoom-pill-hover: #F5EFE6;
      --zoom-pill-divider: #E2DACF;

      /* Component Tokens for Light Mode */
      --card-header-color: #1F2937;
      --card-header-hover: #111827;
      --scrollbar-thumb: #D5CCC0;
      --scrollbar-thumb-hover: #B8ADA0;
      --switch-bg: #D5CCC0;
      --dropdown-bg: #FFFFFF;
      --dropdown-search-bg: #FAF7F2;
    }

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

    html, body {
      width: 100%;
      height: 100%;
      overflow: hidden;
      background-color: var(--bg-main);
      color: var(--text-main);
      font-family: var(--font-ui);
      font-size: 13px;
      line-height: 1.4;
      user-select: none;
    }

    /* Custom Scrollbars */
    ::-webkit-scrollbar {
      width: 5px;
      height: 5px;
    }
    ::-webkit-scrollbar-track {
      background: transparent;
    }
    ::-webkit-scrollbar-thumb {
      background: var(--scrollbar-thumb);
      border-radius: var(--radius-sm);
    }
    ::-webkit-scrollbar-thumb:hover {
      background: var(--scrollbar-thumb-hover);
    }

    /* Layout Structure */
    .app-container {
      display: flex;
      flex-direction: column;
      height: 100vh;
      width: 100vw;
    }

    /* Header Navbar */
    header.navbar {
      height: 52px;
      background: var(--bg-panel);
      border-bottom: 1px solid var(--border-color);
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding: 0 16px;
      flex-shrink: 0;
      z-index: 100;
    }

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

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

    .brand-icon {
      width: 34px;
      height: 36px;
      display: flex;
      align-items: center;
      justify-content: center;
      filter: drop-shadow(0 2px 8px rgba(0, 102, 254, 0.42));
      transition: transform 0.2s ease;
      flex-shrink: 0;
    }

    .brand-icon img,
    .brand-icon svg {
      width: 100%;
      height: 100%;
      object-fit: contain;
      display: block;
    }

    .brand:hover .brand-icon {
      transform: scale(1.06);
    }

    .brand-text-block {
      display: flex;
      flex-direction: column;
    }

    .brand-title {
      font-size: 16px;
      font-weight: 800;
      letter-spacing: -0.35px;
      color: var(--text-main);
      line-height: 1.15;
    }

    .brand-title .accent {
      color: #0066FE;
      background: linear-gradient(135deg, #0066FE 0%, #38BDF8 100%);
      -webkit-background-clip: text;
      background-clip: text;
      -webkit-text-fill-color: transparent;
    }

    .brand-subtitle {
      font-size: 10px;
      color: var(--text-dim);
      font-weight: 500;
      letter-spacing: 0.1px;
      margin-top: 1px;
    }

    /* Top Toolbar Controls */
    .top-toolbar {
      display: flex;
      align-items: center;
      gap: 8px;
    }

    .toolbar-item {
      display: flex;
      align-items: center;
      gap: 6px;
    }

    .toolbar-label {
      font-size: 10px;
      font-weight: 700;
      letter-spacing: 0.5px;
      text-transform: uppercase;
      color: var(--text-dim);
    }

    .nav-select {
      background: var(--bg-input);
      border: 1px solid var(--border-color);
      border-radius: var(--radius-md);
      color: var(--text-main);
      font-size: 12px;
      font-weight: 500;
      padding: 5px 10px;
      outline: none;
      cursor: pointer;
      height: 32px;
      transition: border-color 0.15s;
    }

    .nav-select:hover, .nav-select:focus {
      border-color: var(--accent-blue);
    }

    /* Searchable Projection Dropdown */
    .searchable-proj-container {
      position: relative;
    }

    .nav-select-btn {
      background: var(--bg-input);
      border: 1px solid var(--border-color);
      border-radius: var(--radius-md);
      color: var(--text-main);
      font-size: 12px;
      font-weight: 500;
      padding: 5px 10px;
      outline: none;
      cursor: pointer;
      height: 32px;
      display: inline-flex;
      align-items: center;
      justify-content: space-between;
      gap: 8px;
      min-width: 175px;
      transition: all 0.15s ease;
      user-select: none;
    }

    .nav-select-btn:hover, .nav-select-btn.active {
      border-color: var(--accent-blue);
      background: var(--bg-hover);
    }

    .nav-select-btn .proj-chevron {
      width: 13px;
      height: 13px;
      color: var(--text-muted);
      transition: transform 0.2s ease;
      flex-shrink: 0;
    }

    .nav-select-btn.active .proj-chevron {
      transform: rotate(180deg);
    }

    .proj-dropdown-menu {
      position: absolute;
      top: calc(100% + 6px);
      left: 0;
      width: 280px;
      background: var(--dropdown-bg);
      border: 1px solid var(--border-color);
      border-radius: var(--radius-lg);
      box-shadow: 0 16px 36px rgba(0, 0, 0, 0.25), 0 0 0 1px var(--border-color);
      z-index: 10000;
      display: none;
      flex-direction: column;
      overflow: hidden;
      backdrop-filter: blur(12px);
      animation: projMenuFadeIn 0.15s ease-out;
    }

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

    .proj-dropdown-menu.show {
      display: flex !important;
    }

    .proj-search-box {
      display: flex;
      align-items: center;
      gap: 8px;
      padding: 8px 10px;
      border-bottom: 1px solid var(--border-color);
      background: var(--dropdown-search-bg);
    }

    .proj-search-icon {
      width: 14px;
      height: 14px;
      color: var(--text-dim);
      flex-shrink: 0;
    }

    .proj-search-box input {
      background: transparent;
      border: none;
      outline: none;
      color: var(--text-main);
      font-size: 12px;
      width: 100%;
      font-family: inherit;
    }

    .proj-search-box input::placeholder {
      color: var(--text-dim);
      font-size: 11.5px;
    }

    .proj-clear-btn {
      background: transparent;
      border: none;
      color: var(--text-dim);
      cursor: pointer;
      font-size: 16px;
      line-height: 1;
      padding: 0 4px;
      border-radius: var(--radius-sm);
      transition: color 0.12s;
    }

    .proj-clear-btn:hover {
      color: var(--text-main);
    }

    .proj-options-list {
      max-height: 310px;
      overflow-y: auto;
      padding: 4px 0;
      scrollbar-width: thin;
      scrollbar-color: var(--border-light) transparent;
    }

    .proj-options-list::-webkit-scrollbar {
      width: 6px;
    }

    .proj-options-list::-webkit-scrollbar-thumb {
      background: var(--border-light);
      border-radius: var(--radius-sm);
    }

    .proj-group-header {
      padding: 8px 12px 3px;
      font-size: 10px;
      font-weight: 700;
      letter-spacing: 0.6px;
      text-transform: uppercase;
      color: var(--accent-blue);
      user-select: none;
      background: transparent;
    }

    .proj-option-item {
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding: 6px 12px;
      font-size: 12px;
      color: var(--text-main);
      cursor: pointer;
      transition: background 0.1s, color 0.1s;
      user-select: none;
    }

    .proj-option-item:hover, .proj-option-item.highlighted {
      background: var(--bg-hover);
      color: var(--accent-blue);
    }

    .proj-option-item.selected {
      background: rgba(59, 130, 246, 0.15);
      color: #2563EB;
      font-weight: 600;
    }

    [data-theme="dark"] .proj-option-item.selected {
      color: #60A5FA;
    }

    .proj-option-item .check-icon {
      width: 12px;
      height: 12px;
      color: var(--accent-blue);
    }

    .proj-no-results {
      padding: 20px 12px;
      font-size: 12px;
      color: var(--text-dim);
      text-align: center;
    }

    .nav-btn, .btn-secondary, .btn-export-secondary {
      height: 32px;
      padding: 0 10px;
      background: var(--bg-input);
      border: 1px solid var(--border-color);
      border-radius: var(--radius-md);
      color: var(--text-muted);
      font-size: 12px;
      font-weight: 500;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      gap: 6px;
      cursor: pointer;
      white-space: nowrap !important;
      transition: all 0.15s;
    }

    .nav-btn:hover, .btn-secondary:hover, .btn-export-secondary:hover {
      background: var(--bg-hover);
      color: var(--text-main);
      border-color: var(--border-light);
    }

    .nav-btn.active, .btn-secondary.active {
      background: rgba(59, 130, 246, 0.15);
      border-color: var(--accent-blue);
      color: #2563EB;
    }

    [data-theme="dark"] .nav-btn.active, [data-theme="dark"] .btn-secondary.active {
      color: #60A5FA;
    }

    .nav-btn-primary, .btn-download-primary {
      height: 32px;
      padding: 0 12px;
      background: var(--accent-blue);
      border: 1px solid var(--accent-blue-hover);
      border-radius: var(--radius-md);
      color: #FFFFFF;
      font-size: 12px;
      font-weight: 600;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      gap: 6px;
      cursor: pointer;
      transition: all 0.15s;
    }

    .nav-btn-primary:hover, .btn-download-primary:hover {
      background: var(--accent-blue-hover);
      color: #FFFFFF;
      transform: translateY(-1px);
    }

    /* Navbar Auth & User Profile Dropdown */
    .nav-btn-auth {
      height: 30px;
      padding: 0 10px;
      background: rgba(56, 189, 248, 0.12);
      border: 1px solid rgba(56, 189, 248, 0.35);
      border-radius: var(--radius-md);
      color: #38BDF8;
      font-size: 12px;
      font-weight: 600;
      display: inline-flex;
      align-items: center;
      gap: 6px;
      text-decoration: none;
      cursor: pointer;
      transition: all 0.15s;
    }
    .nav-btn-auth:hover {
      background: rgba(56, 189, 248, 0.22);
      color: #7DD3FC;
      border-color: #38BDF8;
    }
    [data-theme="light"] .nav-btn-auth {
      background: rgba(14, 165, 233, 0.08);
      border-color: rgba(14, 165, 233, 0.3);
      color: #0284C7;
    }
    [data-theme="light"] .nav-btn-auth:hover {
      background: rgba(14, 165, 233, 0.16);
      color: #0369A1;
    }

    .user-profile-menu {
      position: relative;
      display: inline-flex;
      align-items: center;
    }
    .nav-user-pill {
      height: 32px;
      padding: 3px 10px 3px 5px;
      background: var(--bg-card);
      border: 1px solid var(--border-color);
      border-radius: 9999px;
      display: inline-flex;
      align-items: center;
      gap: 7px;
      cursor: pointer;
      color: var(--text-main);
      font-size: 12px;
      font-weight: 500;
      transition: all 0.2s ease;
      box-sizing: border-box;
    }
    .nav-user-pill:hover {
      border-color: var(--accent-blue);
      background: var(--bg-hover);
      transform: translateY(-1px);
    }
    .user-avatar {
      width: 24px;
      height: 24px;
      border-radius: 50%;
      background: linear-gradient(135deg, #38BDF8, #818CF8);
      color: #0B0E14;
      font-size: 11.5px;
      font-weight: 700;
      display: flex;
      align-items: center;
      justify-content: center;
      text-transform: uppercase;
      overflow: hidden;
      flex-shrink: 0;
    }
    .user-avatar img {
      width: 100%;
      height: 100%;
      object-fit: cover;
    }
    .user-name {
      max-width: 170px;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }
    .user-dropdown-popover {
      position: absolute;
      top: calc(100% + 8px);
      right: 0;
      width: 290px;
      background: rgba(11, 19, 38, 0.96);
      backdrop-filter: blur(20px);
      -webkit-backdrop-filter: blur(20px);
      border: 1px solid rgba(255, 255, 255, 0.12);
      border-radius: 18px;
      box-shadow: 0 25px 60px -10px rgba(0, 0, 0, 0.65), 0 0 0 1px rgba(255, 255, 255, 0.05);
      padding: 14px;
      z-index: 9999;
      display: none;
      flex-direction: column;
      gap: 12px;
      animation: popoverFadeIn 0.18s cubic-bezier(0.16, 1, 0.3, 1);
    }
    @keyframes popoverFadeIn {
      from { opacity: 0; transform: translateY(-4px) scale(0.98); }
      to { opacity: 1; transform: translateY(0) scale(1); }
    }
    [data-theme="light"] .user-dropdown-popover {
      background: rgba(255, 255, 255, 0.98);
      border: 1px solid rgba(226, 232, 240, 0.95);
      box-shadow: 0 25px 60px -10px rgba(15, 23, 42, 0.18), 0 0 0 1px rgba(0, 0, 0, 0.04);
    }

    /* Executive Profile Header Card */
    .user-dropdown-profile-card {
      display: flex;
      align-items: center;
      gap: 12px;
      padding: 2px 2px 4px;
    }
    .user-avatar-large {
      width: 42px;
      height: 42px;
      border-radius: 12px;
      background: linear-gradient(135deg, #0284c7, #0066fe, #7c3aed);
      color: #ffffff;
      font-size: 17px;
      font-weight: 800;
      display: flex;
      align-items: center;
      justify-content: center;
      text-transform: uppercase;
      box-shadow: 0 4px 14px rgba(0, 102, 254, 0.35);
      flex-shrink: 0;
      overflow: hidden;
      border: 1.5px solid rgba(255, 255, 255, 0.25);
    }
    .user-avatar-large img {
      width: 100%;
      height: 100%;
      object-fit: cover;
    }
    .user-profile-details {
      min-width: 0;
      flex: 1;
    }
    .user-profile-name-row {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 6px;
      margin-bottom: 2px;
    }
    .user-dropdown-name {
      font-size: 14px;
      font-weight: 700;
      color: var(--text-main);
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
      letter-spacing: -0.01em;
    }
    .user-role-badge {
      font-size: 9.5px;
      font-weight: 800;
      letter-spacing: 0.08em;
      text-transform: uppercase;
      padding: 2px 7px;
      border-radius: 6px;
      background: linear-gradient(135deg, rgba(2, 132, 199, 0.18), rgba(124, 58, 237, 0.2));
      color: #38bdf8;
      border: 1px solid rgba(56, 189, 248, 0.35);
      flex-shrink: 0;
    }
    [data-theme="light"] .user-role-badge {
      background: #eff6ff;
      color: #0066fe;
      border-color: #bfdbfe;
    }
    .user-dropdown-email {
      font-size: 11.5px;
      color: var(--text-dim, #94a3b8);
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
      font-family: inherit;
    }

    /* Verification Strip */
    .user-verify-container {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 8px;
      background: rgba(245, 158, 11, 0.08);
      border: 1px solid rgba(245, 158, 11, 0.22);
      border-radius: 10px;
      padding: 7px 10px;
    }
    .user-verify-container.is-verified {
      background: rgba(16, 185, 129, 0.08);
      border-color: rgba(16, 185, 129, 0.22);
    }
    .user-badge-verified {
      display: inline-flex;
      align-items: center;
      gap: 5px;
      color: #10B981;
      font-size: 11px;
      font-weight: 700;
    }
    .user-badge-unverified {
      display: inline-flex;
      align-items: center;
      gap: 5px;
      color: #F59E0B;
      font-size: 11px;
      font-weight: 600;
    }
    .btn-resend-verify {
      background: #F59E0B;
      color: #ffffff;
      border: none;
      border-radius: 6px;
      padding: 3px 8px;
      font-size: 10.5px;
      font-weight: 700;
      cursor: pointer;
      box-shadow: 0 2px 6px rgba(245, 158, 11, 0.3);
      transition: all 0.15s ease;
      flex-shrink: 0;
    }
    .btn-resend-verify:hover {
      background: #d97706;
      transform: translateY(-0.5px);
    }

    /* Subscription & Quota Card */
    .user-quota-card {
      background: rgba(255, 255, 255, 0.04);
      border: 1px solid rgba(255, 255, 255, 0.08);
      border-radius: 14px;
      padding: 11px 12px;
      display: flex;
      flex-direction: column;
      gap: 8px;
    }
    [data-theme="light"] .user-quota-card {
      background: #f8fafc;
      border-color: #e2e8f0;
    }
    .user-quota-card-header {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 8px;
    }
    .quota-plan-label {
      font-size: 12px;
      font-weight: 700;
      color: var(--text-main);
    }
    .quota-count-badge {
      font-size: 10.5px;
      font-weight: 600;
      color: #38bdf8;
      background: rgba(56, 189, 248, 0.12);
      padding: 2px 7px;
      border-radius: 6px;
    }
    [data-theme="light"] .quota-count-badge {
      color: #1E5E45;
      background: rgba(30, 94, 69, 0.1);
      border: 1px solid rgba(30, 94, 69, 0.25);
    }
    .user-quota-bar-track {
      width: 100%;
      height: 5px;
      background: rgba(255, 255, 255, 0.08);
      border-radius: 999px;
      overflow: hidden;
    }
    [data-theme="light"] .user-quota-bar-track {
      background: #e2e8f0;
    }
    .user-quota-bar-fill {
      height: 100%;
      background: linear-gradient(90deg, #38bdf8, #2563eb);
      border-radius: 999px;
      transition: width 0.3s ease;
    }
    [data-theme="light"] .user-quota-bar-fill {
      background: linear-gradient(90deg, #2D6A4F, #1E5E45);
    }
    .btn-user-upgrade-gradient {
      width: 100%;
      margin-top: 2px;
      background: linear-gradient(135deg, #0284c7, #0066fe, #7c3aed);
      color: #ffffff;
      border: none;
      border-radius: 9px;
      padding: 7px 10px;
      font-size: 11.5px;
      font-weight: 700;
      cursor: pointer;
      display: flex;
      align-items: center;
      gap: 6px;
      box-shadow: 0 4px 12px rgba(0, 102, 254, 0.3);
      transition: all 0.2s ease;
    }
    .btn-user-upgrade-gradient:hover {
      opacity: 0.95;
      transform: translateY(-1px);
      box-shadow: 0 6px 18px rgba(0, 102, 254, 0.45);
    }
    [data-theme="light"] .btn-user-upgrade-gradient {
      background: linear-gradient(135deg, #1E5E45 0%, #164E37 100%) !important;
      box-shadow: 0 4px 12px rgba(30, 94, 69, 0.25) !important;
    }
    [data-theme="light"] .btn-user-upgrade-gradient:hover {
      background: linear-gradient(135deg, #2D6A4F 0%, #164E37 100%) !important;
      box-shadow: 0 6px 18px rgba(30, 94, 69, 0.4) !important;
    }

    /* Dropdown Nav Actions */
    .user-dropdown-nav {
      display: flex;
      flex-direction: column;
      gap: 2px;
    }
    .user-dropdown-item {
      display: flex;
      align-items: center;
      gap: 10px;
      width: 100%;
      padding: 8px 10px;
      border: none;
      background: none;
      border-radius: 10px;
      color: var(--text-main);
      font-size: 12.5px;
      font-weight: 500;
      cursor: pointer;
      text-align: left;
      transition: all 0.15s ease;
    }
    .user-dropdown-item:hover {
      background: rgba(255, 255, 255, 0.06);
      color: #38bdf8;
    }
    [data-theme="light"] .user-dropdown-item:hover {
      background: #f1f5f9;
      color: #0066fe;
    }
    .user-dropdown-item-danger:hover {
      background: rgba(239, 68, 68, 0.12) !important;
      color: #ef4444 !important;
    }
    .user-dropdown-divider {
      height: 1px;
      background: rgba(255, 255, 255, 0.08);
      margin: 2px 0;
    }
    [data-theme="light"] .user-dropdown-divider {
      background: #e2e8f0;
    }

    /* Subscription Quota Pill - Modern SaaS Luxury Styling */
    .nav-quota-pill {
      display: inline-flex;
      align-items: center;
      gap: 7px;
      height: 32px;
      padding: 3px 4px 3px 11px;
      border-radius: 9999px;
      font-size: 11.5px;
      font-weight: 600;
      cursor: pointer;
      border: 1px solid rgba(56, 189, 248, 0.28);
      background: linear-gradient(180deg, rgba(19, 29, 46, 0.95), rgba(12, 19, 31, 0.95));
      color: #F8FAFC;
      box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.08);
      backdrop-filter: blur(10px);
      transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
      white-space: nowrap;
      user-select: none;
      box-sizing: border-box;
    }
    .nav-quota-pill:hover {
      background: linear-gradient(180deg, rgba(26, 40, 63, 0.95), rgba(15, 24, 39, 0.95));
      border-color: rgba(56, 189, 248, 0.55);
      box-shadow: 0 4px 16px rgba(14, 165, 233, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.15);
      transform: translateY(-1px);
    }
    .nav-quota-pill .quota-icon {
      font-size: 12px;
      color: #F59E0B;
      filter: drop-shadow(0 0 6px rgba(245, 158, 11, 0.6));
      display: inline-flex;
      align-items: center;
      line-height: 1;
    }
    .nav-quota-pill .quota-text {
      display: inline-flex;
      align-items: center;
      gap: 4px;
      color: #94A3B8;
      font-size: 11.5px;
      font-weight: 500;
    }
    .nav-quota-pill #quotaCount {
      color: #38BDF8;
      font-weight: 700;
      font-family: var(--font-mono);
      font-size: 12px;
    }
    .nav-quota-pill.pill-pro {
      background: linear-gradient(180deg, rgba(30, 24, 16, 0.95), rgba(20, 15, 10, 0.95));
      border: 1px solid rgba(245, 158, 11, 0.4);
      color: #F59E0B;
      box-shadow: 0 2px 10px rgba(245, 158, 11, 0.15);
    }
    .nav-quota-pill.pill-basic {
      background: linear-gradient(180deg, rgba(16, 30, 24, 0.95), rgba(10, 20, 16, 0.95));
      border: 1px solid rgba(16, 185, 129, 0.4);
      color: #10B981;
      box-shadow: 0 2px 10px rgba(16, 185, 129, 0.15);
    }
    .quota-upgrade-tag {
      padding: 3px 10px;
      border-radius: 999px;
      background: linear-gradient(135deg, #0284C7 0%, #2563EB 50%, #4F46E5 100%);
      border: 1px solid rgba(255, 255, 255, 0.25);
      color: #FFFFFF;
      font-size: 10.5px;
      font-weight: 700;
      letter-spacing: 0.04em;
      text-transform: uppercase;
      box-shadow: 0 2px 8px rgba(37, 99, 235, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.3);
      transition: all 0.2s ease;
      display: inline-flex;
      align-items: center;
      justify-content: center;
    }
    .nav-quota-pill:hover .quota-upgrade-tag {
      background: linear-gradient(135deg, #38BDF8 0%, #3B82F6 50%, #6366F1 100%);
      box-shadow: 0 3px 12px rgba(56, 189, 248, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.4);
      transform: scale(1.03);
    }
    .nav-quota-pill.pill-pro .quota-upgrade-tag {
      background: linear-gradient(135deg, #F59E0B, #EC4899);
      box-shadow: 0 2px 10px rgba(245, 158, 11, 0.4);
    }
    .nav-quota-pill.pill-basic .quota-upgrade-tag {
      background: linear-gradient(135deg, #10B981, #059669);
      box-shadow: 0 2px 10px rgba(16, 185, 129, 0.4);
    }
    .user-plan-badge {
      font-size: 10px;
      font-weight: 700;
      color: var(--accent-blue);
    }
    .btn-menu-upgrade {
      background: none;
      border: 1px solid var(--accent-blue);
      color: var(--accent-blue);
      border-radius: 4px;
      padding: 1px 6px;
      font-size: 10px;
      font-weight: 600;
      cursor: pointer;
    }

    /* Pricing Modal — Dark Navy Card Design (reference-matched) */
    /* NOTE: doubled class for higher specificity — generic .modal-box is defined
       later in source order and would otherwise constrain this modal to 460px,
       clipping the 3rd/Pro card. Layout-only fix; visuals unchanged. */
    .modal-box.modal-box-pricing {
      width: min(1100px, calc(100vw - 48px));
      max-width: 1100px;
      max-height: calc(100vh - 48px);
      min-width: 0;
      border-radius: 20px;
      background: #080C18;
      border: 1px solid rgba(255,255,255,0.06);
      box-shadow: 0 32px 80px rgba(0,0,0,0.7);
      box-sizing: border-box;
      display: flex;
      flex-direction: column;
      overflow: hidden;
    }
    .modal-box-pricing .modal-header {
      flex-shrink: 0;
      position: sticky;
      top: 0;
      z-index: 2;
    }
    .pricing-modal-actions {
      display: flex;
      align-items: center;
      gap: 12px;
      flex-shrink: 0;
    }
    .btn-whatsapp-support {
      display: inline-flex;
      align-items: center;
      gap: 7px;
      padding: 6px 14px;
      border-radius: 999px;
      font-size: 13px;
      font-weight: 600;
      color: #ffffff !important;
      background: linear-gradient(135deg, #25D366 0%, #128C7E 100%);
      box-shadow: 0 2px 8px rgba(37, 211, 102, 0.35);
      text-decoration: none !important;
      transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
      white-space: nowrap;
      cursor: pointer;
    }
    .btn-whatsapp-support:hover {
      transform: translateY(-1px);
      box-shadow: 0 4px 14px rgba(37, 211, 102, 0.5);
      filter: brightness(1.06);
    }
    .btn-whatsapp-support svg {
      width: 16px;
      height: 16px;
      fill: #ffffff;
      flex-shrink: 0;
    }
    @media (max-width: 600px) {
      .btn-whatsapp-support span { display: none; }
      .btn-whatsapp-support { padding: 6px 10px; }
    }
    .modal-box-pricing .modal-close {
      flex-shrink: 0;
    }
    /* Plans Content — the ONLY horizontal scroller. Whole modal never scrolls sideways.
       Top padding (16px) clears the MOST POPULAR badge half that sits over the
       Pro card's top border — without it, overflow-y below would clip the badge. */
    .pricing-grid {
      display: flex;
      gap: 16px;
      align-items: stretch;
      overflow-x: auto;
      overflow-y: hidden;
      padding: 16px 4px;
      scroll-padding-right: 16px;
      min-width: 0;
      max-width: 100%;
      box-sizing: border-box;
      -webkit-overflow-scrolling: touch;
    }
    @media (max-width: 768px) {
      /* Keep readable side-scroll on small screens — never squeeze into tiny columns */
      .pricing-grid { gap: 12px; }
    }
    .pricing-card {
      background: #0F1628;
      border: 1.5px solid rgba(255,255,255,0.07);
      border-radius: 18px;
      padding: 26px 22px 22px;
      display: flex;
      flex-direction: column;
      position: relative;
      overflow: visible;
      transition: all 0.25s ease;
      /* Readable fixed basis inside the horizontal scroller — never cramped */
      flex: 1 0 250px;
      width: 100%;
      min-width: 250px;
      max-width: 100%;
      box-sizing: border-box;
    }
    .pricing-card:hover {
      border-color: rgba(59,130,246,0.35);
      transform: translateY(-2px);
      box-shadow: 0 12px 40px rgba(0,0,0,0.4);
    }
    /* Pro card — neon blue glowing border */
    .pricing-card-pro {
      border: 2px solid #3B82F6;
      box-shadow: 0 0 0 1px rgba(59,130,246,0.2), 0 0 32px rgba(59,130,246,0.18), 0 16px 40px rgba(0,0,0,0.5);
      background: #0D1422;
    }
    .pricing-card-pro:hover {
      transform: translateY(-2px);
      box-shadow: 0 0 0 1px rgba(59,130,246,0.35), 0 0 50px rgba(59,130,246,0.28), 0 20px 50px rgba(0,0,0,0.55);
    }
    .pro-badge-ribbon {
      position: absolute;
      top: 0;
      left: 50%;
      transform: translate(-50%, -50%);
      z-index: 2;
      background: #3B82F6;
      color: #FFF;
      font-size: 10px;
      font-weight: 700;
      letter-spacing: 0.06em;
      padding: 3px 14px;
      border-radius: 999px;
      text-transform: uppercase;
      white-space: nowrap;
      box-shadow: 0 2px 12px rgba(59,130,246,0.5);
    }
    .pricing-tier-name {
      font-size: 18px;
      font-weight: 700;
      color: #F1F5F9;
      margin-bottom: 4px;
      letter-spacing: -0.01em;
    }
    .pricing-desc {
      font-size: 12.5px;
      color: #64748B;
      margin: 0 0 18px;
      line-height: 1.4;
    }
    /* Price highlighted box */
    .pricing-amount {
      display: inline-flex;
      align-items: baseline;
      gap: 4px;
      background: rgba(59,130,246,0.12);
      border: 1px solid rgba(59,130,246,0.18);
      border-radius: 12px;
      padding: 10px 16px;
      margin-bottom: 20px;
      width: 100%;
    }
    .pricing-amount-number {
      font-size: 32px;
      font-weight: 800;
      color: #3B82F6;
      line-height: 1;
      letter-spacing: -0.02em;
    }
    .pricing-period {
      font-size: 13px;
      font-weight: 400;
      color: #64748B;
    }
    /* Pro plan price box — orange */
    .pricing-card-pro .pricing-amount {
      background: rgba(245,120,50,0.1);
      border-color: rgba(245,120,50,0.2);
    }
    .pricing-card-pro .pricing-amount-number {
      color: #F97316;
    }
    /* Feature list */
    .pricing-features {
      list-style: none;
      padding: 0;
      margin: 0 0 22px;
      display: flex;
      flex-direction: column;
      gap: 12px;
      flex: 1;
    }
    .pricing-features li {
      display: flex;
      align-items: center;
      gap: 10px;
      font-size: 13px;
      color: #CBD5E1;
      line-height: 1.3;
    }
    /* Colored dot bullets */
    .feat-dot {
      width: 8px;
      height: 8px;
      border-radius: 50%;
      flex-shrink: 0;
      background: #3B82F6;
    }
    .feat-dot.dot-orange {
      background: #F97316;
    }
    .feat-dot.dot-pro {
      background: #3B82F6;
    }
    .feat-dot.dot-pro-orange {
      background: #F97316;
    }
    /* Hide old checkmark icons */
    .feat-check { display: none; }
    /* CTA buttons — pill style */
    .btn-plan-select {
      width: 100%;
      padding: 13px 16px;
      border-radius: 999px;
      font-size: 14px;
      font-weight: 600;
      cursor: pointer;
      border: none;
      background: #3B82F6;
      color: #FFF;
      transition: all 0.2s;
      letter-spacing: 0.01em;
    }
    .btn-plan-select:hover:not(:disabled) {
      background: #2563EB;
      transform: translateY(-1px);
      box-shadow: 0 6px 20px rgba(59,130,246,0.45);
    }
    .btn-plan-select:disabled {
      cursor: default;
      opacity: 0.45;
      font-size: 13px;
      background: rgba(255,255,255,0.08);
      color: #64748B;
    }
    .btn-plan-primary {
      background: #3B82F6;
      color: #FFF;
    }
    .btn-plan-primary:hover {
      background: #2563EB;
      transform: translateY(-1px);
      box-shadow: 0 6px 20px rgba(59,130,246,0.45);
    }
    .btn-plan-pro {
      background: linear-gradient(135deg, #F97316, #EC4899);
      border: none;
      color: #FFF;
      box-shadow: 0 4px 18px rgba(249,115,22,0.35);
    }
    .btn-plan-pro:hover {
      transform: translateY(-2px);
      box-shadow: 0 8px 28px rgba(249,115,22,0.5);
    }
    /* ── AI-tool popup polish: animation, current-plan, pending, light theme ── */
    /* Prevent page-behind scroll while any modal is open (toggled from JS) */
    body.modal-open {
      overflow: hidden;
    }
    @keyframes modalPop {
      from { opacity: 0; transform: translateY(14px) scale(0.97); }
      to { opacity: 1; transform: translateY(0) scale(1); }
    }
    .modal-overlay.open .modal-box-pricing,
    .modal-overlay.open .modal-box-checkout {
      animation: modalPop 0.22s ease-out;
    }
    .modal-box-pricing .modal-body {
      max-height: 70vh;
      overflow-y: auto;
      overflow-x: hidden;
      min-width: 0;
      max-width: 100%;
      box-sizing: border-box;
    }
    /* Price box must include padding in its 100% width — no spill */
    .modal-box-pricing .pricing-amount {
      box-sizing: border-box;
      max-width: 100%;
    }
    .pricing-card.is-current {
      outline: 2px solid #10B981;
      outline-offset: 2px;
    }
    .plan-current-pill {
      display: inline-block;
      font-size: 10px;
      font-weight: 800;
      letter-spacing: 0.06em;
      text-transform: uppercase;
      color: #10B981;
      background: rgba(16,185,129,0.12);
      border: 1px solid rgba(16,185,129,0.35);
      border-radius: 999px;
      padding: 2px 10px;
      margin-left: 8px;
      vertical-align: middle;
    }
    .payment-pending-banner {
      display: none;
      align-items: center;
      gap: 8px;
      background: rgba(245,158,11,0.1);
      border: 1px solid rgba(245,158,11,0.3);
      color: #F59E0B;
      font-size: 12px;
      font-weight: 600;
      border-radius: 10px;
      padding: 10px 14px;
      margin-bottom: 16px;
      line-height: 1.4;
    }
    .payment-pending-banner.show { display: flex; }
    .btn-plan-select:focus-visible,
    .modal-close:focus-visible,
    .payment-method-btn:focus-visible {
      outline: 2px solid #3B82F6;
      outline-offset: 2px;
    }
    /* Light theme: pricing modal adapts to white cards */
    [data-theme="light"] .modal-box-pricing {
      background: #FFFFFF;
      border-color: #E2E8F0;
      box-shadow: 0 32px 80px rgba(15,23,42,0.18);
    }
    [data-theme="light"] .pricing-card {
      background: #F8FAFC;
      border-color: #E2E8F0;
    }
    [data-theme="light"] .pricing-card-pro {
      background: #FFF7ED;
      border-color: #3B82F6;
      box-shadow: 0 0 0 1px rgba(59,130,246,0.2), 0 0 28px rgba(59,130,246,0.15);
    }
    [data-theme="light"] .pricing-tier-name { color: #0F172A; }
    [data-theme="light"] .pricing-desc { color: #64748B; }
    [data-theme="light"] .pricing-features li { color: #334155; }
    [data-theme="light"] .pricing-amount {
      background: rgba(59,130,246,0.08);
      border-color: rgba(59,130,246,0.2);
    }
    [data-theme="light"] .pricing-card-pro .pricing-amount {
      background: rgba(249,115,22,0.08);
      border-color: rgba(249,115,22,0.25);
    }
    [data-theme="light"] .btn-plan-select:disabled {
      background: #F1F5F9;
      color: #64748B;
      border: 1px solid #CBD5E1;
    }
    .pricing-modal-title {
      font-size: 22px;
      font-weight: 800;
      letter-spacing: -0.02em;
      background: linear-gradient(135deg, #F8FAFC 30%, #94A3B8);
      -webkit-background-clip: text;
      -webkit-text-fill-color: transparent;
      background-clip: text;
    }
    .pricing-modal-subtitle {
      font-size: 12px;
      color: var(--text-dim);
      margin-top: 5px;
      line-height: 1.4;
    }
    .pricing-modal-footer-note {
      margin-top: 16px;
      font-size: 11.5px;
      color: var(--text-dim);
      text-align: center;
      line-height: 1.5;
    }
    .pricing-modal-footer-note strong {
      color: var(--text-muted);
    }
    [data-theme="light"] .pricing-modal-title,
    [data-theme="light"] #pricingModalTitle {
      background: linear-gradient(135deg, #0F172A 20%, #334155 80%) !important;
      -webkit-background-clip: text !important;
      background-clip: text !important;
      -webkit-text-fill-color: transparent !important;
      color: #0F172A !important;
    }
    [data-theme="light"] .pricing-modal-subtitle {
      color: #475569 !important;
      font-weight: 500;
    }
    [data-theme="light"] .modal-box-pricing .modal-close {
      color: #64748B;
    }
    [data-theme="light"] .modal-box-pricing .modal-close:hover {
      color: #0F172A;
    }
    [data-theme="light"] .pricing-modal-footer-note {
      color: #475569;
    }
    [data-theme="light"] .pricing-modal-footer-note strong {
      color: #0F172A;
    }
    @media (max-width: 1024px) {
      .modal-box.modal-box-pricing {
        width: calc(100vw - 32px);
      }
    }
    @media (max-width: 768px) {
      .modal-box.modal-box-pricing { width: calc(100vw - 32px); border-radius: 16px; }
      .modal-box-pricing .modal-body { max-height: 75vh; }
    }
    @media (max-width: 640px) {
      .modal-box.modal-box-pricing {
        width: calc(100vw - 20px);
        max-height: calc(100vh - 20px);
      }
    }

    /* Checkout Modal — Ultra-Modern 2-Column Secure Checkout */
    #paymentModal.open {
      display: flex !important;
      visibility: visible !important;
      opacity: 1 !important;
      z-index: 999999 !important;
    }
    .modal-box-checkout,
    .modal-box-checkout-secure {
      width: min(760px, calc(100vw - 32px)) !important;
      max-width: 760px !important;
      border-radius: 1.5rem !important;
      padding: 28px !important;
      position: relative !important;
      font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
      box-sizing: border-box !important;
      text-align: left !important;
      transition: background-color 0.25s ease, border-color 0.25s ease, color 0.25s ease !important;
    }

    /* ─── DARK THEME (Default & [data-theme="dark"]) ─── */
    html:not([data-theme="light"]) .modal-box-checkout,
    html:not([data-theme="light"]) .modal-box-checkout-secure,
    [data-theme="dark"] .modal-box-checkout,
    [data-theme="dark"] .modal-box-checkout-secure {
      background-color: #0d1527 !important;
      border: 1px solid rgba(255, 255, 255, 0.1) !important;
      box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.75), 0 0 35px rgba(56, 189, 248, 0.12) !important;
      color: #f8fafc !important;
    }
    .checkout-secure-header {
      position: relative;
      margin-bottom: 24px;
    }
    .checkout-close-btn {
      position: absolute;
      top: 0;
      right: 0;
      background: transparent;
      border: none;
      color: #94a3b8;
      padding: 4px;
      cursor: pointer;
      transition: color 0.15s ease;
      display: flex;
      align-items: center;
      justify-content: center;
    }
    .checkout-close-btn:hover {
      color: #ffffff;
    }
    .checkout-close-btn svg {
      width: 20px;
      height: 20px;
    }
    .checkout-title-row {
      display: flex;
      align-items: center;
      gap: 10px;
    }
    .checkout-shield-icon {
      width: 24px;
      height: 24px;
      color: #38bdf8;
    }
    .checkout-secure-title,
    html.dark .checkout-secure-title,
    [data-theme="dark"] .checkout-secure-title {
      font-size: 22px;
      font-weight: 700;
      color: #f8fafc !important;
      letter-spacing: -0.02em;
      margin: 0;
      line-height: 1.2;
    }
    .checkout-secure-subtitle,
    html.dark .checkout-secure-subtitle,
    [data-theme="dark"] .checkout-secure-subtitle {
      font-size: 15px;
      color: #94a3b8 !important;
      margin: 6px 0 0;
      font-weight: 400;
      line-height: 1.4;
    }
    .checkout-secure-subtitle strong,
    html.dark .checkout-secure-subtitle strong,
    [data-theme="dark"] .checkout-secure-subtitle strong {
      font-weight: 700;
      color: #38bdf8 !important;
    }
    .checkout-steps-grid {
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 16px;
      margin-bottom: 24px;
    }
    @media (max-width: 640px) {
      .checkout-steps-grid {
        grid-template-columns: 1fr;
      }
    }
    .checkout-step-card,
    [data-theme="dark"] .checkout-step-card {
      background-color: #162035 !important;
      border: 1px solid rgba(255, 255, 255, 0.08) !important;
      border-radius: 1rem;
      padding: 20px;
      box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
      display: flex;
      flex-direction: column;
      justify-content: space-between;
      box-sizing: border-box;
    }
    .checkout-step-header {
      display: flex;
      align-items: center;
      gap: 10px;
      margin-bottom: 20px;
    }
    .checkout-step-badge,
    [data-theme="dark"] .checkout-step-badge {
      width: 24px;
      height: 24px;
      border-radius: 50%;
      background-color: rgba(56, 189, 248, 0.16) !important;
      color: #38bdf8 !important;
      border: 1px solid rgba(56, 189, 248, 0.3) !important;
      font-size: 12px;
      font-weight: 700;
      display: flex;
      align-items: center;
      justify-content: center;
      flex-shrink: 0;
    }
    .checkout-step-title,
    [data-theme="dark"] .checkout-step-title {
      font-size: 15px;
      font-weight: 700;
      color: #f8fafc !important;
      margin: 0;
    }
    .checkout-field-row {
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding: 8px 0;
      margin-bottom: 8px;
    }
    .checkout-field-row.checkout-amount-row {
      margin-bottom: 0;
      padding-bottom: 0;
    }
    .checkout-label,
    [data-theme="dark"] .checkout-label {
      font-size: 14px;
      font-weight: 500;
      color: #94a3b8 !important;
      display: block;
    }
    .checkout-select-wrap {
      position: relative;
      width: 176px;
    }
    .checkout-select,
    [data-theme="dark"] .checkout-select {
      width: 100%;
      appearance: none;
      -webkit-appearance: none;
      background-color: #0b1324 !important;
      color: #f8fafc !important;
      border: 1px solid rgba(255, 255, 255, 0.12) !important;
      font-weight: 600;
      font-size: 14px;
      padding: 8px 34px 8px 14px;
      border-radius: 0.75rem;
      outline: none;
      cursor: pointer;
      transition: background-color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
      box-sizing: border-box;
    }
    .checkout-select:hover,
    [data-theme="dark"] .checkout-select:hover {
      background-color: #101c36 !important;
      border-color: rgba(56, 189, 248, 0.4) !important;
    }
    .checkout-select:focus,
    [data-theme="dark"] .checkout-select:focus {
      box-shadow: 0 0 0 2px #38bdf8 !important;
      border-color: #38bdf8 !important;
    }
    .checkout-select-chevron,
    [data-theme="dark"] .checkout-select-chevron {
      pointer-events: none;
      position: absolute;
      top: 0;
      bottom: 0;
      right: 0;
      display: flex;
      align-items: center;
      padding: 0 12px;
      color: #94a3b8;
    }
    .checkout-select-chevron svg {
      width: 16px;
      height: 16px;
    }
    .checkout-number-wrap {
      display: flex;
      align-items: center;
      gap: 8px;
    }
    .checkout-number-text,
    [data-theme="dark"] .checkout-number-text {
      color: #38bdf8 !important;
      font-weight: 700;
      font-size: 15px;
      letter-spacing: 0.02em;
    }
    .checkout-copy-btn,
    [data-theme="dark"] .checkout-copy-btn {
      color: #94a3b8;
      background: transparent;
      border: none;
      padding: 4px;
      border-radius: 6px;
      cursor: pointer;
      transition: all 0.15s ease;
      display: flex;
      align-items: center;
      justify-content: center;
    }
    .checkout-copy-btn:hover,
    [data-theme="dark"] .checkout-copy-btn:hover {
      color: #f8fafc;
      background-color: rgba(255, 255, 255, 0.08);
    }
    .checkout-copy-btn.copied {
      color: #34d399 !important;
    }
    .checkout-copy-btn svg {
      width: 16px;
      height: 16px;
    }
    .checkout-amount-text,
    [data-theme="dark"] .checkout-amount-text {
      color: #f8fafc !important;
      font-weight: 800;
      font-size: 18px;
    }
    .checkout-verify-form {
      display: flex;
      flex-direction: column;
      gap: 16px;
    }
    .checkout-input-group {
      display: flex;
      flex-direction: column;
    }
    .checkout-input-group .checkout-label {
      margin-bottom: 6px;
    }
    .checkout-text-input,
    [data-theme="dark"] .checkout-text-input {
      width: 100%;
      background-color: #0b1324 !important;
      border: 1px solid rgba(255, 255, 255, 0.12) !important;
      border-radius: 0.75rem;
      padding: 10px 14px;
      font-size: 14px;
      color: #f8fafc !important;
      outline: none;
      transition: all 0.15s ease;
      box-sizing: border-box;
      font-family: inherit;
    }
    .checkout-text-input:focus,
    [data-theme="dark"] .checkout-text-input:focus {
      border-color: #38bdf8 !important;
      background-color: #101c36 !important;
      box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.2) !important;
    }
    .checkout-text-input::placeholder,
    [data-theme="dark"] .checkout-text-input::placeholder {
      color: #64748b !important;
    }
    .checkout-text-input.checkout-uppercase {
      text-transform: uppercase;
      letter-spacing: 0.05em;
      font-weight: 600;
    }
    .checkout-error-msg {
      font-size: 11px;
      color: #ef4444;
      margin-top: 4px;
      display: none;
      line-height: 1.3;
      font-weight: 500;
    }
    .checkout-secure-footer {
      display: flex;
      flex-direction: column;
      gap: 14px;
      padding-top: 4px;
    }
    .checkout-terms-row {
      display: flex;
      align-items: center;
      gap: 8px;
    }
    .checkout-checkbox,
    [data-theme="dark"] .checkout-checkbox {
      width: 16px;
      height: 16px;
      accent-color: #0284c7;
      cursor: pointer;
    }
    .checkout-terms-label,
    [data-theme="dark"] .checkout-terms-label {
      font-size: 14px;
      color: #94a3b8 !important;
      user-select: none;
      cursor: pointer;
    }
    .checkout-terms-link,
    [data-theme="dark"] .checkout-terms-link {
      font-weight: 600;
      color: #38bdf8 !important;
    }
    .checkout-actions-row {
      display: flex;
      align-items: center;
      justify-content: flex-end;
      gap: 12px;
      padding-top: 4px;
    }
    .checkout-cancel-btn,
    [data-theme="dark"] .checkout-cancel-btn {
      font-size: 14px;
      font-weight: 500;
      color: #94a3b8 !important;
      background: transparent;
      border: none;
      padding: 8px 16px;
      border-radius: 8px;
      cursor: pointer;
      transition: color 0.15s ease, background 0.15s ease;
    }
    .checkout-cancel-btn:hover,
    [data-theme="dark"] .checkout-cancel-btn:hover {
      color: #f8fafc !important;
      background-color: rgba(255, 255, 255, 0.08);
    }
    .checkout-confirm-btn,
    [data-theme="dark"] .checkout-confirm-btn {
      background: linear-gradient(135deg, #0284c7 0%, #0066fe 50%, #7c3aed 100%) !important;
      color: #ffffff !important;
      font-size: 14px;
      font-weight: 600;
      padding: 10px 20px;
      border-radius: 0.75rem;
      border: none;
      display: inline-flex;
      align-items: center;
      gap: 8px;
      box-shadow: 0 4px 16px rgba(0, 102, 254, 0.45) !important;
      cursor: pointer;
      transition: transform 0.15s ease, filter 0.15s ease, box-shadow 0.15s ease;
    }
    .checkout-confirm-btn:hover,
    [data-theme="dark"] .checkout-confirm-btn:hover {
      filter: brightness(1.1) !important;
      box-shadow: 0 6px 22px rgba(0, 102, 254, 0.6) !important;
    }
    .checkout-confirm-btn:active {
      transform: scale(0.97);
    }
    .checkout-confirm-btn:disabled {
      opacity: 0.6;
      cursor: not-allowed;
    }
    .checkout-bolt-icon {
      width: 16px;
      height: 16px;
      color: #f59e0b;
    }

    /* ─── LIGHT THEME OVERRIDES ─── */
    html[data-theme="light"] .modal-box-checkout,
    html[data-theme="light"] .modal-box-checkout-secure,
    [data-theme="light"] .modal-box-checkout,
    [data-theme="light"] .modal-box-checkout-secure,
    [data-theme="light"] .modal-box-checkout.modal-box-checkout-secure {
      background-color: #ffffff !important;
      border: 1px solid #e2e8f0 !important;
      box-shadow: 0 25px 50px -12px rgba(15, 23, 42, 0.15) !important;
      color: #1e293b !important;
    }
    [data-theme="light"] .checkout-secure-title {
      color: #0f172a !important;
    }
    [data-theme="light"] .checkout-shield-icon {
      color: #0284c7 !important;
    }
    [data-theme="light"] .checkout-secure-subtitle {
      color: #64748b !important;
    }
    [data-theme="light"] .checkout-secure-subtitle strong {
      color: #0f172a !important;
    }
    [data-theme="light"] .checkout-close-btn {
      color: #64748b !important;
    }
    [data-theme="light"] .checkout-close-btn:hover {
      color: #0f172a !important;
    }
    [data-theme="light"] .checkout-step-card {
      background-color: #f8fafc !important;
      border: 1px solid #e2e8f0 !important;
      box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05) !important;
    }
    [data-theme="light"] .checkout-step-badge {
      background-color: #e2e8f0 !important;
      color: #334155 !important;
      border: 1px solid #cbd5e1 !important;
    }
    [data-theme="light"] .checkout-step-title {
      color: #0f172a !important;
    }
    [data-theme="light"] .checkout-label {
      color: #64748b !important;
    }
    [data-theme="light"] .checkout-select {
      background-color: #f1f5f9 !important;
      color: #0f172a !important;
      border: 1px solid #cbd5e1 !important;
    }
    [data-theme="light"] .checkout-select:hover {
      background-color: #e2e8f0 !important;
    }
    [data-theme="light"] .checkout-number-text {
      color: #0f172a !important;
    }
    [data-theme="light"] .checkout-copy-btn {
      color: #64748b !important;
    }
    [data-theme="light"] .checkout-copy-btn:hover {
      color: #0f172a !important;
      background-color: #e2e8f0 !important;
    }
    [data-theme="light"] .checkout-amount-text {
      color: #0f172a !important;
    }
    [data-theme="light"] .checkout-text-input {
      background-color: #ffffff !important;
      border: 1px solid #cbd5e1 !important;
      color: #0f172a !important;
    }
    [data-theme="light"] .checkout-text-input:focus {
      border-color: #0284c7 !important;
      background-color: #ffffff !important;
      box-shadow: 0 0 0 2px rgba(2, 132, 199, 0.2) !important;
    }
    [data-theme="light"] .checkout-text-input::placeholder {
      color: #94a3b8 !important;
    }
    [data-theme="light"] .checkout-terms-label {
      color: #64748b !important;
    }
    [data-theme="light"] .checkout-terms-link {
      color: #0284c7 !important;
    }
    [data-theme="light"] .checkout-cancel-btn {
      color: #64748b !important;
    }
    [data-theme="light"] .checkout-cancel-btn:hover {
      color: #0f172a !important;
      background-color: #f1f5f9 !important;
    }


    /* Theme Toggle Switch */
    .theme-switch-pill {
      display: flex;
      align-items: center;
      background: var(--bg-input);
      border: 1px solid var(--border-color);
      border-radius: var(--radius-pill);
      padding: 2px;
      gap: 2px;
      cursor: pointer;
    }

    .theme-switch-opt {
      width: 24px;
      height: 24px;
      border-radius: 50%;
      display: flex;
      align-items: center;
      justify-content: center;
      color: var(--text-dim);
      transition: all 0.15s;
    }

    .theme-switch-opt.active {
      background: var(--accent-blue);
      color: #FFFFFF;
    }

    /* Main Workspace 3-Column Grid */
    .main-workspace {
      display: grid;
      grid-template-columns: var(--sidebar-left-w, 290px) 1fr var(--sidebar-right-w, 320px);
      flex: 1;
      height: calc(100vh - 52px - 32px);
      overflow: hidden;
      gap: 8px;
      padding: 8px;
      background: var(--bg-main);
    }

    /* Sidebars */
    .sidebar {
      display: flex;
      flex-direction: column;
      gap: 8px;
      overflow-y: auto;
      min-width: 0;
      position: relative;
    }
    .left-sidebar { min-width: 220px; max-width: 440px; }
    .right-sidebar { min-width: 300px; max-width: 460px; }
    .sidebar-resize-handle {
      position: sticky;
      top: 0;
      width: 4px;
      cursor: col-resize;
      background: transparent;
      flex-shrink: 0;
      align-self: stretch;
      z-index: 5;
    }
    .sidebar-resize-handle:hover, .sidebar-resize-handle.active {
      background: var(--accent-blue);
    }
    .sidebar-wrap-row { display: flex; align-items: stretch; gap: 0; min-height: 0; }
    #sidebarOverlay {
      display: none;
      position: fixed;
      inset: 52px 0 32px 0;
      background: rgba(0,0,0,0.5);
      z-index: 90;
    }
    #sidebarOverlay.visible { display: block; }
    .mobile-sidebar-toggle { display: none; }
    .sheet-grab-bar { display: none; }
    .mobile-sheet-header { display: none !important; }
    .mobile-bottom-nav { display: none; }

    @media (max-width: 900px) and (min-width: 769px) {
      .main-workspace { grid-template-columns: 1fr; }
      .sidebar {
        position: fixed;
        top: 52px;
        bottom: 32px;
        width: min(320px, 85vw);
        z-index: 95;
        background: var(--bg-panel);
        padding: 8px;
        transition: transform 0.2s ease;
      }
      .left-sidebar { left: 0; transform: translateX(-105%); }
      .right-sidebar { right: 0; transform: translateX(105%); }
      .sidebar.mobile-open { transform: translateX(0); }
      .mobile-sidebar-toggle { display: inline-flex; }
      .sidebar-resize-handle { display: none; }
    }

    /* MODERN MOBILE UX OPTIMIZATION (<768px) */
    @media (max-width: 768px) {
      /* 1. Mobile Bottom Navigation Bar */
      .mobile-bottom-nav {
        display: flex;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        height: calc(56px + env(safe-area-inset-bottom, 0px));
        padding-bottom: env(safe-area-inset-bottom, 0px);
        background: rgba(14, 21, 34, 0.96);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        border-top: 1px solid var(--border-color);
        z-index: 120;
        justify-content: space-around;
        align-items: center;
        box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.45);
      }
      [data-theme="light"] .mobile-bottom-nav {
        background: rgba(255, 255, 255, 0.96);
        border-top-color: #E2E8F0;
        box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.08);
      }
      .mob-nav-item {
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 3px;
        background: none;
        border: none;
        color: var(--text-dim);
        cursor: pointer;
        padding: 6px 0;
        min-height: 48px;
        transition: color 0.2s ease, transform 0.15s ease;
        -webkit-tap-highlight-color: transparent;
      }
      .mob-nav-item:active {
        transform: scale(0.92);
      }
      .mob-nav-icon {
        width: 22px;
        height: 22px;
        display: flex;
        align-items: center;
        justify-content: center;
      }
      .mob-nav-icon svg, .mob-nav-icon i {
        width: 20px;
        height: 20px;
        stroke-width: 2;
      }
      .mob-nav-label {
        font-size: 11px;
        font-weight: 600;
        letter-spacing: 0.02em;
      }
      .mob-nav-item.active {
        color: var(--accent-blue);
      }
      .mob-nav-item.active .mob-nav-label {
        color: var(--accent-blue);
      }

      /* 2. Sidebars formatted as Native Slide-Up Bottom Sheets */
      .app-container {
        height: 100vh;
        height: 100dvh;
        overflow: hidden;
      }
      .main-workspace {
        grid-template-columns: 1fr !important;
        height: calc(100vh - 50px - 56px - env(safe-area-inset-bottom, 0px)) !important;
        height: calc(100dvh - 50px - 56px - env(safe-area-inset-bottom, 0px)) !important;
        overflow: hidden !important;
        padding: 8px !important;
      }
      .sidebar {
        position: fixed !important;
        left: 0 !important;
        right: 0 !important;
        bottom: calc(56px + env(safe-area-inset-bottom, 0px)) !important;
        top: auto !important;
        width: 100% !important;
        max-width: 100% !important;
        height: 74vh !important;
        max-height: 74vh !important;
        border-radius: 20px 20px 0 0 !important;
        border-top: 1px solid rgba(255, 255, 255, 0.15) !important;
        border-left: none !important;
        border-right: none !important;
        box-shadow: 0 -12px 36px rgba(0, 0, 0, 0.6) !important;
        z-index: 110 !important;
        transform: translateY(115%) !important;
        transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1) !important;
        background: var(--bg-panel) !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch !important;
        padding: 0 12px 24px !important;
      }
      [data-theme="light"] .sidebar {
        border-top: 1px solid rgba(0, 0, 0, 0.12) !important;
        box-shadow: 0 -12px 36px rgba(0, 0, 0, 0.15) !important;
      }
      .left-sidebar, .right-sidebar {
        transform: translateY(115%) !important;
      }
      .left-sidebar.mobile-open,
      .right-sidebar.mobile-open,
      .sidebar.mobile-open {
        transform: translateY(0) !important;
        visibility: visible !important;
        display: flex !important;
      }
      .sidebar-resize-handle { display: none !important; }
      .mobile-sidebar-toggle { display: none !important; }

      .sheet-grab-bar {
        display: block !important;
        width: 44px;
        height: 5px;
        background: rgba(148, 163, 184, 0.4);
        border-radius: 999px;
        margin: 10px auto 10px;
        flex-shrink: 0;
        cursor: pointer;
      }
      .sheet-grab-bar:hover {
        background: var(--accent-blue);
      }

      #sidebarOverlay {
        inset: 0 !important;
        bottom: calc(56px + env(safe-area-inset-bottom, 0px)) !important;
        background: rgba(0, 0, 0, 0.6) !important;
        backdrop-filter: blur(3px) !important;
        -webkit-backdrop-filter: blur(3px) !important;
        z-index: 105 !important;
      }

      /* 3. Streamlined Mobile Navbar (Zero-Overflow on 360px+) */
      .navbar {
        height: 52px;
        padding: 0 14px;
        display: flex;
        align-items: center;
        justify-content: space-between;
        background: var(--bg-panel);
        border-bottom: 1px solid var(--border-color);
        z-index: 100;
        box-sizing: border-box;
      }
      .brand-subtitle { display: none !important; }
      .brand-title { font-size: 15px; font-weight: 700; letter-spacing: -0.02em; }
      .brand-icon svg { width: 24px; height: 24px; }

      /* Hide redundant topbar buttons on mobile (Export & Plans are in bottom nav) */
      #topExportBtn, #navQuotaBtn, .nav-quota-pill { display: none !important; }
      .top-toolbar > div[style*="width: 1px"] { display: none !important; }

      /* Hide desktop-only toolbar buttons on mobile */
      #modeSelectBtn, #modePanBtn, #modeZoomBtn, #modeRotateBtn, #topResetViewBtn, #dragLockBtn,
      #openHelpBtn, #openShortcutsBtn {
        display: none !important;
      }

      .top-toolbar {
        flex: 1 !important;
        display: flex !important;
        align-items: center !important;
        justify-content: space-between !important;
        margin-left: 14px !important;
      }
      .toolbar-label { display: none !important; }
      
      .searchable-proj-container {
        position: relative !important;
        max-width: 106px !important;
        margin: 0 auto !important;
        flex-shrink: 1 !important;
      }
      .nav-select-btn {
        height: 32px;
        padding: 0 10px;
        font-size: 11px;
        font-weight: 600;
        max-width: 106px !important;
        border-radius: 999px !important;
        background: var(--bg-input) !important;
        border: 1px solid var(--border-color) !important;
        display: inline-flex;
        align-items: center;
        justify-content: space-between;
        gap: 4px;
        box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
      }
      #projDropdownLabel {
        max-width: 60px !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        white-space: nowrap !important;
        display: inline-block !important;
      }
      .proj-dropdown-menu {
        left: 50% !important;
        right: auto !important;
        transform: translateX(-50%) !important;
        width: 280px !important;
        max-width: calc(100vw - 24px) !important;
        z-index: 10001 !important;
      }

      /* Compact, elegant Theme Switcher */
      .theme-switch-pill {
        display: inline-flex !important;
        height: 32px;
        width: 32px;
        padding: 0 !important;
        align-items: center;
        justify-content: center;
        border-radius: 50% !important;
        background: var(--bg-input) !important;
        border: 1px solid var(--border-color) !important;
        flex-shrink: 0;
        cursor: pointer;
      }
      .theme-switch-opt {
        display: none !important;
      }
      .theme-switch-opt.active {
        display: flex !important;
        width: 100% !important;
        height: 100% !important;
        background: transparent !important;
        color: var(--accent-blue) !important;
      }

      .nav-btn-auth {
        height: 32px;
        padding: 0 10px;
        font-size: 11px;
        border-radius: 999px;
        flex-shrink: 0;
        margin-left: auto !important;
      }
      .user-profile-menu {
        flex-shrink: 0 !important;
        margin-left: auto !important;
        display: inline-flex !important;
        align-items: center !important;
      }
      .nav-user-pill {
        height: 32px;
        padding: 0 !important;
        background: transparent !important;
        border: none !important;
        flex-shrink: 0;
      }
      .nav-user-pill .user-name,
      .nav-user-pill [data-lucide="chevron-down"],
      .nav-user-pill svg.lucide-chevron-down {
        display: none !important;
      }
      .user-avatar {
        width: 32px;
        height: 32px;
        border-radius: 50%;
        border: 2px solid var(--accent-blue);
        box-shadow: 0 2px 10px rgba(0, 102, 254, 0.35);
        font-size: 12px;
        overflow: hidden;
        flex-shrink: 0;
        display: flex;
        align-items: center;
        justify-content: center;
      }
      .user-dropdown-popover {
        left: auto !important;
        right: 0 !important;
        max-width: calc(100vw - 24px) !important;
      }

      .app-footer { display: none !important; }

      /* 4. Canvas Clutter Elimination on Mobile (Single Clean Zoom Pill Only) */
      .floating-left-tools { display: none !important; }
      .floating-top-right { display: none !important; }
      .recent-maps-panel { display: none !important; }

      .floating-zoom-pill {
        position: fixed !important;
        right: 14px !important;
        top: auto !important;
        bottom: calc(118px + env(safe-area-inset-bottom, 0px)) !important;
        transform: none !important;
        z-index: 95 !important;
        box-shadow: 0 6px 20px rgba(0, 0, 0, 0.45) !important;
      }
      .map-stats-card { display: none !important; }
      .map-legend-card {
        position: fixed !important;
        left: 10px !important;
        bottom: calc(118px + env(safe-area-inset-bottom, 0px)) !important;
        max-width: 140px !important;
        font-size: 10px !important;
        z-index: 95 !important;
      }

      /* 5. Mobile Drawer Sticky Header & Close Button */
      .mobile-sheet-header {
        display: flex !important;
        align-items: center;
        justify-content: space-between;
        padding: 4px 4px 10px;
        border-bottom: 1px solid var(--border-color);
        margin-bottom: 12px;
        position: sticky;
        top: 0;
        background: var(--bg-panel);
        z-index: 10;
      }
      .sheet-title {
        font-size: 13px;
        font-weight: 700;
        color: var(--text-main);
        display: flex;
        align-items: center;
        gap: 6px;
      }
      .sheet-close-btn {
        background: rgba(239, 68, 68, 0.12);
        color: #ef4444;
        border: 1px solid rgba(239, 68, 68, 0.25);
        border-radius: 999px;
        padding: 4px 10px;
        font-size: 11px;
        font-weight: 700;
        cursor: pointer;
        display: flex;
        align-items: center;
        gap: 4px;
        transition: all 0.15s ease;
      }
      .sheet-close-btn:hover {
        background: #ef4444;
        color: #ffffff;
      }
    }

    /* Card Panels */
    .card-panel {
      background: var(--bg-panel);
      border: 1px solid var(--border-color);
      border-radius: var(--radius-lg);
      overflow: hidden;
      display: flex;
      flex-direction: column;
      flex-shrink: 0;
    }

    .card-panel.flex-auto {
      flex: 1;
    }

    .card-header {
      padding: 10px 12px;
      display: flex;
      align-items: center;
      gap: 8px;
      font-size: 12px;
      font-weight: 600;
      letter-spacing: 0.3px;
      text-transform: none;
      color: var(--card-header-color);
      cursor: pointer;
      user-select: none;
      background: var(--bg-panel);
      transition: background 0.15s, color 0.15s;
    }

    .card-header:hover {
      background: var(--bg-card);
      color: var(--card-header-hover);
    }

    .card-header .chevron {
      width: 14px;
      height: 14px;
      color: var(--text-dim);
      transition: transform 0.2s ease;
      flex-shrink: 0;
    }

    .card-panel.open .card-header .chevron {
      transform: rotate(90deg);
    }

    .card-panel:not(.open) .card-body {
      display: none !important;
    }

    .card-body {
      padding: 10px 12px;
      display: flex;
      flex-direction: column;
      gap: 8px;
      border-top: 1px solid var(--border-color);
      background: var(--bg-panel);
    }

    .card-header-actions {
      margin-left: auto;
      display: flex;
      align-items: center;
      gap: 4px;
    }

    .btn-micro {
      background: transparent;
      border: 1px solid transparent;
      color: var(--text-muted);
      padding: 2px 7px;
      border-radius: var(--radius-sm);
      font-size: 11px;
      font-weight: 500;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      cursor: pointer;
      white-space: nowrap !important;
      flex-shrink: 0;
      transition: all 0.15s;
    }

    .btn-micro:hover {
      color: var(--text-main);
      background: var(--bg-hover);
      border-color: var(--border-light);
    }

    /* Controls Rows */
    .ctrl-row {
      display: flex;
      align-items: center;
      gap: 8px;
      min-height: 24px;
    }

    .ctrl-label {
      width: 74px;
      font-size: 12px;
      font-weight: 500;
      color: var(--text-muted);
      flex-shrink: 0;
    }

    .ctrl-slider-wrapper {
      flex: 1;
      display: flex;
      align-items: center;
      gap: 8px;
    }

    .ctrl-slider {
      flex: 1;
      height: 4px;
      accent-color: var(--accent-blue);
      cursor: pointer;
    }

    .ctrl-val {
      font-family: var(--font-mono);
      font-size: 11px;
      color: var(--text-muted);
      width: 32px;
      text-align: right;
      flex-shrink: 0;
    }

    /* Color Swatch Component */
    .color-swatch-box {
      display: flex;
      align-items: center;
      gap: 6px;
      background: var(--bg-input);
      border: 1px solid var(--border-color);
      border-radius: var(--radius-md);
      padding: 2px 6px;
      height: 26px;
      position: relative;
      cursor: pointer;
      flex: 1;
    }

    .color-swatch-preview {
      width: 14px;
      height: 14px;
      border-radius: var(--radius-sm);
      border: 1px solid var(--border-color);
      box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.08);
      flex-shrink: 0;
    }

    .color-swatch-hex {
      font-family: var(--font-mono);
      font-size: 11px;
      color: var(--text-muted);
      text-transform: uppercase;
    }

    .color-input-hidden {
      position: absolute;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
      opacity: 0;
      cursor: pointer;
    }

    .ctrl-select {
      flex: 1;
      background: var(--bg-input);
      border: 1px solid var(--border-color);
      border-radius: var(--radius-md);
      color: var(--text-main);
      padding: 4px 8px;
      font-size: 11px;
      outline: none;
      cursor: pointer;
      height: 26px;
    }

    /* Map Data Provider Switcher (amCharts vs Natural Earth) - Image 1 Glass Squircle & Neon Glow */
    .map-provider-switcher {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 8px;
      padding: 0;
      background: transparent;
      border: none;
      margin-bottom: 8px;
      box-sizing: border-box;
      width: 100%;
    }
    .provider-pill-btn {
      position: relative;
      flex: 1;
      min-width: 0;
      height: 44px;
      display: inline-flex;
      align-items: center;
      justify-content: flex-start;
      padding: 3px 8px 3px 4px;
      gap: 7px;
      border-radius: 14px;
      border: 1.5px solid rgba(255, 255, 255, 0.14);
      background: linear-gradient(180deg, rgba(16, 26, 46, 0.65) 0%, rgba(9, 16, 32, 0.82) 100%);
      color: #ffffff;
      cursor: pointer;
      user-select: none;
      white-space: nowrap;
      backdrop-filter: blur(12px);
      -webkit-backdrop-filter: blur(12px);
      box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.08);
      transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
      overflow: hidden;
      outline: none;
      box-sizing: border-box;
    }
    .provider-pill-btn:hover {
      border-color: rgba(255, 255, 255, 0.28);
      background: linear-gradient(180deg, rgba(22, 36, 64, 0.78) 0%, rgba(13, 22, 42, 0.92) 100%);
      box-shadow: 0 6px 18px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.15);
      transform: translateY(-1px);
    }
    /* Active Pill State: Neon Electric Glow & Sapphire Glass (Image 1 style) */
    .provider-pill-btn.active {
      border: 1.5px solid #0088FF;
      background: linear-gradient(180deg, rgba(7, 28, 68, 0.92) 0%, rgba(3, 14, 40, 0.98) 100%);
      color: #ffffff;
      box-shadow: 0 0 16px rgba(0, 136, 255, 0.6), 0 0 30px rgba(0, 114, 255, 0.25), inset 0 0 5px rgba(0, 210, 255, 0.35);
      transform: translateY(0);
    }
    .provider-pill-btn.active:hover {
      border-color: #00A6FF;
      box-shadow: 0 0 20px rgba(0, 136, 255, 0.75), 0 0 36px rgba(0, 114, 255, 0.35), inset 0 0 6px rgba(0, 210, 255, 0.5);
    }
    /* Icon Squircle Badge (Image 1 rounded glass square) */
    .provider-badge {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      width: 32px;
      height: 32px;
      border-radius: 10px;
      background: rgba(255, 255, 255, 0.05);
      border: 1px solid rgba(255, 255, 255, 0.1);
      box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
      flex-shrink: 0;
      position: relative;
      transition: all 0.2s ease;
    }
    .provider-pill-btn.active .provider-badge {
      background: rgba(255, 255, 255, 0.08);
      border-color: rgba(255, 255, 255, 0.18);
      box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25);
    }
    /* Typography Labels (Image 1 style) */
    .provider-label {
      font-size: 12.5px;
      font-weight: 600;
      letter-spacing: -0.01em;
      color: #FFFFFF;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
      transition: all 0.2s ease;
      line-height: 1;
    }
    #providerNaturalEarthBtn .provider-label {
      font-size: 11.8px;
      letter-spacing: -0.02em;
    }
    .provider-pill-btn.active .provider-label {
      color: #FFFFFF;
      text-shadow: 0 0 12px rgba(56, 189, 248, 0.5);
    }
    /* SVG Icon Sizes & Hover */
    .provider-svg {
      display: block;
      transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1);
    }
    .provider-pill-btn:hover .provider-svg {
      transform: scale(1.08);
    }
    .provider-svg.lightning-svg {
      width: 17px;
      height: 17px;
    }
    .provider-svg.globe-svg {
      width: 22px;
      height: 22px;
    }
    /* Light Theme Adaptation */
    [data-theme="light"] .map-provider-switcher {
      background: transparent;
      border: none;
    }
    [data-theme="light"] .provider-pill-btn {
      background: linear-gradient(180deg, #FFFFFF 0%, #F8FAFC 100%);
      border-color: #CBD5E1;
      color: #1E293B;
      box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05), 0 2px 8px rgba(0, 0, 0, 0.03);
    }
    [data-theme="light"] .provider-pill-btn:hover {
      background: #F1F5F9;
      border-color: #94A3B8;
      box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    }
    [data-theme="light"] .provider-pill-btn.active {
      background: linear-gradient(180deg, #F0F9FF 0%, #E0F2FE 100%);
      border-color: #0284C7;
      color: #0369A1;
      box-shadow: 0 0 14px rgba(2, 132, 199, 0.25), 0 2px 6px rgba(0, 0, 0, 0.06);
    }
    [data-theme="light"] .provider-badge {
      background: #FFFFFF;
      border-color: #E2E8F0;
      box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
    }
    [data-theme="light"] .provider-pill-btn.active .provider-badge {
      background: #FFFFFF;
      border-color: #93C5FD;
      box-shadow: 0 0 8px rgba(2, 132, 199, 0.2);
    }
    [data-theme="light"] .provider-label {
      color: #334155;
    }
    [data-theme="light"] .provider-pill-btn.active .provider-label {
      color: #0284C7;
      font-weight: 700;
      text-shadow: none;
    }

    /* Map Source Selector with Flag Display */
    .map-source-picker-container {
      position: relative;
      width: 100%;
      height: 32px;
    }

    .map-source-custom-trigger {
      position: absolute;
      inset: 0;
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding: 0 10px;
      background: var(--bg-input);
      border: 1px solid var(--border-color);
      border-radius: var(--radius-md);
      color: var(--text-main);
      font-size: 12px;
      font-weight: 500;
      pointer-events: none;
      transition: all 0.15s ease;
      box-sizing: border-box;
      z-index: 1;
    }

    .map-source-picker-container:hover .map-source-custom-trigger,
    .map-source-picker-container:focus-within .map-source-custom-trigger {
      border-color: var(--accent-blue);
      background: var(--bg-hover);
    }

    .map-source-trigger-left {
      display: flex;
      align-items: center;
      gap: 8px;
      min-width: 0;
      flex: 1;
    }

    .map-source-flag-badge {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      width: 20px;
      height: 15px;
      flex-shrink: 0;
      overflow: hidden;
      border-radius: 2px;
    }

    .map-source-flag-badge svg {
      width: 14px;
      height: 14px;
      color: var(--text-muted);
    }

    .map-source-flag-img {
      width: 20px;
      height: 14px;
      object-fit: cover;
      border-radius: 2px;
      box-shadow: 0 0 1px rgba(0, 0, 0, 0.4);
      display: block;
    }

    .map-source-trigger-label {
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
      font-size: 12px;
      font-weight: 500;
      color: var(--text-main);
    }

    .map-source-trigger-chevron {
      width: 13px;
      height: 13px;
      color: var(--text-muted);
      flex-shrink: 0;
      margin-left: 6px;
    }

    .map-source-overlay-select {
      position: absolute;
      inset: 0;
      width: 100% !important;
      height: 100% !important;
      opacity: 0 !important;
      cursor: pointer !important;
      z-index: 2 !important;
      margin: 0 !important;
      padding: 0 !important;
    }

    .tree-flag-img {
      width: 16px;
      height: 12px;
      object-fit: cover;
      border-radius: 2px;
      box-shadow: 0 0 1px rgba(0, 0, 0, 0.3);
      flex-shrink: 0;
    }

    /* iOS Style Toggle Switch */
    .switch-toggle {
      position: relative;
      display: inline-block;
      width: 32px;
      height: 18px;
      flex-shrink: 0;
    }

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

    .switch-slider {
      position: absolute;
      cursor: pointer;
      top: 0;
      left: 0;
      right: 0;
      bottom: 0;
      background-color: var(--switch-bg);
      transition: .2s;
      border-radius: var(--radius-pill);
      border: 1px solid var(--border-color);
    }

    .switch-slider:before {
      position: absolute;
      content: "";
      height: 12px;
      width: 12px;
      left: 2px;
      bottom: 2px;
      background-color: #94A3B8;
      transition: .2s;
      border-radius: 50%;
    }

    .switch-toggle input:checked + .switch-slider {
      background-color: var(--accent-blue);
      border-color: var(--accent-blue);
    }

    .switch-toggle input:checked + .switch-slider:before {
      transform: translateX(14px);
      background-color: #FFFFFF;
    }

    /* Tree View in Left Panel */
    .tree-container {
      max-height: 180px;
      overflow-y: auto;
      display: flex;
      flex-direction: column;
      gap: 2px;
      padding-right: 2px;
    }

    .tree-group-header {
      padding: 6px 8px;
      font-size: 12px;
      font-weight: 600;
      color: var(--text-muted);
      cursor: pointer;
      display: flex;
      align-items: center;
      gap: 6px;
      border-radius: var(--radius-sm);
      transition: background 0.15s;
    }

    .tree-group-header:hover {
      color: var(--text-main);
      background: var(--bg-hover);
    }

    .tree-group.expanded .tree-group-header i.chevron {
      transform: rotate(90deg);
    }

    .tree-items {
      display: none;
      padding-left: 10px;
      flex-direction: column;
      gap: 2px;
    }

    .tree-group.expanded .tree-items {
      display: flex;
    }

    .tree-item {
      padding: 6px 8px;
      font-size: 12px;
      color: var(--text-dim);
      cursor: pointer;
      border-radius: var(--radius-sm);
      display: flex;
      align-items: center;
      gap: 6px;
      transition: all 0.15s;
    }

    .tree-item:hover {
      color: var(--text-main);
      background: var(--bg-hover);
    }

    .tree-item.active {
      background: rgba(59, 130, 246, 0.15);
      color: #2563EB;
      font-weight: 600;
    }

    [data-theme="dark"] .tree-item.active {
      background: rgba(59, 130, 246, 0.2);
      color: #60A5FA;
    }

    .tree-item i.check-icon {
      margin-left: auto;
      display: none;
      color: #60A5FA;
      width: 12px;
      height: 12px;
    }

    .tree-item.active i.check-icon {
      display: block;
    }

    /* Center Map Panel Workspace */
    .center-workspace {
      display: flex;
      flex-direction: column;
      gap: 8px;
      min-width: 0;
      position: relative;
    }

    .map-canvas-container {
      flex: 1;
      position: relative;
      background: var(--map-ocean);
      border: 1px solid var(--border-color);
      border-radius: var(--radius-lg);
      overflow: hidden;
      min-height: 0;
    }

    #chartdiv {
      width: 100%;
      height: 100%;
      transition: background 0.25s ease;
      animation: fadeInMap 0.45s cubic-bezier(0.16, 1, 0.3, 1);
    }

    @keyframes fadeInMap {
      from { opacity: 0; transform: scale(0.995); }
      to { opacity: 1; transform: scale(1); }
    }

    /* Floating Map Toolbars */
    .floating-left-tools {
      position: absolute;
      top: 12px;
      left: 12px;
      display: flex;
      flex-direction: column;
      gap: 4px;
      background: var(--floating-bg);
      backdrop-filter: blur(8px);
      border: 1px solid var(--floating-border);
      border-radius: var(--radius-md);
      box-shadow: var(--floating-shadow);
      padding: 4px;
      z-index: 10;
    }

    .float-tool-btn {
      width: 28px;
      height: 28px;
      display: flex;
      align-items: center;
      justify-content: center;
      background: transparent;
      border: none;
      border-radius: var(--radius-sm);
      color: var(--floating-text-dim);
      cursor: pointer;
      transition: all 0.15s;
    }

    .float-tool-btn:hover {
      background: var(--floating-hover);
      color: var(--floating-text);
    }

    .float-tool-btn.active {
      background: var(--accent-blue);
      color: #FFFFFF;
    }

    .float-tool-btn i {
      width: 15px;
      height: 15px;
    }

    .floating-top-right {
      position: absolute;
      top: 12px;
      right: 12px;
      z-index: 10;
    }

    .floating-reset-btn {
      background: var(--floating-bg) !important;
      backdrop-filter: blur(6px) !important;
      border: 1px solid var(--floating-border) !important;
      color: var(--floating-text) !important;
      box-shadow: var(--floating-shadow) !important;
    }

    .floating-reset-btn:hover {
      background: var(--floating-hover) !important;
      color: var(--floating-text) !important;
    }

    /* Right-side Zoom Pill (Home / + / -) */
    .floating-zoom-pill {
      position: absolute;
      right: 12px;
      top: 50%;
      transform: translateY(-50%);
      display: flex;
      flex-direction: column;
      align-items: center;
      background: var(--zoom-pill-bg);
      border: 1px solid var(--zoom-pill-border);
      border-radius: var(--radius-pill);
      padding: 6px 0;
      z-index: 10;
      box-shadow: var(--floating-shadow);
    }

    .zoom-pill-btn {
      width: 32px;
      height: 32px;
      display: flex;
      align-items: center;
      justify-content: center;
      background: transparent;
      border: none;
      border-radius: 50%;
      color: var(--zoom-pill-color);
      cursor: pointer;
      transition: background 0.15s;
    }

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

    .zoom-pill-btn i {
      width: 16px;
      height: 16px;
    }

    .zoom-pill-divider {
      width: 18px;
      height: 1px;
      background: var(--zoom-pill-divider);
      margin: 3px 0;
    }

    /* Floating Map Stats Card */
    .map-stats-card {
      position: absolute;
      bottom: 12px;
      left: 12px;
      background: var(--floating-bg);
      backdrop-filter: blur(8px);
      border: 1px solid var(--floating-border);
      border-radius: var(--radius-md);
      box-shadow: var(--floating-shadow);
      padding: 8px 12px;
      display: flex;
      flex-direction: column;
      gap: 4px;
      z-index: 10;
      min-width: 160px;
    }

    .stats-title {
      font-size: 10px;
      font-weight: 700;
      letter-spacing: 0.5px;
      text-transform: uppercase;
      color: var(--text-dim);
      display: flex;
      align-items: center;
      gap: 5px;
    }

    .stats-row {
      display: flex;
      justify-content: space-between;
      font-size: 11px;
      color: var(--text-muted);
    }

    .stats-val {
      font-weight: 600;
      color: var(--text-main);
      font-family: var(--font-mono);
    }

    /* Floating Legend Card */
    .map-legend-card {
      position: absolute;
      bottom: 12px;
      right: 12px;
      background: var(--floating-bg);
      backdrop-filter: blur(8px);
      border: 1px solid var(--floating-border);
      border-radius: var(--radius-md);
      box-shadow: var(--floating-shadow);
      padding: 8px 12px;
      display: flex;
      flex-direction: column;
      gap: 4px;
      z-index: 10;
      max-height: 140px;
      overflow-y: auto;
      min-width: 130px;
    }

    .legend-item {
      display: flex;
      align-items: center;
      gap: 6px;
      font-size: 11px;
      color: var(--text-muted);
    }

    .legend-dot {
      width: 10px;
      height: 10px;
      border-radius: var(--radius-sm);
      flex-shrink: 0;
    }

    /* Recent Maps Carousel / Shelf */
    .recent-maps-panel {
      background: var(--bg-panel);
      border: 1px solid var(--border-color);
      border-radius: var(--radius-lg);
      overflow: hidden;
      flex-shrink: 0;
    }

    .recent-maps-header {
      padding: 8px 12px;
      display: flex;
      align-items: center;
      justify-content: space-between;
      font-size: 12px;
      font-weight: 600;
      letter-spacing: 0.3px;
      text-transform: none;
      color: var(--text-muted);
      cursor: pointer;
    }

    .recent-maps-list {
      display: flex;
      align-items: center;
      gap: 8px;
      padding: 6px 12px 10px;
      overflow-x: auto;
    }

    .preset-card {
      width: 86px;
      height: 48px;
      border: 1px solid var(--border-color);
      border-radius: var(--radius-md);
      background: var(--bg-card);
      cursor: pointer;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      flex-shrink: 0;
      transition: all 0.15s;
      position: relative;
      overflow: hidden;
      user-select: none;
    }

    .preset-card:hover {
      border-color: var(--accent-blue);
      transform: translateY(-1px);
    }

    .preset-card.active {
      border-color: #38BDF8;
      box-shadow: 0 0 0 1px #38BDF8, 0 2px 8px rgba(56, 189, 248, 0.35);
    }


    .preset-card.add-save {
      border-style: dashed;
      border-color: rgba(6, 182, 212, 0.45);
      color: var(--accent-cyan);
      background: rgba(6, 182, 212, 0.05);
    }

    .preset-card.add-save:hover {
      border-color: var(--accent-cyan);
      background: rgba(6, 182, 212, 0.12);
      color: #38BDF8;
      transform: translateY(-1px);
    }

    .preset-card.custom-preset {
      position: relative;
    }

    .preset-delete-btn {
      position: absolute;
      top: 3px;
      right: 3px;
      width: 15px;
      height: 15px;
      border-radius: 50%;
      background: rgba(15, 23, 42, 0.85);
      color: #CBD5E1;
      border: 1px solid rgba(255, 255, 255, 0.25);
      font-size: 9px;
      font-family: inherit;
      line-height: 1;
      display: flex;
      align-items: center;
      justify-content: center;
      cursor: pointer;
      opacity: 0;
      transition: all 0.15s ease;
      z-index: 10;
      padding: 0;
    }

    [data-theme="light"] .preset-delete-btn {
      background: rgba(255, 255, 255, 0.9);
      color: #475569;
      border-color: rgba(0, 0, 0, 0.18);
    }

    .preset-card:hover .preset-delete-btn {
      opacity: 1;
    }

    .preset-delete-btn:hover {
      background: #EF4444;
      color: #FFFFFF;
      border-color: #EF4444;
      transform: scale(1.15);
    }

    .preset-card * {
      pointer-events: none;
    }

    .preset-card .preset-delete-btn {
      pointer-events: auto;
    }

    .preset-card svg {
      width: 100%;
      height: 100%;
      opacity: 0.85;
      transition: opacity 0.15s;
    }

    .preset-card:hover svg {
      opacity: 1;
    }

    /* Polygons & Painted Lists */
    .polygon-list-box {
      max-height: 160px;
      overflow-y: auto;
      display: flex;
      flex-direction: column;
      gap: 2px;
      padding-right: 2px;
    }

    .polygon-row {
      display: flex;
      align-items: flex-start;
      gap: 8px;
      padding: 5px 6px;
      border-radius: var(--radius-sm);
      color: var(--text-main);
      font-size: 12px;
      cursor: pointer;
      transition: background 0.1s;
    }

    .polygon-row:hover {
      background: var(--bg-hover);
    }

    .polygon-dot {
      width: 8px;
      height: 8px;
      border-radius: 50%;
      flex-shrink: 0;
      margin-top: 4px;
      transition: transform 0.12s;
    }

    /* Per-part color picker: click a row's dot to recolor just that part. */
    .polygon-dot-picker {
      position: relative;
      display: flex;
      align-items: center;
      cursor: pointer;
      flex-shrink: 0;
      padding: 2px;
      margin: -2px;
    }
    .polygon-dot-picker:hover .polygon-dot {
      transform: scale(1.5);
      box-shadow: 0 0 0 2px var(--accent-blue);
    }
    .polygon-dot-input {
      position: absolute;
      inset: 0;
      width: 100%;
      height: 100%;
      opacity: 0;
      cursor: pointer;
      padding: 0;
      border: none;
    }

    .polygon-name {
      flex: 1;
      min-width: 0;
      white-space: normal;
      word-break: break-word;
      line-height: 1.35;
    }

    .polygon-eye-btn {
      background: transparent;
      border: none;
      color: var(--text-dim);
      cursor: pointer;
      padding: 2px;
      display: flex;
      align-items: center;
      border-radius: var(--radius-sm);
    }

    .polygon-eye-btn:hover {
      color: var(--text-main);
    }

    .polygon-row.hidden {
      opacity: 0.4;
      text-decoration: line-through;
    }

    .painted-item-row {
      display: flex;
      align-items: center;
      gap: 8px;
      padding: 4px 6px;
      border-radius: var(--radius-sm);
      background: var(--bg-input);
      border: 1px solid var(--border-color);
      font-size: 11px;
      color: var(--text-main);
    }

    .painted-item-del {
      margin-left: auto;
      background: transparent;
      border: none;
      color: var(--text-dim);
      cursor: pointer;
      font-size: 14px;
      padding: 0 4px;
      border-radius: var(--radius-sm);
    }

    .painted-item-del:hover {
      color: var(--accent-red);
    }

    /* Randomize Colors Button & Palette Controls */
    .randomize-color-row {
      display: flex;
      gap: 6px;
      align-items: center;
    }

    .btn-randomize-colors {
      background: var(--bg-input);
      border: 1px solid var(--border-color);
      color: var(--text-main);
      font-size: 11.5px;
      white-space: nowrap !important;
      flex-shrink: 0;
      transition: all 0.2s ease;
      user-select: none;
    }

    .btn-randomize-colors:hover {
      border-color: var(--accent-blue);
      background: var(--bg-hover);
      transform: translateY(-1px);
      box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    }

    .btn-randomize-colors:active {
      transform: translateY(0);
    }

    [data-theme="light"] .btn-randomize-colors {
      background: #FFFFFF;
      border-color: #E2DACF;
      color: #1F2937;
    }

    [data-theme="light"] .btn-randomize-colors:hover {
      border-color: #1E5E45;
      background: #F5EFE6;
      box-shadow: 0 2px 6px rgba(30, 94, 69, 0.12);
    }

    [data-theme="light"] .btn-randomize-colors svg {
      color: #1E5E45 !important;
    }

    /* Export Format Tabs & Actions */
    .export-tabs {
      display: flex;
      background: var(--bg-input);
      border: 1px solid var(--border-color);
      border-radius: var(--radius-md);
      padding: 2px;
      gap: 2px;
    }

    .export-tab {
      flex: 1;
      padding: 5px 0;
      text-align: center;
      background: transparent;
      border: none;
      border-radius: var(--radius-sm);
      font-size: 11px;
      font-weight: 600;
      color: var(--text-muted);
      cursor: pointer;
      transition: all 0.15s;
    }

    .export-tab.active {
      background: var(--accent-blue);
      color: #FFFFFF;
    }

    /* Custom Ratio & Dimensions Controls - High-End Studio Panel */
    .custom-size-panel {
      display: flex;
      flex-direction: column;
      gap: 9px;
      padding: 10px 11px;
      background: rgba(15, 23, 42, 0.55);
      backdrop-filter: blur(12px);
      -webkit-backdrop-filter: blur(12px);
      border: 1px solid rgba(255, 255, 255, 0.09);
      border-radius: var(--radius-md, 8px);
      margin-top: -2px;
      box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05), 0 4px 12px rgba(0, 0, 0, 0.15);
      animation: fadeInCustomSize 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    }

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

    .custom-size-header {
      display: flex;
      align-items: center;
      justify-content: space-between;
    }

    .custom-size-title {
      font-size: 11px;
      font-weight: 600;
      color: var(--text-muted, #94A3B8);
      letter-spacing: 0.2px;
    }

    .custom-size-badge {
      font-size: 10px;
      font-weight: 600;
      padding: 1px 6px;
      background: rgba(56, 189, 248, 0.12);
      border: 1px solid rgba(56, 189, 248, 0.3);
      color: var(--accent-blue, #38BDF8);
      border-radius: 999px;
      font-family: 'JetBrains Mono', monospace;
    }

    /* Segmented Track */
    .ratio-segmented-track {
      display: flex;
      background: rgba(0, 0, 0, 0.3);
      border: 1px solid rgba(255, 255, 255, 0.08);
      border-radius: 6px;
      padding: 2px;
      gap: 2px;
    }

    .ratio-pill {
      flex: 1;
      padding: 4px 0;
      text-align: center;
      background: transparent !important;
      border: none !important;
      border-radius: 4px;
      font-size: 10px;
      font-weight: 500;
      color: var(--text-muted, #94A3B8) !important;
      cursor: pointer;
      transition: all 0.15s ease;
      outline: none;
      user-select: none;
    }

    .ratio-pill:hover {
      background: rgba(255, 255, 255, 0.06) !important;
      color: var(--text-primary, #F8FAFC) !important;
    }

    .ratio-pill.active {
      background: var(--accent-blue, #2563EB) !important;
      color: #FFFFFF !important;
      font-weight: 600;
      box-shadow: 0 1px 4px rgba(37, 99, 235, 0.35);
    }

    /* Dimensions Input Row */
    .dim-inputs-row {
      display: grid;
      grid-template-columns: 1fr auto 1fr;
      gap: 6px;
      align-items: center;
    }

    .dim-input-group {
      display: flex;
      align-items: center;
      background: rgba(255, 255, 255, 0.04);
      border: 1px solid rgba(255, 255, 255, 0.1);
      border-radius: 6px;
      padding: 0 6px;
      height: 28px;
      transition: all 0.15s ease;
    }

    .dim-input-group:focus-within {
      border-color: var(--accent-blue, #38BDF8);
      background: rgba(255, 255, 255, 0.07);
      box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.2);
    }

    .dim-label {
      font-size: 10px;
      font-weight: 700;
      color: var(--text-muted, #64748B);
      font-family: 'JetBrains Mono', monospace;
      user-select: none;
    }

    .dim-field {
      flex: 1;
      width: 100%;
      min-width: 0;
      background: transparent !important;
      border: none !important;
      outline: none !important;
      color: var(--text-primary, #F8FAFC) !important;
      font-size: 11px;
      font-weight: 600;
      font-family: 'JetBrains Mono', monospace;
      text-align: center;
      padding: 0 4px;
      -moz-appearance: textfield;
    }

    .dim-field::-webkit-outer-spin-button,
    .dim-field::-webkit-inner-spin-button {
      -webkit-appearance: none;
      margin: 0;
    }

    .dim-unit {
      font-size: 10px;
      color: var(--text-muted, #64748B);
      font-weight: 500;
      user-select: none;
    }

    /* Ratio Lock Button */
    .btn-dim-lock {
      width: 28px;
      height: 28px;
      display: flex;
      align-items: center;
      justify-content: center;
      background: rgba(255, 255, 255, 0.04);
      border: 1px solid rgba(255, 255, 255, 0.1);
      border-radius: 6px;
      color: var(--text-muted, #94A3B8);
      cursor: pointer;
      transition: all 0.15s ease;
      outline: none;
      padding: 0;
    }

    .btn-dim-lock:hover {
      background: rgba(255, 255, 255, 0.09);
      color: var(--text-primary, #FFFFFF);
    }

    .btn-dim-lock.active {
      background: rgba(56, 189, 248, 0.15) !important;
      border-color: rgba(56, 189, 248, 0.4) !important;
      color: var(--accent-blue, #38BDF8) !important;
    }

    /* Ratio Status Hint */
    .ratio-hint-text {
      display: flex;
      align-items: center;
      gap: 5px;
      font-size: 10px;
      color: var(--text-muted, #64748B);
      font-weight: 500;
      padding-top: 1px;
    }

    .btn-download-primary {
      width: 100%;
    }

    .export-btn-grid {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 6px;
    }

    .btn-reset-destructive {
      background: rgba(239, 68, 68, 0.08);
      border: 1px solid rgba(239, 68, 68, 0.25);
      color: #EF4444;
      height: 32px;
      padding: 0 12px;
      border-radius: var(--radius-md);
      font-size: 12px;
      font-weight: 600;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      gap: 6px;
      cursor: pointer;
      transition: all 0.15s;
    }

    .btn-reset-destructive:hover {
      background: #EF4444;
      color: #FFFFFF;
    }

    /* Footer */
    footer.app-footer {
      height: 32px;
      background: var(--bg-panel);
      border-top: 1px solid var(--border-color);
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding: 0 16px;
      font-size: 11px;
      color: var(--text-dim);
      flex-shrink: 0;
    }

    .status-coords {
      font-family: var(--font-mono);
      font-size: 11px;
      color: var(--text-muted);
      display: flex;
      align-items: center;
      gap: 12px;
    }

    .status-coords span {
      display: inline-flex;
      align-items: center;
    }

    .status-stats {
      display: flex;
      align-items: center;
      gap: 12px;
    }

    .status-badge {
      display: inline-flex;
      align-items: center;
      gap: 4px;
      background: var(--bg-input);
      border: 1px solid var(--border-color);
      padding: 2px 8px;
      border-radius: var(--radius-sm);
      font-size: 10px;
      font-weight: 600;
      color: var(--text-muted);
    }

    /* Modal dialog */
    .modal-overlay {
      position: fixed;
      inset: 0;
      background: rgba(0, 0, 0, 0.75);
      backdrop-filter: blur(5px);
      -webkit-backdrop-filter: blur(5px);
      display: none;
      align-items: center;
      justify-content: center;
      z-index: 99999 !important;
      padding: 16px;
      box-sizing: border-box;
    }
    @media (max-width: 640px) {
      .modal-overlay { padding: 10px; }
    }

    .modal-overlay.open {
      display: flex !important;
    }

    .modal-box {
      background: var(--bg-panel);
      border: 1px solid var(--border-color);
      border-radius: var(--radius-lg);
      width: 460px;
      max-width: 90vw;
      max-height: 80vh;
      overflow-y: auto;
      box-shadow: 0 20px 40px rgba(0,0,0,0.5);
    }

    .modal-header {
      padding: 14px 18px;
      border-bottom: 1px solid var(--border-color);
      display: flex;
      align-items: center;
      justify-content: space-between;
      font-size: 14px;
      font-weight: 700;
    }

    .modal-close {
      background: transparent;
      border: none;
      color: var(--text-dim);
      font-size: 18px;
      cursor: pointer;
    }

    .modal-close:hover {
      color: var(--text-main);
    }

    .modal-body {
      padding: 16px 18px;
      font-size: 12px;
      color: var(--text-muted);
      line-height: 1.6;
      display: flex;
      flex-direction: column;
      gap: 12px;
    }

    .shortcut-row {
      display: flex;
      justify-content: space-between;
      padding: 6px 0;
      border-bottom: 1px solid var(--border-color);
    }

    .kbd-badge {
      background: var(--bg-card);
      border: 1px solid var(--border-light);
      border-radius: var(--radius-sm);
      padding: 2px 6px;
      font-family: var(--font-mono);
      font-size: 11px;
      color: var(--text-main);
    }

    /* Completely hide and disable all watermark logos and external links */
    a[href*="amcharts"],
    a[href*="amcharts.com"],
    #chartdiv a,
    #chartdiv svg a,
    .am5-logo,
    [class*="am5-logo"],
    g[class*="am5-logo"],
    svg g[aria-label*="amCharts"] {
      display: none !important;
      visibility: hidden !important;
      opacity: 0 !important;
      pointer-events: none !important;
      height: 0 !important;
      width: 0 !important;
      overflow: hidden !important;
    }

    /* ==========================================================================
       LIGHT MODE AESTHETIC REFINEMENT (WARM LINEN & FOREST SAGE GREEN)
       ========================================================================== */

    /* Navbar Brand & Profile */
    [data-theme="light"] .brand-title .accent {
      background: linear-gradient(135deg, #1E5E45, #2D6A4F) !important;
      -webkit-background-clip: text !important;
      background-clip: text !important;
      -webkit-text-fill-color: transparent !important;
    }

    /* Subscription Quota Pill - Light Theme Modern SaaS Capsule */
    [data-theme="light"] .nav-quota-pill {
      background: #FFFFFF !important;
      border: 1px solid #CBD5E1 !important;
      color: #1E293B !important;
      box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05) !important;
      height: 32px !important;
      padding: 3px 4px 3px 10px !important;
      border-radius: 9999px !important;
      display: inline-flex !important;
      align-items: center !important;
      gap: 7px !important;
      box-sizing: border-box !important;
      white-space: nowrap !important;
    }

    [data-theme="light"] .nav-quota-pill:hover {
      background: #F8FAFC !important;
      border-color: #94A3B8 !important;
      transform: translateY(-1px);
      box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08) !important;
    }

    [data-theme="light"] .nav-quota-pill .quota-icon {
      color: #D97706 !important;
      filter: drop-shadow(0 0 4px rgba(217, 119, 6, 0.35)) !important;
    }

    [data-theme="light"] .nav-quota-pill .quota-text {
      color: #64748B !important;
      font-size: 11.5px !important;
    }

    [data-theme="light"] .nav-quota-pill #quotaCount {
      color: #0F172A !important;
      font-weight: 700 !important;
    }

    [data-theme="light"] .quota-upgrade-tag {
      background: linear-gradient(135deg, #1E5E45 0%, #164E37 100%) !important;
      border: 1px solid rgba(255, 255, 255, 0.2) !important;
      color: #FFFFFF !important;
      font-weight: 700 !important;
      font-size: 10.5px !important;
      padding: 3px 9px !important;
      border-radius: 9999px !important;
      box-shadow: 0 2px 8px rgba(30, 94, 69, 0.3) !important;
      letter-spacing: 0.04em !important;
      text-transform: uppercase !important;
      transition: all 0.2s ease !important;
    }

    [data-theme="light"] .nav-quota-pill:hover .quota-upgrade-tag {
      background: linear-gradient(135deg, #2D6A4F 0%, #164E37 100%) !important;
      box-shadow: 0 3px 12px rgba(30, 94, 69, 0.45) !important;
      transform: scale(1.03);
    }

    /* User Profile Pill - Clean & Premium Light Mode Capsule */
    [data-theme="light"] .nav-user-pill {
      background: #FFFFFF !important;
      border: 1px solid #CBD5E1 !important;
      padding: 3px 10px 3px 4px !important;
      border-radius: 9999px !important;
      height: 32px !important;
      display: inline-flex !important;
      align-items: center !important;
      gap: 7px !important;
      box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05) !important;
      box-sizing: border-box !important;
      transition: all 0.2s ease !important;
    }

    [data-theme="light"] .nav-user-pill:hover {
      background: #F8FAFC !important;
      border-color: #94A3B8 !important;
      box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08) !important;
      transform: translateY(-1px);
    }

    [data-theme="light"] .user-avatar {
      width: 24px !important;
      height: 24px !important;
      border-radius: 50% !important;
      background: linear-gradient(135deg, #F59E0B, #EA580C) !important;
      color: #FFFFFF !important;
      font-size: 11.5px !important;
      font-weight: 700 !important;
      box-shadow: 0 1px 3px rgba(234, 88, 12, 0.25) !important;
      display: flex !important;
      align-items: center !important;
      justify-content: center !important;
      flex-shrink: 0 !important;
    }

    [data-theme="light"] .nav-user-pill .user-name {
      color: #0F172A !important;
      font-weight: 600 !important;
      font-size: 12px !important;
      max-width: 170px !important;
      white-space: nowrap !important;
      overflow: hidden !important;
      text-overflow: ellipsis !important;
    }

    [data-theme="light"] .nav-user-pill svg,
    [data-theme="light"] .nav-user-pill i {
      color: #64748B !important;
      width: 12px !important;
      height: 12px !important;
    }

    /* Active Toolbar & Tool Buttons */
    [data-theme="light"] .nav-btn.active,
    [data-theme="light"] .btn-secondary.active,
    [data-theme="light"] .float-tool-btn.active {
      background: #1E5E45 !important;
      color: #FFFFFF !important;
      border-color: #1E5E45 !important;
    }

    [data-theme="light"] .nav-btn.active svg,
    [data-theme="light"] .btn-secondary.active svg,
    [data-theme="light"] .float-tool-btn.active svg {
      stroke: #FFFFFF !important;
    }

    /* Primary Buttons: Download & Export */
    [data-theme="light"] .nav-btn-primary,
    [data-theme="light"] .btn-download-primary,
    [data-theme="light"] #topExportBtn {
      background: #1E5E45 !important;
      border-color: #164E37 !important;
      color: #FFFFFF !important;
      box-shadow: 0 2px 8px rgba(30, 94, 69, 0.25) !important;
    }

    [data-theme="light"] .nav-btn-primary:hover,
    [data-theme="light"] .btn-download-primary:hover,
    [data-theme="light"] #topExportBtn:hover {
      background: #164E37 !important;
      color: #FFFFFF !important;
    }

    /* Export Format Tabs */
    [data-theme="light"] .export-tabs {
      background: #EFE8DE;
      border-color: #E2DACF;
    }

    [data-theme="light"] .export-tab.active {
      background: #1E5E45 !important;
      color: #FFFFFF !important;
      box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
    }

    [data-theme="light"] .custom-size-panel {
      background: #F4EFE6 !important;
      border-color: #E2DACF !important;
      box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6), 0 2px 8px rgba(0, 0, 0, 0.05);
    }
    [data-theme="light"] .custom-size-badge {
      background: rgba(30, 94, 69, 0.1) !important;
      border-color: rgba(30, 94, 69, 0.3) !important;
      color: #1E5E45 !important;
    }
    [data-theme="light"] .ratio-segmented-track {
      background: #E8E1D5 !important;
      border-color: #DDD4C7 !important;
    }
    [data-theme="light"] .ratio-pill {
      color: #78716C !important;
    }
    [data-theme="light"] .ratio-pill:hover {
      background: rgba(0, 0, 0, 0.05) !important;
      color: #1C1917 !important;
    }
    [data-theme="light"] .ratio-pill.active {
      background: #1E5E45 !important;
      color: #FFFFFF !important;
      box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
    }
    [data-theme="light"] .dim-input-group {
      background: #FFFFFF !important;
      border-color: #CBD5E1 !important;
    }
    [data-theme="light"] .dim-input-group:focus-within {
      border-color: #1E5E45 !important;
      box-shadow: 0 0 0 2px rgba(30, 94, 69, 0.15) !important;
    }
    [data-theme="light"] .dim-field {
      color: #0F172A !important;
    }
    [data-theme="light"] .btn-dim-lock {
      background: #FFFFFF !important;
      border-color: #CBD5E1 !important;
      color: #64748B !important;
    }
    [data-theme="light"] .btn-dim-lock.active {
      background: #E6F4EA !important;
      border-color: #1E5E45 !important;
      color: #1E5E45 !important;
    }
    [data-theme="light"] .ratio-hint-text {
      color: #78716C !important;
    }

    /* Reset All Button - Soft Rose Pill */
    [data-theme="light"] .btn-reset-destructive {
      background: #FEE2E2 !important;
      border: 1px solid #FECACA !important;
      color: #DC2626 !important;
      font-weight: 600;
    }

    [data-theme="light"] .btn-reset-destructive:hover {
      background: #DC2626 !important;
      color: #FFFFFF !important;
      border-color: #DC2626 !important;
    }

    /* Preset Cards */
    [data-theme="light"] .preset-card {
      background: #FAF7F2;
      border-color: #E2DACF;
    }

    [data-theme="light"] .preset-card:hover {
      border-color: #1E5E45;
    }

    [data-theme="light"] .preset-card.active {
      border-color: #1E5E45 !important;
      box-shadow: 0 0 0 1px #1E5E45, 0 2px 8px rgba(30, 94, 69, 0.22) !important;
    }

    /* Projections Dropdown */
    [data-theme="light"] .proj-group-header {
      color: #1E5E45 !important;
    }

    [data-theme="light"] .proj-option-item.selected {
      background: rgba(30, 94, 69, 0.12) !important;
      color: #1E5E45 !important;
    }

    [data-theme="light"] .proj-option-item .check-icon {
      color: #1E5E45 !important;
    }

    /* Tree Navigation Active State */
    [data-theme="light"] .tree-item.active {
      background: rgba(30, 94, 69, 0.12) !important;
      color: #1E5E45 !important;
    }

    [data-theme="light"] .tree-item i.check-icon {
      color: #1E5E45 !important;
    }

    /* Rounded Panels & Shadows */
    [data-theme="light"] .card-panel {
      border-radius: 12px;
      box-shadow: 0 1px 4px rgba(0, 0, 0, 0.03);
    }

    [data-theme="light"] .map-canvas-container {
      border-radius: 14px;
      box-shadow: 0 1px 5px rgba(0, 0, 0, 0.04);
    }

    /* Form Controls & Toggle */
    [data-theme="light"] .ctrl-slider {
      accent-color: #1E5E45 !important;
    }

    [data-theme="light"] .switch-toggle input:checked + .switch-slider {
      background-color: #1E5E45 !important;
      border-color: #1E5E45 !important;
    }

    /* Floating Map Stats Card */
    [data-theme="light"] .map-stats-card {
      background: rgba(255, 255, 255, 0.95);
      border: 1px solid #E2DACF;
      border-radius: 10px;
      box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
    }

    [data-theme="light"] .map-stats-card .stats-title svg,
    [data-theme="light"] .map-stats-card .stats-title i {
      color: #1E5E45;
    }

    /* =========================================================================
       PAYMENT STATUS CELEBRATION MODAL (Rich Glassmorphism & Micro-Interactions)
       ========================================================================= */
    .status-celebration-box {
      max-width: 440px;
      width: 92vw;
      background: linear-gradient(180deg, rgba(15, 23, 42, 0.96) 0%, rgba(10, 15, 30, 0.98) 100%);
      border: 1px solid rgba(56, 189, 248, 0.25);
      box-shadow: 0 20px 50px -10px rgba(0, 0, 0, 0.8), 0 0 40px rgba(56, 189, 248, 0.12);
      border-radius: 20px;
      padding: 32px 28px 26px;
      text-align: center;
      position: relative;
      overflow: hidden;
      animation: modalScalePopIn 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    }

    @keyframes modalScalePopIn {
      from {
        opacity: 0;
        transform: scale(0.92) translateY(12px);
      }
      to {
        opacity: 1;
        transform: scale(1) translateY(0);
      }
    }

    .status-modal-icon-wrapper {
      position: relative;
      width: 72px;
      height: 72px;
      margin: 0 auto 18px;
      display: flex;
      align-items: center;
      justify-content: center;
    }

    .status-modal-icon-glow {
      position: absolute;
      inset: -6px;
      border-radius: 50%;
      background: radial-gradient(circle, rgba(16, 185, 129, 0.4) 0%, rgba(56, 189, 248, 0.15) 70%, transparent 100%);
      animation: pulseGlow 2.5s infinite ease-in-out;
    }

    @keyframes pulseGlow {
      0%, 100% { transform: scale(1); opacity: 0.8; }
      50% { transform: scale(1.15); opacity: 1; }
    }

    .status-modal-icon-circle {
      position: relative;
      width: 64px;
      height: 64px;
      border-radius: 50%;
      background: linear-gradient(135deg, rgba(16, 185, 129, 0.2) 0%, rgba(5, 150, 105, 0.35) 100%);
      border: 1.5px solid rgba(52, 211, 153, 0.5);
      color: #34d399;
      display: flex;
      align-items: center;
      justify-content: center;
      box-shadow: 0 8px 20px -4px rgba(16, 185, 129, 0.4);
    }

    .status-celebration-box.type-pending .status-modal-icon-circle {
      background: linear-gradient(135deg, rgba(245, 158, 11, 0.2) 0%, rgba(217, 119, 6, 0.35) 100%);
      border-color: rgba(251, 191, 36, 0.6);
      color: #fbbf24;
      box-shadow: 0 8px 20px -4px rgba(245, 158, 11, 0.4);
    }

    .status-celebration-box.type-pending .status-modal-icon-glow {
      background: radial-gradient(circle, rgba(245, 158, 11, 0.4) 0%, rgba(251, 191, 36, 0.15) 70%, transparent 100%);
    }

    .status-celebration-box.type-rejected .status-modal-icon-circle {
      background: linear-gradient(135deg, rgba(239, 68, 68, 0.2) 0%, rgba(185, 28, 28, 0.35) 100%);
      border-color: rgba(248, 113, 113, 0.6);
      color: #f87171;
      box-shadow: 0 8px 20px -4px rgba(239, 68, 68, 0.4);
    }

    .status-celebration-box.type-rejected .status-modal-icon-glow {
      background: radial-gradient(circle, rgba(239, 68, 68, 0.4) 0%, rgba(248, 113, 113, 0.15) 70%, transparent 100%);
    }

    .status-modal-svg {
      width: 32px;
      height: 32px;
    }

    .status-modal-pill {
      display: inline-block;
      padding: 4px 12px;
      font-size: 11px;
      font-weight: 700;
      text-transform: uppercase;
      letter-spacing: 0.08em;
      border-radius: 9999px;
      background: rgba(16, 185, 129, 0.15);
      color: #34d399;
      border: 1px solid rgba(52, 211, 153, 0.3);
      margin-bottom: 8px;
    }

    .status-celebration-box.type-pending .status-modal-pill {
      background: rgba(245, 158, 11, 0.15);
      color: #fbbf24;
      border-color: rgba(251, 191, 36, 0.3);
    }

    .status-celebration-box.type-rejected .status-modal-pill {
      background: rgba(239, 68, 68, 0.15);
      color: #f87171;
      border-color: rgba(248, 113, 113, 0.3);
    }

    .status-modal-title {
      font-size: 20px;
      font-weight: 700;
      color: #f8fafc;
      margin: 0 0 10px;
      letter-spacing: -0.02em;
    }

    .status-modal-message {
      font-size: 13.5px;
      line-height: 1.55;
      color: #94a3b8;
      margin: 0 0 20px;
    }

    .status-modal-metric-card {
      display: flex;
      align-items: center;
      justify-content: space-around;
      background: rgba(15, 23, 42, 0.6);
      border: 1px solid rgba(51, 65, 85, 0.5);
      border-radius: 12px;
      padding: 12px 14px;
      margin-bottom: 22px;
    }

    .status-metric-item {
      display: flex;
      flex-direction: column;
      gap: 2px;
    }

    .status-metric-label {
      font-size: 11px;
      color: #64748b;
      font-weight: 500;
      text-transform: uppercase;
      letter-spacing: 0.04em;
    }

    .status-metric-value {
      font-size: 13px;
      font-weight: 700;
      color: #e2e8f0;
    }

    .status-metric-value.text-accent {
      color: #38bdf8;
    }

    .status-metric-divider {
      width: 1px;
      height: 28px;
      background: rgba(51, 65, 85, 0.6);
    }

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

    .btn-status-primary {
      width: 100%;
      padding: 12px 18px;
      background: linear-gradient(135deg, #0284c7 0%, #38bdf8 100%);
      border: none;
      border-radius: 10px;
      color: #ffffff;
      font-size: 14px;
      font-weight: 600;
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 8px;
      cursor: pointer;
      transition: all 0.2s ease;
      box-shadow: 0 4px 15px rgba(2, 132, 199, 0.35);
    }

    .btn-status-primary:hover {
      transform: translateY(-1px);
      box-shadow: 0 6px 20px rgba(56, 189, 248, 0.45);
    }

    .btn-status-primary:active {
      transform: translateY(0);
    }