/* 人偶大师 — 与镶口同布局；雾粉中性色 */
:root {
  --kb-offset: 0px;
  --bg: #e8dde2;
  --panel: #f0e6ea;
  --border: #cbb4be;
  --border-soft: #d9c6ce;
  --text: #5c4550;
  --muted: #8a7380;
  --accent: #d08aa0;
  --accent-soft: #e8cdd6;
  --accent-deep: #b86e86;
  --input-bg: #f5eef1;
  --btn-bg: #e4d4db;
  --btn-hover: #dcc8d1;
  --viewport-edge: #cbb4be;
  --card-shadow: 0 4px 14px rgba(92, 69, 80, 0.1);
  --font: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  --radius: 10px;
  --radius-sm: 8px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html.no-scribble,
html.no-scribble body {
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

.no-scribble #panel {
  touch-action: pan-y;
}

.no-scribble #panel .btn,
.no-scribble #view-modes button,
.no-scribble #tray-bar button {
  touch-action: none;
}

/* 预设条允许左右滑动浏览；缩略图按钮勿锁死触摸平移 */
.no-scribble #preset-tray,
.no-scribble .pose-tray {
  touch-action: pan-x;
}

.no-scribble .pose-thumb-btn {
  touch-action: pan-x;
}

.no-scribble #panel input[type="number"],
.no-scribble #panel input[type="text"],
.no-scribble #panel textarea,
.no-scribble .modal input,
.no-scribble .modal textarea,
.no-scribble .preset-search {
  touch-action: manipulation;
  -webkit-user-select: text;
  user-select: text;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
}

#app {
  display: grid;
  grid-template-columns: 1fr minmax(300px, 348px);
  grid-template-rows: 1fr 186px;
  width: 100%;
  height: 100%;
}

#viewport-wrap {
  grid-column: 1;
  grid-row: 1;
  position: relative;
  background: #ddd0d6;
  border-right: 1px solid var(--viewport-edge);
  border-bottom: 1px solid var(--viewport-edge);
  min-width: 0;
  min-height: 0;
}

#viewport {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
}

#viewport-top-left {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 4;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  max-width: min(280px, calc(100% - 24px));
  pointer-events: none;
}

#pose-ref-preview {
  position: relative;
  width: min(200px, 42vw);
  max-height: min(280px, 46vh);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-soft);
  background: rgba(240, 230, 234, 0.94);
  box-shadow: var(--card-shadow);
  overflow: hidden;
  pointer-events: auto;
  user-select: none;
}

#pose-ref-preview[hidden] {
  display: none !important;
}

#pose-ref-img {
  display: block;
  width: 100%;
  height: auto;
  max-height: min(280px, 46vh);
  object-fit: contain;
  object-position: center top;
  background: #e8dde4;
}

#pose-ref-preview .pose-skel-overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

#btn-pose-ref-close {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 22px;
  height: 22px;
  padding: 0;
  border: 1px solid rgba(80, 60, 70, 0.22);
  border-radius: 999px;
  background: rgba(255, 248, 250, 0.92);
  color: #6a5560;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 3px rgba(60, 40, 50, 0.12);
}

#btn-pose-ref-close:hover {
  background: #fff;
  color: #3a2a32;
  border-color: rgba(80, 60, 70, 0.35);
}

#viewport-ops {
  min-width: 0;
  max-width: min(360px, calc(100vw - 48px));
  padding: 8px 12px 9px;
  background: rgba(240, 230, 234, 0.92);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  box-shadow: var(--card-shadow);
  user-select: none;
}

.ops-title {
  font-size: 11px;
  color: #9a8490;
  letter-spacing: 0.08em;
  margin-bottom: 3px;
}

#viewport-ops-body {
  color: var(--text);
  font-size: 13px;
  line-height: 1.35;
  white-space: normal;
}

#hint-stack {
  position: absolute;
  left: 12px;
  bottom: 12px;
  max-width: min(46%, 420px);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  pointer-events: none;
  z-index: 2;
}

#status {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
  max-width: 100%;
  white-space: pre-line;
  padding: 7px 12px;
  background: rgba(240, 230, 234, 0.88);
  border: 1px solid var(--border-soft);
  border-radius: 999px;
}

#view-hud {
  position: absolute;
  right: 14px;
  bottom: 12px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
  z-index: 3;
  pointer-events: none;
}

#view-hud > * {
  pointer-events: auto;
}

#view-modes {
  display: flex;
  flex-direction: row;
  align-items: flex-end;
  gap: 6px;
}


.panel-title #app-version {
  margin-left: 6px;
  color: #9a8490;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  opacity: 0.85;
  vertical-align: baseline;
}

#view-modes button {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  width: 58px;
  height: 54px;
  padding: 5px 2px;
  border: 1px solid var(--border);
  background: rgba(240, 230, 234, 0.92);
  color: var(--text);
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: background 0.12s ease, border-color 0.12s ease, color 0.12s ease, transform 0.12s ease;
  box-shadow: 0 2px 8px rgba(92, 69, 80, 0.08);
}

