:root {
      --primary: #ea580c;
      --primary-hover: #c2410c;
      --surface: #ffffff;
      --bg: #f8fafc;
      --text: #0f172a;
      --text-muted: #64748b;
      --border: #e2e8f0;
      --radius-lg: 16px;
      --radius-md: 10px;
      --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.08);
    }
    * { box-sizing: border-box; margin: 0; padding: 0; }
    body {
      font-family: sans-serif;
      background: var(--bg);
      color: var(--text);
      line-height: 1.5;
    }
    header {
      background: var(--surface);
      border-bottom: 1px solid var(--border);
      position: sticky;
      top: 0;
      z-index: 100;
      padding: 0.75rem 1.75rem;
      display: flex;
      justify-content: space-between;
      align-items: center;
    }
    .brand {
      display: flex;
      align-items: center;
      gap: 0.75rem;
      text-decoration: none;
      color: inherit;
    }
    .brand-icon {
      width: 36px;
      height: 36px;
      background: #ea580c;
      color: white;
      border-radius: 8px;
      display: flex;
      align-items: center;
      justify-content: center;
      font-weight: 800;
      font-size: 1.1rem;
      box-shadow: 0 2px 8px rgba(234, 88, 12, 0.25);
    }
    .brand-title { font-weight: 800; font-size: 1.15rem; color: #0f172a; }
    .brand-badge {
      font-size: 0.75rem;
      background: #fff7ed;
      color: #ea580c;
      font-weight: 700;
      padding: 2px 8px;
      border-radius: 6px;
      border: 1px solid #fed7aa;
      text-decoration: none;
      display: inline-flex;
      align-items: center;
      gap: 4px;
      transition: all 0.15s;
    }
    .nav-links { display: flex; align-items: center; gap: 0.85rem; }
    .nav-btn {
      text-decoration: none;
      color: var(--text-muted);
      font-size: 0.88rem;
      font-weight: 600;
      padding: 0.45rem 0.85rem;
      border-radius: 6px;
      transition: all 0.15s ease;
      display: inline-flex;
      align-items: center;
      gap: 4px;
    }
    .nav-btn:hover { color: #ea580c; background: #fff7ed; }
    .nav-btn.active { color: #ea580c; font-weight: 700; }
    .nav-btn.primary {
      background: #ea580c;
      color: white;
      font-weight: 700;
      box-shadow: 0 2px 8px rgba(234, 88, 12, 0.3);
    }

    .hero-sec {
      max-width: 1080px;
      margin: 2rem auto 1.25rem auto;
      padding: 0 1.25rem;
      text-align: center;
    }
    .hero-badge {
      display: inline-flex;
      align-items: center;
      gap: 6px;
      font-size: 0.82rem;
      font-weight: 700;
      color: #c2410c;
      background: #fff7ed;
      padding: 4px 12px;
      border-radius: 20px;
      margin-bottom: 0.85rem;
      border: 1px solid #fed7aa;
    }
    .hero-title {
      font-size: 2.2rem;
      font-weight: 800;
      letter-spacing: -0.025em;
      margin-bottom: 0.5rem;
    }
    .hero-sub {
      font-size: 1rem;
      color: var(--text-muted);
      max-width: 650px;
      margin: 0 auto;
    }

    .container {
      max-width: 1080px;
      margin: 0 auto 3rem auto;
      padding: 0 1.25rem;
    }
    .main-card {
      background: var(--surface);
      border-radius: var(--radius-lg);
      border: 1px solid var(--border);
      box-shadow: var(--shadow-lg);
      padding: 2rem;
    }

    .dropzone {
      border: 2px dashed #fed7aa;
      background: #fffaf5;
      border-radius: var(--radius-md);
      padding: 3rem 1.5rem;
      text-align: center;
      cursor: pointer;
      transition: all 0.2s;
    }
    .dropzone:hover { border-color: #ea580c; background: #fff7ed; }

    /* Top Upload CTA Banner */
    .top-upload-banner {
      background: linear-gradient(135deg, #fff7ed 0%, #ffedd5 50%, #eff6ff 100%);
      border: 2px dashed #ea580c;
      border-radius: var(--radius-md);
      padding: 1.15rem 1.6rem;
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 1.25rem;
      cursor: pointer;
      margin-bottom: 1.25rem;
      transition: all 0.2s ease;
      box-shadow: 0 4px 15px -3px rgba(234, 88, 12, 0.12);
    }
    .top-upload-banner:hover {
      border-color: #c2410c;
      background: linear-gradient(135deg, #ffedd5 0%, #fed7aa 50%, #e0f2fe 100%);
      transform: translateY(-1px);
      box-shadow: 0 6px 18px -4px rgba(234, 88, 12, 0.2);
    }
    .top-upload-banner.dragover {
      border-color: #2563eb;
      background: #eff6ff;
    }
    .top-upload-left {
      display: flex;
      align-items: center;
      gap: 1rem;
    }
    .top-upload-icon-wrap {
      width: 48px;
      height: 48px;
      border-radius: 12px;
      background: #ea580c;
      color: white;
      display: flex;
      align-items: center;
      justify-content: center;
      flex-shrink: 0;
      box-shadow: 0 4px 10px rgba(234, 88, 12, 0.3);
    }
    .top-upload-icon {
      width: 24px;
      height: 24px;
    }
    .top-upload-title {
      font-size: 1.1rem;
      font-weight: 800;
      color: #9a3412;
      margin-bottom: 0.15rem;
    }
    .top-upload-subtitle {
      font-size: 0.85rem;
      color: #c2410c;
      font-weight: 500;
    }
    .btn-primary-upload {
      background: linear-gradient(135deg, #ea580c 0%, #c2410c 100%);
      color: #ffffff;
      border: none;
      padding: 0.7rem 1.5rem;
      border-radius: 10px;
      font-size: 0.95rem;
      font-weight: 800;
      cursor: pointer;
      display: flex;
      align-items: center;
      gap: 0.5rem;
      box-shadow: 0 4px 14px rgba(234, 88, 12, 0.35);
      transition: all 0.2s ease;
      flex-shrink: 0;
    }
    .btn-primary-upload:hover {
      background: linear-gradient(135deg, #c2410c 0%, #9a3412 100%);
      transform: scale(1.02);
    }
    @media (max-width: 640px) {
      .top-upload-banner {
        flex-direction: column;
        text-align: center;
        padding: 1.15rem 1rem;
      }
      .top-upload-left {
        flex-direction: column;
        gap: 0.6rem;
      }
    }

    /* Grid settings */
    .mode-pills {
      display: flex;
      justify-content: center;
      gap: 0.75rem;
      flex-wrap: wrap;
      margin: 1.25rem 0;
    }
    .mode-btn {
      padding: 0.65rem 1.25rem;
      border-radius: 8px;
      border: 1.5px solid var(--border);
      background: white;
      font-size: 0.88rem;
      font-weight: 700;
      color: #334155;
      cursor: pointer;
      display: flex;
      align-items: center;
      gap: 6px;
      transition: all 0.15s;
    }
    .mode-btn:hover { border-color: #ea580c; }
    .mode-btn.active {
      border-color: #ea580c;
      background: #fff7ed;
      color: #c2410c;
      box-shadow: 0 2px 6px rgba(234, 88, 12, 0.2);
    }

    /* Grid preview stage */
    .grid-stage {
      max-width: 540px;
      margin: 1.5rem auto;
      display: grid;
      gap: 8px;
      background: #f1f5f9;
      padding: 10px;
      border-radius: 16px;
      box-shadow: 0 4px 20px rgba(0,0,0,0.08);
      border: 1px solid #e2e8f0;
      transition: max-width 0.25s ease;
    }
    .grid-cell {
      position: relative;
      aspect-ratio: 1 / 1;
      overflow: hidden;
      border-radius: 8px;
      background: #e2e8f0;
      cursor: pointer;
      box-shadow: 0 2px 8px rgba(0,0,0,0.08);
      transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s ease;
    }
    .grid-cell:hover {
      transform: translateY(-2px) scale(1.02);
      box-shadow: 0 8px 22px rgba(234, 88, 12, 0.22);
    }
    .grid-cell canvas {
      width: 100%;
      height: 100%;
      object-fit: cover;
      display: block;
    }
    .cell-badge {
      position: absolute;
      top: 8px;
      left: 8px;
      background: rgba(15, 23, 42, 0.82);
      backdrop-filter: blur(4px);
      color: white;
      font-size: 0.75rem;
      font-weight: 800;
      width: 24px;
      height: 24px;
      border-radius: 50%;
      display: flex;
      align-items: center;
      justify-content: center;
      box-shadow: 0 2px 6px rgba(0,0,0,0.3);
      z-index: 3;
      transition: all 0.2s ease;
    }
    .cell-hover-overlay {
      position: absolute;
      inset: 0;
      background: rgba(15, 23, 42, 0.45);
      backdrop-filter: blur(2px);
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      gap: 5px;
      color: #ffffff;
      opacity: 0;
      pointer-events: none;
      transition: opacity 0.2s ease;
      z-index: 2;
    }
    .grid-cell:hover .cell-hover-overlay {
      opacity: 1;
    }
    .cell-hover-icon {
      width: 28px;
      height: 28px;
      background: #ea580c;
      border-radius: 50%;
      display: flex;
      align-items: center;
      justify-content: center;
      box-shadow: 0 2px 8px rgba(234, 88, 12, 0.45);
    }
    .cell-hover-text {
      font-size: 0.72rem;
      font-weight: 700;
      letter-spacing: 0.02em;
      text-shadow: 0 1px 3px rgba(0,0,0,0.7);
    }

    .btn-action {
      padding: 0.75rem 1.6rem;
      font-size: 0.95rem;
      font-weight: 700;
      border-radius: 8px;
      cursor: pointer;
      border: none;
      display: inline-flex;
      align-items: center;
      gap: 6px;
      transition: all 0.15s;
    }
    .btn-primary { background: #ea580c; color: white; }
    .btn-primary:hover { background: #c2410c; }
    .btn-outline { background: white; border: 1px solid var(--border); color: #334155; }
    .btn-outline:hover { background: #f1f5f9; }

    .back-banner {
      background: linear-gradient(135deg, #fff7ed, #eff6ff);
      border: 1px solid #fed7aa;
      border-radius: var(--radius-md);
      padding: 1.5rem;
      text-align: center;
      margin: 2.5rem 0;
    }
  
    /* Header Actions & Country Selector */
    .header-actions {
      display: flex;
      align-items: center;
      gap: 0.75rem;
    }
    .select-pill {
      padding: 0.42rem 0.75rem;
      border: 1px solid var(--border, #cbd5e1);
      border-radius: 9999px;
      background: var(--surface, #ffffff);
      font-size: 0.82rem;
      font-weight: 700;
      color: var(--text, #0f172a);
      outline: none;
      cursor: pointer;
      box-shadow: 0 1px 2px rgba(0,0,0,0.03);
    }
    .country-selector {
      min-width: 82px;
    }