:root {
  --brand: #0E2A47;
  --accent: #D96B43;
  --bg: #FAF8F4;
  --surface: #FFFFFF;
  --surface-alt: #F3EFE7;
  --text: #162433;
  --text-muted: #5C6B7A;
  --border: #E8E1D6;
  --ok: #1E7E5A;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: #ECE7DE;
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.g-shell {
  max-width: 480px;
  min-height: 100vh;
  margin: 0 auto;
  background: var(--bg);
  box-shadow: 0 0 50px rgba(14, 42, 71, 0.12);
  padding-bottom: 92px;
  position: relative;
}

.g-loading {
  min-height: 100vh;
  display: grid;
  place-items: center;
}
.g-spinner {
  width: 36px;
  height: 36px;
  border: 3px solid var(--border);
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Hero */
.g-hero {
  position: relative;
  height: 265px;
  background-color: var(--brand);
  background-size: cover;
  background-position: center;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 16px 18px 22px;
  color: #fff;
}
.g-hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(10, 24, 40, 0.42) 0%, rgba(10, 24, 40, 0.15) 45%, rgba(10, 24, 40, 0.82) 100%);
  pointer-events: none;
}
.g-hero > * { position: relative; z-index: 2; }

.g-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.g-logo {
  height: 34px;
  max-width: 110px;
  object-fit: contain;
  background: rgba(255,255,255,0.92);
  padding: 4px 8px;
  border-radius: 9px;
}
.g-langs {
  display: flex;
  gap: 5px;
  background: rgba(14, 42, 71, 0.55);
  backdrop-filter: blur(8px);
  padding: 4px;
  border-radius: 999px;
  margin-left: auto;
}
.g-lang-btn {
  border: 0;
  background: transparent;
  color: rgba(255,255,255,0.85);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 4px 9px;
  border-radius: 999px;
  cursor: pointer;
}
.g-lang-btn.active {
  background: #fff;
  color: var(--brand);
}
.g-lang-select {
  margin-left: auto;
  appearance: none;
  background: rgba(14, 42, 71, 0.72);
  backdrop-filter: blur(8px);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.3);
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
}
.g-lang-select option { color: #162433; background: #fff; }

.g-hero-info h1 {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.8rem;
  line-height: 1.15;
  margin: 0 0 4px;
  text-shadow: 0 2px 12px rgba(0,0,0,0.28);
}
.g-hero-sub {
  margin: 0 0 10px;
  font-size: 0.9rem;
  opacity: 0.94;
}
.g-times-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.g-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(255,255,255,0.18);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,0.25);
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  color: #fff;
  text-decoration: none;
}

/* Body padding */
.g-content { padding: 16px; }

/* Quick Action Row */
.g-quick-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(92px, 1fr));
  gap: 8px;
  margin-bottom: 16px;
}
.g-qbtn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 12px 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  color: var(--brand);
  text-decoration: none;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(14,42,71,0.04);
}
.g-qbtn .ico { font-size: 1.25rem; }
.g-qbtn:active { transform: scale(0.98); }

/* Cards */
.g-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 18px;
  margin-bottom: 14px;
  box-shadow: 0 4px 16px rgba(14, 42, 71, 0.04);
}
.g-card-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 0 0 12px;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--brand);
}

