/* 공고 맞춤 이력서: 입력 → 결과(요건 매칭, 요약, 경력 문장, 부족한 점, 자소서) */
:root {
  --bg: #EEF1F4; --surface: #FFFFFF; --ink: #15212C; --muted: #5B6875; --line: #D5DCE3;
  --accent: #2D5BE3; --accent-soft: #E3EAFD; --ok: #17905F; --ok-soft: #DDF2E8; --warn: #B4610E; --warn-soft: #FBEBD9;
  --bad: #C2372B; --bad-soft: #FBE3E0; --chip: #EEF2F6;
  --r: 14px; --body: "Noto Sans KR", system-ui, -apple-system, sans-serif;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --bg: #0F151B; --surface: #18212A; --ink: #E7EDF3; --muted: #93A1AE; --line: #2A3540;
  --accent: #7C9BFF; --accent-soft: #1F2A48; --ok: #3FCB8F; --ok-soft: #15332A; --warn: #E9A25A; --warn-soft: #3A2A17;
  --bad: #FF7B6E; --bad-soft: #3B1D1A; --chip: #222D37; color-scheme: dark; } }
:root[data-theme="dark"] {
  --bg: #0F151B; --surface: #18212A; --ink: #E7EDF3; --muted: #93A1AE; --line: #2A3540;
  --accent: #7C9BFF; --accent-soft: #1F2A48; --ok: #3FCB8F; --ok-soft: #15332A; --warn: #E9A25A; --warn-soft: #3A2A17;
  --bad: #FF7B6E; --bad-soft: #3B1D1A; --chip: #222D37; color-scheme: dark; }
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--body); font-size: 15px; line-height: 1.6; -webkit-text-size-adjust: 100%; }
.wrap { max-width: 920px; margin-inline: auto; padding: 20px max(16px, env(safe-area-inset-left, 0px)) 80px; display: flex; flex-direction: column; gap: 16px; }
h1 { margin: 0; font-size: clamp(26px, 5vw, 34px); line-height: 1.2; }
h2 { margin: 0 0 10px; font-size: 18px; }
h3 { margin: 0; font-size: 16px; }
p { margin: 0; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
[hidden] { display: none !important; }
.head { display: flex; flex-direction: column; gap: 8px; }
.head p b { color: var(--ink); }
.hub-back { align-self: flex-start; color: var(--muted); text-decoration: none; font-size: 13px; font-weight: 700; padding: 3px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.notice { padding: 12px 14px; border-radius: 12px; background: var(--warn-soft); color: var(--ink); font-size: 14px; }
.notice a { color: var(--accent); font-weight: 700; }
.tabs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; position: sticky; top: 0; z-index: 5; background: var(--bg); padding: 6px 0; }
.tab { all: unset; box-sizing: border-box; cursor: pointer; text-align: center; padding: 10px 4px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); font-weight: 700; font-size: 14px; }
.tab[aria-selected="true"] { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.tab:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.panel { display: flex; flex-direction: column; gap: 14px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.row2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); gap: 10px; }
.fld { display: flex; flex-direction: column; gap: 4px; font-size: 13px; font-weight: 700; color: var(--muted); min-width: 0; }
.fld em { font-style: normal; font-weight: 400; }
input, textarea, select { font: inherit; font-size: 15px; color: var(--ink); background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 9px 11px; width: 100%; min-width: 0; }
textarea { resize: vertical; line-height: 1.6; }
button { font: inherit; }
.primary { cursor: pointer; border: 0; border-radius: 12px; background: var(--accent); color: #fff; font-weight: 700; font-size: 15px; padding: 12px 18px; min-height: 46px; }
.primary:disabled { opacity: .5; cursor: default; }
.ghost { cursor: pointer; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--ink); font-weight: 700; font-size: 13px; padding: 8px 12px; min-height: 38px; align-self: flex-start; }
.ghost.danger { color: var(--bad); }
.ghost.sm { min-height: 32px; padding: 4px 10px; font-size: 12px; }
.qhead { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.qrow { display: grid; grid-template-columns: minmax(0, 1fr) 110px 40px; gap: 6px; align-items: start; }
.qrow textarea { min-height: 44px; }
.qrow .x { all: unset; cursor: pointer; width: 40px; height: 42px; border-radius: 10px; display: grid; place-items: center; color: var(--muted); border: 1px solid var(--line); box-sizing: border-box; }
.runbar, .savebar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.progress { position: relative; overflow: hidden; border-radius: 10px; background: var(--accent-soft); padding: 10px 14px; font-size: 14px; font-weight: 700; color: var(--accent); }
.progress i { position: absolute; inset: 0 auto 0 0; width: 30%; background: color-mix(in srgb, var(--accent) 18%, transparent); animation: slide 1.4s ease-in-out infinite; }
.progress span { position: relative; }
@keyframes slide { 0% { left: -30%; } 100% { left: 100%; } }
@media (prefers-reduced-motion: reduce) { .progress i { animation: none; } }

/* 결과 */
.res { display: flex; flex-direction: column; gap: 14px; margin-top: 4px; }
.res-top { display: flex; flex-direction: column; gap: 10px; }
.res-title { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; align-items: baseline; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }
.actions .primary { min-height: 40px; padding: 8px 14px; font-size: 14px; }
.warnbox { background: var(--warn-soft); border-radius: 10px; padding: 10px 12px; font-size: 13px; }
.req { display: flex; flex-direction: column; gap: 6px; }
.req-row { display: grid; grid-template-columns: 54px minmax(0, 1fr); gap: 8px; align-items: start; padding: 8px 0; border-top: 1px solid var(--line); }
.req-row:first-child { border-top: 0; }
.badge { display: inline-flex; justify-content: center; align-items: center; font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 999px; white-space: nowrap; }
.st-충족 { background: var(--ok-soft); color: var(--ok); }
.st-부분 { background: var(--warn-soft); color: var(--warn); }
.st-없음 { background: var(--bad-soft); color: var(--bad); }
.kind { font-size: 11px; color: var(--muted); font-weight: 700; margin-right: 6px; }
.chips { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.chip { font-size: 11px; background: var(--chip); color: var(--muted); border-radius: 6px; padding: 1px 6px; cursor: help; }
.note { font-size: 13px; color: var(--muted); }
.exp-h { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; margin-top: 6px; }
.exp-h .meta { font-size: 13px; color: var(--muted); }
.bl { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px; align-items: start; }
.bl input { font-size: 14px; }
.counter { font-size: 12px; color: var(--muted); text-align: right; font-variant-numeric: tabular-nums; }
.counter.over { color: var(--bad); font-weight: 700; }
.ans { display: flex; flex-direction: column; gap: 6px; padding-top: 10px; border-top: 1px solid var(--line); }
.ans:first-of-type { border-top: 0; padding-top: 0; }
.ans .q { font-weight: 700; font-size: 14px; }
.check { background: var(--warn-soft); border-radius: 8px; padding: 6px 10px; font-size: 13px; }
ul.plain { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 4px; }

/* 경력 사실 편집 */
.exp-card .exp-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr)); gap: 8px; }
.fact { display: grid; grid-template-columns: 34px minmax(0, 1fr) 36px; gap: 6px; align-items: start; padding: 8px 0; border-top: 1px dashed var(--line); }
.fact .fid { font-size: 11px; color: var(--muted); padding-top: 10px; font-variant-numeric: tabular-nums; }
.fact .ft { display: flex; flex-direction: column; gap: 4px; }
.fact textarea { min-height: 44px; font-size: 14px; }
.fact input { font-size: 13px; padding: 6px 9px; }
.fact .x, .skill .x { all: unset; cursor: pointer; width: 34px; height: 34px; border-radius: 8px; display: grid; place-items: center; color: var(--muted); border: 1px solid var(--line); box-sizing: border-box; }
.skill { display: grid; grid-template-columns: 120px minmax(0, 1fr) 34px; gap: 6px; align-items: center; }
.pf { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: 8px; }
.hist { display: flex; justify-content: space-between; gap: 8px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); flex-wrap: wrap; }
.hist:first-child { border-top: 0; }
.hist button.open { all: unset; cursor: pointer; display: flex; flex-direction: column; min-width: 0; flex: 1; }
.hist b { font-size: 15px; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(20px); background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 10px; font-size: 14px; font-weight: 700; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 20; max-width: calc(100% - 32px); }
.toast.on { opacity: 1; transform: translateX(-50%) translateY(0); }
@media (max-width: 520px) {
  .qrow { grid-template-columns: minmax(0, 1fr) 84px 40px; }
  .skill { grid-template-columns: 90px minmax(0, 1fr) 34px; }
  .card { padding: 14px 12px; }
}