#view-modes button svg {
  width: 22px;
  height: 22px;
  display: block;
}

#view-modes button span {
  font-size: 11px;
  line-height: 1;
  user-select: none;
}

#view-modes button:hover {
  border-color: var(--accent);
  color: var(--accent-deep);
  background: #f5eef1;
  transform: translateY(-1px);
}

#view-modes button.active {
  border-color: var(--accent);
  color: #fff8fa;
  background: var(--accent);
}

#view-modes button.active svg {
  color: #fff8fa;
}

#view-modes button:disabled {
  opacity: 0.42;
  cursor: not-allowed;
  border-color: var(--border-soft);
  color: #a8909a;
  background: rgba(228, 212, 219, 0.7);
  transform: none;
}

#tray-bar {
  grid-column: 1;
  grid-row: 2;
  background: linear-gradient(180deg, #ebe0e5 0%, #e4d6dc 100%);
  border-top: 1px solid var(--viewport-edge);
  border-right: 1px solid var(--viewport-edge);
  display: flex;
  flex-direction: column;
  align-items: stretch;
  padding: 8px 14px 10px;
  overflow: hidden;
  gap: 8px;
  min-height: 0;
}

.tray-bar-head {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 30px;
}

.tray-bar-label {
  flex: 0 0 auto;
  color: #8a7380;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  white-space: nowrap;
  user-select: none;
}

.preset-search-wrap {
  position: relative;
  flex: 0 1 220px;
  max-width: 260px;
  min-width: 148px;
  display: flex;
  align-items: center;
}

.preset-search-icon {
  position: absolute;
  left: 10px;
  width: 14px;
  height: 14px;
  color: #a8909a;
  pointer-events: none;
}

.preset-search {
  width: 100%;
  height: 30px;
  padding: 0 12px 0 30px;
  border: 1px solid var(--border-soft);
  border-radius: 999px;
  background: #faf4f6;
  color: var(--text);
  font-size: 12px;
  outline: none;
  transition: border-color 0.12s ease, box-shadow 0.12s ease, background 0.12s ease;
}

.preset-search::placeholder {
  color: #b29aaa;
}

.preset-search:hover {
  background: #fff8fa;
}

.preset-search:focus {
  border-color: var(--accent);
  background: #fffafb;
  box-shadow: 0 0 0 3px rgba(208, 138, 160, 0.18);
}

.pose-tray {
  display: flex;
  flex-direction: row;
  gap: 8px;
  align-items: stretch;
  overflow-x: auto;
  overflow-y: hidden;
  flex: 1;
  min-width: 0;
  min-height: 0;
  padding: 0 2px 2px;
  touch-action: pan-x;
  overscroll-behavior-x: contain;
  scrollbar-width: thin;
  scrollbar-color: rgba(184, 110, 134, 0.55) transparent;
  cursor: grab;
}

.pose-tray:active {
  cursor: grabbing;
}

.pose-tray::-webkit-scrollbar {
  height: 6px;
}

.pose-tray::-webkit-scrollbar-thumb {
  background: rgba(184, 110, 134, 0.45);
  border-radius: 999px;
}

.pose-tray::-webkit-scrollbar-track {
  background: transparent;
}

.pose-thumb-btn {
  appearance: none;
  flex: 0 0 auto;
  width: 92px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 6px 6px 6px;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  background: #faf4f6;
  color: var(--text);
  cursor: pointer;
  user-select: none;
  transition: border-color 0.12s ease, background 0.12s ease, box-shadow 0.12s ease;
}

.pose-thumb-btn:hover {
  border-color: var(--accent);
  background: #fff8fa;
}

.pose-thumb-btn.active {
  border-color: var(--accent-deep);
  background: var(--accent-soft);
  box-shadow: 0 0 0 1px rgba(184, 110, 134, 0.25);
}

.pose-thumb-frame {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 78px;
  height: 104px; /* 约 3:4 */
  border-radius: 6px;
  background: linear-gradient(180deg, #f3e8ec 0%, #eadde3 100%);
  overflow: hidden;
}

.pose-thumb-frame img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center center;
  pointer-events: none;
  background: #efe4e9;
}

.pose-thumb-label {
  font-size: 11px;
  line-height: 1.2;
  color: var(--muted);
  letter-spacing: 0.02em;
}

.pose-thumb-btn.active .pose-thumb-label {
  color: var(--accent-deep);
  font-weight: 600;
}

#panel {
  grid-column: 2;
  grid-row: 1 / 3;
  display: flex;
  flex-direction: column;
  background: var(--panel);
  border-left: 1px solid var(--border);
  padding: 12px 12px 14px;
  gap: 10px;
  overflow: hidden;
  min-height: 0;
}

.panel-header {
  flex-shrink: 0;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-soft);
}

.panel-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--accent-deep);
  letter-spacing: 0.04em;
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0 2px;
}

.panel-subtitle {
  margin-top: 3px;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.35;
}

.panel-body {
  flex: 1 1 auto;
  min-height: 0;
  max-height: 100%;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-gutter: stable;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-right: 4px;
  /* 内容超出时滚动，勿把分组压扁 */
  align-content: flex-start;
}