/* Wi-Fi Highlight Card */
.g-wifi-card {
  background: linear-gradient(135deg, var(--brand) 0%, color-mix(in srgb, var(--brand) 78%, #2E6F9E) 100%);
  color: #fff;
  border: 0;
}
.g-wifi-card .g-card-title { color: #fff; }
.g-wifi-grid {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
}
.g-wifi-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(255,255,255,0.12);
  padding: 9px 12px;
  border-radius: 11px;
  font-size: 0.88rem;
}
.g-wifi-row span { opacity: 0.8; font-size: 0.8rem; }
.g-wifi-row strong { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.94rem; letter-spacing: 0.02em; }
.g-wifi-btns { display: flex; gap: 8px; }
.g-btn {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 14px;
  border-radius: 12px;
  border: 0;
  font-weight: 600;
  font-size: 0.88rem;
  cursor: pointer;
  text-decoration: none;
}
.g-btn-white { background: #fff; color: var(--brand); }
.g-btn-glass { background: rgba(255,255,255,0.16); color: #fff; border: 1px solid rgba(255,255,255,0.28); }
.g-btn-accent { background: var(--accent); color: #fff; }
.g-btn-brand { background: var(--brand); color: #fff; }
.g-btn-soft { background: var(--surface-alt); color: var(--brand); }

/* Keybox PIN */
.g-pin-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: var(--surface-alt);
  padding: 12px 14px;
  border-radius: 12px;
  margin-top: 12px;
}
.g-pin-val {
  font-family: ui-monospace, monospace;
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--brand);
}

/* Accordion */
.g-acc-item {
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  margin-bottom: 10px;
  overflow: hidden;
}
.g-acc-btn {
  width: 100%;
  border: 0;
  background: transparent;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--brand);
  cursor: pointer;
  text-align: left;
}
.g-acc-left { display: flex; align-items: center; gap: 10px; }
.g-acc-ico { font-size: 1.25rem; }
.g-acc-chev { transition: transform 0.2s ease; color: var(--text-muted); }
.g-acc-item.open .g-acc-chev { transform: rotate(180deg); }
.g-acc-body {
  display: none;
  padding: 0 16px 15px;
  color: var(--text-muted);
  font-size: 0.9rem;
  border-top: 1px solid var(--surface-alt);
  padding-top: 12px;
}
.g-acc-item.open .g-acc-body { display: block; }
.g-acc-img { width: 100%; border-radius: 10px; margin-top: 10px; max-height: 220px; object-fit: cover; }

/* Category filter pills */
.g-filter-row {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 10px;
  margin-bottom: 10px;
  scrollbar-width: none;
}
.g-filter-row::-webkit-scrollbar { display: none; }
.g-fpill {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  padding: 7px 13px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
}
.g-fpill.active {
  background: var(--brand);
  color: #fff;
  border-color: var(--brand);
}

/* Recommendation cards */
.g-rec-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 15px;
  margin-bottom: 10px;
}
.g-rec-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 6px;
}
.g-rec-name { font-weight: 700; color: var(--brand); font-size: 0.98rem; }
.g-rec-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}
.g-tag {
  font-size: 0.74rem;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--surface-alt);
  color: var(--brand);
}
.g-rec-note { margin: 0 0 10px; font-size: 0.88rem; color: var(--text-muted); }

/* House rules & Checklist */
.g-rule-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--surface-alt);
  font-size: 0.92rem;
}
.g-rule-row:last-child { border-bottom: 0; }
.g-check-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 12px;
  border-radius: 12px;
  background: var(--bg);
  margin-bottom: 8px;
  cursor: pointer;
  font-size: 0.92rem;
}
.g-check-item input { width: 19px; height: 19px; accent-color: var(--brand); cursor: pointer; }
.g-check-item.done span { text-decoration: line-through; color: var(--text-muted); }

/* Emergency */
.g-emg-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px;
  border-radius: 14px;
  background: var(--bg);
  margin-bottom: 8px;
}
.g-emg-left { display: flex; align-items: center; gap: 11px; }
.g-emg-title { font-weight: 600; font-size: 0.9rem; color: var(--brand); }
.g-emg-note { font-size: 0.78rem; color: var(--text-muted); }
.g-dial-btn {
  padding: 7px 12px;
  border-radius: 10px;
  background: var(--brand);
  color: #fff;
  text-decoration: none;
  font-weight: 700;
  font-size: 0.82rem;
  white-space: nowrap;
}

/* Feedback Form */
.g-stars { display: flex; gap: 6px; margin-bottom: 12px; }
.g-star {
  border: 0;
  background: var(--surface-alt);
  width: 38px;
  height: 38px;
  border-radius: 10px;
  font-size: 1.2rem;
  cursor: pointer;
  opacity: 0.45;
}
.g-star.on { opacity: 1; background: #FFF2DC; }
.g-input, .g-textarea {
  width: 100%;
  padding: 10px 12px;
  border-radius: 11px;
  border: 1px solid var(--border);
  background: var(--bg);
  font-family: inherit;
  font-size: 0.92rem;
  margin-bottom: 10px;
}
.g-textarea { min-height: 82px; resize: vertical; }

.g-media-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}
.g-media-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--brand);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
}
.g-media-btn.recording {
  background: #FDECEC;
  border-color: #E05252;
  color: #B82626;
  animation: pulseRec 1.1s infinite;
}
@keyframes pulseRec {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.65; }
}
.g-attach-preview {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 8px 10px;
  margin-bottom: 10px;
}
.g-attach-preview img {
  width: 58px;
  height: 46px;
  object-fit: cover;
  border-radius: 8px;
}
.g-attach-preview audio {
  flex: 1;
  height: 36px;
  max-width: 100%;
}
.g-extra-tabs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 8px;
}
.g-extra-pill {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 11px 13px;
  border-radius: 13px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--brand);
  font-weight: 600;
  font-size: 0.88rem;
  cursor: pointer;
  text-align: left;
}
.g-extra-pill:hover { border-color: var(--brand); background: var(--surface-alt); }

