    :root {
      --paper: #F8FAFC;
      --card: #FFFFFF;
      --ink: #0F172A;
      --ink-light: #334155;
      --muted: #64748B;
      --border: #E2E8F0;
      --border-hover: #CBD5E1;
      --cut: #EF4444;
      --cut-glow: rgba(239, 68, 68, 0.25);
      --toner: #2563EB;
      --toner-dark: #1D4ED8;
      --toner-tint: #EFF6FF;
      --toner-glow: rgba(37, 99, 235, 0.2);
      --success: #10B981;
      --success-tint: #ECFDF5;
      --radius: 8px;
      --radius-lg: 12px;
      --mono: 'IBM Plex Mono', ui-monospace, monospace;
      --sans: 'Inter', system-ui, -apple-system, sans-serif;
      --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
      --shadow-md: 0 4px 12px rgba(15, 23, 42, 0.08);
      --shadow-lg: 0 10px 25px -5px rgba(15, 23, 42, 0.1), 0 8px 10px -6px rgba(15, 23, 42, 0.05);
    }

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

    html {
      -webkit-text-size-adjust: 100%;
      scroll-behavior: smooth;
    }

    body {
      background: var(--paper);
      color: var(--ink);
      font-family: var(--sans);
      line-height: 1.5;
      -webkit-font-smoothing: antialiased;
      min-height: 100vh;
      display: flex;
      flex-direction: column;
    }

    input, textarea, select {
      -webkit-user-select: auto;
      -moz-user-select: auto;
      -ms-user-select: auto;
      user-select: auto;
    }

    a {
      color: var(--toner);
      text-decoration: none;
    }

    a:hover {
      text-decoration: underline;
    }

    /* ---------- Top App Header ---------- */
    .site-header {
      background: #ffffff;
      border-bottom: 1px solid var(--border);
      position: sticky;
      top: 0;
      z-index: 100;
      backdrop-filter: blur(8px);
      background: rgba(255, 255, 255, 0.95);
    }

    .header-nav {
      max-width: 1380px;
      margin: 0 auto;
      padding: 0.75rem 1.25rem;
      display: flex;
      justify-content: space-between;
      align-items: center;
    }

    .brand {
      display: flex;
      align-items: center;
      gap: 0.75rem;
      text-decoration: none;
      color: var(--ink);
    }

    .brand-logo-img {
      width: 42px;
      height: 42px;
      object-fit: contain;
      transition: transform 0.25s ease;
      filter: drop-shadow(0 2px 6px rgba(37, 99, 235, 0.22));
    }

    .brand:hover .brand-logo-img {
      transform: scale(1.08) rotate(-3deg);
    }

    .brand-text-col {
      display: flex;
      flex-direction: column;
      line-height: 1.15;
    }

    .brand-title {
      font-family: 'Inter', -apple-system, sans-serif;
      font-weight: 800;
      font-size: 1.35rem;
      letter-spacing: -0.03em;
      color: #0f172a;
      display: flex;
      align-items: center;
    }

    .brand-slice {
      background: linear-gradient(135deg, #0284c7, #2563eb);
      -webkit-background-clip: text;
      -webkit-text-fill-color: transparent;
    }

    .brand-tagline {
      font-size: 0.68rem;
      font-weight: 600;
      color: var(--muted);
      letter-spacing: 0.02em;
    }

    .brand-badge {
      font-size: 0.7rem;
      font-weight: 700;
      background: var(--toner-tint);
      color: var(--toner);
      padding: 0.2rem 0.55rem;
      border-radius: 9999px;
      letter-spacing: 0.04em;
      text-transform: uppercase;
    }

    .header-right {
      display: flex;
      align-items: center;
      gap: 1rem;
      font-size: 0.85rem;
      color: var(--muted);
      font-weight: 500;
    }

    .privacy-pill {
      display: inline-flex;
      align-items: center;
      gap: 0.35rem;
      background: #f1f5f9;
      color: #334155;
      padding: 0.25rem 0.65rem;
      border-radius: 9999px;
      font-size: 0.75rem;
      font-weight: 600;
    }

    /* ---------- Page Layout Shell ---------- */
    .layout {
      max-width: 1200px;
      width: 100%;
      margin: 0 auto;
      padding: 1.5rem 1rem 3rem;
      flex: 1;
    }

    body.studio-active .layout {
      max-width: 1400px;
    }

    .ad-rail {
      display: none !important;
    }

    /* =========================================================
     LANDING HERO SECTION (Default view when no PDF is loaded)
     ========================================================= */
    #landing-section {
      display: flex;
      flex-direction: column;
      gap: 2rem;
      max-width: 1000px;
      margin: 0 auto;
      width: 100%;
      animation: fadeIn 0.3s ease-out;
    }

    @keyframes fadeIn {
      from {
        opacity: 0;
        transform: translateY(8px);
      }

      to {
        opacity: 1;
        transform: translateY(0);
      }
    }

    .landing-hero-card {
      background: #ffffff;
      border: 1px solid var(--border);
      border-radius: var(--radius-lg);
      padding: 2.5rem 2rem;
      box-shadow: var(--shadow-md);
      text-align: center;
      position: relative;
      overflow: hidden;
    }

    .landing-hero-card::before {
      content: "";
      position: absolute;
      top: 0;
      left: 0;
      right: 0;
      height: 4px;
      background: linear-gradient(90deg, #2563eb, #8b5cf6, #ec4899);
    }

    .hero-tag {
      display: inline-flex;
      align-items: center;
      gap: 0.4rem;
      background: var(--toner-tint);
      color: var(--toner);
      font-size: 0.78rem;
      font-weight: 700;
      text-transform: uppercase;
      letter-spacing: 0.05em;
      padding: 0.3rem 0.75rem;
      border-radius: 9999px;
      margin-bottom: 1rem;
    }

    .landing-hero-card h1 {
      font-size: clamp(1.75rem, 3.2vw, 2.35rem);
      font-weight: 800;
      letter-spacing: -0.03em;
      color: var(--ink);
      line-height: 1.25;
      margin-bottom: 0.75rem;
    }

    .landing-hero-card .hero-sub {
      font-size: 1rem;
      color: var(--muted);
      max-width: 620px;
      margin: 0 auto 1.5rem;
      line-height: 1.6;
    }

    .marketplace-pills {
      display: flex;
      justify-content: center;
      gap: 0.5rem;
      flex-wrap: wrap;
      margin-bottom: 1.75rem;
    }

    .m-pill {
      display: inline-flex;
      align-items: center;
      gap: 0.35rem;
      font-size: 0.8rem;
      font-weight: 600;
      padding: 0.3rem 0.75rem;
      border-radius: 9999px;
      border: 1px solid var(--border);
      background: #fafafa;
    }

    .m-pill .dot {
      width: 7px;
      height: 7px;
      border-radius: 50%;
    }

    .m-pill.meesho {
      border-color: #fce7f3;
      color: #be185d;
      background: #fdf2f8;
    }

    .m-pill.meesho .dot {
      background: #db2777;
    }

    .m-pill.flipkart {
      border-color: #e0f2fe;
      color: #0369a1;
      background: #f0f9ff;
    }

    .m-pill.flipkart .dot {
      background: #0284c7;
    }

    .m-pill.amazon {
      border-color: #fef3c7;
      color: #b45309;
      background: #fffbeb;
    }

    .m-pill.amazon .dot {
      background: #d97706;
    }

    .m-pill.courier {
      border-color: #f1f5f9;
      color: #475569;
      background: #f8fafc;
    }

    .m-pill.courier .dot {
      background: #64748b;
    }

    /* Prominent Drag & Drop Box */
    .hero-dropzone {
      border: 2.5px dashed #93c5fd;
      border-radius: var(--radius-lg);
      background: linear-gradient(180deg, #f8fbff 0%, #eff6ff 100%);
      padding: 2.5rem 1.5rem;
      cursor: pointer;
      transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
      position: relative;
      outline: none;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      gap: 0.75rem;
      box-shadow: 0 2px 12px var(--toner-glow);
    }

    .hero-dropzone:hover {
      border-color: var(--toner);
      background: #ebf3ff;
      transform: translateY(-2px);
      box-shadow: 0 8px 24px var(--toner-glow);
    }

    .hero-dropzone.dragover {
      border-color: #1d4ed8;
      background: #dbeafe;
      transform: scale(1.01);
    }

    .hero-dropzone input[type="file"] {
      position: absolute;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
      opacity: 0;
      cursor: pointer;
    }

    .drop-icon-wrap {
      width: 64px;
      height: 64px;
      background: #ffffff;
      border-radius: 50%;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 2rem;
      color: var(--toner);
      box-shadow: 0 4px 12px rgba(37, 99, 235, 0.15);
      transition: transform 0.2s ease;
    }

    .hero-dropzone:hover .drop-icon-wrap {
      transform: scale(1.08);
    }

    .drop-action-btn {
      display: inline-flex;
      align-items: center;
      gap: 0.5rem;
      background: var(--toner);
      color: #ffffff;
      font-size: 0.95rem;
      font-weight: 700;
      padding: 0.75rem 1.5rem;
      border-radius: 9999px;
      box-shadow: 0 2px 8px var(--toner-glow);
      pointer-events: none;
    }

    .drop-hint {
      font-size: 0.85rem;
      color: var(--muted);
    }

    /* Landing Feature Cards */
    .landing-features {
      display: grid;
      grid-template-columns: repeat(3, 1fr);
      gap: 1.25rem;
    }

    @media (max-width:700px) {
      .landing-features {
        grid-template-columns: 1fr;
      }
    }

    .feat-card {
      background: #ffffff;
      border: 1px solid var(--border);
      border-radius: var(--radius);
      padding: 1.25rem;
      box-shadow: var(--shadow-sm);
    }

    .feat-icon {
      font-size: 1.5rem;
      margin-bottom: 0.6rem;
    }

    .feat-title {
      font-size: 0.95rem;
      font-weight: 700;
      color: var(--ink);
      margin-bottom: 0.35rem;
    }

    .feat-desc {
      font-size: 0.82rem;
      color: var(--muted);
      line-height: 1.45;
    }

    /* =========================================================
     STUDIO WORKSPACE (Shown after PDF is uploaded)
     ========================================================= */
    #studio-section {
      display: none;
      flex-direction: column;
      gap: 1.25rem;
      width: 100%;
      animation: fadeIn 0.25s ease-out;
    }

    /* Studio Header / Action Bar */
    .studio-bar {
      background: #ffffff;
      border: 1px solid var(--border);
      border-radius: var(--radius);
      padding: 0.75rem 1.25rem;
      display: flex;
      justify-content: space-between;
      align-items: center;
      flex-wrap: wrap;
      gap: 0.75rem;
      box-shadow: var(--shadow-sm);
    }

    .studio-meta {
      display: flex;
      align-items: center;
      gap: 0.75rem;
    }

    .file-badge {
      font-family: var(--mono);
      font-size: 0.82rem;
      font-weight: 600;
      color: var(--ink);
      background: var(--paper);
      border: 1px solid var(--border);
      padding: 0.35rem 0.75rem;
      border-radius: 6px;
      display: inline-flex;
      align-items: center;
      gap: 0.4rem;
    }

    .studio-bar-actions {
      display: flex;
      align-items: center;
      gap: 0.5rem;
    }

    .action-btn-sm {
      background: #fff;
      border: 1px solid var(--border);
      color: var(--ink);
      font-size: 0.82rem;
      font-weight: 600;
      padding: 0.4rem 0.75rem;
      border-radius: 6px;
      cursor: pointer;
      display: inline-flex;
      align-items: center;
      gap: 0.35rem;
      transition: all 0.15s ease;
    }

    .action-btn-sm:hover {
      border-color: var(--border-hover);
      background: #f8fafc;
    }

    .action-btn-sm.danger {
      color: var(--cut);
    }

    .action-btn-sm.danger:hover {
      background: #fef2f2;
      border-color: #fecaca;
    }

    /* Studio Main 2-Column Grid */
    .studio-grid {
      display: grid;
      grid-template-columns: 1.35fr 1fr;
      gap: 1.5rem;
      align-items: start;
    }

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

    /* ---------- Left Column: ViewPager & Crop Studio ---------- */
    .studio-viewport-panel {
      background: #ffffff;
      border: 1px solid var(--border);
      border-radius: var(--radius-lg);
      box-shadow: var(--shadow-sm);
      padding: 1.25rem;
      display: flex;
      flex-direction: column;
      gap: 1rem;
    }

    /* ViewPager Navigation Bar */
    .viewpager-nav-bar {
      display: flex;
      justify-content: space-between;
      align-items: center;
      padding-bottom: 0.75rem;
      border-bottom: 1px solid var(--border);
      gap: 0.5rem;
      flex-wrap: wrap;
    }

    .pager-controls {
      display: flex;
      align-items: center;
      gap: 0.5rem;
    }

    .pager-btn {
      width: 32px;
      height: 32px;
      border: 1px solid var(--border);
      background: #ffffff;
      border-radius: 6px;
      display: flex;
      align-items: center;
      justify-content: center;
      cursor: pointer;
      font-size: 0.9rem;
      font-weight: 700;
      color: var(--ink);
      transition: all 0.15s;
    }

    .pager-btn:hover:not(:disabled) {
      border-color: var(--toner);
      color: var(--toner);
      background: var(--toner-tint);
    }

    .pager-btn:disabled {
      opacity: 0.35;
      cursor: not-allowed;
    }

    .page-indicator {
      font-family: var(--mono);
      font-size: 0.85rem;
      font-weight: 600;
      color: var(--ink);
      padding: 0 0.35rem;
      min-width: 95px;
      text-align: center;
    }

    .page-tools {
      display: flex;
      align-items: center;
      gap: 0.35rem;
    }

    .tool-btn {
      border: 1px solid var(--border);
      background: #fff;
      color: var(--ink);
      font-size: 0.78rem;
      font-weight: 600;
      padding: 0.35rem 0.65rem;
      border-radius: 6px;
      cursor: pointer;
      display: inline-flex;
      align-items: center;
      gap: 0.3rem;
      transition: all 0.15s;
    }

    .tool-btn:hover {
      border-color: var(--border-hover);
      background: #f1f5f9;
    }

    .tool-btn.active {
      background: var(--toner-tint);
      border-color: var(--toner);
      color: var(--toner-dark);
    }

    /* Active Page Canvas / Image Stage */
    .stage-container {
      position: relative;
      background: #e2e8f0;
      border-radius: var(--radius);
      overflow: hidden;
      display: flex;
      align-items: center;
      justify-content: center;
      min-height: 380px;
      max-height: 540px;
      padding: 1rem;
      user-select: none;
    }

    .stage-inner {
      position: relative;
      display: inline-block;
      max-width: 100%;
      max-height: 100%;
      box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
      border-radius: 4px;
      overflow: hidden;
      background: #ffffff;
    }

    #viewpager-img {
      display: block;
      max-width: 100%;
      max-height: 500px;
      width: auto;
      height: auto;
      object-fit: contain;
      transition: transform 0.15s ease, clip-path 0.2s ease;
    }

    /* Interactive Crop Overlay */
    #crop-overlay {
      position: absolute;
      border: 2.5px dashed var(--cut);
      background: rgba(239, 68, 68, 0.12);
      box-sizing: border-box;
      cursor: move;
      z-index: 10;
    }

    .crop-tag {
      position: absolute;
      top: 4px;
      left: 4px;
      background: var(--cut);
      color: #fff;
      font-size: 0.65rem;
      font-weight: 700;
      padding: 2px 5px;
      border-radius: 3px;
      letter-spacing: 0.02em;
      pointer-events: none;
      text-transform: uppercase;
    }

    .crop-dim-badge {
      position: absolute;
      bottom: 4px;
      right: 4px;
      background: rgba(15, 23, 42, 0.85);
      color: #fff;
      font-family: var(--mono);
      font-size: 0.65rem;
      font-weight: 600;
      padding: 2px 6px;
      border-radius: 3px;
      pointer-events: none;
    }

    /* Interactive Resize Handles */
    .crop-handle {
      position: absolute;
      background: #ffffff;
      border: 2px solid var(--cut);
      box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
      z-index: 12;
    }

    .handle-n {
      top: -6px;
      left: 50%;
      transform: translateX(-50%);
      width: 28px;
      height: 10px;
      border-radius: 4px;
      cursor: ns-resize;
    }

    .handle-s {
      bottom: -6px;
      left: 50%;
      transform: translateX(-50%);
      width: 28px;
      height: 10px;
      border-radius: 4px;
      cursor: ns-resize;
    }

    .handle-w {
      left: -6px;
      top: 50%;
      transform: translateY(-50%);
      width: 10px;
      height: 28px;
      border-radius: 4px;
      cursor: ew-resize;
    }

    .handle-e {
      right: -6px;
      top: 50%;
      transform: translateY(-50%);
      width: 10px;
      height: 28px;
      border-radius: 4px;
      cursor: ew-resize;
    }

    .handle-nw {
      top: -6px;
      left: -6px;
      width: 12px;
      height: 12px;
      border-radius: 50%;
      cursor: nwse-resize;
    }

    .handle-ne {
      top: -6px;
      right: -6px;
      width: 12px;
      height: 12px;
      border-radius: 50%;
      cursor: nesw-resize;
    }

    .handle-sw {
      bottom: -6px;
      left: -6px;
      width: 12px;
      height: 12px;
      border-radius: 50%;
      cursor: nesw-resize;
    }

    .handle-se {
      bottom: -6px;
      right: -6px;
      width: 12px;
      height: 12px;
      border-radius: 50%;
      cursor: nwse-resize;
    }

    /* Crop Settings Panel (Presets + Sliders) */
    .crop-controls-panel {
      background: #fafafa;
      border: 1px solid var(--border);
      border-radius: var(--radius);
      padding: 1rem;
      display: flex;
      flex-direction: column;
      gap: 0.85rem;
    }

    .crop-presets-header {
      display: flex;
      justify-content: space-between;
      align-items: center;
      font-size: 0.82rem;
      font-weight: 700;
      color: var(--ink);
    }

    .presets-chips {
      display: flex;
      gap: 0.4rem;
      flex-wrap: wrap;
    }

    .preset-chip {
      background: #ffffff;
      border: 1px solid var(--border);
      color: var(--ink-light);
      font-size: 0.78rem;
      font-weight: 600;
      padding: 0.35rem 0.75rem;
      border-radius: 9999px;
      cursor: pointer;
      display: inline-flex;
      align-items: center;
      gap: 0.35rem;
      transition: all 0.12s ease;
    }

    .preset-chip .p-dot {
      width: 6px;
      height: 6px;
      border-radius: 50%;
    }

    .preset-chip:hover {
      border-color: var(--toner);
    }

    .preset-chip.active {
      background: var(--toner-tint);
      border-color: var(--toner);
      color: var(--toner-dark);
      box-shadow: 0 1px 3px var(--toner-glow);
    }

    /* Manual Sliders Grid */
    .manual-crop-sliders {
      display: grid;
      grid-template-columns: repeat(4, 1fr);
      gap: 0.75rem;
      padding-top: 0.5rem;
      border-top: 1px solid var(--border);
    }

    @media (max-width:640px) {
      .manual-crop-sliders {
        grid-template-columns: repeat(2, 1fr);
      }
    }

    .slider-item {
      display: flex;
      flex-direction: column;
      gap: 0.25rem;
    }

    .slider-item label {
      font-size: 0.75rem;
      font-weight: 600;
      color: var(--muted);
      display: flex;
      justify-content: space-between;
    }

    .slider-item label span {
      font-family: var(--mono);
      color: var(--toner);
      font-weight: 700;
    }

    .slider-item input[type="range"] {
      width: 100%;
      accent-color: var(--toner);
      height: 4px;
      border-radius: 2px;
    }

    /* Crop Scope Options */
    .crop-scope-row {
      display: flex;
      align-items: center;
      justify-content: space-between;
      font-size: 0.8rem;
      color: var(--muted);
      padding-top: 0.4rem;
    }

    .scope-radios {
      display: flex;
      gap: 0.85rem;
      font-weight: 600;
      color: var(--ink-light);
    }

    .scope-radios label {
      display: inline-flex;
      align-items: center;
      gap: 0.3rem;
      cursor: pointer;
    }

    .scope-radios input[type="radio"] {
      accent-color: var(--toner);
    }

    /* Horizontal Thumbnail Strip (ViewPager Pager Strip) */
    .strip-section {
      border-top: 1px solid var(--border);
      padding-top: 0.75rem;
    }

    .strip-head {
      display: flex;
      justify-content: space-between;
      align-items: center;
      margin-bottom: 0.5rem;
    }

    .strip-head .title {
      font-size: 0.8rem;
      font-weight: 700;
      color: var(--muted);
      text-transform: uppercase;
      letter-spacing: 0.03em;
    }

    .strip-head .quick-links {
      display: flex;
      gap: 0.75rem;
      font-size: 0.78rem;
    }

    .link-action {
      background: none;
      border: none;
      color: var(--toner);
      font-weight: 600;
      cursor: pointer;
      padding: 0;
    }

    .link-action:hover {
      text-decoration: underline;
    }

    .thumbnail-strip {
      display: flex;
      gap: 0.6rem;
      overflow-x: auto;
      padding: 0.4rem 0.2rem 0.6rem;
      scroll-behavior: smooth;
    }

    .thumbnail-strip::-webkit-scrollbar {
      height: 6px;
    }

    .thumbnail-strip::-webkit-scrollbar-thumb {
      background: #cbd5e1;
      border-radius: 3px;
    }

    .strip-thumb-card {
      flex: 0 0 72px;
      border: 2px solid var(--border);
      border-radius: 6px;
      background: #ffffff;
      padding: 3px;
      cursor: pointer;
      position: relative;
      transition: all 0.15s;
      user-select: none;
      text-align: center;
    }

    .strip-thumb-card:hover {
      border-color: var(--toner);
      transform: translateY(-1px);
    }

    .strip-thumb-card.active {
      border-color: var(--toner);
      box-shadow: 0 0 0 2px var(--toner-glow), 0 2px 8px var(--toner-glow);
      background: var(--toner-tint);
    }

    .strip-thumb-card.excluded {
      opacity: 0.35;
      filter: grayscale(90%);
    }

    .strip-thumb-wrap {
      height: 78px;
      display: flex;
      align-items: center;
      justify-content: center;
      background: #f1f5f9;
      border-radius: 4px;
      overflow: hidden;
      position: relative;
    }

    .strip-thumb-wrap img {
      max-width: 100%;
      max-height: 100%;
      display: block;
    }

    .strip-thumb-crop-box {
      position: absolute;
      border: 1.5px dashed var(--cut);
      background: rgba(239, 68, 68, 0.15);
      pointer-events: none;
    }

    .strip-thumb-card .strip-num {
      font-family: var(--mono);
      font-size: 0.68rem;
      font-weight: 700;
      margin-top: 2px;
      color: var(--ink-light);
    }

    /* ---------- Right Column: Printer Selection & Export Studio ---------- */
    .studio-printer-panel {
      display: flex;
      flex-direction: column;
      gap: 1.25rem;
    }

    .printer-card {
      background: #ffffff;
      border: 1px solid var(--border);
      border-radius: var(--radius-lg);
      box-shadow: var(--shadow-sm);
      padding: 1.25rem;
    }

    .panel-title {
      font-size: 1rem;
      font-weight: 800;
      color: var(--ink);
      margin-bottom: 0.3rem;
      display: flex;
      align-items: center;
      gap: 0.4rem;
    }

    .panel-subtitle {
      font-size: 0.82rem;
      color: var(--muted);
      margin-bottom: 1rem;
    }

    /* Printer Tab Switcher */
    .printer-mode-tabs {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 0.6rem;
      margin-bottom: 1rem;
    }

    .p-tab {
      border: 2px solid var(--border);
      border-radius: var(--radius);
      padding: 0.75rem 0.85rem;
      cursor: pointer;
      background: #ffffff;
      transition: all 0.15s ease;
      display: flex;
      flex-direction: column;
      gap: 0.25rem;
    }

    .p-tab:hover {
      border-color: var(--toner);
    }

    .p-tab.active {
      border-color: var(--toner);
      background: var(--toner-tint);
    }

    .p-tab-title {
      font-size: 0.9rem;
      font-weight: 700;
      color: var(--ink);
      display: flex;
      align-items: center;
      gap: 0.35rem;
    }

    .p-tab-desc {
      font-size: 0.75rem;
      color: var(--muted);
      line-height: 1.3;
    }

    /* Printer Config Fields */
    .config-box {
      background: #fafafa;
      border: 1px solid var(--border);
      border-radius: var(--radius);
      padding: 1rem;
      display: flex;
      flex-direction: column;
      gap: 0.85rem;
    }

    .field-row {
      display: flex;
      flex-direction: column;
      gap: 0.3rem;
    }

    .field-row label {
      font-size: 0.8rem;
      font-weight: 600;
      color: var(--ink);
    }

    .field-row select,
    .field-row input[type="number"] {
      width: 100%;
      padding: 0.5rem 0.65rem;
      border: 1px solid var(--border);
      border-radius: 6px;
      font-size: 0.85rem;
      background: #ffffff;
      color: var(--ink);
    }

    .field-row select:focus,
    .field-row input:focus {
      outline: none;
      border-color: var(--toner);
    }

    /* Expandable / Collapsible Card */
    .collapsible-card {
      border: 1px solid var(--border);
      border-radius: var(--radius);
      background: #ffffff;
      overflow: hidden;
      transition: border-color 0.15s ease;
    }

    .collapsible-header {
      padding: 0.7rem 0.85rem;
      background: #f8fafc;
      cursor: pointer;
      display: flex;
      justify-content: space-between;
      align-items: center;
      user-select: none;
      border-bottom: 1px solid transparent;
      transition: all 0.15s ease;
    }

    .collapsible-header:hover {
      background: #f1f5f9;
    }

    .collapsible-card.open .collapsible-header {
      border-bottom-color: var(--border);
      background: #f8fafc;
    }

    .collapsible-title {
      font-size: 0.85rem;
      font-weight: 700;
      color: var(--ink);
      display: flex;
      align-items: center;
      gap: 0.45rem;
      flex-wrap: wrap;
    }

    .collapsible-badge {
      font-size: 0.68rem;
      font-weight: 600;
      color: var(--toner);
      background: var(--toner-tint);
      padding: 0.15rem 0.5rem;
      border-radius: 9999px;
      border: 1px solid #bfdbfe;
    }

    .collapsible-chevron {
      font-size: 0.75rem;
      color: var(--muted);
      transition: transform 0.2s ease;
    }

    .collapsible-card.open .collapsible-chevron {
      transform: rotate(180deg);
    }

    .collapsible-body {
      padding: 0.85rem;
      display: none;
      flex-direction: column;
      gap: 0.85rem;
      background: #fafafa;
    }

    .collapsible-card.open .collapsible-body {
      display: flex;
    }

    /* Orientation Selector Grid */
    .orientation-grid {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 0.5rem;
      margin-top: 0.2rem;
    }

    .orient-btn {
      border: 1.5px solid var(--border);
      border-radius: var(--radius);
      padding: 0.6rem 0.75rem;
      cursor: pointer;
      background: #ffffff;
      display: flex;
      align-items: center;
      gap: 0.6rem;
      transition: all 0.15s ease;
    }

    .orient-btn:hover {
      border-color: var(--toner);
    }

    .orient-btn.active {
      border-color: var(--toner);
      background: var(--toner-tint);
      box-shadow: 0 0 0 1px var(--toner);
    }

    .orient-icon-box {
      border: 1.5px dashed var(--muted);
      border-radius: 3px;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 0.65rem;
      flex-shrink: 0;
      background: #f8fafc;
      transition: all 0.15s;
    }

    .orient-btn.active .orient-icon-box {
      border-color: var(--toner);
      color: var(--toner);
      background: #ffffff;
    }

    .orient-icon-box.landscape {
      width: 30px;
      height: 20px;
    }

    .orient-icon-box.portrait {
      width: 20px;
      height: 30px;
    }

    .orient-text {
      display: flex;
      flex-direction: column;
      text-align: left;
    }

    .orient-text strong {
      font-size: 0.82rem;
      color: var(--ink);
    }

    .orient-text .orient-sub {
      font-size: 0.68rem;
      color: var(--muted);
    }

    /* Sizing & Fit mode toggle */
    .fit-mode-chips {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 0.4rem;
      margin-top: 0.2rem;
    }

    .fit-chip {
      border: 1.5px solid var(--border);
      border-radius: 6px;
      padding: 0.5rem 0.4rem;
      background: #ffffff;
      color: var(--ink-light);
      font-size: 0.78rem;
      font-weight: 600;
      cursor: pointer;
      text-align: center;
      transition: all 0.12s ease;
    }

    .fit-chip:hover {
      border-color: var(--toner);
    }

    .fit-chip.active {
      border-color: var(--toner);
      background: var(--toner-tint);
      color: var(--toner-dark);
    }

    /* Margin preset chips */
    .margin-chips-row {
      display: flex;
      gap: 0.4rem;
      margin-top: 0.25rem;
    }

    .margin-chip {
      flex: 1;
      border: 1px solid var(--border);
      border-radius: 4px;
      padding: 0.35rem 0.4rem;
      background: #ffffff;
      font-size: 0.75rem;
      font-weight: 600;
      cursor: pointer;
      color: var(--ink);
      text-align: center;
      transition: all 0.12s;
    }

    .margin-chip:hover {
      border-color: var(--toner);
    }

    .margin-chip.active {
      border-color: var(--toner);
      background: var(--toner);
      color: #ffffff;
    }

    .field-hint {
      font-size: 0.72rem;
      color: var(--muted);
      line-height: 1.35;
      margin-top: 0.25rem;
    }

    /* Live Sheet Diagram */
    .sheet-diagram-wrap {
      background: #ffffff;
      border: 1px solid var(--border);
      border-radius: var(--radius);
      padding: 0.75rem;
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 1rem;
      margin-top: 0.25rem;
    }

    .sheet-svg-box {
      width: 120px;
      height: 85px;
      display: flex;
      align-items: center;
      justify-content: center;
    }

    .sheet-diagram-info {
      font-size: 0.78rem;
      color: var(--muted);
      display: flex;
      flex-direction: column;
      gap: 0.2rem;
    }

    .sheet-diagram-info strong {
      color: var(--ink);
      font-size: 0.82rem;
    }

    /* A4 Grid Layout Chips (1, 2, 4, 6) */
    .layout-chips-grid {
      display: grid;
      grid-template-columns: repeat(4, 1fr);
      gap: 0.35rem;
    }

    .l-chip {
      border: 1.5px solid var(--border);
      border-radius: 6px;
      padding: 0.45rem 0.25rem;
      text-align: center;
      cursor: pointer;
      background: #fff;
      font-size: 0.8rem;
      font-weight: 700;
      transition: all 0.12s ease;
    }

    .l-chip:hover {
      border-color: var(--toner);
    }

    .l-chip.active {
      border-color: var(--toner);
      background: var(--toner);
      color: #ffffff;
    }

    .l-chip .l-sub {
      display: block;
      font-size: 0.65rem;
      font-weight: normal;
      opacity: 0.85;
    }

    .check-option {
      display: flex;
      align-items: center;
      gap: 0.45rem;
      font-size: 0.82rem;
      font-weight: 500;
      cursor: pointer;
      color: var(--ink-light);
    }

    .check-option input {
      accent-color: var(--toner);
    }

    /* Export Action Card */
    .export-card {
      background: #ffffff;
      border: 1px solid var(--border);
      border-radius: var(--radius-lg);
      box-shadow: var(--shadow-sm);
      padding: 1.25rem;
      display: flex;
      flex-direction: column;
      gap: 0.85rem;
    }

    .btn-main-generate {
      width: 100%;
      background: var(--toner);
      border: none;
      color: #ffffff;
      font-size: 0.95rem;
      font-weight: 700;
      padding: 0.85rem 1.25rem;
      border-radius: var(--radius);
      cursor: pointer;
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 0.5rem;
      box-shadow: 0 2px 10px var(--toner-glow);
      transition: all 0.15s ease;
    }

    .btn-main-generate:hover {
      background: var(--toner-dark);
      box-shadow: 0 4px 14px var(--toner-glow);
      transform: translateY(-1px);
    }

    .btn-main-generate:disabled {
      opacity: 0.45;
      cursor: not-allowed;
      transform: none;
    }

    .export-secondary-row {
      display: flex;
      gap: 0.5rem;
    }

    .btn-sec {
      flex: 1;
      background: #ffffff;
      border: 1px solid var(--border);
      color: var(--ink);
      font-size: 0.82rem;
      font-weight: 600;
      padding: 0.55rem 0.65rem;
      border-radius: 6px;
      cursor: pointer;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      gap: 0.35rem;
      transition: all 0.15s;
    }

    .btn-sec:hover {
      border-color: var(--border-hover);
      background: #f8fafc;
    }

    .status-text {
      font-size: 0.82rem;
      font-weight: 600;
      min-height: 1.2em;
      color: var(--muted);
      text-align: center;
    }

    .status-text.error {
      color: var(--cut);
    }

    .status-text.success {
      color: var(--success);
    }

    /* Output Preview Modal / Inline */
    .preview-card {
      background: #ffffff;
      border: 1px solid var(--border);
      border-radius: var(--radius-lg);
      box-shadow: var(--shadow-sm);
      padding: 1rem;
      display: none;
      flex-direction: column;
      gap: 0.75rem;
    }

    .preview-card-head {
      display: flex;
      justify-content: space-between;
      align-items: center;
      flex-wrap: wrap;
      gap: 0.5rem;
    }

    .preview-card-head h3 {
      font-size: 0.9rem;
      font-weight: 700;
      color: var(--ink);
    }

    .preview-live-badge {
      font-size: 0.68rem;
      font-weight: 700;
      color: var(--success);
      background: var(--success-tint);
      border: 1px solid #a7f3d0;
      padding: 0.15rem 0.45rem;
      border-radius: 9999px;
    }

    .preview-format-badge {
      font-size: 0.72rem;
      font-weight: 600;
      color: var(--ink-light);
      background: var(--paper);
      border: 1px solid var(--border);
      padding: 0.18rem 0.55rem;
      border-radius: 6px;
      display: inline-flex;
      align-items: center;
      gap: 0.3rem;
    }

    .preview-pager-bar {
      display: none;
      align-items: center;
      justify-content: space-between;
      background: var(--paper);
      border: 1px solid var(--border);
      border-radius: 6px;
      padding: 0.35rem 0.6rem;
    }

    .preview-pager-info {
      font-size: 0.75rem;
      font-weight: 600;
      color: var(--ink-light);
      font-family: var(--mono);
    }

    .preview-stage {
      width: 100%;
      min-height: 360px;
      max-height: 540px;
      background: #e2e8f0;
      border: 1px solid var(--border);
      border-radius: 8px;
      display: flex;
      align-items: center;
      justify-content: center;
      overflow: auto;
      padding: 1.25rem;
      position: relative;
    }

    .preview-sheet-wrapper {
      display: flex;
      justify-content: center;
      align-items: center;
      max-width: 100%;
    }

    .preview-canvas {
      display: block;
      max-width: 100%;
      max-height: 480px;
      width: auto;
      height: auto;
      background: #ffffff;
      box-shadow: 0 8px 24px rgba(15, 23, 42, 0.18), 0 2px 6px rgba(15, 23, 42, 0.08);
      transition: all 0.2s ease;
    }

    .preview-canvas.thermal-preview {
      border-radius: 8px;
      /* Realistic die-cut sticker rounded corners */
      border: 1px solid #cbd5e1;
    }

    .preview-canvas.a4-preview {
      border-radius: 2px;
      border: 1px solid #cbd5e1;
    }

    .preview-frame {
      display: none;
      width: 100%;
      height: 380px;
      border: 1px solid var(--border);
      border-radius: 6px;
      background: #525659;
    }

    /* ---------- Footer ---------- */
    footer {
      text-align: center;
      padding: 2rem 1rem;
      color: var(--muted);
      font-size: 0.8rem;
      border-top: 1px solid var(--border);
      background: #ffffff;
      margin-top: auto;
    }

    /* Hidden print iframe */
    #print-iframe {
      display: none;
    }

    /* ---------- Tools Navigation Bar ---------- */
    .tools-nav-bar {
      background: #f8fafc;
      border-bottom: 1px solid var(--border);
      padding: 0.5rem 1.25rem;
      overflow-x: auto;
      white-space: nowrap;
      -webkit-overflow-scrolling: touch;
    }
    .tools-nav-inner {
      max-width: 1380px;
      margin: 0 auto;
      display: flex;
      gap: 0.5rem;
      align-items: center;
    }
    .tools-nav-label {
      font-size: 0.75rem;
      font-weight: 700;
      text-transform: uppercase;
      color: var(--muted);
      letter-spacing: 0.05em;
      margin-right: 0.25rem;
    }
    .tool-link {
      display: inline-flex;
      align-items: center;
      gap: 0.35rem;
      font-size: 0.8rem;
      font-weight: 600;
      color: var(--ink-light);
      background: #ffffff;
      border: 1px solid var(--border);
      padding: 0.3rem 0.75rem;
      border-radius: 9999px;
      text-decoration: none;
      transition: all 0.2s ease;
    }
    .tool-link:hover {
      color: var(--toner);
      border-color: var(--toner);
      background: var(--toner-tint);
      text-decoration: none;
      transform: translateY(-1px);
    }
    .tool-link.active {
      color: #ffffff;
      background: var(--toner);
      border-color: var(--toner);
    }

    /* ---------- Rich SEO Article & Guide Section ---------- */
    .seo-article {
      margin-top: 3.5rem;
      padding-top: 2.5rem;
      border-top: 1px solid var(--border);
      color: var(--ink);
    }
    .seo-article h2 {
      font-size: 1.65rem;
      font-weight: 800;
      color: var(--ink);
      letter-spacing: -0.02em;
      margin-bottom: 1rem;
      display: flex;
      align-items: center;
      gap: 0.6rem;
    }
    .seo-article h3 {
      font-size: 1.25rem;
      font-weight: 700;
      color: var(--ink);
      margin: 1.75rem 0 0.75rem;
    }
    .seo-article p {
      font-size: 0.95rem;
      line-height: 1.7;
      color: var(--ink-light);
      margin-bottom: 1.25rem;
    }
    .seo-highlight-box {
      background: linear-gradient(135deg, #eff6ff 0%, #f0fdf4 100%);
      border: 1px solid #bfdbfe;
      border-left: 4px solid var(--toner);
      border-radius: var(--radius);
      padding: 1.25rem 1.5rem;
      margin: 1.5rem 0;
    }
    .seo-highlight-box p {
      margin-bottom: 0;
      color: #1e3a8a;
      font-weight: 500;
    }

    /* Step Workflow Cards */
    .steps-grid {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
      gap: 1.25rem;
      margin: 1.5rem 0 2rem;
    }
    .step-card {
      background: #ffffff;
      border: 1px solid var(--border);
      border-radius: var(--radius-lg);
      padding: 1.5rem;
      position: relative;
      box-shadow: var(--shadow-sm);
      transition: transform 0.2s ease, box-shadow 0.2s ease;
    }
    .step-card:hover {
      transform: translateY(-2px);
      box-shadow: var(--shadow-md);
    }
    .step-number {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      width: 32px;
      height: 32px;
      border-radius: 9999px;
      background: var(--toner-tint);
      color: var(--toner);
      font-weight: 800;
      font-size: 0.9rem;
      margin-bottom: 0.75rem;
    }
    .step-card h4 {
      font-size: 1.05rem;
      font-weight: 700;
      margin-bottom: 0.5rem;
      color: var(--ink);
    }
    .step-card p {
      font-size: 0.88rem;
      line-height: 1.55;
      color: var(--muted);
      margin-bottom: 0;
    }

    /* Specifications Table */
    .spec-table-wrap {
      width: 100%;
      overflow-x: auto;
      margin: 1.5rem 0 2rem;
      border: 1px solid var(--border);
      border-radius: var(--radius-lg);
      background: #ffffff;
      box-shadow: var(--shadow-sm);
    }
    .spec-table {
      width: 100%;
      border-collapse: collapse;
      text-align: left;
      font-size: 0.9rem;
    }
    .spec-table th {
      background: #f8fafc;
      padding: 0.85rem 1.25rem;
      font-weight: 700;
      color: var(--ink);
      border-bottom: 1px solid var(--border);
    }
    .spec-table td {
      padding: 0.85rem 1.25rem;
      border-bottom: 1px solid var(--border);
      color: var(--ink-light);
    }
    .spec-table tr:last-child td {
      border-bottom: none;
    }
    .spec-table tr:hover td {
      background: #f8fafc;
    }

    /* FAQ Section */
    .faq-section {
      margin-top: 2.5rem;
    }
    .faq-grid {
      display: flex;
      flex-direction: column;
      gap: 1rem;
      margin-top: 1.25rem;
    }
    .faq-item {
      background: #ffffff;
      border: 1px solid var(--border);
      border-radius: var(--radius);
      padding: 1.25rem 1.5rem;
      box-shadow: var(--shadow-sm);
    }
    .faq-item h4 {
      font-size: 1.05rem;
      font-weight: 700;
      color: var(--ink);
      margin-bottom: 0.5rem;
      display: flex;
      align-items: center;
      gap: 0.5rem;
    }
    .faq-item p {
      font-size: 0.9rem;
      line-height: 1.6;
      color: var(--muted);
      margin-bottom: 0;
    }

    /* Related Tools Grid */
    .related-tools-section {
      margin-top: 3rem;
      padding: 2rem;
      background: #f8fafc;
      border: 1px solid var(--border);
      border-radius: var(--radius-lg);
    }
    .related-tools-grid {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
      gap: 1rem;
      margin-top: 1.25rem;
    }
    .rel-tool-card {
      display: flex;
      flex-direction: column;
      gap: 0.35rem;
      background: #ffffff;
      padding: 1rem 1.25rem;
      border-radius: var(--radius);
      border: 1px solid var(--border);
      text-decoration: none;
      transition: all 0.2s ease;
    }
    .rel-tool-card:hover {
      border-color: var(--toner);
      box-shadow: var(--shadow-md);
      transform: translateY(-2px);
      text-decoration: none;
    }
    .rel-tool-title {
      font-size: 0.95rem;
      font-weight: 700;
      color: var(--ink);
    }
    .rel-tool-desc {
      font-size: 0.78rem;
      color: var(--muted);
      line-height: 1.4;
    }
