/* ========================================
   SOCIETY ARTS - STORY BUILDER
   Layout: Studio (Two-Column Decision UI)
   Version: 1.0

   Brand Colors:
   - Brown: #3E2318
   - Beige: #EAE4DAf
   - Orange/Red: #C73314
   - Cream: #FAF8F5
   - Surface: #F2EDE6

   REQUIRES:
   - /css/shared/shared-tooltips.css
   - /css/layout-centered.css  (reuses chat-message, chat-bubble, suggestion-btn, etc.)
   ======================================== */

/* ============================================
   BASE WRAPPER
   ============================================ */

.layout-studio-wrapper {
  height: calc(100vh - var(--logo-bar-height, 60px));
  display: flex;
  background: #EAE4DA;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23n)' opacity='0.03'/%3E%3C/svg%3E");
  overflow: hidden;
  box-sizing: border-box;
  padding: 22px 26px 22px 22px;
  gap: 0;
  position: relative;
}

.layout-studio-wrapper * {
  box-sizing: border-box;
}

/* ============================================
   LEFT PANEL — Chat (dark)
   ============================================ */

/* Left column — width driven by JS drag state via inline style */
.ls-left {
  width: 380px;
  min-width: 260px;
  max-width: 70%;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  height: calc(100vh - var(--logo-bar-height, 60px) - 44px);
  min-height: 0;
  transition: width 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

/* --- Folder Tab Row --- */

.ls-tab-row {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  position: relative;
  z-index: 2;
  flex-shrink: 0;
}

.ls-tab {
  flex: 1;
  position: relative;
  bottom: -1px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  padding: 0 18px;
  height: 54px;
  border-radius: 10px 10px 0 0;
  border: 1px solid transparent;
  cursor: pointer;
  user-select: none;
  background: none;
  overflow: hidden;
  min-width: 0;
  transition: background 0.2s, color 0.2s, border-color 0.2s, box-shadow 0.2s;
  font-family: 'Familjen Grotesk', -apple-system, sans-serif;
  container-type: inline-size;
}

/* Inactive tab */
.ls-tab:not(.active) {
  background: #DDD5C8;
  border-color: rgba(62, 35, 24, 0.22);
  border-bottom-color: rgba(62, 35, 24, 0.22);
  color: rgba(62, 35, 24, 0.48);
  height: 50px;
}

.ls-tab:not(.active):hover {
  background: #EAE4DA;
  color: #3E2318;
}

/* Active tab — bg matches panel body brown */
.ls-tab.active {
  background: #3E2318;
  border-color: #3E2318;
  border-bottom-color: #3E2318;
  color: white;
  height: 54px;
  box-shadow: 0 -2px 12px rgba(62, 35, 24, 0.18), 2px 0 8px rgba(62, 35, 24, 0.06);
  z-index: 3;
}

.ls-tab-title {
  font-family: 'Domine', Georgia, serif;
  font-size: 14px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 7px;
  line-height: 1;
  color: inherit;
  text-align: left;
}

.ls-tab-subtitle {
  font-size: 11px;
  margin-top: 4px;
  font-weight: 400;
  opacity: 0.65;
  line-height: 1.35;
  color: inherit;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.ls-tab.active .ls-tab-subtitle {
  opacity: 0.7;
  color: rgba(255, 255, 255, 0.75);
}

@container (max-width: 130px) {
  .ls-tab-subtitle {
    display: none;
  }
  .ls-tab-title svg,
  .ls-tab-title .ls-tab-icon {
    display: none;
  }
}

/* Tab badge (image count) */
.ls-tab-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 1px 7px;
  border-radius: 20px;
  font-family: 'Familjen Grotesk', -apple-system, sans-serif;
  font-size: 10px;
  font-weight: 700;
  min-width: 20px;
  line-height: 16px;
  background: rgba(255, 255, 255, 0.25);
  color: white;
}

.ls-tab:not(.active) .ls-tab-badge {
  background: rgba(62, 35, 24, 0.15);
  color: rgba(62, 35, 24, 0.55);
}

/* --- Panel Body — brown container below tabs --- */

.ls-panel-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: #3E2318;
  border: 1px solid #3E2318;
  border-radius: 0 0 12px 12px;
  overflow: hidden;
  position: relative;
  z-index: 1;
  box-shadow: 0 4px 24px rgba(62, 35, 24, 0.13), 0 1px 4px rgba(62, 35, 24, 0.07);
}

