:root {
  --bg: #f6f7fb; --card: #ffffff; --ink: #14181f; --muted: #5d6675; --line: #e3e6ee;
  --brand: #2f5bff; --brand-ink: #ffffff; --brand-soft: #e9eeff; --ok: #1a9a5b; --warn: #b7791f; --bad: #c43d3d;
  --radius: 14px; --shadow: 0 1px 2px rgba(20,24,31,.05), 0 8px 24px rgba(20,24,31,.06);
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, sans-serif; }
a { color: var(--brand); }
button { font: inherit; }
.wrap { max-width: 980px; margin: 0 auto; padding: 24px 16px 80px; }
header.top { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.logo { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 20px; letter-spacing: -.02em; }
.logo .mark { width: 32px; height: 32px; border-radius: 9px; background: var(--brand); color: #fff; display: grid; place-items: center; font-size: 15px; }
.tag { color: var(--muted); font-size: 14px; }

.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 20px; }
.steps button { border: 1px solid var(--line); background: var(--card); border-radius: 10px; padding: 10px 8px; text-align: left; cursor: pointer; color: var(--muted); font-size: 14px; }
.steps button b { display: block; color: var(--ink); font-size: 13px; }
.steps button.active { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.steps button.done b::before { content: "✓ "; color: var(--ok); }
.steps button:disabled { opacity: .55; cursor: default; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px; margin-bottom: 16px; }
@media (max-width: 640px) { .card { padding: 16px; } }
.card h2 { margin: 0 0 4px; font-size: 20px; letter-spacing: -.01em; }
.card .sub { margin: 0 0 18px; color: var(--muted); font-size: 15px; }
h3 { font-size: 15px; margin: 22px 0 10px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }

.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid .full { grid-column: 1 / -1; }
label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 4px; color: #2a2f3a; }
input, textarea, select { width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; font: inherit; color: var(--ink); background: #fff; }
input:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
textarea { min-height: 90px; resize: vertical; }
.hint { font-size: 13px; color: var(--muted); margin-top: 4px; }

.entry { border: 1px dashed var(--line); border-radius: 12px; padding: 14px; margin-bottom: 10px; position: relative; }
.entry .rm { position: absolute; top: 8px; right: 8px; border: 0; background: transparent; color: var(--muted); cursor: pointer; font-size: 18px; line-height: 1; padding: 4px 8px; border-radius: 8px; }
.entry .rm:hover { background: #fdecec; color: var(--bad); }

.btn { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--line); background: #fff; color: var(--ink); padding: 10px 16px; border-radius: 10px; cursor: pointer; font-weight: 600; }
.btn:hover { border-color: #c9cfdb; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.btn.primary:hover { filter: brightness(1.05); }
.btn.ghost { background: transparent; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.small { padding: 7px 12px; font-size: 14px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.end { justify-content: flex-end; margin-top: 18px; }
.row.between { justify-content: space-between; margin-top: 18px; }

.notice { padding: 12px 14px; border-radius: 10px; font-size: 14px; margin: 12px 0; }
.notice.ok { background: #e6f6ee; color: #145c38; }
.notice.warn { background: #fff5e2; color: #6b4707; }
.notice.bad { background: #fdecec; color: #7c1f1f; }
.hidden { display: none !important; }

.jobprev { background: #fafbfe; border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; }
.jobprev b { font-size: 16px; }
.jobprev .meta { color: var(--muted); font-size: 14px; }
.jobprev pre { white-space: pre-wrap; font-family: inherit; font-size: 13px; line-height: 1.5; max-height: 220px; overflow: auto; margin: 10px 0 0; color: #333; }

.chat { display: flex; flex-direction: column; gap: 10px; min-height: 220px; max-height: 460px; overflow: auto; padding: 4px; }
.msg { max-width: 80%; padding: 10px 14px; border-radius: 14px; line-height: 1.45; white-space: pre-wrap; }
.msg.ai { background: #f0f2f8; border-bottom-left-radius: 4px; align-self: flex-start; }
.msg.me { background: var(--brand); color: #fff; border-bottom-right-radius: 4px; align-self: flex-end; }
.msg.typing { color: var(--muted); font-style: italic; }
.composer { display: flex; gap: 8px; margin-top: 12px; }
.composer textarea { min-height: 44px; max-height: 160px; }

.resume-wrap { display: grid; grid-template-columns: 1fr 300px; grid-template-areas: 'left primary' 'left side'; grid-template-rows: auto 1fr; gap: 16px; }
@media (max-width: 800px) { .resume-wrap { grid-template-columns: 1fr; grid-template-areas: 'primary' 'left' 'side'; grid-template-rows: auto; } .grid { grid-template-columns: 1fr; } .steps { grid-template-columns: 1fr 1fr; } }
.preview { display: flex; flex-direction: column; gap: 14px; background: #e4e6ec; border: 1px solid var(--line); border-radius: 10px; padding: 14px; min-height: 400px; }
.preview canvas { width: 100%; height: auto; background: #fff; box-shadow: 0 2px 12px rgba(0,0,0,.15); display: block; }
.preview .pagecount { text-align: center; color: var(--muted); font-size: 13px; }
.side .card { padding: 16px; }
.kw { display: inline-block; background: var(--brand-soft); color: #1f3fbf; border-radius: 999px; padding: 2px 10px; font-size: 13px; margin: 2px 4px 2px 0; }
.spinner { width: 18px; height: 18px; border: 3px solid rgba(0,0,0,.12); border-top-color: var(--brand); border-radius: 50%; animation: spin .8s linear infinite; display: inline-block; vertical-align: middle; }
.btn.primary .spinner { border-color: rgba(255,255,255,.35); border-top-color: #fff; }
@keyframes spin { to { transform: rotate(360deg); } }
.working { display: flex; align-items: center; gap: 12px; padding: 40px; justify-content: center; color: var(--muted); }
footer { color: var(--muted); font-size: 13px; text-align: center; margin-top: 30px; }

.upload { background: linear-gradient(180deg, #f3f6ff, #eef2ff); border: 1px solid #d6dfff; border-radius: 12px; padding: 14px 16px; margin-bottom: 18px; display: grid; gap: 10px; }
.upload-text { display: grid; gap: 2px; font-size: 14px; }
.upload-text b { font-size: 15px; }
.upload-text span { color: var(--muted); }
.upload-text span b { font-size: 14px; color: var(--ink); }
.upload label.btn { cursor: pointer; }
.upload #upload-status:empty { display: none; }

.btn.disabled { opacity: .5; pointer-events: none; }

.count { display: inline-block; background: var(--brand-soft); color: #1f3fbf; border-radius: 999px; padding: 0 8px; font-size: 12px; letter-spacing: 0; text-transform: none; margin-left: 6px; }
.count:empty { display: none; }
.kb { display: flex; gap: 8px; align-items: center; margin-bottom: 6px; }
.kb input { flex: 1; }
.kb .src { font-size: 12px; color: var(--muted); white-space: nowrap; max-width: 140px; overflow: hidden; text-overflow: ellipsis; }
.kb .rm { border: 0; background: transparent; color: var(--muted); cursor: pointer; font-size: 18px; line-height: 1; padding: 4px 6px; border-radius: 8px; }
.kb .rm:hover { background: #fdecec; color: var(--bad); }
.msg.sys { align-self: stretch; max-width: none; background: #e6f6ee; color: #145c38; font-size: 13px; border-radius: 10px; }

.editor { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 16px; margin-bottom: 14px; }
.editor h4 { margin: 14px 0 8px; font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); display: flex; justify-content: space-between; align-items: center; }
.editor h4:first-child { margin-top: 0; }
.editor .grid { gap: 8px; }
.editor .entry { padding: 10px; margin-bottom: 8px; }
.editor textarea { min-height: 64px; }
.editor .bar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.editor .bar b { font-size: 15px; }

/* start screen */
.start { padding: 34px 28px 26px; }
.hero { text-align: center; max-width: 620px; margin: 0 auto 22px; }
.hero h1 { font-size: 30px; line-height: 1.15; letter-spacing: -.02em; margin: 0 0 10px; }
.hero p { color: var(--muted); font-size: 16px; margin: 0; }
.drop { border: 2px dashed #c3ccf5; background: #f7f8ff; border-radius: 16px; padding: 34px 20px; text-align: center; display: grid; gap: 4px; justify-items: center; cursor: pointer; transition: background .15s, border-color .15s; }
.drop:hover, .drop:focus, .drop.over { background: #eef1ff; border-color: var(--brand); outline: none; }
.drop .drop-icon { font-size: 34px; margin-bottom: 4px; }
.drop b { font-size: 17px; }
.drop span { color: var(--muted); font-size: 14px; }
.link { color: var(--brand); text-decoration: underline; cursor: pointer; font-weight: 600; }
.row.center { justify-content: center; margin-top: 14px; }
.tip { text-align: center; margin: 14px 0 0; }
.tip b { color: var(--ink); }
.trust { list-style: none; display: flex; justify-content: center; gap: 18px; padding: 0; margin: 14px 0 0; color: var(--muted); font-size: 13px; flex-wrap: wrap; }
.trust li::before { content: "✓ "; color: var(--ok); }
#upload-status:empty, #form-notice:empty { display: none; }
#upload-paste-box { margin-top: 14px; }
@media (max-width: 600px) { .hero h1 { font-size: 24px; } .start { padding: 24px 16px 20px; } }

/* details form */
.grid.g6 { grid-template-columns: repeat(6, 1fr); }
.grid.g6 .half { grid-column: span 3; }
.grid.g6 .third { grid-column: span 2; }
.grid.g6 .full { grid-column: 1 / -1; }
@media (max-width: 640px) { .grid.g6 .half, .grid.g6 .third { grid-column: 1 / -1; } }
.req { font-weight: 500; color: var(--muted); font-size: 12px; margin-left: 6px; }
label .req::before { content: "· "; }
.entry { padding: 12px 12px 10px; }
.entry textarea { min-height: 70px; }
details.opt { border: 1px solid var(--line); border-radius: 12px; padding: 0 14px; margin-top: 10px; background: #fafbfe; }
details.opt > summary { cursor: pointer; list-style: none; padding: 12px 0; font-weight: 700; font-size: 14px; display: flex; align-items: center; gap: 8px; }
details.opt > summary::-webkit-details-marker { display: none; }
details.opt > summary::before { content: "+"; width: 20px; height: 20px; border-radius: 6px; background: var(--brand-soft); color: var(--brand); display: inline-grid; place-items: center; font-size: 15px; }
details.opt[open] > summary::before { content: "–"; }
details.opt > summary .hint { font-weight: 500; margin-left: auto; }
details.opt > *:not(summary) { margin-bottom: 12px; }
details.opt .entry { background: #fff; }
.stickybar { position: sticky; bottom: 10px; display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 22px -22px -22px; padding: 12px 22px; background: rgba(255,255,255,.92); backdrop-filter: blur(6px); border-top: 1px solid var(--line); border-radius: 0 0 var(--radius) var(--radius); }
.stickybar .left { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.stickybar .btn.primary:disabled { opacity: .55; }
@media (max-width: 640px) { .stickybar { margin: 22px -16px -16px; padding: 10px 16px; } .stickybar .left .hint { display: none; } }

/* job screen */
.tabs { display: flex; gap: 6px; background: #eef0f6; padding: 4px; border-radius: 12px; width: max-content; margin-bottom: 14px; }
.tab { border: 0; background: transparent; padding: 8px 14px; border-radius: 9px; cursor: pointer; font-weight: 600; color: var(--muted); }
.tab.active { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.linkrow { display: flex; gap: 8px; }
.linkrow input { flex: 1; padding: 13px 14px; font-size: 16px; }
@media (max-width: 520px) { .linkrow { flex-direction: column; } }
.jobcard { border: 1px solid #cfe8d9; background: #f4fbf7; border-radius: 14px; padding: 16px 18px; margin-top: 14px; }
.jobcard-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.okpill { background: #e6f6ee; color: #145c38; font-weight: 700; font-size: 13px; padding: 4px 10px; border-radius: 999px; }
.jobcard-title { font-size: 20px; font-weight: 800; letter-spacing: -.01em; }
.jobcard-meta { color: var(--muted); font-size: 14px; margin-bottom: 10px; }
.jc-label { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 10px 0 4px; }
#jc-req-list, #jc-nice-list { margin: 0; padding-left: 20px; }
#jc-req-list li, #jc-nice-list li { margin: 2px 0; }
.jobcard details.opt { background: #fff; margin-top: 10px; }
.jobcard pre { white-space: pre-wrap; font-family: inherit; font-size: 13px; line-height: 1.5; max-height: 260px; overflow: auto; margin: 0 0 10px; color: #333; }
.jobcard .meta-edit { display: inline-block; min-width: 120px; padding: 2px 6px; font-size: 14px; }

/* questions screen */
.qhead { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 14px; }
.progress { font-size: 13px; font-weight: 700; color: #1f3fbf; background: var(--brand-soft); border-radius: 999px; padding: 6px 12px; white-space: nowrap; }
.progress.done { background: #e6f6ee; color: #145c38; }
.qwrap { display: grid; grid-template-columns: 1fr 260px; gap: 16px; }
@media (max-width: 800px) { .qwrap { grid-template-columns: 1fr; } .qside { order: -1; } }
.qside-card { background: #fafbfe; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.qjob { font-weight: 700; margin: 2px 0 6px; }
#q-reqs { margin: 0; padding-left: 18px; font-size: 14px; }
#q-reqs li { margin: 3px 0; }
.chat { min-height: 260px; max-height: 420px; }
.quick { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.quick:empty { display: none; }
.quick button { border: 1px solid #c9d2f5; background: #f3f5ff; color: #1f3fbf; border-radius: 999px; padding: 6px 12px; font-size: 13px; font-weight: 600; cursor: pointer; }
.quick button:hover { background: var(--brand-soft); }
.typing { display: inline-flex; gap: 4px; align-items: center; padding: 4px 2px; }
.typing i { width: 7px; height: 7px; border-radius: 50%; background: #9aa3b5; animation: blink 1.2s infinite; }
.typing i:nth-child(2) { animation-delay: .2s; } .typing i:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }
.readybox { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; background: #e6f6ee; color: #145c38; border-radius: 12px; padding: 12px 14px; margin-top: 12px; }
.readybox .btn { margin-left: auto; }
.msg.err { background: #fdecec; color: #7c1f1f; align-self: stretch; max-width: none; font-size: 14px; }
.msg.err button { margin-left: 8px; }

.qside-toggle { display: none; background: none; border: 0; padding: 0; font-size: 13px; margin: 2px 0 6px; }
@media (max-width: 800px) {
  .qside-toggle { display: inline; }
  .qside-more { display: none; }
  .qside-card.open .qside-more { display: block; }
  .qside-card { padding: 10px 14px; }
}

/* resume screen */
.rleft { grid-area: left; min-width: 0; }
.side { grid-area: side; }
.rprimary { grid-area: primary; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; }
.btn.big { width: 100%; justify-content: center; padding: 14px 18px; font-size: 17px; }
.afterdl { margin-top: 10px; background: #e6f6ee; color: #145c38; border-radius: 10px; padding: 10px 12px; font-size: 14px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.reveal { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; font-size: 15px; }
.reveal span:last-child { color: var(--muted); }
.working { padding: 50px 20px; }
.work-inner { display: grid; justify-items: center; gap: 10px; text-align: center; }
.spinner.big { width: 34px; height: 34px; border-width: 4px; }
.work-title { font-weight: 700; font-size: 18px; color: var(--ink); }
.work-steps { list-style: none; padding: 0; margin: 4px 0 0; display: grid; gap: 4px; font-size: 14px; color: var(--muted); text-align: left; }
.work-steps li::before { content: "○ "; }
.work-steps li.done::before { content: "✓ "; color: var(--ok); }
.work-steps li.now { color: var(--ink); font-weight: 600; }
.work-steps li.now::before { content: "● "; color: var(--brand); }
.fit { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.fit li { display: grid; grid-template-columns: 22px 1fr; gap: 6px; font-size: 14px; line-height: 1.35; }
.fit .st { font-weight: 800; }
.fit .st.covered { color: var(--ok); } .fit .st.partly { color: var(--warn); } .fit .st.missing { color: #9aa3b5; }
.fit .note { display: block; color: var(--muted); font-size: 13px; }
.polish { display: flex; gap: 6px; flex-wrap: wrap; }
.polish .btn.on { border-color: var(--brand); background: var(--brand-soft); }
.polishbox { margin-top: 10px; }

/* account, modals, paywall */
.hdr-right { display: flex; align-items: center; gap: 12px; }
@media (max-width: 640px) { .hdr-right .tag { display: none; } }
.acct { display: flex; align-items: center; gap: 8px; position: relative; }
.acct .avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--brand-soft); color: #1f3fbf; display: grid; place-items: center; font-weight: 700; overflow: hidden; cursor: pointer; border: 1px solid var(--line); }
.acct .avatar img { width: 100%; height: 100%; object-fit: cover; }
.acct .credits { font-size: 13px; color: var(--muted); }
.menu { position: absolute; right: 0; top: 40px; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); min-width: 220px; padding: 6px; z-index: 20; display: none; }
.menu.open { display: block; }
.menu .who { padding: 8px 10px; font-size: 13px; color: var(--muted); border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.menu .who b { display: block; color: var(--ink); font-size: 14px; }
.menu button { display: block; width: 100%; text-align: left; border: 0; background: transparent; padding: 9px 10px; border-radius: 8px; cursor: pointer; font-size: 14px; }
.menu button:hover { background: #f3f5fb; }
.modal { position: fixed; inset: 0; background: rgba(20,24,31,.45); display: grid; place-items: center; z-index: 50; padding: 16px; }
.modal-box { background: #fff; border-radius: 16px; padding: 26px 24px 20px; width: 100%; max-width: 440px; position: relative; box-shadow: 0 20px 60px rgba(0,0,0,.25); display: grid; gap: 12px; justify-items: start; }
.modal-box.wide { max-width: 620px; }
.modal-box h3 { margin: 0; font-size: 22px; letter-spacing: -.01em; text-transform: none; color: var(--ink); }
.modal-box p { margin: 0; color: #2a2f3a; }
.modal-x { position: absolute; top: 10px; right: 12px; border: 0; background: transparent; font-size: 24px; color: var(--muted); cursor: pointer; }
.gbtn { text-decoration: none; }
.gbtn .g { background: #fff; color: #4285f4; border-radius: 50%; width: 24px; height: 24px; display: inline-grid; place-items: center; font-weight: 800; margin-right: 4px; }
.packs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; width: 100%; }
@media (max-width: 560px) { .packs { grid-template-columns: 1fr; } }
.pack { border: 1px solid var(--line); border-radius: 12px; padding: 14px; display: grid; gap: 4px; text-align: center; position: relative; }
.pack.featured { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.pack .badge { position: absolute; top: -10px; left: 50%; transform: translateX(-50%); background: var(--brand); color: #fff; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px; }
.pack .price { font-size: 24px; font-weight: 800; }
.pack .each { font-size: 12px; color: var(--muted); }
.pack .btn { justify-content: center; margin-top: 6px; }
.rlist { display: grid; gap: 8px; width: 100%; }
.rlist button { display: flex; justify-content: space-between; align-items: center; gap: 10px; width: 100%; text-align: left; border: 1px solid var(--line); background: #fff; border-radius: 10px; padding: 10px 12px; cursor: pointer; }
.rlist button:hover { border-color: var(--brand); }
.rlist .meta { font-size: 12px; color: var(--muted); }
.rlist .lock { font-size: 12px; color: var(--warn); font-weight: 700; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: #14181f; color: #fff; padding: 10px 16px; border-radius: 10px; font-size: 14px; z-index: 60; box-shadow: var(--shadow); }

.locked { text-align: center; padding: 40px 20px; }
