/* Dream List - Mobile Stylesheet */
/* Auto-loaded on small screens. Keep lightweight. */

/* ── Layout ─────────────────────────────────── */

@media (max-width: 820px) {
  .controls,
  .board {
    grid-template-columns: 1fr;
  }

  .app-shell {
    width: min(100% - 28px, 720px);
  }

  .sidebar,
  .category-section-head {
    position: static;
    max-height: none;
  }

  .dream-list {
    padding: 16px;
  }

  .category-section {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .status-group {
    grid-column: 1;
  }

  .hero {
    min-height: auto;
    padding: 30px 24px 34px;
  }

  .hero::before {
    font-size: 82px;
    right: 18px;
    bottom: 22px;
  }

  .hero::after {
    width: 180px;
  }

  h1 {
    font-size: clamp(42px, 14vw, 68px);
  }

  .manifesto {
    padding-left: 14px;
    font-size: 16px;
    line-height: 1.72;
  }

  .tabs,
  .summary {
    grid-template-columns: repeat(2, 1fr);
  }

  .auth-panel {
    grid-template-columns: 1fr;
    padding: 22px;
  }

  .auth-grid {
    grid-template-columns: 1fr;
  }

  .stat-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .add-form,
  .category-form {
    grid-template-columns: 1fr;
  }

  .dream-item {
    grid-template-columns: 36px minmax(0, 1fr);
    padding: 14px 12px;
  }

  .share-row,
  .meta-row,
  .social-actions {
    gap: 9px;
  }

  .share-row select,
  .social-actions select {
    width: 100%;
    max-width: 260px;
  }

  .friend-card {
    grid-template-columns: 1fr;
  }

  .delete-btn {
    grid-column: 2;
    justify-self: start;
  }

  .comment-form {
    grid-template-columns: 1fr;
  }

  .private-message-form {
    grid-template-columns: 1fr;
  }

  .photo-row {
    grid-template-columns: 1fr;
  }

  .gallery-card {
    grid-template-columns: 1fr;
  }

  .gallery-media-strip {
    min-height: 112px;
  }
}

/* ── Small phones (<=520px) ──────────────────── */

@media (max-width: 520px) {
  /* Initial state: show hero content, keep it compact */
  .hero {
    min-height: auto;
    padding: 16px 14px 10px;
  }

  .hero::before {
    font-size: 52px;
    right: 8px;
    bottom: 4px;
  }

  h1 {
    font-size: clamp(26px, 9vw, 38px);
    line-height: 1;
  }

  .eyebrow {
    font-size: 10px;
    margin-bottom: 2px;
  }

  .manifesto {
    margin-top: 4px;
    padding-left: 10px;
    font-size: 13px;
    line-height: 1.55;
    max-height: 180px;
    overflow: hidden;
  }

  .manifesto-label {
    margin-top: 4px;
    font-size: 11px;
  }

  .subtitle {
    margin-top: 4px;
    font-size: 12px;
  }

  .auth-panel {
    grid-template-columns: 1fr;
    margin-top: 4px;
    padding: 10px;
  }

  .auth-card {
    padding: 8px 10px;
    gap: 6px;
  }

  .auth-form {
    gap: 4px;
  }

  .auth-form label {
    font-size: 11px;
    font-weight: 600;
  }

  .auth-form input {
    min-height: 32px;
    font-size: 14px;
    padding: 4px 8px;
  }

  .auth-form button {
    min-height: 38px;
    font-size: 15px;
    margin-top: 2px;
  }

  .auth-tabs {
    gap: 3px;
    padding: 2px;
  }

  .auth-tab {
    min-height: 32px;
    font-size: 14px;
  }

  /* When user taps login/register, collapse hero */
  body.auth-focus .hero {
    padding: 10px 14px 6px;
    transition: padding 0.25s ease;
  }

  body.auth-focus .hero::before {
    font-size: 36px;
    right: 6px;
    bottom: 2px;
  }

  body.auth-focus .manifesto,
  body.auth-focus .manifesto-label,
  body.auth-focus .subtitle,
  body.auth-focus .auth-copy {
    display: none;
  }

  body.auth-focus h1 {
    font-size: clamp(22px, 8vw, 32px);
  }

  body.auth-focus .auth-panel::after {
    display: none;
  }

  /* WeChat chat view */
  .wechat-chat {
    height: calc(100vh - 180px);
  }

  .wechat-layout {
    flex-direction: column;
  }

  .wechat-sidebar {
    width: 100%;
    border-right: none;
    border-bottom: 1px solid #e5e5e5;
    max-height: 200px;
  }

  .wechat-content {
    flex: 1;
  }

  /* General */
  .app-shell {
    width: min(100% - 16px, 720px);
    padding-top: 10px;
    padding-bottom: 20px;
  }

  .summary,
  .tabs {
    grid-template-columns: 1fr;
  }

  .list-panel,
  .sidebar,
  .auth-panel,
  .controls,
  .summary,
  .tabs {
    border-radius: 7px;
  }

  .panel-head {
    align-items: stretch;
  }

  .panel-actions {
    width: 100%;
  }

  .panel-actions button,
  .share-row button,
  .social-actions button,
  .comment-form button {
    min-height: 40px;
  }

  .share-row select,
  .share-row button {
    width: 100%;
  }

  .dream-title,
  .readonly-title {
    font-size: 16px;
  }
}
