:root {
  color-scheme: dark;
  --ink: #f4f6fb;
  --muted: #9ba5b7;
  --quiet: #6d7688;
  --page: #090b10;
  --surface: #11141c;
  --surface-2: #171b25;
  --line: #282e3c;
  --accent: #94a8ff;
  --accent-2: #8ce8c5;
  --danger: #ff9b9b;
  --radius: 20px;
  --shadow: 0 24px 70px rgb(0 0 0 / 32%);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  margin: 0;
  background:
    radial-gradient(circle at 10% -10%, rgb(115 134 226 / 16%), transparent 30rem),
    radial-gradient(circle at 95% 5%, rgb(67 166 139 / 12%), transparent 27rem),
    var(--page);
  color: var(--ink);
  line-height: 1.6;
}

a {
  color: inherit;
  text-decoration-color: rgb(148 168 255 / 55%);
  text-underline-offset: 0.22em;
}

a:hover {
  text-decoration-color: var(--accent-2);
}

button,
input,
select,
textarea {
  font: inherit;
}

button,
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 0.66rem 1rem;
  background: var(--ink);
  color: #0c0f15;
  font-weight: 740;
  text-decoration: none;
  cursor: pointer;
  transition: transform 150ms ease, background 150ms ease, border-color 150ms ease;
}

button:hover,
.button:hover {
  transform: translateY(-1px);
  background: white;
}

button:focus-visible,
.button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
a:focus-visible {
  outline: 3px solid rgb(148 168 255 / 55%);
  outline-offset: 3px;
}

button.secondary,
.button.secondary {
  border-color: var(--line);
  background: transparent;
  color: var(--ink);
}

button.secondary:hover,
.button.secondary:hover {
  border-color: var(--accent);
  background: rgb(148 168 255 / 8%);
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.skip-link {
  position: fixed;
  top: 0.5rem;
  left: 0.5rem;
  z-index: 20;
  transform: translateY(-150%);
  background: var(--ink);
  color: var(--page);
  padding: 0.6rem 0.9rem;
  border-radius: 8px;
}

.skip-link:focus {
  transform: translateY(0);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 1px solid rgb(40 46 60 / 75%);
  background: rgb(9 11 16 / 82%);
  backdrop-filter: blur(18px);
}

.nav,
.page,
.footer-inner {
  width: min(1120px, calc(100% - 2rem));
  margin-inline: auto;
}

.nav {
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.72rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  text-decoration: none;
}

.brand img {
  width: 34px;
  height: 34px;
}

.brand span span {
  color: var(--accent-2);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1rem;
  color: var(--muted);
  font-size: 0.94rem;
}

.nav-links a {
  text-decoration: none;
}

.nav-links a:hover,
.nav-links a[aria-current="page"] {
  color: var(--ink);
}

.pwa-nav-button {
  min-height: auto;
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--muted);
  font-size: inherit;
  font-weight: inherit;
}

.pwa-nav-button:hover {
  transform: none;
  background: transparent;
  color: var(--ink);
}

.page {
  padding-block: 4.5rem 6rem;
}

.hero {
  max-width: 850px;
  padding-block: 2.7rem 3.8rem;
}

.eyebrow {
  margin: 0 0 0.8rem;
  color: var(--accent-2);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1,
h2,
h3 {
  line-height: 1.08;
  letter-spacing: -0.035em;
}

h1 {
  margin-bottom: 1.25rem;
  font-size: clamp(2.8rem, 9vw, 6.7rem);
  font-weight: 830;
}

.tool-hero h1,
.article h1 {
  font-size: clamp(2.5rem, 7vw, 5rem);
}

h2 {
  margin-bottom: 1rem;
  font-size: clamp(1.75rem, 4vw, 2.7rem);
}

h3 {
  margin-bottom: 0.55rem;
  font-size: 1.2rem;
}

.lede {
  max-width: 700px;
  color: #c4cad6;
  font-size: clamp(1.05rem, 2vw, 1.32rem);
}

.hero-actions,
.button-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  margin-top: 1.8rem;
}

