:root {
  color-scheme: dark;
  --bg: #08111f;
  --panel: #0d192a;
  --line: #25354a;
  --text: #f3f7fb;
  --muted: #8fa0b5;
  --accent: #66e3c4;
  --accent-2: #32c7a3;
  --shadow: 0 24px 80px rgba(0, 0, 0, .34);
}
* { box-sizing: border-box; }
html { min-width: 320px; background: var(--bg); }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: radial-gradient(circle at 78% 3%, rgba(45,146,141,.15), transparent 28rem), linear-gradient(180deg,#091321 0%,var(--bg) 58%);
}
button, input, textarea { font: inherit; }
button { color: inherit; }
.page-shell { min-height: 100vh; }
.site-header {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  padding: 22px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(143,160,181,.16);
}
.brand { color: var(--text); text-decoration: none; display: inline-flex; align-items: center; gap: 11px; font-weight: 730; letter-spacing: -.02em; }
.brand-mark { width: 34px; height: 34px; border: 1px solid rgba(102,227,196,.55); border-radius: 10px; display: grid; place-items: center; background: rgba(102,227,196,.09); }
.brand-mark svg { width: 21px; fill: none; stroke: var(--accent); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.status { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; letter-spacing: .05em; text-transform: uppercase; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 12px var(--accent); }
main { width: min(1180px, calc(100% - 40px)); margin: 0 auto; padding: 70px 0 80px; }
.hero { max-width: 780px; margin-bottom: 48px; }
.eyebrow, .step { margin: 0 0 13px; color: var(--accent); font-size: 11px; font-weight: 750; letter-spacing: .18em; }
h1 { margin: 0; font-size: clamp(42px,7vw,76px); line-height: .99; letter-spacing: -.058em; font-weight: 720; }
h1 span { color: #8798ac; }
.hero-copy { max-width: 650px; margin: 26px 0 0; color: var(--muted); font-size: clamp(16px,2vw,19px); line-height: 1.65; }
.workspace { display: grid; grid-template-columns: minmax(0,.92fr) minmax(0,1.08fr); gap: 20px; align-items: start; }
.input-card, .result-card { background: linear-gradient(145deg,rgba(17,31,50,.98),rgba(11,23,39,.98)); border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow); }
.input-card, .result-card { padding: 26px; }
.result-card { min-height: 650px; }
.card-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 22px; }
.card-heading h2, .empty-state h2 { margin: 0; font-size: 22px; letter-spacing: -.025em; }
.text-button { border: 0; background: transparent; padding: 5px 0; color: var(--muted); cursor: pointer; }
.text-button:hover { color: var(--text); }
.drop-zone { position: relative; min-height: 270px; display: grid; place-items: center; overflow: hidden; border: 1px dashed #496077; border-radius: 14px; background: rgba(3,11,21,.38); cursor: pointer; transition: .2s ease; }
.drop-zone:hover, .drop-zone.dragging { border-color: var(--accent); background: rgba(102,227,196,.04); }
.drop-zone input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.drop-prompt { padding: 28px; display: flex; flex-direction: column; align-items: center; text-align: center; }
.drop-prompt strong { margin-top: 14px; font-size: 16px; }
.drop-prompt span:not(.upload-icon) { margin-top: 5px; color: var(--muted); }
.drop-prompt small { margin-top: 18px; color: #65778c; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; }
.upload-icon { width: 48px; height: 48px; display: grid; place-items: center; border-radius: 50%; background: rgba(102,227,196,.1); }
.upload-icon svg { width: 24px; fill: none; stroke: var(--accent); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
#inputPreview { width: 100%; height: 300px; object-fit: contain; background: #050b13; }
.replace-label { position: absolute; right: 12px; bottom: 12px; padding: 8px 11px; font-size: 12px; border: 1px solid rgba(255,255,255,.18); border-radius: 8px; background: rgba(5,11,19,.82); backdrop-filter: blur(10px); }
.field-label { display: block; margin: 22px 0 9px; font-size: 13px; font-weight: 650; }
.textarea-wrap { position: relative; }
textarea { width: 100%; min-height: 145px; resize: vertical; padding: 14px 14px 34px; color: var(--text); line-height: 1.55; border: 1px solid var(--line); border-radius: 12px; outline: 0; background: rgba(3,11,21,.5); }
textarea:focus { border-color: var(--accent-2); box-shadow: 0 0 0 3px rgba(50,199,163,.08); }
textarea::placeholder { color: #607286; }
#charCount { position: absolute; right: 12px; bottom: 10px; color: #65778c; font-size: 11px; }
.primary-button { width: 100%; margin-top: 18px; min-height: 52px; padding: 0 18px; display: flex; align-items: center; justify-content: center; gap: 10px; border: 0; border-radius: 11px; color: #04130f; background: var(--accent); font-weight: 750; cursor: pointer; transition: transform .18s ease, background .18s ease; }
.primary-button:hover { transform: translateY(-1px); background: #80ead1; }
.primary-button:disabled { cursor: wait; transform: none; opacity: .72; }
.primary-button svg { width: 19px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.spinner { display: none; width: 18px; height: 18px; border: 2px solid rgba(4,19,15,.28); border-top-color: #04130f; border-radius: 50%; animation: spin .7s linear infinite; }
.primary-button.loading .spinner { display: block; }
.primary-button.loading svg { display: none; }
@keyframes spin { to { transform: rotate(360deg); } }
.error-message { margin: 13px 0 0; padding: 11px 13px; color: #ffc5ca; border: 1px solid rgba(255,107,119,.35); border-radius: 9px; background: rgba(255,107,119,.08); }
.result-card.empty { display: grid; place-items: center; }
.empty-state { max-width: 350px; text-align: center; color: var(--muted); }
.empty-state .step { margin-top: 25px; }
.empty-state h2 { color: var(--text); }
.empty-state > p:last-child { line-height: 1.55; }
.scan-icon { width: 82px; height: 82px; display: inline-grid; place-items: center; border-radius: 24px; background: rgba(102,227,196,.05); }
.scan-icon svg { width: 55px; fill: none; stroke: #476073; stroke-width: 1.5; stroke-linecap: round; }
.result-heading { align-items: center; }
.decision-badge { padding: 7px 10px; border-radius: 999px; font-size: 11px; font-weight: 800; letter-spacing: .1em; }
.decision-badge.safe { color: var(--accent); background: rgba(102,227,196,.1); border: 1px solid rgba(102,227,196,.28); }
.decision-badge.unsafe { color: #ff9aa3; background: rgba(255,107,119,.09); border: 1px solid rgba(255,107,119,.28); }
.submitted-content { display: grid; grid-template-columns: 150px minmax(0,1fr); gap: 16px; align-items: stretch; padding: 14px; border: 1px solid var(--line); border-radius: 13px; background: rgba(3,11,21,.35); }
.submitted-content img { width: 150px; height: 116px; border-radius: 8px; object-fit: cover; background: #050b13; }
.submitted-content > div { min-width: 0; }
.submitted-content span { color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.submitted-content p { max-height: 83px; margin: 9px 0 0; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.5; }
.overall-score { margin-top: 24px; padding: 20px; border-radius: 14px; background: rgba(102,227,196,.055); border: 1px solid rgba(102,227,196,.15); }
.score-title { display: flex; align-items: end; justify-content: space-between; gap: 16px; }
.score-title span { display: block; font-size: 15px; font-weight: 700; }
.score-title small { display: block; margin-top: 4px; color: var(--muted); }
.score-title strong { color: var(--accent); font-size: 32px; letter-spacing: -.04em; }
.bar-track { width: 100%; height: 8px; overflow: hidden; border-radius: 99px; background: #233247; }
.bar-track.large { height: 10px; margin-top: 17px; }
.bar { display: block; width: 0; height: 100%; border-radius: inherit; transition: width .7s cubic-bezier(.2,.8,.2,1); }
.bar.safe { background: linear-gradient(90deg,#27b891,#79efd1); }
.category-header { margin: 27px 0 15px; display: flex; align-items: end; justify-content: space-between; gap: 15px; }
.category-header h3 { margin: 0; font-size: 16px; }
.category-header p { margin: 4px 0 0; color: var(--muted); font-size: 12px; }
.category-header > span { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .08em; }
.category-row { display: grid; grid-template-columns: minmax(130px,.8fr) minmax(150px,1.2fr) 52px; gap: 14px; align-items: center; padding: 11px 0; border-top: 1px solid rgba(143,160,181,.13); }
.category-label { min-width: 0; }
.category-label strong { display: block; font-size: 13px; }
.category-label span { color: var(--muted); font-size: 11px; }
.category-row > strong { text-align: right; font-size: 13px; font-variant-numeric: tabular-nums; }
.bar.c1 { background: #f06a8c; }.bar.c2 { background: #ff875f; }.bar.c3 { background: #f0bd57; }.bar.c4 { background: #8d82ef; }.bar.c5 { background: #55aee9; }
.result-meta { margin-top: 16px; display: flex; justify-content: space-between; gap: 12px; color: #607286; font: 10px/1.4 ui-monospace,SFMono-Regular,Menlo,monospace; overflow-wrap: anywhere; }
@media (max-width: 900px) {
  main { padding-top: 48px; }
  .workspace { grid-template-columns: 1fr; }
  .result-card { min-height: 500px; }
}
@media (max-width: 560px) {
  .site-header, main { width: min(100% - 28px,1180px); }
  .site-header { padding: 16px 0; }
  .status { display: none; }
  main { padding: 39px 0 42px; }
  .hero { margin-bottom: 30px; }
  h1 { font-size: clamp(39px,13vw,54px); }
  .hero-copy { margin-top: 19px; font-size: 15px; }
  .input-card, .result-card { padding: 19px; border-radius: 16px; }
  .drop-zone { min-height: 225px; }
  #inputPreview { height: 250px; }
  .submitted-content { grid-template-columns: 96px minmax(0,1fr); }
  .submitted-content img { width: 96px; height: 100px; }
  .category-row { grid-template-columns: minmax(105px,.9fr) minmax(85px,1.1fr) 44px; gap: 9px; }
  .category-label span { display: none; }
  .result-meta { flex-direction: column; }
}
.optional-label { margin-left: 6px; color: var(--muted); font-size: 11px; font-weight: 500; }
