html {
  -webkit-overflow-scrolling: touch;
}

body.offline .write-form {
  opacity: 0.6;
}

.offline form button {
  opacity: 0.5;
  pointer-events: none;
}

.close-details {
  background: none;
  border: none;
  padding: 0;
  margin-top: 1rem;
  font-size: 0.8rem;
  color: #8a8a8a;
}

.muted.small {
  font-size: 0.85em;
}

.connections {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.draft-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
}

.draft-delete {
  background: none;
  border: none;
  color: #b00020;
  font-size: 0.85rem;
  cursor: pointer;
}

.connectivity-banner {
  position: sticky;
  top: 0;
  z-index: 1000;
  padding: 0.5rem 1rem;
  font-size: 0.85rem;
  text-align: center;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.connectivity-banner.offline {
  background: #fff3cd;
  color: #664d03;
  border-bottom: 1px solid #ffecb5;
}

.connectivity-banner.online {
  background: #e6f4ea;
  color: #0f5132;
  border-bottom: 1px solid #badbcc;
}

.connectivity-banner.hidden {
  opacity: 0;
  transform: translateY(-100%);
  pointer-events: none;
}

.draft-delete:hover {
  text-decoration: underline;
}

/* Incident list cards */

.incident-card {
  display: block;
  padding: 1.25rem;
  border-radius: 14px;
  background: #fafafa;
  text-decoration: none;
  color: inherit;
  transition: opacity 0.1s ease-out;
}

.incident-card:active {
  opacity: 0.88;
}

.incident-card strong {
  font-size: 1.05rem;
  font-weight: 500;
  display: block;
  margin-bottom: 0.4rem;
}

.incident-card .muted {
  font-size: 0.85rem;
  color: #6b6b6b;
}

.incident-list {
  display: grid;
  gap: 0.75rem;
}

.connection-meta .divider {
  margin: 0 0.4rem;
}

.add-connection {
  margin-top: 3rem;
  text-align: center;
}

.add-connection a {
  font-size: 0.85rem;
  color: #6b6b6b;
  text-decoration: none;
}

.back-link {
  display: inline-block;
  font-size: 0.8rem;
  color: #8a8a8a;
  text-decoration: none;
  margin-bottom: 1.5rem;
}

.page-header h3 {
  font-size: 1.3rem;
  font-weight: 500;
  margin-bottom: 0.5rem;
}

.page-header {
  margin-bottom: 1.5rem;
}

/* Buttons */

/* Buttons – app-like, touch friendly */

button,
.primary,
.secondary,
.secondary-button {
  display: inline-block;
  padding: 0.6rem 1rem;
  border-radius: 10px;
  font-size: 0.9rem;
  line-height: 1.2;
  cursor: pointer;
  text-decoration: none;
  border: none;
  transition: opacity 0.1s ease-out, transform 0.05s ease-out;
}

button:active,
.primary:active,
.secondary:active,
.secondary-button:active {
  opacity: 0.9;
  transform: translateY(1px);
}

.primary {
  background: #222;
  color: #fff;
}

.secondary,
.secondary-button {
  background: #f0f0f0;
  color: #333;
}

/* Details page */

/* Detail page cards */

.detail-card {
  background: #fafafa;
  border-radius: 14px;
  padding: 1rem;
  margin-bottom: 1rem;
}

.detail-card h5 {
  font-size: 0.95rem;
  font-weight: 500;
  margin-bottom: 0.75rem;
}
.detail-row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.6rem;
}

.detail-row strong {
  font-weight: 500;
}

.detail-row p {
  margin: 0;
}

.detail-card ul li {
  border-left: 2px solid #e5e5e5;
  padding-left: 0.6rem;
}


/* Empty / neutral state */

.card.muted {
  background: transparent;
  border: none;
  padding: 0;
}


/* Delete connection */

.delete-form {
  margin-top: 1rem;
  display: flex;
  gap: 1rem;
  align-items: center;
}

.danger-confirm {
  background: none;
  border: 1px solid rgba(0,0,0,0.25);
  padding: 0.4rem 0.8rem;
  font-size: 0.8rem;
}

.cancel-details {
  background: none;
  border: none;
  padding: 0;
  font-size: 0.8rem;
  color: #8a8a8a;
}

/* PHOTOS */
.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
  gap: 0.5rem;
}

.incident-photo {
  width: 100%;
  border-radius: 8px;
  display: block;
}

