@font-face {
  font-family: "Alimama";
  src: url("https://cdn.chilo.top/standard/alimama.ttf") format("truetype");
  font-display: swap;
}

:root {
  color-scheme: light;
  --background: #f7f7f8;
  --surface: #fff;
  --text: #303036;
  --muted: #72727e;
  --border: #e5e5e9;
  --hover: #f0f0f3;
  --accent: #6965b9;
  --accent-hover: #807bc9;
  --accent-active: #5955a6;
  --on-accent: #fff;
  --error: #b33b48;
  font: 14px/1.5 "Alimama", system-ui, sans-serif;
  color: var(--text);
  background: var(--background);
  -webkit-font-smoothing: antialiased;
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --background: #202023;
    --surface: #242427;
    --text: #dedee3;
    --muted: #a2a2ae;
    --border: #39393f;
    --hover: #303035;
    --accent: #b0a9df;
    --accent-hover: #c3bdeb;
    --accent-active: #9b92cf;
    --on-accent: #202023;
    --error: #ff9ca6;
  }
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
h1, p { margin: 0; }

body {
  margin: 0;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: clamp(16px, 4vw, 24px);
}

.generator {
  width: min(600px, 100%);
}

form, .result { display: grid; gap: 8px; }

.controls {
  display: grid;
  grid-template-columns: 64px 64px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
}

.controls > :is(.symbol-field, .primary) {
  height: 38px;
  min-height: 0;
  padding-block: 0;
  border-radius: 10px;
}

.symbol-field {
  display: flex;
  align-items: center;
  border: 1px solid var(--border);
  background: var(--surface);
}

.symbol-field label { padding-left: 10px; color: var(--muted); cursor: text; }

input, textarea, button { font: inherit; }

.symbol-field input {
  width: 100%;
  min-width: 0;
  height: 100%;
  padding: 0 4px;
  border: 0;
  outline: 0;
  font-size: 16px;
  text-align: center;
  background: transparent;
  color: var(--text);
}

textarea {
  display: block;
  width: 100%;
  min-width: 0;
  min-height: 64px;
  padding: 10px 13px;
  border: 1px solid var(--border);
  border-radius: 10px;
  resize: vertical;
  overflow-wrap: anywhere;
  background: var(--surface);
  color: var(--text);
}

#target { font-size: 16px; }
textarea::placeholder { color: var(--muted); }

.symbol-field:focus-within, textarea:focus {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

button, .primary {
  border: 1px solid transparent;
  border-radius: 10px;
  cursor: pointer;
  transition: background-color .2s ease;
}

.primary {
  display: grid;
  place-items: center;
  min-height: 44px;
  width: 100%;
  padding: 8px 14px;
  background: var(--accent);
  color: var(--on-accent);
  text-decoration: none;
}

.primary:hover { background: var(--accent-hover); }
.primary:active { background: var(--accent-active); }
.primary:disabled { cursor: wait; opacity: .7; }
button:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.result { margin-top: 14px; }
.result-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; }

.secondary {
  min-height: 34px;
  min-width: 72px;
  padding: 4px 10px;
  border-color: var(--border);
  background: var(--surface);
  color: var(--text);
}

.secondary:hover { background: var(--hover); }
.error { color: var(--error); }
.error-page { width: min(280px, 100%); text-align: center; }
.error-page h1 { margin-bottom: 16px; font-size: 22px; font-weight: 600; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}

