:root {
  color-scheme: dark;
  --bg: #050908;
  --panel: rgba(6, 18, 16, 0.9);
  --panel-strong: rgba(10, 28, 24, 0.94);
  --ink: #e9fff8;
  --muted: #79a79a;
  --line: rgba(65, 255, 189, 0.22);
  --green: #44ffb3;
  --green-strong: #1ee68b;
  --cyan: #63e6ff;
  --amber: #ffc857;
  --red: #ff5f56;
  --shadow: 0 30px 90px rgba(0, 0, 0, 0.55);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

html,
body {
  max-width: 100%;
}

body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  background:
    linear-gradient(rgba(68, 255, 179, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(99, 230, 255, 0.03) 1px, transparent 1px),
    var(--bg);
  background-size: 34px 34px, 34px 34px, auto;
  color: var(--ink);
  font-family:
    "SFMono-Regular", "Cascadia Code", "Roboto Mono", ui-monospace, Menlo, Consolas,
    monospace;
  letter-spacing: 0;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  content: "";
  background: repeating-linear-gradient(
    180deg,
    rgba(233, 255, 248, 0.035) 0,
    rgba(233, 255, 248, 0.035) 1px,
    transparent 1px,
    transparent 5px
  );
  mix-blend-mode: screen;
}

button,
input {
  font: inherit;
}

button {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(68, 255, 179, 0.06);
  color: var(--ink);
  cursor: pointer;
  font-weight: 800;
  text-transform: uppercase;
}

button:hover {
  border-color: rgba(68, 255, 179, 0.65);
  background: rgba(68, 255, 179, 0.12);
  box-shadow: 0 0 22px rgba(68, 255, 179, 0.14);
}

button:disabled {
  cursor: wait;
  opacity: 0.72;
}

button:focus-visible,
input:focus-visible {
  outline: 3px solid rgba(99, 230, 255, 0.28);
  outline-offset: 2px;
}

.matrix-canvas {
  position: fixed;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  opacity: 0.38;
}

.app-shell {
  position: relative;
  z-index: 2;
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 24px;
}

.tracker {
  position: relative;
  width: min(820px, 100%);
  padding: 28px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(68, 255, 179, 0.08), transparent 32%),
    linear-gradient(180deg, rgba(8, 24, 21, 0.98), rgba(3, 12, 11, 0.96));
  box-shadow: var(--shadow), 0 0 0 1px rgba(99, 230, 255, 0.07) inset;
}

.tracker::before,
.tracker::after {
  position: absolute;
  width: 58px;
  height: 58px;
  pointer-events: none;
  content: "";
}

.tracker::before {
  top: 12px;
  left: 12px;
  border-top: 1px solid var(--green);
  border-left: 1px solid var(--green);
}

.tracker::after {
  right: 12px;
  bottom: 12px;
  border-right: 1px solid var(--cyan);
  border-bottom: 1px solid var(--cyan);
}

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

.title-block {
  display: grid;
  gap: 8px;
}

.top-actions {
  display: grid;
  justify-items: end;
  gap: 8px;
}

.share-button {
  min-width: 94px;
  padding: 0 15px;
  border-color: rgba(99, 230, 255, 0.34);
  background:
    linear-gradient(90deg, rgba(99, 230, 255, 0.12), rgba(68, 255, 179, 0.1)),
    rgba(3, 12, 11, 0.88);
  color: var(--green);
}

.share-button::before {
  content: "// ";
  color: var(--cyan);
}

.share-status {
  min-height: 1rem;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 800;
  text-align: right;
  text-transform: uppercase;
}

.window-dots {
  display: flex;
  gap: 7px;
}

.window-dots span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 14px rgba(68, 255, 179, 0.55);
}

.window-dots span:nth-child(2) {
  background: var(--amber);
  box-shadow: 0 0 14px rgba(255, 200, 87, 0.45);
}

.window-dots span:nth-child(3) {
  background: var(--cyan);
  box-shadow: 0 0 14px rgba(99, 230, 255, 0.45);
}

.eyebrow,
.field span {
  margin: 0;
  color: var(--cyan);
  font-size: 0.76rem;
  font-weight: 850;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  color: var(--ink);
  font-size: clamp(2.25rem, 5vw, 3.9rem);
  line-height: 0.95;
  text-shadow: 0 0 28px rgba(68, 255, 179, 0.26);
}

.inputs {
  display: grid;
  grid-template-columns: minmax(190px, 0.6fr) minmax(260px, 1fr);
  gap: 14px;
}

.field {
  display: grid;
  min-width: 0;
  gap: 8px;
}

.field span {
  color: var(--muted);
}

input {
  width: 100%;
  min-width: 0;
  min-height: 50px;
  border: 1px solid rgba(121, 167, 154, 0.34);
  border-radius: var(--radius);
  background: rgba(1, 7, 6, 0.82);
  color: var(--ink);
  padding: 0 14px;
  font-size: 1rem;
  box-shadow: 0 0 0 1px rgba(68, 255, 179, 0.04) inset;
}

input:hover {
  border-color: rgba(68, 255, 179, 0.38);
}

.percent-input {
  position: relative;
  min-width: 0;
}

