:root {
  --rose-900: #333c38;
  --rose-700: #567b6d;
  --rose-500: #f2a85d;
  --rose-300: #f7d9a3;
  --rose-200: #faebcd;
  --rose-100: #fffaf0;
  --cream: #fffdf5;
  --paper: rgba(255, 253, 246, 0.95);
  --mint: #b9e2cb;
  --mint-2: #e9f6ed;
  --lemon: #ffe9a5;
  --line: rgba(86, 123, 109, 0.2);
  --shadow: 0 22px 70px rgba(83, 121, 100, 0.17);
  --soft-shadow: 0 12px 36px rgba(83, 121, 100, 0.11);
  font-family: "Avenir Next Rounded", "Nunito", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  color: var(--rose-900);
  background:
    linear-gradient(90deg, rgba(140, 184, 153, 0.1) 1px, transparent 1px),
    linear-gradient(0deg, rgba(140, 184, 153, 0.1) 1px, transparent 1px),
    linear-gradient(135deg, #fffdf5 0%, #fff5e2 45%, #eaf7ed 100%);
  background-size: 36px 36px, 36px 36px, auto;
}

body[data-account="moli"] {
  --rose-900: #3e2634;
  --rose-700: #98607a;
  --rose-500: #f78fbd;
  --rose-300: #ffd4e6;
  --rose-200: #ffeaf2;
  --rose-100: #fff7fb;
  --cream: #fffdf4;
  --paper: rgba(255, 253, 247, 0.94);
  --mint: #bfeecf;
  --mint-2: #effcf1;
  --lemon: #fff7bd;
  --line: rgba(152, 96, 122, 0.16);
  --shadow: 0 24px 78px rgba(247, 143, 189, 0.2);
  --soft-shadow: 0 12px 34px rgba(160, 111, 129, 0.13);
  background:
    radial-gradient(circle at 14% 20%, rgba(255, 212, 230, 0.45) 0 9px, transparent 10px),
    radial-gradient(circle at 84% 12%, rgba(191, 238, 207, 0.46) 0 10px, transparent 11px),
    radial-gradient(circle at 76% 76%, rgba(255, 247, 189, 0.42) 0 13px, transparent 14px),
    linear-gradient(135deg, #fff7fb 0%, #fffdf4 47%, #f1fff4 100%);
  background-size: 160px 160px, 190px 190px, 230px 230px, auto;
}

body::before {
  content: "✳  ◦  ✳  ◦  ✳";
  position: fixed;
  top: 18px;
  left: 50%;
  z-index: 0;
  width: min(920px, 92vw);
  transform: translateX(-50%);
  color: rgba(86, 123, 109, 0.15);
  font-size: clamp(28px, 4vw, 48px);
  letter-spacing: 22px;
  text-align: center;
  pointer-events: none;
  white-space: nowrap;
}

body[data-account="moli"]::before {
  content: "茉莉  ✦  花影  ✦  绘梦";
  color: rgba(247, 143, 189, 0.18);
  font-size: clamp(24px, 3.4vw, 42px);
  letter-spacing: 16px;
}

button,
input,
textarea,
select {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

[hidden] {
  display: none !important;
}

.app {
  position: relative;
  z-index: 1;
  min-height: 100vh;
}

.login-card {
  position: fixed;
  inset: 50% auto auto 50%;
  width: min(430px, calc(100vw - 30px));
  transform: translate(-50%, -50%) rotate(-1deg);
  padding: 36px 32px 32px;
  border: 2px solid rgba(255, 255, 255, 0.84);
  border-radius: 38px;
  background:
    radial-gradient(circle at 90% 12%, rgba(201, 239, 154, 0.22), transparent 32%),
    linear-gradient(var(--paper), var(--paper)) padding-box,
    linear-gradient(135deg, var(--rose-300), var(--mint), var(--lemon)) border-box;
  box-shadow: var(--shadow);
  text-align: center;
  z-index: 10;
}

.login-card::before,
.creator-panel::before,
.result-card::before {
  content: "";
  position: absolute;
  width: 84px;
  height: 26px;
  border-radius: 999px;
  background: rgba(255, 216, 232, 0.78);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.7);
  transform: rotate(-8deg);
}

.login-card::before {
  top: -12px;
  left: 36px;
}

.app:not(.is-locked) .login-card {
  display: none;
}

.brand-badge {
  display: inline-grid;
  place-items: center;
  width: 82px;
  height: 82px;
  margin-bottom: 18px;
  border: 4px solid #fff;
  border-radius: 32px 32px 24px 32px;
  background: linear-gradient(135deg, #f7c676, #fff0c5 55%, #a9d9be);
  color: white;
  font-size: 23px;
  font-weight: 1000;
  box-shadow: 0 16px 34px rgba(83, 121, 100, 0.2);
  text-shadow: 0 2px 10px rgba(143, 66, 100, 0.28);
}

body[data-account="moli"] .brand-badge {
  width: 92px;
  height: 92px;
  border-radius: 50% 46% 50% 44%;
  background:
    radial-gradient(circle at 35% 28%, #fff 0 10px, transparent 11px),
    radial-gradient(circle at 56% 26%, #fff 0 9px, transparent 10px),
    radial-gradient(circle at 48% 45%, #fff8d7 0 9px, transparent 10px),
    linear-gradient(135deg, #ffd2e5, #fffdf4 58%, #bfeecf);
  color: #8b496a;
  box-shadow: 0 18px 38px rgba(247, 143, 189, 0.28);
  text-shadow: none;
}

.login-card h1 {
  margin: 0;
  font-size: 30px;
  letter-spacing: 0;
}

.login-card p {
  margin: 12px 0 24px;
  color: var(--rose-700);
  line-height: 1.7;
}

.login-form {
  display: flex;
  gap: 10px;
}

.login-form input,
.prompt-box textarea,
.control-row select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--rose-900);
  outline: none;
  box-shadow: inset 0 2px 10px rgba(143, 66, 100, 0.04);
}

.login-form input {
  min-width: 0;
  padding: 15px 18px;
}

.login-form button,
#submitButton {
  padding: 14px 24px;
  border: 3px solid #fff;
  border-radius: 999px;
  color: white;
  font-weight: 1000;
  background: linear-gradient(135deg, #ff6caf, #ff9ccd 54%, #ffcfdf);
  box-shadow: 0 13px 24px rgba(243, 111, 174, 0.32), inset 0 -2px 0 rgba(143, 66, 100, 0.08);
  white-space: nowrap;
}

.login-form button:hover,
#submitButton:hover {
  transform: translateY(-1px);
}

.studio {
  display: flex;
  min-height: 100vh;
  flex-direction: column;
}

.app.is-locked .studio {
  pointer-events: none;
  filter: blur(8px);
  opacity: 0.32;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px clamp(16px, 4vw, 50px) 18px;
}

.topbar > div {
  display: flex;
  align-items: center;
  gap: 12px;
}

.topbar strong {
  font-size: 30px;
  font-weight: 1000;
  text-shadow: 0 4px 0 rgba(255, 220, 233, 0.9);
}

body[data-account="moli"] .topbar strong {
  font-size: clamp(24px, 3vw, 34px);
  color: #563346;
  text-shadow: 0 5px 0 rgba(255, 234, 242, 0.9);
}

.topbar small {
  padding: 7px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.68);
  color: var(--rose-700);
  font-weight: 800;
}

.brand-dot {
  width: 28px;
  height: 28px;
  border: 4px solid #fff;
  border-radius: 50% 50% 38% 50%;
  background: linear-gradient(135deg, var(--rose-500), var(--mint));
  box-shadow: 0 0 0 7px rgba(255, 184, 214, 0.24);
}

body[data-account="moli"] .brand-dot {
  position: relative;
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 50%, #fff8c9 0 5px, transparent 6px),
    conic-gradient(from 10deg, #fff 0 18%, #ffd4e6 18% 30%, #fff 30% 48%, #bfeecf 48% 62%, #fff 62% 80%, #ffd4e6 80% 100%);
  box-shadow: 0 0 0 8px rgba(191, 238, 207, 0.22);
}

.ghost-button,
.tiny-button {
  border: 2px solid #fff;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--rose-700);
  font-weight: 900;
  box-shadow: var(--soft-shadow);
}

.ghost-button {
  padding: 11px 17px;
}

.tiny-button {
  padding: 8px 13px;
  font-size: 13px;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.03fr) minmax(340px, 0.97fr);
  gap: 24px;
  width: min(1450px, 100%);
  margin: 0 auto;
  padding: 0 clamp(16px, 4vw, 50px) 42px;
}

.left-stack {
  display: grid;
  gap: 22px;
  align-content: start;
}

.creator-panel,
.result-card,
.history-card,
.wheel-panel {
  position: relative;
  border: 2px solid rgba(255, 255, 255, 0.8);
  background:
    radial-gradient(circle at 92% 8%, rgba(201, 239, 154, 0.22), transparent 34%),
    linear-gradient(var(--paper), var(--paper)) padding-box,
    linear-gradient(135deg, rgba(255, 184, 214, 0.9), rgba(255, 244, 168, 0.6), rgba(205, 239, 143, 0.82)) border-box;
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

body[data-account="moli"] .creator-panel,
body[data-account="moli"] .result-card,
body[data-account="moli"] .history-card,
body[data-account="moli"] .wheel-panel,
body[data-account="moli"] .login-card {
  border-color: rgba(255, 255, 255, 0.88);
  background:
    radial-gradient(circle at 88% 8%, rgba(191, 238, 207, 0.26), transparent 30%),
    radial-gradient(circle at 8% 92%, rgba(255, 212, 230, 0.24), transparent 34%),
    linear-gradient(var(--paper), var(--paper)) padding-box,
    linear-gradient(135deg, rgba(255, 212, 230, 0.95), rgba(255, 253, 244, 0.85), rgba(191, 238, 207, 0.88)) border-box;
}

.creator-panel {
  padding: 26px;
  border-radius: 42px;
}

.wheel-panel {
  padding: 24px;
  border-radius: 42px;
}

.creator-panel::before {
  top: -11px;
  right: 78px;
  transform: rotate(7deg);
}

.result-card::before {
  top: -10px;
  left: 74px;
}

.wheel-panel::before {
  content: "";
  position: absolute;
  top: -10px;
  right: 112px;
  width: 76px;
  height: 25px;
  border-radius: 999px;
  background: rgba(255, 216, 232, 0.78);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.7);
  transform: rotate(-5deg);
}

.panel-head,
.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.panel-head h2 {
  display: inline-block;
  margin: 0 0 8px;
  padding: 4px 12px 8px;
  border-radius: 20px 24px 18px 24px;
  background: linear-gradient(180deg, transparent 52%, rgba(255, 216, 232, 0.88) 52%);
  font-size: 31px;
  font-weight: 1000;
  letter-spacing: 0;
}

body[data-account="moli"] .panel-head h2 {
  background: linear-gradient(180deg, transparent 58%, rgba(191, 238, 207, 0.55) 58%);
}

.panel-head p {
  margin: 0;
  color: var(--rose-700);
  line-height: 1.6;
}

.count-badge {
  flex: 0 0 auto;
  padding: 12px 16px;
  border: 3px solid #fff;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--mint-2), var(--cream));
  color: #6c852e;
  font-weight: 1000;
  box-shadow: var(--soft-shadow);
}

body[data-account="moli"] .count-badge {
  background: linear-gradient(135deg, #f0fff3, #fffdf4);
  color: #5e845f;
}

.drop-zone {
  display: flex;
  align-items: center;
  gap: 17px;
  min-height: 118px;
  margin: 24px 0;
  padding: 20px;
  border: 2px dashed rgba(243, 111, 174, 0.5);
  border-radius: 34px;
  background:
    linear-gradient(135deg, rgba(255, 242, 248, 0.9), rgba(255, 250, 242, 0.82), rgba(240, 251, 220, 0.3)),
    repeating-linear-gradient(-45deg, transparent 0 12px, rgba(255, 184, 214, 0.22) 12px 14px);
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

body[data-account="moli"] .drop-zone {
  border-color: rgba(247, 143, 189, 0.36);
  border-radius: 38px;
  background:
    radial-gradient(circle at 22px 22px, rgba(255, 255, 255, 0.86) 0 8px, transparent 9px),
    linear-gradient(135deg, rgba(255, 247, 251, 0.96), rgba(255, 253, 244, 0.9), rgba(239, 252, 241, 0.62));
  background-size: 72px 72px, auto;
}

.drop-zone:hover {
  transform: translateY(-2px);
  box-shadow: var(--soft-shadow);
}

.drop-zone input {
  display: none;
}

.drop-plus {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  border: 3px solid #fff;
  border-radius: 26px 28px 22px 28px;
  background: linear-gradient(135deg, #fff, #ffe5f0);
  color: var(--rose-500);
  font-size: 36px;
  font-weight: 1000;
  box-shadow: var(--soft-shadow);
}

body[data-account="moli"] .drop-plus {
  border-radius: 50%;
  background: linear-gradient(135deg, #fff, #fff0f7 54%, #effcf1);
  color: #e979ad;
}

.drop-zone div {
  display: grid;
  gap: 6px;
}

.drop-zone strong,
.section-head strong,
.prompt-box > span,
.control-row span {
  font-weight: 1000;
}

.drop-zone span,
.status-text,
.history-meta,
.prompt-box > span,
.control-row span,
.section-head span {
  color: var(--rose-700);
}

.preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(112px, 1fr));
  gap: 13px;
  margin-bottom: 20px;
}

.preview-grid.is-empty {
  display: none;
}

.preview-item {
  position: relative;
  aspect-ratio: 1;
  overflow: hidden;
  border: 4px solid #fff;
  border-radius: 28px;
  background: #fff;
  box-shadow: 0 10px 22px rgba(143, 66, 100, 0.12);
  transform: rotate(-0.5deg);
}

.preview-item:nth-child(even) {
  transform: rotate(0.8deg);
}

.preview-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.preview-item button {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 32px;
  height: 32px;
  border: 2px solid #fff;
  border-radius: 50%;
  background: rgba(255, 242, 248, 0.94);
  color: #b53a70;
  font-weight: 1000;
  box-shadow: var(--soft-shadow);
}

.preview-item small {
  position: absolute;
  left: 8px;
  bottom: 8px;
  max-width: calc(100% - 16px);
  padding: 5px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
  color: var(--rose-700);
  font-size: 11px;
  font-weight: 800;
}

.prompt-box {
  display: grid;
  gap: 10px;
}

.prompt-box textarea {
  min-height: 178px;
  resize: vertical;
  padding: 18px;
  line-height: 1.75;
  border-radius: 30px;
}

.prompt-box textarea:focus,
.control-row select:focus,
.login-form input:focus {
  border-color: rgba(243, 111, 174, 0.68);
  box-shadow: 0 0 0 5px rgba(255, 184, 214, 0.24), inset 0 2px 10px rgba(143, 66, 100, 0.04);
}

body[data-account="moli"] .prompt-box textarea:focus,
body[data-account="moli"] .control-row select:focus,
body[data-account="moli"] .login-form input:focus {
  border-color: rgba(247, 143, 189, 0.55);
  box-shadow: 0 0 0 5px rgba(191, 238, 207, 0.24), inset 0 2px 10px rgba(152, 96, 122, 0.04);
}

.control-row {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 13px;
  align-items: end;
  margin-top: 17px;
}

.control-row label {
  display: grid;
  gap: 8px;
}

.control-row select {
  height: 52px;
  padding: 0 15px;
}

#submitButton {
  height: 52px;
}

.scenario-chips {
  display: flex;
  gap: 9px;
  flex-wrap: wrap;
  margin-bottom: 13px;
}

.scenario-chips button,
.wheel-actions button,
#spinWheelButton {
  border: 2px solid #fff;
  border-radius: 999px;
  font-weight: 1000;
  box-shadow: var(--soft-shadow);
}

.scenario-chips button {
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.76);
  color: var(--rose-700);
}

.wheel-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px;
  gap: 20px;
  align-items: center;
  margin-top: 18px;
}

.wheel-form {
  min-width: 0;
}

.wheel-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 14px;
}

