/* ============================================
   NEXA PHOTOBOOTH — Kiosk App Styles
   Design: Terracotta / Warm Brown (DESIGN.md)
   ============================================ */

/* ── Screen System ── */
.screen {
  display: none;
  min-height: 100vh;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}
.screen.active { display: flex; }

/* ── Screen Header ── */
.screen-header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px 32px;
  background: var(--white);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}
.btn-back {
  width: 44px; height: 44px;
  border-radius: var(--r-pill);
  background: var(--surface);
  border: 1.5px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  color: var(--charcoal); cursor: pointer;
  transition: all var(--t); flex-shrink: 0;
}
.btn-back:hover { border-color: var(--brand); color: var(--brand); background: var(--brand-pale); }
.screen-header-info { flex: 1; }
.screen-title { font-size: 20px; font-weight: 800; color: var(--near-black); line-height: 1; }
.screen-sub   { font-size: 13px; color: var(--dusty); margin-top: 2px; }
.step-dots { display: flex; gap: 6px; align-items: center; }
.step-dots .dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--border); transition: all var(--t);
}
.step-dots .dot.active { background: var(--brand); width: 24px; border-radius: 4px; }
.step-dots .dot.done   { background: var(--brand); opacity: 0.5; }

/* ── Screen Footer ── */
.screen-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 32px;
  background: var(--white);
  border-top: 1px solid var(--border);
  position: sticky;
  bottom: 0;
  z-index: 100;
}

/* ============================================
   WELCOME SCREEN
   ============================================ */
#screen-welcome {
  background: var(--cocoa);
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 40px 24px;
  min-height: 100vh;
}

.welcome-bg {
  position: absolute; inset: 0; pointer-events: none; overflow: hidden;
}
.wb-shape {
  position: absolute; border-radius: 50%;
  background: rgba(206,123,103,0.12);
}
.wb-1 { width: 600px; height: 600px; top: -200px; right: -150px; }
.wb-2 { width: 400px; height: 400px; bottom: -100px; left: -100px; }
.wb-orb {
  position: absolute; border-radius: 50%;
  filter: blur(80px); opacity: 0.4;
}
.wb-orb-1 { width: 300px; height: 300px; background: var(--brand); top: 10%; right: 10%; }
.wb-orb-2 { width: 200px; height: 200px; background: var(--brown); bottom: 20%; left: 15%; }

.welcome-inner {
  position: relative; z-index: 1;
  display: flex; flex-direction: column;
  align-items: center; gap: 32px;
  max-width: 800px; width: 100%;
}

/* Logo */
.welcome-logo {
  display: flex; align-items: center; gap: 12px;
}
.logo-icon {
  width: 52px; height: 52px; border-radius: 14px;
  background: var(--brand);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 8px 24px rgba(206,123,103,0.5);
}
.logo-icon svg { width: 28px; height: 28px; }
.logo-name {
  font-size: 32px; font-weight: 800; color: var(--white);
  letter-spacing: -0.5px;
}

/* Headline */
.welcome-title {
  font-size: clamp(2.5rem, 6vw, 4rem);
  font-weight: 800; color: var(--white);
  line-height: 1.1; letter-spacing: -1px;
}
.welcome-title-accent {
  color: var(--brand);
  display: block;
}
.welcome-sub {
  font-size: 18px; color: rgba(255,255,255,0.6);
  line-height: 1.6; max-width: 480px;
  margin: -16px auto 0;
}

/* Photo strip */
.photo-strip {
  display: flex; gap: 12px; align-items: flex-end;
  overflow: hidden; max-width: 100%;
}
.strip-item {
  flex-shrink: 0;
  width: 120px;
  border-radius: 12px; overflow: hidden;
  position: relative;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
  transition: transform 0.3s ease;
}
.strip-item:hover { transform: translateY(-8px) scale(1.03); }
.strip-item img { width: 100%; height: 160px; object-fit: cover; display: block; }
.strip-item-center { transform: scale(1.1); z-index: 1; }
.strip-item-center img { height: 180px; }
.strip-label {
  position: absolute; bottom: 0; left: 0; right: 0;
  padding: 20px 8px 8px;
  background: linear-gradient(to top, rgba(42,21,12,0.85) 0%, transparent 100%);
  color: white; font-size: 11px; font-weight: 600; text-align: center;
}