/* Tab divider no longer used */
.ls-tab-divider { display: none; }

/* --- Tab Content Panels --- */

.ls-tab-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

/* --- Story Builder tab: messages + input --- */

.ls-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px 16px 8px;
  display: flex;
  flex-direction: column;
  gap: 0;
  scroll-behavior: smooth;
}

.ls-messages::-webkit-scrollbar {
  width: 4px;
}

.ls-messages::-webkit-scrollbar-track {
  background: transparent;
}

.ls-messages::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 2px;
}

/* Override chat bubble colors for dark panel */
.ls-left .chat-message.assistant .chat-bubble {
  background: transparent;
  color: rgba(255, 255, 255, 0.9);
  border: none;
}

.ls-left .chat-message.user .chat-bubble {
  background: rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.95);
  border-radius: 20px 20px 4px 20px;
  padding: 6px 14px;
  border: none;
  font-size: 14px;
  line-height: 1.4;
}

.ls-left .chat-message {
  margin-top: 6px;
}

/* Sadie avatar — red circle with "S" */
.ls-left .chat-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #C73314;
  color: white;
  font-size: 14px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  letter-spacing: 0.02em;
}

/* User avatar — semi-transparent white circle with initials */
.ls-left .chat-avatar.user-avatar {
  background: rgba(255, 255, 255, 0.18);
  font-size: 10px;
}

.ls-left .chat-text {
  color: inherit;
}

.ls-left .suggestion-hint {
  color: rgba(255, 255, 255, 0.5);
}

.ls-left .suggestion-btn {
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.85);
  border-color: rgba(255, 255, 255, 0.12);
  border-radius: 24px;
  padding: 10px 18px;
}

.ls-left .suggestion-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.3);
}

.ls-left .suggestion-btn.suggestion-action {
  background: rgba(199, 51, 20, 0.5);
  border-color: rgba(199, 51, 20, 0.6);
  color: #fff;
}

.ls-left .suggestion-btn.suggestion-action:hover {
  background: rgba(199, 51, 20, 0.7);
}

.ls-left .typing-indicator span {
  background: rgba(255, 255, 255, 0.5);
}

/* --- Chat input area --- */

.ls-input {
  flex-shrink: 0;
  padding: 8px 12px 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

/* Override chat input wrapper for dark panel */
.ls-left .chat-input-wrapper {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.15);
}

.ls-left .chat-input-wrapper:focus-within {
  border-color: rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.13);
}

.ls-left .chat-input {
  background: transparent;
  color: rgba(255, 255, 255, 0.92);
}

.ls-left .chat-input::placeholder {
  color: rgba(255, 255, 255, 0.35);
}

.ls-left .chat-input-action {
  color: rgba(255, 255, 255, 0.5);
}

.ls-left .chat-input-action:hover {
  color: rgba(255, 255, 255, 0.85);
  background: rgba(255, 255, 255, 0.1);
}

.ls-left .chat-input-action.active,
.ls-left .chat-input-action.mic-btn.active {
  color: #C73314;
  background: rgba(199, 51, 20, 0.15);
}

.ls-left .chat-send {
  background: rgba(255, 255, 255, 0.15);
  color: rgba(255, 255, 255, 0.4);
}

.ls-left .chat-send.has-text {
  background: #C73314;
  color: #fff;
}

.ls-left .chat-send.has-text:hover {
  background: #a82b10;
}

/* --- My Creations tab --- */

.ls-creations {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

/* Status bar at top of creations view */
.ls-creations-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  flex-shrink: 0;
  background: rgba(0, 0, 0, 0.12);
  min-height: 38px;
}

.ls-creations-bar-label {
  font-size: 11.5px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.55);
  letter-spacing: 0.01em;
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ls-creations-bar-count {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.38);
  font-weight: 500;
  flex-shrink: 0;
}

/* Expand button in bar */
.ls-expand-btn {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  color: rgba(255, 255, 255, 0.6);
  transition: background 0.15s;
}

.ls-expand-btn:hover {
  background: rgba(255, 255, 255, 0.16);
}

.ls-expand-btn svg {
  width: 13px;
  height: 13px;
}

/* Expanded state — left fills viewport, right/divider hidden */
.ls-wrapper-expanded .ls-right {
  opacity: 0;
  pointer-events: none;
  transform: translateX(20px);
  overflow: hidden;
  flex: 0;
  min-width: 0;
  transition: opacity 0.25s ease, transform 0.3s ease, flex 0.35s ease;
}

