:root {
  color-scheme: light;
  --paper: #f7f8fa;
  --ink: #172844;
  --mute: #526179;
  --line: #d7dfe9;
  --blue: #224dc3;
  --sans: "DM Sans", "Segoe UI", Arial, sans-serif;
  --serif: "STIX Two Text", Georgia, serif;
  font-family: var(--sans);
  color: var(--ink);
  background: var(--paper);
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-height: 100vh; }
button, select, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button, label.file-trigger, select { touch-action: manipulation; }
button { cursor: pointer; }
button:disabled { cursor: default; }
:focus-visible, .file-trigger:focus-within { outline: 3px solid #6c93ef; outline-offset: 3px; }
h1, h2, h3, p, figure, ol { margin: 0; }
.shell { max-width: 1272px; width: calc(100% - clamp(40px, 11vw, 156px)); margin-inline: auto; }
.masthead { background: white; border-bottom: 1px solid var(--line); }
.masthead-inner { min-height: 73px; display: flex; justify-content: space-between; align-items: center; gap: 20px; }
.wordmark { display: inline-flex; align-items: center; gap: 12px; color: var(--ink); text-decoration: none; font-size: 22px; font-weight: 680; letter-spacing: -.055em; }
.mark { width: 27px; height: 30px; position: relative; display: block; }
.mark i { display: block; position: absolute; width: 18px; height: 18px; transform: scaleY(.56) rotate(45deg); background: var(--blue); left: 4px; top: 0; z-index: 3; }
.mark i:nth-child(2) { z-index: 2; top: 6px; background: #5279cf; }
.mark i:nth-child(3) { z-index: 1; top: 12px; background: #8da7e0; }
nav, .actions, .preview-head, .source-row { display: flex; align-items: center; }
nav { gap: 24px; }
nav a, .text-btn { color: var(--mute); font-size: 13px; font-weight: 600; }
nav a { text-decoration: none; }
nav a:hover, .text-btn:hover { color: var(--blue); text-decoration: underline; }
.text-btn { padding: 4px 0; background: transparent; border: 0; }
.intro { padding-block: clamp(36px, 5.2vw, 72px) 36px; }
.section-code { color: var(--blue); font-size: 11px; font-weight: 750; letter-spacing: .12em; text-transform: uppercase; display: flex; align-items: center; gap: 10px; }
.rule { width: 22px; height: 2px; background: currentColor; }
h1, .report-preview h2, .access-panel h1 { font-family: var(--serif); font-weight: 400; }
.intro h1 { margin: 15px 0 15px; font-size: clamp(48px, 5.3vw, 80px); line-height: .98; letter-spacing: -.052em; }
.accent { color: var(--blue); }
.intro p { color: var(--mute); font-size: clamp(15px, 1.18vw, 18px); line-height: 1.55; max-width: 640px; }
.workflow-layout { display: grid; grid-template-columns: minmax(0, 1.62fr) minmax(300px, 1fr); align-items: start; gap: clamp(20px, 2.4vw, 34px); padding-bottom: 64px; }
.work-card, .report-preview, .access-panel { border: 1px solid var(--line); border-radius: 12px; min-width: 0; }
.work-card, .access-panel { background: white; box-shadow: 0 5px 20px #18284506; }
.card-head { padding: 23px clamp(19px, 2.5vw, 34px) 18px; border-bottom: 1px solid var(--line); }
.card-head h2 { font-size: 25px; letter-spacing: -.035em; font-weight: 620; }
.stepper { display: flex; gap: 10px; align-items: center; color: var(--mute); list-style: none; padding: 0; margin-top: 12px; font-size: 12px; }
.stepper [aria-current] { color: var(--blue); font-weight: 720; }
.step-line { width: 20px; height: 1px; background: #c6d0df; }
.card-body { padding: 24px clamp(19px, 2.5vw, 34px) 28px; }
.card-body h3 { font-size: 18px; font-weight: 630; letter-spacing: -.025em; }
.helper, .source-row, .preview-items p { color: var(--mute); line-height: 1.52; font-size: 14px; }
.helper { margin-top: 6px; }
.file-zone { display: flex; align-items: center; gap: 14px; min-height: 104px; padding: 17px; margin: 21px 0; border: 1px dashed #91a4c4; border-radius: 8px; background: #fafbfd; }
.file-zone.dragging { background: #eaf1ff; border-color: var(--blue); }
.upload-mark { display: grid; place-items: center; flex: 0 0 40px; height: 40px; border: 1px solid #ced8e7; border-radius: 10px; color: var(--blue); background: #fff; font-size: 24px; line-height: 1; }
.file-zone > div { min-width: 0; }
.file-zone strong, .file-zone small { display: block; overflow-wrap: anywhere; }
.file-zone strong { font-size: 15px; font-weight: 620; }
.file-zone small { color: var(--mute); margin-top: 4px; font-size: 12px; }
.file-trigger { position: relative; overflow: hidden; color: var(--blue); font-size: 13px; font-weight: 650; border-radius: 4px; margin-left: auto; white-space: nowrap; padding: 7px 3px; text-decoration: underline; text-underline-offset: 3px; }
.file-trigger input { position: absolute; inset: 0; opacity: 0; width: 100%; cursor: pointer; }
.actions { gap: 10px; flex-wrap: wrap; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 13px; min-height: 43px; padding: 10px 16px; border: 1px solid transparent; border-radius: 6px; font-size: 14px; line-height: 1.35; font-weight: 650; text-decoration: none; }
.button.primary { color: white; background: var(--blue); border-color: var(--blue); }
.button.primary:hover:not(:disabled) { background: #143baa; }
.button.primary:disabled { color: #647189; background: #e6ebf2; border-color: #e6ebf2; }
.button.secondary { color: var(--ink); background: white; border-color: #c4cedc; }
.button.secondary:hover:not(:disabled) { background: var(--paper); }
.button.secondary:disabled, .text-btn:disabled { opacity: .58; }
.report-preview { background: #edf2f8; padding: 24px clamp(19px, 2vw, 28px) 25px; }
.preview-head { justify-content: space-between; gap: 8px; }
.report-preview .section-code { font-size: 10px; letter-spacing: .1em; }
.format { border: 1px solid #c1ccdc; color: #4a5870; border-radius: 4px; padding: 3px 6px; font-size: 10px; letter-spacing: .06em; font-weight: 700; }
.report-preview h2 { font-size: clamp(26px, 2.2vw, 34px); line-height: 1.13; letter-spacing: -.04em; margin: 13px 0 18px; }
.sample-chart { background: #ffffffc9; border: 1px solid #d5deeb; border-radius: 6px; padding: 14px; margin-bottom: 20px; }
figcaption { margin-bottom: 9px; }
figcaption strong, figcaption small { display: block; }
figcaption strong { font-size: 13px; }
figcaption small { margin-top: 3px; color: var(--mute); font-size: 11px; }
.bar-row { display: grid; grid-template-columns: 39px minmax(40px, 1fr) 63px; align-items: center; gap: 5px; font-size: 11.5px; }
.bar-row b { font-size: 11px; text-align: right; font-variant-numeric: tabular-nums; }
.bar-track { position: relative; height: 21px; }
.bar-track::before { content: ""; position: absolute; top: 0; bottom: 0; left: 25%; width: 1px; background: #abb9cb; }
.bar-track i { position: absolute; height: 7px; top: 7px; }
.pos { background: var(--blue); left: 25%; width: 75%; }
.zero { background: #8795a7; left: 25%; width: 2px; }
.neg { background: #b2614d; left: 0; width: 25%; }
.preview-items > div { border-top: 1px solid #cdd8e6; padding: 10px 0 0; margin-top: 10px; }
.preview-items h3 { font-size: 13px; font-weight: 660; }
.preview-items p { font-size: 12px; margin-top: 3px; }
.source-row { justify-content: space-between; gap: 12px; margin-top: 6px; }
#source-name { overflow-wrap: anywhere; }
.source-row button { color: var(--blue); flex-shrink: 0; }
.mapping-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin: 22px 0; }
.field.wide { grid-column: 1 / -1; }
.field label, #login-form label { display: block; font-size: 13px; font-weight: 650; margin-bottom: 6px; }
.field label span { font-weight: 400; color: var(--mute); }
select, #password { width: 100%; color: var(--ink); border: 1px solid #adbccd; min-height: 42px; border-radius: 5px; background: white; padding: 8px 10px; }
select:disabled { background: var(--paper); }
.result-symbol { display: grid; place-items: center; width: 37px; height: 37px; border-radius: 50%; background: #e1efea; color: #20694f; font-size: 21px; margin-bottom: 13px; }
.ai-option { display: flex; align-items: flex-start; gap: 10px; margin: 0 0 20px; padding: 13px; border-radius: 6px; background: #f0f4fb; }
.ai-option input { width: 17px; height: 17px; margin: 2px 0 0; flex-shrink: 0; accent-color: var(--blue); }
.ai-option label { font-size: 14px; font-weight: 650; cursor: pointer; }
.ai-option p { font-size: 12px; line-height: 1.5; color: var(--mute); margin-top: 4px; }
#result-panel .actions { margin-top: 20px; }
.message, .error { margin: 0 clamp(19px, 2.5vw, 34px) 22px; line-height: 1.5; font-size: 14px; overflow-wrap: anywhere; }
.message { color: var(--blue); }
.error { border-left: 3px solid #a43536; background: #fdf2f0; color: #832d2d; padding: 10px 12px; }
.access-panel { max-width: 475px; margin: clamp(45px, 10vh, 105px) auto; padding: clamp(25px, 5vw, 43px); }
.access-panel h1 { font-size: 35px; letter-spacing: -.04em; }
.access-panel p { margin: 12px 0 18px; color: var(--mute); font-size: 14px; line-height: 1.6; }
#login-form { margin-top: 22px; }
#login-form .button { margin-top: 16px; }
#login-error { color: #832d2d; }
@media (min-width: 1450px) { .intro h1 br { display: none; } }
@media (max-width: 920px) {
  .shell { width: calc(100% - 48px); }
  .workflow-layout { grid-template-columns: minmax(0, 1.45fr) minmax(260px, 1fr); gap: 16px; }
  .file-zone { flex-wrap: wrap; }
}
@media (max-width: 740px) {
  .workflow-layout { grid-template-columns: 1fr; padding-bottom: 30px; }
  .masthead-inner { min-height: 60px; }
  nav { gap: 12px; }
  nav a, nav button { font-size: 12px !important; }
  .intro { padding-block: 36px 25px; }
  .section-code { font-size: 10px; }
  .preview-items p { font-size: 13px; }
}
@media (max-width: 470px) {
  .shell { width: calc(100% - 30px); }
  .wordmark { font-size: 19px; gap: 6px; }
  nav { max-width: 51%; justify-content: flex-end; flex-wrap: wrap; gap: 2px 12px; }
  .file-zone { gap: 10px; }
  .file-trigger { margin-left: 0; }
  .mapping-grid { grid-template-columns: 1fr; gap: 13px; }
  .actions .button { min-height: 42px; padding: 9px 13px; }
}
