/* fashion.css - the /outfits studio. Mobile first; two columns from 900px. */
.fs { max-width: 1120px; margin: 0 auto; padding: 0 16px 24px; }
.fs [hidden] { display: none !important; }
.fs-intro { text-align: center; padding: 18px 0 14px; }
.fs-intro h1 { font-size: 1.45rem; margin: 0 0 4px; line-height: 1.2; }
.fs-intro p { margin: 0; color: var(--text-muted); font-size: .95rem; }

.fs button { font-family: inherit; cursor: pointer; color: inherit; }
.fs button:focus-visible, .fs summary:focus-visible, .fs-custom:focus-within { outline: 3px solid #2563eb; outline-offset: 2px; }

/* Photo: pinned under the header so changes are always visible. */
.fs-stage {
    position: sticky; top: var(--fs-top, 70px); z-index: 20;
    margin: 0 -16px 12px; padding: 8px 16px;
    background: var(--bg-body);
}
.fs-photo { position: relative; height: 42vh; height: 42svh; min-height: 230px; aspect-ratio: 2 / 3; max-width: 100%; margin: 0 auto; }
.fs-photo canvas { display: block; width: 100%; height: 100%; object-fit: contain; border-radius: var(--radius); background: #8d9bb3; touch-action: manipulation; }
.fs-float {
    position: absolute; min-height: 36px; padding: 0 12px; border: 0; border-radius: 99px;
    background: rgba(255, 255, 255, .93); font-size: 12px; font-weight: 700;
    box-shadow: 0 3px 10px rgba(0, 0, 0, .18);
    user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
}
.fs-original { left: 8px; top: 8px; }
.fs-share { right: 8px; top: 8px; }
.fs-save { right: 8px; top: 52px; }
.fs-loading { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; pointer-events: none; }
.fs-spinner { width: 22px; height: 22px; border: 3px solid rgba(0, 0, 0, .15); border-top-color: #18181b; border-radius: 50%; animation: fs-spin .7s linear infinite; }
@keyframes fs-spin { to { transform: rotate(360deg); } }

.fs-controls { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.fs-card { background: var(--bg-card); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); min-width: 0; }
.fs-card h2 { display: flex; align-items: center; gap: 8px; font-size: 1.02rem; margin: 0 0 12px; }
.fs-step { display: inline-flex; width: 24px; height: 24px; border-radius: 50%; background: #18181b; color: #fff; font-size: 12px; align-items: center; justify-content: center; flex: none; }
.fs-label { font-size: .85rem; color: var(--text-muted); margin: 12px 0 8px; }
.fs-label strong { color: var(--text-main); }
.fs-card h2 + .fs-label { margin-top: -4px; }
.fs-note { font-size: .76rem; color: var(--text-muted); text-align: center; margin: 4px 0; }

/* Swipeable strips on small screens */
.fs-models, .fs-chips, .fs-recs, .fs-swatches { position: relative; display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; padding: 3px; }
.fs-models::-webkit-scrollbar, .fs-chips::-webkit-scrollbar, .fs-recs::-webkit-scrollbar, .fs-swatches::-webkit-scrollbar { display: none; }

.fs-model { flex: 0 0 82px; display: flex; flex-direction: column; align-items: center; gap: 5px; padding: 4px; background: none; border: 2px solid transparent; border-radius: 14px; font-size: 11px; font-weight: 600; line-height: 1.2; }
.fs-model img { width: 100%; height: 92px; object-fit: cover; object-position: top; border-radius: 9px; }
.fs-model.on { border-color: #18181b; background: #f4f4f5; }

.fs-chip { flex: none; min-height: 40px; padding: 0 16px; border: 1.5px solid #e4e4e7; border-radius: 99px; background: #fff; font-size: .88rem; font-weight: 600; }
.fs-chip.on { background: #18181b; border-color: #18181b; color: #fff; }

.fs-swatches { display: grid; grid-auto-flow: column; grid-template-rows: repeat(2, 40px); grid-auto-columns: 40px; }
.fs-sw { width: 40px; height: 40px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1px #d4d4d8; padding: 0; }
.fs-sw.on { box-shadow: 0 0 0 3px #18181b; }
.fs-custom { position: relative; display: flex; align-items: center; justify-content: center; font-size: 20px; font-weight: 600; background: conic-gradient(#f87171, #facc15, #4ade80, #38bdf8, #a78bfa, #f87171); color: #fff; text-shadow: 0 1px 3px rgba(0,0,0,.5); cursor: pointer; }
.fs-custom input { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; cursor: pointer; }

.fs-recs { scroll-snap-type: x proximity; gap: 10px; }
.fs-rec { flex: 0 0 78%; max-width: 300px; scroll-snap-align: start; display: flex; flex-direction: column; border: 2px solid #e4e4e7; border-radius: 14px; overflow: hidden; }
.fs-rec.on { border-color: #18181b; background: #fafafa; }
.fs-rec-main { flex: 1; display: flex; flex-direction: column; align-items: flex-start; gap: 6px; text-align: left; padding: 12px; background: none; border: 0; }
.fs-rec-dots { display: flex; }
.fs-dot { display: inline-block; flex: none; width: 28px; height: 28px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .15); }
.fs-rec-dots .fs-dot { border: 2px solid #fff; width: 34px; height: 34px; margin-right: -8px; }
.fs-rec-why { font-size: .8rem; line-height: 1.4; color: var(--text-muted); }
.fs-more { min-height: 40px; border: 0; border-top: 1px solid #e4e4e7; background: none; font-size: .8rem; font-weight: 700; }
.fs-wait { display: flex; gap: 10px; align-items: center; min-height: 90px; margin: 0 auto; font-size: .9rem; color: var(--text-muted); }

.fs-outfit { list-style: none; margin: 0; padding: 0; }
.fs-outfit li { display: flex; align-items: center; gap: 8px; border-bottom: 1px solid #f1f1f4; }
.fs-piece { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 6px 0; background: none; border: 0; text-align: left; font-size: .9rem; }
.fs-piece-name { font-weight: 700; min-width: 76px; }
.fs-piece-color { color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fs-hex { min-height: 32px; padding: 0 10px; border: 1px solid #e4e4e7; border-radius: 8px; background: #fff; font: 600 11px ui-monospace, Menlo, monospace !important; }

.fs-why summary { cursor: pointer; font-weight: 700; padding: 14px 0 4px; font-size: .9rem; }
.fs-why ul { list-style: none; margin: 8px 0; padding: 0; font-size: .86rem; line-height: 1.45; }
.fs-why li { position: relative; padding: 4px 0 4px 22px; }
.fs-why li::before { content: '\2713'; position: absolute; left: 0; color: #15803d; font-weight: 800; }
.fs-why li.bad::before { content: '\2717'; color: #b91c1c; }
.fs-why .fs-note { text-align: left; }

/* Piece colour picker: bottom sheet on phones */
.fs-sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 200; background: #fff; border-radius: 20px 20px 0 0; box-shadow: 0 -10px 40px rgba(0, 0, 0, .22); padding: 14px 16px calc(16px + env(safe-area-inset-bottom)); }
.fs-sheet-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; }
.fs-sheet-head button { min-height: 38px; padding: 0 18px; border: 0; border-radius: 99px; background: #18181b; color: #fff; font-weight: 700; }

.fs-toast { position: fixed; left: 50%; bottom: 150px; transform: translateX(-50%); z-index: 300; background: #18181b; color: #fff; font-size: .85rem; font-weight: 600; padding: 10px 18px; border-radius: 99px; opacity: 0; pointer-events: none; transition: opacity .2s; max-width: 90vw; text-align: center; }
.fs-toast.show { opacity: 1; }

@media (min-width: 900px) {
    .fs-intro h1 { font-size: 2rem; }
    .fs-layout { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 24px; align-items: start; }
    .fs-stage { top: calc(var(--fs-top, 70px) + 8px); margin: 0; padding: 0; background: none; }
    .fs-photo { height: calc(100vh - var(--fs-top, 70px) - 150px); max-height: 780px; min-height: 420px; }
    .fs-float { font-size: 13px; min-height: 40px; }
    .fs-chips { flex-wrap: wrap; }
    .fs-models { scrollbar-width: thin; }
    .fs-models::-webkit-scrollbar { display: block; height: 6px; }
    .fs-models::-webkit-scrollbar-thumb { background: #d4d4d8; border-radius: 3px; }
    .fs-model { flex-basis: 96px; }
    .fs-model img { height: 110px; }
    .fs-swatches { display: flex; flex-wrap: wrap; }
    .fs-sw { width: 34px; height: 34px; }
    .fs-recs { display: grid; grid-template-columns: 1fr 1fr; overflow: visible; }
    .fs-rec { max-width: none; }
    .fs-sheet { left: auto; right: 24px; bottom: 24px; width: 440px; border-radius: 18px; }
    .fs-toast { bottom: 40px; }
}

/* Short landscape phones: don't pin a photo that would fill the screen. */
@media (max-width: 899px) and (max-height: 520px) {
    .fs-stage { position: static; }
    .fs-photo { height: 80vh; }
}
