:root{
  --bg:#f4f0e8;--card:#fffdf8;--ink:#172237;--muted:#756f66;--line:#ddd4c7;
  --green:#486140;--green-bg:#edf4e9;--amber:#8a6a38;--amber-bg:#f7f0e3;
  --red:#9b4f48;--red-bg:#faece9;--soft:#f0ebe2;--shadow:0 8px 28px rgba(23,34,55,.07)
}
*{box-sizing:border-box} body{margin:0;font-family:Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;color:var(--ink);background:linear-gradient(180deg,#faf7f1,var(--bg))}button{font:inherit;color:inherit}
.topbar{max-width:1160px;margin:auto;padding:18px 20px 8px;display:flex;align-items:end;justify-content:space-between;gap:12px}.eyebrow,.section-kicker{font-size:9px;letter-spacing:.14em;font-weight:850;color:var(--muted)}h1{font-family:Georgia,serif;font-size:42px;font-weight:500;margin:2px 0 0}.top-actions{display:flex;gap:7px}.primary,.ghost{border:1px solid var(--line);border-radius:12px;padding:9px 12px;background:#fff;cursor:pointer}.primary{background:var(--ink);color:#fff;border-color:var(--ink)}
.app-shell{max-width:1160px;margin:auto;padding:8px 20px 34px;display:grid;grid-template-columns:360px minmax(0,1fr);gap:12px;align-items:start}.preview-card,.guide-card{background:rgba(255,253,248,.97);border:1px solid var(--line);border-radius:18px;padding:14px;box-shadow:var(--shadow)}.preview-card{position:sticky;top:10px}.preview-head{display:flex;justify-content:space-between;align-items:center;gap:10px}.outfit-status{font-weight:800;font-size:12px;margin-top:3px}.score-badge{display:flex;align-items:baseline;gap:2px;border:1px solid #c6d3c0;background:#f2f7ef;border-radius:999px;padding:6px 9px}.score-badge strong{font-size:22px;color:#3f5739}.score-badge span{font-size:9px;font-weight:800;color:#667062}.hidden{display:none!important}
.outfit-stage{height:390px;border:1px solid #e2d9cb;border-radius:16px;background:linear-gradient(180deg,#f9f6ef,#eee8df);display:flex;align-items:center;justify-content:center;overflow:hidden;padding:8px;margin-top:10px}.look-stack{width:100%;height:100%;display:flex;flex-direction:column;align-items:center;justify-content:center}.look-piece{width:100%;display:flex;align-items:center;justify-content:center}.look-piece img{width:100%;height:100%;object-fit:contain;filter:drop-shadow(0 7px 10px rgba(23,34,55,.08))}.preview-image{width:100%;height:100%;object-fit:contain;display:grid;place-items:center;background:var(--swatch,transparent);border-radius:12px;color:#fff}.look-top{height:116px;max-width:230px;z-index:3}.look-pants{height:220px;max-width:180px;margin-top:-10px;z-index:2}.look-shoes{height:76px;max-width:205px;margin-top:-18px;z-index:4}.look-empty{border:1px dashed #cdc4b7;border-radius:11px;color:#9b9388;font-size:11px;background:rgba(255,255,255,.48)}.look-top.look-empty{height:92px}.look-pants.look-empty{height:182px;margin-top:7px}.look-shoes.look-empty{height:57px;margin-top:7px}
.selected-strip{display:grid;grid-template-columns:repeat(3,1fr);gap:6px;margin-top:8px}.selected-chip{border:1px solid var(--line);background:#fff;border-radius:10px;padding:6px;display:flex;align-items:center;gap:5px;cursor:pointer;text-align:left;min-width:0}.selected-chip.empty{opacity:.62}.selected-chip img{width:27px;height:31px;object-fit:contain}.chip-fallback{width:27px;height:27px;border-radius:7px;background:var(--swatch);display:grid;place-items:center;color:#fff;font-size:11px}.selected-chip small{display:block;font-size:7px;color:var(--muted);text-transform:uppercase;letter-spacing:.05em}.selected-chip strong{display:block;font-size:8px;line-height:1.1;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.score-breakdown{display:grid;grid-template-columns:repeat(auto-fit,minmax(52px,1fr));gap:5px;margin-top:8px}.metric{border:1px solid var(--line);border-radius:9px;background:#fff;padding:5px}.metric span{display:block;font-size:7px;text-transform:uppercase;letter-spacing:.05em;color:var(--muted)}.metric strong{display:block;font-size:12px;margin-top:1px}.metric.good strong{color:var(--green)}.metric.mid strong{color:var(--amber)}.metric.low strong{color:var(--red)}.why-box{margin-top:8px;border-left:3px solid var(--green);background:#f0f5ed;border-radius:9px;padding:8px 9px;font-size:9px;line-height:1.4;color:#45503f}
.progress{display:grid;grid-template-columns:repeat(4,1fr);gap:5px;margin-bottom:16px}.progress-step{border-radius:9px;background:#f1ece4;border:1px solid #e7ded2;padding:7px 6px;color:#8b847b}.progress-step strong{display:block;font-size:8px}.progress-step span{display:block;font-size:7px;margin-top:1px}.progress-step.active{background:#eef3ea;border-color:#c4d0bd;color:#43583e}.progress-step.done{background:#f8f6f1;color:#5d5a54}.guide-head h2{font-size:24px;margin:3px 0 4px;letter-spacing:-.02em}.guide-head p{font-size:11px;line-height:1.45;color:var(--muted);margin:0;max-width:680px}.start-tabs{display:flex;gap:6px;margin:14px 0 10px}.start-tab{border:1px solid var(--line);background:#fff;border-radius:999px;padding:8px 12px;cursor:pointer;font-size:10px;font-weight:750}.start-tab.active{background:var(--ink);border-color:var(--ink);color:#fff}
.guide-content{margin-top:10px}.recommendation-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}.choice-card{position:relative;border:1px solid var(--line);background:#fff;border-radius:14px;padding:9px;display:grid;grid-template-columns:80px minmax(0,1fr);gap:8px;align-items:center;text-align:left;cursor:pointer;min-height:118px;overflow:hidden}.choice-card:hover{transform:translateY(-1px);box-shadow:0 6px 18px rgba(23,34,55,.06)}.choice-card.best{border-color:#aebfa6;background:#fbfef9}.choice-card.good{border-color:#d6c9ad;background:#fffdf8}.choice-card.avoid{opacity:.56;background:#fbf7f6}.choice-card.avoid::after{content:"×";position:absolute;right:7px;top:1px;color:var(--red);font-size:24px}.choice-card.selected{outline:2px solid var(--ink);outline-offset:-2px}.choice-card img{width:78px;height:96px;object-fit:contain}.choice-fallback{width:70px;height:82px;border-radius:10px;background:var(--swatch);display:grid;place-items:center;color:#fff}.choice-meta{min-width:0}.choice-meta strong{display:block;font-size:11px;line-height:1.15}.choice-color{font-size:8px;color:var(--muted);display:block;margin-top:2px}.choice-score{display:inline-flex;align-items:center;gap:4px;border-radius:999px;padding:4px 6px;font-size:7px;font-weight:850;margin-top:6px;background:#eee}.choice-card.best .choice-score{background:var(--green-bg);color:var(--green)}.choice-card.good .choice-score{background:var(--amber-bg);color:var(--amber)}.choice-card.avoid .choice-score{background:var(--red-bg);color:var(--red)}.choice-reason{display:block;font-size:8px;color:#655f57;line-height:1.35;margin-top:6px}.best-ribbon{position:absolute;left:7px;top:7px;background:var(--green);color:#fff;border-radius:999px;padding:4px 6px;font-size:7px;font-weight:850;z-index:2}.all-options{margin-top:10px;border-top:1px solid var(--line);padding-top:9px}.all-options summary{cursor:pointer;font-size:9px;font-weight:800;color:#5e5a54}.all-options-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:5px;margin-top:7px}.mini-choice{border:1px solid var(--line);background:#fff;border-radius:9px;padding:5px;display:flex;align-items:center;gap:5px;cursor:pointer;text-align:left;position:relative}.mini-choice.avoid{opacity:.55}.mini-choice.avoid::after{content:"×";position:absolute;right:4px;top:0;color:var(--red);font-size:16px}.mini-choice img{width:33px;height:40px;object-fit:contain}.mini-fallback{width:31px;height:31px;border-radius:7px;background:var(--swatch);display:grid;place-items:center;color:#fff;font-size:10px}.mini-choice strong{font-size:8px;line-height:1.1;display:block}.mini-choice small{font-size:7px;color:var(--muted)}
.context-line{border-radius:10px;background:#f5f1ea;border:1px solid #e8dfd3;padding:7px 8px;font-size:9px;color:#615c55;margin-bottom:9px}.context-line strong{color:var(--ink)}.secondary-finish{margin-top:12px;border-top:1px solid var(--line);padding-top:12px}.finish-head h3{font-size:17px;margin:2px 0 3px}.finish-head p{font-size:9px;color:var(--muted);margin:0 0 9px}.finish-grid{display:grid;grid-template-columns:1fr 1fr;gap:8px}.finish-card{border:1px solid var(--line);border-radius:12px;background:#fff;padding:8px}.finish-card h4{font-size:10px;margin:0 0 6px}.finish-options{display:grid;gap:5px}.finish-option{border:1px solid #e0d8cd;background:#faf8f4;border-radius:9px;padding:6px;display:flex;align-items:center;gap:6px;cursor:pointer;text-align:left;position:relative}.finish-option.selected{outline:2px solid var(--ink);outline-offset:-2px}.finish-option.best{background:var(--green-bg);border-color:#c1d0bb}.finish-option.avoid{background:var(--red-bg);border-color:#e3c7c2}.finish-copy strong{font-size:8px;display:block}.finish-copy small{font-size:7px;color:var(--muted);display:block;margin-top:2px}.tee-shape{--tee:#eee;width:27px;height:27px;background:var(--tee);border:1px solid rgba(0,0,0,.14);border-radius:7px 7px 4px 4px;position:relative;clip-path:polygon(18% 0,34% 0,41% 8%,59% 8%,66% 0,82% 0,100% 16%,88% 34%,80% 27%,80% 100%,20% 100%,20% 27%,12% 34%,0 16%);flex:0 0 auto}.tee-shape::after{content:"";position:absolute;left:50%;top:0;background:#fffdf9}.tee-shape.neck-o::after{width:8px;height:5px;transform:translateX(-50%);border-radius:0 0 8px 8px;border:1px solid rgba(0,0,0,.14);border-top:0}.tee-shape.neck-v::after{width:8px;height:8px;transform:translateX(-50%) rotate(45deg);top:-3px;border-right:1px solid rgba(0,0,0,.14);border-bottom:1px solid rgba(0,0,0,.14)}.sock-shape{--sock:#ddd;width:14px;height:24px;background:var(--sock);border:1px solid rgba(0,0,0,.12);border-radius:3px 3px 5px 5px;position:relative;transform:rotate(4deg);flex:0 0 auto}.sock-shape::after{content:"";position:absolute;width:12px;height:7px;background:var(--sock);left:4px;bottom:-2px;border:1px solid rgba(0,0,0,.12);border-left:0;border-radius:0 5px 5px 0}
.engine-details{margin-top:14px;border-top:1px solid var(--line);padding-top:9px}.engine-details summary{font-size:9px;font-weight:800;cursor:pointer}.engine-details p{font-size:9px;color:var(--muted);line-height:1.45;margin:7px 0 0}
@media(max-width:880px){.app-shell{grid-template-columns:1fr}.preview-card{position:static}.outfit-stage{height:335px}.preview-card{order:-1}}
@media(max-width:560px){.topbar{padding:11px 10px 6px}.topbar h1{font-size:30px}.app-shell{padding:5px 8px 20px;gap:8px}.preview-card,.guide-card{border-radius:14px;padding:9px}.preview-card{display:grid;grid-template-columns:140px minmax(0,1fr);gap:7px;align-items:start}.preview-head,.selected-strip,.score-breakdown,.why-box{grid-column:1/-1}.outfit-stage{height:245px;margin-top:4px}.look-top{height:67px}.look-pants{height:128px;max-width:106px;margin-top:-5px}.look-shoes{height:47px;margin-top:-9px}.selected-strip{margin-top:2px}.guide-head h2{font-size:19px}.guide-head p{font-size:10px}.progress{margin-bottom:11px}.progress-step{padding:5px}.progress-step span{display:none}.recommendation-grid{grid-template-columns:1fr 1fr;gap:5px}.choice-card{grid-template-columns:55px minmax(0,1fr);min-height:94px;padding:6px}.choice-card img{width:53px;height:72px}.choice-fallback{width:50px;height:62px}.choice-meta strong{font-size:9px}.choice-reason{font-size:7px}.all-options-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.finish-grid{grid-template-columns:1fr}.start-tabs{overflow-x:auto}.primary,.ghost{padding:7px 8px;font-size:10px}}

/* v12 — compact, choice-first UI */
.outfit-stage{height:335px}
.guide-card{padding:13px}
.progress{margin-bottom:11px}
.guide-head h2{font-size:21px;margin-bottom:2px}
.guide-head p{font-size:10px}
.guide-content{margin-top:8px}
.dual-suggestions{display:grid;grid-template-columns:1fr 1fr;gap:9px;align-items:start}
.suggestion-group{border:1px solid var(--line);border-radius:13px;background:#fbf9f5;padding:8px;min-width:0}
.suggestion-head{display:flex;align-items:baseline;justify-content:space-between;gap:8px;margin-bottom:6px}
.suggestion-head strong{font-size:10px}
.suggestion-head span{font-size:7px;color:var(--muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:72%}
.compact-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(64px,1fr));gap:5px}
.compact-grid.short{grid-template-columns:repeat(auto-fit,minmax(64px,1fr))}
.compact-choice{position:relative;border:1px solid #ded6ca;background:#fff;border-radius:10px;padding:4px;cursor:pointer;height:88px;display:grid;place-items:center;overflow:hidden;transition:.14s ease}
.compact-choice:hover{transform:translateY(-1px);box-shadow:0 5px 13px rgba(23,34,55,.07)}
.compact-choice.best{border-color:#9eb594;background:#f8fcf6;box-shadow:inset 0 0 0 1px #c8d8c1}
.compact-choice.selected{outline:2px solid var(--ink);outline-offset:-2px}
.compact-choice.avoid{opacity:.42;filter:saturate(.65)}
.compact-choice.avoid::after{content:'×';position:absolute;inset:0;display:grid;place-items:center;color:rgba(142,58,50,.86);font-size:38px;font-weight:500;z-index:4;pointer-events:none}
.compact-img{width:100%;height:100%;object-fit:contain;padding:4px;filter:drop-shadow(0 3px 5px rgba(23,34,55,.06))}
.compact-fallback{width:100%;height:100%;border-radius:7px;background:var(--swatch);display:grid;place-items:center;color:#fff;font-size:21px}
.compact-score{position:absolute;right:4px;top:4px;z-index:5;background:rgba(23,34,55,.88);color:#fff;border-radius:999px;padding:3px 5px;font-size:7px;font-weight:850;line-height:1}
.compact-choice.best .compact-score{background:rgba(72,97,64,.93)}
.compact-choice.avoid .compact-score{background:rgba(117,111,102,.84)}

.selected-detail-row{grid-column:1/-1;display:flex;gap:6px;align-items:center;margin-top:1px}
.detail-mini{flex:1;min-width:0;border:1px solid var(--line);border-radius:9px;background:#faf8f4;padding:5px 7px;display:flex;align-items:center;gap:6px}
.detail-mini small{font-size:7px;color:var(--muted);text-transform:uppercase;letter-spacing:.04em}
.detail-mini strong{font-size:8px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.detail-mini .tee-shape{width:21px;height:21px}.detail-mini .sock-shape{width:11px;height:19px}

.secondary-finish{margin-top:9px;padding-top:9px}
.finish-compact{display:grid;grid-template-columns:1fr 1fr;gap:9px}
.finish-compact>section{border:1px solid var(--line);border-radius:12px;background:#fff;padding:8px}
.detail-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(48px,1fr));gap:5px}
.detail-choice{position:relative;height:59px;border:1px solid #ded6ca;border-radius:9px;background:#faf8f4;display:grid;place-items:center;cursor:pointer;padding:5px}
.detail-choice.selected{outline:2px solid var(--ink);outline-offset:-2px}
.detail-choice.best{background:var(--green-bg);border-color:#bdd0b5}
.detail-choice.avoid{background:var(--red-bg);opacity:.62}
.detail-choice.avoid::after{content:'×';position:absolute;inset:0;display:grid;place-items:center;color:rgba(155,79,72,.86);font-size:29px;z-index:3;pointer-events:none}
.detail-score{position:absolute;right:3px;top:3px;z-index:5;border-radius:999px;background:rgba(23,34,55,.86);color:#fff;padding:2px 4px;font-size:6px;font-weight:850}
.detail-choice.best .detail-score{background:var(--green)}
.detail-choice .tee-shape{width:31px;height:31px}.detail-choice .sock-shape{width:17px;height:29px}
.neck-badge{position:absolute;left:4px;bottom:3px;font-size:6px;font-weight:900;background:#fff;border:1px solid var(--line);border-radius:999px;padding:1px 4px;z-index:5}
.bonus-line{margin-top:7px;margin-bottom:0}

@media(max-width:880px){
  .outfit-stage{height:290px}
  .dual-suggestions{grid-template-columns:1fr 1fr}
  .compact-choice{height:80px}
}
@media(max-width:620px){
  .preview-card{display:block}
  .outfit-stage{height:225px}
  .look-top{height:62px}.look-pants{height:122px;max-width:104px;margin-top:-4px}.look-shoes{height:45px;margin-top:-8px}
  .dual-suggestions{grid-template-columns:1fr;gap:7px}
  .suggestion-group{padding:6px}
  .compact-grid{grid-template-columns:repeat(5,minmax(0,1fr));gap:4px}
  .compact-choice{height:67px;border-radius:8px;padding:2px}
  .compact-score{right:2px;top:2px;padding:2px 4px;font-size:6px}
  .finish-compact{grid-template-columns:1fr;gap:7px}
  .detail-grid{grid-template-columns:repeat(6,minmax(0,1fr))}
  .detail-choice{height:52px;padding:3px}
  .guide-head h2{font-size:18px}
  .start-tabs{margin:9px 0 7px}
  .progress{margin-bottom:8px}
}


/* v13 tweaks: full-garment cards + live board */
.outfit-stage{height:385px;padding:14px;margin-top:12px}
.look-stack{gap:10px;padding:6px 0;justify-content:flex-start}
.look-top{height:104px;max-width:220px}
.look-pants{height:194px;max-width:165px;margin-top:0}
.look-shoes{height:70px;max-width:190px;margin-top:0}
.look-top.look-empty{height:88px}.look-pants.look-empty{height:166px;margin-top:0}.look-shoes.look-empty{height:56px;margin-top:0}
.live-board{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;align-items:start}
.completed-board{margin-top:10px}
.selected-group{background:#f8f5ef}
.chosen-panel{width:100%;border:1px solid #d9d0c1;background:#fff;border-radius:12px;padding:10px;cursor:pointer;display:grid;grid-template-rows:1fr auto auto;gap:6px;min-height:170px;position:relative;overflow:hidden}
.chosen-panel:hover{box-shadow:0 6px 16px rgba(23,34,55,.07);transform:translateY(-1px)}
.chosen-img{width:100%;height:104px;object-fit:contain;padding:4px;filter:drop-shadow(0 4px 8px rgba(23,34,55,.08))}
.chosen-fallback{width:100%;height:104px;border-radius:10px;background:var(--swatch);display:grid;place-items:center;color:#fff;font-size:26px}
.chosen-name{font-size:10px;font-weight:800;line-height:1.2}
.chosen-action{font-size:8px;color:var(--muted);text-transform:uppercase;letter-spacing:.04em}
.chosen-score{position:absolute;right:6px;top:6px;border-radius:999px;background:rgba(23,34,55,.88);color:#fff;padding:3px 6px;font-size:7px;font-weight:850}
.compact-grid{grid-template-columns:repeat(auto-fill,minmax(86px,1fr));gap:7px}
.compact-grid.short{grid-template-columns:repeat(auto-fit,minmax(86px,1fr))}
.compact-choice{height:120px;padding:6px;border-radius:11px}
.compact-img{width:100%;height:100%;object-fit:contain;padding:2px 3px 10px}
.compact-fallback{width:100%;height:100%;border-radius:8px;font-size:24px}
.compact-score{right:5px;top:5px;padding:3px 6px;font-size:7px}
.suggestion-group{padding:10px}
.suggestion-head strong{font-size:11px}
.suggestion-head span{font-size:8px;max-width:70%}
.finish-compact{margin-top:4px}
@media(max-width:880px){
  .live-board{grid-template-columns:1fr 1fr}
  .outfit-stage{height:360px}
  .compact-choice{height:108px}
}
@media(max-width:620px){
  .live-board{grid-template-columns:1fr}
  .outfit-stage{height:245px;padding:8px}
  .look-stack{gap:6px}
  .look-top{height:70px;max-width:150px}
  .look-pants{height:124px;max-width:108px}
  .look-shoes{height:46px;max-width:128px}
  .compact-grid{grid-template-columns:repeat(4,minmax(0,1fr));gap:5px}
  .compact-grid.short{grid-template-columns:repeat(4,minmax(0,1fr))}
  .compact-choice{height:82px;padding:4px}
  .chosen-panel{min-height:136px;padding:8px}
  .chosen-img,.chosen-fallback{height:74px}
}

/* v14 — mode switch + safer next-step guidance */
.day-mode{display:flex;gap:5px;margin-top:8px;flex-wrap:wrap}.mode-btn{border:1px solid var(--line);background:#fff;border-radius:999px;padding:6px 10px;font-size:9px;font-weight:800;color:var(--muted);cursor:pointer}.mode-btn.active{background:var(--ink);border-color:var(--ink);color:#fff}.mode-btn:not(.active):hover{background:#f7f3ec}
.safest-strip{display:flex;align-items:center;gap:7px;flex-wrap:wrap;border:1px solid #cbd7c5;background:#f3f8f0;border-radius:12px;padding:7px 8px;margin-bottom:9px}.safest-label{font-size:8px;font-weight:900;letter-spacing:.05em;text-transform:uppercase;color:#53664d;margin-right:1px}.safest-chip{border:1px solid #d6ded2;background:#fff;border-radius:10px;padding:5px 7px;display:flex;align-items:center;gap:6px;cursor:pointer;min-width:0;flex:1 1 180px;text-align:left}.safest-chip:hover{box-shadow:0 4px 12px rgba(23,34,55,.06)}.safest-img{width:30px;height:34px;object-fit:contain;flex:0 0 auto}.safest-fallback{width:30px;height:30px;border-radius:7px;background:var(--swatch);display:grid;place-items:center;color:#fff;flex:0 0 auto}.safest-chip span{min-width:0;display:flex;flex-direction:column}.safest-chip small{font-size:7px;color:var(--muted)}.safest-chip strong{font-size:8px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.safest-chip b{margin-left:auto;background:var(--green);color:#fff;border-radius:999px;padding:3px 5px;font-size:7px}
.finish-compact.single-finish{grid-template-columns:1fr}.selected-detail-row.single{grid-template-columns:1fr;display:grid}
@media(max-width:620px){.day-mode{margin-top:5px}.mode-btn{font-size:8px;padding:5px 8px}.safest-strip{padding:6px}.safest-chip{flex-basis:140px}.safest-chip strong{font-size:7px}}

/* v14.1 — robust garment image sizing
   Keep the full garment visible and use a card shape that matches the garment category. */

/* Do not stretch short lists across the full panel width. */
.compact-grid,
.compact-grid.short{
  grid-template-columns:repeat(auto-fit,minmax(105px,135px));
  justify-content:start;
  align-items:start;
  gap:7px;
}

/* The card is only a viewport. Center the image and never crop it. */
.compact-choice{
  display:flex;
  align-items:center;
  justify-content:center;
  padding:7px;
  overflow:hidden;
  min-width:0;
}

.compact-img{
  display:block;
  width:auto;
  height:auto;
  max-width:100%;
  max-height:100%;
  min-width:0;
  min-height:0;
  object-fit:contain;
  object-position:center center;
  padding:3px;
}

/* Portrait cards for trousers: enough vertical room to show waist-to-hem. */
.compact-choice[data-cat="pants"]{
  height:158px;
}
.compact-choice[data-cat="pants"] .compact-img{
  max-height:146px;
  max-width:112px;
}

/* Tops are closer to square. */
.compact-choice[data-cat="tops"]{
  height:132px;
}
.compact-choice[data-cat="tops"] .compact-img{
  max-height:120px;
  max-width:122px;
}

/* Shoes are naturally landscape, so they need less height. */
.compact-choice[data-cat="shoes"]{
  height:104px;
}
.compact-choice[data-cat="shoes"] .compact-img{
  max-height:90px;
  max-width:126px;
}

/* Apply the same no-crop rule to selected items and the outfit preview. */
.chosen-img,
.look-piece img,
.preview-image,
.selected-chip img,
.safest-img{
  object-fit:contain;
  object-position:center center;
}

.chosen-img{
  width:auto;
  height:auto;
  max-width:100%;
  max-height:118px;
  margin:auto;
}

.look-piece img{
  width:auto;
  height:auto;
  max-width:100%;
  max-height:100%;
}

/* Mobile: keep the full garment visible, but reduce card sizes. */
@media(max-width:620px){
  .compact-grid,
  .compact-grid.short{
    grid-template-columns:repeat(3,minmax(0,1fr));
    gap:5px;
  }

  .compact-choice[data-cat="pants"]{height:118px}
  .compact-choice[data-cat="pants"] .compact-img{max-height:108px;max-width:86px}

  .compact-choice[data-cat="tops"]{height:98px}
  .compact-choice[data-cat="tops"] .compact-img{max-height:88px;max-width:92px}

  .compact-choice[data-cat="shoes"]{height:78px}
  .compact-choice[data-cat="shoes"] .compact-img{max-height:66px;max-width:98px}
}


/* v15 — optional per-item display metadata from catalog.json */
.compact-img,.chosen-img,.look-piece img,.preview-image,.selected-chip img,.safest-img{
  transform:translate(var(--item-x,0px),var(--item-y,0px)) scale(var(--item-scale,1));
  transform-origin:center center;
}

/* v18 complete-outfit explanation */
.why-box{display:grid;gap:5px}
.why-strength,.why-weakness{padding:1px 0}
.why-strength strong{color:var(--green)}
.why-weakness{padding-top:5px;border-top:1px solid rgba(69,80,63,.12)}
.why-weakness strong{color:#7a6040}

/* v19 — in-app pants README / pairing guide */
.compact-choice-wrap{position:relative;width:100%;min-width:0}
.compact-choice-wrap>.compact-choice{width:100%}
.pants-info-btn{position:absolute;left:7px;bottom:7px;z-index:8;border:1px solid rgba(23,34,55,.16);background:rgba(255,255,255,.92);color:var(--ink);border-radius:999px;padding:3px 7px;font-size:7px;font-weight:850;cursor:pointer;box-shadow:0 2px 5px rgba(23,34,55,.06)}
.pants-info-btn:hover,.pants-readmore:hover{background:#fff;box-shadow:0 4px 10px rgba(23,34,55,.10)}
.pants-readmore{margin-top:6px;width:100%;border:1px solid var(--line);background:#fff;border-radius:9px;padding:5px 7px;font-size:8px;font-weight:850;color:var(--ink);cursor:pointer}
.pants-guide-backdrop{position:fixed;inset:0;z-index:9999;background:rgba(18,25,35,.38);backdrop-filter:blur(4px);display:grid;place-items:center;padding:18px}
.pants-guide-modal{width:min(920px,96vw);max-height:min(86vh,880px);overflow:auto;background:#fbf9f5;border:1px solid #d8cfc1;border-radius:20px;box-shadow:0 28px 80px rgba(18,25,35,.24)}
.pants-guide-head{position:relative;display:grid;grid-template-columns:118px 1fr auto;gap:16px;align-items:center;padding:18px 20px 15px;border-bottom:1px solid var(--line);background:linear-gradient(180deg,#fff,#f8f4ed)}
.pants-guide-thumb{height:118px;display:grid;place-items:center;border:1px solid var(--line);border-radius:14px;background:#fff;padding:7px}
.guide-pants-img{max-width:100%;max-height:100%;object-fit:contain}
.guide-pants-fallback{width:100%;height:100%;border-radius:10px;background:var(--swatch)}
.guide-kicker{display:block;font-size:8px;font-weight:900;letter-spacing:.14em;color:var(--muted);margin-bottom:4px}
.pants-guide-head h2{font-size:22px;line-height:1.05;margin:0 0 7px;color:var(--ink)}
.pants-guide-head p{margin:0;color:var(--muted);font-size:11px;line-height:1.45;max-width:690px}
.guide-close{align-self:start;border:1px solid var(--line);background:#fff;border-radius:999px;width:31px;height:31px;font-size:20px;line-height:1;cursor:pointer;color:var(--muted)}
.pants-guide-body{padding:15px 20px 20px;display:grid;gap:15px}
.pants-guide-body section{display:grid;gap:8px}
.pants-guide-body h3{font-size:11px;margin:0;color:var(--ink)}
.guide-color-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:7px}
.guide-color{display:grid;grid-template-columns:26px 1fr;gap:8px;align-items:center;border:1px solid var(--line);border-radius:11px;background:#fff;padding:7px 9px}
.guide-color.best,.guide-item-card.best{border-color:#b8ccb0;background:#f5faf2}
.guide-color.avoid,.guide-item-card.avoid{border-color:#dcc0bc;background:#fff7f5}
.guide-swatch{width:26px;height:26px;border-radius:8px;background:var(--guide-color);border:1px solid rgba(0,0,0,.08)}
.guide-color span:last-child,.guide-item-card span{display:flex;flex-direction:column;gap:2px;min-width:0}
.guide-color strong,.guide-item-card strong{font-size:9px}
.guide-color small,.guide-item-card small{font-size:8px;line-height:1.35;color:var(--muted)}
.guide-item-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:7px}
.guide-item-card{min-height:88px;display:grid;grid-template-columns:66px 1fr;gap:8px;align-items:center;border:1px solid var(--line);border-radius:11px;background:#fff;padding:7px}
.guide-item-img{width:62px;height:68px;object-fit:contain}
.guide-item-fallback{width:58px;height:58px;border-radius:9px;background:var(--swatch)}
.guide-item-grid.socks .guide-item-card{grid-template-columns:36px 1fr;min-height:68px}
.guide-item-grid.socks .sock-shape{width:20px;height:34px;margin:auto}
.guide-watch{border:1px solid #e0cfb8;border-radius:12px;background:#fffaf2;padding:10px 12px}
.guide-watch ul{margin:0;padding-left:17px;color:#6e5a3f;font-size:9px;line-height:1.5}
.guide-footnote{margin:0;color:var(--muted);font-size:8px;line-height:1.45;border-top:1px solid var(--line);padding-top:10px}
@media(max-width:680px){
  .pants-guide-backdrop{padding:8px;place-items:end center}
  .pants-guide-modal{width:100%;max-height:92vh;border-radius:18px 18px 8px 8px}
  .pants-guide-head{grid-template-columns:76px 1fr auto;padding:12px;gap:10px}
  .pants-guide-thumb{height:82px}
  .pants-guide-head h2{font-size:17px}
  .pants-guide-head p{font-size:9px}
  .pants-guide-body{padding:11px 12px 15px;gap:12px}
  .guide-color-grid{grid-template-columns:1fr}
  .guide-item-grid{grid-template-columns:1fr 1fr}
  .guide-item-card{grid-template-columns:48px 1fr;min-height:76px}
  .guide-item-img{width:46px;height:58px}
  .pants-info-btn{left:4px;bottom:4px;font-size:6px;padding:2px 5px}
}