.wheel-actions button,
#spinWheelButton {
  padding: 11px 17px;
}

#generateWheelButton,
#spinWheelButton {
  color: white;
  background: linear-gradient(135deg, #f78fbd, #ffbed8 52%, #fff1f7);
}

.wheel-actions button:disabled,
#spinWheelButton:disabled {
  opacity: 0.55;
  cursor: wait;
}

.wheel-stage {
  display: grid;
  justify-items: center;
  gap: 12px;
  position: relative;
}

.wheel-pointer {
  width: 0;
  height: 0;
  border-right: 13px solid transparent;
  border-left: 13px solid transparent;
  border-top: 24px solid #f78fbd;
  filter: drop-shadow(0 4px 6px rgba(152, 96, 122, 0.18));
  z-index: 2;
}

.decision-wheel {
  position: relative;
  display: grid;
  place-items: center;
  width: 210px;
  height: 210px;
  margin-top: -4px;
  border: 8px solid #fff;
  border-radius: 50%;
  color: #7f4561;
  font-size: 22px;
  font-weight: 1000;
  box-shadow: 0 18px 42px rgba(143, 66, 100, 0.14);
  transition: transform 3.2s cubic-bezier(0.16, 0.84, 0.2, 1);
}

.wheel-center {
  position: relative;
  z-index: 3;
  display: grid;
  place-items: center;
  width: 88px;
  height: 88px;
  border: 5px solid #fff;
  border-radius: 50%;
  background: rgba(255, 253, 247, 0.88);
  box-shadow: 0 8px 22px rgba(143, 66, 100, 0.12);
}

