*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --orange:       #ff6900;
  --orange-h:     #e65c00;
  --orange-s:     rgba(255,105,0,.15);
  --bg:           #f8f9fa;
  --surface:      #ffffff;
  --surface-h:    #f1f3f5;
  --border:       #e9ecef;
  --text:         #212529;
  --text-2:       #495057;
  --text-3:       #868e96;
  --green:        #12b886;
  --green-bg:     #e6fcf5;
  --green-br:     #63e6be;
  --red:          #fa5252;
  --red-bg:       #fff5f5;
  --red-br:       #ffa8a8;
  --amber:        #fd7e14;
  --amber-bg:     #fff4e6;
  --amber-br:     #ffd8a8;
  --radius:       14px;
  --radius-l:     24px;
  --shadow-sm:    0 2px 8px rgba(0,0,0,.04);
  --shadow-md:    0 8px 24px rgba(0,0,0,.06);
  --shadow-lg:    0 24px 48px rgba(0,0,0,.15);
  --overlay:      rgba(0,0,0,.4);
}

html { scroll-behavior: smooth; }

body {
  background-color: var(--bg);
  color: var(--text);
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background-image: radial-gradient(circle at 50% 0%, var(--orange-s), transparent 50%);
  background-repeat: no-repeat;
}

.page {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.25rem;
  padding-bottom: env(safe-area-inset-bottom, 2rem);
}

.inner {
  width: 100%;
  max-width: 440px;
  display: flex;
  flex-direction: column;
}

