:root {
  --tr-red: #e30a17;
  --tr-red-dark: #b00811;
  --bg: #fafafa;
  --card: #ffffff;
  --text: #1a1a1a;
  --muted: #6b6b6b;
  --ok: #2e7d32;
  --err: #c62828;
  --border: #e6e6e6;
  --shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  font-size: 16px;
}

#app {
  min-height: 100vh;
  max-width: 640px;
  margin: 0 auto;
  padding: env(safe-area-inset-top) 16px env(safe-area-inset-bottom);
}

.loader {
  text-align: center;
  padding-top: 30vh;
}

.loader .logo {
  font-size: 64px;
  margin-bottom: 12px;
}

button, .btn {
  display: inline-block;
  padding: 12px 20px;
  border: none;
  border-radius: 12px;
  background: var(--tr-red);
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
  width: 100%;
  margin: 6px 0;
  transition: background 0.15s;
}

button:active, .btn:active { background: var(--tr-red-dark); }

button.secondary, .btn.secondary {
  background: #fff;
  color: var(--tr-red);
  border: 2px solid var(--tr-red);
}

input, textarea {
  width: 100%;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 16px;
  background: #fff;
  color: var(--text);
  margin: 6px 0;
}

.card {
  background: var(--card);
  border-radius: 14px;
  padding: 16px;
  margin: 12px 0;
  box-shadow: var(--shadow);
}

.muted { color: var(--muted); }
.ok { color: var(--ok); }
.err { color: var(--err); }

h1 { font-size: 22px; margin: 16px 0 8px; }
h2 { font-size: 18px; margin: 14px 0 6px; }

.row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.row > * { flex: 1; }

.badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  background: #fff3e0;
  color: #b00811;
  font-size: 13px;
  font-weight: 600;
}

.overlay {
  position: fixed;
  inset: 0;
  background: rgba(255, 255, 255, 0.92);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 24px;
  text-align: center;
}

.spinner {
  width: 64px;
  height: 64px;
  border: 6px solid #f0f0f0;
  border-top-color: var(--tr-red);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
  margin-bottom: 18px;
}

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

.overlay-msg {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 4px;
}

.overlay-sub {
  color: var(--muted);
  font-size: 14px;
  max-width: 320px;
}

.progress-track {
  width: 80%;
  max-width: 320px;
  height: 6px;
  background: #f0f0f0;
  border-radius: 3px;
  margin-top: 16px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  width: 0%;
  background: var(--tr-red);
  transition: width 0.2s linear;
}
