/* ---- Reset & Base ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  background: #fbfaf7;
  color: #211922;
  overflow: hidden;
  --surface: #fffefa;
  --surface-soft: #f5f2eb;
  --line: #e7e1d8;
  --ink: #211922;
  --muted: #746f66;
  --brand: #d9152f;
  --brand-dark: #a90f24;
  --brand-soft: rgba(217, 21, 47, .08);
  --waterfall-overlay-left: 12px;
  --waterfall-overlay-width: calc(100vw - 24px);
  --waterfall-overlay-center: 50vw;
  --remix-bottom: 84px;
  --results-remix-gap: 32px;
  --results-bottom: 238px;
}

/* ---- Header ---- */
#app-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 60px;
  background: rgba(255, 254, 250, .86);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(18px) saturate(1.04);
  -webkit-backdrop-filter: blur(18px) saturate(1.04);
  z-index: 100;
  display: flex;
  align-items: center;
  padding: 0 18px;
  gap: 16px;
}
.header-brand {
  display: flex; align-items: center; gap: 8px; flex-shrink: 0; text-decoration: none;
}
.header-brand-mark {
  width: 30px; height: 30px; border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden; background: var(--surface-soft);
  box-shadow: inset 0 0 0 1px rgba(33,25,34,.06), 0 8px 18px rgba(33,25,34,.08);
}
.header-brand-logo {
  width: 100%; height: 100%; display: block; object-fit: cover;
}
.header-brand-name {
  font-size: 13px; font-weight: 760; color: var(--ink);
  letter-spacing: 0; white-space: nowrap;
}
.header-author-link {
  font-size: 12px; font-weight: 650; color: #7b3c24;
  text-decoration: none; white-space: nowrap;
  padding: 4px 8px; border-radius: 999px;
  background: rgba(191, 92, 47, .08);
  transition: background 0.15s, color 0.15s;
}
.header-author-link:hover {
  background: rgba(191, 92, 47, .14);
  color: var(--brand);
}
.header-search {
  flex: 1; display: flex; align-items: center; gap: 8px;
  max-width: 500px; margin: 0 auto;
}
.header-search-input {
  flex: 1; height: 38px; border-radius: 13px;
  border: 1px solid var(--line); background: rgba(245,242,235,.76);
  padding: 0 14px; font-size: 13px; color: var(--ink); outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.header-search-input::placeholder { color: #969086; }
.header-search-input:focus {
  border-color: rgba(217, 21, 47, .35);
  box-shadow: 0 0 0 4px var(--brand-soft);
  background: #ffffff;
}
.header-search-btn {
  height: 38px; padding: 0 16px;
  background: var(--ink); color: #ffffff; border: none; border-radius: 13px;
  font-size: 13px; font-weight: 650; cursor: pointer; white-space: nowrap;
  transition: background 0.15s, transform .15s;
}
.header-search-btn:hover { background: #3a3233; }
.header-search-btn:active { transform: translateY(1px); }
.header-actions { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.btn-contribute {
  height: 36px; padding: 0 16px;
  border: 1px solid rgba(217,21,47,.2); border-radius: 13px;
  background: linear-gradient(180deg, #ef2942, var(--brand));
  color: #ffffff; font-size: 12px; font-weight: 700;
  cursor: pointer; white-space: nowrap;
  box-shadow: 0 10px 24px rgba(217,21,47,.22);
  transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
}
.btn-contribute:hover {
  transform: translateY(-1px);
  filter: saturate(1.04);
  box-shadow: 0 13px 30px rgba(217,21,47,.27);
}
.btn-contribute:active {
  transform: translateY(0);
  box-shadow: 0 6px 16px rgba(217,21,47,.2);
}

@media (max-width: 760px) {
  #app-header {
    height: 58px;
    padding: 0 12px;
    gap: 10px;
  }
  .header-brand { min-width: 0; gap: 7px; }
  .header-brand-mark { width: 30px; height: 30px; flex: 0 0 30px; }
  .header-brand-name {
    max-width: 118px;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .header-author-link,
  .header-actions { display: none; }
  .header-search {
    min-width: 0;
    max-width: 174px;
    margin: 0 0 0 auto;
    gap: 0;
  }
  .header-search-input {
    min-width: 0;
    height: 36px;
    border-radius: 14px;
    font-size: 12px;
  }
  .header-search-btn { display: none; }
  #gallery-bar {
    top: 58px;
    height: 46px;
    padding: 0 12px;
  }
  #main-layout { padding-top: 104px; }
}

/* ---- Gallery Bar ---- */
#gallery-bar {
  position: fixed; top: 60px; left: 0; right: 0; height: 46px;
  background: rgba(255, 254, 250, .9); border-bottom: 1px solid var(--line); z-index: 90;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  display: flex; align-items: center; padding: 0 16px; gap: 6px; overflow: hidden;
  overscroll-behavior-x: contain;
}
.gallery-chips-wrap {
  display: flex; align-items: center; gap: 6px; flex: 1 1 auto; min-width: 0;
  overflow-x: auto; overflow-y: hidden; padding: 7px 0;
  scrollbar-width: none; -webkit-overflow-scrolling: touch;
}
.gallery-chips-wrap::-webkit-scrollbar { display: none; }
.gallery-chips-wrap::after {
  content: ""; flex: 0 0 2px; height: 1px;
}
.gallery-chip {
  height: 28px; padding: 0 12px; background: transparent;
  border: 1px solid transparent; border-radius: 999px; font-size: 12px; color: var(--muted);
  cursor: pointer; white-space: nowrap; flex-shrink: 0;
  transition: background 0.15s, color 0.15s;
}
.gallery-chip:hover { background: rgba(33,25,34,.05); color: var(--ink); }
.gallery-chip.active { background: var(--ink); color: #ffffff; border-color: var(--ink); }
.gallery-more-btn {
  display: none; height: 26px; padding: 0 12px; background: #f6f6f3; border: none;
  border-radius: 20px; font-size: 12px; color: #62625b; cursor: pointer;
  white-space: nowrap; flex-shrink: 0; position: relative;
}
.gallery-more-btn:hover { background: #e0e0d9; color: #211922; }
.gallery-dropdown {
  display: none; position: absolute; top: 34px; right: 0;
  background: #ffffff; border: 1px solid #e5e5e0; border-radius: 12px;
  box-shadow: 0 14px 36px rgba(0,0,0,.14); padding: 6px; z-index: 220;
  min-width: 180px; max-height: min(360px, calc(100dvh - 112px)); overflow-y: auto;
}
.gallery-dropdown.open { display: block; }
.gallery-dropdown-item {
  display: block; width: 100%; text-align: left; border: none; background: none;
  padding: 7px 12px; font-size: 13px; color: #62625b; cursor: pointer;
  border-radius: 8px; white-space: nowrap;
}
.gallery-dropdown-item:hover { background: #f6f6f3; color: #211922; }
.gallery-dropdown-item.active { color: #e60023; font-weight: 500; }

/* ---- Main Layout ---- */
#main-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  height: 100dvh;
  padding-top: 106px;
}
#main-layout.drawer-open {
  grid-template-columns: minmax(0, 55fr) minmax(420px, 45fr);
}

/* ---- Waterfall ---- */
#waterfall-col {
  overflow-y: auto; overflow-x: hidden; padding: 8px 12px 12px;
  scrollbar-width: thin; scrollbar-color: #e0e0d9 transparent;
}
#waterfall-col::-webkit-scrollbar { width: 5px; }
#waterfall-col::-webkit-scrollbar-track { background: transparent; }
#waterfall-col::-webkit-scrollbar-thumb { background: #e0e0d9; border-radius: 3px; }
.waterfall-toolbar {
  position: sticky; top: 10px; z-index: 70;
  height: 0;
  min-height: 0;
  display: flex; align-items: flex-start; justify-content: flex-end;
  margin: 0;
  padding: 0;
  background: transparent;
  border: 0;
  pointer-events: none;
}
.sort-segmented {
  display: inline-flex; align-items: center; gap: 2px;
  padding: 3px;
  border: 1px solid rgba(231,225,216,.72);
  background: rgba(255,255,255,.58);
  border-radius: 999px;
  box-shadow: 0 14px 32px rgba(33,25,34,.10), 0 1px 0 rgba(255,255,255,.82) inset;
  backdrop-filter: blur(18px) saturate(1.12);
  -webkit-backdrop-filter: blur(18px) saturate(1.12);
  pointer-events: auto;
}
.sort-segmented.is-loading {
  box-shadow: 0 16px 34px rgba(33,25,34,.12), 0 0 0 1px rgba(217,21,47,.08) inset;
}
.sort-segmented.is-loading::after {
  content: "";
  width: 12px; height: 12px; margin: 0 8px 0 4px;
  border-radius: 50%;
  border: 2px solid rgba(33,25,34,.16);
  border-top-color: var(--brand);
  animation: spin .7s linear infinite;
}
.sort-option {
  height: 28px; padding: 0 12px;
  border: 0; border-radius: 999px;
  background: transparent; color: var(--muted);
  font-size: 12px; font-weight: 650; cursor: pointer;
  transition: color .15s, background .15s, transform .15s;
}
.sort-option:hover { color: var(--ink); background: rgba(33,25,34,.05); }
.sort-option:active { transform: translateY(1px); }
.sort-option:disabled { cursor: wait; opacity: .72; }
.sort-option.active {
  background: var(--ink);
  color: #fff;
  box-shadow: 0 5px 12px rgba(33,25,34,.14);
}
.waterfall {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.waterfall-page {
  display: grid;
  grid-template-columns: repeat(var(--waterfall-columns, 5), minmax(0, 1fr));
  gap: 8px;
  align-items: start;
}
.waterfall-column {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}
.waterfall-status {
  min-height: 44px; display: flex; align-items: center; justify-content: center;
  color: #8f8a7e; font-size: 12px; padding: 14px 0 120px;
}

/* ---- Card ---- */
.card {
  display: block; width: 100%; margin: 0;
  padding: 0; border: 0; background: transparent; text-align: left;
  cursor: pointer;
  position: relative; border-radius: 14px; overflow: hidden;
  transition: transform 0.18s ease, box-shadow .18s ease;
  content-visibility: auto;
  contain-intrinsic-size: 320px 480px;
}
.card:hover { transform: translateY(-2px); box-shadow: 0 12px 28px rgba(33,25,34,.12); }
.card:active { transform: translateY(0) scale(.992); }
.card:focus-visible {
  outline: 3px solid rgba(217,21,47,.72);
  outline-offset: 3px;
}
.card:hover .card-placeholder { filter: brightness(0.93); }
.card.selected { outline: 3px solid var(--brand); outline-offset: 2px; }
.card.selected .card-check { display: flex !important; }
.card.opening .card-placeholder {
  box-shadow: inset 0 0 0 2px rgba(217,21,47,.28);
}
.card-placeholder {
  width: 100%; display: flex; align-items: center; justify-content: center;
  border-radius: 14px; transition: filter 0.18s ease; position: relative;
  overflow: hidden; background: var(--surface-soft);
}
.card-placeholder::before {
  content: "";
  position: absolute; inset: 0; z-index: 0;
  background:
    linear-gradient(105deg, rgba(255,255,255,0) 0%, rgba(255,255,255,.22) 42%, rgba(255,255,255,.72) 50%, rgba(255,255,255,.22) 58%, rgba(255,255,255,0) 100%),
    radial-gradient(circle at 30% 20%, rgba(255,255,255,.26), rgba(255,255,255,0) 42%);
  transform: translateX(-110%);
  animation: card-shimmer 1.25s ease-in-out infinite;
  pointer-events: none;
}
.card-placeholder.image-loaded::before,
.card-placeholder.image-error::before {
  opacity: 0;
  animation: none;
}
@keyframes card-shimmer {
  to { transform: translateX(110%); }
}
.card-placeholder img,
.drawer-img-area > img,
.gen-img-block img {
  width: 100%; height: 100%; display: block; object-fit: cover;
}
.drawer-img-area > img { position: absolute; inset: 0 0 auto; height: var(--drawer-image-visual-height, clamp(260px, 45vh, 520px)); object-fit: contain; z-index: 1; }
.card-placeholder img {
  position: relative; z-index: 1; height: auto; object-fit: contain;
  opacity: 0; transition: opacity .22s ease;
}
.card-placeholder img.loaded { opacity: 1; }
.card-placeholder-label {
  font-size: 10px; font-weight: 500; letter-spacing: 0.02em;
  opacity: 0.35; color: #211922; font-variant-numeric: tabular-nums;
}
.card-gallery-tag {
  position: absolute; bottom: 7px; left: 7px; z-index: 5;
  background: rgba(23,20,19,.56); color: #fff; font-size: 10px;
  padding: 3px 7px; border-radius: 999px; pointer-events: none;
  backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
  max-width: calc(100% - 48px); overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap;
}
.card-copy-prompt {
  position: absolute; right: 7px; bottom: 7px; z-index: 6;
  width: 26px; height: 26px; border: none; border-radius: 8px;
  background: rgba(23,20,19,.56); color: #fff; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
  transition: background 0.15s, transform 0.15s, opacity 0.15s;
}
.card-copy-prompt:hover {
  background: rgba(217,21,47,.92); transform: translateY(-1px);
}
.card-copy-prompt:focus-visible,
.card-image-error:focus-visible {
  outline: 2px solid rgba(255,255,255,.88);
  outline-offset: 2px;
}
.card-copy-prompt.copying {
  opacity: .72;
  cursor: progress;
}
.card-copy-prompt.copied {
  background: var(--brand);
}
.card-image-error,
.card-opening-indicator {
  position: absolute; left: 50%; top: 50%; z-index: 8;
  transform: translate(-50%, -50%);
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  min-width: 118px; max-width: calc(100% - 28px);
  min-height: 32px; padding: 7px 11px;
  border-radius: 999px;
  background: rgba(255,255,255,.82);
  color: var(--ink);
  border: 1px solid rgba(231,225,216,.82);
  box-shadow: 0 10px 28px rgba(33,25,34,.14);
  backdrop-filter: blur(14px) saturate(1.12);
  -webkit-backdrop-filter: blur(14px) saturate(1.12);
  font-size: 11px; font-weight: 700;
  text-align: center;
}
.card-image-error { cursor: pointer; color: var(--brand); }
.card-opening-indicator .gen-spinner {
  width: 14px; height: 14px; border-width: 2px;
}
.card-title-shade {
  position: absolute; top: 0; left: 0; right: 0; z-index: 4; min-height: 38%;
  padding: 10px 10px 24px;
  background: linear-gradient(180deg, rgba(16,14,13,.5), rgba(16,14,13,.18) 58%, rgba(16,14,13,0));
  color: #fff; pointer-events: none;
  display: flex; align-items: flex-start;
}
.card-title-text {
  font-size: 12px; font-weight: 720; line-height: 1.28;
  text-shadow: 0 1px 8px rgba(0,0,0,.35);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}
.card-check {
  display: none; position: absolute; top: 7px; right: 7px; z-index: 7;
  width: 18px; height: 18px; background: var(--brand); color: #fff;
  border-radius: 50%; font-size: 10px; align-items: center;
  justify-content: center; font-weight: 700;
}

/* ---- Drawer Col ---- */
#drawer-col {
  border-left: 1px solid #e5e5e0; overflow-y: auto;
  background: #ffffff; position: relative; flex-direction: column;
  scrollbar-width: thin; scrollbar-color: #e0e0d9 transparent;
  display: none; min-width: 0;
  overflow-anchor: none;
}
#main-layout.drawer-open #drawer-col { display: flex; }
#drawer-col::-webkit-scrollbar { width: 5px; }
#drawer-col::-webkit-scrollbar-track { background: transparent; }
#drawer-col::-webkit-scrollbar-thumb { background: #e0e0d9; border-radius: 3px; }
#drawer-empty {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; flex: 1; gap: 12px; color: #91918c;
  padding: 40px; text-align: center;
}
#drawer-empty svg { opacity: 0.25; }
#drawer-empty p { font-size: 13px; line-height: 1.7; }
#drawer-content { display: none; min-height: 100%; }
#drawer-content.visible {
  display: block;
  animation: drawerSlideIn 0.22s ease both;
  overflow-anchor: none;
  padding-bottom: 360px;
}
@keyframes drawerSlideIn {
  from { opacity: 0; transform: translateX(16px); }
  to   { opacity: 1; transform: translateX(0); }
}
.drawer-close-btn {
  position: sticky; top: 12px; margin: 12px 14px -40px auto;
  width: 28px; height: 28px; background: rgba(255,255,255,.82);
  border: none; border-radius: 50%; cursor: pointer;
  display: flex; align-items: center; justify-content: center; z-index: 120;
  box-shadow: 0 8px 24px rgba(0,0,0,.12);
  backdrop-filter: blur(10px);
  transition: background 0.15s, transform 0.15s, box-shadow 0.15s;
}
.drawer-close-btn:hover {
  background: rgba(255,255,255,.96);
  transform: scale(1.04);
  box-shadow: 0 10px 28px rgba(0,0,0,.16);
}

/* ---- Drawer: Image Area ---- */
.drawer-img-area {
  position: sticky; top: 0; z-index: 18; background: #f6f6f3;
  height: var(--drawer-image-compact-height, 160px);
  display: flex; align-items: center;
  justify-content: center; cursor: pointer;
  overflow: visible; transition: box-shadow 0.18s ease, background-color 0.18s ease;
  will-change: box-shadow;
  transform: translateZ(0);
  overflow-anchor: none;
}
.drawer-img-area::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: var(--drawer-image-visual-height, clamp(260px, 45vh, 520px));
  background: #f6f6f3;
  z-index: 0;
  pointer-events: none;
}
.drawer-img-area > img,
.drawer-image-carousel {
  transform: scale(var(--drawer-image-scale, 1));
  transform-origin: center center;
  will-change: transform;
}
.drawer-img-area.is-shrinking {
  background: #f4f4ef;
}
.drawer-img-area.is-compact {
  box-shadow: 0 10px 28px rgba(0,0,0,.08);
}
.drawer-img-area:hover .img-input-hint { opacity: 1; }
.img-input-hint {
  position: absolute; inset: 0 0 auto; height: var(--drawer-image-visual-height, 100%);
  background: rgba(0,0,0,.3);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 12px; opacity: 0;
  transition: opacity 0.2s; pointer-events: none; z-index: 14;
}
.drawer-img-area.input-selected::after {
  content: ""; position: absolute; inset: 0 0 auto; height: var(--drawer-image-visual-height, 100%); z-index: 16;
  border: 3px solid transparent; pointer-events: none;
  background: linear-gradient(135deg, #e60023, #ff6b35, #ffb347) border-box;
  -webkit-mask:
    linear-gradient(#000 0 0) padding-box,
    linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask:
    linear-gradient(#000 0 0) padding-box,
    linear-gradient(#000 0 0);
  mask-composite: exclude;
}
.img-input-badge {
  position: absolute; left: 8px; top: calc(var(--drawer-image-visual-height, 100%) - 34px); z-index: 17;
  background: linear-gradient(135deg, #e60023, #ff6b35);
  color: #fff; font-size: 11px;
  padding: 3px 8px; border-radius: 6px; pointer-events: none;
  display: none;
  box-shadow: 0 6px 18px rgba(230,0,35,.22);
}
.drawer-img-area.input-selected .img-input-badge { display: block; }
.drawer-image-carousel {
  position: absolute; inset: 0 0 auto; height: var(--drawer-image-visual-height, 100%); display: flex; align-items: center;
  justify-content: center; gap: 12px; padding: 18px 48px;
  overflow: hidden; z-index: 1;
}
.drawer-image-slide {
  height: 82%; width: min(46%, 260px); flex: 0 0 auto;
  border-radius: 10px; overflow: hidden; opacity: 0.42;
  transform: scale(0.86); transition: transform 0.2s ease, opacity 0.2s ease;
  background: #f6f6f3; box-shadow: 0 6px 22px rgba(0,0,0,.08);
}
.drawer-image-slide.active {
  opacity: 1; transform: scale(1); width: min(58%, 340px);
  box-shadow: 0 10px 34px rgba(0,0,0,.14);
}
.drawer-image-slide img {
  position: static; width: 100%; height: 100%; object-fit: contain;
}
.img-nav-btn {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 32px; height: 32px; border-radius: 50%; border: none;
  background: rgba(255,255,255,.9); cursor: pointer; font-size: 13px;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.15s; z-index: 17;
}
.img-nav-btn:hover { background: rgba(255,255,255,1); }
.img-nav-btn.prev { left: 8px; }
.img-nav-btn.next { right: 8px; }
.img-counter {
  position: absolute; bottom: 8px; left: 50%; transform: translateX(-50%);
  background: rgba(0,0,0,.45); color: #fff; font-size: 11px;
  padding: 2px 8px; border-radius: 10px;
  font-variant-numeric: tabular-nums;
  z-index: 17;
}

/* ---- Drawer: Info Area ---- */
.drawer-info {
  margin-top: var(--drawer-info-lift-space, 0px);
  padding: 14px 16px 12px; border-bottom: 1px solid #e5e5e0;
  background: #ffffff;
  position: relative;
  z-index: 1;
}
.drawer-info h2 {
  font-size: 15px; font-weight: 700; color: #211922;
  letter-spacing: -0.01em; margin-bottom: 1px; line-height: 1.3;
}
.drawer-info h3 {
  font-size: 11px; font-weight: 400; color: #91918c;
  margin-bottom: 10px; line-height: 1.4;
}
.drawer-gallery-link {
  display: inline-flex; align-items: center; height: 22px;
  padding: 0 8px; margin-bottom: 8px; border: none; border-radius: 11px;
  background: #fef0f0; color: #e60023; cursor: pointer;
  font-size: 11px; font-weight: 600;
}
.drawer-gallery-link:hover { background: #ffe2e5; }
.drawer-pills { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 8px; }
.drawer-pill {
  display: inline-block; padding: 2px 9px;
  border-radius: 20px; background: #f6f6f3;
  border: 1px solid #e5e5e0; font-size: 11px; color: #62625b;
}
.drawer-source { font-size: 11px; color: #91918c; margin-bottom: 10px; }
.drawer-source a { color: #2b48d4; text-decoration: none; }
.drawer-source a:hover { text-decoration: underline; }
.drawer-recipe-card {
  margin: 10px 0 12px;
  padding: 10px 12px;
  border-radius: 12px;
  background: #fff7f0;
  border: 1px solid #ffe0c5;
}
.drawer-recipe-label {
  margin-bottom: 4px;
  color: #8a4a20;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.drawer-recipe-text {
  color: #3b2d24;
  font-size: 12px;
  line-height: 1.6;
}
.drawer-prompt-label {
  font-size: 11px; font-weight: 600; color: #62625b;
  letter-spacing: 0.04em; text-transform: uppercase; margin-bottom: 6px;
}
.drawer-prompt-heading {
  margin: 14px 0 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.drawer-prompt-box {
  position: relative; background: #fafaf8;
  border: 1px solid #e5e5e0; border-radius: 14px; overflow: visible;
  padding: 10px;
}
.drawer-prompt-actions {
  position: relative;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex: 0 0 auto;
}
.prompt-part-controls {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px;
  border-radius: 999px;
  background: rgba(255,255,255,.82);
  border: 1px solid rgba(229,229,224,.78);
  box-shadow: 0 8px 22px rgba(33,25,34,.08);
}
.prompt-part-control {
  height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  border: 1px solid #e5e5e0;
  background: #fff;
  color: #62625b;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
  transition: background .15s, border-color .15s, color .15s, box-shadow .15s;
}
.prompt-part-control.all {
  border-color: #ffc3ce;
  color: #b0001b;
}
.prompt-part-control.content {
  border-color: #9edbb4;
  color: #1f5834;
}
.prompt-part-control.composition {
  border-color: #a9c9ff;
  color: #274f99;
}
.prompt-part-control.style {
  border-color: #e9c978;
  color: #7f4d00;
}
.prompt-part-control:hover,
.prompt-part-control.active {
  background: #fff5f6;
  border-color: #e60023;
  color: #e60023;
  box-shadow: 0 0 0 2px rgba(230,0,35,.08);
}
.drawer-prompt-text {
  display: block;
  padding: 2px 2px 2px 0;
  font-family: 'JetBrains Mono', 'Fira Code', ui-monospace, monospace;
  font-size: 13.5px;
  line-height: 1.9;
  color: #211922;
  white-space: pre-wrap;
  word-break: break-word;
}
.prompt-part-card {
  border: 1px solid #ecece6;
  border-radius: 12px;
  background: #ffffff;
  padding: 10px 11px;
  cursor: pointer;
  transition: border-color .15s, background .15s, box-shadow .15s, transform .15s;
}
.prompt-part-card:hover,
.prompt-part-card:focus-visible {
  outline: none;
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(33,25,34,.06);
}
.prompt-part-card.selected {
  border-color: #e60023;
  box-shadow: 0 0 0 2px rgba(230,0,35,.1);
}
.prompt-part-card-type {
  display: inline-flex;
  align-items: center;
  height: 18px;
  padding: 0 7px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 850;
  margin-bottom: 7px;
}
.prompt-part-card-text {
  font-family: 'JetBrains Mono', 'Fira Code', ui-monospace, monospace;
  font-size: 12.5px;
  line-height: 1.72;
  color: #211922;
  white-space: pre-wrap;
  word-break: break-word;
}
.prompt-part-card-content .prompt-part-card-type {
  background: rgba(77,171,110,.14);
  color: #2d7544;
}
.prompt-part-card-style .prompt-part-card-type {
  background: rgba(245,178,68,.18);
  color: #9b5a00;
}
.prompt-part-card-composition .prompt-part-card-type {
  background: rgba(76,139,245,.14);
  color: #305aa8;
}
.prompt-part-card-plain {
  font-family: 'JetBrains Mono', 'Fira Code', ui-monospace, monospace;
  font-size: 12.5px;
  line-height: 1.72;
  white-space: pre-wrap;
  word-break: break-word;
}
.prompt-slice {
  border-radius: 8px;
  padding: 2px 5px;
  cursor: pointer;
  transition: background .15s, box-shadow .15s, color .15s;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}
.prompt-slice:hover,
.prompt-slice:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px rgba(33,25,34,.1);
}
.prompt-slice.selected {
  box-shadow: 0 0 0 2px rgba(230,0,35,.22);
}
.prompt-slice-content { background: rgba(77, 171, 110, .18); color: #1f5834; }
.prompt-slice-content:hover,
.prompt-slice-content:focus-visible,
.prompt-slice-content.selected { background: rgba(77, 171, 110, .28); }
.prompt-slice-style { background: rgba(245, 178, 68, .22); color: #7f4d00; }
.prompt-slice-style:hover,
.prompt-slice-style:focus-visible,
.prompt-slice-style.selected { background: rgba(245, 178, 68, .34); }
.prompt-slice-composition { background: rgba(76, 139, 245, .16); color: #274f99; }
.prompt-slice-composition:hover,
.prompt-slice-composition:focus-visible,
.prompt-slice-composition.selected { background: rgba(76, 139, 245, .28); }
.prompt-plain {
  color: #211922;
}
.prompt-slice-tooltip {
  position: fixed;
  z-index: 1200;
  pointer-events: none;
  opacity: 0;
  transform: translate3d(0, 0, 0) scale(.96);
  padding: 5px 8px;
  border-radius: 999px;
  border: 1px solid rgba(33,25,34,.08);
  background: rgba(255,255,255,.94);
  box-shadow: 0 10px 26px rgba(33,25,34,.14);
  color: #211922;
  font-size: 11px;
  font-weight: 850;
  line-height: 1.25;
  max-width: min(360px, calc(100vw - 32px));
  white-space: normal;
  transition: opacity .08s ease, transform .08s ease;
}
.prompt-slice-tooltip.visible {
  opacity: 1;
  transform: translate3d(0, 0, 0) scale(1);
}
.prompt-slice-tooltip.content {
  background: #effaf2;
  border-color: #b8e2c7;
  color: #1f5834;
}
.prompt-slice-tooltip.composition {
  background: #edf4ff;
  border-color: #b8d2ff;
  color: #274f99;
}
.prompt-slice-tooltip.style {
  background: #fff7e8;
  border-color: #f5d58a;
  color: #7f4d00;
}
.prompt-copy-btn {
  position: relative;
  width: 24px; height: 24px; border: none; background: rgba(255,255,255,.8);
  border-radius: 6px; cursor: pointer; display: flex; align-items: center;
  justify-content: center; transition: background 0.15s; color: #62625b;
  flex: 0 0 auto;
}
.prompt-copy-btn:hover { background: #fff; color: #211922; }
.copy-tooltip {
  position: absolute; top: -22px; right: 0;
  background: #211922; color: #fff; font-size: 10px;
  padding: 2px 6px; border-radius: 4px; white-space: nowrap;
  pointer-events: none; opacity: 0; transition: opacity 0.2s;
}
.copy-tooltip.show { opacity: 1; }

/* ---- Drawer: Tags Area ---- */
.drawer-tags {
  padding: 14px 16px; border-bottom: 1px solid #e5e5e0;
}
.recipe-action-card {
  padding: 12px;
  border-radius: 14px;
  background: #211922;
  color: #fff;
  margin-bottom: 12px;
}
.recipe-action-kicker {
  font-size: 13px;
  font-weight: 800;
  margin-bottom: 4px;
}
.recipe-action-copy {
  color: rgba(255,255,255,.72);
  font-size: 11px;
  line-height: 1.6;
}
.tags-note {
  font-size: 11px; line-height: 1.65; color: #91918c;
  background: #fafaf9; border: 1px solid #f0f0ec;
  border-radius: 10px; padding: 8px 10px; margin-bottom: 10px;
}
.tags-note strong { color: #62625b; font-weight: 700; }
.tags-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 14px; margin: 2px 0 14px;
}
.ingredient-section {
  padding: 2px 0 14px;
}
.ingredient-section + .ingredient-section {
  margin-top: 12px;
  padding-top: 14px;
  border-top: 1px solid #ecece6;
}
.ingredient-section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin: 2px 0 10px;
}
.tags-title-block {
  min-width: 0;
}
.tags-header-title {
  font-size: 15px; font-weight: 850; color: #211922; letter-spacing: 0;
  display: inline-flex; align-items: center; gap: 7px;
}
.tags-title-icon {
  width: 20px; height: 20px; border-radius: 6px;
  display: inline-flex; align-items: center; justify-content: center;
  background: #fff7f0; color: #d85b14;
  border: 1px solid #ffe1c4;
  flex: 0 0 auto;
}
.tags-header-copy {
  margin-top: 3px;
  color: #77736b;
  font-size: 11px;
  line-height: 1.45;
}
.tags-selected-count {
  color: #91918c; font-size: 11px; font-weight: 600;
}
.tags-quick-btns { display: flex; gap: 6px; flex: 0 0 auto; padding-top: 1px; }
.tag-quick-btn {
  height: 22px; padding: 0 10px; border-radius: 11px;
  border: 1px solid #e5e5e0; background: #fff;
  font-size: 11px; color: #62625b; cursor: pointer;
  transition: all 0.15s;
}
.tag-quick-btn:hover { border-color: #91918c; color: #211922; }
.tag-quick-btn.primary {
  border-color: #ffcf9b;
  background: #fff7f0;
  color: #8a4a20;
  font-weight: 700;
}
.atom-category-block {
  padding: 12px 0 10px;
  border-top: 1px solid #f0f0ec;
}
.atom-category-block:first-of-type { border-top: 0; padding-top: 2px; }
.atom-category-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}
.atom-category-actions {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.atom-category-name {
  color: #211922;
  font-size: 12px;
  font-weight: 800;
}
.atom-category-hint {
  margin-top: 2px;
  color: #91918c;
  font-size: 10px;
  line-height: 1.45;
}
.atom-category-count {
  padding: 2px 7px;
  border-radius: 999px;
  background: #f6f6f3;
  color: #91918c;
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}
.spark-group-btn {
  height: 20px;
  padding: 0 8px;
  font-size: 10px;
  border-color: #ffcf9b;
  color: #8a4a20;
  background: #fff7f0;
}
.atom-card-list {
  display: grid;
  gap: 7px;
}
.spark-card-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.atom-card {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border-radius: 12px;
  border: 1px solid #eeeeea;
  background: #fff;
  cursor: pointer;
  transition: border-color .15s, background .15s, box-shadow .15s, transform .15s;
}
.atom-card:hover {
  border-color: #d8d8d0;
  background: #fffdfb;
  transform: translateY(-1px);
}
.atom-card:focus-visible {
  outline: 3px solid rgba(230,0,35,.16);
  outline-offset: 2px;
}
.atom-card.primary {
  border-color: #ffd9b0;
  background: linear-gradient(180deg, #fffaf5, #ffffff);
}
.atom-card.spark-chip {
  width: auto;
  min-width: 0;
  max-width: 100%;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 7px 6px 10px;
  border-radius: 14px;
  box-shadow: none;
}
.atom-card.spark-chip:hover {
  transform: translateY(-1px);
}
.atom-card.spark-chip.selected {
  border-color: #e60023;
}
.atom-card.spark-chip.emphasized {
  box-shadow: 0 0 0 2px rgba(255,179,71,.18);
}
.atom-card.spark-chip.spark-positive {
  border-color: #b8e2c7;
  background: #f4fbf6;
}
.atom-card.spark-chip.spark-positive:hover {
  background: #eaf7ef;
  border-color: #88cf9f;
}
.atom-card.spark-chip.spark-negative {
  border-color: #e6c4c4;
  background: #fff7f7;
}
.atom-card.spark-chip.spark-negative:hover {
  background: #ffeded;
  border-color: #d99b9b;
}
.atom-card.spark-chip.spark-negative .spark-chip-name {
  color: #7f3030;
}
.atom-card.spark-chip.selected {
  border-color: #e60023;
  background: #fff5f6;
  box-shadow: 0 0 0 2px rgba(230,0,35,.12);
}
.atom-card.prompt-part {
  align-items: start;
}
.atom-card.selected {
  border-color: #e60023;
  background: #fff5f6;
  box-shadow: 0 8px 22px rgba(230,0,35,.08);
}
.atom-card.emphasized {
  border-color: #ff9f45;
  box-shadow: 0 0 0 2px rgba(255,179,71,.2), 0 10px 24px rgba(255,107,53,.08);
}
.atom-card-main { min-width: 0; }
.spark-chip-main {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
  flex-wrap: wrap;
}
.spark-chip-name {
  color: #211922;
  font-size: 11.5px;
  font-weight: 800;
  line-height: 1.35;
  max-width: none;
  overflow: visible;
  text-overflow: clip;
  white-space: normal;
  word-break: break-word;
}
.spark-chip-badge {
  flex: 0 0 auto;
  border-radius: 999px;
  padding: 1px 5px;
  background: #ffe1e1;
  color: #9f3434;
  font-size: 9px;
  font-weight: 800;
}
.atom-card-topline {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}
.atom-name {
  color: #211922;
  font-size: 12px;
  font-weight: 800;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.atom-role,
.atom-confidence {
  flex: 0 0 auto;
  border-radius: 999px;
  padding: 1px 6px;
  font-size: 9px;
  font-weight: 800;
}
.atom-role {
  background: #ffe9d2;
  color: #9b4c10;
}
.atom-confidence {
  background: #f1f1ed;
  color: #91918c;
  font-variant-numeric: tabular-nums;
}
.atom-description {
  margin-top: 4px;
  color: #62625b;
  font-size: 11px;
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.atom-description.prompt-part-text {
  margin-top: 0;
  color: #3f3c36;
  font-size: 11.5px;
  line-height: 1.62;
  display: block;
  overflow: visible;
  -webkit-line-clamp: unset;
  -webkit-box-orient: initial;
}
.atom-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}
.atom-card.spark-chip .atom-actions {
  gap: 3px;
}
.atom-star-btn {
  width: 28px;
  height: 28px;
  border: 1px solid #ecece6;
  border-radius: 50%;
  background: #fff;
  color: #b0b0a8;
  cursor: pointer;
  font-size: 15px;
  line-height: 1;
}
.atom-card.spark-chip .atom-star-btn {
  width: 22px;
  height: 22px;
  font-size: 12px;
  border-color: rgba(33,25,34,.1);
}
.atom-star-btn:hover,
.atom-star-btn.active {
  border-color: #ffcf8a;
  background: #fff7e8;
  color: #d08a00;
}
.atom-add-state {
  width: 28px;
  height: 28px;
  border: 1px solid #ecece6;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  color: #b0b0a8;
  font-size: 16px;
  font-weight: 800;
  line-height: 1;
}
.atom-card.spark-chip .atom-add-state {
  width: 22px;
  height: 22px;
  font-size: 14px;
  border-color: rgba(33,25,34,.1);
}
.atom-card.selected .atom-add-state {
  border-color: #e60023;
  background: #e60023;
  color: #fff;
}
.tag-category-block { margin-bottom: 10px; }
.tag-category-block:last-child { margin-bottom: 0; }
.tag-category-name {
  font-size: 10px; font-weight: 600; color: #91918c;
  letter-spacing: 0.06em; text-transform: uppercase;
  margin-bottom: 6px;
}
.tag-row { display: flex; flex-wrap: wrap; gap: 5px; }
.tag {
  height: 24px; padding: 0 6px 0 10px; border-radius: 12px;
  border: 1px solid #e5e5e0; background: #fff;
  font-size: 12px; color: #211922; cursor: pointer;
  display: inline-flex; align-items: center; gap: 3px;
  transition: all 0.15s; user-select: none;
  max-width: 100%;
}
.tag-label-text {
  min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.tag:not(.selected) { color: #9b9b93; border-color: #e5e5e0; background: #fff; }
.tag:hover { border-color: #91918c; background: #fafaf9; }
.tag.selected {
  background: #fef0f0; border-color: #e60023; color: #e60023;
}
.tag.emphasized {
  box-shadow: 0 0 0 2px rgba(255, 179, 71, .22);
}
.tag.spark {
  border: 1.5px solid transparent;
  background: linear-gradient(#fff, #fff) padding-box,
    linear-gradient(135deg, #e60023, #ff6b35, #ffb347) border-box;
}
.tag.spark:hover {
  background: linear-gradient(#fafaf9, #fafaf9) padding-box,
    linear-gradient(135deg, #e60023, #ff6b35, #ffb347) border-box;
}
.tag.spark.selected {
  background: linear-gradient(#fef0f0, #fef0f0) padding-box,
    linear-gradient(135deg, #e60023, #ff6b35, #ffb347) border-box;
  color: #e60023;
}
.tag-spark-star {
  font-size: 9px; opacity: 0.6; line-height: 1;
}
.tag-emphasis {
  width: 18px; height: 18px; margin-left: 2px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  flex: 0 0 18px; color: #b0b0a8; font-size: 12px; line-height: 1;
}
.tag-emphasis:hover {
  background: rgba(255,179,71,.16); color: #d08a00;
}
.tag.emphasized .tag-emphasis {
  color: #d08a00;
}

/* ---- Drawer: Remix Input Area ---- */
.drawer-remix {
  position: fixed;
  left: var(--waterfall-overlay-center);
  right: auto;
  bottom: var(--remix-bottom);
  z-index: 260;
  width: min(760px, calc(var(--waterfall-overlay-width) - 32px));
  padding: 12px;
  border: 1px solid rgba(229,229,224,.92);
  border-radius: 18px;
  background: rgba(255,255,255,.94);
  box-shadow: 0 24px 72px rgba(0,0,0,.22), 0 2px 0 rgba(255,255,255,.92) inset;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  transform: translate(-50%, 18px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}
#main-layout.drawer-open .drawer-remix {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, 0);
}
#main-layout.drawer-open.remix-collapsed .drawer-remix {
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 18px) scale(.98);
}
.remix-drag-handle {
  display: block;
  width: 54px;
  height: 5px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: #d4d4cc;
  margin: -2px auto 9px;
  cursor: ns-resize;
  touch-action: none;
}
.remix-drag-handle:focus-visible {
  outline: 3px solid rgba(217,21,47,.22);
  outline-offset: 4px;
}
.remix-drag-handle:hover,
.drawer-remix.dragging .remix-drag-handle {
  background: #a8a89f;
}

.kitchen-float-toggle {
  position: fixed;
  left: var(--waterfall-overlay-center);
  bottom: 24px;
  z-index: 270;
  width: 46px;
  height: 46px;
  border: 1px solid rgba(217,21,47,.2);
  border-radius: 50%;
  background: linear-gradient(180deg, #ef2942, var(--brand));
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 18px 38px rgba(217,21,47,.28), 0 0 0 6px rgba(255,255,255,.74);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 10px) scale(.92);
  transition: opacity .18s ease, transform .18s ease, box-shadow .18s ease;
  cursor: pointer;
}
.kitchen-float-toggle:hover {
  transform: translate(-50%, 6px) scale(1);
  box-shadow: 0 22px 46px rgba(217,21,47,.34), 0 0 0 7px rgba(255,255,255,.82);
}
.kitchen-float-toggle:focus-visible {
  outline: 3px solid rgba(217,21,47,.24);
  outline-offset: 5px;
}
#main-layout.drawer-open.remix-collapsed .kitchen-float-toggle {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, 0) scale(1);
}
.kitchen-float-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.drawer-remix.dragging {
  transition: opacity 0.18s ease, box-shadow 0.18s ease;
  box-shadow: 0 28px 82px rgba(0,0,0,.26), 0 2px 0 rgba(255,255,255,.92) inset;
}
.kitchen-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 0 2px 10px;
}
.kitchen-title-block {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}
.kitchen-panel-title {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #211922;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: -0.01em;
}
.kitchen-title-icon {
  width: 20px;
  height: 20px;
  border-radius: 7px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #fff4ec;
  border: 1px solid #ffd8ba;
  color: #d85b14;
  line-height: 1;
}
.kitchen-panel-subtitle {
  min-width: 0;
  margin-top: 0;
  color: #91918c;
  font-size: 11px;
  line-height: 1.4;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.kitchen-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.kitchen-clear-btn,
.kitchen-undo-btn {
  height: 24px;
  padding: 0 10px;
  border: 1px solid #e5e5e0;
  border-radius: 999px;
  background: #fff;
  color: #62625b;
  font-size: 11px;
  cursor: pointer;
}
.kitchen-clear-btn {
  display: none;
}
.kitchen-clear-btn.visible { display: inline-flex; align-items: center; }
.kitchen-undo-btn {
  display: inline-flex;
  align-items: center;
  border-color: #ffd0d8;
  color: #d7193f;
}
.kitchen-undo-btn:disabled {
  opacity: .38;
  cursor: not-allowed;
  border-color: #e5e5e0;
  color: #91918c;
}
.kitchen-clear-btn:hover,
.kitchen-undo-btn:not(:disabled):hover { border-color: #e60023; color: #e60023; }
.kitchen-console-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 34px;
  padding: 6px 8px;
  margin: -2px 0 9px;
  border: 1px solid rgba(231,225,216,.72);
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(250,250,249,.88), rgba(255,255,255,.72));
}
.kitchen-status-pills {
  display: flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
  overflow: hidden;
}
.kitchen-status-pill {
  flex: 0 0 auto;
  height: 20px;
  padding: 0 7px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid #eeeeea;
  color: #746f66;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 760;
  white-space: nowrap;
}
.kitchen-status-pill.strong {
  color: #e60023;
  border-color: rgba(230,0,35,.18);
  background: rgba(230,0,35,.045);
}
.kitchen-status-pill.muted {
  color: #969086;
  background: rgba(255,255,255,.62);
}
.kitchen-status-state {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #8f8a7e;
  font-size: 10px;
  font-weight: 780;
  white-space: nowrap;
}
.kitchen-status-state.active { color: #d85b14; }
.kitchen-status-state.ready { color: #188a54; }
.kitchen-status-state.running { color: #0a72cf; }
.kitchen-status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 0 3px color-mix(in srgb, currentColor 13%, transparent);
}
.remix-label-strip {
  display: block;
  width: 100%; overflow: hidden;
  padding: 0 1px 10px; margin-top: -1px;
}
.remix-label-strip::-webkit-scrollbar { display: none; }
.selected-ingredients-panel {
  width: 100%;
  min-width: 0;
}
.selected-ingredients-title {
  color: #62625b;
  font-size: 11px;
  font-weight: 850;
  line-height: 1;
  margin: 0 0 7px 2px;
}
.selected-ingredients-scroll {
  display: flex;
  align-items: stretch;
  gap: 8px;
  width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  white-space: nowrap;
  scrollbar-width: none;
}
.selected-ingredients-scroll::-webkit-scrollbar { display: none; }
.remix-source-group {
  flex: 0 0 auto;
  width: min(360px, 72vw);
  display: grid;
  gap: 6px;
  padding: 8px;
  border: 1px solid #eeeeea;
  border-radius: 13px;
  background: #fafaf9;
}
.remix-source-head {
  appearance: none;
  border: 0;
  width: 100%;
  padding: 0;
  background: transparent;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  text-align: left;
  border-radius: 8px;
}
.remix-source-head:hover .remix-source-title {
  color: #e60023;
}
.remix-source-head:focus-visible {
  outline: 2px solid rgba(230, 0, 35, 0.35);
  outline-offset: 3px;
}
.remix-source-head:disabled {
  cursor: default;
}
.remix-source-head:disabled .remix-source-title {
  color: #62625b;
}
.remix-source-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: linear-gradient(135deg, #e60023, #ff8a3d);
}
.remix-source-title {
  min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  color: #62625b; font-size: 10px; font-weight: 700;
}
.remix-source-count {
  min-width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  color: #91918c;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 800;
}
.remix-source-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  max-height: 56px;
  overflow: auto;
  scrollbar-width: thin;
  scrollbar-color: #e0e0d9 transparent;
}
.remix-label-chip {
  position: relative;
  flex: 0 0 auto; max-width: 100%; min-height: 30px; display: inline-flex; align-items: center; gap: 4px;
  border: 1px solid rgba(230,0,35,.5); border-radius: 999px;
  padding: 6px 25px 6px 9px; background: rgba(255,255,255,.78);
  color: #e60023; font-size: 11px; line-height: 1.25;
}
.remix-label-chip:hover { background: #fff; border-color: #e60023; }
.remix-label-chip.emphasized {
  border-color: #ff6b35;
  background: linear-gradient(#fff7f4, #fff7f4) padding-box,
    linear-gradient(135deg, #e60023, #ff6b35, #ffb347) border-box;
}
.remix-label-chip .dim {
  color: #91918c; font-size: 10px;
}
.remix-chip-name {
  min-width: 0;
  overflow: visible;
  white-space: normal;
  overflow-wrap: anywhere;
}
.remix-chip-remove {
  position: absolute;
  right: 5px;
  bottom: 4px;
  width: 15px;
  height: 15px;
  border: 1px solid rgba(230,0,35,.22);
  border-radius: 50%;
  background: #fff;
  color: #e60023;
  font-size: 11px;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}
.remix-chip-remove:hover {
  background: #e60023;
  color: #fff;
  border-color: #e60023;
}
.remix-star {
  color: #d08a00; font-size: 10px; line-height: 1;
}
.kitchen-empty-state {
  width: 100%;
  padding: 12px;
  border-radius: 13px;
  border: 1px dashed #deded7;
  background: #fafaf9;
}
.kitchen-empty-title {
  color: #62625b;
  font-size: 12px;
  font-weight: 800;
}
.kitchen-empty-copy {
  margin-top: 3px;
  color: #9b9b93;
  font-size: 11px;
  line-height: 1.5;
  white-space: normal;
}
.seasoning-panel {
  margin-top: 2px;
}
.seasoning-title {
  color: #62625b;
  font-size: 11px;
  font-weight: 850;
  line-height: 1;
  margin: 0 0 7px 2px;
}
.remix-attachments {
  display: flex; align-items: center; gap: 6px;
  flex-wrap: wrap; margin-bottom: 8px;
}
.remix-attachment-thumb {
  position: relative; width: 48px; height: 48px;
  border-radius: 8px; border: 1px solid #e5e5e0; overflow: hidden;
  flex-shrink: 0; background: #f6f6f3;
  display: flex; align-items: center; justify-content: center;
}
.remix-attachment-thumb img {
  width: 100%; height: 100%; object-fit: cover;
}
.remix-attachment-thumb .att-placeholder {
  font-size: 9px; color: #91918c; text-align: center; padding: 4px; line-height: 1.3;
}
.att-remove-btn {
  position: absolute; top: 1px; right: 1px;
  width: 14px; height: 14px; background: rgba(0,0,0,.6);
  border: none; border-radius: 50%; color: #fff;
  font-size: 8px; cursor: pointer; display: flex;
  align-items: center; justify-content: center;
}
.remix-add-ref {
  width: 48px; height: 48px; border-radius: 8px;
  border: 1.5px dashed #e0e0d9; background: none;
  cursor: pointer; display: flex; align-items: center;
  justify-content: center; flex-shrink: 0; transition: border-color 0.15s;
  color: #91918c; font-size: 18px; line-height: 1;
}
.remix-add-ref:hover { border-color: #91918c; color: #62625b; }
.remix-input-row {
  display: flex; align-items: flex-end; gap: 8px; margin-bottom: 8px;
}
.remix-textarea {
  flex: 1; min-height: 52px; max-height: 100px; border: 1px solid #e5e5e0;
  border-radius: 12px; padding: 10px 12px; font-size: 13px; color: #211922;
  font-family: inherit; resize: none; outline: none;
  background: #fff; transition: border-color 0.15s, box-shadow 0.15s;
  line-height: 1.5;
}
.remix-textarea::placeholder { color: #91918c; }
.remix-textarea:focus {
  border-color: #bcbcb3;
  box-shadow: 0 0 0 3px rgba(230,0,35,.06);
}
.remix-send-btn {
  width: 36px; height: 36px; border-radius: 50%; border: none;
  background: #e60023; color: #fff; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; transition: background 0.15s, transform 0.15s;
  align-self: flex-end;
}
.remix-send-btn:hover { background: #c0001e; transform: scale(1.05); }
.remix-send-btn:disabled { background: #e0e0d9; cursor: not-allowed; transform: none; }
.remix-params {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  border-top: 1px solid #f0f0ec; padding-top: 8px;
}
.remix-action-row,
.remix-param-row {
  display: flex; align-items: center; flex-wrap: wrap; gap: 6px;
}
.param-btn {
  height: 24px; padding: 0 10px; border-radius: 12px;
  border: 1px solid #e5e5e0; background: #fff;
  font-size: 11px; color: #62625b; cursor: pointer;
  white-space: nowrap; transition: all 0.15s;
  display: inline-flex; align-items: center; gap: 4px;
}
.param-btn:hover { border-color: #91918c; color: #211922; }
.param-btn.active { background: #fef0f0; border-color: #e60023; color: #e60023; }
.param-select {
  height: 24px; padding: 0 8px; border-radius: 12px;
  border: 1px solid #e5e5e0; background: #fff;
  font-size: 11px; color: #62625b; cursor: pointer; outline: none;
  transition: border-color 0.15s; appearance: none; -webkit-appearance: none;
  padding-right: 20px;
  background-image: url("data:image/svg+xml,%3Csvg width='8' height='5' viewBox='0 0 8 5' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L4 4L7 1' stroke='%2391918c' stroke-width='1.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 7px center;
}
.param-select:focus { border-color: #bcbcb3; }
.remix-job-list {
  display: none;
  border-top: 1px solid #f0f0ec;
  margin-top: 8px; padding-top: 8px;
  overflow: hidden;
}
.remix-job-list.visible { display: block; }
.remix-job-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 0 1px 6px;
  color: #62625b;
  font-size: 10px;
  font-weight: 850;
}
.remix-job-head span:last-child {
  min-width: 18px;
  height: 18px;
  padding: 0 6px;
  border-radius: 999px;
  background: #f6f6f3;
  color: #91918c;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-variant-numeric: tabular-nums;
}
.remix-job-rows {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}
.remix-job-item {
  width: 100%; min-width: 0; height: 42px;
  border: 1px solid #eeeeea; border-radius: 10px;
  background: rgba(255,255,255,.86);
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr) minmax(0, 1fr);
  align-items: center;
  gap: 1px 6px;
  padding: 6px 8px; cursor: pointer; text-align: left;
  font-size: 11px; color: #62625b;
}
.remix-job-item:hover {
  border-color: #d6d6ce;
  background: #ffffff;
  box-shadow: 0 8px 18px rgba(0,0,0,.06);
}
.remix-job-dot {
  width: 7px; height: 7px; border-radius: 50%; background: #bcbcb3;
  grid-row: 1 / 3;
  grid-column: 1;
}
.remix-job-item.running .remix-job-dot { background: #0a84ff; box-shadow: 0 0 0 3px rgba(10,132,255,.1); }
.remix-job-item.done .remix-job-dot { background: #20a162; }
.remix-job-item.failed .remix-job-dot { background: #e60023; }
.remix-job-title {
  grid-column: 2;
  grid-row: 1;
  min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  color: #211922; font-weight: 700;
}
.remix-job-status {
  grid-column: 2;
  grid-row: 2;
  min-width: 0;
  max-width: calc(100% - 48px);
  overflow: hidden;
  text-overflow: ellipsis;
  color: #91918c; white-space: nowrap; font-size: 10px;
}
.remix-job-time {
  grid-column: 2;
  grid-row: 2;
  justify-self: end;
  color: #b0b0a8; white-space: nowrap; font-size: 10px;
  font-variant-numeric: tabular-nums;
}
.remix-job-pager {
  display: flex; justify-content: flex-end; align-items: center; gap: 5px;
  height: 22px; margin-top: 5px;
  color: #b0b0a8; font-size: 10px;
  font-variant-numeric: tabular-nums;
}
.remix-job-page-btn {
  width: 20px; height: 20px; border-radius: 50%;
  border: 1px solid #e5e5e0; background: #fff; color: #62625b;
  cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
  font-size: 14px; line-height: 1;
}
.remix-job-page-btn:hover:not(:disabled) { border-color: #bcbcb3; color: #211922; }
.remix-job-page-btn:disabled { opacity: .38; cursor: default; }

/* ---- Drawer: Results Area ---- */
.drawer-results {
  position: fixed;
  left: var(--waterfall-overlay-center);
  bottom: var(--results-bottom);
  z-index: 250;
  width: min(760px, calc(var(--waterfall-overlay-width) - 32px));
  max-height: calc(100vh - var(--results-bottom) - 80px);
  overflow: visible;
  padding: 0;
  transform: translate(-50%, 16px);
  opacity: 0;
  transition: opacity 0.18s ease, transform 0.18s ease;
  pointer-events: none;
}
#main-layout.drawer-open .drawer-results[style*="block"] {
  opacity: 1;
  transform: translate(-50%, 0);
  pointer-events: auto;
}
.results-title {
  display: none;
}
.results-collapse-btn {
  position: absolute;
  top: -15px;
  left: -15px;
  z-index: 10;
  width: 28px;
  height: 28px;
  border: 1.5px solid rgba(255,255,255,.96);
  border-radius: 50%;
  background: rgba(33,25,34,.84);
  color: #fff;
  cursor: pointer;
  font-size: 18px;
  font-weight: 700;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 28px rgba(0,0,0,.18);
  transition: background .15s ease, transform .15s ease;
}
.results-collapse-btn:hover {
  background: rgba(230,0,35,.9);
  transform: scale(1.04);
}
.result-cards-row {
  display: grid; grid-template-columns: 1fr 1.08fr 0.82fr;
  gap: 0; align-items: end;
  height: var(--result-row-height, auto);
  perspective: 900px;
  isolation: isolate;
}
.result-card {
  flex: 1; min-width: 0; background: #ffffff;
  border: 1px solid #e5e5e0; border-radius: 12px;
  padding: 12px; position: relative; overflow: hidden;
  box-shadow: 0 24px 62px rgba(0,0,0,.18);
  min-height: 0;
  height: 100%;
  transform-origin: 50% 92%;
  transition: transform .18s ease, box-shadow .18s ease;
}
.result-card.brief-card,
.result-card.prompt-card {
  margin-left: 0;
}
.result-cards-row .result-card.brief-card {
  z-index: 1;
  transform: rotate(-2.4deg) translate(5px, 14px);
}
.result-cards-row .result-card.prompt-card {
  z-index: 3;
  transform: rotate(.9deg) translate(-4px, -4px);
}
.result-cards-row .result-card.image-card {
  z-index: 2;
  transform: rotate(2.8deg) translate(-13px, 12px);
}
.result-cards-row .result-card:hover,
.result-cards-row .result-card:focus-within {
  z-index: 4;
  transform: rotate(0deg) translateY(-8px);
}
.result-card.brief-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  scrollbar-width: thin;
  scrollbar-color: #d8d8d0 transparent;
}
.result-card.prompt-card {
  background: #ffffff;
  border-color: #e60023;
  box-shadow: 0 0 0 2px rgba(230,0,35,.12), 0 26px 58px rgba(230,0,35,.2);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  scrollbar-width: thin;
  scrollbar-color: rgba(230,0,35,.28) transparent;
}
.result-card.prompt-card::before {
  content: none;
}
.result-card-label {
  font-size: 10px; font-weight: 700; letter-spacing: 0.06em;
  text-transform: uppercase; color: #91918c; margin-bottom: 8px;
}
.result-card.prompt-card .result-card-label {
  color: #e60023;
  flex: 0 0 auto;
  padding-right: 28px;
}
.result-card.brief-card .result-card-label {
  flex: 0 0 auto;
  padding-right: 28px;
}
.result-card-content {
  font-size: 11px; line-height: 1.6; color: #211922;
  max-height: 132px; overflow-y: auto;
  scrollbar-width: thin; scrollbar-color: #e0e0d9 transparent;
}
.result-card.brief-card .result-card-content {
  flex: 1 1 auto;
  min-height: 0;
  max-height: none;
  overflow-y: auto;
  background: #ffffff;
  border: 1px solid #eeeeea;
  border-radius: 8px;
  padding: 9px;
  line-height: 1.7;
  scrollbar-color: #d8d8d0 transparent;
}
.result-card-content.mono {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 10px; white-space: pre-wrap; word-break: break-all;
}
.result-card.prompt-card .result-card-content.mono {
  flex: 1 1 auto;
  min-height: 0;
  color: #211922;
  background: #fff8f9;
  border: 1px solid rgba(230,0,35,.12);
  border-radius: 8px;
  padding: 9px;
  line-height: 1.7;
  max-height: none;
  overflow-y: auto;
  scrollbar-color: rgba(230,0,35,.28) transparent;
}
.result-card .card-copy-btn {
  position: absolute; top: 8px; right: 8px;
  width: 20px; height: 20px; border: none;
  background: rgba(255,255,255,.8); border-radius: 5px;
  cursor: pointer; display: flex; align-items: center;
  justify-content: center; color: #62625b; transition: all 0.15s;
}
.result-card .card-copy-btn:hover { background: #fff; color: #211922; }
.result-card.prompt-card .card-copy-btn {
  background: #fff4f6;
  color: #e60023;
}
.result-card.prompt-card .card-copy-btn:hover {
  background: #e60023;
  color: #ffffff;
}
.result-loading {
  min-height: 76px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
}
.result-loading .gen-spinner {
  width: 16px;
  height: 16px;
  border-width: 2px;
  flex: 0 0 auto;
}
.result-loading-copy {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}
.result-loading-copy strong {
  font-size: 11px;
  line-height: 1.3;
}
.result-loading-copy small {
  font-size: 10px;
  line-height: 1.45;
  color: #91918c;
}
.result-card.image-card {
  transform: none; display: flex; flex-direction: column;
  overflow: visible;
  height: max-content;
}
.gen-img-placeholder {
  flex: 1; min-height: 112px; border: 1.5px dashed #e0e0d9;
  border-radius: 8px; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 8px;
  background: #fafaf9; cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.gen-img-placeholder:hover { border-color: #e60023; background: rgba(230,0,35,.03); }
.gen-img-placeholder .gen-label { font-size: 12px; font-weight: 600; color: #62625b; }
.gen-btn {
  width: 32px; height: 32px; border-radius: 50%;
  background: #e60023; border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center; color: #fff;
  transition: background 0.15s, transform 0.15s;
}
.gen-btn:hover { background: #c0001e; transform: scale(1.05); }
.gen-loading {
  display: none; flex-direction: column; align-items: center; gap: 6px; padding: 16px;
}
.gen-loading.visible { display: flex; }
.gen-spinner {
  width: 20px; height: 20px; border: 2px solid #e5e5e0;
  border-top-color: #e60023; border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.gen-img-result { display: none; flex-direction: column; gap: 6px; }
.gen-img-result.visible { display: flex; }
.gen-img-block { width: 100%; border-radius: 8px; overflow: hidden; }
.gen-img-block.has-image { position: relative; background: #f6f6f3; }
.gen-img-block.has-image img {
  width: 100%;
  height: auto;
  max-height: none;
  object-fit: contain;
  cursor: zoom-in;
}
.gen-img-block-inner {
  width: 100%; min-height: 96px; display: flex; align-items: center;
  justify-content: center; font-size: 10px; color: rgba(0,0,0,.3);
}
.gen-nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 28px; height: 28px; border: none; border-radius: 50%;
  background: rgba(255,255,255,.86); cursor: pointer; color: #211922;
  display: flex; align-items: center; justify-content: center;
}
.gen-nav.prev { left: 6px; }
.gen-nav.next { right: 6px; }
.gen-counter {
  position: absolute; left: 8px; bottom: 8px; padding: 2px 7px;
  border-radius: 999px; background: rgba(0,0,0,.48); color: #fff;
  font-size: 10px; font-variant-numeric: tabular-nums;
}
.gen-info-btn {
  position: absolute; top: 7px; right: 7px; width: 24px; height: 24px;
  border: 1.5px solid rgba(255,255,255,.95); border-radius: 50%;
  background: rgba(33,25,34,.72);
  color: #fff; cursor: pointer; font-weight: 800;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 14px; font-style: italic; line-height: 1;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 6px 18px rgba(0,0,0,.18);
  z-index: 2;
}
.gen-info-btn:hover { background: rgba(230,0,35,.88); }
.gen-info-popover {
  position: absolute; right: 0; bottom: calc(100% + 8px);
  width: min(330px, calc(var(--waterfall-overlay-width) - 40px));
  max-height: 260px;
  overflow: auto; display: none; z-index: 30; border-radius: 10px;
  border: 1px solid #e5e5e0; background: rgba(255,255,255,.96);
  box-shadow: 0 12px 30px rgba(0,0,0,.12); padding: 10px;
  font-size: 10px; line-height: 1.55; color: #62625b;
}
.gen-info-popover.open { display: block; }
.gen-info-popover strong { display: block; color: #211922; margin-bottom: 4px; }
.gen-detail-section {
  padding-top: 8px;
  margin-top: 8px;
  border-top: 1px solid #eeeeea;
}
.gen-detail-label {
  color: #211922;
  font-size: 10px;
  font-weight: 850;
  margin-bottom: 5px;
}
.gen-detail-text {
  white-space: pre-wrap;
  color: #211922;
  background: #fafaf9;
  border: 1px solid #eeeeea;
  border-radius: 8px;
  padding: 7px;
}
.gen-detail-ref-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}
.gen-detail-ref {
  margin: 0;
  min-width: 0;
}
.gen-detail-ref img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid #eeeeea;
  background: #fafaf9;
}
.gen-detail-ref figcaption {
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #91918c;
}
.gen-detail-ingredients {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}
.gen-detail-ingredient {
  max-width: 100%;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 6px;
  border: 1px solid #f1d7c2;
  border-radius: 999px;
  background: #fffaf5;
  color: #211922;
}
.gen-detail-ingredient-type {
  color: #e60023;
  font-weight: 850;
}
.gen-detail-ingredient-name {
  min-width: 0;
  overflow-wrap: anywhere;
}
.gen-detail-ingredient-source {
  color: #91918c;
}
.gen-detail-empty {
  color: #91918c;
  background: #fafaf9;
  border: 1px dashed #e5e5e0;
  border-radius: 8px;
  padding: 7px;
}
.status-line {
  margin-top: 8px; font-size: 11px; color: #91918c; line-height: 1.5;
}
.status-line.error { color: #e60023; }
.status-line.warn { color: #9a5a00; }
.gen-img-actions { display: flex; gap: 5px; }
.gen-action-btn {
  flex: 1; height: 26px; border-radius: 8px; border: 1px solid #e5e5e0;
  background: #fff; font-size: 11px; color: #62625b; cursor: pointer;
  transition: all 0.15s;
}
.gen-action-btn:hover { border-color: #91918c; color: #211922; }
.gen-action-btn.share { background: #e60023; border-color: #e60023; color: #fff; }
.gen-action-btn.share:hover { background: #c0001e; }
.gen-action-btn.share.done,
.gen-action-btn.share.done:hover {
  background: #11a35a;
  border-color: #11a35a;
  color: #fff;
  cursor: default;
}

/* ---- Generated image lightbox ---- */
.generated-lightbox {
  display: none; position: fixed; inset: 0; z-index: 760;
  align-items: center; justify-content: center;
  padding: 28px;
  background: rgba(17, 17, 16, .62);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.generated-lightbox.open { display: flex; }
.generated-lightbox-panel {
  position: relative;
  display: flex; flex-direction: column; align-items: center;
  gap: 12px;
  width: fit-content;
  max-width: min(92vw, 1180px);
  max-height: calc(100vh - 56px);
  padding: 14px;
  border-radius: 18px;
  background: rgba(255,255,255,.96);
  box-shadow: 0 28px 80px rgba(0,0,0,.32);
}
.generated-lightbox-panel img {
  display: block;
  width: auto;
  max-width: calc(92vw - 28px);
  max-height: calc(100vh - 150px);
  object-fit: contain;
  border-radius: 12px;
  background: #f6f6f3;
}
.generated-lightbox-close {
  position: absolute; top: 10px; right: 10px;
  width: 32px; height: 32px; border-radius: 50%;
  border: 1px solid rgba(229,229,224,.75);
  background: rgba(255,255,255,.9);
  color: #211922; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 8px 24px rgba(0,0,0,.12);
}
.generated-lightbox-close:hover { background: #fff; }
.generated-lightbox-actions {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  padding: 2px 0 0;
}
.lightbox-icon-btn {
  width: 42px; height: 42px; border-radius: 50%;
  border: 1px solid #e5e5e0; background: #fff;
  color: #62625b; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: transform .15s, border-color .15s, color .15s, background .15s;
}
.lightbox-icon-btn:hover {
  transform: translateY(-1px);
  border-color: #bcbcb3; color: #211922;
}
.lightbox-icon-btn.share {
  background: #e60023; border-color: #e60023; color: #fff;
}
.lightbox-icon-btn.share:hover { background: #c0001e; border-color: #c0001e; }
.lightbox-icon-btn:disabled { opacity: .55; cursor: wait; transform: none; }
.lightbox-icon-btn.done { color: #e60023; border-color: #e60023; }
.lightbox-icon-btn.share.done { background: #11a35a; border-color: #11a35a; color: #fff; }
.loading-dots::after {
  content: ''; animation: dots 1.2s steps(4, end) infinite;
}
@keyframes dots {
  0%, 20% { content: ''; }
  40%      { content: '.'; }
  60%      { content: '..'; }
  80%,100% { content: '...'; }
}

/* ---- Modal ---- */
.modal-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,.4); z-index: 500;
  align-items: center; justify-content: center;
}
.modal-overlay.open { display: flex; }
.modal-box {
  background: #ffffff; border-radius: 22px; width: min(1120px, calc(100vw - 40px));
  max-height: calc(100vh - 80px);
  overflow-y: auto; padding: 24px; position: relative;
  box-shadow: 0 20px 60px rgba(0,0,0,.18);
}
.modal-title-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin-bottom: 18px; padding-right: 34px;
}
.modal-title { font-size: 17px; font-weight: 700; color: #211922; }
.modal-subtitle { margin-top: 3px; font-size: 12px; color: #91918c; }
.modal-close {
  position: absolute; top: 14px; right: 14px; width: 26px; height: 26px;
  background: #f6f6f3; border: none; border-radius: 50%; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.modal-close:hover { background: #e5e5e0; }
.modal-cards {
  display: flex; align-items: flex-start; justify-content: center; gap: 14px;
  overflow-x: auto; padding: 8px 4px 14px; min-height: 430px;
  scrollbar-width: thin; scrollbar-color: #e0e0d9 transparent;
}
.modal-cards::-webkit-scrollbar { height: 5px; }
.modal-cards::-webkit-scrollbar-thumb { background: #e0e0d9; border-radius: 999px; }
.contribution-card {
  position: relative; flex: 0 0 320px; max-width: 320px;
  background: #ffffff; border: 1px solid #e5e5e0; border-radius: 18px;
  padding: 18px; box-shadow: 0 16px 42px rgba(0,0,0,.08);
  transform: rotate(-1.2deg); transform-origin: center bottom;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}
.contribution-card:nth-child(2) { transform: rotate(1deg); }
.contribution-card:nth-child(3) { transform: rotate(-0.7deg); }
.contribution-card:focus-within,
.contribution-card:hover {
  transform: rotate(0deg) translateY(-2px);
  border-color: #d4d4cc; box-shadow: 0 18px 48px rgba(0,0,0,.12);
}
.contribution-card-add {
  flex: 0 0 auto;
  width: 28px; height: 28px; border: none; border-radius: 50%;
  background: #e60023; color: #fff; cursor: pointer;
  font-size: 18px; line-height: 1; display: flex; align-items: center;
  justify-content: center; box-shadow: 0 8px 22px rgba(230,0,35,.22);
  transition: background 0.15s, transform 0.15s;
}
.contribution-card-add:hover { background: #c0001e; transform: translateY(-1px); }
.contribution-card-add:disabled {
  background: #e0e0d9; box-shadow: none; cursor: not-allowed;
}
.contribution-card-remove {
  position: absolute; top: 10px; right: 10px;
  width: 28px; height: 28px; border: none; border-radius: 50%;
  background: #f6f6f3; color: #62625b; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.contribution-card-remove:hover { background: #e5e5e0; color: #211922; }
.contribution-card-index {
  font-size: 11px; font-weight: 700; color: #e60023;
  margin-bottom: 10px; letter-spacing: 0.04em; text-transform: uppercase;
}
.form-label {
  display: block; font-size: 11px; font-weight: 600; color: #62625b;
  margin-bottom: 5px; margin-top: 14px; letter-spacing: 0.02em;
}
.form-label:first-of-type { margin-top: 0; }
.form-input {
  width: 100%; border: 1px solid #e5e5e0; border-radius: 12px;
  padding: 9px 13px; font-size: 13px; color: #211922; outline: none;
  transition: border-color 0.15s; background: #ffffff; font-family: inherit;
}
.form-input:focus { border-color: #bcbcb3; box-shadow: 0 0 0 3px rgba(230,0,35,.06); }
textarea.form-input { min-height: 72px; resize: vertical; }
.upload-zone {
  border: 2px dashed #e0e0d9; border-radius: 14px; padding: 28px 16px;
  text-align: center; cursor: pointer; transition: all 0.15s; position: relative;
}
.upload-zone:hover { border-color: #bcbcb3; background: #fafaf9; }
.upload-zone.drag-over { border-color: #e60023; background: rgba(230,0,35,.03); }
.upload-zone-text { font-size: 13px; color: #91918c; line-height: 1.6; }
.upload-zone-text strong { color: #211922; }
.upload-zone input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.upload-previews { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.upload-preview-item {
  position: relative; width: 68px; height: 68px; border-radius: 8px;
  overflow: hidden; border: 1px solid #e5e5e0;
}
.upload-preview-item img { width: 100%; height: 100%; object-fit: cover; }
.upload-preview-remove {
  position: absolute; top: 2px; right: 2px; width: 16px; height: 16px;
  background: rgba(0,0,0,.6); border: none; border-radius: 50%; color: #fff;
  font-size: 9px; cursor: pointer; display: flex; align-items: center; justify-content: center;
}
.btn-submit {
  width: 100%; height: 42px; background: #e60023; color: #ffffff;
  border: none; border-radius: 14px; font-size: 14px; font-weight: 600;
  cursor: pointer; transition: background 0.15s;
}
.btn-submit:hover { background: #c0001e; }
.btn-submit:disabled { background: #e0e0d9; cursor: not-allowed; }
.modal-submit-area {
  border-top: 1px solid #f0f0ec; padding-top: 14px; margin-top: 0;
}
.modal-add-row {
  display: flex; justify-content: center; padding: 0 0 14px;
}
.modal-feedback {
  margin-top: 14px; padding: 12px 14px; background: #f6f6f3;
  border-radius: 10px; font-size: 12px; color: #62625b; display: none;
}
.modal-feedback.visible { display: block; }
.modal-feedback .feedback-title { font-weight: 700; color: #211922; margin-bottom: 3px; }

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
  }
  .card-placeholder::before {
    display: none;
  }
}