/* Start button */
.btn-start {
  display: flex; align-items: center; justify-content: center; gap: 12px;
  height: 72px; padding: 0 48px; border-radius: var(--r-pill);
  background: var(--brand); color: var(--white);
  font-size: 20px; font-weight: 700; font-family: var(--font);
  border: none; cursor: pointer;
  box-shadow: 0 12px 40px rgba(206,123,103,0.55);
  transition: all var(--t);
  animation: pulse-btn 3s ease-in-out infinite;
}
.btn-start:hover {
  background: var(--brand-hover);
  box-shadow: 0 16px 48px rgba(206,123,103,0.65);
  transform: translateY(-3px);
  animation: none;
}
@keyframes pulse-btn {
  0%,100% { box-shadow: 0 12px 40px rgba(206,123,103,0.55); }
  50%      { box-shadow: 0 12px 60px rgba(206,123,103,0.75); }
}

.welcome-login-link {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 13px; color: rgba(255,255,255,0.35);
  text-decoration: none; transition: color var(--t);
  padding: 8px 16px; border-radius: var(--r-pill);
}
.welcome-login-link:hover { color: rgba(255,255,255,0.65); background: rgba(255,255,255,0.06); }

/* ============================================
   FRAME SELECTION SCREEN
   ============================================ */
.frame-content {
  flex: 1; overflow-y: auto; padding: 24px 32px;
  background: var(--surface);
}

.frame-tabs {
  display: flex; gap: 8px; flex-wrap: wrap;
  margin-bottom: 24px;
}
.frame-tab {
  padding: 8px 20px; border-radius: var(--r-pill);
  font-size: 14px; font-weight: 500; font-family: var(--font);
  color: var(--dusty); background: var(--white);
  border: 1.5px solid var(--border); cursor: pointer;
  transition: all var(--t);
}
.frame-tab:hover { border-color: var(--brand); color: var(--brand); }
.frame-tab.active { background: var(--brand); border-color: var(--brand); color: var(--white); }

.frame-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 16px;
}
.frame-card {
  background: var(--white);
  border: 2px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden; cursor: pointer;
  transition: all var(--t);
  position: relative;
}
.frame-card:hover { border-color: var(--brand); box-shadow: var(--shadow-sm); transform: translateY(-2px); }
.frame-card.selected { border-color: var(--brand); box-shadow: var(--shadow-md); }
.frame-card.selected::after {
  content: '✓';
  position: absolute; top: 10px; right: 10px;
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--brand); color: white;
  font-size: 14px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.frame-thumb {
  width: 100%; aspect-ratio: 3/4;
  object-fit: cover; display: block;
  background: var(--cream);
}
.frame-thumb-placeholder {
  width: 100%; aspect-ratio: 3/4;
  display: flex; align-items: center; justify-content: center;
  font-size: 32px;
}
.frame-info { padding: 10px 12px; }
.frame-name { font-size: 13px; font-weight: 700; color: var(--near-black); }
.frame-cat  { font-size: 11px; color: var(--dusty); margin-top: 2px; }
.frame-price { font-size: 13px; font-weight: 700; color: var(--brand); margin-top: 4px; }

.selected-frame-preview {
  display: flex; align-items: center; gap: 8px;
  font-size: 14px; color: var(--dusty);
}
.sfp-name { font-weight: 700; color: var(--near-black); }

/* ============================================
   CAMERA SCREEN
   ============================================ */
#screen-camera {
  background: #0A0808;
}
#screen-camera .screen-header {
  background: rgba(10,8,8,0.9);
  border-bottom-color: rgba(255,255,255,0.08);
}
#screen-camera .screen-title { color: white; }
#screen-camera .screen-sub   { color: rgba(255,255,255,0.5); }
#screen-camera .btn-back { background: rgba(255,255,255,0.08); border-color: rgba(255,255,255,0.15); color: white; }
#screen-camera .btn-back:hover { border-color: var(--brand); color: var(--brand); }
#screen-camera .step-dots .dot { background: rgba(255,255,255,0.2); }

.camera-area {
  flex: 1; display: flex; gap: 16px;
  padding: 16px 24px; align-items: center;
  justify-content: center;
}

.camera-viewport {
  position: relative;
  width: min(480px, 60vw);
  aspect-ratio: 4/3;
  border-radius: var(--r-xl);
  overflow: hidden;
  background: #111;
  box-shadow: 0 0 0 3px rgba(206,123,103,0.4), 0 24px 64px rgba(0,0,0,0.6);
}
#camera-video {
  width: 100%; height: 100%; object-fit: cover;
  transform: scaleX(-1); /* mirror */
}
#camera-canvas { display: none; }

