:root {
  --bg: #fff9fb;
  --card: #ffffff;
  --ink: #1f2a24;
  --muted: #5c6f66;
  --accent: #cfead6; /* soft green */
  --accent2: #f7cfe1; /* soft pink */
  --radius: 12px;
  --shadow: 0 6px 24px rgba(0, 0, 0, 0.08);
}

* {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
}
h1,
h2,
h3 {
  margin: 0 0 0.4rem;
}
p {
  margin: 0 0 0.6rem;
}
.help {
  color: var(--muted);
}

/* Header now has 3 columns: logo, copy, actions (install button) */
header {
  display: grid;
  grid-template-columns: 56px 1fr auto;
  gap: 12px;
  padding: 16px 18px;
  align-items: center;
  background: linear-gradient(90deg, var(--accent2), var(--accent));
  position: sticky;
  top: 0;
  z-index: 10;
}
.logo {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  font-size: 28px;
  background: #fff;
  border-radius: 50%;
  box-shadow: var(--shadow);
}
.head-copy {
  min-width: 0;
}
.sub {
  font-size: 0.9rem;
}

/* Right-aligned, subtle install button in header */
#installBtn.install {
  justify-self: end;
  background: #fff;
  border: 1px solid #e5e9e7;
  padding: 6px 12px;
  border-radius: 999px;
  box-shadow: var(--shadow);
  font-size: 0.95rem;
}

.sticky {
  position: sticky;
  top: 10px;
  margin: 10px 18px;
  z-index: 9;
}

.container {
  padding: 16px 18px;
}
.grid {
  display: grid;
  gap: 16px;
}
@media (min-width: 900px) {
  .grid {
    grid-template-columns: 1.3fr 1fr;
  }
}

.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px;
  display: grid;
  gap: 10px;
}

.inline {
  display: flex;
  align-items: center;
  gap: 10px;
}
.inline.spread {
  justify-content: space-between;
}
.inline.end {
  justify-content: flex-end;
}

.row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.row > div {
  min-width: 0;
  display: flex;
  flex-direction: column; /* ensure label above input consistently */
}

/* pill label */
.pill {
  background: #f4fbf7;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid #e0f2e7;
}
.spacer {
  height: 8px;
}

.banner {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-radius: var(--radius);
  background: #fff6f9;
  border: 1px dashed #f1b7cd;
  margin-bottom: 12px;
}

/* inputs normalized so rows align on iOS too */
button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
  background: #fff;
  border: 1px solid #e5e9e7;
  border-radius: 10px;
  padding: 8px 10px;
}
input,
select,
textarea {
  width: 100%;
} /* buttons NOT full width */

/* fix iOS time input sizing + style */
input[type="time"] {
  width: 100%;
  -webkit-appearance: none;
  appearance: none;
  text-align: center;
  padding: 8px 10px;
  border-radius: 10px;
}

button {
  cursor: pointer;
  background: var(--accent);
  border-color: #bfe2ca;
}
button:hover {
  filter: brightness(0.98);
}
button.ghost {
  background: #fff;
  border-color: #e5e9e7;
}
button.small {
  padding: 6px 10px;
  font-size: 0.9rem;
}
button.danger {
  background: #ffd8e7;
  border-color: #ffc5db;
}
textarea {
  min-height: 90px;
}

.species-figure {
  margin: 4px 0 8px;
  display: grid;
  gap: 6px;
}
.species-figure img {
  width: 100%;
  max-height: 300px;
  object-fit: contain;
  display: block;
  margin: 0 auto;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  background: #f7f7f7;
  cursor: zoom-in;
}
@media (min-width: 900px) {
  .species-figure img {
    max-height: 380px;
  }
}

ul {
  padding-left: 18px;
  margin: 0;
  display: grid;
  gap: 6px;
}
hr {
  border: none;
  border-top: 1px solid #eee;
  margin: 8px 0;
}

footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 12px 18px;
  color: var(--muted);
}
.badge {
  background: #f6fbf8;
  padding: 6px 10px;
  border-radius: 10px;
  border: 1px solid #e0f2e7;
}
.flex {
  display: flex;
  gap: 8px;
  align-items: center;
}

/* modal + toast */
.modalBack {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  align-items: center;
  justify-content: center;
  z-index: 50;
}
.modal {
  background: #fff;
  padding: 16px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  width: min(560px, 92vw);
  display: grid;
  gap: 10px;
}
.toast {
  position: fixed;
  bottom: 14px;
  left: 50%;
  transform: translateX(-50%);
  background: #222;
  color: #fff;
  padding: 10px 14px;
  border-radius: 999px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
  z-index: 60;
}
.toast.show {
  opacity: 1;
}
