/* =========================================================
   月雅衣橱 · 换装间
   手写 CSS，无外链字体 / 图片依赖
   ========================================================= */

:root {
  --ink: #22344f;
  --ink-soft: #3f536e;
  --muted: #7d91ab;
  --muted-light: #a5b6ca;
  --blue: #6aa7ee;
  --blue-deep: #3d77c2;
  --blue-soft: #e5f1ff;
  --frost: #f5faff;
  --paper: #ffffff;
  --line: #dce9f7;
  --line-strong: #c3d7ec;
  --periwinkle: #a8b9f4;
  --moon: #a6d3f3;
  --aqua: #a3d9e6;
  --sky: #b9d8f8;
  --shadow-sm: 0 2px 6px rgba(47, 78, 117, .06), 0 7px 20px rgba(47, 78, 117, .05);
  --shadow-md: 0 8px 24px rgba(47, 78, 117, .10), 0 20px 55px rgba(47, 78, 117, .08);
  --shadow-pop: 0 18px 43px rgba(43, 69, 105, .16);
  --radius-xl: 32px;
  --radius-lg: 24px;
  --radius-md: 18px;
  --font: "Microsoft YaHei", "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", sans-serif;
  --font-round: "YouYuan", "幼圆", "Microsoft YaHei", "PingFang SC", sans-serif;
  --ease: cubic-bezier(.2, .8, .25, 1);
  --ease-bounce: cubic-bezier(.2, .9, .35, 1.15);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: #eaf4ff;
}

body {
  margin: 0;
  height: 100dvh;
  overflow: hidden;
  color: var(--ink);
  font-family: var(--font);
  background:
    radial-gradient(circle at 53% 48%, #fbfdff 0, #eef7ff 35%, #dfedff 68%, #d5e3ff 100%);
  -webkit-font-smoothing: antialiased;
}

button,
input {
  font: inherit;
}

button {
  color: inherit;
}

button,
a,
input,
label {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
a:focus-visible,
input:focus-visible {
  outline: 3px solid rgba(115, 170, 232, .4);
  outline-offset: 2px;
}

button {
  border: 0;
}

body.has-modal {
  overflow: hidden;
}

[hidden] {
  display: none !important;
}

/* ------------------------------ page decor ------------------------------ */

.page-deco {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.deco-blob {
  position: absolute;
  display: block;
  border-radius: 50%;
  filter: blur(1px);
  opacity: .68;
}

.blob-a {
  width: 420px;
  height: 420px;
  left: -150px;
  top: -150px;
  background: radial-gradient(circle at 60% 60%, #cfe6ff, rgba(207, 230, 255, 0));
}

.blob-b {
  width: 540px;
  height: 540px;
  right: -220px;
  top: 6%;
  background: radial-gradient(circle at 40% 50%, #d8dcff, rgba(216, 220, 255, 0));
}

.blob-c {
  width: 520px;
  height: 360px;
  left: 31%;
  bottom: -240px;
  background: radial-gradient(circle at 50% 40%, #c9edf5, rgba(201, 237, 245, 0));
}

.deco-grid {
  position: absolute;
  inset: 0;
  opacity: .23;
  background-image: radial-gradient(rgba(155, 173, 193, .32) .7px, transparent .7px);
  background-size: 22px 22px;
  mask-image: linear-gradient(to bottom, transparent, #000000 18%, #000000 82%, transparent);
}

/* ------------------------------ topbar ------------------------------ */

.topbar {
  position: relative;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 24px;
  height: 76px;
  padding: 16px 30px 0;
  max-width: 1720px;
  margin: 0 auto;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  flex: 0 0 auto;
  color: var(--blue-deep);
  text-decoration: none;
  border-radius: 18px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  color: #5b92d0;
  background: rgba(255, 255, 255, .72);
  border: 1px solid rgba(255, 255, 255, .95);
  border-radius: 17px;
  box-shadow: 0 7px 18px rgba(100, 140, 185, .13);
  transform: rotate(-3deg);
}

.brand-mark svg {
  width: 38px;
  height: 38px;
}

.brand-copy {
  display: flex;
  flex-direction: column;
  line-height: 1;
}

.brand-copy strong {
  color: var(--ink);
  font-family: var(--font-round);
  font-size: 22px;
  letter-spacing: .08em;
  font-weight: 800;
}

.brand-copy small {
  margin-top: 6px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .22em;
}

.top-note {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex: 1;
  color: #8798ac;
  font-size: 13px;
  letter-spacing: .05em;
}

.top-note-star {
  color: #b1ceef;
  font-size: 11px;
}

.top-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex: 0 0 auto;
}

.action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 42px;
  padding: 0 14px;
  border: 1px solid rgba(255, 255, 255, .94);
  border-radius: 14px;
  background: rgba(255, 255, 255, .63);
  box-shadow: 0 3px 10px rgba(80, 101, 126, .05);
  color: #5f6d7c;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: transform .2s var(--ease), background .2s, box-shadow .2s, color .2s;
}

.action-btn svg {
  width: 17px;
  height: 17px;
}

.action-btn:hover {
  color: var(--ink);
  background: #ffffff;
  box-shadow: 0 7px 18px rgba(80, 101, 126, .1);
  transform: translateY(-1px);
}

.action-btn:active {
  transform: translateY(0) scale(.98);
}

.action-btn:disabled {
  opacity: .38;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.action-primary {
  color: #ffffff;
  background: linear-gradient(135deg, #71b4f4, #3f84d4);
  border-color: transparent;
  box-shadow: 0 7px 20px rgba(52, 122, 197, .26);
}

.action-primary:hover {
  color: #ffffff;
  background: linear-gradient(135deg, #83c2fb, #3479c9);
  box-shadow: 0 9px 22px rgba(52, 122, 197, .34);
}

/* ------------------------------ layout ------------------------------ */

.workspace {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 164px minmax(0, 1fr) 462px;
  gap: 18px;
  height: calc(100dvh - 96px);
  max-width: 1720px;
  margin: 0 auto;
  padding: 12px 30px 18px;
}

/* ------------------------------ left rail ------------------------------ */

.left-rail {
  display: flex;
  flex-direction: column;
  gap: 14px;
  align-self: start;
  min-width: 0;
  width: 100%;
  height: 100%;
  min-height: 0;
}

.left-rail .layer-dock {
  max-height: calc(100% - 300px);
}

.weather-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 7px;
  width: 100%;
  padding: 13px 13px 12px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .95);
  border-radius: 22px;
  background:
    radial-gradient(circle at 85% 18%, rgba(255, 255, 255, .9), transparent 44%),
    linear-gradient(155deg, rgba(250, 254, 255, .96), rgba(225, 240, 255, .9));
  box-shadow: var(--shadow-sm);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  transition: transform .22s var(--ease), box-shadow .22s, border-color .22s;
}

.weather-card::before {
  content: "";
  position: absolute;
  width: 76px;
  height: 76px;
  right: -30px;
  top: -38px;
  border: 14px solid rgba(255, 255, 255, .28);
  border-radius: 50%;
  pointer-events: none;
}

.weather-card:hover {
  border-color: rgba(151, 197, 238, .8);
  box-shadow: 0 9px 24px rgba(48, 92, 138, .12);
  transform: translateY(-2px);
}

.weather-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 5px;
}

.weather-eyebrow {
  color: #8ca4bd;
  font-size: 7px;
  font-weight: 800;
  letter-spacing: .13em;
  white-space: nowrap;
}

.weather-state {
  max-width: 72px;
  overflow: hidden;
  color: #a0b3c6;
  font-size: 7px;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.weather-main {
  display: flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
}

.weather-emoji {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  width: 33px;
  height: 33px;
  border-radius: 11px;
  background: rgba(255, 255, 255, .72);
  font-size: 20px;
  line-height: 1;
  box-shadow: 0 3px 9px rgba(59, 104, 153, .08);
}

.weather-temp {
  color: #2c4d70;
  font-family: "Segoe UI", "Microsoft YaHei", sans-serif;
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -.03em;
  line-height: 1;
}

.weather-arrow {
  margin-left: auto;
  color: #83a7ca;
  font-size: 15px;
}

.weather-place {
  overflow: hidden;
  color: #4c6887;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.25;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.weather-meta {
  overflow: hidden;
  color: #93a8bd;
  font-size: 8px;
  line-height: 1.4;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.weather-card.is-loading .weather-emoji {
  animation: weather-pulse 1.1s ease-in-out infinite;
}

@keyframes weather-pulse {
  0%, 100% { opacity: .5; transform: scale(.94); }
  50% { opacity: 1; transform: scale(1.04); }
}

.ai-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 11px 10px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .95);
  border-radius: 20px;
  background:
    radial-gradient(circle at 88% 12%, rgba(255, 255, 255, .9), transparent 40%),
    linear-gradient(150deg, rgba(249, 248, 255, .96), rgba(230, 232, 255, .92));
  box-shadow: var(--shadow-sm);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  transition: transform .22s var(--ease), box-shadow .22s, border-color .22s;
}

.ai-card::after {
  content: "✦";
  position: absolute;
  right: 9px;
  top: 7px;
  color: rgba(146, 157, 222, .4);
  font-size: 8px;
  pointer-events: none;
}

.ai-card:hover {
  border-color: rgba(175, 185, 239, .8);
  box-shadow: 0 9px 24px rgba(64, 78, 144, .12);
  transform: translateY(-2px);
}

.ai-avatar {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 33px;
  height: 33px;
  border-radius: 11px;
  background: rgba(255, 255, 255, .78);
  color: #7f8fd4;
  font-size: 16px;
  box-shadow: 0 3px 9px rgba(89, 99, 166, .1);
}

.ai-card-copy {
  display: flex;
  flex-direction: column;
  gap: 1px;
  flex: 1;
  min-width: 0;
}

.ai-eyebrow {
  color: #9aa5c4;
  font-size: 6.5px;
  font-weight: 800;
  letter-spacing: .14em;
}

.ai-card-copy strong {
  color: #45557e;
  font-family: var(--font-round);
  font-size: 11px;
  font-weight: 800;
}

.ai-card-copy small {
  overflow: hidden;
  color: #98a4bd;
  font-size: 7px;
  line-height: 1.4;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.ai-card-arrow {
  flex: 0 0 auto;
  color: #8e9fcc;
  font-size: 13px;
}

/* ------------------------------ layer dock ------------------------------ */

.layer-dock {
  display: flex;
  flex-direction: column;
  align-self: start;
  min-width: 0;
  min-height: 0;
  height: auto;
  max-height: 100%;
  padding: 18px 12px 13px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .94);
  border-radius: 28px;
  background: linear-gradient(180deg, rgba(252, 254, 255, .94), rgba(238, 247, 255, .84));
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(22px);
}

.layer-dock-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 3px;
}

.layer-head-icon {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  border: 1px solid #d2e6fb;
  border-radius: 10px;
  background: #e4f1ff;
  color: #3d77c2;
}

.layer-head-icon svg {
  width: 20px;
  height: 20px;
}

.layer-head-copy {
  min-width: 0;
  flex: 1;
}

.layer-eyebrow {
  display: block;
  color: #91a7c0;
  font-size: 7px;
  font-weight: 800;
  letter-spacing: .16em;
  white-space: nowrap;
}

.layer-head-copy h2 {
  margin: 2px 0 0;
  color: #2c4665;
  font-family: var(--font-round);
  font-size: 17px;
  font-weight: 800;
  letter-spacing: .08em;
  line-height: 1.1;
}

.layer-count {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 8px;
  background: #e1efff;
  color: #3d77c2;
  font-family: "Segoe UI", "Microsoft YaHei", sans-serif;
  font-size: 10px;
  font-weight: 700;
}

.layer-note {
  margin: 9px 4px 9px;
  color: #8fa3b9;
  font-size: 8px;
  letter-spacing: .03em;
}

.layer-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
  flex: 0 1 auto;
  min-height: 0;
  max-height: 460px;
  padding: 2px 2px 6px;
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: #c9ddf2 transparent;
}

.layer-list::-webkit-scrollbar {
  width: 4px;
}

.layer-list::-webkit-scrollbar-thumb {
  border-radius: 8px;
  background: #c9ddf2;
}

.layer-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
  min-height: 50px;
  padding: 6px 5px 6px 6px;
  border: 1px solid #e7f0fa;
  border-radius: 12px;
  background: rgba(255, 255, 255, .9);
  cursor: pointer;
  transition: border-color .18s, background .18s, box-shadow .18s;
}

.layer-row:hover {
  border-color: #c3dcf3;
  box-shadow: 0 4px 11px rgba(49, 95, 146, .08);
}

.layer-row.is-selected {
  border-color: #75b4f2;
  background: #f1f9ff;
  box-shadow: 0 4px 12px rgba(56, 129, 200, .13);
}

.layer-thumb {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 32px;
  height: 34px;
  overflow: hidden;
  border-radius: 8px;
  background: linear-gradient(145deg, #f5faff, #e7f2ff);
}

.layer-thumb img {
  display: block;
  width: 90%;
  height: 90%;
  object-fit: contain;
  filter: drop-shadow(0 2px 3px rgba(57, 93, 132, .12));
  pointer-events: none;
}

.layer-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 0;
}

.layer-name {
  overflow: hidden;
  color: #405a76;
  font-size: 9px;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.layer-kind {
  overflow: hidden;
  color: #93a8bd;
  font-size: 7px;
  line-height: 1.2;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.layer-arrows {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 0 0 auto;
}

.layer-move {
  display: grid;
  place-items: center;
  width: 20px;
  height: 18px;
  border-radius: 5px;
  background: #eef7ff;
  color: #4f86c2;
  font-family: "Segoe UI", sans-serif;
  font-size: 10px;
  line-height: 1;
  cursor: pointer;
  transition: .15s;
}

.layer-move:hover:not(:disabled) {
  background: #dceeff;
  color: #2d6eb6;
}

.layer-move:disabled {
  opacity: .25;
  cursor: not-allowed;
}

.layer-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
  min-height: 150px;
  padding: 18px 8px;
  text-align: center;
}

.layer-empty-icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin-bottom: 10px;
  border-radius: 14px;
  background: #eaf4ff;
  color: #86a8c9;
}

.layer-empty-icon svg {
  width: 26px;
  height: 26px;
}

.layer-empty strong {
  color: #5c7591;
  font-family: var(--font-round);
  font-size: 11px;
}

.layer-empty p {
  margin: 5px 0 0;
  color: #9aafc4;
  font-size: 8px;
  line-height: 1.65;
}

.layer-reset {
  flex: 0 0 auto;
  margin-top: 8px;
  padding: 8px 6px;
  border: 1px dashed #cfe1f3;
  border-radius: 10px;
  background: rgba(255, 255, 255, .45);
  color: #839bb3;
  font-size: 8px;
  font-weight: 700;
  cursor: pointer;
  transition: .2s;
}

.layer-reset:not(:disabled) {
  border-color: #b9d4ec;
  background: rgba(255, 255, 255, .72);
  color: #4d7dab;
}

.layer-reset:hover:not(:disabled) {
  border-color: #8dbce8;
  background: #ffffff;
  color: #3f78b8;
}

.layer-reset:disabled {
  opacity: .45;
  cursor: not-allowed;
}

/* ------------------------------ stage card ------------------------------ */

.stage-column {
  min-width: 0;
  min-height: 0;
}

.stage-card {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  padding: 17px 22px 16px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .92);
  border-radius: var(--radius-xl);
  background:
    radial-gradient(circle at 50% 34%, rgba(255, 255, 255, .97) 0, rgba(235, 246, 255, .58) 23%, rgba(221, 238, 255, 0) 55%),
    linear-gradient(145deg, #f1f9ff 0%, #e4f1ff 38%, #dbeaff 70%, #e4e7ff 100%);
  box-shadow: var(--shadow-md);
  isolation: isolate;
}

.stage-card::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  opacity: .36;
  background-image: radial-gradient(rgba(113, 158, 213, .34) .8px, transparent .8px);
  background-size: 20px 20px;
  mask-image: linear-gradient(145deg, #000000 0, transparent 55%);
}

.stage-card::after {
  content: "";
  position: absolute;
  z-index: -1;
  width: 310px;
  height: 310px;
  right: -165px;
  bottom: -120px;
  border-radius: 50%;
  border: 45px solid rgba(255, 255, 255, .24);
}

.stage-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex: 0 0 auto;
  height: 30px;
}

.stage-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: #6d7c8e;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .16em;
}

