/* One page, one job. Plain CSS, no build step, no framework — the whole tool is
   a text box and three numbers, and it should load instantly on a phone on the
   office wifi. Dark mode follows the system rather than adding a toggle. */

:root {
  --bg: #fbfbfa;
  --panel: #ffffff;
  --ink: #1b1c1e;
  --muted: #61656c;
  --line: #e2e2df;
  --accent: #1f5f8b;
  --accent-soft: #eaf2f8;
  --error: #a03024;
  --radius: 10px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #16181b;
    --panel: #1e2126;
    --ink: #ececec;
    --muted: #a0a5ad;
    --line: #31353b;
    --accent: #7cb6dd;
    --accent-soft: #22303c;
    --error: #f0a094;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  padding: 2.5rem 1.25rem 4rem;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
        "Helvetica Neue", Arial, sans-serif;
}

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

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

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

/* -- the form ------------------------------------------------------------ */

.row {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
  align-items: flex-end;
}

.field { display: flex; flex-direction: column; gap: .35rem; flex: 1 1 11rem; }
.field.scale { flex: 0 1 12rem; }

.label {
  font-size: .8rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .06em;
}

input[type="text"], select, button {
  font: inherit;
  padding: .6rem .7rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  color: var(--ink);
  min-height: 2.75rem; /* comfortable tap target */
}

input[type="text"] { width: 100%; }

/* A temperature is read digit by digit against a reference, so line the digits
   up: tabular figures stop the result jittering as you type. */
input[type="text"] { font-variant-numeric: tabular-nums; }

button {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  padding-inline: 1.1rem;
}

button:hover { filter: brightness(1.08); }

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

/* -- results ------------------------------------------------------------- */

#output { margin-top: 1.75rem; }

.results {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: .6rem;
}

.result {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: .5rem;
  padding: .85rem 1rem;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

/* The scale you typed in is shown too — it confirms the tool read your input
   the way you meant it — but it is not an answer, so it recedes. */
.result.is-input {
  background: var(--accent-soft);
  border-color: transparent;
}

.value {
  font-size: 1.65rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: -.02em;
}

.symbol {
  font-size: .95rem;
  font-weight: 500;
  color: var(--muted);
  margin-left: .15rem;
}

.scale-name { color: var(--muted); font-size: .9rem; }

.note {
  margin: .8rem 0 0;
  color: var(--muted);
  font-size: .9rem;
  font-style: italic;
}

.error {
  margin: 0;
  padding: .8rem 1rem;
  border: 1px solid currentColor;
  border-radius: var(--radius);
  color: var(--error);
  background: var(--panel);
}

/* -- examples and footer -------------------------------------------------- */

.examples {
  margin-top: 1.75rem;
  color: var(--muted);
  font-size: .9rem;
}

.examples a { color: var(--accent); text-decoration: none; }
.examples a:hover { text-decoration: underline; }
.examples .sep { padding: 0 .4rem; opacity: .6; }

footer {
  margin-top: 2.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: .85rem;
}

footer p { margin: 0; }

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .85em;
  background: var(--accent-soft);
  padding: .1rem .3rem;
  border-radius: 4px;
}
