/* OutfitAvatar · app.css — feature components (avatar studio, wardrobe,
   builder, planner, wishlist, stats, settings, theme gallery). */

/* ================= avatar ================= */

.avatar-card { overflow: hidden; display: flex; flex-direction: column; }
.avatar-stage {
  display: flex; align-items: center; justify-content: center;
  min-height: 300px;
  padding: 10px;
  position: relative;
}
.avatar-stage svg { width: 100%; height: auto; max-height: 66dvh; }
.home-stage svg { max-height: 470px; }
.avatar-edit-link { margin: 0 16px 16px; align-self: center; }

/* ---- 3D stages ---- */
.stage-3d { padding: 0; height: clamp(340px, 58dvh, 620px); }
.home-stage.stage-3d { height: clamp(340px, 52dvh, 540px); }
.avatar3d-canvas {
  width: 100% !important; height: 100% !important;
  display: block;
  border-radius: inherit;
  touch-action: none;
  cursor: grab;
}
.avatar3d-canvas:active { cursor: grabbing; }
.orbit-hint {
  position: absolute; bottom: 10px; left: 50%; transform: translateX(-50%);
  padding: 3px 11px; border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 72%, transparent);
  color: var(--text-3);
  pointer-events: none;
  animation: hintFade 6s forwards;
}
@keyframes hintFade { 0%, 70% { opacity: 1; } 100% { opacity: 0; } }
.quick-preview.stage-3d, .tryon-stage.stage-3d { height: 360px; width: 100%; }
.onboard-avatar.stage-3d { height: 280px; border-radius: var(--r-lg); overflow: hidden; }
.mini-3d img { width: 100%; height: auto; display: block; }

.avatar-svg .figure { transition: transform var(--dur-3) var(--ease); }
.avatar-svg.swap-in .clothing { animation: swapIn var(--dur-3) var(--ease) both; }
.avatar-svg.swap-in .piercings, .avatar-svg.swap-in .tattoos { animation: fadeIn var(--dur-3) both; }
@keyframes swapIn { from { opacity: 0.25; transform: translateY(5px); } to { opacity: 1; transform: none; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* studio */
.studio-layout { display: grid; grid-template-columns: minmax(310px, 5fr) 7fr; gap: 18px; align-items: start; }
.sticky-stage { position: sticky; top: calc(var(--nav-h) + 14px); }
.studio-side { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
#studio-tabs { padding-bottom: 2px; }

.ctl-group { display: flex; flex-direction: column; gap: 9px; padding-bottom: 16px; border-bottom: 1px solid var(--border); }
.ctl-group:last-child { border-bottom: 0; padding-bottom: 0; }
.ctl-title { color: var(--text-2); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.06em; font-weight: 700; }
.ctl-title:empty { display: none; }

.slider-row { display: grid; grid-template-columns: 86px 1fr; align-items: center; gap: 10px; }
.slider-label { font-size: 0.84rem; font-weight: 570; color: var(--text-2); }

.style-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(74px, 1fr)); gap: 8px; }
.style-cell {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 7px 4px 6px;
  border-radius: var(--r-md);
  border: 1.5px solid var(--border);
  background: var(--surface-2);
  transition: all var(--dur-1);
}
.style-cell svg { width: 52px; height: 52px; border-radius: 50%; background: var(--surface); }
.style-cell small { font-size: 0.66rem; color: var(--text-2); font-weight: 600; }
.style-cell:hover { transform: translateY(-2px); border-color: var(--text-3); }
.style-cell.on { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 9%, transparent); }
.style-cell.on small { color: var(--accent); }
.tattoo-cell svg { padding: 10px; color: var(--text); background: var(--surface); }

.soft-note { display: flex; gap: 10px; align-items: center; }
.soft-note .icon { color: var(--accent); }
.soft-note .badge { margin-left: auto; }

