:root {
  --bg: #020711;
  --surface: #071321;
  --surface-strong: #0b1a2d;
  --surface-soft: #101f34;
  --text: #f4f7fb;
  --muted: #9aa7bc;
  --muted-strong: #c3ccda;
  --line: #1d314b;
  --line-strong: #294260;
  --green: #91e46f;
  --green-soft: rgba(145, 228, 111, 0.12);
  --gold: #f3c76f;
  --gold-soft: rgba(243, 199, 111, 0.14);
  --blue: #5aa6ff;
  --violet: #a98cff;
  --red: #ff625d;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
}

body {
  min-height: 100%;
  margin: 0;
  background:
    radial-gradient(circle at 50% -10%, rgba(61, 135, 255, 0.18), transparent 34rem),
    linear-gradient(180deg, #010610 0%, #06111e 100%);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.4;
}

button,
input {
  font: inherit;
}

button {
  color: inherit;
}

svg {
  width: 1.25rem;
  height: 1.25rem;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  place-items: stretch center;
}

.phone-surface {
  width: 100%;
  max-width: 28rem;
  min-height: 100vh;
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(6, 17, 30, 0.92) 0%, rgba(2, 7, 17, 0.96) 100%),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.02) 0 1px, transparent 1px 5.5rem);
  box-shadow: var(--shadow);
  padding-bottom: 6.5rem;
}

.top {
  padding: max(0.8rem, env(safe-area-inset-top)) 1rem 0.95rem;
  border-bottom: 1px solid var(--line);
}

.status-bar {
  min-height: 1.4rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--text);
  font-size: 0.95rem;
  font-weight: 800;
  margin: 0 1.3rem 0.55rem;
}

.system-icons {
  color: rgba(255, 255, 255, 0.92);
  font-size: 0.72rem;
  text-transform: uppercase;
  word-spacing: 0.28rem;
}

.brand-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem;
  margin-bottom: 1rem;
}

.brand {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.brand h1 {
  margin: 0;
  color: #f8fbff;
  font-size: 2rem;
  line-height: 0.95;
  font-weight: 760;
  letter-spacing: 0;
}

.brand p {
  margin: 0.28rem 0 0;
  color: var(--gold);
  font-size: 0.67rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
  white-space: nowrap;
}

.radar-mark {
  width: 3.4rem;
  height: 3.4rem;
  flex: 0 0 auto;
  position: relative;
  border: 2px solid var(--gold);
  border-radius: 50%;
  color: var(--gold);
  background: rgba(243, 199, 111, 0.05);
}

.radar-ring {
  position: absolute;
  inset: 0.42rem;
  border: 1px solid currentColor;
  border-radius: 50%;
  opacity: 0.9;
}

.radar-ring-two {
  inset: 0.88rem;
}

.radar-ring-three {
  inset: 1.35rem;
}

.radar-sweep {
  position: absolute;
  width: 2.25rem;
  height: 0.24rem;
  left: 0.82rem;
  top: 1.52rem;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--green), #12a455);
  transform: rotate(-45deg);
  transform-origin: 0.3rem 50%;
  box-shadow: 0 0 1.1rem rgba(145, 228, 111, 0.55);
}

.radar-dot {
  position: absolute;
  width: 0.52rem;
  height: 0.52rem;
  right: 0.48rem;
  top: 0.45rem;
  border-radius: 50%;
  background: var(--green);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.live-pill,
.icon-button,
.filter-button,
.sort-button,
.segmented button {
  border: 1px solid var(--line-strong);
  background: rgba(12, 28, 47, 0.72);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.02);
}

.live-pill {
  height: 2.35rem;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  border-color: rgba(145, 228, 111, 0.26);
  border-radius: 999px;
  color: var(--green);
  padding: 0 0.85rem;
  font-size: 0.78rem;
  font-weight: 900;
}

.live-pill i {
  width: 0.46rem;
  height: 0.46rem;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 0.9rem currentColor;
}

.icon-button {
  width: 2.35rem;
  height: 2.35rem;
  border-radius: 0.7rem;
  display: grid;
  place-items: center;
}

.search-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.65rem;
  margin-bottom: 0.9rem;
}

.search-box {
  min-height: 3.35rem;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  border: 1px solid var(--line-strong);
  border-radius: 0.78rem;
  background: rgba(15, 30, 50, 0.82);
  padding: 0 0.85rem;
  color: var(--muted-strong);
}

.search-box svg {
  flex: 0 0 auto;
}

.search-box input {
  min-width: 0;
  width: 100%;
  border: 0;
  outline: 0;
  color: var(--text);
  background: transparent;
  font-size: 0.95rem;
}

