:root {
  color: #0f1419;
  background: #fbfbfa;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  --ink: #0f1419;
  --muted: #5d6672;
  --soft: #f4f5f4;
  --line: #deded9;
  --green: #0b8f55;
  --shadow: 0 24px 70px rgba(20, 23, 28, 0.08);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background: #fbfbfa;
}

button {
  font: inherit;
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 70px;
  padding: 0 clamp(18px, 3.4vw, 44px);
  border-bottom: 1px solid var(--line);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-size: 23px;
  font-weight: 760;
  letter-spacing: 0;
}

.brand-mark {
  position: relative;
  width: 30px;
  height: 30px;
  border: 4px solid var(--ink);
  border-radius: 8px;
}

.brand-mark::after {
  position: absolute;
  right: -9px;
  bottom: -9px;
  width: 18px;
  height: 18px;
  content: "";
  background: #fbfbfa;
  border: 4px solid var(--ink);
  border-radius: 8px;
}

.privacy-status {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #2b343d;
  font-size: 15px;
}

.privacy-status:hover {
  color: #0a7147;
}

.privacy-status span {
  display: block;
  width: 20px;
  height: 20px;
  background: var(--green);
  border-radius: 50%;
  position: relative;
}

.privacy-status span::after {
  position: absolute;
  left: 6px;
  top: 4px;
  width: 5px;
  height: 9px;
  content: "";
  border-bottom: 2px solid #fff;
  border-right: 2px solid #fff;
  transform: rotate(45deg);
}

.hero {
  padding: clamp(28px, 4vw, 46px) clamp(18px, 3.4vw, 44px) 34px;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 390px;
  gap: clamp(28px, 4vw, 44px);
  max-width: 1400px;
  margin: 0 auto;
  align-items: start;
}

.picker {
  position: sticky;
  top: 22px;
  align-self: start;
}

.intro {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 28px;
}

.intro h1 {
  max-width: 720px;
  margin: 0;
  font-size: clamp(56px, 7vw, 104px);
  line-height: 0.94;
  letter-spacing: 0;
}

.intro p {
  flex: 0 0 auto;
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 17px;
}

.picker-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: flex-end;
  margin: -6px 0 18px;
  padding: 0;
}

.picker-primary-action {
  min-height: 46px;
  border-radius: var(--radius);
  font-size: 15px;
  font-weight: 780;
}

.picker-primary-action {
  min-width: 180px;
  padding: 0 18px;
  color: #fff;
  background: var(--green);
  border: 1px solid #087444;
}

.picker-primary-action:disabled {
  background: #8fa99d;
  border-color: #8fa99d;
  cursor: progress;
}

.custom-compose-add:focus-visible,
.custom-compose-cancel:focus-visible,
.remove-custom:focus-visible {
  outline: 2px solid rgba(11, 143, 85, 0.36);
  outline-offset: 2px;
}

.category-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.category-card {
  position: relative;
  display: grid;
  min-width: 0;
}

.image-button {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  min-height: 0;
  padding: 0;
  overflow: hidden;
  color: #fff;
  background: #f1f1ef;
  border: 0;
  border-radius: var(--radius);
  box-shadow: 0 16px 44px rgba(18, 22, 26, 0.06);
  line-height: 0;
  appearance: none;
}

.image-button img {
  position: absolute;
  inset: 0;
}

.image-button img,
.ad-image img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center bottom;
}

.image-button::after {
  position: absolute;
  inset: 0;
  content: "";
  background: linear-gradient(180deg, transparent 43%, rgba(0, 0, 0, 0.58));
}

.image-button:hover {
  transform: translateY(-1px);
}

.custom-compose-button,
.custom-compose-form {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  min-height: 0;
  overflow: hidden;
  border: 1px dashed rgba(15, 20, 25, 0.24);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: 0 16px 44px rgba(18, 22, 26, 0.04);
}

.custom-compose-button {
  display: grid;
  place-items: center;
  gap: 10px;
  color: var(--ink);
}

