:root {
  color-scheme: light;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Segoe UI", sans-serif;
  background: #f5f7fb;
  color: #1f2937;
}
body {
  margin: 0;
  background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
}
.container {
  max-width: 1080px;
  margin: 0 auto;
  padding: 24px;
}
.card {
  background: #fff;
  border-radius: 14px;
  padding: 20px;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
  margin-bottom: 20px;
  border: 1px solid #e2e8f0;
}
h1,h2,h3 { margin-top: 0; }
h1 { font-size: 30px; }
h2 { font-size: 20px; }
label { display: block; margin-bottom: 8px; font-weight: 600; color: #334155; }
input, select, textarea, button {
  width: 100%;
  box-sizing: border-box;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid #cbd5e1;
  margin-bottom: 12px;
  font-size: 14px;
  transition: all 0.15s ease;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}
button {
  background: #2563eb;
  color: #fff;
  border: none;
  cursor: pointer;
  font-weight: 600;
}
button:hover { opacity: 0.94; }
button.secondary { background: #64748b; }
button.danger { background: #dc2626; }
.grid {
  display: grid;
  gap: 16px;
}
.grid.two { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.table-wrap { overflow-x: auto; }
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
th, td {
  border-bottom: 1px solid #e2e8f0;
  padding: 10px 8px;
  text-align: left;
  vertical-align: top;
}
th {
  background: #f8fafc;
  color: #334155;
  position: sticky;
  top: 0;
}
tr:hover td { background: #f8fafc; }
.badge {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  background: #dbeafe;
  color: #1d4ed8;
}
.badge.danger { background: #fee2e2; color: #b91c1c; }
.badge.warn { background: #fef3c7; color: #b45309; }
.badge.success { background: #dcfce7; color: #15803d; }
.message {
  padding: 10px 12px;
  border-radius: 8px;
  margin-bottom: 12px;
  background: #eef2ff;
}
.hidden { display: none; }
.inline-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.inline-actions button { width: auto; }
.nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}
.nav a { color: #2563eb; text-decoration: none; font-weight: 600; }
pre.result {
  background: #0f172a;
  color: #f8fafc;
  padding: 16px;
  border-radius: 12px;
  white-space: pre-wrap;
  word-break: break-all;
  line-height: 1.7;
  overflow-y: auto;
}
.public-shell {
  min-height: 100vh;
  background: radial-gradient(circle at top, #e0ecff 0%, #f8fbff 28%, #f3f6fb 100%);
  padding: 32px 16px 48px;
}
.public-container {
  max-width: 1100px;
  margin: 0 auto;
}
.hero-card {
  background: linear-gradient(135deg, #0f172a 0%, #1d4ed8 100%);
  color: #fff;
  border-radius: 24px;
  padding: 28px;
  margin-bottom: 20px;
  box-shadow: 0 20px 50px rgba(29, 78, 216, 0.2);
}
.hero-badge {
  display: inline-block;
  background: rgba(255,255,255,0.14);
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 13px;
  margin-bottom: 14px;
}
.hero-card h1 {
  margin-bottom: 8px;
  font-size: 40px;
}
.hero-subtitle {
  margin: 0;
  color: rgba(255,255,255,0.86);
  font-size: 16px;
}
.hero-actions {
  display: flex;
  gap: 10px;
  margin-top: 18px;
  flex-wrap: wrap;
}
.hero-action-btn {
  width: auto;
  padding: 10px 16px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.25);
  background: rgba(255,255,255,0.08);
  color: #fff;
}
.hero-action-btn.active {
  background: #fff;
  color: #1d4ed8;
  border-color: #fff;
}
.public-view.active { display: block; }
.query-card { margin-bottom: 20px; }
.result-actions { margin-bottom: 14px; }
.query-summary {
  margin-bottom: 14px;
  padding: 12px 14px;
  border-radius: 14px;
  background: #eff6ff;
  color: #1d4ed8;
  font-weight: 700;
}
.public-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 20px;
  margin-bottom: 20px;
}
.public-card {
  border-radius: 20px;
  padding: 24px;
}
.section-heading-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}
.stock-pill, .result-tip {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  border-radius: 999px;
  background: #dbeafe;
  color: #1d4ed8;
  font-size: 13px;
  font-weight: 600;
}
.product-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 18px;
}
.product-tab {
  width: auto;
  min-width: 180px;
  margin: 0;
  padding: 16px 18px;
  border-radius: 16px;
  border: 1px solid #dbe3f0;
  background: #fff;
  color: #0f172a;
  text-align: left;
}
.product-tab.active {
  border-color: #2563eb;
  background: linear-gradient(135deg, #eff6ff, #dbeafe);
  box-shadow: 0 12px 24px rgba(37, 99, 235, 0.16);
}
.tab-title {
  display: block;
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 6px;
}
.tab-subtitle {
  display: block;
  color: #64748b;
  font-size: 13px;
}
.product-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}
.meta-item {
  padding: 12px 14px;
  border-radius: 14px;
  background: #f8fafc;
  color: #475569;
}
.hint-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
  margin-bottom: 14px;
  border-radius: 14px;
  background: #f8fafc;
}
.quantity-hint {
  margin-top: -4px;
  margin-bottom: 14px;
  color: #64748b;
  font-size: 13px;
}
.hint-label {
  color: #64748b;
}
.hint-value {
  font-size: 24px;
  font-weight: 700;
  color: #1d4ed8;
}
.claim-button {
  height: 48px;
  font-size: 16px;
  border-radius: 14px;
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
}
.result-card .result {
  margin: 0;
  min-height: 120px;
  font-size: 18px;
  max-height: 420px;
}
.claim-expires {
  margin-bottom: 14px;
  padding: 14px 16px;
  border-radius: 14px;
  background: linear-gradient(135deg, #fee2e2, #fef3c7);
  color: #b91c1c;
  font-size: 18px;
  font-weight: 800;
  text-align: center;
  box-shadow: 0 8px 20px rgba(185, 28, 28, 0.12);
}
@media (max-width: 900px) {
  .public-grid {
    grid-template-columns: 1fr;
  }
  .hero-card h1 {
    font-size: 30px;
  }
}
.muted {
  color: #64748b;
  font-size: 13px;
}
.section-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
@media (max-width: 640px) {
  .container { padding: 16px; }
  h1 { font-size: 24px; }
}
