/* ── Reset ───────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; cursor: none !important; }
button { font-family: inherit; border: none; background: none; }

/* ── ShiftTools Custom Cursor (Full Solid Black, No Outline) ── */
#shift-cursor {
  position: fixed; pointer-events: none; z-index: 999999;
  width: 24px; height: 24px; left: -50px; top: -50px;
  transition: width .13s, height .13s;
}
#shift-cursor svg {
  width: 100%; height: 100%;
  filter: drop-shadow(0 2px 5px rgba(0,0,0,.25));
  transition: transform .12s, filter .13s;
}
#shift-cursor.hover { width: 30px; height: 30px; }
#shift-cursor.hover svg { filter: drop-shadow(0 4px 10px rgba(0,0,0,.35)); }
#shift-cursor.click svg { transform: scale(.82); }

#shift-trail {
  position: fixed; pointer-events: none; z-index: 999998;
  width: 13px; height: 13px; opacity: .2; left: -50px; top: -50px;
  transition: left .2s ease-out, top .2s ease-out;
}
#shift-trail svg { width: 100%; height: 100%; }

@media (hover: none), (pointer: coarse) {
  html, body, * { cursor: auto !important; }
  #shift-cursor, #shift-trail { display: none !important; }
}

body {
  background: #f0f0f0;
  font-family: "Inter", sans-serif;
  min-height: 100vh;
  padding: 24px 20px 60px;
  overflow-x: hidden;
}

/* ── Top Navigation Bar (Back to Tools) ─────────── */
.page-top-nav {
  max-width: 980px;
  margin: 0 auto 16px;
  display: flex;
  align-items: center;
}
.back-tools-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: #fff;
  border: 1px solid #e2e2e8;
  border-radius: 99px;
  color: #444;
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
  transition: background 0.15s, color 0.15s, border-color 0.15s, transform 0.12s;
}
.back-tools-btn svg {
  transition: transform 0.15s;
}
.back-tools-btn:hover {
  background: #111;
  color: #fff;
  border-color: #111;
  transform: translateY(-1px);
}
.back-tools-btn:hover svg {
  transform: translateX(-2px);
}

/* ── Page card ───────────────────────────────────── */
.page-card {
  max-width: 980px;
  margin: 0 auto 40px;
  background: #fff;
  border-radius: 20px;
  box-shadow: 0 0 0 1px #e0e0e0, 0 4px 6px rgba(0,0,0,0.04), 0 12px 40px rgba(0,0,0,0.08);
  overflow: hidden;
}

/* ── App layout (default mobile/tablet base) ─────── */
.app {
  display: flex;
  flex-direction: column;
  min-height: 540px;
  min-width: 0;
  width: 100%;
}

