:root {
  --ink: #14283b;
  --navy: #17324d;
  --teal: #087a78;
  --teal-dark: #05615f;
  --teal-pale: #e7f3f2;
  --paper: #fbfaf7;
  --white: #ffffff;
  --line: #dce3e7;
  --muted: #687885;
  --danger: #a43c42;
  --danger-pale: #faecec;
  --shadow: 0 18px 50px rgba(26, 48, 67, .08);
  --radius: 18px;
}

* { box-sizing: border-box; }
html { font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; color: var(--ink); background: var(--paper); }
body { margin: 0; min-height: 100vh; background-image: linear-gradient(rgba(23,50,77,.025) 1px, transparent 1px), linear-gradient(90deg, rgba(23,50,77,.025) 1px, transparent 1px); background-size: 32px 32px; }
a { color: inherit; }
button, input { font: inherit; }

.site-header { min-height: 82px; padding: 15px max(24px, calc((100vw - 1180px)/2)); background: rgba(255,255,255,.94); border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; gap: 24px; }
.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; }
.brand-mark { display: grid; place-items: center; width: 44px; height: 44px; background: var(--navy); color: white; border-radius: 12px; font-weight: 800; letter-spacing: -.04em; }
.brand strong, .brand small { display: block; }
.brand strong { font-size: 17px; }
.brand small { color: var(--muted); margin-top: 2px; }
.user-area { display: flex; align-items: center; gap: 18px; }
.user-meta { text-align: right; }
.user-meta strong, .user-meta span { display: block; }
.user-meta span { color: var(--muted); font-size: 13px; margin-top: 3px; }
.page-shell { width: min(1180px, calc(100% - 40px)); margin: 0 auto; padding: 64px 0 80px; }
.site-footer { border-top: 1px solid var(--line); padding: 24px; text-align: center; color: var(--muted); font-size: 13px; background: rgba(255,255,255,.7); }

h1, h2, h3, p { margin-top: 0; }
h1 { font-family: Georgia, "Times New Roman", serif; font-size: clamp(42px, 6vw, 72px); line-height: .98; letter-spacing: -.045em; margin-bottom: 24px; color: var(--navy); }
h2 { font-family: Georgia, "Times New Roman", serif; font-size: clamp(30px, 4vw, 44px); letter-spacing: -.035em; margin-bottom: 14px; color: var(--navy); }
h3 { font-size: 18px; margin-bottom: 8px; }
p { color: var(--muted); line-height: 1.65; }
.eyebrow { display: inline-block; margin-bottom: 18px; color: var(--teal); font-size: 12px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }

.button { display: inline-flex; justify-content: center; align-items: center; min-height: 46px; padding: 0 20px; border-radius: 11px; border: 1px solid transparent; font-weight: 750; text-decoration: none; cursor: pointer; transition: transform .16s ease, background .16s ease; }
.button:hover { transform: translateY(-1px); }
.button-primary { background: var(--teal); color: white; }
.button-primary:hover { background: var(--teal-dark); }
.button:disabled, .button:disabled:hover { opacity: .48; cursor: not-allowed; transform: none; }
.button-primary:disabled, .button-primary:disabled:hover { background: var(--teal); }
.button-secondary { border-color: var(--navy); color: var(--navy); background: transparent; }
.button-quiet { border-color: var(--line); background: white; color: var(--ink); }
.button-row { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 30px; }

