:root {
  /* Palette "terracotta" — noms de variables conservés (--green...) pour ne
     pas devoir retoucher chaque règle ci-dessous, mais les valeurs sont
     maintenant chaudes (terracotta/crème) plutôt que vertes. */
  --green: #c2673d;
  --green-dark: #8a4322;
  --green-light: #f2dcc0;
  --success-bg: #dfead0;
  --success-ink: #3c5a28;
  --ink: #2b2013;
  --muted: #79694f;
  --border: #ddc9a3;
  --bg: #f4e6d0;
  --card-bg: #ecdcc0;
  --danger: #b3412c;
  --radius: 14px;
  font-size: 16px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--ink);
  padding-bottom: 88px; /* laisse la place à la nav en bas sur mobile */
}

header.app-header {
  padding: 20px 20px 12px;
  background: var(--bg);
  position: sticky;
  top: 0;
  z-index: 5;
}

header.app-header h1 {
  margin: 0;
  font-size: 1.3rem;
  color: var(--green);
}

header.app-header p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 0.85rem;
}

main {
  max-width: 480px;
  margin: 0 auto;
  padding: 16px;
}

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

.card > *:first-child {
  margin-top: 0;
}

button, .btn {
  font: inherit;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--card-bg);
  color: var(--ink);
  padding: 10px 18px;
  cursor: pointer;
}

button.primary, .btn.primary {
  background: var(--green);
  border-color: var(--green);
  color: white;
  font-weight: 600;
}

button.primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

button.chip {
  padding: 8px 14px;
  font-size: 0.9rem;
}

button.chip[aria-pressed="true"] {
  background: var(--green);
  border-color: var(--green);
  color: white;
  font-weight: 600;
}

.chip-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 8px 0 16px;
}

label {
  display: block;
  font-weight: 600;
  font-size: 0.9rem;
  margin: 14px 0 14px;
}

input[type="text"], input[type="email"], input[type="number"], textarea, select {
  width: 100%;
  font: inherit;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--card-bg);
  color: var(--ink);
}

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

.helper-text {
  color: var(--muted);
  font-size: 0.82rem;
  margin-top: 4px;
}

.note-box {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: var(--bg);
  border-radius: 10px;
  padding: 12px 14px;
  margin-top: 10px;
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.4;
}

.note-box .note-icon {
  flex-shrink: 0;
}

.switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 26px;
  flex-shrink: 0;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.switch .slider {
  position: absolute;
  inset: 0;
  background: var(--border);
  border-radius: 999px;
  cursor: pointer;
  transition: background-color 0.15s;
}

.switch .slider::before {
  content: "";
  position: absolute;
  width: 20px;
  height: 20px;
  left: 3px;
  top: 3px;
  background: white;
  border-radius: 50%;
  transition: transform 0.15s;
}

.switch input:checked + .slider {
  background: var(--green);
}

.switch input:checked + .slider::before {
  transform: translateX(18px);
}

.switch input:disabled + .slider {
  opacity: 0.5;
  cursor: not-allowed;
}

.helper-text.error-text {
  color: var(--danger);
  font-weight: 600;
}

.alert-card {
  border-left: 4px solid var(--green);
}

.alert-card .type-badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--green-dark);
  background: var(--green-light);
  border-radius: 999px;
  padding: 2px 10px;
  margin-bottom: 6px;
}

.alert-card .commerce-name {
  font-weight: 700;
  font-size: 0.95rem;
}

.commerce-name {
  font-weight: 700;
  font-size: 0.95rem;
}

.photo-dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 22px;
  border: 2px dashed var(--border);
  border-radius: 14px;
  cursor: pointer;
  color: var(--muted);
  font-size: 0.85rem;
  text-align: center;
  margin-top: 6px;
}

.photo-dropzone .dropzone-icon {
  font-size: 1.4rem;
}

.eyebrow {
  text-transform: uppercase;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: 0.04em;
  margin: 0;
}

.badge-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--green);
  color: white;
  font-size: 0.72rem;
  font-weight: 700;
  margin-left: 6px;
  cursor: pointer;
  vertical-align: middle;
  border: none;
}

.distance-tag {
  font-style: italic;
  font-weight: 400;
  font-size: 0.78rem;
  color: var(--muted);
}

.alert-card .timestamp {
  color: var(--muted);
  font-size: 0.78rem;
}

.alert-card img.alert-photo {
  width: 100%;
  border-radius: 10px;
  margin-top: 8px;
}

.relance-actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

nav.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--bg);
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-around;
  padding: 8px 8px max(8px, env(safe-area-inset-bottom));
  z-index: 10;
}

nav.bottom-nav a {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  flex: 1;
  max-width: 200px;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.75rem;
  font-weight: 600;
  text-align: center;
  padding: 6px 10px;
}

nav.bottom-nav a .nav-icon {
  width: 22px;
  height: 22px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

nav.bottom-nav a.active {
  color: var(--green-dark);
}

.banner-ios {
  background: #fff6e6;
  border: 1px solid #f0d999;
  border-radius: var(--radius);
  padding: 14px;
  margin-bottom: 16px;
  display: none;
}

.banner-ios.visible { display: block; }

.banner-ios ol { margin: 8px 0 0; padding-left: 20px; font-size: 0.88rem; }
.banner-ios strong { color: #8a6100; }

.toast {
  position: fixed;
  top: 16px;
  left: 16px;
  right: 16px;
  max-width: 448px;
  margin: 0 auto;
  background: var(--green);
  color: white;
  padding: 12px 16px;
  border-radius: var(--radius);
  text-align: center;
  font-size: 0.9rem;
  font-weight: 600;
  z-index: 30;
  box-shadow: 0 4px 14px rgba(0,0,0,0.15);
}

.toast[hidden] { display: none; }

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

.empty-state {
  text-align: center;
  color: var(--muted);
  padding: 40px 20px;
}

.follow-btn {
  padding: 6px 14px;
  font-size: 0.85rem;
}

.follow-btn[aria-pressed="false"] {
  background: var(--green);
  border-color: var(--green);
  color: white;
  font-weight: 600;
}

.follow-btn[aria-pressed="true"] {
  background: var(--success-bg);
  border-color: var(--success-bg);
  color: var(--success-ink);
  font-weight: 600;
}

.hours-link {
  border: none;
  background: none;
  padding: 0;
  font: inherit;
  font-size: 0.8rem;
  color: var(--muted);
  text-decoration: underline;
  cursor: pointer;
}

.commerce-link {
  border: none;
  background: none;
  padding: 0;
  font: inherit;
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--green);
  text-decoration: underline;
  cursor: pointer;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(27, 27, 24, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 20;
}

.modal-overlay[hidden] { display: none; }

.modal-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 20px;
  max-width: 340px;
  width: 100%;
}

.privacy-note {
  font-size: 0.78rem;
  color: var(--muted);
  margin-top: 18px;
  line-height: 1.4;
}