.proof-line {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.5rem;
  margin-top: 2rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.proof-line span::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-right: 0.55rem;
  border-radius: 50%;
  background: var(--accent-2);
  vertical-align: 0.12em;
}

.section {
  padding-block: 3rem;
}

.section-head {
  max-width: 690px;
  margin-bottom: 1.8rem;
}

.section-head p,
.muted {
  color: var(--muted);
}

.tool-grid,
.principle-grid,
.steps-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.card {
  position: relative;
  overflow: hidden;
  min-height: 240px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.4rem;
  background: linear-gradient(145deg, rgb(23 27 37 / 90%), rgb(14 17 24 / 96%));
  box-shadow: var(--shadow);
}

.card::after {
  content: "";
  position: absolute;
  right: -4rem;
  bottom: -6rem;
  width: 12rem;
  height: 12rem;
  border-radius: 50%;
  background: rgb(148 168 255 / 8%);
  pointer-events: none;
}

.card-number,
.card-tag {
  color: var(--accent-2);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.card h3 {
  margin-top: 2.3rem;
  font-size: 1.55rem;
}

.card p {
  color: var(--muted);
}

.card-link {
  display: inline-flex;
  margin-top: 0.6rem;
  color: var(--ink);
  font-weight: 750;
  text-decoration: none;
}

.card-link::after {
  content: "\2192";
  margin-left: 0.45rem;
  transition: transform 150ms ease;
}

.card-link:hover::after {
  transform: translateX(3px);
}

.callout {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 2rem;
  align-items: center;
  margin-block: 3rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: clamp(1.5rem, 5vw, 3rem);
  background: linear-gradient(110deg, rgb(148 168 255 / 12%), rgb(140 232 197 / 7%));
}

.callout-code {
  border: 1px solid rgb(255 255 255 / 8%);
  border-radius: 16px;
  padding: 1.2rem;
  background: rgb(0 0 0 / 30%);
  color: #cfd6e5;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.85rem;
}

.tool-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 0.34fr);
  gap: 1rem;
  align-items: start;
}

.local-privacy-proof {
  display: flex;
  justify-content: space-between;
  gap: 1.2rem;
  align-items: center;
  margin: -1rem 0 1.35rem;
  border: 1px solid rgb(140 232 197 / 38%);
  border-radius: 14px;
  padding: 0.9rem 1rem;
  background: linear-gradient(110deg, rgb(140 232 197 / 12%), rgb(148 168 255 / 7%));
  box-shadow: 0 12px 30px rgb(0 0 0 / 18%);
}

.local-privacy-proof > div:first-child {
  display: grid;
  gap: 0.2rem;
}

.local-privacy-proof strong {
  color: var(--accent-2);
  font-size: 0.92rem;
}

.local-privacy-proof span {
  color: #c4ccda;
  font-size: 0.8rem;
  line-height: 1.45;
}

.local-privacy-links {
  display: flex;
  flex: 0 0 auto;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.local-privacy-links a {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.42rem 0.68rem;
  color: var(--ink);
  font-size: 0.75rem;
  font-weight: 750;
  text-decoration: none;
}

.local-privacy-links a:hover {
  border-color: var(--accent-2);
}

.workspace,
.side-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgb(17 20 28 / 93%);
  box-shadow: var(--shadow);
}

.workspace {
  padding: clamp(1rem, 3vw, 1.6rem);
}

.side-panel {
  padding: 1.25rem;
}

.side-panel ul {
  padding-left: 1.15rem;
  color: var(--muted);
}

