:root {
  /* The Shed Studio brand palette */
  --bg: #f4f2ef;
  --text: #2b3a4f;
  --accent: #506a8d;
  --accent-dark: #2b3a4f;
  --border: #b2c4d9;
  --card-bg: #ffffff;
  --error-text: #a3401e;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

body {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 32px;
  padding: 32px 16px;
}

.logo {
  width: 100%;
  max-width: 380px;
  height: auto;
}

.screen {
  display: none;
  flex-direction: column;
  align-items: center;
  text-align: center;
  max-width: 700px;
  width: 100%;
  gap: 24px;
}

#language-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 28px;
  padding: 32px 16px;
  text-align: center;
}

.language-overlay-title {
  font-size: 30px;
  font-weight: 700;
  line-height: 1.4;
  margin: 0;
}

/* Show only the screen matching body[data-state] */
body[data-state="idle"] .screen[data-screen="idle"],
body[data-state="processing"] .screen[data-screen="processing"],
body[data-state="done"] .screen[data-screen="done"],
body[data-state="error"] .screen[data-screen="error"] {
  display: flex;
}

h1 {
  font-size: 44px;
  margin: 0;
  line-height: 1.2;
}

.instructions,
.status-text {
  font-size: 26px;
  line-height: 1.5;
  margin: 0;
}

.hidden-file-input {
  /* visually hidden but still focusable/usable, not display:none */
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.or-divider {
  font-size: 22px;
  color: var(--text);
  opacity: 0.7;
}

.save-instructions {
  width: 100%;
  background: var(--card-bg);
  border: 3px solid var(--accent);
  border-radius: 16px;
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.save-instructions-title {
  font-size: 26px;
  font-weight: 700;
  margin: 0 0 4px;
}

.save-instructions-step {
  font-size: 24px;
  line-height: 1.4;
  margin: 0;
  text-align: left;
}

.big-button {
  appearance: none;
  -webkit-appearance: none;
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  min-height: 64px;
  padding: 24px 40px;
  font-size: 30px;
  font-weight: 700;
  color: #ffffff;
  background: var(--accent);
  border: none;
  border-radius: 16px;
  cursor: pointer;
  text-decoration: none;
  min-width: 48px;
}

.big-button:hover,
.big-button:focus-visible {
  background: var(--accent-dark);
}

.big-button .icon {
  font-size: 34px;
}

.text-link {
  background: none;
  border: none;
  color: var(--accent);
  font-size: 24px;
  text-decoration: underline;
  cursor: pointer;
  padding: 16px;
  min-height: 48px;
}

.spinner {
  width: 72px;
  height: 72px;
  border: 8px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

#result-image {
  max-width: 100%;
  max-height: 60vh;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--card-bg);
}

.icon-large {
  font-size: 64px;
}

@media (max-width: 480px) {
  h1 {
    font-size: 34px;
  }
  .instructions,
  .status-text {
    font-size: 22px;
  }
  .big-button {
    font-size: 26px;
    padding: 20px 28px;
  }
  .save-instructions-title {
    font-size: 22px;
  }
  .save-instructions-step {
    font-size: 20px;
  }
}
