:root {
  /* Reference-image vibe */
  --bg: #f2f0eb;
  --surface: #f7f5f1;
  --text: #1d1d1f;
  --muted: rgba(29, 29, 31, 0.62);

  --accent: #ff3b30;
  --accent-2: #ff2d55;

  --shadow-dark: rgba(160, 155, 145, 0.3);
  --shadow-light: rgba(255, 255, 255, 0.85);

  --radius: 22px;
  --radius-lg: 28px;

  --pad: 16px;
  --max: 980px;
}

* {
  box-sizing: border-box;
}
html,
body {
  height: 100%;
}
body {
  margin: 0;
  font-family: Poppins, system-ui, -apple-system, Segoe UI, Roboto, Arial,
    sans-serif;
  background: var(--bg);
  color: var(--text);
}

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

.app-shell {
  min-height: 100vh;
}

/* NAV: mobile bottom tab bar; desktop top bar */
.nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 12px 14px calc(12px + env(safe-area-inset-bottom));
  background: transparent;
  z-index: 20;
}

.nav-inner {
  margin: 0 auto;
  max-width: var(--max);
  background: var(--bg);
  border-radius: var(--radius-lg);
  padding: 12px 14px;
  box-shadow: 10px 10px 20px var(--shadow-dark),
    -10px -10px 20px var(--shadow-light);
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand {
  display: none;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 18px;
}

.brand-dot {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: radial-gradient(
    circle at 30% 30%,
    var(--accent),
    var(--accent-2)
  );
  box-shadow: 4px 4px 10px var(--shadow-dark),
    -4px -4px 10px var(--shadow-light);
}

.brand-title {
  font-weight: 600;
  font-size: 14px;
  line-height: 1.1;
}
.brand-sub {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}

.nav-links {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  width: 100%;
}

.nav-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 8px;
  border-radius: 18px;

  color: rgba(29, 29, 31, 0.55);
  transition: transform 0.12s ease, color 0.12s ease, box-shadow 0.12s ease;
}

.nav-ic svg {
  width: 20px;
  height: 20px;
}

.nav-label {
  font-size: 11px;
  font-weight: 500;
}

.nav-link.is-active {
  color: var(--accent);
  box-shadow: inset 8px 8px 16px rgba(160, 155, 145, 0.18),
    inset -8px -8px 16px rgba(255, 255, 255, 0.75);
}

.nav-link:active {
  transform: scale(0.98);
}

.admin-logout {
  margin: 0;
  display: none;
}
.btn {
  border: 0;
  border-radius: 999px;
  padding: 12px 14px;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.btn-soft {
  background: var(--bg);
  box-shadow: 8px 8px 16px var(--shadow-dark),
    -8px -8px 16px var(--shadow-light);
  color: rgba(29, 29, 31, 0.85);
}

.btn-primary {
  color: white;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 10px 10px 22px rgba(255, 59, 48, 0.22),
    -10px -10px 22px rgba(255, 255, 255, 0.55);
}

.btn:active {
  transform: translateY(1px);
}

/* Content spacing so it doesn’t hide behind the tab bar */
.content {
  max-width: var(--max);
  margin: 0 auto;
  padding: 10px var(--pad) calc(120px + env(safe-area-inset-bottom));
}

.page-header h1 {
  margin: 6px 0 6px;
  font-size: 28px;
  letter-spacing: -0.4px;
}
.muted {
  color: var(--muted);
}
.tiny {
  font-size: 12px;
}

.back-link {
  display: inline-block;
  margin-bottom: 12px;
  color: rgba(29, 29, 31, 0.75);
}

/* Neumorphic cards & inset inputs */
.card {
  background: var(--bg);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: 10px 10px 22px var(--shadow-dark),
    -10px -10px 22px var(--shadow-light);
}

.card + .card {
  margin-top: 14px;
}
.card-title {
  margin: 0 0 10px;
  font-size: 18px;
  font-weight: 600;
}
.card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.card-nested {
  background: rgba(255, 255, 255, 0.1);
  box-shadow: inset 10px 10px 18px rgba(160, 155, 145, 0.18),
    inset -10px -10px 18px rgba(255, 255, 255, 0.65);
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.form-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
label {
  font-size: 12px;
  font-weight: 600;
  color: rgba(29, 29, 31, 0.75);
}

.input {
  font: inherit;
  padding: 12px 14px;
  border-radius: 18px;
  border: 1px solid rgba(0, 0, 0, 0.02);
  background: var(--bg);
  outline: none;
}

.inset {
  box-shadow: inset 10px 10px 18px rgba(160, 155, 145, 0.2),
    inset -10px -10px 18px rgba(255, 255, 255, 0.75);
}

.input:focus {
  border-color: rgba(255, 59, 48, 0.25);
  box-shadow: inset 10px 10px 18px rgba(160, 155, 145, 0.18),
    inset -10px -10px 18px rgba(255, 255, 255, 0.75),
    0 0 0 4px rgba(255, 59, 48, 0.12);
}

.alert {
  margin: 12px 0;
  padding: 12px 14px;
  border-radius: 18px;
  background: var(--bg);
  box-shadow: inset 10px 10px 18px rgba(160, 155, 145, 0.18),
    inset -10px -10px 18px rgba(255, 255, 255, 0.75);
}
.alert-bad {
  border-left: 4px solid var(--accent);
}
.alert-good {
  border-left: 4px solid rgba(52, 199, 89, 0.9);
}

.prose p {
  margin: 0 0 12px;
  line-height: 1.6;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 6px;
}
.section-head h2 {
  margin: 0;
  font-size: 18px;
}

.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  background: var(--bg);
  box-shadow: inset 8px 8px 14px rgba(160, 155, 145, 0.18),
    inset -8px -8px 14px rgba(255, 255, 255, 0.75);
  color: rgba(29, 29, 31, 0.75);
}

.q-text {
  margin-top: 8px;
  font-weight: 500;
}
.answer {
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.08);
  box-shadow: inset 10px 10px 18px rgba(160, 155, 145, 0.16),
    inset -10px -10px 18px rgba(255, 255, 255, 0.6);
}
.answer-label {
  font-size: 12px;
  font-weight: 700;
  color: rgba(29, 29, 31, 0.7);
  margin-bottom: 6px;
}

.grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

.gallery {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}
.gallery-card {
  padding: 12px;
}
.gallery-img {
  width: 100%;
  height: 260px;
  object-fit: cover;
  border-radius: 18px;
  box-shadow: inset 10px 10px 18px rgba(160, 155, 145, 0.12),
    inset -10px -10px 18px rgba(255, 255, 255, 0.55);
}

.list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.admin-actions {
  display: flex;
  gap: 12px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

/* Desktop/tablet layout */
@media (min-width: 860px) {
  .nav {
    position: sticky;
    top: 0;
    bottom: auto;
    padding: 14px 16px;
  }

  .nav-inner {
    border-radius: var(--radius-lg);
  }

  .brand {
    display: flex;
  }
  .nav-links {
    grid-template-columns: repeat(4, auto);
    width: auto;
    margin-left: auto;
  }

  .nav-link {
    flex-direction: row;
    padding: 10px 14px;
    gap: 10px;
  }

  .nav-label {
    font-size: 13px;
  }
  .admin-logout {
    display: block;
  }
  .content {
    padding-bottom: 26px;
  }

  .grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .gallery {
    grid-template-columns: repeat(3, 1fr);
  }
}
/* Mobile-only top bar (raised like desktop nav) */
.mobile-topbar {
  position: sticky;
  top: 0;
  z-index: 19;
  padding: 14px 16px;
  background: transparent;
}

.mobile-topbar-inner {
  max-width: var(--max);
  margin: 0 auto;
  background: var(--bg);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  box-shadow: 10px 10px 20px var(--shadow-dark),
    -10px -10px 20px var(--shadow-light);
}

.mobile-topbar-title {
  font-weight: 600;
  font-size: 16px;
  letter-spacing: -0.2px;
}

.mobile-topbar-sub {
  margin-top: 2px;
  font-size: 12px;
  color: var(--muted);
}

/* Hide the mobile top bar on desktop/tablet since the nav moves to top */
@media (min-width: 860px) {
  .mobile-topbar {
    display: none;
  }
}

#ask,
#questions {
  margin-top: 4rem;
}
/* Preserves newlines and wraps nicely */
.preline {
  white-space: pre-line;
}
/* Collapsible card (details/summary) */
.collapse {
  padding: 0;
}

.collapse-summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;

  padding: 16px;
  border-radius: var(--radius);
  user-select: none;
}

.collapse-summary::-webkit-details-marker {
  display: none;
}

.collapse-title {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.collapse-title .collapse-sub {
  font-size: 12px;
}

.collapse-chevron {
  font-size: 18px;
  line-height: 1;
  transition: transform 0.2s ease;
  opacity: 0.7;
}

.collapse[open] .collapse-chevron {
  transform: rotate(180deg);
}

/* Smooth open/close animation using grid rows */
.collapse-anim {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.28s ease;
}

.collapse[open] .collapse-anim {
  grid-template-rows: 1fr;
}

/* This is what actually "clips" during animation */
.collapse-anim-inner {
  overflow: hidden;
}

/* Spacing lives inside (so we animate height cleanly) */
.collapse-body {
  padding: 0 16px 16px 16px;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
  margin-top: 2px;
  padding-top: 14px;
}

/* Respect reduced motion users */
@media (prefers-reduced-motion: reduce) {
  .collapse-anim {
    transition: none;
  }
  .collapse-chevron {
    transition: none;
  }
}