.side-panel li + li {
  margin-top: 0.45rem;
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.field {
  display: grid;
  gap: 0.45rem;
  margin-bottom: 1rem;
}

.field label,
.field-label {
  color: #d8ddea;
  font-size: 0.88rem;
  font-weight: 700;
}

.field-help {
  color: var(--quiet);
  font-size: 0.78rem;
}

input[type="text"],
input[type="number"],
input[type="search"],
select,
textarea,
.file-drop {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #0c0f15;
  color: var(--ink);
}

input[type="text"],
input[type="number"],
input[type="search"],
select {
  min-height: 44px;
  padding: 0.65rem 0.75rem;
}

textarea {
  min-height: 270px;
  resize: vertical;
  padding: 0.9rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.88rem;
  line-height: 1.55;
  tab-size: 2;
}

input[type="range"] {
  width: 100%;
  accent-color: var(--accent-2);
}

.file-drop {
  display: grid;
  place-items: center;
  min-height: 190px;
  padding: 1.5rem;
  border-style: dashed;
  text-align: center;
  cursor: pointer;
}

.file-drop:hover,
.file-drop.is-over {
  border-color: var(--accent);
  background: rgb(148 168 255 / 6%);
}

.file-drop input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.file-drop strong {
  display: block;
  margin-bottom: 0.2rem;
}

.preview {
  display: none;
  overflow: hidden;
  margin-block: 1rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #090b10;
}

.preview.is-visible {
  display: grid;
}

.preview img {
  display: block;
  width: 100%;
  max-height: 430px;
  object-fit: contain;
}

.preview-meta,
.status {
  color: var(--muted);
  font-size: 0.86rem;
}

.preview-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.75rem 0.9rem;
  border-top: 1px solid var(--line);
}

.status {
  min-height: 1.5em;
  margin-block: 0.8rem 0;
}

.status[data-state="error"] {
  color: var(--danger);
}

.status[data-state="success"] {
  color: var(--accent-2);
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-bottom: 1rem;
}

.tabs button {
  min-height: 38px;
  padding: 0.45rem 0.78rem;
  border-color: var(--line);
  background: transparent;
  color: var(--muted);
  font-size: 0.85rem;
}

.tabs button[aria-selected="true"] {
  border-color: rgb(148 168 255 / 55%);
  background: rgb(148 168 255 / 11%);
  color: var(--ink);
}

.article {
  max-width: 760px;
}

.article section {
  margin-top: 3rem;
}

.article p,
.article li {
  color: #bdc4d2;
}

.article code {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0.1em 0.3em;
  background: var(--surface);
}

.site-footer {
  border-top: 1px solid var(--line);
  color: var(--muted);
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding-block: 2rem;
  font-size: 0.86rem;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.noscript {
  margin: 1rem auto;
  border: 1px solid var(--danger);
  border-radius: 12px;
  padding: 0.8rem 1rem;
  color: var(--danger);
}

.checkbox-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
  margin-bottom: 1rem;
}

.check {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.65rem 0.75rem;
  background: #0c0f15;
  color: #d8ddea;
  cursor: pointer;
}

.check input {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--accent-2);
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.7rem;
  margin-block: 1rem;
}

.metric {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0.8rem;
  background: #0c0f15;
}

.metric strong {
  display: block;
  font-size: 1.35rem;
  line-height: 1.2;
}

.metric span {
  color: var(--quiet);
  font-size: 0.75rem;
}

.result-box,
.output-list {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 1rem;
  background: #0c0f15;
}

.result-box {
  overflow-wrap: anywhere;
  color: #e2e6f1;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  white-space: pre-wrap;
}

.output-list {
  display: grid;
  gap: 0.75rem;
  margin-top: 1rem;
}

.output-row {
  display: grid;
  grid-template-columns: minmax(90px, 0.25fr) minmax(0, 1fr);
  gap: 0.75rem;
  align-items: start;
}

.output-row span:first-child {
  color: var(--quiet);
  font-size: 0.8rem;
  font-weight: 700;
}

.output-row output,
.output-row code {
  overflow-wrap: anywhere;
  color: #e0e5ef;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.diff-output {
  overflow: auto;
  max-height: 620px;
  margin-top: 1rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #0a0c11;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.82rem;
}

.diff-row {
  display: grid;
  grid-template-columns: 3.2rem 3.2rem 1.4rem minmax(max-content, 1fr);
  min-height: 1.7rem;
  border-bottom: 1px solid rgb(255 255 255 / 4%);
  white-space: pre;
}

.diff-row:last-child {
  border-bottom: 0;
}

.diff-row span {
  padding: 0.18rem 0.4rem;
}

