:root {
  color-scheme: light;
  --bg: #f7df57;
  --rail: #111827;
  --panel: #fff4c7;
  --panel-strong: #ffffff;
  --text: #10131a;
  --muted: #4a4f59;
  --line: #10131a;
  --accent: #e22b2f;
  --accent-strong: #0d5db8;
  --warn: #ffb000;
  --danger: #d71920;
  --ink: #ffffff;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 18px 18px, rgba(16, 19, 26, 0.14) 2px, transparent 2.5px) 0 0 / 28px 28px,
    linear-gradient(135deg, #f7df57 0%, #ffe982 42%, #ef3b3f 42%, #ef3b3f 44%, #f7df57 44%);
  color: var(--text);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

button,
input {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

a {
  color: inherit;
  text-decoration: none;
}

h1,
h2,
h3,
p {
  margin: 0;
}

.app-shell {
  width: min(1440px, 100%);
  min-height: 100vh;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 24px;
  background: var(--rail);
  border-right: 4px solid var(--line);
  box-shadow: 8px 0 0 rgba(226, 43, 47, 0.9);
}

.brand,
.nav-link {
  display: flex;
  align-items: center;
}

.brand {
  gap: 10px;
  font-weight: 900;
  line-height: 1.15;
  color: #ffffff;
  text-transform: uppercase;
}

.brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  border: 3px solid #ffffff;
  background: var(--accent);
  color: #ffffff;
  font-size: 0.9rem;
}

.nav-links {
  display: grid;
  gap: 8px;
  margin-top: 34px;
}

.nav-link {
  min-height: 42px;
  padding: 0 12px;
  border-radius: 8px;
  color: var(--muted);
  font-weight: 800;
  color: #d7e7ff;
  text-transform: uppercase;
}

.nav-link.active,
.nav-link:hover {
  background: #ffffff;
  color: var(--rail);
}

.workspace {
  width: min(1120px, calc(100% - 40px));
  margin: 0 auto;
  padding: 30px 0 48px;
  display: grid;
  gap: 22px;
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}

.eyebrow {
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1 {
  max-width: 760px;
  margin-top: 8px;
  font-size: clamp(2.15rem, 5vw, 4.8rem);
  line-height: 0.94;
  letter-spacing: 0;
  text-transform: uppercase;
  text-shadow: 4px 4px 0 #ffffff, 7px 7px 0 rgba(16, 19, 26, 0.18);
}

.lede {
  max-width: 690px;
  margin-top: 14px;
  color: var(--muted);
  font-size: 1.03rem;
  line-height: 1.6;
}

.credit-line {
  width: fit-content;
  max-width: 100%;
  margin-top: 14px;
  padding: 9px 12px;
  border: 3px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--accent-strong);
  box-shadow: 5px 5px 0 var(--line);
  font-size: 0.92rem;
  font-weight: 800;
  line-height: 1.35;
}

.icon-button,
.primary-button {
  border: 3px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
}

.icon-button {
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  background: #ffffff;
  color: var(--text);
  box-shadow: 4px 4px 0 var(--line);
  font-weight: 900;
}

.primary-button {
  min-height: 44px;
  padding: 0 18px;
  background: var(--accent);
  color: var(--ink);
  font-weight: 900;
  text-transform: uppercase;
  box-shadow: 5px 5px 0 var(--line);
}

.tool-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 380px;
  gap: 18px;
  align-items: start;
}

.main-panel,
.result-panel,
.content-band {
  border: 4px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 9px 9px 0 var(--line);
}

.main-panel {
  min-height: 590px;
  overflow: hidden;
}

.drop-zone {
  min-height: 590px;
  padding: 26px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 13px;
  text-align: center;
  outline: none;
}

.drop-zone.dragging {
  background: rgba(13, 93, 184, 0.12);
}

.drop-zone input {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  opacity: 0;
  pointer-events: none;
}

.upload-icon {
  width: 84px;
  height: 84px;
  display: grid;
  place-items: center;
  border: 4px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 5px 5px 0 var(--line);
}

.upload-icon span {
  width: 34px;
  height: 42px;
  border: 3px solid var(--accent);
  border-radius: 6px;
  position: relative;
}

.upload-icon span::before {
  content: "";
  position: absolute;
  left: 8px;
  top: -11px;
  width: 14px;
  height: 14px;
  border-left: 3px solid var(--accent);
  border-top: 3px solid var(--accent);
  transform: rotate(45deg);
  background: #ffffff;
}

.drop-zone h2,
.content-band h2 {
  font-size: clamp(1.4rem, 3vw, 2.1rem);
  line-height: 1.1;
}

.drop-zone p,
.progress-text,
.confidence-note,
.truth-check p,
.notes,
.metrics span,
.empty-report span,
.privacy-band p {
  color: var(--muted);
}

.confidence-note {
  margin-top: -10px;
  font-size: 0.88rem;
  line-height: 1.45;
}

.analysis-view {
  min-height: 590px;
}

.media-panel {
  min-height: 590px;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 10px 10px, rgba(16, 19, 26, 0.11) 2px, transparent 2.5px) 0 0 / 18px 18px,
    #e7f0ff;
}

