/* ios-stitch Master Styles */
:root {
  --primary: #2563eb;
  --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);
}
.app-box {
  width: 100%;
  max-width: 1260px;
  margin: 1.5rem auto 3rem auto;
  background: transparent;
  border: none;
  box-shadow: none;
  padding: 0 1.25rem;
  box-sizing: border-box;
}
.dropzone {
  width: 100%;
  box-sizing: border-box;
  border: 1.5px dashed #cbd5e1;
  border-radius: 18px;
  padding: 3.5rem 1.5rem;
  text-align: center;
  cursor: pointer;
  background: #ffffff;
  box-shadow: 0 4px 20px rgba(15, 23, 42, 0.03);
  transition: border-color 0.15s ease;
  position: relative;
}
.dropzone:hover {
  border-color: var(--primary);
  background: #ffffff;
}
.dropzone-icon { width: 56px; height: 56px; margin: 0 auto 0.85rem auto; color: var(--primary); }
.btn-upload-primary,
label.btn-upload-primary {
  background: #2563eb !important;
  color: #ffffff !important;
  padding: 0.65rem 1.45rem;
  border-radius: 10px;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  box-shadow: none !important;
  border: none !important;
  transition: background-color 0.15s ease;
}
.btn-upload-primary:hover,
label.btn-upload-primary:hover {
  background: #1d4ed8 !important;
  transform: none !important;
  box-shadow: none !important;
}
.btn-upload-primary *,
label.btn-upload-primary * {
  color: #ffffff !important;
  stroke: #ffffff !important;
}
.btn-reupload {
  cursor: pointer; font-size: 0.8rem; color: #2563eb; background: #eff6ff; border: 1px solid #bfdbfe;
  padding: 4px 10px; border-radius: 8px; font-weight: 700; display: inline-flex; align-items: center; gap: 5px;
  transition: background-color 0.15s ease;
}
.btn-reupload:hover {
  background: #dbeafe;
  transform: none !important;
}
.sample-btn {
  background: white; border: 1px solid #cbd5e1; padding: 0.58rem 1.15rem; border-radius: 10px;
  font-size: 0.88rem; font-weight: 700; color: #475569; cursor: pointer; display: inline-flex; align-items: center; gap: 6px;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}
.sample-btn:hover {
  border-color: #94a3b8;
  background: #f8fafc;
  transform: none !important;
}
.studio-grid { display: grid; grid-template-columns: 1.15fr 1fr; gap: 1.5rem; }
@media (max-width: 960px) {
  .studio-grid {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
    gap: 1.25rem !important;
  }
  .app-box {
    padding: 1.15rem 0.85rem !important;
  }
  .stitch-row {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 8px !important;
  }
  .stitch-row-switch {
    display: flex !important;
    flex-direction: row !important;
    justify-content: space-between !important;
    align-items: center !important;
    gap: 12px !important;
  }
  .pill-toggle-group {
    width: 100% !important;
    display: flex !important;
  }
  .pill-toggle-group .pill-btn {
    flex: 1 !important;
    text-align: center !important;
    font-size: 0.78rem !important;
    padding: 7px 4px !important;
  }
}
.panel-card {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  box-shadow: 0 4px 16px -2px rgba(15, 23, 42, 0.04);
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.panel-title { font-size: 0.95rem; font-weight: 800; color: #1e293b; display: flex; align-items: center; justify-content: space-between; }

.screenshots-reel {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 10px 4px;
  border-radius: 10px;
  background: #f8fafc;
  border: 1px dashed #cbd5e1;
  min-height: 110px;
  align-items: center;
}

.thumb-item {
  position: relative;
  flex-shrink: 0;
  width: 70px;
  height: 110px;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
  border: 2px solid transparent;
  transition: border-color 0.15s ease;
  background: #fff;
}
.thumb-item:hover {
  border-color: #2563eb;
  transform: none !important;
}
.thumb-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.thumb-badge {
  position: absolute;
  top: 4px;
  left: 4px;
  background: rgba(15, 23, 42, 0.75);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 4px;
}
.thumb-del {
  position: absolute;
  top: 4px;
  right: 4px;
  background: rgba(239, 68, 68, 0.85);
  color: #fff;
  border: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
}

.control-box-stitch {
  margin-top: 1rem;
  padding: 1rem;
  background: #f8fafc;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
}
.stitch-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.stitch-lbl {
  font-size: 0.88rem;
  font-weight: 700;
  color: #1e293b;
  white-space: nowrap;
}
.stitch-row-switch {
  display: flex !important;
  flex-direction: row !important;
  justify-content: space-between !important;
  align-items: center !important;
  gap: 12px !important;
  margin-top: 0.85rem !important;
}
.stitch-sub-tip {
  font-size: 0.75rem;
  color: #64748b;
  margin: 2px 0 0 0;
  line-height: 1.35;
}
.overlap-slider-block {
  margin-top: 0.85rem;
  display: block;
}

.pill-toggle-group {
  display: inline-flex;
  background: #e2e8f0;
  padding: 3px;
  border-radius: 8px;
  gap: 3px;
}
.pill-toggle-group .pill-btn {
  border: none;
  background: transparent;
  padding: 5px 12px;
  font-size: 0.8rem;
  font-weight: 700;
  color: #64748b;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.pill-toggle-group .pill-btn.active {
  background: #ffffff;
  color: #2563eb;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

/* Switch */
.switch-toggle {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
}
.switch-toggle input { opacity: 0; width: 0; height: 0; }
.switch-toggle .slider {
  position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0;
  background-color: #cbd5e1;
  transition: .25s;
  border-radius: 24px;
}
.switch-toggle .slider:before {
  position: absolute; content: "";
  height: 18px; width: 18px; left: 3px; bottom: 3px;
  background-color: white;
  transition: .25s;
  border-radius: 50%;
}
.switch-toggle input:checked + .slider { background-color: #2563eb; }
.switch-toggle input:checked + .slider:before { transform: translateX(20px); }

.btn-submit-stitch {
  width: 100%;
  margin-top: 1rem;
  padding: 12px;
  border: none;
  border-radius: 10px;
  background: #2563eb;
  color: #fff;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: none;
  transition: background-color 0.15s ease;
}
.btn-submit-stitch:hover {
  background: #1d4ed8;
  transform: none !important;
  box-shadow: none !important;
}

.long-preview-scroll {
  max-height: 540px;
  overflow-y: auto;
  border-radius: 12px;
  background: #0f172a08;
  border: 1px solid #e2e8f0;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 12px;
}
.long-preview-scroll img {
  max-width: 100%;
  height: auto;
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
  border-radius: 8px;
}
.preview-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  color: #94a3b8;
  font-size: 0.88rem;
}

.export-actions-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid #f1f5f9;
}
.btn-download-stitch {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #2563eb;
  color: #fff;
  padding: 8px 18px;
  border-radius: 8px;
  font-size: 0.88rem;
  font-weight: 700;
  border: none;
  cursor: pointer;
}
.btn-copy-stitch {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #f1f5f9;
  color: #1e293b;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 0.88rem;
  font-weight: 700;
  border: 1px solid #cbd5e1;
  cursor: pointer;
}
