:root {
  color-scheme: light;
  --ink: #202b34;
  --muted: #6d7981;
  --line: #dce3e7;
  --paper: #f3f6f7;
  --teal: #145d5c;
  --teal-dark: #0d4948;
  --soft-teal: #e4f2ef;
  --orange: #9a4d18;
  --soft-orange: #fff3e8;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 15px/1.55 "Segoe UI", Arial, sans-serif; }
.shell { width: min(880px, calc(100% - 36px)); margin: 46px auto 56px; }
header { margin: 0 0 25px; }
.eyebrow { color: var(--teal); font-size: 11px; font-weight: 750; letter-spacing: .12em; text-transform: uppercase; }
h1 { margin: 7px 0 3px; font-size: clamp(28px, 5vw, 39px); line-height: 1.15; letter-spacing: -.035em; }
h2 { margin: 2px 0 4px; font-size: 20px; line-height: 1.3; letter-spacing: -.02em; }
p { margin: 0; }
.subtitle { color: var(--muted); font-size: 16px; }
.notice, .connection { display: flex; align-items: center; gap: 12px; padding: 13px 16px; border-radius: 12px; margin: 0 0 16px; }
.notice { background: var(--soft-teal); color: var(--teal-dark); }
.notice div { display: grid; }
.notice span:not(.notice-dot) { font-size: 13px; }
.notice-dot { width: 10px; height: 10px; border-radius: 50%; background: #24846d; box-shadow: 0 0 0 4px #cce7de; flex: none; }
.connection { display: block; color: var(--muted); background: #fff; border: 1px solid var(--line); font-size: 13px; }
.connection.connected { border-color: #b4dace; color: var(--teal-dark); }
.connection.disconnected { border-color: #ead1bd; color: var(--orange); }
.overview-card { padding-bottom: 20px; }
.connections-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.connection-item { display: grid; gap: 4px; border: 1px solid var(--line); border-radius: 10px; padding: 11px 13px; font-size: 13px; }
.connection-state { color: var(--muted); }
.connection-state.connected { color: var(--teal-dark); }
.connection-state.disconnected { color: var(--orange); }
.summary-heading { margin: 20px 0 10px; }
.step-summary { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.step-status { min-width: 0; border: 1px solid var(--line); border-radius: 10px; padding: 10px; display: grid; align-content: start; gap: 6px; }
.step-status strong { font-size: 12px; line-height: 1.35; }
.status-label { font-size: 12px; font-weight: 700; }
.status-label.ready, .status-label.checked, .status-label.recorded { color: var(--teal-dark); }
.status-label.error, .status-label.stale { color: var(--orange); }
.warning-badge { width: fit-content; border-radius: 999px; padding: 2px 8px; color: #834014; background: var(--soft-orange); font-size: 10px; font-weight: 700; }
.import-card[aria-disabled="true"] { opacity: .63; }
.technical-details { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 11px; }
.technical-details summary { cursor: pointer; color: var(--muted); font-size: 12px; }
.import-card .accrual-result { margin-bottom: 0; }
.card { background: white; border: 1px solid var(--line); border-radius: 16px; padding: 23px; margin: 0 0 16px; box-shadow: 0 5px 20px #20343c08; }
.step { display: flex; align-items: flex-start; gap: 13px; margin-bottom: 19px; }
.step > span { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; color: white; background: var(--teal); font-weight: 700; flex: none; }
.step p { color: var(--muted); font-size: 13px; margin-top: 5px; }
.drop { min-height: 142px; border: 1px dashed #aab9bc; border-radius: 12px; background: #fafcfc; display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 5px; cursor: pointer; text-align: center; padding: 20px; transition: border-color .15s, background .15s; }
.drop:hover { border-color: var(--teal); background: #f4faf8; }
.drop > span:last-child { color: var(--muted); font-size: 12px; }
.upload-icon { display: grid; place-items: center; width: 33px; height: 33px; border-radius: 10px; margin-bottom: 3px; background: var(--soft-teal); color: var(--teal); font-size: 21px; }
input[type=file] { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.button { border: 0; border-radius: 9px; padding: 11px 16px; font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; transition: background .15s, opacity .15s; }
.button:disabled { opacity: .5; cursor: not-allowed; }
.primary { color: white; background: var(--teal); }
.primary:hover:not(:disabled) { background: var(--teal-dark); }
form > .button { margin-top: 14px; }
.quiet { background: #edf2f3; color: var(--ink); }
.quiet:hover { background: #e2e9ea; }
.hidden { display: none; }
.section-heading { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 16px; }
.target { border-radius: 10px; background: #f2f6f6; padding: 12px 14px; display: grid; gap: 2px; margin-bottom: 14px; }
.target strong { font-size: 14px; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.metrics { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; margin: 15px 0 9px; }
.metric { border: 1px solid var(--line); border-radius: 10px; padding: 10px 11px; min-width: 0; }
.metric-label { display: block; color: var(--muted); font-size: 11px; }
.metric-value { display: block; font-size: 21px; margin-top: 4px; }
.warning, .success { border-radius: 10px; padding: 12px 14px; margin-top: 12px; font-size: 13px; }
.warning { color: #834014; background: var(--soft-orange); border: 1px solid #f0d5bd; }
.success { color: var(--teal-dark); background: var(--soft-teal); border: 1px solid #b4dace; }
.preserved-note { display: grid; gap: 3px; border-radius: 10px; padding: 11px 14px; margin-top: 12px; color: #385d4e; background: #eef7f0; border: 1px solid #cce4d1; font-size: 12px; }
.raw-diff { display: grid; gap: 4px; padding: 12px 14px; margin-top: 13px; border: 1px solid var(--line); border-radius: 10px; background: #fafcfc; font-size: 13px; }
.raw-diff span { display: block; }
.accrual-result { margin-top: 18px; padding-top: 17px; border-top: 1px solid var(--line); }
.field-diff-list { margin: 5px 0 12px; padding-left: 19px; color: var(--muted); }
.diff-item { margin-bottom: 8px; }
.diff-details { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 12px; }
.diff-details summary { cursor: pointer; color: var(--teal); font-weight: 650; font-size: 13px; }
.diff-list { margin: 10px 0 0; padding-left: 20px; color: var(--muted); font-size: 12px; max-height: 230px; overflow: auto; }
.actions { display: flex; align-items: center; gap: 13px; flex-wrap: wrap; margin-top: 18px; }
.history-card { padding-bottom: 12px; }
.history { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: 12px; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { color: var(--muted); font-weight: 650; }
footer { padding: 5px 2px; color: var(--muted); font-size: 12px; }
@media (max-width: 620px) {
  .shell { width: min(100% - 22px, 880px); margin: 24px auto 34px; }
  .card { padding: 17px; border-radius: 13px; }
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .metric:last-child { grid-column: span 2; }
  .section-heading { align-items: flex-start; }
  .step-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .step-status:last-child { grid-column: span 2; }
  .connections-grid { grid-template-columns: 1fr; }
}
.login-shell { max-width: 540px; }
.login-form { display: grid; gap: 1rem; }
.login-form label { display: grid; gap: .4rem; font-weight: 600; }
.login-form input { width: 100%; padding: .7rem; border: 1px solid #bbc7d1; border-radius: .5rem; font: inherit; }
