/* Home AI · 인테리어 — 따뜻한 중성색 · 휴대폰 먼저 */
:root {
  --bg: #f6f3ee; --card: #fffdf9; --ink: #2b2723; --muted: #8a8178; --line: #e7e0d6;
  --accent: #8c6a43; --accent-ink: #fff; --soft: #f0e9de; --err: #b3412e; --ok: #4f7a52;
  --radius: 14px; --shadow: 0 1px 2px rgba(60, 45, 30, .06), 0 6px 20px rgba(60, 45, 30, .05);
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #1b1916; --card: #24211d; --ink: #ece6dc; --muted: #a39a8e; --line: #38332c;
          --accent: #c49a68; --accent-ink: #1b1916; --soft: #2e2a24; --err: #e07a64; --ok: #8fbf8f; }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.6 -apple-system, BlinkMacSystemFont, "Pretendard", "Apple SD Gothic Neo", "Malgun Gothic", sans-serif; }
a { color: var(--accent); }
h2 { font-size: 18px; margin: 0 0 6px; }
h2 small { font-size: 13px; color: var(--muted); font-weight: 400; }
h3 { font-size: 15px; margin: 18px 0 6px; }
p { margin: 6px 0; }
ul, ol { margin: 4px 0; padding-left: 20px; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.err { color: var(--err); min-height: 1em; }
.nowrap { white-space: nowrap; }

/* 머리 */
.top { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between; gap: 8px;
       padding: 10px 16px; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.brand { font-weight: 700; font-size: 17px; color: var(--ink); text-decoration: none; letter-spacing: .2px; }
.brand small { font-weight: 400; color: var(--muted); font-size: 13px; margin-left: 2px; }
.logo { color: var(--accent); }
.top nav { display: flex; align-items: center; gap: 4px; }
.top nav a { padding: 6px 10px; border-radius: 999px; text-decoration: none; color: var(--muted); font-size: 14px; }
.top nav a.on { background: var(--soft); color: var(--ink); font-weight: 600; }
.inline { display: inline; margin: 0; }
.link { background: none; border: 0; color: var(--muted); font: inherit; font-size: 13px; cursor: pointer; padding: 6px; }

main#app { max-width: 920px; margin: 0 auto; padding: 14px 16px 60px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; margin-bottom: 14px; }

/* 로그인 */
.login { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.login-card { width: 100%; max-width: 360px; display: grid; gap: 12px; }
.login-card .brand { font-size: 22px; margin-bottom: 4px; }

/* 입력 */
label { display: block; font-size: 13px; color: var(--muted); }
input:not([type=radio]):not([type=file]), textarea, select {
  width: 100%; margin-top: 4px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--bg); color: var(--ink); font: inherit; font-size: 15px; }
textarea { resize: vertical; margin-top: 10px; }
input:focus, textarea:focus, select:focus { outline: 2px solid color-mix(in srgb, var(--accent) 40%, transparent); border-color: var(--accent); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 10px; }
@media (max-width: 600px) { .grid2 { grid-template-columns: 1fr; } }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 10px 16px; border-radius: 10px;
       border: 1px solid var(--line); background: var(--card); color: var(--ink); font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.ghost { background: transparent; }
.btn.danger { color: var(--err); border-color: color-mix(in srgb, var(--err) 40%, transparent); background: transparent; }
.btn.small { padding: 7px 12px; font-size: 13px; }
.btn.big { width: 100%; padding: 14px; font-size: 16px; margin-top: 12px; }
.btn:disabled { opacity: .45; cursor: default; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.chip { padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); background: transparent; color: var(--ink); font: inherit; font-size: 13.5px; cursor: pointer; }
.chip.on { background: var(--ink); color: var(--bg); border-color: var(--ink); }

.drop { display: grid; place-items: center; min-height: 180px; margin-top: 10px; border: 2px dashed var(--line); border-radius: 12px; cursor: pointer; overflow: hidden; background: var(--bg); }
.drop-msg { color: var(--muted); font-size: 15px; }
.drop img { width: 100%; max-height: 420px; object-fit: contain; display: block; }

.refs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 10px 0; }
.refs:empty { display: none; }
.ref { position: relative; aspect-ratio: 1; border-radius: 10px; overflow: hidden; background: var(--bg); }
.ref img { width: 100%; height: 100%; object-fit: cover; }
.ref button { position: absolute; top: 4px; right: 4px; width: 26px; height: 26px; border-radius: 50%; border: 0; background: rgba(0,0,0,.55); color: #fff; cursor: pointer; }

.quality { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; }
.q { display: grid; grid-template-columns: auto 1fr; column-gap: 10px; row-gap: 2px; align-items: center; padding: 12px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; color: var(--ink); }
.q:has(input:checked) { border-color: var(--accent); background: var(--soft); }
.q input { margin: 0; grid-row: span 2; accent-color: var(--accent); width: 18px; height: 18px; }
.q span { color: var(--muted); font-size: 13px; }

/* 시안 */
.job-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; margin-bottom: 10px; }
.concept { color: var(--muted); }
.compare { position: relative; width: 100%; border-radius: 12px; overflow: hidden; background: #000; user-select: none; touch-action: pan-y; cursor: ew-resize; }
.compare.solo { cursor: default; }
.compare img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; pointer-events: none; }
.compare .before { position: absolute; inset: 0; }
.handle { position: absolute; top: 0; bottom: 0; width: 2px; background: #fff; transform: translateX(-1px); box-shadow: 0 0 0 1px rgba(0,0,0,.15); pointer-events: none; }
.handle span { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); background: #fff; color: #333; font-size: 11px; padding: 6px 8px; border-radius: 999px; white-space: nowrap; box-shadow: 0 2px 8px rgba(0,0,0,.25); }
.tag { position: absolute; top: 10px; padding: 3px 9px; border-radius: 999px; background: rgba(0,0,0,.5); color: #fff; font-size: 12px; pointer-events: none; }
.tag.l { left: 10px; } .tag.r { right: 10px; }
.row { display: flex; justify-content: space-between; gap: 8px; margin-top: 6px; }

.prog { margin-top: 12px; }
.steps { display: flex; gap: 8px; flex-wrap: wrap; font-size: 13.5px; }
.steps span { color: var(--muted); }
.steps .now { color: var(--accent); font-weight: 700; }
.steps .done { color: var(--ok); }
.bar { height: 4px; border-radius: 4px; background: var(--soft); overflow: hidden; margin: 8px 0 4px; }
.bar i { display: block; width: 35%; height: 100%; background: var(--accent); animation: slide 1.4s ease-in-out infinite; }
@keyframes slide { 0% { transform: translateX(-100%); } 100% { transform: translateX(300%); } }

.thumbs { display: flex; gap: 8px; overflow-x: auto; margin-top: 10px; padding-bottom: 4px; }
.thumbs button, .thumbs a { position: relative; flex: 0 0 auto; width: 88px; height: 66px; padding: 0; border: 2px solid transparent; border-radius: 8px; overflow: hidden; background: var(--bg); cursor: pointer; }
.thumbs .on { border-color: var(--accent); }
.thumbs img { width: 100%; height: 100%; object-fit: cover; }
.thumbs span { position: absolute; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,.5); color: #fff; font-size: 11px; text-align: center; }

.redo { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.redo-btns { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.redo-btns select { width: auto; flex: 1 1 200px; margin-top: 0; }
.hint { list-style: none; padding: 0; margin: 8px 0 0; }

/* 안내서 */
.guide h3 { padding-top: 12px; border-top: 1px solid var(--line); }
.guide h2 + .grid2 h3, .guide h2 + h3 { border-top: 0; padding-top: 0; }
.layout { padding-left: 22px; }
.layout li { margin-bottom: 8px; }
.layout p { margin: 2px 0 0; color: var(--muted); }
.palette { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; }
.sw i { display: block; height: 56px; border-radius: 10px; border: 1px solid var(--line); margin-bottom: 4px; }
.sw b { display: block; font-size: 13.5px; }
.sw span { font-size: 12px; color: var(--muted); font-family: ui-monospace, Consolas, monospace; }
.sw p { font-size: 12.5px; color: var(--muted); margin: 2px 0 0; }
.tbl { overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th, td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { background: var(--soft); font-weight: 600; white-space: nowrap; }
tbody tr:nth-child(even) td { background: color-mix(in srgb, var(--soft) 45%, transparent); }
tbody tr:last-child td { border-bottom: 0; }
.pri { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 12px; white-space: nowrap; }
.pri.p0 { background: var(--accent); color: var(--accent-ink); }
.pri.p1 { background: var(--soft); color: var(--ink); }
.pri.p2, .pri.p3 { color: var(--muted); border: 1px solid var(--line); }

/* 목록 */
.list { display: grid; gap: 10px; }
.item { display: flex; gap: 12px; align-items: center; padding: 8px; border-radius: 12px; text-decoration: none; color: var(--ink); border: 1px solid var(--line); }
.item:hover { background: var(--soft); }
.item img { width: 110px; height: 80px; object-fit: cover; border-radius: 8px; flex: 0 0 auto; background: var(--bg); }
.item p { margin: 2px 0; font-size: 13.5px; }

@media (max-width: 600px) {
  .top nav a { padding: 6px 8px; font-size: 13px; }
  .card { padding: 14px; }
  .quality { grid-template-columns: 1fr; }
  .brand small { display: none; }
  /* 가구 표 → 휴대폰은 품목마다 카드 */
  .tbl { border: 0; overflow: visible; }
  .tbl thead { display: none; }
  .tbl table, .tbl tbody, .tbl tr, .tbl td { display: block; }
  .tbl tr { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; margin-bottom: 8px; background: var(--bg); }
  .tbl td { border: 0; padding: 2px 0; background: none !important; }
  .tbl td.nm { font-size: 15px; display: inline; margin-left: 6px; }
  .tbl td:first-child { display: inline; }
  .tbl td[data-k]::before { content: attr(data-k); display: inline-block; min-width: 84px; color: var(--muted); font-size: 12px; }
  .tbl td.nowrap { white-space: normal; }
}