.panel-slot {
  flex: 1;
  min-height: 160px;
  margin-top: 4px;
  padding: 18px 16px;
  border: 1.5px dashed var(--border);
  border-radius: var(--radius);
  background: rgba(255, 248, 250, 0.35);
  color: var(--muted);
  line-height: 1.55;
  display: flex;
  flex-direction: column;
  gap: 8px;
  justify-content: center;
}

.panel-slot-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--accent-deep);
}

.panel-slot-note {
  font-size: 13px;
  color: var(--muted);
}

.param-group {
  display: flex;
  flex-direction: column;
  flex: 0 0 auto;
  gap: 0;
  padding: 0 8px 8px;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  background: var(--group-bg, #f5eef1);
  box-shadow: 0 1px 6px rgba(92, 69, 80, 0.05);
  overflow: hidden;
}

.param-group-grow {
  flex: 0 0 auto;
}

.param-group-title {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  width: calc(100% + 16px);
  margin: 0 -8px;
  padding: 9px 10px 7px;
  border: none;
  border-bottom: 1px solid var(--group-line, var(--border-soft));
  background: var(--group-sticky, #efe4e9);
  color: var(--group-accent, #9a8490);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-align: left;
  cursor: pointer;
  appearance: none;
  font-family: inherit;
}

.param-group-title:hover {
  filter: brightness(0.98);
}

.param-group-title::before {
  content: '▾';
  display: inline-block;
  margin-right: 4px;
  font-size: 10px;
  opacity: 0.7;
}

.param-group.collapsed .param-group-title::before {
  content: '▸';
}

.param-group-note {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--muted);
}

.param-group-body {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-top: 8px;
}

.param-group.collapsed .param-group-body {
  display: none;
}

.param-group.collapsed {
  padding-bottom: 0;
}

.param-group.collapsed .param-group-title {
  border-bottom-color: transparent;
}

/* 模块标题色：按职能分区，彼此可辨 */
.param-group[data-group="doll"] {
  /* 添加 · 紫灰 */
  --group-accent: #7a6a96;
  --group-bg: rgba(148, 132, 176, 0.09);
  --group-line: rgba(148, 132, 176, 0.3);
  --group-sticky: #ebe6f3;
}

.param-group[data-group="scene-doll"] {
  /* 场景 · 品牌玫（默认展开） */
  --group-accent: #b86e86;
  --group-bg: rgba(208, 138, 160, 0.1);
  --group-line: rgba(208, 138, 160, 0.32);
  --group-sticky: #f3e4ea;
}

.param-group[data-group="edit"],
.param-group[data-group="mirror"] {
  /* 编辑 · 青蓝 */
  --group-accent: #5f7f96;
  --group-bg: rgba(120, 156, 180, 0.09);
  --group-line: rgba(120, 156, 180, 0.28);
  --group-sticky: #e5eef3;
}

.param-group[data-group="constraint"] {
  /* 约束 · 暖杏 */
  --group-accent: #9a7458;
  --group-bg: rgba(196, 152, 120, 0.1);
  --group-line: rgba(196, 152, 120, 0.3);
  --group-sticky: #f3ebe4;
}

.param-group[data-group="nav"] {
  /* 视角 · 苔绿 */
  --group-accent: #5f8a72;
  --group-bg: rgba(120, 168, 144, 0.09);
  --group-line: rgba(120, 168, 144, 0.28);
  --group-sticky: #e5f1ea;
}

.param-group[data-group="export"],
.param-group[data-group="library"] {
  /* 导出图片 · 石板灰 */
  --group-accent: #6e7580;
  --group-bg: rgba(130, 138, 148, 0.08);
  --group-line: rgba(130, 138, 148, 0.26);
  --group-sticky: #eaedf0;
}

.panel-export-model {
  flex-shrink: 0;
  padding-top: 8px;
  border-top: 1px solid var(--border-soft);
}

.panel-export-model .btn-export-model-solo {
  width: 100%;
  min-height: 36px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--accent-deep);
  border-color: color-mix(in srgb, var(--accent) 55%, var(--border));
  background: color-mix(in srgb, var(--accent-soft) 70%, #fff);
}

.panel-export-model .btn-export-model-solo:hover:not(:disabled) {
  background: var(--accent-soft);
  border-color: var(--accent);
}

.panel-export-model .btn-export-model-solo:disabled {
  opacity: 0.55;
}

.panel-note {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.4;
}

.toolbar-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1.2fr;
  gap: 5px;
}

.toolbar-row-2 {
  grid-template-columns: 1fr 1fr;
  align-items: center;
}

.toolbar-row-gap {
  margin-top: 4px;
}

.toolbar-row-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.toolbar-row-export {
  grid-template-columns: 1fr;
  align-items: center;
}

.param-advanced {
  margin-top: 4px;
  border: 1px solid rgba(208, 138, 160, 0.28);
  border-radius: var(--radius-sm);
  background: rgba(255, 248, 250, 0.45);
  overflow: hidden;
}

.param-advanced-summary {
  list-style: none;
  cursor: pointer;
  user-select: none;
  padding: 8px 10px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--accent-deep);
  background: rgba(208, 138, 160, 0.12);
}

