:root {
  color-scheme: light;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #0f172a;
  background: #f8fafc;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-width: 320px;
  background: #f8fafc;
}

.access-gate {
  width: min(100%, 480px);
  margin: 0 auto;
  padding: max(48px, env(safe-area-inset-top)) 18px;
}

.access-gate form { margin-top: 15vh; }
.access-gate button { width: 100%; margin-top: 20px; color: #fff; background: #1d4ed8; }

.shell {
  width: min(100%, 760px);
  margin: 0 auto;
  padding: max(24px, env(safe-area-inset-top)) 18px max(36px, env(safe-area-inset-bottom));
}

header { margin-bottom: 24px; }
.eyebrow { margin: 0 0 8px; color: #1d4ed8; font-size: 14px; font-weight: 800; letter-spacing: .08em; }
h1 { margin: 0; font-size: clamp(32px, 9vw, 48px); line-height: 1.05; }
.intro { margin: 14px 0 0; color: #475569; line-height: 1.55; }

form, .summary, .candidate, .status, .error {
  border: 1px solid #e2e8f0;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 8px 28px rgba(15, 23, 42, .06);
}

form { padding: 20px; }
label { display: block; margin: 0 0 9px; font-size: 16px; font-weight: 750; }
label:not(:first-child) { margin-top: 20px; }
label span { color: #64748b; font-size: 13px; font-weight: 500; }

input, textarea {
  display: block;
  width: 100%;
  min-height: 54px;
  border: 1px solid #cbd5e1;
  border-radius: 13px;
  padding: 14px;
  font: inherit;
  font-size: 16px;
  background: #fff;
}

textarea { resize: vertical; }
input:focus, textarea:focus { border-color: #2563eb; outline: 3px solid rgba(37, 99, 235, .15); }
#source-image { position: absolute; width: 1px; height: 1px; overflow: hidden; opacity: 0; }

.or {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 20px 0;
  color: #94a3b8;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .12em;
}
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: #e2e8f0; }
.file-button {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 56px;
  margin: 0;
  border: 1px dashed #2563eb;
  border-radius: 14px;
  color: #1d4ed8;
  background: #eff6ff;
  cursor: pointer;
}
.image-preview { margin-top: 14px; }
.image-preview img {
  display: block;
  width: 100%;
  max-height: 360px;
  object-fit: contain;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  background: #f1f5f9;
}
#remove-image { width: 100%; min-height: 48px; margin-top: 10px; color: #991b1b; background: #fee2e2; }

button {
  min-height: 56px;
  border: 0;
  border-radius: 14px;
  padding: 14px 18px;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  touch-action: manipulation;
}

#analyze-button, #approve-button { width: 100%; margin-top: 22px; color: #fff; background: #1d4ed8; }
#reject-button { width: 100%; margin-top: 12px; color: #991b1b; background: #fee2e2; }
button:disabled { cursor: wait; opacity: .65; }

.status, .error, .summary, .candidate { margin-top: 18px; padding: 18px; }
.status { display: flex; align-items: center; gap: 12px; }
.error { border-color: #fecaca; color: #991b1b; background: #fff7f7; }
.hidden { display: none !important; }

.spinner {
  width: 22px;
  height: 22px;
  border: 3px solid #bfdbfe;
  border-top-color: #1d4ed8;
  border-radius: 50%;
  animation: spin .8s linear infinite;
}

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

.summary h2, .candidate h3 { margin: 0 0 12px; }
.meta { display: grid; gap: 8px; margin: 0; }
.meta div { overflow-wrap: anywhere; }
.label { color: #64748b; font-size: 12px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.candidate { position: relative; padding-left: 58px; }
.candidate-select { position: absolute; top: 20px; left: 18px; width: 25px; height: 25px; }
.candidate p { margin: 10px 0 0; line-height: 1.5; white-space: pre-line; }
.candidate .hashtags { color: #1d4ed8; }
.decision { margin-top: 18px; }

@media (min-width: 700px) {
  .shell { padding-left: 28px; padding-right: 28px; }
  form, .summary, .candidate { padding: 24px; }
  .candidate { padding-left: 68px; }
  .candidate-select { left: 24px; top: 24px; }
}