.live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #82b3eb;
  box-shadow: 0 0 0 4px rgba(130, 179, 235, .14);
}

.look-no {
  padding: 5px 9px;
  border-radius: 7px;
  background: rgba(255, 255, 255, .54);
  color: #8b9bad;
  font-size: 9px;
  letter-spacing: .12em;
}

.stage-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.soft-icon-btn {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 1px solid rgba(255, 255, 255, .8);
  border-radius: 11px;
  background: rgba(255, 255, 255, .43);
  color: #708093;
  cursor: pointer;
  transition: .2s var(--ease);
}

.soft-icon-btn:hover,
.soft-icon-btn[aria-pressed="true"] {
  color: var(--blue-deep);
  background: rgba(255, 255, 255, .9);
  box-shadow: 0 3px 9px rgba(87, 112, 140, .09);
}

.soft-icon-btn svg {
  width: 17px;
  height: 17px;
}

.body-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  height: 32px;
  padding: 0 9px;
  border: 1px solid rgba(255, 255, 255, .82);
  border-radius: 11px;
  background: rgba(255, 255, 255, .48);
  color: #587999;
  font-size: 9px;
  font-weight: 700;
  cursor: pointer;
  transition: .2s var(--ease);
}

.body-trigger svg {
  width: 16px;
  height: 16px;
}

.body-trigger:hover,
.body-trigger[aria-pressed="true"] {
  color: var(--blue-deep);
  background: rgba(255, 255, 255, .94);
  box-shadow: 0 3px 9px rgba(57, 105, 155, .1);
}

.stage-scene {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  min-height: 0;
  padding: 4px 0;
}

/* side decorations inside the card */
.scene-sticker {
  position: absolute;
  z-index: 4;
  display: grid;
  place-items: center;
  color: #ffffff;
  pointer-events: none;
  box-shadow: 0 6px 16px rgba(100, 136, 178, .13);
}

.sticker-left {
  left: 4.5%;
  top: 22%;
  width: 42px;
  height: 42px;
  border-radius: 14px;
  background: #74b3f3;
  font-size: 21px;
  transform: rotate(-10deg);
}

.sticker-right {
  right: 4.5%;
  top: 43%;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #a5b7f4;
  font-size: 17px;
  transform: rotate(8deg);
}

.scene-script {
  position: absolute;
  left: 3%;
  bottom: 18%;
  color: rgba(86, 132, 185, .55);
  font-family: "Segoe Script", "Bradley Hand", cursive;
  font-size: 21px;
  line-height: 1.15;
  letter-spacing: .03em;
  text-align: left;
  transform: rotate(-8deg);
  pointer-events: none;
  user-select: none;
}

.stage {
  --body-h: 1;
  --body-origin: 96.11%;
  position: relative;
  height: 100%;
  width: auto;
  max-width: 100%;
  aspect-ratio: 520 / 900;
  flex: 0 0 auto;
  isolation: isolate;
}

.stage-halo {
  position: absolute;
  z-index: -2;
  left: 50%;
  top: 8%;
  width: 126%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, .7) 0 44%, rgba(242, 246, 251, .3) 62%, transparent 72%);
  transform: translateX(-50%);
  pointer-events: none;
}

.stage-window {
  position: absolute;
  z-index: -1;
  left: 17%;
  right: 17%;
  top: 4.5%;
  bottom: 18%;
  overflow: hidden;
  border: 1.5px solid rgba(255, 255, 255, .95);
  border-radius: 50% 50% 0 0 / 35% 35% 0 0;
  background:
    linear-gradient(90deg, transparent 48%, rgba(143, 177, 216, .16) 49.5%, rgba(143, 177, 216, .16) 50.5%, transparent 52%),
    linear-gradient(180deg, rgba(247, 252, 255, .86), rgba(223, 240, 255, .38));
  box-shadow: inset 0 0 0 8px rgba(255, 255, 255, .26), 0 15px 40px rgba(96, 146, 199, .08);
  pointer-events: none;
}

