:root {
  color-scheme: dark;
  --bg: #020203;
  --panel: #080809;
  --panel-soft: #0d0d0f;
  --line: #1c1c20;
  --text: #f6f6f7;
  --muted: #96969f;
  --accent: #f04464;
  --warning: #f7c56a;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  background: var(--bg);
  color: var(--text);
}

button,
input,
select {
  font: inherit;
}

.shell {
  width: min(920px, calc(100vw - 40px));
  margin: 0 auto;
  padding: 28px 0 46px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

.topbar,
.actions,
.progress-copy,
.report-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.topbar {
  min-height: 42px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--text);
  font-weight: 760;
  font-size: 1.08rem;
  text-decoration: none;
}

.brand-mark {
  position: relative;
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #050506;
}

.brand-mark::before {
  content: "";
  width: 22px;
  height: 14px;
  border: 1.9px solid var(--text);
  border-radius: 50%;
  transform: rotate(-8deg);
}

.brand-mark span {
  position: absolute;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
}

.language-picker {
  display: inline-flex;
  align-items: center;
}

.language-picker select {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #08080a;
  color: var(--text);
  padding: 0 12px;
}

.hero {
  padding: 0;
}

.price,
.label {
  margin: 0 0 10px;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

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

h1 {
  margin-bottom: 16px;
  font-size: clamp(1.35rem, 2.6vw, 2.15rem);
  font-weight: 720;
  line-height: 1.08;
  letter-spacing: 0;
}

.hero p:not(.price),
.result-card p,
.empty-state p,
.legal {
  color: var(--muted);
  line-height: 1.55;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 22px;
  margin-top: 112px;
}

.search-card,
.result-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(8, 8, 9, 0.82);
}

.search-card {
  display: grid;
  align-content: start;
  align-items: start;
  gap: 16px;
  padding: 22px;
}

.result-card {
  display: flex;
  flex-direction: column;
  min-height: 438px;
  padding: 22px;
}

.field {
  display: grid;
  align-content: start;
}

.field span {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 700;
}

input {
  width: 100%;
  height: 52px;
  min-height: 52px;
  border: 1px solid var(--line);
  border-radius: 7px;
  outline: 0;
  background: #050506;
  color: var(--text);
  padding: 0 14px;
}

input:focus {
  border-color: var(--accent);
}

.date-wheels {
  display: grid;
  grid-template-columns: 52px 58px 72px;
  gap: 6px;
  width: max-content;
  height: 52px;
  min-height: 52px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #050506;
  padding: 6px;
}

.date-wheels select {
  min-width: 0;
  height: 38px;
  border: 0;
  border-radius: 7px;
  outline: 0;
  background: #101014;
  color: var(--text);
  text-align: center;
  text-align-last: center;
  padding: 0 8px;
}

.date-wheels select:focus {
  box-shadow: 0 0 0 1px var(--accent);
}

.url-field {
  gap: 8px;
}

.url-row,
.url-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.url-row input {
  flex: 1;
  min-width: 0;
}

.favicon {
  width: 26px;
  height: 26px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #050506;
}

.url-add,
.url-remove {
  display: grid;
  min-width: 42px;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #111114;
  color: var(--text);
  cursor: pointer;
  font-weight: 900;
}

.url-list {
  display: grid;
  gap: 8px;
}

.url-chip input {
  min-height: 46px;
}

.upload-box {
  display: flex;
  align-items: center;
  gap: 11px;
  height: 56px;
  min-height: 56px;
  border: 1px dashed #303036;
  border-radius: 7px;
  color: var(--text);
  cursor: pointer;
  padding: 0 14px;
}

.upload-box input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.upload-icon {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 7px;
  background: var(--accent);
  font-weight: 800;
}

.signal-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 0;
  border: 0;
  padding: 0;
}

.signal-options legend {
  grid-column: 1 / -1;
  margin-bottom: 2px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.signal-options label {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #070708;
  color: var(--muted);
  font-size: 0.78rem;
  padding: 0 10px;
}

.signal-options input {
  width: 14px;
  height: 14px;
  min-height: 14px;
  accent-color: var(--accent);
}

.mini-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 132px auto;
  align-items: start;
  gap: 12px;
}

.pay-button,
.scan-button,
.report-footer button {
  min-height: 48px;
  border: 0;
  border-radius: 7px;
  cursor: pointer;
  font-weight: 800;
  padding: 0 16px;
}

.pay-button {
  flex: 1;
  background: white;
  color: black;
}

.scan-button {
  flex: 1;
  background: var(--accent);
  color: white;
}

