:root {
  color-scheme: light;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #f4f4f4;
  color: #111;
}

* { box-sizing: border-box; }

html, body { margin: 0; min-height: 100%; }

body {
  min-height: 100vh;
  min-height: 100dvh;
  background: #f4f4f4;
}

button, input { font: inherit; }

.page-shell {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: max(24px, env(safe-area-inset-top)) 16px max(24px, env(safe-area-inset-bottom));
}

.card {
  width: min(100%, 440px);
  background: #fff;
  border: 1px solid #dedede;
  border-radius: 20px;
  padding: 28px 20px 22px;
  box-shadow: 0 16px 44px rgba(0,0,0,.08);
}

.brand-block { text-align: center; margin-bottom: 24px; }
.brand { font-size: 13px; font-weight: 900; letter-spacing: .2em; margin-bottom: 10px; }
h1 { margin: 0; font-size: clamp(24px, 6vw, 30px); line-height: 1.1; }
.brand-block p { margin: 10px auto 0; color: #666; font-size: 14px; line-height: 1.5; max-width: 330px; }

.search-fields { display: grid; gap: 10px; }
.field-row { position: relative; display: flex; gap: 8px; }

.search-input {
  width: 100%;
  height: 52px;
  border: 1px solid #cfcfcf;
  border-radius: 12px;
  padding: 0 14px;
  background: #fff;
  color: #111;
  outline: none;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.search-input:focus { border-color: #111; box-shadow: 0 0 0 3px rgba(0,0,0,.08); }
.search-input::placeholder { color: #999; }

.remove-field {
  flex: 0 0 48px;
  height: 52px;
  border-radius: 12px;
  border: 1px solid #ddd;
  background: #fff;
  color: #555;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; }
.button {
  min-height: 48px;
  border-radius: 12px;
  border: 1px solid #111;
  padding: 0 14px;
  font-weight: 800;
  cursor: pointer;
  transition: transform .1s ease, opacity .15s ease;
}
.button:active { transform: translateY(1px); }
.button:disabled { cursor: not-allowed; opacity: .55; }
.button-primary { background: #111; color: #fff; }
.button-secondary { background: #fff; color: #111; }
.button-full { width: 100%; margin-top: 18px; }

.message {
  margin-top: 16px;
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 14px;
  line-height: 1.45;
  background: #f5f5f5;
  overflow-wrap: anywhere;
}
.message.error { background: #fff0f0; color: #9d1010; border: 1px solid #f2cccc; }
.message.info { background: #f5f5f5; color: #333; border: 1px solid #e2e2e2; }

.result {
  margin-top: 22px;
  padding-top: 22px;
  border-top: 1px solid #e5e5e5;
  text-align: center;
}
.result-title { font-size: 13px; font-weight: 900; letter-spacing: .14em; }
.qr-box {
  width: fit-content;
  max-width: 100%;
  margin: 16px auto 0;
  padding: 12px;
  background: #fff;
  border: 1px solid #e6e6e6;
  border-radius: 12px;
}
.qr-box img, .qr-box canvas { display: block; max-width: 100%; height: auto !important; }
.result-count { margin: 12px 0 0; font-weight: 700; }
.qr-value-wrap { margin-top: 14px; text-align: left; }
.qr-value-label { color: #777; font-size: 12px; margin-bottom: 5px; }
.qr-value {
  padding: 10px 12px;
  border-radius: 10px;
  background: #f5f5f5;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
  line-height: 1.45;
  overflow-wrap: anywhere;
  user-select: all;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 370px) {
  .card { padding-inline: 16px; }
  .actions { grid-template-columns: 1fr; }
}
