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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Hiragino Sans', 'Segoe UI', sans-serif;
  background: #f5f5f5;
  color: #2d3748;
  min-height: 100vh;
  -webkit-text-size-adjust: 100%;
}

.header {
  background: #2c5282;
  color: #fff;
  padding: max(16px, env(safe-area-inset-top)) 20px 16px;
  text-align: center;
  font-size: 18px;
  font-weight: 700;
}

.container {
  max-width: 480px;
  margin: 0 auto;
  padding: 20px 20px calc(24px + env(safe-area-inset-bottom));
}

.screen[hidden] { display: none; }

.lead { font-size: 16px; margin-bottom: 16px; }
.muted { color: #718096; font-size: 14px; }
.hint {
  color: #744210;
  background: #fffbea;
  border: 1px solid #f6e05e;
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 14px;
  margin: 12px 0;
}

.account {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 13px;
  color: #718096;
  margin-bottom: 16px;
  word-break: break-all;
}

.btn {
  display: block;
  width: 100%;
  padding: 16px;
  border: none;
  border-radius: 10px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  margin: 12px 0;
  font-family: inherit;
}
.btn-primary { background: #2c5282; color: #fff; }
.btn-primary:active { background: #1a365d; }
.btn-secondary { background: #e2e8f0; color: #2d3748; }
.btn-secondary:active { background: #cbd5e0; }
.btn:disabled { background: #a0aec0; color: #fff; cursor: not-allowed; }

.link {
  background: none;
  border: none;
  color: #2c5282;
  font-size: 13px;
  text-decoration: underline;
  cursor: pointer;
  padding: 4px;
  font-family: inherit;
  flex-shrink: 0;
}

.preview { text-align: center; }
.preview img {
  max-width: 100%;
  max-height: 45vh;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

.notice {
  border-radius: 10px;
  padding: 14px 16px;
  margin: 12px 0;
  font-size: 14px;
  line-height: 1.6;
}
.notice p + p { margin-top: 6px; }
.notice-error { background: #fff5f5; color: #9b2c2c; border: 1px solid #feb2b2; }
.notice-success { background: #f0fff4; color: #276749; border: 1px solid #9ae6b4; }
.notice ul { margin: 8px 0 0 20px; }

.spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid #2c5282;
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  vertical-align: middle;
  margin-right: 8px;
}
@keyframes spin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
  .spinner { animation-duration: 3s; }
}
