@font-face { font-family: "Plus Jakarta Sans"; font-weight: 400; font-display: swap; src: url("/static/fonts/plus-jakarta-sans-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Plus Jakarta Sans"; font-weight: 500; font-display: swap; src: url("/static/fonts/plus-jakarta-sans-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Plus Jakarta Sans"; font-weight: 600; font-display: swap; src: url("/static/fonts/plus-jakarta-sans-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Plus Jakarta Sans"; font-weight: 700; font-display: swap; src: url("/static/fonts/plus-jakarta-sans-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "Plus Jakarta Sans"; font-weight: 800; font-display: swap; src: url("/static/fonts/plus-jakarta-sans-latin-800-normal.woff2") format("woff2"); }
@font-face { font-family: "JetBrains Mono"; font-weight: 500; font-display: swap; src: url("/static/fonts/jetbrains-mono-latin-500-normal.woff2") format("woff2"); }

:root {
  --text: #0f1a2a; --body: #3f4a5c; --muted: #5b6577; --faint: #8a94a6;
  --primary: #2552d0; --primary-dark: #1d44b3; --primary-bg: #eaf0fd;
  --border: #dce1e8; --line: #e3e7ee; --bg: #f4f6fa; --white: #fff;
  --green: #1c6b47; --green-bg: #e6f4ec; --amber: #8a5a00; --amber-bg: #fff6e0; --amber-line: #f2d9a0;
  --red: #b42318; --red-bg: #fdecea;
  --shadow: 0 4px 16px rgba(15, 26, 42, 0.08);
  --mono: "JetBrains Mono", ui-monospace, Menlo, monospace;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", sans-serif; color: var(--text); background: var(--bg); font-size: 14px; line-height: 1.45; -webkit-font-smoothing: antialiased; }
[hidden] { display: none !important; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--primary); font-weight: 700; text-decoration: none; }
a:hover { text-decoration: underline; }

/* top bar */
.topbar { height: 64px; background: var(--white); border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; padding: 0 32px; position: sticky; top: 0; z-index: 20; }
.brand { display: flex; align-items: center; gap: 12px; }
.logo { width: 32px; height: 32px; border-radius: 8px; background: var(--primary); color: var(--white); font-weight: 800; font-size: 13px; display: grid; place-items: center; flex: none; }
.logo.big { width: 44px; height: 44px; border-radius: 10px; font-size: 16px; }
.brand-name { font-weight: 800; font-size: 15px; line-height: 1.2; }
.brand-sub { font-size: 11.5px; font-weight: 500; color: var(--muted); }
.who { display: flex; align-items: center; gap: 14px; }
.today { font-size: 12.5px; font-weight: 500; color: var(--muted); display: flex; align-items: center; gap: 8px; }
.chip { display: inline-flex; align-items: center; height: 24px; padding: 0 10px; border-radius: 12px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.chip.blue { background: var(--primary-bg); color: var(--primary); }
.chip.green { background: var(--green-bg); color: var(--green); }
.chip.code { border-radius: 6px; padding: 0 8px; font-size: 11.5px; background: var(--primary-bg); color: var(--primary); }
.divider-v { width: 1px; height: 24px; background: var(--line); }
.avatar { width: 28px; height: 28px; border-radius: 50%; background: #dde6fa; color: var(--primary); font-size: 11px; font-weight: 800; display: grid; place-items: center; text-transform: uppercase; }
.user-name { font-size: 12.5px; font-weight: 700; line-height: 1.2; }
.linkbtn { background: none; border: 0; padding: 0; color: var(--primary); font-weight: 600; font-size: 11.5px; cursor: pointer; }

/* layout */
main { padding: 48px 24px 64px; }
.narrow { max-width: 880px; margin: 0 auto; }
.wide { max-width: 1280px; margin: 0 auto; }
h1 { font-size: 26px; font-weight: 800; margin: 0 0 6px; letter-spacing: -0.2px; }
.lead { font-size: 14px; font-weight: 500; color: var(--muted); margin: 0 0 24px; }
.card { background: var(--white); border-radius: 16px; box-shadow: var(--shadow); }
.back { display: inline-block; font-size: 13px; margin-bottom: 8px; background: none; border: 0; padding: 0; color: var(--primary); font-weight: 700; cursor: pointer; }

/* buttons */
.btn { height: 44px; padding: 0 22px; border-radius: 8px; border: 1px solid transparent; font-weight: 700; font-size: 14px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 8px; white-space: nowrap; }
.btn.primary { background: var(--primary); color: var(--white); }
.btn.primary:hover { background: var(--primary-dark); }
.btn.secondary { background: var(--white); color: var(--text); border-color: var(--border); }
.btn.secondary:hover { border-color: #c5ccd7; }
.btn.small { height: 34px; padding: 0 14px; font-size: 12.5px; }
.btn:disabled { opacity: 0.6; cursor: default; }
.btn.block { width: 100%; }

/* login */
.login-wrap { min-height: 100vh; background: linear-gradient(var(--primary-bg) 0, var(--primary-bg) 340px, var(--bg) 340px); display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 24px; }
.login-card { width: 100%; max-width: 420px; padding: 36px 32px 32px; }
.login-card h1 { margin-top: 20px; font-size: 24px; }
.login-card .lead { margin-bottom: 24px; }
.login-help { border-top: 1px solid var(--line); margin-top: 24px; padding-top: 16px; font-size: 12.5px; color: var(--muted); font-weight: 500; }
.login-help .faint { color: var(--faint); font-size: 12px; margin-top: 4px; }
.footer-url { margin-top: 28px; font-size: 12px; font-weight: 600; color: var(--faint); }

/* fields */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label, .field > .label { font-size: 12.5px; font-weight: 600; color: var(--body); }
.req { color: var(--red); }
.input-wrap { position: relative; }
.input { width: 100%; height: 40px; border: 1px solid var(--border); border-radius: 8px; background: var(--white); padding: 0 12px; font-size: 13.5px; outline: none; }
textarea.input { height: 64px; padding: 9px 12px; resize: vertical; line-height: 1.4; }
select.input { appearance: none; padding-right: 32px; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 17px) 18px, calc(100% - 12px) 18px; background-size: 5px 5px; background-repeat: no-repeat; }
.input:focus { border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary); }
.input::placeholder { color: var(--faint); }
.input.mono { font-family: var(--mono); font-size: 13px; font-weight: 500; }
.input.has-chip { padding-right: 70px; }
select.input.has-chip { padding-right: 96px; }
.input.warn { border-color: var(--amber-line); }
.input.bad { border-color: var(--red); box-shadow: 0 0 0 1px var(--red); }
.read-chip { position: absolute; right: 10px; top: 9px; height: 22px; padding: 0 8px; border-radius: 11px; background: var(--green-bg); color: var(--green); font-size: 11px; font-weight: 700; display: flex; align-items: center; pointer-events: none; }
select.input + .read-chip { right: 34px; }
.note { font-size: 11.5px; font-weight: 500; color: var(--muted); }
.note.green { color: var(--green); }
.note.amber { color: var(--amber); }
.note.red { color: var(--red); font-weight: 600; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 24px; }
.section { margin-top: 24px; }
.section-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 12px; }
.section-head h2 { font-size: 15px; font-weight: 800; margin: 0; }
.section-head .opt { font-size: 12.5px; font-weight: 600; color: var(--faint); }

/* banners */
.banner { border-radius: 10px; padding: 13px 16px; font-size: 13px; font-weight: 600; }
.banner.green { background: var(--green-bg); color: var(--green); }
.banner.amber { background: var(--amber-bg); color: var(--amber); }
.banner.red { background: var(--red-bg); color: var(--red); }
.banner ul { margin: 6px 0 0; padding-left: 18px; font-weight: 500; }

/* upload */
.upload-card { padding: 24px; }
.drop { border: 2px dashed #afc0ec; border-radius: 12px; background: #f8faff; padding: 44px 24px 36px; text-align: center; transition: background .15s, border-color .15s; }
.drop.over { background: #eef3ff; border-color: var(--primary); }
.drop-icon { width: 64px; height: 64px; border-radius: 50%; background: var(--primary-bg); color: var(--primary); font-size: 30px; font-weight: 800; display: grid; place-items: center; margin: 0 auto 20px; }
.drop h2 { font-size: 20px; font-weight: 800; margin: 0 0 6px; }
.drop p { margin: 0; color: var(--muted); font-weight: 500; font-size: 13.5px; }
.drop .actions { display: flex; gap: 12px; justify-content: center; margin-top: 28px; flex-wrap: wrap; }
.drop .actions .btn { width: 160px; }
.drop .hint { margin-top: 16px; font-size: 12px; color: var(--faint); }
.tips-title { font-size: 13px; font-weight: 800; color: var(--body); margin: 28px 0 12px; }
.tips { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.tip { background: var(--white); border: 1px solid var(--line); border-radius: 12px; padding: 16px; display: flex; gap: 12px; }
.tip .num { width: 24px; height: 24px; border-radius: 12px; background: var(--primary-bg); color: var(--primary); font-size: 12px; font-weight: 800; display: grid; place-items: center; flex: none; }
.tip b { display: block; font-size: 13.5px; margin-bottom: 4px; }
.tip span { font-size: 12.5px; color: var(--muted); font-weight: 500; }

/* reading */
.reading { border: 1px solid #d5def5; border-radius: 12px; background: #f8faff; padding: 40px 24px; text-align: center; }
.spinner { width: 60px; height: 60px; border-radius: 50%; border: 6px solid #dce4f8; border-top-color: var(--primary); margin: 0 auto 20px; animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.reading h2 { font-size: 20px; font-weight: 800; margin: 0 0 6px; }
.reading p { margin: 0; color: var(--muted); font-weight: 500; }
.progress { width: 360px; max-width: 100%; height: 8px; border-radius: 4px; background: #e3e9f8; margin: 24px auto 18px; overflow: hidden; }
.progress div { height: 100%; width: 5%; background: var(--primary); border-radius: 4px; transition: width .4s; }
.steps { display: inline-flex; flex-direction: column; gap: 8px; text-align: left; font-size: 13px; }
.steps li { list-style: none; display: flex; gap: 10px; color: var(--faint); font-weight: 500; }
.steps li.done { color: var(--body); font-weight: 600; }
.steps li.done i { color: var(--green); }
.steps li.now { color: var(--body); font-weight: 600; }
.steps li.now i { color: var(--primary); }
.steps i { font-style: normal; font-weight: 800; width: 14px; }

/* check & save */
.check-grid { display: grid; grid-template-columns: 520px 1fr; gap: 32px; align-items: start; }
.preview-card { padding: 22px 24px 20px; position: sticky; top: 88px; }
.file-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 14px; }
.file-name { font-size: 14px; font-weight: 700; word-break: break-all; }
.file-info { font-size: 12px; color: var(--muted); font-weight: 500; }
.viewer { height: 340px; border-radius: 10px; border: 1px solid var(--line); background: #eef0f4; overflow: auto; display: grid; place-items: center; }
.viewer img { max-width: 100%; max-height: 100%; transition: transform .2s; transform-origin: center; display: block; }
.viewer.zoom { place-items: start; }
.viewer.zoom img { max-width: none; max-height: none; width: 200%; }
.viewer-empty { color: var(--faint); font-size: 13px; font-weight: 600; padding: 24px; text-align: center; }
.viewer-tools { display: flex; justify-content: space-between; align-items: flex-start; margin-top: 16px; gap: 12px; }
.viewer-tools .left { display: flex; gap: 8px; }
.thumbs { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.thumb { width: 64px; display: flex; flex-direction: column; align-items: center; gap: 4px; background: none; border: 0; padding: 0; cursor: pointer; font-size: 11px; font-weight: 600; color: var(--muted); }
.thumb img, .thumb .ph { width: 64px; height: 44px; object-fit: cover; border-radius: 6px; border: 1px solid var(--border); background: #f2ede2; }
.thumb.on img, .thumb.on .ph { border: 2px solid var(--primary); }
.thumb.on { color: var(--primary); font-weight: 700; }
.privacy { border-top: 1px solid var(--line); margin-top: 16px; padding-top: 14px; font-size: 12px; color: var(--muted); font-weight: 500; }
.form-card { overflow: visible; }
.form-body { padding: 24px; }
.form-foot { border-top: 1px solid var(--line); padding: 18px 24px; display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.next-label { font-size: 12px; font-weight: 600; color: var(--muted); }
.next-id { font-size: 16px; font-weight: 800; }
.foot-actions { display: flex; gap: 12px; }
.foot-actions .btn.primary { min-width: 180px; }
.form-error { margin: 0 24px 0; }

/* search (agent / staff) */
.search-icon { position: absolute; left: 13px; top: 12px; width: 12px; height: 12px; border: 1.6px solid var(--faint); border-radius: 50%; pointer-events: none; }
.search-icon::after { content: ""; position: absolute; width: 6px; height: 1.6px; background: var(--faint); right: -5px; bottom: -3px; transform: rotate(45deg); border-radius: 1px; }
.input.search { padding-left: 36px; padding-right: 32px; }
.clear { position: absolute; right: 8px; top: 8px; width: 24px; height: 24px; border: 0; background: none; color: var(--faint); font-size: 18px; line-height: 1; cursor: pointer; border-radius: 6px; }
.clear:hover { background: var(--bg); color: var(--text); }
.picked { font-weight: 600; }
.suggest { position: absolute; left: 0; right: 0; top: 44px; background: var(--white); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); z-index: 30; overflow: hidden; }
.suggest button { width: 100%; text-align: left; background: var(--white); border: 0; border-bottom: 1px solid var(--line); padding: 8px 14px; display: flex; align-items: center; gap: 12px; cursor: pointer; }
.suggest button:last-of-type { border-bottom: 0; }
.suggest button.on, .suggest button:hover { background: #f1f5fe; }
.suggest .s-name { font-size: 13.5px; font-weight: 700; display: block; }
.suggest .s-sub { font-size: 12px; color: var(--muted); font-weight: 500; display: block; }
.suggest .s-empty, .suggest .s-hint { padding: 10px 14px; font-size: 12px; color: var(--faint); font-weight: 500; }
.suggest .s-hint { border-top: 1px solid var(--line); }

/* result cards */
.result-card { max-width: 600px; margin: 24px auto 0; padding: 40px 40px 36px; text-align: center; }
.icon-circle { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; margin: 0 auto 20px; font-size: 28px; font-weight: 800; }
.icon-circle.green { background: var(--green-bg); color: var(--green); }
.icon-circle.amber { background: var(--amber-bg); color: var(--amber); }
.icon-circle.red { background: var(--red-bg); color: var(--red); }
.result-card h1 { font-size: 24px; }
.result-card .lead { margin-bottom: 24px; }
.summary { background: #f8fafc; border: 1px solid var(--line); border-radius: 12px; padding: 4px 20px; text-align: left; }
.summary .row { display: grid; grid-template-columns: 140px 1fr; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.summary .row:last-child { border-bottom: 0; }
.summary .k { color: var(--muted); font-weight: 600; font-size: 12.5px; }
.summary .v { font-weight: 600; word-break: break-word; }
.summary .v.empty { color: var(--faint); }
.result-card .banner { text-align: left; margin-top: 16px; }
.result-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 24px; }
.result-actions .btn { height: 46px; }
.result-foot { margin-top: 24px; font-size: 13px; font-weight: 600; color: var(--muted); text-align: center; }
.tips-box { background: #f8fafc; border: 1px solid var(--line); border-radius: 12px; padding: 16px 20px; text-align: left; }
.tips-box b { font-size: 13px; }
.tips-box ul { margin: 8px 0 0; padding-left: 18px; color: var(--body); font-size: 13px; }
.tips-box li { margin: 4px 0; }
.small-note { margin-top: 14px; font-size: 12px; color: var(--faint); font-weight: 500; }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--text); color: var(--white); padding: 12px 18px; border-radius: 10px; font-size: 13px; font-weight: 600; z-index: 50; box-shadow: var(--shadow); max-width: calc(100% - 32px); }

/* phones and small screens */
@media (max-width: 1100px) {
  .check-grid { grid-template-columns: 1fr; }
  .preview-card { position: static; }
}
@media (max-width: 720px) {
  .topbar { padding: 0 14px; }
  .today .label { display: none; }
  .brand-sub, .user-name, .divider-v { display: none; }
  main { padding: 24px 14px 48px; }
  h1 { font-size: 22px; }
  .grid2 { grid-template-columns: 1fr; }
  .tips { grid-template-columns: 1fr; }
  .viewer { height: 260px; }
  .form-foot { flex-direction: column; align-items: stretch; }
  .foot-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .result-card { padding: 28px 18px; }
  .result-actions { grid-template-columns: 1fr; }
  .summary .row { grid-template-columns: 110px 1fr; }
  .drop { padding: 32px 16px; }
}

.mt10 { margin-top: 10px; } .mt12 { margin-top: 12px; } .mt16 { margin-top: 16px; } .mt22 { margin-top: 22px; }
.linkbtn.big { font-size: 13px; font-weight: 700; }
