/* Mobile-first. Large touch targets throughout — this is used one-handed,
   outdoors, by someone who is not a phone enthusiast. */

:root {
  --bg: #0d1014;
  --surface: #161b21;
  --surface-2: #1e252d;
  --line: #2a323c;
  --text: #eef2f6;
  --muted: #94a3b2;
  --accent: #c8102e;
  --radius: 14px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Noto Sans Devanagari", system-ui, -apple-system, sans-serif;
  font-size: 17px;
  line-height: 1.45;
  -webkit-text-size-adjust: 100%;
}

/* ---------- top bar ---------- */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: calc(env(safe-area-inset-top, 0px) + 14px) 16px 14px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 10;
}

.topbar h1 {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.topbar h1 span {
  color: var(--accent);
}

.icon-btn {
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--text);
  width: 46px;
  height: 46px;
  border-radius: 12px;
  font-size: 1.3rem;
  cursor: pointer;
}

.icon-btn:active { background: var(--line); }

/* ---------- layout ---------- */

.screen {
  display: block;
  padding: 16px 16px calc(env(safe-area-inset-bottom, 0px) + 32px);
  max-width: 560px;
  margin: 0 auto;
}

/* An author `display` rule beats the browser's built-in [hidden] styling,
   so hiding a screen with the hidden attribute silently does nothing
   unless we say this explicitly. */
[hidden] { display: none !important; }

/* ---------- mode tabs ---------- */

.tabs {
  display: flex;
  gap: 6px;
  padding: 5px;
  margin-bottom: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 13px;
}

.tab {
  flex: 1;
  padding: 12px 10px;
  border: none;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
}

.tab.is-active {
  background: var(--accent);
  color: #fff;
}

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

.row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.grow { flex: 1 1 160px; }

/* ---------- fields ---------- */

.field {
  display: block;
  margin-bottom: 16px;
}

.field:last-child { margin-bottom: 0; }

.label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 7px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

input[type="text"],
input[type="date"],
select,
textarea {
  width: 100%;
  padding: 13px 14px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 11px;
  color: var(--text);
  font-family: inherit;
  font-size: 1rem;
}

textarea {
  resize: vertical;
  min-height: 84px;
}

input[type="file"] {
  width: 100%;
  padding: 11px;
  background: var(--surface-2);
  border: 1px dashed var(--line);
  border-radius: 11px;
  color: var(--muted);
  font-family: inherit;
  font-size: 0.92rem;
}

input[type="color"] {
  width: 72px;
  height: 46px;
  padding: 3px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 11px;
}

input:focus, select:focus, textarea:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.hint, .note {
  display: block;
  margin-top: 7px;
  font-size: 0.82rem;
  color: var(--muted);
}

.explain {
  margin: 0 0 18px;
  font-size: 0.92rem;
  color: var(--muted);
}

.explain strong { color: var(--text); }

.warn {
  margin: 10px 0 0;
  font-size: 0.85rem;
  color: var(--muted);
}

/* ---------- preview ---------- */

.preview-wrap {
  display: flex;
  justify-content: center;
  background: var(--bg);
  border-radius: 10px;
  padding: 10px;
}

.preview {
  display: block;
  width: 100%;
  height: auto;
  max-height: 62vh;
  object-fit: contain;
  border-radius: 6px;
}

/* ---------- reporter photo preview ---------- */

.photo-row {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
}

.photo-preview {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--line);
}

.link-btn {
  background: none;
  border: none;
  color: var(--accent);
  font-family: inherit;
  font-size: 0.9rem;
  padding: 6px 0;
  cursor: pointer;
  text-decoration: underline;
}

/* ---------- actions ---------- */

.actions {
  display: flex;
  flex-direction: column;
  gap: 11px;
}

button.primary, button.secondary {
  width: 100%;
  padding: 17px;
  border-radius: 13px;
  font-family: inherit;
  font-size: 1.05rem;
  font-weight: 700;
  cursor: pointer;
  border: 1px solid transparent;
}

button.primary {
  background: var(--accent);
  color: #fff;
}

button.primary:active { filter: brightness(0.88); }

button.secondary {
  background: var(--surface-2);
  color: var(--text);
  border-color: var(--line);
}

button.secondary:active { background: var(--line); }

.actions .note {
  text-align: center;
  margin-top: 2px;
  min-height: 1.2em;
}

.version {
  opacity: 0.55;
  font-size: 0.75rem;
}
