/* 임시 정체성: 검은 잉크 + 경고 노랑(회수 표지). 이름, 첫 화면 사용자 선택 뒤 바꿈 */
:root {
  --bg: #fbfbf9;
  --ink: #111214;
  --sub: #5d6168;
  --line: #e1e1dc;
  --card: #ffffff;
  --sig: #ffd21f;      /* 경고 노랑: 넓게 칠하지 않음 */
  --sig-ink: #6b5200;
  --hit: #c4161c;
  --ok: #1d7a46;
  --chk: #b86a00;
  --font: "Pretendard", "Apple SD Gothic Neo", "Malgun Gothic", system-ui, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.5 var(--font); }
a { color: inherit; }
svg { width: 1.25em; height: 1.25em; flex: none; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.mut { color: var(--sub); font-size: .86em; }
button { font: inherit; color: inherit; cursor: pointer; }

.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; background: var(--ink); color: #fff; }
.brand { display: flex; align-items: center; gap: 8px; text-decoration: none; font-weight: 800; font-size: 19px; letter-spacing: -.01em; }
.brand svg { color: var(--sig); width: 24px; height: 24px; }
.stamp { font-size: 13px; color: #c9cbd0; font-variant-numeric: tabular-nums; }

main { max-width: 1120px; margin: 0 auto; padding: 16px; display: grid; gap: 20px; }
h2 { font-size: 17px; margin: 0 0 10px; display: flex; align-items: center; gap: 8px; }
.tip { display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; border: 1.5px solid var(--sub); color: var(--sub); font-size: 12px; cursor: help; }

/* 확인 칸 */
.check { background: var(--ink); color: #fff; margin: -16px -16px 0; padding: 18px 16px 20px; }
#q { display: flex; gap: 8px; max-width: 720px; }
#qi { flex: 1; min-width: 0; height: 52px; padding: 0 14px; border: 3px solid var(--sig); border-radius: 6px; font: 600 17px var(--font); background: #fff; color: var(--ink); }
#qi:focus { outline: 3px solid #fff; outline-offset: 2px; }
.ic { display: inline-grid; place-items: center; width: 52px; height: 52px; border: 0; border-radius: 6px; background: #2a2c31; color: #fff; }
.ic.go { background: var(--sig); color: var(--ink); }
.ic svg { width: 26px; height: 26px; }
#res { max-width: 720px; margin-top: 12px; }
#res:empty { display: none; }
#res .ok, #res .warn { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; padding: 12px 14px; border-radius: 6px; }
#res .ok { background: #e7f4ec; color: var(--ok); }
#res .warn { background: var(--sig); color: var(--ink); }
#res .warn .mut { color: var(--sig-ink); }
#res strong { font-size: 18px; }
#res .list { background: var(--card); color: var(--ink); border-radius: 6px; margin-top: 8px; }
#res .wait, #res .err, #res .hint { margin: 8px 0 0; color: #d8dade; font-size: 14px; }
.pill { margin-left: auto; padding: 8px 12px; border: 2px solid currentColor; border-radius: 6px; background: transparent; font-weight: 700; }

/* 목록 줄 */
.list { list-style: none; margin: 0; padding: 0; }
.row { position: relative; border-bottom: 1px solid var(--line); }
.row > a { display: grid; grid-template-columns: auto 1fr auto; grid-template-areas: "b nm d" "b mk mk" "b why why"; gap: 0 10px; padding: 11px 6px; text-decoration: none; }
.row .add { position: absolute; right: 4px; bottom: 6px; width: 36px; height: 36px; background: var(--ink); }
.row .add.done { background: var(--ok); }
.row .add svg { width: 18px; height: 18px; }
.row:has(.add) > a { padding-right: 46px; }
.b { grid-area: b; align-self: start; margin-top: 2px; padding: 1px 6px; border-radius: 4px; font-size: 12px; font-weight: 800; white-space: nowrap; }
.b-recall, .b-stop { background: var(--hit); color: #fff; }
.b-unfit { background: var(--sig); color: var(--ink); }
.b-overseas { background: var(--ink); color: #fff; }
.nm { grid-area: nm; font-weight: 700; overflow-wrap: anywhere; }
.row .mk { grid-area: mk; font-size: 13px; color: var(--sub); }
.why { grid-area: why; font-size: 13px; color: var(--sub); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.row time { grid-area: d; font-size: 12px; color: var(--sub); white-space: nowrap; font-variant-numeric: tabular-nums; }
.row.new .nm::after { content: "새"; margin-left: 6px; padding: 0 4px; border-radius: 3px; background: var(--sig); color: var(--ink); font-size: 11px; vertical-align: 2px; }
.empty { padding: 14px 6px; color: var(--sub); list-style: none; display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.empty svg { width: 1em; height: 1em; }

/* 내 목록 */
.mine ul { list-style: none; margin: 0; padding: 0; background: var(--card); border: 1px solid var(--line); border-radius: 6px; }
.mi { display: grid; grid-template-columns: 14px 1fr auto auto; grid-template-areas: "dot nm exp del" "dot st exp del"; align-items: center; gap: 0 10px; padding: 10px 8px 10px 12px; border-bottom: 1px solid var(--line); }
.mi:last-child { border-bottom: 0; }
.mi .dot { grid-area: dot; width: 12px; height: 12px; border-radius: 50%; background: var(--ok); }
.mi .nm { grid-area: nm; }
.mi .stt { grid-area: st; font-size: 13px; color: var(--sub); }
.mi.st-hit .dot { background: var(--hit); box-shadow: 0 0 0 3px #f6c9cb; }
.mi.st-hit .stt { color: var(--hit); font-weight: 700; }
.mi.st-check .dot { background: var(--chk); }
.mi.st-check .stt { color: var(--chk); font-weight: 700; }
.mi.st-other .dot { background: #9a9ea6; }
.mi .exp { grid-area: exp; }
.mi .exp input { font: 13px var(--font); padding: 4px; border: 1px solid var(--line); border-radius: 4px; max-width: 132px; color: var(--sub); background: #fff; }
.mi .del { grid-area: del; width: 34px; height: 34px; background: transparent; color: var(--sub); }
.mi .del svg { width: 18px; height: 18px; }

/* 필터 */
.newc { padding: 0 6px; border-radius: 4px; background: var(--sig); font-size: 13px; }
.flt { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 8px; scrollbar-width: none; }
.flt button { display: flex; align-items: center; gap: 5px; padding: 7px 10px; border: 1.5px solid var(--line); border-radius: 6px; background: var(--card); white-space: nowrap; font-weight: 600; font-size: 14px; }
.flt button small { color: var(--sub); font-variant-numeric: tabular-nums; }
.flt button[aria-selected="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }
.flt button[aria-selected="true"] small { color: #c9cbd0; }
.flt svg { width: 18px; height: 18px; }
.more { width: 100%; margin-top: 10px; padding: 12px; border: 1.5px solid var(--line); border-radius: 6px; background: var(--card); font-weight: 700; }
.pulse { margin: 0; padding: 10px 12px; border-left: 4px solid var(--sig); background: var(--card); font-size: 14px; color: var(--sub); }
.pulse b { color: var(--ink); }

/* 회수 한 건 */
.rec { background: var(--card); border: 1px solid var(--line); border-radius: 6px; padding: 18px 16px; max-width: 760px; }
.crumb { display: flex; align-items: center; gap: 8px; margin: 0 0 6px; font-size: 14px; color: var(--sub); }
.crumb .b { margin: 0; }
.rec h1 { margin: 0; font-size: 24px; line-height: 1.3; overflow-wrap: anywhere; }
.rec > .mk { margin: 4px 0 0; color: var(--sub); }
.rec > .why { display: block; margin: 14px 0 0; padding: 10px 12px; border-left: 4px solid var(--hit); background: #fdf1f1; color: var(--ink); font-size: 15px; -webkit-line-clamp: unset; }
.facts { display: grid; gap: 0; margin: 16px 0 0; }
.facts div { display: grid; grid-template-columns: 8.5em 1fr; gap: 8px; padding: 8px 0; border-top: 1px solid var(--line); }
.facts dt { color: var(--sub); font-size: 14px; }
.facts dt[title] { text-decoration: underline dotted; cursor: help; }
.facts dd { margin: 0; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.act { margin: 16px 0 0; }
.act .add { display: inline-flex; align-items: center; gap: 6px; padding: 10px 14px; border: 0; border-radius: 6px; background: var(--ink); color: #fff; font-weight: 700; }
.act .add.done { background: var(--ok); }
.srcline { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin: 16px 0 0; font-size: 14px; }
.alt { max-width: 760px; }
.alt h2 { font-size: 15px; color: var(--sub); }
.shop { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border: 1.5px solid var(--line); border-radius: 6px; background: var(--card); text-decoration: none; font-weight: 700; }
.shop small { margin-left: auto; color: var(--sub); font-weight: 500; }

.doc { max-width: 720px; background: var(--card); border: 1px solid var(--line); border-radius: 6px; padding: 18px 16px; }
.doc h1 { margin-top: 0; font-size: 22px; }
.doc h2 { margin-top: 18px; font-size: 16px; }
.doc p { color: #2b2d31; }

/* 바닥 */
.foot { max-width: 1120px; margin: 24px auto 0; padding: 18px 16px 32px; border-top: 1px solid var(--line); display: grid; gap: 14px; font-size: 14px; }
.foot h2 { font-size: 14px; margin-bottom: 6px; }
.foot section { min-width: 0; }
.src { margin: 0; padding-left: 18px; }
.feeds { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; }
.feeds a { display: inline-flex; align-items: center; gap: 4px; padding: 5px 8px; border: 1px solid var(--line); border-radius: 6px; text-decoration: none; background: var(--card); }
.feeds svg { width: 15px; height: 15px; color: #e07b00; }
.fb { display: flex; flex-wrap: wrap; gap: 6px; }
.fb textarea { flex: 1 1 240px; min-width: 0; padding: 8px; border: 1px solid var(--line); border-radius: 6px; font: 14px var(--font); resize: vertical; }
.fb button { padding: 8px 14px; border: 0; border-radius: 6px; background: var(--ink); color: #fff; font-weight: 700; }
.fb output { flex-basis: 100%; color: var(--sub); font-size: 13px; }
.legal { margin: 0; display: flex; gap: 12px; }

@media (min-width: 1000px) {
  main { grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); align-items: start; column-gap: 32px; padding-top: 0; }
  .check { grid-column: 1 / -1; margin: 0 -16px; padding: 28px max(16px, calc((100vw - 1120px) / 2 + 16px)); }
  .check #q, .check #res { max-width: 760px; }
  .news { grid-column: 2; grid-row: 2 / span 3; }
  .mine, .pulse { grid-column: 1; }
  .rec, .alt, .doc { grid-column: 1 / -1; }
  .foot { grid-template-columns: 1.4fr 1fr 1.2fr; }
  .legal { grid-column: 1 / -1; }
}
