:root {
  --ink: #202524;
  --muted: #68706d;
  --line: #d8ddd8;
  --soft: #f5f6f2;
  --paper: #fffef9;
  --truth: #2d5a4e;
  --truth-dark: #1f443b;
  --copper: #a4613b;
  --indigo: #2f3e68;
  --amber: #9a5b16;
  --red: #a33a34;
  --green: #2f6f55;
  --shadow: 0 18px 45px rgba(32, 37, 36, 0.09);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  min-height: 100%;
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(90deg, rgba(32, 37, 36, 0.035) 1px, transparent 1px),
    linear-gradient(180deg, rgba(32, 37, 36, 0.025) 1px, transparent 1px),
    #f3f5f1;
  background-size: 28px 28px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

button,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr;
}

.topbar {
  height: 70px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 254, 249, 0.92);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 10;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
}

.brand-mark {
  width: 36px;
  height: 36px;
  display: inline-grid;
  place-items: center;
  border-radius: 7px;
  color: #fffef9;
  background: var(--ink);
  font-weight: 800;
}

.brand-lockup {
  display: grid;
  gap: 1px;
}

.brand-name {
  font-size: 20px;
  font-weight: 800;
}

.brand-line {
  color: var(--copper);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.top-actions {
  display: inline-flex;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: var(--paper);
}

.nav-button {
  min-width: 82px;
  height: 38px;
  border: 0;
  color: var(--muted);
  background: transparent;
}

.nav-button.active {
  color: #fffef9;
  background: var(--ink);
}

.workspace {
  width: min(1440px, 100%);
  margin: 0 auto;
  padding: 28px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 380px;
  gap: 28px;
  align-items: start;
}

.check-pane,
.feed-pane {
  min-width: 0;
}

.input-band,
.result-panel,
.feed-pane {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.input-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 22px 24px 0;
}

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

h1 {
  font-size: 26px;
  line-height: 1.2;
}

h2 {
  font-size: 18px;
  line-height: 1.25;
}

h3 {
  font-size: 14px;
  text-transform: uppercase;
  color: var(--muted);
}

.status-pill,
.badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  color: var(--truth-dark);
  background: #dfeee8;
  white-space: nowrap;
}

.status-pill.busy {
  color: var(--amber);
  background: #f5eadb;
}

.status-pill.error {
  color: var(--red);
  background: #f6e2df;
}

.check-form {
  padding: 18px 24px 24px;
}

textarea {
  width: 100%;
  min-height: 190px;
  resize: vertical;
  padding: 16px;
  color: var(--ink);
  background: #fffef9;
  border: 1px solid var(--line);
  border-radius: 8px;
  outline: none;
  line-height: 1.55;
}

textarea:focus {
  border-color: var(--truth);
  box-shadow: 0 0 0 3px rgba(45, 90, 78, 0.14);
}