/* piercings */
.pierce-zone { display: flex; justify-content: center; padding: 14px; }
.pierce-zone svg { max-height: 380px; width: auto; max-width: 100%; }
.spot { cursor: pointer; }
.spot-hit { fill: transparent; }
.spot-dot {
  fill: color-mix(in srgb, var(--surface) 74%, transparent);
  stroke: var(--accent);
  stroke-width: 1.6; stroke-dasharray: 2.5 2.2;
  transition: all var(--dur-1);
}
.spot:hover .spot-dot { fill: color-mix(in srgb, var(--accent) 30%, transparent); stroke-dasharray: none; transform: scale(1.25); transform-origin: center; transform-box: fill-box; }
.spot.active .spot-dot { fill: transparent; stroke: var(--accent); stroke-width: 2; stroke-dasharray: none; transform: scale(1.5); transform-origin: center; transform-box: fill-box; }
.avatar-svg .piercings, .ear-svg .piercings { pointer-events: none; }
.pierce-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pierce-row strong { flex: 1 1 130px; }

/* accessories */
.acc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 9px; }
.acc-cell { transition: all var(--dur-1); }
.acc-cell.on { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 8%, var(--surface-2)); }
.acc-head { display: flex; align-items: center; gap: 8px; width: 100%; font-weight: 600; font-size: 0.86rem; }
.acc-head .icon:first-child { color: var(--text-2); }
.acc-state { margin-left: auto; color: var(--accent); display: flex; }
.acc-colors { margin-top: 8px; }
.acc-colors:empty { margin: 0; }

/* scenes */
.scene-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 9px; }
.scene-cell {
  border: 1.5px solid var(--border); border-radius: var(--r-md);
  overflow: hidden; background: var(--surface-2);
  display: flex; flex-direction: column; gap: 0;
  transition: all var(--dur-1);
}
.scene-cell svg { height: 108px; width: 100%; object-fit: cover; }
.scene-cell small { padding: 6px; font-size: 0.7rem; font-weight: 650; color: var(--text-2); }
.scene-cell:hover { transform: translateY(-2px); }
.scene-cell.on { border-color: var(--accent); }
.scene-cell.on small { color: var(--accent); }

/* ================= home ================= */

.home-grid { display: grid; grid-template-columns: 7fr 5fr; gap: 18px; align-items: start; }
.home-col { display: flex; flex-direction: column; gap: 18px; }
.home-ph { gap: 18px; }

.suggested-row { display: flex; gap: 18px; align-items: center; }
.suggested-info h3 { font-size: 1.16rem; }
.outfit-mini svg { width: 100%; height: auto; }

.ph-card { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.ph-head { display: flex; align-items: center; gap: 11px; }
.ph-ic {
  width: 42px; height: 42px; border-radius: var(--r-md);
  display: flex; align-items: center; justify-content: center;
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  color: var(--accent); flex-shrink: 0;
}
.ph-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 14px; }
.ph-card code { font-size: 0.72rem; background: var(--surface-2); padding: 1px 5px; border-radius: 5px; }

.sugg-row { display: flex; align-items: flex-start; gap: 10px; padding: 9px 11px; border-radius: var(--r-md); font-size: 0.88rem; transition: background var(--dur-1); }
a.sugg-row:hover { background: var(--surface-2); }
.sugg-ic { color: var(--accent); display: flex; margin-top: 1px; }

.recent-strip { display: flex; gap: 9px; overflow-x: auto; padding-bottom: 4px; }
.recent-chip {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 14px; border-radius: 999px;
  background: var(--surface-2); border: 1px solid var(--border);
  font-size: 0.84rem; font-weight: 570; white-space: nowrap;
  transition: all var(--dur-1);
}
.recent-chip:hover { border-color: var(--accent); transform: translateY(-1px); }
.recent-ic { color: var(--text-3); display: flex; }

