:root {
  --bg: #0f1115;
  --card: #1a1d24;
  --card-border: #2a2e38;
  --accent: #5b8def;
  --accent-dim: #3a5da8;
  --text: #f2f3f5;
  --text-dim: #9aa1ac;
  --success: #3ecf8e;
  --danger: #e6584f;
  --radius: 16px;
}
* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}
html,
body {
  margin: 0;
  padding: 0;
}
body {
  background: var(--bg);
  color: var(--text);
  font-family:
    -apple-system, BlinkMacSystemFont, "Pretendard", "Apple SD Gothic Neo",
    "Segoe UI", Roboto, sans-serif;
  min-height: 100vh;
  padding: max(20px, env(safe-area-inset-top)) 16px
    max(24px, env(safe-area-inset-bottom));
  display: flex;
  justify-content: center;
}
.app {
  width: 100%;
  max-width: 480px;
  padding: 30px;
}
header {
  text-align: center;
  margin-bottom: 20px;
}
header h1 {
  font-size: 20px;
  margin: 0 0 4px;
  font-weight: 700;
}
header p {
  font-size: 13px;
  color: var(--text-dim);
  margin: 0;
}

.card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 14px;
}

.capture-zone {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 28px 16px;
  text-align: center;
}
.capture-zone.has-image {
  border-style: solid;
  padding: 12px;
}
.capture-zone img {
  max-width: 100%;
  border-radius: 12px;
  display: block;
}
.capture-icon {
  font-size: 40px;
}
.capture-zone p {
  margin: 0;
  color: var(--text-dim);
  font-size: 13px;
  line-height: 1.5;
}

button {
  font-family: inherit;
  border: none;
  border-radius: 12px;
  padding: 14px 18px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
}
.btn-primary {
  background: var(--accent);
  color: #fff;
}
.btn-primary:active {
  background: var(--accent-dim);
}
.btn-secondary {
  background: #252932;
  color: var(--text);
  border: 1px solid var(--card-border);
}
.btn-secondary:active {
  background: #2f333e;
}
.btn-row {
  display: flex;
  gap: 10px;
  margin-top: 12px;
}
.btn-row button {
  flex: 1;
}
button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.progress-wrap {
  margin-top: 14px;
}
.progress-label {
  font-size: 13px;
  color: var(--text-dim);
  margin-bottom: 6px;
  display: flex;
  justify-content: space-between;
}
.progress-bar {
  height: 8px;
  background: #2a2e38;
  border-radius: 999px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: var(--accent);
  width: 0%;
  transition: width 0.2s ease;
}

.field {
  margin-bottom: 14px;
}
.field:last-child {
  margin-bottom: 0;
}
.field label {
  display: block;
  font-size: 12px;
  color: var(--text-dim);
  margin-bottom: 6px;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.field-row {
  display: flex;
  gap: 8px;
}
.field-row input {
  flex: 1;
  background: #12151b;
  border: 1px solid var(--card-border);
  color: var(--text);
  padding: 12px 14px;
  border-radius: 10px;
  font-size: 15px;
  font-family: inherit;
  min-width: 0;
}
.field-row input:focus {
  outline: none;
  border-color: var(--accent);
}
.copy-btn {
  width: auto;
  flex-shrink: 0;
  padding: 0 16px;
  background: #252932;
  color: var(--text);
  border: 1px solid var(--card-border);
  font-size: 13px;
  display: flex;
  align-items: center;
}
.copy-btn.copied {
  background: var(--success);
  color: #06251a;
  border-color: var(--success);
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%) translateY(20px);
  background: #252932;
  color: var(--text);
  padding: 12px 18px;
  border-radius: 12px;
  font-size: 13px;
  border: 1px solid var(--card-border);
  opacity: 0;
  pointer-events: none;
  transition:
    opacity 0.2s ease,
    transform 0.2s ease;
  max-width: 90%;
  text-align: center;
  z-index: 50;
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.hint {
  font-size: 12px;
  color: var(--text-dim);
  line-height: 1.6;
  margin-top: 10px;
}
.raw-toggle {
  font-size: 12px;
  color: var(--accent);
  background: none;
  border: none;
  padding: 0;
  width: auto;
  text-decoration: underline;
  margin-top: 10px;
}
.raw-text {
  margin-top: 10px;
  background: #12151b;
  border: 1px solid var(--card-border);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 12px;
  color: var(--text-dim);
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 160px;
  overflow-y: auto;
  display: none;
}
.raw-text.show {
  display: block;
}

input[type="file"] {
  display: none;
}
.section-title {
  font-size: 14px;
  font-weight: 700;
  margin: 0 0 10px;
}
.badge {
  display: inline-block;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(91, 141, 239, 0.15);
  color: var(--accent);
  margin-left: 6px;
  font-weight: 600;
}
