/* Center the back-to-portal button content */
header #controls .card {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .45rem;
  text-align: center;
  color: var(--btn-back-color, #fff);
  border: none;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  transition: background 0.2s;
  padding: .6rem .9rem;    
  min-height: 56px;        
  font-size: 1rem;              
  border-radius: 12px;        
  width: auto;                  
}

header #controls .card i {
  font-size: 1.2rem;
}


/* Download button styles */
.download-btn {
  background: var(--btn-download-bg, #0077b6);
  color: var(--btn-download-color, #fff);
  border: none;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  transition: background 0.2s;
  text-align: center;
  word-break: break-word;
}

/* Responsive mobile improvements */
@media (max-width: 600px) {
  body {
    font-size: 16px;
    padding: 0;
    background: var(--bg);
  }
  main {
    padding: 1rem 0;
  }
  section {
    max-width: 98vw;
    margin-bottom: 1.5rem;
    padding: 1.2rem .7rem;
    border-radius: 16px;
    box-shadow: var(--shadow);
    background: var(--card-bg);
  }
  h1 {
    font-size: 1.2rem;
    margin-bottom: 1rem;
  }
  h2 {
    font-size: 1.1rem;
    margin-bottom: .7rem;
  }
  .desc {
    font-size: 1.05rem;
    padding: .4rem 0 .7rem 0;
    line-height: 1.6;
  }
  ul {
    padding-left: 1.2rem;
    margin-bottom: 1rem;
  }
  /* Scope cards in main only to avoid stretching the header button */
  main .card {
    width: 98vw;
    max-width: 98vw;
    font-size: 1.05rem;
    padding: 1.1rem .5rem;
    min-height: 60px;
    margin: 1rem auto;
    border-radius: 14px;
  }
  .note-info {
    font-size: 1rem;
    padding: .3rem .2rem;
    margin-bottom: .5rem;
  }
  /* Keep header compact on mobile */
  header {
    flex-direction: row;
    gap: .6rem;
    padding: .9rem .7rem;
    align-items: center;
    justify-content: space-between;
  }
  #controls {
    width: auto;
    justify-content: flex-end;
    margin-bottom: 0;
  }
  header #controls .card {
    min-height: 44px;
    padding: .5rem .7rem;
    font-size: .95rem;
    border-radius: 10px;
  }
  header #controls .card i { font-size: 1.1rem; }
  .download-btn {
    display: block;
    width: 92vw;
    max-width: 360px;
    margin: 1.2rem auto 0 auto;
    font-size: 1.1rem;
    padding: 0.8rem 0.2rem;
    border-radius: 12px;
    box-sizing: border-box;
    background: var(--btn-download-bg, #0077b6);
    color: var(--btn-download-color, #fff);
  }
}
