:root {
  --primary: #2463eb;
  --primary-dark: #1747b8;
  --primary-soft: #edf4ff;
  --ink: #15213a;
  --muted: #6d7890;
  --line: #dfe6f0;
  --surface: #ffffff;
  --canvas: #f2f5fa;
  --success: #109768;
  --success-soft: #eaf9f2;
  --warning: #d27a12;
  --warning-soft: #fff8e7;
  --danger: #dc3d4b;
  --shadow: 0 16px 45px rgba(28, 53, 94, .08);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 86% 0%, rgba(66, 125, 255, .12), transparent 26rem),
    linear-gradient(180deg, #f8faff 0, var(--canvas) 30rem);
  font-family: "Microsoft YaHei", "PingFang SC", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
button, input { font: inherit; }
button { color: inherit; }
.is-hidden { display: none !important; }

.page-shell { width: min(1120px, calc(100% - 32px)); margin: 24px auto 56px; }
.hero {
  display: block;
  padding: 26px 34px;
  color: white;
  overflow: hidden;
  position: relative;
  border-radius: 24px;
  background:
    linear-gradient(100deg, rgba(8, 31, 85, .06), rgba(59, 130, 246, .08)),
    linear-gradient(135deg, #173b94 0%, #245fdb 53%, #3a80ef 100%);
  box-shadow: 0 26px 65px rgba(32, 83, 180, .24);
}
.hero::before,
.hero::after { content: ""; position: absolute; border: 1px solid rgba(255,255,255,.16); border-radius: 50%; }
.hero::before { width: 310px; height: 310px; right: -84px; top: -160px; }
.hero::after { width: 190px; height: 190px; right: 150px; bottom: -146px; }
.hero-copy, .hero-topbar { position: relative; z-index: 1; }
.hero-topbar { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 22px; }
.hero-tools { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; }
.hero-actions { display: flex; align-items: center; justify-content: flex-end; gap: 10px; min-width: 0; }
.eyebrow { display: flex; align-items: center; gap: 8px; width: max-content; padding: 6px 10px; border: 1px solid rgba(255,255,255,.23); border-radius: 999px; font-size: 12px; letter-spacing: .7px; background: rgba(255,255,255,.1); }
.eyebrow-dot { width: 7px; height: 7px; border-radius: 50%; background: #8ef1c4; box-shadow: 0 0 0 4px rgba(142,241,196,.13); }
.hero h1 { margin: 0; font-size: clamp(30px, 5vw, 43px); line-height: 1.15; letter-spacing: 1px; }
.hero p { max-width: 820px; margin: 13px 0 0; color: rgba(255,255,255,.83); font-size: 15px; line-height: 1.8; }
.account-button { display: flex; align-items: center; gap: 10px; min-width: 210px; padding: 10px 12px; text-align: left; color: white; border: 1px solid rgba(255,255,255,.22); border-radius: 14px; background: rgba(255,255,255,.1); cursor: pointer; transition: .2s ease; backdrop-filter: blur(7px); }
.account-button:hover { transform: translateY(-2px); background: rgba(255,255,255,.16); }
.account-avatar { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 11px; color: #1d4ed8; background: #fff; font-weight: 800; }
.account-copy { display: flex; flex: 1; flex-direction: column; gap: 3px; }
.account-copy b { font-size: 13px; }
.account-copy small { color: rgba(255,255,255,.7); font-size: 11px; }
.account-logout { flex-shrink: 0; min-height: 40px; padding: 8px 12px; color: #fff; border: 1px solid rgba(255,255,255,.3); border-radius: 10px; background: rgba(255,255,255,.1); cursor: pointer; font-size: 12px; font-weight: 700; }
.account-logout:hover:not(:disabled) { background: rgba(255,255,255,.2); }
.account-logout:disabled { opacity: .5; cursor: not-allowed; }

.workspace-switch { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin: 20px 0; }
.workspace-button { display: flex; min-width: 0; align-items: center; gap: 13px; padding: 18px 20px; text-align: left; border: 1px solid var(--line); border-radius: 16px; background: rgba(255,255,255,.83); cursor: pointer; box-shadow: 0 5px 20px rgba(36, 65, 111, .035); transition: .2s ease; }
.workspace-button:hover { border-color: #adc5fa; transform: translateY(-1px); }
.workspace-button.is-active { color: var(--primary); border-color: var(--primary); background: #edf4ff; box-shadow: inset 0 0 0 1px var(--primary), 0 8px 22px rgba(36,99,235,.1); }
.workspace-icon { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 12px; color: #60708f; background: #eef2f8; font-size: 22px; }
.workspace-button.is-active .workspace-icon { color: white; background: var(--primary); }
.workspace-button span:nth-child(2) { display: flex; flex-direction: column; gap: 5px; }
.workspace-button b { font-size: 15px; }
.workspace-button small { color: var(--muted); font-size: 12px; font-weight: 400; }

.workspace-panel { animation: reveal .28s ease; }
.subtabs { display: flex; gap: 8px; margin-bottom: 18px; padding: 6px; border: 1px solid var(--line); border-radius: 14px; background: rgba(255,255,255,.86); }
.subtab { flex: 1; padding: 11px 16px; border: 0; border-radius: 10px; color: var(--muted); background: transparent; cursor: pointer; font-weight: 700; transition: .2s ease; }
.subtab small { margin-left: 7px; color: #98a2b4; font-weight: 400; }
.subtab:hover { color: var(--primary); background: #f4f7fc; }
.subtab.is-active { color: var(--primary); background: var(--primary-soft); box-shadow: inset 0 0 0 1px #c8dafd; }
.crm-toolbar { display: flex; align-items: center; gap: 12px; }
.crm-tabs { flex: 1; }
.activity-button { display: inline-flex; align-items: center; gap: 7px; min-height: 44px; padding: 10px 12px; white-space: nowrap; color: #fff; border: 1px solid rgba(255,255,255,.3); border-radius: 12px; background: rgba(255,255,255,.12); cursor: pointer; font-size: 12px; font-weight: 700; }
.activity-button:hover { background: rgba(255,255,255,.2); }
.activity-button b { display: grid; place-items: center; min-width: 20px; height: 20px; padding: 0 5px; color: var(--primary); border-radius: 999px; background: #fff; font-size: 11px; }

.stepper { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 16px; }
.step { display: flex; align-items: center; gap: 10px; padding: 12px 14px; color: #8a96a9; border: 1px solid var(--line); border-radius: 13px; background: rgba(255,255,255,.68); font-size: 12px; }
.step span { display: grid; place-items: center; width: 25px; height: 25px; border-radius: 50%; color: #fff; background: #c4ccda; font-size: 11px; font-weight: 800; }
.step.is-active { color: var(--primary); border-color: #b4ccfc; background: #f7faff; }
.step.is-active span { background: var(--primary); }
.step.is-done { color: var(--success); border-color: #bde8d5; background: #f7fdf9; }
.step.is-done span { background: var(--success); }

.card { margin-bottom: 16px; padding: 25px 28px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); box-shadow: var(--shadow); animation: reveal .28s ease; }
.card-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 18px; }
.card h2, .login-gate h2, .modal h2, .drawer-head h2 { margin: 3px 0 0; font-size: 19px; line-height: 1.35; }
.card-heading p { margin: 7px 0 0; color: var(--muted); font-size: 13px; }
.section-kicker { color: var(--primary); font-size: 10px; font-weight: 800; letter-spacing: 1.4px; }
.soft-badge, .success-badge, .demo-badge { display: inline-flex; align-items: center; padding: 6px 9px; border-radius: 999px; font-size: 11px; white-space: nowrap; }
.soft-badge { color: #5a6a86; background: #f0f3f8; }
.success-badge { color: var(--success); background: var(--success-soft); }
.demo-badge { color: var(--warning); background: var(--warning-soft); }

.dropzone { display: flex; min-height: 190px; align-items: center; justify-content: center; flex-direction: column; gap: 8px; padding: 24px; text-align: center; border: 1.5px dashed #a9c0ee; border-radius: 16px; background: linear-gradient(180deg, #fbfdff, #f4f8ff); cursor: pointer; transition: .2s ease; }
.dropzone:hover, .dropzone.is-dragover { border-color: var(--primary); background: #edf4ff; }
.dropzone.compact { min-height: 156px; }
.dropzone input { display: none; }
.dropzone-icon { display: grid; place-items: center; width: 48px; height: 48px; margin-bottom: 3px; color: var(--primary); border-radius: 14px; background: #e6efff; font-size: 27px; font-weight: 300; }
.dropzone b { font-size: 15px; }
.dropzone small { color: var(--muted); font-size: 12px; }
.dropzone.is-disabled { color: #9da7b7; border-color: #d8dee8; background: #f7f8fa; cursor: not-allowed; }
.dropzone.is-disabled .dropzone-icon { color: #9da7b7; background: #eceff3; }
.muted-card { transition: .2s ease; }

.file-list { display: grid; gap: 8px; margin-top: 12px; }
.file-item { display: flex; align-items: center; gap: 11px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 11px; background: #fbfcfe; }
.file-type { display: grid; place-items: center; width: 34px; height: 34px; color: var(--primary); border-radius: 9px; background: var(--primary-soft); font-size: 10px; font-weight: 800; }
.file-meta { display: flex; min-width: 0; flex: 1; flex-direction: column; gap: 3px; }
.file-meta b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.file-meta small { color: var(--muted); font-size: 11px; }
.file-remove { width: 28px; height: 28px; border: 0; border-radius: 7px; color: #8d99ad; background: transparent; cursor: pointer; }
.file-remove:hover { color: var(--danger); background: #fff0f1; }

.actions { display: flex; align-items: center; gap: 10px; margin-top: 18px; }
.actions.right { justify-content: flex-end; }
.actions.split { justify-content: space-between; }
.button { min-height: 41px; padding: 10px 18px; border: 1px solid transparent; border-radius: 10px; font-size: 13px; font-weight: 700; cursor: pointer; transition: .18s ease; }
.button:hover:not(:disabled) { transform: translateY(-1px); }
.button:disabled { opacity: .45; cursor: not-allowed; }
.button.primary { color: #fff; background: var(--primary); box-shadow: 0 8px 18px rgba(36,99,235,.18); }
.button.primary:hover:not(:disabled) { background: var(--primary-dark); }
.button.success { color: #fff; background: var(--success); box-shadow: 0 8px 18px rgba(16,151,104,.16); }
.button.ghost { color: #4f5e78; border-color: var(--line); background: #fff; }
.button.wide { width: 100%; }
.text-button { padding: 0; color: var(--primary); border: 0; background: transparent; font-size: 12px; font-weight: 700; cursor: pointer; }

.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px 18px; }
.field { display: flex; min-width: 0; flex-direction: column; gap: 7px; color: #34415a; font-size: 12px; font-weight: 700; }
.field.full { grid-column: 1 / -1; }
.form-grid > .full { grid-column: 1 / -1; }
.company-tools { display: flex; align-items: center; flex-wrap: wrap; gap: 18px; margin-bottom: 16px; }
.company-tools a { text-decoration: none; }
.company-source { padding: 14px 16px; margin-bottom: 18px; border: 1px solid #d9e5f5; border-radius: 12px; background: #f7faff; color: var(--muted); font-size: 12px; line-height: 1.8; }
.company-source a { color: var(--primary); }
.company-source p { margin: 4px 0; }
.company-source .text-button { margin-right: 14px; }
.field span { display: flex; align-items: center; gap: 5px; }
.field span small { color: var(--muted); font-size: 10px; font-weight: 400; }
.field em { color: var(--danger); font-style: normal; }
.field input, .field select { width: 100%; min-height: 42px; padding: 9px 11px; color: var(--ink); outline: none; border: 1px solid var(--line); border-radius: 9px; background: #fff; font-size: 13px; font-weight: 500; transition: .16s ease; }
.field input:focus, .field select:focus, .search-input input:focus { border-color: #79a3f5; box-shadow: 0 0 0 3px rgba(36,99,235,.1); }
.new-customer-fields select:disabled, .new-customer-fields input:disabled { color: var(--muted); background: #f5f7fb; cursor: not-allowed; }
.field-note { font-size: 10px; font-weight: 500; }
.field-note.good { color: var(--success); }
.form-section-title { display: flex; align-items: center; gap: 8px; margin: 22px 0 12px; font-size: 13px; font-weight: 800; }
.form-section-title:first-of-type { margin-top: 0; }
.form-section-title > span { display: grid; place-items: center; width: 23px; height: 23px; border-radius: 7px; color: var(--primary); background: var(--primary-soft); font-size: 10px; }
.form-section-title small { color: var(--muted); font-weight: 400; }
.ratio-group { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; padding: 15px; border: 1px solid var(--line); border-radius: 12px; background: #f9fbfe; }
.input-suffix { display: flex; align-items: center; }
.input-suffix input { border-radius: 9px 0 0 9px; }
.input-suffix i { display: grid; place-items: center; width: 38px; height: 42px; color: var(--muted); border: 1px solid var(--line); border-left: 0; border-radius: 0 9px 9px 0; background: #f1f4f8; font-style: normal; }
.ratio-status { padding: 10px 12px; color: var(--success); border-radius: 9px; background: var(--success-soft); font-size: 12px; }
.ratio-status.is-invalid { color: var(--danger); background: #fff0f1; }
.recognition-detail { margin-top: 16px; color: var(--muted); font-size: 12px; }
.recognition-detail summary { color: var(--primary); cursor: pointer; font-weight: 700; }
.recognition-detail pre { padding: 13px; white-space: pre-wrap; color: #4a566c; border: 1px solid var(--line); border-radius: 10px; background: #f8fafc; font-family: inherit; line-height: 1.7; }

.result-card { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 16px; border-color: #bde8d5; background: linear-gradient(90deg, #f4fdf8, #fff); }
.result-card p { margin: 7px 0 0; color: var(--muted); font-size: 12px; }
.result-mark { display: grid; place-items: center; width: 44px; height: 44px; color: #fff; border-radius: 13px; background: var(--success); font-size: 21px; font-weight: 900; }
.download-button { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; white-space: nowrap; }
.generated-changes { display: grid; gap: 4px; max-height: 150px; margin-top: 12px; overflow: auto; color: #617087; font-size: 10px; line-height: 1.6; }
.generated-changes span::before { content: "✓"; margin-right: 6px; color: var(--success); font-weight: 800; }

.login-gate { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 20px; padding: 34px; border: 1px solid #ccdaf7; border-radius: 18px; background: linear-gradient(115deg, #fff, #f2f7ff); box-shadow: var(--shadow); }
.login-gate p { margin: 8px 0 0; color: var(--muted); font-size: 13px; }
.lock-visual { display: grid; place-items: center; width: 68px; height: 68px; color: var(--primary); border: 1px solid #c7d9fb; border-radius: 20px; background: #eaf2ff; font-size: 13px; font-weight: 900; letter-spacing: .5px; }

.ocr-result-list { display: grid; gap: 10px; }
.ocr-row { display: grid; grid-template-columns: 34px minmax(160px, .7fr) minmax(220px, 1.3fr) auto; align-items: center; gap: 12px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: #fbfcfe; }
.ocr-index { display: grid; place-items: center; width: 28px; height: 28px; color: var(--primary); border-radius: 8px; background: var(--primary-soft); font-size: 11px; font-weight: 800; }
.ocr-source { min-width: 0; }
.ocr-source b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.ocr-source small { color: var(--muted); font-size: 10px; }
.ocr-row input { width: 100%; min-height: 39px; padding: 8px 10px; outline: none; border: 1px solid var(--line); border-radius: 8px; }
.confidence { color: var(--success); font-size: 11px; font-weight: 700; }
.claim-recognition-progress { margin: 0 0 16px; color: var(--primary); font-size: 12px; line-height: 1.8; }
.ocr-file-result { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.ocr-file-result .ocr-row { border: 0; border-radius: 0; }
.ocr-company-input { width: 100%; min-height: 60px; padding: 8px 10px; outline: none; border: 1px solid var(--line); border-radius: 8px; font: inherit; font-size: 13px; line-height: 1.65; resize: vertical; }
.ocr-company-input:focus { border-color: var(--primary); }
.ocr-status { color: var(--success); font-size: 11px; font-weight: 700; }
.ocr-status.needs-review, .ocr-error { color: #a96913; }
.ocr-error { margin: 4px 16px; font-size: 12px; line-height: 1.8; }
.ocr-file-actions { display: flex; gap: 16px; padding: 8px 16px; }
.ocr-raw { margin: 0 16px 12px; }
.ocr-candidates { padding: 0 16px; }
.notice { display: flex; align-items: center; gap: 10px; margin-top: 14px; padding: 11px 13px; border-radius: 10px; font-size: 12px; }
.notice b { white-space: nowrap; }
.notice span { flex: 1; color: #5c687d; }
.notice.warning { color: #9f5b08; border: 1px solid #f6d99d; background: var(--warning-soft); }
.notice.info { color: var(--primary); border: 1px solid #c5d8fb; background: var(--primary-soft); }
.match-summary { display: grid; grid-template-columns: auto 1fr; gap: 15px; align-items: center; }
.match-icon { display: grid; place-items: center; width: 50px; height: 50px; border-radius: 15px; background: var(--primary-soft); font-size: 24px; }
.match-summary h3 { margin: 0 0 6px; font-size: 16px; }
.match-summary p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.7; }
.match-meta { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 9px; }
.match-meta span { padding: 5px 8px; color: #4d5d78; border-radius: 7px; background: #f1f4f8; font-size: 10px; }
.progress-track { height: 8px; overflow: hidden; border-radius: 999px; background: #e9edf4; }
.progress-track i { display: block; width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #2764eb, #54a1ff); transition: width .35s ease; }
.operation-steps { display: grid; gap: 8px; margin-top: 17px; }
.operation-step { display: flex; align-items: center; gap: 10px; color: #8a95a8; font-size: 12px; }
.operation-step i { display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: #e5e9f0; font-style: normal; font-size: 10px; }
.operation-step.is-done { color: var(--success); }
.operation-step.is-done i { color: #fff; background: var(--success); }
.operation-step.is-active { color: var(--primary); font-weight: 700; }
.operation-step.is-active i { color: #fff; background: var(--primary); animation: pulse 1s infinite; }

.metric-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.metric { display: flex; min-height: 112px; flex-direction: column; justify-content: center; padding: 18px; border: 1px solid var(--line); border-radius: 15px; background: #fff; box-shadow: 0 9px 25px rgba(28,53,94,.05); }
.metric span { color: var(--muted); font-size: 11px; }
.metric b { margin: 7px 0 4px; font-size: 25px; }
.metric b.amber { color: var(--warning); }
.metric b.green { color: var(--success); }
.metric small { color: #9aa4b5; font-size: 10px; }
.search-row { display: flex; gap: 10px; }
.search-input { position: relative; display: flex; flex: 1; align-items: center; }
.search-input > span { position: absolute; left: 12px; z-index: 1; color: #91a0b5; }
.search-input input { width: 100%; height: 44px; padding: 9px 12px 9px 36px; outline: none; border: 1px solid var(--line); border-radius: 10px; background: #fff; transition: .16s ease; }
.search-input.standalone { max-width: 680px; }
.suggestions { position: absolute; z-index: 8; top: calc(100% + 6px); left: 0; right: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 10px; background: #fff; box-shadow: 0 15px 35px rgba(28,53,94,.14); }
.suggestion { display: block; width: 100%; padding: 11px 13px; text-align: left; border: 0; border-bottom: 1px solid #edf0f5; background: #fff; cursor: pointer; font-size: 12px; }
.suggestion:last-child { border-bottom: 0; }
.suggestion:hover { color: var(--primary); background: #f5f8ff; }
.suggestion small { display: block; margin-top: 4px; color: var(--muted); font-size: 11px; }
.sealed-search-row { display: flex; align-items: flex-start; gap: 10px; }
.sealed-search-row .search-input { min-width: 0; }
.sealed-search-row .button { flex-shrink: 0; }
.search-feedback { margin: 10px 0 0; color: var(--muted); font-size: 12px; line-height: 1.7; }
.search-feedback.is-error { color: #b91c1c; }
.filter-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 15px; }
.filter-chip { min-height: 40px; padding: 8px 13px; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; background: #fff; cursor: pointer; font-size: 12px; }
.filter-chip.is-active { color: var(--primary); border-color: #a9c4fa; background: var(--primary-soft); }
.table-card { padding-bottom: 12px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 12px; }
th { padding: 11px 12px; text-align: left; color: #8792a5; border-bottom: 1px solid var(--line); background: #fafbfd; font-size: 10px; font-weight: 700; white-space: nowrap; }
td { padding: 13px 12px; border-bottom: 1px solid #edf0f4; vertical-align: middle; }
tbody tr:hover { background: #fbfcff; }
.company-cell { min-width: 220px; }
.company-cell b { display: block; font-size: 12px; }
.company-cell small { display: block; margin-top: 4px; color: #9aa4b4; font-size: 10px; }
.status-tag { display: inline-flex; padding: 5px 8px; border-radius: 999px; font-size: 10px; font-weight: 700; white-space: nowrap; }
.status-tag.claimed { color: var(--primary); background: var(--primary-soft); }
.status-tag.expiring { color: var(--warning); background: var(--warning-soft); }
.status-tag.fixed { color: var(--success); background: var(--success-soft); }
.status-tag.public { color: #6e798b; background: #eff2f5; }
.remaining { font-weight: 700; white-space: nowrap; }
.remaining.amber { color: var(--warning); }
.remaining.green { color: var(--success); }
.empty-state { display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 7px; padding: 42px; color: var(--muted); }
.empty-state > span { font-size: 27px; }
.empty-state small { color: #9ba5b5; }
.selected-customer { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 13px; padding: 14px 15px; border: 1px solid #bcd3fb; border-radius: 12px; background: #f4f8ff; }
.selected-customer b { display: block; margin-bottom: 5px; font-size: 13px; }
.selected-customer small { color: var(--muted); font-size: 10px; }
.selected-customer small + small { display: block; margin-top: 5px; }

.footer-note { margin-top: 18px; padding: 0 8px; color: #7f8a9d; font-size: 11px; line-height: 1.8; text-align: center; }
.footer-note span { margin-right: 6px; color: var(--success); font-weight: 800; }

.modal { position: fixed; z-index: 100; inset: 0; display: grid; place-items: center; padding: 18px; background: rgba(13,25,49,.57); backdrop-filter: blur(5px); }
.modal-card { position: relative; width: min(440px, 100%); padding: 31px; border-radius: 20px; background: #fff; box-shadow: 0 30px 80px rgba(7,24,58,.28); animation: modalIn .24s ease; }
.modal-card > p { margin: 9px 0 21px; color: var(--muted); font-size: 12px; line-height: 1.7; }
.modal-logo { display: grid; place-items: center; width: 52px; height: 52px; margin-bottom: 16px; color: white; border-radius: 15px; background: linear-gradient(135deg, var(--primary-dark), #4385f4); font-size: 13px; font-weight: 900; }
.modal-close, .icon-button { display: grid; place-items: center; width: 32px; height: 32px; border: 0; border-radius: 9px; color: #738096; background: #f1f4f8; cursor: pointer; font-size: 20px; }
.modal-close { position: absolute; top: 15px; right: 15px; }
.modal form { display: grid; gap: 15px; }
.login-note { display: flex; align-items: flex-start; gap: 8px; padding: 10px; color: #667289; border-radius: 9px; background: #f4f7fb; font-size: 10px; line-height: 1.6; }
.login-note span { display: grid; place-items: center; width: 16px; height: 16px; flex: 0 0 auto; color: #fff; border-radius: 50%; background: #7992b8; font-size: 9px; font-weight: 900; }
.login-test-consent { display: flex; gap: 9px; align-items: flex-start; padding: 10px; color: #9f5b08; background: var(--warning-soft); border-radius: 9px; font-size: 11px; line-height: 1.7; }
.login-test-consent input { margin-top: 4px; flex: 0 0 auto; }
.crm-error { margin: 0; color: var(--danger); font-size: 12px; line-height: 1.7; overflow-wrap: anywhere; }
#crmConnectionNotice { margin: 0 0 16px; flex-wrap: wrap; line-height: 1.7; }
#crmConnectionMessage { min-width: 180px; overflow-wrap: anywhere; }
#claimMatchSummary h3, #sealedSelectedCustomer b { overflow-wrap: anywhere; }

.activity-drawer { position: fixed; z-index: 96; top: 0; left: 0; width: min(420px, 92vw); height: 100vh; height: 100dvh; overflow-y: auto; padding: 25px; background: #fff; box-shadow: 20px 0 60px rgba(9,27,61,.16); visibility: hidden; transform: translateX(-104%); transition: transform .25s ease; }
.activity-drawer.is-open { visibility: visible; transform: translateX(0); }
body.drawer-open { overflow: hidden; }
.drawer-mask { position: fixed; z-index: 95; inset: 0; background: rgba(13,25,49,.38); }
.drawer-head { display: flex; align-items: flex-start; justify-content: space-between; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.drawer-list { display: grid; gap: 12px; padding-top: 16px; }
.log-item { display: grid; grid-template-columns: auto 1fr; gap: 11px; }
.log-dot { width: 10px; height: 10px; margin-top: 5px; border-radius: 50%; background: var(--success); box-shadow: 0 0 0 4px var(--success-soft); }
.log-item b { display: block; margin-bottom: 4px; font-size: 12px; }
.log-item p { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.6; }
.log-item time { display: block; margin-top: 4px; color: #a0a8b7; font-size: 9px; }
.empty-log { padding: 28px 16px; color: var(--muted); border: 1px dashed var(--line); border-radius: 12px; font-size: 11px; text-align: center; }
.toast { position: fixed; z-index: 120; left: 50%; bottom: 28px; min-width: 240px; max-width: min(520px, calc(100vw - 36px)); padding: 12px 18px; color: #fff; border-radius: 11px; background: #18243a; box-shadow: 0 15px 38px rgba(10,25,52,.24); opacity: 0; pointer-events: none; transform: translate(-50%, 14px); transition: .22s ease; font-size: 12px; text-align: center; }
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

@keyframes reveal { from { opacity: 0; transform: translateY(7px); } to { opacity: 1; transform: none; } }
@keyframes modalIn { from { opacity: 0; transform: scale(.96) translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes pulse { 50% { box-shadow: 0 0 0 5px rgba(36,99,235,.13); } }

@media (max-width: 820px) {
  .hero-tools .eyebrow { display: none; }
}

@media (max-width: 640px) {
  .page-shell { width: min(100% - 20px, 1120px); margin-top: 10px; }
  .hero { padding: 18px; border-radius: 18px; }
  .hero-topbar { gap: 12px; margin-bottom: 20px; }
  .hero-actions { flex-direction: column; align-items: flex-end; gap: 6px; }
  .account-button { min-width: 0; max-width: 180px; padding: 8px 9px; gap: 7px; }
  .account-avatar { flex-shrink: 0; width: 29px; height: 29px; border-radius: 9px; font-size: 12px; }
  .account-copy { min-width: 0; }
  .account-copy b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
  .account-copy small { font-size: 10px; }
  .account-logout { min-height: 36px; padding: 6px 10px; font-size: 11px; }
  .activity-button { gap: 5px; padding: 9px 10px; font-size: 11px; }
  .hero h1 { font-size: 29px; }
  .hero p { font-size: 13px; }
  .workspace-switch { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 16px 0; }
  .workspace-button { min-height: 112px; flex-direction: column; align-items: flex-start; gap: 10px; padding: 14px; border-radius: 14px; }
  .workspace-icon { width: 34px; height: 34px; border-radius: 10px; font-size: 19px; }
  .workspace-button b { font-size: 14px; }
  .workspace-button small { font-size: 11px; line-height: 1.5; }
  .subtabs { overflow-x: auto; }
  .subtab { min-width: 145px; white-space: nowrap; }
  .stepper { display: flex; overflow-x: auto; }
  .step { min-width: 158px; }
  .card { padding: 21px 17px; border-radius: 15px; }
  .card-heading { align-items: flex-start; flex-direction: column; }
  .form-grid, .ratio-group { grid-template-columns: 1fr; }
  .result-card, .login-gate { grid-template-columns: 1fr; text-align: left; }
  .ocr-row { grid-template-columns: 30px 1fr; }
  .ocr-row input { grid-column: 1 / -1; }
  .ocr-company-input { grid-column: 1 / -1; }
  .ocr-status { grid-column: 2; }
  .confidence { grid-column: 2; }
  .metric-grid { gap: 8px; }
  .metric { min-width: 0; min-height: 100px; padding: 12px 10px; overflow-wrap: anywhere; }
  .metric b { font-size: 22px; }
  .search-row { flex-direction: column; }
  .actions.split { align-items: stretch; flex-direction: column-reverse; }
  .actions .button { width: 100%; }
  .selected-customer { align-items: flex-start; flex-direction: column; }
}

.new-customer-fields { margin: 22px 0; padding-top: 20px; border-top: 1px solid var(--line); }
.new-customer-fields h3 { margin: 0 0 8px; }
.new-customer-fields p { color: var(--muted); font-size: 13px; line-height: 1.7; }
.new-customer-fields #claimRegionHint { margin: 0; }
.contract-consent { display: flex; align-items: flex-start; gap: 10px; margin: 16px 0; color: var(--muted); font-size: 13px; line-height: 1.7; cursor: pointer; }
.contract-consent input { flex: 0 0 auto; width: 17px; height: 17px; margin-top: 3px; accent-color: var(--primary); }
.result-card.is-warning { background: var(--warning-soft); border-color: #efd19a; }
.result-card.is-warning .result-mark { color: var(--warning); background: #fff0cf; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
