:root {
  color-scheme: dark;
  --bg: #080c12;
  --line: #2c3746;
  --ink: #edf3fb;
  --muted: #a7b6c9;
  --blue: #4bc6ff;
  --green: #71d9ac;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font:
    15px/1.5 system-ui,
    -apple-system,
    sans-serif;
}
main {
  max-width: 720px;
  margin: 0 auto;
  padding: 28px;
}
body.popup {
  width: 380px;
}
body.popup main {
  padding: 22px;
}
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--line);
  padding-bottom: 16px;
}
h1 {
  font-size: 22px;
  letter-spacing: -0.025em;
  margin: 0;
}
h2 {
  font-size: 20px;
  line-height: 1.25;
  margin: 24px 0 12px;
}
h3 {
  font-size: 16px;
}
p {
  color: var(--muted);
}
button,
a.button {
  font: inherit;
  cursor: pointer;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 9px 14px;
  background: #132030;
  color: var(--ink);
  text-decoration: none;
}
button.primary {
  background: var(--blue);
  color: #05131c;
  border: 0;
  font-weight: 600;
}
button:disabled {
  opacity: 0.45;
  cursor: default;
}
button:hover:not(:disabled) {
  border-color: var(--blue);
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 3px;
}
a {
  color: var(--blue);
  text-underline-offset: 3px;
}
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
section {
  padding: 12px 0 24px;
  border-bottom: 1px solid var(--line);
}
input,
select {
  font: inherit;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #101720;
  color: var(--ink);
  max-width: 100%;
}
label {
  display: block;
  margin: 12px 0 6px;
}
form {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
form input {
  flex: 1;
  min-width: 180px;
}
.status {
  color: var(--green);
  font-size: 13px;
}
#notice {
  color: var(--blue);
  min-height: 1.5em;
}
.row {
  padding: 14px 0;
  border-top: 1px solid var(--line);
  overflow-wrap: anywhere;
}
.row p {
  margin: 4px 0 12px;
}
.row strong {
  font-size: 15px;
}
small {
  color: var(--muted);
}
details {
  margin: 12px 0;
}
summary {
  cursor: pointer;
  color: var(--muted);
}
.progress {
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}
[hidden] {
  display: none !important;
}
::selection {
  background: #205779;
  color: white;
}
@media (max-width: 480px) {
  main {
    padding: 20px;
  }
}
@media (prefers-reduced-motion: no-preference) {
  button {
    transition: border-color 0.15s;
  }
}
.candidate {
  font-size: 12px;
  color: var(--muted);
  margin: 12px 0;
}

h1 {
  display: flex;
  align-items: center;
  gap: 10px;
}
dialog {
  background: var(--bg);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 10px;
  max-width: 480px;
  padding: 24px;
}
dialog::backdrop {
  background: #0009;
}
dialog form {
  display: block;
}
dialog .actions {
  justify-content: flex-end;
}
dialog h2 {
  margin-top: 0;
}
input {
  caret-color: var(--blue);
}
html {
  scrollbar-color: #506379 var(--bg);
}
pre {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
button:active:not(:disabled) {
  background: #233c52;
}
button.primary:active:not(:disabled) {
  background: #83d8ff;
}
.candidate {
  padding: 8px 20px;
}
#items:empty::after {
  content: "Review The Abyss to see caught mail and Rescue a mistake.";
  color: var(--muted);
}
#rules:empty::after {
  content: "No explicit rules. Conservative classification applies.";
  color: var(--muted);
}
#preferences:empty::after {
  content: "No corrections yet. Teach Spammish in Gmail.";
  color: var(--muted);
}

/* Outcome first; counters are rendered from durable confirmed receipts only. */
.cleanup-outcome {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 28px 0 12px;
}
.cleanup-outcome strong {
  font-size: clamp(48px, 10vw, 72px);
  line-height: 1.05;
  font-variant-numeric: tabular-nums;
  color: var(--blue);
}
.cleanup-outcome span {
  color: var(--ink);
  font-size: 18px;
}
.teach {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
}
#activation {
  margin-top: 32px;
}
@media (max-width: 480px) {
  .teach {
    grid-template-columns: 1fr;
    gap: 12px;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }
}