.percent-input input {
  padding-right: 42px;
}

.percent-input span {
  position: absolute;
  top: 50%;
  right: 14px;
  transform: translateY(-50%);
  color: var(--green);
  font-size: 1rem;
  font-weight: 850;
}

.hero {
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr);
  gap: 28px;
  align-items: center;
  margin: 34px 0 28px;
  padding: 30px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.percent-ring {
  position: relative;
  display: grid;
  width: 210px;
  aspect-ratio: 1;
  place-items: center;
  align-content: center;
  border: 1px solid rgba(68, 255, 179, 0.16);
  border-radius: 50%;
  background: rgba(4, 15, 13, 0.98);
  box-shadow:
    0 0 36px rgba(68, 255, 179, 0.14),
    inset 0 0 22px rgba(68, 255, 179, 0.06);
}

.ring-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.ring-track,
.ring-progress {
  fill: none;
  stroke-width: 9;
}

.ring-track {
  stroke: rgba(99, 230, 255, 0.12);
}

.ring-progress {
  stroke: var(--green);
  stroke-linecap: butt;
  filter: drop-shadow(0 0 6px rgba(68, 255, 179, 0.48));
}

.percent-ring strong {
  position: relative;
  color: var(--ink);
  font-size: 3.15rem;
  line-height: 1;
  text-shadow: 0 0 18px rgba(68, 255, 179, 0.28);
}

.percent-ring span {
  position: relative;
  margin-top: 5px;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 850;
  text-transform: uppercase;
}

.instruction p {
  min-width: 0;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.instruction h2 {
  margin-top: 8px;
  color: var(--green);
  font-size: clamp(2.1rem, 5.5vw, 3.8rem);
  line-height: 1.02;
  overflow-wrap: anywhere;
  text-shadow: 0 0 24px rgba(68, 255, 179, 0.2);
}

.bar {
  height: 12px;
  margin: 24px 0 12px;
  overflow: hidden;
  border: 1px solid rgba(99, 230, 255, 0.12);
  border-radius: 999px;
  background: rgba(99, 230, 255, 0.1);
}

#barFill {
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--cyan), var(--green));
  box-shadow: 0 0 18px rgba(68, 255, 179, 0.36);
}

.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 750;
}

.creator-credit {
  min-width: 0;
  text-align: right;
}

.site-footer nav {
  display: flex;
  gap: 14px;
}

.site-footer nav,
.creator-credit {
  white-space: nowrap;
}

a {
  color: var(--cyan);
  text-decoration: none;
}

a:hover {
  color: var(--green);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.legal-shell {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 880px;
  margin: 0 auto;
  padding: 24px;
}

.legal-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(68, 255, 179, 0.08), transparent 28%),
    linear-gradient(180deg, rgba(8, 24, 21, 0.98), rgba(3, 12, 11, 0.96));
  box-shadow: var(--shadow), 0 0 0 1px rgba(99, 230, 255, 0.07) inset;
  padding: 28px;
}

.legal-top {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 18px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--line);
}

.legal-top h1 {
  margin-top: 8px;
}

.legal-content {
  display: grid;
  min-width: 0;
  gap: 22px;
  padding-top: 24px;
  color: var(--ink);
}

.legal-content section {
  display: grid;
  min-width: 0;
  gap: 8px;
}

.legal-content h2 {
  color: var(--green);
  font-size: 1.05rem;
  line-height: 1.3;
}

.legal-content p,
.legal-content li {
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.65;
  overflow-wrap: anywhere;
  white-space: normal;
  word-break: break-word;
}

.legal-content ul {
  display: grid;
  gap: 7px;
  margin: 0;
  padding-left: 1.2rem;
}

.legal-note {
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.6;
}

.is-warning #statusLine {
  color: var(--amber);
  font-weight: 800;
}

.is-danger #statusLine {
  color: var(--red);
  font-weight: 800;
}

.is-done #statusLine {
  color: var(--green);
  font-weight: 800;
}

@media (prefers-reduced-motion: reduce) {
  .matrix-canvas {
    display: none;
  }
}

@media (max-width: 560px) {
  .app-shell {
    display: grid;
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
    place-items: start center;
    padding: 14px;
  }

  .tracker {
    width: 100%;
    max-width: 420px;
    justify-self: center;
    padding: 20px;
  }

  h1 {
    font-size: 2rem;
  }

  .topbar {
    display: grid;
    grid-template-columns: 1fr;
    align-items: start;
    gap: 12px;
  }

  .top-actions {
    justify-items: start;
  }

  .share-button {
    min-width: 84px;
    padding: 0 12px;
  }

  .share-status {
    text-align: left;
  }

  .legal-top {
    display: grid;
    justify-items: start;
  }

  .site-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    font-size: 0.68rem;
  }

  .creator-credit {
    text-align: right;
  }

  .legal-shell {
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: 14px;
  }

  .legal-card {
    width: 100%;
    max-width: 100%;
    padding: 20px;
  }

  .legal-content p,
  .legal-content ul {
    max-width: 32ch;
  }

  .inputs,
  .hero {
    grid-template-columns: 1fr;
  }

  .percent-ring {
    justify-self: center;
    width: min(210px, 72vw);
  }

}
