* { box-sizing: border-box; }
:root {
  --bg: #f6f8f9; --surface: #fff; --ink: #18232b; --muted: #73808a;
  --line: #e7ecef; --accent: #315d70; --accent-dark: #25495a;
  --soft: #eef4f6; --green: #16845b; --shadow: 0 8px 30px rgba(24,35,43,.035);
}
body { margin: 0; background: var(--bg); color: var(--ink); font-family: "DM Sans", Arial, sans-serif; font-size: 14px; }
button, select { font: inherit; }
.app-shell { max-width: 1180px; margin: 28px auto; padding: 0 28px; }
.topbar { height: 70px; display:flex; align-items:center; justify-content:space-between; border-bottom:1px solid var(--line); margin-bottom:38px; }
.brand { display:flex; align-items:center; gap:10px; color:var(--ink); text-decoration:none; font-size:20px; font-weight:700; letter-spacing:-.7px; }
.brand-light { font-weight:500; color:#58798a; }
.brand-mark { width:27px; height:27px; border:2px solid #5c8494; border-radius:50% 50% 45% 45%; display:flex; align-items:center; justify-content:center; gap:2px; transform:scale(.9); }
.brand-mark span { width:6px; height:13px; border:1.5px solid #5c8494; border-top:0; border-radius:0 0 8px 8px; }
.prototype-pill { display:flex; align-items:center; gap:8px; padding:8px 12px; background:#eaf5ef; color:#24764f; border-radius:30px; font-size:12px; font-weight:600; }
.prototype-pill i, .file-ready i { width:7px; height:7px; border-radius:50%; background:#2aa36e; display:inline-block; }
.intro { display:flex; align-items:flex-end; justify-content:space-between; gap:20px; margin-bottom:25px; }
.eyebrow { margin:0 0 9px; color:#6c8793; font-size:10px; font-weight:700; letter-spacing:1.35px; }
h1 { font-size:30px; letter-spacing:-1.1px; margin:0 0 8px; font-weight:700; }
.intro-copy, .section-heading p { color:var(--muted); margin:0; line-height:1.65; }
.privacy-note { color:#78858d; font-size:11px; white-space:nowrap; padding-bottom:4px; }
.shield { display:inline-grid; place-items:center; width:17px; height:17px; border-radius:50%; background:#e8f4ee; color:#21835b; margin-right:5px; }
.panel { background:var(--surface); border:1px solid var(--line); border-radius:14px; padding:25px; box-shadow:var(--shadow); margin-bottom:22px; }
.section-heading { display:flex; justify-content:space-between; align-items:flex-start; gap:18px; margin-bottom:20px; }
h2 { font-size:18px; letter-spacing:-.45px; margin:0 0 5px; }
.section-heading p:not(.eyebrow) { font-size:12px; }
.step-label { color:#98a4aa; font-size:10px; letter-spacing:1px; font-weight:700; white-space:nowrap; padding-top:4px; }
.dropzone { min-height:190px; border:1.5px dashed #cbd6db; border-radius:11px; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:8px; cursor:pointer; background:#fbfcfc; transition:.2s ease; text-align:center; padding:22px; }
.dropzone:hover, .dropzone.dragover { border-color:var(--accent); background:#f5f9fa; }
.dropzone input { display:none; }
.upload-icon { width:38px; height:38px; border-radius:11px; background:var(--soft); color:var(--accent); display:grid; place-items:center; margin-bottom:3px; }
.upload-icon svg { width:22px; height:22px; }
.dropzone strong { font-size:14px; }
.dropzone span { color:var(--muted); font-size:12px; }
.browse-text { color:var(--accent); font-weight:700; }
.dropzone small { color:#9aa5ab; font-size:10px; margin-top:4px; }
.file-preview { margin-top:13px; padding:10px; border:1px solid var(--line); border-radius:10px; display:flex; align-items:center; gap:13px; }
.file-preview img { width:65px; height:65px; object-fit:cover; border-radius:7px; background:#edf1f3; }
.file-meta { display:flex; flex-direction:column; gap:4px; flex:1; min-width:0; }
.file-meta strong { font-size:12px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.file-meta span { color:var(--muted); font-size:10px; }
.file-meta .file-ready { color:#25845c; }
.icon-button { border:0; background:#f1f4f5; width:30px; height:30px; border-radius:8px; cursor:pointer; font-size:20px; color:#687780; }
.upload-actions { display:flex; justify-content:space-between; align-items:center; gap:15px; margin-top:16px; }
.helper-text { color:#929da3; font-size:11px; margin:0; }
.primary-button { background:var(--accent); color:#fff; border:0; border-radius:8px; padding:12px 19px; font-size:12px; font-weight:600; cursor:pointer; transition:.2s; }
.primary-button:hover:not(:disabled) { background:var(--accent-dark); transform:translateY(-1px); }
.primary-button:disabled { background:#e8edef; color:#9aa5ab; cursor:not-allowed; }
.results-section { margin:36px 0 23px; }
.results-section .section-heading { margin-bottom:17px; }
.model-grid { display:grid; grid-template-columns:repeat(3,1fr); gap:13px; }
.model-card { background:#fff; border:1px solid var(--line); border-radius:12px; padding:18px; box-shadow:var(--shadow); }
.model-card-top { display:flex; align-items:center; gap:7px; color:#9aa5ab; font-size:9px; font-weight:700; letter-spacing:1px; }
.model-dot { width:7px; height:7px; border-radius:50%; background:#6f94a3; }
.model-card h3 { font-size:14px; margin:13px 0 18px; }
.prediction-value { font-size:22px; font-weight:700; letter-spacing:-.5px; min-height:29px; }
.muted { color:#9aa5ab; font-size:10px; margin:2px 0 16px; }
.confidence-row { display:flex; justify-content:space-between; font-size:10px; color:#7e8a91; margin-bottom:7px; }
.confidence-row strong { color:#43545e; }
.progress-track { height:5px; background:#edf1f2; border-radius:9px; overflow:hidden; }
.progress-track span { display:block; height:100%; width:0; background:#6e98a7; border-radius:9px; transition:width .3s; }
.notice, .evaluation-note { display:flex; align-items:flex-start; gap:9px; padding:12px 14px; margin-top:13px; background:#f7f9fa; border:1px solid #edf1f2; border-radius:9px; color:#849098; font-size:10px; line-height:1.6; }
.notice-icon { flex:0 0 16px; width:16px; height:16px; display:grid; place-items:center; border:1px solid #aab8bf; border-radius:50%; font-size:10px; font-weight:700; color:#7f9098; }
.xai-panel { margin-top:23px; }
.tabs { display:flex; gap:6px; border-bottom:1px solid var(--line); margin-bottom:18px; }
.tab { background:transparent; border:0; padding:10px 13px 12px; color:#87939a; font-size:11px; cursor:pointer; border-bottom:2px solid transparent; margin-bottom:-1px; }
.tab.active { color:var(--accent); font-weight:700; border-bottom-color:var(--accent); }
.xai-content { display:grid; grid-template-columns:1.25fr 1fr; gap:22px; align-items:stretch; }
.xai-image-wrap { min-height:255px; border:1px solid var(--line); border-radius:10px; background:#f8fafb; position:relative; overflow:hidden; display:flex; flex-direction:column; }
.image-placeholder { flex:1; min-height:220px; display:flex; align-items:center; justify-content:center; flex-direction:column; gap:8px; text-align:center; padding:20px; }
.placeholder-symbol { font-size:36px; color:#9db0b9; }
.image-placeholder strong { font-size:12px; }
.image-placeholder span { font-size:10px; color:#98a4aa; }
.xai-image-wrap img { width:100%; height:255px; object-fit:contain; }
.image-caption { border-top:1px solid var(--line); padding:8px 11px; color:#8b979d; font-size:9px; }
.xai-description { padding:7px 2px; }
.method-tag { display:inline-block; padding:5px 8px; border-radius:5px; background:#edf4f6; color:#527888; font-size:9px; font-weight:700; letter-spacing:.8px; }
.xai-description h3 { font-size:15px; line-height:1.45; margin:13px 0 8px; }
.xai-description p { color:#7d8990; font-size:11px; line-height:1.7; margin:0; }
.legend { display:flex; align-items:center; gap:7px; margin:20px 0; color:#8a969c; font-size:9px; }
.legend i { display:inline-block; width:7px; height:7px; border-radius:50%; margin-right:3px; }
.low { background:#356bc0; } .high { background:#e45c36; }
.legend-gradient { height:5px; flex:1; border-radius:5px; background:linear-gradient(90deg,#315fc0,#36b8c4,#e6d84c,#e44c32); }
.select-row { display:flex; align-items:center; justify-content:space-between; gap:10px; border-top:1px solid var(--line); padding-top:13px; color:#7c8990; font-size:10px; }
.select-row select { border:1px solid var(--line); background:#fff; border-radius:6px; padding:7px 10px; color:#4d5d66; font-size:10px; outline:none; }
.footnote { margin:13px 0 0; color:#9aa5ab; font-size:9px; line-height:1.5; }
.evaluation-panel { margin-bottom:25px; }
.metric-grid { display:grid; grid-template-columns:repeat(3,1fr); gap:10px; }
.metric-card { border:1px solid var(--line); border-radius:9px; padding:14px; display:flex; flex-direction:column; gap:7px; }
.metric-card span { color:#687780; font-size:10px; }
.metric-card strong { font-size:22px; letter-spacing:-.5px; color:#aab4b9; }
.metric-card small { color:#a0aaaf; font-size:9px; }
.evaluation-note { margin-top:12px; }
.footer { border-top:1px solid var(--line); padding:22px 0 14px; display:flex; align-items:center; gap:15px; flex-wrap:wrap; }
.footer-brand { font-size:15px; }
.footer-brand .brand-mark { width:21px; height:21px; }
.footer p { margin:0; color:#89959b; font-size:10px; }
.disclaimer { margin-left:auto; color:#a0aaaf; font-size:9px; }
.toast { position:fixed; bottom:22px; left:50%; transform:translateX(-50%); padding:11px 16px; background:#243b47; color:white; border-radius:8px; box-shadow:0 8px 25px #18232b22; font-size:11px; z-index:5; max-width:calc(100% - 32px); }
.hidden { display:none !important; }
@media (max-width:760px) {
  .app-shell { margin:12px auto; padding:0 14px; }
  .topbar { height:58px; margin-bottom:26px; }
  .intro { display:block; }
  .privacy-note { margin-top:13px; }
  h1 { font-size:25px; }
  .panel { padding:17px; }
  .model-grid { grid-template-columns:1fr; }
  .model-card { padding:15px; }
  .xai-content { grid-template-columns:1fr; }
  .metric-grid { grid-template-columns:repeat(2,1fr); }
  .disclaimer { margin-left:0; width:100%; }
  .upload-actions { align-items:flex-start; flex-direction:column; }
  .primary-button { width:100%; }
}
@media (max-width:390px) { .metric-grid { grid-template-columns:1fr 1fr; } .prototype-pill { font-size:10px; } }

/* ---- backend integration additions ---- */
.status-banner { margin: 0 0 18px; background:#fff8ec; border-color:#f3e3c2; color:#8a6a2c; font-size:11px; }
.status-banner .notice-icon { border-color:#d9b979; color:#a98336; }
.status-banner.error { background:#fdf1f0; border-color:#f3cfcb; color:#a24038; }
.status-banner.error .notice-icon { border-color:#d98b84; color:#a24038; }
.probs { list-style:none; margin:12px 0 0; padding:0; display:flex; flex-direction:column; gap:5px; }
.probs li { display:flex; justify-content:space-between; font-size:10px; color:#8a969c; }
.probs li.top { color:#43545e; font-weight:600; }
.model-card.unavailable { opacity:.55; }
.model-card.unavailable .prediction-value { font-size:14px; }
.spinner { width:22px; height:22px; border:2.5px solid #dbe5e9; border-top-color:var(--accent); border-radius:50%; animation:spin .8s linear infinite; }
@keyframes spin { to { transform:rotate(360deg); } }
.primary-button.loading { opacity:.75; cursor:progress; }
.metric-card strong.has-value { color:var(--ink); }
.metric-card strong:empty { display:none; }
.metric-card .metric-detail { font-size:11px; color:#586872; line-height:1.6; }
.metric-card .metric-detail b { color:var(--ink); font-weight:600; }
code { background:#eef2f4; padding:1px 5px; border-radius:4px; font-size:10px; }