.param-advanced-summary::-webkit-details-marker {
  display: none;
}

.param-advanced-summary::before {
  content: '▸';
  display: inline-block;
  margin-right: 6px;
  transition: transform 0.15s ease;
  opacity: 0.85;
}

.param-advanced[open] > .param-advanced-summary::before {
  transform: rotate(90deg);
}

.param-advanced[open] > .param-advanced-summary {
  border-bottom: 1px solid rgba(208, 138, 160, 0.22);
}

.param-advanced-body {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px 8px 10px;
}

.export-view-checks {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 4px;
  margin: 0 0 6px;
}

.export-view-check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  height: 28px;
  padding: 0 2px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--btn-bg);
  color: var(--text);
  font-size: 12px;
  cursor: pointer;
  user-select: none;
}

.export-view-check input {
  width: 14px;
  height: 14px;
  margin: 0;
  accent-color: var(--accent);
  cursor: pointer;
}

.export-view-check:has(input:checked) {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 14%, var(--btn-bg));
}

.toggle-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 30px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--btn-bg);
  color: var(--text);
  font-size: 12px;
  cursor: pointer;
  user-select: none;
}

.toggle-chip input {
  width: 15px;
  height: 15px;
  accent-color: var(--accent);
  cursor: pointer;
}

.toggle-chip:has(input:checked) {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-deep);
  font-weight: 600;
}

.edit-section-label {
  margin: 10px 0 6px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: #9a8490;
}

.clone-grid {
  display: grid;
  grid-template-columns: 32px 1fr 1fr 1fr;
  gap: 4px;
  align-items: center;
}

.clone-label {
  font-size: 11px;
  color: var(--text);
  font-weight: 600;
  letter-spacing: 0.02em;
  user-select: none;
}

.selected-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  min-height: 18px;
}

.selected-name {
  flex: 1;
  min-width: 0;
  font-size: 12px;
  color: var(--accent-deep);
  font-weight: 600;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.btn-row .btn {
  flex: 1 1 auto;
  min-width: 56px;
}

.param-row {
  display: grid;
  grid-template-columns: 36px 1fr 40px;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text);
}

.param-row-label {
  color: var(--muted);
}

.param-row-value {
  text-align: right;
  font-variant-numeric: tabular-nums;
  color: var(--accent-deep);
  font-size: 11px;
}

.param-row input[type='range'] {
  width: 100%;
  accent-color: var(--accent);
  cursor: pointer;
}

.joint-list {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  flex: 1 1 auto;
  min-height: 72px;
  max-height: none;
  overflow-y: auto;
  padding: 1px;
  align-content: flex-start;
}

.joint-chip {
  appearance: none;
  border: 1px solid var(--border);
  background: #faf4f6;
  color: var(--text);
  font-size: 10px;
  padding: 3px 7px;
  border-radius: 999px;
  cursor: pointer;
  line-height: 1.35;
}

.joint-chip:hover {
  border-color: var(--accent);
}

.joint-chip.active {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent-deep);
  font-weight: 600;
}

.tray-btn {
  flex: 0 0 auto;
  height: 38px;
  min-width: 72px;
  padding: 0 14px;
  border: 1px solid var(--border);
  background: rgba(245, 238, 241, 0.95);
  color: var(--text);
  border-radius: var(--radius-sm);
  font-size: 13px;
  cursor: pointer;
  box-shadow: 0 1px 5px rgba(92, 69, 80, 0.07);
}

.tray-btn:hover:not(:disabled) {
  border-color: var(--accent);
  color: var(--accent-deep);
}

.tray-btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff8fa;
  font-weight: 600;
}

#panel-actions {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: auto;
  padding-top: 6px;
  border-top: 1px solid var(--border-soft);
}

.btn {
  height: 34px;
  border: 1px solid var(--border);
  background: var(--btn-bg);
  color: var(--text);
  font-size: 13px;
  cursor: pointer;
  width: 100%;
  border-radius: var(--radius-sm);
  transition: background 0.15s ease, border-color 0.15s ease, opacity 0.15s;
}

.btn-compact {
  height: 30px;
  font-size: 12px;
  padding: 0 6px;
}

.nav-mode-row {
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.persp-strength-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
}

.persp-strength-row.is-disabled {
  opacity: 0.45;
  pointer-events: none;
}

.persp-strength-label {
  flex: 0 0 auto;
  font-size: 11px;
  font-weight: 600;
  color: var(--text);
  user-select: none;
}

.persp-strength-row input[type='range'] {
  flex: 1 1 auto;
  min-width: 0;
  accent-color: var(--accent);
  cursor: pointer;
}

.persp-strength-val {
  flex: 0 0 28px;
  text-align: right;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  color: var(--muted, #888);
  user-select: none;
}

.nav-mode-row .btn.active {
  border-color: #c9a227;
  color: #f0e6c8;
  box-shadow: inset 0 0 0 1px rgba(201, 162, 39, 0.55);
}

.btn.active {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 18%, var(--btn-bg));
  color: var(--accent-deep, var(--accent));
  font-weight: 600;
}

