* {
  box-sizing: border-box;
}

:root {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans JP", sans-serif;
  color: #263238;
  background: #f3f6fa;
}

body {
  margin: 0;
  min-height: 100vh;
}

header {
  position: sticky;
  top: 0;
  z-index: 10;
  padding: 16px 14px;
  color: #fff;
  text-align: center;
  background: #1565c0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .2);
}

h1 {
  margin: 0;
  font-size: 23px;
}

.network {
  display: inline-block;
  margin-top: 8px;
  padding: 3px 12px;
  border-radius: 999px;
  font-size: 13px;
}

.online {
  background: #2e7d32;
}

.offline {
  background: #c62828;
}

main {
  width: min(100%, 560px);
  margin: 0 auto;
  padding: 12px 12px 40px;
}

.settings-card,
.camera-card,
.manual-card,
.result {
  margin: 12px 0;
  padding: 16px;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 3px 12px rgba(0, 0, 0, .12);
}

.settings-card {
  display: grid;
  gap: 13px;
}

.settings-card > div {
  display: grid;
  gap: 3px;
}

.label,
.manual-card label {
  color: #607d8b;
  font-size: 13px;
}

.settings-card strong {
  font-size: 23px;
}

button {
  width: 100%;
  min-height: 54px;
  border: 0;
  border-radius: 12px;
  color: #fff;
  background: #1565c0;
  font-size: 20px;
  font-weight: 700;
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: .55;
}

#video {
  display: none;
  width: 100%;
  max-height: 58vh;
  margin-top: 14px;
  border-radius: 12px;
  background: #000;
  object-fit: cover;
}

#cameraMessage {
  margin-top: 12px;
  color: #546e7a;
  font-size: 15px;
}

.manual-card {
  display: grid;
  gap: 10px;
}

#qrInput {
  width: 100%;
  padding: 14px;
  border: 2px solid #cfd8dc;
  border-radius: 12px;
  font-size: 23px;
  text-align: center;
  text-transform: uppercase;
}

.result {
  min-height: 150px;
  display: grid;
  place-content: center;
  gap: 8px;
  text-align: center;
  border: 4px solid transparent;
}

#resultTitle {
  font-size: 32px;
  font-weight: 900;
}

#resultName {
  font-size: 25px;
  font-weight: 800;
}

#resultDetail {
  white-space: pre-line;
  font-size: 17px;
  line-height: 1.55;
}

.wait {
  color: #455a64;
  background: #eceff1;
}

.success {
  color: #1b5e20;
  background: #e8f5e9;
  border-color: #43a047;
}

.changed {
  color: #7a4f00;
  background: #fff8e1;
  border-color: #f9a825;
}

.duplicate,
.error {
  color: #b71c1c;
  background: #ffebee;
  border-color: #e53935;
}

@media (min-width: 520px) {
  .settings-card {
    grid-template-columns: 1fr 1fr 1fr;
  }

  .settings-card strong {
    font-size: 19px;
  }
}