/* Bottom Navigation Bar */
.g-bnav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--border);
  display: grid;
  grid-template-columns: repeat(var(--tab-count, 5), 1fr);
  padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
  z-index: 30;
}
.g-bnav.g-bnav-scroll {
  display: flex;
  overflow-x: auto;
  gap: 2px;
  padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
  scrollbar-width: none;
}
.g-bnav.g-bnav-scroll::-webkit-scrollbar { display: none; }
.g-bnav.g-bnav-scroll .g-bnav-btn { flex: 0 0 78px; }
.g-bnav-btn {
  border: 0;
  background: transparent;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 6px 2px;
  color: var(--text-muted);
  font-size: 0.67rem;
  font-weight: 600;
  cursor: pointer;
  border-radius: 10px;
  min-width: 0;
}
.g-bnav-btn .lbl {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.g-bnav-btn .ico { font-size: 1.2rem; }
.g-bnav-btn.active { color: var(--brand); }
.g-bnav-btn.active .ico { transform: translateY(-1px); }

/* Wi-Fi QR Modal */
.g-modal-bg {
  position: fixed;
  inset: 0;
  background: rgba(14, 42, 71, 0.65);
  backdrop-filter: blur(4px);
  display: grid;
  place-items: center;
  padding: 20px;
  z-index: 60;
}
.g-modal {
  background: #fff;
  border-radius: 22px;
  padding: 24px;
  width: 100%;
  max-width: 340px;
  text-align: center;
}
.g-modal-qr svg { width: 210px; height: 210px; margin: 12px auto; display: block; }

.g-toast {
  position: fixed;
  bottom: 84px;
  left: 50%;
  transform: translateX(-50%) translateY(10px);
  background: var(--brand);
  color: #fff;
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 0.86rem;
  font-weight: 600;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 80;
  white-space: nowrap;
}
.g-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

.g-watermark {
  text-align: center;
  padding: 14px 0 6px;
  font-size: 0.78rem;
  color: var(--text-muted);
}
.g-watermark a { color: var(--brand); font-weight: 700; text-decoration: none; }

/* Desktop navigation (hidden on mobile) */
.g-desktop-nav { display: none; }

/* ================= DESKTOP RESPONSIVE VIEW (>= 860px) ================= */
@media (min-width: 860px) {
  body {
    background: var(--bg);
    padding: 24px 24px 56px;
  }
  .g-shell {
    max-width: 1080px;
    min-height: auto;
    border-radius: 26px;
    overflow: hidden;
    border: 1px solid var(--border);
    box-shadow: 0 24px 70px rgba(14, 42, 71, 0.1);
    padding-bottom: 24px;
  }
  .g-hero {
    height: 350px;
    padding: 26px 36px 34px;
  }
  .g-hero-info h1 { font-size: 2.7rem; }
  .g-hero-sub { font-size: 1.08rem; margin-bottom: 14px; }
  .g-chip { font-size: 0.86rem; padding: 6px 14px; }

  .g-bnav { display: none !important; }
  .g-desktop-nav {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 32px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    overflow-x: auto;
  }
  .g-dnav-btn {
    border: 1px solid transparent;
    background: transparent;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border-radius: 12px;
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s ease, color 0.15s ease;
  }
  .g-dnav-btn:hover { background: var(--surface-alt); color: var(--brand); }
  .g-dnav-btn.active {
    background: var(--brand);
    color: #fff;
  }

  .g-content { padding: 28px 36px 24px; }

  .g-home-grid {
    display: grid;
    grid-template-columns: 1.18fr 0.82fr;
    gap: 24px;
    align-items: start;
  }
  .g-home-main { order: 1; }
  .g-home-side { order: 2; }

  .g-cards-2col,
  .g-split-2col {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
    align-items: start;
  }
  .g-cards-2col .g-acc-item,
  .g-cards-2col .g-rec-card,
  .g-split-2col .g-card {
    margin-bottom: 0;
  }
  .g-toast { bottom: 28px; }
}