/* Chrome action popup: show the product's state before its controls. */
body.popup {
  width: 360px;
  max-width: 100vw;
  min-width: 320px;
  background: radial-gradient(
    ellipse at 50% 42%,
    #0e1c2b 0,
    #090e16 43%,
    #070a10 78%
  );
  color: #eef3f8;
  overflow-x: hidden;
}
body.popup main.popup-shell {
  max-width: none;
  min-height: 448px;
  margin: 0;
  padding: 14px 18px 15px;
}
.popup-shell {
  display: flex;
  min-height: 448px;
  flex-direction: column;
  padding: 14px 18px 15px;
}
.popup-shell > section {
  padding: 0;
  border: 0;
}
.popup-header {
  height: 32px;
  flex: 0 0 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border: 0;
  padding: 0;
}
.popup-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #e8edf4;
  text-decoration: none;
  font-size: 12px;
  line-height: 1;
  font-weight: 700;
  letter-spacing: 0.13em;
}
.popup-brand img {
  width: 23px;
  height: 23px;
  object-fit: contain;
}
.settings-link {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 50%;
  color: #a2afbf;
  text-decoration: none;
}
.settings-link:hover {
  background: #1c2937;
  color: #eaf2f9;
}
.settings-link svg {
  width: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.35;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.spammish-object {
  position: relative;
  display: grid;
  height: 210px;
  flex: 0 0 210px;
  place-items: center;
  margin-top: 4px;
  color: #4bc6ff;
  isolation: isolate;
}
.vortex {
  position: absolute;
  inset: 4px 0 0;
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
  z-index: -1;
}
.orbit {
  fill: none;
  stroke: url(#energy);
  stroke-linecap: round;
  transform-box: fill-box;
  transform-origin: center;
}
.orbit-outer {
  stroke-width: 1.5;
  stroke-dasharray: 174 34 25 420;
  opacity: 0.68;
}
.orbit-mid {
  stroke-width: 4.5;
  stroke-dasharray: 162 25 52 300;
  opacity: 0.46;
}
.orbit-inner {
  stroke-width: 7;
  stroke-dasharray: 122 24 57 240;
  opacity: 0.72;
}
.flow {
  fill: none;
  stroke: url(#energy);
  stroke-linecap: round;
  stroke-width: 2.5;
  stroke-dasharray: 80 330;
}
.flow-a {
  opacity: 0.8;
}
.flow-b {
  opacity: 0.47;
}
.abyss-core {
  fill: url(#core);
  stroke: #15283a;
  stroke-width: 1.2;
}
.core-light {
  fill: none;
  stroke: #37aefa;
  stroke-width: 0.8;
  opacity: 0.38;
}
.infall {
  fill: none;
  stroke: url(#energy);
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-dasharray: 2 5;
  opacity: 0.58;
}
.mail {
  fill: #111b27;
  stroke: #70cfff;
  stroke-width: 1.2;
  opacity: 0.77;
}
.mail path {
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.state-lockup {
  display: flex;
  align-items: center;
  flex-direction: column;
  gap: 7px;
  margin-top: 3px;
}
.power-control {
  display: grid;
  width: 60px;
  height: 60px;
  place-items: center;
  padding: 0;
  border: 1px solid #476177;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 40%, #182633, #0a1019 73%);
  color: #9ba9b8;
  box-shadow:
    0 0 0 5px #09111a9c,
    inset 0 0 0 1px #ffffff08;
  cursor: pointer;
  transition:
    color 160ms ease,
    border-color 160ms ease,
    box-shadow 160ms ease,
    transform 160ms ease;
}
.power-control:hover:not(:disabled) {
  border-color: #70cfff;
  color: #dff7ff;
  transform: scale(1.035);
}
.power-control svg {
  width: 26px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.popup-state {
  margin: 0;
  color: #c9d4df;
  font-size: 11px;
  line-height: 1.2;
  font-weight: 650;
  letter-spacing: 0.16em;
  text-align: center;
}
.popup-detail {
  max-width: 250px;
  margin: -3px 0 0;
  color: #c1cbd5;
  font-size: 11px;
  line-height: 1.25;
  text-align: center;
}
.value-block {
  display: flex;
  min-height: 120px;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  margin-top: 0;
}
.value-number {
  color: #f2f6fb;
  font-size: 42px;
  line-height: 1;
  font-weight: 570;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.04em;
}
.value-number.just-confirmed {
  animation: confirmed-arrival 380ms ease-out;
}
.value-caption {
  margin-top: 6px;
  color: #a9b5c2;
  font-size: 12px;
  line-height: 1.15;
  font-weight: 600;
  letter-spacing: 0.18em;
}
.periods {
  display: flex;
  align-items: center;
  gap: 3px;
  margin-top: 15px;
  padding: 3px;
  border: 1px solid #273543;
  border-radius: 7px;
  background: #080e15;
}
.periods button {
  min-width: 70px;
  min-height: 27px;
  padding: 4px 8px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: #8392a3;
  font-size: 12px;
  line-height: 1;
  font-weight: 650;
  letter-spacing: 0.1em;
  cursor: pointer;
}
.periods button[aria-pressed="true"] {
  background: #182638;
  color: #e9f1f8;
}
.periods button:hover {
  color: #f4f8fc;
}
.abyss-link {
  display: flex;
  height: 44px;
  flex: 0 0 44px;
  margin-top: auto;
  align-items: center;
  justify-content: space-between;
  padding: 0 13px 0 15px;
  border: 1px solid #304455;
  border-radius: 7px;
  background: linear-gradient(100deg, #101923, #0c131c);
  color: #e1eaf2;
  text-decoration: none;
  font-size: 12px;
  line-height: 1;
  font-weight: 650;
  letter-spacing: 0.13em;
  transition:
    border-color 150ms ease,
    background-color 150ms ease;
}
.abyss-link:hover {
  border-color: #4e87ac;
  background-color: #142332;
}
.abyss-link svg {
  width: 17px;
  fill: none;
  stroke: #74ceff;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.spammish-object.is-off {
  color: #637182;
}
.is-off .orbit,
.is-off .flow,
.is-off .infall,
.is-off .mail {
  stroke: url(#quiet-energy);
  opacity: 0.36;
}
.is-off .abyss-core {
  stroke: #1c2631;
}
.is-off .core-light {
  opacity: 0.1;
}
.is-on .orbit-outer {
  animation: orbit-spin 44s linear infinite;
}
.is-on .orbit-mid {
  animation: orbit-spin 30s linear infinite reverse;
}
.is-on .flow-a,
.is-on .flow-b {
  animation: flow-drift 8s ease-in-out infinite alternate;
}
.is-on .core-light {
  animation: core-breathe 4.5s ease-in-out infinite alternate;
}
.is-on .power-control,
.is-catching-up .power-control {
  border-color: #43baf3;
  color: #71d3ff;
  box-shadow:
    0 0 0 5px #09111a9c,
    0 0 19px #1687ef45,
    inset 0 0 0 1px #ffffff08;
}
.is-waking .orbit-outer {
  animation: orbit-spin 2.2s ease-in-out infinite;
  opacity: 0.94;
}
.is-waking .orbit-mid {
  animation: orbit-spin 1.8s ease-in-out infinite reverse;
  opacity: 0.72;
}
.is-waking .flow {
  animation: flow-drift 0.8s ease-in-out infinite alternate;
}
.is-catching-up .orbit-outer {
  animation: orbit-spin 8s linear infinite;
  opacity: 0.96;
}
.is-catching-up .orbit-mid {
  animation: orbit-spin 5s linear infinite reverse;
  opacity: 0.72;
}
.is-catching-up .orbit-inner {
  animation: orbit-spin 3.5s linear infinite;
  opacity: 0.94;
}
.is-catching-up .flow-a {
  animation: flow-drift 1.1s ease-in-out infinite alternate;
  stroke-dasharray: 95 260;
}
.is-catching-up .flow-b {
  animation: flow-drift 1.5s ease-in-out infinite alternate-reverse;
  stroke-dasharray: 72 270;
}
.is-catching-up.has-confirmed-movement .mail-a {
  animation: infall-a 1.9s ease-in infinite;
}
.is-catching-up.has-confirmed-movement .mail-b {
  animation: infall-b 1.55s ease-in infinite 0.45s;
}
.is-catching-up.has-confirmed-movement .mail-c {
  animation: infall-c 1.75s ease-in infinite 0.8s;
}
.is-waiting .orbit,
.is-waiting .flow,
.is-waiting .infall,
.is-waiting .mail {
  animation-play-state: paused;
  opacity: 0.55;
}
.is-waiting .popup-state {
  color: #d6c18a;
}
.is-waiting .orbit,
.is-waiting .flow {
  stroke: #b99b57;
}
.is-waiting .mail {
  opacity: 0.45;
}
.is-attention .popup-state,
.is-attention .popup-detail {
  color: #f0a58e;
}
.is-attention .orbit,
.is-attention .flow {
  stroke: #9b514c;
  opacity: 0.55;
}
.is-attention .power-control {
  border-color: #915d52;
  color: #e79c83;
}
@keyframes orbit-spin {
  to {
    transform: rotate(360deg);
  }
}
@keyframes flow-drift {
  to {
    stroke-dashoffset: -42;
  }
}
@keyframes core-breathe {
  to {
    opacity: 0.68;
  }
}
@keyframes confirmed-arrival {
  0% {
    transform: translateY(3px);
    opacity: 0.65;
  }
  100% {
    transform: translateY(0);
    opacity: 1;
  }
}
@keyframes infall-a {
  0% {
    transform: translate(0, 0) scale(1);
    opacity: 0.78;
  }
  85%,
  100% {
    transform: translate(53px, 34px) scale(0.45);
    opacity: 0;
  }
}
@keyframes infall-b {
  0% {
    transform: translate(0, 0) scale(1);
    opacity: 0.7;
  }
  85%,
  100% {
    transform: translate(-38px, -26px) scale(0.4);
    opacity: 0;
  }
}
@keyframes infall-c {
  0% {
    transform: translate(0, 0) scale(1);
    opacity: 0.68;
  }
  85%,
  100% {
    transform: translate(12px, 53px) scale(0.4);
    opacity: 0;
  }
}
@media (prefers-reduced-motion: reduce) {
  .value-number.just-confirmed,
  .spammish-object *,
  .power-control,
  .abyss-link {
    animation: none !important;
    transition: none !important;
  }
}
