:root {
  color-scheme: light;
  --bg: #f6f7f9;
  --panel: #ffffff;
  --text: #1f2933;
  --muted: #637083;
  --line: #d9dee7;
  --primary: #1769e0;
  --primary-dark: #0f55bd;
  --ok: #16794c;
  --warn: #8a5b00;
  --danger: #b42318;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input {
  font: inherit;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px clamp(16px, 4vw, 48px);
  background: var(--panel);
  border-bottom: 1px solid var(--line);
}

h1 {
  margin: 0;
  font-size: 22px;
  line-height: 1.25;
}

p {
  margin: 6px 0 0;
  color: var(--muted);
}

.app-shell {
  width: min(760px, calc(100% - 32px));
  margin: 28px auto;
}

.notice,
.lookup,
.status,
.result,
.login-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.notice {
  display: grid;
  gap: 6px;
  padding: 16px;
  margin-bottom: 16px;
}

.notice span {
  color: var(--muted);
}

.lookup {
  padding: 18px;
}

.lookup label {
  display: block;
  margin-bottom: 8px;
  font-weight: 650;
}

.lookup-row,
.login-form {
  display: flex;
  gap: 10px;
}

input {
  width: 100%;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
}

input:focus {
  outline: 2px solid rgba(23, 105, 224, 0.18);
  border-color: var(--primary);
}

button {
  min-height: 44px;
  min-width: 116px;
  padding: 0 16px;
  border: 0;
  border-radius: 6px;
  background: var(--primary);
  color: #fff;
  font-weight: 650;
  cursor: pointer;
}

button:hover {
  background: var(--primary-dark);
}

button:disabled {
  cursor: wait;
  opacity: 0.7;
}

.ghost {
  min-width: 72px;
  background: #eef2f7;
  color: var(--text);
}

.ghost:hover {
  background: #e2e8f0;
}

.status {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-top: 16px;
  padding: 14px 16px;
}

.status-label {
  flex: 0 0 auto;
  font-weight: 700;
}

.status-text {
  color: var(--muted);
}

.status.loading .status-label {
  color: var(--warn);
}

.status.success .status-label {
  color: var(--ok);
}

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

.result {
  margin-top: 16px;
  padding: 22px;
}

.result-code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 42px;
  font-weight: 800;
  letter-spacing: 0;
}

.result-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 10px;
  color: var(--muted);
}

.hidden {
  display: none;
}

.login-body {
  display: grid;
  place-items: center;
  padding: 18px;
}

.login-panel {
  width: min(420px, 100%);
  padding: 24px;
}

.login-form {
  margin-top: 18px;
}

.error {
  margin-top: 12px;
  color: var(--danger);
}

@media (max-width: 640px) {
  .topbar {
    align-items: flex-start;
  }

  .lookup-row,
  .login-form {
    flex-direction: column;
  }

  button {
    width: 100%;
  }
}