.fav-strip { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.fav-card { display: flex; align-items: center; gap: 10px; transition: all var(--dur-1); }
.fav-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.fav-card .outfit-mini { width: 60px !important; flex-shrink: 0; }

.quick-layout { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.quick-preview { width: min(260px, 60vw); }
.quick-preview svg { width: 100%; height: auto; }

.onboard { display: grid; grid-template-columns: 190px 1fr; gap: 20px; align-items: center; }
.onboard-avatar svg { width: 100%; height: auto; border-radius: var(--r-lg); }
.onboard-list { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 8px; font-size: 0.9rem; }
.onboard-list li { display: flex; align-items: center; gap: 9px; }
.onboard-list .icon { color: var(--accent); flex-shrink: 0; }

/* ================= wardrobe ================= */

.toolbar { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.toolbar .search-bar { min-width: 200px; }

.item-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(186px, 1fr)); gap: 14px; }
.item-card { overflow: hidden; cursor: pointer; position: relative; }
.item-photo {
  aspect-ratio: 1;
  background:
    linear-gradient(45deg, color-mix(in srgb, var(--text-3) 7%, transparent) 25%, transparent 25%, transparent 75%, color-mix(in srgb, var(--text-3) 7%, transparent) 75%) 0 0 / 22px 22px,
    var(--surface-2);
  display: flex; align-items: center; justify-content: center;
  padding: 12px;
}
.item-photo img, .item-photo svg { max-width: 100%; max-height: 100%; object-fit: contain; margin: auto; }
.item-info { padding: 11px 13px 13px; display: flex; flex-direction: column; gap: 4px; }
.item-name { font-size: 0.92rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-menu-btn { position: absolute; top: 8px; right: 8px; background: color-mix(in srgb, var(--surface) 82%, transparent); backdrop-filter: blur(6px); opacity: 0; transition: opacity var(--dur-1); }
.item-card:hover .card-menu-btn, .item-row .card-menu-btn { opacity: 1; }
.item-card .fav-btn { width: 26px; height: 26px; }

.item-list { display: flex; flex-direction: column; gap: 8px; }
.item-row { display: flex; align-items: center; gap: 13px; padding: 9px 13px; cursor: pointer; position: relative; }
.item-row .card-menu-btn { position: static; }
.item-photo-sm { width: 52px; height: 52px; border-radius: var(--r-md); background: var(--surface-2); display: flex; align-items: center; justify-content: center; padding: 5px; flex-shrink: 0; }
.item-photo-sm img, .item-photo-sm svg { max-width: 100%; max-height: 100%; object-fit: contain; }

/* editor modal */
.editor-grid { display: grid; grid-template-columns: 240px 1fr; gap: 18px; }
.photo-drop {
  aspect-ratio: 1;
  border: 2px dashed var(--border);
  border-radius: var(--r-lg);
  background:
    linear-gradient(45deg, color-mix(in srgb, var(--text-3) 8%, transparent) 25%, transparent 25%, transparent 75%, color-mix(in srgb, var(--text-3) 8%, transparent) 75%) 0 0 / 20px 20px,
    var(--surface-2);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; overflow: hidden;
  transition: border-color var(--dur-1);
  padding: 10px;
}
.photo-drop:hover, .photo-drop.drag { border-color: var(--accent); }
.photo-drop.has-img { border-style: solid; }
.photo-drop img { max-width: 100%; max-height: 100%; object-fit: contain; }
.photo-drop.small { aspect-ratio: 4 / 3; }
.photo-hint { display: flex; flex-direction: column; align-items: center; gap: 7px; text-align: center; color: var(--text-3); padding: 10px; }
.bg-controls { display: flex; flex-direction: column; gap: 7px; }
.bg-controls > span:first-child { display: flex; align-items: center; gap: 6px; font-weight: 650; }
.bg-controls .icon { color: var(--accent); }

/* ================= outfit builder ================= */

.builder-layout { display: grid; grid-template-columns: 290px minmax(300px, 1fr) 260px; gap: 16px; align-items: start; }
.builder-picker { display: flex; flex-direction: column; gap: 9px; max-height: calc(100dvh - 200px); position: sticky; top: calc(var(--nav-h) + 14px); }
.picker-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; overflow-y: auto; padding: 2px; }
.picker-cell {
  display: flex; flex-direction: column; gap: 4px;
  padding: 7px; border-radius: var(--r-md);
  border: 1.5px solid var(--border);
  background: var(--surface);
  cursor: grab;
  transition: all var(--dur-1);
}
.picker-cell:hover { border-color: var(--accent); transform: translateY(-2px); box-shadow: var(--shadow-1); }
.picker-cell:active { cursor: grabbing; }
.picker-cell.dragging { opacity: 0.45; transform: scale(0.94); }
.picker-cell small { font-size: 0.68rem; font-weight: 600; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.picker-thumb { height: 62px; display: flex; align-items: center; justify-content: center; background: var(--surface-2); border-radius: var(--r-sm); padding: 4px; }
.picker-thumb img, .picker-thumb svg { max-height: 100%; max-width: 100%; object-fit: contain; }

.builder-stage-card { position: relative; padding: 8px; transition: box-shadow var(--dur-1), border-color var(--dur-1); }
.builder-stage-card .avatar-stage svg { max-height: 56dvh; }
.builder-stage-card.over { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 30%, transparent), var(--shadow-2); }
.builder-stage-card.over .drop-hint { opacity: 1; transform: translate(-50%, 0); }
.drop-hint {
  position: absolute; top: 14px; left: 50%; transform: translate(-50%, -5px);
  padding: 5px 13px; border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 16%, var(--surface));
  color: var(--accent); font-weight: 650;
  opacity: 0; transition: all var(--dur-2);
  pointer-events: none;
}
.builder-slots { display: flex; flex-wrap: wrap; gap: 7px; padding: 10px 8px 8px; border-top: 1px solid var(--border); }
.slot-chip {
  display: flex; align-items: center; gap: 7px;
  padding: 5px 8px 5px 11px; border-radius: 999px;
  background: var(--surface-2); border: 1px solid var(--border);
  font-size: 0.8rem; animation: popIn var(--dur-2) var(--ease) both;
}
.slot-name { text-transform: uppercase; letter-spacing: 0.04em; font-weight: 700; }
.slot-dot { width: 10px; height: 10px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(0,0,0,0.15); }
.slot-item { font-weight: 600; max-width: 130px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.builder-details { position: sticky; top: calc(var(--nav-h) + 14px); display: flex; flex-direction: column; gap: 12px; }

/* saved outfits */
.outfit-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(215px, 1fr)); gap: 14px; }
.outfit-card { display: flex; flex-direction: column; padding: 12px; gap: 11px; }
.outfit-card .outfit-mini { flex-shrink: 0; background: var(--surface-2); border-radius: var(--r-md); align-self: center; }
.outfit-card-info { display: flex; flex-direction: column; gap: 7px; min-width: 0; flex: 1; }
.outfit-card-info strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.outfit-actions { flex-wrap: wrap; }
.outfit-card.flash { animation: flashCard 1.6s var(--ease); }
@keyframes flashCard { 0%, 60% { box-shadow: 0 0 0 3px var(--accent), var(--shadow-2); } 100% { box-shadow: var(--shadow-1); } }