.ls-wrapper-expanded .ls-divider {
  opacity: 0;
  pointer-events: none;
  width: 0;
}

.ls-wrapper-expanded .ls-left {
  width: 100% !important;
  max-width: 100%;
}

/* Expanded grid gets more columns */
.ls-wrapper-expanded .ls-creations-grid {
  grid-template-columns: repeat(5, 1fr);
}

/* Scrollable image area */
.ls-creations-scroll {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 12px;
  min-height: 0;
}

.ls-creations-scroll::-webkit-scrollbar {
  width: 4px;
}

.ls-creations-scroll::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 2px;
}

.ls-creations-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
}

.ls-creation-thumb {
  aspect-ratio: 1;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
  cursor: pointer;
  transition: opacity 0.15s;
  position: relative;
}

.ls-creation-thumb:hover {
  opacity: 1;
}

.ls-creation-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* ── Heart (Favorite) Button ── */
.ls-thumb-heart {
  position: absolute;
  top: 6px;
  left: 6px;
  width: 26px;
  height: 26px;
  border: none;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: rgba(255, 255, 255, 0.75);
  opacity: 0;
  transition: opacity 0.15s, background 0.15s, color 0.15s;
  z-index: 2;
}

.ls-creation-thumb:hover .ls-thumb-heart,
.ls-thumb-heart.active {
  opacity: 1;
}

.ls-thumb-heart.active {
  color: #f87171;
  background: rgba(0, 0, 0, 0.55);
}

.ls-thumb-heart:hover {
  background: rgba(0, 0, 0, 0.65);
  color: #f87171;
}

.ls-thumb-heart svg {
  width: 13px;
  height: 13px;
}

/* ── Bottom Overlay (name + kebab) ── */
.ls-thumb-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.72));
  padding: 20px 7px 7px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 4px;
  opacity: 0;
  transition: opacity 0.18s ease;
  pointer-events: none;
}

.ls-creation-thumb:hover .ls-thumb-overlay {
  opacity: 1;
  pointer-events: auto;
}

.ls-thumb-name {
  color: white;
  font-size: 11px;
  font-weight: 500;
  font-family: 'Familjen Grotesk', -apple-system, sans-serif;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
  min-width: 0;
  line-height: 1.3;
}

/* ── Kebab Trigger ── */
.ls-thumb-kebab {
  width: 22px;
  height: 22px;
  border: none;
  background: rgba(255, 255, 255, 0.18);
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  flex-shrink: 0;
  transition: background 0.15s;
}

.ls-thumb-kebab:hover {
  background: rgba(255, 255, 255, 0.32);
}

.ls-thumb-kebab svg {
  width: 12px;
  height: 12px;
}

/* ── Portal Kebab Menu ── */
.ls-image-kebab-menu {
  background: white;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2), 0 0 0 1px rgba(0, 0, 0, 0.06);
  min-width: 160px;
  overflow: hidden;
  animation: lsMenuIn 0.12s ease;
}

@keyframes lsMenuIn {
  from { opacity: 0; transform: translate(-100%, -95%); }
  to   { opacity: 1; transform: translate(-100%, -100%); }
}

.ls-kebab-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  font-family: 'Familjen Grotesk', -apple-system, sans-serif;
  font-size: 13px;
  color: #1a1a1a;
  cursor: pointer;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  transition: background 0.1s;
}

.ls-kebab-menu-item:hover {
  background: #f5f5f5;
}

.ls-kebab-menu-item svg {
  width: 15px;
  height: 15px;
  opacity: 0.65;
  flex-shrink: 0;
}

.ls-kebab-menu-divider {
  height: 1px;
  background: #e8e8e8;
  margin: 3px 0;
}

.ls-kebab-menu-item.delete {
  color: #dc2626;
}

.ls-kebab-menu-item.delete:hover {
  background: #fef2f2;
}

.ls-creations-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 32px 28px;
  text-align: center;
}

.ls-creations-empty svg {
  width: 44px;
  height: 44px;
  stroke: rgba(255, 255, 255, 0.15);
  fill: none;
  stroke-width: 1.5;
}

.ls-creations-empty p {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.28);
  line-height: 1.65;
  max-width: 210px;
  font-family: 'Familjen Grotesk', -apple-system, sans-serif;
}

/* ============================================
   CENTER DRAG DIVIDER
   ============================================ */