.diff-row .line-number {
  border-right: 1px solid rgb(255 255 255 / 5%);
  color: #646d7f;
  text-align: right;
  user-select: none;
}

.diff-row.add {
  background: rgb(83 196 146 / 11%);
  color: #bff4d9;
}

.diff-row.remove {
  background: rgb(255 116 116 / 10%);
  color: #ffc5c5;
}

.live-value {
  margin-bottom: 0.25rem;
  font-size: clamp(1.7rem, 5vw, 3rem);
  font-weight: 800;
  letter-spacing: -0.04em;
}

.tool-index {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
  margin-top: 1rem;
}

.tool-index a {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.75rem;
  color: var(--muted);
  text-decoration: none;
}

.tool-index a:hover {
  border-color: var(--accent);
  color: var(--ink);
}

.color-input-row {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  gap: 0.65rem;
}

input[type="color"] {
  width: 56px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 3px;
  background: #0c0f15;
  cursor: pointer;
}

.contrast-preview {
  display: grid;
  place-items: center;
  min-height: 180px;
  margin-block: 1rem;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 2rem;
  font-size: clamp(1.4rem, 4vw, 2.4rem);
  font-weight: 800;
  text-align: center;
}

.verdict-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
}

.verdict {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.7rem;
  color: var(--muted);
}

.verdict.pass {
  border-color: rgb(140 232 197 / 40%);
  color: var(--accent-2);
}

.verdict.fail {
  border-color: rgb(255 155 155 / 32%);
  color: var(--danger);
}

.download-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
  margin-top: 1rem;
}

.download-item {
  display: grid;
  gap: 0.65rem;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0.85rem;
  background: #0c0f15;
  text-align: center;
}

.download-item canvas {
  max-width: 96px;
  max-height: 96px;
  image-rendering: auto;
}

.download-item a {
  color: var(--accent-2);
  font-size: 0.8rem;
  font-weight: 700;
}

.match-list {
  display: grid;
  gap: 0.5rem;
  max-height: 500px;
  overflow: auto;
  margin-top: 1rem;
}

.match-item {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.65rem;
  background: #0c0f15;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.82rem;
  overflow-wrap: anywhere;
}

.soundboard-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
  margin-top: 1rem;
}

.sound-pad {
  position: relative;
  display: grid;
  gap: 0.35rem;
  min-height: 120px;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 1rem;
  background: linear-gradient(145deg, rgb(32 37 51 / 95%), rgb(12 15 21 / 98%));
  color: var(--ink);
  text-align: left;
}

.sound-pad:hover,
.sound-pad.is-playing {
  border-color: var(--accent-2);
  background: linear-gradient(145deg, rgb(52 61 78 / 95%), rgb(17 23 29 / 98%));
}

.sound-pad strong {
  overflow-wrap: anywhere;
}

.sound-pad > span:last-child {
  color: var(--quiet);
  font-size: 0.78rem;
}

.sound-key {
  position: absolute;
  top: 0.6rem;
  right: 0.65rem;
  color: var(--accent-2);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.76rem;
}

.feed-file-drop {
  min-height: 130px;
  margin-bottom: 1rem;
}

.feed-controls {
  align-items: end;
}

.feed-export-row {
  margin-bottom: 1rem;
}

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

.feed-entry,
.feed-subscriptions {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 1rem;
  background: #0c0f15;
}

.feed-entry h3 {
  margin: 0;
  font-size: 1.05rem;
}

.feed-entry h3 a,
.feed-subscriptions a {
  color: var(--ink);
  overflow-wrap: anywhere;
}

.feed-entry p:last-child {
  margin-bottom: 0;
  color: var(--muted);
}

.feed-entry-meta {
  margin-block: 0.35rem;
  color: var(--quiet) !important;
  font-size: 0.78rem;
}

.feed-empty {
  border: 1px dashed var(--line);
  border-radius: 14px;
  padding: 1.25rem;
  color: var(--quiet);
  text-align: center;
}

.feed-subscriptions {
  margin-bottom: 1rem;
}

.feed-subscriptions ul {
  display: grid;
  gap: 0.65rem;
  padding: 0;
  list-style: none;
}