.photo-lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
}

.photo-lightbox img {
  max-width: 95%;
  max-height: 95%;
  border-radius: 6px;
}

.photo-lightbox-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: rgba(0,0,0,0.6);
  color: #fff;
  border: none;
  font-size: 1.2rem;
  padding: 0.4rem 0.6rem;
  border-radius: 6px;
  cursor: pointer;
}

.photo-lightbox.hidden {
  display: none;
}

/* ----------------------------------
   iOS Safe Area Support
---------------------------------- */

:root {
  --safe-top: env(safe-area-inset-top);
  --safe-bottom: env(safe-area-inset-bottom);
}

/* Base/physical page wrapper */
.page {
  padding-top: calc(var(--safe-top) + 1rem);
  padding-bottom: calc(var(--safe-bottom) + 1.25rem);
}

/* Reading column */
.content {
  max-width: 720px;
  margin: 0 auto;
  line-height: 1.6;
  padding: 0 1rem; /* subtle side breathing room */
  padding-bottom: 2rem;

}

/* ----------------------------------
   Vertical rhythm
---------------------------------- */

.content > * + * {
  margin-top: 1.25rem;
  
}


/* -------- Base -------- */

:root {
  --bg: #f5f6f7;
  --card-bg: #ffffff;
  --text: #1c1c1e;
  --muted: #6e6e73;
  --border: #e5e5ea;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI",
               Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}

/* ----------------------------------
   App Header
---------------------------------- */

.app-header {
  margin-bottom: 1.25rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid rgba(0,0,0,0.05);
}

.app-header h1 {
  font-size: 0.95rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #6b6b6b; /* muted */
  margin: 0;
}

.app-header + * {
  margin-top: 1.75rem;
}

/* -------- Layout -------- */

.container {
  max-width: 680px;
  margin: 0 auto;
  padding: 1rem;
}

/* -------- Cards -------- */

.card {
  background: var(--card-bg);
  border-radius: 16px;
  padding: 1rem 1.1rem;
  margin-bottom: 1rem;
  border: 1px solid var(--border);
  margin-top: 1.75rem;

}

/* -------- Typography -------- */

h2 {
  font-size: 1.4rem;
  margin: 0 0 0.25rem 0;
}

h5 {
  font-size: 1.05rem;
  margin: 0 0 0.75rem 0;
}

.small {
  font-size: 0.85rem;
  color: var(--muted);
}

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

/* -------- Lists -------- */

.list-unstyled {
  list-style: none;
  padding: 0;
  margin: 0;
}

/* -------- Forms -------- */

label {
  font-size: 0.85rem;
  color: var(--muted);
}

input,
select,
textarea {
  width: 100%;
  padding: 0.5rem 0.6rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  font-size: 0.95rem;
}

textarea {
  resize: vertical;
}



/* -------- Details / Collapsible -------- */

details > summary {
  cursor: pointer;
  font-size: 0.85rem;
  color: var(--muted);
}

details[open] > summary {
  margin-bottom: 0.5rem;
}

/* -------- Links -------- */

a {
  color: inherit;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* -------- Utilities -------- */

.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 1rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 1rem; }
.text-center { text-align: center; }


.page {
  padding: 1rem;
}

.page-header {
  margin-bottom: 1.5rem;
}
.page-header h3 {
  font-size: 1.3rem;
  font-weight: 500;
  margin-bottom: 0.5rem;
}

.page-header {
  margin-bottom: 1.5rem;
}

.page-header h2 {
  margin-bottom: 0.25rem;
}

.muted {
  color: #777;
  font-size: 0.9rem;
}

.form-group {
  margin-bottom: 1rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.25rem;
  font-weight: 500;
}

.form-group input {
  width: 100%;
  padding: 0.6rem;
  font-size: 1rem;
}

.form-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.list-item {
  border-bottom: 1px solid #eee;
}

.list-link {
  display: block;
  padding: 0.75rem 0;
  text-decoration: none;
  color: inherit;
}

.list-title {
  font-weight: 500;
}

.list-meta {
  display: block;
  font-size: 0.9rem;
  color: #777;
}

.empty-state {
  margin-top: 2rem;
}

.page-actions {
  margin-top: 1.5rem;
}

.primary-action {
  display: inline-block;
  padding: 0.6rem 1rem;
  text-decoration: none;
}


