:root {
  --bg0: #0e1210;
  --bg1: #151a16;
  --ink: #e8efe6;
  --muted: #8a9688;
  --line: #2a332c;
  --accent: #d6ff4b;
  --danger: #ff5a3d;
  --warn: #ffb020;
  --ok: #3dff9a;
  --panel: #141914;
  --font-display: "Archivo Black", Impact, sans-serif;
  --font: "IBM Plex Sans", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
  --pad: max(1rem, env(safe-area-inset-left));
  --pad-r: max(1rem, env(safe-area-inset-right));
  --pad-b: max(1.25rem, env(safe-area-inset-bottom));
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: var(--font);
  color: var(--ink);
  background:
    radial-gradient(900px 420px at 0% -5%, #1e2a22 0%, transparent 55%),
    linear-gradient(180deg, #101410 0%, var(--bg0) 40%, #0a0d0b 100%);
  line-height: 1.45;
}

.noise {
  pointer-events: none;
  position: fixed;
  inset: 0;
  opacity: 0.04;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  z-index: 0;
}

.shell {
  position: relative;
  z-index: 1;
  width: min(40rem, 100%);
  margin-inline: auto;
  padding: max(0.85rem, env(safe-area-inset-top)) var(--pad-r) var(--pad-b) var(--pad);
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
}

/* —— header —— */
.top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  padding-bottom: 0.35rem;
  border-bottom: 1px solid var(--line);
}

.brand {
  font-family: var(--font-display);
  font-size: 1.35rem;
  letter-spacing: 0.02em;
  color: var(--accent);
  line-height: 1;
}

.tag {
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
  text-align: right;
}

/* —— hero / form —— */
.hero {
  padding: 1.35rem 0 0.5rem;
}

.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(1.35rem, 6.2vw, 2.35rem);
  line-height: 1.05;
  margin: 0 0 0.55rem;
  letter-spacing: -0.02em;
  white-space: nowrap;
}

.lede {
  margin: 0 0 1.15rem;
  color: var(--muted);
  font-size: 0.95rem;
  max-width: 34rem;
}

.form {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

input[type="url"] {
  width: 100%;
  min-height: 3.15rem;
  border: 1px solid var(--line);
  background: var(--bg1);
  color: var(--ink);
  border-radius: 0;
  padding: 0.85rem 0.9rem;
  font: 500 0.95rem/1.2 var(--mono);
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}

input[type="url"]::placeholder {
  color: #5c675a;
}

input[type="url"]:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
}

button#go {
  width: 100%;
  min-height: 3.15rem;
  border: 0;
  background: var(--accent);
  color: #111;
  font-family: var(--font-display);
  font-size: 1.05rem;
  letter-spacing: 0.04em;
  padding: 0.75rem 1rem;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

button#go:active:not(:disabled) {
  filter: brightness(0.95);
}

button#go:disabled {
  opacity: 0.55;
  cursor: wait;
}

.hint {
  margin: 0.15rem 0 0;
  color: var(--muted);
  font-size: 0.78rem;
}

.mono {
  font-family: var(--mono);
  color: #b7c3b4;
}

.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

/* —— status —— */
.status {
  margin: 0.85rem 0 0;
  padding: 0.85rem 0.9rem;
  border-left: 3px solid var(--accent);
  background: var(--panel);
  font-family: var(--mono);
  font-size: 0.82rem;
  word-break: break-word;
  white-space: pre-wrap;
}

.status.error {
  border-color: var(--danger);
}

.status.loading {
  border-color: var(--warn);
}

