:root {
  color-scheme: dark;
  --bg: #050505;
  --surface: #0d0d0d;
  --surface-2: #141414;
  --surface-3: #1c1c1c;
  --text: #f6f6f0;
  --muted: #92928b;
  --line: #252525;
  --lime: #c9ff31;
  --lime-ink: #101500;
  --danger: #ff6978;
  --shadow: 0 22px 70px rgba(0,0,0,.34);
  --radius: 22px;
}

html[data-theme="light"] {
  color-scheme: light;
  --bg: #f4f4ed;
  --surface: #ffffff;
  --surface-2: #eeeeE7;
  --surface-3: #e3e3db;
  --text: #11110f;
  --muted: #686861;
  --line: #d9d9d1;
  --lime: #9ed900;
  --lime-ink: #152000;
  --shadow: 0 22px 70px rgba(30,30,20,.10);
}

* { box-sizing: border-box; }
html { background: var(--bg); }
body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background:
    radial-gradient(circle at 85% 0%, color-mix(in srgb, var(--lime) 10%, transparent), transparent 30rem),
    var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}
button, input, select { font: inherit; }
button { color: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }

.app-shell { min-height: 100vh; padding-bottom: calc(78px + env(safe-area-inset-bottom)); }
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: calc(10px + env(safe-area-inset-top)) 18px 10px;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid color-mix(in srgb, var(--line) 75%, transparent);
}
.brand-button {
  appearance: none;
  border: 0;
  background: transparent;
  padding: 0;
  display: flex;
  gap: 9px;
  align-items: center;
  cursor: pointer;
}
.brand-eye { color: var(--lime); font-size: 24px; transform: scaleX(1.35); }
.brand-word { font-weight: 950; letter-spacing: -.055em; font-size: 18px; }
.top-actions { display: flex; gap: 8px; }
.icon-button, .round-add {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--surface-2);
  display: inline-grid;
  place-items: center;
  cursor: pointer;
  font-size: 21px;
}
.icon-button.primary, .round-add { background: var(--lime); color: var(--lime-ink); border-color: var(--lime); font-weight: 900; }
.icon-button:disabled, button:disabled { opacity: .45; cursor: wait; }

.main-content { width: min(760px, 100%); margin: 0 auto; padding: 0 16px 42px; }
.screen { display: none; animation: enter .18s ease-out; }
.screen.active { display: block; }
@keyframes enter { from { opacity: .25; transform: translateY(5px); } }

.hero { padding: 28px 2px 18px; }
.hero.compact h1 { margin: 5px 0 12px; font-size: clamp(42px, 12vw, 66px); line-height: .88; letter-spacing: -.065em; text-transform: uppercase; font-weight: 1000; }
.hero.compact h1 span { color: var(--lime); display: inline-block; transform: rotate(-2deg); }
.eyebrow { margin: 0; color: var(--lime); font-size: 11px; line-height: 1.2; letter-spacing: .16em; font-weight: 900; text-transform: uppercase; }
.hero-copy { max-width: 36rem; color: var(--muted); font-size: 15px; line-height: 1.55; margin: 0; }
.since-card {
  margin-top: 20px;
  padding: 16px 17px;
  border: 1px solid color-mix(in srgb, var(--lime) 42%, var(--line));
  border-radius: 18px;
  background: linear-gradient(135deg, color-mix(in srgb, var(--lime) 9%, var(--surface)), var(--surface));
}
.since-card span { display: block; color: var(--lime); font-size: 10px; font-weight: 900; letter-spacing: .12em; }
.since-card strong { display: block; font-size: 20px; margin-top: 4px; }
.since-card small { color: var(--muted); }

.filter-row { display: flex; overflow-x: auto; gap: 8px; padding: 2px 0 18px; scrollbar-width: none; }
.filter-row::-webkit-scrollbar { display: none; }
.filter-pill {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  padding: 9px 14px;
  border-radius: 999px;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
}
.filter-pill.active { background: var(--lime); color: var(--lime-ink); border-color: var(--lime); }