.btn:hover:not(:disabled) {
  background: var(--btn-hover);
  border-color: var(--accent);
}

.btn:disabled {
  opacity: 0.38;
  cursor: not-allowed;
}

.btn-primary {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff8fa;
  font-weight: 600;
}

.btn-primary:hover:not(:disabled) {
  background: var(--accent-deep);
  border-color: var(--accent-deep);
}

.btn-ghost {
  background: transparent;
  border-style: dashed;
  color: var(--muted);
}

.pose-tray-empty {
  flex: 1 1 auto;
  align-self: center;
  padding: 10px 12px;
  font-size: 12px;
  line-height: 1.45;
  color: var(--muted);
  white-space: normal;
}

.pose-thumb-meta {
  font-size: 9px;
  color: #9a8490;
  line-height: 1.1;
  max-width: 68px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pose-thumb-btn.community .pose-thumb-label {
  font-size: 10px;
}

#app-version {
  cursor: pointer;
  user-select: none;
}

.modal[hidden] {
  display: none !important;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  padding-bottom: calc(16px + var(--kb-offset, 0px));
  background: rgba(40, 28, 34, 0.45);
  pointer-events: auto;
  transition: padding-bottom 0.12s ease;
}

/* iPad 虚拟键盘顶起弹窗 */
html.kb-open .modal {
  align-items: flex-end;
}
html.kb-open .modal .modal-card {
  margin-bottom: 8px;
  max-height: min(52vh, 720px);
}

.modal .modal-card {
  pointer-events: auto;
}

.modal-card {
  width: min(420px, 100%);
  max-height: min(86vh, 720px);
  overflow: auto;
  padding: 14px 16px 16px;
  border-radius: 12px;
  border: 1px solid var(--border-soft);
  background: #f7eef2;
  box-shadow: 0 12px 40px rgba(60, 40, 50, 0.22);
}

.modal-card-sm {
  width: min(320px, 100%);
}

.modal-card-wide {
  width: min(720px, 100%);
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.modal-head h2 {
  margin: 0;
  font-size: 15px;
  font-weight: 650;
  color: var(--text);
}

.modal-close {
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: #8a7380;
  font-size: 20px;
  cursor: pointer;
}

.modal-close:hover {
  background: rgba(0, 0, 0, 0.06);
  color: #3a2a32;
}

.modal-hint {
  margin: 0 0 10px;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.4;
}

.modal-msg {
  margin: 0 0 10px;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 12px;
  line-height: 1.45;
  background: rgba(180, 60, 80, 0.1);
  color: #9a3048;
}

.modal-msg.is-ok {
  background: rgba(40, 120, 80, 0.1);
  color: #2a6a4a;
}

.modal-result-body {
  font-size: 13px;
  color: var(--text);
}

.modal-result-body strong {
  color: #8a3048;
  font-size: 16px;
  letter-spacing: 0.04em;
}

.modal-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 10px;
  font-size: 12px;
  color: #7a6570;
}

.modal-field input {
  height: 32px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--text);
  font-size: 13px;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 12px;
}

.admin-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}

.admin-tab {
  height: 28px;
  padding: 0 10px;
  border: 1px solid var(--border-soft);
  border-radius: 999px;
  background: #faf4f6;
  color: var(--text);
  font-size: 12px;
  cursor: pointer;
}

.admin-tab.active {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.admin-body {
  min-height: 180px;
  max-height: 58vh;
  overflow: auto;
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  background: #fff;
}

.admin-row {
  display: grid;
  grid-template-columns: 52px 1fr auto;
  gap: 8px;
  align-items: center;
  padding: 8px 10px;
  border-bottom: 1px solid #f0e4e9;
  font-size: 12px;
}

.admin-row img {
  width: 44px;
  height: 52px;
  object-fit: cover;
  border-radius: 4px;
  background: #f3e8ec;
}

.admin-row-main {
  min-width: 0;
}

.admin-row-main strong {
  display: block;
  color: var(--text);
}

.admin-row-main span {
  color: #9a8490;
}

.admin-row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  justify-content: flex-end;
}

.admin-empty {
  padding: 24px;
  text-align: center;
  color: #9a8490;
  font-size: 13px;
}

.admin-stats {
  padding: 4px 2px 8px;
}

.admin-stats-hint {
  margin: 0 0 10px;
  font-size: 12px;
  color: #9a8490;
  line-height: 1.4;
}

.admin-stats-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.admin-stats-table th,
.admin-stats-table td {
  padding: 8px 10px;
  border-bottom: 1px solid #f0e4e9;
  text-align: right;
}

.admin-stats-table thead th {
  color: #7a6570;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.55);
}

.admin-stats-table tbody th {
  text-align: left;
  font-weight: 550;
  color: var(--text);
}

.admin-stats-table tbody tr:last-child th,
.admin-stats-table tbody tr:last-child td {
  font-weight: 650;
  border-bottom: none;
  padding-top: 12px;
}

