:root {
  color-scheme: light;
  --bg: #f7f8fa;
  --panel: #ffffff;
  --text: #172033;
  --muted: #667085;
  --line: #d6dbe3;
  --primary: #0f766e;
  --primary-dark: #0b5e58;
  --danger: #b42318;
  --ok: #087443;
}

* {
  box-sizing: border-box;
}

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

main {
  width: min(100%, 720px);
  margin: 0 auto;
  padding: 16px;
}

header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 8px 0 16px;
}

h1 {
  margin: 0;
  font-size: 24px;
  line-height: 1.15;
}

.status {
  color: var(--muted);
  font-size: 14px;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 14px;
}

.camera {
  overflow: hidden;
  border-radius: 8px;
  background: #111827;
  aspect-ratio: 4 / 3;
  border: 1px solid #0f172a;
}

video {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

label {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
}

input {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 16px;
  background: #ffffff;
  color: var(--text);
}

.grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.extra-fields {
  margin-top: 12px;
}

.actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 14px;
}

button {
  min-height: 46px;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 15px;
  font-weight: 750;
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

.primary {
  background: var(--primary);
  color: #ffffff;
}

.primary:active {
  background: var(--primary-dark);
}

.secondary {
  background: #ffffff;
  border-color: var(--line);
  color: var(--text);
}

.message {
  min-height: 24px;
  margin-top: 12px;
  font-weight: 650;
}

.message.ok {
  color: var(--ok);
}

.message.error {
  color: var(--danger);
}

.message.muted {
  color: var(--muted);
}

@media (min-width: 560px) {
  .grid.two {
    grid-template-columns: 1fr 1fr;
  }
}