/* history */
.timeline { display: flex; flex-direction: column; gap: 10px; }
.timeline-month { color: var(--text-2); font-size: 0.86rem; text-transform: uppercase; letter-spacing: 0.05em; margin: 12px 0 2px; }
.wear-row { display: flex; align-items: center; gap: 14px; padding: 11px 15px; }
.wear-date { display: flex; flex-direction: column; align-items: center; min-width: 40px; }
.wear-date strong { font-size: 1.2rem; line-height: 1.1; }
.wear-generic { width: 44px; height: 44px; border-radius: var(--r-md); background: var(--surface-2); display: flex; align-items: center; justify-content: center; color: var(--text-3); }
.wear-row .outfit-mini { background: var(--surface-2); border-radius: var(--r-sm); flex-shrink: 0; }
.wear-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 5px; }
.wear-stars { display: inline-flex; gap: 1px; }
.wear-stars i { color: var(--text-3); opacity: 0.4; }
.wear-stars i.on { color: #eda100; opacity: 1; }
.wear-stars i.on svg { fill: #eda100; stroke: #eda100; }
.conf-bar { width: 74px; height: 5px; border-radius: 3px; background: var(--surface-2); overflow: hidden; }
.conf-bar i { display: block; height: 100%; border-radius: 3px; background: linear-gradient(90deg, var(--accent), var(--accent-2)); }
.wear-photo { width: 44px; height: 44px; object-fit: cover; border-radius: var(--r-sm); }

/* ================= planner ================= */

.week-strip { display: grid; grid-template-columns: repeat(7, 1fr); gap: 10px; }
.day-card { padding: 11px; display: flex; flex-direction: column; gap: 8px; min-height: 172px; position: relative; }
.day-card.today { border-color: var(--accent); box-shadow: 0 0 0 1.5px var(--accent), var(--shadow-1); }
.day-head { display: flex; flex-direction: column; }
.day-head strong { font-size: 0.9rem; }
.day-wx { display: flex; align-items: center; gap: 5px; }
.day-assign {
  flex: 1; border: 1.5px dashed var(--border); border-radius: var(--r-md);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  color: var(--text-3); font-weight: 600;
  transition: all var(--dur-1);
}
.day-assign:hover { border-color: var(--accent); color: var(--accent); background: color-mix(in srgb, var(--accent) 6%, transparent); }
.day-outfit { display: flex; flex-direction: column; align-items: center; gap: 3px; position: relative; }
.day-outfit .outfit-mini { background: var(--surface-2); border-radius: var(--r-sm); }
.day-outfit-name { font-size: 0.7rem; font-weight: 650; text-align: center; }
.day-clear { position: absolute; top: -4px; right: -4px; background: var(--surface); border: 1px solid var(--border); opacity: 0; transition: opacity var(--dur-1); }
.day-card:hover .day-clear { opacity: 1; }

.outfit-pick-list { display: flex; flex-direction: column; gap: 6px; max-height: 380px; overflow-y: auto; }
.outfit-pick-row { display: flex; align-items: center; gap: 11px; width: 100%; padding: 7px 9px; border-radius: var(--r-md); text-align: left; }
.outfit-pick-row:hover { background: var(--surface-2); }
.outfit-pick-row .outfit-mini { background: var(--surface-2); border-radius: var(--r-sm); flex-shrink: 0; }

.trips-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.trip-card { padding: 16px; display: flex; flex-direction: column; gap: 11px; }
.progress { height: 7px; border-radius: 4px; background: var(--surface-2); overflow: hidden; }
.progress i { display: block; height: 100%; border-radius: 4px; background: linear-gradient(90deg, var(--accent), var(--accent-2)); transition: width var(--dur-3) var(--ease); }
.pack-list { display: flex; flex-direction: column; gap: 2px; max-height: 300px; overflow-y: auto; }
.pack-group { text-transform: uppercase; letter-spacing: 0.05em; font-weight: 750; margin-top: 9px; }
.pack-row { display: flex; align-items: center; gap: 9px; padding: 5px 4px; border-radius: var(--r-sm); font-size: 0.88rem; cursor: pointer; }
.pack-row:hover { background: var(--surface-2); }
.pack-row input { accent-color: var(--accent); width: 15px; height: 15px; }
.pack-row.done span { text-decoration: line-through; color: var(--text-3); }

/* ================= wishlist ================= */

.wish-grid { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.wish-card.purchased { opacity: 0.62; }
.wish-actions { margin-top: 3px; }
.prio-high { background: color-mix(in srgb, var(--danger) 14%, transparent); color: var(--danger); }
.prio-medium { background: color-mix(in srgb, var(--warn) 16%, transparent); color: var(--warn); }
.prio-low { background: color-mix(in srgb, var(--text-3) 16%, transparent); color: var(--text-2); }

.tryon-layout { display: grid; grid-template-columns: 250px 1fr; gap: 16px; align-items: center; }
.tryon-stage svg { width: 100%; height: auto; max-height: 420px; }
.compare-row { display: flex; align-items: center; gap: 11px; }

/* ================= stats ================= */

.stat-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(158px, 1fr)); gap: 12px; }
.stat-tile { padding: 14px 16px; display: flex; flex-direction: column; gap: 5px; }
.stat-top { display: flex; justify-content: space-between; align-items: center; }
.stat-label { font-size: 0.76rem; font-weight: 650; color: var(--text-2); }
.stat-ic { color: var(--text-3); display: flex; }
.stat-value { font-size: 1.65rem; font-weight: 700; letter-spacing: -0.02em; line-height: 1.1; }
.stat-bottom { display: flex; justify-content: space-between; align-items: flex-end; gap: 6px; min-height: 18px; }
.stat-delta { font-size: 0.72rem; font-weight: 650; }
.stat-delta.good { color: var(--ok); }
.stat-delta.bad { color: var(--warn); }

.charts-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.chart-wide { grid-column: 1 / -1; }

.donut-layout { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.donut-wrap { width: 190px; flex-shrink: 0; }
.donut-seg { transition: opacity var(--dur-1); cursor: pointer; }
.donut-svg:hover .donut-seg:not(:hover) { opacity: 0.45; }
.donut-total { fill: var(--text); font-size: 26px; font-weight: 700; }
.donut-sub { fill: var(--text-3); font-size: 11px; }
.chart-legend { display: flex; flex-direction: column; gap: 6px; flex: 1; min-width: 150px; }
.legend-row { display: flex; align-items: center; gap: 8px; font-size: 0.84rem; }
.legend-swatch { width: 11px; height: 11px; border-radius: 4px; flex-shrink: 0; box-shadow: inset 0 0 0 1px rgba(0,0,0,0.12); }
.legend-label { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.legend-val { color: var(--text-3); font-size: 0.76rem; font-variant-numeric: tabular-nums; }

.bars-chart { display: flex; flex-direction: column; gap: 9px; }
.bar-row { display: grid; grid-template-columns: minmax(90px, 150px) 1fr 42px; align-items: center; gap: 10px; }
.bar-row:has(.bar-thumb) { grid-template-columns: 34px minmax(80px, 140px) 1fr 42px; }
.bar-thumb { width: 34px; height: 34px; border-radius: var(--r-sm); background: var(--surface-2); display: flex; align-items: center; justify-content: center; padding: 3px; }
.bar-thumb img, .bar-thumb svg { max-width: 100%; max-height: 100%; object-fit: contain; }
.bar-thumb-img { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; }
.bar-thumb-img img, .bar-thumb-img svg { max-width: 100%; max-height: 100%; }
.bar-label { font-size: 0.84rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text-2); }
.bar-track { height: 17px; border-radius: 0 4px 4px 0; background: transparent; position: relative; }
.bar-fill { display: block; height: 100%; border-radius: 0 4px 4px 0; background: var(--chart-1); animation: barGrow var(--dur-3) var(--ease) both; transform-origin: left; }
@keyframes barGrow { from { transform: scaleX(0); } to { transform: scaleX(1); } }
.bar-val { font-size: 0.8rem; font-weight: 650; color: var(--text-2); font-variant-numeric: tabular-nums; }

.column-chart svg { width: 100%; height: auto; }
.col-fill { animation: colGrow var(--dur-3) var(--ease) both; transform-origin: bottom; transform-box: fill-box; }
@keyframes colGrow { from { transform: scaleY(0); } to { transform: scaleY(1); } }

.sparkline { overflow: visible; }
.stat-spark { margin-left: auto; }

.list-row { display: flex; align-items: center; gap: 11px; padding: 7px 9px; border-radius: var(--r-md); transition: background var(--dur-1); }
.list-row:hover { background: var(--surface-2); }
.combo-wrap { display: flex; flex-wrap: wrap; gap: 8px; }
.combo-chip {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 13px; border-radius: 999px;
  background: var(--surface-2); border: 1px solid var(--border);
  font-size: 0.84rem; font-weight: 600;
}
.combo-dots { display: inline-flex; }
.combo-dots i { width: 14px; height: 14px; border-radius: 50%; box-shadow: 0 0 0 2px var(--surface); }
.combo-dots i + i { margin-left: -5px; }

/* ================= settings ================= */

.settings-main { max-width: 780px; }
.setting-row {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 13px 0;
  border-bottom: 1px solid var(--border);
}
.setting-row:last-child { border-bottom: 0; }
.setting-row.col { flex-direction: column; align-items: stretch; gap: 10px; }
.setting-label { display: flex; flex-direction: column; gap: 1px; }
.setting-ctl { display: flex; align-items: center; gap: 10px; min-width: 210px; justify-content: flex-end; }
.setting-row.col .setting-ctl { justify-content: flex-start; }
.slider-host { flex: 1; min-width: 150px; }
.slider-val { min-width: 66px; text-align: right; }
.theme-swatch-lg { width: 50px; height: 50px; border-radius: var(--r-md); box-shadow: inset 0 0 0 1px var(--border); flex-shrink: 0; }
#current-theme { gap: 13px; justify-content: flex-start; }
#current-theme .btn { margin-left: auto; }
.auto-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.storage-progress { margin-top: 8px; }
.danger-zone .setting-label strong { color: var(--danger); }
.roadmap { margin-top: 10px; display: flex; flex-direction: column; gap: 3px; }

/* ================= theme gallery ================= */

.themes-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 16px; }
.theme-card { overflow: hidden; display: flex; flex-direction: column; }
.theme-card.current { border-color: var(--accent); box-shadow: 0 0 0 1.5px var(--accent), var(--shadow-1); }
.theme-card-info { padding: 13px 15px 15px; display: flex; flex-direction: column; gap: 7px; }

/* live mini-mock — inherits the theme it previews via [data-theme] */
.mock {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  padding: 10px;
  display: flex; flex-direction: column; gap: 8px;
  border-bottom: 1px solid var(--border);
  min-height: 158px;
}
.mock-nav { display: flex; align-items: center; gap: 8px; background: color-mix(in srgb, var(--surface) 88%, transparent); border: 1px solid var(--border); border-radius: calc(9px * var(--radius-scale)); padding: 6px 9px; }
.mock-logo { width: 15px; height: 15px; border-radius: 5px; background: linear-gradient(135deg, var(--accent), var(--accent-2)); }
.mock-links { display: flex; gap: 4px; flex: 1; }
.mock-links i { width: 22px; height: 5px; border-radius: 3px; background: var(--text-3); opacity: 0.5; }
.mock-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--accent); }
.mock-body { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; flex: 1; }
.mock-card { background: var(--surface); border: 1px solid var(--border); border-radius: calc(10px * var(--radius-scale)); box-shadow: var(--shadow-1); padding: 8px; display: flex; flex-direction: column; gap: 5px; justify-content: center; }
.mock-avatar { width: 24px; height: 24px; border-radius: 50%; background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--accent); display: flex; align-items: center; justify-content: center; }
.mock-lines { display: flex; flex-direction: column; gap: 4px; }
.mock-lines i { height: 5px; border-radius: 3px; background: var(--text-3); opacity: 0.5; }
.mock-bar { height: 7px; border-radius: 4px; background: var(--chart-1); }
.mock-bar:nth-child(2) { background: var(--chart-2); }
.mock-bar:nth-child(3) { background: var(--chart-3); }
.mock-actions { grid-column: 1 / -1; display: flex; gap: 6px; }
.mock-btn { flex: 1; text-align: center; font-size: 0.62rem; font-weight: 700; padding: 5px 2px; border-radius: calc(8px * var(--radius-scale)); border: 1px solid var(--border); color: var(--text-2); background: var(--surface); font-family: var(--font-display); letter-spacing: var(--h-track); text-transform: var(--h-case); }
.mock-btn.primary { background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: var(--on-accent); border: 0; }