.ls-divider {
  width: 18px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: col-resize;
  position: relative;
  z-index: 10;
  user-select: none;
  transition: opacity 0.25s ease, width 0.25s ease;
}

/* Thin vertical line */
.ls-divider::before {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 2px;
  background: rgba(62, 35, 24, 0.18);
  border-radius: 2px;
  transition: background 0.15s, width 0.15s;
}

.ls-divider:hover::before,
.ls-divider.dragging::before {
  background: #C73314;
  width: 3px;
}

/* Grab dots pill */
.ls-divider-dots {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 6px 5px;
  background: #DDD5C8;
  border: 1px solid rgba(62, 35, 24, 0.22);
  border-radius: 6px;
  transition: background 0.15s, border-color 0.15s, box-shadow 0.15s;
}

.ls-divider:hover .ls-divider-dots,
.ls-divider.dragging .ls-divider-dots {
  background: white;
  border-color: #C73314;
  box-shadow: 0 2px 10px rgba(199, 51, 20, 0.18);
}

.ls-divider-dot {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: rgba(62, 35, 24, 0.32);
  transition: background 0.15s;
}

.ls-divider:hover .ls-divider-dot,
.ls-divider.dragging .ls-divider-dot {
  background: #C73314;
}

/* ============================================
   RIGHT PANEL — Decision Cards
   ============================================ */

.ls-right {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow-y: auto;
  padding-right: 2px;
}

.ls-right::-webkit-scrollbar {
  width: 4px;
}

.ls-right::-webkit-scrollbar-thumb {
  background: rgba(62, 35, 24, 0.2);
  border-radius: 2px;
}

/* --- Card Base --- */

.ls-card {
  background: #fff;
  border-radius: 14px;
  overflow: visible;
  box-shadow: 0 1px 4px rgba(62, 35, 24, 0.08), 0 0 0 1px rgba(62, 35, 24, 0.04);
  flex-shrink: 0;
}

.ls-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px 12px;
  border-bottom: 1px solid #F0EBE4;
}

.ls-card-title {
  font-family: 'Domine', Georgia, serif;
  font-size: 16px;
  font-weight: 600;
  color: #3E2318;
  margin: 0;
}

.ls-card-subtitle {
  font-family: 'Familjen Grotesk', -apple-system, sans-serif;
  font-size: 12px;
  color: #9E8776;
  margin-top: 2px;
}

.ls-card-body {
  padding: 16px 18px;
}

/* ============================================
   CARD 1 — My Art Story
   ============================================ */

.ls-story-body {
  padding: 14px 18px 16px;
  position: relative;
}

/* Read view — spark icon + story text side by side */
.ls-story-read-view {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 14px 18px 0 18px;
}

.ls-story-read-clickable {
  cursor: pointer;
  border-radius: 10px;
  transition: background 0.15s;
  padding-bottom: 14px;
}

.ls-story-read-clickable:hover {
  background: #F5F0EA;
}

.ls-story-read-clickable:hover .ls-story-spark {
  background: #DDD5C8;
}

.ls-story-spark {
  width: 26px;
  height: 26px;
  background: #EAE4DA;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 2px;
  font-size: 12px;
  transition: background 0.2s;
}

.ls-story-read-pad {
  height: 0;
}

.ls-story-text {
  font-family: 'Familjen Grotesk', -apple-system, sans-serif;
  font-size: 14px;
  line-height: 1.6;
  color: #3E2318;
  white-space: pre-wrap;
  word-break: break-word;
}

.ls-story-empty {
  font-size: 14px;
  color: #B8A99A;
  font-style: italic;
  line-height: 1.5;
}

.ls-story-textarea {
  width: 100%;
  min-height: 80px;
  border: 1px solid #D4C5B5;
  border-radius: 8px;
  padding: 10px 12px;
  font-family: 'Familjen Grotesk', -apple-system, sans-serif;
  font-size: 14px;
  line-height: 1.6;
  color: #3E2318;
  resize: none;
  background: #FAFAF8;
  outline: none;
  transition: border-color 0.15s;
}

.ls-story-textarea:focus {
  border-color: #3E2318;
  background: #fff;
}

/* Edit footer — tip text + action buttons */
.ls-story-edit-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 18px 14px 18px;
  gap: 10px;
}

.ls-story-edit-hint {
  font-size: 11px;
  color: rgba(62, 35, 24, 0.32);
  line-height: 1.4;
  flex: 1;
  font-family: 'Familjen Grotesk', -apple-system, sans-serif;
}