.search-box input::placeholder {
  color: #8d98aa;
}

.filter-button {
  min-height: 3.35rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border-radius: 0.78rem;
  padding: 0 0.86rem;
  color: var(--gold);
  font-size: 0.92rem;
  font-weight: 760;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border: 1px solid var(--line);
  border-radius: 0.9rem;
  overflow: hidden;
  background: rgba(8, 22, 38, 0.78);
}

.stat {
  min-width: 0;
  display: grid;
  align-content: center;
  gap: 0.1rem;
  min-height: 4.1rem;
  padding: 0.58rem 0.45rem;
  border-left: 1px solid var(--line);
}

.stat:first-child {
  border-left: 0;
}

.stat-icon {
  display: none;
}

.stat strong {
  color: var(--green);
  font-size: 1.18rem;
  line-height: 1;
}

.stat:nth-child(2) strong,
.stat:nth-child(4) strong {
  color: var(--gold);
}

.stat span:last-child {
  color: var(--muted-strong);
  font-size: 0.66rem;
  line-height: 1.15;
}

.public-note {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.42rem;
  margin: 0.88rem 0 0;
  color: var(--muted);
  font-size: 0.78rem;
  text-align: center;
}

.public-note svg {
  width: 0.92rem;
  height: 0.92rem;
}

.feed-section {
  padding: 0 1rem;
}

.feed-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  margin: 0.9rem 0 0.75rem;
}

.feed-toolbar h2 {
  display: flex;
  align-items: center;
  gap: 0.48rem;
  margin: 0;
  font-size: 0.96rem;
  line-height: 1;
  text-transform: uppercase;
}

.feed-toolbar h2 svg {
  color: var(--green);
}

.sort-button {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  border-radius: 999px;
  color: var(--muted-strong);
  padding: 0.5rem 0.7rem;
  font-size: 0.8rem;
}

.segmented {
  display: flex;
  gap: 0.45rem;
  overflow-x: auto;
  padding: 0 0 0.75rem;
  scrollbar-width: none;
}

.segmented::-webkit-scrollbar {
  display: none;
}

.segmented button {
  flex: 0 0 auto;
  min-height: 2.2rem;
  border-radius: 999px;
  color: var(--muted);
  padding: 0 0.85rem;
  font-size: 0.8rem;
  font-weight: 730;
}

.segmented button.active {
  color: #08111c;
  border-color: var(--gold);
  background: var(--gold);
}

.feed-list {
  display: grid;
  gap: 0.85rem;
}

.feed-card {
  position: relative;
  display: grid;
  grid-template-columns: 4.25rem minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 0.9rem;
  background:
    linear-gradient(120deg, rgba(14, 39, 68, 0.98), rgba(5, 17, 30, 0.98)),
    radial-gradient(circle at 100% 0, rgba(90, 166, 255, 0.12), transparent 16rem);
  box-shadow: 0 0.95rem 2.4rem rgba(0, 0, 0, 0.22);
}

.feed-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 0.16rem;
  background: var(--green);
  box-shadow: 0 0 1rem currentColor;
}

.feed-card.accent-gold::before {
  background: var(--gold);
}

.feed-card.accent-violet::before {
  background: var(--violet);
}

.feed-card.accent-blue::before {
  background: var(--blue);
}

.recipient-stack {
  display: grid;
  align-content: start;
  justify-items: center;
  gap: 1.2rem;
  padding: 1.1rem 0.55rem 0.9rem;
}