.login-layout { display: grid; grid-template-columns: 1.1fr .9fr; min-height: 620px; background: var(--white); border: 1px solid var(--line); border-radius: 26px; overflow: hidden; box-shadow: var(--shadow); }
.intro-panel { padding: clamp(40px, 7vw, 82px); background: var(--navy); display: flex; flex-direction: column; justify-content: center; position: relative; overflow: hidden; }
.intro-panel::after { content: ""; position: absolute; width: 320px; height: 320px; border: 70px solid rgba(255,255,255,.045); border-radius: 50%; right: -130px; bottom: -120px; }
.intro-panel h1 { color: white; font-size: clamp(42px, 5vw, 66px); max-width: 680px; }
.intro-panel p { color: #c8d5df; max-width: 580px; font-size: 18px; }
.intro-panel .eyebrow { color: #7ed2ce; }
.safety-line { color: white; margin-top: 52px; font-size: 14px; display: flex; align-items: center; gap: 10px; }
.safety-line span { width: 9px; height: 9px; background: #6dd3a8; border-radius: 50%; box-shadow: 0 0 0 5px rgba(109,211,168,.13); }
.login-card { padding: clamp(36px, 6vw, 70px); display: flex; flex-direction: column; justify-content: center; }
.login-card h2 { font-size: 34px; }
.oidc-button { width: 100%; margin-top: 12px; }
.dev-login-section { margin-top: 34px; padding-top: 28px; border-top: 1px solid var(--line); }
.dev-login-section h3 { margin-bottom: 5px; }
.dev-login-section > p { margin-bottom: 0; font-size: 14px; }
.profile-list { display: grid; gap: 12px; margin-top: 24px; }
.profile-option { width: 100%; display: grid; grid-template-columns: 44px 1fr auto; gap: 14px; align-items: center; padding: 15px; border: 1px solid var(--line); border-radius: 14px; background: white; text-align: left; cursor: pointer; color: var(--ink); }
.profile-option:hover { border-color: var(--teal); background: var(--teal-pale); }
.profile-option strong, .profile-option small { display: block; }
.profile-option small { margin-top: 4px; color: var(--muted); }
.avatar { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 50%; background: var(--teal-pale); color: var(--teal-dark); font-weight: 800; }

.hero { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 70px; align-items: center; padding: 34px 0 76px; }
.hero > div > p { max-width: 700px; font-size: 18px; }
.status-card { padding: 28px; background: white; border: 1px solid var(--line); border-top: 4px solid var(--teal); border-radius: var(--radius); box-shadow: var(--shadow); display: flex; gap: 15px; }
.status-card small, .status-card strong { display: block; }
.status-card small { color: var(--muted); text-transform: uppercase; letter-spacing: .1em; font-size: 10px; margin-bottom: 5px; }
.status-card p { margin: 8px 0 0; font-size: 14px; line-height: 1.5; }
.status-dot { flex: 0 0 auto; width: 11px; height: 11px; margin-top: 5px; border-radius: 50%; background: #6bc49b; box-shadow: 0 0 0 5px #e8f6ef; }
.metric-grid { display: grid; grid-template-columns: repeat(3, 1fr); background: white; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.metric-grid article { padding: 28px 30px; position: relative; border-right: 1px solid var(--line); }
.metric-grid article:last-child { border-right: 0; }
.metric-grid article > span { position: absolute; top: 16px; right: 18px; font-family: Georgia, serif; color: #d7e0e5; font-size: 27px; }
.metric-grid small, .metric-grid strong { display: block; }
.metric-grid small { color: var(--muted); margin-bottom: 10px; }
.metric-grid strong { font-family: Georgia, serif; font-size: 26px; color: var(--navy); }
.process-section, .history-section { padding-top: 76px; }
.section-heading { max-width: 650px; margin-bottom: 30px; }
.section-heading .eyebrow { margin-bottom: 10px; }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.steps article { padding: 28px; background: white; border: 1px solid var(--line); border-radius: var(--radius); }
.steps article > span { display: grid; place-items: center; width: 38px; height: 38px; margin-bottom: 26px; border-radius: 10px; background: var(--teal-pale); color: var(--teal-dark); font-weight: 800; }
.steps p { margin-bottom: 0; }
.history-list { background: white; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.history-list a { display: flex; justify-content: space-between; gap: 20px; align-items: center; padding: 20px 24px; text-decoration: none; border-bottom: 1px solid var(--line); }
.history-list a:last-child { border-bottom: 0; }
.history-list a:hover { background: #f7fafb; }
.history-list strong, .history-list small { display: block; }
.history-list small { color: var(--muted); margin-top: 4px; }
.result-count { color: var(--teal-dark); font-weight: 700; }
.access-denied { display: flex; gap: 18px; padding: 28px; border: 1px solid #eccbcd; background: var(--danger-pale); border-radius: var(--radius); }
.access-denied h2 { font-family: inherit; font-size: 21px; margin-bottom: 6px; }
.access-denied p { margin: 0; }
.lock-symbol { display: grid; place-items: center; flex: 0 0 auto; width: 40px; height: 40px; border-radius: 50%; background: var(--danger); color: white; font-weight: 800; }

.breadcrumb { display: flex; gap: 10px; color: var(--muted); font-size: 14px; margin-bottom: 46px; }
.breadcrumb a { color: var(--teal-dark); }
.narrow-header { max-width: 720px; }
.narrow-header h1, .preview-header h1 { font-size: clamp(42px, 6vw, 62px); }
.upload-card { max-width: 820px; margin-top: 34px; padding: 28px; background: white; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.dropzone { min-height: 260px; border: 2px dashed #aabac4; border-radius: 14px; background: #f8fafb; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; text-align: center; cursor: pointer; transition: border-color .15s ease, background .15s ease; }
.dropzone:hover { border-color: var(--teal); background: var(--teal-pale); }
.upload-prompt { display: flex; flex-direction: column; align-items: center; gap: 8px; color: var(--muted); }
.upload-prompt strong { color: var(--navy); }
.upload-icon { display: grid; place-items: center; width: 48px; height: 48px; margin-bottom: 10px; border-radius: 50%; background: var(--navy); color: white !important; font-size: 24px; }
.file-input { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; }
.dropzone.has-file { min-height: 190px; border-style: solid; border-color: var(--teal); background: var(--teal-pale); }
.dropzone.is-uploading { opacity: .72; cursor: wait; }
.selected-file { width: min(100% - 40px, 620px); display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 16px; padding: 18px 20px; border: 1px solid #a8d7d4; border-radius: 12px; background: white; text-align: left; color: var(--navy); box-shadow: 0 8px 24px rgba(23,50,77,.08); }
.selected-file[hidden] { display: none; }
.selected-file-icon { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: #dff4ea; color: #08704a; font-size: 20px; font-weight: 800; }
.selected-file small, .selected-file strong, .selected-file span { display: block; }
.selected-file small { margin-bottom: 3px; color: var(--teal-dark); font-weight: 750; text-transform: uppercase; letter-spacing: .06em; }
.selected-file strong { overflow-wrap: anywhere; }
.selected-file #selected-file-size { margin-top: 4px; color: var(--muted); font-size: 13px; }
.selected-file-change { color: var(--teal-dark); font-size: 13px; font-weight: 750; white-space: nowrap; }
.form-actions, .preview-actions { display: flex; justify-content: flex-end; gap: 12px; margin-top: 24px; }
.form-errors { margin-top: 14px; padding: 13px 16px; border-radius: 10px; background: var(--danger-pale); color: var(--danger); }
.form-errors ul { margin: 0; padding-left: 18px; }
.info-strip { max-width: 820px; display: flex; align-items: center; gap: 12px; margin-top: 18px; padding: 16px 20px; border-radius: 12px; background: var(--teal-pale); color: var(--teal-dark); }
.info-strip span { color: #496d6c; }
.info-strip a { margin-left: auto; font-weight: 750; }

.preview-header { display: flex; justify-content: space-between; align-items: flex-end; gap: 40px; }
.score { min-width: 180px; padding: 22px; border-left: 3px solid var(--teal); background: white; }
.score strong, .score span { display: block; }
.score strong { font-family: Georgia, serif; font-size: 38px; color: var(--navy); }
.score span { color: var(--muted); font-size: 13px; }
.summary-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin: 38px 0 20px; }
.summary-grid article { padding: 20px 22px; border: 1px solid var(--line); background: white; border-radius: 12px; }
.summary-grid small, .summary-grid strong { display: block; }
.summary-grid small { color: var(--muted); margin-bottom: 6px; }
.summary-grid strong { font-size: 23px; }
.summary-valid { border-left: 4px solid var(--teal) !important; }
.summary-invalid { border-left: 4px solid var(--danger) !important; }
.table-card { background: white; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { padding: 14px 16px; text-align: left; background: var(--navy); color: white; font-size: 11px; letter-spacing: .07em; text-transform: uppercase; }
td { padding: 16px; border-bottom: 1px solid var(--line); vertical-align: top; }
tbody tr:last-child td { border-bottom: 0; }
.badge { display: inline-block; padding: 4px 8px; border-radius: 999px; font-size: 11px; font-weight: 800; }
.badge-valid { color: #086846; background: #e6f5ee; }
.badge-imported { color: #086846; background: #e6f5ee; }
.badge-invalid, .badge-failed { color: var(--danger); background: var(--danger-pale); }
.error-text { max-width: 280px; color: var(--muted); }
.center-note { text-align: right; margin-top: 12px; font-size: 13px; }
.notice { padding: 14px 18px; margin-bottom: 24px; border: 1px solid #a8d7d4; background: var(--teal-pale); border-radius: 12px; color: var(--teal-dark); }
code { background: rgba(23,50,77,.08); padding: 2px 5px; border-radius: 5px; }

@media (max-width: 800px) {
  .page-shell { width: min(100% - 28px, 1180px); padding-top: 38px; }
  .site-header { padding: 13px 16px; }
  .user-meta { display: none; }
  .login-layout, .hero { grid-template-columns: 1fr; }
  .intro-panel { min-height: 400px; }
  .hero { gap: 28px; padding-bottom: 48px; }
  .metric-grid, .steps, .summary-grid { grid-template-columns: 1fr; }
  .metric-grid article { border-right: 0; border-bottom: 1px solid var(--line); }
  .metric-grid article:last-child { border-bottom: 0; }
  .preview-header { align-items: flex-start; flex-direction: column; }
  .score { width: 100%; }
  .info-strip { align-items: flex-start; flex-direction: column; }
  .info-strip a { margin-left: 0; }
  .selected-file { grid-template-columns: auto 1fr; }
  .selected-file-change { grid-column: 2; white-space: normal; }
  .history-list a { align-items: flex-start; flex-direction: column; }
}