.ls-story-edit-hint strong {
  color: rgba(62, 35, 24, 0.48);
  font-weight: 600;
}

.ls-story-edit-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-shrink: 0;
}

.ls-story-btn {
  padding: 6px 14px;
  border-radius: 6px;
  font-family: 'Familjen Grotesk', -apple-system, sans-serif;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.15s;
}

.ls-story-btn.save {
  background: #3E2318;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 2px 8px rgba(62, 35, 24, 0.22);
  font-weight: 700;
}

.ls-story-btn.save:hover {
  background: #2a1810;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(62, 35, 24, 0.3);
}

.ls-story-btn.save svg {
  width: 11px;
  height: 11px;
  stroke: white;
  fill: none;
  stroke-width: 2.8;
}

.ls-story-btn.cancel {
  background: transparent;
  color: #9E8776;
  border-color: #D4C5B5;
}

.ls-story-btn.cancel:hover {
  background: #F5F0EA;
  color: #3E2318;
}

/* Edit button in card header */
.ls-edit-btn {
  width: 30px;
  height: 30px;
  border-radius: 6px;
  border: 1px solid #E8DDD4;
  background: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #9E8776;
  transition: all 0.15s;
  flex-shrink: 0;
}

.ls-edit-btn:hover {
  background: #F5F0EA;
  color: #3E2318;
  border-color: #C4B5A8;
}

.ls-edit-btn.editing {
  background: #3E2318;
  color: #fff;
  border-color: #3E2318;
}

.ls-edit-btn.saved {
  background: #2E7D32;
  color: #fff;
  border-color: #2E7D32;
}

.ls-edit-btn svg {
  width: 14px;
  height: 14px;
}

/* ============================================
   CARD 2 — Pick My Art Style
   ============================================ */

.ls-style-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.ls-style-slot {
  display: flex;
  flex-direction: column;
  gap: 6px;
  cursor: pointer;
}

.ls-style-slot-placeholder {
  aspect-ratio: 1;
  width: 100%;
  border-radius: 10px;
  background: #F2EDE6;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow:
    0 1px 3px rgba(62, 35, 24, 0.06),
    inset 0 1px 0 rgba(255, 255, 255, 0.6);
  transition: box-shadow 0.15s, background 0.15s;
  overflow: hidden;
}