.avatar {
  position: relative;
  width: 2.95rem;
  height: 2.95rem;
  display: grid;
  place-items: center;
  border: 2px solid var(--blue);
  border-radius: 50%;
  color: #f7fbff;
  background: linear-gradient(135deg, #275fbd, #14345e);
  font-size: 1.05rem;
  font-weight: 850;
}

.avatar span {
  position: absolute;
  right: -0.28rem;
  bottom: -0.2rem;
  width: 1.13rem;
  height: 1.13rem;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid #6db2ff;
  background: #1d71d7;
  font-size: 0.61rem;
}

.party-r {
  border-color: var(--red);
  background: linear-gradient(135deg, #a43334, #421418);
}

.party-r span {
  border-color: #ff8b86;
  background: #c73435;
}

.party-i,
.party-neutral {
  border-color: var(--violet);
  background: linear-gradient(135deg, #5f46a8, #261f48);
}

.party-i span {
  border-color: #c0aaff;
  background: #7357c8;
}

.source-orb {
  width: 2.75rem;
  height: 2.75rem;
  display: grid;
  place-items: center;
  border: 1px solid rgba(243, 199, 111, 0.42);
  border-radius: 50%;
  color: var(--gold);
  background: var(--gold-soft);
}

.feed-body {
  min-width: 0;
  padding: 1.02rem 0.82rem 0 0;
}

.feed-head {
  display: flex;
  justify-content: space-between;
  gap: 0.8rem;
}

.feed-head h2 {
  margin: 0;
  font-size: 1rem;
  line-height: 1.08;
}

.feed-head p,
.flow-row p {
  margin: 0.1rem 0 0;
  color: var(--muted);
  font-size: 0.83rem;
}

.entity-chip {
  display: inline-flex;
  margin-top: 0.42rem;
  border-radius: 999px;
  padding: 0.14rem 0.5rem;
  color: var(--muted-strong);
  background: rgba(255, 255, 255, 0.06);
  font-size: 0.7rem;
}

.amount {
  flex: 0 0 auto;
  display: grid;
  justify-items: end;
  align-content: start;
  gap: 0.28rem;
}

.amount strong {
  color: var(--green);
  font-size: 1.05rem;
  line-height: 1;
}

.amount span {
  color: var(--muted);
  font-size: 0.75rem;
}

.flow-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.62rem;
  margin-top: 0.8rem;
  padding-top: 0.72rem;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
}

.flow-row span {
  color: var(--muted);
  font-size: 0.8rem;
}

.flow-row strong {
  display: inline;
  margin-left: 0.24rem;
  color: var(--text);
  font-size: 0.84rem;
}

.flow-chip {
  width: fit-content;
  max-width: 100%;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  border: 1px solid currentColor;
  border-radius: 999px;
  padding: 0.24rem 0.55rem;
  font-size: 0.68rem;
}

.tone-violet {
  color: var(--violet);
  background: rgba(169, 140, 255, 0.08);
}

.tone-gold {
  color: var(--gold);
  background: var(--gold-soft);
}

.tone-blue {
  color: var(--blue);
  background: rgba(90, 166, 255, 0.1);
}

.support-chip {
  display: inline-flex;
  color: inherit;
  font-size: 0.64rem;
}

.evidence-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
  align-items: center;
  margin: 0.78rem -0.82rem 0 0;
  padding: 0.72rem 0.82rem 0.72rem 0;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  color: var(--muted);
}

.evidence-row > span,
.evidence-row a {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--muted-strong);
  font-size: 0.72rem;
  text-decoration: none;
}

.evidence-row svg {
  width: 1rem;
  height: 1rem;
  flex: 0 0 auto;
}

.confidence {
  grid-column: span 1;
  color: var(--green) !important;
  flex-wrap: wrap;
}

.confidence em {
  flex-basis: 100%;
  color: var(--muted);
  font-style: normal;
  padding-left: 1.35rem;
}

.evidence-row a {
  justify-content: center;
  border: 1px solid var(--line-strong);
  border-radius: 0.58rem;
  padding: 0.55rem 0.6rem;
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
  font-weight: 760;
}

.empty-state {
  border: 1px solid var(--line);
  border-radius: 0.9rem;
  padding: 1.1rem;
  color: var(--muted-strong);
  background: rgba(11, 26, 45, 0.8);
}

.bottom-nav {
  position: fixed;
  left: 50%;
  bottom: 0;
  z-index: 10;
  width: min(100%, 28rem);
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  padding: 0.78rem 0.65rem max(0.8rem, env(safe-area-inset-bottom));
  border: 1px solid var(--line);
  border-bottom: 0;
  border-radius: 1rem 1rem 0 0;
  background: rgba(7, 18, 32, 0.95);
  backdrop-filter: blur(18px);
  transform: translateX(-50%);
}

.bottom-nav button {
  min-width: 0;
  display: grid;
  justify-items: center;
  gap: 0.32rem;
  border: 0;
  color: var(--muted);
  background: transparent;
  font-size: 0.7rem;
}

.bottom-nav svg {
  width: 1.45rem;
  height: 1.45rem;
  stroke-width: 1.9;
}

.bottom-nav button.active {
  color: var(--gold);
}

@media (min-width: 48rem) {
  .app-shell {
    padding: 2rem 0;
  }

  .phone-surface {
    min-height: 56rem;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 1.8rem;
  }

  .bottom-nav {
    position: sticky;
    margin-top: 1rem;
    left: auto;
    bottom: 0;
    width: 100%;
    transform: none;
  }

  .stat-icon {
    display: grid;
    place-items: center;
    width: 1.62rem;
    height: 1.62rem;
    margin-bottom: 0.15rem;
    border: 1px solid rgba(145, 228, 111, 0.3);
    border-radius: 50%;
    color: var(--green);
    background: var(--green-soft);
  }

  .stat-icon svg {
    width: 1rem;
    height: 1rem;
  }
}