.stage-window::before {
  content: "";
  position: absolute;
  left: 12%;
  right: 12%;
  top: 11%;
  bottom: 0;
  border: 1px solid rgba(173, 192, 214, .19);
  border-bottom: 0;
  border-radius: 50% 50% 0 0 / 34% 34% 0 0;
}

.window-spark {
  position: absolute;
  display: block;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .95);
  box-shadow: 0 0 0 4px rgba(255, 255, 255, .25);
  animation: twinkle 4s ease-in-out infinite;
}

.window-spark.s1 { left: 18%; top: 25%; }
.window-spark.s2 { right: 16%; top: 36%; width: 4px; height: 4px; animation-delay: 1.2s; }
.window-spark.s3 { right: 26%; top: 14%; width: 3px; height: 3px; animation-delay: 2.2s; }

@keyframes twinkle {
  0%, 100% { opacity: .35; transform: scale(.8); }
  50% { opacity: 1; transform: scale(1.25); }
}

.stage-floor {
  position: absolute;
  z-index: 0;
  left: 3%;
  right: 3%;
  bottom: 1%;
  height: 17%;
  border-radius: 50%;
  background:
    radial-gradient(ellipse at 50% 59%, rgba(255, 255, 255, .78) 0 38%, rgba(230, 244, 255, .42) 60%, transparent 72%),
    linear-gradient(180deg, transparent 18%, rgba(143, 180, 220, .09) 48%, rgba(139, 176, 218, .16) 100%);
  pointer-events: none;
}

.floor-ring {
  position: absolute;
  left: 50%;
  bottom: 8%;
  width: 54%;
  height: 18%;
  border: 1px solid rgba(133, 160, 190, .19);
  border-radius: 50%;
  transform: translateX(-50%);
}

.floor-shadow {
  position: absolute;
  left: 50%;
  bottom: 10%;
  width: 34%;
  height: 11%;
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(107, 128, 153, .23), transparent 70%);
  filter: blur(3px);
  transform: translateX(-50%);
}

.doll-wrap {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  transform: scaleY(var(--body-h, 1));
  transform-origin: 50% var(--body-origin, 96.11%);
  will-change: transform;
}

.mannequin {
  position: absolute;
  z-index: 2;
  left: 18.46%;
  top: 2.78%;
  width: 58.27%;
  height: auto;
  pointer-events: none;
  user-select: none;
  filter: drop-shadow(0 7px 7px rgba(80, 101, 124, .11));
}

.layers {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
}

.garment {
  --x: 50;
  --y: 30;
  --w: 30;
  --r: 0deg;
  --flip: 1;
  position: absolute;
  left: calc(var(--x) * 1%);
  top: calc(var(--y) * 1%);
  width: calc(var(--w) * 1%);
  transform: translate(-50%, -50%) rotate(var(--r)) scaleX(var(--flip)) scaleY(var(--h, 1));
  transform-origin: 50% 50%;
  pointer-events: auto;
  cursor: grab;
  touch-action: none;
  user-select: none;
  -webkit-user-drag: none;
  filter: drop-shadow(0 4px 5px rgba(59, 76, 96, .12));
  transition: filter .2s;
  will-change: left, top, width, transform;
}

.garment:hover {
  filter: drop-shadow(0 6px 8px rgba(59, 76, 96, .19));
}

.garment.dragging {
  cursor: grabbing;
  filter: drop-shadow(0 9px 13px rgba(59, 76, 96, .25));
}

.garment img {
  display: block;
  width: 100%;
  height: auto;
  pointer-events: none;
  -webkit-user-drag: none;
  user-select: none;
}

.garment.is-new {
  animation: garment-pop .42s var(--ease-bounce) both;
}

@keyframes garment-pop {
  0% { opacity: 0; transform: translate(-50%, -50%) rotate(var(--r)) scaleX(var(--flip)) scaleY(var(--h, 1)) scale(.82); }
  65% { opacity: 1; transform: translate(-50%, -50%) rotate(var(--r)) scaleX(var(--flip)) scaleY(var(--h, 1)) scale(1.03); }
  100% { opacity: 1; transform: translate(-50%, -50%) rotate(var(--r)) scaleX(var(--flip)) scaleY(var(--h, 1)) scale(1); }
}

.garment.selected::before {
  content: "";
  position: absolute;
  inset: -7px;
  border: 1.5px dashed rgba(83, 145, 215, .72);
  border-radius: 9px;
  pointer-events: none;
}

.garment.selected::after {
  content: "";
  position: absolute;
  right: -8px;
  bottom: -8px;
  width: 10px;
  height: 10px;
  border: 2px solid #ffffff;
  border-radius: 50%;
  background: var(--blue);
  box-shadow: 0 2px 5px rgba(65, 105, 150, .25);
  pointer-events: none;
}

.selection-tag {
  position: absolute;
  left: 50%;
  top: -26px;
  max-width: 150px;
  padding: 4px 8px;
  border-radius: 6px;
  background: #2c4566;
  color: #ffffff;
  font-size: 9px;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transform: translateX(-50%);
  box-shadow: 0 3px 7px rgba(39, 53, 70, .2);
  pointer-events: none;
}

/* alignment guides */
.guide-lines {
  position: absolute;
  inset: 0;
  z-index: 30;
  pointer-events: none;
}

.guide-line {
  position: absolute;
  left: 9%;
  right: 9%;
  top: var(--y);
  height: 0;
  border-top: 1px dashed rgba(105, 151, 203, .45);
}

.guide-line b {
  position: absolute;
  left: 0;
  top: -7px;
  padding: 1px 5px;
  border-radius: 4px;
  background: rgba(250, 252, 254, .8);
  color: rgba(86, 121, 162, .8);
  font-size: 8px;
  font-weight: 600;
}

/* empty and hint */
.stage-empty {
  position: absolute;
  z-index: 50;
  left: 50%;
  bottom: 13%;
  width: 170px;
  padding: 11px 12px;
  border: 1px solid rgba(255, 255, 255, .9);
  border-radius: 15px 15px 15px 4px;
  background: rgba(251, 253, 254, .91);
  box-shadow: 0 8px 20px rgba(92, 119, 150, .11);
  text-align: center;
  transform: translateX(-50%);
  backdrop-filter: blur(8px);
}

.stage-empty strong {
  display: block;
  color: #5d748e;
  font-size: 11px;
}

.stage-empty p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 9px;
}

.empty-arrow {
  position: absolute;
  right: 9px;
  top: -22px;
  color: #89b1df;
  font-size: 23px;
  transform: rotate(6deg);
}

.stage-hint {
  position: absolute;
  z-index: 40;
  left: 50%;
  bottom: -2px;
  display: flex;
  align-items: center;
  gap: 5px;
  width: max-content;
  max-width: 100%;
  padding: 6px 10px;
  border-radius: 9px;
  background: rgba(250, 252, 254, .66);
  color: rgba(104, 122, 143, .8);
  font-size: 8px;
  font-weight: 600;
  letter-spacing: .02em;
  white-space: nowrap;
  transform: translateX(-50%);
  backdrop-filter: blur(4px);
  pointer-events: none;
}

.hint-dot {
  opacity: .5;
}

/* look strip */
.look-strip {
  position: relative;
  z-index: 5;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex: 0 0 auto;
  gap: 15px;
  min-height: 62px;
  padding: 4px 4px 0 8px;
}

.look-copy {
  min-width: 0;
}

.look-eyebrow {
  display: block;
  margin-bottom: 3px;
  color: #99aabd;
  font-size: 8px;
  font-weight: 800;
  letter-spacing: .17em;
}

.look-copy strong {
  display: block;
  color: #2b4261;
  font-family: var(--font-round);
  font-size: 17px;
  letter-spacing: .03em;
  line-height: 1.25;
}

