/* Shared auth uses Rovairo's existing modal, button and field design. */
.community-dialog { border: 0; padding: 0; margin: auto; border-radius: 16px; width: min(520px, calc(100vw - 24px)); max-height: calc(100dvh - 32px); color: var(--color-text-primary); background: white; }
.community-dialog::backdrop { background: rgba(0,0,0,.5); }
.community-dialog .modal-content { position: relative; width: 100%; max-width: none; max-height: none; margin: 0; opacity: 1; transform: none; box-sizing: border-box; }
.community-dialog .modal-close { font-size: 26px; }
.community-dialog .modal-form { display: grid; gap: 16px; }
.community-dialog .modal-link { margin-top: 16px; }
.community-dialog.auth-dialog .modal-content { background: linear-gradient(145deg, #eaf4ff 0%, #f3fbfc 45%, #ffffff 100%); border-top: 6px solid #2563eb; }
.auth-dialog h2 { color: #183653; }
.auth-dialog .modal-form input { background: #ffffff; border: 1px solid #c7d7eb; }
.auth-dialog .modal-form input:focus { outline: 2px solid #2563eb; outline-offset: 2px; }
.community-dialog.auth-dialog .modal-link { border: 0; padding: 10px 0; background: transparent; color: #1d4ed8; font: inherit; font-weight: 600; cursor: pointer; }
.auth-dialog .modal-link:hover { text-decoration: underline; }
.community-dialog textarea { resize: vertical; }
.community-status { color: var(--color-text-secondary); line-height: 1.5; overflow-wrap: anywhere; margin: 12px 0; }
.community-status:empty { display: none; }
.community-notice { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); width: max-content; max-width: calc(100vw - 32px); padding: 14px 20px; background: white; color: var(--color-text-primary); border: 1px solid var(--color-border); border-radius: 12px; box-shadow: var(--shadow-md); z-index: 2500; display: flex; gap: 16px; }
.community-dismiss { border: 0; background: transparent; font-size: 22px; cursor: pointer; }
.community-account { position: relative; min-width: 0; display: inline-flex; align-items: center; }
.community-account-menu { position: relative; }
.community-account-menu summary,
.community-account-chip { display: inline-flex; align-items: center; gap: 8px; height: 42px; min-height: 40px; max-height: 44px; padding: 4px 12px 4px 6px; background: #ffffff; border: 1px solid #dce3e5; border-radius: 9999px; color: #15343b; font-family: inherit; font-size: 14px; font-weight: 500; line-height: 1; letter-spacing: normal; text-transform: none; cursor: pointer; list-style: none; user-select: none; box-sizing: border-box; box-shadow: 0 1px 2px rgba(21, 52, 59, 0.04); transition: background-color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease; white-space: nowrap; outline: none; }
.community-account-menu summary::-webkit-details-marker { display: none; }
.community-account-menu summary:hover,
.community-account-chip:hover { background: #f8fbfb; border-color: #cbd5e1; color: #102a30; box-shadow: 0 2px 5px rgba(21, 52, 59, 0.08); transform: none; }
.community-account-menu[open] summary,
.community-account-menu[open] .community-account-chip { background: #f0f5f6; border-color: #b8c9cd; box-shadow: 0 2px 6px rgba(21, 52, 59, 0.1); }
.community-account-menu summary:focus-visible,
.community-account-chip:focus-visible { outline: 2px solid #1687b5; outline-offset: 2px; }
.community-account-name { color: #15343b; font-weight: 600; font-size: 14px; line-height: 1.2; white-space: nowrap; max-width: none; overflow: visible; text-overflow: clip; }
.community-avatar { width: 32px; height: 32px; flex: 0 0 32px; border-radius: 50%; display: inline-flex; justify-content: center; align-items: center; background: #e6eef0; color: #15343b; font-weight: 600; font-size: 13px; line-height: 1; overflow: hidden; box-sizing: border-box; border: 1px solid rgba(21, 52, 59, 0.08); }
.community-avatar img,
.community-account img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; display: block; }
.community-account-chevron { display: inline-flex; align-items: center; justify-content: center; width: 12px; height: 12px; color: #64748b; margin-left: -2px; margin-right: 2px; transition: transform 0.2s ease, color 0.15s ease; flex-shrink: 0; }
.community-account-menu summary:hover .community-account-chevron { color: #15343b; }
.community-account-menu[open] .community-account-chevron { transform: rotate(180deg); color: #15343b; }
.community-account-options { position: absolute; top: calc(100% + 8px); right: 0; min-width: 180px; display: grid; gap: 4px; padding: 10px; background: white; border: 1px solid #dce3e5; border-radius: 12px; box-shadow: 0 10px 28px rgba(21, 52, 59, 0.12), 0 2px 6px rgba(0, 0, 0, 0.04); z-index: 1100; animation: accountDropdownFade 0.15s ease-out; }
@keyframes accountDropdownFade { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: translateY(0); } }
.community-account-options button { text-align: left; min-height: 38px; padding: 8px 12px; border: none; background: transparent; border-radius: 8px; color: #15343b; font-size: 14px; font-weight: 500; cursor: pointer; display: flex; align-items: center; transition: background-color 0.15s ease, color 0.15s ease; width: 100%; }
.community-account-options button:hover { background: #f1f5f9; color: #0f172a; }
.community-account-options button:last-child { color: #b91c1c; border-top: 1px solid #f1f5f9; margin-top: 4px; padding-top: 10px; }
.community-account-options button:last-child:hover { background: #fef2f2; color: #991b1b; }
.community-feed-controls { display: flex; gap: 16px; padding: 16px 0; }
.community-comments { border-top: 1px solid var(--color-border); padding: 20px; }
.community-comments[hidden], .community-feed-controls [hidden] { display: none; }
.community-comment { padding: 12px 0; border-bottom: 1px solid var(--color-border); }
.community-comment .post-time { display: block; }
.saved-trip-card { padding: 24px; margin: 24px 0; border-radius: 16px; background: white; border: 1px solid #e2e8f0; }
.saved-trip-card h2 { overflow-wrap: anywhere; }
.saved-trip-text { white-space: pre-wrap; overflow-wrap: anywhere; padding-top: 16px; }
.saved-trip-card summary { cursor: pointer; padding: 12px 0; }
.saved-trip-card .community-feed-controls { flex-wrap: wrap; }
.saga-photo-preview { width: 100%; max-height: 220px; object-fit: contain; border-radius: 10px; }
.saga-photo-preview[hidden] { display: none; }
.saga-owner-menu { position: relative; margin-left: auto; align-self: flex-start; flex-shrink: 0; }
.saga-owner-menu summary { list-style: none; cursor: pointer; width: 44px; height: 44px; display: grid; place-items: center; font-size: 28px; color: #475569; border-radius: 50%; }
.saga-owner-menu summary::-webkit-details-marker { display: none; }
.saga-owner-menu summary:hover, .saga-owner-menu summary:focus-visible { background: #eaf0ff; }
.saga-owner-options { position: absolute; top: 44px; right: 0; z-index: 10; min-width: 150px; padding: 8px; display: grid; background: white; border: 1px solid #e2e8f0; border-radius: 10px; box-shadow: 0 4px 14px #0002; }
.saga-owner-options .action-btn { min-height: 44px; padding: 10px; text-align: left; }
.saga-owner-options .action-btn:last-child { color: #b91c1c; }
.community-comment-form { display: grid; gap: 12px; margin-top: 16px; }
.saga-card .saga-text { white-space: pre-wrap; overflow-wrap: anywhere; }
.saga-card .saga-title, .saga-card .user-name { overflow-wrap: anywhere; }
.saga-card > .community-status { padding: 0 20px; }
.saga-card .action-btn[aria-pressed="true"] { color: var(--color-primary); font-weight: 700; }
.saga-card button:disabled, .community-dialog button:disabled { opacity: .6; cursor: wait; }
/* Responsive Account Chip Rules */
@media(min-width: 1024px) and (max-width: 1199px) {
  .community-account-menu summary,
  .community-account-chip {
    padding: 4px 10px 4px 5px;
    gap: 6px;
  }
}

@media(min-width: 768px) and (max-width: 1023px) {
  .community-account-menu summary,
  .community-account-chip {
    padding: 4px 10px 4px 5px;
    gap: 6px;
  }
}

@media(max-width: 767px) {
  .main-social-container .saga-feed { grid-template-columns: minmax(0, 1fr); }
  .main-social-container .social-tabs { flex-wrap: wrap; }
  .main-social-container .section-header { flex-wrap: wrap; gap: 12px; }
  .community-account-menu summary,
  .community-account-chip {
    width: 40px;
    height: 40px;
    min-height: 40px;
    max-height: 40px;
    padding: 0;
    border-radius: 50%;
    justify-content: center;
    gap: 0;
  }
  .community-account-name,
  .community-account-chevron {
    display: none !important;
  }
  .community-avatar {
    width: 32px;
    height: 32px;
    margin: 0;
  }
}