.feed-subscriptions li {
  display: grid;
  gap: 0.2rem;
}

.feed-subscriptions li span {
  color: var(--quiet);
  font-size: 0.78rem;
}

.sanitizer-file-drop {
  min-height: 120px;
  margin-bottom: 1rem;
}

.sanitizer-reveal {
  max-width: 430px;
}

.redaction-list {
  display: grid;
  gap: 0.65rem;
  padding: 0;
  list-style: none;
}

.redaction-item {
  display: grid;
  gap: 0.6rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.8rem;
  background: #0c0f15;
}

.redaction-heading,
.redaction-mapping {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem;
}

.redaction-heading span {
  color: var(--quiet);
  font-size: 0.78rem;
}

.redaction-mapping {
  justify-content: flex-start;
  align-items: center;
}

.redaction-mapping code {
  overflow-wrap: anywhere;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 0.25rem 0.4rem;
  color: #dce2ee;
}

.redaction-mapping span {
  color: var(--accent-2);
}

.ytdlp-warning-box {
  margin-top: 1rem;
  font-family: inherit;
  white-space: normal;
}

.ytdlp-warning-box ul {
  margin-bottom: 0;
  padding-left: 1.2rem;
  color: var(--muted);
}

.image-manifest-list {
  display: grid;
  gap: 0.7rem;
}

.image-manifest-item {
  display: grid;
  gap: 0.45rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0.9rem;
  background: #0c0f15;
}

.image-manifest-item h3 {
  margin: 0;
  font-size: 1rem;
}

.image-manifest-item h3 a {
  color: var(--ink);
  overflow-wrap: anywhere;
}

.image-manifest-item > code {
  overflow-wrap: anywhere;
  color: var(--quiet);
  font-size: 0.75rem;
}

.archive-file-drop {
  min-height: 150px;
}

.archive-folder-drop {
  min-height: 105px;
  margin-block: 0.75rem 1rem;
}

.archive-warning-list {
  display: grid;
  gap: 0.55rem;
  margin-block: 1rem;
}

.archive-notice {
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.65rem 0.75rem;
  font-size: 0.84rem;
}

.archive-notice-safe {
  border-color: rgb(140 232 197 / 34%);
  background: rgb(140 232 197 / 7%);
  color: var(--accent-2);
}

.archive-notice-warning {
  border-color: rgb(255 155 155 / 34%);
  background: rgb(255 155 155 / 7%);
  color: #ffc1c1;
}

.archive-selection-row {
  margin-top: 0;
}

.archive-entry-list,
.archive-create-list {
  overflow: auto;
  max-height: 620px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #0c0f15;
}

.archive-entry {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  gap: 0.7rem;
  align-items: start;
  padding: 0.75rem;
  border-bottom: 1px solid rgb(255 255 255 / 5%);
  cursor: pointer;
}

.archive-entry:last-child,
.archive-create-item:last-child {
  border-bottom: 0;
}

.archive-entry.is-blocked {
  background: rgb(255 155 155 / 3%);
  cursor: not-allowed;
}

.archive-entry input {
  width: 18px;
  height: 18px;
  margin: 0.18rem 0 0;
  accent-color: var(--accent-2);
}

.archive-entry-content {
  display: grid;
  min-width: 0;
  gap: 0.18rem;
}

.archive-entry-content strong {
  overflow-wrap: anywhere;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.88rem;
}

.archive-entry-meta,
.archive-entry-warning {
  color: var(--quiet);
  font-size: 0.76rem;
}

.archive-entry-warning {
  color: #ffb7b7;
}

.archive-output-grid {
  align-items: end;
  margin-top: 1rem;
}

.archive-action-row {
  margin-top: 0;
}

.archive-create-item {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin: 0;
  padding: 0.65rem 0.75rem;
  border-bottom: 1px solid rgb(255 255 255 / 5%);
  color: var(--muted);
  font-size: 0.8rem;
}

.archive-create-item code {
  overflow-wrap: anywhere;
  color: var(--ink);
}