/* ── Header ──────────────────────────────────────── */
.app-header {
  padding: 36px 44px 0;
  min-width: 0;
}
.eyebrow {
  display: inline-flex; align-items: center; gap: 7px;
  background: #f5f5f5; padding: 5px 13px; border-radius: 99px; margin-bottom: 18px;
}
.eyebrow-dot {
  width: 6px; height: 6px; background: #22c55e;
  border-radius: 50%; animation: pulse 2s infinite;
}
@keyframes pulse { 0%,100% { opacity:1; } 50% { opacity:0.4; } }
.eyebrow span { font-size: 11px; font-weight: 500; color: #555; letter-spacing: 0.03em; }
.app-header h1, .app-header h2 {
  font-size: 26px; font-weight: 300; color: #111;
  letter-spacing: -0.025em; line-height: 1.2; margin-bottom: 7px;
}
.app-header strong { font-weight: 600; }
.app-header p { font-size: 13px; color: #aaa; font-weight: 300; margin-bottom: 28px; }

/* ── Drop zone ───────────────────────────────────── */
.drop-wrap {
  padding: 0 44px;
  min-width: 0;
}
.drop-zone {
  border: 1.5px dashed #e0e0e0; border-radius: 14px;
  padding: 40px 24px; text-align: center; cursor: pointer;
  transition: all 0.2s; position: relative;
}
.drop-zone:hover { border-color: #111; background: #fafafa; }
.drop-zone.dragging { border-color: #111; background: #f8f8f8; }
.drop-ring {
  width: 50px; height: 50px; border-radius: 50%; background: #f5f5f5;
  margin: 0 auto 12px; display: flex; align-items: center; justify-content: center;
  transition: background 0.2s;
}
.drop-zone:hover .drop-ring { background: #efefef; }
.drop-zone h3 { font-size: 14px; font-weight: 500; color: #111; margin-bottom: 4px; }
.drop-zone p { font-size: 12px; color: #bbb; }
.drop-zone em {
  font-style: normal; color: #555;
  text-decoration: underline; text-underline-offset: 2px; text-decoration-color: #ccc;
}
#file-input { display: none; }

/* ── Strip (Horizontal scroll with min-width:0 protection) ── */
.strip-wrap {
  padding: 24px 44px;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
}
.strip-label {
  font-size: 10px; font-weight: 600; letter-spacing: 0.1em;
  color: #bbb; text-transform: uppercase; margin-bottom: 12px;
}
.strip {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 10px;
  min-width: 0;
  max-width: 100%;
  scrollbar-width: thin;
  scrollbar-color: #ddd transparent;
  -webkit-overflow-scrolling: touch;
}
.strip::-webkit-scrollbar {
  height: 6px;
}
.strip::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 99px;
}
.strip::-webkit-scrollbar-thumb {
  background: #ccc;
  border-radius: 99px;
}
.strip::-webkit-scrollbar-thumb:hover {
  background: #999;
}

.img-card {
  flex-shrink: 0;
  position: relative;
  transition: transform 0.15s;
  user-select: none;
}
.img-card.drag-over { opacity: 0.4; }

.img-thumb {
  width: 76px;
  height: 96px;
  border-radius: 8px;
  display: block;
  margin-bottom: 6px;
  position: relative;
  overflow: hidden;
  cursor: pointer;
  background: #f0f0f0;
  border: 1px solid #e8e8e8;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.img-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.img-thumb::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0);
  transition: background 0.18s;
  border-radius: 7px;
}
.img-thumb:hover::after {
  background: rgba(0,0,0,0.22);
}
.thumb-eye {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%,-50%);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.18s;
  z-index: 2;
}
.img-thumb:hover .thumb-eye {
  opacity: 1;
}

.img-page-num {
  position: absolute;
  bottom: 5px;
  left: 6px;
  font-size: 10px;
  font-weight: 700;
  color: #fff;
  background: rgba(0,0,0,0.6);
  padding: 1px 5px;
  border-radius: 4px;
  z-index: 1;
}

.img-del {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 20px;
  height: 20px;
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 50%;
  font-size: 12px;
  color: #999;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 4px rgba(0,0,0,0.12);
  transition: all 0.15s;
  line-height: 1;
  z-index: 3;
}
.img-del:hover {
  background: #111;
  color: #fff;
  border-color: #111;
}

.img-name {
  font-size: 10px;
  color: #888;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 76px;
  text-align: center;
}

.add-card {
  flex-shrink: 0;
  width: 76px;
  height: 96px;
  border: 1.5px dashed #d4d4d8;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #aaa;
  font-size: 24px;
  cursor: pointer;
  transition: all 0.2s;
  font-weight: 300;
  align-self: flex-start;
  background: #fafafa;
}
.add-card:hover {
  border-color: #111;
  color: #111;
  background: #fff;
}

/* ── Settings chips ───────────────────────────────── */
.chips-wrap {
  padding: 0 44px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  min-width: 0;
}
.chip {
  display: flex; align-items: center; gap: 5px;
  border: 1px solid #e8e8e8; border-radius: 99px;
  padding: 6px 13px; font-size: 12px; color: #555;
  cursor: pointer; transition: all 0.15s; white-space: nowrap;
}
.chip:hover { border-color: #999; color: #111; }
.chip.active { background: #111; color: #fff; border-color: #111; }

/* ── Divider ─────────────────────────────────────── */
.divider { margin: 20px 44px 0; border: none; border-top: 1px solid #f0f0f0; }

/* ── Footer ──────────────────────────────────────── */
.app-footer {
  margin-top: auto;
  padding: 22px 44px 36px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-width: 0;
}
.footer-info { font-size: 12px; color: #bbb; line-height: 1.6; }
.footer-info strong { color: #111; font-weight: 500; }
.download-btn {
  flex-shrink: 0;
  height: 46px;
  padding: 0 26px;
  background: #111;
  color: #fff;
  border-radius: 99px;
  font-size: 14px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: background 0.15s, transform 0.1s, box-shadow 0.15s;
  white-space: nowrap;
}
.download-btn:hover {
  background: #333;
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(0,0,0,0.15);
}
.download-btn:active { transform: translateY(0); }
.download-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

/* ── Sidebar (Summary) ───────────────────────────── */
.app-sidebar {
  display: flex;
  flex-direction: column;
  background: #fafafa;
  border-left: 1px solid #f0f0f0;
  padding: 32px 24px;
  min-width: 0;
  max-width: 100%;
}
.sidebar-title {
  font-size: 10px; font-weight: 600; letter-spacing: 0.1em;
  text-transform: uppercase; color: #bbb; margin-bottom: 18px;
}
.sidebar-stat { margin-bottom: 16px; }
.sidebar-stat-num {
  font-size: 32px; font-weight: 300; color: #111;
  letter-spacing: -0.03em; line-height: 1; margin-bottom: 3px;
}
.sidebar-stat-label {
  font-size: 10px; color: #bbb; font-weight: 500;
  letter-spacing: 0.06em; text-transform: uppercase;
}
.sidebar-bar-wrap { margin-bottom: 6px; }
.sidebar-bar {
  height: 3px; background: #eee; border-radius: 2px;
  overflow: hidden; margin-bottom: 7px;
}
.sidebar-bar-fill {
  height: 100%; background: #111; border-radius: 2px;
  width: 0%; transition: width 0.4s;
}
.sidebar-bar-labels {
  display: flex; justify-content: space-between; font-size: 10px; color: #bbb;
}
.sidebar-hr {
  border: none; border-top: 1px solid #ebebeb; margin: 16px 0;
}
.sidebar-order {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  margin-bottom: 8px;
}
.sidebar-order-label {
  font-size: 10px; font-weight: 600; letter-spacing: 0.1em;
  text-transform: uppercase; color: #bbb; margin-bottom: 10px;
}
#sb-order-list {
  flex: 1;
  min-height: 140px;
  overflow-y: auto;
  padding-right: 6px;
  padding-bottom: 16px;
  scrollbar-width: thin;
  scrollbar-color: #ddd transparent;
}
#sb-order-list::-webkit-scrollbar { width: 4px; }
#sb-order-list::-webkit-scrollbar-thumb { background: #ddd; border-radius: 4px; }

.sidebar-order-item {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 0; border-bottom: 1px solid #f0f0f0;
}
.sidebar-order-item:last-child { border-bottom: none; }
.sidebar-order-swatch {
  width: 22px; height: 28px; border-radius: 3px;
  flex-shrink: 0; background: #eee; overflow: hidden;
  border: 1px solid #e0e0e0;
}
.sidebar-order-swatch img {
  width: 100%; height: 100%; object-fit: cover; display: block;
}
.sidebar-order-name {
  flex: 1; font-size: 11px; color: #666;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sidebar-order-pg {
  font-size: 10px; color: #bbb; font-weight: 600;
}
.sidebar-empty {
  font-size: 11px; color: #ccc; font-style: italic; padding: 8px 0;
}

/* ── Preview Modal ───────────────────────────────── */
.preview-modal {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.78);
  backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center;
  z-index: 9000;
  opacity: 0; pointer-events: none;
  transition: opacity 0.22s;
}
.preview-modal.open { opacity: 1; pointer-events: all; }
.preview-inner {
  position: relative;
  max-width: min(90vw, 760px);
  max-height: 90vh;
  display: flex; flex-direction: column; align-items: center;
}
.preview-img {
  max-width: 100%; max-height: calc(90vh - 56px);
  border-radius: 12px;
  box-shadow: 0 24px 80px rgba(0,0,0,0.6);
  object-fit: contain;
  display: block;
}
.preview-close {
  position: absolute; top: -16px; right: -16px;
  width: 36px; height: 36px;
  background: #fff; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; color: #333; line-height: 1;
  box-shadow: 0 4px 16px rgba(0,0,0,0.25);
  transition: background 0.15s, color 0.15s;
  cursor: pointer; border: none;
}
.preview-close:hover { background: #111; color: #fff; }
.preview-label {
  margin-top: 14px; font-size: 12px;
  color: rgba(255,255,255,0.75); letter-spacing: 0.02em;
}

/* ── SEO Section ─────────────────────────────────── */
.seo-section { max-width: 980px; margin: 0 auto 32px; padding: 0 20px; }
.seo-section > h2 {
  font-size: 18px; font-weight: 300; color: #111;
  letter-spacing: -0.02em; margin-bottom: 16px;
}
.seo-section > h2 strong { font-weight: 600; }
.seo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
}
.seo-card {
  background: #fff; border-radius: 14px; padding: 20px 22px;
  box-shadow: 0 0 0 1px #e8e8e8, 0 2px 8px rgba(0,0,0,0.03);
}
.seo-card-icon {
  width: 36px; height: 36px; border-radius: 10px;
  background: #111; display: flex; align-items: center; justify-content: center;
  margin-bottom: 12px;
}
.seo-card h3 { font-size: 13px; font-weight: 600; color: #111; margin-bottom: 6px; }
.seo-card p { font-size: 12px; color: #888; line-height: 1.65; }

/* ── FAQ Section ─────────────────────────────────── */
.faq-section { max-width: 980px; margin: 0 auto; padding: 0 20px 64px; }
.faq-section > h2 {
  font-size: 22px; font-weight: 300; color: #111;
  letter-spacing: -0.02em; margin-bottom: 6px;
}
.faq-section > h2 strong { font-weight: 600; }
.faq-section > p { font-size: 13px; color: #aaa; margin-bottom: 28px; }
.faq-list { display: flex; flex-direction: column; gap: 10px; }
.faq-item {
  background: #fff; border-radius: 14px;
  box-shadow: 0 0 0 1px #e8e8e8, 0 2px 8px rgba(0,0,0,0.04);
  overflow: hidden; transition: box-shadow 0.2s;
}
.faq-item:hover { box-shadow: 0 0 0 1px #d0d0d0, 0 4px 16px rgba(0,0,0,0.07); }
.faq-question {
  width: 100%; display: flex; align-items: center; justify-content: space-between;
  padding: 18px 22px; text-align: left; gap: 12px; cursor: pointer;
}
.faq-question h3 { font-size: 14px; font-weight: 500; color: #111; line-height: 1.4; flex: 1; }
.faq-chevron {
  flex-shrink: 0; width: 20px; height: 20px; border-radius: 50%;
  background: #f5f5f5; display: flex; align-items: center; justify-content: center;
  transition: background 0.15s, transform 0.25s;
}
.faq-item.open .faq-chevron { background: #111; transform: rotate(180deg); }
.faq-item.open .faq-chevron svg path { stroke: #fff; }
.faq-answer { max-height: 0; overflow: hidden; transition: max-height 0.35s cubic-bezier(0.4,0,0.2,1); }
.faq-answer-inner { padding: 0 22px 20px; font-size: 13px; color: #555; line-height: 1.75; }
.faq-answer-inner ul { margin: 10px 0 0 20px; display: flex; flex-direction: column; gap: 4px; }
.faq-answer-inner li { color: #555; }
.faq-answer-inner strong { color: #111; font-weight: 500; }

/* ══════════════════════════════════════════════════
   RESPONSIVE BREAKPOINTS (Mobile, Tablet, Laptop, Desktop)
   ══════════════════════════════════════════════════ */

/* ── Mobile (≤ 599px): Single column, hide sidebar ── */
@media (max-width: 599px) {
  body { padding: 20px 12px 48px; }
  .page-card { border-radius: 16px; margin-bottom: 28px; }
  .app-header { padding: 24px 20px 0; }
  .app-header h1, .app-header h2 { font-size: 20px; }
  .app-header p { font-size: 12px; margin-bottom: 22px; }
  .drop-wrap { padding: 0 20px; }
  .drop-zone { padding: 30px 16px; border-radius: 12px; }
  .drop-ring { width: 44px; height: 44px; margin-bottom: 10px; }
  .drop-zone h3 { font-size: 13px; }
  .strip-wrap { padding: 18px 20px; }
  .img-thumb { width: 64px; height: 82px; }
  .img-name { max-width: 64px; }
  .add-card { width: 64px; height: 82px; font-size: 20px; }
  .chips-wrap { padding: 0 20px; gap: 6px; }
  .chip { font-size: 11px; padding: 5px 11px; }
  .divider { margin: 14px 20px 0; }
  .app-footer {
    padding: 16px 20px 28px;
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }
  .download-btn {
    width: 100%;
    justify-content: center;
    height: 50px;
    font-size: 15px;
    border-radius: 14px;
  }
  .app-sidebar { display: none !important; }
}

/* ── Tablet (600px – 859px): 2-Column with sleek sidebar ── */
@media (min-width: 600px) and (max-width: 859px) {
  body { padding: 28px 16px 52px; }
  .app {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 220px;
    grid-template-rows: auto auto auto 1fr auto;
    min-height: 500px;
  }
  .app-header  { grid-column: 1; grid-row: 1; padding: 28px 30px 0; }
  .app-header h1, .app-header h2 { font-size: 22px; }
  .drop-wrap   { grid-column: 1; grid-row: 2; padding: 0 30px; }
  .drop-zone   { padding: 28px 20px; }
  .strip-wrap  { grid-column: 1; grid-row: 3; padding: 18px 30px; }
  .chips-wrap  { grid-column: 1; grid-row: 4; padding: 0 30px; align-content: start; }
  .app-footer  { grid-column: 1; grid-row: 5; padding: 18px 30px 28px; }
  .divider     { grid-column: 1 / -1; display: none; }
  .app-sidebar {
    grid-column: 2; grid-row: 1 / -1;
    display: flex !important;
    padding: 28px 20px;
  }
  .sidebar-stat-num { font-size: 26px; }
}

/* ── Desktop / Laptop (≥ 860px): Full 2-Column layout ── */
@media (min-width: 860px) {
  .app {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 260px;
    grid-template-rows: auto auto auto 1fr auto;
    min-height: 540px;
  }
  .app-header  { grid-column: 1; grid-row: 1; padding: 36px 44px 0; }
  .drop-wrap   { grid-column: 1; grid-row: 2; padding: 0 44px; }
  .strip-wrap  { grid-column: 1; grid-row: 3; padding: 24px 44px; }
  .chips-wrap  { grid-column: 1; grid-row: 4; padding: 0 44px; align-content: start; }
  .app-footer  { grid-column: 1; grid-row: 5; padding: 22px 44px 36px; }
  .divider     { grid-column: 1 / -1; display: none; }
  .app-sidebar {
    grid-column: 2; grid-row: 1 / -1;
    display: flex !important;
    padding: 32px 26px;
  }
}