.admin-usage-row {
  display: grid;
  grid-template-columns: 148px 100px 1fr;
  gap: 8px;
  padding: 6px 10px;
  border-bottom: 1px solid #f0e4e9;
  font-size: 11px;
  color: #6a5560;
}

/* —— DesignDoll 式手部调节浮层 —— */
#hand-tool {
  position: absolute;
  /* 方位立方体约 108×108 + margin14，面板顶边让开 */
  right: 14px;
  top: 136px;
  bottom: auto;
  z-index: 40;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  pointer-events: auto;
  user-select: none;
  touch-action: none;
  transform: scale(1.12);
  transform-origin: top right;
}

#hand-tool[hidden] {
  display: none !important;
}

.hand-tool-sides {
  display: flex;
  gap: 6px;
}

.hand-side-btn {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  border: 1px solid #5a5a5a;
  background: #3a3a3a;
  color: #ddd;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  line-height: 1.05;
  padding: 0;
}

.hand-side-btn .hand-side-ico {
  font-size: 14px;
  line-height: 1;
  opacity: 0.85;
}

.hand-side-btn .hand-side-ico-flip {
  transform: scaleX(-1);
}

.hand-side-btn.active {
  border: 2px solid #c9a227;
  box-shadow: inset 0 0 0 2px #c9a227;
  background: #454545;
  color: #f0e6c8;
}

.hand-side-btn:hover {
  background: #484848;
}

.hand-reset-btn {
  width: 176px;
  height: 28px;
  margin: 0;
  border-radius: 8px;
  border: 1px solid #1f1f1f;
  background: #2e2e2e;
  color: #d8d8d8;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.28);
}

.hand-reset-btn:hover {
  background: #3a3a3a;
  color: #f0e6c8;
  border-color: #5a5a5a;
}

.hand-reset-btn:active {
  background: #454545;
  color: #ffb070;
}

.hand-focus-row {
  display: flex;
  gap: 6px;
  width: 176px;
}

.hand-focus-btn {
  flex: 1 1 0;
  height: 28px;
  margin: 0;
  border-radius: 8px;
  border: 1px solid #1f1f1f;
  background: #2e2e2e;
  color: #d8d8d8;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.28);
}

.hand-focus-btn:hover:not(:disabled) {
  background: #3a3a3a;
  color: #f0e6c8;
  border-color: #5a5a5a;
}

.hand-focus-btn.active {
  border-color: #c9a227;
  color: #f0e6c8;
  box-shadow: inset 0 0 0 1px rgba(201, 162, 39, 0.55);
}

.hand-focus-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.hand-schematic {
  position: relative;
  width: 176px;
  height: 186px;
  border-radius: 14px;
  background: #2e2e2e;
  border: 1px solid #1f1f1f;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  padding: 10px 12px 12px;
  box-sizing: border-box;
}

/* 左手：整板水平镜像（拇指到左侧，指序对调）；勿再单独改 thumb 的 left/right，否则会抵消镜像 */
.hand-schematic[data-mirror="1"] {
  transform: scaleX(-1);
}

.hand-fingers {
  display: flex;
  align-items: flex-end;
  gap: 5px;
  height: 96px;
}

.hand-finger-col,
.toe-finger-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  flex: 0 0 auto;
}

.digit-num {
  display: block;
  width: 100%;
  text-align: center;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  color: #f0e6c8;
  letter-spacing: 0.02em;
  user-select: none;
  pointer-events: none;
}

/* 整板镜像后，编号再翻回来，避免数字反着看 */
.hand-schematic[data-mirror="1"] .digit-num,
.toe-schematic[data-mirror="1"] .digit-num {
  transform: scaleX(-1);
}

.digit-num-thumb {
  position: absolute;
  /* 拇指轨内侧略偏下；LH 镜像后 right 越小越靠左 */
  right: 20px;
  bottom: 52px;
  left: auto;
  top: auto;
  z-index: 3;
  width: auto;
  margin: 0;
  font-size: 12px;
  font-weight: 700;
  color: #f0e6c8;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.75);
  transform: none;
  pointer-events: none;
  user-select: none;
}

.hand-schematic[data-mirror="1"] .digit-num-thumb {
  transform: scaleX(-1);
}

.hand-finger-track {
  position: relative;
  width: 22px;
  height: 78px;
  border-radius: 12px;
  background: #1a1a1a;
  border: 1px solid #111;
  cursor: ns-resize;
  flex: 0 0 auto;
}

.hand-weight-col {
  display: flex;
  gap: 5px;
  margin-left: 6px;
  height: auto;
  align-self: flex-end;
  padding-bottom: 2px;
  flex: 0 0 auto;
}

.hand-weight-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  flex: 0 0 auto;
}

.hand-weight-label {
  display: block;
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
  color: #f0e6c8;
  letter-spacing: 0.02em;
  user-select: none;
  pointer-events: none;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.75);
}

.hand-schematic[data-mirror="1"] .hand-weight-label {
  transform: scaleX(-1);
}

