* {
  box-sizing: border-box
}

:root {
  --bg: #0b0d10;
  --panel: #12161b;
  --text: #e7edf2;
  --muted: #9aa7b2;
  --accent: #67d4ff;
  --accent-2: #8cff8c;
  --danger: #ff6b6b;
  --ring: #2a323a
}

html,
body {
  height: 100%
}

body {
  margin: 0;
  font: 16px/1.4 system-ui, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text)
}

.wrap {
  max-width: 1000px;
  margin-inline: auto;
  padding: 24px
}

.app-header {
  display: flex;
  justify-content: space-evenly;
  margin: 0 0 20px 0
}

.app-header h1 {
  margin: 0 0 4px 0;
  font-size: 28px
}

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

.controls {
  background: var(--panel);
  padding: 16px;
  border-radius: 14px;
  box-shadow: 0 0 0 1px var(--ring) inset, 0 8px 30px rgb(0 0 0 / .25);
  margin-bottom: 20px
}

.levels {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin: 0 0 12px 0;
  border: 0;
  padding: 0
}

.levels label {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  background: #0d1116;
  padding: 6px 10px;
  border-radius: 10px;
  box-shadow: 0 0 0 1px var(--ring) inset
}

.row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 10px 0
}

.select,
select,
input[type="range"] {
  appearance: none;
  background: #0d1116;
  border: 1px solid var(--ring);
  color: var(--text);
  padding: 8px 10px;
  border-radius: 10px
}

#count {
  width: 240px
}

output {
  min-width: 2ch;
  display: inline-block;
  text-align: right
}

.buttons {
  gap: 10px;
  flex-wrap: wrap
}

.btn {
  background: #0d1116;
  border: 1px solid var(--ring);
  color: var(--text);
  padding: 10px 14px;
  border-radius: 12px;
  cursor: pointer
}

.btn.small {
  padding: 6px 10px;
  font-size: 14px
}

.btn.primary {
  background: linear-gradient(180deg, #223 0%, #112 100%);
  border-color: #2a3d5a;
  box-shadow: 0 0 0 1px rgba(103, 212, 255, .2) inset
}

.btn.danger {
  border-color: #4a2a2a;
  color: #ffd0d0
}

.btn[aria-pressed="true"] {
  outline: 2px solid var(--accent)
}

.list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 12px
}

.card {
  background: var(--panel);
  padding: 14px;
  border-radius: 14px;
  box-shadow: 0 0 0 1px var(--ring) inset
}

.card h3 {
  margin: 0 0 6px 0;
  font-size: 18px
}

.card h3[role="link"] {
  cursor: pointer
}

.card h3[role="link"]:hover,
.card h3[role="link"]:focus {
  text-decoration: underline;
  text-underline-offset: 2px
}

.meta {
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 10px
}

.actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap
}

.actions .icon-btn {
  border-radius: 10px;
  border: 1px solid var(--ring);
  background: #0d1116;
  cursor: pointer;
  color: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  padding: 0;
  line-height: 1;
  font-size: 18px;
}

.actions .icon-btn[aria-pressed="true"] {
  outline: 2px solid var(--accent-2)
}

.summary {
  margin-top: 12px;
  color: var(--muted)
}

.switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 26px
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: #26303a;
  border-radius: 999px;
  transition: .2s
}

.slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 4px;
  top: 4px;
  background: white;
  border-radius: 50%;
  transition: .2s
}

.switch input:checked+.slider {
  background: #1b5e3c
}

.switch input:checked+.slider:before {
  transform: translateX(18px)
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0
}

a.download {
  display: inline-block;
  margin-top: 8px
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #f6f7fb;
    --panel: #fff;
    --text: #0c1116;
    --muted: #5b6770;
    --ring: #d0d7de
  }

  body {
    background: var(--bg);
    color: var(--text)
  }

  .levels label {
    background: #fff;
    box-shadow: 0 0 0 1px var(--ring) inset
  }

  .select,
  select,
  input[type="range"] {
    background: #fff;
    border-color: var(--ring);
    color: #0c1116
  }

  .btn {
    background: #fff;
    border-color: var(--ring);
    color: #0c1116
  }

  .btn.primary {
    background: linear-gradient(180deg, #f7fafc 0%, #eef2f8 100%);
    border-color: #c9d4e5
  }

  .btn.danger {
    background: #fff;
    border-color: #f2c9c9;
    color: #8a1f1f
  }

  .actions .icon-btn {
    background: #fff;
    border-color: var(--ring);
    color: #0c1116
  }
}