.frame-overlay {
  position: absolute; inset: 0; pointer-events: none;
  background-size: cover; background-position: center;
  mix-blend-mode: multiply;
}

.countdown-overlay {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,0.4);
  opacity: 0; pointer-events: none;
  transition: opacity 0.2s;
}
.countdown-overlay.active { opacity: 1; }
.countdown-num {
  font-size: 120px; font-weight: 800; color: white;
  text-shadow: 0 4px 24px rgba(0,0,0,0.5);
  animation: countPop 0.8s ease;
}
@keyframes countPop {
  0%   { transform: scale(1.5); opacity: 0; }
  30%  { transform: scale(1.0); opacity: 1; }
  80%  { transform: scale(1.0); opacity: 1; }
  100% { transform: scale(0.8); opacity: 0; }
}

.flash-overlay {
  position: absolute; inset: 0;
  background: white; opacity: 0; pointer-events: none;
  transition: opacity 0.05s;
}
.flash-overlay.flash { opacity: 1; }

/* Taken photos strip */
.taken-strip {
  display: flex; flex-direction: column; gap: 10px;
  align-items: center;
}
.taken-slot {
  width: 80px; height: 100px;
  border-radius: var(--r-md);
  border: 2px dashed rgba(255,255,255,0.2);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden; position: relative;
  transition: all var(--t);
}
.taken-slot.empty span {
  font-size: 20px; font-weight: 700; color: rgba(255,255,255,0.2);
}
.taken-slot.filled { border-style: solid; border-color: var(--brand); }
.taken-slot img { width: 100%; height: 100%; object-fit: cover; }
.taken-slot.current { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(206,123,103,0.3); }

/* Camera controls */
.camera-controls {
  display: flex; align-items: center; justify-content: center;
  gap: 32px; padding: 16px 24px;
}
.btn-cam-action {
  width: 52px; height: 52px; border-radius: 50%;
  background: rgba(255,255,255,0.1);
  border: 1.5px solid rgba(255,255,255,0.2);
  display: flex; align-items: center; justify-content: center;
  color: white; cursor: pointer; transition: all var(--t);
}
.btn-cam-action:hover { background: rgba(255,255,255,0.2); border-color: var(--brand); }
.btn-cam-action:disabled { opacity: 0.3; cursor: not-allowed; }

.btn-shutter {
  width: 80px; height: 80px; border-radius: 50%;
  background: var(--brand);
  border: 4px solid rgba(255,255,255,0.3);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: all var(--t);
  box-shadow: 0 0 0 6px rgba(206,123,103,0.25);
}
.btn-shutter:hover { background: var(--brand-hover); transform: scale(1.05); }
.btn-shutter:active { transform: scale(0.95); }
.btn-shutter:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }
.shutter-inner {
  width: 56px; height: 56px; border-radius: 50%;
  background: white; opacity: 0.9;
}

.camera-footer {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 24px;
  background: rgba(10,8,8,0.9);
  border-top: 1px solid rgba(255,255,255,0.08);
}
.photo-count-info { font-size: 15px; color: rgba(255,255,255,0.6); }
.photo-count-info strong { color: white; }

/* ============================================
   PREVIEW & PAYMENT SCREEN
   ============================================ */
.preview-layout {
  flex: 1; display: grid;
  grid-template-columns: 1fr 420px;
  gap: 0; overflow: hidden;
}

.preview-left {
  background: var(--surface);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 32px; gap: 20px;
  border-right: 1px solid var(--border);
}

.preview-strip-container {
  background: var(--white);
  border-radius: var(--r-xl);
  padding: 16px;
  box-shadow: var(--shadow-md);
}
.preview-strip {
  display: flex; flex-direction: column; gap: 4px;
  width: 200px;
}
.preview-strip-photo {
  width: 200px; height: 150px;
  object-fit: cover; border-radius: 6px;
  display: block;
}

.preview-actions { display: flex; gap: 12px; }

.preview-right {
  background: var(--white);
  overflow-y: auto; padding: 32px;
  display: flex; flex-direction: column;
}

.payment-card { flex: 1; display: flex; flex-direction: column; gap: 24px; }
.payment-title { font-size: 22px; font-weight: 800; color: var(--near-black); }

