/* UUID Generator — one page, one action.
 *
 * Monospace for every UUID, because the whole job of this page is to let
 * someone read and copy a 36-character string without transcription errors.
 * Colours are the muted neutral set the other internal tools use; the only
 * saturated colour on the page is the Generate button, since there is exactly
 * one primary action here.
 */

:root {
  --bg: #f6f7f9;
  --panel: #ffffff;
  --ink: #1b1f24;
  --muted: #5c6672;
  --line: #dde1e6;
  --accent: #2f6fd0;
  --accent-ink: #ffffff;
  --ok: #1f7a4d;
  --bad: #a32c2c;
  --bad-bg: #fdf0f0;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  padding: 2rem 1rem 4rem;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

main {
  max-width: 46rem;
  margin: 0 auto;
}

h1 {
  margin: 0 0 .25rem;
  font-size: 1.6rem;
  letter-spacing: -0.01em;
}

.lede {
  margin: 0 0 1.5rem;
  color: var(--muted);
}

/* -- controls ------------------------------------------------------------ */

.controls {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 1.1rem 1.2rem;
}

.field {
  display: flex;
  align-items: center;
  gap: .6rem;
  flex-wrap: wrap;
}

.field + .field { margin-top: .85rem; }

label { font-weight: 600; }

input[type="number"] {
  width: 6rem;
  padding: .5rem .6rem;
  font: inherit;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 7px;
}

input[type="number"]:focus-visible,
button:focus-visible,
a:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

button.generate {
  padding: .5rem 1.1rem;
  font: inherit;
  font-weight: 600;
  color: var(--accent-ink);
  background: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 7px;
  cursor: pointer;
}

button.generate:hover { filter: brightness(1.07); }

.options { gap: 1.1rem; }

.check {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  font-weight: 500;
  color: var(--muted);
  cursor: pointer;
}

.presets {
  margin: .9rem 0 0;
  color: var(--muted);
  font-size: .92rem;
}

.preset {
  display: inline-block;
  min-width: 2.1rem;
  margin-left: .2rem;
  padding: .12rem .45rem;
  text-align: center;
  text-decoration: none;
  color: var(--accent);
  border: 1px solid var(--line);
  border-radius: 6px;
  font-variant-numeric: tabular-nums;
}

.preset:hover { border-color: var(--accent); }

.preset.current {
  color: var(--accent-ink);
  background: var(--accent);
  border-color: var(--accent);
}

/* -- result -------------------------------------------------------------- */

.result {
  margin-top: 1.4rem;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 1.1rem 1.2rem 1.3rem;
}

.result-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: .8rem;
}

.result-head h2 {
  margin: 0;
  font-size: 1.05rem;
  color: var(--muted);
  font-weight: 600;
}

.uuid-list {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: uuid;
}

.uuid-list li {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .38rem 0;
  border-bottom: 1px solid var(--line);
}

.uuid-list li:last-child { border-bottom: 0; }

.uuid {
  flex: 1;
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  font-size: 1rem;
  letter-spacing: .01em;
  word-break: break-all;
  user-select: all; /* one click selects the whole UUID, not a hyphen-delimited word */
}

.copy {
  flex: 0 0 auto;
  padding: .28rem .7rem;
  font: inherit;
  font-size: .85rem;
  color: var(--muted);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
  cursor: pointer;
}

.copy:hover { border-color: var(--accent); color: var(--accent); }

.copy.copied {
  color: var(--ok);
  border-color: var(--ok);
}

.copy.copy-all {
  font-size: .9rem;
  padding: .35rem .9rem;
}

.raw-label {
  display: block;
  margin: 1rem 0 .35rem;
  font-size: .85rem;
  font-weight: 500;
  color: var(--muted);
}

.raw {
  width: 100%;
  padding: .6rem .7rem;
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  font-size: .92rem;
  line-height: 1.5;
  color: var(--ink);
  background: #fbfcfd;
  border: 1px solid var(--line);
  border-radius: 7px;
  resize: vertical;
}

/* -- error --------------------------------------------------------------- */

.error {
  margin: 1rem 0 0;
  padding: .7rem .9rem;
  color: var(--bad);
  background: var(--bad-bg);
  border: 1px solid #f0cfcf;
  border-radius: 8px;
}

/* -- footer -------------------------------------------------------------- */

footer {
  margin-top: 1.8rem;
  color: var(--muted);
  font-size: .87rem;
}

footer p { margin: .4rem 0; }

footer code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .92em;
  padding: .05rem .3rem;
  background: #eef1f4;
  border-radius: 4px;
}

footer a { color: var(--accent); }

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14171b;
    --panel: #1c2026;
    --ink: #e8ebee;
    --muted: #9aa4b0;
    --line: #2c333b;
    --accent: #6ba3f0;
    --accent-ink: #10141a;
    --ok: #5fc98d;
    --bad: #f08a8a;
    --bad-bg: #2a1c1c;
  }
  input[type="number"], .copy { background: #171b21; color: var(--ink); }
  .raw { background: #171b21; }
  footer code { background: #232931; }
  .error { border-color: #4a2b2b; }
}
