/* --- FORCE HORIZONTAL NAVIGATION --- */
nav.pwa-nav.force-horizontal-nav,
.pwa-nav.force-horizontal-nav {
  position: fixed !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: 100vw !important;
  max-width: 100vw !important;
  display: flex !important;
  flex-direction: row !important;
  gap: 0 !important;
  z-index: 10000 !important;
  background: #161b22 !important;
  /* border-top: 2px solid #ff7b72 !important; */
  padding: 0 !important;
}

.pwa-nav.force-horizontal-nav>* {
  flex: 1 1 0 !important;
  min-width: 0 !important;
  width: 100% !important;
  max-width: none !important;
  box-sizing: border-box !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  /* border: 1px solid #ff7b72 !important; */
}

/* Reset and Base */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

body {
  background: linear-gradient(135deg, #0f111a 0%, #161b22 100%);
  color: #e6edf3;
  font-family: 'Inter', sans-serif;
  min-height: 100vh;
  width: 100vw;
  max-width: 100vw;
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow-x: hidden;
}

/* Background Elements */
.bg-glow {
  position: absolute;
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, rgba(46, 160, 67, 0.15) 0%, rgba(0, 0, 0, 0) 70%);
  border-radius: 50%;
  top: -50px;
  left: -100px;
  z-index: 0;
  animation: pulse 8s infinite alternate;
}

@keyframes pulse {
  0% {
    transform: scale(1);
    opacity: 0.6;
  }

  100% {
    transform: scale(1.2);
    opacity: 1;
  }
}

/* Container */
.container {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 480px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 100vh;
}

