.profile-companion {
  display: grid;
  grid-template-columns: minmax(220px, .82fr) minmax(280px, 1.18fr);
  gap: clamp(20px, 4vw, 56px);
  align-items: center;
  padding: clamp(20px, 4vw, 42px);
  margin-bottom: 24px;
  border: 1px solid var(--ui-border);
  border-radius: var(--ui-radius-lg, 14px);
  background: var(--ui-soft);
}
.profile-companion-copy h2 { max-width: 16ch; font-size: 28px; line-height: 1.4; }
.profile-companion-copy > p:not(.eyebrow) { max-width: 42ch; margin: 10px 0 20px; color: var(--ui-muted); font-size: 14px; line-height: 1.8; }
.profile-pet-progress { display: grid; gap: 5px; padding: 12px 14px; margin: 0 0 20px; border-left: 2px solid var(--ui-border-strong); background: var(--ui-surface); background: color-mix(in srgb, var(--ui-surface) 72%, transparent); }
.profile-pet-progress b { font-size: 13px; }
.profile-pet-progress span { color: var(--ui-muted); font-size: 12px; line-height: 1.65; }
.profile-companion-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.profile-companion-actions > a { min-height: 44px; }
.profile-companion-stage {
  position: relative;
  display: grid;
  min-height: clamp(260px, 35vw, 390px);
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--ui-line);
  border-radius: 12px;
  background: var(--ui-surface);
}
.profile-companion-stage::after { position: absolute; right: 8%; bottom: 12%; left: 8%; height: 1px; background: var(--ui-line); content: ''; }
.profile-companion-figure { display: block; width: 100%; height: clamp(258px, 35vw, 388px); padding: 8px 48px 4px 8px; object-fit: contain; }
.profile-locked-pet {
  position: absolute;
  z-index: 1;
  right: clamp(12px, 3vw, 34px);
  bottom: clamp(24px, 4vw, 40px);
  display: grid;
  width: clamp(68px, 9vw, 92px);
  aspect-ratio: 1;
  place-items: center;
  border: 1px solid var(--ui-border);
  border-radius: 50%;
  background: var(--ui-soft);
  color: var(--ui-accent);
  opacity: .56;
}
.profile-locked-pet > .icon { width: 40%; height: 40%; }
.profile-locked-pet .pet-lock-mark { position: absolute; right: -2px; bottom: -1px; display: grid; width: 29px; height: 29px; place-items: center; border: 1px solid var(--ui-border); border-radius: 50%; background: var(--ui-surface); color: var(--ui-ink); }
.profile-locked-pet .pet-lock-mark .icon { width: 15px; height: 15px; }
.profile-scene-caption { position: absolute; z-index: 2; right: 10px; bottom: 8px; left: 10px; color: var(--ui-muted); font-size: 11px; text-align: center; }
.profile-shortcuts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-bottom: 24px; }
.profile-shortcut { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 14px; align-items: center; min-height: 92px; padding: 18px; border: 1px solid var(--ui-line); border-radius: 10px; background: var(--ui-surface); color: inherit; text-decoration: none; }
.profile-shortcut:hover { border-color: var(--ui-border-strong); background: var(--ui-soft); }
.profile-shortcut .choice-icon { margin: 0; }
.profile-shortcut h3 { font-size: 15px; }
.profile-shortcut p { margin-top: 4px; color: var(--ui-muted); font-size: 12px; line-height: 1.65; }
.profile-shortcut > .icon { width: 16px; color: var(--ui-accent); }
.profile-integrations-note { margin-bottom: 24px; }
.profile-wallet { display:flex; flex-wrap:wrap; align-items:center; gap:16px 24px; padding:18px 22px; margin-bottom:20px; border:1px solid var(--ui-warm-line); border-radius:var(--ui-card-radius); background:var(--ui-warm); }
.profile-wallet-balance { display:flex; align-items:center; gap:12px; }
.wallet-symbol { display:grid; place-items:center; width:40px; height:40px; border:1px solid var(--ui-warm-line); border-radius:50%; color:var(--ui-warm-ink); background:var(--ui-surface); }
.wallet-symbol .icon { width:22px; height:22px; }
.profile-wallet-balance > div { display:grid; gap:3px; font-size:12px; color:var(--ui-muted); }
.profile-wallet-balance strong { display:flex; gap:10px; align-items:center; color:var(--ui-ink); font-size:24px; }
.profile-wallet-balance small { color:var(--ui-warm-ink); font-size:11px; font-weight:normal; }
.profile-wallet-copy { flex:1; min-width:180px; font-size:13px; }
.profile-wallet-copy p { margin-top:4px; color:var(--ui-muted); font-size:12px; line-height:1.7; }
.profile-wallet > a { display:inline-flex; align-items:center; gap:8px; min-height:44px; font-size:13px; }
.wardrobe-header-note { margin: -10px 0 20px; color: var(--ui-muted); font-size: 13px; line-height: 1.8; }
.wardrobe-preview {
  display: grid;
  grid-template-columns: minmax(250px, .9fr) minmax(230px, 1.1fr);
  gap: clamp(20px, 4vw, 40px);
  align-items: center;
  padding: clamp(18px, 3vw, 30px);
  margin-bottom: 28px;
  border: 1px solid var(--ui-line);
  border-radius: 12px;
  background: var(--ui-surface);
}
.wardrobe-reference-frame { display: grid; min-height: 300px; max-height: 450px; place-items: center; overflow: hidden; border: 1px solid var(--ui-line); border-radius: 8px; background: var(--ui-wash); }
.wardrobe-reference-image { display: block; width: 100%; height: 100%; min-height: 300px; max-height: 450px; object-fit: contain; }
.wardrobe-reference-copy h2 { margin: 8px 0; font-size: 20px; line-height: 1.5; }
.wardrobe-reference-copy > p:not(.eyebrow) { max-width: 48ch; margin: 0; color: var(--ui-muted); font-size: 13px; line-height: 1.85; }
.wardrobe-reference-controls { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0; }
.wardrobe-reference-controls button, .wardrobe-tab {
  min-height: 44px;
  padding: 9px 13px;
  border: 1px solid var(--ui-line);
  border-radius: 8px;
  background: var(--ui-surface);
  color: var(--ui-muted);
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}
.wardrobe-reference-controls button[aria-pressed="true"], .wardrobe-tab[aria-pressed="true"] { border-color: var(--ui-border-strong); background: var(--ui-selected); color: var(--ui-accent); }
.wardrobe-reference-controls button:focus-visible, .wardrobe-tab:focus-visible, .profile-shortcut:focus-visible { outline: 2px solid var(--ui-accent); outline-offset: 3px; }
.wardrobe-reference-status { display: inline-flex; padding: 5px 8px; border: 1px solid var(--ui-border); border-radius: 999px; background: var(--ui-soft); color: var(--ui-accent); font-size: 11px; }
.wardrobe-boundary-note { padding: 12px 14px; border-left: 2px solid var(--ui-marker); background: var(--ui-wash); color: var(--ui-muted); font-size: 12px; line-height: 1.75; }
.wardrobe-section-heading { display: flex; flex-wrap: wrap; gap: 12px 20px; align-items: end; justify-content: space-between; margin: 26px 0 14px; }
.wardrobe-section-heading h2 { font-size: 19px; }
.wardrobe-section-heading p { margin-top: 5px; color: var(--ui-muted); font-size: 12px; line-height: 1.7; }
.wardrobe-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.wardrobe-items { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.wardrobe-item { display: flex; min-width: 0; flex-direction: column; gap: 11px; padding: 16px; border: 1px solid var(--ui-line); border-radius: 9px; background: var(--ui-surface); }
.wardrobe-item-top { display: flex; flex-wrap: wrap; gap: 7px; align-items: center; justify-content: space-between; }
.wardrobe-item-category, .wardrobe-item-state { display: inline-flex; width: fit-content; padding: 4px 7px; border: 1px solid var(--ui-border); border-radius: 999px; background: var(--ui-soft); color: var(--ui-accent); font-size: 10px; line-height: 1.4; }
.wardrobe-item h3 { font-size: 15px; line-height: 1.55; }
.wardrobe-item-note { flex: 1; color: var(--ui-muted); font-size: 12px; line-height: 1.75; }
.wardrobe-item-meta { display: flex; flex-wrap: wrap; gap: 6px 12px; color: var(--ui-muted); font-size: 11px; }
.wardrobe-item button { min-height: 44px; padding: 8px 11px; border: 1px solid var(--ui-line); border-radius: 7px; background: var(--ui-wash); color: var(--ui-muted); font: inherit; font-size: 12px; cursor: not-allowed; opacity: .78; }
.wardrobe-inventory-note { margin-bottom: 14px; }
.wardrobe-item[data-mode="inventory"] .wardrobe-item-state { border-color: var(--ui-line); background: var(--ui-wash); color: var(--ui-muted); }
.girl-fitting { display: grid; grid-template-columns: minmax(220px,.9fr) minmax(240px,1.1fr); gap: 32px; align-items: center; padding: 24px 0; border-top: 1px solid var(--ui-line); border-bottom: 1px solid var(--ui-line); }
.girl-fitting-stage { display: flex; align-items: center; justify-content: center; min-width: 0; background: var(--ui-soft); }
.girl-dress-figure { display: block; width: 100%; max-width: calc(570px * var(--girl-canvas-ratio, 2 / 3)); height: auto; aspect-ratio: var(--girl-canvas-ratio, 2 / 3); }
/* Keep ratio rules external to respect the page's self-only style policy. */
.girl-dress-figure[data-character-id="girl_crosspose_short"] { --girl-canvas-ratio: 3 / 4; }
.profile-companion-stage > .girl-dress-figure { width: calc(388px * var(--girl-canvas-ratio, 2 / 3)); max-width: calc(100% - 38px); margin-right: 38px; }
.girl-fitting-controls { min-width: 0; padding-right: 20px; }
.girl-fitting-controls h2 { margin: 9px 0; font-size: 23px; line-height: 1.5; }
.girl-fitting-controls > p { color: var(--ui-muted); font-size: 13px; line-height: 1.8; }
.girl-fitting-controls .girl-fitting-status { margin: 20px 0; color: var(--ui-accent); font-weight: 600; }
.girl-fitting-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 20px; }
.girl-fitting-actions button { min-height: 44px; }
.girl-fitting-controls .girl-fitting-note { margin-top: 10px; font-size: 12px; }
.girl-reference-details { margin-top: 28px; }
.girl-reference-details summary { width: fit-content; padding: 12px 0; color: var(--ui-accent); cursor: pointer; font-size: 13px; }
.wardrobe-item-image { display: grid; place-items: center; height: 128px; background: var(--ui-soft); }
.wardrobe-item-image img { display: block; width: 150px; height: 120px; object-fit: contain; }
.wardrobe-item .wardrobe-wear-button { display: inline-flex; gap: 8px; align-items: center; justify-content: center; background: var(--ui-selected); color: var(--ui-accent); border-color: var(--ui-border-strong); cursor: pointer; opacity: 1; }
.wardrobe-item .wardrobe-wear-button:hover { background: var(--ui-soft); }
.wardrobe-item .wardrobe-wear-button:focus-visible, .girl-fitting-actions button:focus-visible { outline: 2px solid var(--ui-accent); outline-offset: 3px; }
.wardrobe-wear-button .icon { width: 16px; height: 16px; }
.wardrobe-item.is-wearing { border-color: var(--ui-border-strong); }
.wardrobe-item .wardrobe-buy-button { font-size: 11px; min-height: 32px; }
@media (max-width: 850px) {
  .profile-companion { grid-template-columns: minmax(0, 1fr) minmax(240px, .9fr); }
  .wardrobe-preview { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .wardrobe-items { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .girl-fitting { grid-template-columns: minmax(0,1fr); gap: 18px; padding-top: 18px; }
  .girl-dress-figure { height: auto; width: 100%; max-width: calc(520px * var(--girl-canvas-ratio, 2 / 3)); }
  .girl-fitting-controls { padding: 0; }
  .girl-fitting-controls h2 { font-size: 21px; }
  .profile-companion-stage > .girl-dress-figure { width: calc(292px * var(--girl-canvas-ratio, 2 / 3)); max-width: calc(100% - 30px); margin-right: 30px; }
  .profile-companion, .wardrobe-preview { grid-template-columns: minmax(0, 1fr); }
  .profile-companion { gap: 18px; padding: 18px; }
  .profile-companion-copy h2 { font-size: 22px; }
  .profile-companion-copy { order: 0; }
  .profile-companion-stage { order: 1; min-height: 290px; }
  .profile-companion-figure { height: 292px; }
  .profile-shortcuts { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .wardrobe-preview { gap: 18px; padding: 14px; }
  .wardrobe-reference-frame, .wardrobe-reference-image { min-height: 255px; max-height: 360px; }
  .wardrobe-items { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .wardrobe-item { padding: 14px; }
  .wardrobe-section-heading { align-items: flex-start; }
}
@media (prefers-reduced-motion: reduce) {
  .profile-shortcut, .wardrobe-reference-controls button, .wardrobe-tab { scroll-behavior: auto; transition: none; }
}

/* Leave a separate caption area below the complete character. */
.profile-companion-stage { padding: 8px 0 34px; }
.profile-companion-stage::after { bottom: 28px; }

.girl-character-picker { display:grid;gap:8px;margin:18px 0;font-size:13px;max-width:330px; }
.girl-character-picker select { min-height:44px;max-width:100%;border:1px solid var(--ui-border-strong);border-radius:8px;background:var(--ui-surface);color:var(--ui-ink);padding:8px 12px;font:inherit; }
.girl-character-picker select:focus-visible { outline:2px solid var(--ui-accent);outline-offset:3px; }

/* Hallmark · pre-emit critique: P5 H5 E4 S5 R5 V4
 * Existing wardrobe route · pale cyan paper tokens · real fitting assets.
 * Character, item scroll area and save action share one viewport.
 */
body[data-view="wardrobe"] .main { padding-top: 16px; }
.wardrobe-studio {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  height: calc(100vh - 114px);
  height: calc(100dvh - 114px);
  min-height: 360px;
  border: 1px solid var(--ui-border);
  border-radius: 8px;
  background: var(--ui-surface);
  color: var(--ui-ink);
}
.wardrobe-studio :is(button, summary, select) { font: inherit; font-size: 13px; white-space: nowrap; }
.wardrobe-studio button { cursor: pointer; }
.wardrobe-studio button:disabled { cursor: default; opacity: .45; }
.wardrobe-studio :is(button, summary, select, [tabindex]):focus-visible { outline: 2px solid var(--ui-accent); outline-offset: -3px; }
.wardrobe-studio .icon { width: 16px; height: 16px; flex: none; }
.closet-toolbar { display: flex; min-width: 0; gap: 16px; align-items: center; justify-content: space-between; padding: 12px 20px; border-bottom: 1px solid var(--ui-border); }
.closet-toolbar .eyebrow { margin: 0 0 2px; font-size: 9px; }
.closet-toolbar h1 { min-width: 0; font-size: 24px; line-height: 1.3; font-style: normal; overflow-wrap: anywhere; }
.closet-character { min-width: 0; max-width: 55%; }
.closet-character select { width: 100%; min-height: 44px; padding: 8px 30px 8px 12px; border: 1px solid var(--ui-border-strong); border-radius: 6px; background: var(--ui-surface); color: var(--ui-ink); }
.closet-workspace { display: grid; grid-template-columns: minmax(0, .95fr) minmax(0, 1.05fr); min-width: 0; min-height: 0; }
.closet-preview { display: grid; grid-template-rows: 44px minmax(0, 1fr) 64px; min-width: 0; min-height: 0; border-right: 1px solid var(--ui-border); background: var(--ui-soft); }
.closet-view-controls { display: flex; min-width: 0; align-items: center; justify-content: space-between; gap: 8px; padding: 0 12px; color: var(--ui-muted); font-size: 12px; }
.closet-view-controls > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.closet-view-controls > div { display: flex; flex: none; }
.closet-view-controls button { display: inline-flex; gap: 5px; min-height: 44px; align-items: center; padding: 0 9px; border: 0; background: transparent; color: var(--ui-muted); }
.closet-view-controls button[aria-pressed="true"] { color: var(--ui-accent); font-weight: 600; }
.closet-view-controls button:not(:disabled):hover { background: var(--ui-selected); }
.closet-preview .girl-fitting-stage { min-height: 0; overflow: hidden; padding: 4px 12px; }
.closet-preview .girl-dress-figure { width: 100%; height: 100%; max-width: none; aspect-ratio: auto; }
.closet-preview .is-closeup { padding: 12px; }
.closet-equipped { display: flex; min-width: 0; gap: 12px; align-items: center; padding: 6px 12px; border-top: 1px solid var(--ui-border); }
.closet-equipped-label { flex: none; color: var(--ui-accent); font-size: 12px; }
.closet-equipped-list { display: flex; min-width: 0; gap: 8px; align-items: center; overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: thin; }
.closet-equipped-list button { position: relative; flex: none; width: 44px; height: 44px; padding: 0; border: 1px solid var(--ui-border-strong); border-radius: 6px; background: var(--ui-surface); }
.closet-equipped-list button:hover { background: var(--ui-selected); }
.closet-equipped-list img { display: block; width: 100%; height: 100%; object-fit: contain; }
.closet-equipped-list button > span { position: absolute; top: -1px; right: -1px; display: grid; width: 16px; height: 16px; place-items: center; border-radius: 0 5px 0 4px; background: var(--ui-accent); color: var(--ui-surface); font-size: 12px; line-height: 1; }
.closet-equipped-empty { color: var(--ui-muted); font-size: 11px; line-height: 1.5; }
.closet-browser { display: grid; grid-template-rows: auto auto minmax(0, 1fr) auto; min-width: 0; min-height: 0; }
.closet-categories { display: flex; min-width: 0; gap: 4px; padding: 8px 12px 0; overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: thin; border-bottom: 1px solid var(--ui-border); }
.closet-categories button { position: relative; flex: none; min-height: 44px; padding: 8px 12px; border: 0; background: transparent; color: var(--ui-muted); }
.closet-categories button[aria-pressed="true"] { color: var(--ui-accent); font-weight: 600; background: var(--ui-soft); }
.closet-categories button[aria-pressed="true"]::after { position: absolute; bottom: 0; right: 10px; left: 10px; height: 2px; background: var(--ui-accent); content: ''; }
.closet-categories button:hover { background: var(--ui-soft); }
.closet-filter { display: flex; min-width: 0; min-height: 44px; gap: 8px; align-items: center; justify-content: space-between; padding: 0 16px; color: var(--ui-muted); font-size: 12px; }
.closet-filter button { display: inline-flex; min-height: 44px; gap: 6px; align-items: center; padding: 0 4px; border: 0; background: transparent; color: var(--ui-muted); }
.closet-filter button .icon { border: 1px solid var(--ui-border-strong); border-radius: 3px; stroke: transparent; }
.closet-filter button[aria-pressed="true"] { color: var(--ui-accent); }
.closet-filter button[aria-pressed="true"] .icon { background: var(--ui-accent); stroke: var(--ui-surface); }
.closet-item-scroll { min-width: 0; min-height: 0; overflow-y: auto; overscroll-behavior-y: contain; scrollbar-gutter: stable; scrollbar-width: thin; padding: 4px 12px 16px; scroll-padding: 8px; }
.closet-pairs { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 12px; }
.closet-pairs button { display: inline-flex; min-height: 44px; gap: 6px; align-items: center; padding: 8px 10px; border: 1px solid var(--ui-border); border-radius: 6px; background: var(--ui-soft); color: var(--ui-accent); }
.closet-pairs button[aria-pressed="true"] { border-color: var(--ui-border-strong); background: var(--ui-selected); }
.closet-pairs > span { color: var(--ui-muted); font-size: 11px; }
.closet-items { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.wardrobe-studio .closet-item { display: flex; min-width: 0; flex-direction: column; align-items: stretch; padding: 0 0 10px; overflow: hidden; border: 1px solid var(--ui-line); border-radius: 6px; background: var(--ui-surface); color: var(--ui-ink); text-align: left; white-space: normal; }
.closet-item:hover { border-color: var(--ui-border-strong); }
.closet-item.is-wearing { border-color: var(--ui-accent); background: var(--ui-soft); }
.closet-item-picture { position: relative; display: grid; width: 100%; height: clamp(90px, 10vw, 130px); place-items: center; margin-bottom: 8px; background: var(--ui-soft); }
.closet-item-picture > img { display: block; width: 100%; height: 100%; min-height: 0; object-fit: contain; }
.closet-item-check { position: absolute; right: 6px; bottom: 6px; display: grid; width: 22px; height: 22px; place-items: center; border-radius: 50%; background: var(--ui-accent); color: var(--ui-surface); }
.closet-item-name { padding: 0 8px; font-size: 12px; line-height: 1.5; overflow-wrap: anywhere; }
.closet-item-hint { margin-top: auto; padding: 4px 8px 0; color: var(--ui-muted); font-size: 11px; line-height: 1.5; }
.closet-item.is-wearing .closet-item-hint { color: var(--ui-accent); }
.closet-empty { padding: 20px 8px; color: var(--ui-muted); font-size: 13px; line-height: 1.8; }
.closet-help { padding: 8px 16px; border-top: 1px solid var(--ui-line); color: var(--ui-muted); font-size: 11px; line-height: 1.6; }
.closet-savebar { position: relative; display: flex; gap: 16px; align-items: center; justify-content: space-between; padding: 12px 20px; border-top: 1px solid var(--ui-border); border-radius: 0 0 8px 8px; background: var(--ui-surface); }
.closet-savebar .girl-fitting-status { min-width: 0; color: var(--ui-accent); font-size: 13px; line-height: 1.6; }
.closet-savebar .girl-fitting-status > span { display: block; color: var(--ui-muted); font-size: 11px; }
.closet-save-actions { display: flex; flex: none; gap: 8px; align-items: center; }
.closet-save-actions > button, .closet-more summary { display: inline-flex; min-height: 44px; align-items: center; justify-content: center; gap: 6px; padding: 8px 12px; border: 1px solid var(--ui-border); border-radius: 6px; background: var(--ui-surface); color: var(--ui-accent); }
.closet-save-actions > .closet-save { padding: 8px 16px; border-color: var(--ui-border-strong); background: var(--ui-primary); font-weight: 600; }
.closet-save-actions > button:not(:disabled):hover, .closet-more summary:hover { background: var(--ui-selected); }
.closet-save-actions > button:not(:disabled):active, .wardrobe-studio button:not(:disabled):active { background: var(--ui-pressed); }
.closet-more { position: relative; }
.closet-more summary { list-style: none; cursor: pointer; }
.closet-more summary::-webkit-details-marker { display: none; }
.closet-more[open] summary { border-color: var(--ui-border-strong); background: var(--ui-selected); }
.closet-more > div { position: absolute; z-index: 5; right: 0; bottom: calc(100% + 8px); display: grid; width: max-content; min-width: 180px; max-width: calc(100vw - 40px); padding: 6px; border: 1px solid var(--ui-border-strong); border-radius: 8px; background: var(--ui-surface); box-shadow: var(--ui-overlay-shadow); }
.closet-more button { min-height: 44px; padding: 10px 12px; border: 0; border-radius: 4px; background: transparent; color: var(--ui-ink); text-align: left; }
.closet-more button:hover { background: var(--ui-soft); }
.closet-catalog-details { margin-top: 16px; border-top: 1px solid var(--ui-line); }
.closet-catalog-details > summary { width: fit-content; padding: 16px 0; color: var(--ui-accent); font-size: 13px; cursor: pointer; }
.closet-catalog-details > summary:focus-visible { outline: 2px solid var(--ui-accent); outline-offset: 3px; }
.closet-catalog-details .wardrobe-section-heading { margin-top: 12px; }
@media (max-width: 1120px) {
  .closet-items { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .closet-savebar { padding: 12px; }
}
@media (max-width: 1020px) {
  .wardrobe-studio { height: calc(100vh - 102px); height: calc(100dvh - 102px); }
}
@media (max-width: 640px) {
  body[data-view="wardrobe"] .main { padding: 8px 10px 12px; }
  .wardrobe-studio { height: calc(100vh - 80px); height: calc(100dvh - 80px); min-height: 480px; }
  .closet-toolbar { gap: 8px; padding: 6px 10px; }
  .closet-toolbar .eyebrow { display: none; }
  .closet-toolbar h1 { font-size: 21px; }
  .closet-character { max-width: 62%; }
  .closet-character select { padding-left: 8px; font-size: 12px; }
  .closet-workspace { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1.1fr) minmax(0, .9fr); }
  .closet-preview { position: relative; grid-template-rows: 44px minmax(0, 1fr); border-right: 0; border-bottom: 1px solid var(--ui-border); }
  .closet-view-controls { padding: 0 8px; font-size: 11px; }
  .closet-view-controls button { font-size: 12px; }
  .closet-preview .girl-fitting-stage { padding: 4px 56px 4px 8px; }
  .closet-preview .is-closeup { padding: 8px 60px 8px 8px; }
  .closet-equipped { position: absolute; z-index: 1; top: 50px; bottom: 8px; right: 8px; width: 44px; flex-direction: column; gap: 6px; padding: 0; border: 0; }
  .closet-equipped-label { font-size: 10px; white-space: nowrap; }
  .closet-equipped-list { flex-direction: column; gap: 6px; overflow-x: clip; overflow-y: auto; overscroll-behavior-y: contain; }
  .closet-equipped-empty { display: none; }
  .closet-categories { padding: 0 6px; }
  .closet-categories button { padding: 8px 12px; font-size: 12px; }
  .closet-filter { padding: 0 10px; font-size: 11px; }
  .closet-filter button { font-size: 12px; }
  .closet-item-scroll { padding: 0 8px 10px; }
  .closet-items { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .closet-item-picture { height: 84px; margin-bottom: 6px; }
  .closet-item-name { padding: 0 6px; font-size: 11px; }
  .closet-item-hint { padding-right: 6px; padding-left: 6px; font-size: 10px; }
  .closet-pairs { gap: 6px; margin-bottom: 8px; }
  .closet-pairs > span { display: none; }
  .closet-pairs.is-overview { display: none; }
  .closet-pairs button { font-size: 12px; }
  .closet-help { display: none; }
  .closet-browser { grid-template-rows: auto auto minmax(0, 1fr); }
  .closet-savebar { flex-wrap: wrap; gap: 6px; padding: 6px 10px max(6px, env(safe-area-inset-bottom)); }
  .closet-savebar .girl-fitting-status { flex: 1 0 100%; font-size: 11px; }
  .closet-savebar .girl-fitting-status > span { display: none; }
  .closet-save-actions { width: 100%; gap: 8px; }
  .closet-save-actions > .closet-save { flex: 1; }
  .closet-save-actions > button, .closet-more summary { font-size: 12px; }
  .closet-more > div { right: auto; left: 0; }
}
@media (max-height: 600px) and (min-width: 641px) {
  body[data-view="wardrobe"] .main { padding-top: 6px; }
  .wardrobe-studio { height: calc(100vh - 82px); height: calc(100dvh - 82px); min-height: 260px; }
  .closet-toolbar { padding: 0 12px; }
  .closet-toolbar .eyebrow { display: none; }
  .closet-toolbar h1 { font-size: 20px; }
  .closet-preview { position: relative; grid-template-rows: minmax(0, 1fr); }
  .closet-preview .closet-view-controls { position: absolute; z-index: 2; top: 0; right: 0; left: 0; }
  .closet-preview .closet-view-controls > span { visibility: hidden; }
  .closet-preview .girl-fitting-stage { padding: 8px 56px 8px 8px; }
  .closet-equipped { position: absolute; z-index: 1; top: 44px; bottom: 6px; right: 6px; width: 44px; flex-direction: column; gap: 4px; padding: 0; border: 0; }
  .closet-equipped-label { font-size: 10px; white-space: nowrap; }
  .closet-equipped-list { flex-direction: column; overflow-x: clip; overflow-y: auto; overscroll-behavior-y: contain; }
  .closet-equipped-empty { display: none; }
  .closet-savebar { padding: 4px 12px; }
  .closet-savebar .girl-fitting-status > span, .closet-help { display: none; }
  .closet-browser { grid-template-rows: auto auto minmax(0, 1fr); }
  .closet-categories { padding-top: 0; }
}

/* Wardrobe + shop · existing paper/cyan system; no transaction simulation.
 * Hallmark · pre-emit critique: P5 H5 E4 S5 R5 V4
 * Shared workbench, existing side navigation, compact utility actions.
 */
.wardrobe-studio {
  --closet-blue: #80a7c1;
  --closet-purple: #b59ac4;
  --closet-green: #9abca6;
  --closet-scrim: var(--ui-scrim);
}
.closet-title { display:flex; align-items:center; gap:8px; min-width:0; }
.closet-title > a { display:grid; place-items:center; width:32px; min-height:44px; color:var(--ui-accent); border-radius:var(--ui-radius); }
.closet-title > a:hover { background:var(--ui-soft); }
.closet-toolbar { gap:12px; }
.closet-character { margin-left:auto; max-width:46%; }
.closet-wallet { display:grid; gap:1px; padding:5px 12px; min-height:44px; flex:none; border:1px solid var(--ui-warm-line); border-radius:var(--ui-radius); background:var(--ui-warm); color:var(--ui-warm-ink); }
.closet-wallet > span { display:flex; gap:6px; justify-content:center; align-items:center; }
.closet-wallet b { font-size:17px; line-height:1.2; }
.closet-wallet small { font-size:10px; }
.closet-workspace { grid-template-columns:minmax(0,.8fr) minmax(0,1.2fr); }
.closet-browser { grid-template-rows:auto auto auto minmax(0,1fr) auto; }
.closet-modes { display:flex; align-items:stretch; gap:0; min-width:0; padding:0 16px; border-bottom:1px solid var(--ui-border); }
.closet-modes > button { display:inline-flex; align-items:center; gap:8px; min-height:52px; padding:8px 14px; border:0; border-bottom:2px solid transparent; background:transparent; color:var(--ui-muted); }
.closet-modes > button[aria-pressed="true"] { border-bottom-color:var(--ui-accent); color:var(--ui-accent); font-weight:600; }
.closet-modes > button:hover { background:var(--ui-soft); }
.closet-modes > span { align-self:center; margin-left:auto; padding-left:8px; color:var(--ui-muted); font-size:10px; white-space:nowrap; }
.closet-categories { padding-top:0; }
.closet-filter { min-height:36px; }
.closet-filter > button { min-height:36px; }
.closet-sync-label { color:var(--ui-warm-ink); font-size:11px; }
.closet-items { align-items:start; }
.closet-product { display:flex; flex-direction:column; min-width:0; border:1px solid var(--ui-line); border-radius:var(--ui-card-radius); background:var(--ui-surface); overflow:clip; }
.closet-product:hover { border-color:var(--ui-border-strong); }
.closet-product.is-wearing { border-color:var(--ui-accent); }
.wardrobe-studio .closet-product > .closet-item { width:100%; border:0; border-radius:0; overflow:clip; background:var(--ui-surface); }
.wardrobe-studio .closet-product > .closet-item:hover { background:var(--ui-soft); }
.wardrobe-studio .closet-product > .closet-item.is-wearing { background:var(--ui-selected); }
.closet-item-picture { height:clamp(100px,10vw,132px); background:var(--ui-soft); }
.closet-product .closet-item-name { white-space:nowrap; overflow:hidden; text-overflow:ellipsis; font-weight:600; }
.closet-product .closet-item-hint { font-size:10px; }
.closet-pair-picture { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); }
.closet-pair-picture > img { min-width:0; width:100%; height:100%; object-fit:contain; }
.closet-pair-badge { position:absolute; top:7px; left:7px; padding:2px 5px; border:1px solid var(--ui-border); border-radius:4px; background:var(--ui-surface); color:var(--ui-accent); font-size:9px; }
.closet-card-footer { display:flex; align-items:center; justify-content:space-between; gap:4px; padding:0 8px; border-top:1px solid var(--ui-line); min-height:36px; }
.closet-card-footer > span { color:var(--ui-muted); font-size:10px; }
.closet-card-footer > button { display:inline-flex; align-items:center; gap:2px; min-height:36px; padding:0 2px; border:0; background:transparent; color:var(--ui-accent); font-size:11px; }
.closet-card-footer .icon { width:12px; height:12px; }
.closet-colors { display:flex; align-items:center; flex-wrap:wrap; gap:3px; padding:0 6px 6px; }
.closet-colors button { display:inline-flex; align-items:center; justify-content:center; gap:4px; min-width:34px; min-height:36px; padding:4px; border:1px solid transparent; border-radius:4px; background:transparent; color:var(--ui-muted); font-size:10px; }
.closet-colors button[aria-pressed="true"] { border-color:var(--ui-border-strong); background:var(--ui-selected); color:var(--ui-accent); }
.closet-colors button:hover { background:var(--ui-soft); }
.closet-color-dot { display:inline-block; flex:none; width:10px; height:10px; border-radius:50%; border:1px solid var(--ui-border-strong); }
.closet-color-dot.is-blue { background:var(--closet-blue); }
.closet-color-dot.is-purple { background:var(--closet-purple); }
.closet-color-dot.is-green { background:var(--closet-green); }
.closet-inventory-note { padding:24px 20px; margin:4px 0 16px; border:1px dashed var(--ui-border-strong); border-radius:var(--ui-card-radius); background:var(--ui-soft); text-align:center; }
.closet-inventory-note .choice-icon { display:inline-grid; margin:0 0 10px; }
.closet-inventory-note h2 { font-size:17px; line-height:1.5; }
.closet-inventory-note p { max-width:32ch; margin:8px auto 12px; color:var(--ui-muted); font-size:12px; line-height:1.8; }
.closet-inventory-note button { display:inline-flex; align-items:center; justify-content:center; gap:8px; min-height:44px; padding:8px 14px; border:1px solid var(--ui-border-strong); border-radius:var(--ui-radius); background:var(--ui-surface); color:var(--ui-accent); }
.closet-dialog { position:fixed; inset:0; margin:auto; width:min(440px,calc(100vw - 32px)); max-height:calc(100dvh - 40px); padding:0; overflow:clip; border:1px solid var(--ui-border-strong); border-radius:12px; background:var(--ui-surface); color:var(--ui-ink); box-shadow:var(--ui-overlay-shadow); }
.closet-dialog[open] { display:flex; flex-direction:column; }
.closet-dialog::backdrop { background:var(--closet-scrim); }
.closet-dialog-header { display:flex; flex:none; align-items:center; justify-content:space-between; padding:4px 12px 4px 22px; border-bottom:1px solid var(--ui-line); }
.closet-dialog-header .eyebrow { margin:0; font-size:10px; }
.closet-dialog-header > button { display:grid; place-items:center; width:44px; height:44px; padding:0; border:0; border-radius:var(--ui-radius); background:transparent; color:var(--ui-accent); }
.closet-dialog-header > button:hover { background:var(--ui-soft); }
.closet-dialog-body { min-height:0; padding:18px 22px; overflow-y:auto; overscroll-behavior:contain; }
.closet-detail-picture { display:grid; place-items:center; height:170px; border:1px solid var(--ui-border); border-radius:var(--ui-card-radius); background:var(--ui-soft); margin-bottom:18px; }
.closet-detail-picture > img { max-width:100%; height:100%; min-height:0; object-fit:contain; }
.closet-detail-picture.closet-pair-picture { grid-template-columns:repeat(2,minmax(0,1fr)); }
.closet-detail-heading { display:flex; align-items:center; justify-content:space-between; gap:12px; }
.closet-detail-heading h2, .closet-dialog-body > h2 { font-size:22px; line-height:1.5; }
.closet-detail-category { display:block; margin-bottom:3px; color:var(--ui-muted); font-size:11px; }
.closet-detail-price { flex:none; color:var(--ui-warm-ink); font-size:12px; }
.closet-dialog .closet-colors { padding:12px 0 0; gap:8px; }
.closet-dialog .closet-colors button { padding:6px 12px; min-height:44px; font-size:12px; }
.closet-side-controls { display:flex; gap:8px; margin-top:12px; }
.closet-side-controls > button { display:inline-flex; align-items:center; gap:6px; min-height:44px; padding:8px 12px; border:1px solid var(--ui-border); border-radius:var(--ui-radius); background:var(--ui-surface); color:var(--ui-accent); font-size:12px; }
.closet-side-controls > button[aria-pressed="true"] { background:var(--ui-selected); border-color:var(--ui-border-strong); }
.closet-dialog-body > p { margin-top:12px; font-size:12px; line-height:1.85; color:var(--ui-muted); }
.closet-detail-facts { display:grid; gap:10px; padding:16px 0; font-size:12px; }
.closet-detail-facts > div { display:grid; grid-template-columns:86px minmax(0,1fr); gap:8px; }
.closet-detail-facts dt { color:var(--ui-muted); }
.closet-detail-facts dd { margin:0; }
.closet-dialog-note { padding:12px 14px; border-left:2px solid var(--ui-border-strong); background:var(--ui-soft); font-size:12px; }
.closet-dialog-note p { margin-top:4px; color:var(--ui-muted); line-height:1.8; }
.closet-dialog-actions { display:flex; flex:none; gap:10px; padding:14px 22px; border-top:1px solid var(--ui-border); }
.closet-dialog-actions > :is(button,a) { display:inline-flex; flex:1; align-items:center; justify-content:center; gap:6px; min-height:44px; padding:8px 12px; border:1px solid var(--ui-border-strong); border-radius:var(--ui-radius); background:var(--ui-primary); color:var(--ui-accent); font-size:13px; text-decoration:none; }
.closet-dialog-actions > button:disabled { border-color:var(--ui-line); background:var(--ui-warm); color:var(--ui-muted); opacity:.75; }
.closet-wallet-hero { display:grid; justify-items:center; gap:8px; margin:6px 0 22px; color:var(--ui-warm-ink); font-size:12px; }
.closet-wallet-hero strong { color:var(--ui-ink); font-size:40px; line-height:1; }
.closet-dialog.is-wallet .closet-dialog-note { margin-top:18px; }
@media (max-width:1120px) { .closet-modes > span { display:none; } }
@media (max-width:640px) {
  .profile-wallet { padding:16px; gap:12px; }
  .profile-wallet-copy { display:none; }
  .profile-wallet > a { margin-left:auto; font-size:12px; }
  .closet-toolbar { padding:4px 8px; gap:6px; }
  .closet-title { gap:0; }
  .closet-title > a { width:24px; }
  .closet-toolbar h1 { font-size:20px; }
  .closet-character { max-width:none; flex:1; }
  .closet-character select { min-width:0; padding:8px 18px 8px 6px; font-size:11px; }
  .closet-wallet { padding:4px 6px; }
  .closet-wallet small { font-size:9px; }
  .closet-workspace { grid-template-columns:minmax(0,1fr); grid-template-rows:minmax(0,.85fr) minmax(0,1.15fr); }
  .closet-browser { grid-template-rows:auto auto auto minmax(0,1fr); }
  .closet-modes { padding:0 8px; }
  .closet-modes > button { flex:1; justify-content:center; min-height:44px; padding:4px 8px; gap:6px; }
  .closet-categories button { min-height:40px; padding:6px 12px; }
  .closet-filter, .closet-filter > button { min-height:30px; }
  .closet-items { grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; }
  .closet-item-picture { height:88px; }
  .closet-product .closet-item-name { font-size:12px; padding:0 8px; }
  .closet-product .closet-item-hint { padding-left:8px; }
  .closet-card-footer { min-height:40px; }
  .closet-card-footer > button { min-height:40px; }
  .closet-colors button { min-height:40px; }
  .closet-inventory-note { padding:18px 14px; }
  .closet-inventory-note .choice-icon { display:none; }
  .closet-inventory-note h2 { font-size:15px; }
  .closet-savebar .girl-fitting-status { line-height:1.4; }
  .closet-dialog { inset:auto 0 0; width:100%; max-width:none; max-height:90dvh; margin:0; border-radius:14px 14px 0 0; }
  .closet-dialog-body { padding:14px 18px; }
  .closet-dialog-header { padding-left:18px; }
  .closet-dialog-actions { padding:12px 18px max(12px,env(safe-area-inset-bottom)); }
  .closet-detail-picture { height:140px; margin-bottom:14px; }
  .closet-detail-heading h2 { font-size:20px; }
}
@media (max-height:700px) and (max-width:640px) {
  .closet-workspace { grid-template-rows:minmax(0,.9fr) minmax(0,1.1fr); }
  .closet-view-controls, .closet-view-controls button { min-height:36px; height:36px; }
  .closet-preview { grid-template-rows:36px minmax(0,1fr); }
  .closet-item-picture { height:76px; }
}
@media (max-height:600px) and (min-width:641px) {
  .closet-toolbar { padding:0 8px; }
  .closet-wallet { padding:2px 8px; }
  .closet-wallet small { display:none; }
  .closet-browser { grid-template-rows:auto auto auto minmax(0,1fr); }
  .closet-modes > button { min-height:36px; }
  .closet-categories button { min-height:36px; padding:4px 10px; }
  .closet-filter, .closet-filter > button { min-height:28px; }
  .closet-item-picture { height:74px; }
}
@media (min-width:641px) and (max-width:850px) and (orientation:portrait) {
  .closet-workspace { grid-template-columns:minmax(0,1fr); grid-template-rows:minmax(0,.85fr) minmax(0,1.15fr); }
  .closet-preview { grid-template-rows:40px minmax(0,1fr) 56px; border-right:0; border-bottom:1px solid var(--ui-border); }
  .closet-items { grid-template-columns:repeat(3,minmax(0,1fr)); }
  .closet-item-picture { height:100px; }
}
@media (max-width:640px) and (max-height:480px) and (orientation:landscape) {
  .wardrobe-studio { height:calc(100dvh - 80px); min-height:240px; }
  .closet-toolbar { padding:0 6px; }
  .closet-toolbar h1 { font-size:18px; }
  .closet-title > a, .closet-character select, .closet-wallet { min-height:36px; }
  .closet-wallet small { display:none; }
  .closet-workspace { grid-template-columns:minmax(0,.8fr) minmax(0,1.2fr); grid-template-rows:minmax(0,1fr); }
  .closet-browser { grid-template-rows:auto auto minmax(0,1fr); }
  .closet-preview { grid-template-rows:36px minmax(0,1fr); border-right:1px solid var(--ui-border); border-bottom:0; }
  .closet-preview .girl-fitting-stage { padding:4px 46px 4px 4px; }
  .closet-equipped { top:40px; right:4px; width:36px; }
  .closet-equipped-list button { width:36px; height:36px; }
  .closet-modes > button, .closet-categories button { min-height:32px; padding:2px 8px; font-size:11px; }
  .closet-filter { display:none; }
  .closet-savebar { flex-wrap:nowrap; }
  .closet-save-actions > button, .closet-more summary { min-height:36px; padding-top:4px; padding-bottom:4px; }
  .closet-savebar .girl-fitting-status { flex:1; font-size:10px; }
  .closet-save-actions { width:auto; }
  .closet-item-picture { height:72px; }
}

/* Hallmark · system: DESIGN.md · companion-first workbench · original routes retained.
 * Original character pixels and coordinates stay intact; companions share that scene.
 */
.closet-workspace { grid-template-columns:minmax(0,1.3fr) minmax(0,1fr); }
.closet-preview { position:relative; grid-template-rows:40px minmax(0,1fr) 50px 124px; background:var(--ui-paper); }
.closet-preview .girl-fitting-stage { position:relative; padding:0 12px 8px; }
.closet-view-controls { padding:0 16px; }
.closet-view-controls > span { color:var(--ui-ink); font-weight:600; }
.closet-equipped { padding:3px 16px; gap:10px; }
.closet-equipped-list button { width:38px; height:38px; }
.closet-equipped-empty { font-size:12px; }
.companion-picker { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); grid-template-rows:22px minmax(0,1fr); gap:4px 10px; min-width:0; padding:8px 16px 10px; border-top:1px solid var(--ui-border); background:var(--ui-surface); }
.companion-picker-heading { grid-column:1/-1; display:flex; align-items:center; justify-content:space-between; min-width:0; color:var(--ui-ink); font-size:13px; }
.companion-picker-heading > span { color:var(--ui-muted); font-size:11px; }
.companion-choice { position:relative; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:1px; min-width:0; min-height:0; padding:3px; border:1px solid var(--ui-border); border-radius:10px; background:var(--ui-paper); color:var(--ui-ink); cursor:pointer; }
.companion-choice > img { display:block; flex:1 1 auto; min-height:0; width:74px; max-width:100%; height:58px; object-fit:contain; }
.wardrobe-studio .companion-choice > span:not(.companion-choice-check) { font-size:12px; line-height:1.4; white-space:nowrap; }
.companion-choice[aria-pressed="true"] { border-color:var(--ui-accent); background:var(--ui-selected); color:var(--ui-accent); }
.companion-choice:hover { border-color:var(--ui-border-strong); background:var(--ui-soft); }
.companion-choice:active { background:var(--ui-pressed); }
.companion-choice:focus-visible { outline:2px solid var(--ui-accent); outline-offset:-3px; }
.companion-choice-check { position:absolute; right:5px; top:5px; display:none; color:var(--ui-accent); }
.companion-choice[aria-pressed="true"] .companion-choice-check { display:block; }
.companion-choice .companion-choice-check > .icon { width:14px; height:14px; }
.companion-none-picture { display:grid; place-items:center; width:52px; height:52px; color:var(--ui-marker); }
.companion-none-picture > .icon { width:28px; height:28px; }
.companion-pet-layer { pointer-events:none; }
.companion-closeup-note { position:absolute; right:8px; bottom:8px; left:8px; text-align:center; color:var(--ui-muted); font-size:11px; line-height:1.5; }
.closet-preview-disclaimer { max-width:250px; margin:8px 8px 4px; padding-top:10px; border-top:1px solid var(--ui-line); white-space:normal; color:var(--ui-muted); font-size:12px; line-height:1.7; }
.closet-more { position:static; }
.closet-more:not([open]) > div { display:none; }
.closet-more > div { right:8px; left:auto; width:min(280px,calc(100vw - 40px)); min-width:0; max-height:min(360px,calc(100dvh - 120px)); overflow-y:auto; overscroll-behavior-y:contain; }
.closet-items { grid-template-columns:repeat(2,minmax(0,1fr)); }
.closet-item-picture { height:100px; }
.profile-companion { grid-template-columns:minmax(0,1.15fr) minmax(0,.85fr); gap:28px; padding:24px; }
.profile-companion-copy { grid-column:2; grid-row:1; }
.profile-companion-stage { grid-column:1; grid-row:1; padding:0 0 58px; background:var(--ui-paper); border:0; border-radius:10px; }
.profile-companion-stage::after { content:none; }
.profile-companion-stage > .girl-dress-figure { display:block; width:100%; max-width:100%; height:clamp(360px,40vw,510px); margin:0; aspect-ratio:auto; }
.profile-scene-caption { bottom:10px; color:var(--ui-ink); font-size:14px; font-weight:600; }
.profile-scene-caption > span { display:block; margin-top:4px; color:var(--ui-muted); font-size:11px; font-weight:400; }
@media (max-width:1120px) and (min-width:851px) {
  .closet-workspace { grid-template-columns:minmax(0,1.2fr) minmax(0,1fr); }
  .closet-preview { grid-template-rows:36px minmax(0,1fr) 48px 116px; }
  .companion-picker { gap:4px 6px; padding:6px 10px; }
  .companion-choice > img { height:54px; }
  .closet-item-picture { height:88px; }
}
@media (max-width:850px) and (orientation:portrait) {
  .closet-workspace { grid-template-columns:minmax(0,1fr); grid-template-rows:minmax(0,1.3fr) minmax(0,.7fr); }
  .closet-preview { grid-template-columns:minmax(0,1fr) 92px; grid-template-rows:minmax(0,1fr); border-right:0; border-bottom:1px solid var(--ui-border); }
  .closet-preview .closet-view-controls { position:absolute; z-index:2; top:0; left:0; right:92px; height:36px; padding:0 10px; }
  .closet-view-controls button { min-height:36px; padding:0 8px; }
  .closet-preview .girl-fitting-stage { grid-column:1; grid-row:1; padding:36px 4px 8px; }
  .closet-preview .is-closeup { padding:40px 8px 30px; }
  .companion-picker { grid-column:2; grid-row:1; grid-template-columns:minmax(0,1fr); grid-template-rows:28px 48px repeat(3,minmax(0,1fr)); gap:6px; padding:8px 6px; border-top:0; border-left:1px solid var(--ui-border); }
  .companion-picker-heading { display:block; text-align:center; font-size:12px; line-height:1.4; }
  .companion-picker-heading > span { display:none; }
  .companion-choice { padding:2px; }
  .companion-choice > img { width:78px; height:70px; }
  .companion-none { flex-direction:row; gap:4px; }
  .companion-none-picture { width:20px; height:24px; }
  .companion-none-picture > .icon { width:18px; height:18px; }
  .wardrobe-studio .companion-none > span { font-size:10px; }
  .closet-equipped { position:absolute; z-index:1; top:40px; right:100px; bottom:10px; width:34px; display:flex; flex-direction:column; gap:4px; padding:0; border:0; }
  .closet-equipped-label { font-size:9px; white-space:nowrap; }
  .closet-equipped-list { flex-direction:column; overflow-x:clip; overflow-y:auto; gap:4px; }
  .closet-equipped-list button { width:32px; height:32px; }
  .closet-equipped-empty { display:none; }
  .closet-items { grid-template-columns:repeat(4,minmax(0,1fr)); }
  .closet-item-picture { height:76px; }
  .closet-modes > button { min-height:40px; padding:5px 12px; }
  .closet-categories button { min-height:36px; padding:4px 12px; }
  .closet-filter,.closet-filter > button { min-height:28px; }
  .closet-help { display:none; }
  .closet-browser { grid-template-rows:auto auto auto minmax(0,1fr); }
}
@media (max-width:640px) and (orientation:portrait) {
  .closet-workspace { grid-template-rows:minmax(0,1.32fr) minmax(0,.68fr); }
  .closet-preview { grid-template-columns:minmax(0,1fr) 82px; }
  .closet-preview .closet-view-controls { right:82px; font-size:11px; }
  .closet-view-controls button { padding:0 6px; font-size:11px; }
  .closet-view-controls .icon { width:13px; height:13px; }
  .companion-picker { padding:6px 4px; gap:5px; grid-template-rows:28px 42px repeat(3,minmax(0,1fr)); }
  .companion-choice > img { width:70px; height:64px; }
  .closet-equipped { top:40px; right:88px; width:28px; }
  .closet-equipped-list button { width:28px; height:28px; }
  .closet-equipped-list button > span { width:13px; height:13px; font-size:10px; }
  .closet-items { grid-template-columns:repeat(3,minmax(0,1fr)); gap:6px; }
  .closet-item-picture { height:56px; margin-bottom:4px; }
  .closet-product .closet-item-name { font-size:10px; padding:0 4px; }
  .closet-product .closet-item-hint { display:none; }
  .closet-card-footer { min-height:30px; padding:0 4px; }
  .closet-card-footer > span { font-size:9px; }
  .closet-card-footer > button { min-height:30px; font-size:10px; }
  .closet-savebar { flex-wrap:nowrap; gap:6px; padding:8px 8px max(8px,env(safe-area-inset-bottom)); }
  .closet-savebar .girl-fitting-status { flex:1; font-size:10px; line-height:1.5; }
  .closet-savebar .girl-fitting-status > span { display:none; }
  .closet-save-actions { width:auto; gap:5px; }
  .closet-save-actions > button,.closet-more summary { min-height:40px; padding:6px 9px; font-size:12px; }
  .closet-save-actions > .closet-save { padding:6px 12px; }
  .profile-companion { grid-template-columns:minmax(0,1fr); gap:16px; padding:16px; }
  .profile-companion-copy { grid-column:1; grid-row:2; }
  .profile-companion-stage { grid-column:1; grid-row:1; }
  .profile-companion-stage > .girl-dress-figure { height:370px; }
  .profile-companion-copy h2 { font-size:23px; }
  .profile-companion-copy > p:not(.eyebrow) { margin:8px 0 16px; }
}
@media (max-width:640px) and (max-height:700px) and (orientation:portrait) {
  .closet-workspace { grid-template-rows:minmax(0,1.13fr) minmax(0,.87fr); }
  .closet-toolbar { padding-top:3px; padding-bottom:3px; }
  .closet-preview { grid-template-columns:minmax(0,1fr) 72px; }
  .closet-preview .closet-view-controls { right:72px; }
  .closet-preview .closet-view-controls > span { display:none; }
  .companion-picker { grid-template-rows:24px 36px repeat(3,minmax(0,1fr)); gap:3px; padding:4px; }
  .companion-picker-heading { font-size:10px; }
  .companion-choice > img { width:58px; height:46px; }
  .wardrobe-studio .companion-choice > span:not(.companion-choice-check) { font-size:11px; }
  .wardrobe-studio .companion-none > span { font-size:9px; }
  .companion-none-picture { display:none; }
  .closet-equipped { right:78px; }
  .closet-savebar { padding-top:6px; padding-bottom:max(6px,env(safe-area-inset-bottom)); }
  .closet-modes > button { min-height:36px; }
  .closet-categories button { min-height:32px; padding-top:2px; padding-bottom:2px; }
}
@media (max-height:600px) and (orientation:landscape) {
  .closet-workspace { grid-template-columns:minmax(0,1.15fr) minmax(0,1fr); grid-template-rows:minmax(0,1fr); }
  .closet-preview { grid-template-columns:minmax(0,1fr) 60px; grid-template-rows:minmax(0,1fr); border-right:1px solid var(--ui-border); border-bottom:0; }
  .closet-preview .closet-view-controls { position:absolute; z-index:2; top:0; right:60px; left:0; height:30px; padding:0 4px; }
  .closet-preview .closet-view-controls > span { display:none; }
  .closet-view-controls button { min-height:30px; padding:0 6px; font-size:11px; }
  .closet-preview .girl-fitting-stage { grid-column:1; grid-row:1; padding:30px 4px 2px; }
  .companion-picker { grid-column:2; grid-row:1; grid-template-columns:minmax(0,1fr); grid-template-rows:repeat(4,minmax(0,1fr)); padding:2px; gap:2px; border-top:0; border-left:1px solid var(--ui-border); }
  .companion-picker-heading { display:none; }
  .companion-choice { padding:1px; gap:0; }
  .companion-choice > img { width:42px; height:29px; }
  .companion-none-picture { width:22px; height:16px; }
  .companion-none-picture > .icon { width:14px; height:14px; }
  .wardrobe-studio .companion-choice > span:not(.companion-choice-check) { font-size:10px; line-height:1.2; }
  .wardrobe-studio .companion-none > span { font-size:8px; }
  .closet-equipped { position:absolute; top:34px; right:66px; bottom:4px; width:26px; padding:0; border:0; flex-direction:column; }
  .closet-equipped-label { font-size:8px; }
  .closet-equipped-list { flex-direction:column; overflow-x:clip; overflow-y:auto; }
  .closet-equipped-list button { width:26px; height:26px; }
  .closet-equipped-empty { display:none; }
  .closet-item-picture { height:56px; }
}

/* Hallmark · pre-emit critique: P5 H5 E4 S5 R5 V4
 * Separate character workbench and pet gallery; existing DESIGN.md tokens.
 * Each page saves only its own preview. Original assets stay intact.
 */
.studio-areas { display:flex; gap:8px; min-width:0; padding:0 16px; border-bottom:1px solid var(--ui-border); background:var(--ui-surface); }
.studio-areas > a { display:inline-flex; align-items:center; justify-content:center; gap:8px; min-height:44px; padding:8px 16px; border-bottom:2px solid transparent; color:var(--ui-muted); font-size:13px; white-space:nowrap; }
.studio-areas > a[aria-current="page"] { color:var(--ui-accent); border-bottom-color:var(--ui-accent); font-weight:600; }
.studio-areas > a:hover { background:var(--ui-soft); }
.studio-areas .icon { width:17px; height:17px; flex:none; }
.wardrobe-studio { grid-template-rows:auto auto minmax(0,1fr) auto; }
.wardrobe-studio .closet-preview { grid-template-columns:minmax(0,1fr); grid-template-rows:40px minmax(0,1fr) 50px; }
.wardrobe-studio .closet-view-controls { position:static; height:40px; visibility:visible; }
.wardrobe-studio .closet-view-controls > span { visibility:visible; }
.wardrobe-studio .girl-fitting-stage { grid-column:1; grid-row:2; padding:0 12px 8px; }
.wardrobe-studio .closet-equipped { position:static; width:auto; flex-direction:row; padding:3px 16px; border-top:1px solid var(--ui-border); }
.wardrobe-studio .closet-equipped-list { flex-direction:row; overflow-x:auto; overflow-y:clip; }
.wardrobe-studio .closet-equipped-list button { width:38px; height:38px; }
body[data-view="pets"] .main { padding-top:16px; }
.pet-studio { display:grid; grid-template-rows:auto auto minmax(0,1fr) auto; height:calc(100dvh - 114px); min-height:440px; border:1px solid var(--ui-border); border-radius:8px; background:var(--ui-surface); color:var(--ui-ink); }
.pet-studio :is(button,a) { font-family:var(--ui-font-body); }
.pet-studio button { cursor:pointer; }
.pet-studio button:disabled { cursor:default; opacity:.45; }
.pet-studio :is(button,a):focus-visible { outline:2px solid var(--ui-accent); outline-offset:-3px; }
.pet-studio .icon { width:18px; height:18px; flex:none; }
.pet-toolbar { display:flex; justify-content:space-between; align-items:center; gap:12px; padding:12px 20px; border-bottom:1px solid var(--ui-border); }
.pet-toolbar .eyebrow { margin:0 0 2px; font-size:9px; }
.pet-toolbar h1 { font-size:24px; line-height:1.3; }
.pet-preview-label { color:var(--ui-muted); font-size:12px; white-space:nowrap; }
.pet-workspace { display:grid; grid-template-columns:minmax(0,1.5fr) minmax(280px,1fr); min-width:0; min-height:0; }
.pet-showcase { display:grid; grid-template-rows:minmax(0,1fr) auto; min-width:0; min-height:0; padding:20px; background:var(--ui-soft); border-right:1px solid var(--ui-border); }
.pet-stage { display:grid; place-items:center; min-width:0; min-height:0; }
.pet-portrait { display:block; width:100%; height:100%; min-width:0; min-height:0; object-fit:contain; }
.pet-stage > .pet-portrait { max-width:520px; max-height:100%; }
.pet-stage-caption { padding:0 8px 8px; text-align:center; }
.pet-stage-caption h2 { font-size:24px; line-height:1.4; }
.pet-stage-caption p { margin-top:6px; color:var(--ui-muted); font-size:13px; line-height:1.7; }
.pet-empty { text-align:center; color:var(--ui-muted); }
.pet-empty > .icon { width:52px; height:52px; margin:0 auto 18px; color:var(--ui-marker); }
.pet-empty h2 { color:var(--ui-ink); font-size:22px; }
.pet-empty p { margin-top:10px; font-size:13px; }
.pet-selector { min-width:0; min-height:0; padding:28px 24px 20px; overflow-y:auto; overscroll-behavior-y:contain; scrollbar-width:thin; }
.pet-selector-heading h2 { font-size:24px; line-height:1.4; }
.pet-selector-heading > p:not(.eyebrow) { margin:8px 0 20px; color:var(--ui-muted); font-size:13px; line-height:1.7; }
.pet-options { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:10px; }
.pet-option { position:relative; display:grid; grid-template-rows:minmax(0,1fr) auto; gap:4px; min-width:0; min-height:120px; padding:8px 4px; border:1px solid var(--ui-border); border-radius:var(--ui-card-radius); background:var(--ui-paper); color:var(--ui-ink); font-size:13px; }
.pet-option > img { width:100%; height:100px; min-width:0; object-fit:contain; }
.pet-option-check { position:absolute; top:6px; right:6px; display:none; color:var(--ui-accent); }
.pet-option[aria-pressed="true"] .pet-option-check { display:block; }
.pet-option[aria-pressed="true"],.pet-none[aria-pressed="true"] { border-color:var(--ui-accent); background:var(--ui-selected); color:var(--ui-accent); }
.pet-option:hover,.pet-none:hover { background:var(--ui-soft); border-color:var(--ui-border-strong); }
.pet-studio button:not(:disabled):active { background:var(--ui-pressed); }
.pet-none { display:flex; gap:8px; align-items:center; justify-content:center; width:100%; min-height:44px; margin:12px 0 24px; padding:8px; border:1px solid var(--ui-border); border-radius:var(--ui-radius); background:var(--ui-surface); color:var(--ui-muted); font-size:13px; white-space:nowrap; }
.pet-unlock-note { padding:14px 16px; border-left:2px solid var(--ui-border-strong); background:var(--ui-paper); font-size:12px; line-height:1.8; }
.pet-unlock-note p { margin-top:6px; color:var(--ui-muted); }
.pet-preview-note { margin-top:14px; color:var(--ui-muted); font-size:11px; line-height:1.7; }
.pet-savebar { display:flex; gap:16px; align-items:center; justify-content:space-between; padding:12px 20px; border-top:1px solid var(--ui-border); }
.pet-save-status { min-width:0; color:var(--ui-accent); font-size:13px; line-height:1.6; }
.pet-save-status > span { display:block; color:var(--ui-muted); font-size:11px; }
.pet-save-actions { display:flex; gap:8px; flex:none; }
.pet-save-actions > button { display:inline-flex; gap:6px; align-items:center; justify-content:center; min-height:44px; padding:8px 14px; border:1px solid var(--ui-border); border-radius:var(--ui-radius); background:var(--ui-surface); color:var(--ui-accent); font-size:13px; white-space:nowrap; }
.pet-save-actions > .pet-save { background:var(--ui-primary); border-color:var(--ui-border-strong); font-weight:600; }
.pet-save-actions > button:not(:disabled):hover { background:var(--ui-selected); }
.profile-pet-home { display:grid; grid-template-columns:minmax(0,.65fr) minmax(0,1fr); align-items:center; gap:28px; margin:24px 0; padding:24px; border:1px solid var(--ui-border); border-radius:var(--ui-card-radius); background:var(--ui-soft); }
.profile-pet-portrait { display:grid; place-items:center; min-width:0; height:240px; }
.profile-pet-portrait .pet-portrait { max-width:280px; }
.profile-pet-placeholder { color:var(--ui-marker); }
.profile-pet-placeholder > .icon { width:72px; height:72px; }
.profile-pet-copy h2 { font-size:24px; }
.profile-pet-copy > p:not(.eyebrow) { margin:10px 0 18px; color:var(--ui-muted); font-size:14px; line-height:1.8; }
.profile-pet-copy > span { display:block; margin-top:12px; color:var(--ui-muted); font-size:11px; }
@media (max-width:1020px) { .pet-studio { height:calc(100dvh - 102px); } }
@media (max-width:850px) and (orientation:portrait) {
  .wardrobe-studio .closet-preview { grid-template-rows:36px minmax(0,1fr); }
  .wardrobe-studio .closet-view-controls { height:36px; padding:0 10px; }
  .wardrobe-studio .girl-fitting-stage { padding:0 46px 8px 8px; }
  .wardrobe-studio .closet-equipped { position:absolute; top:40px; right:8px; bottom:8px; width:34px; flex-direction:column; padding:0; border:0; }
  .wardrobe-studio .closet-equipped-list { flex-direction:column; overflow-x:clip; overflow-y:auto; }
  .wardrobe-studio .closet-equipped-list button { width:32px; height:32px; }
  .pet-workspace { grid-template-columns:minmax(0,1fr); grid-template-rows:minmax(0,1fr) minmax(0,38%); }
  .pet-showcase { padding:10px 16px; border-right:0; border-bottom:1px solid var(--ui-border); }
  .pet-stage-caption { padding:0; }
  .pet-stage-caption h2 { font-size:20px; }
  .pet-stage-caption p { display:none; }
  .pet-selector { padding:12px 16px; }
  .pet-selector-heading { display:none; }
  .pet-option { min-height:90px; padding:4px; }
  .pet-option > img { height:74px; }
  .pet-none { margin:8px 0; }
  .pet-unlock-note { padding:8px 12px; font-size:11px; line-height:1.6; }
  .pet-unlock-note p { margin-top:2px; }
  .pet-preview-note { margin-top:6px; font-size:10px; }
}
@media (max-width:640px) {
  body[data-view="pets"] .main { padding:8px 10px 12px; }
  .pet-studio { height:calc(100dvh - 80px); min-height:480px; }
  .studio-areas { padding:0 8px; gap:0; }
  .studio-areas > a { flex:1; min-height:40px; padding:8px; font-size:12px; }
  .pet-toolbar { min-height:52px; padding:4px 8px; }
  .pet-toolbar h1 { font-size:21px; }
  .pet-toolbar .eyebrow { display:none; }
  .pet-showcase { padding:6px 10px; }
  .pet-stage-caption h2 { font-size:18px; }
  .pet-selector { padding:8px 10px; }
  .pet-options { gap:8px; }
  .pet-option { min-height:80px; font-size:12px; }
  .pet-option > img { height:60px; }
  .pet-none { min-height:40px; margin:6px 0; font-size:12px; }
  .pet-unlock-note { padding:6px 8px; font-size:10px; }
  .pet-savebar { gap:6px; padding:8px max(8px,env(safe-area-inset-right)) max(8px,env(safe-area-inset-bottom)) 8px; }
  .pet-save-status { flex:1; font-size:10px; }
  .pet-save-status > span { display:none; }
  .pet-save-actions { gap:5px; }
  .pet-save-actions > button { min-height:40px; padding:6px 9px; font-size:12px; }
  .profile-pet-home { grid-template-columns:minmax(0,1fr); gap:12px; padding:16px; }
  .profile-pet-portrait { height:220px; }
  .profile-pet-copy h2 { font-size:23px; }
}
@media (max-height:600px) and (orientation:landscape) {
  .wardrobe-studio { grid-template-columns:minmax(0,1fr) auto; grid-template-rows:auto minmax(0,1fr) auto; }
  .wardrobe-studio .closet-toolbar { grid-column:1; grid-row:1; }
  .wardrobe-studio .studio-areas { grid-column:2; grid-row:1; align-items:stretch; padding:0; border-left:1px solid var(--ui-border); }
  .wardrobe-studio .studio-areas > a { gap:4px; padding:4px 8px; font-size:11px; }
  .wardrobe-studio .studio-areas .icon { width:14px; height:14px; }
  .wardrobe-studio .closet-workspace,.wardrobe-studio .closet-savebar { grid-column:1 / -1; }
  .wardrobe-studio .closet-preview { grid-template-rows:30px minmax(0,1fr); }
  .wardrobe-studio .closet-view-controls { height:30px; padding:0 4px; }
  .wardrobe-studio .girl-fitting-stage { padding:0 34px 2px 4px; }
  .wardrobe-studio .closet-equipped { position:absolute; top:34px; right:4px; bottom:4px; width:26px; flex-direction:column; padding:0; border:0; }
  .wardrobe-studio .closet-equipped-list { flex-direction:column; overflow-x:clip; overflow-y:auto; }
  .wardrobe-studio .closet-equipped-list button { width:26px; height:26px; }
  body[data-view="pets"] .main { padding-top:6px; }
  .pet-studio { height:calc(100dvh - 82px); min-height:230px; }
  .pet-toolbar { min-height:36px; padding:0 8px; }
  .pet-toolbar h1 { font-size:18px; }
  .pet-toolbar .eyebrow { display:none; }
  .pet-toolbar .closet-title > a { min-height:36px; }
  .studio-areas > a { min-height:32px; padding:4px 12px; }
  .pet-workspace { grid-template-columns:minmax(0,1fr) minmax(0,1fr); grid-template-rows:minmax(0,1fr); }
  .pet-showcase { padding:2px 8px; border-right:1px solid var(--ui-border); border-bottom:0; }
  .pet-stage-caption { padding:0; }
  .pet-stage-caption h2 { font-size:14px; }
  .pet-stage-caption p,.pet-selector-heading { display:none; }
  .pet-selector { padding:6px 10px; }
  .pet-options { gap:6px; }
  .pet-option { min-height:68px; padding:2px; font-size:11px; }
  .pet-option > img { height:42px; }
  .pet-none { min-height:32px; margin:4px 0; padding:4px; font-size:11px; }
  .pet-unlock-note { padding:4px 6px; font-size:10px; }
  .pet-preview-note { margin-top:4px; font-size:10px; }
  .pet-savebar { padding:4px 10px; }
  .pet-save-status { font-size:10px; }
  .pet-save-status > span { display:none; }
  .pet-save-actions > button { min-height:36px; padding:4px 10px; font-size:12px; }
}