/* —— result —— */
.result {
  margin-top: 1rem;
  margin-bottom: 1.5rem;
  animation: rise 0.35s ease both;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.result-grid {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.meta-panel,
.report-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  padding: 0.9rem;
}

/* thumb + meta side by side on phone */
.meta-panel {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 0.75rem 0.9rem;
  align-items: start;
}

.thumb-wrap {
  grid-row: 1 / span 2;
  aspect-ratio: 9 / 14;
  width: 100%;
  background: #0a0d0b;
  border: 1px solid var(--line);
  overflow: hidden;
  position: relative;
}

.thumb-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.thumb-fallback {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.65rem;
  text-align: center;
  padding: 0.25rem;
}

.meta {
  margin: 0;
  display: grid;
  gap: 0.45rem;
}

.meta div {
  display: grid;
  gap: 0.1rem;
}

.meta dt {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.meta dd {
  margin: 0;
  font-family: var(--mono);
  font-size: 0.8rem;
  word-break: break-word;
}

.ext {
  grid-column: 2;
  color: var(--accent);
  font-size: 0.85rem;
  text-decoration: none;
  padding: 0.35rem 0;
}

.ext:active {
  opacity: 0.8;
}

.badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.85rem;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.4rem 0.55rem;
  font-family: var(--mono);
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  background: #222a23;
  border: 1px solid var(--line);
  line-height: 1.2;
}

.badge.verdadeiro {
  color: #062416;
  background: var(--ok);
  border-color: transparent;
}

.badge.falso,
.badge.enganoso {
  color: #2a0904;
  background: var(--danger);
  border-color: transparent;
}

.badge.misto,
.badge.sem_evidencia {
  color: #1a1200;
  background: var(--warn);
  border-color: transparent;
}

.badge-muted {
  color: var(--muted);
}

.report-panel h2 {
  font-family: var(--font-display);
  font-size: 1.25rem;
  margin: 0 0 0.5rem;
  line-height: 1.15;
}

.report-panel h3 {
  margin: 1.1rem 0 0.4rem;
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.summary {
  margin: 0;
  font-size: 0.95rem;
}

.transcript {
  font-family: var(--mono);
  font-size: 0.82rem;
  white-space: pre-wrap;
  max-height: 10rem;
  overflow: auto;
  padding: 0.55rem 0.65rem;
  background: #0a0d0b;
  border: 1px solid var(--line);
}

.claims,
.caveats,
.sources {
  margin: 0;
  padding-left: 1.05rem;
  font-size: 0.9rem;
}

.claims li,
.caveats li,
.sources li {
  margin: 0.4rem 0;
}

.sources a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 0.15em;
  word-break: break-word;
}

.sources a:hover {
  color: var(--ink);
}

.source-snip {
  margin: 0.2rem 0 0;
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.35;
}

.sources-empty {
  color: var(--muted);
  list-style: none;
  margin-left: -1.05rem;
}

.claims .assessment {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--accent);
  margin-right: 0.3rem;
}

.raw {
  margin-top: 1rem;
  border-top: 1px solid var(--line);
  padding-top: 0.65rem;
}

.raw summary {
  cursor: pointer;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.8rem;
  padding: 0.25rem 0;
}

.raw pre {
  overflow: auto;
  max-height: 240px;
  background: #0a0d0b;
  padding: 0.7rem;
  font-size: 0.7rem;
  color: #b7c3b4;
  -webkit-overflow-scrolling: touch;
}

.foot {
  margin-top: auto;
  padding-top: 1.25rem;
  color: var(--muted);
  font-size: 0.78rem;
  border-top: 1px solid var(--line);
}

.foot p {
  margin: 0;
}

/* —— tablet+ —— */
@media (min-width: 640px) {
  .shell {
    width: min(44rem, calc(100% - 2.5rem));
    padding-top: 1.35rem;
  }

  .brand {
    font-size: 1.65rem;
  }

  .tag {
    font-size: 0.88rem;
  }

  .hero {
    padding-top: 1.75rem;
  }

  .hero h1 {
    font-size: clamp(2rem, 4vw, 2.75rem);
  }

  .lede {
    font-size: 1rem;
    margin-bottom: 1.35rem;
  }

  .form {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 0.55rem 0.6rem;
  }

  input[type="url"] {
    grid-column: 1;
    min-height: 3.25rem;
  }

  button#go {
    grid-column: 2;
    width: auto;
    min-width: 8.5rem;
    padding-inline: 1.35rem;
  }

  .hint {
    grid-column: 1 / -1;
  }

  .meta-panel {
    grid-template-columns: 120px 1fr;
  }

  .report-panel h2 {
    font-size: 1.45rem;
  }
}

@media (min-width: 900px) {
  .shell {
    width: min(58rem, calc(100% - 3rem));
  }

  .result-grid {
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 1rem;
    align-items: start;
  }

  .meta-panel {
    display: flex;
    flex-direction: column;
  }

  .thumb-wrap {
    grid-row: auto;
    max-width: none;
    width: 100%;
  }

  .ext {
    grid-column: auto;
  }
}