.theme-teaser { justify-content: center; }
.teaser-body { padding: 22px; display: flex; flex-direction: column; gap: 9px; }
.teaser-ic { color: var(--accent); }
.teaser-list { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.teaser-list a { color: var(--accent); font-weight: 600; }

/* ================= responsive features ================= */

@media (max-width: 1060px) {
  .builder-layout { grid-template-columns: 250px 1fr; }
  .builder-details { grid-column: 1 / -1; position: static; }
}
@media (max-width: 900px) {
  .home-grid, .studio-layout { grid-template-columns: 1fr; }
  .sticky-stage { position: static; }
  .avatar-stage svg { max-height: 52dvh; }
  .week-strip { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
  .charts-grid { grid-template-columns: 1fr; }
  .onboard { grid-template-columns: 1fr; }
  .onboard-avatar { max-width: 170px; margin: 0 auto; }
  .editor-grid, .tryon-layout { grid-template-columns: 1fr; }
  .builder-layout { grid-template-columns: 1fr; }
  .builder-picker { position: static; max-height: 320px; }
  .picker-grid { grid-template-columns: repeat(auto-fill, minmax(108px, 1fr)); }
}
@media (max-width: 560px) {
  .item-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
  .suggested-row { flex-direction: column; align-items: flex-start; }
  .stat-tiles { grid-template-columns: 1fr 1fr; }
  .setting-row { flex-wrap: wrap; }
  .setting-ctl { min-width: 0; }
}