.header {
  text-align: center;
  margin-bottom: 2rem;
  animation: fadeUp .6s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.brand-icon {
  width: 46px;
  height: 46px;
  background: linear-gradient(135deg, var(--orange), #ff4500);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 14px var(--orange-s);
}
.brand-icon svg { width: 26px; height: 26px; }

.brand-name {
  font-size: 2.1rem;
  font-weight: 700;
  letter-spacing: -0.04em;
  color: var(--text);
}

.tagline {
  font-size: 0.95rem;
  color: var(--text-2);
  line-height: 1.5;
}

.badge {
  display: none;
  margin: 1rem auto 0;
  background-color: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  padding: 0.3rem 0.8rem;
  border-radius: 100px;
  font-weight: 500;
  box-shadow: var(--shadow-sm);
}

.card {
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-l);
  padding: 1.75rem;
  box-shadow: var(--shadow-md);
  animation: fadeUp .6s 0.1s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.field { margin-bottom: 1.25rem; }

.field-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.5rem;
}

.input-base {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  background-color: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 0.85rem 1rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.9rem;
  color: var(--text);
  outline: none;
  transition: all 0.2s ease;
}

.select-btn {
  cursor: pointer;
  text-align: left;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  -webkit-tap-highlight-color: transparent;
}

.select-btn:hover, .text-input:hover { border-color: var(--text-3); }
.select-btn:focus-visible, .text-input:focus {
  border-color: var(--orange);
  background-color: var(--surface);
  box-shadow: 0 0 0 4px var(--orange-s);
}
.select-btn.selected { border-color: var(--orange); }
.select-btn .ph { color: var(--text-3); font-family: 'Inter', sans-serif; }
.select-btn .val { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.chevron { width: 18px; height: 18px; color: var(--text-3); flex-shrink: 0; transition: transform 0.3s ease; }
.select-btn.open .chevron { transform: rotate(180deg); color: var(--orange); }

.text-input::placeholder { color: var(--text-3); font-family: 'Inter', sans-serif; }

.divider { height: 1px; background-color: var(--border); margin: 1.75rem 0; }

.verify-btn {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  padding: 1rem;
  background: linear-gradient(135deg, var(--orange), #fa5200);
  border: none;
  border-radius: var(--radius);
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 1rem;
  font-weight: 600;
  color: #fff;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 4px 12px var(--orange-s);
  -webkit-tap-highlight-color: transparent;
  outline: none;
  display: flex;
  justify-content: center;
  align-items: center;
}
.verify-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(255,105,0,.3);
}
.verify-btn:active:not(:disabled) { transform: translateY(0); }
.verify-btn:focus-visible { box-shadow: 0 0 0 4px var(--orange-s); }
.verify-btn:disabled { opacity: 0.6; cursor: not-allowed; }

.spinner {
  display: inline-block;
  width: 18px; height: 18px;
  border: 2.5px solid rgba(255,255,255,.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-right: 0.5rem;
}

.result {
  margin-top: 1.25rem;
  border-radius: var(--radius);
  padding: 1.25rem;
  display: none;
  flex-direction: column;
  gap: 1rem;
  animation: popIn .4s cubic-bezier(0.16, 1, 0.3, 1) both;
}
.result.show { display: flex; }

.result-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.result-icon {
  width: 24px; height: 24px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}
.result-icon svg { width: 14px; height: 14px; stroke-width: 3; }

.result-title { font-size: 1.1rem; font-weight: 700; letter-spacing: -0.01em; }

.result-meta {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  background: var(--surface);
  padding: 0.75rem;
  border-radius: 8px;
}
.result-row {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  display: flex;
  justify-content: space-between;
  border-bottom: 1px dashed var(--border);
  padding-bottom: 0.4rem;
}
.result-row:last-child { border-bottom: none; padding-bottom: 0; }
.rk { color: var(--text-3); }
.rv { color: var(--text); font-weight: 500; }

.result.global { background-color: var(--green-bg); border: 1px solid var(--green-br); }
.result.global .result-icon { background-color: var(--green); color: #fff; }
.result.global .result-title { color: var(--green); }

.result.regional { background-color: var(--amber-bg); border: 1px solid var(--amber-br); }
.result.regional .result-icon { background-color: var(--amber); color: #fff; }
.result.regional .result-title { color: var(--amber); }

.result.error { background-color: var(--red-bg); border: 1px solid var(--red-br); }
.result.error .result-icon { background-color: var(--red); color: #fff; }
.result.error .result-title { color: var(--red); }

.overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 100;
  background-color: var(--overlay);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  align-items: flex-end;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
}
.overlay.open { display: flex; opacity: 1; }

.sheet {
  background-color: var(--surface);
  width: 100%;
  max-width: 440px;
  height: 85vh;
  border-radius: 24px 24px 0 0;
  display: flex;
  flex-direction: column;
  transform: translateY(100%);
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  padding-bottom: env(safe-area-inset-bottom, 0px);
  box-shadow: var(--shadow-lg);
}
.overlay.open .sheet { transform: translateY(0); }

.sheet-header {
  padding: 1.25rem;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.sheet-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}
.sheet-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
}
.sheet-close {
  -webkit-appearance: none;
  appearance: none;
  width: 32px; height: 32px;
  background-color: var(--surface-h);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s ease;
}
.sheet-close:hover { background-color: var(--border); }

.sheet-search {
  width: 100%;
  background-color: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 0.8rem 1rem;
  font-family: 'Inter', sans-serif;
  font-size: 0.95rem;
  color: var(--text);
  outline: none;
  transition: border-color 0.2s ease;
}
.sheet-search:focus { border-color: var(--orange); }

.sheet-list {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  flex: 1;
  min-height: 0;
  padding: 0.5rem 0;
}

.sheet-list::-webkit-scrollbar { width: 6px; }
.sheet-list::-webkit-scrollbar-track { background: transparent; }
.sheet-list::-webkit-scrollbar-thumb { background-color: var(--border); border-radius: 10px; }

.list-msg {
  padding: 3rem 1.5rem;
  text-align: center;
  font-size: 0.9rem;
  color: var(--text-3);
}

.list-item {
  padding: 0.85rem 1.25rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.9rem;
  color: var(--text);
  cursor: pointer;
  transition: background-color 0.15s ease;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.list-item:hover { background-color: var(--surface-h); }
.list-item.active { background-color: var(--orange-s); color: var(--orange); font-weight: 600; }
.list-item mark { background: transparent; color: var(--orange); font-weight: bold; }

.footer {
  width: 100%;
  text-align: center;
  padding: 1.5rem 0;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.85rem;
}
.footer a {
  color: var(--text-3);
  text-decoration: none;
  transition: color 0.2s ease;
  border-bottom: 1px solid transparent;
  padding-bottom: 2px;
}
.footer a:hover {
  color: var(--orange);
  border-color: var(--orange);
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(15px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes popIn {
  from { opacity: 0; transform: scale(0.97); }
  to   { opacity: 1; transform: scale(1); }
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

@media (min-width: 640px) {
  .overlay { align-items: center; }
  .sheet {
    height: auto;
    max-height: 80vh;
    border-radius: var(--radius-l);
    transform: scale(0.95);
    opacity: 0;
  }
  .overlay.open .sheet {
    transform: scale(1);
    opacity: 1;
  }
}
