/* AI 패션왕 v1 · visual styles · photo-first, system fonts only */
:root {
  --bg: #f7f7f5; --surface: #fff; --ink: #202120; --muted: #626660; --line: #dedfda;
  --keep: #ae3056; --drop: #47515c; --accent: #202120; --ok: #216342; --warn: #a33030;
  --radius: 14px; --shadow: 0 4px 18px rgba(25,30,25,.06);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--ink); font: 15px/1.5 -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Malgun Gothic", sans-serif; -webkit-tap-highlight-color: transparent; }
button, input, select { font: inherit; color: inherit; }
button, a, input, select { touch-action: manipulation; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible { outline: 3px solid #245d9c; outline-offset: 3px; }
input::placeholder { color: #70756f; opacity: 1; }
.app { max-width: 520px; margin: 0 auto; min-height: 100%; padding: calc(12px + env(safe-area-inset-top)) 16px calc(16px + env(safe-area-inset-bottom)); }
.screen { display: flex; flex-direction: column; gap: 12px; }
.center { text-align: center; align-items: center; justify-content: center; min-height: 80vh; min-height: 80svh; }
.brand { font-size: 28px; letter-spacing: -.02em; margin: 8px 0; }
.brand.small { font-size: 18px; margin: 0; }
.lead { font-size: 17px; margin: 0; }
.sub { color: var(--muted); margin: -6px 0 4px; }
h2 { font-size: 20px; margin: 4px 0; }
small { color: var(--muted); }

.btn { border: 1px solid var(--line); background: var(--surface); border-radius: 10px; min-width: 44px; min-height: 44px; padding: 9px 14px; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; gap: 6px; justify-content: center; }
.btn:disabled { opacity: .5; cursor: default; }
.btn.primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn.ghost { background: transparent; }
.btn.big { padding: 14px 20px; font-size: 16px; width: 100%; }
.btn.on { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn:not(:disabled):active, .want-btn:active, .mood-card:active { filter: brightness(.94); }

.bar { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.progress { flex: 1; text-align: center; font-size: 14px; }
.pbar { height: 4px; background: var(--line); border-radius: 4px; margin-top: 4px; overflow: hidden; }
.pbar i { display: block; height: 100%; background: var(--accent); }

/* intro */
.serin-intro { display: flex; gap: 12px; align-items: center; background: var(--surface); border-radius: var(--radius); border: 1px solid var(--line); padding: 12px; }
.serin-intro img { width: 72px; height: 108px; object-fit: cover; border-radius: 10px; }
.serin-intro p { margin: 0; }
.form { display: flex; flex-direction: column; gap: 14px; }
.form label { display: flex; flex-direction: column; gap: 6px; font-weight: 600; }
.form input[name=nickname] { font-size: 16px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; }
fieldset { border: 0; padding: 0; margin: 0; }
legend { font-weight: 600; margin-bottom: 6px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip input { position: absolute; opacity: 0; }
.chip span { display: inline-flex; align-items: center; min-height: 44px; padding: 8px 14px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); font-weight: 400; }
.chip input:checked + span { background: var(--accent); color: #fff; border-color: var(--accent); }
.chip input:focus-visible + span { outline: 3px solid #245d9c; outline-offset: 3px; }
.notice { font-size: 12px; color: var(--muted); margin: 0; }

/* moods */
.mood-list { display: flex; flex-direction: column; gap: 14px; }
.mood-card { display: flex; flex-direction: column; gap: 8px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 8px; text-align: left; cursor: pointer; box-shadow: 0 2px 8px rgba(25,30,25,.025); }
.mood-card[data-done] { border-color: #b8c6bb; }
.mood-card[data-done] .mood-imgs { opacity: .75; }
.mood-imgs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.mood-imgs img { width: 100%; aspect-ratio: 2/3; object-fit: cover; border-radius: 10px; background: #ddd; }
.mood-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; padding: 3px 4px 4px; }
.mood-meta b { font-size: 16px; }
.mood-meta span { color: var(--muted); font-size: 13px; }
.badge { margin-left: auto; font-size: 12px; padding: 3px 8px; border-radius: 999px; background: var(--bg); }
.badge.ok { color: var(--ok); background: #e9f4ec; }
.badge.no { color: var(--warn); background: #f9ebea; }

/* card */
.meaning { margin: 0; font-size: 13px; color: var(--muted); text-align: center; }
.abandon { display: flex; flex-direction: column; gap: 6px; background: #f2f3ef; border: 1px solid var(--line); border-radius: 12px; padding: 10px; font-size: 14px; }
.card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; touch-action: pan-y; user-select: none; transition: transform .2s ease; }
.card.dragging { transition: none; }
.photo { position: relative; aspect-ratio: 2/3; margin: 0 auto; background: #e9e8e5; }
.photo img { width: 100%; height: 100%; object-fit: contain; display: block; pointer-events: none; }
.photo-label { position: absolute; left: 8px; right: 8px; bottom: 8px; font-size: 11px; padding: 4px 8px; border-radius: 8px; background: rgba(20,24,20,.8); color: #fff; }
.photo-label.factory { background: rgba(255,255,255,.95); color: var(--ink); }
.photo-nav { position: absolute; top: 45%; width: 44px; height: 44px; border-radius: 50%; border: 0; background: rgba(255,255,255,.85); font-size: 24px; line-height: 1; cursor: pointer; }
.photo-nav.prev { left: 8px; } .photo-nav.next { right: 8px; }
.stamp { position: absolute; top: 18px; z-index: 1; padding: 6px 14px; border: 3px solid currentColor; border-radius: 6px; background: rgba(255,255,255,.96); box-shadow: 0 3px 12px rgba(0,0,0,.16); font-weight: 800; font-size: 25px; pointer-events: none; opacity: 0; transition: opacity .1s; }
.stamp.keep { left: 16px; color: var(--keep); transform: rotate(-12deg); }
.stamp.drop { right: 16px; color: var(--drop); transform: rotate(12deg); }
.hint-keep .stamp.keep, .hint-drop .stamp.drop { opacity: 1; }
.thumbs { display: flex; gap: 6px; padding: 6px 10px; overflow-x: auto; }
.thumb { flex: 0 0 auto; width: 44px; height: 52px; padding: 0; border: 2px solid transparent; border-radius: 8px; overflow: hidden; background: #eee; cursor: pointer; }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb.factory img { object-fit: contain; background: #fff; }
.thumb.on { border-color: var(--accent); }
.info { padding: 2px 10px 10px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.tags { display: inline-flex; flex-wrap: wrap; gap: 4px; }
.tags i { font-style: normal; font-size: 12px; background: var(--bg); padding: 2px 8px; border-radius: 999px; margin-right: 0; }
.actions { display: flex; justify-content: center; align-items: center; gap: 24px; padding-top: 4px; }
.btn.round { width: 64px; height: 64px; border-radius: 50%; flex-direction: column; gap: 0; font-size: 24px; padding: 0; box-shadow: none; line-height: 1.15; }
.btn.round small { font-size: 11px; color: inherit; font-weight: 600; margin-top: 3px; }
.btn.round.keep { color: #fff; background: var(--keep); border-color: var(--keep); }
.btn.round.drop { color: var(--drop); background: #edf0f2; border-color: #c4cbd1; }
.btn.round.undo { width: 48px; height: 48px; font-size: 18px; }
.keys { text-align: center; font-size: 12px; color: var(--muted); margin: 0; }
kbd { border: 1px solid var(--line); border-radius: 4px; padding: 0 4px; background: var(--surface); }
@media (hover: none) { .keys { display: none; } }

/* rate sheet */
.sheet-wrap { position: fixed; inset: 0; background: rgba(20,24,20,.48); display: flex; align-items: flex-end; justify-content: center; z-index: 10; }
.sheet { background: var(--surface); width: 100%; max-width: 520px; max-height: 92vh; max-height: 92dvh; overflow-y: auto; overscroll-behavior: contain; border-radius: 18px 18px 0 0; box-shadow: 0 -8px 32px rgba(0,0,0,.1); padding: 16px 16px calc(16px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 10px; }
.sheet > * { flex-shrink: 0; }
.sheet-head { display: flex; gap: 10px; align-items: center; }
.sheet-head img { width: 44px; height: 66px; object-fit: cover; border-radius: 8px; }
.q { font-weight: 700; margin: 4px 0 0; }
.q small { display: block; font-size: 12px; font-weight: 400; margin-top: 2px; }
.want { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.want-btn { min-height: 52px; padding: 12px 0; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); font-size: 18px; font-weight: 700; cursor: pointer; }
.want-btn.on { background: var(--keep); color: #fff; border-color: var(--keep); }
.want-labels { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; font-size: 11px; color: var(--muted); }
.want-labels span:nth-child(2) { text-align: center; }
.want-labels span:last-child { text-align: right; }
.price-row { display: flex; align-items: center; gap: 8px; }
.price-row > span, .price-row .btn { flex-shrink: 0; }
.price-row .btn { padding-inline: 10px; font-size: 13px; }
.price-row input { flex: 1; min-width: 0; font-size: 20px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; }
.price-preview { margin: 0; font-size: 13px; color: var(--muted); min-height: 1.2em; }
.sheet-actions { display: flex; justify-content: space-between; gap: 10px; }
.sheet-actions .primary { flex: 1; }

/* rack / done */
.big-num { font-size: 64px; letter-spacing: -.05em; font-variant-numeric: tabular-nums; font-weight: 800; margin: 0; }
.big-num small { font-size: 15px; letter-spacing: 0; margin-left: 8px; font-weight: 500; }
.rack-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.rack-list li { display: flex; gap: 10px; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 10px; }
.rack-list img { width: 64px; height: 96px; flex-shrink: 0; object-fit: cover; border-radius: 8px; }
.rack-list div { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; font-size: 13px; overflow-wrap: anywhere; }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(20px); background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 999px; font-size: 14px; opacity: 0; transition: .2s; pointer-events: none; z-index: 20; }
.toast.show { opacity: 1; transform: translateX(-50%); }

/* Reserve controls first; let the complete product photo use the remaining viewport. */
.cards { height: calc(100vh - 28px - env(safe-area-inset-top) - env(safe-area-inset-bottom)); height: calc(100svh - 28px - env(safe-area-inset-top) - env(safe-area-inset-bottom)); min-height: 540px; gap: 8px; }
.cards > :not(.card) { flex-shrink: 0; }
.cards .card { flex: 1 1 0; min-height: 0; display: flex; flex-direction: column; }
.cards .photo { flex: 1 1 0; width: 100%; min-height: 0; aspect-ratio: auto; }
.cards .photo img { position: absolute; inset: 0; }
.cards .thumbs, .cards .info { flex-shrink: 0; }
.cards .bar .btn { padding-inline: 12px; }
.cards .bar .btn:first-child { min-width: 44px; }
.cards .progress { font-size: 13px; }
.cards .meaning { font-size: 12px; line-height: 1.5; }
.cards .abandon { gap: 4px; padding: 8px 10px; font-size: 12px; }
.cards .abandon .btn { font-size: 12px; padding: 8px; }
.center p:not(.big-num) { line-height: 1.8; }
.center > .btn { min-width: 180px; }
.rack-list b { font-size: 15px; }
.rack-list .btn { flex-shrink: 0; }
.toast { max-width: calc(100% - 32px); width: max-content; text-align: center; bottom: calc(24px + env(safe-area-inset-bottom)); }
@media (max-width: 400px) {
  .app { padding-inline: 12px; }
  .screen.moods > h2 { font-size: 21px; letter-spacing: -.03em; }
  .rack-list img { width: 56px; height: 84px; }
  .rack-list .btn { padding-inline: 10px; }
}
@media (min-width: 768px) {
  .app { max-width: 560px; padding-inline: 24px; }
  .cards { max-height: 940px; }
  .sheet-wrap { align-items: center; padding: 24px; }
  .sheet { border-radius: 18px; padding: 24px; }
}
@media (hover: hover) {
  .btn:not(:disabled):hover { border-color: var(--ink); }
  .mood-card:hover { border-color: #9a9f97; }
}
@media (prefers-reduced-motion: reduce) {
  .card, .stamp, .toast { transition: none; }
}

/* profile form (2026-10-08) */
fieldset.missing legend { color: var(--warn); }
.form-err { color: var(--warn); font-size: 13px; margin: 0; min-height: 1em; }
.form legend small { font-weight: 400; }
.kfocus { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 12px; }
.sheet .keys { margin-top: 2px; }