.custom-compose-button:hover {
  border-color: rgba(11, 143, 85, 0.7);
  transform: translateY(-1px);
}

.custom-compose-button b {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  color: var(--green);
  border: 2px solid currentColor;
  border-radius: 50%;
  font-size: 35px;
  font-weight: 520;
  line-height: 1;
}

.custom-compose-button span {
  max-width: 80%;
  color: #111820;
  font-size: 18px;
  font-weight: 780;
  line-height: 1.08;
  text-align: center;
}

.custom-compose-form {
  display: grid;
  grid-template-rows: 1fr auto;
  gap: 10px;
  padding: 16px;
  border-style: solid;
  border-color: rgba(11, 143, 85, 0.42);
}

.custom-topic-input {
  width: 100%;
  min-width: 0;
  height: 100%;
  resize: none;
  padding: 0;
  color: var(--ink);
  background: transparent;
  border: 0;
  font: inherit;
  font-size: clamp(21px, 2.1vw, 30px);
  font-weight: 780;
  line-height: 1.05;
  outline: 0;
}

.custom-topic-input::placeholder {
  color: #9aa1a8;
}

.custom-compose-form:focus-within {
  border-color: rgba(11, 143, 85, 0.76);
  box-shadow: 0 0 0 2px rgba(11, 143, 85, 0.14), 0 16px 44px rgba(18, 22, 26, 0.06);
}