.wheel-labels {
  position: absolute;
  inset: 0;
  z-index: 2;
  border-radius: 50%;
  pointer-events: none;
}

.wheel-label {
  position: absolute;
  top: 50%;
  left: 50%;
  display: block;
  width: 72px;
  margin: -11px 0 0 -36px;
  color: #6f3c56;
  font-size: 12px;
  font-weight: 1000;
  line-height: 1.15;
  text-align: center;
  text-shadow:
    0 1px 0 rgba(255, 255, 255, 0.95),
    0 -1px 0 rgba(255, 255, 255, 0.8),
    1px 0 0 rgba(255, 255, 255, 0.8),
    -1px 0 0 rgba(255, 255, 255, 0.8);
  transform-origin: 36px 11px;
  word-break: keep-all;
}

.wheel-result {
  min-height: 32px;
  padding: 8px 13px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--rose-700);
  font-weight: 1000;
  text-align: center;
}

.wheel-options {
  display: flex;
  gap: 9px;
  flex-wrap: wrap;
  margin-top: 17px;
}

.wheel-option {
  padding: 9px 13px;
  border: 2px solid #fff;
  border-radius: 999px;
  background: linear-gradient(135deg, #fff7fb, #effcf1);
  color: #8b496a;
  font-weight: 1000;
  box-shadow: 0 7px 16px rgba(143, 66, 100, 0.08);
}

.wheel-empty {
  padding: 14px 16px;
  border: 1px dashed rgba(247, 143, 189, 0.36);
  border-radius: 20px;
  color: var(--rose-700);
  background: rgba(255, 255, 255, 0.55);
}

#submitButton:disabled,
.login-form button:disabled {
  opacity: 0.55;
  cursor: wait;
  transform: none;
}

.result-panel {
  display: grid;
  gap: 20px;
  grid-template-rows: minmax(370px, auto) minmax(230px, 1fr);
}

.result-card,
.history-card {
  min-width: 0;
  padding: 20px;
  border-radius: 38px;
}

.section-head strong {
  font-size: 18px;
}

.result-view {
  display: grid;
  place-items: center;
  min-height: 320px;
  margin-top: 15px;
  overflow: hidden;
  border: 8px solid #fff;
  border-radius: 32px;
  background:
    linear-gradient(135deg, rgba(255, 250, 252, 0.82), rgba(255, 248, 237, 0.78), rgba(240, 251, 220, 0.22)),
    repeating-linear-gradient(90deg, transparent 0 18px, rgba(255, 184, 214, 0.12) 18px 20px);
  box-shadow: inset 0 0 0 1px rgba(143, 66, 100, 0.08);
}

body[data-account="moli"] .result-view {
  background:
    linear-gradient(135deg, rgba(255, 250, 253, 0.86), rgba(255, 253, 244, 0.82), rgba(239, 252, 241, 0.38)),
    radial-gradient(circle at 18px 18px, rgba(255, 212, 230, 0.32) 0 4px, transparent 5px);
  background-size: auto, 46px 46px;
}

.empty-state {
  padding: 30px;
  color: var(--rose-700);
  text-align: center;
  line-height: 1.7;
}

.loading-state {
  display: grid;
  gap: 13px;
  place-items: center;
  color: var(--rose-700);
  font-weight: 900;
}

.loading-heart {
  width: 46px;
  height: 46px;
  border: 4px solid #fff;
  border-radius: 18px 18px 14px 18px;
  background: linear-gradient(135deg, var(--rose-500), var(--rose-300), var(--mint));
  box-shadow: var(--soft-shadow);
  animation: pulse 1.2s infinite ease-in-out;
}

@keyframes pulse {
  0%, 100% { transform: scale(0.9) rotate(-7deg); opacity: 0.75; }
  50% { transform: scale(1.06) rotate(7deg); opacity: 1; }
}

.result-image {
  width: 100%;
  padding: 10px;
}

.result-image img {
  display: block;
  width: 100%;
  max-height: 68vh;
  object-fit: contain;
  border: 6px solid #fff;
  border-radius: 28px;
  box-shadow: 0 18px 42px rgba(143, 66, 100, 0.14);
}

.result-actions {
  display: flex;
  justify-content: center;
  padding-top: 14px;
}

.result-refs {
  margin-top: 15px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.68);
}