.look-copy p {
  max-width: 420px;
  margin: 3px 0 0;
  overflow: hidden;
  color: #8a97a5;
  font-size: 10px;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.worn-meter {
  display: flex;
  align-items: baseline;
  flex: 0 0 auto;
  gap: 5px;
  min-width: 65px;
  padding: 7px 12px;
  border: 1px solid rgba(255, 255, 255, .8);
  border-radius: 14px;
  background: rgba(255, 255, 255, .39);
  color: #62758a;
}

.worn-meter span {
  color: var(--blue-deep);
  font-family: "Segoe UI", sans-serif;
  font-size: 22px;
  font-weight: 700;
  line-height: 1;
}

.worn-meter small {
  font-size: 9px;
  color: #7c8c9e;
}

/* adjust toolbar */
.adjust-bar {
  position: absolute;
  z-index: 50;
  left: 50%;
  bottom: 82px;
  display: flex;
  align-items: center;
  gap: 12px;
  width: min(94%, 520px);
  padding: 7px 9px 7px 13px;
  border: 1px solid rgba(255, 255, 255, .9);
  border-radius: 15px;
  background: rgba(253, 253, 254, .9);
  box-shadow: 0 10px 28px rgba(71, 93, 118, .15);
  transform: translateX(-50%);
  backdrop-filter: blur(15px);
  animation: bar-in .22s var(--ease);
}

@keyframes bar-in {
  from { opacity: 0; transform: translate(-50%, 7px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

.adjust-name {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 6px;
  flex: 1;
  color: #505f70;
  font-size: 10px;
  font-weight: 700;
}

.adjust-name span:last-child {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.adjust-dot {
  width: 6px;
  height: 6px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--blue);
}

.adjust-tools {
  display: flex;
  gap: 3px;
  flex: 0 0 auto;
}

.adjust-btn {
  display: grid;
  place-items: center;
  width: 29px;
  height: 29px;
  border-radius: 8px;
  background: #f3f6fa;
  color: #67788c;
  font-family: "Segoe UI", sans-serif;
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  transition: .16s;
}

.adjust-btn:hover {
  background: #eef3f9;
  color: var(--blue-deep);
}

.adjust-btn svg {
  width: 15px;
  height: 15px;
}

.adjust-remove {
  flex: 0 0 auto;
  padding: 7px 10px;
  border-radius: 8px;
  background: #f4f7fb;
  color: #5b96da;
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
  transition: .16s;
}

.adjust-remove:hover {
  background: var(--blue);
  color: #ffffff;
}

/* ------------------------------ wardrobe ------------------------------ */

.wardrobe {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  height: 100%;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .96);
  border-radius: var(--radius-xl);
  background: rgba(249, 252, 255, .88);
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(24px);
}

.wardrobe-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  flex: 0 0 auto;
  padding: 23px 22px 20px;
}

.wardrobe-eyebrow {
  color: #9babbd;
  font-size: 8px;
  font-weight: 800;
  letter-spacing: .22em;
}

.wardrobe-head h1 {
  margin: 5px 0 0;
  color: #293e5d;
  font-family: var(--font-round);
  font-size: 26px;
  font-weight: 800;
  letter-spacing: .045em;
  line-height: 1.2;
}

.title-spark {
  display: inline-block;
  color: #72abe8;
  font-family: serif;
  font-size: 15px;
  transform: translateY(-7px) rotate(12deg);
}

.wardrobe-head p {
  margin: 7px 0 0;
  color: #8e98a4;
  font-size: 11px;
  letter-spacing: .01em;
}

.round-add {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  margin-top: 2px;
  border-radius: 14px;
  background: #ffffff;
  color: var(--blue-deep);
  box-shadow: 0 5px 15px rgba(91, 126, 166, .12);
  cursor: pointer;
  transition: .2s var(--ease);
}

.round-add svg {
  width: 20px;
  height: 20px;
}

.round-add:hover {
  background: var(--blue);
  color: #ffffff;
  transform: translateY(-1px) rotate(5deg);
  box-shadow: 0 8px 20px rgba(91, 151, 219, .22);
}

/* category tabs */
.tabs {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 3px;
  flex: 0 0 auto;
  margin: 0 18px;
  padding: 5px;
  border: 1px solid rgba(212, 228, 245, .9);
  border-radius: 18px;
  background: #ecf4ff;
}

.tab {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  min-width: 0;
  height: 53px;
  padding: 4px 2px;
  border-radius: 13px;
  background: transparent;
  color: #7a8da6;
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
  transition: .22s var(--ease);
}

.tab svg {
  width: 20px;
  height: 20px;
  opacity: .72;
  transition: .22s;
}

.tab:hover {
  color: #4e6b8e;
  background: rgba(255, 255, 255, .6);
}

.tab.active {
  color: #2f6db5;
  background: #ffffff;
  box-shadow: 0 4px 13px rgba(55, 117, 185, .14);
}

.tab.active svg {
  opacity: 1;
}

.tab.active::after {
  content: "";
  position: absolute;
  bottom: 5px;
  width: 12px;
  height: 2px;
  border-radius: 2px;
  background: #5c9ce3;
}

.tab-count {
  position: absolute;
  top: 5px;
  right: 8%;
  display: grid;
  place-items: center;
  min-width: 13px;
  height: 13px;
  padding: 0 3px;
  border-radius: 5px;
  background: #dceaff;
  color: #3f7fc9;
  font-family: "Segoe UI", sans-serif;
  font-size: 7px;
  font-weight: 700;
  line-height: 1;
}

/* category header */
.category-bar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 15px;
  flex: 0 0 auto;
  padding: 18px 23px 12px;
}

.category-bar h2 {
  margin: 0;
  color: #334d6d;
  font-family: var(--font-round);
  font-size: 17px;
  font-weight: 800;
  letter-spacing: .04em;
}

.category-bar p {
  margin: 4px 0 0;
  color: #8d98a5;
  font-size: 10px;
}

.category-count {
  flex: 0 0 auto;
  padding: 5px 9px;
  border-radius: 8px;
  background: #f2f6fa;
  color: #889bb0;
  font-family: "Segoe UI", "Microsoft YaHei", sans-serif;
  font-size: 9px;
  font-weight: 600;
}

/* items */
.items-scroll {
  flex: 1;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 2px 19px 20px;
  scrollbar-width: thin;
  scrollbar-color: #cbdaec transparent;
}

.items-scroll::-webkit-scrollbar {
  width: 6px;
}

.items-scroll::-webkit-scrollbar-thumb {
  border-radius: 8px;
  background: #cbdaec;
}

.items-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 11px;
}

.item-card {
  position: relative;
  min-width: 0;
  padding: 7px 7px 9px;
  border: 1px solid #e3edf8;
  border-radius: 17px;
  background: #ffffff;
  box-shadow: 0 2px 7px rgba(65, 100, 140, .04);
  text-align: left;
  cursor: pointer;
  transition: transform .22s var(--ease), box-shadow .22s, border-color .22s;
}

.item-card:hover {
  border-color: #b9d7f4;
  box-shadow: 0 9px 22px rgba(58, 103, 154, .11);
  transform: translateY(-2px);
}

.item-card.worn {
  border-color: #7fbaf3;
  box-shadow: 0 7px 18px rgba(62, 135, 211, .17);
}

.item-thumb {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 1.25 / 1;
  overflow: hidden;
  border-radius: 12px;
  background:
    radial-gradient(circle at 50% 45%, #fdfeff 0, #f0f7ff 57%, #e7f1ff 100%);
}

.item-thumb::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .6);
  pointer-events: none;
}

.item-thumb img {
  position: absolute;
  left: 8%;
  top: 8%;
  display: block;
  width: 84%;
  height: 84%;
  object-fit: contain;
  filter: drop-shadow(0 4px 5px rgba(64, 82, 103, .1));
  transition: transform .35s var(--ease);
  pointer-events: none;
}

.item-card:hover .item-thumb img {
  transform: scale(1.045) rotate(-1deg);
}

.item-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 5px;
  padding: 8px 4px 0;
}

.item-name {
  overflow: hidden;
  color: #4e5966;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.4;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.item-kind {
  flex: 0 0 auto;
  color: #9ca9b7;
  font-size: 8px;
}

.worn-badge {
  position: absolute;
  top: 11px;
  left: 11px;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 3px 6px;
  border-radius: 6px;
  background: rgba(255, 255, 255, .93);
  color: #5e97d9;
  font-size: 8px;
  font-weight: 700;
  box-shadow: 0 2px 6px rgba(87, 120, 158, .12);
  backdrop-filter: blur(4px);
}

.worn-badge::before {
  content: "✓";
  font-size: 8px;
}

.mine-badge {
  position: absolute;
  top: 11px;
  right: 11px;
  padding: 3px 5px;
  border-radius: 5px;
  background: rgba(107, 123, 170, .8);
  color: #ffffff;
  font-size: 7px;
  font-weight: 700;
  letter-spacing: .02em;
}

.item-delete {
  position: absolute;
  z-index: 2;
  right: 10px;
  bottom: 38px;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 8px;
  background: rgba(255, 255, 255, .94);
  color: #7d94af;
  box-shadow: 0 2px 7px rgba(77, 103, 132, .13);
  opacity: 0;
  cursor: pointer;
  transform: translateY(3px);
  transition: .2s;
}

.item-delete:hover {
  background: #f4f8fc;
  color: #4e8ed8;
}

.item-card:hover .item-delete,
.item-delete:focus-visible {
  opacity: 1;
  transform: translateY(0);
}

.add-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 153px;
  padding: 14px;
  border: 1.5px dashed #ccdbec;
  border-radius: 17px;
  background: rgba(251, 252, 254, .46);
  color: #8da0b6;
  text-align: center;
  cursor: pointer;
  transition: .22s var(--ease);
}

.add-card:hover {
  border-color: #b3cdea;
  background: #fafcfe;
  color: #6398d4;
  transform: translateY(-2px);
}

.add-card span {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  margin-bottom: 8px;
  border-radius: 11px;
  background: #ffffff;
  color: #7fabdd;
  font-size: 22px;
  line-height: 1;
  box-shadow: 0 3px 8px rgba(87, 116, 149, .08);
}

.add-card strong {
  font-size: 10px;
  font-weight: 700;
}

.add-card small {
  margin-top: 3px;
  color: #a5b2c0;
  font-size: 8px;
}

/* empty state */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 280px;
  padding: 30px 15px;
  text-align: center;
}

.empty-illustration {
  width: 105px;
  height: 105px;
  margin-bottom: 6px;
  opacity: .82;
}

.empty-illustration svg {
  width: 100%;
  height: 100%;
}

.empty-state strong {
  color: #566475;
  font-family: var(--font-round);
  font-size: 15px;
}

.empty-state p {
  margin: 6px 0 16px;
  color: #909dab;
  font-size: 10px;
}

.empty-import-btn {
  padding: 9px 14px;
  border-radius: 11px;
  background: #f4f7fb;
  color: #5c95d7;
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
  transition: .2s;
}

.empty-import-btn:hover {
  background: #e8eff8;
}

/* footer */
.wardrobe-foot {
  display: flex;
  align-items: stretch;
  gap: 8px;
  flex: 0 0 auto;
  padding: 12px 19px 17px;
  border-top: 1px solid rgba(230, 235, 240, .8);
  background: rgba(253, 254, 254, .7);
}

.import-main {
  position: relative;
  display: flex;
  align-items: center;
  gap: 11px;
  flex: 1;
  min-width: 0;
  padding: 11px 13px;
  overflow: hidden;
  border-radius: 15px;
  background: linear-gradient(125deg, #78b8f6, #4a8edc 68%, #3b7fcd);
  color: #ffffff;
  text-align: left;
  cursor: pointer;
  box-shadow: 0 7px 18px rgba(58, 129, 205, .25);
  transition: .22s var(--ease);
}

.import-main::after {
  content: "";
  position: absolute;
  width: 95px;
  height: 95px;
  right: -38px;
  top: -47px;
  border: 18px solid rgba(255, 255, 255, .11);
  border-radius: 50%;
}

.import-main:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 23px rgba(50, 123, 201, .33);
}

.import-plus {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: rgba(255, 255, 255, .21);
  font-size: 22px;
  font-weight: 300;
  line-height: 1;
}

.import-copy {
  display: flex;
  flex-direction: column;
  min-width: 0;
  gap: 2px;
}

.import-copy strong {
  font-size: 12px;
  letter-spacing: .01em;
}

.import-copy small {
  overflow: hidden;
  color: rgba(255, 255, 255, .72);
  font-size: 8px;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.import-arrow {
  position: relative;
  z-index: 1;
  margin-left: auto;
  padding-right: 2px;
  color: rgba(255, 255, 255, .75);
  font-size: 17px;
}

.clear-category {
  flex: 0 0 auto;
  padding: 0 12px;
  border: 1px solid #e4e9ef;
  border-radius: 13px;
  background: #ffffff;
  color: #8798ab;
  font-size: 9px;
  font-weight: 700;
  cursor: pointer;
  transition: .2s;
}

.clear-category:hover {
  border-color: #c5d7ec;
  color: #5e95d4;
  background: #fafbfd;
}

/* ------------------------------ modals ------------------------------ */

.modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  padding: 20px;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(45, 54, 64, .31);
  backdrop-filter: blur(9px);
  animation: fade-in .2s ease;
}