.example-row {
  margin-top: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.example-chip {
  min-height: 32px;
  padding: 6px 10px;
  color: var(--indigo);
  background: #eef1f6;
  border: 1px solid #d5dbea;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
}

.example-chip:hover {
  border-color: var(--indigo);
  background: #e6ebf4;
}

.language-row {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.control-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.segmented-control {
  display: inline-flex;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: #fffef9;
}

.segmented-control label {
  min-width: 92px;
  height: 32px;
  display: inline-grid;
  place-items: center;
  color: var(--muted);
  cursor: pointer;
  font-size: 13px;
  font-weight: 800;
}

.segmented-control label span {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
}

.segmented-control label + label {
  border-left: 1px solid var(--line);
}

.segmented-control input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.segmented-control input:checked + span {
  color: var(--paper);
  background: var(--truth);
}

.segmented-control label:has(input:disabled) {
  cursor: default;
  opacity: 0.68;
}

.form-row {
  margin-top: 14px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
}

.submit-stack {
  display: grid;
  justify-items: end;
  gap: 10px;
  width: min(100%, 380px);
}

.char-count,
.muted {
  color: var(--muted);
  font-size: 14px;
}

.primary-button {
  min-width: 112px;
  height: 42px;
  border: 0;
  border-radius: 8px;
  color: #fffef9;
  background: var(--truth);
  font-weight: 800;
  position: relative;
  isolation: isolate;
  z-index: 0;
  overflow: visible;
}

.primary-button span {
  position: relative;
  z-index: 1;
}

.primary-button:hover {
  background: var(--truth-dark);
}

.primary-button:disabled {
  cursor: default;
  color: rgba(255, 254, 249, 0.86);
  background: #71827c;
  opacity: 1;
}

.primary-button:disabled:hover {
  background: #71827c;
}

.primary-button.has-halo {
  opacity: 1;
  box-shadow:
    0 0 0 3px rgba(45, 90, 78, 0.16),
    0 0 22px rgba(45, 90, 78, 0.24);
  animation: button-halo 1.5s ease-in-out infinite;
}

.result-panel {
  margin-top: 24px;
}

.result-panel.empty {
  min-height: 230px;
  display: grid;
  place-items: center;
}

.empty-state {
  display: grid;
  gap: 14px;
  justify-items: center;
  color: var(--muted);
}

.empty-mark {
  width: 92px;
  height: 92px;
  display: grid;
  align-content: center;
  gap: 8px;
  padding: 18px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #fffef9;
}

.empty-mark span {
  display: block;
  height: 8px;
  border-radius: 999px;
  background: #dfeee8;
  transform-origin: left center;
}

.empty-mark span:nth-child(2) {
  width: 68%;
  background: #efe4db;
}

.empty-mark span:nth-child(3) {
  width: 82%;
  background: #e7ebf3;
}

.result-panel.investigating .empty-mark {
  border-color: rgba(45, 90, 78, 0.35);
  box-shadow: 0 0 0 3px rgba(45, 90, 78, 0.08);
}

.result-panel.investigating .empty-mark span {
  animation: evidence-lines 1.15s ease-in-out infinite;
}

.result-panel.investigating .empty-mark span:nth-child(2) {
  animation-delay: 0.12s;
}

.result-panel.investigating .empty-mark span:nth-child(3) {
  animation-delay: 0.24s;
}

.result-head {
  padding: 18px 24px;
  border-bottom: 1px solid var(--line);
}

.verdict-card {
  display: grid;
  gap: 9px;
  padding: 16px 18px;
  border: 1px solid #d2dfd6;
  border-left: 4px solid rgba(45, 90, 78, 0.58);
  border-radius: 8px;
  background: #f1f6f1;
  box-shadow: inset 0 1px 0 rgba(255, 254, 249, 0.85);
  position: relative;
}

.result-kicker,
.result-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.verdict-card .result-kicker {
  padding-right: 76px;
}

.result-meta {
  color: var(--muted);
  font-size: 12px;
}

.evidence-note,
.trust-note {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.evidence-note {
  margin-top: 2px;
  padding: 10px 12px;
  color: #334842;
  background: #edf4ef;
  border: 1px solid #d7e5dc;
  border-radius: 8px;
}

.trust-note {
  padding-top: 2px;
  border-top: 1px solid var(--line);
}

.copy-button {
  position: absolute;
  top: 14px;
  right: 14px;
  min-width: 62px;
  height: 30px;
  border: 1px solid #bfd3c7;
  border-radius: 8px;
  color: var(--truth-dark);
  background: rgba(255, 254, 249, 0.72);
  font-size: 12px;
  font-weight: 800;
}

.copy-button:hover {
  border-color: var(--truth);
  background: #fffef9;
}

.deep-review {
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border: 1px solid #cfe0d5;
  border-left: 3px solid rgba(45, 90, 78, 0.55);
  border-radius: 8px;
  background: #f4f8f3;
}

.deep-review-title {
  margin: 0 0 4px;
  color: var(--truth-dark);
  font-weight: 800;
}

.deep-review-copy {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.secondary-button {
  min-width: 112px;
  height: 36px;
  border: 1px solid #b8d0c4;
  border-radius: 8px;
  color: var(--truth-dark);
  background: #fffef9;
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

.secondary-button:hover {
  border-color: var(--truth);
  background: #edf4ef;
}

.secondary-button:disabled {
  cursor: default;
  color: var(--muted);
  background: var(--soft);
}

.verdict {
  color: var(--ink);
  font-size: 23px;
  line-height: 1.15;
}

.verdict.confirmed_true,
.badge.positive {
  color: var(--green);
}

.verdict.confirmed_false,
.badge.negative {
  color: var(--red);
}

.verdict.misleading,
.verdict.recirculated,
.badge.caution {
  color: var(--amber);
}

.result-body {
  padding: 22px 24px 24px;
  display: grid;
  gap: 22px;
}

.claim-text {
  font-size: 16px;
  line-height: 1.45;
}

.explanation {
  line-height: 1.7;
  color: #334155;
}

.source-list,
.component-list {
  display: grid;
  gap: 10px;
}

.source-item,
.component-item,
.feed-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffef9;
}

.source-item {
  padding: 10px 12px;
}

.source-item a {
  display: flex;
  gap: 7px;
  align-items: baseline;
  color: var(--indigo);
  text-decoration: none;
  overflow-wrap: anywhere;
}

.source-tier {
  flex: 0 0 auto;
  color: #59615d;
  padding: 1px 5px;
  border: 1px solid #cfd6ce;
  border-radius: 4px;
  background: #eef0ec;
  font-size: 10px;
  font-weight: 800;
  line-height: 1.3;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.source-tier.official {
  color: #176445;
  border-color: #9fcfb3;
  background: #dff1e6;
}

.source-tier.major_news {
  color: #87510d;
  border-color: #e0bd83;
  background: #f7e8cd;
}

.source-tier.weak {
  color: #56615e;
  border-color: #c9d0cc;
  background: #e9ece8;
}

.component-item {
  padding: 14px;
  display: grid;
  gap: 8px;
}

.component-question {
  font-weight: 800;
}

.component-finding {
  color: #334155;
  line-height: 1.6;
}

.feed-pane {
  position: sticky;
  top: 92px;
}

.feed-header {
  height: 58px;
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}

.icon-button {
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: #fffef9;
  font-size: 18px;
}

.icon-button:hover {
  border-color: var(--truth);
}

.feed-list {
  padding: 14px;
  display: grid;
  gap: 12px;
  max-height: calc(100vh - 160px);
  overflow: auto;
}

.feed-item {
  padding: 14px;
  display: grid;
  gap: 9px;
  text-align: left;
  cursor: pointer;
}

.feed-item:hover {
  border-color: var(--truth);
}

.feed-title {
  font-size: 14px;
  line-height: 1.45;
  font-weight: 800;
}

.feed-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
}

.skeleton-line,
.skeleton-block {
  overflow: hidden;
  position: relative;
  background: #ecefed;
  border-radius: 999px;
}

.skeleton-line {
  width: 72%;
  height: 13px;
}

.skeleton-line.wide {
  width: 88%;
}

.skeleton-line.short {
  width: 46%;
}

.skeleton-block {
  width: 100%;
  height: 92px;
  border-radius: 8px;
}

.skeleton-line::after,
.skeleton-block::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(255, 254, 249, 0.72), transparent);
  animation: shimmer 1.3s infinite;
}

@keyframes shimmer {
  to {
    transform: translateX(100%);
  }
}

@keyframes evidence-lines {
  0%,
  100% {
    transform: scaleX(0.72);
  }

  45% {
    transform: scaleX(1);
  }
}

@keyframes button-halo {
  0%,
  100% {
    box-shadow:
      0 0 0 3px rgba(45, 90, 78, 0.14),
      0 0 16px rgba(45, 90, 78, 0.18);
  }

  50% {
    box-shadow:
      0 0 0 5px rgba(164, 97, 59, 0.16),
      0 0 28px rgba(45, 90, 78, 0.30);
  }
}

@media (prefers-reduced-motion: reduce) {
  .result-panel.investigating .empty-mark span,
  .primary-button.has-halo,
  .skeleton-line::after,
  .skeleton-block::after {
    animation: none;
  }
}

.hidden {
  display: none !important;
}

@media (max-width: 980px) {
  .workspace {
    grid-template-columns: 1fr;
  }

  .feed-pane {
    position: static;
  }

  .feed-list {
    max-height: none;
  }
}

@media (max-width: 640px) {
  .topbar {
    height: auto;
    padding: 14px 16px;
    gap: 12px;
    align-items: stretch;
    flex-direction: column;
  }

  .top-actions {
    width: 100%;
  }

  .nav-button {
    flex: 1;
  }

  .workspace {
    padding: 16px;
    gap: 18px;
  }

  .input-heading,
  .form-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .example-chip {
    width: 100%;
  }

  .language-row {
    align-items: flex-start;
    justify-content: flex-start;
    flex-direction: column;
    width: 100%;
  }

  .segmented-control {
    width: 100%;
  }

  .segmented-control label {
    flex: 1;
    min-width: 0;
  }

  h1 {
    font-size: 22px;
  }

  .primary-button {
    width: 100%;
  }

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

  .secondary-button {
    width: 100%;
  }

  .source-tier {
    font-size: 11px;
  }

  .submit-stack {
    width: 100%;
    justify-items: stretch;
  }
}