.hand-weight-track {
  position: relative;
  width: 9px;
  height: 52px;
  border-radius: 4px;
  background: #1a1a1a;
  border: 1px solid #111;
  cursor: ns-resize;
}

.hand-weight-knob {
  position: absolute;
  left: 50%;
  top: 0;
  width: 9px;
  height: 9px;
  margin-left: -4.5px;
  border-radius: 50%;
  background: #e8e8e8;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.35);
  pointer-events: none;
}

.hand-spread-track {
  position: relative;
  margin-top: 10px;
  width: 108px;
  height: 22px;
  border-radius: 12px;
  background: #1a1a1a;
  border: 1px solid #111;
  cursor: ew-resize;
}

.hand-thumb-track {
  position: absolute;
  right: 12px;
  bottom: 16px;
  width: 22px;
  height: 64px;
  border-radius: 12px;
  background: #1a1a1a;
  border: 1px solid #111;
  cursor: ns-resize;
  transform: rotate(28deg);
  transform-origin: center bottom;
}

.hand-knob {
  position: absolute;
  left: 50%;
  top: 0;
  width: 16px;
  height: 16px;
  margin-left: -8px;
  border-radius: 50%;
  background: #f2f2f2;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.45);
  pointer-events: none;
}

.hand-spread-track .hand-knob {
  left: 0;
  top: 50%;
  margin-left: 0;
  margin-top: -8px;
}

.hand-finger-track:active .hand-knob,
.hand-thumb-track:active .hand-knob,
.hand-spread-track:active .hand-knob {
  background: #ff7a3c;
  box-shadow: 0 0 0 6px rgba(255, 100, 40, 0.35);
}

/* 导出格式选择（对齐指环大师 askChoice） */
#choice-overlay.modal .choice-card {
  width: min(340px, 100%);
}

.choice-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 4px;
}

.choice-options .choice-option {
  width: 100%;
  height: 34px;
  justify-content: center;
  text-align: center;
}

/* —— 脚趾调节面板（与手部同侧浮层，互斥显示） —— */
#toe-tool {
  position: absolute;
  right: 14px;
  top: 136px;
  bottom: auto;
  z-index: 40;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  pointer-events: auto;
  user-select: none;
  touch-action: none;
  transform: scale(1.12);
  transform-origin: top right;
}

#toe-tool[hidden] {
  display: none !important;
}

.toe-tool-sides {
  display: flex;
  gap: 6px;
}

.toe-side-btn {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  border: 1px solid #5a5a5a;
  background: #3a3a3a;
  color: #ddd;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  line-height: 1.05;
  padding: 0;
}

.toe-side-btn .toe-side-ico {
  font-size: 14px;
  line-height: 1;
  opacity: 0.85;
}

.toe-side-btn .toe-side-ico-flip {
  transform: scaleX(-1);
}

.toe-side-btn.active {
  border: 2px solid #c9a227;
  box-shadow: inset 0 0 0 2px #c9a227;
  background: #454545;
  color: #f0e6c8;
}

.toe-side-btn:hover {
  background: #484848;
}

.toe-schematic {
  position: relative;
  width: 176px;
  height: 168px;
  border-radius: 14px;
  background: #2e2e2e;
  border: 1px solid #1f1f1f;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  padding: 10px 12px 12px;
  box-sizing: border-box;
}

.toe-schematic[data-mirror="1"] {
  transform: scaleX(-1);
}

.toe-fingers {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 4px;
  height: 108px;
}

.toe-finger-col {
  flex: 1 1 0;
  min-width: 0;
}

.toe-finger-track {
  position: relative;
  width: 100%;
  max-width: 26px;
  height: 90px;
  border-radius: 12px;
  background: #1a1a1a;
  border: 1px solid #111;
  cursor: ns-resize;
  flex: 0 0 auto;
}

.toe-spread-track {
  position: relative;
  margin-top: 10px;
  width: 140px;
  height: 22px;
  border-radius: 12px;
  background: #1a1a1a;
  border: 1px solid #111;
  cursor: ew-resize;
}

.toe-knob {
  position: absolute;
  left: 50%;
  top: 0;
  width: 16px;
  height: 16px;
  margin-left: -8px;
  border-radius: 50%;
  background: #f2f2f2;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.45);
  pointer-events: none;
}

.toe-spread-track .toe-knob {
  left: 0;
  top: 50%;
  margin-left: 0;
  margin-top: -8px;
}

.toe-finger-track:active .toe-knob,
.toe-spread-track:active .toe-knob {
  background: #ff7a3c;
  box-shadow: 0 0 0 6px rgba(255, 100, 40, 0.35);
}

.toe-focus-row {
  margin-top: 6px;
}

.toe-reset-btn {
  width: 176px;
  height: 28px;
  margin: 0;
  border-radius: 8px;
  border: 1px solid #1f1f1f;
  background: #2e2e2e;
  color: #d8d8d8;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.28);
}

.toe-reset-btn:hover {
  background: #3a3a3a;
  color: #f0e6c8;
  border-color: #5a5a5a;
}

.toe-reset-btn:active {
  background: #454545;
  color: #ffb070;
}

