:root {
  --bg: #f6f6f4;
  --fg: #1c1c1c;
  --muted: #5d5d5d;
  --line: #cfcfc8;
  --card: #ffffff;
  --accent: #1a4f8a;
  --error: #a11414;
  --valid: #197a3d;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #16181a;
    --fg: #e8e8e6;
    --muted: #a0a0a0;
    --line: #34383c;
    --card: #1e2124;
    --accent: #7db1ea;
    --error: #ff8a80;
    --valid: #6fd99a;
  }
}

* {
  box-sizing: border-box;
}

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

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

h1 {
  font-size: 1.5rem;
  margin: 0 0 0.35rem;
}

h2 {
  font-size: 1.1rem;
  margin: 0 0 0.6rem;
}

.sub,
.note {
  color: var(--muted);
  font-size: 0.86rem;
}

.sub {
  margin: 0 0 1.25rem;
}

.imei-valid {
  color: var(--valid);
}

.imei-invalid {
  color: var(--error);
}

.note {
  margin: 0.4rem 0 0;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0.9rem 1rem;
  margin-bottom: 0.9rem;
}

label {
  display: block;
  font-weight: 600;
  font-size: 0.82rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.35rem;
}

input,
select,
button {
  font: inherit;
  color: inherit;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 0.45rem 0.55rem;
  width: 100%;
}

input[type='search'] {
  margin-bottom: 0.4rem;
}

select[size] {
  height: auto;
}

.row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 0.6rem;
}

.row > div {
  flex: 1 1 9rem;
}

button {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  font-weight: 600;
  cursor: pointer;
}

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

.error {
  color: var(--error);
  margin: 0.7rem 0 0;
  font-size: 0.9rem;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}

th,
td {
  text-align: left;
  padding: 0.4rem 0.5rem;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

th {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--muted);
}

td.code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 1rem;
  user-select: all;
}

td.seq {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color: var(--muted);
  font-size: 0.85rem;
}

footer p {
  color: var(--muted);
  font-size: 0.8rem;
  margin-top: 2rem;
  border-top: 1px solid var(--line);
  padding-top: 0.8rem;
}

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.9em;
}

[hidden] {
  display: none !important;
}

/* Inline affordance inside a .note line — `button` above is full-width by default. */
.btn-inline {
  width: auto;
  padding: 0.15rem 0.5rem;
  font-size: 0.8rem;
  margin-left: 0.4rem;
  vertical-align: baseline;
}

.imei-detected {
  color: var(--accent);
}

/* Standalone result line (the master code) — the table's td.code equivalent. */
.bigcode {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 1.35rem;
  letter-spacing: 0.08em;
  margin: 0.2rem 0 0;
  user-select: all;
}

.bigcode.empty {
  color: var(--muted);
  letter-spacing: normal;
}

footer a {
  color: inherit;
}

.callout {
  background: var(--bg);
  border-left: 3px solid var(--accent);
  border-radius: 0 4px 4px 0;
  padding: 0.55rem 0.7rem;
  margin: 0 0 0.5rem;
}