.ls-style-slot:hover .ls-style-slot-placeholder {
  background: #EDE5DB;
  box-shadow:
    0 2px 6px rgba(62, 35, 24, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

.ls-slot-grid-svg {
  width: 72%;
  height: 72%;
  max-width: 120px;
  max-height: 120px;
  color: rgba(62, 35, 24, 0.18);
  transition: color 0.15s;
}

.ls-style-slot:hover .ls-slot-grid-svg {
  color: rgba(62, 35, 24, 0.38);
}

/* Filled slot */
.ls-style-slot-image {
  aspect-ratio: 1;
  width: 100%;
  border-radius: 10px;
  overflow: hidden;
  position: relative;
  box-shadow:
    0 2px 6px rgba(62, 35, 24, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.ls-style-slot-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.ls-style-remove {
  position: absolute;
  top: 5px;
  right: 5px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.55);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  opacity: 0;
  transition: opacity 0.15s;
}

.ls-style-slot:hover .ls-style-remove {
  opacity: 1;
}

.ls-style-slot-label {
  font-family: 'Familjen Grotesk', -apple-system, sans-serif;
  font-size: 11.5px;
  font-weight: 500;
  color: #9E8776;
  text-align: center;
  min-height: 32px;
  line-height: 1.35;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 2px;
}

.ls-style-slot-label a {
  color: #3E2318;
  text-decoration: none;
}

.ls-style-slot-label a:hover {
  text-decoration: underline;
  color: #C73314;
}

/* ============================================
   CARD 3 — Choose My Canvas
   ============================================ */

.ls-canvas-body {
  padding: 11px 16px 12px;
  display: flex;
  align-items: center;
  gap: 6px;
  overflow: visible;
}

.ls-canvas-strip {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1;
  flex-wrap: wrap;
  min-width: 0;
  overflow: visible;
}

/* Thin vertical separator between groups */
.ls-canvas-sep {
  width: 1px;
  height: 28px;
  background: rgba(62, 35, 24, 0.13);
  flex-shrink: 0;
  margin: 0 2px;
  border-radius: 1px;
}

/* Individual shape chip */
.ls-canvas-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 8px;
  border: 1.5px solid rgba(62, 35, 24, 0.13);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
  white-space: nowrap;
  flex-shrink: 0;
  position: relative;
  background: transparent;
}

.ls-canvas-chip:hover {
  border-color: rgba(62, 35, 24, 0.22);
  background: #EAE4DA;
}

.ls-canvas-chip.selected {
  border-color: #C73314;
  background: rgba(199, 51, 20, 0.05);
  box-shadow: 0 0 0 2px rgba(199, 51, 20, 0.1);
}

/* Proportional shape rectangle inside chip */
.ls-chip-shape {
  background: #DDD5C8;
  border-radius: 2px;
  flex-shrink: 0;
  transition: background 0.15s;
  outline: 1.5px solid rgba(62, 35, 24, 0.14);
  outline-offset: -1px;
}

.ls-canvas-chip.selected .ls-chip-shape {
  background: #3E2318;
  outline-color: #3E2318;
}

/* Shape size classes */
.ls-cs-3x2 { width: 28px; height: 19px; }
.ls-cs-5x4 { width: 25px; height: 20px; }
.ls-cs-1x1 { width: 20px; height: 20px; }
.ls-cs-4x5 { width: 18px; height: 22px; }
.ls-cs-2x3 { width: 15px; height: 22px; }

/* Text column inside chip */
.ls-chip-text {
  display: flex;
  flex-direction: column;
  gap: 1px;
  line-height: 1;
}

.ls-chip-name {
  font-size: 11px;
  font-weight: 700;
  color: #3E2318;
  opacity: 0.6;
  font-family: 'Familjen Grotesk', -apple-system, sans-serif;
}

.ls-canvas-chip.selected .ls-chip-name {
  opacity: 1;
  color: #C73314;
}

.ls-chip-ratio {
  font-size: 9.5px;
  color: rgba(62, 35, 24, 0.48);
  font-weight: 500;
  letter-spacing: 0.02em;
  font-family: 'Familjen Grotesk', -apple-system, sans-serif;
}

/* Chip hover tooltip — shows print sizes */
.ls-chip-tooltip {
  display: none;
  position: absolute;
  bottom: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%);
  background: #3E2318;
  color: white;
  padding: 10px 14px;
  border-radius: 10px;
  min-width: 90px;
  text-align: center;
  z-index: 1000;
  pointer-events: none;
  box-shadow: 0 4px 16px rgba(62, 35, 24, 0.3);
  white-space: nowrap;
}

.ls-chip-tooltip::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 7px solid transparent;
  border-top-color: #3E2318;
}

.ls-canvas-chip:hover .ls-chip-tooltip {
  display: block;
}

.ls-chip-tooltip-title {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(255, 255, 255, 0.55);
  margin-bottom: 5px;
  font-family: 'Familjen Grotesk', -apple-system, sans-serif;
}

.ls-chip-tooltip-sizes {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.ls-chip-tooltip-size {
  font-size: 13px;
  font-weight: 500;
  color: white;
  font-family: 'Familjen Grotesk', -apple-system, sans-serif;
}

/* Custom trigger button — dashed, end of strip */
.ls-canvas-custom-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 6px 10px;
  border-radius: 8px;
  border: 1.5px dashed rgba(62, 35, 24, 0.22);
  background: none;
  font-family: 'Familjen Grotesk', -apple-system, sans-serif;
  font-size: 10.5px;
  font-weight: 600;
  color: rgba(62, 35, 24, 0.48);
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: all 0.15s;
}

.ls-canvas-custom-btn:hover,
.ls-canvas-custom-btn.active {
  border-color: #3E2318;
  color: #3E2318;
  background: #EAE4DA;
}

.ls-canvas-custom-btn.active {
  border-style: solid;
  border-color: #C73314;
  color: #C73314;
  background: rgba(199, 51, 20, 0.05);
}

.ls-canvas-custom-btn.selected {
  background: #3E2318;
  color: white;
  border-color: #3E2318;
  border-style: solid;
}

.ls-canvas-custom-btn svg {
  width: 10px;
  height: 10px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2.5;
  flex-shrink: 0;
}

/* Custom input — slides open below strip using grid rows trick */
.ls-canvas-custom-row {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.22s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
}

.ls-canvas-custom-row.open {
  grid-template-rows: 1fr;
}

.ls-canvas-custom-inner {
  min-height: 0;
  overflow: hidden;
}