.preview {
  width: 100%;
  height: 100%;
  max-height: 76vh;
  object-fit: contain;
}

.result-panel {
  position: sticky;
  top: 24px;
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.score-wrap {
  display: grid;
  grid-template-columns: 120px 1fr;
  align-items: center;
  gap: 16px;
}

.score-ring {
  width: 120px;
  height: 120px;
  transform: rotate(-90deg);
}

.score-ring circle {
  fill: none;
  stroke-width: 12;
}

.score-ring circle:first-child {
  stroke: #ffffff;
}

#scoreArc {
  stroke: var(--accent);
  stroke-linecap: round;
  stroke-dasharray: 326.73;
  stroke-dashoffset: 326.73;
  transition: stroke-dashoffset 240ms ease, stroke 240ms ease;
}

.score-value {
  font-size: 3rem;
  font-weight: 950;
  line-height: 1;
}

.score-label {
  margin-top: 8px;
  color: var(--muted);
  font-weight: 800;
}

.verdict {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px;
  border: 3px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 4px 4px 0 var(--line);
}

.verdict-dot {
  flex: 0 0 auto;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--muted);
}

.truth-check {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 3px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 4px 4px 0 var(--line);
}

.truth-check h3 {
  margin-bottom: 4px;
  color: var(--text);
  font-size: 1rem;
}

.truth-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.truth-buttons button {
  min-height: 38px;
  border: 3px solid var(--line);
  border-radius: 8px;
  background: #fff4c7;
  color: var(--text);
  cursor: pointer;
  font-weight: 900;
  text-transform: uppercase;
}

.truth-buttons button.active {
  border-color: var(--line);
  background: var(--accent-strong);
  color: #ffffff;
}

.truth-status {
  min-height: 38px;
  display: grid;
  place-items: center;
  border: 3px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  background: #fff4c7;
  font-size: 0.92rem;
}

.truth-status.correct {
  border-color: rgba(54, 196, 143, 0.8);
  color: var(--accent-strong);
}

.truth-status.incorrect {
  border-color: rgba(238, 102, 97, 0.8);
  color: var(--danger);
}

.metrics {
  display: grid;
  gap: 14px;
}

.metrics div {
  display: grid;
  gap: 8px;
}

meter {
  width: 100%;
  height: 12px;
}

.notes {
  border-top: 1px solid var(--line);
  padding-top: 18px;
}

.notes h3 {
  margin-bottom: 10px;
  color: var(--text);
  font-size: 1rem;
}

.notes ul {
  margin: 0;
  padding-left: 18px;
  line-height: 1.55;
}

.content-band {
  padding: 24px;
}

.report-list {
  margin-top: 18px;
  display: grid;
  gap: 12px;
}

.report-card,
.empty-report {
  display: grid;
  gap: 6px;
  padding: 15px;
  border: 3px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 4px 4px 0 var(--line);
}

.project-band {
  display: grid;
  gap: 22px;
}

.project-band > div:first-child {
  display: grid;
  gap: 10px;
}

.project-band p {
  max-width: 820px;
  color: var(--muted);
  line-height: 1.65;
}

.component-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.component-grid article {
  display: grid;
  gap: 8px;
  min-height: 134px;
  padding: 16px;
  border: 3px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 4px 4px 0 var(--line);
}

.component-grid strong {
  color: var(--text);
}

.component-grid span {
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.5;
}

.report-card header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.report-card strong {
  overflow-wrap: anywhere;
}

.report-card span {
  color: var(--muted);
  font-size: 0.92rem;
}

.privacy-band {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(280px, 1.2fr);
  gap: 20px;
  align-items: start;
}

.privacy-band p {
  line-height: 1.65;
}

.hidden {
  display: none !important;
}

@media (max-width: 1020px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 20px;
  }

  .nav-links {
    display: flex;
    margin-top: 0;
  }

  .tool-layout {
    grid-template-columns: 1fr;
  }

  .result-panel {
    position: static;
    order: -1;
  }

  .privacy-band {
    grid-template-columns: 1fr;
  }

  .component-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .workspace {
    width: min(100% - 20px, 1120px);
    padding-top: 18px;
  }

  .sidebar {
    align-items: stretch;
    flex-direction: column;
  }

  .nav-links {
    overflow-x: auto;
  }

  .topbar {
    align-items: stretch;
  }

  h1 {
    font-size: 2.25rem;
  }

  .icon-button {
    display: none;
  }

  .main-panel,
  .drop-zone,
  .analysis-view,
  .media-panel {
    min-height: 430px;
  }

  .score-wrap {
    grid-template-columns: 96px 1fr;
  }

  .score-ring {
    width: 96px;
    height: 96px;
  }

  .score-value {
    font-size: 2.4rem;
  }

  .component-grid {
    grid-template-columns: 1fr;
  }
}