.pwa-dialog {
  width: min(820px, calc(100% - 1.5rem));
  max-height: min(86vh, 850px);
  margin: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0;
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 30px 100px rgb(0 0 0 / 65%);
}

.pwa-dialog::backdrop {
  background: rgb(4 5 8 / 78%);
  backdrop-filter: blur(5px);
}

.pwa-dialog-shell {
  padding: clamp(1rem, 4vw, 2rem);
}

.pwa-dialog-header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 1rem;
}

.pwa-dialog-header h2 {
  margin-bottom: 0.4rem;
}

.pwa-close {
  flex: 0 0 auto;
}

.pwa-manager-section {
  margin-top: 1.25rem;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 1rem;
  background: #0c0f15;
}

.pwa-manager-section h3 {
  margin-bottom: 0.45rem;
}

.pwa-button-row {
  margin-block: 0.8rem;
}

.pwa-import-button input {
  display: none;
}

.pwa-workspace-list {
  overflow: auto;
  max-height: 300px;
  margin-block: 1rem;
  border: 1px solid var(--line);
  border-radius: 12px;
}

.pwa-workspace-item {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
  padding: 0.7rem;
  border-bottom: 1px solid rgb(255 255 255 / 5%);
}

.pwa-workspace-item:last-child {
  border-bottom: 0;
}

.pwa-workspace-item > div:first-child {
  display: grid;
  min-width: 0;
  gap: 0.15rem;
}

.pwa-workspace-item strong {
  overflow-wrap: anywhere;
  font-size: 0.88rem;
}

.pwa-workspace-item span {
  color: var(--quiet);
  font-size: 0.74rem;
}

.pwa-workspace-actions {
  display: flex;
  flex: 0 0 auto;
  gap: 0.4rem;
}

.pwa-workspace-actions button {
  min-height: 34px;
  padding: 0.35rem 0.6rem;
  font-size: 0.75rem;
}

.audio-file-drop {
  min-height: 145px;
}

.audio-record-box {
  display: grid;
  gap: 0.75rem;
  margin-top: 1rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 1rem;
  background: #0c0f15;
}

.audio-record-box p {
  margin-bottom: 0;
}

.audio-record-actions {
  margin-top: 0;
}

.audio-record-actions > strong {
  min-width: 4rem;
  color: var(--accent-2);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 1.1rem;
  font-variant-numeric: tabular-nums;
  text-align: center;
}

.audio-waveform-wrap {
  overflow: hidden;
  margin-block: 1rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #090b10;
}

.audio-waveform-wrap canvas {
  display: block;
  width: 100%;
  height: 240px;
  cursor: crosshair;
  touch-action: none;
}

.audio-waveform-wrap p {
  margin: 0;
  border-top: 1px solid var(--line);
  padding: 0.55rem 0.75rem;
}

.audio-edit-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.3rem 1rem;
}

.audio-range-field label {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
}

.audio-range-field output {
  color: var(--accent-2);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.8rem;
}

.audio-range-field input[type="number"] {
  margin-top: 0.25rem;
}

@media (max-width: 820px) {
  .tool-grid,
  .principle-grid,
  .steps-grid,
  .tool-shell,
  .callout {
    grid-template-columns: 1fr;
  }

  .nav-links a:not(.nav-essential) {
    display: none;
  }

  .page {
    padding-top: 2.5rem;
  }

  .local-privacy-proof {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (max-width: 540px) {
  .field-grid {
    grid-template-columns: 1fr;
  }

  .audio-edit-grid {
    grid-template-columns: 1fr;
  }

  .checkbox-grid,
  .metric-grid,
  .tool-index,
  .download-grid,
  .soundboard-grid {
    grid-template-columns: 1fr 1fr;
  }

  .output-row {
    grid-template-columns: 1fr;
    gap: 0.1rem;
  }

  .footer-inner {
    flex-direction: column;
  }

  .pwa-dialog-header,
  .pwa-workspace-item {
    align-items: stretch;
    flex-direction: column;
  }

  .pwa-close {
    align-self: flex-start;
  }

  .pwa-workspace-actions {
    flex-wrap: wrap;
  }

  .brand span span {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}