.ls-canvas-custom-content {
  padding: 12px 16px 14px;
  border-top: 1px solid rgba(62, 35, 24, 0.13);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ls-custom-top-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.ls-custom-input-label {
  font-size: 11px;
  font-weight: 600;
  color: rgba(62, 35, 24, 0.48);
  white-space: nowrap;
  font-family: 'Familjen Grotesk', -apple-system, sans-serif;
}

.ls-custom-inputs {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.ls-custom-num {
  width: 52px;
  padding: 6px 8px;
  border: 1.5px solid rgba(62, 35, 24, 0.22);
  border-radius: 7px;
  font-family: 'Familjen Grotesk', -apple-system, sans-serif;
  font-size: 13px;
  font-weight: 600;
  color: #3E2318;
  background: white;
  text-align: center;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  -moz-appearance: textfield;
}

.ls-custom-num::-webkit-outer-spin-button,
.ls-custom-num::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.ls-custom-num:focus {
  border-color: #C73314;
  box-shadow: 0 0 0 3px rgba(199, 51, 20, 0.1);
}

.ls-custom-x {
  font-size: 14px;
  font-weight: 700;
  color: rgba(62, 35, 24, 0.32);
  flex-shrink: 0;
  user-select: none;
  font-family: 'Familjen Grotesk', -apple-system, sans-serif;
}

.ls-custom-actions {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-shrink: 0;
  margin-left: auto;
}

.ls-btn-custom-cancel {
  background: none;
  border: none;
  font-family: 'Familjen Grotesk', -apple-system, sans-serif;
  font-size: 12px;
  font-weight: 600;
  color: rgba(62, 35, 24, 0.48);
  cursor: pointer;
  padding: 6px 8px;
  border-radius: 6px;
  transition: color 0.15s, background 0.15s;
}

.ls-btn-custom-cancel:hover {
  color: #3E2318;
  background: #EAE4DA;
}

.ls-btn-custom-apply {
  background: #3E2318;
  color: white;
  border: none;
  font-family: 'Familjen Grotesk', -apple-system, sans-serif;
  font-size: 12px;
  font-weight: 700;
  padding: 6px 14px;
  border-radius: 7px;
  cursor: pointer;
  transition: background 0.15s, transform 0.12s;
  display: flex;
  align-items: center;
  gap: 5px;
  box-shadow: 0 2px 6px rgba(62, 35, 24, 0.2);
}

.ls-btn-custom-apply:hover {
  background: #2a1810;
  transform: translateY(-1px);
}

.ls-btn-custom-apply:active {
  transform: translateY(0);
}

.ls-btn-custom-apply svg {
  width: 11px;
  height: 11px;
  stroke: white;
  fill: none;
  stroke-width: 2.8;
}

.ls-custom-ratio-note {
  font-size: 10.5px;
  color: rgba(62, 35, 24, 0.48);
  font-style: italic;
  line-height: 1.4;
  padding: 0 2px;
  font-family: 'Familjen Grotesk', -apple-system, sans-serif;
}

/* ============================================
   CARD 4 — Create Button
   ============================================ */

.ls-create-card {
  background: transparent;
  border: none;
  box-shadow: none;
  flex-shrink: 0;
}

.ls-create-btn {
  width: 100%;
  padding: 16px;
  border-radius: 14px;
  border: none;
  background: #C73314;
  color: #fff;
  font-family: 'Domine', Georgia, serif;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.02em;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: all 0.18s;
  box-shadow: 0 4px 18px rgba(199, 51, 20, 0.32);
}

.ls-create-btn:hover:not(:disabled) {
  background: #a82b10;
  transform: translateY(-2px);
  box-shadow: 0 7px 24px rgba(199, 51, 20, 0.42);
}

.ls-create-btn:active:not(:disabled) {
  transform: translateY(0);
}

.ls-create-btn svg {
  width: 18px;
  height: 18px;
  stroke: white;
  fill: none;
  stroke-width: 2.5;
  flex-shrink: 0;
}

.ls-create-btn:disabled {
  background: #D4C5B5;
  color: #A8998A;
  cursor: not-allowed;
  box-shadow: none;
}

.ls-create-btn.ls-create-btn-nudge {
  background: #EAE4DA;
  color: #A8998A;
  cursor: default;
  box-shadow: none;
  border-radius: 100px;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.01em;
}

.ls-create-btn.ls-create-btn-nudge:hover {
  background: #EAE4DA;
  transform: none;
  box-shadow: none;
}

.ls-create-btn-view {
  background: #3E2318;
  box-shadow: 0 2px 8px rgba(62, 35, 24, 0.2);
}

.ls-create-btn-view:hover:not(:disabled) {
  background: #5a3528;
}

.ls-create-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: lsSpin 0.7s linear infinite;
  flex-shrink: 0;
}

@keyframes lsSpin {
  to { transform: rotate(360deg); }
}

/* ============================================
   VOICE MODE INDICATOR
   ============================================ */

.ls-voice-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: 'Familjen Grotesk', -apple-system, sans-serif;
  font-size: 12px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.7);
  background: rgba(199, 51, 20, 0.3);
  border-radius: 20px;
  padding: 3px 10px;
  margin-left: auto;
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 900px) {
  .layout-studio-wrapper {
    flex-direction: column;
    height: auto;
    overflow: auto;
    padding: 12px;
    gap: 12px;
  }

  .ls-left {
    width: 100% !important;
    max-width: 100%;
    min-width: 0;
    height: 400px;
  }

  .ls-divider {
    display: none;
  }

  .ls-right {
    overflow: visible;
  }
}

