/* ——— Mobile-first compact layout ——— */

html {
  -webkit-text-size-adjust: 100%;
}

@media (max-width: 768px) {
  .navbar-modern {
    padding: 0.5rem 0;
  }

  .navbar-brand-modern {
    font-size: 1.1rem;
  }

  .user-menu-btn {
    padding: 0.35rem 0.5rem;
    font-size: 0.85rem;
  }

  .user-avatar {
    width: 28px;
    height: 28px;
    font-size: 0.85rem;
  }

  .main-container {
    padding: 0.75rem 0 1.5rem;
  }

  .container,
  .container-fluid {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
  }

  .sidebar-modern {
    padding: 1rem;
    border-radius: var(--radius-md);
    margin-bottom: 1rem;
  }

  .sidebar-header {
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
  }

  .sidebar-title,
  .section-title {
    font-size: 1rem;
  }

  .btn-add-task,
  .btn-manage-projects {
    padding: 0.65rem 1rem;
    font-size: 0.9rem;
  }

  .filters-section {
    gap: 0.75rem;
  }

  .filter-group {
    margin-bottom: 0.5rem;
  }

  .filter-label {
    font-size: 0.78rem;
    margin-bottom: 0.25rem;
  }

  .filter-select,
  .form-input-modern {
    font-size: 0.9rem;
    padding: 0.5rem 0.65rem;
  }

  .reminder-widget {
    padding: 0.85rem;
  }

  .reminder-subtitle {
    font-size: 0.78rem;
  }

  .reminder-push-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.65rem;
  }

  .reminder-push-label {
    font-size: 0.85rem;
  }

  .reminder-push-status {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.35rem;
    line-height: 1.35;
  }

  .tasks-section {
    padding: 0.85rem;
    border-radius: var(--radius-md);
  }

  .tasks-title {
    font-size: 1.15rem;
  }

  .tasks-count {
    font-size: 0.8rem;
    padding: 0.35rem 0.65rem;
  }

  /* Responsive task cards instead of wide table */
  .tasks-table-wrapper {
    border: none;
    overflow: visible;
  }

  .tasks-table {
    min-width: 0;
  }

  .tasks-table thead {
    display: none;
  }

  .tasks-table tbody tr {
    display: block;
    margin-bottom: 0.75rem;
    padding: 0.75rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
  }

  .tasks-table tbody tr:hover {
    background: var(--bg-card);
  }

  .tasks-table tbody td {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.4rem 0;
    border: none;
    font-size: 0.85rem;
  }

  .tasks-table tbody td::before {
    content: attr(data-label);
    font-weight: 600;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
    flex-shrink: 0;
    min-width: 5.5rem;
  }

  .tasks-table tbody td:last-child {
    justify-content: flex-end;
    padding-top: 0.5rem;
    border-top: 1px solid var(--border-color);
    margin-top: 0.25rem;
  }

  .tasks-table tbody td:last-child::before {
    display: none;
  }

  .task-title-cell {
    text-align: right;
    flex: 1;
  }

  .task-title-btn {
    font-size: 0.9rem;
  }

  .modal-dialog {
    margin: 0.5rem;
  }

  .modal-header-modern {
    padding: 1rem;
  }

  .modal-body-modern {
    padding: 1rem;
  }

  .modal-title-modern {
    font-size: 1.1rem;
  }

  .friends-page {
    padding: 0.5rem 0 1rem;
    height: calc(100dvh - 64px);
    max-height: calc(100dvh - 64px);
  }

  .friends-chat {
    min-height: 0;
  }

  .chat-messages {
    min-height: 0;
  }

  .profile-page {
    padding: 1rem 0 2rem;
  }

  .profile-grid {
    gap: 1rem;
  }

  .profile-card {
    padding: 1rem;
  }

  .profile-header h1 {
    font-size: 1.35rem;
  }

  .stats-page {
    padding: 1rem 0.75rem 2rem;
  }

  .stats-header h1 {
    font-size: 1.35rem;
  }

  .stat-chip {
    min-width: calc(50% - 0.5rem);
    padding: 0.75rem;
  }

  .stat-value {
    font-size: 1.35rem;
  }

  .notification-toast {
    left: 0.75rem;
    right: 0.75rem;
    bottom: 1rem;
  }

  .consent-bottom-fixed {
    padding: 0 0.5rem max(0.75rem, env(safe-area-inset-bottom));
  }

  .pwa-install-banner {
    bottom: max(0.75rem, env(safe-area-inset-bottom));
  }

  .calendar-section {
    padding: 0.85rem;
    border-radius: var(--radius-md);
  }

  .calendar-header {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
  }

  .calendar-title {
    font-size: 1.15rem;
  }

  .calendar-controls {
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.35rem;
  }

  .calendar-month-year {
    font-size: 0.95rem;
    min-width: 0;
  }

  .calendar-nav-btn,
  .calendar-today-btn {
    padding: 0.4rem 0.65rem;
    font-size: 0.85rem;
  }

  .calendar-day {
    min-height: 2.5rem;
    padding: 0.25rem;
    font-size: 0.75rem;
  }

  .calendar-day-number {
    font-size: 0.8rem;
  }

  .calendar-task-dot {
    width: 5px;
    height: 5px;
  }

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

  .gkeep-composer-actions {
    flex-direction: column;
  }

  .gkeep-composer-actions .btn-primary {
    width: 100%;
  }
}

@media (max-width: 480px) {
  .tasks-header {
    gap: 0.5rem;
  }

  .auth-container,
  .register-container {
    padding: 1rem 0.75rem;
    min-height: auto;
  }

  .auth-card,
  .register-card {
    padding: 1.25rem 1rem;
    border-radius: var(--radius-md);
  }

  .auth-title,
  .register-title {
    font-size: 1.35rem;
  }

  .auth-form .form-group,
  .register-form .form-group {
    margin-bottom: 0.85rem;
  }

  .project-overview-card {
    padding: 0.75rem;
  }

  .assignee-chip {
    font-size: 0.72rem;
    padding: 0.15rem 0.45rem;
  }

  .miro-topbar {
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 0.5rem;
  }

  .miro-topbar-right {
    width: 100%;
    justify-content: flex-end;
  }

  .consent-modal-center {
    max-width: calc(100vw - 1.5rem);
  }

  .consent-modal-bottom {
    max-width: calc(100vw - 1rem);
  }
}
