:root {
  --navy: #0b2e33;
  --teal: #028090;
  --sea: #00a896;
  --mint: #02c39a;
  --bg: #f4fbfa;
  --text: #17393d;
  --border: #d5ede9;
  --white: #ffffff;
  --danger: #a32d2d;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}

.site-header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px 24px;
  background: var(--navy);
  color: var(--white);
}
.site-header .logo {
  width: 56px;
  height: 56px;
  border-radius: 12px;
  flex-shrink: 0;
}
.site-header h1 {
  margin: 0;
  font-size: 22px;
}
.site-header .tagline {
  margin: 2px 0 0;
  font-size: 14px;
  color: var(--mint);
}

main {
  max-width: 640px;
  margin: 0 auto;
  padding: 24px 20px 80px;
}

.step {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 20px;
}
.step h2 {
  margin-top: 0;
  font-size: 18px;
  color: var(--navy);
}
.step h3 {
  margin: 0 0 6px;
  font-size: 15px;
  color: var(--navy);
}
.hint {
  font-size: 14px;
  color: #3d5a5e;
  margin-top: 4px;
}

.capture-controls {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 16px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 18px;
  border-radius: 8px;
  border: none;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
}
.btn-primary {
  background: var(--teal);
  color: var(--white);
}
.btn-primary:hover { background: #026e7a; }
.btn-secondary {
  background: var(--white);
  color: var(--teal);
  border: 1.5px solid var(--teal);
}
.btn-secondary:hover { background: #e8f7f4; }
.btn-wide {
  width: 100%;
  margin-top: 16px;
}
.btn[disabled] {
  opacity: 0.55;
  cursor: not-allowed;
}

.preview-wrap {
  margin-top: 16px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border);
}
.preview-wrap img {
  display: block;
  width: 100%;
  max-height: 360px;
  object-fit: contain;
  background: #eee;
}

.status {
  font-size: 14px;
  margin-top: 12px;
  min-height: 20px;
}
.status.error { color: var(--danger); font-weight: 600; }
.status.busy { color: var(--teal); }

textarea#text-review {
  width: 100%;
  margin-top: 12px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 15px;
  font-family: inherit;
  resize: vertical;
}

.review-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 6px;
}
.char-count {
  font-size: 12px;
  color: #6b8a8e;
}

.output-card {
  border-top: 1px solid var(--border);
  padding-top: 16px;
  margin-top: 16px;
}
.output-card:first-of-type {
  border-top: none;
  padding-top: 0;
  margin-top: 0;
}

.output-actions {
  display: flex;
  gap: 12px;
  margin-top: 12px;
  flex-wrap: wrap;
}

.braille-preview {
  margin-top: 12px;
  padding: 14px;
  background: #eef8f6;
  border-radius: 8px;
  font-size: 22px;
  line-height: 2;
  word-break: break-word;
  min-height: 48px;
}

#step-restart {
  background: none;
  border: none;
  padding: 0;
  text-align: center;
}

.site-footer {
  text-align: center;
  font-size: 12.5px;
  color: #6b8a8e;
  padding: 0 24px 32px;
}

@media (min-width: 480px) {
  .capture-controls .btn { flex: 1; }
}