.progress-card {
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.progress-copy {
  color: var(--muted);
  font-size: 0.9rem;
}

.progress-copy strong {
  color: var(--text);
}

.progress-track {
  overflow: hidden;
  height: 8px;
  margin-top: 10px;
  border-radius: 999px;
  background: #222226;
}

.progress-fill {
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
  transition: width 320ms ease;
}

.result-card h2 {
  margin-bottom: 0;
  font-size: 1.7rem;
}

.result-summary {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.86rem;
}

.score-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 18px 0;
}

.score-row div,
.empty-state,
.match-card {
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel-soft);
  padding: 12px;
}

.score-row span,
.confidence span,
.report-footer {
  color: var(--muted);
  font-size: 0.82rem;
}

.score-row strong {
  display: block;
  margin-top: 8px;
  font-size: 2rem;
}

#riskScore {
  color: var(--warning);
}

.match-list {
  display: grid;
  gap: 9px;
}

.scan-feed {
  display: grid;
  gap: 7px;
  margin-top: 12px;
}

.scan-step {
  display: grid;
  grid-template-columns: 18px 1fr auto;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.025);
  color: var(--muted);
  font-size: 0.78rem;
  padding: 0 10px;
}

.scan-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #34343a;
}

.scan-step.active .scan-dot {
  background: var(--accent);
  box-shadow: 0 0 0 5px rgba(240, 68, 100, 0.13);
}

.scan-step.done .scan-dot {
  background: #65d48f;
}

.scan-step strong {
  color: var(--text);
  font-weight: 760;
}

.scan-step span:last-child {
  justify-self: end;
  color: var(--muted);
  font-size: 0.72rem;
}

.match-card {
  display: grid;
  grid-template-columns: 58px 1fr auto;
  align-items: center;
  gap: 10px;
  color: var(--text);
  text-decoration: none;
  transition:
    border-color 160ms ease,
    transform 160ms ease;
}

.match-card:hover {
  border-color: #4a4a52;
  transform: translateY(-1px);
}

.match-card.scanning {
  animation: scanPulse 1.25s ease-in-out infinite;
}

.match-thumb {
  overflow: hidden;
  width: 58px;
  height: 58px;
  border-radius: 7px;
  background:
    radial-gradient(circle at 50% 42%, rgba(240, 68, 100, 0.34), transparent 28px),
    #050506;
}

.match-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

@keyframes scanPulse {
  0%,
  100% {
    opacity: 0.68;
  }

  50% {
    opacity: 1;
  }
}

.match-card h3 {
  margin-bottom: 4px;
  font-size: 0.98rem;
}

.match-card p {
  margin: 0;
  font-size: 0.86rem;
  overflow-wrap: anywhere;
}

.avatar {
  display: none;
}

.confidence {
  text-align: right;
}

.confidence strong {
  display: block;
}

.empty-state {
  min-height: 128px;
  display: grid;
  place-content: center;
}

.empty-state h3 {
  margin-bottom: 6px;
}

.report-footer {
  margin-top: auto;
  padding-top: 14px;
}

.report-footer button {
  min-height: 38px;
  background: #232328;
  color: var(--text);
}

.report-footer button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.legal {
  max-width: 640px;
  margin: 18px 0 0;
  font-size: 0.74rem;
  opacity: 0.55;
}

.app-info {
  max-width: 720px;
  margin-top: 34px;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  color: var(--muted);
}

.app-info h2 {
  margin-bottom: 8px;
  color: var(--text);
  font-size: 0.92rem;
  letter-spacing: 0;
}

.app-info p {
  max-width: 680px;
  margin: 0 0 8px;
  font-size: 0.84rem;
  line-height: 1.7;
}

.profile-history {
  margin-top: 28px;
  padding-top: 22px;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
}

.profile-history-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 14px;
}

.profile-history h2 {
  margin: 0;
  font-size: 1.1rem;
}

.profile-history-head span {
  color: var(--muted);
  font-size: 0.78rem;
}

.history-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.history-actions button {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 0.76rem;
  font-weight: 760;
  padding: 0 12px;
}

.history-actions button:hover {
  border-color: #3a3a42;
  color: var(--text);
}

.tracked-profiles {
  display: grid;
  gap: 10px;
}

.tracked-empty,
.tracked-profile {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(8, 8, 9, 0.72);
  padding: 14px;
}

.tracked-empty {
  color: var(--muted);
  font-size: 0.86rem;
}

