body {
  font-family: sans-serif;
  text-align: center;
  margin: 0;
  display: flex;
  flex-direction: column;
  height: 100vh;
}
main {
  padding: 2em;
  flex: 1;
  overflow-y: auto;
  padding: 1em;
  padding-bottom: 80px; /* space for tab bar */
}



/* --- Scan tab --- */
#preview {
  max-width: 300px;
  margin-top: 1em;
  border: 1px solid #ccc;
  border-radius: 8px;
}
#result, #cleaned, #matches, #alts {
  margin-top: 1em;
  background: #f5f5f5;
  padding: 1em;
  border-radius: 8px;
  white-space: pre-wrap;
  text-align: left;
}
.collapsible-header {
  width: 100%;
  background: #0077cc;
  color: white;
  padding: 10px;
  border: none;
  border-radius: 6px;
  font-size: 1em;
  text-align: left;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 1px;
}

.chevron {
  display: inline-block;
  transition: transform 0.2s ease;
  font-size: 0.8em;
}

/* Rotate down when open */
.chevron.open {
  transform: rotate(90deg);
}

.collapsible-content {
  max-height: 10px;
  overflow: hidden;
  background: #f5f5f5;
  border-radius: 6px;
  padding: 0 10px;
  transition: max-height 0.3s ease-out, padding 0.3s ease-out;
  margin-top: 5px;
}

.collapsible-content.open {
  padding: 10px;
  max-height: 800px;
}



/* --- Allergies tab --- */
.allergy-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  text-align: left;
  padding: 1em;
}

.allergy-item {
  display: flex;
  align-items: center;
  gap: 10px;
}

.allergy-item input {
  transform: scale(1.2);
}


  
/* --- Bottom Nav --- */
header {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 60px;
  background: #0077cc;
  display: flex;
  justify-content: space-evenly;
  gap: 5px;
  padding: 5px;
  align-items: stretch;
  color: white;
  box-shadow: 0 -2px 5px rgba(0, 0, 0, 0.1);
  z-index: 10;
}

header button {
  flex: 1;
  font-weight: 300;
  background: none;
  border:#f5f5f5;
  color: white;
  font-size: 1em;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

header button:hover,
header button:active,
header button:focus {
  background: #0077cc;
}

header button.active {
  font-weight: bold;
}

section {
  display: none;
}

section.active {
  display: block;
}