.emotion-state-launcher {
  position: relative;
  min-width: 0;
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 17px 15px;
  border: 1px solid rgba(117, 97, 155, 0.15);
  border-radius: 8px;
  overflow: hidden;
  color: #393451;
  background: linear-gradient(112deg, rgba(247, 244, 250, 0.96), rgba(233, 244, 241, 0.88));
}

.emotion-state-launcher::after {
  content: "";
  position: absolute;
  width: 170px;
  height: 170px;
  right: -104px;
  top: -107px;
  border-radius: 50%;
  background: rgba(132, 194, 184, 0.19);
  pointer-events: none;
}

.emotion-state-launcher-moon {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #e5ca7d;
  box-shadow: 0 0 24px rgba(226, 196, 112, 0.34);
  position: relative;
}

.emotion-state-launcher-moon::after {
  content: "";
  position: absolute;
  inset: -2px -2px 2px 11px;
  border-radius: 50%;
  background: #efedf4;
}

.emotion-state-launcher > div { min-width: 0; position: relative; z-index: 1; }
.emotion-state-launcher small { display: block; margin-bottom: 3px; color: #786d90; font-size: 11px; line-height: 1.45; }
.emotion-state-launcher strong { display: block; font-size: 15px; line-height: 1.45; font-weight: 650; letter-spacing: 0; }
.emotion-state-launcher p { margin: 4px 0 0; color: #777381; font-size: 12px; line-height: 1.58; }
.emotion-state-launcher > button {
  position: relative;
  z-index: 1;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  border: 0;
  padding: 0 2px 0 8px;
  color: #655286;
  background: transparent;
  font: inherit;
  font-size: 12px;
  font-weight: 650;
  white-space: nowrap;
  cursor: pointer;
}
.emotion-state-launcher > button svg { width: 17px; height: 17px; }

body.emotion-state-open { overflow: hidden; }
.emotion-state-layer { position: fixed; inset: 0; z-index: 1200; display: grid; place-items: end center; }
.emotion-state-layer[hidden] { display: none; }
.emotion-state-backdrop { position: absolute; inset: 0; border: 0; background: rgba(12, 10, 24, 0.68); backdrop-filter: blur(10px); }
.emotion-state-sheet {
  position: relative;
  width: min(100%, 1020px);
  max-height: 96dvh;
  overflow: auto;
  overscroll-behavior: contain;
  border-radius: 8px 8px 0 0;
  color: #302d3b;
  background: #f8f7f5;
  box-shadow: 0 -32px 96px rgba(15, 12, 31, 0.27);
}
.emotion-state-grabber { display: block; width: 36px; height: 4px; margin: 8px auto 1px; border-radius: 2px; background: #d3d0d5; }
.emotion-state-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; padding: 13px 18px 14px; }
.emotion-state-head small { display: block; margin-bottom: 3px; color: #73628d; font-size: 11px; line-height: 1.45; }
.emotion-state-head h2 { margin: 0; max-width: 30rem; font-size: 20px; line-height: 1.4; font-weight: 650; letter-spacing: 0; }
.emotion-state-close {
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  color: #6c6870;
  background: #eceaec;
  cursor: pointer;
}
.emotion-state-close svg { width: 19px; height: 19px; }
.emotion-state-loading,
.emotion-state-error,
.emotion-state-empty { min-height: 430px; display: grid; place-content: center; justify-items: center; gap: 16px; padding: 30px; text-align: center; color: #6f6976; }
.emotion-state-loading > span { width: 70px; height: 70px; border-radius: 50%; background: linear-gradient(145deg, #6659a8, #8fd1c5); box-shadow: 0 0 0 16px rgba(118, 105, 181, 0.08), 0 0 42px rgba(98, 184, 175, 0.2); animation: emotion-state-breathe 3.4s ease-in-out infinite; }
.emotion-state-empty .emotion-state-launcher-moon { width: 62px; height: 62px; }
.emotion-state-error button,
.emotion-state-empty button { min-height: 44px; border: 0; border-radius: 6px; padding: 0 18px; color: #fff; background: #66558d; font: inherit; cursor: pointer; }
@keyframes emotion-state-breathe { 50% { transform: scale(1.1); box-shadow: 0 0 0 26px rgba(118, 105, 181, 0.05), 0 0 64px rgba(98, 184, 175, 0.28); } }

.emotion-state-workspace { padding: 0 16px calc(28px + env(safe-area-inset-bottom)); }
.emotion-state-preview { display: grid; place-items: center; padding: 2px 0 15px; }
.emotion-state-card {
  position: relative;
  isolation: isolate;
  width: min(100%, 350px);
  aspect-ratio: 4 / 5;
  overflow: hidden;
  border-radius: 8px;
  color: #fffdf8;
  background: #181528;
  box-shadow: 0 22px 48px rgba(31, 25, 58, 0.21);
  transition: aspect-ratio 180ms ease, width 180ms ease;
}
.emotion-state-card.format-1-1 { aspect-ratio: 1 / 1; }
.emotion-state-card.format-9-16 { width: min(79%, 292px); aspect-ratio: 9 / 16; }
.emotion-card-art { position: absolute; inset: 0; z-index: -3; width: 100%; height: 100%; object-fit: cover; }
.emotion-card-shade { position: absolute; inset: 0; z-index: -2; background: linear-gradient(180deg, rgba(13, 11, 25, 0.24), rgba(13, 11, 25, 0.04) 44%, rgba(13, 11, 25, 0.48)); }
.emotion-state-card.photo-adapt .emotion-card-shade { background: linear-gradient(180deg, rgba(13, 11, 25, 0.36), rgba(13, 11, 25, 0.18) 42%, rgba(13, 11, 25, 0.56)); }
.emotion-card-photo-moon { position: absolute; top: 6%; right: 7%; width: 10%; aspect-ratio: 1; border-radius: 50%; background: #efd487; box-shadow: 0 0 22px rgba(239, 212, 135, 0.52); }
.emotion-card-awaiting { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 8px; color: rgba(255,255,255,.72); }
.emotion-card-awaiting svg { width: 28px; height: 28px; }
.emotion-card-copy {
  position: absolute;
  left: 9%;
  right: 8%;
  z-index: 2;
  touch-action: none;
  cursor: grab;
  text-shadow: 0 2px 18px rgba(9, 8, 17, 0.48);
}
.emotion-state-card[data-text-position="top"] .emotion-card-copy { top: 17%; }
.emotion-state-card[data-text-position="center"] .emotion-card-copy { top: 49%; transform: translateY(-50%); }
.emotion-state-card[data-text-position="bottom"] .emotion-card-copy { bottom: 17%; }
.emotion-state-card[data-text-position="manual"] .emotion-card-copy { left: calc(var(--copy-x) * 100%); right: 6%; top: calc(var(--copy-y) * 100%); transform: translateY(-10%); }
.emotion-card-copy > small { display: block; margin-bottom: 8px; color: rgba(255,255,255,.72); font-size: 10px; line-height: 1.4; }
.emotion-card-copy > p { margin: 0; max-width: 100%; color: #fffdf8; font-size: clamp(20px, 6.4vw, 29px); line-height: 1.55; font-weight: 600; letter-spacing: 0; overflow-wrap: anywhere; }
.emotion-card-copy > span { display: block; margin-top: 12px; color: rgba(255,255,255,.7); font-size: 10px; line-height: 1.5; }
.emotion-state-card.style-eastern_whitespace .emotion-card-copy > p { font-weight: 500; line-height: 1.7; }
.emotion-state-card.style-cold_editorial .emotion-card-copy > p,
.emotion-state-card.style-cyber_interface .emotion-card-copy > p { font-size: clamp(17px, 5.3vw, 24px); line-height: 1.55; }
.emotion-state-card.style-absurd_rescue .emotion-card-copy { transform: rotate(-1deg); }
.emotion-state-card[data-text-position="manual"].style-absurd_rescue .emotion-card-copy { transform: translateY(-10%) rotate(-1deg); }
.emotion-state-card footer { position: absolute; z-index: 2; left: 8%; right: 8%; bottom: 6%; display: flex; justify-content: space-between; align-items: center; gap: 10px; padding-top: 10px; border-top: 1px solid rgba(255,255,255,.18); color: rgba(255,255,255,.65); font-size: 8px; }
.emotion-state-card footer strong { color: rgba(255,255,255,.9); font-size: 10px; font-weight: 650; }

.emotion-state-privacy { display: flex; gap: 8px; align-items: flex-start; margin: 0 0 12px; color: #77717c; font-size: 11px; line-height: 1.62; }
.emotion-state-privacy svg { width: 15px; height: 15px; flex: 0 0 15px; margin-top: 1px; color: #715e91; }
.emotion-state-control { padding: 16px 0; border-top: 1px solid #e7e4e6; }
.emotion-state-control > strong { display: block; margin-bottom: 10px; color: #45414b; font-size: 12px; line-height: 1.5; font-weight: 650; }
.emotion-distance-control { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.emotion-distance-control button {
  min-width: 0;
  min-height: 64px;
  display: grid;
  align-content: center;
  gap: 3px;
  border: 1px solid #ddd9e1;
  border-radius: 7px;
  padding: 8px 5px;
  color: #746e79;
  background: #fff;
  font: inherit;
  cursor: pointer;
}
.emotion-distance-control button strong { font-size: 12px; font-weight: 620; }
.emotion-distance-control button small { font-size: 9px; line-height: 1.35; color: #918b95; }
.emotion-distance-control button.active { border-color: #756398; color: #4f4167; background: #f2eff7; box-shadow: inset 0 0 0 1px rgba(117, 99, 152, 0.08); }
.emotion-distance-control button:disabled { opacity: .42; cursor: default; }
.emotion-final-line { display: grid; gap: 6px; margin-top: 13px; }
.emotion-final-line > span { color: #514b57; font-size: 11px; font-weight: 620; }
.emotion-final-line textarea { width: 100%; min-height: 82px; border: 1px solid #dcd7e0; border-radius: 7px; padding: 11px 12px; color: #35303c; background: #fff; font: inherit; font-size: 14px; line-height: 1.7; resize: vertical; outline: 0; }
.emotion-final-line textarea:focus { border-color: #8170a0; box-shadow: 0 0 0 3px rgba(129, 112, 160, 0.11); }
.emotion-final-line > small { color: #88818c; font-size: 10px; line-height: 1.5; }

.emotion-style-list { display: grid; grid-auto-flow: column; grid-auto-columns: 116px; gap: 8px; overflow-x: auto; padding: 1px 1px 8px; scroll-snap-type: x proximity; scrollbar-width: none; }
.emotion-style-list::-webkit-scrollbar { display: none; }
.emotion-style-list button { min-width: 0; scroll-snap-align: start; display: grid; gap: 7px; border: 1px solid transparent; border-radius: 8px; padding: 5px; color: #716b77; background: transparent; text-align: left; font: inherit; cursor: pointer; }
.emotion-style-list button.active { border-color: #8878a6; color: #463957; background: #fff; box-shadow: 0 5px 16px rgba(49, 40, 65, 0.08); }
.emotion-style-list img { width: 100%; aspect-ratio: 4 / 3; border-radius: 5px; object-fit: cover; background: #242035; }
.emotion-style-list button > span { min-width: 0; display: grid; gap: 2px; }
.emotion-style-list strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; font-weight: 620; }
.emotion-style-list small { height: 2.7em; overflow: hidden; color: #8b858f; font-size: 8px; line-height: 1.35; }

.emotion-source-control { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
.emotion-source-control button { min-width: 0; min-height: 53px; display: flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid #ddd9e1; border-radius: 7px; padding: 0 8px; color: #706a77; background: #fff; font: inherit; font-size: 11px; cursor: pointer; }
.emotion-source-control button svg { width: 17px; height: 17px; flex: 0 0 17px; }
.emotion-source-control button.active { border-color: #756398; color: #4f4167; background: #f2eff7; }
.emotion-photo-panel { display: grid; gap: 10px; margin-top: 12px; padding: 12px 0 0; }
.emotion-photo-panel > p { display: flex; gap: 7px; margin: 0; color: #7e7882; font-size: 10px; line-height: 1.55; }
.emotion-photo-panel > p svg { width: 15px; height: 15px; flex: 0 0 15px; color: #5f867d; }
.emotion-photo-actions { display: flex; flex-wrap: wrap; gap: 7px; }
.emotion-photo-actions button { min-height: 39px; display: inline-flex; align-items: center; gap: 6px; border: 1px solid #d9d4de; border-radius: 6px; padding: 0 11px; color: #665a72; background: #fff; font: inherit; font-size: 10px; cursor: pointer; }
.emotion-photo-actions button.primary { border-color: #65538b; color: #fff; background: #65538b; }
.emotion-photo-actions svg { width: 15px; height: 15px; }
.emotion-photo-treatment,
.emotion-segment { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 3px; padding: 3px; border-radius: 7px; background: #ece9ed; }
.emotion-photo-treatment { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.emotion-photo-treatment button,
.emotion-segment button { min-height: 36px; border: 0; border-radius: 5px; padding: 0 5px; color: #77717d; background: transparent; font: inherit; font-size: 10px; cursor: pointer; }
.emotion-photo-treatment button.active,
.emotion-segment button.active { color: #443758; background: #fff; box-shadow: 0 2px 8px rgba(44, 37, 56, 0.08); font-weight: 620; }

.emotion-fine-tune { border-top: 1px solid #e7e4e6; }
.emotion-fine-tune > summary { min-height: 50px; display: flex; align-items: center; justify-content: space-between; gap: 12px; color: #625b69; font-size: 11px; font-weight: 620; cursor: pointer; list-style: none; }
.emotion-fine-tune > summary::-webkit-details-marker { display: none; }
.emotion-fine-tune > summary svg { width: 17px; height: 17px; color: #796991; }
.emotion-fine-tune-body { display: grid; gap: 8px; padding: 2px 0 15px; }
.emotion-fine-tune-body > label { margin-top: 5px; color: #716a77; font-size: 10px; }
.emotion-drag-hint,
.emotion-lunar-choice > p { margin: 0; color: #8b848f; font-size: 9px; line-height: 1.5; }
.emotion-lunar-choice { display: grid; gap: 7px; }

.emotion-state-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 15px; }
.emotion-state-actions button { min-width: 0; min-height: 48px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; border: 1px solid #d6d1dc; border-radius: 7px; padding: 0 10px; color: #5f536d; background: #fff; font: inherit; font-size: 11px; font-weight: 620; cursor: pointer; }
.emotion-state-actions button svg { width: 16px; height: 16px; }
.emotion-state-actions button.primary { border-color: #66558d; color: #fff; background: #66558d; }
.emotion-state-actions button.danger-quiet { grid-column: 1 / -1; min-height: 38px; border-color: transparent; color: #8b6972; background: transparent; }
.emotion-state-status { min-height: 20px; margin: 9px 0 0; color: #4d776d; text-align: center; font-size: 10px; line-height: 1.6; }
.emotion-state-status[data-error="true"] { color: #9a5860; }

@media (min-width: 760px) {
  .emotion-state-layer { place-items: center; padding: 28px; }
  .emotion-state-sheet { border-radius: 8px; max-height: calc(100dvh - 56px); }
  .emotion-state-grabber { display: none; }
  .emotion-state-head { padding: 22px 26px 16px; }
  .emotion-state-workspace { display: grid; grid-template-columns: minmax(340px, 0.9fr) minmax(380px, 1fr); column-gap: 32px; align-items: start; padding: 0 26px 28px; }
  .emotion-state-preview { grid-column: 1; grid-row: 1 / span 8; position: sticky; top: 4px; padding-right: 4px; }
  .emotion-state-privacy,
  .emotion-state-control,
  .emotion-fine-tune,
  .emotion-state-actions,
  .emotion-state-status { grid-column: 2; }
  .emotion-state-card { width: min(100%, 410px); }
  .emotion-state-card.format-9-16 { width: min(77%, 330px); }
  .emotion-card-copy > p { font-size: clamp(24px, 2.1vw, 31px); }
}

@media (max-width: 370px) {
  .emotion-state-launcher { grid-template-columns: 34px minmax(0, 1fr); padding: 14px 12px; }
  .emotion-state-launcher-moon { width: 32px; height: 32px; }
  .emotion-state-launcher > button { grid-column: 2; justify-self: start; min-height: 34px; padding-left: 0; }
  .emotion-state-head,
  .emotion-state-workspace { padding-left: 13px; padding-right: 13px; }
  .emotion-state-head h2 { font-size: 18px; }
  .emotion-state-card { width: min(100%, 294px); }
  .emotion-distance-control button { min-height: 59px; padding-left: 3px; padding-right: 3px; }
  .emotion-distance-control button strong { font-size: 11px; }
  .emotion-distance-control button small { font-size: 8px; }
  .emotion-style-list { grid-auto-columns: 104px; }
}

@media (prefers-reduced-motion: reduce) {
  .emotion-state-loading > span { animation: none; }
  .emotion-state-card { transition: none; }
}

body.v15 .thumb-nav {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
}
body.v15 .primary-panel {
  padding-bottom: calc(94px + env(safe-area-inset-bottom));
}
body.v15 .mobile-shell {
  padding-bottom: calc(84px + env(safe-area-inset-bottom));
}
body.v15[data-mode="qa"] .thumb-nav { grid-template-columns: repeat(6, minmax(0, 1fr)); }
body.v15 .thumb-nav button { padding-inline: 2px; }
@media (max-width: 350px) {
  body.v15 .thumb-nav { gap: 2px; padding-inline: 4px; }
  body.v15 .thumb-nav button { font-size: 0.61rem; }
  body.v15 .thumb-nav svg { width: 18px; height: 18px; }
}