/* Branding Section */
.hero {
  margin-top: 40px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.hero img {
  width: 100%;
  max-width: 300px;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  margin-bottom: 24px;
  transition: transform 0.3s ease;
}

.hero img:active {
  transform: scale(0.98);
}

/* Glassmorphic Cards */
.glass-card {
  background: rgba(255, 255, 255, 0.03);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 16px;
  padding: 20px;
  width: 100%;
  margin-bottom: 16px;
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
  text-align: center;
  animation: slideUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes slideUp {
  from {
    transform: translateY(20px);
    opacity: 0;
  }

  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.glass-card:nth-child(1) {
  animation-delay: 0.1s;
}

.glass-card:nth-child(2) {
  animation-delay: 0.2s;
}

.tagline {
  font-size: 0.9rem;
  line-height: 1.5;
  color: #8b949e;
  margin-bottom: 12px;
}

.tagline strong {
  color: #c9d1d9;
}

.headline {
  font-size: 1.25rem;
  font-weight: 800;
  color: #ff7b72;
  margin-bottom: 8px;
}

.subline {
  font-size: 0.85rem;
  color: #8b949e;
}

.subline a {
  color: #58a6ff;
  text-decoration: none;
  font-weight: 600;
}

/* Action Section */
.actions {
  width: 100%;
  margin-top: 24px;
  animation: slideUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) both;
  animation-delay: 0.3s;
}

.btn-login {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  background: linear-gradient(180deg, #2ea043 0%, #238636 100%);
  color: #ffffff;
  font-weight: 600;
  font-size: 1.1rem;
  padding: 16px 24px;
  border-radius: 12px;
  text-decoration: none;
  border: 1px solid rgba(240, 246, 252, 0.1);
  box-shadow: 0 4px 12px rgba(46, 160, 67, 0.2);
  transition: all 0.2s ease;
}

.btn-login:active {
  transform: scale(0.96);
  background: linear-gradient(180deg, #238636 0%, #1a6428 100%);
  box-shadow: 0 2px 6px rgba(46, 160, 67, 0.2);
}

.btn-login::before {
  content: '';
  display: inline-block;
  width: 20px;
  height: 20px;
  margin-right: 12px;
  /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MS41OCA4LjE5Ny02LjA3NCA4LjE5Ny0xMS4zODRDMjQgNS4zNyAxOC42MyAwIDEyIDB6Ii8+PC9zdmc+');
  background-size: contain;
  background-repeat: no-repeat;
}

/* Footer */
.footer {
  margin-top: auto;
  padding: 32px 0 16px;
  text-align: center;
  font-size: 0.75rem;
  color: #484f58;
  width: 100%;
}

.footer a {
  color: #8b949e;
  text-decoration: none;
  margin: 0 6px;
  transition: color 0.2s;
}

.footer a:active {
  color: #c9d1d9;
}

.footer p {
  margin-top: 12px;
  font-size: 0.7rem;
}

.app-shell-page {
  position: relative;
  overflow-x: hidden;
  overflow-y: auto;
  width: 100%;
  max-width: 100%;
  left: 0;
  padding-bottom: calc(92px + env(safe-area-inset-bottom));
}

.app-shell-page .bg-grid {
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
  background-size: 32px 32px;
  opacity: 0.12;
  pointer-events: none;
  z-index: 0;
}

.app-shell {
  position: relative;
  z-index: 1;
  width: 100vw;
  max-width: 360px;
  margin: 0 auto;
  min-width: 0;
  min-height: 100vh;
  padding: 20px 20px 0;
  box-sizing: border-box;
  overflow-x: hidden;
}

.update-banner {
  display: grid;
  gap: 12px;
  margin-bottom: 16px;
  padding: 16px;
  border-radius: 18px;
  border: 1px solid rgba(88, 166, 255, 0.22);
  background: linear-gradient(180deg, rgba(88, 166, 255, 0.16) 0%, rgba(255, 255, 255, 0.05) 100%);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.18);
}

.update-banner-copy strong {
  display: block;
  color: #f0f6fc;
  margin-bottom: 6px;
}

.update-banner-copy p {
  color: #d0d7de;
  font-size: 0.9rem;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.update-banner-action {
  appearance: none;
  border: 1px solid rgba(240, 246, 252, 0.12);
  border-radius: 14px;
  background: linear-gradient(180deg, #58a6ff 0%, #2f81f7 100%);
  color: #ffffff;
  font-weight: 800;
  padding: 12px 14px;
}

.update-banner-action:disabled {
  opacity: 0.7;
}

.app-topbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
}

.brand-lockup {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.brand-badge {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  max-width: 100%;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(255, 123, 114, 0.16);
  color: #ffb5ad;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  overflow-wrap: anywhere;
}

.brand-status {
  color: #8b949e;
  font-size: 0.82rem;
  overflow-wrap: anywhere;
}

.install-chip,
.btn-secondary {
  appearance: none;
  border: 1px solid rgba(240, 246, 252, 0.12);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  color: #e6edf3;
  padding: 12px 16px;
  font-size: 0.88rem;
  font-weight: 700;
  text-decoration: none;
  white-space: normal;
  overflow-wrap: anywhere;
  max-width: 100%;
}

.app-panels {
  position: relative;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.panel {
  display: none;
  animation: slideUp 0.35s ease both;
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  box-sizing: border-box;
}

.panel.is-active {
  display: block;
}

.hero-panel {
  text-align: left;
  padding: 24px;
}

.hero-mark {
  width: 100%;
  border-radius: 18px;
  margin-bottom: 20px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
}

.eyebrow {
  color: #58a6ff;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.72rem;
  font-weight: 700;
  margin-bottom: 10px;
}

.app-headline,
.section-title {
  color: #f0f6fc;
  font-size: clamp(1.6rem, 6vw, 2.3rem);
  line-height: 1.08;
  margin-bottom: 14px;
  overflow-wrap: anywhere;
}

.section-title {
  font-size: 1.35rem;
}

.app-copy {
  color: #b7c0ca;
  font-size: 0.98rem;
  line-height: 1.6;
  overflow-wrap: anywhere;
}

.hero-actions {
  display: grid;
  gap: 12px;
  margin-top: 0;
  min-width: 0;
}

.metrics-card {
  margin-top: 16px;
}

.metric-grid,
.route-grid,
.feature-stack {
  display: grid;
  gap: 12px;
}

.metric-grid strong,
.feature-card strong,
.route-card strong {
  display: block;
  color: #f0f6fc;
  margin-bottom: 6px;
  overflow-wrap: anywhere;
}

.metric-grid p,
.feature-card p,
.route-card span,
.install-note {
  color: #8b949e;
  font-size: 0.9rem;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.feature-card,
.route-card {
  display: block;
  min-width: 0;
  padding: 16px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.06);
  text-decoration: none;
}

.route-card-primary {
  background: linear-gradient(180deg, rgba(46, 160, 67, 0.2) 0%, rgba(35, 134, 54, 0.12) 100%);
  border-color: rgba(46, 160, 67, 0.3);
}

.install-note {
  margin-top: 16px;
  padding: 12px 14px;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  transition: all 0.2s ease;
}

.update-banner-action:active,
.update-banner-action:hover {
  transform: scale(0.98);
  opacity: 0.9;
}

.update-banner-action:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.install-guide {
  margin-top: 12px;
  padding: 14px 16px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.08);
  max-width: 100%;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  transition: all 0.2s ease;
}

.install-chip:active,
.install-chip:hover,
.btn-secondary:active,
.btn-secondary:hover {
  transform: scale(0.98);
  opacity: 0.85;
}

.install-guide strong {
  display: block;
  color: #f0f6fc;
  margin-bottom: 6px;
}

.install-guide p {
  color: #8b949e;
  font-size: 0.9rem;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.pwa-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  flex-direction: row;
  gap: 10px;
  width: 100%;
  max-width: 360px;
  margin: 0 auto;
  padding: 14px 0 calc(14px + env(safe-area-inset-bottom));
  background: #161b22 !important;
  /* border-top: 2px solid #ff7b72 !important; */
  position: fixed !important;
  left: 0 !important;
  right: 0 !important;
  margin: 0 auto !important;
  bottom: 0 !important;
  width: 100% !important;
  max-width: 360px !important;
  display: flex !important;
  flex-direction: row !important;
  gap: 10px !important;
  padding: 14px 0 calc(14px + env(safe-area-inset-bottom)) !important;
  margin-top: 0 !important;
  z-index: 1000 !important;
}

.pwa-nav-item {
  /* border: 1px solid #ff7b72 !important; */
  max-width: none !important;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  width: 100%;
  box-sizing: border-box;
  flex: 1 1 0;
  text-align: center;
  min-width: 0;
  width: 100%;
  box-sizing: border-box;
  appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.04);
  color: #8b949e;
  font-weight: 700;
  padding: 14px 10px;
  min-width: 0;
  white-space: normal;
  overflow-wrap: anywhere;
}

.pwa-nav-item.is-active {
  color: #f0f6fc;
  background: rgba(255, 123, 114, 0.14);
  border-color: rgba(255, 123, 114, 0.28);
}

@media (max-width: 380px) {
  .app-shell {
    padding: 14px 12px 0;
  }

  .hero-panel,
  .glass-card,
  .feature-card,
  .route-card,
  .install-note,
  .install-guide {
    padding: 16px;
  }

  .brand-badge {
    font-size: 0.72rem;
    letter-spacing: 0.05em;
  }

  .app-headline {
    font-size: 1.42rem;
    line-height: 1.14;
  }

  .app-copy,
  .metric-grid p,
  .feature-card p,
  .route-card span,
  .install-note,
  .install-guide p {
    font-size: 0.88rem;
  }

  .install-chip,
  .btn-secondary,
  .btn-login,
  .pwa-nav-item {
    font-size: 0.82rem;
    padding: 12px 10px;
  }
}

.list-divider {
  display: block;
  width: 250px;
  text-align: left !important;
  margin: 0 auto;
}

.list-divider p {
  text-align: left !important;
}

.list-divider ul {
  text-align: left !important;
  padding-left: 1.5rem;
}

.list-divider li {
  text-align: left !important;
}

@media (min-width: 540px) {
  .app-shell {
    margin: 0 auto;
    padding-top: 28px;
  }

  .update-banner {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
  }

  .hero-actions,
  .metric-grid,
  .route-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Header */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(15, 17, 26, 0.85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  padding: 16px;
  text-align: center;
  font-weight: 800;
  color: #ff7b72;
}

/* Content Area */
.content {
  flex: 1;
  width: 100%;
  min-width: 0;
  padding: 24px;
  padding-bottom: 90px;
  /* Space for the bottom navigation bar */
  overflow-y: auto;
}

/* Glassmorphic Card */
.glass-card {
  background: rgba(255, 255, 255, 0.03);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 16px;
  padding: 20px;
  width: 100%;
  margin-bottom: 16px;
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
}

/* Bottom Navigation */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  background: rgba(22, 27, 34, 0.85);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  justify-content: space-around;
  align-items: center;
  padding: 10px 0 calc(10px + env(safe-area-inset-bottom)) 0;
  z-index: 1000;
}

.bottom-nav a {
  color: #8b949e;
  text-decoration: none;
  font-size: 0.65rem;
  font-weight: 600;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: color 0.2s ease;
}

.bottom-nav a:active,
.bottom-nav a:hover {
  color: #c9d1d9;
}

/* 32x32 Placeholder for future icons */
.nav-icon {
  width: 32px;
  height: 32px;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Overrides for dynamic width on containers */
.notice,
.post,
.for-the,
.is-by,
.is-with,
.edit-pro,
.delete-post-button,
#post-form-section {
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
}

.reply-post {
  width: calc(100% - 28px) !important;
  max-width: calc(100% - 28px) !important;
  box-sizing: border-box !important;
}

input[type="text"],
input[type="password"],
input[type="submit"],
textarea {
  max-width: calc(100% - 12px) !important;
  box-sizing: border-box !important;
}

.post input[type=text],
.edit-pro input[type=text],
.delete-post-button input[type=submit] {
  width: calc(100% - 12px) !important;
  max-width: 400px !important;
}

#user-search-section {
  margin: 0 auto;
}