.custom-compose-actions {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.custom-compose-add,
.custom-compose-cancel {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0 12px;
  border-radius: var(--radius);
  font-size: 12px;
  font-weight: 820;
}

.custom-compose-add {
  color: #fff;
  background: var(--green);
  border: 1px solid #087444;
}

.custom-compose-cancel {
  color: #4d5760;
  background: #fff;
  border: 1px solid var(--line);
}

.custom-image-button {
  display: grid;
  place-items: center;
  background: #182129;
}

.custom-image-button::after {
  background: none;
}

.custom-visual {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 8px;
  color: #fff;
  pointer-events: none;
}

.custom-visual b {
  font-size: clamp(38px, 5vw, 70px);
  line-height: 0.9;
  letter-spacing: 0;
}

.custom-visual small {
  color: rgba(255, 255, 255, 0.72);
  font-size: 12px;
  font-weight: 780;
  text-transform: uppercase;
}

.ad-image .custom-visual {
  background: #111820;
}

.category-card.selected .image-button {
  box-shadow: 0 0 0 2px rgba(11, 143, 85, 0.28), 0 18px 48px rgba(18, 22, 26, 0.08);
}

.category-title {
  position: absolute;
  left: 16px;
  bottom: 15px;
  z-index: 1;
  max-width: calc(100% - 32px);
  overflow: hidden;
  font-size: 18px;
  font-weight: 780;
  text-align: left;
  text-overflow: ellipsis;
  text-shadow: 0 2px 16px rgba(0, 0, 0, 0.42);
  white-space: nowrap;
}

.checkmark {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  display: none;
  width: 28px;
  height: 28px;
  background: var(--green);
  border-radius: 50%;
}

.checkmark::after {
  position: absolute;
  left: 9px;
  top: 6px;
  width: 6px;
  height: 11px;
  content: "";
  border-bottom: 2px solid #fff;
  border-right: 2px solid #fff;
  transform: rotate(45deg);
}

.category-card.selected .checkmark {
  display: block;
}

.remove-custom {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 3;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  color: #111820;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(15, 20, 25, 0.12);
  border-radius: 50%;
  font-size: 14px;
  font-weight: 860;
  line-height: 1;
}

.remove-custom:hover {
  color: #fff;
  background: #111820;
  border-color: #111820;
}

.option-row {
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 56px;
  z-index: 3;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  max-height: calc(100% - 72px);
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  transform: translateY(6px);
  transition: opacity 160ms ease, transform 160ms ease;
}

.option {
  min-height: 30px;
  padding: 0 10px;
  color: #fff;
  background: rgba(15, 20, 25, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 780;
  box-shadow: 0 10px 24px rgba(15, 20, 25, 0.18);
  backdrop-filter: blur(10px);
}

.category-card:hover .option-row,
.category-card:focus-within .option-row {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.option.active,
.category-card.selected .option:hover {
  color: #063f29;
  background: #eaf5ef;
  border-color: #b8dec9;
}

.feed-panel {
  position: sticky;
  top: 22px;
  align-self: start;
  display: flex;
  flex-direction: column;
  padding: 22px;
  background: rgba(255, 255, 255, 0.84);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.feed-heading {
  order: 1;
}

.feed-list {
  order: 2;
}

.signal-card {
  order: 3;
}

.extension-note {
  order: 4;
}

.activation-queue {
  order: 2;
}

.feed-panel.built .activation-queue {
  order: 2;
}

.feed-panel.built .feed-list {
  order: 3;
  margin-top: 14px;
}

.feed-panel.built .feed-list .ad-card:nth-child(n + 3) {
  display: none;
}

.feed-panel.built .signal-card {
  order: 4;
}

.feed-panel.built .extension-note {
  order: 5;
}

.feed-heading {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 16px;
}

.feed-heading h2 {
  margin: 0;
  font-size: 20px;
}

.feed-heading p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.feed-heading span {
  flex: 0 0 auto;
  padding: 7px 10px;
  color: #0a7147;
  background: #eaf5ef;
  border: 1px solid #c8e7d5;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 760;
}

.feed-list {
  display: grid;
  gap: 12px;
}

.ad-card {
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.ad-image {
  position: relative;
  aspect-ratio: 16 / 10;
  background: #f1f1ef;
}

.save-button {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 34px;
  height: 34px;
  background: rgba(255, 255, 255, 0.92);
  border-radius: 50%;
}

.save-button::before,
.save-button::after {
  position: absolute;
  top: 10px;
  width: 10px;
  height: 15px;
  content: "";
  background: transparent;
  border: 2px solid #151a1f;
  border-bottom: 0;
  border-radius: 10px 10px 0 0;
}

.save-button::before {
  left: 8px;
  transform: rotate(-45deg);
}

.save-button::after {
  right: 8px;
  transform: rotate(45deg);
}

.ad-copy {
  display: grid;
  gap: 5px;
  padding: 12px 13px 13px;
}

.ad-copy span {
  color: #7a828b;
  font-size: 10px;
  font-weight: 760;
  letter-spacing: 0;
  text-transform: uppercase;
}

.ad-copy strong {
  color: #111820;
  font-size: 15px;
}

.ad-copy small {
  min-height: 34px;
  color: #59636e;
  font-size: 13px;
  line-height: 1.3;
}

.ad-copy button {
  justify-self: start;
  margin-top: 4px;
  padding: 6px 10px;
  color: #063f29;
  background: #eaf5ef;
  border: 1px solid #c8e7d5;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 760;
}

.signal-card {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  margin-top: 14px;
  padding: 14px 0;
  color: var(--ink);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.signal-mark {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, 5px);
  gap: 4px;
  align-items: end;
  justify-content: center;
  width: 34px;
  height: 34px;
  padding: 8px 7px;
  pointer-events: none;
  background: rgba(20, 167, 104, 0.14);
  border: 1px solid rgba(34, 188, 122, 0.56);
  border-radius: 50%;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.07);
}

.signal-mark::after {
  position: absolute;
  inset: -4px;
  content: "";
  border: 1px solid rgba(34, 188, 122, 0.24);
  border-radius: 50%;
  animation: signalPulse 1600ms ease-in-out infinite;
}

.signal-mark i {
  position: relative;
  z-index: 1;
  display: block;
  width: 5px;
  min-height: 9px;
  background: #22bc7a;
  border-radius: 999px;
  transform-origin: bottom;
  animation: signalBar 1200ms ease-in-out infinite;
}

.signal-mark i:nth-child(2) {
  min-height: 17px;
  animation-delay: 120ms;
}

.signal-mark i:nth-child(3) {
  min-height: 12px;
  animation-delay: 240ms;
}

.signal-card strong,
.signal-card small {
  display: block;
}

.signal-card strong {
  font-size: 14px;
}

.signal-card small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.extension-note {
  display: grid;
  gap: 6px;
  margin-top: 14px;
  padding: 14px 0 0;
  border-top: 1px solid var(--line);
}

.extension-note strong {
  color: var(--ink);
  font-size: 13px;
}

.extension-note small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.extension-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-top: 4px;
}

.feed-primary-action,
.feed-secondary-action,
.extension-download {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0 12px;
  border-radius: var(--radius);
  font-size: 12px;
  font-weight: 780;
}

.feed-primary-action {
  color: #fff;
  background: var(--green);
  border: 1px solid #087444;
}

.feed-primary-action:disabled {
  background: #8fa99d;
  border-color: #8fa99d;
  cursor: progress;
}

.feed-secondary-action {
  color: #27313a;
  background: #fff;
  border: 1px solid var(--line);
}

.feed-secondary-action:disabled {
  color: #7b858e;
  cursor: progress;
}

.extension-download {
  color: #fff;
  background: #111820;
  border: 1px solid #111820;
}

.extension-download:hover {
  background: #26313b;
  border-color: #26313b;
}

.activation-queue {
  display: grid;
  gap: 12px;
  margin-top: 2px;
  padding: 0 0 4px;
}

.queue-summary {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.queue-summary strong {
  font-size: 15px;
}

.queue-summary small {
  color: var(--muted);
  font-size: 12px;
}

.signal-line {
  margin: -4px 0 0;
  color: #66707a;
  font-size: 11px;
  font-weight: 720;
  letter-spacing: 0;
  line-height: 1.45;
}

.category-progress-list {
  display: grid;
  align-content: start;
  border-top: 1px solid var(--line);
}

.category-progress {
  position: relative;
  display: grid;
  gap: 7px;
  min-height: 58px;
  overflow: hidden;
  padding: 10px 0 11px;
  border-bottom: 1px solid var(--line);
}

.category-progress::before {
  content: none;
}

.category-progress.running::before {
  content: none;
}

.progress-topline {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.progress-topline span {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.progress-topline strong {
  overflow: hidden;
  color: #111820;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.progress-topline small {
  color: var(--muted);
  font-size: 11px;
}

.progress-topline b {
  flex: 0 0 auto;
  color: #66707a;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.category-progress.done .progress-topline b {
  color: #0a7147;
}

.progress-track {
  position: relative;
  z-index: 1;
  height: 9px;
  overflow: hidden;
  background: #edf0ed;
  border-radius: 999px;
}

.progress-track span {
  display: block;
  width: 0;
  height: 100%;
  background: var(--green);
  border-radius: inherit;
  transition: width 260ms ease;
}

.category-progress.running .progress-track span {
  animation: barPulse 760ms ease-in-out infinite;
}

.completion-burst {
  position: absolute;
  right: 18px;
  top: 19px;
  width: 8px;
  height: 8px;
  pointer-events: none;
}

.completion-burst i {
  position: absolute;
  inset: 0;
  display: block;
  background: #19a967;
  border-radius: 999px;
  opacity: 0;
}

.category-progress.done .completion-burst i {
  animation: burst 680ms ease-out both;
}

.category-progress.done .completion-burst i:nth-child(2) {
  animation-delay: 45ms;
  background: #111820;
}

.category-progress.done .completion-burst i:nth-child(3) {
  animation-delay: 85ms;
  background: #f0bc2f;
}

.category-progress.done .completion-burst i:nth-child(4) {
  animation-delay: 120ms;
}

.category-progress.done .completion-burst i:nth-child(5) {
  animation-delay: 160ms;
  background: #f0bc2f;
}

.blocked-note {
  color: #85610d;
  font-size: 12px;
  line-height: 1.35;
}

.empty-feed {
  padding: 28px;
  color: var(--muted);
  text-align: center;
  background: #fff;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
}

.mechanism {
  display: grid;
  grid-template-columns: 360px minmax(0, 1fr);
  gap: 40px;
  max-width: 1400px;
  margin: 0 auto;
  padding: 8px clamp(18px, 3.4vw, 44px) 72px;
}

.mechanism h2 {
  margin: 0;
  font-size: 28px;
}

.mechanism p {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.55;
}

.mechanism .non-affiliation-note {
  margin-top: 18px;
  color: #2f3b44;
  font-size: 13px;
  font-weight: 720;
  line-height: 1.45;
}

.mechanism-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.mechanism-grid article {
  padding: 18px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.mechanism-grid span {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  margin-bottom: 22px;
  color: #fff;
  background: #111;
  border-radius: 50%;
  font-size: 13px;
  font-weight: 800;
}

.mechanism-grid strong,
.mechanism-grid small {
  display: block;
}

.mechanism-grid strong {
  font-size: 16px;
}

.mechanism-grid small {
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.legal-page {
  padding: clamp(32px, 5vw, 64px) clamp(18px, 3.4vw, 44px) 80px;
}

.legal-content {
  max-width: 760px;
  margin: 0 auto;
}

.legal-content h1 {
  margin: 0 0 10px;
  font-size: clamp(44px, 7vw, 82px);
  line-height: 0.94;
  letter-spacing: 0;
}

.legal-content h2 {
  margin: 34px 0 8px;
  font-size: 20px;
}

.legal-content p {
  margin: 0 0 12px;
  color: #4d5760;
  font-size: 16px;
  line-height: 1.62;
}

@media (max-width: 1180px) {
  .hero-grid,
  .mechanism {
    grid-template-columns: 1fr;
  }

  .feed-panel {
    position: static;
  }

  .picker {
    position: static;
  }

  .feed-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 860px) {
  .topbar {
    min-height: 64px;
  }

  .privacy-status {
    font-size: 0;
  }

  .intro {
    display: block;
  }

  .intro h1 {
    font-size: clamp(52px, 14vw, 86px);
  }

  .intro p {
    margin-top: 18px;
  }

  .picker-actions {
    flex-wrap: wrap;
    justify-content: flex-start;
    margin-top: 0;
  }

  .picker-primary-action {
    flex: 1 1 210px;
  }

  .category-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .image-button,
  .custom-compose-button,
  .custom-compose-form {
    min-height: 210px;
  }

  .mechanism-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .brand {
    font-size: 19px;
  }

  .category-grid,
  .feed-list {
    grid-template-columns: 1fr;
  }

  .image-button,
  .custom-compose-button,
  .custom-compose-form {
    min-height: 240px;
  }
}

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

  50% {
    opacity: 1;
  }
}

@keyframes signalPulse {
  0%,
  100% {
    opacity: 0.52;
    transform: scale(0.96);
  }

  50% {
    opacity: 1;
    transform: scale(1.05);
  }
}

@keyframes signalBar {
  0%,
  100% {
    transform: scaleY(0.74);
  }

  50% {
    transform: scaleY(1);
  }
}

@keyframes burst {
  0% {
    opacity: 0;
    transform: translate(0, 0) scale(0.6);
  }

  24% {
    opacity: 1;
  }

  100% {
    opacity: 0;
    transform: translate(var(--burst-x, 18px), var(--burst-y, -18px)) scale(0.12);
  }
}

.completion-burst i:nth-child(1) {
  --burst-x: 20px;
  --burst-y: -22px;
}

.completion-burst i:nth-child(2) {
  --burst-x: -18px;
  --burst-y: -18px;
}

.completion-burst i:nth-child(3) {
  --burst-x: 18px;
  --burst-y: 18px;
}

.completion-burst i:nth-child(4) {
  --burst-x: -16px;
  --burst-y: 18px;
}

.completion-burst i:nth-child(5) {
  --burst-x: 0;
  --burst-y: -27px;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 1ms !important;
  }
}