.tracked-profile {
  display: grid;
  grid-template-columns: 46px 1fr auto;
  align-items: center;
  gap: 12px;
  color: var(--text);
  text-decoration: none;
}

.tracked-profile img {
  width: 46px;
  height: 46px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #050506;
  object-fit: cover;
}

.tracked-profile h3 {
  margin: 0 0 4px;
  font-size: 0.96rem;
}

.tracked-profile p {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
  overflow-wrap: anywhere;
}

.tracked-stats {
  display: flex;
  flex-wrap: wrap;
  justify-content: end;
  gap: 6px;
}

.tracked-stats span {
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.74rem;
  padding: 5px 8px;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%) translateY(18px);
  max-width: min(500px, calc(100vw - 32px));
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #101013;
  color: var(--text);
  opacity: 0;
  padding: 12px 14px;
  transition:
    opacity 180ms ease,
    transform 180ms ease;
}

.toast.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

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

  .hero {
    padding-top: 72px;
  }
}

@media (max-width: 560px) {
  .shell {
    width: min(100vw - 22px, 980px);
    padding-top: 18px;
  }

  .topbar,
  .actions {
    align-items: stretch;
    flex-direction: column;
  }

  .language-picker {
    justify-content: space-between;
  }

  .mini-grid,
  .signal-options,
  .score-row,
  .tracked-profile {
    grid-template-columns: 1fr;
  }

  .date-wheels {
    grid-template-columns: 1fr 1fr 1fr;
  }

  .tracked-stats {
    justify-content: start;
  }

  .history-actions {
    align-items: start;
    flex-direction: column;
  }
}

/* Research workspace */
.workspace { grid-template-columns: minmax(270px, .85fr) minmax(340px, 1.15fr); align-items: start; }
.result-card { gap: 18px; }
.reference-workspace { border-bottom: 1px solid var(--line); padding-bottom: 18px; }
.reference-workspace[hidden], [hidden] { display: none !important; }
.reference-grid { display: flex; gap: 10px; overflow-x: auto; margin: 12px 0; }
.reference-grid img { width: 100px; height: 100px; object-fit: contain; border: 1px solid var(--line); border-radius: 8px; background: #050506; }
.reference-workspace small, .feature-note { color: var(--muted); font-size: .72rem; line-height: 1.6; }
.consent-row { display: flex; gap: 9px; align-items: start; font-size: .74rem; line-height: 1.5; color: var(--muted); }
.consent-row input { accent-color: var(--accent); }
.quiet-button { background: transparent; color: var(--muted); border: 1px solid var(--line); border-radius: 6px; padding: 8px 12px; cursor: pointer; }
button:disabled { opacity: .45; cursor: not-allowed; }
.match-list { max-height: 650px; overflow-y: auto; }
.match-card { min-width: 0; }
.match-card > div:nth-child(2) { min-width: 0; }
.match-card h3 { overflow-wrap: anywhere; }
.match-thumb img { object-fit: contain; background: #090909; }
.confidence { max-width: 96px; }
.confidence span { font-size: .66rem; }
.scan-step.error .scan-dot { background: #ffa561; }
.profile-record { border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.profile-record summary { cursor: pointer; }
.profile-record .tracked-profile { border: 0; border-radius: 0; }
.profile-timeline { padding: 0 16px 16px; overflow-x: auto; }
.profile-timeline table { width: 100%; border-collapse: collapse; font-size: .76rem; color: var(--muted); }
.profile-timeline td, .profile-timeline th { padding: 10px 8px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
.profile-timeline th { font-weight: 500; }
.profile-timeline a { color: var(--text); }
.profile-timeline p { color: var(--muted); font-size: .72rem; line-height: 1.6; }
.profile-controls { display: flex; justify-content: space-between; gap: 10px; margin-top: 14px; }
.plan-dialog { background: #0c0c0e; color: var(--text); border: 1px solid var(--line); border-radius: 14px; padding: 30px; max-width: min(430px, calc(100vw - 40px)); }
.plan-dialog::backdrop { background: #000b; backdrop-filter: blur(6px); }
.plan-dialog > button { float: right; }
.plan-dialog p { color: var(--muted); font-size: .85rem; line-height: 1.8; }
.plan-dialog .plan-price { color: var(--text); font-size: 2rem; }
.plan-price small { color: var(--muted); font-size: .8rem; }
@media(max-width: 760px) { .workspace { grid-template-columns: 1fr; margin-top: 60px; } .tracked-profile { grid-template-columns: 46px 1fr; } .tracked-stats { grid-column: 1 / -1; justify-content: start; } }
