:root {
  --bg: #16171a;
  --panel: #1e2024;
  --panel-2: #24272c;
  --line: #31353b;
  --line-strong: #4a4f57;
  --text: #e7e9ec;
  --muted: #94989f;
  --accent: #e7e9ec;
  --accent-text: #15161a;
  --danger: #ff6b6b;
}

* {
  box-sizing: border-box;
  border-radius: 0;
}

html,
body {
  margin: 0;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial,
    sans-serif;
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

main {
  max-width: 680px;
  margin: 0 auto;
  padding: 56px 24px 72px;
}

h1 {
  margin: 0 0 28px;
  font-size: 20px;
  font-weight: 650;
  letter-spacing: -0.01em;
}

form#controls {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.row {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  flex-wrap: wrap;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.row .field {
  flex: 1 1 200px;
}

.field-count {
  flex: 0 0 88px;
}

.optional {
  text-transform: none;
  letter-spacing: 0;
  font-weight: 400;
  opacity: 0.7;
}

input[type="text"] {
  width: 100%;
  background: var(--panel);
  color: var(--text);
  border: 1px solid var(--line);
  padding: 10px 12px;
  font: inherit;
  transition: border-color 120ms ease;
}

input[type="text"]:hover {
  border-color: var(--line-strong);
}

label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--muted);
}

select,
input[type="number"] {
  width: 100%;
  background: var(--panel);
  color: var(--text);
  border: 1px solid var(--line);
  padding: 10px 12px;
  font: inherit;
  transition: border-color 120ms ease;
}

select {
  appearance: none;
  padding-right: 32px;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%2394989f'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
}

select:hover,
input[type="number"]:hover {
  border-color: var(--line-strong);
}

button {
  font: inherit;
  cursor: pointer;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: var(--accent-text);
  font-weight: 600;
  padding: 10px 20px;
  transition: background-color 120ms ease;
}

button:hover:not(:disabled) {
  background: #fff;
}

button:disabled {
  opacity: 0.45;
  cursor: default;
}

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

#status {
  margin: 22px 0 0;
  font-size: 13px;
  color: var(--muted);
}

#status.error {
  color: var(--danger);
}

/* Quiet pulse while the backend waits out upstream rate limits. */
#status.loading::before {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 8px;
  background: var(--muted);
  vertical-align: middle;
  animation: pulse 1.1s ease-in-out infinite;
}

@keyframes pulse {
  0%,
  100% {
    opacity: 0.2;
  }
  50% {
    opacity: 1;
  }
}

#results {
  list-style: none;
  margin: 26px 0 0;
  padding: 0;
  border-top: 1px solid var(--line);
}

#results:empty {
  border-top: 0;
}

#results li {
  border-bottom: 1px solid var(--line);
}

#results button {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 4px;
  background: transparent;
  border: 0;
  color: var(--text);
  font-weight: 500;
  text-align: left;
}

#results button:hover {
  background: var(--panel);
  color: #fff;
}

#results .copy-hint {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--muted);
  opacity: 0;
  transition: opacity 120ms ease;
}

#results button:hover .copy-hint,
#results button.copied .copy-hint {
  opacity: 1;
}

#results button.copied .copy-hint {
  color: var(--accent);
}

/* --- footer + privacy policy --- */

.site-footer {
  margin-top: 44px;
  border-top: 1px solid var(--line);
  padding-top: 16px;
}

.site-footer a,
a.back {
  color: var(--muted);
  text-decoration: none;
  font-size: 13px;
}

.site-footer a:hover,
a.back:hover {
  color: var(--text);
}

.page-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 6px;
}

.page-head h1 {
  margin-bottom: 0;
}

.updated {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 13px;
}

.policy h2 {
  margin: 32px 0 8px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--muted);
}

.policy p {
  margin: 0 0 12px;
}
