* {
    box-sizing: border-box;
  }

  body {
    margin: 0;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background-color: #f5f5f7;
    color: #111827;
  }

  /* Top bar */
  .topbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 56px;
    background: #ffffff;
    box-shadow: 0 1px 4px rgba(15, 23, 42, 0.08);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    z-index: 100;
  }

  .topbar-left {
    display: flex;
    align-items: center;
    gap: 10px;
  }

  .topbar-logo {
    height: 40px;
    width: auto;
  }

  .topbar-title {
    font-size: 0.95rem;
    font-weight: 600;
  }

  .topbar-sub {
    font-size: 0.8rem;
    color: #6b7280;
  }

  /* Main container */
  .page {
    padding: 72px 16px 16px;  /* space for fixed header */
    max-width: 1200px;
    margin: 0 auto;
  }

  .page-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 8px;
  }

  .page-header h1 {
    margin: 0;
    font-size: 1.2rem;
  }

  .search-input {
    padding: 6px 10px;
    font-size: 0.85rem;
    border-radius: 999px;
    border: 1px solid #d1d5db;
    min-width: 200px;
    background: #ffffff;
  }

  #statusMessage {
    font-size: 0.8rem;
    color: #6b7280;
    margin-bottom: 12px;
  }

  /* Card grid */
  .grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 14px;
  }

  .mag-card {
    background: #ffffff;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.08);
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    transition: transform 0.08s ease, box-shadow 0.08s ease;
    cursor: pointer;
  }

  .mag-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.18);
  }

  .mag-cover {
    width: 100%;
    aspect-ratio: 3 / 4;
    object-fit: cover;
    background: #e5e7eb;
    display: block;
  }

  .mag-body {
    padding: 8px 10px 10px;
    display: flex;
    flex-direction: column;
    gap: 4px;
  }

  .mag-title {
    margin: 0;
    font-size: 0.9rem;
    font-weight: 600;
  }

  .mag-meta {
    margin: 0;
    font-size: 0.8rem;
    color: #6b7280;
  }

  .mag-desc {
    margin: 0;
    font-size: 0.78rem;
    color: #4b5563;
  }

  /* Footer */
  .footer-simple {
    text-align: center;
    padding: 12px 12px 16px;
    font-size: 0.75rem;
    color: #6b7280;
  }

  @media (max-width: 480px) {
    .topbar-title {
      font-size: 0.85rem;
    }
    .topbar-sub {
      display: none;
    }
  }