.order-summary {
  background: var(--surface);
  border-radius: var(--r-lg);
  padding: 20px; border: 1px solid var(--border);
}
.order-row {
  display: flex; justify-content: space-between;
  font-size: 15px; color: var(--charcoal); padding: 6px 0;
}
.order-row span:last-child { font-weight: 600; color: var(--near-black); }
.order-divider { height: 1px; background: var(--border); margin: 8px 0; }
.order-total { font-size: 18px; font-weight: 800; }
.order-total span:last-child { color: var(--brand); font-size: 22px; }

.payment-methods-label { font-size: 14px; font-weight: 600; color: var(--dark-gray); margin-bottom: 12px; }
.payment-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 10px; }
.pay-method {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 16px 8px; border-radius: var(--r-md);
  border: 2px solid var(--border); background: var(--white);
  cursor: pointer; transition: all var(--t); font-family: var(--font);
  font-size: 13px; font-weight: 600; color: var(--charcoal);
}
.pay-method:hover { border-color: var(--brand); color: var(--brand); }
.pay-method.active { border-color: var(--brand); background: var(--brand-pale); color: var(--brand); }
.pay-icon { color: inherit; }

.qris-section {
  display: flex; flex-direction: column; align-items: center; gap: 12px;
  padding: 20px; background: var(--cream);
  border-radius: var(--r-lg); border: 1px solid var(--border);
}
.qris-box {
  background: white; padding: 12px; border-radius: var(--r-md);
  box-shadow: var(--shadow-sm);
}
.qris-hint { font-size: 13px; color: var(--dusty); text-align: center; line-height: 1.5; }

/* ============================================
   PRINT SCREEN
   ============================================ */
#screen-print {
  background: var(--surface);
  align-items: center; justify-content: center;
}
.print-center {
  display: flex; flex-direction: column; align-items: center;
  gap: 20px; text-align: center; max-width: 400px; padding: 40px 24px;
}
.print-animation { position: relative; margin-bottom: 8px; }
.print-icon-wrap {
  width: 96px; height: 96px; border-radius: 50%;
  background: var(--brand);
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 16px;
  box-shadow: var(--shadow-md);
  animation: printPulse 1.5s ease-in-out infinite;
}
@keyframes printPulse {
  0%,100% { box-shadow: var(--shadow-md); }
  50%      { box-shadow: 0 0 0 16px rgba(206,123,103,0.15), var(--shadow-md); }
}
.print-paper {
  width: 120px; height: 0; background: white;
  border-radius: 0 0 4px 4px;
  margin: 0 auto;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  overflow: hidden;
  animation: paperOut 3s ease-in-out 0.5s forwards;
}
@keyframes paperOut { to { height: 160px; } }
.print-title { font-size: 28px; font-weight: 800; color: var(--near-black); }
.print-sub   { font-size: 16px; color: var(--dusty); line-height: 1.6; }
.print-progress {
  width: 100%; height: 8px; background: var(--border);
  border-radius: var(--r-pill); overflow: hidden;
}
.print-progress-bar {
  height: 100%; background: var(--brand);
  border-radius: var(--r-pill); width: 0%;
  transition: width 0.3s ease;
}
.print-status { font-size: 14px; color: var(--dusty); }

/* ============================================
   DONE SCREEN
   ============================================ */
