:root {
  color-scheme: light;
  --bg: #f5f7fb;
  --panel: #ffffff;
  --text: #172033;
  --muted: #64748b;
  --line: #dfe6ef;
  --brand: #2563eb;
  --ok: #16a34a;
  --warn: #f59e0b;
  --bad: #dc2626;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: Arial, Helvetica, sans-serif;
}

.shell {
  width: min(760px, 100%);
  margin: 0 auto;
  padding: 22px 16px 40px;
}

.hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .08em;
}

h1, h2 {
  margin: 0;
  letter-spacing: 0;
}

h1 { font-size: 28px; }
h2 { font-size: 18px; }

.badge, .state {
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 11px;
  background: #fff;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.panel, .result {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  box-shadow: 0 10px 28px rgba(15, 23, 42, .06);
  margin-bottom: 14px;
}

.photoBox {
  min-height: 178px;
  border: 2px dashed #bac7d8;
  border-radius: 8px;
  background: #f8fafc;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 22px;
  cursor: pointer;
}

.photoBox input { display: none; }
.photoBox strong { display: block; margin-top: 10px; font-size: 17px; }
.photoBox small { display: block; margin-top: 6px; color: var(--muted); line-height: 1.45; }

.photoIcon {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #eaf1ff;
  color: var(--brand);
  font-weight: 900;
}

.manual {
  margin-top: 16px;
}

.manual label {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  margin-bottom: 7px;
}

.manual input {
  width: 100%;
  height: 48px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 13px;
  color: var(--text);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 18px;
  font-weight: 800;
}

.primary {
  width: 100%;
  height: 48px;
  margin-top: 12px;
  border: 0;
  border-radius: 8px;
  background: var(--brand);
  color: #fff;
  font-size: 15px;
  font-weight: 900;
  cursor: pointer;
}

.primary:disabled {
  opacity: .6;
  cursor: not-allowed;
}

.status {
  min-height: 20px;
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.status.is-error { color: var(--bad); }
.status.is-ok { color: var(--ok); }

.resultHead {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.meter {
  height: 16px;
  overflow: hidden;
  border-radius: 999px;
  background: #e8edf5;
  margin: 16px 0 12px;
}

.meter div {
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: var(--ok);
  transition: width .25s ease;
}

.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.stats div {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  padding: 11px;
}

.stats span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  margin-bottom: 4px;
}

.stats strong {
  display: block;
  min-width: 0;
  font-size: 14px;
  overflow-wrap: anywhere;
}

@media (max-width: 520px) {
  .shell { padding-top: 16px; }
  h1 { font-size: 24px; }
  .hero { align-items: flex-start; }
  .stats { grid-template-columns: 1fr; }
}