.result-refs-title {
  margin-bottom: 10px;
  color: var(--rose-700);
  font-size: 13px;
  font-weight: 1000;
}

.download-button {
  padding: 11px 18px;
  border: 3px solid #fff;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--mint-2), #fff);
  color: #65841f;
  font-weight: 1000;
  text-decoration: none;
  box-shadow: var(--soft-shadow);
}

body[data-account="moli"] .download-button,
body[data-account="moli"] .history-actions button:first-child {
  background: linear-gradient(135deg, #effcf1, #fffdf4);
  color: #5e845f;
}

body[data-account="moli"] .login-form button,
body[data-account="moli"] #submitButton,
body[data-account="moli"] #generateWheelButton,
body[data-account="moli"] #spinWheelButton {
  background: linear-gradient(135deg, #f78fbd, #ffbed8 52%, #fff1f7);
  box-shadow: 0 13px 24px rgba(247, 143, 189, 0.27), inset 0 -2px 0 rgba(152, 96, 122, 0.06);
}

body[data-account="moli"] .history-item.is-active {
  border-color: rgba(191, 238, 207, 0.78);
  box-shadow: 0 0 0 5px rgba(191, 238, 207, 0.24), 0 8px 18px rgba(143, 66, 100, 0.07);
}

.error-state {
  padding: 24px;
  color: #b53a70;
  font-weight: 900;
  text-align: center;
}

.history-list {
  display: grid;
  gap: 11px;
  max-height: 430px;
  margin-top: 13px;
  overflow: auto;
  padding-right: 4px;
}

.history-item {
  display: grid;
  gap: 9px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.76);
  box-shadow: 0 8px 18px rgba(143, 66, 100, 0.07);
}