#screen-done {
  background: var(--surface);
  align-items: center; justify-content: center;
}
.done-center {
  display: flex; flex-direction: column; align-items: center;
  gap: 20px; text-align: center; max-width: 560px; padding: 40px 24px;
}
.done-icon {
  width: 88px; height: 88px; border-radius: 50%;
  background: linear-gradient(135deg, var(--brand), var(--brown));
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow-lg);
  animation: popIn 0.5s cubic-bezier(0.34,1.56,0.64,1);
}
@keyframes popIn { from { transform: scale(0); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.done-title { font-size: 36px; font-weight: 800; color: var(--near-black); }
.done-sub   { font-size: 17px; color: var(--dusty); line-height: 1.65; }

.done-strip-preview {
  display: flex; gap: 8px; justify-content: center;
  background: var(--white); padding: 16px; border-radius: var(--r-xl);
  box-shadow: var(--shadow-sm); border: 1px solid var(--border);
}
.done-strip-preview img {
  width: 80px; height: 100px; object-fit: cover;
  border-radius: var(--r-sm);
}

.done-share-label { font-size: 14px; font-weight: 600; color: var(--dark-gray); margin-bottom: 12px; }
.done-share-btns  { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.btn-share {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 20px; border-radius: var(--r-pill);
  background: var(--white); border: 1.5px solid var(--border);
  font-size: 14px; font-weight: 600; font-family: var(--font);
  color: var(--charcoal); cursor: pointer; transition: all var(--t);
}
.btn-share:hover { border-color: var(--brand); color: var(--brand); background: var(--brand-pale); }

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 1023px) {
  .preview-layout { grid-template-columns: 1fr; }
  .preview-left { border-right: none; border-bottom: 1px solid var(--border); padding: 24px; }
  .preview-right { padding: 24px; }
  .camera-viewport { width: min(400px, 80vw); }
  .taken-strip { flex-direction: row; }
  .taken-slot { width: 70px; height: 88px; }
  .camera-area { flex-direction: column; }
}

@media (max-width: 767px) {
  .screen-header { padding: 16px 20px; }
  .screen-footer { padding: 16px 20px; }
  .frame-content { padding: 16px 20px; }
  .frame-grid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 12px; }
  .welcome-title { font-size: 2.2rem; }
  .btn-start { height: 60px; font-size: 17px; padding: 0 32px; }
  .photo-strip { gap: 8px; }
  .strip-item { width: 90px; }
  .strip-item img { height: 120px; }
  .strip-item-center img { height: 140px; }
  .camera-viewport { width: 90vw; }
  .taken-strip { flex-direction: row; }
  .taken-slot { width: 60px; height: 76px; }
  .payment-grid { grid-template-columns: repeat(3,1fr); }
  .done-title { font-size: 28px; }
  .screen-title { font-size: 17px; }
}

@media (max-width: 480px) {
  .welcome-title { font-size: 1.9rem; }
  .photo-strip { display: none; }
  .frame-grid { grid-template-columns: repeat(2,1fr); }
  .preview-strip { width: 160px; }
  .preview-strip-photo { width: 160px; height: 120px; }
}

/* ============================================
   FRAME SELECTION — Fremio-style UI
   ============================================ */

/* ── Top bar ── */
.fs-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 28px 12px;
  background: var(--white);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.fs-topbar-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.fs-step-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--dusty);
  letter-spacing: 0.3px;
}

/* ── Layout type tabs (Story / 4R / 2R) ── */
.fs-layout-tabs {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 16px 28px 0;
  background: var(--white);
  flex-shrink: 0;
}
.fs-layout-tab {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 22px;
  border-radius: var(--r-pill);
  font-size: 14px;
  font-weight: 600;
  font-family: var(--font);
  color: var(--dusty);
  background: var(--surface);
  border: 1.5px solid var(--border);
  cursor: pointer;
  transition: all var(--t);
  white-space: nowrap;
}
.fs-layout-tab:hover {
  border-color: var(--brand);
  color: var(--brand);
  background: var(--brand-pale);
}
.fs-layout-tab.active {
  background: var(--brand);
  border-color: var(--brand);
  color: var(--white);
  box-shadow: var(--shadow-sm);
}
.tab-badge-new {
  display: inline-flex;
  align-items: center;
  padding: 1px 7px;
  border-radius: var(--r-pill);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.3px;
  background: var(--cocoa);
  color: var(--white);
  line-height: 1.6;
}
.fs-layout-tab.active .tab-badge-new {
  background: rgba(255,255,255,0.25);
  color: var(--white);
}

/* ── Layout subtitle ── */
.fs-layout-subtitle {
  text-align: center;
  font-size: 17px;
  font-weight: 700;
  color: var(--near-black);
  padding: 14px 28px 0;
  background: var(--white);
  flex-shrink: 0;
  line-height: 1.4;
}

/* ── Scrollable body ── */
.fs-body {
  flex: 1;
  overflow-y: auto;
  background: #FAF6F3;
  padding: 24px 28px 120px; /* bottom padding for fixed footer */
  -webkit-overflow-scrolling: touch;
}

/* ── Series header ── */
.fs-series-header {
  margin-bottom: 18px;
}
.fs-series-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--near-black);
}
.fs-series-title span {
  font-weight: 500;
  color: var(--dusty);
}

/* ── Frame grid ── */
.fs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 20px;
}