.feed-list, .alerts-list { display: grid; gap: 13px; }
.feed-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.feed-meta { display: flex; align-items: center; gap: 11px; padding: 15px 15px 10px; }
.avatar {
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--surface-3);
  border: 1px solid var(--line);
  color: var(--lime);
  font-weight: 950;
  letter-spacing: -.04em;
}
.feed-meta-copy { min-width: 0; flex: 1; }
.feed-meta-copy strong, .feed-meta-copy small { display: block; }
.feed-meta-copy strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.feed-meta-copy small { color: var(--muted); margin-top: 2px; }
.source-mark {
  min-width: 34px;
  height: 28px;
  padding: 0 8px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  font-size: 10px;
  font-weight: 1000;
  border: 1px solid var(--line);
  background: var(--surface-2);
}
.source-mark.tiktok { color: #ff6eae; }
.source-mark.youtube { color: #ff6565; }
.source-mark.bluesky { color: #78a9ff; }
.source-mark.mastodon { color: #b6a5ff; }
.source-mark.rss, .source-mark.web, .source-mark.press { color: #8db6ff; }
.source-mark.instagram { color: #d48cff; }
.source-mark.x, .source-mark.twitter { color: var(--text); }
.feed-body { padding: 2px 15px 15px; }
.feed-body h2 { margin: 4px 0 6px; font-size: 18px; letter-spacing: -.025em; }
.feed-body p { margin: 0; color: var(--muted); line-height: 1.5; font-size: 14px; }
.feed-thumb { width: 100%; max-height: 360px; object-fit: cover; display: block; background: var(--surface-2); }
.feed-link { display: inline-flex; margin-top: 13px; color: var(--lime); text-decoration: none; font-weight: 850; font-size: 13px; }
.new-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--lime); box-shadow: 0 0 0 4px color-mix(in srgb, var(--lime) 13%, transparent); }

.section-head { display: flex; justify-content: space-between; align-items: end; gap: 16px; padding: 28px 2px 18px; }
.section-head h1 { margin: 3px 0 0; font-size: 43px; line-height: 1; letter-spacing: -.055em; text-transform: uppercase; }
.search-box {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 14px;
  height: 48px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  margin-bottom: 14px;
}
.search-box span { color: var(--muted); font-size: 20px; }
.search-box input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--text); }

.target-list { display: grid; gap: 8px; }
.target-row {
  width: 100%;
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 18px;
  padding: 12px 13px;
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
  cursor: pointer;
}
.target-row .avatar { width: 46px; height: 46px; }
.target-copy { flex: 1; min-width: 0; }
.target-copy strong { display: block; font-size: 15px; }
.target-copy small { display: block; color: var(--muted); margin-top: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.target-count { min-width: 28px; height: 28px; padding: 0 8px; border-radius: 999px; display: grid; place-items: center; background: color-mix(in srgb, var(--lime) 12%, var(--surface-2)); color: var(--lime); font-size: 12px; font-weight: 900; }

.alert-row {
  border-bottom: 1px solid var(--line);
  display: grid;
  grid-template-columns: 48px 1fr auto;
  gap: 11px;
  padding: 14px 2px;
  align-items: start;
}
.alert-time { color: var(--muted); font-size: 12px; padding-top: 2px; }
.alert-copy strong, .alert-copy span { display: block; }
.alert-copy strong { font-size: 14px; }
.alert-copy span { color: var(--muted); font-size: 13px; margin-top: 3px; }

.settings-stack { display: grid; gap: 12px; }
.settings-card { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 16px; }
.settings-card h2 { margin: 0 0 12px; font-size: 17px; letter-spacing: -.025em; }
.field-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; min-height: 48px; border-top: 1px solid var(--line); }
.field-row:first-of-type { border-top: 0; }
.field-row span { color: var(--muted); }
.field-row select, .field-row input {
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 10px;
  max-width: 52%;
}
.foundation-card { border-color: color-mix(in srgb, var(--lime) 35%, var(--line)); }
.foundation-title { display: flex; justify-content: space-between; gap: 12px; align-items: start; }
.health-dot { width: 11px; height: 11px; border-radius: 50%; display: block; margin-top: 4px; }
.health-dot.pending { background: #d6b55f; }
.health-dot.ok { background: var(--lime); box-shadow: 0 0 14px color-mix(in srgb, var(--lime) 55%, transparent); }
.health-dot.error { background: var(--danger); }
.status-grid { margin: 8px 0 15px; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.status-grid div { padding: 10px; background: var(--surface-2); border-radius: 12px; }
.status-grid dt { color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .08em; }
.status-grid dd { margin: 4px 0 0; font-weight: 800; font-size: 13px; }
.button-row { display: flex; gap: 8px; flex-wrap: wrap; }
.primary-button, .ghost-button {
  border-radius: 12px;
  padding: 10px 13px;
  font-weight: 850;
  cursor: pointer;
}
.primary-button { background: var(--lime); color: var(--lime-ink); border: 1px solid var(--lime); }
.primary-button.full { width: 100%; min-height: 48px; }
.ghost-button { background: transparent; border: 1px solid var(--line); color: var(--text); }
.ghost-button.danger { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 35%, var(--line)); }
.danger-zone p { color: var(--muted); font-size: 13px; line-height: 1.45; }
.account-form { display: grid; gap: 9px; }
.account-form input, .form-field input, .form-field select {
  width: 100%;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--text);
  border-radius: 12px;
  padding: 12px;
  outline: none;
}
.account-status { color: var(--muted); font-size: 13px; margin: -3px 0 10px; }

.bottom-nav {
  position: fixed;
  z-index: 30;
  left: 0;
  right: 0;
  bottom: 0;
  min-height: calc(66px + env(safe-area-inset-bottom));
  padding: 7px max(12px, calc((100vw - 760px) / 2)) env(safe-area-inset-bottom);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: blur(20px);
  border-top: 1px solid var(--line);
}
.nav-item {
  position: relative;
  border: 0;
  background: transparent;
  color: var(--muted);
  display: grid;
  place-items: center;
  gap: 1px;
  cursor: pointer;
}
.nav-item span { font-size: 20px; }
.nav-item small { font-size: 10px; font-weight: 750; }
.nav-item.active { color: var(--lime); }
.nav-item i { position: absolute; top: 0; right: calc(50% - 18px); min-width: 17px; height: 17px; padding: 0 4px; border-radius: 999px; background: var(--danger); color: white; font-size: 9px; font-style: normal; display: grid; place-items: center; }

.modal { border: 0; padding: 0; background: transparent; width: min(620px, calc(100% - 18px)); max-height: min(88vh, 820px); }
.modal::backdrop { background: rgba(0,0,0,.74); backdrop-filter: blur(5px); }
.modal-card { margin: 0; width: 100%; max-height: 88vh; overflow: auto; background: var(--surface); color: var(--text); border: 1px solid var(--line); border-radius: 24px; padding: 18px; box-shadow: var(--shadow); }
.modal-head { display: flex; justify-content: space-between; gap: 15px; align-items: start; margin-bottom: 13px; }
.modal-head h2 { margin: 3px 0 0; font-size: 28px; line-height: 1; letter-spacing: -.05em; }
.muted { color: var(--muted); line-height: 1.5; font-size: 13px; }
.form-field { display: grid; gap: 7px; margin: 13px 0; }
.form-field span { color: var(--muted); font-size: 12px; font-weight: 800; }
.check-row { display: flex; align-items: center; gap: 9px; color: var(--muted); font-size: 13px; margin: 13px 0 16px; }
.form-error { color: var(--danger); min-height: 18px; font-size: 12px; }
.source-chips { display: flex; gap: 8px; flex-wrap: wrap; margin: 15px 0; }
.source-chip { border: 1px solid var(--line); border-radius: 12px; padding: 8px 10px; background: var(--surface-2); }
.source-chip strong { font-size: 11px; text-transform: uppercase; }
.source-chip small { display: block; color: var(--muted); margin-top: 3px; max-width: 300px; overflow: hidden; text-overflow: ellipsis; }
.source-chip.ok strong { color: var(--lime); }
.source-chip.error strong { color: var(--danger); }
.timeline-title { margin-top: 24px; text-transform: uppercase; letter-spacing: .08em; font-size: 12px; color: var(--muted); }
.mini-timeline { display: grid; gap: 0; }
.mini-row { padding: 11px 0; border-bottom: 1px solid var(--line); }
.mini-row strong { display: block; font-size: 13px; }
.mini-row small { color: var(--muted); }
.legal-card p { line-height: 1.6; }

.empty-state { border: 1px dashed var(--line); border-radius: 18px; padding: 26px 18px; text-align: center; color: var(--muted); background: color-mix(in srgb, var(--surface) 68%, transparent); }
.empty-state strong { color: var(--text); display: block; margin-bottom: 5px; }
.toast { position: fixed; z-index: 60; left: 50%; bottom: calc(84px + env(safe-area-inset-bottom)); transform: translateX(-50%); width: min(430px, calc(100% - 28px)); background: var(--text); color: var(--bg); border-radius: 14px; padding: 11px 14px; font-size: 13px; font-weight: 780; box-shadow: var(--shadow); text-align: center; }

@media (min-width: 760px) {
  .topbar { padding-left: max(22px, calc((100vw - 760px) / 2)); padding-right: max(22px, calc((100vw - 760px) / 2)); }
  .main-content { padding-left: 22px; padding-right: 22px; }
  .hero { padding-top: 42px; }
  .feed-list { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
  .feed-card:first-child { grid-column: 1 / -1; }
  .target-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .settings-stack { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
  .foundation-card { grid-column: 1 / -1; }
}