@keyframes fade-in {
  from { opacity: 0; }
}

.modal-card {
  position: relative;
  z-index: 1;
  width: min(920px, 100%);
  max-height: calc(100dvh - 40px);
  overflow: auto;
  border: 1px solid rgba(255, 255, 255, .9);
  border-radius: 27px;
  background: #fdfefe;
  box-shadow: 0 35px 90px rgba(39, 50, 63, .28);
  animation: modal-in .32s var(--ease);
  scrollbar-width: thin;
  scrollbar-color: #cbdaec transparent;
}

@keyframes modal-in {
  from { opacity: 0; transform: translateY(14px) scale(.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 23px 26px 17px;
}

.modal-eyebrow {
  display: block;
  color: #9aacc1;
  font-size: 8px;
  font-weight: 800;
  letter-spacing: .22em;
}

.modal-head h2 {
  margin: 5px 0 0;
  color: #374452;
  font-family: var(--font-round);
  font-size: 24px;
  letter-spacing: .03em;
}

.modal-close {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 11px;
  background: #f2f6fa;
  color: #8093a9;
  font-family: "Segoe UI", sans-serif;
  font-size: 22px;
  font-weight: 300;
  line-height: 1;
  cursor: pointer;
  transition: .2s;
}

.modal-close:hover {
  background: #edf3f9;
  color: #5e97d8;
  transform: rotate(5deg);
}

.import-layout {
  display: grid;
  grid-template-columns: 1.02fr .98fr;
  gap: 0;
  padding: 0 26px 26px;
}

.import-visual {
  min-width: 0;
  padding-right: 24px;
  border-right: 1px solid #eaeef2;
}

/* dropzone */
.import-drop {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 368px;
  padding: 28px 20px;
  overflow: hidden;
  border: 1.5px dashed #c5d5e7;
  border-radius: 20px;
  background:
    radial-gradient(circle at 50% 45%, #fafcfd 0, #f4f8fc 58%, #eff3f8 100%);
  text-align: center;
  transition: .25s;
}

.import-drop.is-over {
  border-color: #76abe7;
  background: #f6f9fc;
  box-shadow: inset 0 0 0 5px rgba(137, 183, 236, .1);
}

.drop-orbit {
  position: absolute;
  width: 245px;
  height: 245px;
  border: 1px solid rgba(175, 202, 232, .2);
  border-radius: 50%;
  pointer-events: none;
}

.drop-orbit::before,
.drop-orbit::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  background: #bad5f4;
}

.drop-orbit::before { width: 6px; height: 6px; left: 31px; top: 37px; }
.drop-orbit::after { width: 4px; height: 4px; right: 27px; bottom: 51px; opacity: .55; }

.drop-icon {
  display: grid;
  place-items: center;
  width: 75px;
  height: 75px;
  margin-bottom: 15px;
  border-radius: 24px;
  background: #ffffff;
  color: #8eadd1;
  box-shadow: 0 9px 24px rgba(105, 136, 171, .12);
  transform: rotate(-3deg);
}

.drop-icon svg {
  width: 55px;
  height: 55px;
}

.import-drop strong {
  color: #4b5b6e;
  font-family: var(--font-round);
  font-size: 16px;
}

.import-drop p {
  margin: 6px 0 16px;
  color: #929fad;
  font-size: 10px;
}

.choose-file-btn {
  position: relative;
  z-index: 1;
  padding: 10px 20px;
  border-radius: 11px;
  background: #3c4a5b;
  color: #ffffff;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 5px 12px rgba(46, 60, 75, .16);
  transition: .2s;
}

.choose-file-btn:hover {
  background: #5d95d4;
  transform: translateY(-1px);
}

.import-drop small {
  margin-top: 14px;
  color: #a7b4c2;
  font-size: 8px;
}

/* preview */
.import-preview {
  display: flex;
  flex-direction: column;
  gap: 11px;
}

.checker {
  background-color: #f8f9fa;
  background-image:
    linear-gradient(45deg, #eaedf1 25%, transparent 25%),
    linear-gradient(-45deg, #eaedf1 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #eaedf1 75%),
    linear-gradient(-45deg, transparent 75%, #eaedf1 75%);
  background-size: 18px 18px;
  background-position: 0 0, 0 9px, 9px -9px, -9px 0;
}

.preview-stage {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 300px;
  max-height: 348px;
  overflow: hidden;
  border: 1px solid #e4e9ee;
  border-radius: 20px;
}

.preview-stage canvas {
  display: block;
  max-width: 92%;
  max-height: 318px;
  width: auto;
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 7px 9px rgba(69, 85, 103, .13));
}

.preview-badge {
  position: absolute;
  left: 12px;
  bottom: 12px;
  padding: 4px 8px;
  border-radius: 7px;
  background: rgba(255, 255, 255, .92);
  color: #8398b1;
  font-size: 8px;
  font-weight: 700;
  box-shadow: 0 2px 7px rgba(91, 115, 142, .1);
}

.preview-controls {
  padding: 12px 14px;
  border: 1px solid #e8ecf1;
  border-radius: 15px;
  background: #fcfdfe;
}

.toggle-row {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
}

.toggle-row > span {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.toggle-row strong {
  color: #4e5b69;
  font-size: 10px;
}

.toggle-row small {
  color: #9aa6b4;
  font-size: 8px;
}

.toggle-row input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.toggle {
  position: relative;
  display: block;
  flex: 0 0 auto;
  width: 34px;
  height: 20px;
  border-radius: 20px;
  background: #dae1e8;
  transition: .23s;
}

.toggle::after {
  content: "";
  position: absolute;
  left: 3px;
  top: 3px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 1px 4px rgba(68, 83, 101, .22);
  transition: .23s var(--ease);
}

.toggle-row input:checked + .toggle {
  background: #78ade9;
}

.toggle-row input:checked + .toggle::after {
  transform: translateX(14px);
}

.range-row {
  display: block;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid #ecf0f4;
}

.range-row span {
  display: flex;
  justify-content: space-between;
  color: #6c7c8f;
  font-size: 9px;
}

.range-row b {
  color: #699edb;
  font-family: "Segoe UI", sans-serif;
  font-size: 9px;
}

input[type="range"] {
  display: block;
  width: 100%;
  height: 4px;
  margin: 9px 0 2px;
  border-radius: 10px;
  outline: none;
  accent-color: #79ade8;
  cursor: pointer;
}

.preview-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 14px;
  margin-top: 6px;
}

.text-btn {
  padding: 4px 0;
  background: transparent;
  color: #77899e;
  font-size: 9px;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.text-btn:hover {
  color: #659cda;
}

/* form */
.import-form {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding-left: 24px;
}

.form-tip {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 10px 11px;
  border-radius: 12px;
  background: #f4f8fc;
  color: #7e8fa2;
}

.form-tip > span {
  color: #8ab3e2;
  font-size: 11px;
  line-height: 1.5;
}

.form-tip p {
  margin: 0;
  font-size: 9px;
  line-height: 1.65;
}

.form-tip b {
  color: #6397d3;
}

.field {
  display: block;
  margin-top: 17px;
}

.field-label {
  display: block;
  margin-bottom: 7px;
  color: #546476;
  font-size: 10px;
  font-weight: 700;
}

.field input[type="text"] {
  width: 100%;
  height: 42px;
  padding: 0 12px;
  border: 1px solid #e1e7ed;
  border-radius: 11px;
  background: #fbfcfe;
  color: #414d5b;
  font-size: 11px;
  outline: none;
  transition: .2s;
}

.field input[type="text"]::placeholder {
  color: #adb8c5;
}

.field input[type="text"]:focus {
  border-color: #a7c7eb;
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(141, 185, 236, .11);
}

.category-picker {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.category-picker button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  height: 37px;
  border: 1px solid #e5e9ee;
  border-radius: 10px;
  background: #fbfcfe;
  color: #7c8a9b;
  font-size: 9px;
  font-weight: 700;
  cursor: pointer;
  transition: .18s;
}

.category-picker button i {
  font-family: Georgia, serif;
  font-size: 12px;
  font-style: normal;
  color: #9ab6d6;
}

.category-picker button:hover {
  border-color: #c4d6ea;
  color: #6295cf;
}

.category-picker button.active {
  border-color: #94bce9;
  background: #f4f7fb;
  color: #5791d4;
  box-shadow: inset 0 0 0 1px rgba(115, 170, 232, .1);
}

.category-picker button.active i {
  color: #6ca1dd;
}

.import-note {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  margin-top: 17px;
  padding-top: 13px;
  border-top: 1px solid #ecf0f4;
}

.note-icon {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: #eaeef2;
  color: #8696a9;
  font-family: Georgia, serif;
  font-size: 9px;
  font-style: italic;
}

.import-note p {
  margin: 0;
  color: #929fad;
  font-size: 8px;
  line-height: 1.6;
}

.import-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: auto;
  padding-top: 20px;
}

.secondary-btn,
.primary-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 40px;
  padding: 0 16px;
  border-radius: 11px;
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
  transition: .2s var(--ease);
}

.secondary-btn {
  border: 1px solid #e4e8ed;
  background: #ffffff;
  color: #7d8c9e;
}

.secondary-btn:hover {
  background: #f5f8fc;
}

.primary-btn {
  background: linear-gradient(135deg, #4c90dd, #346fb6);
  color: #ffffff;
  box-shadow: 0 5px 13px rgba(48, 109, 178, .22);
}

.primary-btn:hover {
  background: linear-gradient(135deg, #5b9de9, #2f68ad);
  box-shadow: 0 7px 17px rgba(48, 109, 178, .3);
  transform: translateY(-1px);
}

.primary-btn:disabled {
  opacity: .38;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* help modal */
.help-card {
  width: min(760px, 100%);
}

.help-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 11px;
  padding: 0 26px 20px;
}

.help-grid article {
  position: relative;
  padding: 17px 17px 16px;
  overflow: hidden;
  border: 1px solid #e9edf2;
  border-radius: 16px;
  background: #fbfcfe;
}

.help-grid article:nth-child(2) { background: #fafbfd; }
.help-grid article:nth-child(3) { background: #fbfcfd; }
.help-grid article:nth-child(4) { background: #f9fcfd; }

.help-num {
  display: block;
  margin-bottom: 9px;
  color: #a7c5e8;
  font-family: "Segoe UI", sans-serif;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .1em;
}

.help-grid h3 {
  margin: 0 0 6px;
  color: #4b5a6b;
  font-family: var(--font-round);
  font-size: 14px;
}

.help-grid p {
  margin: 0;
  color: #808c99;
  font-size: 10px;
  line-height: 1.65;
}

.help-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  padding: 15px 26px 22px;
  border-top: 1px solid #edf0f4;
}

.help-footer > span {
  color: #929eac;
  font-size: 9px;
}

kbd {
  padding: 2px 5px;
  border: 1px solid #dce2e8;
  border-radius: 4px;
  background: #ffffff;
  color: #7a899b;
  font-family: "Segoe UI", sans-serif;
  font-size: 8px;
}

/* ------------------------------ body-shape drawer ------------------------------ */

.body-drawer {
  position: fixed;
  inset: 0;
  z-index: 220;
}

.body-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(28, 46, 69, .17);
  animation: fade-in .22s ease;
}

.body-sheet {
  position: absolute;
  top: 94px;
  right: 20px;
  bottom: 20px;
  display: flex;
  flex-direction: column;
  width: min(368px, calc(100vw - 40px));
  padding: 22px 22px 18px;
  overflow-y: auto;
  border: 1px solid rgba(255, 255, 255, .95);
  border-radius: 28px;
  background: rgba(251, 254, 255, .97);
  box-shadow: 0 30px 80px rgba(35, 55, 82, .24);
  animation: body-sheet-in .3s var(--ease);
  scrollbar-width: thin;
  scrollbar-color: #c9ddf2 transparent;
}

@keyframes body-sheet-in {
  from { opacity: 0; transform: translateX(18px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes body-sheet-up {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: translateY(0); }
}

.body-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  flex: 0 0 auto;
}

.body-head h2 {
  margin: 5px 0 0;
  color: #293e5d;
  font-family: var(--font-round);
  font-size: 24px;
  letter-spacing: .03em;
}

.body-intro {
  display: flex;
  align-items: center;
  gap: 11px;
  margin-top: 17px;
  padding: 12px 13px;
  border: 1px solid #deecfa;
  border-radius: 14px;
  background: #f2f8ff;
}

.body-intro-icon {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: #ffffff;
  color: #5e92c8;
  box-shadow: 0 3px 9px rgba(57, 100, 147, .08);
}

.body-intro-icon svg {
  width: 30px;
  height: 30px;
}

.body-intro p {
  margin: 0;
  color: #7e94ab;
  font-size: 9px;
  line-height: 1.65;
}

.body-intro b {
  color: #4d7dab;
}

.body-fields {
  display: flex;
  flex-direction: column;
  gap: 9px;
  margin-top: 13px;
}

.body-field {
  display: block;
  padding: 11px 13px 9px;
  border: 1px solid #e4eef9;
  border-radius: 14px;
  background: #fbfdff;
  cursor: default;
}

.body-field-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  color: #445f7a;
  font-size: 11px;
  font-weight: 700;
}

.body-field-value {
  color: #9aafc4;
  font-family: "Segoe UI", "Microsoft YaHei", sans-serif;
  font-size: 9px;
  font-weight: 500;
}

.body-field-value b {
  color: var(--blue-deep);
  font-size: 13px;
  font-weight: 700;
}

.body-field-value i {
  margin-left: 4px;
  color: #99aec3;
  font-size: 8px;
  font-style: normal;
}

.body-range {
  display: block;
  width: 100%;
  height: 5px;
  margin: 11px 0 4px;
  border-radius: 10px;
  accent-color: var(--blue-deep);
  cursor: pointer;
}

.body-field-range {
  display: flex;
  justify-content: space-between;
  color: #b0c0d1;
  font-family: "Segoe UI", sans-serif;
  font-size: 7px;
}

.body-note {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  margin: 13px 0 0;
  padding-top: 12px;
  border-top: 1px solid #eef4fa;
  color: #96aabd;
  font-size: 8px;
  line-height: 1.65;
}

.body-note span {
  color: #75a9dd;
  font-size: 11px;
  line-height: 1.3;
}

.body-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: auto;
  padding-top: 17px;
}

/* ------------------------------ weather drawer ------------------------------ */

.weather-sheet {
  bottom: auto;
  max-height: calc(100dvh - 114px);
  gap: 0;
}

.weather-hero {
  flex: 0 0 auto;
  margin-top: 16px;
  padding: 16px;
  border: 1px solid #dbeaf9;
  border-radius: 19px;
  background:
    radial-gradient(circle at 92% 7%, rgba(255, 255, 255, .86), transparent 34%),
    linear-gradient(145deg, #f1f9ff, #dfefff);
}

.weather-hero-main {
  display: flex;
  align-items: center;
  gap: 12px;
}

.weather-now-icon {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 58px;
  height: 58px;
  border-radius: 18px;
  background: rgba(255, 255, 255, .82);
  font-size: 33px;
  line-height: 1;
  box-shadow: 0 5px 15px rgba(54, 103, 155, .1);
}

.weather-now-copy {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.weather-now-copy strong {
  color: #284a6d;
  font-family: "Segoe UI", "Microsoft YaHei", sans-serif;
  font-size: 42px;
  font-weight: 700;
  letter-spacing: -.04em;
  line-height: 1;
}

.weather-now-copy span {
  overflow: hidden;
  color: #7691ac;
  font-size: 10px;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.weather-place-row {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 13px;
  min-width: 0;
  color: #466786;
}

.weather-pin {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 17px;
  height: 17px;
  color: #5d97d1;
}

.weather-pin svg {
  width: 15px;
  height: 15px;
}

.weather-place-row strong {
  flex: 0 0 auto;
  max-width: 52%;
  overflow: hidden;
  font-size: 11px;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.weather-place-row span:last-child {
  min-width: 0;
  overflow: hidden;
  color: #8ba2b8;
  font-size: 8px;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.weather-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  margin-top: 13px;
  padding-top: 12px;
  border-top: 1px solid rgba(156, 190, 223, .25);
}

.weather-stats div {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding-left: 8px;
  border-left: 1px solid rgba(157, 190, 221, .22);
}

.weather-stats div:first-child {
  padding-left: 0;
  border-left: 0;
}

.weather-stats span {
  color: #97aabd;
  font-size: 8px;
}

.weather-stats b {
  color: #496987;
  font-family: "Segoe UI", "Microsoft YaHei", sans-serif;
  font-size: 12px;
  font-weight: 600;
}

.weather-locator {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-top: 13px;
}

.weather-locate {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 38px;
  border: 1px solid #d5e7f9;
  border-radius: 11px;
  background: #f0f8ff;
  color: #4c80b5;
  font-size: 9px;
  font-weight: 700;
  cursor: pointer;
  transition: .2s;
}

.weather-locate svg {
  width: 15px;
  height: 15px;
}

.weather-locate:hover {
  border-color: #a9cdec;
  background: #e7f4ff;
  color: #2f6ca8;
}

.weather-city-form {
  display: flex;
  gap: 5px;
  min-width: 0;
}

.weather-city-form input {
  flex: 1;
  min-width: 0;
  height: 36px;
  padding: 0 10px;
  border: 1px solid #e0ebf6;
  border-radius: 10px;
  outline: none;
  background: #fbfdff;
  color: #49657f;
  font-size: 9px;
}

.weather-city-form input::placeholder {
  color: #b0c0d0;
}

.weather-city-form input:focus {
  border-color: #a9cdec;
  background: #fff;
}

.weather-city-form button {
  flex: 0 0 auto;
  height: 36px;
  padding: 0 12px;
  border-radius: 10px;
  background: #dfeeff;
  color: #3e77b4;
  font-size: 9px;
  font-weight: 700;
  cursor: pointer;
  transition: .2s;
}

.weather-city-form button:hover {
  background: #d0e6ff;
}

.weather-city-results {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 142px;
  margin-top: 7px;
  padding: 5px;
  overflow-y: auto;
  border: 1px solid #e3eef9;
  border-radius: 12px;
  background: #fbfdff;
  scrollbar-width: thin;
  scrollbar-color: #c9ddf2 transparent;
}

.weather-city-results button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  padding: 7px 8px;
  border-radius: 7px;
  background: transparent;
  color: #5b7895;
  text-align: left;
  cursor: pointer;
}

.weather-city-results button:hover {
  background: #eef7ff;
}

.weather-city-results strong {
  font-size: 9px;
  font-weight: 700;
}

.weather-city-results small {
  overflow: hidden;
  color: #9ab0c5;
  font-size: 8px;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.weather-city-results p {
  margin: 0;
  padding: 7px 8px;
  color: #9ab0c5;
  font-size: 8px;
}

.weather-forecast {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  margin-top: 14px;
}

.weather-forecast-card {
  min-width: 0;
  padding: 10px 6px 9px;
  border: 1px solid #e4eff9;
  border-radius: 13px;
  background: #fbfdff;
  text-align: center;
}

.weather-forecast-day {
  display: block;
  color: #849ab0;
  font-size: 8px;
}

.weather-forecast-icon {
  display: block;
  margin-top: 6px;
  font-size: 22px;
  line-height: 1.2;
}

.weather-forecast-desc {
  display: block;
  margin-top: 3px;
  overflow: hidden;
  color: #6b84a0;
  font-size: 8px;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.weather-forecast-temp {
  display: flex;
  justify-content: center;
  gap: 4px;
  margin-top: 5px;
  color: #9aafc4;
  font-family: "Segoe UI", "Microsoft YaHei", sans-serif;
  font-size: 9px;
}

.weather-forecast-temp b {
  color: #466886;
  font-weight: 700;
}

.weather-advice {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-top: 13px;
  padding: 11px 12px;
  border: 1px solid #dae9f8;
  border-radius: 13px;
  background: linear-gradient(145deg, #f1f8ff, #e8f3ff);
}

.weather-advice-icon {
  flex: 0 0 auto;
  color: #6da6df;
  font-size: 12px;
  line-height: 1.5;
}

.weather-advice p {
  margin: 0;
  color: #7890a8;
  font-size: 9px;
  line-height: 1.65;
}

.weather-source {
  margin: 12px 0 0;
  color: #a9b9c9;
  font-size: 7px;
  line-height: 1.55;
}

.weather-foot {
  display: flex;
  justify-content: flex-end;
  margin-top: auto;
  padding-top: 14px;
}

.weather-foot .primary-btn {
  min-width: 94px;
}

.weather-sheet.is-loading .weather-now-icon {
  animation: weather-pulse 1.1s ease-in-out infinite;
}

/* ------------------------------ AI stylist ------------------------------ */

.ai-sheet {
  gap: 0;
}

.ai-head-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

.ai-clear {
  height: 28px;
  padding: 0 9px;
  border: 1px solid #e2ebf5;
  border-radius: 8px;
  background: #f8fbfe;
  color: #8da2b7;
  font-size: 8px;
  font-weight: 700;
  cursor: pointer;
  transition: .2s;
}

.ai-clear:hover {
  border-color: #c6dbef;
  background: #fff;
  color: #5484b5;
}

.ai-weather-context {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  margin-top: 13px;
  padding: 9px 10px;
  border: 1px solid #dbe9f8;
  border-radius: 13px;
  background: #f4f9ff;
  color: #537493;
  text-align: left;
  cursor: pointer;
  transition: .2s;
}

.ai-weather-context:hover {
  border-color: #b6d3ee;
  background: #edf7ff;
}

.ai-context-icon {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: #ffffff;
  font-size: 17px;
  line-height: 1;
  box-shadow: 0 2px 7px rgba(59, 103, 150, .08);
}

.ai-context-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 0;
}

.ai-context-copy strong {
  overflow: hidden;
  color: #4a6785;
  font-size: 9px;
  font-weight: 700;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.ai-context-copy small {
  overflow: hidden;
  color: #94a9bd;
  font-size: 8px;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.ai-context-arrow {
  flex: 0 0 auto;
  color: #86a8c8;
  font-size: 13px;
}

.ai-chat {
  display: flex;
  flex-direction: column;
  gap: 9px;
  flex: 1;
  min-height: 210px;
  margin: 13px 0 8px;
  padding: 4px 3px 5px;
  overflow-x: hidden;
  overflow-y: auto;
  scroll-behavior: smooth;
  scrollbar-width: thin;
  scrollbar-color: #c9ddf2 transparent;
}

.ai-chat::-webkit-scrollbar {
  width: 4px;
}

.ai-chat::-webkit-scrollbar-thumb {
  border-radius: 8px;
  background: #c9ddf2;
}

.ai-msg {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  width: 100%;
}

.ai-msg.user {
  justify-content: flex-end;
}

.ai-bot-avatar {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 23px;
  height: 23px;
  border-radius: 8px;
  background: #edf2ff;
  color: #7f8fd0;
  font-size: 10px;
  box-shadow: 0 2px 5px rgba(82, 91, 150, .08);
}

.ai-bubble {
  max-width: 82%;
  padding: 9px 11px;
  border: 1px solid #e6eff9;
  border-radius: 14px 14px 14px 4px;
  background: #f4f9ff;
  color: #526c84;
  font-size: 9.5px;
  line-height: 1.7;
  white-space: pre-wrap;
  word-break: break-word;
}

.ai-msg.user .ai-bubble {
  border-color: transparent;
  border-radius: 14px 14px 4px 14px;
  background: linear-gradient(135deg, #73aff0, #4a86cb);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(66, 128, 196, .16);
}

.ai-typing .ai-bubble {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 45px;
  min-height: 30px;
  padding: 8px 12px;
}

.ai-typing i {
  display: block;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #89a5c2;
  animation: ai-dot 1.1s ease-in-out infinite;
}

.ai-typing i:nth-child(2) { animation-delay: .15s; }
.ai-typing i:nth-child(3) { animation-delay: .3s; }

.ai-plan-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: -1px 0 3px 29px;
  animation: ai-actions-in .25s var(--ease);
}

@keyframes ai-actions-in {
  from { opacity: 0; transform: translateY(3px); }
  to { opacity: 1; transform: translateY(0); }
}

.ai-plan-actions button {
  height: 29px;
  padding: 0 10px;
  border-radius: 8px;
  font-size: 8px;
  font-weight: 700;
  cursor: pointer;
  transition: .18s;
}

.ai-plan-wear {
  border: 1px solid transparent;
  background: linear-gradient(135deg, #5a9ce6, #3c78be);
  color: #ffffff;
  box-shadow: 0 3px 9px rgba(59, 122, 190, .17);
}

.ai-plan-wear:hover {
  background: linear-gradient(135deg, #69a9f0, #2f6ab1);
  box-shadow: 0 5px 12px rgba(59, 122, 190, .24);
}

.ai-plan-again {
  border: 1px solid #dce9f6;
  background: #fbfdff;
  color: #7d93a9;
}

.ai-plan-again:hover {
  border-color: #bcd7ee;
  background: #f2f9ff;
  color: #4e7fae;
}

@keyframes ai-dot {
  0%, 60%, 100% { opacity: .35; transform: translateY(0); }
  30% { opacity: 1; transform: translateY(-3px); }
}

.ai-quick {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  flex: 0 0 auto;
  padding: 7px 0 8px;
  border-top: 1px solid #eff4fa;
}

.ai-quick button {
  padding: 6px 8px;
  border: 1px solid #e3edf8;
  border-radius: 8px;
  background: #fbfdff;
  color: #7890a7;
  font-size: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: .18s;
}

.ai-quick button:hover {
  border-color: #c4dcf2;
  background: #f1f8ff;
  color: #4d7da9;
}

.ai-form {
  display: flex;
  gap: 6px;
  flex: 0 0 auto;
}

.ai-form input {
  flex: 1;
  min-width: 0;
  height: 40px;
  padding: 0 11px;
  border: 1px solid #dfeaf6;
  border-radius: 11px;
  outline: none;
  background: #fbfdff;
  color: #4d6680;
  font-size: 9px;
  transition: .2s;
}

.ai-form input::placeholder {
  color: #b1c0d0;
}

.ai-form input:focus {
  border-color: #a8caeb;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(111, 169, 234, .08);
}

.ai-form button {
  flex: 0 0 auto;
  width: 58px;
  height: 40px;
  border-radius: 11px;
  background: linear-gradient(135deg, #4e90dc, #376fb6);
  color: #ffffff;
  font-size: 9px;
  font-weight: 700;
  cursor: pointer;
  transition: .2s;
}

.ai-form button:hover {
  background: linear-gradient(135deg, #5d9ee8, #2f67ac);
}

.ai-form button:disabled {
  opacity: .5;
  cursor: not-allowed;
}

.ai-footnote {
  margin: 8px 0 0;
  color: #aab9c8;
  font-size: 7px;
  line-height: 1.5;
}

/* ------------------------------ toast ------------------------------ */

.toast {
  position: fixed;
  z-index: 300;
  left: 50%;
  bottom: 30px;
  max-width: min(90vw, 420px);
  padding: 11px 17px;
  border: 1px solid rgba(255, 255, 255, .2);
  border-radius: 12px;
  background: rgba(52, 64, 78, .93);
  color: #ffffff;
  font-size: 11px;
  font-weight: 600;
  text-align: center;
  box-shadow: 0 12px 30px rgba(39, 51, 64, .22);
  transform: translate(-50%, 16px);
  opacity: 0;
  pointer-events: none;
  transition: .28s var(--ease);
  backdrop-filter: blur(10px);
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* ------------------------------ small screens ------------------------------ */

@media (max-width: 1280px) {
  .workspace {
    grid-template-columns: 148px minmax(0, 1fr) 420px;
  }

  .top-note {
    font-size: 11px;
  }

  .topbar {
    padding-left: 22px;
    padding-right: 22px;
  }

  .workspace {
    padding-left: 22px;
    padding-right: 22px;
  }

  .action-btn {
    padding: 0 11px;
  }

  .scene-script {
    display: none;
  }
}

@media (max-width: 1120px) {
  .workspace {
    grid-template-columns: 132px minmax(0, 1fr) 388px;
    gap: 14px;
  }

  .layer-dock {
    padding: 14px 8px 10px;
    border-radius: 22px;
  }

  .layer-dock-head {
    gap: 5px;
  }

  .layer-head-icon {
    width: 27px;
    height: 27px;
    border-radius: 8px;
  }

  .layer-head-icon svg {
    width: 17px;
    height: 17px;
  }

  .layer-eyebrow {
    display: none;
  }

  .layer-head-copy h2 {
    font-size: 15px;
  }

  .layer-row {
    gap: 4px;
    padding-left: 5px;
  }

  .layer-thumb {
    width: 28px;
    height: 31px;
  }

  .layer-name {
    font-size: 8px;
  }

  .layer-kind {
    display: none;
  }

  .layer-move {
    width: 18px;
    height: 17px;
    font-size: 9px;
  }

  .top-note {
    display: none;
  }

  .top-actions {
    margin-left: auto;
  }

  .action-btn span {
    display: none;
  }

  .action-btn {
    width: 42px;
    padding: 0;
  }

  .action-primary {
    width: auto;
    padding: 0 13px;
  }

  .action-primary span {
    display: inline;
  }

  .wardrobe-head {
    padding: 19px 18px 16px;
  }

  .tabs {
    margin: 0 14px;
  }

  .category-bar {
    padding: 15px 19px 10px;
  }

  .items-scroll {
    padding-left: 15px;
    padding-right: 15px;
  }

  .wardrobe-foot {
    padding: 10px 15px 14px;
  }

  .import-copy small {
    display: none;
  }

  .item-name {
    font-size: 10px;
  }

  .stage-card {
    padding-left: 16px;
    padding-right: 16px;
  }

  .sticker-left {
    left: 2%;
  }

  .sticker-right {
    right: 2%;
  }
}

@media (max-width: 900px) {
  body {
    height: auto;
    min-height: 100dvh;
    overflow-y: auto;
    overflow-x: hidden;
  }

  .topbar {
    position: relative;
    height: 68px;
    padding: 12px 16px 0;
    gap: 12px;
  }

  .brand-mark {
    width: 41px;
    height: 41px;
    border-radius: 14px;
  }

  .brand-mark svg {
    width: 32px;
    height: 32px;
  }

  .brand-copy strong {
    font-size: 19px;
  }

  .brand-copy small {
    font-size: 7px;
    margin-top: 5px;
  }

  .action-btn {
    width: 38px;
    height: 38px;
    border-radius: 12px;
  }

  .action-btn svg {
    width: 16px;
    height: 16px;
  }

  .action-primary {
    width: 38px;
    padding: 0;
  }

  .action-primary span {
    display: none;
  }

  .workspace {
    display: flex;
    flex-direction: column;
    height: auto;
    padding: 10px 12px 22px;
    gap: 13px;
  }

  .stage-column {
    order: 1;
    height: min(67dvh, 700px);
    min-height: 470px;
  }

  .left-rail {
    order: 2;
    align-self: stretch;
    gap: 10px;
    height: auto;
  }

  .left-rail .layer-dock {
    max-height: none;
  }

  .layer-dock {
    order: 0;
    align-self: stretch;
    width: 100%;
    height: auto;
    max-height: none;
    padding: 11px 12px 10px;
    border-radius: 22px;
  }

  .weather-card {
    padding: 11px 13px 10px;
    border-radius: 20px;
  }

  .layer-dock-head {
    gap: 7px;
    padding: 0 2px;
  }

  .layer-head-icon {
    width: 29px;
    height: 29px;
    border-radius: 9px;
  }

  .layer-head-copy h2 {
    font-size: 16px;
  }

  .layer-eyebrow {
    display: block;
    font-size: 6px;
  }

  .layer-note {
    display: none;
  }

  .layer-list {
    flex-direction: row;
    gap: 7px;
    padding: 9px 1px 5px;
    overflow-x: auto;
    overflow-y: hidden;
  }

  .layer-row {
    flex: 0 0 152px;
    min-height: 54px;
    padding: 6px;
  }

  .layer-thumb {
    width: 30px;
    height: 32px;
  }

  .layer-kind {
    display: block;
  }

  .layer-move {
    width: 23px;
    height: 21px;
    font-size: 10px;
  }

  .layer-empty {
    flex: 1 1 auto;
    flex-direction: row;
    justify-content: flex-start;
    gap: 9px;
    min-height: 54px;
    padding: 4px 2px;
    text-align: left;
  }

  .layer-empty-icon {
    width: 34px;
    height: 34px;
    margin: 0;
    border-radius: 10px;
  }

  .layer-empty-icon svg {
    width: 21px;
    height: 21px;
  }

  .layer-empty p {
    margin-top: 2px;
  }

  .layer-reset {
    align-self: flex-end;
    width: auto;
    margin-top: 3px;
    padding: 6px 10px;
  }

  .wardrobe {
    order: 3;
  }

  .body-sheet {
    top: auto;
    left: 10px;
    right: 10px;
    bottom: 10px;
    width: auto;
    max-height: calc(100dvh - 20px);
    padding: 18px 18px 15px;
    border-radius: 24px;
    animation-name: body-sheet-up;
  }

  .ai-sheet {
    height: min(80dvh, 720px);
    max-height: calc(100dvh - 20px);
  }

  .ai-chat {
    min-height: 180px;
  }

  .ai-plan-actions button {
    height: 34px;
    padding: 0 12px;
    font-size: 9px;
  }

  .body-fields {
    gap: 7px;
  }

  .stage-card {
    border-radius: 26px;
    padding: 13px 14px 12px;
  }

  .stage-hint {
    display: none;
  }

  .stage-empty {
    bottom: 12%;
  }

  .look-strip {
    min-height: 55px;
    padding-left: 4px;
  }

  .look-copy strong {
    font-size: 15px;
  }

  .look-copy p {
    max-width: 240px;
    font-size: 9px;
  }

  .worn-meter {
    min-width: 58px;
    padding: 6px 9px;
  }

  .worn-meter span {
    font-size: 19px;
  }

  .adjust-bar {
    bottom: 69px;
    width: calc(100% - 18px);
    gap: 7px;
    padding-left: 10px;
  }

  .adjust-name {
    max-width: 80px;
  }

  .adjust-btn {
    width: 27px;
    height: 27px;
  }

  .adjust-remove {
    padding: 6px 8px;
  }

  .sticker-left,
  .sticker-right {
    width: 31px;
    height: 31px;
    border-radius: 10px;
    font-size: 15px;
  }

  .sticker-left { top: 19%; }
  .sticker-right { top: 47%; }

  .wardrobe {
    height: auto;
    min-height: 510px;
    border-radius: 26px;
  }

  .items-scroll {
    max-height: 48dvh;
  }

  .item-delete {
    opacity: 1;
    transform: none;
  }

  .wardrobe-foot {
    position: sticky;
    bottom: 0;
    z-index: 2;
    padding-bottom: 13px;
    border-radius: 0 0 26px 26px;
    background: rgba(253, 254, 254, .94);
    backdrop-filter: blur(12px);
  }

  .import-layout {
    grid-template-columns: 1fr;
    padding: 0 18px 20px;
  }

  .import-visual {
    padding-right: 0;
    padding-bottom: 18px;
    border-right: 0;
    border-bottom: 1px solid #eaeef2;
  }

  .import-form {
    padding-left: 0;
    padding-top: 18px;
  }

  .import-drop {
    min-height: 250px;
  }

  .preview-stage {
    min-height: 240px;
    max-height: 300px;
  }

  .preview-stage canvas {
    max-height: 270px;
  }

  .modal-head {
    padding: 19px 18px 14px;
  }

  .import-actions {
    padding-top: 17px;
  }
}

@media (max-width: 560px) {
  .topbar {
    padding-left: 12px;
    padding-right: 12px;
    gap: 7px;
  }

  .brand-copy small {
    display: none;
  }

  .brand-copy strong {
    font-size: 17px;
  }

  .top-actions {
    gap: 5px;
  }

  .action-btn {
    width: 35px;
    height: 35px;
  }

  .stage-column {
    height: min(66dvh, 620px);
    min-height: 440px;
  }

  .scene-sticker {
    display: none;
  }

  .stage-eyebrow {
    gap: 6px;
    font-size: 8px;
  }

  .look-no {
    display: none;
  }

  .stage-actions {
    gap: 4px;
  }

  .soft-icon-btn {
    width: 29px;
    height: 29px;
  }

  .body-trigger {
    height: 29px;
    padding: 0 7px;
    font-size: 8px;
  }

  .body-trigger svg {
    width: 15px;
    height: 15px;
  }

  .body-sheet {
    padding: 16px 14px 13px;
    border-radius: 22px;
  }

  .ai-sheet {
    height: min(82dvh, 700px);
  }

  .ai-bubble {
    max-width: 85%;
    font-size: 9px;
  }

  .body-head h2 {
    font-size: 21px;
  }

  .body-intro {
    margin-top: 12px;
    padding: 10px;
  }

  .body-intro-icon {
    width: 36px;
    height: 36px;
  }

  .body-field {
    padding: 9px 11px 8px;
  }

  .body-actions .secondary-btn,
  .body-actions .primary-btn {
    flex: 1;
    padding: 0 10px;
  }

  .look-copy strong {
    font-size: 14px;
  }

  .tabs {
    gap: 1px;
    margin: 0 10px;
    padding: 4px;
    border-radius: 15px;
  }

  .tab {
    height: 49px;
    font-size: 9px;
    border-radius: 11px;
  }

  .tab svg {
    width: 18px;
    height: 18px;
  }

  .tab-count {
    right: 4%;
    top: 3px;
  }

  .wardrobe-head {
    padding: 16px 16px 14px;
  }

  .wardrobe-head h1 {
    font-size: 22px;
  }

  .round-add {
    width: 38px;
    height: 38px;
  }

  .category-bar {
    padding: 13px 16px 9px;
  }

  .items-scroll {
    padding-left: 13px;
    padding-right: 13px;
    padding-bottom: 14px;
  }

  .items-grid {
    gap: 8px;
  }

  .item-card {
    padding: 6px 6px 8px;
    border-radius: 14px;
  }

  .item-thumb {
    border-radius: 10px;
  }

  .item-name {
    font-size: 9px;
  }

  .item-kind {
    display: none;
  }

  .item-meta {
    padding-top: 6px;
  }

  .add-card {
    min-height: 138px;
  }

  .wardrobe-foot {
    padding: 9px 13px 12px;
  }

  .import-main {
    padding: 9px 10px;
  }

  .import-plus {
    width: 28px;
    height: 28px;
  }

  .clear-category {
    padding: 0 9px;
  }

  .modal {
    padding: 10px;
  }

  .modal-card {
    max-height: calc(100dvh - 20px);
    border-radius: 22px;
  }

  .modal-head h2 {
    font-size: 21px;
  }

  .help-grid {
    grid-template-columns: 1fr;
    padding: 0 18px 16px;
  }

  .help-footer {
    flex-direction: column;
    align-items: stretch;
    padding: 13px 18px 18px;
  }

  .help-footer .primary-btn {
    width: 100%;
  }

  .category-picker button {
    height: 35px;
  }

  .adjust-bar {
    bottom: 63px;
    padding: 6px 7px;
  }

  .adjust-name {
    display: none;
  }

  .adjust-tools {
    margin-right: auto;
  }

  .adjust-remove {
    font-size: 9px;
  }

  .worn-meter small {
    display: none;
  }
}

@media (max-height: 760px) and (min-width: 901px) {
  .topbar {
    height: 64px;
    padding-top: 10px;
  }

  .workspace {
    height: calc(100dvh - 78px);
    padding-top: 6px;
    padding-bottom: 12px;
  }

  .brand-mark {
    width: 42px;
    height: 42px;
  }

  .brand-copy strong {
    font-size: 20px;
  }

  .wardrobe-head {
    padding-top: 16px;
    padding-bottom: 14px;
  }

  .wardrobe-head h1 {
    font-size: 22px;
  }

  .wardrobe-head p {
    display: none;
  }

  .category-bar {
    padding-top: 13px;
    padding-bottom: 9px;
  }

  .look-strip {
    min-height: 52px;
  }

  .stage-card {
    padding-top: 13px;
    padding-bottom: 12px;
  }

  .item-thumb {
    aspect-ratio: 1.45 / 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
  }
}