/* ── Frame card ── */
.fs-card {
  background: var(--white);
  border-radius: var(--r-lg);
  border: 2px solid transparent;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.25s ease;
  box-shadow: 0 2px 8px rgba(42,21,12,0.06);
  position: relative;
}
.fs-card:hover {
  border-color: var(--brand);
  box-shadow: 0 6px 20px rgba(206,123,103,0.2);
  transform: translateY(-3px);
}
.fs-card.selected {
  border-color: var(--brand);
  box-shadow: 0 8px 24px rgba(206,123,103,0.3);
  transform: translateY(-3px);
}

/* Selected checkmark */
.fs-card-check {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--brand);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: scale(0.5);
  transition: all 0.2s ease;
  z-index: 2;
  box-shadow: 0 2px 8px rgba(206,123,103,0.4);
}
.fs-card.selected .fs-card-check {
  opacity: 1;
  transform: scale(1);
}
.fs-card-check svg {
  width: 13px;
  height: 13px;
  stroke: white;
  stroke-width: 2.5;
}

/* ── Frame preview (the actual frame layout visual) ── */
.fs-card-preview {
  width: 100%;
  aspect-ratio: 9/16; /* Story Instagram default */
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  position: relative;
  overflow: hidden;
}
.fs-card-preview.layout-4r {
  aspect-ratio: 3/4;
}
.fs-card-preview.layout-2r {
  aspect-ratio: 2/3;
}

/* Photo slots inside frame preview */
.fs-slot-grid {
  flex: 1;
  display: grid;
  gap: 4px;
  width: 100%;
  height: 100%;
}
/* 1x4 vertical strip */
.fs-slot-grid.grid-1x4 {
  grid-template-columns: 1fr;
  grid-template-rows: repeat(4, 1fr);
}
/* 2x2 grid */
.fs-slot-grid.grid-2x2 {
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
}
/* 2x3 grid */
.fs-slot-grid.grid-2x3 {
  grid-template-columns: 1fr 1fr;
  grid-template-rows: repeat(3, 1fr);
}
/* 1x2 strip */
.fs-slot-grid.grid-1x2 {
  grid-template-columns: 1fr;
  grid-template-rows: 1fr 1fr;
}
/* 3x2 */
.fs-slot-grid.grid-3x2 {
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: 1fr 1fr;
}

.fs-slot {
  background: rgba(200,190,185,0.35);
  border-radius: 3px;
  border: 1px dashed rgba(150,130,120,0.3);
  min-height: 0;
}

/* Frame border decoration area */
.fs-frame-deco {
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: calc(var(--r-lg) - 2px);
}

/* ── Frame info ── */
.fs-card-info {
  padding: 10px 12px 12px;
  border-top: 1px solid rgba(217,185,171,0.25);
}
.fs-card-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--near-black);
  margin-bottom: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.fs-card-desc {
  font-size: 11px;
  color: var(--dusty);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ── Bottom bar ── */
.fs-bottombar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 28px;
  background: var(--white);
  border-top: 1px solid var(--border);
  box-shadow: 0 -4px 20px rgba(42,21,12,0.08);
  z-index: 200;
}
.fs-selected-info {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 0;
}
.fs-selected-thumb {
  width: 44px;
  height: 56px;
  border-radius: 8px;
  background: var(--cream);
  border: 1.5px solid var(--border);
  flex-shrink: 0;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}
.fs-selected-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--near-black);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.fs-selected-price {
  font-size: 13px;
  color: var(--brand);
  font-weight: 600;
  margin-top: 2px;
}

/* ── Responsive ── */
@media (max-width: 1023px) {
  .fs-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 16px;
  }
  .fs-body { padding: 20px 20px 120px; }
  .fs-topbar, .fs-layout-tabs, .fs-layout-subtitle { padding-left: 20px; padding-right: 20px; }
  .fs-bottombar { padding: 14px 20px; }
}

@media (max-width: 767px) {
  .fs-layout-tabs { gap: 6px; padding: 12px 16px 0; overflow-x: auto; justify-content: flex-start; }
  .fs-layout-tab  { font-size: 13px; padding: 8px 16px; flex-shrink: 0; }
  .fs-layout-subtitle { font-size: 15px; padding: 12px 16px 0; }
  .fs-body { padding: 16px 16px 110px; }
  .fs-grid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 12px; }
  .fs-topbar { padding: 14px 16px 10px; }
  .fs-bottombar { padding: 12px 16px; }
  .fs-selected-thumb { width: 36px; height: 46px; }
  .fs-selected-name { font-size: 13px; }
}

@media (max-width: 480px) {
  .fs-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .fs-layout-subtitle { font-size: 14px; }
}
