:root {
      --primary: #ea580c;
      --primary-hover: #c2410c;
      --primary-light: #fff7ed;
      --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;
    }
    .brand-badge:hover {
      background: #ffedd5;
      border-color: #fdba74;
    }
    .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);
    }
    .nav-btn.primary:hover { background: #c2410c; color: white; }

    .hero-sec {
      max-width: 1120px;
      margin: 2.5rem auto 1.5rem auto;
      padding: 0 1.25rem;
      text-align: center;
    }
    .hero-badge {
      display: inline-flex;
      align-items: center;
      gap: 6px;
      font-size: 0.78rem;
      font-weight: 600;
      color: #475569;
      background: #f8fafc;
      padding: 3px 10px;
      border-radius: 20px;
      margin-bottom: 0.85rem;
      border: 1px solid rgba(0, 0, 0, 0.08);
    }
    .hero-title {
      font-size: 2.4rem;
      font-weight: 800;
      letter-spacing: -0.025em;
      color: #0f172a;
      line-height: 1.25;
      margin-bottom: 0.75rem;
    }
    .hero-sub,
    .hero-subtitle {
      font-size: 1.05rem;
      color: var(--text-muted);
      max-width: 700px;
      margin: 0 auto;
    }

    /* App Box */
    .app-box,
    .container {
      max-width: 1120px;
      margin: 1.5rem auto 3rem auto;
      background: transparent;
      border: none;
      box-shadow: none;
      padding: 0 1.25rem;
    }

    .main-card {
      background: transparent;
      border: none;
      box-shadow: none;
      padding: 0;
    }

    /* Multi-Tool Suite Tabs */
    .suite-tabs-wrap {
      margin-bottom: 2rem;
      display: flex;
      justify-content: center;
      border-bottom: 1px solid rgba(0, 0, 0, 0.08);
      padding-bottom: 0.25rem;
    }
    .suite-tabs-nav {
      display: inline-flex;
      align-items: center;
      background: transparent;
      padding: 0;
      margin-bottom: -1px;
      gap: 2.2rem;
      border: none;
      box-shadow: none;
      max-width: 100%;
      overflow-x: auto;
      -webkit-overflow-scrolling: touch;
    }
    .suite-tab-item {
      display: inline-flex;
      align-items: center;
      gap: 6px;
      padding: 0.55rem 0.6rem;
      font-size: 0.92rem;
      font-weight: 500;
      color: #64748b;
      text-decoration: none;
      transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
      white-space: nowrap;
      border: none;
      border-bottom: 2px solid transparent;
      background: transparent;
      user-select: none;
    }
    .suite-tab-item svg {
      opacity: 0.65;
      transition: opacity 0.15s ease;
      color: currentColor;
    }
    .suite-tab-item:hover {
      color: #0f172a;
      background: transparent;
      border-color: rgba(0, 0, 0, 0.18);
    }
    .suite-tab-item:hover svg {
      opacity: 0.9;
    }
    .suite-tab-item.active {
      background: transparent;
      color: #0f172a;
      font-weight: 600;
      border: none;
      border-bottom: 2px solid #0f172a;
      box-shadow: none;
      border-radius: 0;
    }
    .suite-tab-item.active svg {
      color: #0f172a;
      opacity: 1;
    }

    @media (max-width: 768px) {
      .suite-tabs-wrap {
        width: 100%;
        margin-bottom: 1.25rem;
        border-bottom: none;
        padding: 0;
        justify-content: stretch;
      }
      .suite-tabs-nav {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 8px 10px;
        width: 100%;
        max-width: 100%;
        padding: 0;
        margin: 0;
        background: transparent;
        border: none;
        box-shadow: none;
      }
      .suite-tab-item {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 6px;
        padding: 0.6rem 0.5rem;
        font-size: 0.85rem;
        font-weight: 500;
        color: #475569;
        background: #ffffff;
        border: 1px solid rgba(0, 0, 0, 0.08);
        border-radius: 8px;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
        text-align: center;
        white-space: nowrap;
        text-decoration: none;
        box-sizing: border-box;
        transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
        user-select: none;
      }
      .suite-tab-item span {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
      }
      .suite-tab-item svg {
        flex-shrink: 0;
        opacity: 0.7;
        color: currentColor;
      }
      .suite-tab-item:hover,
      .suite-tab-item:focus {
        color: #0f172a;
        border-color: rgba(0, 0, 0, 0.2);
        text-decoration: none;
      }
      .suite-tab-item.active {
        color: #0f172a;
        font-weight: 700;
        background: #f8fafc;
        border: 1.5px solid #0f172a;
        box-shadow: 0 2px 6px rgba(15, 23, 42, 0.06);
      }
      .suite-tab-item.active svg {
        color: #0f172a;
        opacity: 1;
      }
    }

    /* Minimalist Dropzone */
    .dropzone {
      border: 1.5px dashed #cbd5e1;
      border-radius: 18px;
      padding: 3rem 1.5rem;
      text-align: center;
      cursor: pointer;
      background: #ffffff;
      box-shadow: 0 4px 20px rgba(15, 23, 42, 0.03);
      transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    }
    .dropzone:hover, .dropzone.dragover {
      border-color: #0f172a;
      background: #fafafa;
    }
    .dropzone-icon-badge {
      width: 52px;
      height: 52px;
      margin: 0 auto 1.1rem;
      background: #f8fafc;
      border: 1px solid rgba(0, 0, 0, 0.06);
      border-radius: 14px;
      display: flex;
      align-items: center;
      justify-content: center;
      color: #475569;
      transition: transform 0.2s ease, border-color 0.2s ease;
    }
    .dropzone:hover .dropzone-icon-badge {
      transform: translateY(-2px);
      color: #0f172a;
      border-color: rgba(0, 0, 0, 0.12);
    }
    .dropzone-title {
      font-size: 1.15rem;
      font-weight: 700;
      color: #0f172a;
      margin-bottom: 1.2rem;
      letter-spacing: -0.01em;
    }
    .dropzone-cta-btn {
      display: inline-flex;
      align-items: center;
      gap: 8px;
      background: #ffffff;
      color: #0f172a;
      border: 1px solid rgba(0, 0, 0, 0.12);
      padding: 0.7rem 1.6rem;
      border-radius: 10px;
      font-size: 0.92rem;
      font-weight: 600;
      box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
      cursor: pointer;
      transition: all 0.15s ease;
      margin-bottom: 1rem;
    }
    .dropzone-cta-btn:hover {
      border-color: #0f172a;
      background: #f8fafc;
      transform: translateY(-1px);
      box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    }
    .dropzone-hints {
      display: flex;
      justify-content: center;
      gap: 0.6rem;
      flex-wrap: wrap;
    }
    .dropzone-badge {
      display: inline-flex;
      align-items: center;
      gap: 5px;
      font-size: 0.76rem;
      color: #64748b;
      background: transparent;
      padding: 0;
      border: none;
      font-weight: 500;
    }
    @media (max-width: 768px) {
      .dropzone {
        padding: 2.4rem 1.2rem;
        border-radius: 16px;
      }
      .dropzone-icon-badge {
        width: 46px;
        height: 46px;
        margin-bottom: 0.8rem;
      }
      .dropzone-title {
        font-size: 1.05rem;
        margin-bottom: 0.85rem;
      }
      .dropzone-cta-btn {
        padding: 0.6rem 1.35rem;
        font-size: 0.88rem;
      }
    }

    /* Layout Editor Area */
    .editor-layout {
      display: none;
      grid-template-columns: 310px minmax(0, 1fr);
      gap: 1.5rem;
      margin-top: 1.5rem;
      width: 100%;
      box-sizing: border-box;
    }
    @media (max-width: 860px) {
      .editor-layout { grid-template-columns: 1fr; }
    }

    .control-panel {
      background: #ffffff;
      border: 1px solid rgba(0, 0, 0, 0.08);
      border-radius: 14px;
      box-shadow: 0 4px 16px rgba(15, 23, 42, 0.03);
      padding: 1.25rem;
      display: flex;
      flex-direction: column;
      gap: 1.25rem;
      min-width: 0;
      box-sizing: border-box;
    }

    .panel-block-title {
      font-size: 0.85rem;
      font-weight: 800;
      color: #334155;
      text-transform: uppercase;
      letter-spacing: 0.05em;
      margin-bottom: 0.5rem;
      display: flex;
      align-items: center;
      gap: 6px;
    }

    /* Direction Mode Switcher */
    .dir-grid {
      display: grid;
      grid-template-columns: 1fr 1fr 1fr;
      gap: 0.5rem;
    }
    .dir-btn {
      padding: 0.65rem 0.4rem;
      border: 1px solid rgba(0, 0, 0, 0.08);
      background: white;
      border-radius: 8px;
      font-size: 0.82rem;
      font-weight: 700;
      color: var(--text-muted);
      cursor: pointer;
      display: flex;
      flex-direction: column;
      align-items: center;
      gap: 4px;
      transition: all 0.15s ease;
    }
    .dir-btn:hover { border-color: rgba(0,0,0,0.2); color: #0f172a; }
    .dir-btn.active {
      border-color: #0f172a;
      background: #f8fafc;
      color: #0f172a;
    }

    /* Sliders */
    .slider-row {
      display: flex;
      flex-direction: column;
      gap: 0.35rem;
    }
    .slider-header {
      display: flex;
      justify-content: space-between;
      font-size: 0.82rem;
      font-weight: 600;
      color: #475569;
    }
    .slider-header span.val {
      font-weight: 800;
      color: #0f172a;
    }
    input[type="range"] {
      width: 100%;
      accent-color: #0f172a;
      cursor: pointer;
    }

    /* Color picker & presets */
    .color-options {
      display: flex;
      align-items: center;
      gap: 0.5rem;
      flex-wrap: wrap;
    }
    .color-dot {
      width: 26px;
      height: 26px;
      border-radius: 6px;
      border: 2px solid #cbd5e1;
      cursor: pointer;
      position: relative;
      transition: transform 0.15s;
    }
    .color-dot:hover { transform: scale(1.1); }
    .color-dot.active { border-color: #0f172a; outline: 2px solid #94a3b8; }
    .color-picker-input {
      width: 26px;
      height: 26px;
      border: none;
      padding: 0;
      border-radius: 6px;
      cursor: pointer;
    }

    /* Image list thumbnails */
    .thumb-list-wrap {
      display: flex;
      flex-direction: column;
      gap: 0.5rem;
      max-height: 230px;
      overflow-y: auto;
      padding-right: 4px;
    }
    .thumb-item {
      display: flex;
      align-items: center;
      justify-content: space-between;
      background: white;
      border: 1px solid var(--border);
      border-radius: 8px;
      padding: 6px 10px;
      gap: 8px;
    }
    .thumb-preview {
      width: 40px;
      height: 40px;
      border-radius: 4px;
      object-fit: cover;
      background: #e2e8f0;
    }
    .thumb-info {
      flex: 1;
      min-width: 0;
    }
    .thumb-name {
      font-size: 0.78rem;
      font-weight: 600;
      color: #1e293b;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }
    .thumb-size {
      font-size: 0.7rem;
      color: var(--text-muted);
    }
    .thumb-btns {
      display: flex;
      align-items: center;
      gap: 3px;
    }
    .thumb-btn-sm {
      background: #f1f5f9;
      border: 1px solid var(--border);
      border-radius: 4px;
      font-size: 0.75rem;
      padding: 2px 6px;
      cursor: pointer;
      color: #475569;
    }
    .thumb-btn-sm:hover { background: #e2e8f0; color: #0f172a; }
    .thumb-btn-sm.del:hover { background: #fee2e2; color: #dc2626; border-color: #fca5a5; }

    /* Right Preview Canvas Area */
    .preview-stage {
      display: flex;
      flex-direction: column;
      background: #ffffff;
      border: 1px solid rgba(0, 0, 0, 0.08);
      border-radius: 14px;
      box-shadow: 0 4px 16px rgba(15, 23, 42, 0.03);
      overflow: hidden;
      min-width: 0;
      box-sizing: border-box;
    }
    .stage-toolbar {
      background: white;
      border-bottom: 1px solid rgba(0, 0, 0, 0.06);
      padding: 0.75rem 1rem;
      display: flex;
      align-items: center;
      justify-content: space-between;
      font-size: 0.85rem;
      flex-wrap: wrap;
      gap: 0.5rem;
    }
    .canvas-scroll-wrap {
      flex: 1;
      overflow: auto;
      max-height: 600px;
      padding: 1.5rem;
      display: flex;
      justify-content: center;
      align-items: flex-start;
      background: repeating-conic-gradient(#f8fafc 0% 25%, #f1f5f9 0% 50%) 50% / 16px 16px;
    }
    #stitchCanvas {
      max-width: 100%;
      height: auto;
      box-shadow: 0 4px 16px rgba(15, 23, 42, 0.08);
      border-radius: 6px;
      display: block;
    }

    /* Actions bottom (Outside workspace card) */
    .action-bar {
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 1rem;
      margin-top: 1.5rem;
      flex-wrap: wrap;
    }
    .btn-main {
      padding: 0.75rem 1.6rem;
      font-size: 0.95rem;
      font-weight: 700;
      border-radius: 8px;
      border: none;
      cursor: pointer;
      display: inline-flex;
      align-items: center;
      gap: 6px;
      transition: all 0.15s ease;
    }
    .btn-download {
      background: #0f172a;
      color: white;
      border: none;
      box-shadow: 0 2px 8px rgba(15, 23, 42, 0.12);
    }
    .btn-download:hover { background: #1e293b; }
    .btn-secondary {
      background: white;
      border: 1px solid rgba(0, 0, 0, 0.12);
      color: #0f172a;
      box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    }
    .btn-secondary:hover { background: #f8fafc; border-color: #0f172a; }



    .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;
    }