:root {
  --bg: #f4f5f7;
  --card: #ffffff;
  --ink: #1b1f24;
  --muted: #5f6b7a;
  --line: #d9dee5;
  --accent: #0b5cad;
  --accent-ink: #ffffff;
  --warn-bg: #fff7e6;
  --warn-line: #f0b429;
  --err-bg: #fdecec;
  --err-line: #d64545;
  --ok-bg: #e9f7ef;
  --ok-line: #2f9e5f;
  --info-bg: #eef4fb;
  --info-line: #7aa6d8;
  --radius: 10px;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--ink); font: 15px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; }
a { color: var(--accent); }
header.top { background: #111827; color: #fff; padding: 12px 20px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
header.top .brand { font-weight: 700; letter-spacing: .3px; }
header.top .brand small { font-weight: 400; opacity: .7; margin-left: 8px; }
header.top button { background: transparent; color: #fff; border: 1px solid rgba(255,255,255,.4); }
main { max-width: 1080px; margin: 0 auto; padding: 20px 16px 60px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; margin-bottom: 16px; }
h1 { font-size: 22px; margin: 0 0 6px; }
h2 { font-size: 18px; margin: 0 0 12px; }
h3 { font-size: 15px; margin: 18px 0 8px; color: var(--muted); text-transform: uppercase; letter-spacing: .4px; }
p.muted, span.muted, div.muted { color: var(--muted); }
label { display: block; font-size: 13px; color: var(--muted); margin: 10px 0 4px; }
input[type=text], input[type=password], input[type=email], input[type=number], select, textarea {
  width: 100%; padding: 9px 10px; border: 1px solid var(--line); border-radius: 8px; font: inherit; background: #fff;
}
input:focus, select:focus, textarea:focus { outline: 2px solid #bcd3ee; border-color: var(--accent); }
button { font: inherit; padding: 10px 16px; border-radius: 8px; border: 1px solid var(--accent); background: var(--accent); color: var(--accent-ink); cursor: pointer; }
button.secondary { background: #fff; color: var(--accent); }
button.ghost { background: transparent; color: var(--muted); border-color: var(--line); }
button:disabled { opacity: .5; cursor: not-allowed; }
.row { display: flex; gap: 12px; flex-wrap: wrap; }
.row > * { flex: 1 1 200px; }
.actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 18px; flex-wrap: wrap; }
.actions .left { margin-right: auto; }
.notice { border-radius: 8px; padding: 10px 12px; margin: 10px 0; border: 1px solid var(--line); background: var(--info-bg); border-color: var(--info-line); }
.notice.warn { background: var(--warn-bg); border-color: var(--warn-line); }
.notice.error { background: var(--err-bg); border-color: var(--err-line); }
.notice.ok { background: var(--ok-bg); border-color: var(--ok-line); }
.notice.question { background: #f3ecff; border-color: #9c6ade; }
.notice label { display: inline; color: var(--ink); font-size: 14px; margin-left: 8px; }
.steps { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 16px; font-size: 13px; }
.steps span { padding: 5px 10px; border-radius: 999px; background: #e6e9ee; color: var(--muted); }
.steps span.active { background: var(--accent); color: #fff; }
.steps span.done { background: var(--ok-bg); color: #1f6b3f; }
.choice { display: flex; gap: 8px; flex-wrap: wrap; }
.choice label { flex: 1 1 120px; margin: 0; border: 1px solid var(--line); border-radius: 8px; padding: 12px; text-align: center; cursor: pointer; color: var(--ink); font-size: 15px; background: #fff; }
.choice input { display: none; }
.choice input:checked + span { font-weight: 700; color: var(--accent); }
.choice label:has(input:checked) { border-color: var(--accent); background: #eef4fb; }
.slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.slot { border: 1px dashed var(--line); border-radius: var(--radius); padding: 12px; background: #fafbfc; }
.slot.required { border-color: #9aaabb; }
.slot:not(.filled) { cursor: pointer; }
.slot.dragover { border-color: var(--accent); background: #eef4fb; border-style: solid; }
.slot.filled { border-style: solid; border-color: var(--ok-line); background: #fff; }
.slot .name { font-weight: 600; }
.slot .req { font-size: 12px; color: var(--muted); }
.slot img { max-width: 100%; max-height: 180px; border-radius: 6px; margin-top: 8px; border: 1px solid var(--line); background: #fff; display: block; }
.slot .fileline { font-size: 12px; color: var(--muted); margin-top: 6px; word-break: break-all; }
.slot input[type=file] { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; }
.slot .odo { margin-top: 8px; }
.slot .odo label { margin: 0 0 4px; }
.dropzone { position: relative; margin-top: 10px; border: 2px dashed #9aaabb; border-radius: 8px; padding: 18px 10px; text-align: center; color: var(--muted); background: #fff; font-size: 14px; transition: background .15s, border-color .15s; }
.dropzone .dz-icon { font-size: 26px; line-height: 1; color: var(--accent); margin-bottom: 4px; }
.dropzone .dz-sub { font-size: 12px; margin-top: 4px; }
.slot:hover .dropzone, .slot.dragover .dropzone { border-color: var(--accent); background: #eef4fb; }
.review-block { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; border-top: 1px solid var(--line); padding-top: 14px; margin-top: 14px; }
.review-block .src img { width: 100%; border: 1px solid var(--line); border-radius: 8px; background: #fff; cursor: zoom-in; }
.review-block .src .cap { font-size: 12px; color: var(--muted); margin-top: 4px; }
.source-tag { display: inline-block; font-size: 11px; padding: 2px 6px; border-radius: 4px; background: #e6e9ee; color: var(--muted); margin-left: 6px; vertical-align: middle; }
.preview-doc { margin-bottom: 20px; }
.preview-doc .pages { display: flex; gap: 10px; flex-wrap: wrap; }
.preview-doc .pages img { width: calc(50% - 5px); max-width: 420px; border: 1px solid var(--line); border-radius: 6px; background: #fff; cursor: zoom-in; }
.deal-list { width: 100%; border-collapse: collapse; }
.deal-list th, .deal-list td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--line); font-size: 14px; }
.deal-list tr { cursor: pointer; }
.deal-list tr:hover td { background: #f7f9fb; }
.status { font-size: 12px; padding: 2px 8px; border-radius: 999px; background: #e6e9ee; }
.status.submitted { background: var(--ok-bg); color: #1f6b3f; }
.banner { background: #fffbe6; border: 1px solid #f0b429; border-radius: var(--radius); padding: 12px 14px; margin-bottom: 16px; }
.banner b { display: block; margin-bottom: 2px; }
.lightbox { position: fixed; inset: 0; background: rgba(0,0,0,.85); display: flex; align-items: center; justify-content: center; z-index: 50; cursor: zoom-out; }
.lightbox img { max-width: 96vw; max-height: 96vh; }
.spinner { display: inline-block; width: 16px; height: 16px; border: 2px solid #fff; border-right-color: transparent; border-radius: 50%; animation: spin .8s linear infinite; vertical-align: -3px; margin-right: 6px; }
@keyframes spin { to { transform: rotate(360deg); } }
.kv { display: grid; grid-template-columns: 160px 1fr; gap: 4px 12px; font-size: 14px; }
.kv div:nth-child(odd) { color: var(--muted); }
.money-input { position: relative; }
.money-input input { padding-left: 22px; }
.money-input::before { content: "$"; position: absolute; left: 9px; top: 9px; color: var(--muted); }
@media (max-width: 720px) {
  .review-block { grid-template-columns: 1fr; }
  .preview-doc .pages img { width: 100%; }
  main { padding: 12px 10px 60px; }
  .card { padding: 14px; }
}
.pdfpages canvas { width: calc(50% - 5px); max-width: 420px; border: 1px solid var(--line); border-radius: 6px; background: #fff; cursor: zoom-in; height: auto; }
.pdfpages { display: flex; gap: 10px; flex-wrap: wrap; }
.slot .reading { font-size: 12px; margin-top: 6px; }
.slot .reading.ok { color: #1f6b3f; }
.slot .reading.err { color: #b42318; }
@media (max-width: 720px) { .pdfpages canvas { width: 100%; } }
