:root {
  color-scheme: dark;
  --bg: #080c16;
  --panel: rgba(17, 24, 39, 0.92);
  --panel-strong: #121a2a;
  --line: rgba(148, 163, 184, 0.22);
  --text: #f8fafc;
  --muted: #9aa8bd;
  --accent: #7dd3fc;
  --accent-strong: #38bdf8;
  --success: #86efac;
  --warning: #fde68a;
  --danger: #fda4af;
  --radius: 20px;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.28);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(circle at 12% 5%, rgba(56, 189, 248, 0.14), transparent 30rem),
    radial-gradient(circle at 88% 18%, rgba(139, 92, 246, 0.12), transparent 32rem),
    var(--bg);
}
button, input { font: inherit; }
a { color: var(--accent); }
.shell { width: min(1180px, calc(100% - 40px)); margin: 0 auto; }
.skip-link { position: absolute; left: -9999px; top: 8px; }
.skip-link:focus { left: 8px; z-index: 10; padding: 10px 14px; background: white; color: black; }

.site-header { padding: 64px 0 36px; border-bottom: 1px solid var(--line); }
.header-inner { display: flex; align-items: flex-end; justify-content: space-between; gap: 32px; }
.eyebrow, .step { margin: 0 0 8px; color: var(--accent); text-transform: uppercase; letter-spacing: .14em; font-size: .73rem; font-weight: 800; }
h1 { margin: 0; max-width: 820px; font-size: clamp(2.1rem, 5vw, 4.4rem); line-height: .98; letter-spacing: -.055em; }
.hero-copy { max-width: 760px; margin: 22px 0 0; color: var(--muted); font-size: 1.08rem; line-height: 1.7; }
.header-badges { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.header-badges span { padding: 8px 11px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); font-size: .82rem; white-space: nowrap; }

.layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 22px; padding: 34px 0 54px; }
.panel { padding: 26px; background: linear-gradient(160deg, rgba(20, 29, 47, .96), rgba(11, 16, 29, .96)); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.full-width { grid-column: 1 / -1; }
.section-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 22px; }
h2, h3 { margin: 0; }
h2 { font-size: 1.4rem; letter-spacing: -.02em; }
h3 { font-size: .92rem; color: #dce7f5; }
.status { padding: 7px 10px; border-radius: 999px; font-size: .77rem; font-weight: 750; }
.status-loading { color: var(--warning); background: rgba(253, 230, 138, .10); }
.status-ready { color: var(--success); background: rgba(134, 239, 172, .10); }
.status-error { color: var(--danger); background: rgba(253, 164, 175, .10); }

.drop-zone { min-height: 210px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 24px; border: 1px dashed rgba(125, 211, 252, .48); border-radius: 16px; background: rgba(56, 189, 248, .045); text-align: center; cursor: pointer; transition: border-color .2s, transform .2s, background .2s; }
.drop-zone:hover, .drop-zone:focus, .drop-zone.is-dragging { border-color: var(--accent-strong); background: rgba(56, 189, 248, .085); transform: translateY(-1px); outline: none; }
.drop-zone span:last-child { color: var(--muted); font-size: .84rem; }
.drop-icon { display: grid; place-items: center; width: 44px; height: 44px; margin-bottom: 5px; border-radius: 14px; background: rgba(125, 211, 252, .13); color: var(--accent); font-size: 1.45rem; }
.sample-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 15px 0; color: var(--muted); font-size: .84rem; }
.text-button { border: 0; padding: 0; background: transparent; color: var(--accent); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.preview-card { display: flex; gap: 14px; align-items: center; padding: 13px; margin: 15px 0; border: 1px solid var(--line); border-radius: 14px; background: rgba(255, 255, 255, .025); }
.preview-card img { width: 86px; height: 86px; object-fit: cover; border-radius: 10px; background: #05070d; image-rendering: auto; }
.preview-details { min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.preview-details span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 700; }
.preview-details span:last-child { color: var(--muted); font-size: .82rem; }
.primary-button { width: 100%; min-height: 48px; border: 0; border-radius: 13px; background: linear-gradient(135deg, #38bdf8, #818cf8); color: #041019; font-weight: 850; cursor: pointer; transition: filter .2s, transform .2s; }
.primary-button:hover:not(:disabled) { filter: brightness(1.07); transform: translateY(-1px); }
.primary-button:disabled { opacity: .45; cursor: not-allowed; }
.error-message { margin: 13px 0 0; color: var(--danger); font-size: .9rem; }

.results-panel { min-height: 520px; }
.empty-results { min-height: 350px; display: grid; place-content: center; justify-items: center; color: var(--muted); text-align: center; }
.empty-results span { font-size: 3rem; color: rgba(125, 211, 252, .5); }
.empty-results p { max-width: 290px; line-height: 1.6; }
.inference-time { color: var(--muted); font-size: .8rem; }
.headline-result { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 20px; border: 1px solid var(--line); border-radius: 16px; background: rgba(255, 255, 255, .025); }
.headline-result .label { display: block; color: var(--muted); font-size: .78rem; text-transform: uppercase; letter-spacing: .1em; }
#predicted-class { display: block; margin-top: 7px; font-size: 2rem; text-transform: capitalize; }
.confidence-ring { width: 105px; height: 105px; flex: 0 0 auto; display: grid; place-content: center; border-radius: 50%; text-align: center; background: conic-gradient(var(--accent-strong) var(--confidence, 0%), rgba(148, 163, 184, .13) 0); position: relative; }
.confidence-ring::before { content: ""; position: absolute; inset: 8px; border-radius: 50%; background: var(--panel-strong); }
.confidence-ring span, .confidence-ring small { z-index: 1; }
.confidence-ring span { font-size: 1.17rem; font-weight: 850; }
.confidence-ring small { color: var(--muted); font-size: .69rem; }
.warning { margin-top: 15px; padding: 12px 14px; border: 1px solid rgba(253, 230, 138, .28); border-radius: 12px; background: rgba(253, 230, 138, .08); color: #fff4c2; line-height: 1.5; font-size: .88rem; }
.probability-section, .interpretation { margin-top: 22px; }
.probability-list { display: grid; gap: 12px; margin-top: 13px; }
.probability-row { display: grid; grid-template-columns: 70px 1fr 62px; align-items: center; gap: 12px; }
.probability-label { text-transform: capitalize; font-weight: 700; }
.probability-track { height: 10px; overflow: hidden; border-radius: 99px; background: rgba(148, 163, 184, .14); }
.probability-fill { height: 100%; border-radius: inherit; background: linear-gradient(90deg, #38bdf8, #818cf8); }
.probability-value { text-align: right; color: #dbeafe; font-variant-numeric: tabular-nums; }
.interpretation p { margin: 10px 0 0; color: var(--muted); line-height: 1.65; }

.metric-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.metric-grid article { padding: 18px; border: 1px solid var(--line); border-radius: 14px; background: rgba(255, 255, 255, .025); }
.metric-grid strong { display: block; font-size: 1.6rem; }
.metric-grid span { display: block; margin-top: 6px; color: var(--muted); font-size: .82rem; }
.model-notes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 18px; }
.model-notes p, .disclaimer p { margin: 0; color: var(--muted); line-height: 1.65; }
.disclaimer { border-color: rgba(253, 230, 138, .22); }
.disclaimer h2 { margin-bottom: 12px; }
.disclaimer p + p { margin-top: 10px; }

.site-footer { border-top: 1px solid var(--line); padding: 24px 0 32px; color: var(--muted); }
.footer-inner { display: flex; justify-content: space-between; gap: 20px; font-size: .84rem; }
.footer-inner nav { display: flex; gap: 18px; }
.is-hidden { display: none !important; }

@media (max-width: 820px) {
  .header-inner { align-items: flex-start; flex-direction: column; }
  .header-badges { justify-content: flex-start; }
  .layout { grid-template-columns: 1fr; }
  .full-width { grid-column: auto; }
  .metric-grid, .model-notes { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 520px) {
  .shell { width: min(100% - 24px, 1180px); }
  .site-header { padding-top: 42px; }
  .panel { padding: 19px; }
  .section-heading, .headline-result, .footer-inner { align-items: flex-start; flex-direction: column; }
  .metric-grid, .model-notes { grid-template-columns: 1fr; }
  .confidence-ring { width: 92px; height: 92px; }
}