/* API 없이 쓰기 (채팅 흐름) */
.chatflow { border: 1px solid var(--accent); border-radius: 12px; padding: 12px 14px; background: var(--accent-soft); display: flex; flex-direction: column; gap: 8px; }
.cf-head { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.pill { font-size: 12px; font-weight: 700; color: var(--ok); background: var(--ok-soft); border-radius: 999px; padding: 1px 10px; }
.cf-steps { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 10px; }
.cf-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.cf-steps textarea { background: var(--surface); }
.linkbtn { text-decoration: none; display: inline-flex; align-items: center; }

/* v1.2 지원 도구 */
.toolpick { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: 8px; }
.tp { all: unset; box-sizing: border-box; cursor: pointer; display: flex; flex-direction: column; gap: 4px; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg); min-width: 0; }
.tp b { font-size: 15px; }
.tp span { font-size: 12.5px; color: var(--muted); line-height: 1.5; }
.tp[aria-checked="true"] { border-color: var(--accent); background: var(--accent-soft); }
.tp[aria-checked="true"] b { color: var(--accent); }
.tp:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.v-근거있음, .lv-좋음 { background: var(--ok-soft); color: var(--ok); }
.v-과장, .lv-주의 { background: var(--warn-soft); color: var(--warn); }
.v-근거없음 { background: var(--bad-soft); color: var(--bad); }
.cat { background: var(--accent-soft); color: var(--accent); }
.counts { display: flex; gap: 6px; flex-wrap: wrap; }
.claim { display: grid; gap: 6px; padding: 10px 0; border-top: 1px solid var(--line); }
.claim:first-of-type { border-top: 0; }
.claim .orig { font-size: 14px; }
.claim .sugg { background: var(--ok-soft); border-radius: 8px; padding: 8px 10px; font-size: 14px; display: grid; gap: 6px; }
.iq { display: grid; gap: 6px; padding: 12px 0; border-top: 1px solid var(--line); }
.iq:first-of-type { border-top: 0; }
.iq .qh { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; font-weight: 700; }
.iq .ans-text { white-space: pre-wrap; font-size: 14px; background: var(--bg); border-radius: 8px; padding: 8px 10px; }
.kv { display: grid; grid-template-columns: minmax(80px, max-content) minmax(0, 1fr); gap: 6px 12px; font-size: 14px; }
.kv dt { color: var(--muted); font-weight: 700; }
.kv dd { margin: 0; overflow-wrap: anywhere; }
.src { font-size: 12px; color: var(--accent); overflow-wrap: anywhere; }
@media (max-width: 520px) { .tab { font-size: 12.5px; padding: 9px 2px; } }

/* v1.3 공고 적합도 비교 */
.fit-item { display: grid; gap: 8px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg); }
.fit-item .fit-h { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.fit-item textarea, .fit-item input { background: var(--surface); }
#tl-fit-list { display: grid; gap: 10px; }
.vd-strong { background: var(--ok-soft); color: var(--ok); }
.vd-good { background: var(--accent-soft); color: var(--accent); }
.vd-fix { background: var(--warn-soft); color: var(--warn); }
.vd-no { background: var(--bad-soft); color: var(--bad); }
.rank { display: grid; gap: 0; }
.rank-row { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 9px 0; border-top: 1px solid var(--line); }
.rank-row:first-child { border-top: 0; }
.rank-no { font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; text-align: center; }
.rank-name { min-width: 0; }
.rank-name b { display: block; overflow-wrap: anywhere; }
.bar { height: 6px; border-radius: 99px; background: var(--chip); overflow: hidden; margin-top: 4px; }
.bar i { display: block; height: 100%; border-radius: 99px; background: var(--accent); }
.score { font-weight: 700; font-variant-numeric: tabular-nums; font-size: 18px; }
.fit-card .fit-top { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