.history-item.is-active {
  border-color: rgba(243, 111, 174, 0.56);
  box-shadow: 0 0 0 5px rgba(255, 184, 214, 0.24), 0 8px 18px rgba(143, 66, 100, 0.07);
}

.history-title {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-weight: 1000;
}

.history-prompt {
  display: -webkit-box;
  overflow: hidden;
  color: var(--rose-700);
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-height: 1.48;
}

.reference-strip {
  display: flex;
  gap: 9px;
  overflow-x: auto;
  padding: 2px 2px 6px;
}

.reference-strip a {
  display: block;
  flex: 0 0 72px;
  width: 72px;
  height: 72px;
  overflow: hidden;
  border: 3px solid #fff;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 7px 16px rgba(143, 66, 100, 0.1);
}

.reference-strip img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.reference-strip.is-compact {
  gap: 7px;
  padding-bottom: 3px;
}

.reference-strip.is-compact a {
  flex-basis: 48px;
  width: 48px;
  height: 48px;
  border-radius: 14px;
  border-width: 2px;
}

.reference-more {
  display: grid;
  place-items: center;
  flex: 0 0 48px;
  height: 48px;
  border: 2px solid #fff;
  border-radius: 14px;
  background: var(--mint-2);
  color: #65841f;
  font-weight: 1000;
  box-shadow: 0 7px 16px rgba(143, 66, 100, 0.08);
}

