:root {
  --bg: #f4f6f4;
  --card: #ffffff;
  --text: #111111;
  --muted: #5a5a5a;
  --orange: #ffac2a;
  --green: #7bbf9b;
  --blue: #7fb8d9;
  --purple: #8b6fb2;
  --gold: #e7ba57;
  --border: rgba(0, 0, 0, 0.12);
  --soft-border: rgba(0, 0, 0, 0.08);
  --shadow: 0 10px 28px rgba(0, 0, 0, 0.07);
  --radius: 18px;
  --radius-small: 12px;
  --max-width: 560px;
  --bottom-nav-height: 74px;
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  background-image: url("/assets/images/bg.png");
  background-repeat: repeat;
  background-position: center top;
  background-size: 1400px auto;
  color: var(--text);
  font-family: "Open Sans", system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: 0.55; }
a { color: inherit; }

.app-shell { min-height: 100vh; display: flex; flex-direction: column; }
.app-header { display: flex; justify-content: center; padding: 8px 16px 2px; }
.logo { width: 142px; height: auto; display: block; }

.app-main {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 6px 16px calc(var(--bottom-nav-height) + env(safe-area-inset-bottom, 0px) + 24px);
}

.page { animation: softIn 150ms ease-out; }
@keyframes softIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }

.eyebrow {
  margin: 6px 0 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.page-title {
  margin: 0 0 10px;
  font-family: "Poppins", system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  font-size: 34px;
  line-height: 1.08;
  letter-spacing: -0.02em;
}

.lead-text, .body-text {
  margin: 0 0 14px;
  font-size: 16px;
  line-height: 1.55;
  color: var(--text);
}
.help-text { margin: 10px 0 0; font-size: 14px; line-height: 1.45; color: var(--muted); }

.section-block {
  margin-top: 16px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.section-heading-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.section-title {
  margin: 0 0 10px;
  font-family: "Poppins", system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  font-size: 19px;
  line-height: 1.2;
}
.message-board, .booking-card, .install-card { background: rgba(255, 255, 255, 0.88); }
.quick-actions, .button-stack { display: grid; grid-template-columns: 1fr; gap: 12px; }

.btn {
  width: 100%;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-height: 50px;
  padding: 13px 16px;
  border-radius: 999px;
  border: 0;
  text-decoration: none;
  font-family: "Poppins", system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  font-weight: 700;
  font-size: 15px;
}
.primary-btn, .mini-btn { background: var(--orange); color: #111; }
.secondary-btn { background: #fff; color: #111; border: 1px solid var(--border); }
.btn:active, .module-card:active, .bottom-nav-btn:active { transform: translateY(1px); }

.search-filter-block { margin: 16px 0; }
.search-box {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 0 13px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 999px;
}
.search-box .icon { width: 20px; height: 20px; color: var(--muted); flex: 0 0 auto; }
.search-box input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font-size: 16px; color: var(--text); }

.filter-chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 10px 2px 2px;
  scrollbar-width: none;
}
.filter-chips::-webkit-scrollbar { display: none; }
.filter-chip {
  flex: 0 0 auto;
  min-height: 34px;
  padding: 7px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #fff;
  color: var(--text);
  font-size: 14px;
  font-weight: 700;
}
.filter-chip.is-active { border-color: rgba(255, 172, 42, 0.85); box-shadow: inset 0 0 0 1px rgba(255, 172, 42, 0.35); }
.filter-chip.tag-open { background: rgba(123, 191, 155, 0.18); }
.filter-chip.tag-aware, .filter-chip.tag-awareness { background: rgba(127, 184, 217, 0.2); }
.filter-chip.tag-engaged, .filter-chip.tag-values { background: rgba(255, 172, 42, 0.19); }
.filter-chip.tag-couples, .filter-chip.tag-relationships { background: rgba(139, 111, 178, 0.14); }
.filter-chip.tag-workplace { background: rgba(231, 186, 87, 0.18); }

.module-list { display: flex; flex-direction: column; gap: 0; }
.compact-list { margin-top: 2px; }
.module-card {
  width: 100%;
  display: grid;
  grid-template-columns: 46px 1fr 22px;
  align-items: center;
  gap: 12px;
  padding: 13px 0;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--soft-border);
  color: var(--text);
  text-align: left;
}
.module-list .module-card:last-child { border-bottom: 0; }
.module-card-icon {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 15px;
  background: #f4f6f4;
  color: #111;
}
.module-card-icon .icon { width: 25px; height: 25px; }
.type-audio { background: rgba(127, 184, 217, 0.22); color: #111; }
.type-tool { background: rgba(255, 172, 42, 0.24); color: #111; }
.type-learn { background: rgba(123, 191, 155, 0.22); color: #111; }
.type-pdf { background: rgba(139, 111, 178, 0.18); color: #111; }
.type-video { background: rgba(231, 186, 87, 0.24); color: #111; }
.module-card-body { min-width: 0; display: block; }
.module-card-title { display: block; font-family: "Poppins", system-ui, sans-serif; font-weight: 700; font-size: 16px; line-height: 1.2; }
.module-card-description { display: block; margin-top: 3px; color: var(--muted); font-size: 14px; line-height: 1.35; }
.module-meta-row { display: flex; align-items: center; gap: 8px; margin-top: 8px; color: var(--muted); font-size: 12px; font-weight: 700; }
.type-badge { padding: 3px 8px; border: 1px solid var(--border); border-radius: 999px; color: #111; background: #fff; }
.module-card-arrow { color: var(--muted); display: flex; justify-content: flex-end; }
.module-card-arrow .icon { width: 18px; height: 18px; }

.module-page .back-link {
  margin: 0 0 12px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text);
  font-weight: 700;
}
.module-content { padding: 0; background: transparent; border: 0; border-radius: 0; }
.module-content-plain { padding-bottom: 16px; }
.module-type-row { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.module-icon-large { width: 58px; height: 58px; display: grid; place-items: center; border-radius: 18px; }
.module-icon-large .icon { width: 31px; height: 31px; }
.audio-player { width: 100%; margin: 8px 0 4px; }
.field-label { display: block; margin: 14px 0 6px; font-weight: 700; font-family: "Poppins", system-ui, sans-serif; }
.text-area {
  width: 100%;
  min-height: 94px;
  resize: vertical;
  padding: 12px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text);
}
.result-area, .note-panel {
  margin-top: 14px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid var(--soft-border);
  border-radius: 14px;
}
.result-area h2 { margin: 0 0 8px; font-family: "Poppins", system-ui, sans-serif; font-size: 18px; }
.empty-state { margin-top: 16px; padding: 16px; background: #fff; border: 1px solid var(--border); border-radius: var(--radius); color: var(--muted); }
.module-subtitle {
  margin: 20px 0 8px;
  font-family: "Poppins", system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  font-size: 20px;
  line-height: 1.25;
}
.content-list {
  margin: 0 0 16px 20px;
  padding: 0;
  color: var(--text);
  font-size: 16px;
  line-height: 1.55;
}
.content-list li { margin: 6px 0; }
.admin-warning { display: none; }


.bottom-nav {
  position: fixed;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: min(100%, var(--max-width));
  height: calc(var(--bottom-nav-height) + env(safe-area-inset-bottom, 0px));
  padding: 8px 14px calc(8px + env(safe-area-inset-bottom, 0px));
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  background: rgba(255, 255, 255, 0.96);
  border-top: 1px solid var(--border);
  backdrop-filter: blur(12px);
  z-index: 20;
}
.bottom-nav-btn {
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 16px;
  background: transparent;
  color: #222;
}
.bottom-nav-btn .icon { width: 25px; height: 25px; }
.bottom-nav-btn.is-active { background: rgba(255, 172, 42, 0.23); }

.drawer-layer { position: fixed; inset: 0; pointer-events: none; z-index: 40; }
.drawer-layer.is-open { pointer-events: auto; }
.drawer-backdrop { position: absolute; inset: 0; border: 0; background: rgba(0,0,0,0); transition: background 160ms ease; }
.drawer-layer.is-open .drawer-backdrop { background: rgba(0, 0, 0, 0.26); }
.drawer {
  position: absolute;
  top: 0;
  left: 0;
  width: min(84vw, 340px);
  height: 100%;
  padding: max(14px, env(safe-area-inset-top, 0px)) 14px 20px;
  background: #fff;
  border-right: 1px solid var(--border);
  transform: translateX(-102%);
  transition: transform 180ms ease;
  box-shadow: var(--shadow);
}
.drawer-layer.is-open .drawer { transform: translateX(0); }
.drawer-header { display: flex; justify-content: space-between; align-items: center; padding: 4px 2px 14px; }
.drawer-logo { width: 132px; height: auto; }
.icon-btn { width: 42px; height: 42px; display: grid; place-items: center; border: 1px solid var(--border); border-radius: 14px; background: #fff; color: #111; }
.icon-btn .icon { width: 22px; height: 22px; }
.drawer-list { display: flex; flex-direction: column; gap: 8px; }
.drawer-item {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  width: 100%;
  padding: 10px 12px;
  border: 1px solid transparent;
  border-radius: 15px;
  background: transparent;
  color: #111;
  font-weight: 700;
  text-align: left;
}
.drawer-item .icon { width: 22px; height: 22px; }
.drawer-item.is-active { border-color: rgba(255, 172, 42, 0.55); background: rgba(255, 172, 42, 0.14); }

.update-banner {
  position: fixed;
  left: 50%;
  bottom: calc(var(--bottom-nav-height) + env(safe-area-inset-bottom, 0px) + 12px);
  transform: translateX(-50%);
  width: min(calc(100% - 28px), calc(var(--max-width) - 28px));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  z-index: 30;
  font-weight: 700;
}
.mini-btn { width: auto; min-height: 38px; padding: 8px 14px; font-size: 13px; }
.icon { display: block; }

@media (min-width: 520px) {
  .quick-actions { grid-template-columns: 1fr 1fr; }
}
