@font-face {
  font-family: "Noto SSP Emoji";
  src: url("ssp_emoji.ttf") format("truetype");
  font-display: swap;
}
:root {
  color-scheme: light dark;
  font-family: Roboto, Arial, sans-serif;
  color: var(--text);
  background: var(--background);
  --text: #1d1b20;
  --background: #fffbfe;
  --accent: #675080;
  --secondary: #625b71;
  --surface: #eee6f4;
  --outline: #79747e;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
  :root {
    --text: #e6e1e5;
    --background: #141218;
    --accent: #d0bcff;
    --secondary: #ccc2dc;
    --surface: #2b2633;
    --outline: #938f99;
  }
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 280px;
}

header {
  padding: 18px 20px;
}
@media (max-width: 400px) {
  header {
    padding-inline: 14px;
  }
}

h1 {
  margin: 0;
  font-size: 22px;
  font-weight: 400;
  line-height: 28px;
  text-align: center;
}

main {
  min-height: calc(100svh - 64px);
  display: grid;
  place-items: center;
  padding: 20px 10px;
}
@media (max-height: 600px) {
  main {
    align-items: start;
    padding-bottom: 56px;
  }
}

footer {
  text-align: center;
  font-size: 10px;
  color: var(--secondary);
}

button, a, input {
  -webkit-tap-highlight-color: transparent;
}

a:hover, button:enabled:hover {
  background-color: var(--surface);
  filter: brightness(0.96);
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.field {
  position: relative;
}
.field label {
  position: absolute;
  top: -7px;
  left: 12px;
  padding: 0 4px;
  font: 12px/14px var(--mono);
  background: var(--background);
  color: var(--secondary);
}
.field input {
  border: 1px solid var(--outline);
  border-radius: 4px;
  width: 100%;
  height: 54px;
  background: transparent;
  padding: 12px 15px;
  font: 16px var(--mono);
  letter-spacing: 1.4px;
  color: inherit;
}
.field input:focus {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}
.field:focus-within label {
  color: var(--accent);
}

.icon-button {
  border: 1px solid var(--outline);
  border-radius: 24px;
  flex-shrink: 0;
  width: 56px;
  height: 40px;
  display: grid;
  place-items: center;
  color: var(--accent);
  background: transparent;
  cursor: pointer;
}
.icon-button.filled {
  background: var(--surface);
  border-color: transparent;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1333333333);
}
.icon-button svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
}
.icon-button:disabled {
  opacity: 0.4;
  cursor: default;
}
@media (max-width: 400px) {
  .icon-button {
    width: 44px;
  }
}

input[type=range], input[type=checkbox], input[type=radio] {
  accent-color: var(--accent);
  cursor: pointer;
}
input[type=range] {
  width: 100%;
  margin: 5px 0;
  height: 24px;
}
input[type=checkbox], input[type=radio] {
  width: 18px;
  height: 18px;
}

fieldset {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 0;
  padding: 0;
  margin: 0;
  font-size: 14px;
}

legend {
  float: left;
  padding: 0;
  margin-right: 6px;
  line-height: 36px;
}

.generator {
  width: 100%;
  max-width: 500px;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.loading {
  height: 2px;
  overflow: hidden;
}
.loading.active::after {
  content: "";
  display: block;
  width: 35%;
  height: 100%;
  background: var(--accent);
  animation: loading 1.2s ease-in-out infinite alternate;
}
@media (prefers-reduced-motion: reduce) {
  .loading.active::after {
    animation: none;
    width: 100%;
  }
}

@keyframes loading {
  to {
    transform: translateX(190%);
  }
}
.emoji {
  height: 38px;
  text-align: center;
  font: 30px/38px "Noto SSP Emoji", sans-serif;
  letter-spacing: 1px;
}

.expiry {
  height: 2px;
  margin-top: -12px;
}
.expiry div {
  height: 100%;
  background: var(--secondary);
  transition: width 0.1s linear;
}
@media (prefers-reduced-motion: reduce) {
  .expiry div {
    transition: none;
  }
}

.password-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
}

.password {
  flex: 1;
  min-width: 0;
  text-align: center;
  overflow-wrap: anywhere;
  font: 20px/1.6 var(--mono);
  letter-spacing: 2px;
}
.password.revealed {
  font-size: 15px;
}

.length-control {
  padding: 0 12px;
}
.length-control > label {
  display: block;
  font-size: 12px;
  text-align: center;
  color: var(--secondary);
}

.length-stops {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  color: var(--secondary);
}

.options {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: space-between;
}
.options label {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  min-height: 36px;
}
@media (max-width: 400px) {
  .options {
    flex-wrap: wrap;
    justify-content: center;
    gap: 0 12px;
  }
}

.special {
  font: 14px var(--mono);
  letter-spacing: 1.4px;
}

.status {
  position: absolute;
  top: 100%;
  margin: 12px 0 0;
  width: 100%;
  text-align: center;
  font-size: 13px;
  color: var(--secondary);
}

.downloads {
  align-items: start;
  padding-bottom: 40px;
}

.download-content {
  width: 100%;
  max-width: 500px;
  display: grid;
  gap: 24px;
}
.download-content a {
  color: var(--accent);
}
.download-content nav {
  font-size: 14px;
}
.download-content h2 {
  margin: 0;
  font-size: 28px;
  font-weight: 400;
}
.download-content h3 {
  margin: 0 0 10px;
  font-size: 16px;
  font-weight: 500;
}

.download-intro {
  margin: 8px 0 0;
  color: var(--secondary);
  line-height: 1.5;
}

.download-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}
.download-list a {
  display: flex;
  align-items: center;
  gap: 16px;
  justify-content: space-between;
  border: 1px solid var(--outline);
  border-radius: 8px;
  padding: 14px 16px;
  text-decoration: none;
}
.download-list small {
  display: block;
  margin-top: 4px;
  color: var(--secondary);
  font-size: 12px;
  line-height: 1.5;
}

.download-format {
  flex-shrink: 0;
  padding: 5px 8px;
  border-radius: 16px;
  background: var(--surface);
  font: 11px var(--mono);
}