/* ── Editable title in StoryCard ── */
.ls-card-title-editable {
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: color 0.15s;
}
.ls-card-title-editable:hover { color: #C73314; }
.ls-card-title-editable:hover .ls-title-edit-icon { opacity: 1; }
.ls-title-edit-icon { opacity: 0; transition: opacity 0.15s; flex-shrink: 0; }

.ls-title-edit-row {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
}
.ls-title-input {
  flex: 1;
  min-width: 0;
  font-family: 'Domine', var(--font-serif);
  font-size: 15px;
  font-weight: 600;
  color: #3E2318;
  background: #F5F0EA;
  border: 1.5px solid #C73314;
  border-radius: 6px;
  padding: 4px 8px;
  outline: none;
}
.ls-title-btn {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.15s;
}
.ls-title-btn-cancel { background: #e5e0d8; color: #666; }
.ls-title-btn-cancel:hover { background: #d0c9c0; }
.ls-title-btn-save { background: #C73314; color: white; }
.ls-title-btn-save:hover { background: #a82b10; }

/* ── Story Card CTA pill ── */
.ls-story-cta {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: none;
  border-radius: 100px;
  padding: 7px 16px;
  font-family: 'Familjen Grotesk', -apple-system, sans-serif;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.2s, color 0.2s, box-shadow 0.2s;
  letter-spacing: -0.01em;
}

.ls-story-cta-ready {
  background: #C73314;
  color: white;
  box-shadow: 0 3px 12px rgba(199,51,20,0.35);
}
.ls-story-cta-ready:hover {
  background: #a82b10;
  box-shadow: 0 4px 16px rgba(199,51,20,0.45);
}

.ls-story-cta-nudge {
  background: transparent;
  color: #A8998A;
  cursor: default;
  font-size: 12px;
  border: 1.5px dashed #C4B8A8;
  padding: 6px 14px;
}

.ls-story-cta-view {
  background: #3E2318;
  color: white;
}
.ls-story-cta-view:hover { background: #5a3528; }

.ls-story-cta-creating {
  background: #EAE4DA;
  color: #A8998A;
  cursor: default;
}

/* ── Creating shimmer state ── */
.ls-creations-creating {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 14px 14px 20px;
  overflow-y: auto;
  overflow-x: hidden;
  min-height: 0;
}

@keyframes lsShimmer {
  0%   { background-position: -200% center; }
  100% { background-position: 200% center; }
}

.ls-creation-shimmer {
  background: linear-gradient(
    90deg,
    rgba(255,255,255,0.06) 25%,
    rgba(255,255,255,0.13) 50%,
    rgba(255,255,255,0.06) 75%
  );
  background-size: 200% 100%;
  animation: lsShimmer 1.6s ease-in-out infinite;
  cursor: default;
}

.ls-creating-msg {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: center;
  font-family: 'Familjen Grotesk', -apple-system, sans-serif;
  font-size: 12px;
  color: rgba(255,255,255,0.45);
  line-height: 1.5;
  text-align: center;
  padding: 0 16px;
}

@keyframes lsPulse {
  0%, 100% { opacity: 0.4; transform: scale(1); }
  50%       { opacity: 1;   transform: scale(1.2); }
}

.ls-creating-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #C73314;
  flex-shrink: 0;
  animation: lsPulse 1.4s ease-in-out infinite;
}