.history-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.history-actions button {
  padding: 8px 12px;
  border: 2px solid #fff;
  border-radius: 999px;
  background: #fff2f8;
  color: #a84773;
  font-size: 13px;
  font-weight: 1000;
  box-shadow: 0 6px 14px rgba(143, 66, 100, 0.08);
}

.history-actions button:first-child {
  background: var(--mint-2);
  color: #65841f;
}

.status-text {
  min-height: 22px;
  margin-top: 12px;
  font-size: 14px;
  font-weight: 800;
}

@media (max-width: 980px) {
  .workspace {
    grid-template-columns: 1fr;
  }

  .result-panel {
    grid-template-rows: auto auto;
  }

  .wheel-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 620px) {
  body::before {
    top: 8px;
    letter-spacing: 10px;
  }

  .topbar {
    padding: 16px;
  }

  .topbar strong {
    font-size: 27px;
  }

  .topbar small {
    display: none;
  }

  .workspace {
    padding: 0 12px 28px;
  }

  .creator-panel,
  .result-card,
  .history-card,
  .wheel-panel {
    border-radius: 30px;
  }

  .creator-panel,
  .wheel-panel {
    padding: 17px;
  }

  .panel-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .panel-head h2 {
    font-size: 27px;
  }

  .drop-zone {
    min-height: 106px;
  }

  .control-row {
    grid-template-columns: 1fr;
  }

  .decision-wheel {
    width: min(230px, 68vw);
    height: min(230px, 68vw);
  }

  .login-form {
    flex-direction: column;
  }

  .login-card {
    padding: 28px 24px;
    border-radius: 32px;
  }
}