@media (max-width: 900px) {
  #app {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(280px, 1fr) 176px auto;
  }
  #tray-bar {
    grid-row: 2;
    border-right: none;
    padding: 8px 10px 8px;
  }
  .preset-search-wrap {
    flex: 1 1 auto;
    max-width: none;
  }
  #panel {
    grid-column: 1;
    grid-row: 3;
    max-height: 40vh;
    border-left: none;
    border-top: 1px solid var(--border);
  }
  #hand-tool {
    right: 8px;
    top: 128px;
    bottom: auto;
    transform: scale(0.92);
    transform-origin: top right;
  }
  #toe-tool {
    right: 8px;
    top: 128px;
    bottom: auto;
    transform: scale(0.92);
    transform-origin: top right;
  }
}

.doll-catalog {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.doll-catalog-card {
  appearance: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  padding: 6px;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  background: #faf4f6;
  color: var(--text);
  cursor: pointer;
  transition: border-color 0.12s ease, background 0.12s ease, box-shadow 0.12s ease;
}

.doll-catalog-card:hover {
  border-color: var(--accent);
  background: #fff8fa;
  box-shadow: 0 2px 8px rgba(92, 69, 80, 0.08);
}

.doll-catalog-frame {
  display: block;
  width: 100%;
  aspect-ratio: 3 / 4;
  border-radius: 6px;
  overflow: hidden;
  background: linear-gradient(180deg, #f3e8ec 0%, #eadde3 100%);
}

.doll-catalog-frame img,
.doll-catalog-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.18s ease;
}

.doll-catalog-img.is-ready {
  opacity: 1;
}

.doll-catalog-frame.is-loading {
  background:
    linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.45), transparent) 0 0 / 200% 100%,
    linear-gradient(180deg, #f3e8ec 0%, #eadde3 100%);
  animation: doll-catalog-shimmer 1.1s ease-in-out infinite;
}

@keyframes doll-catalog-shimmer {
  0% { background-position: 100% 0, 0 0; }
  100% { background-position: -100% 0, 0 0; }
}

.doll-catalog-label {
  font-size: 10px;
  font-weight: 600;
  color: var(--accent-deep);
  letter-spacing: 0.01em;
  text-align: center;
  line-height: 1.25;
  max-width: 100%;
  word-break: break-all;
}

.doll-scene-label {
  margin-top: 10px;
  margin-bottom: 4px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: #9a8490;
}

#group-scene-doll .doll-scene-list {
  margin-top: 0;
}

.doll-scene-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 36px;
  padding: 6px;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  background: rgba(255, 248, 250, 0.55);
}

.doll-scene-empty {
  padding: 10px 8px;
  font-size: 11px;
  color: var(--muted);
  text-align: center;
}

.doll-scene-row {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr) 28px 28px 28px;
  align-items: center;
  gap: 4px;
  min-height: 32px;
  padding: 2px 4px;
  border-radius: 6px;
}

.doll-scene-row.is-active {
  background: var(--accent-soft);
}

.doll-scene-check {
  width: 15px;
  height: 15px;
  margin: 0;
  accent-color: var(--accent-deep);
  cursor: pointer;
}

.doll-scene-name {
  min-width: 0;
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.doll-scene-rename {
  min-width: 0;
  width: 100%;
  height: 26px;
  margin: 0;
  padding: 0 6px;
  border: 1px solid var(--accent);
  border-radius: 5px;
  background: #fff;
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
  font-family: inherit;
  outline: none;
  box-shadow: 0 0 0 2px rgba(176, 112, 136, 0.18);
}

.doll-scene-btn {
  appearance: none;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.doll-scene-btn:hover {
  border-color: var(--border);
  background: #faf4f6;
  color: var(--accent-deep);
}

.doll-scene-btn svg {
  width: 16px;
  height: 16px;
  display: block;
}

.doll-scene-btn.is-off {
  opacity: 0.45;
}

.switch-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 10px;
}

.switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  min-width: 0;
  min-height: 30px;
  cursor: pointer;
  user-select: none;
}

.switch-row-label {
  min-width: 0;
  font-size: 11px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.switch {
  position: relative;
  display: inline-block;
  width: 40px;
  height: 22px;
  flex-shrink: 0;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}

.switch-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: #dcc8d1;
  border: 1px solid var(--border);
  border-radius: 999px;
  transition: background 0.18s ease, border-color 0.18s ease;
}

.switch-slider::before {
  position: absolute;
  content: '';
  height: 16px;
  width: 16px;
  left: 2px;
  top: 2px;
  background: #fff8fa;
  border-radius: 50%;
  transition: transform 0.18s ease;
  box-shadow: 0 1px 3px rgba(92, 69, 80, 0.2);
}

.switch input:checked + .switch-slider {
  background: var(--accent);
  border-color: var(--accent-deep);
}

.switch input:checked + .switch-slider::before {
  transform: translateX(18px);
}

.switch input:focus-visible + .switch-slider {
  outline: 2px solid var(--accent-soft);
  outline-offset: 2px;
}

