:root {
  color-scheme: light;
  --ink: #17243d;
  --muted: #667085;
  --green: #299a62;
  --green-dark: #197548;
  --green-pale: #eaf7f0;
  --navy: #21304e;
  --border: #dbe3df;
  --surface: #ffffff;
  --background: #f8fbf9;
  --danger: #b42318;
  --danger-pale: #fff0ee;
  --warning: #9a6700;
  --warning-pale: #fff8e5;
  --shadow: 0 12px 35px rgba(23, 36, 61, 0.09);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--background);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
button, input { font: inherit; }
.header {
  border-bottom: 1px solid var(--border);
  background: rgba(255,255,255,.96);
  position: sticky;
  top: 0;
  z-index: 10;
}
.header-inner {
  max-width: 480px;
  margin: auto;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
#brand { color: var(--navy); font-size: 17px; letter-spacing: -.02em; }
.secure-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  background: var(--green-pale);
  color: var(--green-dark);
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}
.container { width: 100%; max-width: 480px; margin: auto; padding: 28px 20px 64px; }
h1 { margin: 0; font-size: 27px; line-height: 1.14; letter-spacing: -.035em; }
h2 { margin: 14px 0 0; font-size: 21px; }
p { line-height: 1.55; }
.intro { color: var(--muted); font-size: 15px; margin: 12px 0 0; }
.loading { padding: 72px 0; text-align: center; color: var(--muted); }
.spinner {
  display: inline-block;
  width: 30px;
  height: 30px;
  border: 3px solid #dbeee3;
  border-top-color: var(--green);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.actions { display: grid; gap: 12px; margin-top: 26px; }
.button {
  border: 0;
  min-height: 56px;
  border-radius: 14px;
  padding: 14px 18px;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 9px;
  cursor: pointer;
  font-weight: 800;
  font-size: 16px;
  transition: transform .08s ease, opacity .15s ease;
}
.button:active { transform: translateY(1px); }
.button:disabled { cursor: not-allowed; opacity: .48; }
.button-primary { color: white; background: linear-gradient(135deg, var(--green-dark), var(--green)); box-shadow: 0 8px 20px rgba(41,154,98,.2); }
.button-secondary { color: var(--navy); background: white; border: 1px solid var(--border); }
.button-danger { color: var(--danger); background: var(--danger-pale); border: 1px solid #ffd5d0; }
.hint { margin: 12px 0 0; color: var(--muted); text-align: center; font-size: 12px; }
.offline, .error-inline {
  margin-top: 16px;
  border-radius: 12px;
  padding: 11px 13px;
  font-size: 14px;
}
.offline { color: var(--warning); background: var(--warning-pale); border: 1px solid #f2d98b; }
.error-inline { color: var(--danger); background: var(--danger-pale); border: 1px solid #ffd5d0; }
.photo-grid { list-style: none; padding: 0; margin: 24px 0 0; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.photo {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: white;
  box-shadow: var(--shadow);
}
.preview {
  height: 150px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #eef3f0;
  color: var(--muted);
}
.preview img { width: 100%; height: 100%; object-fit: cover; }
.file-placeholder { padding: 15px; text-align: center; font-size: 13px; overflow-wrap: anywhere; }
.remove {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  background: rgba(23,36,61,.88);
  color: white;
  cursor: pointer;
  font-size: 18px;
}
.photo-meta { min-height: 48px; padding: 9px 10px; font-size: 12px; }
.ok { color: var(--green-dark); font-weight: 800; }
.bad { color: var(--danger); font-weight: 700; }
.progress { height: 7px; overflow: hidden; border-radius: 99px; background: #e8eeeb; margin-bottom: 6px; }
.progress span { display: block; height: 100%; width: 0; background: var(--green); transition: width .15s linear; }
.finish { width: 100%; margin-top: 28px; }
.state-card {
  margin-top: 18px;
  padding: 28px 22px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: white;
  text-align: center;
  box-shadow: var(--shadow);
}
.state-icon {
  width: 52px;
  height: 52px;
  margin: auto;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--green-pale);
  color: var(--green-dark);
  font-size: 24px;
  font-weight: 900;
}
.state-card.warning .state-icon { background: var(--warning-pale); color: var(--warning); }
.state-card.danger .state-icon { background: var(--danger-pale); color: var(--danger); }
.state-card p { color: var(--muted); font-size: 14px; }
.privacy { margin: 30px 0 0; text-align: center; color: var(--muted); font-size: 12px; }
.gallery { display: grid; gap: 14px; margin-top: 24px; }
.gallery a { display: block; overflow: hidden; border-radius: 16px; border: 1px solid var(--border); background: white; box-shadow: var(--shadow); }
.gallery img { display: block; width: 100%; max-height: 520px; object-fit: contain; background: #eef3f0; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }
@media (max-width: 370px) {
  .secure-badge { font-size: 10px; padding: 5px 8px; }
  .photo-grid { grid-template-columns: 1fr; }
}
