:root {
  --bg: #ffffff;
  --panel: #f8f9fa;
  --ink: #212529;
  --muted: #6c757d;
  --brand: #E60023;
  --accent: #E60023;
  --danger: #dc3545;
  --radius: 16px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, 'Fira Sans', 'Droid Sans', Helvetica, Arial, 'Apple Color Emoji','Segoe UI Emoji';
  background: var(--bg);
  color: var(--ink);
}

.wrap {
  max-width: 1200px;
  margin: 32px auto;
  padding: 24px;
}
.grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 24px;
}

.card {
  background: var(--panel);
  border: 1px solid rgba(0,0,0,0.1);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

h1 {
  font-size: 28px;
  margin: 0 0 8px;
}

p.lead {
  color: var(--muted);
  margin-top: 0;
}

label {
  display: block;
  font-weight: 600;
  margin: 14px 0 6px;
}

input, textarea, select {
  width: 100%;
  background: white;
  border: 1px solid #dee2e6;
  color: var(--ink);
  border-radius: 10px;
  padding: 10px 12px;
  outline: none;
  transition: border .2s, box-shadow .2s;
}

input:focus, textarea:focus, select:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(230,0,35,.1);
}

textarea {
  min-height: 110px;
  resize: vertical;
}

.row {
  display: grid;
  gap: 12px;
  grid-template-columns: 1fr 1fr;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  border: 1px solid transparent;
  background: var(--brand);
  color: white;
  padding: 10px 14px;
  border-radius: 12px;
  font-weight: 700;
  text-decoration: none;
  transition: transform .06s ease-in-out, filter .2s;
}

.btn:hover {
  filter: brightness(1.05);
}

.btn:active {
  transform: translateY(1px);
}

.btn.secondary {
  background: #6c757d;
  border-color: #6c757d;
  color: white;
  font-weight: 600;
}

.btn.ghost {
  background: transparent;
  border-color: #dee2e6;
  color: var(--ink);
}

.btn.danger {
  background: var(--danger);
}

.stack {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.out {
  background: #f8f9fa;
  border: 1px dashed #dee2e6;
  padding: 10px;
  border-radius: 12px;
  word-break: break-all;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}

.muted {
  color: var(--muted);
  font-size: 13px;
}

.pill {
  font-size: 12px;
  padding: 2px 8px;
  border: 1px solid #dee2e6;
  border-radius: 999px;
  color: var(--muted);
  background: white;
}

details {
  margin-top: 10px;
}

.center {
  text-align: center;
}

.hide {
  display: none;
}

.ok {
  color: var(--accent);
  font-weight: 700;
}

.warn {
  color: #ffc107;
  font-weight: 700;
}

/* Stores page specific styles */
.stores {
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 12px;
}

.stores a {
  display: inline-flex;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(0,0,0,0.1);
  background: white;
}

.stores img {
  display: block;
  height: 56px;
}

.custom {
  margin-top: 16px;
  display: flex;
  gap: 8px;
}

.custom input {
  flex: 1;
  background: white;
  border: 1px solid #dee2e6;
  color: var(--ink);
  border-radius: 10px;
  padding: 10px 12px;
  outline: none;
}

.custom .btn {
  background: var(--brand);
  color: white;
  border: none;
  border-radius: 10px;
  padding: 10px 14px;
  font-weight: 700;
  cursor: pointer;
}

@media (max-width: 900px) {
  .grid {
    grid-template-columns: 1fr;
  }
}

/* Language switcher styles */
.lang-switcher {
  position: absolute;
  top: 24px;
  right: 24px;
  z-index: 1000;
}

.lang-dropdown {
  position: relative;
  display: inline-block;
}

.lang-btn {
  background: white;
  border: 1px solid #dee2e6;
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 14px;
  font-weight: 500;
  color: var(--ink);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.lang-btn:hover {
  border-color: var(--brand);
  box-shadow: 0 0 0 2px rgba(230,0,35,.1);
}

.arrow {
  font-size: 10px;
  transition: transform 0.2s;
}

.lang-options {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 4px;
  background: white;
  border: 1px solid #dee2e6;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  min-width: 140px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: all 0.2s;
}

.lang-options.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.lang-option {
  display: block;
  padding: 10px 16px;
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid #f8f9fa;
  transition: background-color 0.2s;
}

.lang-option:last-child {
  border-bottom: none;
}

.lang-option:hover {
  background-color: #f8f9fa;
}

.lang-option.active {
  background-color: var(--brand);
  color: white;
}

/* QR Open Container and Button */
.qr-open-container {
  width: 100%;
  text-align: center;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid #dee2e6;
}

.qr-open-container p {
  margin: 0 0 12px 0;
  color: var(--muted);
  font-size: 0.9em;
}

#qrOpenButton {
  width: 100%;
  justify-content: center;
  margin-top: 8px;
}

/* Make wrap relative for absolute positioning of language switcher */
.wrap {
  position: relative;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.status-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin: 8px 0 12px;
}

.spinner {
  width: 28px;
  height: 28px;
  border: 3px solid #dee2e6;
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}
